@dsh-agentic-roleplay/core 0.3.5 → 0.3.6
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 -5
- package/lib/client.js +1735 -459
- package/lib/client.js.map +1 -1
- package/lib/{deliver-Cl6bjp7g.js → deliver-BBgciEEK.js} +2 -2
- package/lib/doctor.js +3 -3
- package/lib/{hooks-DdO_tNhu.js → hooks-DkwFGtNH.js} +3 -3
- package/lib/index.js +394 -28
- package/lib/{load-Clkl0T7C.js → load-CVwJjIJ5.js} +7 -7
- package/lib/lorebook-author-tools-Bj31z1cu.js +619 -0
- package/lib/lorebook-authoring.js +67 -0
- package/lib/orchestration.js +6 -6
- package/lib/{pack-jail-ClMpVc__.js → pack-jail-2XztyYAX.js} +6 -5
- package/lib/{packs-BC2A3geF.js → packs-xHRCcGdb.js} +2 -2
- package/lib/preset-D0FMSeZ9.js +59 -0
- package/lib/{preset-author-tools-Dibp-LY9.js → preset-author-tools-BxycmoAr.js} +22 -16
- package/lib/preset-authoring.js +3 -3
- package/lib/{presets-DNjNxQL5.js → presets-gkBWAiVb.js} +44 -5
- package/lib/{reflection-Bju_LPFn.js → reflection-q0UpwXlx.js} +5 -5
- package/lib/{preset-ClQm7KPQ.js → tools-Dy1fgP6B.js} +424 -247
- package/package.json +3 -2
- package/prompts/en/import/lorebook.md +7 -0
- package/prompts/en/lorebook/persona.md +1 -0
- package/prompts/en/lorebook/procedure.md +1 -0
- package/prompts/en/lorebook/welcome.md +1 -0
- package/prompts/en/preset/persona.md +1 -1
- package/prompts/en/preset/procedure.md +1 -1
- package/prompts/zh/import/lorebook.md +7 -0
- package/prompts/zh/lorebook/persona.md +1 -0
- package/prompts/zh/lorebook/procedure.md +1 -0
- package/prompts/zh/lorebook/welcome.md +1 -0
- package/prompts/zh/preset/persona.md +1 -1
- package/prompts/zh/preset/procedure.md +1 -1
package/lib/client.js
CHANGED
|
@@ -26,19 +26,19 @@ 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$30 = ".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$30 = "src/client/panel/PageTabs.module.css";
|
|
31
|
+
let tag$30 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$30) + "]");
|
|
32
|
+
if (tag$30 === null) {
|
|
33
|
+
tag$30 = document.createElement("style");
|
|
34
|
+
tag$30.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
35
|
+
tag$30.dataset.pluginCss = key$30;
|
|
36
|
+
document.head.appendChild(tag$30);
|
|
37
|
+
}
|
|
38
|
+
tag$30.textContent = css$30;
|
|
39
39
|
var PageTabs_module_css_default = {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"tab": "rp_Poldga_tab",
|
|
41
|
+
"tabs": "rp_Poldga_tabs"
|
|
42
42
|
};
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/client/panel/PageTabs.tsx
|
|
@@ -82,19 +82,19 @@ 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$29 = ".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$29 = "src/client/panel/RoleplayPanel.module.css";
|
|
87
|
+
let tag$29 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$29) + "]");
|
|
88
|
+
if (tag$29 === null) {
|
|
89
|
+
tag$29 = document.createElement("style");
|
|
90
|
+
tag$29.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
91
|
+
tag$29.dataset.pluginCss = key$29;
|
|
92
|
+
document.head.appendChild(tag$29);
|
|
93
93
|
}
|
|
94
|
-
tag$
|
|
94
|
+
tag$29.textContent = css$29;
|
|
95
95
|
var RoleplayPanel_module_css_default = {
|
|
96
|
-
"body": "rp_ua5gBa_body",
|
|
97
96
|
"header": "rp_ua5gBa_header",
|
|
97
|
+
"body": "rp_ua5gBa_body",
|
|
98
98
|
"panel": "rp_ua5gBa_panel",
|
|
99
99
|
"title": "rp_ua5gBa_title"
|
|
100
100
|
};
|
|
@@ -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$18 = {
|
|
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$13 = "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$13);
|
|
207
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$13, dictionaries$18), "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$13,
|
|
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$13
|
|
233
233
|
}, PanelIcon));
|
|
234
234
|
}
|
|
235
235
|
//#endregion
|
|
@@ -311,6 +311,14 @@ window.__ModuleLoader__.load({
|
|
|
311
311
|
body: JSON.stringify(request)
|
|
312
312
|
}));
|
|
313
313
|
}
|
|
314
|
+
async function convertLorebook(request) {
|
|
315
|
+
return await answer$3(await fetch(`${API_PREFIX}/catalogue/convert/lorebook`, {
|
|
316
|
+
method: "POST",
|
|
317
|
+
credentials: "same-origin",
|
|
318
|
+
headers: { "content-type": "application/json" },
|
|
319
|
+
body: JSON.stringify(request)
|
|
320
|
+
}));
|
|
321
|
+
}
|
|
314
322
|
async function convertPreset(request) {
|
|
315
323
|
return await answer$3(await fetch(`${API_PREFIX}/catalogue/convert/preset`, {
|
|
316
324
|
method: "POST",
|
|
@@ -325,7 +333,7 @@ window.__ModuleLoader__.load({
|
|
|
325
333
|
}
|
|
326
334
|
//#endregion
|
|
327
335
|
//#region src/client/pages/catalogue/catalogue-controller.ts
|
|
328
|
-
const messageOf$
|
|
336
|
+
const messageOf$11 = (error) => error instanceof Error ? error.message : String(error);
|
|
329
337
|
/** The configured catalogues as the host sees them, read again whenever the settings change. */
|
|
330
338
|
var CatalogueController = class {
|
|
331
339
|
openChat;
|
|
@@ -366,7 +374,7 @@ window.__ModuleLoader__.load({
|
|
|
366
374
|
} catch (error) {
|
|
367
375
|
if (this.abort.signal.aborted) return;
|
|
368
376
|
this.store.update((draft) => {
|
|
369
|
-
draft.error = messageOf$
|
|
377
|
+
draft.error = messageOf$11(error);
|
|
370
378
|
if (draft.status === "loading") draft.status = "failed";
|
|
371
379
|
});
|
|
372
380
|
}
|
|
@@ -377,49 +385,49 @@ window.__ModuleLoader__.load({
|
|
|
377
385
|
};
|
|
378
386
|
//#endregion
|
|
379
387
|
//#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
|
|
380
|
-
const css$
|
|
381
|
-
const key$
|
|
382
|
-
let tag$
|
|
383
|
-
if (tag$
|
|
384
|
-
tag$
|
|
385
|
-
tag$
|
|
386
|
-
tag$
|
|
387
|
-
document.head.appendChild(tag$
|
|
388
|
+
const css$28 = ".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}";
|
|
389
|
+
const key$28 = "src/client/pages/catalogue/CataloguePage.module.css";
|
|
390
|
+
let tag$28 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$28) + "]");
|
|
391
|
+
if (tag$28 === null) {
|
|
392
|
+
tag$28 = document.createElement("style");
|
|
393
|
+
tag$28.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
394
|
+
tag$28.dataset.pluginCss = key$28;
|
|
395
|
+
document.head.appendChild(tag$28);
|
|
388
396
|
}
|
|
389
|
-
tag$
|
|
397
|
+
tag$28.textContent = css$28;
|
|
390
398
|
var CataloguePage_module_css_default = {
|
|
391
|
-
"success": "rp_qK1u-G_success",
|
|
392
|
-
"grid": "rp_qK1u-G_grid",
|
|
393
|
-
"notice": "rp_qK1u-G_notice",
|
|
394
|
-
"spacer": "rp_qK1u-G_spacer",
|
|
395
|
-
"select": "rp_qK1u-G_select",
|
|
396
399
|
"placeholder": "rp_qK1u-G_placeholder",
|
|
397
|
-
"
|
|
398
|
-
"name": "rp_qK1u-G_name",
|
|
399
|
-
"detail": "rp_qK1u-G_detail",
|
|
400
|
-
"description": "rp_qK1u-G_description",
|
|
400
|
+
"toolbar": "rp_qK1u-G_toolbar",
|
|
401
401
|
"meta": "rp_qK1u-G_meta",
|
|
402
|
+
"more": "rp_qK1u-G_more",
|
|
403
|
+
"form": "rp_qK1u-G_form",
|
|
404
|
+
"grid": "rp_qK1u-G_grid",
|
|
405
|
+
"card": "rp_qK1u-G_card",
|
|
402
406
|
"image": "rp_qK1u-G_image",
|
|
407
|
+
"updates": "rp_qK1u-G_updates",
|
|
408
|
+
"cover": "rp_qK1u-G_cover",
|
|
409
|
+
"warning": "rp_qK1u-G_warning",
|
|
403
410
|
"field": "rp_qK1u-G_field",
|
|
404
|
-
"
|
|
405
|
-
"changes": "rp_qK1u-G_changes",
|
|
406
|
-
"actions": "rp_qK1u-G_actions",
|
|
407
|
-
"toolbar": "rp_qK1u-G_toolbar",
|
|
411
|
+
"tags": "rp_qK1u-G_tags",
|
|
408
412
|
"search": "rp_qK1u-G_search",
|
|
409
413
|
"body": "rp_qK1u-G_body",
|
|
410
|
-
"
|
|
411
|
-
"
|
|
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",
|
|
414
|
+
"name": "rp_qK1u-G_name",
|
|
415
|
+
"description": "rp_qK1u-G_description",
|
|
418
416
|
"kind": "rp_qK1u-G_kind",
|
|
417
|
+
"spacer": "rp_qK1u-G_spacer",
|
|
418
|
+
"kinds": "rp_qK1u-G_kinds",
|
|
419
|
+
"success": "rp_qK1u-G_success",
|
|
420
|
+
"changes": "rp_qK1u-G_changes",
|
|
421
|
+
"label": "rp_qK1u-G_label",
|
|
422
|
+
"viewport": "rp_qK1u-G_viewport",
|
|
423
|
+
"select": "rp_qK1u-G_select",
|
|
424
|
+
"detail": "rp_qK1u-G_detail",
|
|
425
|
+
"status": "rp_qK1u-G_status",
|
|
426
|
+
"update": "rp_qK1u-G_update",
|
|
419
427
|
"page": "rp_qK1u-G_page",
|
|
420
|
-
"
|
|
421
|
-
"
|
|
422
|
-
"
|
|
428
|
+
"actions": "rp_qK1u-G_actions",
|
|
429
|
+
"notice": "rp_qK1u-G_notice",
|
|
430
|
+
"message": "rp_qK1u-G_message"
|
|
423
431
|
};
|
|
424
432
|
//#endregion
|
|
425
433
|
//#region src/client/pages/catalogue/ImportUrlDialog.tsx
|
|
@@ -493,7 +501,7 @@ window.__ModuleLoader__.load({
|
|
|
493
501
|
const date = new Date(iso);
|
|
494
502
|
return Number.isNaN(date.getTime()) ? iso : date.toLocaleDateString();
|
|
495
503
|
};
|
|
496
|
-
const messageOf$
|
|
504
|
+
const messageOf$10 = (problem) => problem instanceof Error ? problem.message : String(problem);
|
|
497
505
|
/** One entry of a catalogue: what it says about itself, its releases, and installing, updating or converting one of them. */
|
|
498
506
|
function WorldDialog({ t, source, id, name, kind, onClose, onChanged, openChat }) {
|
|
499
507
|
const [detail, setDetail] = (0, react.useState)();
|
|
@@ -510,7 +518,7 @@ window.__ModuleLoader__.load({
|
|
|
510
518
|
setDetail(loaded);
|
|
511
519
|
setVersionId(loaded.versions[0]?.id ?? "");
|
|
512
520
|
}, (problem) => {
|
|
513
|
-
if (!abort.signal.aborted) setError(messageOf$
|
|
521
|
+
if (!abort.signal.aborted) setError(messageOf$10(problem));
|
|
514
522
|
});
|
|
515
523
|
return () => {
|
|
516
524
|
abort.abort();
|
|
@@ -547,7 +555,7 @@ window.__ModuleLoader__.load({
|
|
|
547
555
|
}, (problem) => {
|
|
548
556
|
setBusy(void 0);
|
|
549
557
|
if (problem instanceof InstallConflict && problem.reason !== "exists") setConflict(problem);
|
|
550
|
-
else setFailure(t("installFailed", { message: messageOf$
|
|
558
|
+
else setFailure(t("installFailed", { message: messageOf$10(problem) }));
|
|
551
559
|
});
|
|
552
560
|
};
|
|
553
561
|
const runConvert = () => {
|
|
@@ -565,7 +573,7 @@ window.__ModuleLoader__.load({
|
|
|
565
573
|
openChat(result.chatSessionId);
|
|
566
574
|
onClose();
|
|
567
575
|
} catch (problem) {
|
|
568
|
-
setFailure(t("convertFailed", { message: messageOf$
|
|
576
|
+
setFailure(t("convertFailed", { message: messageOf$10(problem) }));
|
|
569
577
|
}
|
|
570
578
|
else setStarted({
|
|
571
579
|
...result,
|
|
@@ -573,7 +581,7 @@ window.__ModuleLoader__.load({
|
|
|
573
581
|
});
|
|
574
582
|
}, (problem) => {
|
|
575
583
|
setBusy(void 0);
|
|
576
|
-
setFailure(t("convertFailed", { message: messageOf$
|
|
584
|
+
setFailure(t("convertFailed", { message: messageOf$10(problem) }));
|
|
577
585
|
});
|
|
578
586
|
};
|
|
579
587
|
const runPreset = () => {
|
|
@@ -591,15 +599,42 @@ window.__ModuleLoader__.load({
|
|
|
591
599
|
openChat(result.chatSessionId);
|
|
592
600
|
onClose();
|
|
593
601
|
} catch (problem) {
|
|
594
|
-
setFailure(t("importPresetFailed", { message: messageOf$
|
|
602
|
+
setFailure(t("importPresetFailed", { message: messageOf$10(problem) }));
|
|
603
|
+
}
|
|
604
|
+
}, (problem) => {
|
|
605
|
+
setBusy(void 0);
|
|
606
|
+
setFailure(t("importPresetFailed", { message: messageOf$10(problem) }));
|
|
607
|
+
});
|
|
608
|
+
};
|
|
609
|
+
const runLorebook = () => {
|
|
610
|
+
if (version === void 0) return;
|
|
611
|
+
setBusy("lorebook");
|
|
612
|
+
setFailure(void 0);
|
|
613
|
+
convertLorebook({
|
|
614
|
+
source: source.name,
|
|
615
|
+
versionId: version.id,
|
|
616
|
+
title: detail?.name ?? name,
|
|
617
|
+
language: t("language")
|
|
618
|
+
}).then((result) => {
|
|
619
|
+
setBusy(void 0);
|
|
620
|
+
try {
|
|
621
|
+
openChat(result.chatSessionId);
|
|
622
|
+
onClose();
|
|
623
|
+
} catch (problem) {
|
|
624
|
+
setFailure(t("importLorebookFailed", { message: messageOf$10(problem) }));
|
|
595
625
|
}
|
|
596
626
|
}, (problem) => {
|
|
597
627
|
setBusy(void 0);
|
|
598
|
-
setFailure(t("
|
|
628
|
+
setFailure(t("importLorebookFailed", { message: messageOf$10(problem) }));
|
|
599
629
|
});
|
|
600
630
|
};
|
|
601
631
|
const idle = busy === void 0 && done === void 0 && started === void 0 && conflict === void 0;
|
|
602
|
-
const primary = kind === "
|
|
632
|
+
const primary = kind === "lorebook" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
633
|
+
variant: "primary",
|
|
634
|
+
disabled: !idle || version === void 0,
|
|
635
|
+
onClick: runLorebook,
|
|
636
|
+
children: busy === "lorebook" ? t("importingLorebook") : t("importLorebookAction")
|
|
637
|
+
}) : kind === "preset" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
603
638
|
variant: "primary",
|
|
604
639
|
disabled: !idle || version === void 0,
|
|
605
640
|
onClick: runPreset,
|
|
@@ -704,6 +739,10 @@ window.__ModuleLoader__.load({
|
|
|
704
739
|
className: CataloguePage_module_css_default.success,
|
|
705
740
|
children: t("importPresetNote")
|
|
706
741
|
}),
|
|
742
|
+
kind === "lorebook" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
743
|
+
className: CataloguePage_module_css_default.success,
|
|
744
|
+
children: t("importLorebookNote")
|
|
745
|
+
}),
|
|
707
746
|
kind === "card" && detail.converted !== void 0 && detail.converted.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
708
747
|
className: CataloguePage_module_css_default.success,
|
|
709
748
|
children: t("convertedBefore", { names: detail.converted.map((world) => world.name).join(", ") })
|
|
@@ -779,7 +818,7 @@ window.__ModuleLoader__.load({
|
|
|
779
818
|
openChat(started.chatSessionId);
|
|
780
819
|
onClose();
|
|
781
820
|
} catch (problem) {
|
|
782
|
-
setFailure(t("convertFailed", { message: messageOf$
|
|
821
|
+
setFailure(t("convertFailed", { message: messageOf$10(problem) }));
|
|
783
822
|
}
|
|
784
823
|
},
|
|
785
824
|
children: t("openChat")
|
|
@@ -936,7 +975,7 @@ window.__ModuleLoader__.load({
|
|
|
936
975
|
className: CataloguePage_module_css_default.search,
|
|
937
976
|
type: "search",
|
|
938
977
|
value: search,
|
|
939
|
-
placeholder: kind === "card" ? t("searchCardsPlaceholder") : kind === "preset" ? t("searchPresetsPlaceholder") : t("searchPlaceholder"),
|
|
978
|
+
placeholder: kind === "card" ? t("searchCardsPlaceholder") : kind === "preset" ? t("searchPresetsPlaceholder") : kind === "lorebook" ? t("searchLorebooksPlaceholder") : t("searchPlaceholder"),
|
|
940
979
|
"aria-label": t("search"),
|
|
941
980
|
disabled: source === void 0,
|
|
942
981
|
onChange: (event) => {
|
|
@@ -988,7 +1027,8 @@ window.__ModuleLoader__.load({
|
|
|
988
1027
|
children: [
|
|
989
1028
|
"world",
|
|
990
1029
|
"card",
|
|
991
|
-
"preset"
|
|
1030
|
+
"preset",
|
|
1031
|
+
"lorebook"
|
|
992
1032
|
].map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
993
1033
|
type: "button",
|
|
994
1034
|
role: "tab",
|
|
@@ -999,7 +1039,7 @@ window.__ModuleLoader__.load({
|
|
|
999
1039
|
setKind(entry);
|
|
1000
1040
|
setPage(void 0);
|
|
1001
1041
|
},
|
|
1002
|
-
children: entry === "world" ? t("kindWorlds") : entry === "card" ? t("kindCards") : t("kindPresets")
|
|
1042
|
+
children: entry === "world" ? t("kindWorlds") : entry === "card" ? t("kindCards") : entry === "preset" ? t("kindPresets") : t("kindLorebooks")
|
|
1003
1043
|
}, entry))
|
|
1004
1044
|
}),
|
|
1005
1045
|
source !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -1078,7 +1118,7 @@ window.__ModuleLoader__.load({
|
|
|
1078
1118
|
children: t("loading")
|
|
1079
1119
|
}) : page.items.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1080
1120
|
className: CataloguePage_module_css_default.message,
|
|
1081
|
-
children: applied === "" ? kind === "card" ? t("emptyCards") : kind === "preset" ? t("emptyPresets") : t("empty") : t("emptySearch", { search: applied })
|
|
1121
|
+
children: applied === "" ? kind === "card" ? t("emptyCards") : kind === "preset" ? t("emptyPresets") : kind === "lorebook" ? t("emptyLorebooks") : t("empty") : t("emptySearch", { search: applied })
|
|
1082
1122
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
1083
1123
|
className: CataloguePage_module_css_default.grid,
|
|
1084
1124
|
children: page.items.map((world) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -1170,7 +1210,7 @@ window.__ModuleLoader__.load({
|
|
|
1170
1210
|
}
|
|
1171
1211
|
//#endregion
|
|
1172
1212
|
//#region src/client/pages/catalogue/locales.ts
|
|
1173
|
-
const dictionaries$
|
|
1213
|
+
const dictionaries$17 = {
|
|
1174
1214
|
en: {
|
|
1175
1215
|
nav: "Catalogue",
|
|
1176
1216
|
loading: "Loading worlds…",
|
|
@@ -1219,6 +1259,13 @@ window.__ModuleLoader__.load({
|
|
|
1219
1259
|
kindCards: "Character cards",
|
|
1220
1260
|
searchCardsPlaceholder: "Search character cards",
|
|
1221
1261
|
emptyCards: "This catalogue has no published character cards for you.",
|
|
1262
|
+
kindLorebooks: "Lorebooks",
|
|
1263
|
+
searchLorebooksPlaceholder: "Search SillyTavern lorebooks",
|
|
1264
|
+
emptyLorebooks: "This catalogue has no published lorebooks for you.",
|
|
1265
|
+
importLorebookAction: "Import as a lorebook",
|
|
1266
|
+
importingLorebook: "Importing…",
|
|
1267
|
+
importLorebookNote: "A SillyTavern lorebook is turned into a new lorebook in your library by the authoring assistant: facts become entries known to everyone unless an entry says otherwise, and instructions to the AI are kept aside, to become a preset only if you agree. Importing it again makes another lorebook.",
|
|
1268
|
+
importLorebookFailed: "Could not import the lorebook: {message}",
|
|
1222
1269
|
kindPresets: "Presets",
|
|
1223
1270
|
searchPresetsPlaceholder: "Search SillyTavern presets",
|
|
1224
1271
|
emptyPresets: "This catalogue has no published presets for you.",
|
|
@@ -1302,6 +1349,13 @@ window.__ModuleLoader__.load({
|
|
|
1302
1349
|
kindCards: "角色卡",
|
|
1303
1350
|
searchCardsPlaceholder: "搜索角色卡",
|
|
1304
1351
|
emptyCards: "这个目录里没有对你开放的已发布角色卡。",
|
|
1352
|
+
kindLorebooks: "世界书",
|
|
1353
|
+
searchLorebooksPlaceholder: "搜索酒馆世界书",
|
|
1354
|
+
emptyLorebooks: "这个目录里没有对你开放的已发布世界书。",
|
|
1355
|
+
importLorebookAction: "导入为世界书",
|
|
1356
|
+
importingLorebook: "正在导入…",
|
|
1357
|
+
importLorebookNote: "酒馆世界书由创作助手转换为你的库中的一本新世界书:事实会变成人人皆知的条目(除非条目另有说明),给 AI 的指令会被单独保存,只有你同意才会变成预设。再次导入会生成另一本世界书。",
|
|
1358
|
+
importLorebookFailed: "无法导入世界书:{message}",
|
|
1305
1359
|
kindPresets: "预设",
|
|
1306
1360
|
searchPresetsPlaceholder: "搜索酒馆预设",
|
|
1307
1361
|
emptyPresets: "这个目录里没有对你开放的已发布预设。",
|
|
@@ -1340,11 +1394,11 @@ window.__ModuleLoader__.load({
|
|
|
1340
1394
|
};
|
|
1341
1395
|
//#endregion
|
|
1342
1396
|
//#region src/client/pages/catalogue/index.ts
|
|
1343
|
-
const NAMESPACE$
|
|
1397
|
+
const NAMESPACE$12 = "roleplay.catalogue";
|
|
1344
1398
|
/** Adds the Catalogue page to the Role Play panel: worlds of the catalogues set up in the settings. */
|
|
1345
1399
|
function registerCataloguePage(ctx) {
|
|
1346
|
-
const t = ctx.locale.bind(NAMESPACE$
|
|
1347
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$
|
|
1400
|
+
const t = ctx.locale.bind(NAMESPACE$12);
|
|
1401
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$12, dictionaries$17), "roleplay: catalogue dictionaries");
|
|
1348
1402
|
const catalogue = new CatalogueController(createChatOpener(ctx));
|
|
1349
1403
|
ctx.effect(() => () => {
|
|
1350
1404
|
catalogue.dispose();
|
|
@@ -1357,7 +1411,7 @@ window.__ModuleLoader__.load({
|
|
|
1357
1411
|
id: "catalogue",
|
|
1358
1412
|
order: 3,
|
|
1359
1413
|
label: () => t("nav"),
|
|
1360
|
-
locale: NAMESPACE$
|
|
1414
|
+
locale: NAMESPACE$12,
|
|
1361
1415
|
inject: () => catalogue.inject()
|
|
1362
1416
|
}, CataloguePage));
|
|
1363
1417
|
}
|
|
@@ -1419,7 +1473,7 @@ window.__ModuleLoader__.load({
|
|
|
1419
1473
|
}
|
|
1420
1474
|
//#endregion
|
|
1421
1475
|
//#region src/client/pages/avatars/avatars-controller.ts
|
|
1422
|
-
const messageOf$
|
|
1476
|
+
const messageOf$9 = (error) => error instanceof Error ? error.message : String(error);
|
|
1423
1477
|
/** Reads the player avatars from the host and makes and removes them. */
|
|
1424
1478
|
var AvatarsController = class {
|
|
1425
1479
|
store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
|
|
@@ -1466,7 +1520,7 @@ window.__ModuleLoader__.load({
|
|
|
1466
1520
|
} catch (error) {
|
|
1467
1521
|
if (this.abort.signal.aborted) return;
|
|
1468
1522
|
this.store.update((draft) => {
|
|
1469
|
-
draft.error = messageOf$
|
|
1523
|
+
draft.error = messageOf$9(error);
|
|
1470
1524
|
if (draft.avatars === void 0) draft.status = "failed";
|
|
1471
1525
|
});
|
|
1472
1526
|
} finally {
|
|
@@ -1874,51 +1928,51 @@ window.__ModuleLoader__.load({
|
|
|
1874
1928
|
const isDirty = (character, draft) => Object.keys(editOf$1(character, draft)).length > 0;
|
|
1875
1929
|
//#endregion
|
|
1876
1930
|
//#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
|
|
1877
|
-
const css$
|
|
1878
|
-
const key$
|
|
1879
|
-
let tag$
|
|
1880
|
-
if (tag$
|
|
1881
|
-
tag$
|
|
1882
|
-
tag$
|
|
1883
|
-
tag$
|
|
1884
|
-
document.head.appendChild(tag$
|
|
1931
|
+
const css$27 = ".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}}";
|
|
1932
|
+
const key$27 = "src/client/world-editor/CharactersPanel.module.css";
|
|
1933
|
+
let tag$27 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$27) + "]");
|
|
1934
|
+
if (tag$27 === null) {
|
|
1935
|
+
tag$27 = document.createElement("style");
|
|
1936
|
+
tag$27.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
1937
|
+
tag$27.dataset.pluginCss = key$27;
|
|
1938
|
+
document.head.appendChild(tag$27);
|
|
1885
1939
|
}
|
|
1886
|
-
tag$
|
|
1940
|
+
tag$27.textContent = css$27;
|
|
1887
1941
|
var CharactersPanel_module_css_default = {
|
|
1888
|
-
"
|
|
1889
|
-
"
|
|
1942
|
+
"grid": "rp_5ZMIxq_grid",
|
|
1943
|
+
"missing": "rp_5ZMIxq_missing",
|
|
1944
|
+
"tabOn": "rp_5ZMIxq_tabOn",
|
|
1890
1945
|
"tabs": "rp_5ZMIxq_tabs",
|
|
1946
|
+
"sectionTitle": "rp_5ZMIxq_sectionTitle",
|
|
1947
|
+
"field": "rp_5ZMIxq_field",
|
|
1891
1948
|
"tab": "rp_5ZMIxq_tab",
|
|
1892
|
-
"
|
|
1893
|
-
"
|
|
1894
|
-
"
|
|
1895
|
-
"
|
|
1896
|
-
"goal": "rp_5ZMIxq_goal",
|
|
1897
|
-
"grid": "rp_5ZMIxq_grid",
|
|
1898
|
-
"panel": "rp_5ZMIxq_panel",
|
|
1949
|
+
"initial": "rp_5ZMIxq_initial",
|
|
1950
|
+
"help": "rp_5ZMIxq_help",
|
|
1951
|
+
"body": "rp_5ZMIxq_body",
|
|
1952
|
+
"empty": "rp_5ZMIxq_empty",
|
|
1899
1953
|
"head": "rp_5ZMIxq_head",
|
|
1954
|
+
"sheet": "rp_5ZMIxq_sheet",
|
|
1955
|
+
"barText": "rp_5ZMIxq_barText",
|
|
1900
1956
|
"nameInput": "rp_5ZMIxq_nameInput",
|
|
1957
|
+
"portraitError": "rp_5ZMIxq_portraitError",
|
|
1958
|
+
"wide": "rp_5ZMIxq_wide",
|
|
1959
|
+
"label": "rp_5ZMIxq_label",
|
|
1960
|
+
"section": "rp_5ZMIxq_section",
|
|
1961
|
+
"select": "rp_5ZMIxq_select",
|
|
1901
1962
|
"portrait": "rp_5ZMIxq_portrait",
|
|
1902
1963
|
"portraitBox": "rp_5ZMIxq_portraitBox",
|
|
1903
|
-
"
|
|
1904
|
-
"tabsSpace": "rp_5ZMIxq_tabsSpace",
|
|
1905
|
-
"error": "rp_5ZMIxq_error",
|
|
1906
|
-
"voiceInline": "rp_5ZMIxq_voiceInline",
|
|
1907
|
-
"help": "rp_5ZMIxq_help",
|
|
1908
|
-
"tabOn": "rp_5ZMIxq_tabOn",
|
|
1909
|
-
"meta": "rp_5ZMIxq_meta",
|
|
1910
|
-
"empty": "rp_5ZMIxq_empty",
|
|
1911
|
-
"portraitError": "rp_5ZMIxq_portraitError",
|
|
1964
|
+
"row": "rp_5ZMIxq_row",
|
|
1912
1965
|
"portraitHint": "rp_5ZMIxq_portraitHint",
|
|
1913
|
-
"
|
|
1914
|
-
"
|
|
1915
|
-
"
|
|
1916
|
-
"
|
|
1917
|
-
"field": "rp_5ZMIxq_field",
|
|
1966
|
+
"meta": "rp_5ZMIxq_meta",
|
|
1967
|
+
"goal": "rp_5ZMIxq_goal",
|
|
1968
|
+
"portraitAction": "rp_5ZMIxq_portraitAction",
|
|
1969
|
+
"voiceInline": "rp_5ZMIxq_voiceInline",
|
|
1918
1970
|
"area": "rp_5ZMIxq_area",
|
|
1919
|
-
"
|
|
1920
|
-
"
|
|
1921
|
-
"
|
|
1971
|
+
"error": "rp_5ZMIxq_error",
|
|
1972
|
+
"tabsSpace": "rp_5ZMIxq_tabsSpace",
|
|
1973
|
+
"bar": "rp_5ZMIxq_bar",
|
|
1974
|
+
"panel": "rp_5ZMIxq_panel",
|
|
1975
|
+
"placeholder": "rp_5ZMIxq_placeholder"
|
|
1922
1976
|
};
|
|
1923
1977
|
//#endregion
|
|
1924
1978
|
//#region src/client/world-editor/EditorTabs.tsx
|
|
@@ -3367,7 +3421,7 @@ window.__ModuleLoader__.load({
|
|
|
3367
3421
|
}
|
|
3368
3422
|
//#endregion
|
|
3369
3423
|
//#region src/client/world-editor/FactionsPanel.tsx
|
|
3370
|
-
const list$
|
|
3424
|
+
const list$2 = (text) => text.split(",").map((value) => value.trim()).filter(Boolean);
|
|
3371
3425
|
function FactionsPanel({ t, world, source, onChanged, actions }) {
|
|
3372
3426
|
const [chosen, setChosen] = (0, react.useState)();
|
|
3373
3427
|
const [drafts, setDrafts] = (0, react.useState)({});
|
|
@@ -3398,10 +3452,10 @@ window.__ModuleLoader__.load({
|
|
|
3398
3452
|
const save = () => {
|
|
3399
3453
|
const edit = {
|
|
3400
3454
|
name: draft.name,
|
|
3401
|
-
aliases: list$
|
|
3455
|
+
aliases: list$2(draft.aliases),
|
|
3402
3456
|
summary: draft.summary,
|
|
3403
3457
|
description: draft.description,
|
|
3404
|
-
values: list$
|
|
3458
|
+
values: list$2(draft.values),
|
|
3405
3459
|
structure: draft.structure,
|
|
3406
3460
|
state: draft.state
|
|
3407
3461
|
};
|
|
@@ -3631,50 +3685,50 @@ window.__ModuleLoader__.load({
|
|
|
3631
3685
|
}
|
|
3632
3686
|
//#endregion
|
|
3633
3687
|
//#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
|
|
3634
|
-
const css$
|
|
3635
|
-
const key$
|
|
3636
|
-
let tag$
|
|
3637
|
-
if (tag$
|
|
3638
|
-
tag$
|
|
3639
|
-
tag$
|
|
3640
|
-
tag$
|
|
3641
|
-
document.head.appendChild(tag$
|
|
3688
|
+
const css$26 = ".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}}";
|
|
3689
|
+
const key$26 = "src/client/world-editor/RelationsPanel.module.css";
|
|
3690
|
+
let tag$26 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$26) + "]");
|
|
3691
|
+
if (tag$26 === null) {
|
|
3692
|
+
tag$26 = document.createElement("style");
|
|
3693
|
+
tag$26.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
3694
|
+
tag$26.dataset.pluginCss = key$26;
|
|
3695
|
+
document.head.appendChild(tag$26);
|
|
3642
3696
|
}
|
|
3643
|
-
tag$
|
|
3697
|
+
tag$26.textContent = css$26;
|
|
3644
3698
|
var RelationsPanel_module_css_default = {
|
|
3645
|
-
"
|
|
3646
|
-
"space": "rp_7pEHTW_space",
|
|
3699
|
+
"node_location": "rp_7pEHTW_node_location",
|
|
3647
3700
|
"notice": "rp_7pEHTW_notice",
|
|
3648
|
-
"
|
|
3649
|
-
"node_faction": "rp_7pEHTW_node_faction",
|
|
3650
|
-
"entities": "rp_7pEHTW_entities",
|
|
3651
|
-
"filterOn": "rp_7pEHTW_filterOn",
|
|
3652
|
-
"toolbar": "rp_7pEHTW_toolbar",
|
|
3653
|
-
"head": "rp_7pEHTW_head",
|
|
3654
|
-
"edgeOn": "rp_7pEHTW_edgeOn",
|
|
3655
|
-
"edgeTitle": "rp_7pEHTW_edgeTitle",
|
|
3701
|
+
"error": "rp_7pEHTW_error",
|
|
3656
3702
|
"form": "rp_7pEHTW_form",
|
|
3657
|
-
"
|
|
3658
|
-
"graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
|
|
3703
|
+
"graph": "rp_7pEHTW_graph",
|
|
3659
3704
|
"node_character": "rp_7pEHTW_node_character",
|
|
3705
|
+
"graphInspector": "rp_7pEHTW_graphInspector",
|
|
3706
|
+
"entities": "rp_7pEHTW_entities",
|
|
3707
|
+
"node_item": "rp_7pEHTW_node_item",
|
|
3708
|
+
"space": "rp_7pEHTW_space",
|
|
3709
|
+
"toolbar": "rp_7pEHTW_toolbar",
|
|
3710
|
+
"edgeKind": "rp_7pEHTW_edgeKind",
|
|
3711
|
+
"node_faction": "rp_7pEHTW_node_faction",
|
|
3660
3712
|
"graphEdge": "rp_7pEHTW_graphEdge",
|
|
3713
|
+
"node": "rp_7pEHTW_node",
|
|
3714
|
+
"filterOn": "rp_7pEHTW_filterOn",
|
|
3715
|
+
"inspector": "rp_7pEHTW_inspector",
|
|
3661
3716
|
"edge": "rp_7pEHTW_edge",
|
|
3662
3717
|
"perspective": "rp_7pEHTW_perspective",
|
|
3718
|
+
"edgeOn": "rp_7pEHTW_edgeOn",
|
|
3719
|
+
"metrics": "rp_7pEHTW_metrics",
|
|
3720
|
+
"actions": "rp_7pEHTW_actions",
|
|
3721
|
+
"wide": "rp_7pEHTW_wide",
|
|
3722
|
+
"graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
|
|
3663
3723
|
"list": "rp_7pEHTW_list",
|
|
3664
|
-
"node": "rp_7pEHTW_node",
|
|
3665
|
-
"graphInspector": "rp_7pEHTW_graphInspector",
|
|
3666
3724
|
"workspace": "rp_7pEHTW_workspace",
|
|
3667
|
-
"
|
|
3668
|
-
"metrics": "rp_7pEHTW_metrics",
|
|
3669
|
-
"inspector": "rp_7pEHTW_inspector",
|
|
3670
|
-
"filter": "rp_7pEHTW_filter",
|
|
3671
|
-
"error": "rp_7pEHTW_error",
|
|
3725
|
+
"edgeTitle": "rp_7pEHTW_edgeTitle",
|
|
3672
3726
|
"status": "rp_7pEHTW_status",
|
|
3673
|
-
"
|
|
3727
|
+
"panel": "rp_7pEHTW_panel",
|
|
3728
|
+
"head": "rp_7pEHTW_head",
|
|
3674
3729
|
"check": "rp_7pEHTW_check",
|
|
3675
|
-
"
|
|
3676
|
-
"
|
|
3677
|
-
"panel": "rp_7pEHTW_panel"
|
|
3730
|
+
"filter": "rp_7pEHTW_filter",
|
|
3731
|
+
"empty": "rp_7pEHTW_empty"
|
|
3678
3732
|
};
|
|
3679
3733
|
//#endregion
|
|
3680
3734
|
//#region src/client/world-editor/RelationsPanel.tsx
|
|
@@ -4991,23 +5045,23 @@ window.__ModuleLoader__.load({
|
|
|
4991
5045
|
};
|
|
4992
5046
|
//#endregion
|
|
4993
5047
|
//#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
|
|
4994
|
-
const css$
|
|
4995
|
-
const key$
|
|
4996
|
-
let tag$
|
|
4997
|
-
if (tag$
|
|
4998
|
-
tag$
|
|
4999
|
-
tag$
|
|
5000
|
-
tag$
|
|
5001
|
-
document.head.appendChild(tag$
|
|
5048
|
+
const css$25 = ".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}";
|
|
5049
|
+
const key$25 = "src/client/widgets/pack-frame/PackFrame.module.css";
|
|
5050
|
+
let tag$25 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$25) + "]");
|
|
5051
|
+
if (tag$25 === null) {
|
|
5052
|
+
tag$25 = document.createElement("style");
|
|
5053
|
+
tag$25.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
5054
|
+
tag$25.dataset.pluginCss = key$25;
|
|
5055
|
+
document.head.appendChild(tag$25);
|
|
5002
5056
|
}
|
|
5003
|
-
tag$
|
|
5057
|
+
tag$25.textContent = css$25;
|
|
5004
5058
|
var PackFrame_module_css_default = {
|
|
5059
|
+
"problems": "rp_h_sbFq_problems",
|
|
5005
5060
|
"hud": "rp_h_sbFq_hud",
|
|
5006
|
-
"fill": "rp_h_sbFq_fill",
|
|
5007
5061
|
"frame": "rp_h_sbFq_frame",
|
|
5008
|
-
"
|
|
5062
|
+
"message": "rp_h_sbFq_message",
|
|
5009
5063
|
"tab": "rp_h_sbFq_tab",
|
|
5010
|
-
"
|
|
5064
|
+
"fill": "rp_h_sbFq_fill"
|
|
5011
5065
|
};
|
|
5012
5066
|
//#endregion
|
|
5013
5067
|
//#region src/client/widgets/pack-frame/theme.ts
|
|
@@ -5259,24 +5313,24 @@ window.__ModuleLoader__.load({
|
|
|
5259
5313
|
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;
|
|
5260
5314
|
//#endregion
|
|
5261
5315
|
//#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
|
|
5262
|
-
const css$
|
|
5263
|
-
const key$
|
|
5264
|
-
let tag$
|
|
5265
|
-
if (tag$
|
|
5266
|
-
tag$
|
|
5267
|
-
tag$
|
|
5268
|
-
tag$
|
|
5269
|
-
document.head.appendChild(tag$
|
|
5316
|
+
const css$24 = ".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}";
|
|
5317
|
+
const key$24 = "src/client/world-editor/PacksPanel.module.css";
|
|
5318
|
+
let tag$24 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$24) + "]");
|
|
5319
|
+
if (tag$24 === null) {
|
|
5320
|
+
tag$24 = document.createElement("style");
|
|
5321
|
+
tag$24.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
5322
|
+
tag$24.dataset.pluginCss = key$24;
|
|
5323
|
+
document.head.appendChild(tag$24);
|
|
5270
5324
|
}
|
|
5271
|
-
tag$
|
|
5325
|
+
tag$24.textContent = css$24;
|
|
5272
5326
|
var PacksPanel_module_css_default = {
|
|
5273
|
-
"stage": "rp_FLaP7q_stage",
|
|
5274
5327
|
"controls": "rp_FLaP7q_controls",
|
|
5275
|
-
"
|
|
5276
|
-
"files": "rp_FLaP7q_files",
|
|
5328
|
+
"stageTall": "rp_FLaP7q_stageTall",
|
|
5277
5329
|
"note": "rp_FLaP7q_note",
|
|
5330
|
+
"stage": "rp_FLaP7q_stage",
|
|
5278
5331
|
"group": "rp_FLaP7q_group",
|
|
5279
|
-
"
|
|
5332
|
+
"log": "rp_FLaP7q_log",
|
|
5333
|
+
"files": "rp_FLaP7q_files"
|
|
5280
5334
|
};
|
|
5281
5335
|
//#endregion
|
|
5282
5336
|
//#region src/client/world-editor/PacksPanel.tsx
|
|
@@ -6172,6 +6226,85 @@ window.__ModuleLoader__.load({
|
|
|
6172
6226
|
});
|
|
6173
6227
|
}
|
|
6174
6228
|
//#endregion
|
|
6229
|
+
//#region src/client/lorebooks-api.ts
|
|
6230
|
+
async function reply$1(response) {
|
|
6231
|
+
if (!response.ok) {
|
|
6232
|
+
const body = await response.json().catch(() => void 0);
|
|
6233
|
+
throw new Error(typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim());
|
|
6234
|
+
}
|
|
6235
|
+
return await response.json();
|
|
6236
|
+
}
|
|
6237
|
+
const json$1 = (method, body) => ({
|
|
6238
|
+
method,
|
|
6239
|
+
credentials: "same-origin",
|
|
6240
|
+
headers: { "content-type": "application/json" },
|
|
6241
|
+
body: JSON.stringify(body)
|
|
6242
|
+
});
|
|
6243
|
+
const named = (name) => `name=${encodeURIComponent(name)}`;
|
|
6244
|
+
async function listLorebooks(signal) {
|
|
6245
|
+
return await reply$1(await fetch(`${API_PREFIX}/lorebooks`, {
|
|
6246
|
+
credentials: "same-origin",
|
|
6247
|
+
signal
|
|
6248
|
+
}));
|
|
6249
|
+
}
|
|
6250
|
+
async function readLorebook(name, signal) {
|
|
6251
|
+
return await reply$1(await fetch(`${API_PREFIX}/lorebooks/item?${named(name)}`, {
|
|
6252
|
+
credentials: "same-origin",
|
|
6253
|
+
signal
|
|
6254
|
+
}));
|
|
6255
|
+
}
|
|
6256
|
+
async function createLorebook(request, signal) {
|
|
6257
|
+
return await reply$1(await fetch(`${API_PREFIX}/lorebooks`, {
|
|
6258
|
+
...json$1("POST", request),
|
|
6259
|
+
signal
|
|
6260
|
+
}));
|
|
6261
|
+
}
|
|
6262
|
+
async function updateLorebookInfo(name, change, signal) {
|
|
6263
|
+
return await reply$1(await fetch(`${API_PREFIX}/lorebooks/item?${named(name)}`, {
|
|
6264
|
+
...json$1("PUT", change),
|
|
6265
|
+
signal
|
|
6266
|
+
}));
|
|
6267
|
+
}
|
|
6268
|
+
async function writeLorebookEntry(name, entry, signal) {
|
|
6269
|
+
const { id, ...rest } = entry;
|
|
6270
|
+
return await reply$1(await fetch(`${API_PREFIX}/lorebooks/entry?${named(name)}&id=${encodeURIComponent(id)}`, {
|
|
6271
|
+
...json$1("PUT", rest),
|
|
6272
|
+
signal
|
|
6273
|
+
}));
|
|
6274
|
+
}
|
|
6275
|
+
async function removeLorebookEntry(name, id, signal) {
|
|
6276
|
+
return await reply$1(await fetch(`${API_PREFIX}/lorebooks/entry?${named(name)}&id=${encodeURIComponent(id)}`, {
|
|
6277
|
+
method: "DELETE",
|
|
6278
|
+
credentials: "same-origin",
|
|
6279
|
+
signal
|
|
6280
|
+
}));
|
|
6281
|
+
}
|
|
6282
|
+
async function deleteLorebook(name, signal) {
|
|
6283
|
+
const response = await fetch(`${API_PREFIX}/lorebooks/item?${named(name)}`, {
|
|
6284
|
+
method: "DELETE",
|
|
6285
|
+
credentials: "same-origin",
|
|
6286
|
+
signal
|
|
6287
|
+
});
|
|
6288
|
+
if (!response.ok) await reply$1(response);
|
|
6289
|
+
}
|
|
6290
|
+
/** Opens the authoring chat of a lorebook. */
|
|
6291
|
+
async function authorLorebook(name, language, signal) {
|
|
6292
|
+
return await reply$1(await fetch(`${API_PREFIX}/lorebooks/authoring?${named(name)}`, {
|
|
6293
|
+
...json$1("POST", { language }),
|
|
6294
|
+
signal
|
|
6295
|
+
}));
|
|
6296
|
+
}
|
|
6297
|
+
/** Sends a SillyTavern lorebook to a new library lorebook, whose authoring chat turns it into entries. */
|
|
6298
|
+
async function importLorebook(name, file, language, signal) {
|
|
6299
|
+
return await reply$1(await fetch(`${API_PREFIX}/lorebooks/import?${named(name)}&language=${encodeURIComponent(language)}`, {
|
|
6300
|
+
method: "POST",
|
|
6301
|
+
credentials: "same-origin",
|
|
6302
|
+
headers: { "content-type": "application/json" },
|
|
6303
|
+
body: file,
|
|
6304
|
+
signal
|
|
6305
|
+
}));
|
|
6306
|
+
}
|
|
6307
|
+
//#endregion
|
|
6175
6308
|
//#region src/client/presets-api.ts
|
|
6176
6309
|
async function reply(response) {
|
|
6177
6310
|
if (!response.ok) {
|
|
@@ -6273,7 +6406,7 @@ window.__ModuleLoader__.load({
|
|
|
6273
6406
|
}
|
|
6274
6407
|
//#endregion
|
|
6275
6408
|
//#region src/client/world-editor/InfoPanel.tsx
|
|
6276
|
-
const draftOf$
|
|
6409
|
+
const draftOf$4 = (info) => ({
|
|
6277
6410
|
name: info.name,
|
|
6278
6411
|
description: info.description,
|
|
6279
6412
|
tags: info.tags.join(", "),
|
|
@@ -6285,6 +6418,7 @@ window.__ModuleLoader__.load({
|
|
|
6285
6418
|
startingTime: info.startingTime,
|
|
6286
6419
|
version: info.version,
|
|
6287
6420
|
preset: info.preset,
|
|
6421
|
+
lorebooks: info.lorebooks,
|
|
6288
6422
|
alternates: info.alternateOpenings
|
|
6289
6423
|
});
|
|
6290
6424
|
const lines = (value) => value.split("\n").map((line) => line.trim()).filter((line) => line !== "");
|
|
@@ -6303,6 +6437,7 @@ window.__ModuleLoader__.load({
|
|
|
6303
6437
|
"version",
|
|
6304
6438
|
"preset"
|
|
6305
6439
|
]) if (draft[key].trim() !== saved[key].trim()) edit[key] = draft[key];
|
|
6440
|
+
if (JSON.stringify(draft.lorebooks) !== JSON.stringify(saved.lorebooks)) edit["lorebooks"] = draft.lorebooks;
|
|
6306
6441
|
if (JSON.stringify(words(draft.tags)) !== JSON.stringify(words(saved.tags))) edit["tags"] = words(draft.tags);
|
|
6307
6442
|
if (JSON.stringify(lines(draft.rules)) !== JSON.stringify(lines(saved.rules))) edit["rules"] = lines(draft.rules);
|
|
6308
6443
|
const cleaned = (list) => list.map((entry) => ({
|
|
@@ -6321,9 +6456,11 @@ window.__ModuleLoader__.load({
|
|
|
6321
6456
|
const [status, setStatus] = (0, react.useState)({ state: "idle" });
|
|
6322
6457
|
const [playable, setPlayable] = (0, react.useState)([]);
|
|
6323
6458
|
const [presets, setPresets] = (0, react.useState)([]);
|
|
6459
|
+
const [books, setBooks] = (0, react.useState)([]);
|
|
6324
6460
|
(0, react.useEffect)(() => {
|
|
6325
6461
|
const abort = new AbortController();
|
|
6326
6462
|
listPresets(abort.signal).then(setPresets, () => void 0);
|
|
6463
|
+
listLorebooks(abort.signal).then(setBooks, () => void 0);
|
|
6327
6464
|
return () => {
|
|
6328
6465
|
abort.abort();
|
|
6329
6466
|
};
|
|
@@ -6339,8 +6476,8 @@ window.__ModuleLoader__.load({
|
|
|
6339
6476
|
const abort = new AbortController();
|
|
6340
6477
|
loadInfo(worldId, abort.signal).then((value) => {
|
|
6341
6478
|
setInfo(value);
|
|
6342
|
-
setSaved(draftOf$
|
|
6343
|
-
setDraft(draftOf$
|
|
6479
|
+
setSaved(draftOf$4(value));
|
|
6480
|
+
setDraft(draftOf$4(value));
|
|
6344
6481
|
}, (failure) => {
|
|
6345
6482
|
if (!abort.signal.aborted) setStatus({
|
|
6346
6483
|
state: "failed",
|
|
@@ -6358,6 +6495,13 @@ window.__ModuleLoader__.load({
|
|
|
6358
6495
|
});
|
|
6359
6496
|
const edit = changes(saved, draft);
|
|
6360
6497
|
const dirty = Object.keys(edit).length > 0;
|
|
6498
|
+
const setBooksDraft = (lorebooks) => {
|
|
6499
|
+
setDraft({
|
|
6500
|
+
...draft,
|
|
6501
|
+
lorebooks
|
|
6502
|
+
});
|
|
6503
|
+
setStatus({ state: "idle" });
|
|
6504
|
+
};
|
|
6361
6505
|
const set = (key, value) => {
|
|
6362
6506
|
setDraft({
|
|
6363
6507
|
...draft,
|
|
@@ -6376,8 +6520,8 @@ window.__ModuleLoader__.load({
|
|
|
6376
6520
|
setStatus({ state: "saving" });
|
|
6377
6521
|
saveInfo(worldId, edit, new AbortController().signal).then((value) => {
|
|
6378
6522
|
setInfo(value);
|
|
6379
|
-
setSaved(draftOf$
|
|
6380
|
-
setDraft(draftOf$
|
|
6523
|
+
setSaved(draftOf$4(value));
|
|
6524
|
+
setDraft(draftOf$4(value));
|
|
6381
6525
|
setStatus({ state: "saved" });
|
|
6382
6526
|
onSaved();
|
|
6383
6527
|
}, (failure) => {
|
|
@@ -6621,6 +6765,36 @@ window.__ModuleLoader__.load({
|
|
|
6621
6765
|
children: t("infoPresetHelp")
|
|
6622
6766
|
})
|
|
6623
6767
|
]
|
|
6768
|
+
}),
|
|
6769
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
6770
|
+
className: CharactersPanel_module_css_default.field,
|
|
6771
|
+
"data-testid": "roleplay-world-lorebooks",
|
|
6772
|
+
children: [
|
|
6773
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("legend", {
|
|
6774
|
+
className: CharactersPanel_module_css_default.label,
|
|
6775
|
+
children: t("infoLorebooks")
|
|
6776
|
+
}),
|
|
6777
|
+
books.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [
|
|
6778
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6779
|
+
type: "checkbox",
|
|
6780
|
+
checked: draft.lorebooks.includes(entry.name),
|
|
6781
|
+
disabled: entry.problems.length > 0,
|
|
6782
|
+
onChange: (event) => {
|
|
6783
|
+
setBooksDraft(event.target.checked ? [...draft.lorebooks, entry.name] : draft.lorebooks.filter((name) => name !== entry.name));
|
|
6784
|
+
}
|
|
6785
|
+
}),
|
|
6786
|
+
" ",
|
|
6787
|
+
entry.title
|
|
6788
|
+
] }, entry.name)),
|
|
6789
|
+
draft.lorebooks.filter((name) => !books.some((entry) => entry.name === name)).map((name) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6790
|
+
className: CharactersPanel_module_css_default.help,
|
|
6791
|
+
children: t("infoLorebookMissing", { name })
|
|
6792
|
+
}, name)),
|
|
6793
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6794
|
+
className: CharactersPanel_module_css_default.help,
|
|
6795
|
+
children: t("infoLorebooksHelp")
|
|
6796
|
+
})
|
|
6797
|
+
]
|
|
6624
6798
|
})
|
|
6625
6799
|
]
|
|
6626
6800
|
})]
|
|
@@ -6633,7 +6807,7 @@ window.__ModuleLoader__.load({
|
|
|
6633
6807
|
}
|
|
6634
6808
|
//#endregion
|
|
6635
6809
|
//#region src/client/world-editor/PromptsPanel.tsx
|
|
6636
|
-
const messageOf$
|
|
6810
|
+
const messageOf$8 = (error) => error instanceof Error ? error.message : String(error);
|
|
6637
6811
|
/** 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. */
|
|
6638
6812
|
function PromptsPanel({ t, worldId, language, actions }) {
|
|
6639
6813
|
const [tag, setTag] = (0, react.useState)(language);
|
|
@@ -6646,7 +6820,7 @@ window.__ModuleLoader__.load({
|
|
|
6646
6820
|
loadPrompts(worldId, tag, new AbortController().signal).then(setEntries, (failure) => {
|
|
6647
6821
|
setStatus({
|
|
6648
6822
|
state: "failed",
|
|
6649
|
-
message: messageOf$
|
|
6823
|
+
message: messageOf$8(failure)
|
|
6650
6824
|
});
|
|
6651
6825
|
});
|
|
6652
6826
|
}, [worldId, tag]);
|
|
@@ -6666,7 +6840,7 @@ window.__ModuleLoader__.load({
|
|
|
6666
6840
|
}, (failure) => {
|
|
6667
6841
|
if (!abort.signal.aborted) setStatus({
|
|
6668
6842
|
state: "failed",
|
|
6669
|
-
message: messageOf$
|
|
6843
|
+
message: messageOf$8(failure)
|
|
6670
6844
|
});
|
|
6671
6845
|
});
|
|
6672
6846
|
return () => {
|
|
@@ -6693,7 +6867,7 @@ window.__ModuleLoader__.load({
|
|
|
6693
6867
|
}, (failure) => {
|
|
6694
6868
|
setMade({
|
|
6695
6869
|
state: "failed",
|
|
6696
|
-
message: t("presetSaveFailed", { message: messageOf$
|
|
6870
|
+
message: t("presetSaveFailed", { message: messageOf$8(failure) })
|
|
6697
6871
|
});
|
|
6698
6872
|
});
|
|
6699
6873
|
};
|
|
@@ -6707,7 +6881,7 @@ window.__ModuleLoader__.load({
|
|
|
6707
6881
|
}, (failure) => {
|
|
6708
6882
|
setStatus({
|
|
6709
6883
|
state: "failed",
|
|
6710
|
-
message: messageOf$
|
|
6884
|
+
message: messageOf$8(failure)
|
|
6711
6885
|
});
|
|
6712
6886
|
});
|
|
6713
6887
|
};
|
|
@@ -7215,7 +7389,7 @@ window.__ModuleLoader__.load({
|
|
|
7215
7389
|
}
|
|
7216
7390
|
//#endregion
|
|
7217
7391
|
//#region src/client/world-editor/CalendarPanel.tsx
|
|
7218
|
-
const draftOf$
|
|
7392
|
+
const draftOf$3 = (calendar) => ({
|
|
7219
7393
|
hemisphere: calendar.hemisphere,
|
|
7220
7394
|
holidays: calendar.holidays.map((holiday) => ({
|
|
7221
7395
|
id: holiday.id,
|
|
@@ -7242,7 +7416,7 @@ window.__ModuleLoader__.load({
|
|
|
7242
7416
|
(0, react.useEffect)(() => {
|
|
7243
7417
|
const abort = new AbortController();
|
|
7244
7418
|
loadCalendar(worldId, abort.signal).then((value) => {
|
|
7245
|
-
const next = draftOf$
|
|
7419
|
+
const next = draftOf$3(value);
|
|
7246
7420
|
setSaved(next);
|
|
7247
7421
|
setDraft(next);
|
|
7248
7422
|
}, (failure) => {
|
|
@@ -7277,7 +7451,7 @@ window.__ModuleLoader__.load({
|
|
|
7277
7451
|
const save = () => {
|
|
7278
7452
|
setStatus({ state: "saving" });
|
|
7279
7453
|
saveCalendar(worldId, documentOf$1(draft), new AbortController().signal).then((value) => {
|
|
7280
|
-
const next = draftOf$
|
|
7454
|
+
const next = draftOf$3(value);
|
|
7281
7455
|
setSaved(next);
|
|
7282
7456
|
setDraft(next);
|
|
7283
7457
|
setStatus({ state: "saved" });
|
|
@@ -7548,28 +7722,28 @@ window.__ModuleLoader__.load({
|
|
|
7548
7722
|
}
|
|
7549
7723
|
//#endregion
|
|
7550
7724
|
//#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
|
|
7551
|
-
const css$
|
|
7552
|
-
const key$
|
|
7553
|
-
let tag$
|
|
7554
|
-
if (tag$
|
|
7555
|
-
tag$
|
|
7556
|
-
tag$
|
|
7557
|
-
tag$
|
|
7558
|
-
document.head.appendChild(tag$
|
|
7725
|
+
const css$23 = ".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}";
|
|
7726
|
+
const key$23 = "src/client/widgets/tool-switches/ToolSwitches.module.css";
|
|
7727
|
+
let tag$23 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$23) + "]");
|
|
7728
|
+
if (tag$23 === null) {
|
|
7729
|
+
tag$23 = document.createElement("style");
|
|
7730
|
+
tag$23.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
7731
|
+
tag$23.dataset.pluginCss = key$23;
|
|
7732
|
+
document.head.appendChild(tag$23);
|
|
7559
7733
|
}
|
|
7560
|
-
tag$
|
|
7734
|
+
tag$23.textContent = css$23;
|
|
7561
7735
|
var ToolSwitches_module_css_default = {
|
|
7562
|
-
"
|
|
7563
|
-
"
|
|
7564
|
-
"toolText": "rp_CjoFLq_toolText",
|
|
7736
|
+
"hint": "rp_CjoFLq_hint",
|
|
7737
|
+
"external": "rp_CjoFLq_external",
|
|
7565
7738
|
"tool": "rp_CjoFLq_tool",
|
|
7739
|
+
"help": "rp_CjoFLq_help",
|
|
7566
7740
|
"root": "rp_CjoFLq_root",
|
|
7567
|
-
"
|
|
7741
|
+
"agentName": "rp_CjoFLq_agentName",
|
|
7742
|
+
"toolText": "rp_CjoFLq_toolText",
|
|
7568
7743
|
"default": "rp_CjoFLq_default",
|
|
7569
|
-
"
|
|
7570
|
-
"external": "rp_CjoFLq_external",
|
|
7744
|
+
"title": "rp_CjoFLq_title",
|
|
7571
7745
|
"error": "rp_CjoFLq_error",
|
|
7572
|
-
"
|
|
7746
|
+
"agent": "rp_CjoFLq_agent"
|
|
7573
7747
|
};
|
|
7574
7748
|
//#endregion
|
|
7575
7749
|
//#region src/client/widgets/tool-switches/ToolSwitches.tsx
|
|
@@ -7738,7 +7912,7 @@ window.__ModuleLoader__.load({
|
|
|
7738
7912
|
}
|
|
7739
7913
|
//#endregion
|
|
7740
7914
|
//#region src/client/world-editor/DicePanel.tsx
|
|
7741
|
-
const draftOf$
|
|
7915
|
+
const draftOf$2 = (dice) => dice.checks.map((check) => ({
|
|
7742
7916
|
key: check.key,
|
|
7743
7917
|
name: check.name,
|
|
7744
7918
|
use: check.use,
|
|
@@ -7799,7 +7973,7 @@ window.__ModuleLoader__.load({
|
|
|
7799
7973
|
(0, react.useEffect)(() => {
|
|
7800
7974
|
const abort = new AbortController();
|
|
7801
7975
|
loadDice(worldId, abort.signal).then((value) => {
|
|
7802
|
-
const next = draftOf$
|
|
7976
|
+
const next = draftOf$2(value);
|
|
7803
7977
|
setSaved(next);
|
|
7804
7978
|
setDraft(next);
|
|
7805
7979
|
}, (failure) => {
|
|
@@ -7837,7 +8011,7 @@ window.__ModuleLoader__.load({
|
|
|
7837
8011
|
const save = () => {
|
|
7838
8012
|
setStatus({ state: "saving" });
|
|
7839
8013
|
saveDice(worldId, documentOf(draft), new AbortController().signal).then((value) => {
|
|
7840
|
-
const next = draftOf$
|
|
8014
|
+
const next = draftOf$2(value);
|
|
7841
8015
|
setSaved(next);
|
|
7842
8016
|
setDraft(next);
|
|
7843
8017
|
setStatus({ state: "saved" });
|
|
@@ -8138,7 +8312,7 @@ window.__ModuleLoader__.load({
|
|
|
8138
8312
|
}
|
|
8139
8313
|
//#endregion
|
|
8140
8314
|
//#region src/client/world-editor/variables-draft.ts
|
|
8141
|
-
const list = (value) => value.split(/[,,\n]/).map((entry) => entry.trim()).filter((entry) => entry !== "");
|
|
8315
|
+
const list$1 = (value) => value.split(/[,,\n]/).map((entry) => entry.trim()).filter((entry) => entry !== "");
|
|
8142
8316
|
const NEW = {
|
|
8143
8317
|
key: "",
|
|
8144
8318
|
name: "",
|
|
@@ -8156,7 +8330,7 @@ window.__ModuleLoader__.load({
|
|
|
8156
8330
|
options: "",
|
|
8157
8331
|
bands: ""
|
|
8158
8332
|
};
|
|
8159
|
-
const draftOf = (value) => ({
|
|
8333
|
+
const draftOf$1 = (value) => ({
|
|
8160
8334
|
key: value.key,
|
|
8161
8335
|
name: value.name,
|
|
8162
8336
|
kind: value.kind,
|
|
@@ -8188,8 +8362,8 @@ window.__ModuleLoader__.load({
|
|
|
8188
8362
|
const [min, max, only, options] = [
|
|
8189
8363
|
number(draft.min),
|
|
8190
8364
|
number(draft.max),
|
|
8191
|
-
list(draft.only),
|
|
8192
|
-
list(draft.options)
|
|
8365
|
+
list$1(draft.only),
|
|
8366
|
+
list$1(draft.options)
|
|
8193
8367
|
];
|
|
8194
8368
|
return {
|
|
8195
8369
|
key: draft.key.trim(),
|
|
@@ -8219,7 +8393,7 @@ window.__ModuleLoader__.load({
|
|
|
8219
8393
|
(0, react.useEffect)(() => {
|
|
8220
8394
|
const abort = new AbortController();
|
|
8221
8395
|
loadVariables(worldId, abort.signal).then((value) => {
|
|
8222
|
-
const drafts = value.map(draftOf);
|
|
8396
|
+
const drafts = value.map(draftOf$1);
|
|
8223
8397
|
setSaved(drafts);
|
|
8224
8398
|
setDraft(drafts);
|
|
8225
8399
|
}, (failure) => {
|
|
@@ -8248,7 +8422,7 @@ window.__ModuleLoader__.load({
|
|
|
8248
8422
|
const save = () => {
|
|
8249
8423
|
setStatus({ state: "saving" });
|
|
8250
8424
|
saveVariables(worldId, draft.map(declarationOf), new AbortController().signal).then((value) => {
|
|
8251
|
-
const drafts = value.map(draftOf);
|
|
8425
|
+
const drafts = value.map(draftOf$1);
|
|
8252
8426
|
setSaved(drafts);
|
|
8253
8427
|
setDraft(drafts);
|
|
8254
8428
|
setStatus({ state: "saved" });
|
|
@@ -8567,52 +8741,52 @@ window.__ModuleLoader__.load({
|
|
|
8567
8741
|
const imageUrl = (target, image) => `${route(target, "/file")}&path=${encodeURIComponent(image.path)}&v=${encodeURIComponent(image.createdAt)}`;
|
|
8568
8742
|
//#endregion
|
|
8569
8743
|
//#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
|
|
8570
|
-
const css$
|
|
8571
|
-
const key$
|
|
8572
|
-
let tag$
|
|
8573
|
-
if (tag$
|
|
8574
|
-
tag$
|
|
8575
|
-
tag$
|
|
8576
|
-
tag$
|
|
8577
|
-
document.head.appendChild(tag$
|
|
8744
|
+
const css$22 = ".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))}}";
|
|
8745
|
+
const key$22 = "src/client/widgets/gallery-view/GalleryView.module.css";
|
|
8746
|
+
let tag$22 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$22) + "]");
|
|
8747
|
+
if (tag$22 === null) {
|
|
8748
|
+
tag$22 = document.createElement("style");
|
|
8749
|
+
tag$22.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
8750
|
+
tag$22.dataset.pluginCss = key$22;
|
|
8751
|
+
document.head.appendChild(tag$22);
|
|
8578
8752
|
}
|
|
8579
|
-
tag$
|
|
8753
|
+
tag$22.textContent = css$22;
|
|
8580
8754
|
var GalleryView_module_css_default = {
|
|
8581
|
-
"editField": "rp_9pSHmG_editField",
|
|
8582
|
-
"editButton": "rp_9pSHmG_editButton",
|
|
8583
|
-
"reusable": "rp_9pSHmG_reusable",
|
|
8584
|
-
"pre": "rp_9pSHmG_pre",
|
|
8585
|
-
"editInput": "rp_9pSHmG_editInput",
|
|
8586
|
-
"count": "rp_9pSHmG_count",
|
|
8587
|
-
"tags": "rp_9pSHmG_tags",
|
|
8588
8755
|
"caption": "rp_9pSHmG_caption",
|
|
8589
|
-
"
|
|
8756
|
+
"reusable": "rp_9pSHmG_reusable",
|
|
8757
|
+
"facts": "rp_9pSHmG_facts",
|
|
8590
8758
|
"status": "rp_9pSHmG_status",
|
|
8591
8759
|
"error": "rp_9pSHmG_error",
|
|
8592
|
-
"
|
|
8760
|
+
"edit": "rp_9pSHmG_edit",
|
|
8761
|
+
"count": "rp_9pSHmG_count",
|
|
8762
|
+
"editLabel": "rp_9pSHmG_editLabel",
|
|
8763
|
+
"editInput": "rp_9pSHmG_editInput",
|
|
8764
|
+
"select": "rp_9pSHmG_select",
|
|
8765
|
+
"large": "rp_9pSHmG_large",
|
|
8766
|
+
"pre": "rp_9pSHmG_pre",
|
|
8593
8767
|
"page": "rp_9pSHmG_page",
|
|
8594
|
-
"
|
|
8768
|
+
"open": "rp_9pSHmG_open",
|
|
8769
|
+
"message": "rp_9pSHmG_message",
|
|
8595
8770
|
"editHelp": "rp_9pSHmG_editHelp",
|
|
8771
|
+
"note": "rp_9pSHmG_note",
|
|
8772
|
+
"cell": "rp_9pSHmG_cell",
|
|
8773
|
+
"grid": "rp_9pSHmG_grid",
|
|
8774
|
+
"image": "rp_9pSHmG_image",
|
|
8596
8775
|
"toolbar": "rp_9pSHmG_toolbar",
|
|
8597
|
-
"
|
|
8598
|
-
"
|
|
8599
|
-
"
|
|
8776
|
+
"detail": "rp_9pSHmG_detail",
|
|
8777
|
+
"statusError": "rp_9pSHmG_statusError",
|
|
8778
|
+
"editField": "rp_9pSHmG_editField",
|
|
8600
8779
|
"thumb": "rp_9pSHmG_thumb",
|
|
8601
8780
|
"editArea": "rp_9pSHmG_editArea",
|
|
8602
|
-
"
|
|
8603
|
-
"
|
|
8604
|
-
"
|
|
8605
|
-
"cell": "rp_9pSHmG_cell",
|
|
8606
|
-
"statusError": "rp_9pSHmG_statusError",
|
|
8607
|
-
"detail": "rp_9pSHmG_detail",
|
|
8608
|
-
"edit": "rp_9pSHmG_edit",
|
|
8609
|
-
"large": "rp_9pSHmG_large"
|
|
8781
|
+
"tags": "rp_9pSHmG_tags",
|
|
8782
|
+
"editButton": "rp_9pSHmG_editButton",
|
|
8783
|
+
"actions": "rp_9pSHmG_actions"
|
|
8610
8784
|
};
|
|
8611
8785
|
//#endregion
|
|
8612
8786
|
//#region src/client/widgets/gallery-view/GalleryView.tsx
|
|
8613
8787
|
/** How often the list is read again while pictures are waiting to be described. */
|
|
8614
8788
|
const POLL_MS$2 = 3e3;
|
|
8615
|
-
const messageOf$
|
|
8789
|
+
const messageOf$7 = (error) => error instanceof Error ? error.message : String(error);
|
|
8616
8790
|
function EditDialog({ t, image, onSave, onClose }) {
|
|
8617
8791
|
const [description, setDescription] = (0, react.useState)(image.description ?? "");
|
|
8618
8792
|
const [tags, setTags] = (0, react.useState)(image.tags.join(", "));
|
|
@@ -8626,7 +8800,7 @@ window.__ModuleLoader__.load({
|
|
|
8626
8800
|
tags: tags.split(/[,,]/).map((tag) => tag.trim()).filter((tag) => tag !== "")
|
|
8627
8801
|
}).then(onClose, (failure) => {
|
|
8628
8802
|
setBusy(false);
|
|
8629
|
-
setError(messageOf$
|
|
8803
|
+
setError(messageOf$7(failure));
|
|
8630
8804
|
});
|
|
8631
8805
|
};
|
|
8632
8806
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
@@ -8713,7 +8887,7 @@ window.__ModuleLoader__.load({
|
|
|
8713
8887
|
if (!signal.aborted) {
|
|
8714
8888
|
setLoad({
|
|
8715
8889
|
status: "failed",
|
|
8716
|
-
message: messageOf$
|
|
8890
|
+
message: messageOf$7(failure)
|
|
8717
8891
|
});
|
|
8718
8892
|
setRefreshing(false);
|
|
8719
8893
|
}
|
|
@@ -8760,7 +8934,7 @@ window.__ModuleLoader__.load({
|
|
|
8760
8934
|
} catch (failure) {
|
|
8761
8935
|
setNotice(t("uploadFailed", {
|
|
8762
8936
|
name: file.name,
|
|
8763
|
-
message: messageOf$
|
|
8937
|
+
message: messageOf$7(failure)
|
|
8764
8938
|
}));
|
|
8765
8939
|
}
|
|
8766
8940
|
setUploading(false);
|
|
@@ -8777,7 +8951,7 @@ window.__ModuleLoader__.load({
|
|
|
8777
8951
|
};
|
|
8778
8952
|
const mark = (image, reusable) => {
|
|
8779
8953
|
updateImage(target, image.path, { reusable }, new AbortController().signal).then(replace, (failure) => {
|
|
8780
|
-
setNotice(t("updateFailed", { message: messageOf$
|
|
8954
|
+
setNotice(t("updateFailed", { message: messageOf$7(failure) }));
|
|
8781
8955
|
});
|
|
8782
8956
|
};
|
|
8783
8957
|
const { images, failures } = load.contents;
|
|
@@ -8936,24 +9110,24 @@ window.__ModuleLoader__.load({
|
|
|
8936
9110
|
}
|
|
8937
9111
|
//#endregion
|
|
8938
9112
|
//#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
|
|
8939
|
-
const css$
|
|
8940
|
-
const key$
|
|
8941
|
-
let tag$
|
|
8942
|
-
if (tag$
|
|
8943
|
-
tag$
|
|
8944
|
-
tag$
|
|
8945
|
-
tag$
|
|
8946
|
-
document.head.appendChild(tag$
|
|
9113
|
+
const css$21 = ".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}";
|
|
9114
|
+
const key$21 = "src/client/world-editor/WorldEditor.module.css";
|
|
9115
|
+
let tag$21 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$21) + "]");
|
|
9116
|
+
if (tag$21 === null) {
|
|
9117
|
+
tag$21 = document.createElement("style");
|
|
9118
|
+
tag$21.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
9119
|
+
tag$21.dataset.pluginCss = key$21;
|
|
9120
|
+
document.head.appendChild(tag$21);
|
|
8947
9121
|
}
|
|
8948
|
-
tag$
|
|
9122
|
+
tag$21.textContent = css$21;
|
|
8949
9123
|
var WorldEditor_module_css_default = {
|
|
8950
|
-
"
|
|
9124
|
+
"content": "rp__swA3a_content",
|
|
8951
9125
|
"drawerItemOn": "rp__swA3a_drawerItemOn",
|
|
9126
|
+
"message": "rp__swA3a_message",
|
|
8952
9127
|
"drawer": "rp__swA3a_drawer",
|
|
9128
|
+
"view": "rp__swA3a_view",
|
|
8953
9129
|
"warning": "rp__swA3a_warning",
|
|
8954
|
-
"drawerItem": "rp__swA3a_drawerItem"
|
|
8955
|
-
"content": "rp__swA3a_content",
|
|
8956
|
-
"view": "rp__swA3a_view"
|
|
9130
|
+
"drawerItem": "rp__swA3a_drawerItem"
|
|
8957
9131
|
};
|
|
8958
9132
|
//#endregion
|
|
8959
9133
|
//#region src/client/world-editor/WorldEditor.tsx
|
|
@@ -9338,38 +9512,38 @@ window.__ModuleLoader__.load({
|
|
|
9338
9512
|
}
|
|
9339
9513
|
//#endregion
|
|
9340
9514
|
//#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
|
|
9341
|
-
const css$
|
|
9342
|
-
const key$
|
|
9343
|
-
let tag$
|
|
9344
|
-
if (tag$
|
|
9345
|
-
tag$
|
|
9346
|
-
tag$
|
|
9347
|
-
tag$
|
|
9348
|
-
document.head.appendChild(tag$
|
|
9515
|
+
const css$20 = ".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}}";
|
|
9516
|
+
const key$20 = "src/client/pages/avatars/AvatarsPage.module.css";
|
|
9517
|
+
let tag$20 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$20) + "]");
|
|
9518
|
+
if (tag$20 === null) {
|
|
9519
|
+
tag$20 = document.createElement("style");
|
|
9520
|
+
tag$20.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
9521
|
+
tag$20.dataset.pluginCss = key$20;
|
|
9522
|
+
document.head.appendChild(tag$20);
|
|
9349
9523
|
}
|
|
9350
|
-
tag$
|
|
9524
|
+
tag$20.textContent = css$20;
|
|
9351
9525
|
var AvatarsPage_module_css_default = {
|
|
9526
|
+
"editHeader": "rp_pQOzEG_editHeader",
|
|
9527
|
+
"name": "rp_pQOzEG_name",
|
|
9528
|
+
"actions": "rp_pQOzEG_actions",
|
|
9352
9529
|
"form": "rp_pQOzEG_form",
|
|
9530
|
+
"open": "rp_pQOzEG_open",
|
|
9531
|
+
"error": "rp_pQOzEG_error",
|
|
9532
|
+
"summary": "rp_pQOzEG_summary",
|
|
9353
9533
|
"viewport": "rp_pQOzEG_viewport",
|
|
9354
|
-
"
|
|
9534
|
+
"editTitle": "rp_pQOzEG_editTitle",
|
|
9355
9535
|
"card": "rp_pQOzEG_card",
|
|
9356
|
-
"portrait": "rp_pQOzEG_portrait",
|
|
9357
9536
|
"editBody": "rp_pQOzEG_editBody",
|
|
9358
|
-
"toolbar": "rp_pQOzEG_toolbar",
|
|
9359
9537
|
"page": "rp_pQOzEG_page",
|
|
9360
|
-
"placeholder": "rp_pQOzEG_placeholder",
|
|
9361
|
-
"field": "rp_pQOzEG_field",
|
|
9362
|
-
"name": "rp_pQOzEG_name",
|
|
9363
|
-
"open": "rp_pQOzEG_open",
|
|
9364
9538
|
"text": "rp_pQOzEG_text",
|
|
9365
|
-
"
|
|
9539
|
+
"field": "rp_pQOzEG_field",
|
|
9540
|
+
"portrait": "rp_pQOzEG_portrait",
|
|
9366
9541
|
"message": "rp_pQOzEG_message",
|
|
9367
|
-
"
|
|
9542
|
+
"toolbar": "rp_pQOzEG_toolbar",
|
|
9543
|
+
"label": "rp_pQOzEG_label",
|
|
9544
|
+
"count": "rp_pQOzEG_count",
|
|
9368
9545
|
"grid": "rp_pQOzEG_grid",
|
|
9369
|
-
"
|
|
9370
|
-
"summary": "rp_pQOzEG_summary",
|
|
9371
|
-
"actions": "rp_pQOzEG_actions",
|
|
9372
|
-
"error": "rp_pQOzEG_error"
|
|
9546
|
+
"placeholder": "rp_pQOzEG_placeholder"
|
|
9373
9547
|
};
|
|
9374
9548
|
//#endregion
|
|
9375
9549
|
//#region src/client/pages/avatars/AvatarsPage.tsx
|
|
@@ -9473,7 +9647,7 @@ window.__ModuleLoader__.load({
|
|
|
9473
9647
|
})
|
|
9474
9648
|
});
|
|
9475
9649
|
}
|
|
9476
|
-
function DeleteDialog$
|
|
9650
|
+
function DeleteDialog$2({ t, avatar, remove, onClose }) {
|
|
9477
9651
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
9478
9652
|
const [error, setError] = (0, react.useState)();
|
|
9479
9653
|
const confirm = () => {
|
|
@@ -9626,7 +9800,7 @@ window.__ModuleLoader__.load({
|
|
|
9626
9800
|
});
|
|
9627
9801
|
}
|
|
9628
9802
|
}),
|
|
9629
|
-
deleting !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeleteDialog$
|
|
9803
|
+
deleting !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeleteDialog$2, {
|
|
9630
9804
|
t,
|
|
9631
9805
|
avatar: deleting,
|
|
9632
9806
|
remove,
|
|
@@ -9652,7 +9826,7 @@ window.__ModuleLoader__.load({
|
|
|
9652
9826
|
}
|
|
9653
9827
|
//#endregion
|
|
9654
9828
|
//#region src/client/widgets/tool-switches/locales.ts
|
|
9655
|
-
const dictionaries$
|
|
9829
|
+
const dictionaries$16 = {
|
|
9656
9830
|
en: {
|
|
9657
9831
|
sw_title: "Tools",
|
|
9658
9832
|
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.",
|
|
@@ -9728,7 +9902,7 @@ window.__ModuleLoader__.load({
|
|
|
9728
9902
|
};
|
|
9729
9903
|
//#endregion
|
|
9730
9904
|
//#region src/client/widgets/gallery-view/locales.ts
|
|
9731
|
-
const dictionaries$
|
|
9905
|
+
const dictionaries$15 = {
|
|
9732
9906
|
en: {
|
|
9733
9907
|
tab: "Gallery",
|
|
9734
9908
|
notRoleplay: "This chat is not a roleplay session, so it has no gallery.",
|
|
@@ -9806,7 +9980,7 @@ window.__ModuleLoader__.load({
|
|
|
9806
9980
|
cancel: "取消"
|
|
9807
9981
|
}
|
|
9808
9982
|
};
|
|
9809
|
-
const dictionaries$
|
|
9983
|
+
const dictionaries$11 = withDictionaries(withDictionaries(withDictionaries(withDictionaries(withDictionaries({
|
|
9810
9984
|
en: {
|
|
9811
9985
|
language: "en",
|
|
9812
9986
|
sectionInfo: "About",
|
|
@@ -9893,6 +10067,9 @@ window.__ModuleLoader__.load({
|
|
|
9893
10067
|
infoAlternateText: "Narration",
|
|
9894
10068
|
infoAlternateAdd: "Add an opening",
|
|
9895
10069
|
infoAlternateRemove: "Remove",
|
|
10070
|
+
infoLorebooks: "Suggested lorebooks",
|
|
10071
|
+
infoLorebooksHelp: "Background knowledge from your library that a new story of this world starts with; the player can change the choice when starting.",
|
|
10072
|
+
infoLorebookMissing: "{name} (not in your library)",
|
|
9896
10073
|
infoPreset: "Suggested preset",
|
|
9897
10074
|
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
10075
|
infoPresetNone: "None",
|
|
@@ -10182,6 +10359,9 @@ window.__ModuleLoader__.load({
|
|
|
10182
10359
|
infoAlternateText: "叙述",
|
|
10183
10360
|
infoAlternateAdd: "添加开场",
|
|
10184
10361
|
infoAlternateRemove: "移除",
|
|
10362
|
+
infoLorebooks: "建议的世界书",
|
|
10363
|
+
infoLorebooksHelp: "新故事默认带上的、来自你的库中的背景知识;玩家开始时可以更改。",
|
|
10364
|
+
infoLorebookMissing: "{name}(库中没有)",
|
|
10185
10365
|
infoPreset: "建议的预设",
|
|
10186
10366
|
infoPresetHelp: "新故事默认使用的、来自你的库中的写作指令。世界自带的提示词仍然优先;玩家开始时也可以另选。",
|
|
10187
10367
|
infoPresetNone: "无",
|
|
@@ -10385,7 +10565,7 @@ window.__ModuleLoader__.load({
|
|
|
10385
10565
|
relationCancel: "取消",
|
|
10386
10566
|
relationCreate: "创建"
|
|
10387
10567
|
}
|
|
10388
|
-
}, prefixed(dictionaries$
|
|
10568
|
+
}, prefixed(dictionaries$15, "gallery_")), prefixed({
|
|
10389
10569
|
en: {
|
|
10390
10570
|
title: "Triggers",
|
|
10391
10571
|
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.",
|
|
@@ -10619,7 +10799,7 @@ window.__ModuleLoader__.load({
|
|
|
10619
10799
|
logOpen: "请求打开:{surface}",
|
|
10620
10800
|
noSurfaces: "这个界面包没有可预览的界面位置。"
|
|
10621
10801
|
}
|
|
10622
|
-
}, "pk_")), dictionaries$
|
|
10802
|
+
}, "pk_")), dictionaries$16), prefixed({
|
|
10623
10803
|
en: {
|
|
10624
10804
|
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.",
|
|
10625
10805
|
none: "This world has no checks. Its game master can still roll plain dice for things that have none.",
|
|
@@ -10693,7 +10873,7 @@ window.__ModuleLoader__.load({
|
|
|
10693
10873
|
bandCritical: "关键"
|
|
10694
10874
|
}
|
|
10695
10875
|
}, "dice_"));
|
|
10696
|
-
const dictionaries$
|
|
10876
|
+
const dictionaries$10 = withDictionaries({
|
|
10697
10877
|
en: {
|
|
10698
10878
|
nav: "Avatars",
|
|
10699
10879
|
avatarsLoading: "Loading avatars…",
|
|
@@ -10746,30 +10926,1054 @@ window.__ModuleLoader__.load({
|
|
|
10746
10926
|
avatarDeleteFailed: "无法删除角色形象:{message}",
|
|
10747
10927
|
avatarEdit: "编辑"
|
|
10748
10928
|
}
|
|
10749
|
-
}, dictionaries$
|
|
10929
|
+
}, dictionaries$11);
|
|
10930
|
+
//#endregion
|
|
10931
|
+
//#region src/client/pages/avatars/index.ts
|
|
10932
|
+
const NAMESPACE$11 = "roleplay.avatars";
|
|
10933
|
+
/** Adds the Avatars page to the Role Play panel: characters to play in any world. */
|
|
10934
|
+
function registerAvatarsPage(ctx) {
|
|
10935
|
+
const t = ctx.locale.bind(NAMESPACE$11);
|
|
10936
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$11, dictionaries$10), "roleplay: avatars dictionaries");
|
|
10937
|
+
const avatars = new AvatarsController();
|
|
10938
|
+
ctx.effect(() => () => {
|
|
10939
|
+
avatars.dispose();
|
|
10940
|
+
}, "roleplay: avatars requests");
|
|
10941
|
+
ctx.slots.inject("roleplay.page", () => ctx.slots.register({
|
|
10942
|
+
name: "roleplay.page",
|
|
10943
|
+
id: "avatars",
|
|
10944
|
+
order: 5,
|
|
10945
|
+
label: () => t("nav"),
|
|
10946
|
+
locale: NAMESPACE$11,
|
|
10947
|
+
inject: () => avatars.inject()
|
|
10948
|
+
}, AvatarsPage));
|
|
10949
|
+
}
|
|
10950
|
+
//#endregion
|
|
10951
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/lorebooks/LorebooksPage.module.css.mjs
|
|
10952
|
+
const css$19 = ".rp_VV-Eha_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_VV-Eha_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_VV-Eha_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_VV-Eha_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_VV-Eha_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_VV-Eha_grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_VV-Eha_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);flex-direction:column;gap:8px;min-width:0;padding:12px;display:flex}.rp_VV-Eha_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_VV-Eha_head{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_VV-Eha_title{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_VV-Eha_name{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_VV-Eha_description{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:3;-webkit-box-orient:vertical;margin:0;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.rp_VV-Eha_meta{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_VV-Eha_cardActions{flex-wrap:wrap;gap:4px;margin-top:auto;display:flex}.rp_VV-Eha_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_VV-Eha_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_VV-Eha_warning{color:var(--dsw-alias-state-warning-primary,var(--dsw-alias-state-error-primary));margin:0;font-size:12px}.rp_VV-Eha_ok{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_VV-Eha_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_VV-Eha_editTitle{color:var(--dsw-alias-label-primary);flex:auto;font-size:14px;font-weight:500}.rp_VV-Eha_editBody{flex-direction:column;flex:1 1 0;gap:24px;min-height:0;padding:16px 24px;display:flex;overflow-y:auto}.rp_VV-Eha_section{flex-direction:column;gap:12px;max-width:720px;display:flex}.rp_VV-Eha_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_VV-Eha_help{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_VV-Eha_row{flex-wrap:wrap;gap:12px;display:flex}.rp_VV-Eha_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_VV-Eha_field{flex-direction:column;flex:200px;gap:6px;min-width:0;display:flex}.rp_VV-Eha_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_VV-Eha_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:280px;font:13px/20px var(--dsw-font-mono,monospace);color:var(--dsw-alias-label-primary);resize:vertical;padding:8px}.rp_VV-Eha_input{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}@media (width<=640px){.rp_VV-Eha_grid{grid-template-columns:1fr}.rp_VV-Eha_form{min-width:0}.rp_VV-Eha_editBody{padding:16px}}.rp_VV-Eha_select{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);max-width:100%;font:inherit;color:var(--dsw-alias-label-primary);padding:4px 6px;font-size:13px}.rp_VV-Eha_entryArea{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:200px;color:var(--dsw-alias-label-primary);resize:vertical;padding:8px;font:13px/20px inherit}";
|
|
10953
|
+
const key$19 = "src/client/pages/lorebooks/LorebooksPage.module.css";
|
|
10954
|
+
let tag$19 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$19) + "]");
|
|
10955
|
+
if (tag$19 === null) {
|
|
10956
|
+
tag$19 = document.createElement("style");
|
|
10957
|
+
tag$19.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
10958
|
+
tag$19.dataset.pluginCss = key$19;
|
|
10959
|
+
document.head.appendChild(tag$19);
|
|
10960
|
+
}
|
|
10961
|
+
tag$19.textContent = css$19;
|
|
10962
|
+
var LorebooksPage_module_css_default = {
|
|
10963
|
+
"label": "rp_VV-Eha_label",
|
|
10964
|
+
"count": "rp_VV-Eha_count",
|
|
10965
|
+
"actions": "rp_VV-Eha_actions",
|
|
10966
|
+
"name": "rp_VV-Eha_name",
|
|
10967
|
+
"grid": "rp_VV-Eha_grid",
|
|
10968
|
+
"description": "rp_VV-Eha_description",
|
|
10969
|
+
"sectionTitle": "rp_VV-Eha_sectionTitle",
|
|
10970
|
+
"area": "rp_VV-Eha_area",
|
|
10971
|
+
"entryArea": "rp_VV-Eha_entryArea",
|
|
10972
|
+
"message": "rp_VV-Eha_message",
|
|
10973
|
+
"toolbar": "rp_VV-Eha_toolbar",
|
|
10974
|
+
"warning": "rp_VV-Eha_warning",
|
|
10975
|
+
"error": "rp_VV-Eha_error",
|
|
10976
|
+
"help": "rp_VV-Eha_help",
|
|
10977
|
+
"editTitle": "rp_VV-Eha_editTitle",
|
|
10978
|
+
"editHeader": "rp_VV-Eha_editHeader",
|
|
10979
|
+
"field": "rp_VV-Eha_field",
|
|
10980
|
+
"title": "rp_VV-Eha_title",
|
|
10981
|
+
"ok": "rp_VV-Eha_ok",
|
|
10982
|
+
"section": "rp_VV-Eha_section",
|
|
10983
|
+
"meta": "rp_VV-Eha_meta",
|
|
10984
|
+
"card": "rp_VV-Eha_card",
|
|
10985
|
+
"cardActions": "rp_VV-Eha_cardActions",
|
|
10986
|
+
"select": "rp_VV-Eha_select",
|
|
10987
|
+
"page": "rp_VV-Eha_page",
|
|
10988
|
+
"input": "rp_VV-Eha_input",
|
|
10989
|
+
"head": "rp_VV-Eha_head",
|
|
10990
|
+
"editBody": "rp_VV-Eha_editBody",
|
|
10991
|
+
"row": "rp_VV-Eha_row",
|
|
10992
|
+
"form": "rp_VV-Eha_form",
|
|
10993
|
+
"viewport": "rp_VV-Eha_viewport"
|
|
10994
|
+
};
|
|
10995
|
+
//#endregion
|
|
10996
|
+
//#region src/client/pages/lorebooks/LorebookEditor.tsx
|
|
10997
|
+
const messageOf$6 = (failure) => failure instanceof Error ? failure.message : String(failure);
|
|
10998
|
+
const KINDS = [
|
|
10999
|
+
"history",
|
|
11000
|
+
"culture",
|
|
11001
|
+
"religion",
|
|
11002
|
+
"politics",
|
|
11003
|
+
"geography",
|
|
11004
|
+
"science",
|
|
11005
|
+
"custom",
|
|
11006
|
+
"legend",
|
|
11007
|
+
"other"
|
|
11008
|
+
];
|
|
11009
|
+
const SCOPES = ["everyone", "listed"];
|
|
11010
|
+
const ID = /^[\p{L}\p{N}][\p{L}\p{N}_-]{0,79}$/u;
|
|
11011
|
+
const list = (text) => text.split(/[,\n,、]/).map((entry) => entry.trim()).filter((entry) => entry !== "");
|
|
11012
|
+
const draftOf = (entry) => ({
|
|
11013
|
+
id: entry.id,
|
|
11014
|
+
title: entry.title,
|
|
11015
|
+
kind: entry.kind,
|
|
11016
|
+
scope: entry.scope,
|
|
11017
|
+
knownBy: entry.knownBy.join(", "),
|
|
11018
|
+
summary: entry.summary,
|
|
11019
|
+
body: entry.body,
|
|
11020
|
+
related: entry.related.join(", ")
|
|
11021
|
+
});
|
|
11022
|
+
const blank = () => ({
|
|
11023
|
+
id: "",
|
|
11024
|
+
title: "",
|
|
11025
|
+
kind: "other",
|
|
11026
|
+
scope: "everyone",
|
|
11027
|
+
knownBy: "",
|
|
11028
|
+
summary: "",
|
|
11029
|
+
body: "",
|
|
11030
|
+
related: ""
|
|
11031
|
+
});
|
|
11032
|
+
const entryOf = (draft) => ({
|
|
11033
|
+
id: draft.id.trim(),
|
|
11034
|
+
title: draft.title.trim(),
|
|
11035
|
+
kind: draft.kind,
|
|
11036
|
+
scope: draft.scope,
|
|
11037
|
+
knownBy: draft.scope === "listed" ? list(draft.knownBy) : [],
|
|
11038
|
+
summary: draft.summary.trim(),
|
|
11039
|
+
body: draft.body,
|
|
11040
|
+
related: list(draft.related)
|
|
11041
|
+
});
|
|
11042
|
+
const infoOf$1 = (summary) => ({
|
|
11043
|
+
title: summary.title === summary.name ? "" : summary.title,
|
|
11044
|
+
description: summary.description
|
|
11045
|
+
});
|
|
11046
|
+
/** One library lorebook: what it says about itself and its entries one at a time; the assistant does the larger rewrites and the import. */
|
|
11047
|
+
function LorebookEditor({ t, name, onBack, author }) {
|
|
11048
|
+
const [loaded, setLoaded] = (0, react.useState)();
|
|
11049
|
+
const [failure, setFailure] = (0, react.useState)();
|
|
11050
|
+
const [info, setInfo] = (0, react.useState)();
|
|
11051
|
+
const [infoStatus, setInfoStatus] = (0, react.useState)({ state: "idle" });
|
|
11052
|
+
const [draft, setDraft] = (0, react.useState)(blank());
|
|
11053
|
+
const [creating, setCreating] = (0, react.useState)(true);
|
|
11054
|
+
const [entryStatus, setEntryStatus] = (0, react.useState)({ state: "idle" });
|
|
11055
|
+
const accept = (value, keep) => {
|
|
11056
|
+
setLoaded(value);
|
|
11057
|
+
setInfo(infoOf$1(value.summary));
|
|
11058
|
+
const chosen = value.entries.find((entry) => entry.id === keep) ?? value.entries[0];
|
|
11059
|
+
setCreating(chosen === void 0);
|
|
11060
|
+
setDraft(chosen === void 0 ? blank() : draftOf(chosen));
|
|
11061
|
+
};
|
|
11062
|
+
(0, react.useEffect)(() => {
|
|
11063
|
+
const abort = new AbortController();
|
|
11064
|
+
readLorebook(name, abort.signal).then((value) => {
|
|
11065
|
+
accept(value);
|
|
11066
|
+
}, (problem) => {
|
|
11067
|
+
if (!abort.signal.aborted) setFailure(messageOf$6(problem));
|
|
11068
|
+
});
|
|
11069
|
+
return () => {
|
|
11070
|
+
abort.abort();
|
|
11071
|
+
};
|
|
11072
|
+
}, [name]);
|
|
11073
|
+
if (loaded === void 0 || info === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11074
|
+
className: LorebooksPage_module_css_default.message,
|
|
11075
|
+
role: failure === void 0 ? void 0 : "alert",
|
|
11076
|
+
children: failure === void 0 ? t("loading") : t("loadFailed", { message: failure })
|
|
11077
|
+
});
|
|
11078
|
+
const saved = infoOf$1(loaded.summary);
|
|
11079
|
+
const infoDirty = JSON.stringify(info) !== JSON.stringify(saved);
|
|
11080
|
+
const current = creating ? void 0 : loaded.entries.find((entry) => entry.id === draft.id);
|
|
11081
|
+
const entryDirty = creating || current !== void 0 && JSON.stringify(draftOf(current)) !== JSON.stringify(draft);
|
|
11082
|
+
const ready = ID.test(draft.id.trim()) && draft.title.trim() !== "" && (draft.body.trim() !== "" || draft.summary.trim() !== "") && (draft.scope === "everyone" || list(draft.knownBy).length > 0);
|
|
11083
|
+
const saveInfo = () => {
|
|
11084
|
+
setInfoStatus({ state: "saving" });
|
|
11085
|
+
updateLorebookInfo(name, info, new AbortController().signal).then((summary) => {
|
|
11086
|
+
setLoaded({
|
|
11087
|
+
...loaded,
|
|
11088
|
+
summary
|
|
11089
|
+
});
|
|
11090
|
+
setInfo(infoOf$1(summary));
|
|
11091
|
+
setInfoStatus({ state: "saved" });
|
|
11092
|
+
}, (problem) => {
|
|
11093
|
+
setInfoStatus({
|
|
11094
|
+
state: "failed",
|
|
11095
|
+
message: messageOf$6(problem)
|
|
11096
|
+
});
|
|
11097
|
+
});
|
|
11098
|
+
};
|
|
11099
|
+
const reload = (keep) => {
|
|
11100
|
+
readLorebook(name, new AbortController().signal).then((value) => {
|
|
11101
|
+
accept(value, keep);
|
|
11102
|
+
}, (problem) => {
|
|
11103
|
+
setEntryStatus({
|
|
11104
|
+
state: "failed",
|
|
11105
|
+
message: messageOf$6(problem)
|
|
11106
|
+
});
|
|
11107
|
+
});
|
|
11108
|
+
};
|
|
11109
|
+
const saveEntry = () => {
|
|
11110
|
+
setEntryStatus({ state: "saving" });
|
|
11111
|
+
const entry = entryOf(draft);
|
|
11112
|
+
writeLorebookEntry(name, entry, new AbortController().signal).then(() => {
|
|
11113
|
+
setEntryStatus({ state: "saved" });
|
|
11114
|
+
reload(entry.id);
|
|
11115
|
+
}, (problem) => {
|
|
11116
|
+
setEntryStatus({
|
|
11117
|
+
state: "failed",
|
|
11118
|
+
message: messageOf$6(problem)
|
|
11119
|
+
});
|
|
11120
|
+
});
|
|
11121
|
+
};
|
|
11122
|
+
const removeEntry = () => {
|
|
11123
|
+
setEntryStatus({ state: "saving" });
|
|
11124
|
+
removeLorebookEntry(name, draft.id, new AbortController().signal).then(() => {
|
|
11125
|
+
setEntryStatus({ state: "idle" });
|
|
11126
|
+
reload();
|
|
11127
|
+
}, (problem) => {
|
|
11128
|
+
setEntryStatus({
|
|
11129
|
+
state: "failed",
|
|
11130
|
+
message: messageOf$6(problem)
|
|
11131
|
+
});
|
|
11132
|
+
});
|
|
11133
|
+
};
|
|
11134
|
+
const edit = (change) => {
|
|
11135
|
+
setDraft({
|
|
11136
|
+
...draft,
|
|
11137
|
+
...change
|
|
11138
|
+
});
|
|
11139
|
+
setEntryStatus({ state: "idle" });
|
|
11140
|
+
};
|
|
11141
|
+
const text = (key, caption, options = {}) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11142
|
+
className: LorebooksPage_module_css_default.field,
|
|
11143
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11144
|
+
className: LorebooksPage_module_css_default.label,
|
|
11145
|
+
children: t(caption)
|
|
11146
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
11147
|
+
className: LorebooksPage_module_css_default.input,
|
|
11148
|
+
value: draft[key],
|
|
11149
|
+
disabled: options.disabled === true,
|
|
11150
|
+
onChange: (event) => {
|
|
11151
|
+
edit({ [key]: event.target.value });
|
|
11152
|
+
}
|
|
11153
|
+
})]
|
|
11154
|
+
});
|
|
11155
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11156
|
+
className: LorebooksPage_module_css_default.page,
|
|
11157
|
+
"data-testid": "roleplay-lorebook-editor",
|
|
11158
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11159
|
+
className: LorebooksPage_module_css_default.editHeader,
|
|
11160
|
+
children: [
|
|
11161
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11162
|
+
variant: "ghost",
|
|
11163
|
+
size: "sm",
|
|
11164
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronLeftOutlineRegular, {}),
|
|
11165
|
+
onClick: onBack,
|
|
11166
|
+
children: t("back")
|
|
11167
|
+
}),
|
|
11168
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11169
|
+
className: LorebooksPage_module_css_default.editTitle,
|
|
11170
|
+
children: loaded.summary.title
|
|
11171
|
+
}),
|
|
11172
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11173
|
+
variant: "primary",
|
|
11174
|
+
size: "sm",
|
|
11175
|
+
onClick: author,
|
|
11176
|
+
children: t("author")
|
|
11177
|
+
})
|
|
11178
|
+
]
|
|
11179
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11180
|
+
className: LorebooksPage_module_css_default.editBody,
|
|
11181
|
+
children: [
|
|
11182
|
+
loaded.summary.problems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11183
|
+
className: LorebooksPage_module_css_default.error,
|
|
11184
|
+
role: "alert",
|
|
11185
|
+
children: t("broken", { problems: loaded.summary.problems.join("; ") })
|
|
11186
|
+
}),
|
|
11187
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
11188
|
+
className: LorebooksPage_module_css_default.section,
|
|
11189
|
+
children: [
|
|
11190
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
11191
|
+
className: LorebooksPage_module_css_default.sectionTitle,
|
|
11192
|
+
children: t("info")
|
|
11193
|
+
}),
|
|
11194
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11195
|
+
className: LorebooksPage_module_css_default.field,
|
|
11196
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11197
|
+
className: LorebooksPage_module_css_default.label,
|
|
11198
|
+
children: t("bookTitle")
|
|
11199
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
11200
|
+
className: LorebooksPage_module_css_default.input,
|
|
11201
|
+
value: info.title,
|
|
11202
|
+
onChange: (event) => {
|
|
11203
|
+
setInfo({
|
|
11204
|
+
...info,
|
|
11205
|
+
title: event.target.value
|
|
11206
|
+
});
|
|
11207
|
+
setInfoStatus({ state: "idle" });
|
|
11208
|
+
}
|
|
11209
|
+
})]
|
|
11210
|
+
}),
|
|
11211
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11212
|
+
className: LorebooksPage_module_css_default.field,
|
|
11213
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11214
|
+
className: LorebooksPage_module_css_default.label,
|
|
11215
|
+
children: t("bookDescription")
|
|
11216
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
11217
|
+
className: LorebooksPage_module_css_default.input,
|
|
11218
|
+
rows: 3,
|
|
11219
|
+
value: info.description,
|
|
11220
|
+
onChange: (event) => {
|
|
11221
|
+
setInfo({
|
|
11222
|
+
...info,
|
|
11223
|
+
description: event.target.value
|
|
11224
|
+
});
|
|
11225
|
+
setInfoStatus({ state: "idle" });
|
|
11226
|
+
}
|
|
11227
|
+
})]
|
|
11228
|
+
}),
|
|
11229
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11230
|
+
className: LorebooksPage_module_css_default.actions,
|
|
11231
|
+
children: [
|
|
11232
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11233
|
+
variant: "primary",
|
|
11234
|
+
size: "sm",
|
|
11235
|
+
disabled: !infoDirty || infoStatus.state === "saving",
|
|
11236
|
+
onClick: saveInfo,
|
|
11237
|
+
children: infoStatus.state === "saving" ? t("infoSaving") : t("infoSave")
|
|
11238
|
+
}),
|
|
11239
|
+
infoStatus.state === "saved" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11240
|
+
className: LorebooksPage_module_css_default.ok,
|
|
11241
|
+
role: "status",
|
|
11242
|
+
children: t("infoSaved")
|
|
11243
|
+
}),
|
|
11244
|
+
infoStatus.state === "failed" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11245
|
+
className: LorebooksPage_module_css_default.error,
|
|
11246
|
+
role: "alert",
|
|
11247
|
+
children: t("infoFailed", { message: infoStatus.message ?? "" })
|
|
11248
|
+
})
|
|
11249
|
+
]
|
|
11250
|
+
})
|
|
11251
|
+
]
|
|
11252
|
+
}),
|
|
11253
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
11254
|
+
className: LorebooksPage_module_css_default.section,
|
|
11255
|
+
children: [
|
|
11256
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
11257
|
+
className: LorebooksPage_module_css_default.sectionTitle,
|
|
11258
|
+
children: t("entries")
|
|
11259
|
+
}),
|
|
11260
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11261
|
+
className: LorebooksPage_module_css_default.help,
|
|
11262
|
+
children: t("entriesHelp")
|
|
11263
|
+
}),
|
|
11264
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11265
|
+
className: LorebooksPage_module_css_default.actions,
|
|
11266
|
+
children: [loaded.entries.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
11267
|
+
className: LorebooksPage_module_css_default.select,
|
|
11268
|
+
value: creating ? "" : draft.id,
|
|
11269
|
+
"aria-label": t("entryPick"),
|
|
11270
|
+
"data-testid": "roleplay-lorebook-entry",
|
|
11271
|
+
onChange: (event) => {
|
|
11272
|
+
const found = loaded.entries.find((entry) => entry.id === event.target.value);
|
|
11273
|
+
if (found !== void 0) {
|
|
11274
|
+
setCreating(false);
|
|
11275
|
+
setDraft(draftOf(found));
|
|
11276
|
+
setEntryStatus({ state: "idle" });
|
|
11277
|
+
}
|
|
11278
|
+
},
|
|
11279
|
+
children: [creating && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
11280
|
+
value: "",
|
|
11281
|
+
children: t("entryNew")
|
|
11282
|
+
}), loaded.entries.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
|
|
11283
|
+
value: entry.id,
|
|
11284
|
+
children: [entry.title, entry.scope === "listed" ? ` · ${t("scope_listed")}` : ""]
|
|
11285
|
+
}, entry.id))]
|
|
11286
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11287
|
+
variant: "outline",
|
|
11288
|
+
size: "sm",
|
|
11289
|
+
disabled: creating && draft.id === "" && draft.title === "" && draft.body === "",
|
|
11290
|
+
onClick: () => {
|
|
11291
|
+
setCreating(true);
|
|
11292
|
+
setDraft(blank());
|
|
11293
|
+
setEntryStatus({ state: "idle" });
|
|
11294
|
+
},
|
|
11295
|
+
children: t("entryAdd")
|
|
11296
|
+
})]
|
|
11297
|
+
}),
|
|
11298
|
+
text("id", "entryId", { disabled: !creating }),
|
|
11299
|
+
text("title", "entryTitle"),
|
|
11300
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11301
|
+
className: LorebooksPage_module_css_default.row,
|
|
11302
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11303
|
+
className: LorebooksPage_module_css_default.field,
|
|
11304
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11305
|
+
className: LorebooksPage_module_css_default.label,
|
|
11306
|
+
children: t("entryKind")
|
|
11307
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
11308
|
+
className: LorebooksPage_module_css_default.select,
|
|
11309
|
+
value: draft.kind,
|
|
11310
|
+
onChange: (event) => {
|
|
11311
|
+
edit({ kind: event.target.value });
|
|
11312
|
+
},
|
|
11313
|
+
children: KINDS.map((kind) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
11314
|
+
value: kind,
|
|
11315
|
+
children: t(`kind_${kind}`)
|
|
11316
|
+
}, kind))
|
|
11317
|
+
})]
|
|
11318
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11319
|
+
className: LorebooksPage_module_css_default.field,
|
|
11320
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11321
|
+
className: LorebooksPage_module_css_default.label,
|
|
11322
|
+
children: t("entryScope")
|
|
11323
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
11324
|
+
className: LorebooksPage_module_css_default.select,
|
|
11325
|
+
value: draft.scope,
|
|
11326
|
+
"data-testid": "roleplay-lorebook-scope",
|
|
11327
|
+
onChange: (event) => {
|
|
11328
|
+
edit({ scope: event.target.value });
|
|
11329
|
+
},
|
|
11330
|
+
children: SCOPES.map((scope) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
11331
|
+
value: scope,
|
|
11332
|
+
children: t(`scope_${scope}`)
|
|
11333
|
+
}, scope))
|
|
11334
|
+
})]
|
|
11335
|
+
})]
|
|
11336
|
+
}),
|
|
11337
|
+
draft.scope === "listed" && text("knownBy", "entryKnownBy"),
|
|
11338
|
+
text("summary", "entrySummary"),
|
|
11339
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11340
|
+
className: LorebooksPage_module_css_default.field,
|
|
11341
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11342
|
+
className: LorebooksPage_module_css_default.label,
|
|
11343
|
+
children: t("entryBody")
|
|
11344
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
11345
|
+
className: LorebooksPage_module_css_default.entryArea,
|
|
11346
|
+
value: draft.body,
|
|
11347
|
+
onChange: (event) => {
|
|
11348
|
+
edit({ body: event.target.value });
|
|
11349
|
+
}
|
|
11350
|
+
})]
|
|
11351
|
+
}),
|
|
11352
|
+
loaded.entries.length > 1 && text("related", "entryRelated"),
|
|
11353
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11354
|
+
className: LorebooksPage_module_css_default.actions,
|
|
11355
|
+
children: [
|
|
11356
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11357
|
+
variant: "primary",
|
|
11358
|
+
size: "sm",
|
|
11359
|
+
disabled: !entryDirty || !ready || entryStatus.state === "saving",
|
|
11360
|
+
onClick: saveEntry,
|
|
11361
|
+
children: entryStatus.state === "saving" ? t("entrySaving") : t("entrySave")
|
|
11362
|
+
}),
|
|
11363
|
+
!creating && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11364
|
+
variant: "ghost",
|
|
11365
|
+
size: "sm",
|
|
11366
|
+
disabled: entryStatus.state === "saving",
|
|
11367
|
+
onClick: removeEntry,
|
|
11368
|
+
children: t("entryRemove")
|
|
11369
|
+
}),
|
|
11370
|
+
entryStatus.state === "saved" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11371
|
+
className: LorebooksPage_module_css_default.ok,
|
|
11372
|
+
role: "status",
|
|
11373
|
+
children: t("entrySaved")
|
|
11374
|
+
}),
|
|
11375
|
+
entryStatus.state === "failed" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11376
|
+
className: LorebooksPage_module_css_default.error,
|
|
11377
|
+
role: "alert",
|
|
11378
|
+
children: t("entryFailed", { message: entryStatus.message ?? "" })
|
|
11379
|
+
})
|
|
11380
|
+
]
|
|
11381
|
+
})
|
|
11382
|
+
]
|
|
11383
|
+
})
|
|
11384
|
+
]
|
|
11385
|
+
})]
|
|
11386
|
+
});
|
|
11387
|
+
}
|
|
11388
|
+
//#endregion
|
|
11389
|
+
//#region src/client/pages/lorebooks/LorebooksPage.tsx
|
|
11390
|
+
const NAME$1 = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
|
|
11391
|
+
const messageOf$5 = (failure) => failure instanceof Error ? failure.message : String(failure);
|
|
11392
|
+
const nameFromFile$1 = (file) => file.replace(/\.[^.]*$/, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^[-_]+|[-_]+$/g, "").slice(0, 64);
|
|
11393
|
+
function NameDialog$1({ t, mode, file, submit, onClose }) {
|
|
11394
|
+
const formId = (0, react.useId)();
|
|
11395
|
+
const [name, setName] = (0, react.useState)(file === void 0 ? "" : nameFromFile$1(file));
|
|
11396
|
+
const [title, setTitle] = (0, react.useState)("");
|
|
11397
|
+
const [description, setDescription] = (0, react.useState)("");
|
|
11398
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
11399
|
+
const [error, setError] = (0, react.useState)();
|
|
11400
|
+
const go = () => {
|
|
11401
|
+
if (!NAME$1.test(name) || busy) return;
|
|
11402
|
+
setBusy(true);
|
|
11403
|
+
setError(void 0);
|
|
11404
|
+
submit(name, title.trim(), description.trim()).then(onClose, (failure) => {
|
|
11405
|
+
setBusy(false);
|
|
11406
|
+
setError(messageOf$5(failure));
|
|
11407
|
+
});
|
|
11408
|
+
};
|
|
11409
|
+
const importing = mode === "import";
|
|
11410
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
11411
|
+
open: true,
|
|
11412
|
+
onClose,
|
|
11413
|
+
title: importing ? t("importTitle") : t("createTitle"),
|
|
11414
|
+
description: importing ? t("importHelp", { file: file ?? "" }) : t("createHelp"),
|
|
11415
|
+
closeLabel: t("close"),
|
|
11416
|
+
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, {
|
|
11417
|
+
variant: "ghost",
|
|
11418
|
+
disabled: busy,
|
|
11419
|
+
onClick: onClose,
|
|
11420
|
+
children: t("cancel")
|
|
11421
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11422
|
+
variant: "primary",
|
|
11423
|
+
type: "submit",
|
|
11424
|
+
form: formId,
|
|
11425
|
+
disabled: busy || !NAME$1.test(name),
|
|
11426
|
+
children: importing ? busy ? t("importing") : t("import") : busy ? t("creating") : t("create")
|
|
11427
|
+
})] }),
|
|
11428
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
11429
|
+
id: formId,
|
|
11430
|
+
className: LorebooksPage_module_css_default.form,
|
|
11431
|
+
onSubmit: (event) => {
|
|
11432
|
+
event.preventDefault();
|
|
11433
|
+
go();
|
|
11434
|
+
},
|
|
11435
|
+
children: [
|
|
11436
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11437
|
+
className: LorebooksPage_module_css_default.field,
|
|
11438
|
+
children: [
|
|
11439
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11440
|
+
className: LorebooksPage_module_css_default.label,
|
|
11441
|
+
children: t("bookName")
|
|
11442
|
+
}),
|
|
11443
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
11444
|
+
value: name,
|
|
11445
|
+
maxLength: 64,
|
|
11446
|
+
"data-modal-autofocus": true,
|
|
11447
|
+
onChange: (event) => {
|
|
11448
|
+
setName(event.target.value);
|
|
11449
|
+
}
|
|
11450
|
+
}),
|
|
11451
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11452
|
+
className: LorebooksPage_module_css_default.help,
|
|
11453
|
+
children: t("bookNameHelp")
|
|
11454
|
+
})
|
|
11455
|
+
]
|
|
11456
|
+
}),
|
|
11457
|
+
!importing && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11458
|
+
className: LorebooksPage_module_css_default.field,
|
|
11459
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11460
|
+
className: LorebooksPage_module_css_default.label,
|
|
11461
|
+
children: t("bookTitle")
|
|
11462
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
11463
|
+
value: title,
|
|
11464
|
+
maxLength: 300,
|
|
11465
|
+
onChange: (event) => {
|
|
11466
|
+
setTitle(event.target.value);
|
|
11467
|
+
}
|
|
11468
|
+
})]
|
|
11469
|
+
}),
|
|
11470
|
+
!importing && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11471
|
+
className: LorebooksPage_module_css_default.field,
|
|
11472
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11473
|
+
className: LorebooksPage_module_css_default.label,
|
|
11474
|
+
children: t("bookDescription")
|
|
11475
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
11476
|
+
value: description,
|
|
11477
|
+
maxLength: 300,
|
|
11478
|
+
onChange: (event) => {
|
|
11479
|
+
setDescription(event.target.value);
|
|
11480
|
+
}
|
|
11481
|
+
})]
|
|
11482
|
+
}),
|
|
11483
|
+
error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11484
|
+
className: LorebooksPage_module_css_default.error,
|
|
11485
|
+
role: "alert",
|
|
11486
|
+
children: importing ? t("importFailed", { message: error }) : t("createFailed", { message: error })
|
|
11487
|
+
})
|
|
11488
|
+
]
|
|
11489
|
+
})
|
|
11490
|
+
});
|
|
11491
|
+
}
|
|
11492
|
+
function DeleteDialog$1({ t, book, remove, onClose }) {
|
|
11493
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
11494
|
+
const [error, setError] = (0, react.useState)();
|
|
11495
|
+
const confirm = () => {
|
|
11496
|
+
setBusy(true);
|
|
11497
|
+
setError(void 0);
|
|
11498
|
+
remove(book.name).then(onClose, (failure) => {
|
|
11499
|
+
setBusy(false);
|
|
11500
|
+
setError(messageOf$5(failure));
|
|
11501
|
+
});
|
|
11502
|
+
};
|
|
11503
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
11504
|
+
open: true,
|
|
11505
|
+
onClose,
|
|
11506
|
+
title: t("deleteTitle"),
|
|
11507
|
+
description: t("deleteHelp", { name: book.title }),
|
|
11508
|
+
closeLabel: t("close"),
|
|
11509
|
+
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, {
|
|
11510
|
+
variant: "ghost",
|
|
11511
|
+
disabled: busy,
|
|
11512
|
+
onClick: onClose,
|
|
11513
|
+
children: t("cancel")
|
|
11514
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11515
|
+
variant: "primary",
|
|
11516
|
+
disabled: busy,
|
|
11517
|
+
onClick: confirm,
|
|
11518
|
+
children: busy ? t("deleting") : t("delete")
|
|
11519
|
+
})] }),
|
|
11520
|
+
children: error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11521
|
+
className: LorebooksPage_module_css_default.error,
|
|
11522
|
+
role: "alert",
|
|
11523
|
+
children: t("deleteFailed", { message: error })
|
|
11524
|
+
})
|
|
11525
|
+
});
|
|
11526
|
+
}
|
|
11527
|
+
/** The lorebook library: reusable background knowledge that a story copies when it starts. */
|
|
11528
|
+
function LorebooksPage({ t, useLorebooks, load, refresh, create, remove, author, importFile }) {
|
|
11529
|
+
const state = useLorebooks((snapshot) => snapshot);
|
|
11530
|
+
const [editing, setEditing] = (0, react.useState)();
|
|
11531
|
+
const [creating, setCreating] = (0, react.useState)(false);
|
|
11532
|
+
const [deleting, setDeleting] = (0, react.useState)();
|
|
11533
|
+
const [uploaded, setUploaded] = (0, react.useState)();
|
|
11534
|
+
const [notice, setNotice] = (0, react.useState)();
|
|
11535
|
+
const picker = (0, react.useRef)(null);
|
|
11536
|
+
(0, react.useEffect)(() => {
|
|
11537
|
+
load();
|
|
11538
|
+
}, [load]);
|
|
11539
|
+
const open = (name) => {
|
|
11540
|
+
setNotice(void 0);
|
|
11541
|
+
author(name).catch((failure) => {
|
|
11542
|
+
setNotice(t("authorFailed", { message: messageOf$5(failure) }));
|
|
11543
|
+
});
|
|
11544
|
+
};
|
|
11545
|
+
if (editing !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LorebookEditor, {
|
|
11546
|
+
t,
|
|
11547
|
+
name: editing,
|
|
11548
|
+
onBack: () => {
|
|
11549
|
+
setEditing(void 0);
|
|
11550
|
+
refresh();
|
|
11551
|
+
},
|
|
11552
|
+
author: () => {
|
|
11553
|
+
open(editing);
|
|
11554
|
+
}
|
|
11555
|
+
});
|
|
11556
|
+
const books = state.books ?? [];
|
|
11557
|
+
const failedWithoutData = state.status === "failed" && state.books === void 0;
|
|
11558
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11559
|
+
className: LorebooksPage_module_css_default.page,
|
|
11560
|
+
"data-testid": "roleplay-lorebooks-page",
|
|
11561
|
+
children: [
|
|
11562
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11563
|
+
className: LorebooksPage_module_css_default.toolbar,
|
|
11564
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11565
|
+
className: LorebooksPage_module_css_default.count,
|
|
11566
|
+
children: state.books === void 0 ? "" : t(books.length === 1 ? "countOne" : "countOther", { count: books.length })
|
|
11567
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11568
|
+
className: LorebooksPage_module_css_default.actions,
|
|
11569
|
+
children: [
|
|
11570
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
11571
|
+
ref: picker,
|
|
11572
|
+
type: "file",
|
|
11573
|
+
accept: ".json,application/json",
|
|
11574
|
+
hidden: true,
|
|
11575
|
+
"data-testid": "roleplay-lorebook-file",
|
|
11576
|
+
onChange: (event) => {
|
|
11577
|
+
setUploaded(event.target.files?.[0]);
|
|
11578
|
+
event.target.value = "";
|
|
11579
|
+
}
|
|
11580
|
+
}),
|
|
11581
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11582
|
+
variant: "outline",
|
|
11583
|
+
size: "sm",
|
|
11584
|
+
onClick: () => {
|
|
11585
|
+
picker.current?.click();
|
|
11586
|
+
},
|
|
11587
|
+
children: t("import")
|
|
11588
|
+
}),
|
|
11589
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11590
|
+
variant: "primary",
|
|
11591
|
+
size: "sm",
|
|
11592
|
+
onClick: () => {
|
|
11593
|
+
setCreating(true);
|
|
11594
|
+
},
|
|
11595
|
+
children: t("create")
|
|
11596
|
+
}),
|
|
11597
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11598
|
+
variant: "outline",
|
|
11599
|
+
size: "sm",
|
|
11600
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, {}),
|
|
11601
|
+
disabled: state.refreshing || state.status === "loading",
|
|
11602
|
+
"aria-busy": state.refreshing,
|
|
11603
|
+
onClick: refresh,
|
|
11604
|
+
children: state.refreshing ? t("refreshing") : t("refresh")
|
|
11605
|
+
})
|
|
11606
|
+
]
|
|
11607
|
+
})]
|
|
11608
|
+
}),
|
|
11609
|
+
state.error !== void 0 && !failedWithoutData && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11610
|
+
className: LorebooksPage_module_css_default.error,
|
|
11611
|
+
role: "alert",
|
|
11612
|
+
children: t("loadFailed", { message: state.error })
|
|
11613
|
+
}),
|
|
11614
|
+
notice !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11615
|
+
className: LorebooksPage_module_css_default.error,
|
|
11616
|
+
role: "alert",
|
|
11617
|
+
children: notice
|
|
11618
|
+
}),
|
|
11619
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11620
|
+
className: LorebooksPage_module_css_default.viewport,
|
|
11621
|
+
children: state.status === "idle" || state.status === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11622
|
+
className: LorebooksPage_module_css_default.message,
|
|
11623
|
+
children: t("loading")
|
|
11624
|
+
}) : failedWithoutData ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11625
|
+
className: LorebooksPage_module_css_default.error,
|
|
11626
|
+
role: "alert",
|
|
11627
|
+
children: t("loadFailed", { message: state.error ?? "" })
|
|
11628
|
+
}) : books.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11629
|
+
className: LorebooksPage_module_css_default.message,
|
|
11630
|
+
children: t("empty")
|
|
11631
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
11632
|
+
className: LorebooksPage_module_css_default.grid,
|
|
11633
|
+
children: books.map((book) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
11634
|
+
className: LorebooksPage_module_css_default.card,
|
|
11635
|
+
"data-testid": "roleplay-lorebook-card",
|
|
11636
|
+
children: [
|
|
11637
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11638
|
+
className: LorebooksPage_module_css_default.head,
|
|
11639
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11640
|
+
className: LorebooksPage_module_css_default.title,
|
|
11641
|
+
children: book.title
|
|
11642
|
+
}), book.title !== book.name && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11643
|
+
className: LorebooksPage_module_css_default.name,
|
|
11644
|
+
children: book.name
|
|
11645
|
+
})]
|
|
11646
|
+
}),
|
|
11647
|
+
book.description !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11648
|
+
className: LorebooksPage_module_css_default.description,
|
|
11649
|
+
children: book.description
|
|
11650
|
+
}),
|
|
11651
|
+
book.problems.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11652
|
+
className: LorebooksPage_module_css_default.error,
|
|
11653
|
+
children: t("broken", { problems: book.problems.join("; ") })
|
|
11654
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11655
|
+
className: LorebooksPage_module_css_default.meta,
|
|
11656
|
+
children: [t("entriesCount", { count: book.entries }), t("commonCount", { count: book.common })].join(" · ")
|
|
11657
|
+
}),
|
|
11658
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11659
|
+
className: LorebooksPage_module_css_default.cardActions,
|
|
11660
|
+
children: [
|
|
11661
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11662
|
+
variant: "outline",
|
|
11663
|
+
size: "sm",
|
|
11664
|
+
onClick: () => {
|
|
11665
|
+
setEditing(book.name);
|
|
11666
|
+
},
|
|
11667
|
+
children: t("edit")
|
|
11668
|
+
}),
|
|
11669
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11670
|
+
variant: "outline",
|
|
11671
|
+
size: "sm",
|
|
11672
|
+
onClick: () => {
|
|
11673
|
+
open(book.name);
|
|
11674
|
+
},
|
|
11675
|
+
children: t("author")
|
|
11676
|
+
}),
|
|
11677
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11678
|
+
variant: "ghost",
|
|
11679
|
+
size: "sm",
|
|
11680
|
+
onClick: () => {
|
|
11681
|
+
setDeleting(book);
|
|
11682
|
+
},
|
|
11683
|
+
children: t("delete")
|
|
11684
|
+
})
|
|
11685
|
+
]
|
|
11686
|
+
})
|
|
11687
|
+
]
|
|
11688
|
+
}, book.name))
|
|
11689
|
+
})
|
|
11690
|
+
}),
|
|
11691
|
+
creating && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NameDialog$1, {
|
|
11692
|
+
t,
|
|
11693
|
+
mode: "create",
|
|
11694
|
+
submit: create,
|
|
11695
|
+
onClose: () => {
|
|
11696
|
+
setCreating(false);
|
|
11697
|
+
}
|
|
11698
|
+
}),
|
|
11699
|
+
uploaded !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NameDialog$1, {
|
|
11700
|
+
t,
|
|
11701
|
+
mode: "import",
|
|
11702
|
+
file: uploaded.name,
|
|
11703
|
+
submit: async (name) => {
|
|
11704
|
+
const result = await importFile(name, uploaded);
|
|
11705
|
+
if (!result.started) setNotice(t("importNotStarted", { message: result.failure ?? "" }));
|
|
11706
|
+
},
|
|
11707
|
+
onClose: () => {
|
|
11708
|
+
setUploaded(void 0);
|
|
11709
|
+
}
|
|
11710
|
+
}),
|
|
11711
|
+
deleting !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeleteDialog$1, {
|
|
11712
|
+
t,
|
|
11713
|
+
book: deleting,
|
|
11714
|
+
remove,
|
|
11715
|
+
onClose: () => {
|
|
11716
|
+
setDeleting(void 0);
|
|
11717
|
+
}
|
|
11718
|
+
})
|
|
11719
|
+
]
|
|
11720
|
+
});
|
|
11721
|
+
}
|
|
11722
|
+
//#endregion
|
|
11723
|
+
//#region src/client/pages/lorebooks/locales.ts
|
|
11724
|
+
const dictionaries$9 = {
|
|
11725
|
+
en: {
|
|
11726
|
+
nav: "Lorebooks",
|
|
11727
|
+
language: "en",
|
|
11728
|
+
loading: "Loading lorebooks…",
|
|
11729
|
+
loadFailed: "Could not load the lorebooks: {message}",
|
|
11730
|
+
empty: "No lorebooks yet. A lorebook is a collection of background knowledge (history, customs, places, legends) that any story can start with. Make one to fill in, or import a SillyTavern lorebook.",
|
|
11731
|
+
countOne: "{count} lorebook",
|
|
11732
|
+
countOther: "{count} lorebooks",
|
|
11733
|
+
refresh: "Refresh",
|
|
11734
|
+
refreshing: "Refreshing…",
|
|
11735
|
+
back: "Back",
|
|
11736
|
+
cancel: "Cancel",
|
|
11737
|
+
close: "Close",
|
|
11738
|
+
create: "New lorebook",
|
|
11739
|
+
createTitle: "New lorebook",
|
|
11740
|
+
createHelp: "The new lorebook starts empty. Add entries yourself or with the assistant.",
|
|
11741
|
+
bookName: "Name",
|
|
11742
|
+
bookNameHelp: "Letters, digits, \"-\" and \"_\", up to 64. Worlds and stories refer to the lorebook by this name.",
|
|
11743
|
+
bookTitle: "Title",
|
|
11744
|
+
bookDescription: "Description",
|
|
11745
|
+
creating: "Creating…",
|
|
11746
|
+
createFailed: "Could not create the lorebook: {message}",
|
|
11747
|
+
import: "Import SillyTavern lorebook",
|
|
11748
|
+
importTitle: "Import a SillyTavern lorebook",
|
|
11749
|
+
importHelp: "The assistant reads {file}. Facts become entries that everyone in a story knows, unless an entry clearly says only some characters do. Instructions to the AI are kept aside, and you are asked before they become a preset.",
|
|
11750
|
+
importing: "Importing…",
|
|
11751
|
+
importFailed: "Could not import the lorebook: {message}",
|
|
11752
|
+
importNotStarted: "The lorebook was kept, but the assistant could not be started: {message}. Open its authoring chat to continue.",
|
|
11753
|
+
edit: "Edit",
|
|
11754
|
+
author: "Edit with assistant",
|
|
11755
|
+
authorFailed: "Could not open the authoring chat: {message}",
|
|
11756
|
+
delete: "Delete",
|
|
11757
|
+
deleteTitle: "Delete lorebook",
|
|
11758
|
+
deleteHelp: "Delete {name}? Stories that already use it keep their own copy. The lorebook is moved to the trash folder.",
|
|
11759
|
+
deleting: "Deleting…",
|
|
11760
|
+
deleteFailed: "Could not delete the lorebook: {message}",
|
|
11761
|
+
broken: "Cannot be used: {problems}",
|
|
11762
|
+
entriesCount: "{count} entries",
|
|
11763
|
+
commonCount: "{count} known to everyone",
|
|
11764
|
+
info: "About",
|
|
11765
|
+
infoSave: "Save",
|
|
11766
|
+
infoSaving: "Saving…",
|
|
11767
|
+
infoSaved: "Saved.",
|
|
11768
|
+
infoFailed: "Could not save: {message}",
|
|
11769
|
+
entries: "Entries",
|
|
11770
|
+
entriesHelp: "One fact of the world each, written as reference prose. A story starts with every entry; entries known to everyone are known to every character, and the others only to the characters listed.",
|
|
11771
|
+
entryPick: "Entry",
|
|
11772
|
+
entryNew: "New entry",
|
|
11773
|
+
entryAdd: "New entry",
|
|
11774
|
+
entryId: "Id",
|
|
11775
|
+
entryTitle: "Title",
|
|
11776
|
+
entryKind: "Kind",
|
|
11777
|
+
entryScope: "Who knows it",
|
|
11778
|
+
entryKnownBy: "Known by (names, separated by commas)",
|
|
11779
|
+
entrySummary: "Summary (one sentence)",
|
|
11780
|
+
entryBody: "Text",
|
|
11781
|
+
entryRelated: "Related entries (ids, separated by commas)",
|
|
11782
|
+
entrySave: "Save entry",
|
|
11783
|
+
entrySaving: "Saving…",
|
|
11784
|
+
entrySaved: "Saved.",
|
|
11785
|
+
entryRemove: "Remove this entry",
|
|
11786
|
+
entryFailed: "Could not save the entry: {message}",
|
|
11787
|
+
scope_everyone: "Everyone",
|
|
11788
|
+
scope_listed: "Only the characters listed",
|
|
11789
|
+
kind_history: "History",
|
|
11790
|
+
kind_culture: "Culture",
|
|
11791
|
+
kind_religion: "Religion",
|
|
11792
|
+
kind_politics: "Politics",
|
|
11793
|
+
kind_geography: "Geography",
|
|
11794
|
+
kind_science: "Science",
|
|
11795
|
+
kind_custom: "Custom",
|
|
11796
|
+
kind_legend: "Legend",
|
|
11797
|
+
kind_other: "Other"
|
|
11798
|
+
},
|
|
11799
|
+
zh: {
|
|
11800
|
+
nav: "世界书",
|
|
11801
|
+
language: "zh",
|
|
11802
|
+
loading: "正在加载世界书…",
|
|
11803
|
+
loadFailed: "无法加载世界书:{message}",
|
|
11804
|
+
empty: "还没有世界书。世界书是任何故事都可以带上的背景知识集合(历史、习俗、地点、传说)。你可以新建一本来填写,或导入酒馆世界书。",
|
|
11805
|
+
countOne: "{count} 本世界书",
|
|
11806
|
+
countOther: "{count} 本世界书",
|
|
11807
|
+
refresh: "刷新",
|
|
11808
|
+
refreshing: "正在刷新…",
|
|
11809
|
+
back: "返回",
|
|
11810
|
+
cancel: "取消",
|
|
11811
|
+
close: "关闭",
|
|
11812
|
+
create: "新建世界书",
|
|
11813
|
+
createTitle: "新建世界书",
|
|
11814
|
+
createHelp: "新世界书一开始是空的。可以自己添加条目,也可以交给助手。",
|
|
11815
|
+
bookName: "名称",
|
|
11816
|
+
bookNameHelp: "字母、数字、“-”和“_”,最长 64 个字符。世界和故事通过这个名称引用世界书。",
|
|
11817
|
+
bookTitle: "标题",
|
|
11818
|
+
bookDescription: "描述",
|
|
11819
|
+
creating: "正在创建…",
|
|
11820
|
+
createFailed: "无法创建世界书:{message}",
|
|
11821
|
+
import: "导入酒馆世界书",
|
|
11822
|
+
importTitle: "导入酒馆世界书",
|
|
11823
|
+
importHelp: "助手会读取 {file}。事实会变成故事中人人皆知的条目,除非条目明确说明只有部分角色知道。给 AI 的指令会被单独保存,变成预设之前会先征求你的同意。",
|
|
11824
|
+
importing: "正在导入…",
|
|
11825
|
+
importFailed: "无法导入世界书:{message}",
|
|
11826
|
+
importNotStarted: "世界书已保存,但助手没能启动:{message}。请打开它的创作聊天继续。",
|
|
11827
|
+
edit: "编辑",
|
|
11828
|
+
author: "用助手编辑",
|
|
11829
|
+
authorFailed: "无法打开创作聊天:{message}",
|
|
11830
|
+
delete: "删除",
|
|
11831
|
+
deleteTitle: "删除世界书",
|
|
11832
|
+
deleteHelp: "删除{name}?已经在使用它的故事会保留各自的副本。该世界书会被移到回收文件夹。",
|
|
11833
|
+
deleting: "正在删除…",
|
|
11834
|
+
deleteFailed: "无法删除世界书:{message}",
|
|
11835
|
+
broken: "无法使用:{problems}",
|
|
11836
|
+
entriesCount: "{count} 个条目",
|
|
11837
|
+
commonCount: "{count} 个人人皆知",
|
|
11838
|
+
info: "概览",
|
|
11839
|
+
infoSave: "保存",
|
|
11840
|
+
infoSaving: "正在保存…",
|
|
11841
|
+
infoSaved: "已保存。",
|
|
11842
|
+
infoFailed: "无法保存:{message}",
|
|
11843
|
+
entries: "条目",
|
|
11844
|
+
entriesHelp: "每条是世界的一个事实,写成说明性文字。故事开始时会带上每个条目;人人皆知的条目每个角色都知道,其余的只有列出的角色知道。",
|
|
11845
|
+
entryPick: "条目",
|
|
11846
|
+
entryNew: "新条目",
|
|
11847
|
+
entryAdd: "新条目",
|
|
11848
|
+
entryId: "编号",
|
|
11849
|
+
entryTitle: "标题",
|
|
11850
|
+
entryKind: "类型",
|
|
11851
|
+
entryScope: "谁知道",
|
|
11852
|
+
entryKnownBy: "知道的人(名字,用逗号分隔)",
|
|
11853
|
+
entrySummary: "摘要(一句话)",
|
|
11854
|
+
entryBody: "正文",
|
|
11855
|
+
entryRelated: "相关条目(编号,用逗号分隔)",
|
|
11856
|
+
entrySave: "保存条目",
|
|
11857
|
+
entrySaving: "正在保存…",
|
|
11858
|
+
entrySaved: "已保存。",
|
|
11859
|
+
entryRemove: "移除此条目",
|
|
11860
|
+
entryFailed: "无法保存条目:{message}",
|
|
11861
|
+
scope_everyone: "所有人",
|
|
11862
|
+
scope_listed: "仅列出的角色",
|
|
11863
|
+
kind_history: "历史",
|
|
11864
|
+
kind_culture: "文化",
|
|
11865
|
+
kind_religion: "宗教",
|
|
11866
|
+
kind_politics: "政治",
|
|
11867
|
+
kind_geography: "地理",
|
|
11868
|
+
kind_science: "科学",
|
|
11869
|
+
kind_custom: "习俗",
|
|
11870
|
+
kind_legend: "传说",
|
|
11871
|
+
kind_other: "其他"
|
|
11872
|
+
}
|
|
11873
|
+
};
|
|
11874
|
+
//#endregion
|
|
11875
|
+
//#region src/client/pages/lorebooks/lorebooks-controller.ts
|
|
11876
|
+
const messageOf$4 = (error) => error instanceof Error ? error.message : String(error);
|
|
11877
|
+
/** Reads the lorebook library from the host and makes, removes and opens its lorebooks. */
|
|
11878
|
+
var LorebooksController = class {
|
|
11879
|
+
openChat;
|
|
11880
|
+
language;
|
|
11881
|
+
store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
|
|
11882
|
+
status: "idle",
|
|
11883
|
+
refreshing: false
|
|
11884
|
+
});
|
|
11885
|
+
abort = new AbortController();
|
|
11886
|
+
face = {
|
|
11887
|
+
hooks: { lorebooks: this.store },
|
|
11888
|
+
load: () => {
|
|
11889
|
+
if (this.store.getSnapshot().status === "idle") this.read(false);
|
|
11890
|
+
},
|
|
11891
|
+
refresh: () => {
|
|
11892
|
+
this.read(true);
|
|
11893
|
+
},
|
|
11894
|
+
create: async (name, title, description) => {
|
|
11895
|
+
await createLorebook({
|
|
11896
|
+
name,
|
|
11897
|
+
...title === "" ? {} : { title },
|
|
11898
|
+
...description === "" ? {} : { description }
|
|
11899
|
+
}, this.abort.signal);
|
|
11900
|
+
await this.read(true);
|
|
11901
|
+
},
|
|
11902
|
+
remove: async (name) => {
|
|
11903
|
+
await deleteLorebook(name, this.abort.signal);
|
|
11904
|
+
await this.read(true);
|
|
11905
|
+
},
|
|
11906
|
+
author: async (name) => {
|
|
11907
|
+
this.openChat((await authorLorebook(name, this.language(), this.abort.signal)).chatSessionId);
|
|
11908
|
+
},
|
|
11909
|
+
importFile: async (name, file) => {
|
|
11910
|
+
const opened = await importLorebook(name, file, this.language(), this.abort.signal);
|
|
11911
|
+
await this.read(true);
|
|
11912
|
+
this.openChat(opened.chatSessionId);
|
|
11913
|
+
return {
|
|
11914
|
+
started: opened.started,
|
|
11915
|
+
...opened.failure === void 0 ? {} : { failure: opened.failure }
|
|
11916
|
+
};
|
|
11917
|
+
}
|
|
11918
|
+
};
|
|
11919
|
+
constructor(openChat, language) {
|
|
11920
|
+
this.openChat = openChat;
|
|
11921
|
+
this.language = language;
|
|
11922
|
+
}
|
|
11923
|
+
inject() {
|
|
11924
|
+
return this.face;
|
|
11925
|
+
}
|
|
11926
|
+
dispose() {
|
|
11927
|
+
this.abort.abort();
|
|
11928
|
+
}
|
|
11929
|
+
async read(refreshing) {
|
|
11930
|
+
this.store.update((draft) => {
|
|
11931
|
+
if (refreshing) draft.refreshing = true;
|
|
11932
|
+
else draft.status = "loading";
|
|
11933
|
+
});
|
|
11934
|
+
try {
|
|
11935
|
+
const books = await listLorebooks(this.abort.signal);
|
|
11936
|
+
this.store.update((draft) => {
|
|
11937
|
+
draft.status = "ready";
|
|
11938
|
+
draft.books = books;
|
|
11939
|
+
delete draft.error;
|
|
11940
|
+
});
|
|
11941
|
+
} catch (error) {
|
|
11942
|
+
if (this.abort.signal.aborted) return;
|
|
11943
|
+
this.store.update((draft) => {
|
|
11944
|
+
draft.error = messageOf$4(error);
|
|
11945
|
+
if (draft.books === void 0) draft.status = "failed";
|
|
11946
|
+
});
|
|
11947
|
+
} finally {
|
|
11948
|
+
if (!this.abort.signal.aborted) this.store.update((draft) => {
|
|
11949
|
+
draft.refreshing = false;
|
|
11950
|
+
});
|
|
11951
|
+
}
|
|
11952
|
+
}
|
|
11953
|
+
};
|
|
10750
11954
|
//#endregion
|
|
10751
|
-
//#region src/client/pages/
|
|
10752
|
-
const NAMESPACE$10 = "roleplay.
|
|
10753
|
-
/** Adds the
|
|
10754
|
-
function
|
|
11955
|
+
//#region src/client/pages/lorebooks/index.ts
|
|
11956
|
+
const NAMESPACE$10 = "roleplay.lorebooks";
|
|
11957
|
+
/** Adds the Lorebooks page to the Role Play panel: reusable background knowledge that stories start with. */
|
|
11958
|
+
function registerLorebooksPage(ctx) {
|
|
10755
11959
|
const t = ctx.locale.bind(NAMESPACE$10);
|
|
10756
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$10, dictionaries$9), "roleplay:
|
|
10757
|
-
const
|
|
11960
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$10, dictionaries$9), "roleplay: lorebooks dictionaries");
|
|
11961
|
+
const lorebooks = new LorebooksController(createChatOpener(ctx), () => t("language"));
|
|
10758
11962
|
ctx.effect(() => () => {
|
|
10759
|
-
|
|
10760
|
-
}, "roleplay:
|
|
11963
|
+
lorebooks.dispose();
|
|
11964
|
+
}, "roleplay: lorebooks requests");
|
|
10761
11965
|
ctx.slots.inject("roleplay.page", () => ctx.slots.register({
|
|
10762
11966
|
name: "roleplay.page",
|
|
10763
|
-
id: "
|
|
10764
|
-
order:
|
|
11967
|
+
id: "lorebooks",
|
|
11968
|
+
order: 8,
|
|
10765
11969
|
label: () => t("nav"),
|
|
10766
11970
|
locale: NAMESPACE$10,
|
|
10767
|
-
inject: () =>
|
|
10768
|
-
},
|
|
11971
|
+
inject: () => lorebooks.inject()
|
|
11972
|
+
}, LorebooksPage));
|
|
10769
11973
|
}
|
|
10770
11974
|
//#endregion
|
|
10771
11975
|
//#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}}";
|
|
11976
|
+
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_warning{color:var(--dsw-alias-state-warning-primary,var(--dsw-alias-state-error-primary));margin:0;font-size:12px}.rp_ZK89ba_ok{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_ZK89ba_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_ZK89ba_editTitle{color:var(--dsw-alias-label-primary);flex:auto;font-size:14px;font-weight:500}.rp_ZK89ba_editBody{flex-direction:column;flex:1 1 0;gap:24px;min-height:0;padding:16px 24px;display:flex;overflow-y:auto}.rp_ZK89ba_section{flex-direction:column;gap:12px;max-width:720px;display:flex}.rp_ZK89ba_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_ZK89ba_help{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_ZK89ba_row{flex-wrap:wrap;gap:12px;display:flex}.rp_ZK89ba_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_ZK89ba_field{flex-direction:column;flex:200px;gap:6px;min-width:0;display:flex}.rp_ZK89ba_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_ZK89ba_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:280px;font:13px/20px var(--dsw-font-mono,monospace);color:var(--dsw-alias-label-primary);resize:vertical;padding:8px}.rp_ZK89ba_input{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}@media (width<=640px){.rp_ZK89ba_grid{grid-template-columns:1fr}.rp_ZK89ba_form{min-width:0}.rp_ZK89ba_editBody{padding:16px}}";
|
|
10773
11977
|
const key$18 = "src/client/pages/presets/PresetsPage.module.css";
|
|
10774
11978
|
let tag$18 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$18) + "]");
|
|
10775
11979
|
if (tag$18 === null) {
|
|
@@ -10780,34 +11984,35 @@ window.__ModuleLoader__.load({
|
|
|
10780
11984
|
}
|
|
10781
11985
|
tag$18.textContent = css$18;
|
|
10782
11986
|
var PresetsPage_module_css_default = {
|
|
10783
|
-
"
|
|
10784
|
-
"grid": "rp_ZK89ba_grid",
|
|
10785
|
-
"viewport": "rp_ZK89ba_viewport",
|
|
10786
|
-
"error": "rp_ZK89ba_error",
|
|
10787
|
-
"editHeader": "rp_ZK89ba_editHeader",
|
|
11987
|
+
"row": "rp_ZK89ba_row",
|
|
10788
11988
|
"description": "rp_ZK89ba_description",
|
|
10789
|
-
"
|
|
10790
|
-
"
|
|
11989
|
+
"field": "rp_ZK89ba_field",
|
|
11990
|
+
"name": "rp_ZK89ba_name",
|
|
11991
|
+
"input": "rp_ZK89ba_input",
|
|
11992
|
+
"card": "rp_ZK89ba_card",
|
|
11993
|
+
"warning": "rp_ZK89ba_warning",
|
|
11994
|
+
"help": "rp_ZK89ba_help",
|
|
11995
|
+
"editTitle": "rp_ZK89ba_editTitle",
|
|
11996
|
+
"cardActions": "rp_ZK89ba_cardActions",
|
|
10791
11997
|
"meta": "rp_ZK89ba_meta",
|
|
10792
11998
|
"toolbar": "rp_ZK89ba_toolbar",
|
|
10793
|
-
"
|
|
10794
|
-
"
|
|
11999
|
+
"page": "rp_ZK89ba_page",
|
|
12000
|
+
"viewport": "rp_ZK89ba_viewport",
|
|
12001
|
+
"ok": "rp_ZK89ba_ok",
|
|
12002
|
+
"editBody": "rp_ZK89ba_editBody",
|
|
12003
|
+
"actions": "rp_ZK89ba_actions",
|
|
12004
|
+
"area": "rp_ZK89ba_area",
|
|
10795
12005
|
"count": "rp_ZK89ba_count",
|
|
12006
|
+
"grid": "rp_ZK89ba_grid",
|
|
10796
12007
|
"title": "rp_ZK89ba_title",
|
|
10797
|
-
"
|
|
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",
|
|
12008
|
+
"sectionTitle": "rp_ZK89ba_sectionTitle",
|
|
10807
12009
|
"section": "rp_ZK89ba_section",
|
|
10808
|
-
"
|
|
10809
|
-
"
|
|
10810
|
-
"
|
|
12010
|
+
"error": "rp_ZK89ba_error",
|
|
12011
|
+
"form": "rp_ZK89ba_form",
|
|
12012
|
+
"head": "rp_ZK89ba_head",
|
|
12013
|
+
"editHeader": "rp_ZK89ba_editHeader",
|
|
12014
|
+
"label": "rp_ZK89ba_label",
|
|
12015
|
+
"message": "rp_ZK89ba_message"
|
|
10811
12016
|
};
|
|
10812
12017
|
//#endregion
|
|
10813
12018
|
//#region src/client/pages/presets/PresetEditor.tsx
|
|
@@ -10941,7 +12146,7 @@ window.__ModuleLoader__.load({
|
|
|
10941
12146
|
};
|
|
10942
12147
|
const label = (key) => {
|
|
10943
12148
|
const { language, id } = promptKey(key);
|
|
10944
|
-
return `${language} · ${t(`prompt_${id}`)}`;
|
|
12149
|
+
return `${language} · ${PROMPT_IDS.includes(id) ? t(`prompt_${id}`) : id}`;
|
|
10945
12150
|
};
|
|
10946
12151
|
const field = (key, caption, options = {}) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
10947
12152
|
className: PresetsPage_module_css_default.field,
|
|
@@ -11056,6 +12261,11 @@ window.__ModuleLoader__.load({
|
|
|
11056
12261
|
className: PresetsPage_module_css_default.help,
|
|
11057
12262
|
children: t("promptsHelp")
|
|
11058
12263
|
}),
|
|
12264
|
+
loaded.summary.rules.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12265
|
+
className: PresetsPage_module_css_default.warning,
|
|
12266
|
+
role: "note",
|
|
12267
|
+
children: t("rulesWarning", { list: loaded.summary.rules.join(", ") })
|
|
12268
|
+
}),
|
|
11059
12269
|
paths.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11060
12270
|
className: PresetsPage_module_css_default.message,
|
|
11061
12271
|
children: t("promptsNone")
|
|
@@ -11434,6 +12644,11 @@ window.__ModuleLoader__.load({
|
|
|
11434
12644
|
className: PresetsPage_module_css_default.meta,
|
|
11435
12645
|
children: [t("languages", { list: preset.languages.join(", ") }), t("promptsCount", { count: preset.prompts.length })].join(" · ")
|
|
11436
12646
|
}),
|
|
12647
|
+
preset.rules.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12648
|
+
className: PresetsPage_module_css_default.warning,
|
|
12649
|
+
role: "note",
|
|
12650
|
+
children: t("rulesWarning", { list: preset.rules.join(", ") })
|
|
12651
|
+
}),
|
|
11437
12652
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11438
12653
|
className: PresetsPage_module_css_default.cardActions,
|
|
11439
12654
|
children: [
|
|
@@ -11561,6 +12776,7 @@ window.__ModuleLoader__.load({
|
|
|
11561
12776
|
missing: "This preset is no longer there.",
|
|
11562
12777
|
promptAdd: "Add a prompt…",
|
|
11563
12778
|
promptAddButton: "Add",
|
|
12779
|
+
rulesWarning: "Warning: this preset carries prompts that hold rules of the game ({list}). They change how the models are told to run the story, not only how it reads, and a wrong change can break it.",
|
|
11564
12780
|
"prompt_roleplay/persona": "Persona",
|
|
11565
12781
|
"prompt_roleplay/style": "Narration style",
|
|
11566
12782
|
"prompt_roleplay/character-style": "Character style"
|
|
@@ -11625,6 +12841,7 @@ window.__ModuleLoader__.load({
|
|
|
11625
12841
|
missing: "这个预设已不存在。",
|
|
11626
12842
|
promptAdd: "添加提示词…",
|
|
11627
12843
|
promptAddButton: "添加",
|
|
12844
|
+
rulesWarning: "警告:这个预设带有属于游戏规则的提示词({list})。它们改变的是模型如何主持故事,而不只是文风,改错可能会破坏故事的运行。",
|
|
11628
12845
|
"prompt_roleplay/persona": "人设",
|
|
11629
12846
|
"prompt_roleplay/style": "叙述文风",
|
|
11630
12847
|
"prompt_roleplay/character-style": "角色风格"
|
|
@@ -11761,8 +12978,8 @@ window.__ModuleLoader__.load({
|
|
|
11761
12978
|
}
|
|
11762
12979
|
tag$17.textContent = css$17;
|
|
11763
12980
|
var Pager_module_css_default = {
|
|
11764
|
-
"
|
|
11765
|
-
"
|
|
12981
|
+
"pager": "rp_KBAD0W_pager",
|
|
12982
|
+
"position": "rp_KBAD0W_position"
|
|
11766
12983
|
};
|
|
11767
12984
|
//#endregion
|
|
11768
12985
|
//#region src/client/widgets/pager/Pager.tsx
|
|
@@ -11835,10 +13052,10 @@ window.__ModuleLoader__.load({
|
|
|
11835
13052
|
}
|
|
11836
13053
|
tag$15.textContent = css$15;
|
|
11837
13054
|
var DeleteSessionDialog_module_css_default = {
|
|
11838
|
-
"body": "rp_FifHrW_body",
|
|
11839
|
-
"error": "rp_FifHrW_error",
|
|
11840
13055
|
"question": "rp_FifHrW_question",
|
|
11841
|
-
"warning": "rp_FifHrW_warning"
|
|
13056
|
+
"warning": "rp_FifHrW_warning",
|
|
13057
|
+
"error": "rp_FifHrW_error",
|
|
13058
|
+
"body": "rp_FifHrW_body"
|
|
11842
13059
|
};
|
|
11843
13060
|
//#endregion
|
|
11844
13061
|
//#region src/client/pages/sessions/DeleteSessionDialog.tsx
|
|
@@ -11945,28 +13162,28 @@ window.__ModuleLoader__.load({
|
|
|
11945
13162
|
}
|
|
11946
13163
|
tag$14.textContent = css$14;
|
|
11947
13164
|
var SessionsPage_module_css_default = {
|
|
11948
|
-
"
|
|
11949
|
-
"turnsColumn": "rp_24z4eW_turnsColumn",
|
|
11950
|
-
"secondary": "rp_24z4eW_secondary",
|
|
11951
|
-
"table": "rp_24z4eW_table",
|
|
11952
|
-
"page": "rp_24z4eW_page",
|
|
13165
|
+
"count": "rp_24z4eW_count",
|
|
11953
13166
|
"actions": "rp_24z4eW_actions",
|
|
11954
|
-
"
|
|
11955
|
-
"
|
|
13167
|
+
"viewport": "rp_24z4eW_viewport",
|
|
13168
|
+
"worldColumn": "rp_24z4eW_worldColumn",
|
|
11956
13169
|
"spin": "rp_24z4eW_spin",
|
|
11957
|
-
"count": "rp_24z4eW_count",
|
|
11958
13170
|
"fits": "rp_24z4eW_fits",
|
|
11959
|
-
"
|
|
11960
|
-
"
|
|
13171
|
+
"table": "rp_24z4eW_table",
|
|
13172
|
+
"toolbar": "rp_24z4eW_toolbar",
|
|
13173
|
+
"spinning": "rp_24z4eW_spinning",
|
|
13174
|
+
"scrolls": "rp_24z4eW_scrolls",
|
|
13175
|
+
"turnsColumn": "rp_24z4eW_turnsColumn",
|
|
13176
|
+
"number": "rp_24z4eW_number",
|
|
13177
|
+
"page": "rp_24z4eW_page",
|
|
13178
|
+
"secondary": "rp_24z4eW_secondary",
|
|
11961
13179
|
"name": "rp_24z4eW_name",
|
|
11962
13180
|
"message": "rp_24z4eW_message",
|
|
11963
|
-
"
|
|
13181
|
+
"badge": "rp_24z4eW_badge",
|
|
11964
13182
|
"archived": "rp_24z4eW_archived",
|
|
11965
|
-
"worldColumn": "rp_24z4eW_worldColumn",
|
|
11966
13183
|
"notice": "rp_24z4eW_notice",
|
|
11967
|
-
"
|
|
11968
|
-
"
|
|
11969
|
-
"
|
|
13184
|
+
"actionsColumn": "rp_24z4eW_actionsColumn",
|
|
13185
|
+
"timeColumn": "rp_24z4eW_timeColumn",
|
|
13186
|
+
"nameColumn": "rp_24z4eW_nameColumn"
|
|
11970
13187
|
};
|
|
11971
13188
|
//#endregion
|
|
11972
13189
|
//#region src/client/pages/sessions/SessionsPage.tsx
|
|
@@ -12482,14 +13699,14 @@ window.__ModuleLoader__.load({
|
|
|
12482
13699
|
}
|
|
12483
13700
|
tag$13.textContent = css$13;
|
|
12484
13701
|
var WorldCard_module_css_default = {
|
|
12485
|
-
"cover": "rp_Bvxx5q_cover",
|
|
12486
|
-
"tags": "rp_Bvxx5q_tags",
|
|
12487
|
-
"placeholder": "rp_Bvxx5q_placeholder",
|
|
12488
|
-
"image": "rp_Bvxx5q_image",
|
|
12489
13702
|
"info": "rp_Bvxx5q_info",
|
|
13703
|
+
"name": "rp_Bvxx5q_name",
|
|
12490
13704
|
"tag": "rp_Bvxx5q_tag",
|
|
12491
13705
|
"openButton": "rp_Bvxx5q_openButton",
|
|
12492
|
-
"
|
|
13706
|
+
"tags": "rp_Bvxx5q_tags",
|
|
13707
|
+
"image": "rp_Bvxx5q_image",
|
|
13708
|
+
"cover": "rp_Bvxx5q_cover",
|
|
13709
|
+
"placeholder": "rp_Bvxx5q_placeholder",
|
|
12493
13710
|
"play": "rp_Bvxx5q_play",
|
|
12494
13711
|
"card": "rp_Bvxx5q_card"
|
|
12495
13712
|
};
|
|
@@ -12585,9 +13802,9 @@ window.__ModuleLoader__.load({
|
|
|
12585
13802
|
}
|
|
12586
13803
|
tag$12.textContent = css$12;
|
|
12587
13804
|
var AvatarChoices_module_css_default = {
|
|
12588
|
-
"text": "rp_YCstOG_text",
|
|
12589
13805
|
"name": "rp_YCstOG_name",
|
|
12590
13806
|
"option": "rp_YCstOG_option",
|
|
13807
|
+
"text": "rp_YCstOG_text",
|
|
12591
13808
|
"summary": "rp_YCstOG_summary"
|
|
12592
13809
|
};
|
|
12593
13810
|
//#endregion
|
|
@@ -12628,18 +13845,18 @@ window.__ModuleLoader__.load({
|
|
|
12628
13845
|
}
|
|
12629
13846
|
tag$11.textContent = css$11;
|
|
12630
13847
|
var StartSessionDialog_module_css_default = {
|
|
12631
|
-
"message": "rp_AnbLKG_message",
|
|
12632
13848
|
"error": "rp_AnbLKG_error",
|
|
12633
|
-
"
|
|
12634
|
-
"
|
|
12635
|
-
"option": "rp_AnbLKG_option",
|
|
13849
|
+
"form": "rp_AnbLKG_form",
|
|
13850
|
+
"optionSummary": "rp_AnbLKG_optionSummary",
|
|
12636
13851
|
"field": "rp_AnbLKG_field",
|
|
12637
13852
|
"label": "rp_AnbLKG_label",
|
|
12638
|
-
"
|
|
13853
|
+
"message": "rp_AnbLKG_message",
|
|
13854
|
+
"advanced": "rp_AnbLKG_advanced",
|
|
12639
13855
|
"optionText": "rp_AnbLKG_optionText",
|
|
12640
|
-
"
|
|
13856
|
+
"optionName": "rp_AnbLKG_optionName",
|
|
12641
13857
|
"advancedToggle": "rp_AnbLKG_advancedToggle",
|
|
12642
|
-
"
|
|
13858
|
+
"advancedBody": "rp_AnbLKG_advancedBody",
|
|
13859
|
+
"option": "rp_AnbLKG_option"
|
|
12643
13860
|
};
|
|
12644
13861
|
//#endregion
|
|
12645
13862
|
//#region src/client/pages/worlds/AddAvatarsDialog.tsx
|
|
@@ -13512,14 +14729,14 @@ window.__ModuleLoader__.load({
|
|
|
13512
14729
|
}
|
|
13513
14730
|
tag$10.textContent = css$10;
|
|
13514
14731
|
var SettingsFields_module_css_default = {
|
|
14732
|
+
"row": "rp_Rhi3yq_row",
|
|
14733
|
+
"label": "rp_Rhi3yq_label",
|
|
13515
14734
|
"area": "rp_Rhi3yq_area",
|
|
13516
14735
|
"help": "rp_Rhi3yq_help",
|
|
13517
|
-
"groupTitle": "rp_Rhi3yq_groupTitle",
|
|
13518
14736
|
"error": "rp_Rhi3yq_error",
|
|
13519
|
-
"
|
|
13520
|
-
"
|
|
13521
|
-
"field": "rp_Rhi3yq_field"
|
|
13522
|
-
"group": "rp_Rhi3yq_group"
|
|
14737
|
+
"group": "rp_Rhi3yq_group",
|
|
14738
|
+
"groupTitle": "rp_Rhi3yq_groupTitle",
|
|
14739
|
+
"field": "rp_Rhi3yq_field"
|
|
13523
14740
|
};
|
|
13524
14741
|
//#endregion
|
|
13525
14742
|
//#region src/client/settings-form/SettingsFields.tsx
|
|
@@ -13786,9 +15003,9 @@ window.__ModuleLoader__.load({
|
|
|
13786
15003
|
}
|
|
13787
15004
|
tag$9.textContent = css$9;
|
|
13788
15005
|
var TranslateBanner_module_css_default = {
|
|
13789
|
-
"banner": "rp_Lx8vJa_banner",
|
|
13790
15006
|
"text": "rp_Lx8vJa_text",
|
|
13791
|
-
"error": "rp_Lx8vJa_error"
|
|
15007
|
+
"error": "rp_Lx8vJa_error",
|
|
15008
|
+
"banner": "rp_Lx8vJa_banner"
|
|
13792
15009
|
};
|
|
13793
15010
|
//#endregion
|
|
13794
15011
|
//#region src/client/pages/worlds/TranslateBanner.tsx
|
|
@@ -13857,6 +15074,8 @@ window.__ModuleLoader__.load({
|
|
|
13857
15074
|
const [opening, setOpening] = (0, react.useState)("");
|
|
13858
15075
|
const [startTime, setStartTime] = (0, react.useState)("");
|
|
13859
15076
|
const [preset, setPreset] = (0, react.useState)("");
|
|
15077
|
+
const [books, setBooks] = (0, react.useState)();
|
|
15078
|
+
const chosenBooks = books ?? new Set(dialog.suggestedLorebooks);
|
|
13860
15079
|
const [choice, setChoice] = (0, react.useState)();
|
|
13861
15080
|
const [brought, setBrought] = (0, react.useState)(/* @__PURE__ */ new Set());
|
|
13862
15081
|
const [showSettings, setShowSettings] = (0, react.useState)(false);
|
|
@@ -13917,6 +15136,7 @@ window.__ModuleLoader__.load({
|
|
|
13917
15136
|
avatars: bringing.map((avatar) => avatar.key),
|
|
13918
15137
|
...!openingValid ? {} : { opening: Number(opening) },
|
|
13919
15138
|
...preset === "" ? {} : { preset },
|
|
15139
|
+
...books === void 0 ? {} : { lorebooks: [...books] },
|
|
13920
15140
|
...startTime.trim() === "" || shown["clock.mode"] === "real" ? {} : { startingTime: startTime.trim() },
|
|
13921
15141
|
settings: fromDrafts(base, shown, options)
|
|
13922
15142
|
});
|
|
@@ -14044,6 +15264,43 @@ window.__ModuleLoader__.load({
|
|
|
14044
15264
|
})
|
|
14045
15265
|
]
|
|
14046
15266
|
}),
|
|
15267
|
+
dialog.status === "ready" && (dialog.lorebooks.length > 0 || dialog.suggestedLorebooks.length > 0) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
15268
|
+
className: StartSessionDialog_module_css_default.field,
|
|
15269
|
+
"data-testid": "roleplay-start-lorebooks",
|
|
15270
|
+
children: [
|
|
15271
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("legend", {
|
|
15272
|
+
className: StartSessionDialog_module_css_default.label,
|
|
15273
|
+
children: t("startLorebooks")
|
|
15274
|
+
}),
|
|
15275
|
+
dialog.lorebooks.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [
|
|
15276
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
15277
|
+
type: "checkbox",
|
|
15278
|
+
checked: chosenBooks.has(entry.name),
|
|
15279
|
+
disabled: dialog.submitting || entry.problems.length > 0,
|
|
15280
|
+
onChange: (event) => {
|
|
15281
|
+
const next = new Set(chosenBooks);
|
|
15282
|
+
if (event.target.checked) next.add(entry.name);
|
|
15283
|
+
else next.delete(entry.name);
|
|
15284
|
+
setBooks(next);
|
|
15285
|
+
}
|
|
15286
|
+
}),
|
|
15287
|
+
" ",
|
|
15288
|
+
entry.problems.length > 0 ? t("startLorebookBroken", { name: entry.title }) : t("startLorebookEntry", {
|
|
15289
|
+
name: entry.title,
|
|
15290
|
+
count: entry.entries
|
|
15291
|
+
}),
|
|
15292
|
+
dialog.suggestedLorebooks.includes(entry.name) ? ` · ${t("startLorebookSuggested")}` : ""
|
|
15293
|
+
] }, entry.name)),
|
|
15294
|
+
dialog.suggestedLorebooks.filter((name) => !dialog.lorebooks.some((entry) => entry.name === name)).map((name) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
15295
|
+
className: StartSessionDialog_module_css_default.message,
|
|
15296
|
+
children: t("startLorebookMissing", { name })
|
|
15297
|
+
}, name)),
|
|
15298
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
15299
|
+
className: StartSessionDialog_module_css_default.message,
|
|
15300
|
+
children: t("startLorebooksHelp")
|
|
15301
|
+
})
|
|
15302
|
+
]
|
|
15303
|
+
}),
|
|
14047
15304
|
dialog.status === "ready" && shown["clock.mode"] !== "real" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
14048
15305
|
className: StartSessionDialog_module_css_default.field,
|
|
14049
15306
|
children: [
|
|
@@ -14339,25 +15596,25 @@ window.__ModuleLoader__.load({
|
|
|
14339
15596
|
}
|
|
14340
15597
|
tag$8.textContent = css$8;
|
|
14341
15598
|
var WorldsPage_module_css_default = {
|
|
14342
|
-
"
|
|
15599
|
+
"scrolls": "rp_FHUyRq_scrolls",
|
|
15600
|
+
"starter": "rp_FHUyRq_starter",
|
|
14343
15601
|
"editHeader": "rp_FHUyRq_editHeader",
|
|
15602
|
+
"fits": "rp_FHUyRq_fits",
|
|
15603
|
+
"spinning": "rp_FHUyRq_spinning",
|
|
15604
|
+
"editBody": "rp_FHUyRq_editBody",
|
|
14344
15605
|
"notice": "rp_FHUyRq_notice",
|
|
14345
|
-
"spin": "rp_FHUyRq_spin",
|
|
14346
15606
|
"grid": "rp_FHUyRq_grid",
|
|
14347
15607
|
"editTitle": "rp_FHUyRq_editTitle",
|
|
14348
|
-
"fits": "rp_FHUyRq_fits",
|
|
14349
|
-
"toolbarActions": "rp_FHUyRq_toolbarActions",
|
|
14350
|
-
"editBody": "rp_FHUyRq_editBody",
|
|
14351
|
-
"starters": "rp_FHUyRq_starters",
|
|
14352
15608
|
"authorButton": "rp_FHUyRq_authorButton",
|
|
14353
|
-
"
|
|
14354
|
-
"count": "rp_FHUyRq_count",
|
|
14355
|
-
"page": "rp_FHUyRq_page",
|
|
15609
|
+
"toolbarActions": "rp_FHUyRq_toolbarActions",
|
|
14356
15610
|
"viewport": "rp_FHUyRq_viewport",
|
|
14357
|
-
"
|
|
14358
|
-
"
|
|
15611
|
+
"count": "rp_FHUyRq_count",
|
|
15612
|
+
"message": "rp_FHUyRq_message",
|
|
15613
|
+
"starters": "rp_FHUyRq_starters",
|
|
15614
|
+
"spin": "rp_FHUyRq_spin",
|
|
14359
15615
|
"toolbar": "rp_FHUyRq_toolbar",
|
|
14360
|
-
"
|
|
15616
|
+
"page": "rp_FHUyRq_page",
|
|
15617
|
+
"cell": "rp_FHUyRq_cell"
|
|
14361
15618
|
};
|
|
14362
15619
|
//#endregion
|
|
14363
15620
|
//#region src/client/pages/worlds/StarterWorlds.tsx
|
|
@@ -14427,34 +15684,34 @@ window.__ModuleLoader__.load({
|
|
|
14427
15684
|
}
|
|
14428
15685
|
tag$7.textContent = css$7;
|
|
14429
15686
|
var ImportCardPage_module_css_default = {
|
|
14430
|
-
"title": "rp_DmG_oG_title",
|
|
14431
|
-
"entryTitle": "rp_DmG_oG_entryTitle",
|
|
14432
|
-
"preview": "rp_DmG_oG_preview",
|
|
14433
15687
|
"noPicture": "rp_DmG_oG_noPicture",
|
|
14434
|
-
"fieldTitle": "rp_DmG_oG_fieldTitle",
|
|
14435
15688
|
"about": "rp_DmG_oG_about",
|
|
14436
|
-
"
|
|
15689
|
+
"entryTitle": "rp_DmG_oG_entryTitle",
|
|
15690
|
+
"field": "rp_DmG_oG_field",
|
|
14437
15691
|
"top": "rp_DmG_oG_top",
|
|
14438
|
-
"
|
|
15692
|
+
"header": "rp_DmG_oG_header",
|
|
15693
|
+
"fieldTitle": "rp_DmG_oG_fieldTitle",
|
|
15694
|
+
"text": "rp_DmG_oG_text",
|
|
15695
|
+
"entryOff": "rp_DmG_oG_entryOff",
|
|
14439
15696
|
"choice": "rp_DmG_oG_choice",
|
|
15697
|
+
"row": "rp_DmG_oG_row",
|
|
15698
|
+
"picture": "rp_DmG_oG_picture",
|
|
15699
|
+
"fieldMeta": "rp_DmG_oG_fieldMeta",
|
|
15700
|
+
"preview": "rp_DmG_oG_preview",
|
|
14440
15701
|
"error": "rp_DmG_oG_error",
|
|
15702
|
+
"heading": "rp_DmG_oG_heading",
|
|
14441
15703
|
"tags": "rp_DmG_oG_tags",
|
|
14442
|
-
"
|
|
15704
|
+
"section": "rp_DmG_oG_section",
|
|
15705
|
+
"space": "rp_DmG_oG_space",
|
|
14443
15706
|
"label": "rp_DmG_oG_label",
|
|
14444
|
-
"fieldMeta": "rp_DmG_oG_fieldMeta",
|
|
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
15707
|
"note": "rp_DmG_oG_note",
|
|
14450
|
-
"
|
|
15708
|
+
"title": "rp_DmG_oG_title",
|
|
15709
|
+
"page": "rp_DmG_oG_page",
|
|
15710
|
+
"entry": "rp_DmG_oG_entry",
|
|
14451
15711
|
"fieldHead": "rp_DmG_oG_fieldHead",
|
|
14452
|
-
"row": "rp_DmG_oG_row",
|
|
14453
15712
|
"entryHead": "rp_DmG_oG_entryHead",
|
|
14454
|
-
"
|
|
14455
|
-
"
|
|
14456
|
-
"entry": "rp_DmG_oG_entry",
|
|
14457
|
-
"text": "rp_DmG_oG_text"
|
|
15713
|
+
"body": "rp_DmG_oG_body",
|
|
15714
|
+
"choiceText": "rp_DmG_oG_choiceText"
|
|
14458
15715
|
};
|
|
14459
15716
|
//#endregion
|
|
14460
15717
|
//#region src/client/pages/worlds/ImportCardPage.tsx
|
|
@@ -15488,6 +16745,12 @@ window.__ModuleLoader__.load({
|
|
|
15488
16745
|
startTitle: "Start a new session",
|
|
15489
16746
|
sessionName: "Session name",
|
|
15490
16747
|
playAs: "Play as",
|
|
16748
|
+
startLorebooks: "Lorebooks",
|
|
16749
|
+
startLorebookEntry: "{name} ({count} entries)",
|
|
16750
|
+
startLorebookBroken: "{name} (has problems)",
|
|
16751
|
+
startLorebookSuggested: "suggested by the world",
|
|
16752
|
+
startLorebookMissing: "The world suggests the lorebook \"{name}\", which is not in your library.",
|
|
16753
|
+
startLorebooksHelp: "The entries of the lorebooks you tick are copied into the story. Entries known to everyone are known to every character.",
|
|
15491
16754
|
startPreset: "Writing preset",
|
|
15492
16755
|
startPresetDefault: "Default style",
|
|
15493
16756
|
startPresetWorld: "The world's suggestion ({name})",
|
|
@@ -15606,6 +16869,12 @@ window.__ModuleLoader__.load({
|
|
|
15606
16869
|
startTitle: "开始新存档",
|
|
15607
16870
|
sessionName: "存档名称",
|
|
15608
16871
|
playAs: "扮演角色",
|
|
16872
|
+
startLorebooks: "世界书",
|
|
16873
|
+
startLorebookEntry: "{name}({count} 个条目)",
|
|
16874
|
+
startLorebookBroken: "{name}(有问题)",
|
|
16875
|
+
startLorebookSuggested: "世界建议",
|
|
16876
|
+
startLorebookMissing: "世界建议使用世界书“{name}”,但你的资料库里没有。",
|
|
16877
|
+
startLorebooksHelp: "勾选的世界书的条目会复制进故事。人人皆知的条目,每个角色都知道。",
|
|
15609
16878
|
startPreset: "写作预设",
|
|
15610
16879
|
startPresetDefault: "默认风格",
|
|
15611
16880
|
startPresetWorld: "世界的建议({name})",
|
|
@@ -15662,7 +16931,7 @@ window.__ModuleLoader__.load({
|
|
|
15662
16931
|
startAvatars: "带上角色形象",
|
|
15663
16932
|
startAvatarsHelp: "勾选要带进这个存档的角色形象,它们会成为存档中的角色,你也可以扮演它们。世界本身不会改变。"
|
|
15664
16933
|
}
|
|
15665
|
-
}, dictionaries$6), dictionaries$
|
|
16934
|
+
}, dictionaries$6), dictionaries$11);
|
|
15666
16935
|
//#endregion
|
|
15667
16936
|
//#region src/client/pages/worlds/worlds-controller.ts
|
|
15668
16937
|
async function request$1(path, init, signal) {
|
|
@@ -15789,14 +17058,17 @@ window.__ModuleLoader__.load({
|
|
|
15789
17058
|
timeZone: "",
|
|
15790
17059
|
presets: [],
|
|
15791
17060
|
suggestedPreset: "",
|
|
17061
|
+
lorebooks: [],
|
|
17062
|
+
suggestedLorebooks: [],
|
|
15792
17063
|
submitting: false
|
|
15793
17064
|
};
|
|
15794
17065
|
});
|
|
15795
17066
|
try {
|
|
15796
|
-
const [{ characters, openings, startingTime, timeZone, preset }, avatars, presets] = await Promise.all([
|
|
17067
|
+
const [{ characters, openings, startingTime, timeZone, preset, lorebooks: suggested }, avatars, presets, books] = await Promise.all([
|
|
15797
17068
|
request$1(`/worlds/characters?id=${encodeURIComponent(worldId)}`, {}, this.abort.signal),
|
|
15798
17069
|
listAvatars(this.abort.signal).catch(() => []),
|
|
15799
|
-
request$1("/presets", {}, this.abort.signal).catch(() => [])
|
|
17070
|
+
request$1("/presets", {}, this.abort.signal).catch(() => []),
|
|
17071
|
+
request$1("/lorebooks", {}, this.abort.signal).catch(() => [])
|
|
15800
17072
|
]);
|
|
15801
17073
|
this.updateDialog(token, (dialog) => {
|
|
15802
17074
|
dialog.status = "ready";
|
|
@@ -15807,6 +17079,8 @@ window.__ModuleLoader__.load({
|
|
|
15807
17079
|
dialog.timeZone = timeZone;
|
|
15808
17080
|
dialog.presets = presets;
|
|
15809
17081
|
dialog.suggestedPreset = preset ?? "";
|
|
17082
|
+
dialog.lorebooks = books;
|
|
17083
|
+
dialog.suggestedLorebooks = suggested ?? [];
|
|
15810
17084
|
});
|
|
15811
17085
|
} catch (error) {
|
|
15812
17086
|
if (this.abort.signal.aborted) return;
|
|
@@ -15845,6 +17119,7 @@ window.__ModuleLoader__.load({
|
|
|
15845
17119
|
...options.opening === void 0 ? {} : { opening: options.opening },
|
|
15846
17120
|
...options.startingTime === void 0 ? {} : { startingTime: options.startingTime },
|
|
15847
17121
|
...options.preset === void 0 ? {} : { preset: options.preset },
|
|
17122
|
+
...options.lorebooks === void 0 ? {} : { lorebooks: options.lorebooks },
|
|
15848
17123
|
...options.settings === void 0 ? {} : { settings: options.settings }
|
|
15849
17124
|
})
|
|
15850
17125
|
}, this.abort.signal);
|
|
@@ -16030,9 +17305,9 @@ window.__ModuleLoader__.load({
|
|
|
16030
17305
|
}
|
|
16031
17306
|
tag$6.textContent = css$6;
|
|
16032
17307
|
var BranchDialog_module_css_default = {
|
|
16033
|
-
"field": "rp_Dy1TaW_field",
|
|
16034
|
-
"form": "rp_Dy1TaW_form",
|
|
16035
17308
|
"error": "rp_Dy1TaW_error",
|
|
17309
|
+
"form": "rp_Dy1TaW_form",
|
|
17310
|
+
"field": "rp_Dy1TaW_field",
|
|
16036
17311
|
"label": "rp_Dy1TaW_label"
|
|
16037
17312
|
};
|
|
16038
17313
|
//#endregion
|
|
@@ -16176,7 +17451,7 @@ window.__ModuleLoader__.load({
|
|
|
16176
17451
|
/** Adds the Gallery tab beside Chat and World: every image of the session in a grid. */
|
|
16177
17452
|
function registerGallery(ctx) {
|
|
16178
17453
|
const t = ctx.locale.bind(NAMESPACE$5);
|
|
16179
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$5, dictionaries$
|
|
17454
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$5, dictionaries$15), "roleplay: gallery dictionaries");
|
|
16180
17455
|
ctx.inject(["uiConversation"], (scope) => {
|
|
16181
17456
|
scope.uiConversation.views.register(galleryTarget);
|
|
16182
17457
|
scope.slots.inject("conversation.view", () => scope.slots.register({
|
|
@@ -16503,16 +17778,16 @@ window.__ModuleLoader__.load({
|
|
|
16503
17778
|
tag$5.textContent = css$5;
|
|
16504
17779
|
var SidebarPage_module_css_default = {
|
|
16505
17780
|
"bar": "rp_Ptco8a_bar",
|
|
16506
|
-
"main": "rp_Ptco8a_main",
|
|
16507
|
-
"title": "rp_Ptco8a_title",
|
|
16508
|
-
"icon": "rp_Ptco8a_icon",
|
|
16509
|
-
"entry": "rp_Ptco8a_entry",
|
|
16510
17781
|
"name": "rp_Ptco8a_name",
|
|
16511
|
-
"
|
|
17782
|
+
"page": "rp_Ptco8a_page",
|
|
16512
17783
|
"text": "rp_Ptco8a_text",
|
|
16513
17784
|
"description": "rp_Ptco8a_description",
|
|
16514
|
-
"
|
|
16515
|
-
"
|
|
17785
|
+
"content": "rp_Ptco8a_content",
|
|
17786
|
+
"entry": "rp_Ptco8a_entry",
|
|
17787
|
+
"title": "rp_Ptco8a_title",
|
|
17788
|
+
"main": "rp_Ptco8a_main",
|
|
17789
|
+
"icon": "rp_Ptco8a_icon",
|
|
17790
|
+
"message": "rp_Ptco8a_message"
|
|
16516
17791
|
};
|
|
16517
17792
|
//#endregion
|
|
16518
17793
|
//#region src/client/interface/SidebarPage.tsx
|
|
@@ -16815,7 +18090,7 @@ window.__ModuleLoader__.load({
|
|
|
16815
18090
|
/** Adds the World tab beside Chat: the state of the story, by the part of the world. */
|
|
16816
18091
|
function registerWorld(ctx) {
|
|
16817
18092
|
const t = ctx.locale.bind(NAMESPACE$3);
|
|
16818
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$3, dictionaries$
|
|
18093
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$3, dictionaries$11), "roleplay: world dictionaries");
|
|
16819
18094
|
ctx.inject(["uiConversation"], (scope) => {
|
|
16820
18095
|
scope.uiConversation.views.register(worldTarget);
|
|
16821
18096
|
scope.slots.inject("conversation.view", () => scope.slots.register({
|
|
@@ -16840,26 +18115,26 @@ window.__ModuleLoader__.load({
|
|
|
16840
18115
|
}
|
|
16841
18116
|
tag$4.textContent = css$4;
|
|
16842
18117
|
var ChatSettingsView_module_css_default = {
|
|
16843
|
-
"
|
|
16844
|
-
"
|
|
18118
|
+
"error": "rp_wLpbxW_error",
|
|
18119
|
+
"saved": "rp_wLpbxW_saved",
|
|
18120
|
+
"activity": "rp_wLpbxW_activity",
|
|
18121
|
+
"pre": "rp_wLpbxW_pre",
|
|
18122
|
+
"description": "rp_wLpbxW_description",
|
|
18123
|
+
"help": "rp_wLpbxW_help",
|
|
16845
18124
|
"table": "rp_wLpbxW_table",
|
|
16846
|
-
"
|
|
16847
|
-
"link": "rp_wLpbxW_link",
|
|
16848
|
-
"reasons": "rp_wLpbxW_reasons",
|
|
18125
|
+
"run": "rp_wLpbxW_run",
|
|
16849
18126
|
"select": "rp_wLpbxW_select",
|
|
16850
|
-
"
|
|
18127
|
+
"list": "rp_wLpbxW_list",
|
|
18128
|
+
"row": "rp_wLpbxW_row",
|
|
16851
18129
|
"field": "rp_wLpbxW_field",
|
|
16852
|
-
"
|
|
16853
|
-
"pre": "rp_wLpbxW_pre",
|
|
16854
|
-
"notice": "rp_wLpbxW_notice",
|
|
18130
|
+
"reasons": "rp_wLpbxW_reasons",
|
|
16855
18131
|
"message": "rp_wLpbxW_message",
|
|
16856
|
-
"
|
|
16857
|
-
"view": "rp_wLpbxW_view",
|
|
18132
|
+
"notice": "rp_wLpbxW_notice",
|
|
16858
18133
|
"label": "rp_wLpbxW_label",
|
|
16859
|
-
"
|
|
16860
|
-
"
|
|
16861
|
-
"
|
|
16862
|
-
"
|
|
18134
|
+
"link": "rp_wLpbxW_link",
|
|
18135
|
+
"actions": "rp_wLpbxW_actions",
|
|
18136
|
+
"view": "rp_wLpbxW_view",
|
|
18137
|
+
"title": "rp_wLpbxW_title"
|
|
16863
18138
|
};
|
|
16864
18139
|
//#endregion
|
|
16865
18140
|
//#region src/client/chat-settings/settings-api.ts
|
|
@@ -18131,7 +19406,7 @@ window.__ModuleLoader__.load({
|
|
|
18131
19406
|
saved: "已保存。",
|
|
18132
19407
|
saveFailed: "无法保存设置:{message}"
|
|
18133
19408
|
}
|
|
18134
|
-
}, dictionaries$6), dictionaries$
|
|
19409
|
+
}, dictionaries$6), dictionaries$16);
|
|
18135
19410
|
//#endregion
|
|
18136
19411
|
//#region src/client/chat-settings/index.ts
|
|
18137
19412
|
const NAMESPACE$2 = "roleplay.chatSettings";
|
|
@@ -18226,15 +19501,15 @@ window.__ModuleLoader__.load({
|
|
|
18226
19501
|
}
|
|
18227
19502
|
tag$3.textContent = css$3;
|
|
18228
19503
|
var CatalogueSettings_module_css_default = {
|
|
18229
|
-
"
|
|
18230
|
-
"row": "rp_KPhXDa_row",
|
|
18231
|
-
"keyHint": "rp_KPhXDa_keyHint",
|
|
18232
|
-
"title": "rp_KPhXDa_title",
|
|
19504
|
+
"problem": "rp_KPhXDa_problem",
|
|
18233
19505
|
"actions": "rp_KPhXDa_actions",
|
|
18234
|
-
"hint": "rp_KPhXDa_hint",
|
|
18235
19506
|
"label": "rp_KPhXDa_label",
|
|
19507
|
+
"hint": "rp_KPhXDa_hint",
|
|
18236
19508
|
"field": "rp_KPhXDa_field",
|
|
18237
|
-
"
|
|
19509
|
+
"title": "rp_KPhXDa_title",
|
|
19510
|
+
"row": "rp_KPhXDa_row",
|
|
19511
|
+
"section": "rp_KPhXDa_section",
|
|
19512
|
+
"keyHint": "rp_KPhXDa_keyHint"
|
|
18238
19513
|
};
|
|
18239
19514
|
//#endregion
|
|
18240
19515
|
//#region src/client/settings/CatalogueSettings.tsx
|
|
@@ -18674,28 +19949,28 @@ window.__ModuleLoader__.load({
|
|
|
18674
19949
|
}
|
|
18675
19950
|
tag$2.textContent = css$2;
|
|
18676
19951
|
var NarrationView_module_css_default = {
|
|
18677
|
-
"
|
|
19952
|
+
"oocNote": "rp_NFPimG_oocNote",
|
|
19953
|
+
"words": "rp_NFPimG_words",
|
|
19954
|
+
"images": "rp_NFPimG_images",
|
|
18678
19955
|
"imageError": "rp_NFPimG_imageError",
|
|
18679
19956
|
"dice": "rp_NFPimG_dice",
|
|
18680
|
-
"diceList": "rp_NFPimG_diceList",
|
|
18681
|
-
"output": "rp_NFPimG_output",
|
|
18682
|
-
"playAll": "rp_NFPimG_playAll",
|
|
18683
|
-
"oocLabel": "rp_NFPimG_oocLabel",
|
|
18684
|
-
"imageButton": "rp_NFPimG_imageButton",
|
|
18685
|
-
"note": "rp_NFPimG_note",
|
|
18686
|
-
"playLine": "rp_NFPimG_playLine",
|
|
18687
|
-
"line": "rp_NFPimG_line",
|
|
18688
19957
|
"oocRefused": "rp_NFPimG_oocRefused",
|
|
18689
|
-
"imageStatus": "rp_NFPimG_imageStatus",
|
|
18690
|
-
"narration": "rp_NFPimG_narration",
|
|
18691
19958
|
"diceSummary": "rp_NFPimG_diceSummary",
|
|
18692
|
-
"
|
|
19959
|
+
"narration": "rp_NFPimG_narration",
|
|
19960
|
+
"diceList": "rp_NFPimG_diceList",
|
|
18693
19961
|
"name": "rp_NFPimG_name",
|
|
19962
|
+
"sceneImage": "rp_NFPimG_sceneImage",
|
|
19963
|
+
"line": "rp_NFPimG_line",
|
|
19964
|
+
"playAll": "rp_NFPimG_playAll",
|
|
19965
|
+
"playLine": "rp_NFPimG_playLine",
|
|
18694
19966
|
"avatar": "rp_NFPimG_avatar",
|
|
18695
19967
|
"speech": "rp_NFPimG_speech",
|
|
18696
|
-
"
|
|
18697
|
-
"
|
|
18698
|
-
"
|
|
19968
|
+
"preview": "rp_NFPimG_preview",
|
|
19969
|
+
"imageStatus": "rp_NFPimG_imageStatus",
|
|
19970
|
+
"output": "rp_NFPimG_output",
|
|
19971
|
+
"note": "rp_NFPimG_note",
|
|
19972
|
+
"oocLabel": "rp_NFPimG_oocLabel",
|
|
19973
|
+
"imageButton": "rp_NFPimG_imageButton"
|
|
18699
19974
|
};
|
|
18700
19975
|
//#endregion
|
|
18701
19976
|
//#region src/client/transcript/PreviewNode.tsx
|
|
@@ -18960,11 +20235,11 @@ window.__ModuleLoader__.load({
|
|
|
18960
20235
|
}
|
|
18961
20236
|
tag$1.textContent = css$1;
|
|
18962
20237
|
var SuggestionsDock_module_css_default = {
|
|
18963
|
-
"card": "rp_rWH4DG_card",
|
|
18964
20238
|
"dock": "rp_rWH4DG_dock",
|
|
18965
|
-
"
|
|
20239
|
+
"chip": "rp_rWH4DG_chip",
|
|
18966
20240
|
"label": "rp_rWH4DG_label",
|
|
18967
|
-
"
|
|
20241
|
+
"card": "rp_rWH4DG_card",
|
|
20242
|
+
"lines": "rp_rWH4DG_lines"
|
|
18968
20243
|
};
|
|
18969
20244
|
//#endregion
|
|
18970
20245
|
//#region src/client/transcript/SuggestionsDock.tsx
|
|
@@ -19084,12 +20359,12 @@ window.__ModuleLoader__.load({
|
|
|
19084
20359
|
}
|
|
19085
20360
|
tag.textContent = css;
|
|
19086
20361
|
var TurnsDock_module_css_default = {
|
|
19087
|
-
"count": "rp_f4YLlq_count",
|
|
19088
|
-
"error": "rp_f4YLlq_error",
|
|
19089
20362
|
"group": "rp_f4YLlq_group",
|
|
19090
|
-
"
|
|
20363
|
+
"dock": "rp_f4YLlq_dock",
|
|
20364
|
+
"error": "rp_f4YLlq_error",
|
|
20365
|
+
"count": "rp_f4YLlq_count",
|
|
19091
20366
|
"select": "rp_f4YLlq_select",
|
|
19092
|
-
"
|
|
20367
|
+
"button": "rp_f4YLlq_button"
|
|
19093
20368
|
};
|
|
19094
20369
|
//#endregion
|
|
19095
20370
|
//#region src/client/transcript/withdrawn.ts
|
|
@@ -19458,6 +20733,7 @@ window.__ModuleLoader__.load({
|
|
|
19458
20733
|
registerWorldsPage(ctx);
|
|
19459
20734
|
registerAvatarsPage(ctx);
|
|
19460
20735
|
registerPresetsPage(ctx);
|
|
20736
|
+
registerLorebooksPage(ctx);
|
|
19461
20737
|
registerCataloguePage(ctx);
|
|
19462
20738
|
registerSessionsPage(ctx);
|
|
19463
20739
|
registerTranscript(ctx);
|