@dsh-agentic-roleplay/core 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/authoring.js +5 -3
- package/lib/client.js +1964 -473
- package/lib/client.js.map +1 -1
- package/lib/{deliver-CpZOxBX5.js → deliver-Cl6bjp7g.js} +3 -2
- package/lib/doctor.js +3 -3
- package/lib/{gallery-CtFDL22W.js → gallery-DIEgETzU.js} +2 -2
- package/lib/generator-DJ48HxPI.js +145 -0
- package/lib/{hooks-KTCR3fNJ.js → hooks-DdO_tNhu.js} +3 -3
- package/lib/images.js +4 -3
- package/lib/index.js +522 -51
- package/lib/language-BgyxtB2h.js +38 -0
- package/lib/{generator-B6FxlKOV.js → library-9JB9zw5a.js} +2 -143
- package/lib/{language-DWVwi1R7.js → load-Clkl0T7C.js} +6 -40
- package/lib/orchestration.js +22 -14
- package/lib/pack-jail-ClMpVc__.js +1979 -0
- package/lib/{packs-BYjrAen6.js → packs-BC2A3geF.js} +3 -29
- package/lib/{presenter-agent-CiEVKcjJ.js → presenter-agent-DnNEG_Mn.js} +4 -3
- package/lib/{pack-jail-CybSNzxr.js → preset-ClQm7KPQ.js} +22 -2048
- package/lib/preset-author-tools-Dibp-LY9.js +270 -0
- package/lib/preset-authoring.js +53 -0
- package/lib/presets-DNjNxQL5.js +335 -0
- package/lib/{reflection-waxFg1x-.js → reflection-Bju_LPFn.js} +130 -8
- package/package.json +3 -2
- package/prompts/en/preset/persona.md +1 -0
- package/prompts/en/preset/procedure.md +1 -0
- package/prompts/en/preset/welcome.md +1 -0
- package/prompts/zh/preset/persona.md +1 -0
- package/prompts/zh/preset/procedure.md +1 -0
- package/prompts/zh/preset/welcome.md +1 -0
package/lib/client.js
CHANGED
|
@@ -26,16 +26,16 @@ window.__ModuleLoader__.load({
|
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
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
|
|
29
|
-
const css$
|
|
30
|
-
const key$
|
|
31
|
-
let tag$
|
|
32
|
-
if (tag$
|
|
33
|
-
tag$
|
|
34
|
-
tag$
|
|
35
|
-
tag$
|
|
36
|
-
document.head.appendChild(tag$
|
|
37
|
-
}
|
|
38
|
-
tag$
|
|
29
|
+
const css$29 = ".rp_Poldga_tabs{scrollbar-width:none;gap:24px;margin-bottom:-1px;display:flex;overflow-x:auto}.rp_Poldga_tabs::-webkit-scrollbar{display:none}.rp_Poldga_tab{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:0;margin:0;padding:8px 0;font-size:13px;line-height:20px;box-shadow:inset 0 -2px #0000}.rp_Poldga_tab:hover{color:var(--dsw-alias-label-primary)}.rp_Poldga_tab[aria-selected=true]{color:var(--dsw-alias-state-business-primary);font-weight:500;box-shadow:inset 0 -2px}.rp_Poldga_tab:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px;border-radius:var(--dsw-radius-xs)}";
|
|
30
|
+
const key$29 = "src/client/panel/PageTabs.module.css";
|
|
31
|
+
let tag$29 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$29) + "]");
|
|
32
|
+
if (tag$29 === null) {
|
|
33
|
+
tag$29 = document.createElement("style");
|
|
34
|
+
tag$29.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
35
|
+
tag$29.dataset.pluginCss = key$29;
|
|
36
|
+
document.head.appendChild(tag$29);
|
|
37
|
+
}
|
|
38
|
+
tag$29.textContent = css$29;
|
|
39
39
|
var PageTabs_module_css_default = {
|
|
40
40
|
"tabs": "rp_Poldga_tabs",
|
|
41
41
|
"tab": "rp_Poldga_tab"
|
|
@@ -82,21 +82,21 @@ window.__ModuleLoader__.load({
|
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
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
|
|
85
|
-
const css$
|
|
86
|
-
const key$
|
|
87
|
-
let tag$
|
|
88
|
-
if (tag$
|
|
89
|
-
tag$
|
|
90
|
-
tag$
|
|
91
|
-
tag$
|
|
92
|
-
document.head.appendChild(tag$
|
|
85
|
+
const css$28 = ".rp_ua5gBa_panel{min-height:0;color:var(--dsw-alias-label-primary);flex-direction:column;flex:1 1 0;display:flex}.rp_ua5gBa_header{border-bottom:.5px solid var(--dsw-alias-border-l2);flex:none;padding:12px 24px 0}.rp_ua5gBa_title{margin:0 0 4px;font-size:14px;font-weight:500;line-height:22px}.rp_ua5gBa_body{flex-direction:column;flex:1 1 0;min-height:0;padding:12px 24px 16px;display:flex}@media (width<=640px){.rp_ua5gBa_header,.rp_ua5gBa_body{padding-inline:16px}}";
|
|
86
|
+
const key$28 = "src/client/panel/RoleplayPanel.module.css";
|
|
87
|
+
let tag$28 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$28) + "]");
|
|
88
|
+
if (tag$28 === null) {
|
|
89
|
+
tag$28 = document.createElement("style");
|
|
90
|
+
tag$28.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
91
|
+
tag$28.dataset.pluginCss = key$28;
|
|
92
|
+
document.head.appendChild(tag$28);
|
|
93
93
|
}
|
|
94
|
-
tag$
|
|
94
|
+
tag$28.textContent = css$28;
|
|
95
95
|
var RoleplayPanel_module_css_default = {
|
|
96
|
-
"panel": "rp_ua5gBa_panel",
|
|
97
|
-
"title": "rp_ua5gBa_title",
|
|
98
96
|
"body": "rp_ua5gBa_body",
|
|
99
|
-
"header": "rp_ua5gBa_header"
|
|
97
|
+
"header": "rp_ua5gBa_header",
|
|
98
|
+
"panel": "rp_ua5gBa_panel",
|
|
99
|
+
"title": "rp_ua5gBa_title"
|
|
100
100
|
};
|
|
101
101
|
//#endregion
|
|
102
102
|
//#region src/client/panel/RoleplayPanel.tsx
|
|
@@ -143,7 +143,7 @@ window.__ModuleLoader__.load({
|
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region src/client/panel/locales.ts
|
|
146
|
-
const dictionaries$
|
|
146
|
+
const dictionaries$17 = {
|
|
147
147
|
en: {
|
|
148
148
|
label: "Role Play",
|
|
149
149
|
heading: "DSH Agentic Role Play",
|
|
@@ -200,11 +200,11 @@ window.__ModuleLoader__.load({
|
|
|
200
200
|
}
|
|
201
201
|
//#endregion
|
|
202
202
|
//#region src/client/panel/index.ts
|
|
203
|
-
const NAMESPACE$
|
|
203
|
+
const NAMESPACE$12 = "roleplay.panel";
|
|
204
204
|
/** Adds the Role Play entry to the sidebar and the main panel it opens. */
|
|
205
205
|
function registerPanel(ctx) {
|
|
206
|
-
const t = ctx.locale.bind(NAMESPACE$
|
|
207
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$
|
|
206
|
+
const t = ctx.locale.bind(NAMESPACE$12);
|
|
207
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$12, dictionaries$17), "roleplay: panel dictionaries");
|
|
208
208
|
const pages = createPagesSource(ctx);
|
|
209
209
|
ctx.effect(() => pages.start(), "roleplay: page list");
|
|
210
210
|
const handle = createPanelStore();
|
|
@@ -216,7 +216,7 @@ window.__ModuleLoader__.load({
|
|
|
216
216
|
ctx.slots.inject("main", () => ctx.slots.register({
|
|
217
217
|
name: "main",
|
|
218
218
|
key: PANEL_ID,
|
|
219
|
-
locale: NAMESPACE$
|
|
219
|
+
locale: NAMESPACE$12,
|
|
220
220
|
store,
|
|
221
221
|
inject: () => ({ hooks: { pages: pages.store } }),
|
|
222
222
|
children: { "roleplay.page": {
|
|
@@ -229,7 +229,7 @@ window.__ModuleLoader__.load({
|
|
|
229
229
|
id: PANEL_ID,
|
|
230
230
|
order: 5,
|
|
231
231
|
label: () => t("label"),
|
|
232
|
-
locale: NAMESPACE$
|
|
232
|
+
locale: NAMESPACE$12
|
|
233
233
|
}, PanelIcon));
|
|
234
234
|
}
|
|
235
235
|
//#endregion
|
|
@@ -311,13 +311,21 @@ window.__ModuleLoader__.load({
|
|
|
311
311
|
body: JSON.stringify(request)
|
|
312
312
|
}));
|
|
313
313
|
}
|
|
314
|
+
async function convertPreset(request) {
|
|
315
|
+
return await answer$3(await fetch(`${API_PREFIX}/catalogue/convert/preset`, {
|
|
316
|
+
method: "POST",
|
|
317
|
+
credentials: "same-origin",
|
|
318
|
+
headers: { "content-type": "application/json" },
|
|
319
|
+
body: JSON.stringify(request)
|
|
320
|
+
}));
|
|
321
|
+
}
|
|
314
322
|
/** The address a catalogue serves a release's archive from. */
|
|
315
323
|
function downloadUrl(baseUrl, versionId) {
|
|
316
324
|
return `${baseUrl.trim().replace(/\/+$/, "")}/versions/${encodeURIComponent(versionId)}/download`;
|
|
317
325
|
}
|
|
318
326
|
//#endregion
|
|
319
327
|
//#region src/client/pages/catalogue/catalogue-controller.ts
|
|
320
|
-
const messageOf$
|
|
328
|
+
const messageOf$8 = (error) => error instanceof Error ? error.message : String(error);
|
|
321
329
|
/** The configured catalogues as the host sees them, read again whenever the settings change. */
|
|
322
330
|
var CatalogueController = class {
|
|
323
331
|
openChat;
|
|
@@ -358,7 +366,7 @@ window.__ModuleLoader__.load({
|
|
|
358
366
|
} catch (error) {
|
|
359
367
|
if (this.abort.signal.aborted) return;
|
|
360
368
|
this.store.update((draft) => {
|
|
361
|
-
draft.error = messageOf$
|
|
369
|
+
draft.error = messageOf$8(error);
|
|
362
370
|
if (draft.status === "loading") draft.status = "failed";
|
|
363
371
|
});
|
|
364
372
|
}
|
|
@@ -369,49 +377,49 @@ window.__ModuleLoader__.load({
|
|
|
369
377
|
};
|
|
370
378
|
//#endregion
|
|
371
379
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/catalogue/CataloguePage.module.css.mjs
|
|
372
|
-
const css$
|
|
373
|
-
const key$
|
|
374
|
-
let tag$
|
|
375
|
-
if (tag$
|
|
376
|
-
tag$
|
|
377
|
-
tag$
|
|
378
|
-
tag$
|
|
379
|
-
document.head.appendChild(tag$
|
|
380
|
+
const css$27 = ".rp_qK1u-G_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_qK1u-G_toolbar{flex-wrap:wrap;flex:none;align-items:center;gap:8px;min-height:32px;display:flex}.rp_qK1u-G_spacer{flex:auto}.rp_qK1u-G_select,.rp_qK1u-G_search{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);height:32px;font:inherit;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);padding:0 8px;font-size:12px}.rp_qK1u-G_search{min-width:200px}.rp_qK1u-G_select:focus-visible,.rp_qK1u-G_search:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}.rp_qK1u-G_status{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}.rp_qK1u-G_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_qK1u-G_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_qK1u-G_grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_qK1u-G_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);min-width:0;font:inherit;text-align:left;color:inherit;background:var(--dsw-alias-settings-card-fill);cursor:pointer;flex-direction:column;padding:0;transition:border-color .12s;display:flex;overflow:hidden}.rp_qK1u-G_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_qK1u-G_card:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_qK1u-G_cover{aspect-ratio:4/3;background:var(--dsw-alias-bg-layer-3)}.rp_qK1u-G_image{object-fit:cover;width:100%;height:100%;display:block}.rp_qK1u-G_placeholder{color:#ffffffd9;background:linear-gradient(145deg, hsl(var(--rp-hue) 38% 46%), hsl(calc(var(--rp-hue) + 35) 38% 32%));user-select:none;justify-content:center;align-items:center;width:100%;height:100%;font-size:36px;font-weight:500;display:flex}.rp_qK1u-G_body{flex-direction:column;gap:4px;padding:8px 10px 10px;display:flex}.rp_qK1u-G_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_qK1u-G_meta{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_qK1u-G_tags{flex-wrap:wrap;gap:4px;display:flex}.rp_qK1u-G_more{justify-content:center;padding:12px 0;display:flex}.rp_qK1u-G_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 24px;font-size:13px}.rp_qK1u-G_form{flex-direction:column;gap:8px;display:flex}.rp_qK1u-G_field{flex-direction:column;gap:4px;display:flex}.rp_qK1u-G_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_qK1u-G_detail{flex-direction:column;gap:8px;font-size:13px;display:flex}.rp_qK1u-G_description{white-space:pre-wrap;max-height:240px;color:var(--dsw-alias-label-secondary);margin:0;overflow-y:auto}.rp_qK1u-G_success{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_qK1u-G_kinds{border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;gap:16px;display:flex}.rp_qK1u-G_kind{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;margin-bottom:-1px;padding:4px 0 6px;font-size:13px}.rp_qK1u-G_kind[aria-selected=true]{border-bottom-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary);font-weight:500}.rp_qK1u-G_kind:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.rp_qK1u-G_updates{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;flex:none;align-items:center;gap:4px 8px;margin:0;padding:0;font-size:12px;list-style:none;display:flex}.rp_qK1u-G_update{border:.5px solid var(--dsw-alias-state-business-primary);border-radius:var(--dsw-radius-sm);font:inherit;color:var(--dsw-alias-state-business-primary);cursor:pointer;background:0 0;padding:2px 8px}.rp_qK1u-G_warning{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);flex-direction:column;gap:8px;padding:8px 12px;font-size:12px;display:flex}.rp_qK1u-G_warning p{margin:0}.rp_qK1u-G_changes{font-family:var(--dsw-font-mono,monospace);color:var(--dsw-alias-label-tertiary);margin:0;padding-left:16px;font-size:11px}.rp_qK1u-G_actions{flex-wrap:wrap;gap:8px;display:flex}";
|
|
381
|
+
const key$27 = "src/client/pages/catalogue/CataloguePage.module.css";
|
|
382
|
+
let tag$27 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$27) + "]");
|
|
383
|
+
if (tag$27 === null) {
|
|
384
|
+
tag$27 = document.createElement("style");
|
|
385
|
+
tag$27.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
386
|
+
tag$27.dataset.pluginCss = key$27;
|
|
387
|
+
document.head.appendChild(tag$27);
|
|
380
388
|
}
|
|
381
|
-
tag$
|
|
389
|
+
tag$27.textContent = css$27;
|
|
382
390
|
var CataloguePage_module_css_default = {
|
|
383
|
-
"
|
|
384
|
-
"message": "rp_qK1u-G_message",
|
|
385
|
-
"actions": "rp_qK1u-G_actions",
|
|
386
|
-
"warning": "rp_qK1u-G_warning",
|
|
391
|
+
"success": "rp_qK1u-G_success",
|
|
387
392
|
"grid": "rp_qK1u-G_grid",
|
|
388
|
-
"toolbar": "rp_qK1u-G_toolbar",
|
|
389
|
-
"more": "rp_qK1u-G_more",
|
|
390
|
-
"card": "rp_qK1u-G_card",
|
|
391
393
|
"notice": "rp_qK1u-G_notice",
|
|
392
|
-
"
|
|
393
|
-
"
|
|
394
|
-
"
|
|
395
|
-
"
|
|
394
|
+
"spacer": "rp_qK1u-G_spacer",
|
|
395
|
+
"select": "rp_qK1u-G_select",
|
|
396
|
+
"placeholder": "rp_qK1u-G_placeholder",
|
|
397
|
+
"status": "rp_qK1u-G_status",
|
|
398
|
+
"name": "rp_qK1u-G_name",
|
|
396
399
|
"detail": "rp_qK1u-G_detail",
|
|
397
|
-
"
|
|
400
|
+
"description": "rp_qK1u-G_description",
|
|
401
|
+
"meta": "rp_qK1u-G_meta",
|
|
398
402
|
"image": "rp_qK1u-G_image",
|
|
399
|
-
"form": "rp_qK1u-G_form",
|
|
400
|
-
"updates": "rp_qK1u-G_updates",
|
|
401
|
-
"tags": "rp_qK1u-G_tags",
|
|
402
403
|
"field": "rp_qK1u-G_field",
|
|
403
|
-
"
|
|
404
|
-
"spacer": "rp_qK1u-G_spacer",
|
|
405
|
-
"status": "rp_qK1u-G_status",
|
|
404
|
+
"viewport": "rp_qK1u-G_viewport",
|
|
406
405
|
"changes": "rp_qK1u-G_changes",
|
|
406
|
+
"actions": "rp_qK1u-G_actions",
|
|
407
|
+
"toolbar": "rp_qK1u-G_toolbar",
|
|
407
408
|
"search": "rp_qK1u-G_search",
|
|
408
|
-
"cover": "rp_qK1u-G_cover",
|
|
409
|
-
"name": "rp_qK1u-G_name",
|
|
410
|
-
"placeholder": "rp_qK1u-G_placeholder",
|
|
411
|
-
"select": "rp_qK1u-G_select",
|
|
412
409
|
"body": "rp_qK1u-G_body",
|
|
413
|
-
"
|
|
414
|
-
"
|
|
410
|
+
"update": "rp_qK1u-G_update",
|
|
411
|
+
"form": "rp_qK1u-G_form",
|
|
412
|
+
"label": "rp_qK1u-G_label",
|
|
413
|
+
"more": "rp_qK1u-G_more",
|
|
414
|
+
"message": "rp_qK1u-G_message",
|
|
415
|
+
"cover": "rp_qK1u-G_cover",
|
|
416
|
+
"updates": "rp_qK1u-G_updates",
|
|
417
|
+
"kinds": "rp_qK1u-G_kinds",
|
|
418
|
+
"kind": "rp_qK1u-G_kind",
|
|
419
|
+
"page": "rp_qK1u-G_page",
|
|
420
|
+
"card": "rp_qK1u-G_card",
|
|
421
|
+
"warning": "rp_qK1u-G_warning",
|
|
422
|
+
"tags": "rp_qK1u-G_tags"
|
|
415
423
|
};
|
|
416
424
|
//#endregion
|
|
417
425
|
//#region src/client/pages/catalogue/ImportUrlDialog.tsx
|
|
@@ -485,7 +493,7 @@ window.__ModuleLoader__.load({
|
|
|
485
493
|
const date = new Date(iso);
|
|
486
494
|
return Number.isNaN(date.getTime()) ? iso : date.toLocaleDateString();
|
|
487
495
|
};
|
|
488
|
-
const messageOf$
|
|
496
|
+
const messageOf$7 = (problem) => problem instanceof Error ? problem.message : String(problem);
|
|
489
497
|
/** One entry of a catalogue: what it says about itself, its releases, and installing, updating or converting one of them. */
|
|
490
498
|
function WorldDialog({ t, source, id, name, kind, onClose, onChanged, openChat }) {
|
|
491
499
|
const [detail, setDetail] = (0, react.useState)();
|
|
@@ -502,7 +510,7 @@ window.__ModuleLoader__.load({
|
|
|
502
510
|
setDetail(loaded);
|
|
503
511
|
setVersionId(loaded.versions[0]?.id ?? "");
|
|
504
512
|
}, (problem) => {
|
|
505
|
-
if (!abort.signal.aborted) setError(messageOf$
|
|
513
|
+
if (!abort.signal.aborted) setError(messageOf$7(problem));
|
|
506
514
|
});
|
|
507
515
|
return () => {
|
|
508
516
|
abort.abort();
|
|
@@ -539,7 +547,7 @@ window.__ModuleLoader__.load({
|
|
|
539
547
|
}, (problem) => {
|
|
540
548
|
setBusy(void 0);
|
|
541
549
|
if (problem instanceof InstallConflict && problem.reason !== "exists") setConflict(problem);
|
|
542
|
-
else setFailure(t("installFailed", { message: messageOf$
|
|
550
|
+
else setFailure(t("installFailed", { message: messageOf$7(problem) }));
|
|
543
551
|
});
|
|
544
552
|
};
|
|
545
553
|
const runConvert = () => {
|
|
@@ -557,7 +565,7 @@ window.__ModuleLoader__.load({
|
|
|
557
565
|
openChat(result.chatSessionId);
|
|
558
566
|
onClose();
|
|
559
567
|
} catch (problem) {
|
|
560
|
-
setFailure(t("convertFailed", { message: messageOf$
|
|
568
|
+
setFailure(t("convertFailed", { message: messageOf$7(problem) }));
|
|
561
569
|
}
|
|
562
570
|
else setStarted({
|
|
563
571
|
...result,
|
|
@@ -565,11 +573,38 @@ window.__ModuleLoader__.load({
|
|
|
565
573
|
});
|
|
566
574
|
}, (problem) => {
|
|
567
575
|
setBusy(void 0);
|
|
568
|
-
setFailure(t("convertFailed", { message: messageOf$
|
|
576
|
+
setFailure(t("convertFailed", { message: messageOf$7(problem) }));
|
|
577
|
+
});
|
|
578
|
+
};
|
|
579
|
+
const runPreset = () => {
|
|
580
|
+
if (version === void 0) return;
|
|
581
|
+
setBusy("preset");
|
|
582
|
+
setFailure(void 0);
|
|
583
|
+
convertPreset({
|
|
584
|
+
source: source.name,
|
|
585
|
+
versionId: version.id,
|
|
586
|
+
title: detail?.name ?? name,
|
|
587
|
+
language: t("language")
|
|
588
|
+
}).then((result) => {
|
|
589
|
+
setBusy(void 0);
|
|
590
|
+
try {
|
|
591
|
+
openChat(result.chatSessionId);
|
|
592
|
+
onClose();
|
|
593
|
+
} catch (problem) {
|
|
594
|
+
setFailure(t("importPresetFailed", { message: messageOf$7(problem) }));
|
|
595
|
+
}
|
|
596
|
+
}, (problem) => {
|
|
597
|
+
setBusy(void 0);
|
|
598
|
+
setFailure(t("importPresetFailed", { message: messageOf$7(problem) }));
|
|
569
599
|
});
|
|
570
600
|
};
|
|
571
601
|
const idle = busy === void 0 && done === void 0 && started === void 0 && conflict === void 0;
|
|
572
|
-
const primary = kind === "
|
|
602
|
+
const primary = kind === "preset" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
603
|
+
variant: "primary",
|
|
604
|
+
disabled: !idle || version === void 0,
|
|
605
|
+
onClick: runPreset,
|
|
606
|
+
children: busy === "preset" ? t("importingPreset") : t("importPresetAction")
|
|
607
|
+
}) : kind === "card" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
573
608
|
variant: "primary",
|
|
574
609
|
disabled: !idle || version === void 0,
|
|
575
610
|
onClick: runConvert,
|
|
@@ -665,6 +700,10 @@ window.__ModuleLoader__.load({
|
|
|
665
700
|
className: CataloguePage_module_css_default.success,
|
|
666
701
|
children: t("convertNote")
|
|
667
702
|
}),
|
|
703
|
+
kind === "preset" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
704
|
+
className: CataloguePage_module_css_default.success,
|
|
705
|
+
children: t("importPresetNote")
|
|
706
|
+
}),
|
|
668
707
|
kind === "card" && detail.converted !== void 0 && detail.converted.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
669
708
|
className: CataloguePage_module_css_default.success,
|
|
670
709
|
children: t("convertedBefore", { names: detail.converted.map((world) => world.name).join(", ") })
|
|
@@ -740,7 +779,7 @@ window.__ModuleLoader__.load({
|
|
|
740
779
|
openChat(started.chatSessionId);
|
|
741
780
|
onClose();
|
|
742
781
|
} catch (problem) {
|
|
743
|
-
setFailure(t("convertFailed", { message: messageOf$
|
|
782
|
+
setFailure(t("convertFailed", { message: messageOf$7(problem) }));
|
|
744
783
|
}
|
|
745
784
|
},
|
|
746
785
|
children: t("openChat")
|
|
@@ -897,7 +936,7 @@ window.__ModuleLoader__.load({
|
|
|
897
936
|
className: CataloguePage_module_css_default.search,
|
|
898
937
|
type: "search",
|
|
899
938
|
value: search,
|
|
900
|
-
placeholder: kind === "card" ? t("searchCardsPlaceholder") : t("searchPlaceholder"),
|
|
939
|
+
placeholder: kind === "card" ? t("searchCardsPlaceholder") : kind === "preset" ? t("searchPresetsPlaceholder") : t("searchPlaceholder"),
|
|
901
940
|
"aria-label": t("search"),
|
|
902
941
|
disabled: source === void 0,
|
|
903
942
|
onChange: (event) => {
|
|
@@ -946,7 +985,11 @@ window.__ModuleLoader__.load({
|
|
|
946
985
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
947
986
|
className: CataloguePage_module_css_default.kinds,
|
|
948
987
|
role: "tablist",
|
|
949
|
-
children: [
|
|
988
|
+
children: [
|
|
989
|
+
"world",
|
|
990
|
+
"card",
|
|
991
|
+
"preset"
|
|
992
|
+
].map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
950
993
|
type: "button",
|
|
951
994
|
role: "tab",
|
|
952
995
|
className: CataloguePage_module_css_default.kind,
|
|
@@ -956,7 +999,7 @@ window.__ModuleLoader__.load({
|
|
|
956
999
|
setKind(entry);
|
|
957
1000
|
setPage(void 0);
|
|
958
1001
|
},
|
|
959
|
-
children: entry === "world" ? t("kindWorlds") : t("kindCards")
|
|
1002
|
+
children: entry === "world" ? t("kindWorlds") : entry === "card" ? t("kindCards") : t("kindPresets")
|
|
960
1003
|
}, entry))
|
|
961
1004
|
}),
|
|
962
1005
|
source !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -1035,7 +1078,7 @@ window.__ModuleLoader__.load({
|
|
|
1035
1078
|
children: t("loading")
|
|
1036
1079
|
}) : page.items.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1037
1080
|
className: CataloguePage_module_css_default.message,
|
|
1038
|
-
children: applied === "" ? kind === "card" ? t("emptyCards") : t("empty") : t("emptySearch", { search: applied })
|
|
1081
|
+
children: applied === "" ? kind === "card" ? t("emptyCards") : kind === "preset" ? t("emptyPresets") : t("empty") : t("emptySearch", { search: applied })
|
|
1039
1082
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
1040
1083
|
className: CataloguePage_module_css_default.grid,
|
|
1041
1084
|
children: page.items.map((world) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -1127,7 +1170,7 @@ window.__ModuleLoader__.load({
|
|
|
1127
1170
|
}
|
|
1128
1171
|
//#endregion
|
|
1129
1172
|
//#region src/client/pages/catalogue/locales.ts
|
|
1130
|
-
const dictionaries$
|
|
1173
|
+
const dictionaries$16 = {
|
|
1131
1174
|
en: {
|
|
1132
1175
|
nav: "Catalogue",
|
|
1133
1176
|
loading: "Loading worlds…",
|
|
@@ -1176,6 +1219,13 @@ window.__ModuleLoader__.load({
|
|
|
1176
1219
|
kindCards: "Character cards",
|
|
1177
1220
|
searchCardsPlaceholder: "Search character cards",
|
|
1178
1221
|
emptyCards: "This catalogue has no published character cards for you.",
|
|
1222
|
+
kindPresets: "Presets",
|
|
1223
|
+
searchPresetsPlaceholder: "Search SillyTavern presets",
|
|
1224
|
+
emptyPresets: "This catalogue has no published presets for you.",
|
|
1225
|
+
importPresetAction: "Import as a preset",
|
|
1226
|
+
importingPreset: "Importing…",
|
|
1227
|
+
importPresetNote: "A SillyTavern preset is turned into a new preset in your library by the authoring assistant, which keeps only what is about how to narrate (not rules, formats or scripts). Importing it again makes another preset.",
|
|
1228
|
+
importPresetFailed: "Could not import the preset: {message}",
|
|
1179
1229
|
update: "Update",
|
|
1180
1230
|
updating: "Updating…",
|
|
1181
1231
|
updated: "Updated \"{name}\" to release {version}.",
|
|
@@ -1252,6 +1302,13 @@ window.__ModuleLoader__.load({
|
|
|
1252
1302
|
kindCards: "角色卡",
|
|
1253
1303
|
searchCardsPlaceholder: "搜索角色卡",
|
|
1254
1304
|
emptyCards: "这个目录里没有对你开放的已发布角色卡。",
|
|
1305
|
+
kindPresets: "预设",
|
|
1306
|
+
searchPresetsPlaceholder: "搜索酒馆预设",
|
|
1307
|
+
emptyPresets: "这个目录里没有对你开放的已发布预设。",
|
|
1308
|
+
importPresetAction: "导入为预设",
|
|
1309
|
+
importingPreset: "正在导入…",
|
|
1310
|
+
importPresetNote: "酒馆预设由创作助手转换为你的库中的一个新预设,只保留关于叙述方式的部分(不含规则、格式或脚本)。再次导入会生成另一个预设。",
|
|
1311
|
+
importPresetFailed: "无法导入预设:{message}",
|
|
1255
1312
|
update: "更新",
|
|
1256
1313
|
updating: "更新中…",
|
|
1257
1314
|
updated: "已将“{name}”更新到版本 {version}。",
|
|
@@ -1283,11 +1340,11 @@ window.__ModuleLoader__.load({
|
|
|
1283
1340
|
};
|
|
1284
1341
|
//#endregion
|
|
1285
1342
|
//#region src/client/pages/catalogue/index.ts
|
|
1286
|
-
const NAMESPACE$
|
|
1343
|
+
const NAMESPACE$11 = "roleplay.catalogue";
|
|
1287
1344
|
/** Adds the Catalogue page to the Role Play panel: worlds of the catalogues set up in the settings. */
|
|
1288
1345
|
function registerCataloguePage(ctx) {
|
|
1289
|
-
const t = ctx.locale.bind(NAMESPACE$
|
|
1290
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$
|
|
1346
|
+
const t = ctx.locale.bind(NAMESPACE$11);
|
|
1347
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$11, dictionaries$16), "roleplay: catalogue dictionaries");
|
|
1291
1348
|
const catalogue = new CatalogueController(createChatOpener(ctx));
|
|
1292
1349
|
ctx.effect(() => () => {
|
|
1293
1350
|
catalogue.dispose();
|
|
@@ -1300,7 +1357,7 @@ window.__ModuleLoader__.load({
|
|
|
1300
1357
|
id: "catalogue",
|
|
1301
1358
|
order: 3,
|
|
1302
1359
|
label: () => t("nav"),
|
|
1303
|
-
locale: NAMESPACE$
|
|
1360
|
+
locale: NAMESPACE$11,
|
|
1304
1361
|
inject: () => catalogue.inject()
|
|
1305
1362
|
}, CataloguePage));
|
|
1306
1363
|
}
|
|
@@ -1362,7 +1419,7 @@ window.__ModuleLoader__.load({
|
|
|
1362
1419
|
}
|
|
1363
1420
|
//#endregion
|
|
1364
1421
|
//#region src/client/pages/avatars/avatars-controller.ts
|
|
1365
|
-
const messageOf$
|
|
1422
|
+
const messageOf$6 = (error) => error instanceof Error ? error.message : String(error);
|
|
1366
1423
|
/** Reads the player avatars from the host and makes and removes them. */
|
|
1367
1424
|
var AvatarsController = class {
|
|
1368
1425
|
store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
|
|
@@ -1409,7 +1466,7 @@ window.__ModuleLoader__.load({
|
|
|
1409
1466
|
} catch (error) {
|
|
1410
1467
|
if (this.abort.signal.aborted) return;
|
|
1411
1468
|
this.store.update((draft) => {
|
|
1412
|
-
draft.error = messageOf$
|
|
1469
|
+
draft.error = messageOf$6(error);
|
|
1413
1470
|
if (draft.avatars === void 0) draft.status = "failed";
|
|
1414
1471
|
});
|
|
1415
1472
|
} finally {
|
|
@@ -1817,51 +1874,51 @@ window.__ModuleLoader__.load({
|
|
|
1817
1874
|
const isDirty = (character, draft) => Object.keys(editOf$1(character, draft)).length > 0;
|
|
1818
1875
|
//#endregion
|
|
1819
1876
|
//#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
|
|
1820
|
-
const css$
|
|
1821
|
-
const key$
|
|
1822
|
-
let tag$
|
|
1823
|
-
if (tag$
|
|
1824
|
-
tag$
|
|
1825
|
-
tag$
|
|
1826
|
-
tag$
|
|
1827
|
-
document.head.appendChild(tag$
|
|
1877
|
+
const css$26 = ".rp_5ZMIxq_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_5ZMIxq_tabs{border-bottom:.5px solid var(--dsw-alias-border-l2);flex:none;gap:4px;padding:0 24px;display:flex;overflow-x:auto}.rp_5ZMIxq_tab{font:inherit;white-space:nowrap;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;flex:none;margin-bottom:-1px;padding:12px 10px 10px;font-size:13px;line-height:20px}.rp_5ZMIxq_tabOn{color:var(--dsw-alias-state-business-primary);border-bottom-color:var(--dsw-alias-state-business-primary);font-weight:500}.rp_5ZMIxq_body{flex:1 1 0;min-height:0;overflow-y:auto}.rp_5ZMIxq_sheet{box-sizing:border-box;flex-direction:column;gap:20px;max-width:760px;padding:24px 24px 240px;display:flex}.rp_5ZMIxq_head{align-items:flex-start;gap:20px;display:flex}.rp_5ZMIxq_portrait{aspect-ratio:3/4;object-fit:cover;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);width:150px;height:auto;display:block}.rp_5ZMIxq_portraitBox{border-radius:var(--dsw-radius-lg);width:150px;height:200px;color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;flex:0 0 150px;padding:0;display:block;position:relative}.rp_5ZMIxq_portraitBox:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.rp_5ZMIxq_portraitBox:disabled{cursor:not-allowed}.rp_5ZMIxq_portraitAction{box-sizing:border-box;border-radius:0 0 var(--dsw-radius-lg) var(--dsw-radius-lg);color:#fff;text-align:center;opacity:0;background:#0000009e;padding:7px 6px;font-size:12px;line-height:16px;transition:opacity .12s;position:absolute;bottom:1px;left:1px;right:1px}.rp_5ZMIxq_portraitBox:hover .rp_5ZMIxq_portraitAction,.rp_5ZMIxq_portraitBox:focus-visible .rp_5ZMIxq_portraitAction,.rp_5ZMIxq_portraitBox:disabled .rp_5ZMIxq_portraitAction{opacity:1}.rp_5ZMIxq_portraitError,.rp_5ZMIxq_portraitHint{margin:12px 24px 0;font-size:12px}.rp_5ZMIxq_portraitError{color:var(--dsw-alias-state-danger-primary)}.rp_5ZMIxq_portraitHint{color:var(--dsw-alias-label-secondary)}.rp_5ZMIxq_placeholder{box-sizing:border-box;color:var(--dsw-alias-label-secondary);flex-direction:column;justify-content:center;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_initial{opacity:.6;font-size:48px;font-weight:500;line-height:1}.rp_5ZMIxq_missing{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5ZMIxq_meta{flex-direction:column;flex:1 1 0;gap:10px;min-width:0;display:flex}.rp_5ZMIxq_section{border-top:.5px solid var(--dsw-alias-border-l4);flex-direction:column;gap:6px;padding-top:16px;display:flex}.rp_5ZMIxq_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:500;line-height:20px}.rp_5ZMIxq_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 24px;font-size:13px}.rp_5ZMIxq_section .rp_5ZMIxq_empty{padding:0}.rp_5ZMIxq_tabsSpace{flex:auto}.rp_5ZMIxq_voiceInline{min-width:220px;color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:12px;display:flex}.rp_5ZMIxq_bar{border-bottom:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-2);flex:none;justify-content:flex-end;align-items:center;gap:8px;padding:6px 24px;display:flex}.rp_5ZMIxq_barText{color:var(--dsw-alias-label-secondary);margin-right:auto;font-size:12px}.rp_5ZMIxq_nameInput{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:var(--dsw-alias-label-primary);font:inherit;padding:4px 8px;font-size:14px;line-height:22px}.rp_5ZMIxq_row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_grid{grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:10px 12px;display:grid}.rp_5ZMIxq_field{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_5ZMIxq_wide{grid-column:1/-1}.rp_5ZMIxq_label,.rp_5ZMIxq_help{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5ZMIxq_error{color:var(--dsw-alias-state-error-primary);font-size:12px}.rp_5ZMIxq_select{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:inherit;font:inherit;padding:4px 8px;font-size:13px}.rp_5ZMIxq_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:96px;color:inherit;font:inherit;resize:vertical;padding:6px 8px;font-size:13px;line-height:20px}.rp_5ZMIxq_goal{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);flex-direction:column;gap:8px;padding:10px;display:flex}.rp_5ZMIxq_row>.rp_5ZMIxq_select{width:auto;min-width:110px}.rp_5ZMIxq_select:focus-visible,.rp_5ZMIxq_area:focus-visible,.rp_5ZMIxq_nameInput:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}@media (width<=640px){.rp_5ZMIxq_sheet{padding-inline:16px}.rp_5ZMIxq_head{flex-direction:column}.rp_5ZMIxq_portraitBox,.rp_5ZMIxq_portrait{width:120px}.rp_5ZMIxq_portraitBox{flex-basis:120px;height:160px}.rp_5ZMIxq_bar{flex-wrap:wrap;padding-inline:16px}.rp_5ZMIxq_voiceInline{width:100%;min-width:0}}";
|
|
1878
|
+
const key$26 = "src/client/world-editor/CharactersPanel.module.css";
|
|
1879
|
+
let tag$26 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$26) + "]");
|
|
1880
|
+
if (tag$26 === null) {
|
|
1881
|
+
tag$26 = document.createElement("style");
|
|
1882
|
+
tag$26.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
1883
|
+
tag$26.dataset.pluginCss = key$26;
|
|
1884
|
+
document.head.appendChild(tag$26);
|
|
1828
1885
|
}
|
|
1829
|
-
tag$
|
|
1886
|
+
tag$26.textContent = css$26;
|
|
1830
1887
|
var CharactersPanel_module_css_default = {
|
|
1831
|
-
"tabsSpace": "rp_5ZMIxq_tabsSpace",
|
|
1832
|
-
"empty": "rp_5ZMIxq_empty",
|
|
1833
|
-
"sheet": "rp_5ZMIxq_sheet",
|
|
1834
|
-
"goal": "rp_5ZMIxq_goal",
|
|
1835
|
-
"sectionTitle": "rp_5ZMIxq_sectionTitle",
|
|
1836
|
-
"initial": "rp_5ZMIxq_initial",
|
|
1837
|
-
"placeholder": "rp_5ZMIxq_placeholder",
|
|
1838
|
-
"panel": "rp_5ZMIxq_panel",
|
|
1839
|
-
"grid": "rp_5ZMIxq_grid",
|
|
1840
1888
|
"body": "rp_5ZMIxq_body",
|
|
1841
|
-
"
|
|
1842
|
-
"
|
|
1889
|
+
"portraitAction": "rp_5ZMIxq_portraitAction",
|
|
1890
|
+
"tabs": "rp_5ZMIxq_tabs",
|
|
1843
1891
|
"tab": "rp_5ZMIxq_tab",
|
|
1844
1892
|
"section": "rp_5ZMIxq_section",
|
|
1893
|
+
"missing": "rp_5ZMIxq_missing",
|
|
1894
|
+
"sheet": "rp_5ZMIxq_sheet",
|
|
1895
|
+
"placeholder": "rp_5ZMIxq_placeholder",
|
|
1896
|
+
"goal": "rp_5ZMIxq_goal",
|
|
1897
|
+
"grid": "rp_5ZMIxq_grid",
|
|
1898
|
+
"panel": "rp_5ZMIxq_panel",
|
|
1845
1899
|
"head": "rp_5ZMIxq_head",
|
|
1846
|
-
"
|
|
1900
|
+
"nameInput": "rp_5ZMIxq_nameInput",
|
|
1901
|
+
"portrait": "rp_5ZMIxq_portrait",
|
|
1902
|
+
"portraitBox": "rp_5ZMIxq_portraitBox",
|
|
1903
|
+
"label": "rp_5ZMIxq_label",
|
|
1904
|
+
"tabsSpace": "rp_5ZMIxq_tabsSpace",
|
|
1847
1905
|
"error": "rp_5ZMIxq_error",
|
|
1906
|
+
"voiceInline": "rp_5ZMIxq_voiceInline",
|
|
1848
1907
|
"help": "rp_5ZMIxq_help",
|
|
1849
|
-
"missing": "rp_5ZMIxq_missing",
|
|
1850
|
-
"bar": "rp_5ZMIxq_bar",
|
|
1851
1908
|
"tabOn": "rp_5ZMIxq_tabOn",
|
|
1852
|
-
"row": "rp_5ZMIxq_row",
|
|
1853
|
-
"label": "rp_5ZMIxq_label",
|
|
1854
|
-
"select": "rp_5ZMIxq_select",
|
|
1855
|
-
"portraitAction": "rp_5ZMIxq_portraitAction",
|
|
1856
|
-
"portraitBox": "rp_5ZMIxq_portraitBox",
|
|
1857
1909
|
"meta": "rp_5ZMIxq_meta",
|
|
1858
|
-
"
|
|
1859
|
-
"
|
|
1860
|
-
"wide": "rp_5ZMIxq_wide",
|
|
1861
|
-
"tabs": "rp_5ZMIxq_tabs",
|
|
1862
|
-
"portrait": "rp_5ZMIxq_portrait",
|
|
1910
|
+
"empty": "rp_5ZMIxq_empty",
|
|
1911
|
+
"portraitError": "rp_5ZMIxq_portraitError",
|
|
1863
1912
|
"portraitHint": "rp_5ZMIxq_portraitHint",
|
|
1864
|
-
"
|
|
1913
|
+
"sectionTitle": "rp_5ZMIxq_sectionTitle",
|
|
1914
|
+
"select": "rp_5ZMIxq_select",
|
|
1915
|
+
"barText": "rp_5ZMIxq_barText",
|
|
1916
|
+
"bar": "rp_5ZMIxq_bar",
|
|
1917
|
+
"field": "rp_5ZMIxq_field",
|
|
1918
|
+
"area": "rp_5ZMIxq_area",
|
|
1919
|
+
"initial": "rp_5ZMIxq_initial",
|
|
1920
|
+
"row": "rp_5ZMIxq_row",
|
|
1921
|
+
"wide": "rp_5ZMIxq_wide"
|
|
1865
1922
|
};
|
|
1866
1923
|
//#endregion
|
|
1867
1924
|
//#region src/client/world-editor/EditorTabs.tsx
|
|
@@ -3574,48 +3631,48 @@ window.__ModuleLoader__.load({
|
|
|
3574
3631
|
}
|
|
3575
3632
|
//#endregion
|
|
3576
3633
|
//#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
|
|
3577
|
-
const css$
|
|
3578
|
-
const key$
|
|
3579
|
-
let tag$
|
|
3580
|
-
if (tag$
|
|
3581
|
-
tag$
|
|
3582
|
-
tag$
|
|
3583
|
-
tag$
|
|
3584
|
-
document.head.appendChild(tag$
|
|
3634
|
+
const css$25 = ".rp_7pEHTW_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex;position:relative}.rp_7pEHTW_toolbar{border-bottom:.5px solid var(--dsw-alias-border-l2);flex-wrap:wrap;align-items:center;gap:4px;padding:8px 16px;display:flex}.rp_7pEHTW_filter{border-radius:var(--dsw-radius-sm);min-height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:4px 10px}.rp_7pEHTW_filterOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2)}.rp_7pEHTW_filter:focus-visible,.rp_7pEHTW_edge:focus-visible,.rp_7pEHTW_graphEdge:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:-2px}.rp_7pEHTW_space{flex:1}.rp_7pEHTW_perspective{color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:12px;display:flex}.rp_7pEHTW_perspective select{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);max-width:180px;min-height:32px;color:inherit;padding:4px 8px}.rp_7pEHTW_workspace{flex:1 1 0;grid-template-columns:minmax(220px,34%) minmax(320px,1fr);min-height:0;display:grid}.rp_7pEHTW_list{border-right:.5px solid var(--dsw-alias-border-l3);overflow-y:auto}.rp_7pEHTW_edge{border:0;border-bottom:.5px solid var(--dsw-alias-border-l4);width:100%;min-height:48px;color:inherit;text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:8px 16px;display:flex}.rp_7pEHTW_edgeOn{background:var(--dsw-alias-bg-layer-2)}.rp_7pEHTW_edgeTitle{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.rp_7pEHTW_edgeKind{color:var(--dsw-alias-label-tertiary);font-size: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:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:inherit;font:inherit;padding:6px 8px}.rp_7pEHTW_form textarea{resize:vertical;min-height:96px}.rp_7pEHTW_form select:focus-visible,.rp_7pEHTW_form textarea:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}.rp_7pEHTW_wide{grid-column:1/-1}.rp_7pEHTW_metrics{grid-column:1/-1;grid-template-columns:repeat(4,minmax(90px,1fr));gap:10px;display:grid}.rp_7pEHTW_check{align-self:end;align-items:center;min-height:32px;flex-direction:row!important}.rp_7pEHTW_actions{border-top:.5px solid var(--dsw-alias-border-l4);flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;margin-top:28px;padding-top:12px;display:flex}.rp_7pEHTW_status{color:var(--dsw-alias-label-secondary);margin-right:auto}.rp_7pEHTW_error{color:var(--dsw-alias-state-error-primary);margin-right:auto}.rp_7pEHTW_graph{background:radial-gradient(circle, var(--dsw-alias-bg-layer-2), transparent 70%);flex:1 1 0;min-height:360px;position:relative;overflow:hidden}.rp_7pEHTW_graph svg{width:100%;height:100%;min-height:520px}.rp_7pEHTW_graphEdge{cursor:pointer;stroke:var(--dsw-alias-border-l1);stroke-width:2px}.rp_7pEHTW_graphEdge:hover,.rp_7pEHTW_graphEdgeOn{stroke:var(--dsw-alias-state-business-primary);stroke-width:4px}.rp_7pEHTW_node circle{fill:var(--dsw-alias-bg-layer-1);stroke:var(--dsw-alias-border-l1);stroke-width:2px}.rp_7pEHTW_node_character circle{fill:color-mix(in srgb, var(--dsw-alias-state-business-primary) 18%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_location circle{fill:color-mix(in srgb, #4a9 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_item circle{fill:color-mix(in srgb, #c90 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_faction circle{fill:color-mix(in srgb, #96c 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node text{fill:var(--dsw-alias-label-primary);pointer-events:none;font-size:11px}.rp_7pEHTW_graphInspector{box-sizing:border-box;border-radius:var(--dsw-radius-panel);background:var(--dsw-alias-bg-layer-1);width:min(480px,100% - 40px);max-height:62%;box-shadow:var(--dsw-elevation-panel);border:0;padding:18px;position:absolute;bottom:20px;right:20px;overflow-y:auto}@media (width<=760px){.rp_7pEHTW_workspace{grid-template-columns:1fr}.rp_7pEHTW_list{border-right:0;border-bottom:.5px solid var(--dsw-alias-border-l3);max-height:220px}.rp_7pEHTW_inspector{padding-inline:16px}.rp_7pEHTW_form{grid-template-columns:1fr}.rp_7pEHTW_wide,.rp_7pEHTW_metrics{grid-column:1}.rp_7pEHTW_metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.rp_7pEHTW_graphInspector{width:calc(100% - 24px);bottom:12px;right:12px}}@media (pointer:coarse){.rp_7pEHTW_filter{min-height:44px}}";
|
|
3635
|
+
const key$25 = "src/client/world-editor/RelationsPanel.module.css";
|
|
3636
|
+
let tag$25 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$25) + "]");
|
|
3637
|
+
if (tag$25 === null) {
|
|
3638
|
+
tag$25 = document.createElement("style");
|
|
3639
|
+
tag$25.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
3640
|
+
tag$25.dataset.pluginCss = key$25;
|
|
3641
|
+
document.head.appendChild(tag$25);
|
|
3585
3642
|
}
|
|
3586
|
-
tag$
|
|
3643
|
+
tag$25.textContent = css$25;
|
|
3587
3644
|
var RelationsPanel_module_css_default = {
|
|
3588
|
-
"
|
|
3589
|
-
"edge": "rp_7pEHTW_edge",
|
|
3590
|
-
"filter": "rp_7pEHTW_filter",
|
|
3591
|
-
"graphInspector": "rp_7pEHTW_graphInspector",
|
|
3645
|
+
"wide": "rp_7pEHTW_wide",
|
|
3592
3646
|
"space": "rp_7pEHTW_space",
|
|
3647
|
+
"notice": "rp_7pEHTW_notice",
|
|
3593
3648
|
"actions": "rp_7pEHTW_actions",
|
|
3594
|
-
"
|
|
3595
|
-
"edgeTitle": "rp_7pEHTW_edgeTitle",
|
|
3649
|
+
"node_faction": "rp_7pEHTW_node_faction",
|
|
3596
3650
|
"entities": "rp_7pEHTW_entities",
|
|
3597
|
-
"inspector": "rp_7pEHTW_inspector",
|
|
3598
3651
|
"filterOn": "rp_7pEHTW_filterOn",
|
|
3599
|
-
"
|
|
3600
|
-
"
|
|
3652
|
+
"toolbar": "rp_7pEHTW_toolbar",
|
|
3653
|
+
"head": "rp_7pEHTW_head",
|
|
3601
3654
|
"edgeOn": "rp_7pEHTW_edgeOn",
|
|
3602
|
-
"
|
|
3655
|
+
"edgeTitle": "rp_7pEHTW_edgeTitle",
|
|
3656
|
+
"form": "rp_7pEHTW_form",
|
|
3657
|
+
"node_location": "rp_7pEHTW_node_location",
|
|
3658
|
+
"graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
|
|
3659
|
+
"node_character": "rp_7pEHTW_node_character",
|
|
3660
|
+
"graphEdge": "rp_7pEHTW_graphEdge",
|
|
3661
|
+
"edge": "rp_7pEHTW_edge",
|
|
3603
3662
|
"perspective": "rp_7pEHTW_perspective",
|
|
3663
|
+
"list": "rp_7pEHTW_list",
|
|
3604
3664
|
"node": "rp_7pEHTW_node",
|
|
3665
|
+
"graphInspector": "rp_7pEHTW_graphInspector",
|
|
3666
|
+
"workspace": "rp_7pEHTW_workspace",
|
|
3605
3667
|
"edgeKind": "rp_7pEHTW_edgeKind",
|
|
3606
|
-
"
|
|
3668
|
+
"metrics": "rp_7pEHTW_metrics",
|
|
3669
|
+
"inspector": "rp_7pEHTW_inspector",
|
|
3670
|
+
"filter": "rp_7pEHTW_filter",
|
|
3671
|
+
"error": "rp_7pEHTW_error",
|
|
3672
|
+
"status": "rp_7pEHTW_status",
|
|
3607
3673
|
"empty": "rp_7pEHTW_empty",
|
|
3608
|
-
"form": "rp_7pEHTW_form",
|
|
3609
|
-
"node_faction": "rp_7pEHTW_node_faction",
|
|
3610
3674
|
"check": "rp_7pEHTW_check",
|
|
3611
|
-
"
|
|
3612
|
-
"node_character": "rp_7pEHTW_node_character",
|
|
3613
|
-
"head": "rp_7pEHTW_head",
|
|
3614
|
-
"status": "rp_7pEHTW_status",
|
|
3615
|
-
"wide": "rp_7pEHTW_wide",
|
|
3616
|
-
"node_location": "rp_7pEHTW_node_location",
|
|
3617
|
-
"metrics": "rp_7pEHTW_metrics",
|
|
3618
|
-
"graphEdge": "rp_7pEHTW_graphEdge",
|
|
3675
|
+
"node_item": "rp_7pEHTW_node_item",
|
|
3619
3676
|
"graph": "rp_7pEHTW_graph",
|
|
3620
3677
|
"panel": "rp_7pEHTW_panel"
|
|
3621
3678
|
};
|
|
@@ -4934,22 +4991,22 @@ window.__ModuleLoader__.load({
|
|
|
4934
4991
|
};
|
|
4935
4992
|
//#endregion
|
|
4936
4993
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/pack-frame/PackFrame.module.css.mjs
|
|
4937
|
-
const css$
|
|
4938
|
-
const key$
|
|
4939
|
-
let tag$
|
|
4940
|
-
if (tag$
|
|
4941
|
-
tag$
|
|
4942
|
-
tag$
|
|
4943
|
-
tag$
|
|
4944
|
-
document.head.appendChild(tag$
|
|
4994
|
+
const css$24 = ".rp_h_sbFq_frame{background:0 0;border:0;width:100%;display:block}.rp_h_sbFq_fill{height:100%;min-height:0}.rp_h_sbFq_message{color:var(--dsw-alias-label-secondary);margin:0;padding:16px 24px;font-size:13px;line-height:20px}.rp_h_sbFq_problems{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;padding-left:18px;font-size:12px}.rp_h_sbFq_hud{box-sizing:border-box;width:min(800px,100%);margin:0 auto 8px;padding:0 16px}.rp_h_sbFq_tab{flex-direction:column;flex:1 1 0;width:100%;min-height:0;display:flex}";
|
|
4995
|
+
const key$24 = "src/client/widgets/pack-frame/PackFrame.module.css";
|
|
4996
|
+
let tag$24 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$24) + "]");
|
|
4997
|
+
if (tag$24 === null) {
|
|
4998
|
+
tag$24 = document.createElement("style");
|
|
4999
|
+
tag$24.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
5000
|
+
tag$24.dataset.pluginCss = key$24;
|
|
5001
|
+
document.head.appendChild(tag$24);
|
|
4945
5002
|
}
|
|
4946
|
-
tag$
|
|
5003
|
+
tag$24.textContent = css$24;
|
|
4947
5004
|
var PackFrame_module_css_default = {
|
|
5005
|
+
"hud": "rp_h_sbFq_hud",
|
|
5006
|
+
"fill": "rp_h_sbFq_fill",
|
|
4948
5007
|
"frame": "rp_h_sbFq_frame",
|
|
4949
5008
|
"problems": "rp_h_sbFq_problems",
|
|
4950
|
-
"hud": "rp_h_sbFq_hud",
|
|
4951
5009
|
"tab": "rp_h_sbFq_tab",
|
|
4952
|
-
"fill": "rp_h_sbFq_fill",
|
|
4953
5010
|
"message": "rp_h_sbFq_message"
|
|
4954
5011
|
};
|
|
4955
5012
|
//#endregion
|
|
@@ -5202,24 +5259,24 @@ window.__ModuleLoader__.load({
|
|
|
5202
5259
|
const createPack = async (world, pack, name, signal) => (await read$2(await fetch(`${API_PREFIX}/worlds/interface/pack?${packQuery(world, pack)}`, init("POST", signal, { name })))).problems;
|
|
5203
5260
|
//#endregion
|
|
5204
5261
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/PacksPanel.module.css.mjs
|
|
5205
|
-
const css$
|
|
5206
|
-
const key$
|
|
5207
|
-
let tag$
|
|
5208
|
-
if (tag$
|
|
5209
|
-
tag$
|
|
5210
|
-
tag$
|
|
5211
|
-
tag$
|
|
5212
|
-
document.head.appendChild(tag$
|
|
5262
|
+
const css$23 = ".rp_FLaP7q_controls{flex-wrap:wrap;align-items:center;gap:8px 16px;margin:8px 0;display:flex}.rp_FLaP7q_group{color:var(--dsw-alias-label-tertiary);align-items:center;gap:4px;font-size:12px;display:inline-flex}.rp_FLaP7q_stage{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-base);max-width:100%;overflow:hidden}.rp_FLaP7q_stageTall{height:420px}.rp_FLaP7q_log{color:var(--dsw-alias-label-secondary);margin:4px 0 0;padding-left:16px;font-size:12px}.rp_FLaP7q_files{columns:2 220px;margin:4px 0 0;padding-left:16px;font-size:12px}.rp_FLaP7q_note{color:var(--dsw-alias-label-tertiary);font-size:12px}";
|
|
5263
|
+
const key$23 = "src/client/world-editor/PacksPanel.module.css";
|
|
5264
|
+
let tag$23 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$23) + "]");
|
|
5265
|
+
if (tag$23 === null) {
|
|
5266
|
+
tag$23 = document.createElement("style");
|
|
5267
|
+
tag$23.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
5268
|
+
tag$23.dataset.pluginCss = key$23;
|
|
5269
|
+
document.head.appendChild(tag$23);
|
|
5213
5270
|
}
|
|
5214
|
-
tag$
|
|
5271
|
+
tag$23.textContent = css$23;
|
|
5215
5272
|
var PacksPanel_module_css_default = {
|
|
5273
|
+
"stage": "rp_FLaP7q_stage",
|
|
5274
|
+
"controls": "rp_FLaP7q_controls",
|
|
5275
|
+
"log": "rp_FLaP7q_log",
|
|
5276
|
+
"files": "rp_FLaP7q_files",
|
|
5216
5277
|
"note": "rp_FLaP7q_note",
|
|
5217
|
-
"stageTall": "rp_FLaP7q_stageTall",
|
|
5218
5278
|
"group": "rp_FLaP7q_group",
|
|
5219
|
-
"
|
|
5220
|
-
"controls": "rp_FLaP7q_controls",
|
|
5221
|
-
"stage": "rp_FLaP7q_stage",
|
|
5222
|
-
"log": "rp_FLaP7q_log"
|
|
5279
|
+
"stageTall": "rp_FLaP7q_stageTall"
|
|
5223
5280
|
};
|
|
5224
5281
|
//#endregion
|
|
5225
5282
|
//#region src/client/world-editor/PacksPanel.tsx
|
|
@@ -6115,6 +6172,106 @@ window.__ModuleLoader__.load({
|
|
|
6115
6172
|
});
|
|
6116
6173
|
}
|
|
6117
6174
|
//#endregion
|
|
6175
|
+
//#region src/client/presets-api.ts
|
|
6176
|
+
async function reply(response) {
|
|
6177
|
+
if (!response.ok) {
|
|
6178
|
+
const body = await response.json().catch(() => void 0);
|
|
6179
|
+
throw new Error(typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim());
|
|
6180
|
+
}
|
|
6181
|
+
return await response.json();
|
|
6182
|
+
}
|
|
6183
|
+
const json = (method, body) => ({
|
|
6184
|
+
method,
|
|
6185
|
+
credentials: "same-origin",
|
|
6186
|
+
headers: { "content-type": "application/json" },
|
|
6187
|
+
body: JSON.stringify(body)
|
|
6188
|
+
});
|
|
6189
|
+
async function listPresets(signal) {
|
|
6190
|
+
return await reply(await fetch(`${API_PREFIX}/presets`, {
|
|
6191
|
+
credentials: "same-origin",
|
|
6192
|
+
signal
|
|
6193
|
+
}));
|
|
6194
|
+
}
|
|
6195
|
+
/** Makes a preset of the prose prompts a world carries. */
|
|
6196
|
+
async function savePresetFromWorld(request, signal) {
|
|
6197
|
+
return await reply(await fetch(`${API_PREFIX}/presets`, {
|
|
6198
|
+
...json("POST", request),
|
|
6199
|
+
signal
|
|
6200
|
+
}));
|
|
6201
|
+
}
|
|
6202
|
+
async function loadPresetStatus(session, signal) {
|
|
6203
|
+
return await reply(await fetch(`${API_PREFIX}/sessions/preset?id=${encodeURIComponent(session)}`, {
|
|
6204
|
+
credentials: "same-origin",
|
|
6205
|
+
signal
|
|
6206
|
+
}));
|
|
6207
|
+
}
|
|
6208
|
+
/** Puts a preset into the chat's story, or takes its preset out when no name is given. */
|
|
6209
|
+
async function applyPreset(session, name, signal) {
|
|
6210
|
+
return await reply(await fetch(`${API_PREFIX}/sessions/preset?id=${encodeURIComponent(session)}`, {
|
|
6211
|
+
...json("POST", name === void 0 ? {} : { name }),
|
|
6212
|
+
signal
|
|
6213
|
+
}));
|
|
6214
|
+
}
|
|
6215
|
+
const empty = async (response) => {
|
|
6216
|
+
if (!response.ok) await reply(response);
|
|
6217
|
+
};
|
|
6218
|
+
async function readPreset(name, signal) {
|
|
6219
|
+
return await reply(await fetch(`${API_PREFIX}/presets/item?name=${encodeURIComponent(name)}`, {
|
|
6220
|
+
credentials: "same-origin",
|
|
6221
|
+
signal
|
|
6222
|
+
}));
|
|
6223
|
+
}
|
|
6224
|
+
/** Makes a preset holding the shipped prose prompts, as a starting point to edit. */
|
|
6225
|
+
async function createPreset(request, signal) {
|
|
6226
|
+
return await reply(await fetch(`${API_PREFIX}/presets`, {
|
|
6227
|
+
...json("POST", request),
|
|
6228
|
+
signal
|
|
6229
|
+
}));
|
|
6230
|
+
}
|
|
6231
|
+
async function updatePresetInfo(name, change, signal) {
|
|
6232
|
+
return await reply(await fetch(`${API_PREFIX}/presets/item?name=${encodeURIComponent(name)}`, {
|
|
6233
|
+
...json("PUT", change),
|
|
6234
|
+
signal
|
|
6235
|
+
}));
|
|
6236
|
+
}
|
|
6237
|
+
async function writePresetPrompt(name, language, id, text, signal) {
|
|
6238
|
+
return await reply(await fetch(`${API_PREFIX}/presets/prompt?name=${encodeURIComponent(name)}&language=${encodeURIComponent(language)}&id=${encodeURIComponent(id)}`, {
|
|
6239
|
+
...json("PUT", { text }),
|
|
6240
|
+
signal
|
|
6241
|
+
}));
|
|
6242
|
+
}
|
|
6243
|
+
async function removePresetPrompt(name, language, id, signal) {
|
|
6244
|
+
return await reply(await fetch(`${API_PREFIX}/presets/prompt?name=${encodeURIComponent(name)}&language=${encodeURIComponent(language)}&id=${encodeURIComponent(id)}`, {
|
|
6245
|
+
method: "DELETE",
|
|
6246
|
+
credentials: "same-origin",
|
|
6247
|
+
signal
|
|
6248
|
+
}));
|
|
6249
|
+
}
|
|
6250
|
+
async function deletePreset(name, signal) {
|
|
6251
|
+
await empty(await fetch(`${API_PREFIX}/presets/item?name=${encodeURIComponent(name)}`, {
|
|
6252
|
+
method: "DELETE",
|
|
6253
|
+
credentials: "same-origin",
|
|
6254
|
+
signal
|
|
6255
|
+
}));
|
|
6256
|
+
}
|
|
6257
|
+
/** Opens the authoring chat of a preset. */
|
|
6258
|
+
async function authorPreset(name, language, signal) {
|
|
6259
|
+
return await reply(await fetch(`${API_PREFIX}/presets/authoring?name=${encodeURIComponent(name)}`, {
|
|
6260
|
+
...json("POST", { language }),
|
|
6261
|
+
signal
|
|
6262
|
+
}));
|
|
6263
|
+
}
|
|
6264
|
+
/** Sends a SillyTavern preset to a new library preset, whose authoring chat turns it into prompts. */
|
|
6265
|
+
async function importPreset(name, file, language, signal) {
|
|
6266
|
+
return await reply(await fetch(`${API_PREFIX}/presets/import?name=${encodeURIComponent(name)}&language=${encodeURIComponent(language)}`, {
|
|
6267
|
+
method: "POST",
|
|
6268
|
+
credentials: "same-origin",
|
|
6269
|
+
headers: { "content-type": "application/json" },
|
|
6270
|
+
body: file,
|
|
6271
|
+
signal
|
|
6272
|
+
}));
|
|
6273
|
+
}
|
|
6274
|
+
//#endregion
|
|
6118
6275
|
//#region src/client/world-editor/InfoPanel.tsx
|
|
6119
6276
|
const draftOf$3 = (info) => ({
|
|
6120
6277
|
name: info.name,
|
|
@@ -6127,6 +6284,7 @@ window.__ModuleLoader__.load({
|
|
|
6127
6284
|
timeZone: info.timeZone,
|
|
6128
6285
|
startingTime: info.startingTime,
|
|
6129
6286
|
version: info.version,
|
|
6287
|
+
preset: info.preset,
|
|
6130
6288
|
alternates: info.alternateOpenings
|
|
6131
6289
|
});
|
|
6132
6290
|
const lines = (value) => value.split("\n").map((line) => line.trim()).filter((line) => line !== "");
|
|
@@ -6142,7 +6300,8 @@ window.__ModuleLoader__.load({
|
|
|
6142
6300
|
"authorUrl",
|
|
6143
6301
|
"timeZone",
|
|
6144
6302
|
"startingTime",
|
|
6145
|
-
"version"
|
|
6303
|
+
"version",
|
|
6304
|
+
"preset"
|
|
6146
6305
|
]) if (draft[key].trim() !== saved[key].trim()) edit[key] = draft[key];
|
|
6147
6306
|
if (JSON.stringify(words(draft.tags)) !== JSON.stringify(words(saved.tags))) edit["tags"] = words(draft.tags);
|
|
6148
6307
|
if (JSON.stringify(lines(draft.rules)) !== JSON.stringify(lines(saved.rules))) edit["rules"] = lines(draft.rules);
|
|
@@ -6161,6 +6320,14 @@ window.__ModuleLoader__.load({
|
|
|
6161
6320
|
const [draft, setDraft] = (0, react.useState)();
|
|
6162
6321
|
const [status, setStatus] = (0, react.useState)({ state: "idle" });
|
|
6163
6322
|
const [playable, setPlayable] = (0, react.useState)([]);
|
|
6323
|
+
const [presets, setPresets] = (0, react.useState)([]);
|
|
6324
|
+
(0, react.useEffect)(() => {
|
|
6325
|
+
const abort = new AbortController();
|
|
6326
|
+
listPresets(abort.signal).then(setPresets, () => void 0);
|
|
6327
|
+
return () => {
|
|
6328
|
+
abort.abort();
|
|
6329
|
+
};
|
|
6330
|
+
}, []);
|
|
6164
6331
|
(0, react.useEffect)(() => {
|
|
6165
6332
|
const abort = new AbortController();
|
|
6166
6333
|
loadPlayable(worldId, abort.signal).then(setPlayable, () => void 0);
|
|
@@ -6418,7 +6585,43 @@ window.__ModuleLoader__.load({
|
|
|
6418
6585
|
field("version", "infoVersion", "infoVersionHelp", { placeholder: "1.0" }),
|
|
6419
6586
|
field("authorUrl", "infoAuthorUrl", void 0, { placeholder: "https://" }),
|
|
6420
6587
|
field("timeZone", "infoTimeZone", "infoTimeZoneHelp", { placeholder: "Europe/London" }),
|
|
6421
|
-
field("startingTime", "infoStartingTime", "infoStartingTimeHelp", { placeholder: "1912-04-14T23:40:00" })
|
|
6588
|
+
field("startingTime", "infoStartingTime", "infoStartingTimeHelp", { placeholder: "1912-04-14T23:40:00" }),
|
|
6589
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6590
|
+
className: CharactersPanel_module_css_default.field,
|
|
6591
|
+
children: [
|
|
6592
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6593
|
+
className: CharactersPanel_module_css_default.label,
|
|
6594
|
+
children: t("infoPreset")
|
|
6595
|
+
}),
|
|
6596
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
6597
|
+
className: CharactersPanel_module_css_default.select,
|
|
6598
|
+
value: draft.preset,
|
|
6599
|
+
"data-testid": "roleplay-world-preset",
|
|
6600
|
+
onChange: (event) => {
|
|
6601
|
+
set("preset", event.target.value);
|
|
6602
|
+
},
|
|
6603
|
+
children: [
|
|
6604
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6605
|
+
value: "",
|
|
6606
|
+
children: t("infoPresetNone")
|
|
6607
|
+
}),
|
|
6608
|
+
presets.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6609
|
+
value: entry.name,
|
|
6610
|
+
disabled: entry.problems.length > 0,
|
|
6611
|
+
children: entry.title
|
|
6612
|
+
}, entry.name)),
|
|
6613
|
+
draft.preset !== "" && !presets.some((entry) => entry.name === draft.preset) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6614
|
+
value: draft.preset,
|
|
6615
|
+
children: t("infoPresetMissing", { name: draft.preset })
|
|
6616
|
+
})
|
|
6617
|
+
]
|
|
6618
|
+
}),
|
|
6619
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6620
|
+
className: CharactersPanel_module_css_default.help,
|
|
6621
|
+
children: t("infoPresetHelp")
|
|
6622
|
+
})
|
|
6623
|
+
]
|
|
6624
|
+
})
|
|
6422
6625
|
]
|
|
6423
6626
|
})]
|
|
6424
6627
|
})
|
|
@@ -6430,7 +6633,7 @@ window.__ModuleLoader__.load({
|
|
|
6430
6633
|
}
|
|
6431
6634
|
//#endregion
|
|
6432
6635
|
//#region src/client/world-editor/PromptsPanel.tsx
|
|
6433
|
-
const messageOf$
|
|
6636
|
+
const messageOf$5 = (error) => error instanceof Error ? error.message : String(error);
|
|
6434
6637
|
/** The prompts the models are given: the world can carry its own version of each, which replaces the shipped one in the sessions it starts. */
|
|
6435
6638
|
function PromptsPanel({ t, worldId, language, actions }) {
|
|
6436
6639
|
const [tag, setTag] = (0, react.useState)(language);
|
|
@@ -6443,7 +6646,7 @@ window.__ModuleLoader__.load({
|
|
|
6443
6646
|
loadPrompts(worldId, tag, new AbortController().signal).then(setEntries, (failure) => {
|
|
6444
6647
|
setStatus({
|
|
6445
6648
|
state: "failed",
|
|
6446
|
-
message: messageOf$
|
|
6649
|
+
message: messageOf$5(failure)
|
|
6447
6650
|
});
|
|
6448
6651
|
});
|
|
6449
6652
|
}, [worldId, tag]);
|
|
@@ -6463,7 +6666,7 @@ window.__ModuleLoader__.load({
|
|
|
6463
6666
|
}, (failure) => {
|
|
6464
6667
|
if (!abort.signal.aborted) setStatus({
|
|
6465
6668
|
state: "failed",
|
|
6466
|
-
message: messageOf$
|
|
6669
|
+
message: messageOf$5(failure)
|
|
6467
6670
|
});
|
|
6468
6671
|
});
|
|
6469
6672
|
return () => {
|
|
@@ -6474,6 +6677,26 @@ window.__ModuleLoader__.load({
|
|
|
6474
6677
|
tag,
|
|
6475
6678
|
open
|
|
6476
6679
|
]);
|
|
6680
|
+
const [presetName, setPresetName] = (0, react.useState)("");
|
|
6681
|
+
const [made, setMade] = (0, react.useState)();
|
|
6682
|
+
const makePreset = () => {
|
|
6683
|
+
const name = presetName.trim();
|
|
6684
|
+
savePresetFromWorld({
|
|
6685
|
+
name,
|
|
6686
|
+
fromWorld: worldId
|
|
6687
|
+
}, new AbortController().signal).then(() => {
|
|
6688
|
+
setMade({
|
|
6689
|
+
state: "made",
|
|
6690
|
+
message: t("presetMade", { name })
|
|
6691
|
+
});
|
|
6692
|
+
setPresetName("");
|
|
6693
|
+
}, (failure) => {
|
|
6694
|
+
setMade({
|
|
6695
|
+
state: "failed",
|
|
6696
|
+
message: t("presetSaveFailed", { message: messageOf$5(failure) })
|
|
6697
|
+
});
|
|
6698
|
+
});
|
|
6699
|
+
};
|
|
6477
6700
|
const dirty = prompt !== void 0 && draft !== prompt.text;
|
|
6478
6701
|
const write = (action, done) => {
|
|
6479
6702
|
setStatus({ state: "saving" });
|
|
@@ -6484,7 +6707,7 @@ window.__ModuleLoader__.load({
|
|
|
6484
6707
|
}, (failure) => {
|
|
6485
6708
|
setStatus({
|
|
6486
6709
|
state: "failed",
|
|
6487
|
-
message: messageOf$
|
|
6710
|
+
message: messageOf$5(failure)
|
|
6488
6711
|
});
|
|
6489
6712
|
});
|
|
6490
6713
|
};
|
|
@@ -6540,6 +6763,33 @@ window.__ModuleLoader__.load({
|
|
|
6540
6763
|
" ",
|
|
6541
6764
|
entry.carried && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: t("promptCarried") })
|
|
6542
6765
|
] }, entry.id)) }),
|
|
6766
|
+
(entries ?? []).some((entry) => entry.kind === "prose" && entry.carried) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6767
|
+
className: CharactersPanel_module_css_default.row,
|
|
6768
|
+
children: [
|
|
6769
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6770
|
+
className: CharactersPanel_module_css_default.select,
|
|
6771
|
+
value: presetName,
|
|
6772
|
+
placeholder: t("presetName"),
|
|
6773
|
+
"aria-label": t("presetName"),
|
|
6774
|
+
onChange: (event) => {
|
|
6775
|
+
setPresetName(event.target.value);
|
|
6776
|
+
setMade(void 0);
|
|
6777
|
+
}
|
|
6778
|
+
}),
|
|
6779
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6780
|
+
variant: "ghost",
|
|
6781
|
+
size: "sm",
|
|
6782
|
+
disabled: presetName.trim() === "",
|
|
6783
|
+
onClick: makePreset,
|
|
6784
|
+
children: t("presetMake")
|
|
6785
|
+
}),
|
|
6786
|
+
made !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6787
|
+
className: made.state === "failed" ? CharactersPanel_module_css_default.error : CharactersPanel_module_css_default.barText,
|
|
6788
|
+
role: made.state === "failed" ? "alert" : "status",
|
|
6789
|
+
children: made.message
|
|
6790
|
+
})
|
|
6791
|
+
]
|
|
6792
|
+
}),
|
|
6543
6793
|
prompt !== void 0 && open !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
6544
6794
|
className: CharactersPanel_module_css_default.section,
|
|
6545
6795
|
children: [
|
|
@@ -7298,28 +7548,28 @@ window.__ModuleLoader__.load({
|
|
|
7298
7548
|
}
|
|
7299
7549
|
//#endregion
|
|
7300
7550
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/tool-switches/ToolSwitches.module.css.mjs
|
|
7301
|
-
const css$
|
|
7302
|
-
const key$
|
|
7303
|
-
let tag$
|
|
7304
|
-
if (tag$
|
|
7305
|
-
tag$
|
|
7306
|
-
tag$
|
|
7307
|
-
tag$
|
|
7308
|
-
document.head.appendChild(tag$
|
|
7551
|
+
const css$22 = ".rp_CjoFLq_root{flex-direction:column;gap:12px;display:flex}.rp_CjoFLq_title{margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_CjoFLq_help{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_CjoFLq_agent{border-top:1px solid var(--dsw-alias-border-l3);flex-direction:column;gap:6px;padding:8px 0;display:flex}.rp_CjoFLq_agentName{font-size:14px;font-weight:500}.rp_CjoFLq_hint{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_CjoFLq_tool{cursor:pointer;align-items:flex-start;gap:8px;font-size:13px;display:flex}.rp_CjoFLq_tool input{margin-top:3px}.rp_CjoFLq_toolText{flex-direction:column;display:flex}.rp_CjoFLq_default{color:var(--dsw-alias-label-tertiary);margin-left:6px;font-size:11px}.rp_CjoFLq_error{color:var(--dsw-alias-state-error-primary,#d33);font-size:12px}.rp_CjoFLq_external{flex-direction:column;gap:6px;margin-top:4px;display:flex}.rp_CjoFLq_external>summary{cursor:pointer}";
|
|
7552
|
+
const key$22 = "src/client/widgets/tool-switches/ToolSwitches.module.css";
|
|
7553
|
+
let tag$22 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$22) + "]");
|
|
7554
|
+
if (tag$22 === null) {
|
|
7555
|
+
tag$22 = document.createElement("style");
|
|
7556
|
+
tag$22.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
7557
|
+
tag$22.dataset.pluginCss = key$22;
|
|
7558
|
+
document.head.appendChild(tag$22);
|
|
7309
7559
|
}
|
|
7310
|
-
tag$
|
|
7560
|
+
tag$22.textContent = css$22;
|
|
7311
7561
|
var ToolSwitches_module_css_default = {
|
|
7562
|
+
"agentName": "rp_CjoFLq_agentName",
|
|
7312
7563
|
"title": "rp_CjoFLq_title",
|
|
7313
|
-
"error": "rp_CjoFLq_error",
|
|
7314
7564
|
"toolText": "rp_CjoFLq_toolText",
|
|
7315
|
-
"
|
|
7316
|
-
"agent": "rp_CjoFLq_agent",
|
|
7565
|
+
"tool": "rp_CjoFLq_tool",
|
|
7317
7566
|
"root": "rp_CjoFLq_root",
|
|
7567
|
+
"agent": "rp_CjoFLq_agent",
|
|
7568
|
+
"default": "rp_CjoFLq_default",
|
|
7569
|
+
"help": "rp_CjoFLq_help",
|
|
7318
7570
|
"external": "rp_CjoFLq_external",
|
|
7319
|
-
"
|
|
7320
|
-
"
|
|
7321
|
-
"hint": "rp_CjoFLq_hint",
|
|
7322
|
-
"help": "rp_CjoFLq_help"
|
|
7571
|
+
"error": "rp_CjoFLq_error",
|
|
7572
|
+
"hint": "rp_CjoFLq_hint"
|
|
7323
7573
|
};
|
|
7324
7574
|
//#endregion
|
|
7325
7575
|
//#region src/client/widgets/tool-switches/ToolSwitches.tsx
|
|
@@ -8317,52 +8567,52 @@ window.__ModuleLoader__.load({
|
|
|
8317
8567
|
const imageUrl = (target, image) => `${route(target, "/file")}&path=${encodeURIComponent(image.path)}&v=${encodeURIComponent(image.createdAt)}`;
|
|
8318
8568
|
//#endregion
|
|
8319
8569
|
//#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
|
|
8320
|
-
const css$
|
|
8321
|
-
const key$
|
|
8322
|
-
let tag$
|
|
8323
|
-
if (tag$
|
|
8324
|
-
tag$
|
|
8325
|
-
tag$
|
|
8326
|
-
tag$
|
|
8327
|
-
document.head.appendChild(tag$
|
|
8570
|
+
const css$21 = ".rp_9pSHmG_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;padding:16px 24px;display:flex;overflow-y:auto}.rp_9pSHmG_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;display:flex}.rp_9pSHmG_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_9pSHmG_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_9pSHmG_select{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);height:32px;font:inherit;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);padding:0 8px;font-size:12px}.rp_9pSHmG_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 24px;font-size:13px}.rp_9pSHmG_grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_9pSHmG_cell{min-width:0}.rp_9pSHmG_thumb{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);width:100%;font:inherit;text-align:left;color:inherit;cursor:pointer;flex-direction:column;padding:0;display:flex;overflow:hidden}.rp_9pSHmG_open{cursor:zoom-in;background:0 0;border:0;padding:0;display:block}.rp_9pSHmG_thumb:hover{border-color:var(--dsw-alias-border-l4)}.rp_9pSHmG_image{aspect-ratio:1;object-fit:cover;background:var(--dsw-alias-bg-layer-3);width:100%;display:block}.rp_9pSHmG_caption{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-secondary);padding:6px 8px;font-size:12px;overflow:hidden}.rp_9pSHmG_detail{flex-direction:column;gap:12px;width:min(640px,100%);max-height:70vh;display:flex;overflow-y:auto}.rp_9pSHmG_large{border-radius:var(--dsw-radius-lg);object-fit:contain;max-width:100%;max-height:32vh;margin:0 auto;display:block}.rp_9pSHmG_facts{grid-template-columns:max-content 1fr;gap:6px 12px;margin:0;font-size:12px;line-height:18px;display:grid}.rp_9pSHmG_facts dt{color:var(--dsw-alias-label-tertiary)}.rp_9pSHmG_facts dd{min-width:0;color:var(--dsw-alias-label-primary);margin:0}.rp_9pSHmG_pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:160px;overflow-y:auto}.rp_9pSHmG_tags{flex-wrap:wrap;gap:4px;display:flex}.rp_9pSHmG_note{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_9pSHmG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_9pSHmG_status,.rp_9pSHmG_statusError{color:var(--dsw-alias-label-tertiary);padding:0 8px 6px;font-size: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:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}.rp_9pSHmG_editArea{resize:vertical;min-height:96px}.rp_9pSHmG_editArea:focus-visible,.rp_9pSHmG_editInput:focus-visible,.rp_9pSHmG_select:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}@media (width<=640px){.rp_9pSHmG_page{padding-inline:16px}.rp_9pSHmG_toolbar{align-items:flex-start}.rp_9pSHmG_grid{grid-template-columns:repeat(auto-fill,minmax(136px,1fr))}}";
|
|
8571
|
+
const key$21 = "src/client/widgets/gallery-view/GalleryView.module.css";
|
|
8572
|
+
let tag$21 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$21) + "]");
|
|
8573
|
+
if (tag$21 === null) {
|
|
8574
|
+
tag$21 = document.createElement("style");
|
|
8575
|
+
tag$21.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
8576
|
+
tag$21.dataset.pluginCss = key$21;
|
|
8577
|
+
document.head.appendChild(tag$21);
|
|
8328
8578
|
}
|
|
8329
|
-
tag$
|
|
8579
|
+
tag$21.textContent = css$21;
|
|
8330
8580
|
var GalleryView_module_css_default = {
|
|
8331
|
-
"note": "rp_9pSHmG_note",
|
|
8332
|
-
"editLabel": "rp_9pSHmG_editLabel",
|
|
8333
|
-
"toolbar": "rp_9pSHmG_toolbar",
|
|
8334
|
-
"image": "rp_9pSHmG_image",
|
|
8335
|
-
"status": "rp_9pSHmG_status",
|
|
8336
|
-
"cell": "rp_9pSHmG_cell",
|
|
8337
|
-
"count": "rp_9pSHmG_count",
|
|
8338
|
-
"edit": "rp_9pSHmG_edit",
|
|
8339
|
-
"large": "rp_9pSHmG_large",
|
|
8340
8581
|
"editField": "rp_9pSHmG_editField",
|
|
8341
|
-
"
|
|
8582
|
+
"editButton": "rp_9pSHmG_editButton",
|
|
8342
8583
|
"reusable": "rp_9pSHmG_reusable",
|
|
8343
|
-
"
|
|
8584
|
+
"pre": "rp_9pSHmG_pre",
|
|
8585
|
+
"editInput": "rp_9pSHmG_editInput",
|
|
8586
|
+
"count": "rp_9pSHmG_count",
|
|
8587
|
+
"tags": "rp_9pSHmG_tags",
|
|
8588
|
+
"caption": "rp_9pSHmG_caption",
|
|
8589
|
+
"note": "rp_9pSHmG_note",
|
|
8590
|
+
"status": "rp_9pSHmG_status",
|
|
8344
8591
|
"error": "rp_9pSHmG_error",
|
|
8345
|
-
"thumb": "rp_9pSHmG_thumb",
|
|
8346
|
-
"page": "rp_9pSHmG_page",
|
|
8347
8592
|
"grid": "rp_9pSHmG_grid",
|
|
8348
|
-
"
|
|
8593
|
+
"page": "rp_9pSHmG_page",
|
|
8594
|
+
"image": "rp_9pSHmG_image",
|
|
8595
|
+
"editHelp": "rp_9pSHmG_editHelp",
|
|
8596
|
+
"toolbar": "rp_9pSHmG_toolbar",
|
|
8597
|
+
"actions": "rp_9pSHmG_actions",
|
|
8349
8598
|
"message": "rp_9pSHmG_message",
|
|
8350
|
-
"
|
|
8351
|
-
"
|
|
8352
|
-
"
|
|
8599
|
+
"editLabel": "rp_9pSHmG_editLabel",
|
|
8600
|
+
"thumb": "rp_9pSHmG_thumb",
|
|
8601
|
+
"editArea": "rp_9pSHmG_editArea",
|
|
8602
|
+
"open": "rp_9pSHmG_open",
|
|
8353
8603
|
"facts": "rp_9pSHmG_facts",
|
|
8354
|
-
"editInput": "rp_9pSHmG_editInput",
|
|
8355
|
-
"detail": "rp_9pSHmG_detail",
|
|
8356
8604
|
"select": "rp_9pSHmG_select",
|
|
8357
|
-
"
|
|
8605
|
+
"cell": "rp_9pSHmG_cell",
|
|
8358
8606
|
"statusError": "rp_9pSHmG_statusError",
|
|
8359
|
-
"
|
|
8607
|
+
"detail": "rp_9pSHmG_detail",
|
|
8608
|
+
"edit": "rp_9pSHmG_edit",
|
|
8609
|
+
"large": "rp_9pSHmG_large"
|
|
8360
8610
|
};
|
|
8361
8611
|
//#endregion
|
|
8362
8612
|
//#region src/client/widgets/gallery-view/GalleryView.tsx
|
|
8363
8613
|
/** How often the list is read again while pictures are waiting to be described. */
|
|
8364
8614
|
const POLL_MS$2 = 3e3;
|
|
8365
|
-
const messageOf$
|
|
8615
|
+
const messageOf$4 = (error) => error instanceof Error ? error.message : String(error);
|
|
8366
8616
|
function EditDialog({ t, image, onSave, onClose }) {
|
|
8367
8617
|
const [description, setDescription] = (0, react.useState)(image.description ?? "");
|
|
8368
8618
|
const [tags, setTags] = (0, react.useState)(image.tags.join(", "));
|
|
@@ -8376,7 +8626,7 @@ window.__ModuleLoader__.load({
|
|
|
8376
8626
|
tags: tags.split(/[,,]/).map((tag) => tag.trim()).filter((tag) => tag !== "")
|
|
8377
8627
|
}).then(onClose, (failure) => {
|
|
8378
8628
|
setBusy(false);
|
|
8379
|
-
setError(messageOf$
|
|
8629
|
+
setError(messageOf$4(failure));
|
|
8380
8630
|
});
|
|
8381
8631
|
};
|
|
8382
8632
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
@@ -8463,7 +8713,7 @@ window.__ModuleLoader__.load({
|
|
|
8463
8713
|
if (!signal.aborted) {
|
|
8464
8714
|
setLoad({
|
|
8465
8715
|
status: "failed",
|
|
8466
|
-
message: messageOf$
|
|
8716
|
+
message: messageOf$4(failure)
|
|
8467
8717
|
});
|
|
8468
8718
|
setRefreshing(false);
|
|
8469
8719
|
}
|
|
@@ -8510,7 +8760,7 @@ window.__ModuleLoader__.load({
|
|
|
8510
8760
|
} catch (failure) {
|
|
8511
8761
|
setNotice(t("uploadFailed", {
|
|
8512
8762
|
name: file.name,
|
|
8513
|
-
message: messageOf$
|
|
8763
|
+
message: messageOf$4(failure)
|
|
8514
8764
|
}));
|
|
8515
8765
|
}
|
|
8516
8766
|
setUploading(false);
|
|
@@ -8527,7 +8777,7 @@ window.__ModuleLoader__.load({
|
|
|
8527
8777
|
};
|
|
8528
8778
|
const mark = (image, reusable) => {
|
|
8529
8779
|
updateImage(target, image.path, { reusable }, new AbortController().signal).then(replace, (failure) => {
|
|
8530
|
-
setNotice(t("updateFailed", { message: messageOf$
|
|
8780
|
+
setNotice(t("updateFailed", { message: messageOf$4(failure) }));
|
|
8531
8781
|
});
|
|
8532
8782
|
};
|
|
8533
8783
|
const { images, failures } = load.contents;
|
|
@@ -8686,24 +8936,24 @@ window.__ModuleLoader__.load({
|
|
|
8686
8936
|
}
|
|
8687
8937
|
//#endregion
|
|
8688
8938
|
//#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
|
|
8689
|
-
const css$
|
|
8690
|
-
const key$
|
|
8691
|
-
let tag$
|
|
8692
|
-
if (tag$
|
|
8693
|
-
tag$
|
|
8694
|
-
tag$
|
|
8695
|
-
tag$
|
|
8696
|
-
document.head.appendChild(tag$
|
|
8939
|
+
const css$20 = ".rp__swA3a_view{flex:1 1 0;width:100%;min-height:0;display:flex}.rp__swA3a_message{color:var(--dsw-alias-label-secondary);margin:0;padding:24px;font-size:13px}.rp__swA3a_warning{color:var(--dsw-alias-label-primary);border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-2);margin:0 0 12px;padding:8px 12px;font-size:13px}.rp__swA3a_drawer{box-sizing:border-box;border-right:.5px solid var(--dsw-alias-border-l3);flex-direction:column;flex:0 0 168px;gap:2px;padding:16px 8px;display:flex}.rp__swA3a_drawerItem{border-radius:var(--dsw-radius-md);width:100%;font:inherit;text-align:left;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:6px 12px;font-size:13px;line-height:20px;display:block}@media (width<=720px){.rp__swA3a_view{flex-direction:column}.rp__swA3a_drawer{border-right:0;border-bottom:.5px solid var(--dsw-alias-border-l3);flex-direction:row;flex:none;width:100%;padding:8px;overflow-x:auto}.rp__swA3a_drawerItem{white-space:nowrap;flex:none;width:auto}}.rp__swA3a_drawerItem:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.rp__swA3a_drawerItemOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2);font-weight:500}.rp__swA3a_content{flex-direction:column;flex:1 1 0;min-width:0;min-height:0;display:flex}";
|
|
8940
|
+
const key$20 = "src/client/world-editor/WorldEditor.module.css";
|
|
8941
|
+
let tag$20 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$20) + "]");
|
|
8942
|
+
if (tag$20 === null) {
|
|
8943
|
+
tag$20 = document.createElement("style");
|
|
8944
|
+
tag$20.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
8945
|
+
tag$20.dataset.pluginCss = key$20;
|
|
8946
|
+
document.head.appendChild(tag$20);
|
|
8697
8947
|
}
|
|
8698
|
-
tag$
|
|
8948
|
+
tag$20.textContent = css$20;
|
|
8699
8949
|
var WorldEditor_module_css_default = {
|
|
8700
8950
|
"message": "rp__swA3a_message",
|
|
8701
|
-
"view": "rp__swA3a_view",
|
|
8702
|
-
"drawerItem": "rp__swA3a_drawerItem",
|
|
8703
|
-
"warning": "rp__swA3a_warning",
|
|
8704
|
-
"drawer": "rp__swA3a_drawer",
|
|
8705
8951
|
"drawerItemOn": "rp__swA3a_drawerItemOn",
|
|
8706
|
-
"
|
|
8952
|
+
"drawer": "rp__swA3a_drawer",
|
|
8953
|
+
"warning": "rp__swA3a_warning",
|
|
8954
|
+
"drawerItem": "rp__swA3a_drawerItem",
|
|
8955
|
+
"content": "rp__swA3a_content",
|
|
8956
|
+
"view": "rp__swA3a_view"
|
|
8707
8957
|
};
|
|
8708
8958
|
//#endregion
|
|
8709
8959
|
//#region src/client/world-editor/WorldEditor.tsx
|
|
@@ -9088,38 +9338,38 @@ window.__ModuleLoader__.load({
|
|
|
9088
9338
|
}
|
|
9089
9339
|
//#endregion
|
|
9090
9340
|
//#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
|
|
9091
|
-
const css$
|
|
9092
|
-
const key$
|
|
9093
|
-
let tag$
|
|
9094
|
-
if (tag$
|
|
9095
|
-
tag$
|
|
9096
|
-
tag$
|
|
9097
|
-
tag$
|
|
9098
|
-
document.head.appendChild(tag$
|
|
9341
|
+
const css$19 = ".rp_pQOzEG_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_pQOzEG_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_pQOzEG_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_pQOzEG_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_pQOzEG_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_pQOzEG_grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_pQOzEG_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);align-items:center;gap:4px;min-width:0;padding-right:8px;display:flex}.rp_pQOzEG_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_pQOzEG_open{min-width:0;font:inherit;text-align:left;color:inherit;cursor:pointer;background:0 0;border:0;flex:auto;align-items:center;gap:12px;padding:10px 0 10px 10px;display:flex}.rp_pQOzEG_open:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_pQOzEG_portrait,.rp_pQOzEG_placeholder{border-radius:var(--dsw-radius-lg);object-fit:cover;flex:none;width:48px;height:48px}.rp_pQOzEG_placeholder{color:var(--dsw-alias-label-secondary);justify-content:center;align-items:center;font-size:20px;font-weight:500;display:flex}.rp_pQOzEG_text{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_pQOzEG_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_pQOzEG_summary{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.rp_pQOzEG_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_pQOzEG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_pQOzEG_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_pQOzEG_editTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_pQOzEG_editBody{flex:1 1 0;min-height:0;display:flex}.rp_pQOzEG_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_pQOzEG_field{flex-direction:column;gap:6px;min-width:0;display:flex}.rp_pQOzEG_label{color:var(--dsw-alias-label-secondary);font-size:12px}@media (width<=640px){.rp_pQOzEG_toolbar{align-items:flex-start}.rp_pQOzEG_count{padding-top:6px}.rp_pQOzEG_grid{grid-template-columns:1fr}.rp_pQOzEG_form{min-width:0}}";
|
|
9342
|
+
const key$19 = "src/client/pages/avatars/AvatarsPage.module.css";
|
|
9343
|
+
let tag$19 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$19) + "]");
|
|
9344
|
+
if (tag$19 === null) {
|
|
9345
|
+
tag$19 = document.createElement("style");
|
|
9346
|
+
tag$19.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
9347
|
+
tag$19.dataset.pluginCss = key$19;
|
|
9348
|
+
document.head.appendChild(tag$19);
|
|
9099
9349
|
}
|
|
9100
|
-
tag$
|
|
9350
|
+
tag$19.textContent = css$19;
|
|
9101
9351
|
var AvatarsPage_module_css_default = {
|
|
9102
|
-
"open": "rp_pQOzEG_open",
|
|
9103
|
-
"placeholder": "rp_pQOzEG_placeholder",
|
|
9104
|
-
"count": "rp_pQOzEG_count",
|
|
9105
|
-
"actions": "rp_pQOzEG_actions",
|
|
9106
|
-
"card": "rp_pQOzEG_card",
|
|
9107
|
-
"name": "rp_pQOzEG_name",
|
|
9108
|
-
"field": "rp_pQOzEG_field",
|
|
9109
|
-
"editHeader": "rp_pQOzEG_editHeader",
|
|
9110
|
-
"message": "rp_pQOzEG_message",
|
|
9111
|
-
"editTitle": "rp_pQOzEG_editTitle",
|
|
9112
|
-
"editBody": "rp_pQOzEG_editBody",
|
|
9113
|
-
"viewport": "rp_pQOzEG_viewport",
|
|
9114
9352
|
"form": "rp_pQOzEG_form",
|
|
9115
|
-
"
|
|
9353
|
+
"viewport": "rp_pQOzEG_viewport",
|
|
9116
9354
|
"label": "rp_pQOzEG_label",
|
|
9355
|
+
"card": "rp_pQOzEG_card",
|
|
9117
9356
|
"portrait": "rp_pQOzEG_portrait",
|
|
9118
|
-
"
|
|
9357
|
+
"editBody": "rp_pQOzEG_editBody",
|
|
9358
|
+
"toolbar": "rp_pQOzEG_toolbar",
|
|
9359
|
+
"page": "rp_pQOzEG_page",
|
|
9360
|
+
"placeholder": "rp_pQOzEG_placeholder",
|
|
9361
|
+
"field": "rp_pQOzEG_field",
|
|
9362
|
+
"name": "rp_pQOzEG_name",
|
|
9363
|
+
"open": "rp_pQOzEG_open",
|
|
9119
9364
|
"text": "rp_pQOzEG_text",
|
|
9120
|
-
"
|
|
9121
|
-
"
|
|
9122
|
-
"
|
|
9365
|
+
"count": "rp_pQOzEG_count",
|
|
9366
|
+
"message": "rp_pQOzEG_message",
|
|
9367
|
+
"editHeader": "rp_pQOzEG_editHeader",
|
|
9368
|
+
"grid": "rp_pQOzEG_grid",
|
|
9369
|
+
"editTitle": "rp_pQOzEG_editTitle",
|
|
9370
|
+
"summary": "rp_pQOzEG_summary",
|
|
9371
|
+
"actions": "rp_pQOzEG_actions",
|
|
9372
|
+
"error": "rp_pQOzEG_error"
|
|
9123
9373
|
};
|
|
9124
9374
|
//#endregion
|
|
9125
9375
|
//#region src/client/pages/avatars/AvatarsPage.tsx
|
|
@@ -9223,7 +9473,7 @@ window.__ModuleLoader__.load({
|
|
|
9223
9473
|
})
|
|
9224
9474
|
});
|
|
9225
9475
|
}
|
|
9226
|
-
function DeleteDialog({ t, avatar, remove, onClose }) {
|
|
9476
|
+
function DeleteDialog$1({ t, avatar, remove, onClose }) {
|
|
9227
9477
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
9228
9478
|
const [error, setError] = (0, react.useState)();
|
|
9229
9479
|
const confirm = () => {
|
|
@@ -9376,7 +9626,7 @@ window.__ModuleLoader__.load({
|
|
|
9376
9626
|
});
|
|
9377
9627
|
}
|
|
9378
9628
|
}),
|
|
9379
|
-
deleting !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeleteDialog, {
|
|
9629
|
+
deleting !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeleteDialog$1, {
|
|
9380
9630
|
t,
|
|
9381
9631
|
avatar: deleting,
|
|
9382
9632
|
remove,
|
|
@@ -9402,7 +9652,7 @@ window.__ModuleLoader__.load({
|
|
|
9402
9652
|
}
|
|
9403
9653
|
//#endregion
|
|
9404
9654
|
//#region src/client/widgets/tool-switches/locales.ts
|
|
9405
|
-
const dictionaries$
|
|
9655
|
+
const dictionaries$15 = {
|
|
9406
9656
|
en: {
|
|
9407
9657
|
sw_title: "Tools",
|
|
9408
9658
|
sw_help: "Which optional tools each kind of agent may use. A choice applies to every agent of that kind, not to one character. Tools this version does not know are left as they are and not shown.",
|
|
@@ -9478,7 +9728,7 @@ window.__ModuleLoader__.load({
|
|
|
9478
9728
|
};
|
|
9479
9729
|
//#endregion
|
|
9480
9730
|
//#region src/client/widgets/gallery-view/locales.ts
|
|
9481
|
-
const dictionaries$
|
|
9731
|
+
const dictionaries$14 = {
|
|
9482
9732
|
en: {
|
|
9483
9733
|
tab: "Gallery",
|
|
9484
9734
|
notRoleplay: "This chat is not a roleplay session, so it has no gallery.",
|
|
@@ -9556,7 +9806,7 @@ window.__ModuleLoader__.load({
|
|
|
9556
9806
|
cancel: "取消"
|
|
9557
9807
|
}
|
|
9558
9808
|
};
|
|
9559
|
-
const dictionaries$
|
|
9809
|
+
const dictionaries$10 = withDictionaries(withDictionaries(withDictionaries(withDictionaries(withDictionaries({
|
|
9560
9810
|
en: {
|
|
9561
9811
|
language: "en",
|
|
9562
9812
|
sectionInfo: "About",
|
|
@@ -9643,6 +9893,10 @@ window.__ModuleLoader__.load({
|
|
|
9643
9893
|
infoAlternateText: "Narration",
|
|
9644
9894
|
infoAlternateAdd: "Add an opening",
|
|
9645
9895
|
infoAlternateRemove: "Remove",
|
|
9896
|
+
infoPreset: "Suggested preset",
|
|
9897
|
+
infoPresetHelp: "The writing instructions from your library that a new story of this world starts with. The world's own prompts still come first, and the player can choose another when starting.",
|
|
9898
|
+
infoPresetNone: "None",
|
|
9899
|
+
infoPresetMissing: "{name} (not in the library)",
|
|
9646
9900
|
infoStory: "Author and time",
|
|
9647
9901
|
infoAuthor: "Author",
|
|
9648
9902
|
infoVersion: "Version",
|
|
@@ -9661,6 +9915,10 @@ window.__ModuleLoader__.load({
|
|
|
9661
9915
|
promptShippedText: "Showing the shipped text; saving makes it this world's own.",
|
|
9662
9916
|
promptRulesWarning: "This prompt holds the rules of the game and how the tools are used. Change it only when you know what the models are told; ${name} marks values the program fills in and must stay.",
|
|
9663
9917
|
promptRevert: "Use the shipped one",
|
|
9918
|
+
presetMake: "Save as preset",
|
|
9919
|
+
presetName: "Preset name",
|
|
9920
|
+
presetMade: "Saved as the preset \"{name}\". It is in the presets folder of your roleplay folder.",
|
|
9921
|
+
presetSaveFailed: "Could not make the preset: {message}",
|
|
9664
9922
|
tab: "World",
|
|
9665
9923
|
noPlayableWarning: "This world has no playable character, so a session cannot be started. Add one, or ask the authoring assistant to.",
|
|
9666
9924
|
editorLoading: "Loading the world…",
|
|
@@ -9924,6 +10182,10 @@ window.__ModuleLoader__.load({
|
|
|
9924
10182
|
infoAlternateText: "叙述",
|
|
9925
10183
|
infoAlternateAdd: "添加开场",
|
|
9926
10184
|
infoAlternateRemove: "移除",
|
|
10185
|
+
infoPreset: "建议的预设",
|
|
10186
|
+
infoPresetHelp: "新故事默认使用的、来自你的库中的写作指令。世界自带的提示词仍然优先;玩家开始时也可以另选。",
|
|
10187
|
+
infoPresetNone: "无",
|
|
10188
|
+
infoPresetMissing: "{name}(库中没有)",
|
|
9927
10189
|
infoStory: "作者与时间",
|
|
9928
10190
|
infoAuthor: "作者",
|
|
9929
10191
|
infoVersion: "版本",
|
|
@@ -9942,6 +10204,10 @@ window.__ModuleLoader__.load({
|
|
|
9942
10204
|
promptShippedText: "显示的是默认文本;保存后会成为本世界自己的版本。",
|
|
9943
10205
|
promptRulesWarning: "这条提示词包含游戏规则和工具的用法。只有在清楚模型被告知了什么时才修改;${name} 是程序填入的值,必须保留。",
|
|
9944
10206
|
promptRevert: "改用默认版本",
|
|
10207
|
+
presetMake: "保存为预设",
|
|
10208
|
+
presetName: "预设名称",
|
|
10209
|
+
presetMade: "已保存为预设“{name}”,位于角色扮演文件夹的 presets 文件夹中。",
|
|
10210
|
+
presetSaveFailed: "无法创建预设:{message}",
|
|
9945
10211
|
tab: "世界",
|
|
9946
10212
|
noPlayableWarning: "这个世界没有可扮演的角色,因此无法开始会话。请添加一个,或让创作助手添加。",
|
|
9947
10213
|
editorLoading: "正在载入世界…",
|
|
@@ -10119,7 +10385,7 @@ window.__ModuleLoader__.load({
|
|
|
10119
10385
|
relationCancel: "取消",
|
|
10120
10386
|
relationCreate: "创建"
|
|
10121
10387
|
}
|
|
10122
|
-
}, prefixed(dictionaries$
|
|
10388
|
+
}, prefixed(dictionaries$14, "gallery_")), prefixed({
|
|
10123
10389
|
en: {
|
|
10124
10390
|
title: "Triggers",
|
|
10125
10391
|
help: "What the world does by itself when something comes true. They are read from triggers.json; ask the authoring assistant to make or change them, or edit the file.",
|
|
@@ -10353,7 +10619,7 @@ window.__ModuleLoader__.load({
|
|
|
10353
10619
|
logOpen: "请求打开:{surface}",
|
|
10354
10620
|
noSurfaces: "这个界面包没有可预览的界面位置。"
|
|
10355
10621
|
}
|
|
10356
|
-
}, "pk_")), dictionaries$
|
|
10622
|
+
}, "pk_")), dictionaries$15), prefixed({
|
|
10357
10623
|
en: {
|
|
10358
10624
|
help: "How uncertain attempts are settled. The game master rolls one of these checks and is told which band the roll fell in, so no number is ever made up. Each check says when it is used, the dice it rolls and what each result means; the bands together should cover every value the dice can give.",
|
|
10359
10625
|
none: "This world has no checks. Its game master can still roll plain dice for things that have none.",
|
|
@@ -10427,79 +10693,1042 @@ window.__ModuleLoader__.load({
|
|
|
10427
10693
|
bandCritical: "关键"
|
|
10428
10694
|
}
|
|
10429
10695
|
}, "dice_"));
|
|
10430
|
-
const dictionaries$
|
|
10696
|
+
const dictionaries$9 = withDictionaries({
|
|
10697
|
+
en: {
|
|
10698
|
+
nav: "Avatars",
|
|
10699
|
+
avatarsLoading: "Loading avatars…",
|
|
10700
|
+
avatarsLoadFailed: "Could not load the avatars: {message}",
|
|
10701
|
+
avatarsEmpty: "No avatars yet. An avatar is a character you can play in any world: make one, then add it to a world or bring it into a new session.",
|
|
10702
|
+
avatarsCountOne: "{count} avatar",
|
|
10703
|
+
avatarsCountOther: "{count} avatars",
|
|
10704
|
+
avatarsRefresh: "Refresh",
|
|
10705
|
+
avatarsRefreshing: "Refreshing…",
|
|
10706
|
+
avatarsBack: "Back",
|
|
10707
|
+
avatarsCancel: "Cancel",
|
|
10708
|
+
avatarsClose: "Close",
|
|
10709
|
+
avatarsMissing: "This avatar is no longer there.",
|
|
10710
|
+
avatarCreate: "New avatar",
|
|
10711
|
+
avatarCreateTitle: "New avatar",
|
|
10712
|
+
avatarCreateHelp: "An avatar is a playable character that is not tied to a world. Give it a name; everything else can be written in the editor.",
|
|
10713
|
+
avatarName: "Name",
|
|
10714
|
+
avatarCreating: "Creating…",
|
|
10715
|
+
avatarCreateFailed: "Could not create the avatar: {message}",
|
|
10716
|
+
avatarDelete: "Delete",
|
|
10717
|
+
avatarDeleteTitle: "Delete avatar",
|
|
10718
|
+
avatarDeleteHelp: "Delete {name}? Worlds and sessions that already have it keep their own copy. The avatar is moved to the trash folder.",
|
|
10719
|
+
avatarDeleting: "Deleting…",
|
|
10720
|
+
avatarDeleteFailed: "Could not delete the avatar: {message}",
|
|
10721
|
+
avatarEdit: "Edit"
|
|
10722
|
+
},
|
|
10723
|
+
zh: {
|
|
10724
|
+
nav: "角色形象",
|
|
10725
|
+
avatarsLoading: "正在加载角色形象…",
|
|
10726
|
+
avatarsLoadFailed: "无法加载角色形象:{message}",
|
|
10727
|
+
avatarsEmpty: "还没有角色形象。角色形象是可在任何世界里扮演的角色:先创建一个,再把它加入世界,或在新存档中带上它。",
|
|
10728
|
+
avatarsCountOne: "{count} 个角色形象",
|
|
10729
|
+
avatarsCountOther: "{count} 个角色形象",
|
|
10730
|
+
avatarsRefresh: "刷新",
|
|
10731
|
+
avatarsRefreshing: "正在刷新…",
|
|
10732
|
+
avatarsBack: "返回",
|
|
10733
|
+
avatarsCancel: "取消",
|
|
10734
|
+
avatarsClose: "关闭",
|
|
10735
|
+
avatarsMissing: "这个角色形象已不存在。",
|
|
10736
|
+
avatarCreate: "新建角色形象",
|
|
10737
|
+
avatarCreateTitle: "新建角色形象",
|
|
10738
|
+
avatarCreateHelp: "角色形象是不属于任何世界的可扮演角色。先起个名字,其余内容可在编辑器中填写。",
|
|
10739
|
+
avatarName: "名称",
|
|
10740
|
+
avatarCreating: "正在创建…",
|
|
10741
|
+
avatarCreateFailed: "无法创建角色形象:{message}",
|
|
10742
|
+
avatarDelete: "删除",
|
|
10743
|
+
avatarDeleteTitle: "删除角色形象",
|
|
10744
|
+
avatarDeleteHelp: "删除{name}?已经带有它的世界和存档会保留各自的副本。该角色形象会被移到回收文件夹。",
|
|
10745
|
+
avatarDeleting: "正在删除…",
|
|
10746
|
+
avatarDeleteFailed: "无法删除角色形象:{message}",
|
|
10747
|
+
avatarEdit: "编辑"
|
|
10748
|
+
}
|
|
10749
|
+
}, dictionaries$10);
|
|
10750
|
+
//#endregion
|
|
10751
|
+
//#region src/client/pages/avatars/index.ts
|
|
10752
|
+
const NAMESPACE$10 = "roleplay.avatars";
|
|
10753
|
+
/** Adds the Avatars page to the Role Play panel: characters to play in any world. */
|
|
10754
|
+
function registerAvatarsPage(ctx) {
|
|
10755
|
+
const t = ctx.locale.bind(NAMESPACE$10);
|
|
10756
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$10, dictionaries$9), "roleplay: avatars dictionaries");
|
|
10757
|
+
const avatars = new AvatarsController();
|
|
10758
|
+
ctx.effect(() => () => {
|
|
10759
|
+
avatars.dispose();
|
|
10760
|
+
}, "roleplay: avatars requests");
|
|
10761
|
+
ctx.slots.inject("roleplay.page", () => ctx.slots.register({
|
|
10762
|
+
name: "roleplay.page",
|
|
10763
|
+
id: "avatars",
|
|
10764
|
+
order: 5,
|
|
10765
|
+
label: () => t("nav"),
|
|
10766
|
+
locale: NAMESPACE$10,
|
|
10767
|
+
inject: () => avatars.inject()
|
|
10768
|
+
}, AvatarsPage));
|
|
10769
|
+
}
|
|
10770
|
+
//#endregion
|
|
10771
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/presets/PresetsPage.module.css.mjs
|
|
10772
|
+
const css$18 = ".rp_ZK89ba_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_ZK89ba_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_ZK89ba_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_ZK89ba_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_ZK89ba_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_ZK89ba_grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_ZK89ba_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);flex-direction:column;gap:8px;min-width:0;padding:12px;display:flex}.rp_ZK89ba_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_ZK89ba_head{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_ZK89ba_title{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_ZK89ba_name{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_ZK89ba_description{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:3;-webkit-box-orient:vertical;margin:0;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.rp_ZK89ba_meta{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_ZK89ba_cardActions{flex-wrap:wrap;gap:4px;margin-top:auto;display:flex}.rp_ZK89ba_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_ZK89ba_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_ZK89ba_ok{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_ZK89ba_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_ZK89ba_editTitle{color:var(--dsw-alias-label-primary);flex:auto;font-size:14px;font-weight:500}.rp_ZK89ba_editBody{flex-direction:column;flex:1 1 0;gap:24px;min-height:0;padding:16px 24px;display:flex;overflow-y:auto}.rp_ZK89ba_section{flex-direction:column;gap:12px;max-width:720px;display:flex}.rp_ZK89ba_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_ZK89ba_help{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_ZK89ba_row{flex-wrap:wrap;gap:12px;display:flex}.rp_ZK89ba_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_ZK89ba_field{flex-direction:column;flex:200px;gap:6px;min-width:0;display:flex}.rp_ZK89ba_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_ZK89ba_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:280px;font:13px/20px var(--dsw-font-mono,monospace);color:var(--dsw-alias-label-primary);resize:vertical;padding:8px}.rp_ZK89ba_input{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}@media (width<=640px){.rp_ZK89ba_grid{grid-template-columns:1fr}.rp_ZK89ba_form{min-width:0}.rp_ZK89ba_editBody{padding:16px}}";
|
|
10773
|
+
const key$18 = "src/client/pages/presets/PresetsPage.module.css";
|
|
10774
|
+
let tag$18 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$18) + "]");
|
|
10775
|
+
if (tag$18 === null) {
|
|
10776
|
+
tag$18 = document.createElement("style");
|
|
10777
|
+
tag$18.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
10778
|
+
tag$18.dataset.pluginCss = key$18;
|
|
10779
|
+
document.head.appendChild(tag$18);
|
|
10780
|
+
}
|
|
10781
|
+
tag$18.textContent = css$18;
|
|
10782
|
+
var PresetsPage_module_css_default = {
|
|
10783
|
+
"actions": "rp_ZK89ba_actions",
|
|
10784
|
+
"grid": "rp_ZK89ba_grid",
|
|
10785
|
+
"viewport": "rp_ZK89ba_viewport",
|
|
10786
|
+
"error": "rp_ZK89ba_error",
|
|
10787
|
+
"editHeader": "rp_ZK89ba_editHeader",
|
|
10788
|
+
"description": "rp_ZK89ba_description",
|
|
10789
|
+
"page": "rp_ZK89ba_page",
|
|
10790
|
+
"head": "rp_ZK89ba_head",
|
|
10791
|
+
"meta": "rp_ZK89ba_meta",
|
|
10792
|
+
"toolbar": "rp_ZK89ba_toolbar",
|
|
10793
|
+
"message": "rp_ZK89ba_message",
|
|
10794
|
+
"sectionTitle": "rp_ZK89ba_sectionTitle",
|
|
10795
|
+
"count": "rp_ZK89ba_count",
|
|
10796
|
+
"title": "rp_ZK89ba_title",
|
|
10797
|
+
"name": "rp_ZK89ba_name",
|
|
10798
|
+
"editTitle": "rp_ZK89ba_editTitle",
|
|
10799
|
+
"help": "rp_ZK89ba_help",
|
|
10800
|
+
"field": "rp_ZK89ba_field",
|
|
10801
|
+
"label": "rp_ZK89ba_label",
|
|
10802
|
+
"area": "rp_ZK89ba_area",
|
|
10803
|
+
"form": "rp_ZK89ba_form",
|
|
10804
|
+
"row": "rp_ZK89ba_row",
|
|
10805
|
+
"input": "rp_ZK89ba_input",
|
|
10806
|
+
"cardActions": "rp_ZK89ba_cardActions",
|
|
10807
|
+
"section": "rp_ZK89ba_section",
|
|
10808
|
+
"editBody": "rp_ZK89ba_editBody",
|
|
10809
|
+
"ok": "rp_ZK89ba_ok",
|
|
10810
|
+
"card": "rp_ZK89ba_card"
|
|
10811
|
+
};
|
|
10812
|
+
//#endregion
|
|
10813
|
+
//#region src/client/pages/presets/PresetEditor.tsx
|
|
10814
|
+
const messageOf$3 = (failure) => failure instanceof Error ? failure.message : String(failure);
|
|
10815
|
+
const numberOf = (text) => text.trim() === "" ? void 0 : Number(text);
|
|
10816
|
+
const PROMPT_IDS = [
|
|
10817
|
+
"roleplay/persona",
|
|
10818
|
+
"roleplay/style",
|
|
10819
|
+
"roleplay/character-style"
|
|
10820
|
+
];
|
|
10821
|
+
const PROMPT_LANGUAGES = ["en", "zh"];
|
|
10822
|
+
const promptKey = (path) => ({
|
|
10823
|
+
language: path.slice(0, path.indexOf("/")),
|
|
10824
|
+
id: path.slice(path.indexOf("/") + 1)
|
|
10825
|
+
});
|
|
10826
|
+
const infoOf = (summary) => ({
|
|
10827
|
+
title: summary.title === summary.name ? "" : summary.title,
|
|
10828
|
+
description: summary.description,
|
|
10829
|
+
master: summary.sampling.master?.toString() ?? "",
|
|
10830
|
+
characters: summary.sampling.characters?.toString() ?? ""
|
|
10831
|
+
});
|
|
10832
|
+
/** One library preset: what it says about itself and the text of each prompt it carries; the assistant does the larger rewrites. */
|
|
10833
|
+
function PresetEditor({ t, name, onBack, author }) {
|
|
10834
|
+
const [loaded, setLoaded] = (0, react.useState)();
|
|
10835
|
+
const [failure, setFailure] = (0, react.useState)();
|
|
10836
|
+
const [info, setInfo] = (0, react.useState)();
|
|
10837
|
+
const [infoStatus, setInfoStatus] = (0, react.useState)({ state: "idle" });
|
|
10838
|
+
const [path, setPath] = (0, react.useState)("");
|
|
10839
|
+
const [text, setText] = (0, react.useState)("");
|
|
10840
|
+
const [draft, setDraft] = (0, react.useState)("");
|
|
10841
|
+
const [addition, setAddition] = (0, react.useState)("");
|
|
10842
|
+
const [promptStatus, setPromptStatus] = (0, react.useState)({ state: "idle" });
|
|
10843
|
+
const accept = (value, keep) => {
|
|
10844
|
+
setLoaded(value);
|
|
10845
|
+
setInfo(infoOf(value.summary));
|
|
10846
|
+
setDraft("");
|
|
10847
|
+
const paths = Object.keys(value.prompts).sort();
|
|
10848
|
+
const chosen = keep !== void 0 && paths.includes(keep) ? keep : paths[0] ?? "";
|
|
10849
|
+
setPath(chosen);
|
|
10850
|
+
setText(value.prompts[chosen] ?? "");
|
|
10851
|
+
};
|
|
10852
|
+
(0, react.useEffect)(() => {
|
|
10853
|
+
const abort = new AbortController();
|
|
10854
|
+
readPreset(name, abort.signal).then((value) => {
|
|
10855
|
+
accept(value);
|
|
10856
|
+
}, (problem) => {
|
|
10857
|
+
if (!abort.signal.aborted) setFailure(messageOf$3(problem));
|
|
10858
|
+
});
|
|
10859
|
+
return () => {
|
|
10860
|
+
abort.abort();
|
|
10861
|
+
};
|
|
10862
|
+
}, [name]);
|
|
10863
|
+
if (loaded === void 0 || info === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10864
|
+
className: PresetsPage_module_css_default.message,
|
|
10865
|
+
role: failure === void 0 ? void 0 : "alert",
|
|
10866
|
+
children: failure === void 0 ? t("loading") : t("loadFailed", { message: failure })
|
|
10867
|
+
});
|
|
10868
|
+
const paths = [...Object.keys(loaded.prompts), ...draft === "" ? [] : [draft]].sort();
|
|
10869
|
+
const missing = PROMPT_LANGUAGES.flatMap((language) => PROMPT_IDS.map((id) => `${language}/${id}`)).filter((key) => !paths.includes(key));
|
|
10870
|
+
const saved = infoOf(loaded.summary);
|
|
10871
|
+
const infoDirty = JSON.stringify(info) !== JSON.stringify(saved);
|
|
10872
|
+
const promptDirty = path !== "" && (path === draft || text !== loaded.prompts[path]);
|
|
10873
|
+
const saveInfo = () => {
|
|
10874
|
+
setInfoStatus({ state: "saving" });
|
|
10875
|
+
const sampling = {
|
|
10876
|
+
...numberOf(info.master) === void 0 ? {} : { master: numberOf(info.master) },
|
|
10877
|
+
...numberOf(info.characters) === void 0 ? {} : { characters: numberOf(info.characters) }
|
|
10878
|
+
};
|
|
10879
|
+
updatePresetInfo(name, {
|
|
10880
|
+
title: info.title,
|
|
10881
|
+
description: info.description,
|
|
10882
|
+
sampling
|
|
10883
|
+
}, new AbortController().signal).then((summary) => {
|
|
10884
|
+
setLoaded({
|
|
10885
|
+
...loaded,
|
|
10886
|
+
summary
|
|
10887
|
+
});
|
|
10888
|
+
setInfo(infoOf(summary));
|
|
10889
|
+
setInfoStatus({ state: "saved" });
|
|
10890
|
+
}, (problem) => {
|
|
10891
|
+
setInfoStatus({
|
|
10892
|
+
state: "failed",
|
|
10893
|
+
message: messageOf$3(problem)
|
|
10894
|
+
});
|
|
10895
|
+
});
|
|
10896
|
+
};
|
|
10897
|
+
const afterPrompt = (summary, prompts, keep) => {
|
|
10898
|
+
accept({
|
|
10899
|
+
summary,
|
|
10900
|
+
prompts
|
|
10901
|
+
}, keep);
|
|
10902
|
+
};
|
|
10903
|
+
const savePrompt = () => {
|
|
10904
|
+
const { language, id } = promptKey(path);
|
|
10905
|
+
setPromptStatus({ state: "saving" });
|
|
10906
|
+
writePresetPrompt(name, language, id, text, new AbortController().signal).then((summary) => {
|
|
10907
|
+
afterPrompt(summary, {
|
|
10908
|
+
...loaded.prompts,
|
|
10909
|
+
[path]: text.endsWith("\n") ? text : `${text}\n`
|
|
10910
|
+
}, path);
|
|
10911
|
+
setPromptStatus({ state: "saved" });
|
|
10912
|
+
}, (problem) => {
|
|
10913
|
+
setPromptStatus({
|
|
10914
|
+
state: "failed",
|
|
10915
|
+
message: messageOf$3(problem)
|
|
10916
|
+
});
|
|
10917
|
+
});
|
|
10918
|
+
};
|
|
10919
|
+
const removePrompt = () => {
|
|
10920
|
+
if (path === draft) {
|
|
10921
|
+
setDraft("");
|
|
10922
|
+
const rest = Object.keys(loaded.prompts).sort();
|
|
10923
|
+
setPath(rest[0] ?? "");
|
|
10924
|
+
setText(loaded.prompts[rest[0] ?? ""] ?? "");
|
|
10925
|
+
setPromptStatus({ state: "idle" });
|
|
10926
|
+
return;
|
|
10927
|
+
}
|
|
10928
|
+
const { language, id } = promptKey(path);
|
|
10929
|
+
setPromptStatus({ state: "saving" });
|
|
10930
|
+
removePresetPrompt(name, language, id, new AbortController().signal).then((summary) => {
|
|
10931
|
+
const rest = { ...loaded.prompts };
|
|
10932
|
+
delete rest[path];
|
|
10933
|
+
afterPrompt(summary, rest);
|
|
10934
|
+
setPromptStatus({ state: "idle" });
|
|
10935
|
+
}, (problem) => {
|
|
10936
|
+
setPromptStatus({
|
|
10937
|
+
state: "failed",
|
|
10938
|
+
message: messageOf$3(problem)
|
|
10939
|
+
});
|
|
10940
|
+
});
|
|
10941
|
+
};
|
|
10942
|
+
const label = (key) => {
|
|
10943
|
+
const { language, id } = promptKey(key);
|
|
10944
|
+
return `${language} · ${t(`prompt_${id}`)}`;
|
|
10945
|
+
};
|
|
10946
|
+
const field = (key, caption, options = {}) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
10947
|
+
className: PresetsPage_module_css_default.field,
|
|
10948
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10949
|
+
className: PresetsPage_module_css_default.label,
|
|
10950
|
+
children: t(caption)
|
|
10951
|
+
}), options.rows === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10952
|
+
className: PresetsPage_module_css_default.input,
|
|
10953
|
+
value: info[key],
|
|
10954
|
+
inputMode: options.number === true ? "decimal" : void 0,
|
|
10955
|
+
onChange: (event) => {
|
|
10956
|
+
setInfo({
|
|
10957
|
+
...info,
|
|
10958
|
+
[key]: event.target.value
|
|
10959
|
+
});
|
|
10960
|
+
setInfoStatus({ state: "idle" });
|
|
10961
|
+
}
|
|
10962
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
10963
|
+
className: PresetsPage_module_css_default.input,
|
|
10964
|
+
rows: options.rows,
|
|
10965
|
+
value: info[key],
|
|
10966
|
+
onChange: (event) => {
|
|
10967
|
+
setInfo({
|
|
10968
|
+
...info,
|
|
10969
|
+
[key]: event.target.value
|
|
10970
|
+
});
|
|
10971
|
+
setInfoStatus({ state: "idle" });
|
|
10972
|
+
}
|
|
10973
|
+
})]
|
|
10974
|
+
});
|
|
10975
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10976
|
+
className: PresetsPage_module_css_default.page,
|
|
10977
|
+
"data-testid": "roleplay-preset-editor",
|
|
10978
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10979
|
+
className: PresetsPage_module_css_default.editHeader,
|
|
10980
|
+
children: [
|
|
10981
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
10982
|
+
variant: "ghost",
|
|
10983
|
+
size: "sm",
|
|
10984
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronLeftOutlineRegular, {}),
|
|
10985
|
+
onClick: onBack,
|
|
10986
|
+
children: t("back")
|
|
10987
|
+
}),
|
|
10988
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10989
|
+
className: PresetsPage_module_css_default.editTitle,
|
|
10990
|
+
children: loaded.summary.title
|
|
10991
|
+
}),
|
|
10992
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
10993
|
+
variant: "primary",
|
|
10994
|
+
size: "sm",
|
|
10995
|
+
onClick: author,
|
|
10996
|
+
children: t("author")
|
|
10997
|
+
})
|
|
10998
|
+
]
|
|
10999
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11000
|
+
className: PresetsPage_module_css_default.editBody,
|
|
11001
|
+
children: [
|
|
11002
|
+
loaded.summary.problems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11003
|
+
className: PresetsPage_module_css_default.error,
|
|
11004
|
+
role: "alert",
|
|
11005
|
+
children: t("broken", { problems: loaded.summary.problems.join("; ") })
|
|
11006
|
+
}),
|
|
11007
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
11008
|
+
className: PresetsPage_module_css_default.section,
|
|
11009
|
+
children: [
|
|
11010
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
11011
|
+
className: PresetsPage_module_css_default.sectionTitle,
|
|
11012
|
+
children: t("info")
|
|
11013
|
+
}),
|
|
11014
|
+
field("title", "presetTitle"),
|
|
11015
|
+
field("description", "presetDescription", { rows: 3 }),
|
|
11016
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11017
|
+
className: PresetsPage_module_css_default.row,
|
|
11018
|
+
children: [field("master", "samplingMaster", { number: true }), field("characters", "samplingCharacters", { number: true })]
|
|
11019
|
+
}),
|
|
11020
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11021
|
+
className: PresetsPage_module_css_default.help,
|
|
11022
|
+
children: t("samplingHelp")
|
|
11023
|
+
}),
|
|
11024
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11025
|
+
className: PresetsPage_module_css_default.actions,
|
|
11026
|
+
children: [
|
|
11027
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11028
|
+
variant: "primary",
|
|
11029
|
+
size: "sm",
|
|
11030
|
+
disabled: !infoDirty || infoStatus.state === "saving",
|
|
11031
|
+
onClick: saveInfo,
|
|
11032
|
+
children: infoStatus.state === "saving" ? t("infoSaving") : t("infoSave")
|
|
11033
|
+
}),
|
|
11034
|
+
infoStatus.state === "saved" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11035
|
+
className: PresetsPage_module_css_default.ok,
|
|
11036
|
+
role: "status",
|
|
11037
|
+
children: t("infoSaved")
|
|
11038
|
+
}),
|
|
11039
|
+
infoStatus.state === "failed" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11040
|
+
className: PresetsPage_module_css_default.error,
|
|
11041
|
+
role: "alert",
|
|
11042
|
+
children: t("infoFailed", { message: infoStatus.message ?? "" })
|
|
11043
|
+
})
|
|
11044
|
+
]
|
|
11045
|
+
})
|
|
11046
|
+
]
|
|
11047
|
+
}),
|
|
11048
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
11049
|
+
className: PresetsPage_module_css_default.section,
|
|
11050
|
+
children: [
|
|
11051
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
11052
|
+
className: PresetsPage_module_css_default.sectionTitle,
|
|
11053
|
+
children: t("prompts")
|
|
11054
|
+
}),
|
|
11055
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11056
|
+
className: PresetsPage_module_css_default.help,
|
|
11057
|
+
children: t("promptsHelp")
|
|
11058
|
+
}),
|
|
11059
|
+
paths.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11060
|
+
className: PresetsPage_module_css_default.message,
|
|
11061
|
+
children: t("promptsNone")
|
|
11062
|
+
}),
|
|
11063
|
+
paths.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
11064
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11065
|
+
className: PresetsPage_module_css_default.field,
|
|
11066
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11067
|
+
className: PresetsPage_module_css_default.label,
|
|
11068
|
+
children: t("promptPick")
|
|
11069
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
11070
|
+
value: path,
|
|
11071
|
+
"data-testid": "roleplay-preset-prompt",
|
|
11072
|
+
onChange: (event) => {
|
|
11073
|
+
setPath(event.target.value);
|
|
11074
|
+
setText(loaded.prompts[event.target.value] ?? "");
|
|
11075
|
+
setPromptStatus({ state: "idle" });
|
|
11076
|
+
},
|
|
11077
|
+
children: paths.map((key) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
11078
|
+
value: key,
|
|
11079
|
+
children: label(key)
|
|
11080
|
+
}, key))
|
|
11081
|
+
})]
|
|
11082
|
+
}),
|
|
11083
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
11084
|
+
className: PresetsPage_module_css_default.area,
|
|
11085
|
+
value: text,
|
|
11086
|
+
"aria-label": t("promptPick"),
|
|
11087
|
+
onChange: (event) => {
|
|
11088
|
+
setText(event.target.value);
|
|
11089
|
+
setPromptStatus({ state: "idle" });
|
|
11090
|
+
}
|
|
11091
|
+
}),
|
|
11092
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11093
|
+
className: PresetsPage_module_css_default.actions,
|
|
11094
|
+
children: [
|
|
11095
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11096
|
+
variant: "primary",
|
|
11097
|
+
size: "sm",
|
|
11098
|
+
disabled: !promptDirty || promptStatus.state === "saving" || text.trim() === "",
|
|
11099
|
+
onClick: savePrompt,
|
|
11100
|
+
children: promptStatus.state === "saving" ? t("promptSaving") : t("promptSave")
|
|
11101
|
+
}),
|
|
11102
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11103
|
+
variant: "ghost",
|
|
11104
|
+
size: "sm",
|
|
11105
|
+
disabled: !promptDirty,
|
|
11106
|
+
onClick: () => {
|
|
11107
|
+
setText(loaded.prompts[path] ?? "");
|
|
11108
|
+
},
|
|
11109
|
+
children: t("promptReset")
|
|
11110
|
+
}),
|
|
11111
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11112
|
+
variant: "ghost",
|
|
11113
|
+
size: "sm",
|
|
11114
|
+
disabled: promptStatus.state === "saving",
|
|
11115
|
+
onClick: removePrompt,
|
|
11116
|
+
children: t("promptRemove")
|
|
11117
|
+
}),
|
|
11118
|
+
promptStatus.state === "saved" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11119
|
+
className: PresetsPage_module_css_default.ok,
|
|
11120
|
+
role: "status",
|
|
11121
|
+
children: t("promptSaved")
|
|
11122
|
+
}),
|
|
11123
|
+
promptStatus.state === "failed" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11124
|
+
className: PresetsPage_module_css_default.error,
|
|
11125
|
+
role: "alert",
|
|
11126
|
+
children: t("promptFailed", { message: promptStatus.message ?? "" })
|
|
11127
|
+
})
|
|
11128
|
+
]
|
|
11129
|
+
})
|
|
11130
|
+
] }),
|
|
11131
|
+
missing.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11132
|
+
className: PresetsPage_module_css_default.actions,
|
|
11133
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
11134
|
+
value: addition,
|
|
11135
|
+
"aria-label": t("promptAdd"),
|
|
11136
|
+
"data-testid": "roleplay-preset-prompt-add",
|
|
11137
|
+
onChange: (event) => {
|
|
11138
|
+
setAddition(event.target.value);
|
|
11139
|
+
},
|
|
11140
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
11141
|
+
value: "",
|
|
11142
|
+
children: t("promptAdd")
|
|
11143
|
+
}), missing.map((key) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
11144
|
+
value: key,
|
|
11145
|
+
children: label(key)
|
|
11146
|
+
}, key))]
|
|
11147
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11148
|
+
variant: "ghost",
|
|
11149
|
+
size: "sm",
|
|
11150
|
+
disabled: addition === "",
|
|
11151
|
+
onClick: () => {
|
|
11152
|
+
setDraft(addition);
|
|
11153
|
+
setPath(addition);
|
|
11154
|
+
setText("");
|
|
11155
|
+
setAddition("");
|
|
11156
|
+
setPromptStatus({ state: "idle" });
|
|
11157
|
+
},
|
|
11158
|
+
children: t("promptAddButton")
|
|
11159
|
+
})]
|
|
11160
|
+
})
|
|
11161
|
+
]
|
|
11162
|
+
})
|
|
11163
|
+
]
|
|
11164
|
+
})]
|
|
11165
|
+
});
|
|
11166
|
+
}
|
|
11167
|
+
//#endregion
|
|
11168
|
+
//#region src/client/pages/presets/PresetsPage.tsx
|
|
11169
|
+
const NAME = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
|
|
11170
|
+
const messageOf$2 = (failure) => failure instanceof Error ? failure.message : String(failure);
|
|
11171
|
+
const nameFromFile = (file) => file.replace(/\.[^.]*$/, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^[-_]+|[-_]+$/g, "").slice(0, 64);
|
|
11172
|
+
function NameDialog({ t, mode, file, submit, onClose }) {
|
|
11173
|
+
const formId = (0, react.useId)();
|
|
11174
|
+
const [name, setName] = (0, react.useState)(file === void 0 ? "" : nameFromFile(file));
|
|
11175
|
+
const [title, setTitle] = (0, react.useState)("");
|
|
11176
|
+
const [description, setDescription] = (0, react.useState)("");
|
|
11177
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
11178
|
+
const [error, setError] = (0, react.useState)();
|
|
11179
|
+
const go = () => {
|
|
11180
|
+
if (!NAME.test(name) || busy) return;
|
|
11181
|
+
setBusy(true);
|
|
11182
|
+
setError(void 0);
|
|
11183
|
+
submit(name, title.trim(), description.trim()).then(onClose, (failure) => {
|
|
11184
|
+
setBusy(false);
|
|
11185
|
+
setError(messageOf$2(failure));
|
|
11186
|
+
});
|
|
11187
|
+
};
|
|
11188
|
+
const importing = mode === "import";
|
|
11189
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
11190
|
+
open: true,
|
|
11191
|
+
onClose,
|
|
11192
|
+
title: importing ? t("importTitle") : t("createTitle"),
|
|
11193
|
+
description: importing ? t("importHelp", { file: file ?? "" }) : t("createHelp"),
|
|
11194
|
+
closeLabel: t("close"),
|
|
11195
|
+
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11196
|
+
variant: "ghost",
|
|
11197
|
+
disabled: busy,
|
|
11198
|
+
onClick: onClose,
|
|
11199
|
+
children: t("cancel")
|
|
11200
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11201
|
+
variant: "primary",
|
|
11202
|
+
type: "submit",
|
|
11203
|
+
form: formId,
|
|
11204
|
+
disabled: busy || !NAME.test(name),
|
|
11205
|
+
children: importing ? busy ? t("importing") : t("import") : busy ? t("creating") : t("create")
|
|
11206
|
+
})] }),
|
|
11207
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
11208
|
+
id: formId,
|
|
11209
|
+
className: PresetsPage_module_css_default.form,
|
|
11210
|
+
onSubmit: (event) => {
|
|
11211
|
+
event.preventDefault();
|
|
11212
|
+
go();
|
|
11213
|
+
},
|
|
11214
|
+
children: [
|
|
11215
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11216
|
+
className: PresetsPage_module_css_default.field,
|
|
11217
|
+
children: [
|
|
11218
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11219
|
+
className: PresetsPage_module_css_default.label,
|
|
11220
|
+
children: t("presetName")
|
|
11221
|
+
}),
|
|
11222
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
11223
|
+
value: name,
|
|
11224
|
+
maxLength: 64,
|
|
11225
|
+
"data-modal-autofocus": true,
|
|
11226
|
+
onChange: (event) => {
|
|
11227
|
+
setName(event.target.value);
|
|
11228
|
+
}
|
|
11229
|
+
}),
|
|
11230
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11231
|
+
className: PresetsPage_module_css_default.help,
|
|
11232
|
+
children: t("presetNameHelp")
|
|
11233
|
+
})
|
|
11234
|
+
]
|
|
11235
|
+
}),
|
|
11236
|
+
!importing && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11237
|
+
className: PresetsPage_module_css_default.field,
|
|
11238
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11239
|
+
className: PresetsPage_module_css_default.label,
|
|
11240
|
+
children: t("presetTitle")
|
|
11241
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
11242
|
+
value: title,
|
|
11243
|
+
maxLength: 300,
|
|
11244
|
+
onChange: (event) => {
|
|
11245
|
+
setTitle(event.target.value);
|
|
11246
|
+
}
|
|
11247
|
+
})]
|
|
11248
|
+
}),
|
|
11249
|
+
!importing && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11250
|
+
className: PresetsPage_module_css_default.field,
|
|
11251
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11252
|
+
className: PresetsPage_module_css_default.label,
|
|
11253
|
+
children: t("presetDescription")
|
|
11254
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
11255
|
+
value: description,
|
|
11256
|
+
maxLength: 300,
|
|
11257
|
+
onChange: (event) => {
|
|
11258
|
+
setDescription(event.target.value);
|
|
11259
|
+
}
|
|
11260
|
+
})]
|
|
11261
|
+
}),
|
|
11262
|
+
error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11263
|
+
className: PresetsPage_module_css_default.error,
|
|
11264
|
+
role: "alert",
|
|
11265
|
+
children: importing ? t("importFailed", { message: error }) : t("createFailed", { message: error })
|
|
11266
|
+
})
|
|
11267
|
+
]
|
|
11268
|
+
})
|
|
11269
|
+
});
|
|
11270
|
+
}
|
|
11271
|
+
function DeleteDialog({ t, preset, remove, onClose }) {
|
|
11272
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
11273
|
+
const [error, setError] = (0, react.useState)();
|
|
11274
|
+
const confirm = () => {
|
|
11275
|
+
setBusy(true);
|
|
11276
|
+
setError(void 0);
|
|
11277
|
+
remove(preset.name).then(onClose, (failure) => {
|
|
11278
|
+
setBusy(false);
|
|
11279
|
+
setError(messageOf$2(failure));
|
|
11280
|
+
});
|
|
11281
|
+
};
|
|
11282
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
11283
|
+
open: true,
|
|
11284
|
+
onClose,
|
|
11285
|
+
title: t("deleteTitle"),
|
|
11286
|
+
description: t("deleteHelp", { name: preset.title }),
|
|
11287
|
+
closeLabel: t("close"),
|
|
11288
|
+
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11289
|
+
variant: "ghost",
|
|
11290
|
+
disabled: busy,
|
|
11291
|
+
onClick: onClose,
|
|
11292
|
+
children: t("cancel")
|
|
11293
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11294
|
+
variant: "primary",
|
|
11295
|
+
disabled: busy,
|
|
11296
|
+
onClick: confirm,
|
|
11297
|
+
children: busy ? t("deleting") : t("delete")
|
|
11298
|
+
})] }),
|
|
11299
|
+
children: error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11300
|
+
className: PresetsPage_module_css_default.error,
|
|
11301
|
+
role: "alert",
|
|
11302
|
+
children: t("deleteFailed", { message: error })
|
|
11303
|
+
})
|
|
11304
|
+
});
|
|
11305
|
+
}
|
|
11306
|
+
/** The preset library: reusable writing instructions that a story copies when it starts. */
|
|
11307
|
+
function PresetsPage({ t, usePresets, load, refresh, create, remove, author, importFile }) {
|
|
11308
|
+
const state = usePresets((snapshot) => snapshot);
|
|
11309
|
+
const [editing, setEditing] = (0, react.useState)();
|
|
11310
|
+
const [creating, setCreating] = (0, react.useState)(false);
|
|
11311
|
+
const [deleting, setDeleting] = (0, react.useState)();
|
|
11312
|
+
const [uploaded, setUploaded] = (0, react.useState)();
|
|
11313
|
+
const [notice, setNotice] = (0, react.useState)();
|
|
11314
|
+
const picker = (0, react.useRef)(null);
|
|
11315
|
+
(0, react.useEffect)(() => {
|
|
11316
|
+
load();
|
|
11317
|
+
}, [load]);
|
|
11318
|
+
const open = (name) => {
|
|
11319
|
+
setNotice(void 0);
|
|
11320
|
+
author(name).catch((failure) => {
|
|
11321
|
+
setNotice(t("authorFailed", { message: messageOf$2(failure) }));
|
|
11322
|
+
});
|
|
11323
|
+
};
|
|
11324
|
+
if (editing !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PresetEditor, {
|
|
11325
|
+
t,
|
|
11326
|
+
name: editing,
|
|
11327
|
+
onBack: () => {
|
|
11328
|
+
setEditing(void 0);
|
|
11329
|
+
refresh();
|
|
11330
|
+
},
|
|
11331
|
+
author: () => {
|
|
11332
|
+
open(editing);
|
|
11333
|
+
}
|
|
11334
|
+
});
|
|
11335
|
+
const presets = state.presets ?? [];
|
|
11336
|
+
const failedWithoutData = state.status === "failed" && state.presets === void 0;
|
|
11337
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11338
|
+
className: PresetsPage_module_css_default.page,
|
|
11339
|
+
"data-testid": "roleplay-presets-page",
|
|
11340
|
+
children: [
|
|
11341
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11342
|
+
className: PresetsPage_module_css_default.toolbar,
|
|
11343
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11344
|
+
className: PresetsPage_module_css_default.count,
|
|
11345
|
+
children: state.presets === void 0 ? "" : t(presets.length === 1 ? "countOne" : "countOther", { count: presets.length })
|
|
11346
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11347
|
+
className: PresetsPage_module_css_default.actions,
|
|
11348
|
+
children: [
|
|
11349
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
11350
|
+
ref: picker,
|
|
11351
|
+
type: "file",
|
|
11352
|
+
accept: ".json,application/json",
|
|
11353
|
+
hidden: true,
|
|
11354
|
+
"data-testid": "roleplay-preset-file",
|
|
11355
|
+
onChange: (event) => {
|
|
11356
|
+
setUploaded(event.target.files?.[0]);
|
|
11357
|
+
event.target.value = "";
|
|
11358
|
+
}
|
|
11359
|
+
}),
|
|
11360
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11361
|
+
variant: "outline",
|
|
11362
|
+
size: "sm",
|
|
11363
|
+
onClick: () => {
|
|
11364
|
+
picker.current?.click();
|
|
11365
|
+
},
|
|
11366
|
+
children: t("import")
|
|
11367
|
+
}),
|
|
11368
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11369
|
+
variant: "primary",
|
|
11370
|
+
size: "sm",
|
|
11371
|
+
onClick: () => {
|
|
11372
|
+
setCreating(true);
|
|
11373
|
+
},
|
|
11374
|
+
children: t("create")
|
|
11375
|
+
}),
|
|
11376
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11377
|
+
variant: "outline",
|
|
11378
|
+
size: "sm",
|
|
11379
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, {}),
|
|
11380
|
+
disabled: state.refreshing || state.status === "loading",
|
|
11381
|
+
"aria-busy": state.refreshing,
|
|
11382
|
+
onClick: refresh,
|
|
11383
|
+
children: state.refreshing ? t("refreshing") : t("refresh")
|
|
11384
|
+
})
|
|
11385
|
+
]
|
|
11386
|
+
})]
|
|
11387
|
+
}),
|
|
11388
|
+
state.error !== void 0 && !failedWithoutData && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11389
|
+
className: PresetsPage_module_css_default.error,
|
|
11390
|
+
role: "alert",
|
|
11391
|
+
children: t("loadFailed", { message: state.error })
|
|
11392
|
+
}),
|
|
11393
|
+
notice !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11394
|
+
className: PresetsPage_module_css_default.error,
|
|
11395
|
+
role: "alert",
|
|
11396
|
+
children: notice
|
|
11397
|
+
}),
|
|
11398
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11399
|
+
className: PresetsPage_module_css_default.viewport,
|
|
11400
|
+
children: state.status === "idle" || state.status === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11401
|
+
className: PresetsPage_module_css_default.message,
|
|
11402
|
+
children: t("loading")
|
|
11403
|
+
}) : failedWithoutData ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11404
|
+
className: PresetsPage_module_css_default.error,
|
|
11405
|
+
role: "alert",
|
|
11406
|
+
children: t("loadFailed", { message: state.error ?? "" })
|
|
11407
|
+
}) : presets.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11408
|
+
className: PresetsPage_module_css_default.message,
|
|
11409
|
+
children: t("empty")
|
|
11410
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
11411
|
+
className: PresetsPage_module_css_default.grid,
|
|
11412
|
+
children: presets.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
11413
|
+
className: PresetsPage_module_css_default.card,
|
|
11414
|
+
"data-testid": "roleplay-preset-card",
|
|
11415
|
+
children: [
|
|
11416
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11417
|
+
className: PresetsPage_module_css_default.head,
|
|
11418
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11419
|
+
className: PresetsPage_module_css_default.title,
|
|
11420
|
+
children: preset.title
|
|
11421
|
+
}), preset.title !== preset.name && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11422
|
+
className: PresetsPage_module_css_default.name,
|
|
11423
|
+
children: preset.name
|
|
11424
|
+
})]
|
|
11425
|
+
}),
|
|
11426
|
+
preset.description !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11427
|
+
className: PresetsPage_module_css_default.description,
|
|
11428
|
+
children: preset.description
|
|
11429
|
+
}),
|
|
11430
|
+
preset.problems.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11431
|
+
className: PresetsPage_module_css_default.error,
|
|
11432
|
+
children: t("broken", { problems: preset.problems.join("; ") })
|
|
11433
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11434
|
+
className: PresetsPage_module_css_default.meta,
|
|
11435
|
+
children: [t("languages", { list: preset.languages.join(", ") }), t("promptsCount", { count: preset.prompts.length })].join(" · ")
|
|
11436
|
+
}),
|
|
11437
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11438
|
+
className: PresetsPage_module_css_default.cardActions,
|
|
11439
|
+
children: [
|
|
11440
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11441
|
+
variant: "outline",
|
|
11442
|
+
size: "sm",
|
|
11443
|
+
onClick: () => {
|
|
11444
|
+
setEditing(preset.name);
|
|
11445
|
+
},
|
|
11446
|
+
children: t("edit")
|
|
11447
|
+
}),
|
|
11448
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11449
|
+
variant: "outline",
|
|
11450
|
+
size: "sm",
|
|
11451
|
+
onClick: () => {
|
|
11452
|
+
open(preset.name);
|
|
11453
|
+
},
|
|
11454
|
+
children: t("author")
|
|
11455
|
+
}),
|
|
11456
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11457
|
+
variant: "ghost",
|
|
11458
|
+
size: "sm",
|
|
11459
|
+
onClick: () => {
|
|
11460
|
+
setDeleting(preset);
|
|
11461
|
+
},
|
|
11462
|
+
children: t("delete")
|
|
11463
|
+
})
|
|
11464
|
+
]
|
|
11465
|
+
})
|
|
11466
|
+
]
|
|
11467
|
+
}, preset.name))
|
|
11468
|
+
})
|
|
11469
|
+
}),
|
|
11470
|
+
creating && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NameDialog, {
|
|
11471
|
+
t,
|
|
11472
|
+
mode: "create",
|
|
11473
|
+
submit: create,
|
|
11474
|
+
onClose: () => {
|
|
11475
|
+
setCreating(false);
|
|
11476
|
+
}
|
|
11477
|
+
}),
|
|
11478
|
+
uploaded !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NameDialog, {
|
|
11479
|
+
t,
|
|
11480
|
+
mode: "import",
|
|
11481
|
+
file: uploaded.name,
|
|
11482
|
+
submit: async (name) => {
|
|
11483
|
+
const result = await importFile(name, uploaded);
|
|
11484
|
+
if (!result.started) setNotice(t("importNotStarted", { message: result.failure ?? "" }));
|
|
11485
|
+
},
|
|
11486
|
+
onClose: () => {
|
|
11487
|
+
setUploaded(void 0);
|
|
11488
|
+
}
|
|
11489
|
+
}),
|
|
11490
|
+
deleting !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeleteDialog, {
|
|
11491
|
+
t,
|
|
11492
|
+
preset: deleting,
|
|
11493
|
+
remove,
|
|
11494
|
+
onClose: () => {
|
|
11495
|
+
setDeleting(void 0);
|
|
11496
|
+
}
|
|
11497
|
+
})
|
|
11498
|
+
]
|
|
11499
|
+
});
|
|
11500
|
+
}
|
|
11501
|
+
//#endregion
|
|
11502
|
+
//#region src/client/pages/presets/locales.ts
|
|
11503
|
+
const dictionaries$8 = {
|
|
10431
11504
|
en: {
|
|
10432
|
-
nav: "
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
10441
|
-
|
|
10442
|
-
|
|
10443
|
-
|
|
10444
|
-
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
|
|
10455
|
-
|
|
11505
|
+
nav: "Presets",
|
|
11506
|
+
language: "en",
|
|
11507
|
+
loading: "Loading presets…",
|
|
11508
|
+
loadFailed: "Could not load the presets: {message}",
|
|
11509
|
+
empty: "No presets yet. A preset is a set of writing instructions (the narrator, the narration style, how characters speak) that you can put into any story. Make one to edit, import a SillyTavern preset, or save a world's own prompts as one.",
|
|
11510
|
+
countOne: "{count} preset",
|
|
11511
|
+
countOther: "{count} presets",
|
|
11512
|
+
refresh: "Refresh",
|
|
11513
|
+
refreshing: "Refreshing…",
|
|
11514
|
+
back: "Back",
|
|
11515
|
+
cancel: "Cancel",
|
|
11516
|
+
close: "Close",
|
|
11517
|
+
create: "New preset",
|
|
11518
|
+
createTitle: "New preset",
|
|
11519
|
+
createHelp: "The new preset starts with the shipped narration prompts, which you can then rewrite yourself or with the assistant.",
|
|
11520
|
+
presetName: "Name",
|
|
11521
|
+
presetNameHelp: "Letters, digits, \"-\" and \"_\", up to 64. Worlds and sessions refer to the preset by this name.",
|
|
11522
|
+
presetTitle: "Title",
|
|
11523
|
+
presetDescription: "Description",
|
|
11524
|
+
creating: "Creating…",
|
|
11525
|
+
createFailed: "Could not create the preset: {message}",
|
|
11526
|
+
import: "Import SillyTavern preset",
|
|
11527
|
+
importTitle: "Import a SillyTavern preset",
|
|
11528
|
+
importHelp: "The assistant reads {file} and writes the parts that are about how to narrate into a new preset: the narrator, the style, how characters speak. Rules of the game, formats and scripts are not carried over.",
|
|
11529
|
+
importing: "Importing…",
|
|
11530
|
+
importFailed: "Could not import the preset: {message}",
|
|
11531
|
+
importNotStarted: "The preset was kept, but the assistant could not be started: {message}. Open its authoring chat to continue.",
|
|
11532
|
+
edit: "Edit",
|
|
11533
|
+
author: "Edit with assistant",
|
|
11534
|
+
authorFailed: "Could not open the authoring chat: {message}",
|
|
11535
|
+
delete: "Delete",
|
|
11536
|
+
deleteTitle: "Delete preset",
|
|
11537
|
+
deleteHelp: "Delete {name}? Stories that already use it keep their own copy. The preset is moved to the trash folder.",
|
|
11538
|
+
deleting: "Deleting…",
|
|
11539
|
+
deleteFailed: "Could not delete the preset: {message}",
|
|
11540
|
+
broken: "Cannot be used: {problems}",
|
|
11541
|
+
languages: "Languages: {list}",
|
|
11542
|
+
promptsCount: "{count} prompts",
|
|
11543
|
+
info: "About",
|
|
11544
|
+
infoSave: "Save",
|
|
11545
|
+
infoSaving: "Saving…",
|
|
11546
|
+
infoSaved: "Saved.",
|
|
11547
|
+
infoFailed: "Could not save: {message}",
|
|
11548
|
+
samplingMaster: "Narrator temperature",
|
|
11549
|
+
samplingCharacters: "Characters temperature",
|
|
11550
|
+
samplingHelp: "Suggested only: a story's own settings win. Leave empty to suggest nothing; 0 to 2.",
|
|
11551
|
+
prompts: "Prompts",
|
|
11552
|
+
promptsHelp: "The text a story gets when it starts with this preset. ${name} marks a value the program fills in. A prompt or language the preset lacks can be added below; the assistant can also write it.",
|
|
11553
|
+
promptsNone: "This preset carries no prompts yet.",
|
|
11554
|
+
promptPick: "Prompt",
|
|
11555
|
+
promptSave: "Save prompt",
|
|
11556
|
+
promptSaving: "Saving…",
|
|
11557
|
+
promptSaved: "Saved.",
|
|
11558
|
+
promptRemove: "Remove this prompt",
|
|
11559
|
+
promptFailed: "Could not save the prompt: {message}",
|
|
11560
|
+
promptReset: "Discard changes",
|
|
11561
|
+
missing: "This preset is no longer there.",
|
|
11562
|
+
promptAdd: "Add a prompt…",
|
|
11563
|
+
promptAddButton: "Add",
|
|
11564
|
+
"prompt_roleplay/persona": "Persona",
|
|
11565
|
+
"prompt_roleplay/style": "Narration style",
|
|
11566
|
+
"prompt_roleplay/character-style": "Character style"
|
|
10456
11567
|
},
|
|
10457
11568
|
zh: {
|
|
10458
|
-
nav: "
|
|
10459
|
-
|
|
10460
|
-
|
|
10461
|
-
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
|
-
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
11569
|
+
nav: "预设",
|
|
11570
|
+
language: "zh",
|
|
11571
|
+
loading: "正在加载预设…",
|
|
11572
|
+
loadFailed: "无法加载预设:{message}",
|
|
11573
|
+
empty: "还没有预设。预设是一组可放进任何故事的写作指令(叙述者、叙述文风、角色怎样说话)。你可以新建一个来编辑,导入酒馆预设,或把世界自带的提示词存成预设。",
|
|
11574
|
+
countOne: "{count} 个预设",
|
|
11575
|
+
countOther: "{count} 个预设",
|
|
11576
|
+
refresh: "刷新",
|
|
11577
|
+
refreshing: "正在刷新…",
|
|
11578
|
+
back: "返回",
|
|
11579
|
+
cancel: "取消",
|
|
11580
|
+
close: "关闭",
|
|
11581
|
+
create: "新建预设",
|
|
11582
|
+
createTitle: "新建预设",
|
|
11583
|
+
createHelp: "新预设以内置的叙述提示词为起点,之后可以自己改写,也可以交给助手改写。",
|
|
11584
|
+
presetName: "名称",
|
|
11585
|
+
presetNameHelp: "字母、数字、“-”和“_”,最长 64 个字符。世界和存档通过这个名称引用预设。",
|
|
11586
|
+
presetTitle: "标题",
|
|
11587
|
+
presetDescription: "描述",
|
|
11588
|
+
creating: "正在创建…",
|
|
11589
|
+
createFailed: "无法创建预设:{message}",
|
|
11590
|
+
import: "导入酒馆预设",
|
|
11591
|
+
importTitle: "导入酒馆预设",
|
|
11592
|
+
importHelp: "助手会读取 {file},把其中关于叙述方式的部分(叙述者、文风、角色说话方式)写进一个新预设;游戏规则、格式和脚本不会被带入。",
|
|
11593
|
+
importing: "正在导入…",
|
|
11594
|
+
importFailed: "无法导入预设:{message}",
|
|
11595
|
+
importNotStarted: "预设已保存,但助手没能启动:{message}。请打开它的创作聊天继续。",
|
|
11596
|
+
edit: "编辑",
|
|
11597
|
+
author: "用助手编辑",
|
|
11598
|
+
authorFailed: "无法打开创作聊天:{message}",
|
|
11599
|
+
delete: "删除",
|
|
11600
|
+
deleteTitle: "删除预设",
|
|
11601
|
+
deleteHelp: "删除{name}?已经在使用它的故事会保留各自的副本。该预设会被移到回收文件夹。",
|
|
11602
|
+
deleting: "正在删除…",
|
|
11603
|
+
deleteFailed: "无法删除预设:{message}",
|
|
11604
|
+
broken: "无法使用:{problems}",
|
|
11605
|
+
languages: "语言:{list}",
|
|
11606
|
+
promptsCount: "{count} 个提示词",
|
|
11607
|
+
info: "概览",
|
|
11608
|
+
infoSave: "保存",
|
|
11609
|
+
infoSaving: "正在保存…",
|
|
11610
|
+
infoSaved: "已保存。",
|
|
11611
|
+
infoFailed: "无法保存:{message}",
|
|
11612
|
+
samplingMaster: "叙述者温度",
|
|
11613
|
+
samplingCharacters: "角色温度",
|
|
11614
|
+
samplingHelp: "仅作建议:故事自己的设置优先。留空表示不建议;范围 0 到 2。",
|
|
11615
|
+
prompts: "提示词",
|
|
11616
|
+
promptsHelp: "以这个预设开始的故事会得到这些文字。${name} 表示由程序填入的值。预设缺少的提示词或语言可以在下面添加,也可以让助手来写。",
|
|
11617
|
+
promptsNone: "这个预设还没有提示词。",
|
|
11618
|
+
promptPick: "提示词",
|
|
11619
|
+
promptSave: "保存提示词",
|
|
11620
|
+
promptSaving: "正在保存…",
|
|
11621
|
+
promptSaved: "已保存。",
|
|
11622
|
+
promptRemove: "移除此提示词",
|
|
11623
|
+
promptFailed: "无法保存提示词:{message}",
|
|
11624
|
+
promptReset: "放弃修改",
|
|
11625
|
+
missing: "这个预设已不存在。",
|
|
11626
|
+
promptAdd: "添加提示词…",
|
|
11627
|
+
promptAddButton: "添加",
|
|
11628
|
+
"prompt_roleplay/persona": "人设",
|
|
11629
|
+
"prompt_roleplay/style": "叙述文风",
|
|
11630
|
+
"prompt_roleplay/character-style": "角色风格"
|
|
10482
11631
|
}
|
|
10483
|
-
}
|
|
11632
|
+
};
|
|
10484
11633
|
//#endregion
|
|
10485
|
-
//#region src/client/pages/
|
|
10486
|
-
const
|
|
10487
|
-
/**
|
|
10488
|
-
|
|
11634
|
+
//#region src/client/pages/presets/presets-controller.ts
|
|
11635
|
+
const messageOf$1 = (error) => error instanceof Error ? error.message : String(error);
|
|
11636
|
+
/** Reads the preset library from the host and makes, removes and opens its presets. */
|
|
11637
|
+
var PresetsController = class {
|
|
11638
|
+
openChat;
|
|
11639
|
+
language;
|
|
11640
|
+
store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
|
|
11641
|
+
status: "idle",
|
|
11642
|
+
refreshing: false
|
|
11643
|
+
});
|
|
11644
|
+
abort = new AbortController();
|
|
11645
|
+
face = {
|
|
11646
|
+
hooks: { presets: this.store },
|
|
11647
|
+
load: () => {
|
|
11648
|
+
if (this.store.getSnapshot().status === "idle") this.read(false);
|
|
11649
|
+
},
|
|
11650
|
+
refresh: () => {
|
|
11651
|
+
this.read(true);
|
|
11652
|
+
},
|
|
11653
|
+
create: async (name, title, description) => {
|
|
11654
|
+
await createPreset({
|
|
11655
|
+
name,
|
|
11656
|
+
...title === "" ? {} : { title },
|
|
11657
|
+
...description === "" ? {} : { description }
|
|
11658
|
+
}, this.abort.signal);
|
|
11659
|
+
await this.read(true);
|
|
11660
|
+
},
|
|
11661
|
+
remove: async (name) => {
|
|
11662
|
+
await deletePreset(name, this.abort.signal);
|
|
11663
|
+
await this.read(true);
|
|
11664
|
+
},
|
|
11665
|
+
author: async (name) => {
|
|
11666
|
+
this.openChat((await authorPreset(name, this.language(), this.abort.signal)).chatSessionId);
|
|
11667
|
+
},
|
|
11668
|
+
importFile: async (name, file) => {
|
|
11669
|
+
const opened = await importPreset(name, file, this.language(), this.abort.signal);
|
|
11670
|
+
await this.read(true);
|
|
11671
|
+
this.openChat(opened.chatSessionId);
|
|
11672
|
+
return {
|
|
11673
|
+
started: opened.started,
|
|
11674
|
+
...opened.failure === void 0 ? {} : { failure: opened.failure }
|
|
11675
|
+
};
|
|
11676
|
+
}
|
|
11677
|
+
};
|
|
11678
|
+
constructor(openChat, language) {
|
|
11679
|
+
this.openChat = openChat;
|
|
11680
|
+
this.language = language;
|
|
11681
|
+
}
|
|
11682
|
+
inject() {
|
|
11683
|
+
return this.face;
|
|
11684
|
+
}
|
|
11685
|
+
dispose() {
|
|
11686
|
+
this.abort.abort();
|
|
11687
|
+
}
|
|
11688
|
+
async read(refreshing) {
|
|
11689
|
+
this.store.update((draft) => {
|
|
11690
|
+
if (refreshing) draft.refreshing = true;
|
|
11691
|
+
else draft.status = "loading";
|
|
11692
|
+
});
|
|
11693
|
+
try {
|
|
11694
|
+
const presets = await listPresets(this.abort.signal);
|
|
11695
|
+
this.store.update((draft) => {
|
|
11696
|
+
draft.status = "ready";
|
|
11697
|
+
draft.presets = presets;
|
|
11698
|
+
delete draft.error;
|
|
11699
|
+
});
|
|
11700
|
+
} catch (error) {
|
|
11701
|
+
if (this.abort.signal.aborted) return;
|
|
11702
|
+
this.store.update((draft) => {
|
|
11703
|
+
draft.error = messageOf$1(error);
|
|
11704
|
+
if (draft.presets === void 0) draft.status = "failed";
|
|
11705
|
+
});
|
|
11706
|
+
} finally {
|
|
11707
|
+
if (!this.abort.signal.aborted) this.store.update((draft) => {
|
|
11708
|
+
draft.refreshing = false;
|
|
11709
|
+
});
|
|
11710
|
+
}
|
|
11711
|
+
}
|
|
11712
|
+
};
|
|
11713
|
+
//#endregion
|
|
11714
|
+
//#region src/client/pages/presets/index.ts
|
|
11715
|
+
const NAMESPACE$9 = "roleplay.presets";
|
|
11716
|
+
/** Adds the Presets page to the Role Play panel: reusable writing instructions for stories. */
|
|
11717
|
+
function registerPresetsPage(ctx) {
|
|
10489
11718
|
const t = ctx.locale.bind(NAMESPACE$9);
|
|
10490
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$9, dictionaries$8), "roleplay:
|
|
10491
|
-
const
|
|
11719
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$9, dictionaries$8), "roleplay: presets dictionaries");
|
|
11720
|
+
const presets = new PresetsController(createChatOpener(ctx), () => t("language"));
|
|
10492
11721
|
ctx.effect(() => () => {
|
|
10493
|
-
|
|
10494
|
-
}, "roleplay:
|
|
11722
|
+
presets.dispose();
|
|
11723
|
+
}, "roleplay: presets requests");
|
|
10495
11724
|
ctx.slots.inject("roleplay.page", () => ctx.slots.register({
|
|
10496
11725
|
name: "roleplay.page",
|
|
10497
|
-
id: "
|
|
10498
|
-
order:
|
|
11726
|
+
id: "presets",
|
|
11727
|
+
order: 7,
|
|
10499
11728
|
label: () => t("nav"),
|
|
10500
11729
|
locale: NAMESPACE$9,
|
|
10501
|
-
inject: () =>
|
|
10502
|
-
},
|
|
11730
|
+
inject: () => presets.inject()
|
|
11731
|
+
}, PresetsPage));
|
|
10503
11732
|
}
|
|
10504
11733
|
/** Page by what fits on screen, but never below the minimum page. */
|
|
10505
11734
|
function pagingFor(fit) {
|
|
@@ -10606,10 +11835,10 @@ window.__ModuleLoader__.load({
|
|
|
10606
11835
|
}
|
|
10607
11836
|
tag$15.textContent = css$15;
|
|
10608
11837
|
var DeleteSessionDialog_module_css_default = {
|
|
11838
|
+
"body": "rp_FifHrW_body",
|
|
10609
11839
|
"error": "rp_FifHrW_error",
|
|
10610
11840
|
"question": "rp_FifHrW_question",
|
|
10611
|
-
"warning": "rp_FifHrW_warning"
|
|
10612
|
-
"body": "rp_FifHrW_body"
|
|
11841
|
+
"warning": "rp_FifHrW_warning"
|
|
10613
11842
|
};
|
|
10614
11843
|
//#endregion
|
|
10615
11844
|
//#region src/client/pages/sessions/DeleteSessionDialog.tsx
|
|
@@ -10716,28 +11945,28 @@ window.__ModuleLoader__.load({
|
|
|
10716
11945
|
}
|
|
10717
11946
|
tag$14.textContent = css$14;
|
|
10718
11947
|
var SessionsPage_module_css_default = {
|
|
10719
|
-
"fits": "rp_24z4eW_fits",
|
|
10720
|
-
"table": "rp_24z4eW_table",
|
|
10721
11948
|
"spinning": "rp_24z4eW_spinning",
|
|
10722
|
-
"actions": "rp_24z4eW_actions",
|
|
10723
|
-
"nameColumn": "rp_24z4eW_nameColumn",
|
|
10724
11949
|
"turnsColumn": "rp_24z4eW_turnsColumn",
|
|
10725
|
-
"
|
|
11950
|
+
"secondary": "rp_24z4eW_secondary",
|
|
11951
|
+
"table": "rp_24z4eW_table",
|
|
11952
|
+
"page": "rp_24z4eW_page",
|
|
11953
|
+
"actions": "rp_24z4eW_actions",
|
|
10726
11954
|
"scrolls": "rp_24z4eW_scrolls",
|
|
10727
|
-
"
|
|
10728
|
-
"notice": "rp_24z4eW_notice",
|
|
10729
|
-
"message": "rp_24z4eW_message",
|
|
10730
|
-
"actionsColumn": "rp_24z4eW_actionsColumn",
|
|
11955
|
+
"nameColumn": "rp_24z4eW_nameColumn",
|
|
10731
11956
|
"spin": "rp_24z4eW_spin",
|
|
10732
|
-
"viewport": "rp_24z4eW_viewport",
|
|
10733
|
-
"archived": "rp_24z4eW_archived",
|
|
10734
11957
|
"count": "rp_24z4eW_count",
|
|
10735
|
-
"
|
|
11958
|
+
"fits": "rp_24z4eW_fits",
|
|
11959
|
+
"actionsColumn": "rp_24z4eW_actionsColumn",
|
|
11960
|
+
"viewport": "rp_24z4eW_viewport",
|
|
10736
11961
|
"name": "rp_24z4eW_name",
|
|
10737
|
-
"
|
|
11962
|
+
"message": "rp_24z4eW_message",
|
|
11963
|
+
"number": "rp_24z4eW_number",
|
|
11964
|
+
"archived": "rp_24z4eW_archived",
|
|
11965
|
+
"worldColumn": "rp_24z4eW_worldColumn",
|
|
11966
|
+
"notice": "rp_24z4eW_notice",
|
|
10738
11967
|
"toolbar": "rp_24z4eW_toolbar",
|
|
10739
11968
|
"badge": "rp_24z4eW_badge",
|
|
10740
|
-
"
|
|
11969
|
+
"timeColumn": "rp_24z4eW_timeColumn"
|
|
10741
11970
|
};
|
|
10742
11971
|
//#endregion
|
|
10743
11972
|
//#region src/client/pages/sessions/SessionsPage.tsx
|
|
@@ -11253,16 +12482,16 @@ window.__ModuleLoader__.load({
|
|
|
11253
12482
|
}
|
|
11254
12483
|
tag$13.textContent = css$13;
|
|
11255
12484
|
var WorldCard_module_css_default = {
|
|
11256
|
-
"tag": "rp_Bvxx5q_tag",
|
|
11257
|
-
"card": "rp_Bvxx5q_card",
|
|
11258
|
-
"info": "rp_Bvxx5q_info",
|
|
11259
|
-
"tags": "rp_Bvxx5q_tags",
|
|
11260
|
-
"name": "rp_Bvxx5q_name",
|
|
11261
12485
|
"cover": "rp_Bvxx5q_cover",
|
|
12486
|
+
"tags": "rp_Bvxx5q_tags",
|
|
12487
|
+
"placeholder": "rp_Bvxx5q_placeholder",
|
|
12488
|
+
"image": "rp_Bvxx5q_image",
|
|
12489
|
+
"info": "rp_Bvxx5q_info",
|
|
12490
|
+
"tag": "rp_Bvxx5q_tag",
|
|
11262
12491
|
"openButton": "rp_Bvxx5q_openButton",
|
|
12492
|
+
"name": "rp_Bvxx5q_name",
|
|
11263
12493
|
"play": "rp_Bvxx5q_play",
|
|
11264
|
-
"
|
|
11265
|
-
"image": "rp_Bvxx5q_image"
|
|
12494
|
+
"card": "rp_Bvxx5q_card"
|
|
11266
12495
|
};
|
|
11267
12496
|
//#endregion
|
|
11268
12497
|
//#region src/client/widgets/world-card/WorldCard.tsx
|
|
@@ -11358,8 +12587,8 @@ window.__ModuleLoader__.load({
|
|
|
11358
12587
|
var AvatarChoices_module_css_default = {
|
|
11359
12588
|
"text": "rp_YCstOG_text",
|
|
11360
12589
|
"name": "rp_YCstOG_name",
|
|
11361
|
-
"
|
|
11362
|
-
"
|
|
12590
|
+
"option": "rp_YCstOG_option",
|
|
12591
|
+
"summary": "rp_YCstOG_summary"
|
|
11363
12592
|
};
|
|
11364
12593
|
//#endregion
|
|
11365
12594
|
//#region src/client/widgets/avatar-choices/AvatarChoices.tsx
|
|
@@ -11399,18 +12628,18 @@ window.__ModuleLoader__.load({
|
|
|
11399
12628
|
}
|
|
11400
12629
|
tag$11.textContent = css$11;
|
|
11401
12630
|
var StartSessionDialog_module_css_default = {
|
|
11402
|
-
"
|
|
11403
|
-
"advancedToggle": "rp_AnbLKG_advancedToggle",
|
|
12631
|
+
"message": "rp_AnbLKG_message",
|
|
11404
12632
|
"error": "rp_AnbLKG_error",
|
|
12633
|
+
"advanced": "rp_AnbLKG_advanced",
|
|
12634
|
+
"advancedBody": "rp_AnbLKG_advancedBody",
|
|
12635
|
+
"option": "rp_AnbLKG_option",
|
|
11405
12636
|
"field": "rp_AnbLKG_field",
|
|
11406
12637
|
"label": "rp_AnbLKG_label",
|
|
11407
|
-
"optionSummary": "rp_AnbLKG_optionSummary",
|
|
11408
|
-
"optionText": "rp_AnbLKG_optionText",
|
|
11409
|
-
"message": "rp_AnbLKG_message",
|
|
11410
|
-
"option": "rp_AnbLKG_option",
|
|
11411
|
-
"advanced": "rp_AnbLKG_advanced",
|
|
11412
12638
|
"form": "rp_AnbLKG_form",
|
|
11413
|
-
"
|
|
12639
|
+
"optionText": "rp_AnbLKG_optionText",
|
|
12640
|
+
"optionSummary": "rp_AnbLKG_optionSummary",
|
|
12641
|
+
"advancedToggle": "rp_AnbLKG_advancedToggle",
|
|
12642
|
+
"optionName": "rp_AnbLKG_optionName"
|
|
11414
12643
|
};
|
|
11415
12644
|
//#endregion
|
|
11416
12645
|
//#region src/client/pages/worlds/AddAvatarsDialog.tsx
|
|
@@ -12283,14 +13512,14 @@ window.__ModuleLoader__.load({
|
|
|
12283
13512
|
}
|
|
12284
13513
|
tag$10.textContent = css$10;
|
|
12285
13514
|
var SettingsFields_module_css_default = {
|
|
12286
|
-
"
|
|
12287
|
-
"
|
|
12288
|
-
"field": "rp_Rhi3yq_field",
|
|
12289
|
-
"error": "rp_Rhi3yq_error",
|
|
13515
|
+
"area": "rp_Rhi3yq_area",
|
|
13516
|
+
"help": "rp_Rhi3yq_help",
|
|
12290
13517
|
"groupTitle": "rp_Rhi3yq_groupTitle",
|
|
13518
|
+
"error": "rp_Rhi3yq_error",
|
|
13519
|
+
"row": "rp_Rhi3yq_row",
|
|
12291
13520
|
"label": "rp_Rhi3yq_label",
|
|
12292
|
-
"
|
|
12293
|
-
"
|
|
13521
|
+
"field": "rp_Rhi3yq_field",
|
|
13522
|
+
"group": "rp_Rhi3yq_group"
|
|
12294
13523
|
};
|
|
12295
13524
|
//#endregion
|
|
12296
13525
|
//#region src/client/settings-form/SettingsFields.tsx
|
|
@@ -12558,8 +13787,8 @@ window.__ModuleLoader__.load({
|
|
|
12558
13787
|
tag$9.textContent = css$9;
|
|
12559
13788
|
var TranslateBanner_module_css_default = {
|
|
12560
13789
|
"banner": "rp_Lx8vJa_banner",
|
|
12561
|
-
"
|
|
12562
|
-
"
|
|
13790
|
+
"text": "rp_Lx8vJa_text",
|
|
13791
|
+
"error": "rp_Lx8vJa_error"
|
|
12563
13792
|
};
|
|
12564
13793
|
//#endregion
|
|
12565
13794
|
//#region src/client/pages/worlds/TranslateBanner.tsx
|
|
@@ -12627,6 +13856,7 @@ window.__ModuleLoader__.load({
|
|
|
12627
13856
|
const [name, setName] = (0, react.useState)(dialog.worldName);
|
|
12628
13857
|
const [opening, setOpening] = (0, react.useState)("");
|
|
12629
13858
|
const [startTime, setStartTime] = (0, react.useState)("");
|
|
13859
|
+
const [preset, setPreset] = (0, react.useState)("");
|
|
12630
13860
|
const [choice, setChoice] = (0, react.useState)();
|
|
12631
13861
|
const [brought, setBrought] = (0, react.useState)(/* @__PURE__ */ new Set());
|
|
12632
13862
|
const [showSettings, setShowSettings] = (0, react.useState)(false);
|
|
@@ -12686,6 +13916,7 @@ window.__ModuleLoader__.load({
|
|
|
12686
13916
|
...selected.startsWith("avatar:") ? { playerAvatar: selected.slice(7) } : { playerCharacterId: selected },
|
|
12687
13917
|
avatars: bringing.map((avatar) => avatar.key),
|
|
12688
13918
|
...!openingValid ? {} : { opening: Number(opening) },
|
|
13919
|
+
...preset === "" ? {} : { preset },
|
|
12689
13920
|
...startTime.trim() === "" || shown["clock.mode"] === "real" ? {} : { startingTime: startTime.trim() },
|
|
12690
13921
|
settings: fromDrafts(base, shown, options)
|
|
12691
13922
|
});
|
|
@@ -12777,6 +14008,42 @@ window.__ModuleLoader__.load({
|
|
|
12777
14008
|
}, index)] : [])]
|
|
12778
14009
|
})]
|
|
12779
14010
|
}),
|
|
14011
|
+
dialog.status === "ready" && (dialog.presets.length > 0 || dialog.suggestedPreset !== "") && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
14012
|
+
className: StartSessionDialog_module_css_default.field,
|
|
14013
|
+
children: [
|
|
14014
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
14015
|
+
className: StartSessionDialog_module_css_default.label,
|
|
14016
|
+
children: t("startPreset")
|
|
14017
|
+
}),
|
|
14018
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
14019
|
+
value: preset,
|
|
14020
|
+
disabled: dialog.submitting,
|
|
14021
|
+
"data-testid": "roleplay-start-preset",
|
|
14022
|
+
onChange: (event) => {
|
|
14023
|
+
setPreset(event.target.value);
|
|
14024
|
+
},
|
|
14025
|
+
children: [
|
|
14026
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
14027
|
+
value: "",
|
|
14028
|
+
children: dialog.suggestedPreset === "" ? t("startPresetDefault") : t("startPresetWorld", { name: dialog.suggestedPreset })
|
|
14029
|
+
}),
|
|
14030
|
+
dialog.suggestedPreset !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
14031
|
+
value: "none",
|
|
14032
|
+
children: t("startPresetNone")
|
|
14033
|
+
}),
|
|
14034
|
+
dialog.presets.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
14035
|
+
value: entry.name,
|
|
14036
|
+
disabled: entry.problems.length > 0,
|
|
14037
|
+
children: entry.problems.length > 0 ? t("startPresetBroken", { name: entry.title }) : entry.title
|
|
14038
|
+
}, entry.name))
|
|
14039
|
+
]
|
|
14040
|
+
}),
|
|
14041
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
14042
|
+
className: StartSessionDialog_module_css_default.message,
|
|
14043
|
+
children: preset === "" || preset === "none" ? t("startPresetHelp") : dialog.presets.find((entry) => entry.name === preset)?.description ?? ""
|
|
14044
|
+
})
|
|
14045
|
+
]
|
|
14046
|
+
}),
|
|
12780
14047
|
dialog.status === "ready" && shown["clock.mode"] !== "real" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
12781
14048
|
className: StartSessionDialog_module_css_default.field,
|
|
12782
14049
|
children: [
|
|
@@ -12900,6 +14167,15 @@ window.__ModuleLoader__.load({
|
|
|
12900
14167
|
const formId = (0, react.useId)();
|
|
12901
14168
|
const [folder, setFolder] = (0, react.useState)("");
|
|
12902
14169
|
const [name, setName] = (0, react.useState)("");
|
|
14170
|
+
const [preset, setPreset] = (0, react.useState)("");
|
|
14171
|
+
const [presets, setPresets] = (0, react.useState)([]);
|
|
14172
|
+
(0, react.useEffect)(() => {
|
|
14173
|
+
const abort = new AbortController();
|
|
14174
|
+
listPresets(abort.signal).then(setPresets, () => void 0);
|
|
14175
|
+
return () => {
|
|
14176
|
+
abort.abort();
|
|
14177
|
+
};
|
|
14178
|
+
}, []);
|
|
12903
14179
|
const [submitting, setSubmitting] = (0, react.useState)(false);
|
|
12904
14180
|
const [error, setError] = (0, react.useState)();
|
|
12905
14181
|
const create = async () => {
|
|
@@ -12913,7 +14189,8 @@ window.__ModuleLoader__.load({
|
|
|
12913
14189
|
headers: { "content-type": "application/json" },
|
|
12914
14190
|
body: JSON.stringify({
|
|
12915
14191
|
folder,
|
|
12916
|
-
name
|
|
14192
|
+
name,
|
|
14193
|
+
...preset === "" ? {} : { preset }
|
|
12917
14194
|
})
|
|
12918
14195
|
});
|
|
12919
14196
|
if (!response.ok) {
|
|
@@ -12987,6 +14264,34 @@ window.__ModuleLoader__.load({
|
|
|
12987
14264
|
}
|
|
12988
14265
|
})]
|
|
12989
14266
|
}),
|
|
14267
|
+
presets.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
14268
|
+
className: StartSessionDialog_module_css_default.field,
|
|
14269
|
+
children: [
|
|
14270
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
14271
|
+
className: StartSessionDialog_module_css_default.label,
|
|
14272
|
+
children: t("worldPreset")
|
|
14273
|
+
}),
|
|
14274
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
14275
|
+
value: preset,
|
|
14276
|
+
"data-testid": "roleplay-create-preset",
|
|
14277
|
+
onChange: (event) => {
|
|
14278
|
+
setPreset(event.target.value);
|
|
14279
|
+
},
|
|
14280
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
14281
|
+
value: "",
|
|
14282
|
+
children: t("worldPresetNone")
|
|
14283
|
+
}), presets.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
14284
|
+
value: entry.name,
|
|
14285
|
+
disabled: entry.problems.length > 0,
|
|
14286
|
+
children: entry.title
|
|
14287
|
+
}, entry.name))]
|
|
14288
|
+
}),
|
|
14289
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
14290
|
+
className: StartSessionDialog_module_css_default.message,
|
|
14291
|
+
children: t("worldPresetHelp")
|
|
14292
|
+
})
|
|
14293
|
+
]
|
|
14294
|
+
}),
|
|
12990
14295
|
error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12991
14296
|
className: StartSessionDialog_module_css_default.error,
|
|
12992
14297
|
role: "alert",
|
|
@@ -13034,25 +14339,25 @@ window.__ModuleLoader__.load({
|
|
|
13034
14339
|
}
|
|
13035
14340
|
tag$8.textContent = css$8;
|
|
13036
14341
|
var WorldsPage_module_css_default = {
|
|
13037
|
-
"
|
|
13038
|
-
"
|
|
13039
|
-
"fits": "rp_FHUyRq_fits",
|
|
13040
|
-
"toolbarActions": "rp_FHUyRq_toolbarActions",
|
|
13041
|
-
"spin": "rp_FHUyRq_spin",
|
|
14342
|
+
"message": "rp_FHUyRq_message",
|
|
14343
|
+
"editHeader": "rp_FHUyRq_editHeader",
|
|
13042
14344
|
"notice": "rp_FHUyRq_notice",
|
|
13043
|
-
"
|
|
14345
|
+
"spin": "rp_FHUyRq_spin",
|
|
13044
14346
|
"grid": "rp_FHUyRq_grid",
|
|
13045
|
-
"editHeader": "rp_FHUyRq_editHeader",
|
|
13046
|
-
"starter": "rp_FHUyRq_starter",
|
|
13047
|
-
"message": "rp_FHUyRq_message",
|
|
13048
|
-
"authorButton": "rp_FHUyRq_authorButton",
|
|
13049
14347
|
"editTitle": "rp_FHUyRq_editTitle",
|
|
14348
|
+
"fits": "rp_FHUyRq_fits",
|
|
14349
|
+
"toolbarActions": "rp_FHUyRq_toolbarActions",
|
|
13050
14350
|
"editBody": "rp_FHUyRq_editBody",
|
|
13051
|
-
"scrolls": "rp_FHUyRq_scrolls",
|
|
13052
14351
|
"starters": "rp_FHUyRq_starters",
|
|
13053
|
-
"
|
|
14352
|
+
"authorButton": "rp_FHUyRq_authorButton",
|
|
14353
|
+
"starter": "rp_FHUyRq_starter",
|
|
14354
|
+
"count": "rp_FHUyRq_count",
|
|
14355
|
+
"page": "rp_FHUyRq_page",
|
|
14356
|
+
"viewport": "rp_FHUyRq_viewport",
|
|
14357
|
+
"scrolls": "rp_FHUyRq_scrolls",
|
|
13054
14358
|
"cell": "rp_FHUyRq_cell",
|
|
13055
|
-
"
|
|
14359
|
+
"toolbar": "rp_FHUyRq_toolbar",
|
|
14360
|
+
"spinning": "rp_FHUyRq_spinning"
|
|
13056
14361
|
};
|
|
13057
14362
|
//#endregion
|
|
13058
14363
|
//#region src/client/pages/worlds/StarterWorlds.tsx
|
|
@@ -13122,34 +14427,34 @@ window.__ModuleLoader__.load({
|
|
|
13122
14427
|
}
|
|
13123
14428
|
tag$7.textContent = css$7;
|
|
13124
14429
|
var ImportCardPage_module_css_default = {
|
|
14430
|
+
"title": "rp_DmG_oG_title",
|
|
14431
|
+
"entryTitle": "rp_DmG_oG_entryTitle",
|
|
14432
|
+
"preview": "rp_DmG_oG_preview",
|
|
14433
|
+
"noPicture": "rp_DmG_oG_noPicture",
|
|
14434
|
+
"fieldTitle": "rp_DmG_oG_fieldTitle",
|
|
14435
|
+
"about": "rp_DmG_oG_about",
|
|
14436
|
+
"heading": "rp_DmG_oG_heading",
|
|
14437
|
+
"top": "rp_DmG_oG_top",
|
|
14438
|
+
"section": "rp_DmG_oG_section",
|
|
14439
|
+
"choice": "rp_DmG_oG_choice",
|
|
14440
|
+
"error": "rp_DmG_oG_error",
|
|
13125
14441
|
"tags": "rp_DmG_oG_tags",
|
|
14442
|
+
"picture": "rp_DmG_oG_picture",
|
|
14443
|
+
"label": "rp_DmG_oG_label",
|
|
13126
14444
|
"fieldMeta": "rp_DmG_oG_fieldMeta",
|
|
13127
|
-
"
|
|
14445
|
+
"page": "rp_DmG_oG_page",
|
|
14446
|
+
"choiceText": "rp_DmG_oG_choiceText",
|
|
14447
|
+
"header": "rp_DmG_oG_header",
|
|
14448
|
+
"body": "rp_DmG_oG_body",
|
|
14449
|
+
"note": "rp_DmG_oG_note",
|
|
14450
|
+
"field": "rp_DmG_oG_field",
|
|
13128
14451
|
"fieldHead": "rp_DmG_oG_fieldHead",
|
|
13129
14452
|
"row": "rp_DmG_oG_row",
|
|
13130
14453
|
"entryHead": "rp_DmG_oG_entryHead",
|
|
13131
|
-
"section": "rp_DmG_oG_section",
|
|
13132
|
-
"header": "rp_DmG_oG_header",
|
|
13133
|
-
"label": "rp_DmG_oG_label",
|
|
13134
|
-
"field": "rp_DmG_oG_field",
|
|
13135
|
-
"entryTitle": "rp_DmG_oG_entryTitle",
|
|
13136
|
-
"text": "rp_DmG_oG_text",
|
|
13137
|
-
"choiceText": "rp_DmG_oG_choiceText",
|
|
13138
|
-
"page": "rp_DmG_oG_page",
|
|
13139
|
-
"space": "rp_DmG_oG_space",
|
|
13140
|
-
"title": "rp_DmG_oG_title",
|
|
13141
|
-
"preview": "rp_DmG_oG_preview",
|
|
13142
14454
|
"entryOff": "rp_DmG_oG_entryOff",
|
|
13143
|
-
"
|
|
13144
|
-
"note": "rp_DmG_oG_note",
|
|
13145
|
-
"heading": "rp_DmG_oG_heading",
|
|
13146
|
-
"top": "rp_DmG_oG_top",
|
|
14455
|
+
"space": "rp_DmG_oG_space",
|
|
13147
14456
|
"entry": "rp_DmG_oG_entry",
|
|
13148
|
-
"
|
|
13149
|
-
"noPicture": "rp_DmG_oG_noPicture",
|
|
13150
|
-
"picture": "rp_DmG_oG_picture",
|
|
13151
|
-
"fieldTitle": "rp_DmG_oG_fieldTitle",
|
|
13152
|
-
"choice": "rp_DmG_oG_choice"
|
|
14457
|
+
"text": "rp_DmG_oG_text"
|
|
13153
14458
|
};
|
|
13154
14459
|
//#endregion
|
|
13155
14460
|
//#region src/client/pages/worlds/ImportCardPage.tsx
|
|
@@ -14183,6 +15488,12 @@ window.__ModuleLoader__.load({
|
|
|
14183
15488
|
startTitle: "Start a new session",
|
|
14184
15489
|
sessionName: "Session name",
|
|
14185
15490
|
playAs: "Play as",
|
|
15491
|
+
startPreset: "Writing preset",
|
|
15492
|
+
startPresetDefault: "Default style",
|
|
15493
|
+
startPresetWorld: "The world's suggestion ({name})",
|
|
15494
|
+
startPresetNone: "No preset",
|
|
15495
|
+
startPresetBroken: "{name} (has problems)",
|
|
15496
|
+
startPresetHelp: "A preset sets how the story is written. Presets are kept in the presets folder of your roleplay folder.",
|
|
14186
15497
|
startOpening: "Opening",
|
|
14187
15498
|
startOpeningDefault: "The world's own opening",
|
|
14188
15499
|
startTime: "Story starts at",
|
|
@@ -14202,6 +15513,9 @@ window.__ModuleLoader__.load({
|
|
|
14202
15513
|
worldFolder: "Folder name",
|
|
14203
15514
|
worldFolderHelp: "A new folder directly inside the roleplay worlds directory.",
|
|
14204
15515
|
worldName: "World name",
|
|
15516
|
+
worldPreset: "Suggested preset",
|
|
15517
|
+
worldPresetNone: "None",
|
|
15518
|
+
worldPresetHelp: "Writing instructions from your library for new stories of this world. It can be changed later in the editor.",
|
|
14205
15519
|
createWorldFailed: "Could not create the world: {message}",
|
|
14206
15520
|
importPreset: "Import narration preset",
|
|
14207
15521
|
presetOpening: "Opening…",
|
|
@@ -14292,6 +15606,12 @@ window.__ModuleLoader__.load({
|
|
|
14292
15606
|
startTitle: "开始新存档",
|
|
14293
15607
|
sessionName: "存档名称",
|
|
14294
15608
|
playAs: "扮演角色",
|
|
15609
|
+
startPreset: "写作预设",
|
|
15610
|
+
startPresetDefault: "默认风格",
|
|
15611
|
+
startPresetWorld: "世界的建议({name})",
|
|
15612
|
+
startPresetNone: "不使用预设",
|
|
15613
|
+
startPresetBroken: "{name}(有问题)",
|
|
15614
|
+
startPresetHelp: "预设决定故事的写法。预设保存在角色扮演文件夹的 presets 文件夹中。",
|
|
14295
15615
|
startOpening: "开场",
|
|
14296
15616
|
startOpeningDefault: "世界自带的开场",
|
|
14297
15617
|
startTime: "故事开始于",
|
|
@@ -14311,6 +15631,9 @@ window.__ModuleLoader__.load({
|
|
|
14311
15631
|
worldFolder: "文件夹名称",
|
|
14312
15632
|
worldFolderHelp: "将在角色扮演 worlds 目录下直接创建这个文件夹。",
|
|
14313
15633
|
worldName: "世界名称",
|
|
15634
|
+
worldPreset: "建议的预设",
|
|
15635
|
+
worldPresetNone: "无",
|
|
15636
|
+
worldPresetHelp: "库中的写作指令,供这个世界的新故事使用;之后可在编辑器中修改。",
|
|
14314
15637
|
createWorldFailed: "无法创建世界:{message}",
|
|
14315
15638
|
importPreset: "导入叙述预设",
|
|
14316
15639
|
presetOpening: "正在打开…",
|
|
@@ -14339,7 +15662,7 @@ window.__ModuleLoader__.load({
|
|
|
14339
15662
|
startAvatars: "带上角色形象",
|
|
14340
15663
|
startAvatarsHelp: "勾选要带进这个存档的角色形象,它们会成为存档中的角色,你也可以扮演它们。世界本身不会改变。"
|
|
14341
15664
|
}
|
|
14342
|
-
}, dictionaries$6), dictionaries$
|
|
15665
|
+
}, dictionaries$6), dictionaries$10);
|
|
14343
15666
|
//#endregion
|
|
14344
15667
|
//#region src/client/pages/worlds/worlds-controller.ts
|
|
14345
15668
|
async function request$1(path, init, signal) {
|
|
@@ -14464,11 +15787,17 @@ window.__ModuleLoader__.load({
|
|
|
14464
15787
|
openings: [],
|
|
14465
15788
|
startingTime: "",
|
|
14466
15789
|
timeZone: "",
|
|
15790
|
+
presets: [],
|
|
15791
|
+
suggestedPreset: "",
|
|
14467
15792
|
submitting: false
|
|
14468
15793
|
};
|
|
14469
15794
|
});
|
|
14470
15795
|
try {
|
|
14471
|
-
const [{ characters, openings, startingTime, timeZone }, avatars] = await Promise.all([
|
|
15796
|
+
const [{ characters, openings, startingTime, timeZone, preset }, avatars, presets] = await Promise.all([
|
|
15797
|
+
request$1(`/worlds/characters?id=${encodeURIComponent(worldId)}`, {}, this.abort.signal),
|
|
15798
|
+
listAvatars(this.abort.signal).catch(() => []),
|
|
15799
|
+
request$1("/presets", {}, this.abort.signal).catch(() => [])
|
|
15800
|
+
]);
|
|
14472
15801
|
this.updateDialog(token, (dialog) => {
|
|
14473
15802
|
dialog.status = "ready";
|
|
14474
15803
|
dialog.characters = characters;
|
|
@@ -14476,6 +15805,8 @@ window.__ModuleLoader__.load({
|
|
|
14476
15805
|
dialog.openings = openings;
|
|
14477
15806
|
dialog.startingTime = startingTime;
|
|
14478
15807
|
dialog.timeZone = timeZone;
|
|
15808
|
+
dialog.presets = presets;
|
|
15809
|
+
dialog.suggestedPreset = preset ?? "";
|
|
14479
15810
|
});
|
|
14480
15811
|
} catch (error) {
|
|
14481
15812
|
if (this.abort.signal.aborted) return;
|
|
@@ -14513,6 +15844,7 @@ window.__ModuleLoader__.load({
|
|
|
14513
15844
|
...options.avatars.length === 0 ? {} : { avatars: options.avatars },
|
|
14514
15845
|
...options.opening === void 0 ? {} : { opening: options.opening },
|
|
14515
15846
|
...options.startingTime === void 0 ? {} : { startingTime: options.startingTime },
|
|
15847
|
+
...options.preset === void 0 ? {} : { preset: options.preset },
|
|
14516
15848
|
...options.settings === void 0 ? {} : { settings: options.settings }
|
|
14517
15849
|
})
|
|
14518
15850
|
}, this.abort.signal);
|
|
@@ -14698,10 +16030,10 @@ window.__ModuleLoader__.load({
|
|
|
14698
16030
|
}
|
|
14699
16031
|
tag$6.textContent = css$6;
|
|
14700
16032
|
var BranchDialog_module_css_default = {
|
|
14701
|
-
"label": "rp_Dy1TaW_label",
|
|
14702
|
-
"form": "rp_Dy1TaW_form",
|
|
14703
16033
|
"field": "rp_Dy1TaW_field",
|
|
14704
|
-
"
|
|
16034
|
+
"form": "rp_Dy1TaW_form",
|
|
16035
|
+
"error": "rp_Dy1TaW_error",
|
|
16036
|
+
"label": "rp_Dy1TaW_label"
|
|
14705
16037
|
};
|
|
14706
16038
|
//#endregion
|
|
14707
16039
|
//#region src/client/branch/BranchDialog.tsx
|
|
@@ -14844,7 +16176,7 @@ window.__ModuleLoader__.load({
|
|
|
14844
16176
|
/** Adds the Gallery tab beside Chat and World: every image of the session in a grid. */
|
|
14845
16177
|
function registerGallery(ctx) {
|
|
14846
16178
|
const t = ctx.locale.bind(NAMESPACE$5);
|
|
14847
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$5, dictionaries$
|
|
16179
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$5, dictionaries$14), "roleplay: gallery dictionaries");
|
|
14848
16180
|
ctx.inject(["uiConversation"], (scope) => {
|
|
14849
16181
|
scope.uiConversation.views.register(galleryTarget);
|
|
14850
16182
|
scope.slots.inject("conversation.view", () => scope.slots.register({
|
|
@@ -15170,17 +16502,17 @@ window.__ModuleLoader__.load({
|
|
|
15170
16502
|
}
|
|
15171
16503
|
tag$5.textContent = css$5;
|
|
15172
16504
|
var SidebarPage_module_css_default = {
|
|
15173
|
-
"title": "rp_Ptco8a_title",
|
|
15174
|
-
"page": "rp_Ptco8a_page",
|
|
15175
16505
|
"bar": "rp_Ptco8a_bar",
|
|
15176
|
-
"content": "rp_Ptco8a_content",
|
|
15177
16506
|
"main": "rp_Ptco8a_main",
|
|
15178
|
-
"
|
|
16507
|
+
"title": "rp_Ptco8a_title",
|
|
16508
|
+
"icon": "rp_Ptco8a_icon",
|
|
16509
|
+
"entry": "rp_Ptco8a_entry",
|
|
15179
16510
|
"name": "rp_Ptco8a_name",
|
|
16511
|
+
"content": "rp_Ptco8a_content",
|
|
15180
16512
|
"text": "rp_Ptco8a_text",
|
|
15181
16513
|
"description": "rp_Ptco8a_description",
|
|
15182
|
-
"
|
|
15183
|
-
"
|
|
16514
|
+
"message": "rp_Ptco8a_message",
|
|
16515
|
+
"page": "rp_Ptco8a_page"
|
|
15184
16516
|
};
|
|
15185
16517
|
//#endregion
|
|
15186
16518
|
//#region src/client/interface/SidebarPage.tsx
|
|
@@ -15483,7 +16815,7 @@ window.__ModuleLoader__.load({
|
|
|
15483
16815
|
/** Adds the World tab beside Chat: the state of the story, by the part of the world. */
|
|
15484
16816
|
function registerWorld(ctx) {
|
|
15485
16817
|
const t = ctx.locale.bind(NAMESPACE$3);
|
|
15486
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$3, dictionaries$
|
|
16818
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$3, dictionaries$10), "roleplay: world dictionaries");
|
|
15487
16819
|
ctx.inject(["uiConversation"], (scope) => {
|
|
15488
16820
|
scope.uiConversation.views.register(worldTarget);
|
|
15489
16821
|
scope.slots.inject("conversation.view", () => scope.slots.register({
|
|
@@ -15508,26 +16840,26 @@ window.__ModuleLoader__.load({
|
|
|
15508
16840
|
}
|
|
15509
16841
|
tag$4.textContent = css$4;
|
|
15510
16842
|
var ChatSettingsView_module_css_default = {
|
|
15511
|
-
"
|
|
15512
|
-
"
|
|
15513
|
-
"
|
|
15514
|
-
"
|
|
15515
|
-
"
|
|
15516
|
-
"label": "rp_wLpbxW_label",
|
|
16843
|
+
"actions": "rp_wLpbxW_actions",
|
|
16844
|
+
"run": "rp_wLpbxW_run",
|
|
16845
|
+
"table": "rp_wLpbxW_table",
|
|
16846
|
+
"row": "rp_wLpbxW_row",
|
|
16847
|
+
"link": "rp_wLpbxW_link",
|
|
15517
16848
|
"reasons": "rp_wLpbxW_reasons",
|
|
15518
16849
|
"select": "rp_wLpbxW_select",
|
|
16850
|
+
"help": "rp_wLpbxW_help",
|
|
16851
|
+
"field": "rp_wLpbxW_field",
|
|
15519
16852
|
"description": "rp_wLpbxW_description",
|
|
16853
|
+
"pre": "rp_wLpbxW_pre",
|
|
16854
|
+
"notice": "rp_wLpbxW_notice",
|
|
16855
|
+
"message": "rp_wLpbxW_message",
|
|
15520
16856
|
"saved": "rp_wLpbxW_saved",
|
|
15521
|
-
"list": "rp_wLpbxW_list",
|
|
15522
16857
|
"view": "rp_wLpbxW_view",
|
|
15523
|
-
"
|
|
15524
|
-
"
|
|
15525
|
-
"
|
|
15526
|
-
"
|
|
15527
|
-
"
|
|
15528
|
-
"run": "rp_wLpbxW_run",
|
|
15529
|
-
"actions": "rp_wLpbxW_actions",
|
|
15530
|
-
"table": "rp_wLpbxW_table"
|
|
16858
|
+
"label": "rp_wLpbxW_label",
|
|
16859
|
+
"title": "rp_wLpbxW_title",
|
|
16860
|
+
"error": "rp_wLpbxW_error",
|
|
16861
|
+
"list": "rp_wLpbxW_list",
|
|
16862
|
+
"activity": "rp_wLpbxW_activity"
|
|
15531
16863
|
};
|
|
15532
16864
|
//#endregion
|
|
15533
16865
|
//#region src/client/chat-settings/settings-api.ts
|
|
@@ -15631,7 +16963,7 @@ window.__ModuleLoader__.load({
|
|
|
15631
16963
|
}
|
|
15632
16964
|
//#endregion
|
|
15633
16965
|
//#region src/client/chat-settings/InterfaceSection.tsx
|
|
15634
|
-
const message = (failure) => failure instanceof Error ? failure.message : String(failure);
|
|
16966
|
+
const message$1 = (failure) => failure instanceof Error ? failure.message : String(failure);
|
|
15635
16967
|
/**
|
|
15636
16968
|
* 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
|
|
15637
16969
|
* with the other settings, so it is saved with them), and, when the world's packs are not what the story copied, a way
|
|
@@ -15649,7 +16981,7 @@ window.__ModuleLoader__.load({
|
|
|
15649
16981
|
setStatus(next);
|
|
15650
16982
|
setFailure(void 0);
|
|
15651
16983
|
}, (error) => {
|
|
15652
|
-
if (!abort.signal.aborted) setFailure(message(error));
|
|
16984
|
+
if (!abort.signal.aborted) setFailure(message$1(error));
|
|
15653
16985
|
});
|
|
15654
16986
|
return () => {
|
|
15655
16987
|
abort.abort();
|
|
@@ -15670,7 +17002,7 @@ window.__ModuleLoader__.load({
|
|
|
15670
17002
|
setVersion((number) => number + 1);
|
|
15671
17003
|
}, (error) => {
|
|
15672
17004
|
setReport(void 0);
|
|
15673
|
-
setFailure(t("packSyncFailed", { message: message(error) }));
|
|
17005
|
+
setFailure(t("packSyncFailed", { message: message$1(error) }));
|
|
15674
17006
|
});
|
|
15675
17007
|
};
|
|
15676
17008
|
if (status === void 0) return failure === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -15784,6 +17116,123 @@ window.__ModuleLoader__.load({
|
|
|
15784
17116
|
});
|
|
15785
17117
|
}
|
|
15786
17118
|
//#endregion
|
|
17119
|
+
//#region src/client/chat-settings/PresetSection.tsx
|
|
17120
|
+
const message = (failure) => failure instanceof Error ? failure.message : String(failure);
|
|
17121
|
+
/** The writing preset the story's prompts came from, whether it still matches the library, and a way to switch or take it out. */
|
|
17122
|
+
function PresetSection({ t, session, disabled }) {
|
|
17123
|
+
const [status, setStatus] = (0, react.useState)();
|
|
17124
|
+
const [choice, setChoice] = (0, react.useState)("");
|
|
17125
|
+
const [failure, setFailure] = (0, react.useState)();
|
|
17126
|
+
const [report, setReport] = (0, react.useState)();
|
|
17127
|
+
const [sure, setSure] = (0, react.useState)(false);
|
|
17128
|
+
const [version, setVersion] = (0, react.useState)(0);
|
|
17129
|
+
(0, react.useEffect)(() => {
|
|
17130
|
+
const abort = new AbortController();
|
|
17131
|
+
loadPresetStatus(session, abort.signal).then((next) => {
|
|
17132
|
+
setStatus(next);
|
|
17133
|
+
setFailure(void 0);
|
|
17134
|
+
}, (error) => {
|
|
17135
|
+
if (!abort.signal.aborted) setFailure(message(error));
|
|
17136
|
+
});
|
|
17137
|
+
return () => {
|
|
17138
|
+
abort.abort();
|
|
17139
|
+
};
|
|
17140
|
+
}, [session, version]);
|
|
17141
|
+
const run = (name) => {
|
|
17142
|
+
setSure(false);
|
|
17143
|
+
applyPreset(session, name, new AbortController().signal).then((done) => {
|
|
17144
|
+
setReport(t("presetApplied", { count: done.files.length }));
|
|
17145
|
+
setFailure(void 0);
|
|
17146
|
+
setChoice("");
|
|
17147
|
+
setVersion((number) => number + 1);
|
|
17148
|
+
}, (error) => {
|
|
17149
|
+
setReport(void 0);
|
|
17150
|
+
setFailure(t("presetFailed", { message: message(error) }));
|
|
17151
|
+
});
|
|
17152
|
+
};
|
|
17153
|
+
if (status === void 0) return failure === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
17154
|
+
className: ChatSettingsView_module_css_default.error,
|
|
17155
|
+
role: "alert",
|
|
17156
|
+
children: t("presetLoadFailed", { message: failure })
|
|
17157
|
+
});
|
|
17158
|
+
if (status.applied === void 0 && status.available.length === 0) return null;
|
|
17159
|
+
const applied = status.applied;
|
|
17160
|
+
const library = applied === void 0 ? void 0 : status.available.find((entry) => entry.name === applied.name);
|
|
17161
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
17162
|
+
className: ChatSettingsView_module_css_default.activity,
|
|
17163
|
+
"data-testid": "roleplay-preset",
|
|
17164
|
+
children: [
|
|
17165
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("presetTitle") }),
|
|
17166
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
17167
|
+
className: ChatSettingsView_module_css_default.description,
|
|
17168
|
+
children: t("presetHelp")
|
|
17169
|
+
}),
|
|
17170
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
17171
|
+
className: ChatSettingsView_module_css_default.description,
|
|
17172
|
+
children: applied === void 0 ? t("presetNone") : t(`presetState_${applied.state}`, { name: library?.title ?? applied.name })
|
|
17173
|
+
}),
|
|
17174
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
17175
|
+
className: ChatSettingsView_module_css_default.field,
|
|
17176
|
+
style: { maxWidth: "none" },
|
|
17177
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
17178
|
+
className: ChatSettingsView_module_css_default.label,
|
|
17179
|
+
children: t("presetChoose")
|
|
17180
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
17181
|
+
className: ChatSettingsView_module_css_default.select,
|
|
17182
|
+
value: choice,
|
|
17183
|
+
disabled,
|
|
17184
|
+
onChange: (event) => {
|
|
17185
|
+
setChoice(event.target.value);
|
|
17186
|
+
setSure(false);
|
|
17187
|
+
},
|
|
17188
|
+
children: [
|
|
17189
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
17190
|
+
value: "",
|
|
17191
|
+
children: t("presetKeep")
|
|
17192
|
+
}),
|
|
17193
|
+
applied !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
17194
|
+
value: "__none",
|
|
17195
|
+
children: t("presetRemove")
|
|
17196
|
+
}),
|
|
17197
|
+
status.available.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
17198
|
+
value: entry.name,
|
|
17199
|
+
disabled: entry.problems.length > 0,
|
|
17200
|
+
children: entry.problems.length > 0 ? t("presetBroken", { name: entry.title }) : entry.title
|
|
17201
|
+
}, entry.name))
|
|
17202
|
+
]
|
|
17203
|
+
})]
|
|
17204
|
+
}),
|
|
17205
|
+
(choice !== "" || applied !== void 0 && applied.state === "changed") && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
17206
|
+
variant: "ghost",
|
|
17207
|
+
size: "sm",
|
|
17208
|
+
disabled,
|
|
17209
|
+
onClick: () => {
|
|
17210
|
+
if (sure) run(choice === "" ? applied?.name : choice === "__none" ? void 0 : choice);
|
|
17211
|
+
else setSure(true);
|
|
17212
|
+
},
|
|
17213
|
+
children: sure ? t("presetConfirm") : choice === "__none" ? t("presetTakeOut") : choice === "" ? t("presetReapply") : t("presetSwitch")
|
|
17214
|
+
}), sure && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
17215
|
+
type: "button",
|
|
17216
|
+
className: ChatSettingsView_module_css_default.link,
|
|
17217
|
+
onClick: () => {
|
|
17218
|
+
setSure(false);
|
|
17219
|
+
},
|
|
17220
|
+
children: t("vectorsCancel")
|
|
17221
|
+
})] }),
|
|
17222
|
+
report !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
17223
|
+
className: ChatSettingsView_module_css_default.description,
|
|
17224
|
+
role: "status",
|
|
17225
|
+
children: report
|
|
17226
|
+
}),
|
|
17227
|
+
failure !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
17228
|
+
className: ChatSettingsView_module_css_default.error,
|
|
17229
|
+
role: "alert",
|
|
17230
|
+
children: failure
|
|
17231
|
+
})
|
|
17232
|
+
]
|
|
17233
|
+
});
|
|
17234
|
+
}
|
|
17235
|
+
//#endregion
|
|
15787
17236
|
//#region src/client/chat-settings/ReflectionSection.tsx
|
|
15788
17237
|
const POLL_MS$1 = 3e3;
|
|
15789
17238
|
/** When the characters last sorted what they took in, and a way to have them do it now. */
|
|
@@ -16331,6 +17780,11 @@ window.__ModuleLoader__.load({
|
|
|
16331
17780
|
saved: payload.settings.interface.pack,
|
|
16332
17781
|
disabled: saving
|
|
16333
17782
|
}),
|
|
17783
|
+
session !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PresetSection, {
|
|
17784
|
+
t,
|
|
17785
|
+
session,
|
|
17786
|
+
disabled: saving
|
|
17787
|
+
}),
|
|
16334
17788
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolSwitches, {
|
|
16335
17789
|
board: payload.settings.tools,
|
|
16336
17790
|
onChange: setTools,
|
|
@@ -16498,6 +17952,24 @@ window.__ModuleLoader__.load({
|
|
|
16498
17952
|
reflectHelp: "Each character with something new sorts it into what it believes: beliefs are merged, firmed up or let go, each resting on events it took in. It runs in the background; you can keep playing.",
|
|
16499
17953
|
reflectFailed: "Could not start the reflection: {message}",
|
|
16500
17954
|
reflectError: "The last pass failed: {message}",
|
|
17955
|
+
presetTitle: "Writing preset",
|
|
17956
|
+
presetHelp: "The prose prompts this story copied from a preset. Changing it replaces those prompts from the next prompt used; the replaced copies are kept in the story's .trash folder. Prompts the world carried that a preset replaced are not brought back.",
|
|
17957
|
+
presetNone: "No preset is in use.",
|
|
17958
|
+
presetState_current: "Using {name}.",
|
|
17959
|
+
presetState_changed: "Using {name}, which has changed in the library since this story copied it.",
|
|
17960
|
+
presetState_edited: "Using {name}, but a copy was edited in this story. Re-applying replaces your edit.",
|
|
17961
|
+
presetState_missing: "Using {name}, which is no longer in the library; the story keeps its copies.",
|
|
17962
|
+
presetChoose: "Preset",
|
|
17963
|
+
presetKeep: "Keep the current one",
|
|
17964
|
+
presetRemove: "Take the preset out",
|
|
17965
|
+
presetBroken: "{name} (has problems)",
|
|
17966
|
+
presetConfirm: "Replace the story's copies?",
|
|
17967
|
+
presetTakeOut: "Take it out",
|
|
17968
|
+
presetReapply: "Re-apply from the library",
|
|
17969
|
+
presetSwitch: "Switch to it",
|
|
17970
|
+
presetApplied: "Done: {count} prompt(s) replaced.",
|
|
17971
|
+
presetFailed: "Could not change the preset: {message}",
|
|
17972
|
+
presetLoadFailed: "Could not read the preset: {message}",
|
|
16501
17973
|
packTitle: "Interface pack",
|
|
16502
17974
|
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.",
|
|
16503
17975
|
packActive: "In use: {name}",
|
|
@@ -16616,6 +18088,24 @@ window.__ModuleLoader__.load({
|
|
|
16616
18088
|
reflectHelp: "每个有新见闻的角色会把它们整理成自己的信念:合并、巩固或放下,每一条都要依据它接收到的事件。反思在后台进行,你可以继续游玩。",
|
|
16617
18089
|
reflectFailed: "无法开始反思:{message}",
|
|
16618
18090
|
reflectError: "上一次反思失败:{message}",
|
|
18091
|
+
presetTitle: "写作预设",
|
|
18092
|
+
presetHelp: "这个故事从预设复制来的叙述类提示词。更换后,从下一次使用提示词起生效;被替换的副本保存在故事的 .trash 文件夹中。世界自带、但被预设替换过的提示词不会恢复。",
|
|
18093
|
+
presetNone: "未使用预设。",
|
|
18094
|
+
presetState_current: "正在使用 {name}。",
|
|
18095
|
+
presetState_changed: "正在使用 {name},库中的这个预设在故事复制之后已有改动。",
|
|
18096
|
+
presetState_edited: "正在使用 {name},但故事中的副本被修改过。重新应用会覆盖你的修改。",
|
|
18097
|
+
presetState_missing: "正在使用 {name},它已不在库中;故事保留自己的副本。",
|
|
18098
|
+
presetChoose: "预设",
|
|
18099
|
+
presetKeep: "保持当前",
|
|
18100
|
+
presetRemove: "移除预设",
|
|
18101
|
+
presetBroken: "{name}(有问题)",
|
|
18102
|
+
presetConfirm: "替换故事中的副本?",
|
|
18103
|
+
presetTakeOut: "移除",
|
|
18104
|
+
presetReapply: "从库中重新应用",
|
|
18105
|
+
presetSwitch: "切换到它",
|
|
18106
|
+
presetApplied: "完成:替换了 {count} 条提示词。",
|
|
18107
|
+
presetFailed: "无法更改预设:{message}",
|
|
18108
|
+
presetLoadFailed: "无法读取预设:{message}",
|
|
16619
18109
|
packTitle: "界面包",
|
|
16620
18110
|
packHelp: "界面包会改变此故事的外观,并可添加状态条、按钮、开场卡片、背景或标签页。世界可以自带界面包;你自己的放在角色扮演目录的 ui 文件夹中。",
|
|
16621
18111
|
packActive: "使用中:{name}",
|
|
@@ -16641,7 +18131,7 @@ window.__ModuleLoader__.load({
|
|
|
16641
18131
|
saved: "已保存。",
|
|
16642
18132
|
saveFailed: "无法保存设置:{message}"
|
|
16643
18133
|
}
|
|
16644
|
-
}, dictionaries$6), dictionaries$
|
|
18134
|
+
}, dictionaries$6), dictionaries$15);
|
|
16645
18135
|
//#endregion
|
|
16646
18136
|
//#region src/client/chat-settings/index.ts
|
|
16647
18137
|
const NAMESPACE$2 = "roleplay.chatSettings";
|
|
@@ -16736,15 +18226,15 @@ window.__ModuleLoader__.load({
|
|
|
16736
18226
|
}
|
|
16737
18227
|
tag$3.textContent = css$3;
|
|
16738
18228
|
var CatalogueSettings_module_css_default = {
|
|
16739
|
-
"
|
|
16740
|
-
"field": "rp_KPhXDa_field",
|
|
16741
|
-
"problem": "rp_KPhXDa_problem",
|
|
16742
|
-
"keyHint": "rp_KPhXDa_keyHint",
|
|
18229
|
+
"section": "rp_KPhXDa_section",
|
|
16743
18230
|
"row": "rp_KPhXDa_row",
|
|
18231
|
+
"keyHint": "rp_KPhXDa_keyHint",
|
|
16744
18232
|
"title": "rp_KPhXDa_title",
|
|
16745
|
-
"
|
|
18233
|
+
"actions": "rp_KPhXDa_actions",
|
|
16746
18234
|
"hint": "rp_KPhXDa_hint",
|
|
16747
|
-
"
|
|
18235
|
+
"label": "rp_KPhXDa_label",
|
|
18236
|
+
"field": "rp_KPhXDa_field",
|
|
18237
|
+
"problem": "rp_KPhXDa_problem"
|
|
16748
18238
|
};
|
|
16749
18239
|
//#endregion
|
|
16750
18240
|
//#region src/client/settings/CatalogueSettings.tsx
|
|
@@ -17184,28 +18674,28 @@ window.__ModuleLoader__.load({
|
|
|
17184
18674
|
}
|
|
17185
18675
|
tag$2.textContent = css$2;
|
|
17186
18676
|
var NarrationView_module_css_default = {
|
|
17187
|
-
"
|
|
17188
|
-
"avatar": "rp_NFPimG_avatar",
|
|
17189
|
-
"speech": "rp_NFPimG_speech",
|
|
17190
|
-
"note": "rp_NFPimG_note",
|
|
17191
|
-
"line": "rp_NFPimG_line",
|
|
18677
|
+
"preview": "rp_NFPimG_preview",
|
|
17192
18678
|
"imageError": "rp_NFPimG_imageError",
|
|
17193
|
-
"name": "rp_NFPimG_name",
|
|
17194
|
-
"playLine": "rp_NFPimG_playLine",
|
|
17195
|
-
"sceneImage": "rp_NFPimG_sceneImage",
|
|
17196
18679
|
"dice": "rp_NFPimG_dice",
|
|
17197
|
-
"
|
|
18680
|
+
"diceList": "rp_NFPimG_diceList",
|
|
17198
18681
|
"output": "rp_NFPimG_output",
|
|
17199
|
-
"
|
|
17200
|
-
"oocRefused": "rp_NFPimG_oocRefused",
|
|
18682
|
+
"playAll": "rp_NFPimG_playAll",
|
|
17201
18683
|
"oocLabel": "rp_NFPimG_oocLabel",
|
|
17202
|
-
"preview": "rp_NFPimG_preview",
|
|
17203
|
-
"words": "rp_NFPimG_words",
|
|
17204
|
-
"images": "rp_NFPimG_images",
|
|
17205
18684
|
"imageButton": "rp_NFPimG_imageButton",
|
|
18685
|
+
"note": "rp_NFPimG_note",
|
|
18686
|
+
"playLine": "rp_NFPimG_playLine",
|
|
18687
|
+
"line": "rp_NFPimG_line",
|
|
18688
|
+
"oocRefused": "rp_NFPimG_oocRefused",
|
|
17206
18689
|
"imageStatus": "rp_NFPimG_imageStatus",
|
|
17207
|
-
"
|
|
17208
|
-
"diceSummary": "rp_NFPimG_diceSummary"
|
|
18690
|
+
"narration": "rp_NFPimG_narration",
|
|
18691
|
+
"diceSummary": "rp_NFPimG_diceSummary",
|
|
18692
|
+
"sceneImage": "rp_NFPimG_sceneImage",
|
|
18693
|
+
"name": "rp_NFPimG_name",
|
|
18694
|
+
"avatar": "rp_NFPimG_avatar",
|
|
18695
|
+
"speech": "rp_NFPimG_speech",
|
|
18696
|
+
"words": "rp_NFPimG_words",
|
|
18697
|
+
"oocNote": "rp_NFPimG_oocNote",
|
|
18698
|
+
"images": "rp_NFPimG_images"
|
|
17209
18699
|
};
|
|
17210
18700
|
//#endregion
|
|
17211
18701
|
//#region src/client/transcript/PreviewNode.tsx
|
|
@@ -17470,11 +18960,11 @@ window.__ModuleLoader__.load({
|
|
|
17470
18960
|
}
|
|
17471
18961
|
tag$1.textContent = css$1;
|
|
17472
18962
|
var SuggestionsDock_module_css_default = {
|
|
17473
|
-
"dock": "rp_rWH4DG_dock",
|
|
17474
|
-
"chip": "rp_rWH4DG_chip",
|
|
17475
18963
|
"card": "rp_rWH4DG_card",
|
|
18964
|
+
"dock": "rp_rWH4DG_dock",
|
|
18965
|
+
"lines": "rp_rWH4DG_lines",
|
|
17476
18966
|
"label": "rp_rWH4DG_label",
|
|
17477
|
-
"
|
|
18967
|
+
"chip": "rp_rWH4DG_chip"
|
|
17478
18968
|
};
|
|
17479
18969
|
//#endregion
|
|
17480
18970
|
//#region src/client/transcript/SuggestionsDock.tsx
|
|
@@ -17594,12 +19084,12 @@ window.__ModuleLoader__.load({
|
|
|
17594
19084
|
}
|
|
17595
19085
|
tag.textContent = css;
|
|
17596
19086
|
var TurnsDock_module_css_default = {
|
|
19087
|
+
"count": "rp_f4YLlq_count",
|
|
17597
19088
|
"error": "rp_f4YLlq_error",
|
|
17598
|
-
"select": "rp_f4YLlq_select",
|
|
17599
|
-
"button": "rp_f4YLlq_button",
|
|
17600
19089
|
"group": "rp_f4YLlq_group",
|
|
17601
|
-
"
|
|
17602
|
-
"
|
|
19090
|
+
"button": "rp_f4YLlq_button",
|
|
19091
|
+
"select": "rp_f4YLlq_select",
|
|
19092
|
+
"dock": "rp_f4YLlq_dock"
|
|
17603
19093
|
};
|
|
17604
19094
|
//#endregion
|
|
17605
19095
|
//#region src/client/transcript/withdrawn.ts
|
|
@@ -17967,6 +19457,7 @@ window.__ModuleLoader__.load({
|
|
|
17967
19457
|
registerPanel(ctx);
|
|
17968
19458
|
registerWorldsPage(ctx);
|
|
17969
19459
|
registerAvatarsPage(ctx);
|
|
19460
|
+
registerPresetsPage(ctx);
|
|
17970
19461
|
registerCataloguePage(ctx);
|
|
17971
19462
|
registerSessionsPage(ctx);
|
|
17972
19463
|
registerTranscript(ctx);
|