@dsh-agentic-roleplay/core 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/{notes-CJzbN_-E.js → activity-t7OBgHlc.js} +267 -47
- package/lib/authoring.js +295 -14
- package/lib/client.js +2599 -648
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +1 -1
- package/lib/{documents-BBq88wXP.js → documents-Bu5uYRZB.js} +54 -33
- package/lib/{gallery-CjG9_4Sz.js → gallery-DUeBMHQX.js} +2 -2
- package/lib/{generator-pxZS-pu-.js → generator-HPifO3Kk.js} +211 -15
- package/lib/images.js +3 -3
- package/lib/index.js +849 -20
- package/lib/{narration-tYy6Rkfr.js → narration-BRyHU0H2.js} +28 -5
- package/lib/orchestration.js +803 -233
- package/lib/packs-ByP1J-zj.js +1334 -0
- package/lib/{presenter-agent-DbZALurg.js → presenter-agent-G43ODV8I.js} +3 -3
- package/package.json +5 -3
- package/prompts/en/roleplay/ask-answerer.md +3 -0
- package/prompts/en/roleplay/ask-question.md +2 -0
- package/prompts/en/roleplay/character-decide.md +1 -1
- package/prompts/en/roleplay/character-lookup.md +1 -1
- package/prompts/en/roleplay/faction-strategist.md +5 -0
- package/prompts/en/roleplay/game-master.md +5 -1
- package/prompts/en/roleplay/ooc-empty.md +1 -1
- package/prompts/en/roleplay/trigger-judge.md +3 -0
- package/prompts/en/world/procedure.md +1 -1
- package/prompts/zh/roleplay/ask-answerer.md +3 -0
- package/prompts/zh/roleplay/ask-question.md +2 -0
- package/prompts/zh/roleplay/character-decide.md +1 -1
- package/prompts/zh/roleplay/character-lookup.md +1 -1
- package/prompts/zh/roleplay/faction-strategist.md +5 -0
- package/prompts/zh/roleplay/game-master.md +5 -1
- package/prompts/zh/roleplay/ooc-empty.md +1 -1
- package/prompts/zh/roleplay/trigger-judge.md +3 -0
- package/prompts/zh/world/procedure.md +1 -1
- package/starter-worlds/blackwater-observatory/characters/arthur-moore/character.json +65 -0
- package/starter-worlds/blackwater-observatory/characters/clara-whitlock/character.json +87 -0
- package/starter-worlds/blackwater-observatory/characters/eleanor-graves/character.json +80 -0
- package/starter-worlds/blackwater-observatory/characters/marcus-reed/character.json +73 -0
- package/starter-worlds/blackwater-observatory/items/anonymous-letter/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/brass-laboratory-key/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/claras-gossip-notebook/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/harlans-notebook/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/investigators-coat/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/investigators-notebook/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/locked-filing-cabinet/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/marcus-calibration-notes/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/mayors-administrative-seal/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/municipal-lockbox/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/pocket-revolver/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/room-7-cash-receipt/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/rusting-mine-cart/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/signal-recording-strip/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/silver-pocket-watch/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/survey-archive-cabinet/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/surveyors-map/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/unknown-visitors-note-fragment/item.json +10 -0
- package/starter-worlds/blackwater-observatory/locations/blackwater-ridge/location.json +5 -0
- package/starter-worlds/blackwater-observatory/locations/iron-stag-bar/location.json +30 -0
- package/starter-worlds/blackwater-observatory/locations/iron-stag-room-7/location.json +18 -0
- package/starter-worlds/blackwater-observatory/locations/north-forest-cabin/location.json +18 -0
- package/starter-worlds/blackwater-observatory/locations/observatory-directors-office/location.json +20 -0
- package/starter-worlds/blackwater-observatory/locations/observatory-telescope-chamber/location.json +25 -0
- package/starter-worlds/blackwater-observatory/locations/old-mine-entrance/location.json +27 -0
- package/starter-worlds/blackwater-observatory/locations/old-mine-main-tunnel/location.json +13 -0
- package/starter-worlds/blackwater-observatory/locations/town-hall-mayors-office/location.json +25 -0
- package/starter-worlds/blackwater-observatory/locations/town-hall-records-room/location.json +13 -0
- package/starter-worlds/blackwater-observatory/locations/town-square/location.json +30 -0
- package/starter-worlds/blackwater-observatory/triggers.json +20 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/map.html +12 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/map.js +40 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/notebook.html +29 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/notebook.js +45 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/pack.json +31 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/skin.css +16 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/strip.html +11 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/strip.js +12 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/style.css +23 -0
- package/starter-worlds/blackwater-observatory/variables.json +39 -0
- package/starter-worlds/blackwater-observatory/world.json +27 -0
- package/lib/worlds-Bj-EGS_i.js +0 -478
package/lib/client.js
CHANGED
|
@@ -9,6 +9,7 @@ window.__ModuleLoader__.load({
|
|
|
9
9
|
let react = require("react");
|
|
10
10
|
let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
|
|
11
11
|
let _deepseek_ai_dsh_client_ui_slots = require("@deepseek-ai/dsh-client-ui-slots");
|
|
12
|
+
let react_dom = require("react-dom");
|
|
12
13
|
//#region src/shared/ids.ts
|
|
13
14
|
/**
|
|
14
15
|
* Profile entry id of the core plugin's row. Settings forms are addressed by
|
|
@@ -24,20 +25,20 @@ window.__ModuleLoader__.load({
|
|
|
24
25
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconUsersOutlineRegular, { size });
|
|
25
26
|
}
|
|
26
27
|
//#endregion
|
|
27
|
-
//#region \0css-module:/home/
|
|
28
|
-
const css$
|
|
29
|
-
const key$
|
|
30
|
-
let tag$
|
|
31
|
-
if (tag$
|
|
32
|
-
tag$
|
|
33
|
-
tag$
|
|
34
|
-
tag$
|
|
35
|
-
document.head.appendChild(tag$
|
|
36
|
-
}
|
|
37
|
-
tag$
|
|
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$23 = ".rp_Poldga_tabs{gap:24px;margin-bottom:-1px;display:flex}.rp_Poldga_tab{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;margin:0;padding:8px 0;font-size:13px;line-height:20px;box-shadow:inset 0 -2px #0000}.rp_Poldga_tab:hover{color:var(--dsw-alias-label-primary)}.rp_Poldga_tab[aria-selected=true]{color:var(--dsw-alias-state-business-primary);font-weight:500;box-shadow:inset 0 -2px}.rp_Poldga_tab:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px;border-radius:var(--dsw-radius-xs)}";
|
|
30
|
+
const key$23 = "src/client/panel/PageTabs.module.css";
|
|
31
|
+
let tag$23 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$23) + "]");
|
|
32
|
+
if (tag$23 === null) {
|
|
33
|
+
tag$23 = document.createElement("style");
|
|
34
|
+
tag$23.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
35
|
+
tag$23.dataset.pluginCss = key$23;
|
|
36
|
+
document.head.appendChild(tag$23);
|
|
37
|
+
}
|
|
38
|
+
tag$23.textContent = css$23;
|
|
38
39
|
var PageTabs_module_css_default = {
|
|
39
|
-
"tabs": "
|
|
40
|
-
"tab": "
|
|
40
|
+
"tabs": "rp_Poldga_tabs",
|
|
41
|
+
"tab": "rp_Poldga_tab"
|
|
41
42
|
};
|
|
42
43
|
//#endregion
|
|
43
44
|
//#region src/client/panel/PageTabs.tsx
|
|
@@ -80,22 +81,22 @@ window.__ModuleLoader__.load({
|
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
//#endregion
|
|
83
|
-
//#region \0css-module:/home/
|
|
84
|
-
const css$
|
|
85
|
-
const key$
|
|
86
|
-
let tag$
|
|
87
|
-
if (tag$
|
|
88
|
-
tag$
|
|
89
|
-
tag$
|
|
90
|
-
tag$
|
|
91
|
-
document.head.appendChild(tag$
|
|
92
|
-
}
|
|
93
|
-
tag$
|
|
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$22 = ".rp_ua5gBa_panel{min-height:0;color:var(--dsw-alias-label-primary);flex-direction:column;flex:1 1 0;display:flex}.rp_ua5gBa_header{border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;padding:12px 24px 0}.rp_ua5gBa_title{margin:0 0 4px;font-size:14px;font-weight:500;line-height:22px}.rp_ua5gBa_body{flex-direction:column;flex:1 1 0;min-height:0;padding:12px 24px 16px;display:flex}";
|
|
86
|
+
const key$22 = "src/client/panel/RoleplayPanel.module.css";
|
|
87
|
+
let tag$22 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$22) + "]");
|
|
88
|
+
if (tag$22 === null) {
|
|
89
|
+
tag$22 = document.createElement("style");
|
|
90
|
+
tag$22.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
91
|
+
tag$22.dataset.pluginCss = key$22;
|
|
92
|
+
document.head.appendChild(tag$22);
|
|
93
|
+
}
|
|
94
|
+
tag$22.textContent = css$22;
|
|
94
95
|
var RoleplayPanel_module_css_default = {
|
|
95
|
-
"panel": "
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
96
|
+
"panel": "rp_ua5gBa_panel",
|
|
97
|
+
"title": "rp_ua5gBa_title",
|
|
98
|
+
"header": "rp_ua5gBa_header",
|
|
99
|
+
"body": "rp_ua5gBa_body"
|
|
99
100
|
};
|
|
100
101
|
//#endregion
|
|
101
102
|
//#region src/client/panel/RoleplayPanel.tsx
|
|
@@ -142,7 +143,7 @@ window.__ModuleLoader__.load({
|
|
|
142
143
|
}
|
|
143
144
|
//#endregion
|
|
144
145
|
//#region src/client/panel/locales.ts
|
|
145
|
-
const dictionaries$
|
|
146
|
+
const dictionaries$11 = {
|
|
146
147
|
en: {
|
|
147
148
|
label: "Role Play",
|
|
148
149
|
heading: "DSH Agentic Role Play",
|
|
@@ -199,11 +200,11 @@ window.__ModuleLoader__.load({
|
|
|
199
200
|
}
|
|
200
201
|
//#endregion
|
|
201
202
|
//#region src/client/panel/index.ts
|
|
202
|
-
const NAMESPACE$
|
|
203
|
+
const NAMESPACE$10 = "roleplay.panel";
|
|
203
204
|
/** Adds the Role Play entry to the sidebar and the main panel it opens. */
|
|
204
205
|
function registerPanel(ctx) {
|
|
205
|
-
const t = ctx.locale.bind(NAMESPACE$
|
|
206
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$
|
|
206
|
+
const t = ctx.locale.bind(NAMESPACE$10);
|
|
207
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$10, dictionaries$11), "roleplay: panel dictionaries");
|
|
207
208
|
const pages = createPagesSource(ctx);
|
|
208
209
|
ctx.effect(() => pages.start(), "roleplay: page list");
|
|
209
210
|
const handle = createPanelStore();
|
|
@@ -215,7 +216,7 @@ window.__ModuleLoader__.load({
|
|
|
215
216
|
ctx.slots.inject("main", () => ctx.slots.register({
|
|
216
217
|
name: "main",
|
|
217
218
|
key: PANEL_ID,
|
|
218
|
-
locale: NAMESPACE$
|
|
219
|
+
locale: NAMESPACE$10,
|
|
219
220
|
store,
|
|
220
221
|
inject: () => ({ hooks: { pages: pages.store } }),
|
|
221
222
|
children: { "roleplay.page": {
|
|
@@ -228,7 +229,7 @@ window.__ModuleLoader__.load({
|
|
|
228
229
|
id: PANEL_ID,
|
|
229
230
|
order: 5,
|
|
230
231
|
label: () => t("label"),
|
|
231
|
-
locale: NAMESPACE$
|
|
232
|
+
locale: NAMESPACE$10
|
|
232
233
|
}, PanelIcon));
|
|
233
234
|
}
|
|
234
235
|
//#endregion
|
|
@@ -362,7 +363,7 @@ window.__ModuleLoader__.load({
|
|
|
362
363
|
var NotEditableError = class extends Error {};
|
|
363
364
|
/** What the host said when it refused an edit, in its words. */
|
|
364
365
|
var RefusedEditError = class extends Error {};
|
|
365
|
-
async function answer$
|
|
366
|
+
async function answer$2(response) {
|
|
366
367
|
if (response.status === 404) throw new NotEditableError("not found");
|
|
367
368
|
if (!response.ok) {
|
|
368
369
|
const body = await response.json().catch(() => void 0);
|
|
@@ -372,7 +373,7 @@ window.__ModuleLoader__.load({
|
|
|
372
373
|
return await response.json();
|
|
373
374
|
}
|
|
374
375
|
async function put(url, edit, signal) {
|
|
375
|
-
return await answer$
|
|
376
|
+
return await answer$2(await fetch(url, {
|
|
376
377
|
method: "PUT",
|
|
377
378
|
credentials: "same-origin",
|
|
378
379
|
headers: { "content-type": "application/json" },
|
|
@@ -381,7 +382,7 @@ window.__ModuleLoader__.load({
|
|
|
381
382
|
}));
|
|
382
383
|
}
|
|
383
384
|
async function postJson(url, body, signal) {
|
|
384
|
-
return await answer$
|
|
385
|
+
return await answer$2(await fetch(url, {
|
|
385
386
|
method: "POST",
|
|
386
387
|
credentials: "same-origin",
|
|
387
388
|
headers: { "content-type": "application/json" },
|
|
@@ -390,16 +391,29 @@ window.__ModuleLoader__.load({
|
|
|
390
391
|
}));
|
|
391
392
|
}
|
|
392
393
|
async function remove(url, signal) {
|
|
393
|
-
return await answer$
|
|
394
|
+
return await answer$2(await fetch(url, {
|
|
394
395
|
method: "DELETE",
|
|
395
396
|
credentials: "same-origin",
|
|
396
397
|
signal
|
|
397
398
|
}));
|
|
398
399
|
}
|
|
399
400
|
async function post(url, signal) {
|
|
400
|
-
return await answer$
|
|
401
|
+
return await answer$2(await fetch(url, {
|
|
402
|
+
method: "POST",
|
|
403
|
+
credentials: "same-origin",
|
|
404
|
+
signal
|
|
405
|
+
}));
|
|
406
|
+
}
|
|
407
|
+
/** Sends a picture file as the body, with its name, and answers the refreshed world. */
|
|
408
|
+
async function postFile(url, file, signal) {
|
|
409
|
+
return await answer$2(await fetch(url, {
|
|
401
410
|
method: "POST",
|
|
402
411
|
credentials: "same-origin",
|
|
412
|
+
headers: {
|
|
413
|
+
"x-file-name": encodeURIComponent(file.name),
|
|
414
|
+
"content-type": file.type || "application/octet-stream"
|
|
415
|
+
},
|
|
416
|
+
body: file,
|
|
403
417
|
signal
|
|
404
418
|
}));
|
|
405
419
|
}
|
|
@@ -428,7 +442,7 @@ window.__ModuleLoader__.load({
|
|
|
428
442
|
const id = encodeURIComponent(worldId);
|
|
429
443
|
return {
|
|
430
444
|
worldId,
|
|
431
|
-
load: async (signal) => await answer$
|
|
445
|
+
load: async (signal) => await answer$2(await fetch(`${API_PREFIX}/worlds/state?id=${id}`, {
|
|
432
446
|
credentials: "same-origin",
|
|
433
447
|
signal
|
|
434
448
|
})),
|
|
@@ -443,7 +457,8 @@ window.__ModuleLoader__.load({
|
|
|
443
457
|
saveRelation: async (edit, signal) => await put(`${API_PREFIX}/worlds/state/relation?id=${id}`, edit, signal),
|
|
444
458
|
saveNarrationVoice: async (voice, signal) => await put(`${API_PREFIX}/worlds/state/narration-voice?id=${id}`, { voice }, signal),
|
|
445
459
|
listVoices: async (signal) => await listVoices(`${API_PREFIX}/speech/voices`, signal),
|
|
446
|
-
generatePortrait: async (key, signal) => await post(`${API_PREFIX}/worlds/state/character/portrait?id=${id}&key=${encodeURIComponent(key)}`, signal)
|
|
460
|
+
generatePortrait: async (key, signal) => await post(`${API_PREFIX}/worlds/state/character/portrait?id=${id}&key=${encodeURIComponent(key)}`, signal),
|
|
461
|
+
uploadPortrait: async (key, file, signal) => await postFile(`${API_PREFIX}/worlds/state/character/portrait/upload?id=${id}&key=${encodeURIComponent(key)}`, file, signal)
|
|
447
462
|
};
|
|
448
463
|
}
|
|
449
464
|
//#endregion
|
|
@@ -718,52 +733,52 @@ window.__ModuleLoader__.load({
|
|
|
718
733
|
}
|
|
719
734
|
const isDirty = (character, draft) => Object.keys(editOf$1(character, draft)).length > 0;
|
|
720
735
|
//#endregion
|
|
721
|
-
//#region \0css-module:/home/
|
|
722
|
-
const css$
|
|
723
|
-
const key$
|
|
724
|
-
let tag$
|
|
725
|
-
if (tag$
|
|
726
|
-
tag$
|
|
727
|
-
tag$
|
|
728
|
-
tag$
|
|
729
|
-
document.head.appendChild(tag$
|
|
736
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/CharactersPanel.module.css.mjs
|
|
737
|
+
const css$21 = ".rp_5ZMIxq_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_5ZMIxq_tabs{border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;gap:4px;padding:0 24px;display:flex;overflow-x:auto}.rp_5ZMIxq_tab{font:inherit;white-space:nowrap;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;flex:none;margin-bottom:-1px;padding:12px 10px 10px;font-size:13px;line-height:20px}.rp_5ZMIxq_tabOn{color:var(--dsw-alias-state-business-primary);border-bottom-color:var(--dsw-alias-state-business-primary);font-weight:500}.rp_5ZMIxq_body{flex:1 1 0;min-height:0;overflow-y:auto}.rp_5ZMIxq_sheet{box-sizing:border-box;flex-direction:column;gap:20px;max-width:760px;padding:24px 24px 240px;display:flex}.rp_5ZMIxq_head{align-items:flex-start;gap:20px;display:flex}.rp_5ZMIxq_portrait{aspect-ratio:3/4;object-fit:cover;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:150px;height:auto;display:block}.rp_5ZMIxq_portraitBox{border-radius:var(--dsw-radius-sm);width:150px;height:200px;color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;flex:0 0 150px;padding:0;display:block;position:relative}.rp_5ZMIxq_portraitBox:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.rp_5ZMIxq_portraitBox:disabled{cursor:not-allowed}.rp_5ZMIxq_portraitAction{box-sizing:border-box;border-radius:0 0 var(--dsw-radius-sm) var(--dsw-radius-sm);color:#fff;text-align:center;opacity:0;background:#0000009e;padding:7px 6px;font-size:12px;line-height:16px;transition:opacity .12s;position:absolute;bottom:1px;left:1px;right:1px}.rp_5ZMIxq_portraitBox:hover .rp_5ZMIxq_portraitAction,.rp_5ZMIxq_portraitBox:focus-visible .rp_5ZMIxq_portraitAction,.rp_5ZMIxq_portraitBox:disabled .rp_5ZMIxq_portraitAction{opacity:1}.rp_5ZMIxq_portraitError,.rp_5ZMIxq_portraitHint{margin:12px 24px 0;font-size:12px}.rp_5ZMIxq_portraitError{color:var(--dsw-alias-state-danger-primary)}.rp_5ZMIxq_portraitHint{color:var(--dsw-alias-label-secondary)}.rp_5ZMIxq_placeholder{box-sizing:border-box;color:var(--dsw-alias-label-secondary);flex-direction:column;justify-content:center;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_initial{opacity:.6;font-size:48px;font-weight:500;line-height:1}.rp_5ZMIxq_missing{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5ZMIxq_meta{flex-direction:column;flex:1 1 0;gap:10px;min-width:0;display:flex}.rp_5ZMIxq_section{border-top:1px solid var(--dsw-alias-border-l4);flex-direction:column;gap:6px;padding-top:16px;display:flex}.rp_5ZMIxq_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:500;line-height:20px}.rp_5ZMIxq_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 24px;font-size:13px}.rp_5ZMIxq_section .rp_5ZMIxq_empty{padding:0}.rp_5ZMIxq_tabsSpace{flex:auto}.rp_5ZMIxq_voiceInline{min-width:220px;color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:12px;display:flex}.rp_5ZMIxq_bar{border-bottom:1px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-2);flex:none;justify-content:flex-end;align-items:center;gap:8px;padding:6px 24px;display:flex}.rp_5ZMIxq_barText{color:var(--dsw-alias-label-secondary);margin-right:auto;font-size:12px}.rp_5ZMIxq_nameInput{font-size:16px;font-weight:500}.rp_5ZMIxq_row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px 12px;display:grid}.rp_5ZMIxq_field{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_5ZMIxq_wide{grid-column:1/-1}.rp_5ZMIxq_label,.rp_5ZMIxq_help{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5ZMIxq_error{color:var(--dsw-alias-state-error-primary);font-size:12px}.rp_5ZMIxq_select{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;min-height:32px;color:inherit;font:inherit;background:0 0;padding:4px 8px;font-size:13px}.rp_5ZMIxq_area{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;color:inherit;font:inherit;resize:vertical;background:0 0;padding:6px 8px;font-size:13px;line-height:20px}.rp_5ZMIxq_goal{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);flex-direction:column;gap:8px;padding:10px;display:flex}.rp_5ZMIxq_row>.rp_5ZMIxq_select{width:auto;min-width:110px}";
|
|
738
|
+
const key$21 = "src/client/world-editor/CharactersPanel.module.css";
|
|
739
|
+
let tag$21 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$21) + "]");
|
|
740
|
+
if (tag$21 === null) {
|
|
741
|
+
tag$21 = document.createElement("style");
|
|
742
|
+
tag$21.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
743
|
+
tag$21.dataset.pluginCss = key$21;
|
|
744
|
+
document.head.appendChild(tag$21);
|
|
730
745
|
}
|
|
731
|
-
tag$
|
|
746
|
+
tag$21.textContent = css$21;
|
|
732
747
|
var CharactersPanel_module_css_default = {
|
|
733
|
-
"
|
|
734
|
-
"
|
|
735
|
-
"
|
|
736
|
-
"
|
|
737
|
-
"
|
|
738
|
-
"
|
|
739
|
-
"
|
|
740
|
-
"
|
|
741
|
-
"
|
|
742
|
-
"
|
|
743
|
-
"
|
|
744
|
-
"
|
|
745
|
-
"
|
|
746
|
-
"
|
|
747
|
-
"
|
|
748
|
-
"
|
|
749
|
-
"
|
|
750
|
-
"
|
|
751
|
-
"
|
|
752
|
-
"
|
|
753
|
-
"
|
|
754
|
-
"
|
|
755
|
-
"
|
|
756
|
-
"
|
|
757
|
-
"
|
|
758
|
-
"
|
|
759
|
-
"
|
|
760
|
-
"
|
|
761
|
-
"
|
|
762
|
-
"
|
|
763
|
-
"
|
|
764
|
-
"
|
|
765
|
-
"
|
|
766
|
-
"
|
|
748
|
+
"panel": "rp_5ZMIxq_panel",
|
|
749
|
+
"sheet": "rp_5ZMIxq_sheet",
|
|
750
|
+
"body": "rp_5ZMIxq_body",
|
|
751
|
+
"portraitError": "rp_5ZMIxq_portraitError",
|
|
752
|
+
"placeholder": "rp_5ZMIxq_placeholder",
|
|
753
|
+
"tabOn": "rp_5ZMIxq_tabOn",
|
|
754
|
+
"meta": "rp_5ZMIxq_meta",
|
|
755
|
+
"head": "rp_5ZMIxq_head",
|
|
756
|
+
"barText": "rp_5ZMIxq_barText",
|
|
757
|
+
"portraitAction": "rp_5ZMIxq_portraitAction",
|
|
758
|
+
"initial": "rp_5ZMIxq_initial",
|
|
759
|
+
"missing": "rp_5ZMIxq_missing",
|
|
760
|
+
"tabsSpace": "rp_5ZMIxq_tabsSpace",
|
|
761
|
+
"voiceInline": "rp_5ZMIxq_voiceInline",
|
|
762
|
+
"goal": "rp_5ZMIxq_goal",
|
|
763
|
+
"grid": "rp_5ZMIxq_grid",
|
|
764
|
+
"portrait": "rp_5ZMIxq_portrait",
|
|
765
|
+
"empty": "rp_5ZMIxq_empty",
|
|
766
|
+
"portraitBox": "rp_5ZMIxq_portraitBox",
|
|
767
|
+
"bar": "rp_5ZMIxq_bar",
|
|
768
|
+
"field": "rp_5ZMIxq_field",
|
|
769
|
+
"label": "rp_5ZMIxq_label",
|
|
770
|
+
"sectionTitle": "rp_5ZMIxq_sectionTitle",
|
|
771
|
+
"help": "rp_5ZMIxq_help",
|
|
772
|
+
"select": "rp_5ZMIxq_select",
|
|
773
|
+
"nameInput": "rp_5ZMIxq_nameInput",
|
|
774
|
+
"row": "rp_5ZMIxq_row",
|
|
775
|
+
"error": "rp_5ZMIxq_error",
|
|
776
|
+
"area": "rp_5ZMIxq_area",
|
|
777
|
+
"wide": "rp_5ZMIxq_wide",
|
|
778
|
+
"portraitHint": "rp_5ZMIxq_portraitHint",
|
|
779
|
+
"tabs": "rp_5ZMIxq_tabs",
|
|
780
|
+
"tab": "rp_5ZMIxq_tab",
|
|
781
|
+
"section": "rp_5ZMIxq_section"
|
|
767
782
|
};
|
|
768
783
|
//#endregion
|
|
769
784
|
//#region src/client/world-editor/CharactersPanel.tsx
|
|
@@ -1286,6 +1301,16 @@ window.__ModuleLoader__.load({
|
|
|
1286
1301
|
setDrafts(({ [current.key]: _discarded, ...rest }) => rest);
|
|
1287
1302
|
setSaving({ status: "idle" });
|
|
1288
1303
|
};
|
|
1304
|
+
const uploadPortrait = (file) => {
|
|
1305
|
+
if (file === void 0 || dirty) return;
|
|
1306
|
+
setPortrait({ key: current.key });
|
|
1307
|
+
source.uploadPortrait(current.key, file, new AbortController().signal).then((next) => {
|
|
1308
|
+
setPortrait({});
|
|
1309
|
+
onChanged(next);
|
|
1310
|
+
}, (failure) => {
|
|
1311
|
+
setPortrait({ error: failure instanceof Error ? failure.message : String(failure) });
|
|
1312
|
+
});
|
|
1313
|
+
};
|
|
1289
1314
|
const generatePortrait = () => {
|
|
1290
1315
|
if (dirty) return;
|
|
1291
1316
|
setPortrait({ key: current.key });
|
|
@@ -1366,6 +1391,23 @@ window.__ModuleLoader__.load({
|
|
|
1366
1391
|
className: CharactersPanel_module_css_default.body,
|
|
1367
1392
|
ref: body,
|
|
1368
1393
|
children: [
|
|
1394
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1395
|
+
className: CharactersPanel_module_css_default.portraitHint,
|
|
1396
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1397
|
+
type: "file",
|
|
1398
|
+
accept: "image/png",
|
|
1399
|
+
hidden: true,
|
|
1400
|
+
disabled: dirty || portrait.key === current.key,
|
|
1401
|
+
onChange: (event) => {
|
|
1402
|
+
uploadPortrait(event.target.files?.[0]);
|
|
1403
|
+
event.target.value = "";
|
|
1404
|
+
}
|
|
1405
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1406
|
+
role: "button",
|
|
1407
|
+
tabIndex: 0,
|
|
1408
|
+
children: t("portraitUpload")
|
|
1409
|
+
})]
|
|
1410
|
+
}) }),
|
|
1369
1411
|
portrait.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1370
1412
|
className: CharactersPanel_module_css_default.portraitError,
|
|
1371
1413
|
role: "alert",
|
|
@@ -1555,6 +1597,7 @@ window.__ModuleLoader__.load({
|
|
|
1555
1597
|
name: place.name,
|
|
1556
1598
|
description: place.description,
|
|
1557
1599
|
features: place.features,
|
|
1600
|
+
parent: place.parent?.key ?? "",
|
|
1558
1601
|
visual: visualDraft(place.visualIdentity)
|
|
1559
1602
|
};
|
|
1560
1603
|
const draft = drafts[place.key] ?? original;
|
|
@@ -1571,6 +1614,7 @@ window.__ModuleLoader__.load({
|
|
|
1571
1614
|
name: draft.name.trim(),
|
|
1572
1615
|
description: draft.description,
|
|
1573
1616
|
features: draft.features,
|
|
1617
|
+
parent: draft.parent === "" ? null : draft.parent,
|
|
1574
1618
|
visualIdentity: visual(draft.visual.description, draft.visual.tags, draft.visual.negativeTags, draft.visual.globalId)
|
|
1575
1619
|
};
|
|
1576
1620
|
setStatus({ state: "saving" });
|
|
@@ -1622,14 +1666,29 @@ window.__ModuleLoader__.load({
|
|
|
1622
1666
|
});
|
|
1623
1667
|
}
|
|
1624
1668
|
}),
|
|
1625
|
-
|
|
1626
|
-
|
|
1669
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1670
|
+
className: CharactersPanel_module_css_default.field,
|
|
1671
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1627
1672
|
className: CharactersPanel_module_css_default.label,
|
|
1628
1673
|
children: t("insidePlace")
|
|
1629
|
-
}),
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1674
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1675
|
+
className: CharactersPanel_module_css_default.select,
|
|
1676
|
+
value: draft.parent,
|
|
1677
|
+
onChange: (event) => {
|
|
1678
|
+
update({
|
|
1679
|
+
...draft,
|
|
1680
|
+
parent: event.target.value
|
|
1681
|
+
});
|
|
1682
|
+
},
|
|
1683
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1684
|
+
value: "",
|
|
1685
|
+
children: t("insideNothing")
|
|
1686
|
+
}), world.places.filter((other) => other.key !== place.key).map((other) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1687
|
+
value: other.key,
|
|
1688
|
+
children: other.name
|
|
1689
|
+
}, other.key))]
|
|
1690
|
+
})]
|
|
1691
|
+
}),
|
|
1633
1692
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
1634
1693
|
className: CharactersPanel_module_css_default.section,
|
|
1635
1694
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
@@ -1773,6 +1832,7 @@ window.__ModuleLoader__.load({
|
|
|
1773
1832
|
quality: thing.quality,
|
|
1774
1833
|
notable: thing.notable,
|
|
1775
1834
|
hidden: thing.hidden,
|
|
1835
|
+
owner: thing.owner?.key ?? "",
|
|
1776
1836
|
...thing.containerState === void 0 ? {} : { containerState: thing.containerState },
|
|
1777
1837
|
visual: visualDraft(thing.visualIdentity)
|
|
1778
1838
|
};
|
|
@@ -1793,6 +1853,7 @@ window.__ModuleLoader__.load({
|
|
|
1793
1853
|
quality: draft.quality,
|
|
1794
1854
|
notable: draft.notable,
|
|
1795
1855
|
hidden: draft.hidden,
|
|
1856
|
+
owner: draft.owner === "" ? null : draft.owner,
|
|
1796
1857
|
...draft.containerState === void 0 ? {} : { containerState: draft.containerState },
|
|
1797
1858
|
visualIdentity: visual(draft.visual.description, draft.visual.tags, draft.visual.negativeTags, draft.visual.globalId)
|
|
1798
1859
|
};
|
|
@@ -1850,8 +1911,7 @@ window.__ModuleLoader__.load({
|
|
|
1850
1911
|
children: [
|
|
1851
1912
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: t("heldAt", { holder: thing.holder }) }),
|
|
1852
1913
|
thing.unique && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: t("unique") }),
|
|
1853
|
-
thing.wearable !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: t("wearableAt", { slot: thing.wearable }) })
|
|
1854
|
-
thing.owner !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: t("ownedBy", { owner: thing.owner.name }) })
|
|
1914
|
+
thing.wearable !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: t("wearableAt", { slot: thing.wearable }) })
|
|
1855
1915
|
]
|
|
1856
1916
|
}),
|
|
1857
1917
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
@@ -1890,6 +1950,29 @@ window.__ModuleLoader__.load({
|
|
|
1890
1950
|
}
|
|
1891
1951
|
})]
|
|
1892
1952
|
}),
|
|
1953
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1954
|
+
className: CharactersPanel_module_css_default.field,
|
|
1955
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1956
|
+
className: CharactersPanel_module_css_default.label,
|
|
1957
|
+
children: t("ownerLabel")
|
|
1958
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1959
|
+
className: CharactersPanel_module_css_default.select,
|
|
1960
|
+
value: draft.owner,
|
|
1961
|
+
onChange: (event) => {
|
|
1962
|
+
update({
|
|
1963
|
+
...draft,
|
|
1964
|
+
owner: event.target.value
|
|
1965
|
+
});
|
|
1966
|
+
},
|
|
1967
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1968
|
+
value: "",
|
|
1969
|
+
children: t("ownerNobody")
|
|
1970
|
+
}), world.characters.map((person) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1971
|
+
value: person.key,
|
|
1972
|
+
children: person.name
|
|
1973
|
+
}, person.key))]
|
|
1974
|
+
})]
|
|
1975
|
+
}),
|
|
1893
1976
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1894
1977
|
className: CharactersPanel_module_css_default.field,
|
|
1895
1978
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -2252,51 +2335,51 @@ window.__ModuleLoader__.load({
|
|
|
2252
2335
|
});
|
|
2253
2336
|
}
|
|
2254
2337
|
//#endregion
|
|
2255
|
-
//#region \0css-module:/home/
|
|
2256
|
-
const css$
|
|
2257
|
-
const key$
|
|
2258
|
-
let tag$
|
|
2259
|
-
if (tag$
|
|
2260
|
-
tag$
|
|
2261
|
-
tag$
|
|
2262
|
-
tag$
|
|
2263
|
-
document.head.appendChild(tag$
|
|
2338
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/RelationsPanel.module.css.mjs
|
|
2339
|
+
const css$20 = ".rp_7pEHTW_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex;position:relative}.rp_7pEHTW_toolbar{border-bottom:1px solid var(--dsw-alias-border-l2);align-items:center;gap:4px;padding:8px 16px;display:flex}.rp_7pEHTW_filter{border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:5px 9px}.rp_7pEHTW_filterOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2)}.rp_7pEHTW_space{flex:1}.rp_7pEHTW_perspective{color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:12px;display:flex}.rp_7pEHTW_perspective select{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);max-width:150px;color:inherit;background:0 0;padding:4px 6px}.rp_7pEHTW_workspace{flex:1 1 0;grid-template-columns:minmax(220px,34%) minmax(320px,1fr);min-height:0;display:grid}.rp_7pEHTW_list{border-right:1px solid var(--dsw-alias-border-l3);overflow-y:auto}.rp_7pEHTW_edge{border:0;border-bottom:1px solid var(--dsw-alias-border-l4);width:100%;color:inherit;text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:10px 16px;display:flex}.rp_7pEHTW_edgeOn{background:var(--dsw-alias-bg-layer-2)}.rp_7pEHTW_edgeTitle{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.rp_7pEHTW_edgeKind{color:var(--dsw-alias-label-tertiary);font-size:11px}.rp_7pEHTW_empty{color:var(--dsw-alias-label-tertiary);padding:20px}.rp_7pEHTW_inspector{min-width:0;padding:24px 24px 240px;overflow-y:auto}.rp_7pEHTW_head h2{margin:0 0 8px;font-size:17px}.rp_7pEHTW_entities{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:6px;display:flex}.rp_7pEHTW_notice{color:var(--dsw-alias-label-secondary);margin:24px 0}.rp_7pEHTW_form{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:24px;display:grid}.rp_7pEHTW_form label{color:var(--dsw-alias-label-tertiary);flex-direction:column;gap:5px;font-size:12px;display:flex}.rp_7pEHTW_form select,.rp_7pEHTW_form textarea{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;color:inherit;font:inherit;background:0 0;padding:7px 9px}.rp_7pEHTW_wide{grid-column:1/-1}.rp_7pEHTW_metrics{grid-column:1/-1;grid-template-columns:repeat(4,minmax(90px,1fr));gap:10px;display:grid}.rp_7pEHTW_check{align-self:end;align-items:center;min-height:32px;flex-direction:row!important}.rp_7pEHTW_actions{border-top:1px solid var(--dsw-alias-border-l4);justify-content:flex-end;align-items:center;gap:8px;margin-top:28px;padding-top:12px;display:flex}.rp_7pEHTW_status{color:var(--dsw-alias-label-secondary);margin-right:auto}.rp_7pEHTW_error{color:var(--dsw-alias-state-error-primary);margin-right:auto}.rp_7pEHTW_graph{background:radial-gradient(circle, var(--dsw-alias-bg-layer-2), transparent 70%);flex:1 1 0;min-height:360px;position:relative;overflow:hidden}.rp_7pEHTW_graph svg{width:100%;height:100%;min-height:520px}.rp_7pEHTW_graphEdge{cursor:pointer;stroke:var(--dsw-alias-border-l1);stroke-width:2px}.rp_7pEHTW_graphEdge:hover,.rp_7pEHTW_graphEdgeOn{stroke:var(--dsw-alias-state-business-primary);stroke-width:4px}.rp_7pEHTW_node circle{fill:var(--dsw-alias-bg-layer-1);stroke:var(--dsw-alias-border-l1);stroke-width:2px}.rp_7pEHTW_node_character circle{fill:color-mix(in srgb, var(--dsw-alias-state-business-primary) 18%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_location circle{fill:color-mix(in srgb, #4a9 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_item circle{fill:color-mix(in srgb, #c90 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_faction circle{fill:color-mix(in srgb, #96c 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node text{fill:var(--dsw-alias-label-primary);pointer-events:none;font-size:11px}.rp_7pEHTW_graphInspector{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:min(480px,100% - 40px);max-height:62%;padding:18px;position:absolute;bottom:20px;right:20px;overflow-y:auto;box-shadow:0 8px 30px #0000002e}@media (width<=760px){.rp_7pEHTW_workspace{grid-template-columns:1fr}.rp_7pEHTW_list{border-right:0;border-bottom:1px solid var(--dsw-alias-border-l3);max-height:220px}.rp_7pEHTW_metrics{grid-template-columns:repeat(2,1fr)}}";
|
|
2340
|
+
const key$20 = "src/client/world-editor/RelationsPanel.module.css";
|
|
2341
|
+
let tag$20 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$20) + "]");
|
|
2342
|
+
if (tag$20 === null) {
|
|
2343
|
+
tag$20 = document.createElement("style");
|
|
2344
|
+
tag$20.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
2345
|
+
tag$20.dataset.pluginCss = key$20;
|
|
2346
|
+
document.head.appendChild(tag$20);
|
|
2264
2347
|
}
|
|
2265
|
-
tag$
|
|
2348
|
+
tag$20.textContent = css$20;
|
|
2266
2349
|
var RelationsPanel_module_css_default = {
|
|
2267
|
-
"
|
|
2268
|
-
"
|
|
2269
|
-
"
|
|
2270
|
-
"
|
|
2271
|
-
"
|
|
2272
|
-
"
|
|
2273
|
-
"
|
|
2274
|
-
"
|
|
2275
|
-
"
|
|
2276
|
-
"
|
|
2277
|
-
"
|
|
2278
|
-
"
|
|
2279
|
-
"
|
|
2280
|
-
"
|
|
2281
|
-
"
|
|
2282
|
-
"
|
|
2283
|
-
"
|
|
2284
|
-
"
|
|
2285
|
-
"
|
|
2286
|
-
"
|
|
2287
|
-
"
|
|
2288
|
-
"
|
|
2289
|
-
"
|
|
2290
|
-
"
|
|
2291
|
-
"
|
|
2292
|
-
"
|
|
2293
|
-
"
|
|
2294
|
-
"
|
|
2295
|
-
"
|
|
2296
|
-
"
|
|
2297
|
-
"
|
|
2298
|
-
"
|
|
2299
|
-
"
|
|
2350
|
+
"status": "rp_7pEHTW_status",
|
|
2351
|
+
"error": "rp_7pEHTW_error",
|
|
2352
|
+
"space": "rp_7pEHTW_space",
|
|
2353
|
+
"edgeKind": "rp_7pEHTW_edgeKind",
|
|
2354
|
+
"graph": "rp_7pEHTW_graph",
|
|
2355
|
+
"toolbar": "rp_7pEHTW_toolbar",
|
|
2356
|
+
"node_character": "rp_7pEHTW_node_character",
|
|
2357
|
+
"empty": "rp_7pEHTW_empty",
|
|
2358
|
+
"graphInspector": "rp_7pEHTW_graphInspector",
|
|
2359
|
+
"node_location": "rp_7pEHTW_node_location",
|
|
2360
|
+
"head": "rp_7pEHTW_head",
|
|
2361
|
+
"node_faction": "rp_7pEHTW_node_faction",
|
|
2362
|
+
"list": "rp_7pEHTW_list",
|
|
2363
|
+
"edgeTitle": "rp_7pEHTW_edgeTitle",
|
|
2364
|
+
"node_item": "rp_7pEHTW_node_item",
|
|
2365
|
+
"graphEdge": "rp_7pEHTW_graphEdge",
|
|
2366
|
+
"workspace": "rp_7pEHTW_workspace",
|
|
2367
|
+
"edge": "rp_7pEHTW_edge",
|
|
2368
|
+
"edgeOn": "rp_7pEHTW_edgeOn",
|
|
2369
|
+
"entities": "rp_7pEHTW_entities",
|
|
2370
|
+
"node": "rp_7pEHTW_node",
|
|
2371
|
+
"notice": "rp_7pEHTW_notice",
|
|
2372
|
+
"wide": "rp_7pEHTW_wide",
|
|
2373
|
+
"perspective": "rp_7pEHTW_perspective",
|
|
2374
|
+
"actions": "rp_7pEHTW_actions",
|
|
2375
|
+
"graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
|
|
2376
|
+
"form": "rp_7pEHTW_form",
|
|
2377
|
+
"inspector": "rp_7pEHTW_inspector",
|
|
2378
|
+
"filterOn": "rp_7pEHTW_filterOn",
|
|
2379
|
+
"filter": "rp_7pEHTW_filter",
|
|
2380
|
+
"panel": "rp_7pEHTW_panel",
|
|
2381
|
+
"metrics": "rp_7pEHTW_metrics",
|
|
2382
|
+
"check": "rp_7pEHTW_check"
|
|
2300
2383
|
};
|
|
2301
2384
|
//#endregion
|
|
2302
2385
|
//#region src/client/world-editor/RelationsPanel.tsx
|
|
@@ -3421,7 +3504,7 @@ window.__ModuleLoader__.load({
|
|
|
3421
3504
|
}
|
|
3422
3505
|
//#endregion
|
|
3423
3506
|
//#region src/client/world-editor/world-files-api.ts
|
|
3424
|
-
async function read$
|
|
3507
|
+
async function read$2(response) {
|
|
3425
3508
|
if (!response.ok) {
|
|
3426
3509
|
const body = await response.json().catch(() => void 0);
|
|
3427
3510
|
const message = (Array.isArray(body?.problems) ? body.problems.join("; ") : void 0) ?? (typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim());
|
|
@@ -3439,20 +3522,20 @@ window.__ModuleLoader__.load({
|
|
|
3439
3522
|
body: JSON.stringify(body)
|
|
3440
3523
|
}
|
|
3441
3524
|
});
|
|
3442
|
-
const loadInfo = async (world, signal) => await read$
|
|
3443
|
-
const saveInfo = async (world, edit, signal) => await read$
|
|
3444
|
-
const loadPrompts = async (world, language, signal) => await read$
|
|
3445
|
-
const loadPrompt = async (world, language, prompt, signal) => await read$
|
|
3525
|
+
const loadInfo = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/info?${query(world)}`, init("GET", signal)));
|
|
3526
|
+
const saveInfo = async (world, edit, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/info?${query(world)}`, init("PUT", signal, edit)));
|
|
3527
|
+
const loadPrompts = async (world, language, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/prompts?${query(world, language)}`, init("GET", signal)));
|
|
3528
|
+
const loadPrompt = async (world, language, prompt, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/prompts/item?${query(world, language, prompt)}`, init("GET", signal)));
|
|
3446
3529
|
const savePrompt = async (world, language, prompt, text, signal) => {
|
|
3447
|
-
await read$
|
|
3530
|
+
await read$2(await fetch(`${API_PREFIX}/worlds/prompts/item?${query(world, language, prompt)}`, init("PUT", signal, { text })));
|
|
3448
3531
|
};
|
|
3449
3532
|
const removePrompt = async (world, language, prompt, signal) => {
|
|
3450
|
-
await read$
|
|
3533
|
+
await read$2(await fetch(`${API_PREFIX}/worlds/prompts/item?${query(world, language, prompt)}`, init("DELETE", signal)));
|
|
3451
3534
|
};
|
|
3452
|
-
const loadRoutines = async (world, signal) => await read$
|
|
3453
|
-
const saveRoutine = async (world, key, windows, signal) => await read$
|
|
3454
|
-
const loadVariables = async (world, signal) => await read$
|
|
3455
|
-
const saveVariables = async (world, variables, signal) => await read$
|
|
3535
|
+
const loadRoutines = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/routines?${query(world)}`, init("GET", signal)));
|
|
3536
|
+
const saveRoutine = async (world, key, windows, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/routines/item?${query(world)}&key=${encodeURIComponent(key)}`, init("PUT", signal, { windows })));
|
|
3537
|
+
const loadVariables = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/variables?${query(world)}`, init("GET", signal)));
|
|
3538
|
+
const saveVariables = async (world, variables, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/variables?${query(world)}`, init("PUT", signal, { variables })));
|
|
3456
3539
|
//#endregion
|
|
3457
3540
|
//#region src/client/world-editor/InfoPanel.tsx
|
|
3458
3541
|
const draftOf$1 = (info) => ({
|
|
@@ -3465,6 +3548,7 @@ window.__ModuleLoader__.load({
|
|
|
3465
3548
|
authorUrl: info.authorUrl,
|
|
3466
3549
|
timeZone: info.timeZone,
|
|
3467
3550
|
startingTime: info.startingTime,
|
|
3551
|
+
version: info.version,
|
|
3468
3552
|
alternates: info.alternateOpenings
|
|
3469
3553
|
});
|
|
3470
3554
|
const lines = (value) => value.split("\n").map((line) => line.trim()).filter((line) => line !== "");
|
|
@@ -3479,7 +3563,8 @@ window.__ModuleLoader__.load({
|
|
|
3479
3563
|
"authorName",
|
|
3480
3564
|
"authorUrl",
|
|
3481
3565
|
"timeZone",
|
|
3482
|
-
"startingTime"
|
|
3566
|
+
"startingTime",
|
|
3567
|
+
"version"
|
|
3483
3568
|
]) if (draft[key].trim() !== saved[key].trim()) edit[key] = draft[key];
|
|
3484
3569
|
if (JSON.stringify(words(draft.tags)) !== JSON.stringify(words(saved.tags))) edit["tags"] = words(draft.tags);
|
|
3485
3570
|
if (JSON.stringify(lines(draft.rules)) !== JSON.stringify(lines(saved.rules))) edit["rules"] = lines(draft.rules);
|
|
@@ -3713,6 +3798,7 @@ window.__ModuleLoader__.load({
|
|
|
3713
3798
|
className: CharactersPanel_module_css_default.grid,
|
|
3714
3799
|
children: [
|
|
3715
3800
|
field("authorName", "infoAuthor"),
|
|
3801
|
+
field("version", "infoVersion", "infoVersionHelp", { placeholder: "1.0" }),
|
|
3716
3802
|
field("authorUrl", "infoAuthorUrl", void 0, { placeholder: "https://" }),
|
|
3717
3803
|
field("timeZone", "infoTimeZone", "infoTimeZoneHelp", { placeholder: "Europe/London" }),
|
|
3718
3804
|
field("startingTime", "infoStartingTime", "infoStartingTimeHelp", { placeholder: "1912-04-14T23:40:00" })
|
|
@@ -4659,47 +4745,47 @@ window.__ModuleLoader__.load({
|
|
|
4659
4745
|
}
|
|
4660
4746
|
const imageUrl = (target, image) => `${route(target, "/file")}&path=${encodeURIComponent(image.path)}&v=${encodeURIComponent(image.createdAt)}`;
|
|
4661
4747
|
//#endregion
|
|
4662
|
-
//#region \0css-module:/home/
|
|
4663
|
-
const css$
|
|
4664
|
-
const key$
|
|
4665
|
-
let tag$
|
|
4666
|
-
if (tag$
|
|
4667
|
-
tag$
|
|
4668
|
-
tag$
|
|
4669
|
-
tag$
|
|
4670
|
-
document.head.appendChild(tag$
|
|
4748
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/gallery-view/GalleryView.module.css.mjs
|
|
4749
|
+
const css$19 = ".rp_9pSHmG_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;padding:16px 24px;display:flex;overflow-y:auto}.rp_9pSHmG_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;display:flex}.rp_9pSHmG_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_9pSHmG_actions{align-items:center;gap:8px;display:flex}.rp_9pSHmG_select{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);height:28px;font:inherit;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);padding:0 8px;font-size:12px}.rp_9pSHmG_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 24px;font-size:13px}.rp_9pSHmG_grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_9pSHmG_cell{min-width:0}.rp_9pSHmG_thumb{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);width:100%;font:inherit;text-align:left;color:inherit;cursor:pointer;flex-direction:column;padding:0;display:flex;overflow:hidden}.rp_9pSHmG_open{cursor:zoom-in;background:0 0;border:0;padding:0;display:block}.rp_9pSHmG_thumb:hover{border-color:var(--dsw-alias-border-l4)}.rp_9pSHmG_image{aspect-ratio:1;object-fit:cover;background:var(--dsw-alias-bg-layer-3);width:100%;display:block}.rp_9pSHmG_caption{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-secondary);padding:6px 8px;font-size:12px;overflow:hidden}.rp_9pSHmG_detail{flex-direction:column;gap:12px;width:min(640px,100%);max-height:70vh;display:flex;overflow-y:auto}.rp_9pSHmG_large{border-radius:var(--dsw-radius-sm);object-fit:contain;max-width:100%;max-height:32vh;margin:0 auto;display:block}.rp_9pSHmG_facts{grid-template-columns:max-content 1fr;gap:6px 12px;margin:0;font-size:12px;line-height:18px;display:grid}.rp_9pSHmG_facts dt{color:var(--dsw-alias-label-tertiary)}.rp_9pSHmG_facts dd{min-width:0;color:var(--dsw-alias-label-primary);margin:0}.rp_9pSHmG_pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:160px;overflow-y:auto}.rp_9pSHmG_tags{flex-wrap:wrap;gap:4px;display:flex}.rp_9pSHmG_note{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_9pSHmG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_9pSHmG_status,.rp_9pSHmG_statusError{color:var(--dsw-alias-label-tertiary);padding:0 8px 6px;font-size:11px;line-height:16px}.rp_9pSHmG_statusError{color:var(--dsw-alias-state-error-primary)}.rp_9pSHmG_reusable{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:6px;padding:0 8px 6px;font-size:11px;display:flex}.rp_9pSHmG_reusable input{accent-color:var(--dsw-alias-state-business-primary);margin:0}.rp_9pSHmG_editButton{font:inherit;color:var(--dsw-alias-state-business-primary);cursor:pointer;background:0 0;border:0;align-self:flex-start;margin:0 8px 4px;padding:0;font-size:11px}.rp_9pSHmG_edit{flex-direction:column;gap:12px;width:min(480px,100%);display:flex}.rp_9pSHmG_editField{flex-direction:column;gap:4px;display:flex}.rp_9pSHmG_editLabel{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_9pSHmG_editHelp{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_9pSHmG_editArea,.rp_9pSHmG_editInput{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}.rp_9pSHmG_editArea{resize:vertical}";
|
|
4750
|
+
const key$19 = "src/client/widgets/gallery-view/GalleryView.module.css";
|
|
4751
|
+
let tag$19 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$19) + "]");
|
|
4752
|
+
if (tag$19 === null) {
|
|
4753
|
+
tag$19 = document.createElement("style");
|
|
4754
|
+
tag$19.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
4755
|
+
tag$19.dataset.pluginCss = key$19;
|
|
4756
|
+
document.head.appendChild(tag$19);
|
|
4671
4757
|
}
|
|
4672
|
-
tag$
|
|
4758
|
+
tag$19.textContent = css$19;
|
|
4673
4759
|
var GalleryView_module_css_default = {
|
|
4674
|
-
"detail": "
|
|
4675
|
-
"
|
|
4676
|
-
"
|
|
4677
|
-
"
|
|
4678
|
-
"
|
|
4679
|
-
"
|
|
4680
|
-
"
|
|
4681
|
-
"
|
|
4682
|
-
"
|
|
4683
|
-
"
|
|
4684
|
-
"
|
|
4685
|
-
"
|
|
4686
|
-
"
|
|
4687
|
-
"
|
|
4688
|
-
"
|
|
4689
|
-
"
|
|
4690
|
-
"
|
|
4691
|
-
"
|
|
4692
|
-
"
|
|
4693
|
-
"
|
|
4694
|
-
"
|
|
4695
|
-
"
|
|
4696
|
-
"grid": "
|
|
4697
|
-
"
|
|
4698
|
-
"
|
|
4699
|
-
"
|
|
4700
|
-
"
|
|
4701
|
-
"
|
|
4702
|
-
"
|
|
4760
|
+
"detail": "rp_9pSHmG_detail",
|
|
4761
|
+
"editInput": "rp_9pSHmG_editInput",
|
|
4762
|
+
"editButton": "rp_9pSHmG_editButton",
|
|
4763
|
+
"count": "rp_9pSHmG_count",
|
|
4764
|
+
"select": "rp_9pSHmG_select",
|
|
4765
|
+
"error": "rp_9pSHmG_error",
|
|
4766
|
+
"toolbar": "rp_9pSHmG_toolbar",
|
|
4767
|
+
"status": "rp_9pSHmG_status",
|
|
4768
|
+
"page": "rp_9pSHmG_page",
|
|
4769
|
+
"editLabel": "rp_9pSHmG_editLabel",
|
|
4770
|
+
"editArea": "rp_9pSHmG_editArea",
|
|
4771
|
+
"facts": "rp_9pSHmG_facts",
|
|
4772
|
+
"statusError": "rp_9pSHmG_statusError",
|
|
4773
|
+
"tags": "rp_9pSHmG_tags",
|
|
4774
|
+
"image": "rp_9pSHmG_image",
|
|
4775
|
+
"thumb": "rp_9pSHmG_thumb",
|
|
4776
|
+
"large": "rp_9pSHmG_large",
|
|
4777
|
+
"cell": "rp_9pSHmG_cell",
|
|
4778
|
+
"editHelp": "rp_9pSHmG_editHelp",
|
|
4779
|
+
"editField": "rp_9pSHmG_editField",
|
|
4780
|
+
"actions": "rp_9pSHmG_actions",
|
|
4781
|
+
"message": "rp_9pSHmG_message",
|
|
4782
|
+
"grid": "rp_9pSHmG_grid",
|
|
4783
|
+
"edit": "rp_9pSHmG_edit",
|
|
4784
|
+
"caption": "rp_9pSHmG_caption",
|
|
4785
|
+
"open": "rp_9pSHmG_open",
|
|
4786
|
+
"pre": "rp_9pSHmG_pre",
|
|
4787
|
+
"note": "rp_9pSHmG_note",
|
|
4788
|
+
"reusable": "rp_9pSHmG_reusable"
|
|
4703
4789
|
};
|
|
4704
4790
|
//#endregion
|
|
4705
4791
|
//#region src/client/widgets/gallery-view/GalleryView.tsx
|
|
@@ -5028,25 +5114,25 @@ window.__ModuleLoader__.load({
|
|
|
5028
5114
|
});
|
|
5029
5115
|
}
|
|
5030
5116
|
//#endregion
|
|
5031
|
-
//#region \0css-module:/home/
|
|
5032
|
-
const css$
|
|
5033
|
-
const key$
|
|
5034
|
-
let tag$
|
|
5035
|
-
if (tag$
|
|
5036
|
-
tag$
|
|
5037
|
-
tag$
|
|
5038
|
-
tag$
|
|
5039
|
-
document.head.appendChild(tag$
|
|
5117
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/WorldEditor.module.css.mjs
|
|
5118
|
+
const css$18 = ".rp__swA3a_view{flex:1 1 0;width:100%;min-height:0;display:flex}.rp__swA3a_message{color:var(--dsw-alias-label-secondary);margin:0;padding:24px;font-size:13px}.rp__swA3a_warning{color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);margin:0 0 12px;padding:8px 12px;font-size:13px}.rp__swA3a_drawer{box-sizing:border-box;border-right:1px solid var(--dsw-alias-border-l3);flex-direction:column;flex:0 0 168px;gap:2px;padding:16px 8px;display:flex}.rp__swA3a_drawerItem{border-radius:var(--dsw-radius-sm);width:100%;font:inherit;text-align:left;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:6px 12px;font-size:13px;line-height:20px;display:block}.rp__swA3a_drawerItem:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.rp__swA3a_drawerItemOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2);font-weight:500}.rp__swA3a_content{flex-direction:column;flex:1 1 0;min-width:0;min-height:0;display:flex}";
|
|
5119
|
+
const key$18 = "src/client/world-editor/WorldEditor.module.css";
|
|
5120
|
+
let tag$18 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$18) + "]");
|
|
5121
|
+
if (tag$18 === null) {
|
|
5122
|
+
tag$18 = document.createElement("style");
|
|
5123
|
+
tag$18.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
5124
|
+
tag$18.dataset.pluginCss = key$18;
|
|
5125
|
+
document.head.appendChild(tag$18);
|
|
5040
5126
|
}
|
|
5041
|
-
tag$
|
|
5127
|
+
tag$18.textContent = css$18;
|
|
5042
5128
|
var WorldEditor_module_css_default = {
|
|
5043
|
-
"
|
|
5044
|
-
"warning": "
|
|
5045
|
-
"
|
|
5046
|
-
"
|
|
5047
|
-
"
|
|
5048
|
-
"
|
|
5049
|
-
"
|
|
5129
|
+
"drawerItemOn": "rp__swA3a_drawerItemOn",
|
|
5130
|
+
"warning": "rp__swA3a_warning",
|
|
5131
|
+
"message": "rp__swA3a_message",
|
|
5132
|
+
"drawer": "rp__swA3a_drawer",
|
|
5133
|
+
"content": "rp__swA3a_content",
|
|
5134
|
+
"view": "rp__swA3a_view",
|
|
5135
|
+
"drawerItem": "rp__swA3a_drawerItem"
|
|
5050
5136
|
};
|
|
5051
5137
|
//#endregion
|
|
5052
5138
|
//#region src/client/world-editor/WorldEditor.tsx
|
|
@@ -5343,39 +5429,39 @@ window.__ModuleLoader__.load({
|
|
|
5343
5429
|
});
|
|
5344
5430
|
}
|
|
5345
5431
|
//#endregion
|
|
5346
|
-
//#region \0css-module:/home/
|
|
5347
|
-
const css$
|
|
5348
|
-
const key$
|
|
5349
|
-
let tag$
|
|
5350
|
-
if (tag$
|
|
5351
|
-
tag$
|
|
5352
|
-
tag$
|
|
5353
|
-
tag$
|
|
5354
|
-
document.head.appendChild(tag$
|
|
5432
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/avatars/AvatarsPage.module.css.mjs
|
|
5433
|
+
const css$17 = ".rp_pQOzEG_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_pQOzEG_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_pQOzEG_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_pQOzEG_actions{align-items:center;gap:8px;display:flex}.rp_pQOzEG_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_pQOzEG_grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_pQOzEG_card{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);align-items:center;gap:4px;min-width:0;padding-right:8px;display:flex}.rp_pQOzEG_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_pQOzEG_open{min-width:0;font:inherit;text-align:left;color:inherit;cursor:pointer;background:0 0;border:0;flex:auto;align-items:center;gap:12px;padding:10px 0 10px 10px;display:flex}.rp_pQOzEG_open:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_pQOzEG_portrait,.rp_pQOzEG_placeholder{border-radius:var(--dsw-radius-sm);object-fit:cover;flex:none;width:48px;height:48px}.rp_pQOzEG_placeholder{color:var(--dsw-alias-label-secondary);justify-content:center;align-items:center;font-size:20px;font-weight:500;display:flex}.rp_pQOzEG_text{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_pQOzEG_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_pQOzEG_summary{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.rp_pQOzEG_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_pQOzEG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_pQOzEG_editHeader{border-bottom:1px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_pQOzEG_editTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_pQOzEG_editBody{flex:1 1 0;min-height:0;display:flex}.rp_pQOzEG_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_pQOzEG_field{flex-direction:column;gap:6px;min-width:0;display:flex}.rp_pQOzEG_label{color:var(--dsw-alias-label-secondary);font-size:12px}";
|
|
5434
|
+
const key$17 = "src/client/pages/avatars/AvatarsPage.module.css";
|
|
5435
|
+
let tag$17 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$17) + "]");
|
|
5436
|
+
if (tag$17 === null) {
|
|
5437
|
+
tag$17 = document.createElement("style");
|
|
5438
|
+
tag$17.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
5439
|
+
tag$17.dataset.pluginCss = key$17;
|
|
5440
|
+
document.head.appendChild(tag$17);
|
|
5355
5441
|
}
|
|
5356
|
-
tag$
|
|
5442
|
+
tag$17.textContent = css$17;
|
|
5357
5443
|
var AvatarsPage_module_css_default = {
|
|
5358
|
-
"
|
|
5359
|
-
"
|
|
5360
|
-
"
|
|
5361
|
-
"
|
|
5362
|
-
"
|
|
5363
|
-
"
|
|
5364
|
-
"
|
|
5365
|
-
"
|
|
5366
|
-
"
|
|
5367
|
-
"
|
|
5368
|
-
"
|
|
5369
|
-
"
|
|
5370
|
-
"
|
|
5371
|
-
"
|
|
5372
|
-
"
|
|
5373
|
-
"
|
|
5374
|
-
"
|
|
5375
|
-
"count": "
|
|
5376
|
-
"
|
|
5377
|
-
"
|
|
5378
|
-
"
|
|
5444
|
+
"field": "rp_pQOzEG_field",
|
|
5445
|
+
"actions": "rp_pQOzEG_actions",
|
|
5446
|
+
"toolbar": "rp_pQOzEG_toolbar",
|
|
5447
|
+
"viewport": "rp_pQOzEG_viewport",
|
|
5448
|
+
"placeholder": "rp_pQOzEG_placeholder",
|
|
5449
|
+
"editHeader": "rp_pQOzEG_editHeader",
|
|
5450
|
+
"page": "rp_pQOzEG_page",
|
|
5451
|
+
"form": "rp_pQOzEG_form",
|
|
5452
|
+
"card": "rp_pQOzEG_card",
|
|
5453
|
+
"error": "rp_pQOzEG_error",
|
|
5454
|
+
"summary": "rp_pQOzEG_summary",
|
|
5455
|
+
"message": "rp_pQOzEG_message",
|
|
5456
|
+
"name": "rp_pQOzEG_name",
|
|
5457
|
+
"grid": "rp_pQOzEG_grid",
|
|
5458
|
+
"portrait": "rp_pQOzEG_portrait",
|
|
5459
|
+
"open": "rp_pQOzEG_open",
|
|
5460
|
+
"text": "rp_pQOzEG_text",
|
|
5461
|
+
"count": "rp_pQOzEG_count",
|
|
5462
|
+
"label": "rp_pQOzEG_label",
|
|
5463
|
+
"editTitle": "rp_pQOzEG_editTitle",
|
|
5464
|
+
"editBody": "rp_pQOzEG_editBody"
|
|
5379
5465
|
};
|
|
5380
5466
|
//#endregion
|
|
5381
5467
|
//#region src/client/pages/avatars/AvatarsPage.tsx
|
|
@@ -5656,7 +5742,7 @@ window.__ModuleLoader__.load({
|
|
|
5656
5742
|
}
|
|
5657
5743
|
//#endregion
|
|
5658
5744
|
//#region src/client/widgets/gallery-view/locales.ts
|
|
5659
|
-
const dictionaries$
|
|
5745
|
+
const dictionaries$10 = {
|
|
5660
5746
|
en: {
|
|
5661
5747
|
tab: "Gallery",
|
|
5662
5748
|
notRoleplay: "This chat is not a roleplay session, so it has no gallery.",
|
|
@@ -5734,7 +5820,7 @@ window.__ModuleLoader__.load({
|
|
|
5734
5820
|
cancel: "取消"
|
|
5735
5821
|
}
|
|
5736
5822
|
};
|
|
5737
|
-
const dictionaries$
|
|
5823
|
+
const dictionaries$9 = withDictionaries({
|
|
5738
5824
|
en: {
|
|
5739
5825
|
language: "en",
|
|
5740
5826
|
sectionInfo: "About",
|
|
@@ -5806,6 +5892,8 @@ window.__ModuleLoader__.load({
|
|
|
5806
5892
|
infoAlternateRemove: "Remove",
|
|
5807
5893
|
infoStory: "Author and time",
|
|
5808
5894
|
infoAuthor: "Author",
|
|
5895
|
+
infoVersion: "Version",
|
|
5896
|
+
infoVersionHelp: "Your own label for this release of the world, such as 1.2. It is recorded in the sessions started from it.",
|
|
5809
5897
|
infoAuthorUrl: "Author link",
|
|
5810
5898
|
infoTimeZone: "Time zone",
|
|
5811
5899
|
infoTimeZoneHelp: "An IANA name such as Europe/London. Empty means UTC.",
|
|
@@ -5852,6 +5940,7 @@ window.__ModuleLoader__.load({
|
|
|
5852
5940
|
factions: "Factions",
|
|
5853
5941
|
noCharacters: "This story has no characters.",
|
|
5854
5942
|
portraitMissing: "No portrait",
|
|
5943
|
+
portraitUpload: "Upload a PNG portrait",
|
|
5855
5944
|
portraitGenerate: "Generate portrait",
|
|
5856
5945
|
portraitGenerating: "Generating…",
|
|
5857
5946
|
portraitRetry: "Regenerate portrait",
|
|
@@ -5925,6 +6014,9 @@ window.__ModuleLoader__.load({
|
|
|
5925
6014
|
noThings: "This story has no things.",
|
|
5926
6015
|
description: "Description",
|
|
5927
6016
|
insidePlace: "Inside",
|
|
6017
|
+
insideNothing: "(not inside another place)",
|
|
6018
|
+
ownerLabel: "Belongs to",
|
|
6019
|
+
ownerNobody: "(no one)",
|
|
5928
6020
|
features: "Features",
|
|
5929
6021
|
featureId: "Feature ID",
|
|
5930
6022
|
addFeature: "Add feature",
|
|
@@ -6058,6 +6150,8 @@ window.__ModuleLoader__.load({
|
|
|
6058
6150
|
infoAlternateRemove: "移除",
|
|
6059
6151
|
infoStory: "作者与时间",
|
|
6060
6152
|
infoAuthor: "作者",
|
|
6153
|
+
infoVersion: "版本",
|
|
6154
|
+
infoVersionHelp: "你为这个版本的世界取的标记,例如 1.2;从它开始的会话会记录这个版本。",
|
|
6061
6155
|
infoAuthorUrl: "作者链接",
|
|
6062
6156
|
infoTimeZone: "时区",
|
|
6063
6157
|
infoTimeZoneHelp: "IANA 名称,例如 Europe/London;留空为 UTC。",
|
|
@@ -6104,6 +6198,7 @@ window.__ModuleLoader__.load({
|
|
|
6104
6198
|
factions: "阵营",
|
|
6105
6199
|
noCharacters: "这个故事没有角色。",
|
|
6106
6200
|
portraitMissing: "暂无肖像",
|
|
6201
|
+
portraitUpload: "上传 PNG 肖像",
|
|
6107
6202
|
portraitGenerate: "生成肖像",
|
|
6108
6203
|
portraitGenerating: "正在生成…",
|
|
6109
6204
|
portraitRetry: "重新生成肖像",
|
|
@@ -6177,6 +6272,9 @@ window.__ModuleLoader__.load({
|
|
|
6177
6272
|
noThings: "这个故事没有物品。",
|
|
6178
6273
|
description: "描述",
|
|
6179
6274
|
insidePlace: "位于",
|
|
6275
|
+
insideNothing: "(不在其他地点内)",
|
|
6276
|
+
ownerLabel: "归属",
|
|
6277
|
+
ownerNobody: "(无人)",
|
|
6180
6278
|
features: "地点特征",
|
|
6181
6279
|
featureId: "特征 ID",
|
|
6182
6280
|
addFeature: "添加特征",
|
|
@@ -6239,8 +6337,8 @@ window.__ModuleLoader__.load({
|
|
|
6239
6337
|
relationCancel: "取消",
|
|
6240
6338
|
relationCreate: "创建"
|
|
6241
6339
|
}
|
|
6242
|
-
}, prefixed(dictionaries$
|
|
6243
|
-
const dictionaries$
|
|
6340
|
+
}, prefixed(dictionaries$10, "gallery_"));
|
|
6341
|
+
const dictionaries$8 = withDictionaries({
|
|
6244
6342
|
en: {
|
|
6245
6343
|
nav: "Avatars",
|
|
6246
6344
|
avatarsLoading: "Loading avatars…",
|
|
@@ -6293,14 +6391,14 @@ window.__ModuleLoader__.load({
|
|
|
6293
6391
|
avatarDeleteFailed: "无法删除角色形象:{message}",
|
|
6294
6392
|
avatarEdit: "编辑"
|
|
6295
6393
|
}
|
|
6296
|
-
}, dictionaries$
|
|
6394
|
+
}, dictionaries$9);
|
|
6297
6395
|
//#endregion
|
|
6298
6396
|
//#region src/client/pages/avatars/index.ts
|
|
6299
|
-
const NAMESPACE$
|
|
6397
|
+
const NAMESPACE$9 = "roleplay.avatars";
|
|
6300
6398
|
/** Adds the Avatars page to the Role Play panel: characters to play in any world. */
|
|
6301
6399
|
function registerAvatarsPage(ctx) {
|
|
6302
|
-
const t = ctx.locale.bind(NAMESPACE$
|
|
6303
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$
|
|
6400
|
+
const t = ctx.locale.bind(NAMESPACE$9);
|
|
6401
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$9, dictionaries$8), "roleplay: avatars dictionaries");
|
|
6304
6402
|
const avatars = new AvatarsController();
|
|
6305
6403
|
ctx.effect(() => () => {
|
|
6306
6404
|
avatars.dispose();
|
|
@@ -6310,7 +6408,7 @@ window.__ModuleLoader__.load({
|
|
|
6310
6408
|
id: "avatars",
|
|
6311
6409
|
order: 5,
|
|
6312
6410
|
label: () => t("nav"),
|
|
6313
|
-
locale: NAMESPACE$
|
|
6411
|
+
locale: NAMESPACE$9,
|
|
6314
6412
|
inject: () => avatars.inject()
|
|
6315
6413
|
}, AvatarsPage));
|
|
6316
6414
|
}
|
|
@@ -6343,20 +6441,20 @@ window.__ModuleLoader__.load({
|
|
|
6343
6441
|
return Math.min(Math.floor(Math.max(0, index) / pageSize), lastPage) * pageSize;
|
|
6344
6442
|
}
|
|
6345
6443
|
//#endregion
|
|
6346
|
-
//#region \0css-module:/home/
|
|
6347
|
-
const css$
|
|
6348
|
-
const key$
|
|
6349
|
-
let tag$
|
|
6350
|
-
if (tag$
|
|
6351
|
-
tag$
|
|
6352
|
-
tag$
|
|
6353
|
-
tag$
|
|
6354
|
-
document.head.appendChild(tag$
|
|
6444
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/pager/Pager.module.css.mjs
|
|
6445
|
+
const css$16 = ".rp_KBAD0W_pager{flex:none;justify-content:center;align-items:center;gap:8px;display:flex}.rp_KBAD0W_position{text-align:center;min-width:120px;color:var(--dsw-alias-label-tertiary);font-size:12px}";
|
|
6446
|
+
const key$16 = "src/client/widgets/pager/Pager.module.css";
|
|
6447
|
+
let tag$16 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$16) + "]");
|
|
6448
|
+
if (tag$16 === null) {
|
|
6449
|
+
tag$16 = document.createElement("style");
|
|
6450
|
+
tag$16.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
6451
|
+
tag$16.dataset.pluginCss = key$16;
|
|
6452
|
+
document.head.appendChild(tag$16);
|
|
6355
6453
|
}
|
|
6356
|
-
tag$
|
|
6454
|
+
tag$16.textContent = css$16;
|
|
6357
6455
|
var Pager_module_css_default = {
|
|
6358
|
-
"
|
|
6359
|
-
"
|
|
6456
|
+
"position": "rp_KBAD0W_position",
|
|
6457
|
+
"pager": "rp_KBAD0W_pager"
|
|
6360
6458
|
};
|
|
6361
6459
|
//#endregion
|
|
6362
6460
|
//#region src/client/widgets/pager/Pager.tsx
|
|
@@ -6390,18 +6488,18 @@ window.__ModuleLoader__.load({
|
|
|
6390
6488
|
});
|
|
6391
6489
|
}
|
|
6392
6490
|
//#endregion
|
|
6393
|
-
//#region \0css-module:/home/
|
|
6394
|
-
const css$
|
|
6395
|
-
const key$
|
|
6396
|
-
let tag$
|
|
6397
|
-
if (tag$
|
|
6398
|
-
tag$
|
|
6399
|
-
tag$
|
|
6400
|
-
tag$
|
|
6401
|
-
document.head.appendChild(tag$
|
|
6491
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/problem-list/ProblemList.module.css.mjs
|
|
6492
|
+
const css$15 = ".rp_LZh3Iq_problems{color:var(--dsw-alias-state-warn-primary);flex:none;font-size:12px}.rp_LZh3Iq_problems summary{cursor:pointer}.rp_LZh3Iq_problems ul{color:var(--dsw-alias-label-secondary);margin:8px 0 0;padding-left:20px}.rp_LZh3Iq_problems code{font-family:var(--dsw-font-mono);color:var(--dsw-alias-label-primary)}";
|
|
6493
|
+
const key$15 = "src/client/widgets/problem-list/ProblemList.module.css";
|
|
6494
|
+
let tag$15 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$15) + "]");
|
|
6495
|
+
if (tag$15 === null) {
|
|
6496
|
+
tag$15 = document.createElement("style");
|
|
6497
|
+
tag$15.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
6498
|
+
tag$15.dataset.pluginCss = key$15;
|
|
6499
|
+
document.head.appendChild(tag$15);
|
|
6402
6500
|
}
|
|
6403
|
-
tag$
|
|
6404
|
-
var ProblemList_module_css_default = { "problems": "
|
|
6501
|
+
tag$15.textContent = css$15;
|
|
6502
|
+
var ProblemList_module_css_default = { "problems": "rp_LZh3Iq_problems" };
|
|
6405
6503
|
//#endregion
|
|
6406
6504
|
//#region src/client/widgets/problem-list/ProblemList.tsx
|
|
6407
6505
|
/** A collapsed list of what went wrong while reading files; renders nothing when nothing did. */
|
|
@@ -6417,22 +6515,22 @@ window.__ModuleLoader__.load({
|
|
|
6417
6515
|
});
|
|
6418
6516
|
}
|
|
6419
6517
|
//#endregion
|
|
6420
|
-
//#region \0css-module:/home/
|
|
6421
|
-
const css$
|
|
6422
|
-
const key$
|
|
6423
|
-
let tag$
|
|
6424
|
-
if (tag$
|
|
6425
|
-
tag$
|
|
6426
|
-
tag$
|
|
6427
|
-
tag$
|
|
6428
|
-
document.head.appendChild(tag$
|
|
6518
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/sessions/DeleteSessionDialog.module.css.mjs
|
|
6519
|
+
const css$14 = ".rp_FifHrW_body{flex-direction:column;gap:8px;min-width:min(380px,100%);display:flex}.rp_FifHrW_body p{margin:0}.rp_FifHrW_question{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;font-size:13px;line-height:20px}.rp_FifHrW_warning{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.rp_FifHrW_error{color:var(--dsw-alias-state-error-primary);font-size:12px}";
|
|
6520
|
+
const key$14 = "src/client/pages/sessions/DeleteSessionDialog.module.css";
|
|
6521
|
+
let tag$14 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$14) + "]");
|
|
6522
|
+
if (tag$14 === null) {
|
|
6523
|
+
tag$14 = document.createElement("style");
|
|
6524
|
+
tag$14.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
6525
|
+
tag$14.dataset.pluginCss = key$14;
|
|
6526
|
+
document.head.appendChild(tag$14);
|
|
6429
6527
|
}
|
|
6430
|
-
tag$
|
|
6528
|
+
tag$14.textContent = css$14;
|
|
6431
6529
|
var DeleteSessionDialog_module_css_default = {
|
|
6432
|
-
"
|
|
6433
|
-
"
|
|
6434
|
-
"
|
|
6435
|
-
"
|
|
6530
|
+
"warning": "rp_FifHrW_warning",
|
|
6531
|
+
"body": "rp_FifHrW_body",
|
|
6532
|
+
"question": "rp_FifHrW_question",
|
|
6533
|
+
"error": "rp_FifHrW_error"
|
|
6436
6534
|
};
|
|
6437
6535
|
//#endregion
|
|
6438
6536
|
//#region src/client/pages/sessions/DeleteSessionDialog.tsx
|
|
@@ -6527,40 +6625,40 @@ window.__ModuleLoader__.load({
|
|
|
6527
6625
|
return useFit(viewport, rowFit);
|
|
6528
6626
|
}
|
|
6529
6627
|
//#endregion
|
|
6530
|
-
//#region \0css-module:/home/
|
|
6531
|
-
const css$
|
|
6532
|
-
const key$
|
|
6533
|
-
let tag$
|
|
6534
|
-
if (tag$
|
|
6535
|
-
tag$
|
|
6536
|
-
tag$
|
|
6537
|
-
tag$
|
|
6538
|
-
document.head.appendChild(tag$
|
|
6628
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/sessions/SessionsPage.module.css.mjs
|
|
6629
|
+
const css$13 = ".rp_24z4eW_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_24z4eW_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_24z4eW_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_24z4eW_spinning{animation:.9s linear infinite rp_24z4eW_spin}@keyframes rp_24z4eW_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.rp_24z4eW_spinning{animation:none}}.rp_24z4eW_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_24z4eW_viewport{--rp-row-height:40px;--rp-header-height:32px;flex:1 1 0;min-height:0}.rp_24z4eW_scrolls{overflow-y:auto}.rp_24z4eW_fits{overflow:hidden}.rp_24z4eW_table{border-collapse:collapse;table-layout:fixed;width:100%}.rp_24z4eW_actionsColumn{width:132px}.rp_24z4eW_nameColumn{width:30%}.rp_24z4eW_worldColumn{width:26%}.rp_24z4eW_timeColumn{width:16%}.rp_24z4eW_turnsColumn{width:10%}.rp_24z4eW_table th{height:var(--rp-header-height);border-bottom:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);text-align:left;color:var(--dsw-alias-label-tertiary);padding:0 12px;font-size:12px;font-weight:400;position:sticky;top:0}.rp_24z4eW_table td{height:var(--rp-row-height);border-bottom:1px solid var(--dsw-alias-border-l1);text-overflow:ellipsis;white-space:nowrap;padding:0 12px;font-size:13px;overflow:hidden}.rp_24z4eW_name{color:var(--dsw-alias-label-primary);font-weight:500}.rp_24z4eW_secondary{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_24z4eW_table .rp_24z4eW_number{text-align:right}.rp_24z4eW_table .rp_24z4eW_actions{text-align:center;white-space:nowrap;padding:0 8px}.rp_24z4eW_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_24z4eW_archived td{opacity:.6}.rp_24z4eW_badge{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-tertiary);margin-left:6px;padding:0 6px;font-size:11px}";
|
|
6630
|
+
const key$13 = "src/client/pages/sessions/SessionsPage.module.css";
|
|
6631
|
+
let tag$13 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$13) + "]");
|
|
6632
|
+
if (tag$13 === null) {
|
|
6633
|
+
tag$13 = document.createElement("style");
|
|
6634
|
+
tag$13.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
6635
|
+
tag$13.dataset.pluginCss = key$13;
|
|
6636
|
+
document.head.appendChild(tag$13);
|
|
6539
6637
|
}
|
|
6540
|
-
tag$
|
|
6638
|
+
tag$13.textContent = css$13;
|
|
6541
6639
|
var SessionsPage_module_css_default = {
|
|
6542
|
-
"
|
|
6543
|
-
"
|
|
6544
|
-
"
|
|
6545
|
-
"
|
|
6546
|
-
"
|
|
6547
|
-
"
|
|
6548
|
-
"
|
|
6549
|
-
"
|
|
6550
|
-
"
|
|
6551
|
-
"
|
|
6552
|
-
"
|
|
6553
|
-
"spin": "
|
|
6554
|
-
"
|
|
6555
|
-
"
|
|
6556
|
-
"
|
|
6557
|
-
"
|
|
6558
|
-
"
|
|
6559
|
-
"
|
|
6560
|
-
"
|
|
6561
|
-
"
|
|
6562
|
-
"
|
|
6563
|
-
"
|
|
6640
|
+
"page": "rp_24z4eW_page",
|
|
6641
|
+
"count": "rp_24z4eW_count",
|
|
6642
|
+
"fits": "rp_24z4eW_fits",
|
|
6643
|
+
"scrolls": "rp_24z4eW_scrolls",
|
|
6644
|
+
"message": "rp_24z4eW_message",
|
|
6645
|
+
"secondary": "rp_24z4eW_secondary",
|
|
6646
|
+
"number": "rp_24z4eW_number",
|
|
6647
|
+
"spinning": "rp_24z4eW_spinning",
|
|
6648
|
+
"nameColumn": "rp_24z4eW_nameColumn",
|
|
6649
|
+
"viewport": "rp_24z4eW_viewport",
|
|
6650
|
+
"timeColumn": "rp_24z4eW_timeColumn",
|
|
6651
|
+
"spin": "rp_24z4eW_spin",
|
|
6652
|
+
"table": "rp_24z4eW_table",
|
|
6653
|
+
"name": "rp_24z4eW_name",
|
|
6654
|
+
"notice": "rp_24z4eW_notice",
|
|
6655
|
+
"worldColumn": "rp_24z4eW_worldColumn",
|
|
6656
|
+
"archived": "rp_24z4eW_archived",
|
|
6657
|
+
"actions": "rp_24z4eW_actions",
|
|
6658
|
+
"toolbar": "rp_24z4eW_toolbar",
|
|
6659
|
+
"turnsColumn": "rp_24z4eW_turnsColumn",
|
|
6660
|
+
"badge": "rp_24z4eW_badge",
|
|
6661
|
+
"actionsColumn": "rp_24z4eW_actionsColumn"
|
|
6564
6662
|
};
|
|
6565
6663
|
//#endregion
|
|
6566
6664
|
//#region src/client/pages/sessions/SessionsPage.tsx
|
|
@@ -6777,7 +6875,7 @@ window.__ModuleLoader__.load({
|
|
|
6777
6875
|
}
|
|
6778
6876
|
//#endregion
|
|
6779
6877
|
//#region src/client/pages/sessions/locales.ts
|
|
6780
|
-
const dictionaries$
|
|
6878
|
+
const dictionaries$7 = {
|
|
6781
6879
|
en: {
|
|
6782
6880
|
nav: "Sessions",
|
|
6783
6881
|
loading: "Loading sessions…",
|
|
@@ -7039,11 +7137,11 @@ window.__ModuleLoader__.load({
|
|
|
7039
7137
|
};
|
|
7040
7138
|
//#endregion
|
|
7041
7139
|
//#region src/client/pages/sessions/index.ts
|
|
7042
|
-
const NAMESPACE$
|
|
7140
|
+
const NAMESPACE$8 = "roleplay.sessions";
|
|
7043
7141
|
/** Adds the Sessions page to the Role Play panel. */
|
|
7044
7142
|
function registerSessionsPage(ctx) {
|
|
7045
|
-
const t = ctx.locale.bind(NAMESPACE$
|
|
7046
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$
|
|
7143
|
+
const t = ctx.locale.bind(NAMESPACE$8);
|
|
7144
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$8, dictionaries$7), "roleplay: sessions dictionaries");
|
|
7047
7145
|
const sessions = new SessionsController(createChatOpener(ctx));
|
|
7048
7146
|
ctx.effect(() => () => {
|
|
7049
7147
|
sessions.dispose();
|
|
@@ -7053,33 +7151,33 @@ window.__ModuleLoader__.load({
|
|
|
7053
7151
|
id: "sessions",
|
|
7054
7152
|
order: 10,
|
|
7055
7153
|
label: () => t("nav"),
|
|
7056
|
-
locale: NAMESPACE$
|
|
7154
|
+
locale: NAMESPACE$8,
|
|
7057
7155
|
inject: () => sessions.inject()
|
|
7058
7156
|
}, SessionsPage));
|
|
7059
7157
|
}
|
|
7060
7158
|
//#endregion
|
|
7061
|
-
//#region \0css-module:/home/
|
|
7062
|
-
const css$
|
|
7063
|
-
const key$
|
|
7064
|
-
let tag$
|
|
7065
|
-
if (tag$
|
|
7066
|
-
tag$
|
|
7067
|
-
tag$
|
|
7068
|
-
tag$
|
|
7069
|
-
document.head.appendChild(tag$
|
|
7159
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/world-card/WorldCard.module.css.mjs
|
|
7160
|
+
const css$12 = ".rp_Bvxx5q_card{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);flex-direction:column;flex:auto;min-width:0;transition:border-color .12s;display:flex;overflow:hidden}.rp_Bvxx5q_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_Bvxx5q_card:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_Bvxx5q_cover{background:var(--dsw-alias-bg-layer-3);flex:1 1 0;min-height:0;position:relative;overflow:hidden}.rp_Bvxx5q_image{object-fit:cover;width:100%;height:100%;display:block}.rp_Bvxx5q_placeholder{color:#ffffffd9;background:linear-gradient(145deg, hsl(var(--rp-hue) 38% 46%), hsl(calc(var(--rp-hue) + 35) 38% 32%));user-select:none;justify-content:center;align-items:center;width:100%;height:100%;font-size:40px;font-weight:500;display:flex}.rp_Bvxx5q_play{color:#fff;opacity:.6;cursor:pointer;background:#00000059;border:0;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;padding:0;transition:opacity .12s,background-color .12s;display:flex;position:absolute;top:8px;right:8px}.rp_Bvxx5q_card:hover .rp_Bvxx5q_play,.rp_Bvxx5q_play:focus-visible{opacity:1}.rp_Bvxx5q_play:hover{background:#0000008c}.rp_Bvxx5q_play:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_Bvxx5q_info{flex-direction:column;flex:none;gap:4px;padding:8px 10px;display:flex}.rp_Bvxx5q_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.rp_Bvxx5q_tags{gap:4px;display:flex;overflow:hidden;mask-image:linear-gradient(90deg,#000 calc(100% - 20px),#0000)}.rp_Bvxx5q_tag{flex:none}.rp_Bvxx5q_open{cursor:pointer}";
|
|
7161
|
+
const key$12 = "src/client/widgets/world-card/WorldCard.module.css";
|
|
7162
|
+
let tag$12 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$12) + "]");
|
|
7163
|
+
if (tag$12 === null) {
|
|
7164
|
+
tag$12 = document.createElement("style");
|
|
7165
|
+
tag$12.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
7166
|
+
tag$12.dataset.pluginCss = key$12;
|
|
7167
|
+
document.head.appendChild(tag$12);
|
|
7070
7168
|
}
|
|
7071
|
-
tag$
|
|
7169
|
+
tag$12.textContent = css$12;
|
|
7072
7170
|
var WorldCard_module_css_default = {
|
|
7073
|
-
"
|
|
7074
|
-
"
|
|
7075
|
-
"tags": "
|
|
7076
|
-
"
|
|
7077
|
-
"
|
|
7078
|
-
"
|
|
7079
|
-
"
|
|
7080
|
-
"
|
|
7081
|
-
"
|
|
7082
|
-
"
|
|
7171
|
+
"card": "rp_Bvxx5q_card",
|
|
7172
|
+
"cover": "rp_Bvxx5q_cover",
|
|
7173
|
+
"tags": "rp_Bvxx5q_tags",
|
|
7174
|
+
"image": "rp_Bvxx5q_image",
|
|
7175
|
+
"tag": "rp_Bvxx5q_tag",
|
|
7176
|
+
"placeholder": "rp_Bvxx5q_placeholder",
|
|
7177
|
+
"name": "rp_Bvxx5q_name",
|
|
7178
|
+
"open": "rp_Bvxx5q_open",
|
|
7179
|
+
"info": "rp_Bvxx5q_info",
|
|
7180
|
+
"play": "rp_Bvxx5q_play"
|
|
7083
7181
|
};
|
|
7084
7182
|
//#endregion
|
|
7085
7183
|
//#region src/client/widgets/world-card/WorldCard.tsx
|
|
@@ -7161,22 +7259,22 @@ window.__ModuleLoader__.load({
|
|
|
7161
7259
|
});
|
|
7162
7260
|
}
|
|
7163
7261
|
//#endregion
|
|
7164
|
-
//#region \0css-module:/home/
|
|
7165
|
-
const css$
|
|
7166
|
-
const key$
|
|
7167
|
-
let tag$
|
|
7168
|
-
if (tag$
|
|
7169
|
-
tag$
|
|
7170
|
-
tag$
|
|
7171
|
-
tag$
|
|
7172
|
-
document.head.appendChild(tag$
|
|
7262
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/avatar-choices/AvatarChoices.module.css.mjs
|
|
7263
|
+
const css$11 = ".rp_YCstOG_option{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}.rp_YCstOG_option:has(input:checked){border-color:var(--dsw-alias-state-business-primary)}.rp_YCstOG_option input{accent-color:var(--dsw-alias-state-business-primary);margin:3px 0 0}.rp_YCstOG_text{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_YCstOG_name{font-size:13px;font-weight:500}.rp_YCstOG_summary{color:var(--dsw-alias-label-secondary);font-size:12px}";
|
|
7264
|
+
const key$11 = "src/client/widgets/avatar-choices/AvatarChoices.module.css";
|
|
7265
|
+
let tag$11 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$11) + "]");
|
|
7266
|
+
if (tag$11 === null) {
|
|
7267
|
+
tag$11 = document.createElement("style");
|
|
7268
|
+
tag$11.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
7269
|
+
tag$11.dataset.pluginCss = key$11;
|
|
7270
|
+
document.head.appendChild(tag$11);
|
|
7173
7271
|
}
|
|
7174
|
-
tag$
|
|
7272
|
+
tag$11.textContent = css$11;
|
|
7175
7273
|
var AvatarChoices_module_css_default = {
|
|
7176
|
-
"
|
|
7177
|
-
"option": "
|
|
7178
|
-
"name": "
|
|
7179
|
-
"
|
|
7274
|
+
"summary": "rp_YCstOG_summary",
|
|
7275
|
+
"option": "rp_YCstOG_option",
|
|
7276
|
+
"name": "rp_YCstOG_name",
|
|
7277
|
+
"text": "rp_YCstOG_text"
|
|
7180
7278
|
};
|
|
7181
7279
|
//#endregion
|
|
7182
7280
|
//#region src/client/widgets/avatar-choices/AvatarChoices.tsx
|
|
@@ -7204,30 +7302,30 @@ window.__ModuleLoader__.load({
|
|
|
7204
7302
|
}, avatar.key)) });
|
|
7205
7303
|
}
|
|
7206
7304
|
//#endregion
|
|
7207
|
-
//#region \0css-module:/home/
|
|
7208
|
-
const css$
|
|
7209
|
-
const key$
|
|
7210
|
-
let tag$
|
|
7211
|
-
if (tag$
|
|
7212
|
-
tag$
|
|
7213
|
-
tag$
|
|
7214
|
-
tag$
|
|
7215
|
-
document.head.appendChild(tag$
|
|
7305
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/StartSessionDialog.module.css.mjs
|
|
7306
|
+
const css$10 = ".rp_AnbLKG_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_AnbLKG_field{border:0;flex-direction:column;gap:6px;min-width:0;margin:0;padding:0;display:flex}.rp_AnbLKG_label{color:var(--dsw-alias-label-secondary);padding:0;font-size:12px}.rp_AnbLKG_option{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}.rp_AnbLKG_option:has(input:checked){border-color:var(--dsw-alias-state-business-primary)}.rp_AnbLKG_option input{accent-color:var(--dsw-alias-state-business-primary);margin:3px 0 0}.rp_AnbLKG_optionText{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_AnbLKG_optionName{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:20px}.rp_AnbLKG_optionSummary{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.rp_AnbLKG_message{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_AnbLKG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_AnbLKG_advanced{flex-direction:column;gap:8px;display:flex}.rp_AnbLKG_advancedToggle{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;align-self:flex-start;align-items:center;gap:6px;padding:0;font-size:12px;display:inline-flex}.rp_AnbLKG_advancedToggle:hover{color:var(--dsw-alias-label-primary)}.rp_AnbLKG_advancedBody{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);flex-direction:column;gap:12px;max-height:320px;padding:12px;display:flex;overflow-y:auto}";
|
|
7307
|
+
const key$10 = "src/client/pages/worlds/StartSessionDialog.module.css";
|
|
7308
|
+
let tag$10 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$10) + "]");
|
|
7309
|
+
if (tag$10 === null) {
|
|
7310
|
+
tag$10 = document.createElement("style");
|
|
7311
|
+
tag$10.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
7312
|
+
tag$10.dataset.pluginCss = key$10;
|
|
7313
|
+
document.head.appendChild(tag$10);
|
|
7216
7314
|
}
|
|
7217
|
-
tag$
|
|
7315
|
+
tag$10.textContent = css$10;
|
|
7218
7316
|
var StartSessionDialog_module_css_default = {
|
|
7219
|
-
"
|
|
7220
|
-
"
|
|
7221
|
-
"
|
|
7222
|
-
"
|
|
7223
|
-
"
|
|
7224
|
-
"
|
|
7225
|
-
"
|
|
7226
|
-
"
|
|
7227
|
-
"
|
|
7228
|
-
"
|
|
7229
|
-
"
|
|
7230
|
-
"
|
|
7317
|
+
"optionText": "rp_AnbLKG_optionText",
|
|
7318
|
+
"error": "rp_AnbLKG_error",
|
|
7319
|
+
"form": "rp_AnbLKG_form",
|
|
7320
|
+
"advancedBody": "rp_AnbLKG_advancedBody",
|
|
7321
|
+
"optionName": "rp_AnbLKG_optionName",
|
|
7322
|
+
"label": "rp_AnbLKG_label",
|
|
7323
|
+
"advanced": "rp_AnbLKG_advanced",
|
|
7324
|
+
"optionSummary": "rp_AnbLKG_optionSummary",
|
|
7325
|
+
"message": "rp_AnbLKG_message",
|
|
7326
|
+
"advancedToggle": "rp_AnbLKG_advancedToggle",
|
|
7327
|
+
"field": "rp_AnbLKG_field",
|
|
7328
|
+
"option": "rp_AnbLKG_option"
|
|
7231
7329
|
};
|
|
7232
7330
|
//#endregion
|
|
7233
7331
|
//#region src/client/pages/worlds/AddAvatarsDialog.tsx
|
|
@@ -7347,7 +7445,7 @@ window.__ModuleLoader__.load({
|
|
|
7347
7445
|
options,
|
|
7348
7446
|
fallback
|
|
7349
7447
|
});
|
|
7350
|
-
const text = (max, fallback) => ({
|
|
7448
|
+
const text$1 = (max, fallback) => ({
|
|
7351
7449
|
kind: "text",
|
|
7352
7450
|
max,
|
|
7353
7451
|
fallback
|
|
@@ -7359,9 +7457,12 @@ window.__ModuleLoader__.load({
|
|
|
7359
7457
|
flaky: flag(true),
|
|
7360
7458
|
recall: integer(1, 30, 12),
|
|
7361
7459
|
lookup: flag(true),
|
|
7460
|
+
lookupCalls: integer(1, 20, 5),
|
|
7362
7461
|
verify: flag(true),
|
|
7363
7462
|
backlogRounds: integer(1, 100, 6),
|
|
7364
|
-
overRetrieve: integer(1, 10, 4)
|
|
7463
|
+
overRetrieve: integer(1, 10, 4),
|
|
7464
|
+
associate: integer(0, 10, 2),
|
|
7465
|
+
diversity: ratio(0, 1, .3)
|
|
7365
7466
|
},
|
|
7366
7467
|
context: {
|
|
7367
7468
|
limitTokens: integer(0, 1e6, 0),
|
|
@@ -7378,34 +7479,51 @@ window.__ModuleLoader__.load({
|
|
|
7378
7479
|
},
|
|
7379
7480
|
clock: {
|
|
7380
7481
|
mode: choice(CLOCK_MODES, "simulated"),
|
|
7381
|
-
timeZone: text(64, ""),
|
|
7482
|
+
timeZone: text$1(64, ""),
|
|
7382
7483
|
roundSeconds: integer(0, 3600, 30),
|
|
7383
7484
|
maxSkipDays: integer(1, 3650, 30)
|
|
7384
7485
|
},
|
|
7486
|
+
diagnostics: { keepRuns: flag(false) },
|
|
7385
7487
|
offstage: {
|
|
7386
7488
|
perTurn: integer(0, 5, 2),
|
|
7387
7489
|
perCharacter: integer(1, 3, 1),
|
|
7490
|
+
joint: flag(true),
|
|
7388
7491
|
summary: flag(true)
|
|
7389
7492
|
},
|
|
7390
7493
|
sampling: {
|
|
7391
7494
|
master: ratio(0, 2, .7),
|
|
7392
7495
|
characters: ratio(0, 2, .8),
|
|
7393
|
-
suggestions: ratio(0, 2, .
|
|
7496
|
+
suggestions: ratio(0, 2, .2),
|
|
7394
7497
|
authoring: ratio(0, 2, .4),
|
|
7395
7498
|
records: ratio(0, 2, .1),
|
|
7396
7499
|
tools: choice(["auto", "required"], "required"),
|
|
7397
|
-
maxTokens: integer(256, 64e3, 8e3)
|
|
7500
|
+
maxTokens: integer(256, 64e3, 8e3),
|
|
7501
|
+
shortMaxTokens: integer(256, 64e3, 2e3),
|
|
7502
|
+
headroom: ratio(1, 10, 2)
|
|
7503
|
+
},
|
|
7504
|
+
prompts: { language: text$1(8, "en") },
|
|
7505
|
+
reasoning: { children: text$1(40, "") },
|
|
7506
|
+
factions: {
|
|
7507
|
+
perTurn: integer(0, 3, 1),
|
|
7508
|
+
everyDays: integer(1, 365, 3)
|
|
7509
|
+
},
|
|
7510
|
+
models: {
|
|
7511
|
+
characters: text$1(200, ""),
|
|
7512
|
+
background: text$1(200, ""),
|
|
7513
|
+
records: text$1(200, ""),
|
|
7514
|
+
suggestions: text$1(200, ""),
|
|
7515
|
+
authoring: text$1(200, "")
|
|
7398
7516
|
},
|
|
7399
|
-
prompts: { language: text(8, "en") },
|
|
7400
|
-
reasoning: { children: text(40, "") },
|
|
7401
7517
|
triggers: {
|
|
7402
7518
|
enabled: flag(true),
|
|
7403
7519
|
maxFires: integer(1, 10, 3),
|
|
7404
7520
|
beatTurns: integer(1, 20, 3),
|
|
7405
|
-
cueTurns: integer(1, 20, 2)
|
|
7521
|
+
cueTurns: integer(1, 20, 2),
|
|
7522
|
+
judgedPerTurn: integer(0, 5, 2)
|
|
7406
7523
|
},
|
|
7524
|
+
interface: { pack: text$1(60, "") },
|
|
7407
7525
|
rewind: { keepSnapshots: integer(0, 500, 30) },
|
|
7408
|
-
rules: { own: text(MAX_OWN_RULES, "") },
|
|
7526
|
+
rules: { own: text$1(MAX_OWN_RULES, "") },
|
|
7409
7527
|
preview: { enabled: flag(true) },
|
|
7410
7528
|
suggestions: { count: integer(0, 5, 3) },
|
|
7411
7529
|
images: {
|
|
@@ -7422,8 +7540,8 @@ window.__ModuleLoader__.load({
|
|
|
7422
7540
|
reuse: flag(true),
|
|
7423
7541
|
highRes: flag(false),
|
|
7424
7542
|
interpret: flag(true),
|
|
7425
|
-
interpreterModel: text(200, ""),
|
|
7426
|
-
captioner: text(200, "")
|
|
7543
|
+
interpreterModel: text$1(200, ""),
|
|
7544
|
+
captioner: text$1(200, "")
|
|
7427
7545
|
},
|
|
7428
7546
|
embedding: { options: record() }
|
|
7429
7547
|
};
|
|
@@ -7442,6 +7560,8 @@ window.__ModuleLoader__.load({
|
|
|
7442
7560
|
return false;
|
|
7443
7561
|
}
|
|
7444
7562
|
}
|
|
7563
|
+
/** A model as `provider/model`: both parts present, no spaces. */
|
|
7564
|
+
const MODEL_NAME = /^[^\s/]+\/\S+$/;
|
|
7445
7565
|
//#endregion
|
|
7446
7566
|
//#region src/client/settings-form/fields.ts
|
|
7447
7567
|
/** The settings the form offers, in the order shown. The rest are in the settings file. */
|
|
@@ -7477,10 +7597,28 @@ window.__ModuleLoader__.load({
|
|
|
7477
7597
|
help: "overRetrieveHelp"
|
|
7478
7598
|
},
|
|
7479
7599
|
{
|
|
7480
|
-
path: ["memory", "
|
|
7481
|
-
kind: "
|
|
7482
|
-
label: "
|
|
7483
|
-
help: "
|
|
7600
|
+
path: ["memory", "associate"],
|
|
7601
|
+
kind: "integer",
|
|
7602
|
+
label: "associate",
|
|
7603
|
+
help: "associateHelp"
|
|
7604
|
+
},
|
|
7605
|
+
{
|
|
7606
|
+
path: ["memory", "diversity"],
|
|
7607
|
+
kind: "decimal",
|
|
7608
|
+
label: "diversity",
|
|
7609
|
+
help: "diversityHelp"
|
|
7610
|
+
},
|
|
7611
|
+
{
|
|
7612
|
+
path: ["memory", "lookup"],
|
|
7613
|
+
kind: "flag",
|
|
7614
|
+
label: "lookup",
|
|
7615
|
+
help: "lookupHelp"
|
|
7616
|
+
},
|
|
7617
|
+
{
|
|
7618
|
+
path: ["memory", "lookupCalls"],
|
|
7619
|
+
kind: "integer",
|
|
7620
|
+
label: "lookupCalls",
|
|
7621
|
+
help: "lookupCallsHelp"
|
|
7484
7622
|
},
|
|
7485
7623
|
{
|
|
7486
7624
|
path: ["memory", "verify"],
|
|
@@ -7576,6 +7714,58 @@ window.__ModuleLoader__.load({
|
|
|
7576
7714
|
zone: false,
|
|
7577
7715
|
placeholder: "off"
|
|
7578
7716
|
},
|
|
7717
|
+
{
|
|
7718
|
+
path: ["factions", "perTurn"],
|
|
7719
|
+
kind: "integer",
|
|
7720
|
+
label: "factionsPerTurn",
|
|
7721
|
+
help: "factionsPerTurnHelp"
|
|
7722
|
+
},
|
|
7723
|
+
{
|
|
7724
|
+
path: ["factions", "everyDays"],
|
|
7725
|
+
kind: "integer",
|
|
7726
|
+
label: "factionsEveryDays",
|
|
7727
|
+
help: "factionsEveryDaysHelp"
|
|
7728
|
+
},
|
|
7729
|
+
{
|
|
7730
|
+
path: ["models", "characters"],
|
|
7731
|
+
kind: "text",
|
|
7732
|
+
label: "modelsCharacters",
|
|
7733
|
+
help: "modelsCharactersHelp",
|
|
7734
|
+
zone: false,
|
|
7735
|
+
placeholder: "localai/model-id"
|
|
7736
|
+
},
|
|
7737
|
+
{
|
|
7738
|
+
path: ["models", "background"],
|
|
7739
|
+
kind: "text",
|
|
7740
|
+
label: "modelsBackground",
|
|
7741
|
+
help: "modelsBackgroundHelp",
|
|
7742
|
+
zone: false,
|
|
7743
|
+
placeholder: "localai/model-id"
|
|
7744
|
+
},
|
|
7745
|
+
{
|
|
7746
|
+
path: ["models", "records"],
|
|
7747
|
+
kind: "text",
|
|
7748
|
+
label: "modelsRecords",
|
|
7749
|
+
help: "modelsRecordsHelp",
|
|
7750
|
+
zone: false,
|
|
7751
|
+
placeholder: "localai/model-id"
|
|
7752
|
+
},
|
|
7753
|
+
{
|
|
7754
|
+
path: ["models", "suggestions"],
|
|
7755
|
+
kind: "text",
|
|
7756
|
+
label: "modelsSuggestions",
|
|
7757
|
+
help: "modelsSuggestionsHelp",
|
|
7758
|
+
zone: false,
|
|
7759
|
+
placeholder: "localai/model-id"
|
|
7760
|
+
},
|
|
7761
|
+
{
|
|
7762
|
+
path: ["models", "authoring"],
|
|
7763
|
+
kind: "text",
|
|
7764
|
+
label: "modelsAuthoring",
|
|
7765
|
+
help: "modelsAuthoringHelp",
|
|
7766
|
+
zone: false,
|
|
7767
|
+
placeholder: "localai/model-id"
|
|
7768
|
+
},
|
|
7579
7769
|
{
|
|
7580
7770
|
path: ["triggers", "enabled"],
|
|
7581
7771
|
kind: "flag",
|
|
@@ -7588,6 +7778,12 @@ window.__ModuleLoader__.load({
|
|
|
7588
7778
|
label: "triggersMaxFires",
|
|
7589
7779
|
help: "triggersMaxFiresHelp"
|
|
7590
7780
|
},
|
|
7781
|
+
{
|
|
7782
|
+
path: ["triggers", "judgedPerTurn"],
|
|
7783
|
+
kind: "integer",
|
|
7784
|
+
label: "triggersJudged",
|
|
7785
|
+
help: "triggersJudgedHelp"
|
|
7786
|
+
},
|
|
7591
7787
|
{
|
|
7592
7788
|
path: ["triggers", "beatTurns"],
|
|
7593
7789
|
kind: "integer",
|
|
@@ -7728,6 +7924,12 @@ window.__ModuleLoader__.load({
|
|
|
7728
7924
|
label: "offstagePerCharacter",
|
|
7729
7925
|
help: "offstagePerCharacterHelp"
|
|
7730
7926
|
},
|
|
7927
|
+
{
|
|
7928
|
+
path: ["offstage", "joint"],
|
|
7929
|
+
kind: "flag",
|
|
7930
|
+
label: "offstageJoint",
|
|
7931
|
+
help: "offstageJointHelp"
|
|
7932
|
+
},
|
|
7731
7933
|
{
|
|
7732
7934
|
path: ["offstage", "summary"],
|
|
7733
7935
|
kind: "flag",
|
|
@@ -7751,6 +7953,20 @@ window.__ModuleLoader__.load({
|
|
|
7751
7953
|
kind: "percent",
|
|
7752
7954
|
label: "retainRatio",
|
|
7753
7955
|
help: "retainRatioHelp"
|
|
7956
|
+
},
|
|
7957
|
+
{
|
|
7958
|
+
path: ["interface", "pack"],
|
|
7959
|
+
kind: "text",
|
|
7960
|
+
label: "interfacePack",
|
|
7961
|
+
help: "interfacePackHelp",
|
|
7962
|
+
zone: false,
|
|
7963
|
+
placeholder: "none"
|
|
7964
|
+
},
|
|
7965
|
+
{
|
|
7966
|
+
path: ["diagnostics", "keepRuns"],
|
|
7967
|
+
kind: "flag",
|
|
7968
|
+
label: "diagnosticsKeepRuns",
|
|
7969
|
+
help: "diagnosticsKeepRunsHelp"
|
|
7754
7970
|
}
|
|
7755
7971
|
];
|
|
7756
7972
|
/**
|
|
@@ -7768,7 +7984,7 @@ window.__ModuleLoader__.load({
|
|
|
7768
7984
|
"authoring.enabled": false
|
|
7769
7985
|
};
|
|
7770
7986
|
const keyOf = (field) => field.path.join(".");
|
|
7771
|
-
function read(root, path) {
|
|
7987
|
+
function read$1(root, path) {
|
|
7772
7988
|
return path.reduce((node, key) => node[key], root);
|
|
7773
7989
|
}
|
|
7774
7990
|
/** The key of the draft of one request option of the embedding provider. */
|
|
@@ -7776,7 +7992,7 @@ window.__ModuleLoader__.load({
|
|
|
7776
7992
|
/** What each setting of the form starts as, and each request option the embedding provider offers. */
|
|
7777
7993
|
function toDrafts(settings, options = []) {
|
|
7778
7994
|
const fixed = FORM_FIELDS.map((field) => {
|
|
7779
|
-
const value = read(settings, field.path);
|
|
7995
|
+
const value = read$1(settings, field.path);
|
|
7780
7996
|
return [keyOf(field), field.kind === "flag" ? value === true : field.kind === "percent" ? String(Math.round(value * 100)) : String(value)];
|
|
7781
7997
|
});
|
|
7782
7998
|
const requested = options.map((option) => {
|
|
@@ -7787,7 +8003,7 @@ window.__ModuleLoader__.load({
|
|
|
7787
8003
|
}
|
|
7788
8004
|
/** The bounds of a field as the form shows them: percentages for a share. */
|
|
7789
8005
|
function boundsOf(field) {
|
|
7790
|
-
const spec = read(SETTINGS_SPEC, field.path);
|
|
8006
|
+
const spec = read$1(SETTINGS_SPEC, field.path);
|
|
7791
8007
|
return field.kind === "percent" ? {
|
|
7792
8008
|
min: Math.round((spec.min ?? 0) * 100),
|
|
7793
8009
|
max: Math.round((spec.max ?? 1) * 100)
|
|
@@ -7810,6 +8026,7 @@ window.__ModuleLoader__.load({
|
|
|
7810
8026
|
if (field.kind === "text") {
|
|
7811
8027
|
const draft = drafts[keyOf(field)];
|
|
7812
8028
|
if (field.zone && typeof draft === "string" && draft.trim() !== "" && !isTimeZone(draft.trim())) bad.add(keyOf(field));
|
|
8029
|
+
if (field.path[0] === "models" && typeof draft === "string" && draft.trim() !== "" && !MODEL_NAME.test(draft.trim())) bad.add(keyOf(field));
|
|
7813
8030
|
continue;
|
|
7814
8031
|
}
|
|
7815
8032
|
const draft = drafts[keyOf(field)];
|
|
@@ -7894,31 +8111,31 @@ window.__ModuleLoader__.load({
|
|
|
7894
8111
|
return options;
|
|
7895
8112
|
}
|
|
7896
8113
|
//#endregion
|
|
7897
|
-
//#region \0css-module:/home/
|
|
7898
|
-
const css$
|
|
7899
|
-
const key$
|
|
7900
|
-
let tag$
|
|
7901
|
-
if (tag$
|
|
7902
|
-
tag$
|
|
7903
|
-
tag$
|
|
7904
|
-
tag$
|
|
7905
|
-
document.head.appendChild(tag$
|
|
8114
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/settings-form/SettingsFields.module.css.mjs
|
|
8115
|
+
const css$9 = ".rp_Rhi3yq_row{flex-direction:column;gap:6px;display:flex}.rp_Rhi3yq_field{flex-direction:column;gap:6px;max-width:200px;display:flex}.rp_Rhi3yq_label{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_Rhi3yq_help{max-width:560px;color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_Rhi3yq_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_Rhi3yq_group{border-top:1px solid var(--dsw-alias-border-l3);flex-direction:column;gap:12px;padding-top:12px;display:flex}.rp_Rhi3yq_groupTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:500}.rp_Rhi3yq_area{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;max-width:560px;color:inherit;font:inherit;resize:vertical;background:0 0;padding:6px 8px;font-size:13px}";
|
|
8116
|
+
const key$9 = "src/client/settings-form/SettingsFields.module.css";
|
|
8117
|
+
let tag$9 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$9) + "]");
|
|
8118
|
+
if (tag$9 === null) {
|
|
8119
|
+
tag$9 = document.createElement("style");
|
|
8120
|
+
tag$9.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
8121
|
+
tag$9.dataset.pluginCss = key$9;
|
|
8122
|
+
document.head.appendChild(tag$9);
|
|
7906
8123
|
}
|
|
7907
|
-
tag$
|
|
8124
|
+
tag$9.textContent = css$9;
|
|
7908
8125
|
var SettingsFields_module_css_default = {
|
|
7909
|
-
"
|
|
7910
|
-
"
|
|
7911
|
-
"
|
|
7912
|
-
"
|
|
7913
|
-
"
|
|
7914
|
-
"
|
|
7915
|
-
"
|
|
7916
|
-
"
|
|
8126
|
+
"error": "rp_Rhi3yq_error",
|
|
8127
|
+
"help": "rp_Rhi3yq_help",
|
|
8128
|
+
"field": "rp_Rhi3yq_field",
|
|
8129
|
+
"row": "rp_Rhi3yq_row",
|
|
8130
|
+
"area": "rp_Rhi3yq_area",
|
|
8131
|
+
"groupTitle": "rp_Rhi3yq_groupTitle",
|
|
8132
|
+
"group": "rp_Rhi3yq_group",
|
|
8133
|
+
"label": "rp_Rhi3yq_label"
|
|
7917
8134
|
};
|
|
7918
8135
|
//#endregion
|
|
7919
8136
|
//#region src/client/settings-form/SettingsFields.tsx
|
|
7920
8137
|
/** The settings of a chat as editable fields: one control with its explanation under each. */
|
|
7921
|
-
function SettingsFields({ t, drafts, onChange, onPreset, options = [], disabled = false, locked = {} }) {
|
|
8138
|
+
function SettingsFields({ t, drafts, onChange, onPreset, options = [], disabled = false, locked = {}, hidden = [] }) {
|
|
7922
8139
|
const bad = problemsOf(drafts, options);
|
|
7923
8140
|
const locale = t("localeId");
|
|
7924
8141
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
@@ -7944,7 +8161,7 @@ window.__ModuleLoader__.load({
|
|
|
7944
8161
|
children: t("presetFastHelp")
|
|
7945
8162
|
})]
|
|
7946
8163
|
}),
|
|
7947
|
-
FORM_FIELDS.map((field) => {
|
|
8164
|
+
FORM_FIELDS.filter((field) => !hidden.includes(keyOf(field))).map((field) => {
|
|
7948
8165
|
const key = keyOf(field);
|
|
7949
8166
|
const { min, max } = field.kind === "choice" || field.kind === "text" ? {
|
|
7950
8167
|
min: 0,
|
|
@@ -8455,6 +8672,119 @@ window.__ModuleLoader__.load({
|
|
|
8455
8672
|
});
|
|
8456
8673
|
}
|
|
8457
8674
|
//#endregion
|
|
8675
|
+
//#region src/client/pages/worlds/starter-api.ts
|
|
8676
|
+
async function answer$1(response) {
|
|
8677
|
+
if (!response.ok) {
|
|
8678
|
+
const body = await response.json().catch(() => void 0);
|
|
8679
|
+
throw new Error(typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim());
|
|
8680
|
+
}
|
|
8681
|
+
return await response.json();
|
|
8682
|
+
}
|
|
8683
|
+
/** The worlds that ship with the plugin. */
|
|
8684
|
+
async function loadStarters(signal) {
|
|
8685
|
+
return await answer$1(await fetch(`${API_PREFIX}/worlds/starter`, {
|
|
8686
|
+
credentials: "same-origin",
|
|
8687
|
+
signal
|
|
8688
|
+
}));
|
|
8689
|
+
}
|
|
8690
|
+
/** Copies one into the person's worlds. */
|
|
8691
|
+
async function addStarter(folder) {
|
|
8692
|
+
await answer$1(await fetch(`${API_PREFIX}/worlds/starter`, {
|
|
8693
|
+
method: "POST",
|
|
8694
|
+
credentials: "same-origin",
|
|
8695
|
+
headers: { "content-type": "application/json" },
|
|
8696
|
+
body: JSON.stringify({ folder })
|
|
8697
|
+
}));
|
|
8698
|
+
}
|
|
8699
|
+
//#endregion
|
|
8700
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/WorldsPage.module.css.mjs
|
|
8701
|
+
const css$8 = ".rp_FHUyRq_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_FHUyRq_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_FHUyRq_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_FHUyRq_toolbarActions{align-items:center;gap:8px;display:flex}.rp_FHUyRq_spinning{animation:.9s linear infinite rp_FHUyRq_spin}@keyframes rp_FHUyRq_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.rp_FHUyRq_spinning{animation:none}}.rp_FHUyRq_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_FHUyRq_viewport{--rp-card-width:168px;--rp-card-height:288px;--rp-card-gap:16px;flex:1 1 0;min-height:0;padding:4px}.rp_FHUyRq_scrolls{overflow-y:auto}.rp_FHUyRq_fits{overflow:hidden}.rp_FHUyRq_grid{grid-auto-rows:var(--rp-card-height);grid-template-columns:repeat(auto-fill, var(--rp-card-width));gap:var(--rp-card-gap);margin:0;padding:0;list-style:none;display:grid}.rp_FHUyRq_cell{min-width:0;display:flex}.rp_FHUyRq_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_FHUyRq_editHeader{border-bottom:1px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_FHUyRq_editTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_FHUyRq_authorButton{margin-left:auto}.rp_FHUyRq_editBody{flex:1 1 0;min-height:0;display:flex}.rp_FHUyRq_starters{flex-direction:column;align-items:center;gap:8px;padding-bottom:24px;display:flex}.rp_FHUyRq_starter{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);text-align:center;max-width:480px;color:var(--dsw-alias-label-secondary);flex-direction:column;align-items:center;gap:6px;padding:12px 16px;font-size:13px;display:flex}";
|
|
8702
|
+
const key$8 = "src/client/pages/worlds/WorldsPage.module.css";
|
|
8703
|
+
let tag$8 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$8) + "]");
|
|
8704
|
+
if (tag$8 === null) {
|
|
8705
|
+
tag$8 = document.createElement("style");
|
|
8706
|
+
tag$8.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
8707
|
+
tag$8.dataset.pluginCss = key$8;
|
|
8708
|
+
document.head.appendChild(tag$8);
|
|
8709
|
+
}
|
|
8710
|
+
tag$8.textContent = css$8;
|
|
8711
|
+
var WorldsPage_module_css_default = {
|
|
8712
|
+
"grid": "rp_FHUyRq_grid",
|
|
8713
|
+
"authorButton": "rp_FHUyRq_authorButton",
|
|
8714
|
+
"notice": "rp_FHUyRq_notice",
|
|
8715
|
+
"cell": "rp_FHUyRq_cell",
|
|
8716
|
+
"editHeader": "rp_FHUyRq_editHeader",
|
|
8717
|
+
"viewport": "rp_FHUyRq_viewport",
|
|
8718
|
+
"editBody": "rp_FHUyRq_editBody",
|
|
8719
|
+
"starters": "rp_FHUyRq_starters",
|
|
8720
|
+
"starter": "rp_FHUyRq_starter",
|
|
8721
|
+
"toolbarActions": "rp_FHUyRq_toolbarActions",
|
|
8722
|
+
"spinning": "rp_FHUyRq_spinning",
|
|
8723
|
+
"page": "rp_FHUyRq_page",
|
|
8724
|
+
"toolbar": "rp_FHUyRq_toolbar",
|
|
8725
|
+
"editTitle": "rp_FHUyRq_editTitle",
|
|
8726
|
+
"fits": "rp_FHUyRq_fits",
|
|
8727
|
+
"scrolls": "rp_FHUyRq_scrolls",
|
|
8728
|
+
"message": "rp_FHUyRq_message",
|
|
8729
|
+
"spin": "rp_FHUyRq_spin",
|
|
8730
|
+
"count": "rp_FHUyRq_count"
|
|
8731
|
+
};
|
|
8732
|
+
//#endregion
|
|
8733
|
+
//#region src/client/pages/worlds/StarterWorlds.tsx
|
|
8734
|
+
/** The worlds that ship with the plugin and are not yet the person's, offered where the list of worlds is empty. */
|
|
8735
|
+
function StarterWorlds({ t, onAdded }) {
|
|
8736
|
+
const [offered, setOffered] = (0, react.useState)([]);
|
|
8737
|
+
const [adding, setAdding] = (0, react.useState)();
|
|
8738
|
+
const [error, setError] = (0, react.useState)();
|
|
8739
|
+
(0, react.useEffect)(() => {
|
|
8740
|
+
const abort = new AbortController();
|
|
8741
|
+
loadStarters(abort.signal).then((found) => {
|
|
8742
|
+
setOffered(found.filter((world) => !world.installed));
|
|
8743
|
+
}, (failure) => {
|
|
8744
|
+
if (!abort.signal.aborted) setError(failure instanceof Error ? failure.message : String(failure));
|
|
8745
|
+
});
|
|
8746
|
+
return () => {
|
|
8747
|
+
abort.abort();
|
|
8748
|
+
};
|
|
8749
|
+
}, []);
|
|
8750
|
+
const add = (folder) => {
|
|
8751
|
+
setAdding(folder);
|
|
8752
|
+
setError(void 0);
|
|
8753
|
+
addStarter(folder).then(() => {
|
|
8754
|
+
setAdding(void 0);
|
|
8755
|
+
onAdded();
|
|
8756
|
+
}, (failure) => {
|
|
8757
|
+
setAdding(void 0);
|
|
8758
|
+
setError(failure instanceof Error ? failure.message : String(failure));
|
|
8759
|
+
});
|
|
8760
|
+
};
|
|
8761
|
+
if (offered.length === 0 && error === void 0) return null;
|
|
8762
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8763
|
+
className: WorldsPage_module_css_default.starters,
|
|
8764
|
+
"data-testid": "roleplay-starters",
|
|
8765
|
+
children: [offered.map((world) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8766
|
+
className: WorldsPage_module_css_default.starter,
|
|
8767
|
+
children: [
|
|
8768
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: world.name }),
|
|
8769
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: world.description.split("\n")[0] }),
|
|
8770
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
8771
|
+
variant: "primary",
|
|
8772
|
+
size: "sm",
|
|
8773
|
+
disabled: adding !== void 0,
|
|
8774
|
+
onClick: () => {
|
|
8775
|
+
add(world.folder);
|
|
8776
|
+
},
|
|
8777
|
+
children: adding === world.folder ? t("starterAdding") : t("starterAdd")
|
|
8778
|
+
})
|
|
8779
|
+
]
|
|
8780
|
+
}, world.folder)), error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8781
|
+
className: WorldsPage_module_css_default.notice,
|
|
8782
|
+
role: "alert",
|
|
8783
|
+
children: t("starterFailed", { message: error })
|
|
8784
|
+
})]
|
|
8785
|
+
});
|
|
8786
|
+
}
|
|
8787
|
+
//#endregion
|
|
8458
8788
|
//#region src/client/pages/worlds/import-api.ts
|
|
8459
8789
|
async function answer(response) {
|
|
8460
8790
|
if (!response.ok) {
|
|
@@ -8495,46 +8825,46 @@ window.__ModuleLoader__.load({
|
|
|
8495
8825
|
}
|
|
8496
8826
|
const pictureUrl = (id) => `${API_PREFIX}/worlds/import/picture?id=${encodeURIComponent(id)}`;
|
|
8497
8827
|
//#endregion
|
|
8498
|
-
//#region \0css-module:/home/
|
|
8499
|
-
const css$
|
|
8500
|
-
const key$
|
|
8501
|
-
let tag$
|
|
8502
|
-
if (tag$
|
|
8503
|
-
tag$
|
|
8504
|
-
tag$
|
|
8505
|
-
tag$
|
|
8506
|
-
document.head.appendChild(tag$
|
|
8828
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/ImportCardPage.module.css.mjs
|
|
8829
|
+
const css$7 = ".rp_DmG_oG_page{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_DmG_oG_header{border-bottom:1px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_DmG_oG_title{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_DmG_oG_space{flex:auto}.rp_DmG_oG_error{color:var(--dsw-alias-state-error-primary);margin:0;padding:8px 16px;font-size:12px}.rp_DmG_oG_body{box-sizing:border-box;flex-direction:column;flex:1 1 0;gap:20px;min-height:0;padding:20px 24px 40px;display:flex;overflow-y:auto}.rp_DmG_oG_body>*{flex:none;width:100%;max-width:860px}.rp_DmG_oG_top{align-items:flex-start;gap:20px;display:flex}.rp_DmG_oG_picture{object-fit:cover;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);flex:0 0 120px;width:120px;height:160px}.rp_DmG_oG_noPicture{box-sizing:border-box;color:var(--dsw-alias-label-tertiary);justify-content:center;align-items:center;font-size:12px;display:flex}.rp_DmG_oG_about{flex-direction:column;flex:1 1 0;gap:8px;min-width:0;display:flex}.rp_DmG_oG_label{color:var(--dsw-alias-label-tertiary);flex-direction:column;gap:4px;font-size:12px;display:flex}.rp_DmG_oG_tags{flex-wrap:wrap;gap:6px;display:flex}.rp_DmG_oG_note{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_DmG_oG_section{flex-direction:column;gap:8px;display:flex}.rp_DmG_oG_heading{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:500}.rp_DmG_oG_row{align-items:center;gap:8px;display:flex}.rp_DmG_oG_field,.rp_DmG_oG_entry{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm)}.rp_DmG_oG_fieldHead,.rp_DmG_oG_entryHead{box-sizing:border-box;width:100%;font:inherit;text-align:left;color:inherit;background:0 0;border:0;align-items:center;gap:8px;padding:8px 10px;display:flex}.rp_DmG_oG_fieldHead{cursor:pointer}.rp_DmG_oG_fieldTitle,.rp_DmG_oG_entryTitle{min-width:0;color:var(--dsw-alias-label-primary);flex:auto;font-size:13px}.rp_DmG_oG_entryTitle{font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;padding:0;font-size:13px}.rp_DmG_oG_fieldMeta{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_DmG_oG_field .rp_DmG_oG_note,.rp_DmG_oG_entry .rp_DmG_oG_note{padding:0 10px 6px}.rp_DmG_oG_text{white-space:pre-wrap;word-break:break-word;max-height:320px;font:inherit;color:var(--dsw-alias-label-secondary);border-top:1px solid var(--dsw-alias-border-l4);margin:0;padding:8px 10px 10px;font-size:12px;line-height:18px;overflow:auto}.rp_DmG_oG_entryOff .rp_DmG_oG_entryTitle{color:var(--dsw-alias-label-tertiary);text-decoration:line-through}.rp_DmG_oG_choice{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}.rp_DmG_oG_choice input{margin-top:3px}.rp_DmG_oG_choiceText{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_DmG_oG_preview{white-space:pre-wrap;word-break:break-word;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}";
|
|
8830
|
+
const key$7 = "src/client/pages/worlds/ImportCardPage.module.css";
|
|
8831
|
+
let tag$7 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$7) + "]");
|
|
8832
|
+
if (tag$7 === null) {
|
|
8833
|
+
tag$7 = document.createElement("style");
|
|
8834
|
+
tag$7.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
8835
|
+
tag$7.dataset.pluginCss = key$7;
|
|
8836
|
+
document.head.appendChild(tag$7);
|
|
8507
8837
|
}
|
|
8508
|
-
tag$
|
|
8838
|
+
tag$7.textContent = css$7;
|
|
8509
8839
|
var ImportCardPage_module_css_default = {
|
|
8510
|
-
"
|
|
8511
|
-
"
|
|
8512
|
-
"top": "
|
|
8513
|
-
"
|
|
8514
|
-
"
|
|
8515
|
-
"
|
|
8516
|
-
"
|
|
8517
|
-
"
|
|
8518
|
-
"
|
|
8519
|
-
"
|
|
8520
|
-
"
|
|
8521
|
-
"
|
|
8522
|
-
"
|
|
8523
|
-
"page": "
|
|
8524
|
-
"
|
|
8525
|
-
"
|
|
8526
|
-
"
|
|
8527
|
-
"
|
|
8528
|
-
"
|
|
8529
|
-
"
|
|
8530
|
-
"
|
|
8531
|
-
"
|
|
8532
|
-
"
|
|
8533
|
-
"
|
|
8534
|
-
"
|
|
8535
|
-
"
|
|
8536
|
-
"
|
|
8537
|
-
"
|
|
8840
|
+
"header": "rp_DmG_oG_header",
|
|
8841
|
+
"picture": "rp_DmG_oG_picture",
|
|
8842
|
+
"top": "rp_DmG_oG_top",
|
|
8843
|
+
"label": "rp_DmG_oG_label",
|
|
8844
|
+
"tags": "rp_DmG_oG_tags",
|
|
8845
|
+
"entry": "rp_DmG_oG_entry",
|
|
8846
|
+
"error": "rp_DmG_oG_error",
|
|
8847
|
+
"fieldMeta": "rp_DmG_oG_fieldMeta",
|
|
8848
|
+
"text": "rp_DmG_oG_text",
|
|
8849
|
+
"title": "rp_DmG_oG_title",
|
|
8850
|
+
"about": "rp_DmG_oG_about",
|
|
8851
|
+
"choice": "rp_DmG_oG_choice",
|
|
8852
|
+
"space": "rp_DmG_oG_space",
|
|
8853
|
+
"page": "rp_DmG_oG_page",
|
|
8854
|
+
"heading": "rp_DmG_oG_heading",
|
|
8855
|
+
"body": "rp_DmG_oG_body",
|
|
8856
|
+
"fieldHead": "rp_DmG_oG_fieldHead",
|
|
8857
|
+
"section": "rp_DmG_oG_section",
|
|
8858
|
+
"entryHead": "rp_DmG_oG_entryHead",
|
|
8859
|
+
"fieldTitle": "rp_DmG_oG_fieldTitle",
|
|
8860
|
+
"choiceText": "rp_DmG_oG_choiceText",
|
|
8861
|
+
"field": "rp_DmG_oG_field",
|
|
8862
|
+
"row": "rp_DmG_oG_row",
|
|
8863
|
+
"noPicture": "rp_DmG_oG_noPicture",
|
|
8864
|
+
"note": "rp_DmG_oG_note",
|
|
8865
|
+
"entryOff": "rp_DmG_oG_entryOff",
|
|
8866
|
+
"entryTitle": "rp_DmG_oG_entryTitle",
|
|
8867
|
+
"preview": "rp_DmG_oG_preview"
|
|
8538
8868
|
};
|
|
8539
8869
|
//#endregion
|
|
8540
8870
|
//#region src/client/pages/worlds/ImportCardPage.tsx
|
|
@@ -8873,37 +9203,6 @@ window.__ModuleLoader__.load({
|
|
|
8873
9203
|
});
|
|
8874
9204
|
}
|
|
8875
9205
|
//#endregion
|
|
8876
|
-
//#region \0css-module:/home/x/workspace/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/WorldsPage.module.css.mjs
|
|
8877
|
-
const css$5 = ".rp_xwWrpW_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_xwWrpW_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_xwWrpW_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_xwWrpW_toolbarActions{align-items:center;gap:8px;display:flex}.rp_xwWrpW_spinning{animation:.9s linear infinite rp_xwWrpW_spin}@keyframes rp_xwWrpW_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.rp_xwWrpW_spinning{animation:none}}.rp_xwWrpW_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_xwWrpW_viewport{--rp-card-width:168px;--rp-card-height:288px;--rp-card-gap:16px;flex:1 1 0;min-height:0;padding:4px}.rp_xwWrpW_scrolls{overflow-y:auto}.rp_xwWrpW_fits{overflow:hidden}.rp_xwWrpW_grid{grid-auto-rows:var(--rp-card-height);grid-template-columns:repeat(auto-fill, var(--rp-card-width));gap:var(--rp-card-gap);margin:0;padding:0;list-style:none;display:grid}.rp_xwWrpW_cell{min-width:0;display:flex}.rp_xwWrpW_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_xwWrpW_editHeader{border-bottom:1px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_xwWrpW_editTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_xwWrpW_authorButton{margin-left:auto}.rp_xwWrpW_editBody{flex:1 1 0;min-height:0;display:flex}";
|
|
8878
|
-
const key$5 = "src/client/pages/worlds/WorldsPage.module.css";
|
|
8879
|
-
let tag$5 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$5) + "]");
|
|
8880
|
-
if (tag$5 === null) {
|
|
8881
|
-
tag$5 = document.createElement("style");
|
|
8882
|
-
tag$5.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
8883
|
-
tag$5.dataset.pluginCss = key$5;
|
|
8884
|
-
document.head.appendChild(tag$5);
|
|
8885
|
-
}
|
|
8886
|
-
tag$5.textContent = css$5;
|
|
8887
|
-
var WorldsPage_module_css_default = {
|
|
8888
|
-
"grid": "rp_xwWrpW_grid",
|
|
8889
|
-
"toolbarActions": "rp_xwWrpW_toolbarActions",
|
|
8890
|
-
"spinning": "rp_xwWrpW_spinning",
|
|
8891
|
-
"viewport": "rp_xwWrpW_viewport",
|
|
8892
|
-
"toolbar": "rp_xwWrpW_toolbar",
|
|
8893
|
-
"editHeader": "rp_xwWrpW_editHeader",
|
|
8894
|
-
"count": "rp_xwWrpW_count",
|
|
8895
|
-
"scrolls": "rp_xwWrpW_scrolls",
|
|
8896
|
-
"editTitle": "rp_xwWrpW_editTitle",
|
|
8897
|
-
"editBody": "rp_xwWrpW_editBody",
|
|
8898
|
-
"spin": "rp_xwWrpW_spin",
|
|
8899
|
-
"message": "rp_xwWrpW_message",
|
|
8900
|
-
"authorButton": "rp_xwWrpW_authorButton",
|
|
8901
|
-
"page": "rp_xwWrpW_page",
|
|
8902
|
-
"fits": "rp_xwWrpW_fits",
|
|
8903
|
-
"cell": "rp_xwWrpW_cell",
|
|
8904
|
-
"notice": "rp_xwWrpW_notice"
|
|
8905
|
-
};
|
|
8906
|
-
//#endregion
|
|
8907
9206
|
//#region src/client/pages/worlds/WorldsPage.tsx
|
|
8908
9207
|
/** The worlds, one page of cards at a time. */
|
|
8909
9208
|
function WorldsPage({ t, useWorlds, load, refresh, openStartDialog, closeStartDialog, startSession, dismissStarted, openAuthoring, openChat }) {
|
|
@@ -9103,10 +9402,13 @@ window.__ModuleLoader__.load({
|
|
|
9103
9402
|
className: WorldsPage_module_css_default.message,
|
|
9104
9403
|
role: "alert",
|
|
9105
9404
|
children: t("loadFailed", { message: state.error ?? "" })
|
|
9106
|
-
}) : worlds.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9405
|
+
}) : worlds.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9107
9406
|
className: WorldsPage_module_css_default.message,
|
|
9108
9407
|
children: t("empty", { directory: state.payload?.directory ?? "" })
|
|
9109
|
-
})
|
|
9408
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StarterWorlds, {
|
|
9409
|
+
t,
|
|
9410
|
+
onAdded: refresh
|
|
9411
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
9110
9412
|
className: WorldsPage_module_css_default.grid,
|
|
9111
9413
|
children: visible.map((world) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
9112
9414
|
className: WorldsPage_module_css_default.cell,
|
|
@@ -9175,7 +9477,7 @@ window.__ModuleLoader__.load({
|
|
|
9175
9477
|
}
|
|
9176
9478
|
//#endregion
|
|
9177
9479
|
//#region src/client/settings-form/locales.ts
|
|
9178
|
-
const dictionaries$
|
|
9480
|
+
const dictionaries$6 = {
|
|
9179
9481
|
en: {
|
|
9180
9482
|
samplingMaster: "Temperature: game master",
|
|
9181
9483
|
samplingMasterHelp: "How freely the game master decides and narrates (0 to 2). Lower keeps its calls and the world consistent.",
|
|
@@ -9197,8 +9499,14 @@ window.__ModuleLoader__.load({
|
|
|
9197
9499
|
recallHelp: "The most memories brought back to a character each time it acts, chosen by what the moment calls to mind.",
|
|
9198
9500
|
overRetrieve: "Memories considered per memory recalled",
|
|
9199
9501
|
overRetrieveHelp: "To choose what a character is reminded of, this many times as many candidates are retrieved (by the moment's cues, by words and by meaning) and the best are kept; a reranking service, when one is configured, judges the wider net. 1 chooses straight from the first search.",
|
|
9502
|
+
associate: "Memories that come to mind with others",
|
|
9503
|
+
associateHelp: "The most extra memories a character is reminded of because they are strongly tied (the same people together with the same place or tags) to something the moment called to mind, and matter enough. 0 turns it off.",
|
|
9504
|
+
diversity: "Spread of what is recalled",
|
|
9505
|
+
diversityHelp: "From 0 to 1: how much a memory that says what one already chosen says counts against it, so that a character is not reminded of the same moment several times. 0 chooses by score alone.",
|
|
9200
9506
|
lookup: "Characters can look up memories",
|
|
9201
9507
|
lookupHelp: "While it decides, a character can ask itself about something it remembers beyond what the moment already brought to mind. Each character only reaches its own memories. It makes a character's turn a little longer.",
|
|
9508
|
+
lookupCalls: "Memory look-ups per decision",
|
|
9509
|
+
lookupCallsHelp: "The most times a character may look into its memory while it decides. After that it is told to answer. A character that keeps looking makes the turn much longer.",
|
|
9202
9510
|
verify: "Check the records",
|
|
9203
9511
|
verifyHelp: "The record keeper reads back what it wrote about each round, compares it with the round and fixes mistakes before it finishes. It runs in the background of the narration, so it rarely delays you; turn it off for speed or to save model calls.",
|
|
9204
9512
|
backlogRounds: "Most rounds waiting to be remembered",
|
|
@@ -9245,6 +9553,22 @@ window.__ModuleLoader__.load({
|
|
|
9245
9553
|
imagesInterpreterModelHelp: "As provider/model. Leave empty to use the chat's own model, which must be declared able to read images. Use this to describe images with a vision model while the story runs on another.",
|
|
9246
9554
|
imagesCaptioner: "Captioning model",
|
|
9247
9555
|
imagesCaptionerHelp: "As provider/model. A model that only writes a caption for a picture (it cannot call tools) looks at it, and the chat's model turns the caption into the description. Leave empty to have one vision model do both.",
|
|
9556
|
+
triggersJudged: "Statements judged after a turn",
|
|
9557
|
+
triggersJudgedHelp: "The most statements that triggers wait on (such as \"the mayor has lost the town's trust\") that a model judges after one of your messages, in one background request. A trigger fires from the verdict at the next look. 0 turns it off, and such triggers never fire.",
|
|
9558
|
+
factionsPerTurn: "Organisations acting on their own",
|
|
9559
|
+
factionsPerTurnHelp: "The most organisations that decide what they do after one of your messages, when story time has passed since they last did. Each is one request in the background. 0 turns it off.",
|
|
9560
|
+
factionsEveryDays: "Days between their decisions",
|
|
9561
|
+
factionsEveryDaysHelp: "How many days of story time pass before an organisation decides again.",
|
|
9562
|
+
modelsBackground: "Model for background characters",
|
|
9563
|
+
modelsBackgroundHelp: "As provider/model. Characters of the background tier (crowds, passers-by) run on this model; empty uses the model for characters. They take part in the same way as the others, only on a cheaper model.",
|
|
9564
|
+
modelsCharacters: "Model for characters",
|
|
9565
|
+
modelsCharactersHelp: "As provider/model. Leave empty to use the chat's own model. Characters run side by side and write short answers, so a smaller, faster model often does as well.",
|
|
9566
|
+
modelsRecords: "Model for the record keeper",
|
|
9567
|
+
modelsRecordsHelp: "As provider/model. Leave empty to use the chat's own model. The keeper runs in the background and must call tools correctly.",
|
|
9568
|
+
modelsSuggestions: "Model for suggested actions",
|
|
9569
|
+
modelsSuggestionsHelp: "As provider/model. Leave empty to use the chat's own model.",
|
|
9570
|
+
modelsAuthoring: "Model for the world and plot author",
|
|
9571
|
+
modelsAuthoringHelp: "As provider/model. Leave empty to use the chat's own model. Made-up characters, places and things are only as good as this model.",
|
|
9248
9572
|
imagesOff: "Off",
|
|
9249
9573
|
imagesManual: "Manual",
|
|
9250
9574
|
imagesEveryTurn: "Every turn",
|
|
@@ -9256,6 +9580,12 @@ window.__ModuleLoader__.load({
|
|
|
9256
9580
|
offstagePerTurn: "Characters acting off stage per turn",
|
|
9257
9581
|
offstagePerCharacter: "Times one character acts off stage per turn",
|
|
9258
9582
|
offstagePerCharacterHelp: "A character with several things due is asked about the first; the rest wait for your next turn. With the limit above, this caps what the world does without you: nothing runs while you are away from the chat, and each message you send lets at most this many characters act.",
|
|
9583
|
+
interfacePack: "Interface pack",
|
|
9584
|
+
interfacePackHelp: "The interface pack this story uses. Empty uses the first pack the story carries; \"none\" turns packs off and shows the plain chat; a name picks that pack of the story, or of your roleplay folder's ui folder.",
|
|
9585
|
+
diagnosticsKeepRuns: "Keep what the helpers were told",
|
|
9586
|
+
diagnosticsKeepRunsHelp: "Each helper run (a character, the record keeper, the suggestions) keeps its instructions, what it was asked, its tool calls and its result, for the latest 60 runs. Open a run in the activity list to see why it said or wrote what it did. The texts include what the characters know in private, so leave it off unless you are looking for a problem.",
|
|
9587
|
+
offstageJoint: "Meetings happen between people",
|
|
9588
|
+
offstageJointHelp: "The people of one off-stage commitment decide one after another, each told who has already meant to come, so they meet instead of each guessing. It takes longer in the background but asks the same number of times. Off: each decides alone, all at once.",
|
|
9259
9589
|
offstageSummary: "Tell me what happened meanwhile",
|
|
9260
9590
|
offstageSummaryHelp: "Characters acting off stage also say in a line what came of it, in the same request (no extra cost), and it is shown as a card beside the story until your next message, outside the conversation.",
|
|
9261
9591
|
offstagePerTurnHelp: "When something falls due for characters who are away from you (a meeting whose time has come, a deadline that passed), up to this many of them are asked, in the background after your turn, what they do about it. What they decide is recorded and can be seen in the story later. 0 turns it off.",
|
|
@@ -9302,8 +9632,14 @@ window.__ModuleLoader__.load({
|
|
|
9302
9632
|
recallHelp: "角色每次行动时最多被唤起的记忆条数,按当前情境联想到的内容挑选。",
|
|
9303
9633
|
overRetrieve: "每条回忆的候选倍数",
|
|
9304
9634
|
overRetrieveHelp: "为了选出角色被唤起的记忆,会先检索出此倍数的候选(按情境线索、字词和语义),再保留最好的;若已配置重排序服务,则由它评判这张更大的网。1 表示直接从第一次检索中选取。",
|
|
9635
|
+
diversity: "回忆的分散程度",
|
|
9636
|
+
diversityHelp: "0 到 1:与已选中的某条记忆说的是同一件事的记忆要被扣多少分,这样角色就不会把同一个时刻想起好几遍。0 表示只按得分选择。",
|
|
9637
|
+
associate: "顺带想起的记忆",
|
|
9638
|
+
associateHelp: "角色会因为与当前情境唤起的某件事紧密相连(相同的人物,加上相同的地点或标签)且足够重要,而顺带想起的额外记忆的最大条数。0 表示关闭。",
|
|
9305
9639
|
lookup: "角色可主动回忆",
|
|
9306
9640
|
lookupHelp: "角色在决定行动时,可以主动向自己追问更多记忆,超出当前情境已唤起的部分。每个角色只能查到自己的记忆。会让角色的回合稍长一些。",
|
|
9641
|
+
lookupCalls: "每次决定的记忆查询次数",
|
|
9642
|
+
lookupCallsHelp: "角色在决定行动时最多可以查询自己记忆的次数,超过后会被要求直接作答。反复查询会让这一轮慢得多。",
|
|
9307
9643
|
verify: "核对记录",
|
|
9308
9644
|
verifyHelp: "记录员在结束前会回读自己写入的记录,对照回合内容并纠正错误。它在叙述的同时于后台运行,通常不会拖慢你;追求速度或想节省模型调用时可以关闭。",
|
|
9309
9645
|
backlogRounds: "等待记录的回合上限",
|
|
@@ -9350,6 +9686,22 @@ window.__ModuleLoader__.load({
|
|
|
9350
9686
|
imagesInterpreterModelHelp: "写成 提供方/模型。留空则使用对话自己的模型,它必须声明能读取图像。可用它让视觉模型描述图像,而故事用另一个模型运行。",
|
|
9351
9687
|
imagesCaptioner: "图像说明模型",
|
|
9352
9688
|
imagesCaptionerHelp: "写成 提供方/模型。只会给图片写说明文字的模型(不能调用工具)负责看图,再由对话的模型把说明整理成描述。留空则由一个视觉模型完成全部。",
|
|
9689
|
+
triggersJudged: "每回合评判的陈述数",
|
|
9690
|
+
triggersJudgedHelp: "触发器所等待的陈述(例如“市长已失去全镇信任”)中,你发送一条消息后最多让模型评判多少条,合并为一次后台请求。触发器在下一次检查时根据结论触发。0 表示关闭,此类触发器永远不会触发。",
|
|
9691
|
+
factionsPerTurn: "组织自主行动",
|
|
9692
|
+
factionsPerTurnHelp: "你发送一条消息后,最多让多少个组织决定自己的行动(前提是自它们上次行动以来故事时间已经过去)。每个组织占用一次后台请求。0 表示关闭。",
|
|
9693
|
+
factionsEveryDays: "决策间隔天数",
|
|
9694
|
+
factionsEveryDaysHelp: "组织再次决策之前要经过多少天故事时间。",
|
|
9695
|
+
modelsBackground: "背景角色使用的模型",
|
|
9696
|
+
modelsBackgroundHelp: "写成 提供方/模型。背景层级的角色(人群、路人)使用此模型;留空则使用“角色使用的模型”。它们的参与方式与其他角色相同,只是换成更便宜的模型。",
|
|
9697
|
+
modelsCharacters: "角色使用的模型",
|
|
9698
|
+
modelsCharactersHelp: "写成 提供方/模型。留空则使用对话自己的模型。角色并行运行且回答简短,较小较快的模型通常也能胜任。",
|
|
9699
|
+
modelsRecords: "记录员使用的模型",
|
|
9700
|
+
modelsRecordsHelp: "写成 提供方/模型。留空则使用对话自己的模型。记录员在后台运行,必须能正确调用工具。",
|
|
9701
|
+
modelsSuggestions: "行动建议使用的模型",
|
|
9702
|
+
modelsSuggestionsHelp: "写成 提供方/模型。留空则使用对话自己的模型。",
|
|
9703
|
+
modelsAuthoring: "世界与剧情作者使用的模型",
|
|
9704
|
+
modelsAuthoringHelp: "写成 提供方/模型。留空则使用对话自己的模型。新编造的角色、地点和物品的质量取决于这个模型。",
|
|
9353
9705
|
imagesOff: "关闭",
|
|
9354
9706
|
imagesManual: "手动",
|
|
9355
9707
|
imagesEveryTurn: "每轮",
|
|
@@ -9361,6 +9713,12 @@ window.__ModuleLoader__.load({
|
|
|
9361
9713
|
offstagePerTurn: "每轮台下行动的角色数",
|
|
9362
9714
|
offstagePerCharacter: "每个角色每轮台下行动次数",
|
|
9363
9715
|
offstagePerCharacterHelp: "同一角色有多件事到期时,只询问第一件,其余等你的下一轮。配合上面的上限,这限制了世界在无人操作时的行动:你离开聊天时什么都不会运行,你每发一条消息最多让这么多次角色行动。",
|
|
9716
|
+
interfacePack: "界面包",
|
|
9717
|
+
interfacePackHelp: "此故事使用的界面包。留空则使用故事自带的第一个包;填 \"none\" 则关闭界面包并显示普通聊天;填名称则选用故事中的该包,或角色扮演目录 ui 文件夹中的该包。",
|
|
9718
|
+
diagnosticsKeepRuns: "保留助手收到的内容",
|
|
9719
|
+
diagnosticsKeepRunsHelp: "每次助手运行(角色、记录员、建议)都会保存它的指令、被问的内容、工具调用和结果,保留最近 60 次。在活动列表中打开一次运行,可查看它为何那样说或写。内容包含角色私下所知的信息,因此除非要排查问题,请保持关闭。",
|
|
9720
|
+
offstageJoint: "约定在人与人之间发生",
|
|
9721
|
+
offstageJointHelp: "同一个台下约定的人依次决定,后者会被告知谁已决定前来,因此他们会碰面而不是各自猜测。后台耗时更长,但请求次数不变。关闭则各自同时独立决定。",
|
|
9364
9722
|
offstageSummary: "告诉我期间发生了什么",
|
|
9365
9723
|
offstageSummaryHelp: "台下行动的角色会在同一次请求里用一句话说明结果(不额外消耗请求),并以卡片形式显示在故事旁,直到你发送下一条消息,不会进入对话记录。",
|
|
9366
9724
|
offstagePerTurnHelp: "当有事对不在你身边的角色到期时(约定的时间到了、期限过了),每轮结束后会在后台最多询问这么多角色打算怎么办。他们的决定会被记录,之后可在故事中看到。0 表示关闭。",
|
|
@@ -9387,11 +9745,14 @@ window.__ModuleLoader__.load({
|
|
|
9387
9745
|
embeddingOptionsHelp: "所选嵌入提供方允许本对话为每次请求设置的内容。留空则使用提供方自己的设置。"
|
|
9388
9746
|
}
|
|
9389
9747
|
};
|
|
9390
|
-
const dictionaries$
|
|
9748
|
+
const dictionaries$5 = withDictionaries(withDictionaries({
|
|
9391
9749
|
en: {
|
|
9392
9750
|
nav: "Worlds",
|
|
9393
9751
|
loading: "Loading worlds…",
|
|
9394
9752
|
loadFailed: "Could not load worlds: {message}",
|
|
9753
|
+
starterAdd: "Add this sample world",
|
|
9754
|
+
starterAdding: "Adding…",
|
|
9755
|
+
starterFailed: "Could not add the sample world: {message}",
|
|
9395
9756
|
empty: "No worlds yet. Create one here, or put a folder with a world.json inside {directory}.",
|
|
9396
9757
|
countOne: "{count} world",
|
|
9397
9758
|
countOther: "{count} worlds",
|
|
@@ -9484,6 +9845,9 @@ window.__ModuleLoader__.load({
|
|
|
9484
9845
|
nav: "世界卡",
|
|
9485
9846
|
loading: "正在加载世界卡…",
|
|
9486
9847
|
loadFailed: "无法加载世界卡:{message}",
|
|
9848
|
+
starterAdd: "添加这个示例世界",
|
|
9849
|
+
starterAdding: "正在添加…",
|
|
9850
|
+
starterFailed: "无法添加示例世界:{message}",
|
|
9487
9851
|
empty: "还没有世界卡。可在此创建,也可在 {directory} 中新建文件夹并放入 world.json。",
|
|
9488
9852
|
countOne: "{count} 张世界卡",
|
|
9489
9853
|
countOther: "{count} 张世界卡",
|
|
@@ -9572,7 +9936,7 @@ window.__ModuleLoader__.load({
|
|
|
9572
9936
|
startAvatars: "带上角色形象",
|
|
9573
9937
|
startAvatarsHelp: "勾选要带进这个存档的角色形象,它们会成为存档中的角色,你也可以扮演它们。世界本身不会改变。"
|
|
9574
9938
|
}
|
|
9575
|
-
}, dictionaries$
|
|
9939
|
+
}, dictionaries$6), dictionaries$9);
|
|
9576
9940
|
//#endregion
|
|
9577
9941
|
//#region src/client/pages/worlds/worlds-controller.ts
|
|
9578
9942
|
async function request$1(path, init, signal) {
|
|
@@ -9805,11 +10169,11 @@ window.__ModuleLoader__.load({
|
|
|
9805
10169
|
};
|
|
9806
10170
|
//#endregion
|
|
9807
10171
|
//#region src/client/pages/worlds/index.ts
|
|
9808
|
-
const NAMESPACE$
|
|
10172
|
+
const NAMESPACE$7 = "roleplay.worlds";
|
|
9809
10173
|
/** Adds the Worlds page to the Role Play panel. */
|
|
9810
10174
|
function registerWorldsPage(ctx) {
|
|
9811
|
-
const t = ctx.locale.bind(NAMESPACE$
|
|
9812
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$
|
|
10175
|
+
const t = ctx.locale.bind(NAMESPACE$7);
|
|
10176
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$7, dictionaries$5), "roleplay: worlds dictionaries");
|
|
9813
10177
|
const worlds = new WorldsController(createChatOpener(ctx), () => t("language"));
|
|
9814
10178
|
ctx.effect(() => () => {
|
|
9815
10179
|
worlds.dispose();
|
|
@@ -9819,7 +10183,7 @@ window.__ModuleLoader__.load({
|
|
|
9819
10183
|
id: "worlds",
|
|
9820
10184
|
order: 0,
|
|
9821
10185
|
label: () => t("nav"),
|
|
9822
|
-
locale: NAMESPACE$
|
|
10186
|
+
locale: NAMESPACE$7,
|
|
9823
10187
|
inject: () => worlds.inject()
|
|
9824
10188
|
}, WorldsPage));
|
|
9825
10189
|
}
|
|
@@ -9918,22 +10282,22 @@ window.__ModuleLoader__.load({
|
|
|
9918
10282
|
}
|
|
9919
10283
|
};
|
|
9920
10284
|
//#endregion
|
|
9921
|
-
//#region \0css-module:/home/
|
|
9922
|
-
const css$
|
|
9923
|
-
const key$
|
|
9924
|
-
let tag$
|
|
9925
|
-
if (tag$
|
|
9926
|
-
tag$
|
|
9927
|
-
tag$
|
|
9928
|
-
tag$
|
|
9929
|
-
document.head.appendChild(tag$
|
|
10285
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/branch/BranchDialog.module.css.mjs
|
|
10286
|
+
const css$6 = ".rp_Dy1TaW_form{flex-direction:column;gap:12px;min-width:min(420px,100%);display:flex}.rp_Dy1TaW_field{flex-direction:column;gap:6px;min-width:0;display:flex}.rp_Dy1TaW_label{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_Dy1TaW_error{color:var(--dsw-alias-state-danger-primary);margin:0;font-size:12px}";
|
|
10287
|
+
const key$6 = "src/client/branch/BranchDialog.module.css";
|
|
10288
|
+
let tag$6 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$6) + "]");
|
|
10289
|
+
if (tag$6 === null) {
|
|
10290
|
+
tag$6 = document.createElement("style");
|
|
10291
|
+
tag$6.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
10292
|
+
tag$6.dataset.pluginCss = key$6;
|
|
10293
|
+
document.head.appendChild(tag$6);
|
|
9930
10294
|
}
|
|
9931
|
-
tag$
|
|
10295
|
+
tag$6.textContent = css$6;
|
|
9932
10296
|
var BranchDialog_module_css_default = {
|
|
9933
|
-
"
|
|
9934
|
-
"
|
|
9935
|
-
"
|
|
9936
|
-
"
|
|
10297
|
+
"field": "rp_Dy1TaW_field",
|
|
10298
|
+
"form": "rp_Dy1TaW_form",
|
|
10299
|
+
"label": "rp_Dy1TaW_label",
|
|
10300
|
+
"error": "rp_Dy1TaW_error"
|
|
9937
10301
|
};
|
|
9938
10302
|
//#endregion
|
|
9939
10303
|
//#region src/client/branch/BranchDialog.tsx
|
|
@@ -10002,7 +10366,7 @@ window.__ModuleLoader__.load({
|
|
|
10002
10366
|
}
|
|
10003
10367
|
//#endregion
|
|
10004
10368
|
//#region src/client/branch/locales.ts
|
|
10005
|
-
const dictionaries$
|
|
10369
|
+
const dictionaries$4 = {
|
|
10006
10370
|
en: {
|
|
10007
10371
|
title: "Name the branch",
|
|
10008
10372
|
description: "A new session was made from the story at this point; the first one is as it was.",
|
|
@@ -10026,10 +10390,10 @@ window.__ModuleLoader__.load({
|
|
|
10026
10390
|
};
|
|
10027
10391
|
//#endregion
|
|
10028
10392
|
//#region src/client/branch/index.ts
|
|
10029
|
-
const NAMESPACE$
|
|
10393
|
+
const NAMESPACE$6 = "roleplay.branch";
|
|
10030
10394
|
/** Asks for a name when DSH's fork of a roleplay chat has made a session of its own. Forks of ordinary chats are not touched. */
|
|
10031
10395
|
function registerBranchNaming(ctx) {
|
|
10032
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$
|
|
10396
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$6, dictionaries$4), "roleplay: branch dictionaries");
|
|
10033
10397
|
const branches = new BranchController();
|
|
10034
10398
|
ctx.inject(["sessions"], (inner) => {
|
|
10035
10399
|
const sessions = inner.get("sessions");
|
|
@@ -10038,7 +10402,7 @@ window.__ModuleLoader__.load({
|
|
|
10038
10402
|
ctx.slots.inject("shell.overlay", () => ctx.slots.register({
|
|
10039
10403
|
name: "shell.overlay",
|
|
10040
10404
|
id: "roleplay-branch",
|
|
10041
|
-
locale: NAMESPACE$
|
|
10405
|
+
locale: NAMESPACE$6,
|
|
10042
10406
|
inject: () => branches.inject()
|
|
10043
10407
|
}, BranchDialog));
|
|
10044
10408
|
}
|
|
@@ -10062,11 +10426,11 @@ window.__ModuleLoader__.load({
|
|
|
10062
10426
|
}
|
|
10063
10427
|
//#endregion
|
|
10064
10428
|
//#region src/client/gallery/index.ts
|
|
10065
|
-
const NAMESPACE$
|
|
10066
|
-
const VIEW_ID$
|
|
10429
|
+
const NAMESPACE$5 = "roleplay.gallery";
|
|
10430
|
+
const VIEW_ID$3 = "roleplay-gallery";
|
|
10067
10431
|
/** The shell activates a data target for every view tab; this tab reads from the host itself, so its target is empty. */
|
|
10068
10432
|
const galleryTarget = {
|
|
10069
|
-
target: VIEW_ID$
|
|
10433
|
+
target: VIEW_ID$3,
|
|
10070
10434
|
create: () => ({
|
|
10071
10435
|
empty: {},
|
|
10072
10436
|
replace: () => ({}),
|
|
@@ -10075,91 +10439,1013 @@ window.__ModuleLoader__.load({
|
|
|
10075
10439
|
};
|
|
10076
10440
|
/** Adds the Gallery tab beside Chat and World: every image of the session in a grid. */
|
|
10077
10441
|
function registerGallery(ctx) {
|
|
10078
|
-
const t = ctx.locale.bind(NAMESPACE$
|
|
10079
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$
|
|
10442
|
+
const t = ctx.locale.bind(NAMESPACE$5);
|
|
10443
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$5, dictionaries$10), "roleplay: gallery dictionaries");
|
|
10080
10444
|
ctx.inject(["uiConversation"], (scope) => {
|
|
10081
10445
|
scope.uiConversation.views.register(galleryTarget);
|
|
10082
10446
|
scope.slots.inject("conversation.view", () => scope.slots.register({
|
|
10083
10447
|
name: "conversation.view",
|
|
10084
|
-
id: VIEW_ID$
|
|
10448
|
+
id: VIEW_ID$3,
|
|
10085
10449
|
order: 15,
|
|
10086
10450
|
label: () => t("tab"),
|
|
10087
|
-
locale: NAMESPACE$
|
|
10451
|
+
locale: NAMESPACE$5
|
|
10088
10452
|
}, GalleryTab));
|
|
10089
10453
|
});
|
|
10090
10454
|
}
|
|
10091
10455
|
//#endregion
|
|
10092
|
-
//#region src/
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
return
|
|
10100
|
-
}
|
|
10101
|
-
return;
|
|
10102
|
-
}
|
|
10103
|
-
}
|
|
10104
|
-
//#endregion
|
|
10105
|
-
//#region src/client/world/session-source.ts
|
|
10106
|
-
/** The story of a roleplay session, as the World tab reads and edits it. */
|
|
10107
|
-
function sessionSource(session) {
|
|
10108
|
-
const id = encodeURIComponent(session);
|
|
10456
|
+
//#region src/client/chat-input.ts
|
|
10457
|
+
/** What can be done with the input box of a session: put words in it, and send them. Resolved on use, so a client without it fails at the click. */
|
|
10458
|
+
function facadeOf(scope, sessionId) {
|
|
10459
|
+
const input = () => {
|
|
10460
|
+
const actx = scope.get("sessions")?.scope(sessionId);
|
|
10461
|
+
const conversation = actx?.get("conversation");
|
|
10462
|
+
if (actx === void 0 || conversation === void 0) throw new Error("the input of this chat is not available");
|
|
10463
|
+
return conversation.input.for(actx);
|
|
10464
|
+
};
|
|
10109
10465
|
return {
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
saveLore: async (key, edit, signal) => await put(`${API_PREFIX}/sessions/world/lore?id=${id}&key=${encodeURIComponent(key)}`, edit, signal),
|
|
10119
|
-
savePlots: async (edit, signal) => await put(`${API_PREFIX}/sessions/world/plots?id=${id}`, edit, signal),
|
|
10120
|
-
saveRelation: async (edit, signal) => await put(`${API_PREFIX}/sessions/world/relation?id=${id}`, edit, signal),
|
|
10121
|
-
saveNarrationVoice: async (voice, signal) => await put(`${API_PREFIX}/sessions/world/narration-voice?id=${id}`, { voice }, signal),
|
|
10122
|
-
listVoices: async (signal) => await listVoices(`${API_PREFIX}/speech/voices`, signal),
|
|
10123
|
-
generatePortrait: async (key, signal) => await post(`${API_PREFIX}/sessions/world/character/portrait?id=${id}&key=${encodeURIComponent(key)}`, signal)
|
|
10466
|
+
pick: (text) => {
|
|
10467
|
+
input().setDraft(text);
|
|
10468
|
+
},
|
|
10469
|
+
fill: (text, send) => {
|
|
10470
|
+
const facade = input();
|
|
10471
|
+
facade.setDraft(text);
|
|
10472
|
+
if (send) facade.submit();
|
|
10473
|
+
}
|
|
10124
10474
|
};
|
|
10125
10475
|
}
|
|
10126
10476
|
//#endregion
|
|
10127
|
-
//#region src/client/
|
|
10128
|
-
/** The
|
|
10129
|
-
function
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
fontSize: 13
|
|
10137
|
-
},
|
|
10138
|
-
children: t("notRoleplay")
|
|
10139
|
-
});
|
|
10140
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorldEditor, {
|
|
10141
|
-
t,
|
|
10142
|
-
source,
|
|
10143
|
-
notEditable: t("notRoleplay")
|
|
10144
|
-
});
|
|
10477
|
+
//#region src/client/interface/api.ts
|
|
10478
|
+
/** The host says why in `message`; a failure that has none is told by its status. */
|
|
10479
|
+
async function read(response, what) {
|
|
10480
|
+
if (!response.ok) throw new Error((await response.json().catch(() => ({}))).message ?? `${what} (${response.status})`);
|
|
10481
|
+
return await response.json();
|
|
10482
|
+
}
|
|
10483
|
+
const enc = encodeURIComponent;
|
|
10484
|
+
async function packOf(session) {
|
|
10485
|
+
return read(await fetch(`roleplay-api/sessions/interface?id=${enc(session)}`), "the interface pack could not be read");
|
|
10145
10486
|
}
|
|
10487
|
+
async function viewOf(session, revision) {
|
|
10488
|
+
return read(await fetch(`roleplay-api/sessions/interface/view?id=${enc(session)}${revision === void 0 ? "" : `&revision=${enc(revision)}`}`), "the story could not be read");
|
|
10489
|
+
}
|
|
10490
|
+
async function historyOf(session, limit) {
|
|
10491
|
+
return read(await fetch(`roleplay-api/sessions/interface/history?id=${enc(session)}&limit=${limit}`), "the story so far could not be read");
|
|
10492
|
+
}
|
|
10493
|
+
async function storeOf(session, request) {
|
|
10494
|
+
return (await read(await fetch(`roleplay-api/sessions/interface/storage?id=${enc(session)}`, {
|
|
10495
|
+
method: "POST",
|
|
10496
|
+
headers: { "content-type": "application/json" },
|
|
10497
|
+
body: JSON.stringify(request)
|
|
10498
|
+
}), "the pack could not keep that")).value;
|
|
10499
|
+
}
|
|
10500
|
+
async function availability() {
|
|
10501
|
+
return read(await fetch("roleplay-api/interface/availability"), "the interface packs could not be looked up");
|
|
10502
|
+
}
|
|
10503
|
+
/** The address of a surface of the pack: its files are found beside it by their relative addresses, so the key stands in the path. */
|
|
10504
|
+
const frameAddress = (key, file, revision) => `roleplay-api/sessions/interface/frame/${enc(key)}/${file.split("/").map(enc).join("/")}?r=${enc(revision)}`;
|
|
10146
10505
|
//#endregion
|
|
10147
|
-
//#region src/client/
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10506
|
+
//#region src/client/interface/conversation-body.ts
|
|
10507
|
+
/**
|
|
10508
|
+
* The element that holds a session's transcript and what is drawn behind it, found from something inside the same
|
|
10509
|
+
* conversation: the closest ancestor that contains the scrolling body of the chat, and that body's parent.
|
|
10510
|
+
*/
|
|
10511
|
+
function conversationBody(from) {
|
|
10512
|
+
for (let at = from.parentElement; at !== null; at = at.parentElement) {
|
|
10513
|
+
const scroll = at.querySelector("[class*=\"_scrollBody\"]");
|
|
10514
|
+
if (scroll?.parentElement != null) return {
|
|
10515
|
+
body: scroll.parentElement,
|
|
10516
|
+
scroll
|
|
10517
|
+
};
|
|
10518
|
+
}
|
|
10519
|
+
}
|
|
10520
|
+
//#endregion
|
|
10521
|
+
//#region src/client/interface/backdrop.ts
|
|
10522
|
+
const LIFTED = "data-rp-lifted";
|
|
10523
|
+
const STYLE = "data-roleplay-backdrop-style";
|
|
10524
|
+
/**
|
|
10525
|
+
* A layer behind the transcript of the chat that `anchor` stands in, for a pack's backdrop. The conversation paints its
|
|
10526
|
+
* own opaque background and its scrolling body above any layer under it, so the layer is put first in the body and the
|
|
10527
|
+
* scrolling body is lifted over it; both stay transparent to clicks. When the page is not built as expected there is
|
|
10528
|
+
* no layer and a note in the console, and the story plays as it does without a backdrop.
|
|
10529
|
+
*/
|
|
10530
|
+
function useBackdropHost(anchor, enabled) {
|
|
10531
|
+
const [host, setHost] = (0, react.useState)(void 0);
|
|
10532
|
+
(0, react.useEffect)(() => {
|
|
10533
|
+
const from = anchor.current;
|
|
10534
|
+
if (!enabled || from === null) {
|
|
10535
|
+
setHost(void 0);
|
|
10536
|
+
return;
|
|
10537
|
+
}
|
|
10538
|
+
const found = conversationBody(from);
|
|
10539
|
+
if (found === void 0) {
|
|
10540
|
+
console.warn("roleplay: the interface pack has a backdrop, but this page has no place for one");
|
|
10541
|
+
setHost(void 0);
|
|
10542
|
+
return;
|
|
10543
|
+
}
|
|
10544
|
+
const layer = document.createElement("div");
|
|
10545
|
+
layer.setAttribute("data-rp", "backdrop");
|
|
10546
|
+
layer.style.cssText = "position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden";
|
|
10547
|
+
found.body.insertBefore(layer, found.body.firstChild);
|
|
10548
|
+
found.scroll.setAttribute(LIFTED, "");
|
|
10549
|
+
let style = document.head.querySelector(`style[${STYLE}]`);
|
|
10550
|
+
if (style === null) {
|
|
10551
|
+
style = document.createElement("style");
|
|
10552
|
+
style.setAttribute(STYLE, "");
|
|
10553
|
+
style.textContent = `[${LIFTED}]{position:relative;z-index:1}`;
|
|
10554
|
+
document.head.append(style);
|
|
10555
|
+
}
|
|
10556
|
+
setHost(layer);
|
|
10557
|
+
return () => {
|
|
10558
|
+
layer.remove();
|
|
10559
|
+
found.scroll.removeAttribute(LIFTED);
|
|
10560
|
+
if (document.querySelector(`[${LIFTED}]`) === null) document.head.querySelector(`style[${STYLE}]`)?.remove();
|
|
10561
|
+
setHost(void 0);
|
|
10562
|
+
};
|
|
10563
|
+
}, [anchor, enabled]);
|
|
10564
|
+
return host;
|
|
10565
|
+
}
|
|
10566
|
+
//#endregion
|
|
10567
|
+
//#region src/client/interface/hooks.ts
|
|
10568
|
+
const PACK_POLL_MS = 4e3;
|
|
10569
|
+
const VIEW_POLL_MS = 2e3;
|
|
10570
|
+
/**
|
|
10571
|
+
* One poll of the host for everyone who wants the same thing: the strips, the tab and the backdrop of a story all
|
|
10572
|
+
* read the same pack and view, so they share the request instead of each making their own.
|
|
10573
|
+
*/
|
|
10574
|
+
function useShared(cache, key, active, fetch, onError, interval) {
|
|
10575
|
+
const [value, setValue] = (0, react.useState)(key === void 0 ? void 0 : cache.get(key)?.value);
|
|
10576
|
+
(0, react.useEffect)(() => {
|
|
10577
|
+
if (key === void 0 || !active) {
|
|
10578
|
+
setValue(void 0);
|
|
10579
|
+
return;
|
|
10580
|
+
}
|
|
10581
|
+
let entry = cache.get(key);
|
|
10582
|
+
if (entry === void 0) {
|
|
10583
|
+
const created = {
|
|
10584
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
10585
|
+
value: void 0,
|
|
10586
|
+
stop: () => void 0
|
|
10587
|
+
};
|
|
10588
|
+
entry = created;
|
|
10589
|
+
cache.set(key, created);
|
|
10590
|
+
let stopped = false;
|
|
10591
|
+
let timer;
|
|
10592
|
+
const look = () => {
|
|
10593
|
+
fetch(created.value).then((next) => {
|
|
10594
|
+
created.value = next;
|
|
10595
|
+
}, (error) => {
|
|
10596
|
+
created.value = onError(error);
|
|
10597
|
+
}).finally(() => {
|
|
10598
|
+
if (stopped) return;
|
|
10599
|
+
for (const listener of created.listeners) listener(created.value);
|
|
10600
|
+
timer = setTimeout(look, interval);
|
|
10601
|
+
});
|
|
10602
|
+
};
|
|
10603
|
+
created.stop = () => {
|
|
10604
|
+
stopped = true;
|
|
10605
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
10606
|
+
};
|
|
10607
|
+
look();
|
|
10608
|
+
}
|
|
10609
|
+
const listener = (next) => {
|
|
10610
|
+
setValue((previous) => previous === next ? previous : next);
|
|
10611
|
+
};
|
|
10612
|
+
entry.listeners.add(listener);
|
|
10613
|
+
setValue(entry.value);
|
|
10614
|
+
return () => {
|
|
10615
|
+
entry.listeners.delete(listener);
|
|
10616
|
+
if (entry.listeners.size === 0) {
|
|
10617
|
+
entry.stop();
|
|
10618
|
+
cache.delete(key);
|
|
10619
|
+
}
|
|
10620
|
+
};
|
|
10621
|
+
}, [
|
|
10622
|
+
cache,
|
|
10623
|
+
key,
|
|
10624
|
+
active,
|
|
10625
|
+
interval
|
|
10626
|
+
]);
|
|
10627
|
+
return value;
|
|
10628
|
+
}
|
|
10629
|
+
const packs = /* @__PURE__ */ new Map();
|
|
10630
|
+
const views = /* @__PURE__ */ new Map();
|
|
10631
|
+
/** The interface pack of a story, looked at again from time to time so that an edited file shows. A session the host does not know has none. */
|
|
10632
|
+
function usePack(session) {
|
|
10633
|
+
return useShared(packs, session, true, async (previous) => {
|
|
10634
|
+
const found = await packOf(session);
|
|
10635
|
+
return previous !== void 0 && JSON.stringify(previous) === JSON.stringify(found) ? previous : found;
|
|
10636
|
+
}, () => ({
|
|
10637
|
+
pack: null,
|
|
10638
|
+
problems: []
|
|
10639
|
+
}), PACK_POLL_MS);
|
|
10640
|
+
}
|
|
10641
|
+
/** What the player may know of the story, kept up to date while `active`. */
|
|
10642
|
+
function usePlayerView(session, active) {
|
|
10643
|
+
return useShared(views, session, active, async (previous) => {
|
|
10644
|
+
const reply = await viewOf(session, previous?.revision);
|
|
10645
|
+
return reply.unchanged !== true && "view" in reply ? reply.view : previous;
|
|
10646
|
+
}, (error) => {
|
|
10647
|
+
console.warn("roleplay: the story could not be read for the interface pack", error);
|
|
10648
|
+
}, VIEW_POLL_MS);
|
|
10649
|
+
}
|
|
10650
|
+
//#endregion
|
|
10651
|
+
//#region src/shared/interface-pack.ts
|
|
10652
|
+
/** The surfaces that sit in a strip of the chat and so have a height of their own, with the heights they may ask for. */
|
|
10653
|
+
const STRIP_HEIGHTS = {
|
|
10654
|
+
hud: {
|
|
10655
|
+
min: 24,
|
|
10656
|
+
max: 320,
|
|
10657
|
+
fallback: 56
|
|
10658
|
+
},
|
|
10659
|
+
dock: {
|
|
10660
|
+
min: 24,
|
|
10661
|
+
max: 320,
|
|
10662
|
+
fallback: 48
|
|
10663
|
+
},
|
|
10664
|
+
opening: {
|
|
10665
|
+
min: 120,
|
|
10666
|
+
max: 640,
|
|
10667
|
+
fallback: 320
|
|
10668
|
+
}
|
|
10669
|
+
};
|
|
10670
|
+
const isStrip = (name) => name in STRIP_HEIGHTS;
|
|
10671
|
+
const PACK_LIMITS = {
|
|
10672
|
+
files: 200,
|
|
10673
|
+
bytes: 5242880,
|
|
10674
|
+
fileBytes: 1048576,
|
|
10675
|
+
depth: 4,
|
|
10676
|
+
storageBytes: 65536,
|
|
10677
|
+
history: {
|
|
10678
|
+
fallback: 20,
|
|
10679
|
+
max: 100
|
|
10680
|
+
}
|
|
10681
|
+
};
|
|
10682
|
+
/** The longest words a surface may send as the player. */
|
|
10683
|
+
const MAX_WORDS = 2e3;
|
|
10684
|
+
/** How long a surface waits before it may speak again when the turn does not move. */
|
|
10685
|
+
const SAY_AGAIN_AFTER_MS = 3e4;
|
|
10686
|
+
/** Reads what came through `postMessage`; anything that is not the protocol is nothing. */
|
|
10687
|
+
function parseFrameMessage(data) {
|
|
10688
|
+
if (typeof data !== "object" || data === null) return void 0;
|
|
10689
|
+
const message = data;
|
|
10690
|
+
if (message["rp"] !== 1) return void 0;
|
|
10691
|
+
if (message["type"] === "hello") return { type: "hello" };
|
|
10692
|
+
if (message["type"] === "resize") return typeof message["height"] === "number" && Number.isFinite(message["height"]) ? {
|
|
10693
|
+
type: "resize",
|
|
10694
|
+
height: message["height"]
|
|
10695
|
+
} : void 0;
|
|
10696
|
+
if (message["type"] === "request" && typeof message["id"] === "number" && typeof message["method"] === "string") {
|
|
10697
|
+
const params = message["params"];
|
|
10698
|
+
return {
|
|
10699
|
+
type: "request",
|
|
10700
|
+
id: message["id"],
|
|
10701
|
+
method: message["method"],
|
|
10702
|
+
params: typeof params === "object" && params !== null && !Array.isArray(params) ? params : {}
|
|
10703
|
+
};
|
|
10704
|
+
}
|
|
10705
|
+
}
|
|
10706
|
+
/** The height a surface may ask for, as the interface allows it for that strip. */
|
|
10707
|
+
function clampHeight(height, surface) {
|
|
10708
|
+
const { min, max } = STRIP_HEIGHTS[surface];
|
|
10709
|
+
return Math.min(max, Math.max(min, Math.round(height)));
|
|
10710
|
+
}
|
|
10711
|
+
const text = (params, name) => {
|
|
10712
|
+
const value = params[name];
|
|
10713
|
+
if (typeof value !== "string") throw new Error(`${name} must be text`);
|
|
10714
|
+
return value;
|
|
10715
|
+
};
|
|
10716
|
+
/** Answers a surface's requests: what the pack was allowed to ask in its manifest, within limits, nothing else. */
|
|
10717
|
+
var Bridge = class {
|
|
10718
|
+
env;
|
|
10719
|
+
stamps = [];
|
|
10720
|
+
spoke;
|
|
10721
|
+
constructor(env) {
|
|
10722
|
+
this.env = env;
|
|
10723
|
+
}
|
|
10724
|
+
async answer(message) {
|
|
10725
|
+
try {
|
|
10726
|
+
return {
|
|
10727
|
+
ok: true,
|
|
10728
|
+
value: await this.run(message.method, message.params)
|
|
10729
|
+
};
|
|
10730
|
+
} catch (error) {
|
|
10731
|
+
return {
|
|
10732
|
+
ok: false,
|
|
10733
|
+
error: error instanceof Error ? error.message : String(error)
|
|
10734
|
+
};
|
|
10735
|
+
}
|
|
10736
|
+
}
|
|
10737
|
+
allowed(action) {
|
|
10738
|
+
if (!this.env.actions.includes(action)) throw new Error(`the pack did not ask for "${action}" in its pack.json actions`);
|
|
10739
|
+
}
|
|
10740
|
+
words(params) {
|
|
10741
|
+
const words = text(params, "text").trim();
|
|
10742
|
+
if (words === "") throw new Error("there are no words");
|
|
10743
|
+
if (words.length > 2e3) throw new Error(`words are at most ${MAX_WORDS} characters`);
|
|
10744
|
+
return words;
|
|
10745
|
+
}
|
|
10746
|
+
async run(method, params) {
|
|
10747
|
+
const now = this.env.now();
|
|
10748
|
+
while (this.stamps.length > 0 && now - this.stamps[0] >= 1e3) this.stamps.shift();
|
|
10749
|
+
if (this.stamps.length >= 20) throw new Error("too many requests; at most 20 a second");
|
|
10750
|
+
this.stamps.push(now);
|
|
10751
|
+
const view = this.env.view();
|
|
10752
|
+
switch (method) {
|
|
10753
|
+
case "state":
|
|
10754
|
+
if (view === void 0) throw new Error("the story has not been read yet");
|
|
10755
|
+
return view;
|
|
10756
|
+
case "say": {
|
|
10757
|
+
this.allowed("say");
|
|
10758
|
+
const turn = view?.story.turn ?? 0;
|
|
10759
|
+
if (this.spoke !== void 0 && this.spoke.turn === turn && now - this.spoke.at < SAY_AGAIN_AFTER_MS) throw new Error("already said something this turn; wait for the story to answer");
|
|
10760
|
+
const words = this.words(params);
|
|
10761
|
+
this.spoke = {
|
|
10762
|
+
turn,
|
|
10763
|
+
at: now
|
|
10764
|
+
};
|
|
10765
|
+
await this.env.say(words);
|
|
10766
|
+
return null;
|
|
10767
|
+
}
|
|
10768
|
+
case "fill":
|
|
10769
|
+
this.allowed("fill");
|
|
10770
|
+
await this.env.fill(this.words(params));
|
|
10771
|
+
return null;
|
|
10772
|
+
case "choose": {
|
|
10773
|
+
this.allowed("choose");
|
|
10774
|
+
const index = params["index"];
|
|
10775
|
+
const chosen = typeof index === "number" && Number.isInteger(index) ? view?.suggestions[index] : void 0;
|
|
10776
|
+
if (chosen === void 0) throw new Error("there is no such suggestion");
|
|
10777
|
+
await this.env.fill(chosen);
|
|
10778
|
+
return null;
|
|
10779
|
+
}
|
|
10780
|
+
case "open": {
|
|
10781
|
+
this.allowed("open");
|
|
10782
|
+
const surface = params["surface"];
|
|
10783
|
+
if (surface !== "tab" && surface !== "sidebar") throw new Error("surface must be \"tab\" or \"sidebar\"");
|
|
10784
|
+
await this.env.open(surface);
|
|
10785
|
+
return null;
|
|
10786
|
+
}
|
|
10787
|
+
case "storage.get": return await this.env.storage("get", text(params, "key"));
|
|
10788
|
+
case "storage.set":
|
|
10789
|
+
await this.env.storage("set", text(params, "key"), params["value"]);
|
|
10790
|
+
return null;
|
|
10791
|
+
case "storage.remove":
|
|
10792
|
+
await this.env.storage("remove", text(params, "key"));
|
|
10793
|
+
return null;
|
|
10794
|
+
case "history": {
|
|
10795
|
+
const asked = params["limit"];
|
|
10796
|
+
const limit = typeof asked === "number" && Number.isInteger(asked) && asked >= 1 ? Math.min(asked, PACK_LIMITS.history.max) : PACK_LIMITS.history.fallback;
|
|
10797
|
+
return await this.env.history(limit);
|
|
10798
|
+
}
|
|
10799
|
+
case "theme": return this.env.theme();
|
|
10800
|
+
default: throw new Error(`there is no rp.${method}`);
|
|
10801
|
+
}
|
|
10802
|
+
}
|
|
10803
|
+
};
|
|
10804
|
+
//#endregion
|
|
10805
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/interface/PackFrame.module.css.mjs
|
|
10806
|
+
const css$5 = ".rp_bMXf9W_frame{background:0 0;border:0;width:100%;display:block}.rp_bMXf9W_fill{height:100%;min-height:0}.rp_bMXf9W_message{color:var(--dsw-alias-label-secondary);margin:0;padding:16px 24px;font-size:13px;line-height:20px}.rp_bMXf9W_problems{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;padding-left:18px;font-size:12px}.rp_bMXf9W_hud{box-sizing:border-box;width:min(800px,100%);margin:0 auto 8px;padding:0 16px}.rp_bMXf9W_tab{flex-direction:column;flex:1 1 0;width:100%;min-height:0;display:flex}";
|
|
10807
|
+
const key$5 = "src/client/interface/PackFrame.module.css";
|
|
10808
|
+
let tag$5 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$5) + "]");
|
|
10809
|
+
if (tag$5 === null) {
|
|
10810
|
+
tag$5 = document.createElement("style");
|
|
10811
|
+
tag$5.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
10812
|
+
tag$5.dataset.pluginCss = key$5;
|
|
10813
|
+
document.head.appendChild(tag$5);
|
|
10814
|
+
}
|
|
10815
|
+
tag$5.textContent = css$5;
|
|
10816
|
+
var PackFrame_module_css_default = {
|
|
10817
|
+
"frame": "rp_bMXf9W_frame",
|
|
10818
|
+
"fill": "rp_bMXf9W_fill",
|
|
10819
|
+
"message": "rp_bMXf9W_message",
|
|
10820
|
+
"hud": "rp_bMXf9W_hud",
|
|
10821
|
+
"tab": "rp_bMXf9W_tab",
|
|
10822
|
+
"problems": "rp_bMXf9W_problems"
|
|
10823
|
+
};
|
|
10824
|
+
//#endregion
|
|
10825
|
+
//#region src/client/interface/theme.ts
|
|
10826
|
+
/** The colours of DSH a surface is given, so that it looks right in light and dark. */
|
|
10827
|
+
const SHARED_TOKENS = [
|
|
10828
|
+
"--dsw-alias-bg-base",
|
|
10829
|
+
"--dsw-alias-bg-layer-1",
|
|
10830
|
+
"--dsw-alias-bg-layer-2",
|
|
10831
|
+
"--dsw-alias-bg-overlay",
|
|
10832
|
+
"--dsw-alias-border-l1",
|
|
10833
|
+
"--dsw-alias-border-l2",
|
|
10834
|
+
"--dsw-alias-border-l3",
|
|
10835
|
+
"--dsw-alias-border-l4",
|
|
10836
|
+
"--dsw-alias-brand-primary",
|
|
10837
|
+
"--dsw-alias-label-primary",
|
|
10838
|
+
"--dsw-alias-label-secondary",
|
|
10839
|
+
"--dsw-alias-label-tertiary",
|
|
10840
|
+
"--dsw-alias-link",
|
|
10841
|
+
"--dsw-alias-state-business-primary",
|
|
10842
|
+
"--dsw-alias-state-error-primary",
|
|
10843
|
+
"--dsw-alias-state-idle-primary",
|
|
10844
|
+
"--dsw-alias-state-success-primary",
|
|
10845
|
+
"--dsw-alias-state-warn-primary",
|
|
10846
|
+
"--dsw-radius-sm"
|
|
10847
|
+
];
|
|
10848
|
+
const DARK_ATTRIBUTE = "data-ds-dark-theme";
|
|
10849
|
+
/** The scheme and the colours the page uses now. */
|
|
10850
|
+
function readTheme(body = document.body) {
|
|
10851
|
+
const style = getComputedStyle(body);
|
|
10852
|
+
const tokens = {};
|
|
10853
|
+
for (const name of SHARED_TOKENS) {
|
|
10854
|
+
const value = style.getPropertyValue(name).trim();
|
|
10855
|
+
if (value !== "") tokens[name] = value;
|
|
10856
|
+
}
|
|
10857
|
+
return {
|
|
10858
|
+
scheme: body.hasAttribute(DARK_ATTRIBUTE) ? "dark" : "light",
|
|
10859
|
+
tokens
|
|
10860
|
+
};
|
|
10861
|
+
}
|
|
10862
|
+
/** Calls back when the page changes its scheme or its colours. @returns stop. */
|
|
10863
|
+
function watchTheme(callback, body = document.body) {
|
|
10864
|
+
const observer = new MutationObserver(callback);
|
|
10865
|
+
observer.observe(body, {
|
|
10866
|
+
attributes: true,
|
|
10867
|
+
attributeFilter: [
|
|
10868
|
+
DARK_ATTRIBUTE,
|
|
10869
|
+
"style",
|
|
10870
|
+
"class"
|
|
10871
|
+
]
|
|
10872
|
+
});
|
|
10873
|
+
return () => {
|
|
10874
|
+
observer.disconnect();
|
|
10875
|
+
};
|
|
10876
|
+
}
|
|
10877
|
+
//#endregion
|
|
10878
|
+
//#region src/client/interface/PackFrame.tsx
|
|
10879
|
+
/**
|
|
10880
|
+
* A surface of a pack, in a frame that can run its scripts and nothing more: no access to this page,
|
|
10881
|
+
* its storage or the network. The only way out is the bridge, which answers what the pack asked for.
|
|
10882
|
+
*/
|
|
10883
|
+
function PackFrame({ session, pack, surface, view, input, onResize, fill, height, title }) {
|
|
10884
|
+
const frame = (0, react.useRef)(null);
|
|
10885
|
+
const [ready, setReady] = (0, react.useState)(false);
|
|
10886
|
+
const latest = (0, react.useRef)({
|
|
10887
|
+
view,
|
|
10888
|
+
input,
|
|
10889
|
+
actions: pack.actions
|
|
10890
|
+
});
|
|
10891
|
+
const before = (0, react.useRef)(void 0);
|
|
10892
|
+
latest.current = {
|
|
10893
|
+
view,
|
|
10894
|
+
input,
|
|
10895
|
+
actions: pack.actions
|
|
10896
|
+
};
|
|
10897
|
+
const file = pack.surfaces[surface]?.file;
|
|
10898
|
+
const bridge = (0, react.useMemo)(() => {
|
|
10899
|
+
return new Bridge({
|
|
10900
|
+
get actions() {
|
|
10901
|
+
return latest.current.actions;
|
|
10902
|
+
},
|
|
10903
|
+
view: () => latest.current.view,
|
|
10904
|
+
say: (text) => {
|
|
10905
|
+
latest.current.input.say(text);
|
|
10906
|
+
},
|
|
10907
|
+
fill: (text) => {
|
|
10908
|
+
latest.current.input.fill(text);
|
|
10909
|
+
},
|
|
10910
|
+
open: (surface) => {
|
|
10911
|
+
latest.current.input.open(surface);
|
|
10912
|
+
},
|
|
10913
|
+
history: (limit) => historyOf(session, limit),
|
|
10914
|
+
storage: (op, key, value) => storeOf(session, {
|
|
10915
|
+
op,
|
|
10916
|
+
key,
|
|
10917
|
+
...value === void 0 ? {} : { value }
|
|
10918
|
+
}),
|
|
10919
|
+
theme: () => readTheme(),
|
|
10920
|
+
now: () => Date.now()
|
|
10921
|
+
});
|
|
10922
|
+
}, [session]);
|
|
10923
|
+
const send = (message) => {
|
|
10924
|
+
frame.current?.contentWindow?.postMessage({
|
|
10925
|
+
rp: 1,
|
|
10926
|
+
...message
|
|
10927
|
+
}, "*");
|
|
10928
|
+
};
|
|
10929
|
+
(0, react.useEffect)(() => {
|
|
10930
|
+
setReady(false);
|
|
10931
|
+
before.current = void 0;
|
|
10932
|
+
const onMessage = (event) => {
|
|
10933
|
+
if (event.source === null || event.source !== frame.current?.contentWindow) return;
|
|
10934
|
+
const message = parseFrameMessage(event.data);
|
|
10935
|
+
if (message === void 0) return;
|
|
10936
|
+
if (message.type === "hello") setReady(true);
|
|
10937
|
+
else if (message.type === "resize") {
|
|
10938
|
+
if (isStrip(surface)) onResize?.(clampHeight(message.height, surface));
|
|
10939
|
+
} else bridge.answer(message).then((answer) => {
|
|
10940
|
+
send({
|
|
10941
|
+
type: "response",
|
|
10942
|
+
id: message.id,
|
|
10943
|
+
...answer.ok ? {
|
|
10944
|
+
ok: true,
|
|
10945
|
+
value: answer.value
|
|
10946
|
+
} : {
|
|
10947
|
+
ok: false,
|
|
10948
|
+
error: answer.error
|
|
10949
|
+
}
|
|
10950
|
+
});
|
|
10951
|
+
});
|
|
10952
|
+
};
|
|
10953
|
+
window.addEventListener("message", onMessage);
|
|
10954
|
+
return () => {
|
|
10955
|
+
window.removeEventListener("message", onMessage);
|
|
10956
|
+
};
|
|
10957
|
+
}, [
|
|
10958
|
+
bridge,
|
|
10959
|
+
file,
|
|
10960
|
+
pack.revision,
|
|
10961
|
+
onResize,
|
|
10962
|
+
surface
|
|
10963
|
+
]);
|
|
10964
|
+
(0, react.useEffect)(() => {
|
|
10965
|
+
if (!ready) return void 0;
|
|
10966
|
+
const push = () => {
|
|
10967
|
+
send({
|
|
10968
|
+
type: "event",
|
|
10969
|
+
name: "theme",
|
|
10970
|
+
data: readTheme()
|
|
10971
|
+
});
|
|
10972
|
+
};
|
|
10973
|
+
push();
|
|
10974
|
+
return watchTheme(push);
|
|
10975
|
+
}, [ready]);
|
|
10976
|
+
(0, react.useEffect)(() => {
|
|
10977
|
+
if (!ready || view === void 0) return;
|
|
10978
|
+
send({
|
|
10979
|
+
type: "event",
|
|
10980
|
+
name: "state",
|
|
10981
|
+
data: view
|
|
10982
|
+
});
|
|
10983
|
+
const previous = before.current;
|
|
10984
|
+
if (previous !== void 0 && view.story.turn !== previous.story.turn) send({
|
|
10985
|
+
type: "event",
|
|
10986
|
+
name: "turn",
|
|
10987
|
+
data: { turn: view.story.turn }
|
|
10988
|
+
});
|
|
10989
|
+
if (previous !== void 0 && JSON.stringify(view.suggestions) !== JSON.stringify(previous.suggestions)) send({
|
|
10990
|
+
type: "event",
|
|
10991
|
+
name: "suggestions",
|
|
10992
|
+
data: view.suggestions
|
|
10993
|
+
});
|
|
10994
|
+
before.current = view;
|
|
10995
|
+
}, [ready, view]);
|
|
10996
|
+
if (file === void 0) return null;
|
|
10997
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
|
|
10998
|
+
ref: frame,
|
|
10999
|
+
className: `${PackFrame_module_css_default.frame}${fill === true ? ` ${PackFrame_module_css_default.fill}` : ""}`,
|
|
11000
|
+
style: fill === true ? void 0 : { height: `${height ?? pack.surfaces[surface]?.height ?? 56}px` },
|
|
11001
|
+
title,
|
|
11002
|
+
src: frameAddress(pack.frame, file, pack.revision),
|
|
11003
|
+
sandbox: "allow-scripts",
|
|
11004
|
+
referrerPolicy: "no-referrer",
|
|
11005
|
+
"data-rp-frame": surface
|
|
11006
|
+
});
|
|
11007
|
+
}
|
|
11008
|
+
//#endregion
|
|
11009
|
+
//#region src/client/interface/PackDock.tsx
|
|
11010
|
+
/**
|
|
11011
|
+
* A strip of the story's interface pack in the chat: `hud` above the input box and its docks, `dock` just above the
|
|
11012
|
+
* input, `opening` in the place of both until the first turn has been played. The `hud` one also puts the pack's
|
|
11013
|
+
* colours and skin into the page, so that they come with the pack even when it has no strip. Renders nothing for a
|
|
11014
|
+
* story without such a strip.
|
|
11015
|
+
*/
|
|
11016
|
+
function PackDock({ sessionId, surface, frameInput, overrideTokens, useSession, t }) {
|
|
11017
|
+
const session = roleplaySessionOf(sessionId);
|
|
11018
|
+
const pack = usePack(session)?.pack ?? void 0;
|
|
11019
|
+
const strip = pack?.surfaces[surface];
|
|
11020
|
+
const backdrop = surface === "hud" ? pack?.surfaces.backdrop : void 0;
|
|
11021
|
+
const anchor = (0, react.useRef)(null);
|
|
11022
|
+
const layer = useBackdropHost(anchor, backdrop !== void 0);
|
|
11023
|
+
const running = useSession((state) => state.running);
|
|
11024
|
+
const view = usePlayerView(session, strip !== void 0 || backdrop !== void 0);
|
|
11025
|
+
const [height, setHeight] = (0, react.useState)(void 0);
|
|
11026
|
+
const resize = (0, react.useCallback)((next) => {
|
|
11027
|
+
setHeight(next);
|
|
11028
|
+
}, []);
|
|
11029
|
+
(0, react.useEffect)(() => {
|
|
11030
|
+
if (surface !== "hud" || pack === void 0 || pack.skin === "") return void 0;
|
|
11031
|
+
const style = document.createElement("style");
|
|
11032
|
+
style.setAttribute("data-roleplay-pack", pack.id);
|
|
11033
|
+
style.textContent = pack.skin;
|
|
11034
|
+
document.head.append(style);
|
|
11035
|
+
return () => {
|
|
11036
|
+
style.remove();
|
|
11037
|
+
};
|
|
11038
|
+
}, [
|
|
11039
|
+
surface,
|
|
11040
|
+
pack?.id,
|
|
11041
|
+
pack?.skin
|
|
11042
|
+
]);
|
|
11043
|
+
const tokens = pack?.theme;
|
|
11044
|
+
(0, react.useEffect)(() => {
|
|
11045
|
+
if (surface !== "hud" || tokens === void 0 || Object.keys(tokens).length === 0) return void 0;
|
|
11046
|
+
return overrideTokens("roleplay-pack", tokens);
|
|
11047
|
+
}, [
|
|
11048
|
+
surface,
|
|
11049
|
+
tokens,
|
|
11050
|
+
overrideTokens
|
|
11051
|
+
]);
|
|
11052
|
+
if (session === void 0 || pack === void 0) return null;
|
|
11053
|
+
const shown = strip !== void 0 && !(surface === "opening" && (running || view === void 0 || view.story.turn > 0));
|
|
11054
|
+
if (!shown && backdrop === void 0) return null;
|
|
11055
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
11056
|
+
shown && strip !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11057
|
+
className: PackFrame_module_css_default.hud,
|
|
11058
|
+
"data-rp": surface,
|
|
11059
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PackFrame, {
|
|
11060
|
+
session,
|
|
11061
|
+
pack,
|
|
11062
|
+
surface,
|
|
11063
|
+
view,
|
|
11064
|
+
input: frameInput,
|
|
11065
|
+
onResize: resize,
|
|
11066
|
+
...height === void 0 && strip.height === void 0 ? {} : { height: height ?? strip.height },
|
|
11067
|
+
title: t(surface)
|
|
11068
|
+
})
|
|
11069
|
+
}),
|
|
11070
|
+
backdrop !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11071
|
+
ref: anchor,
|
|
11072
|
+
hidden: true
|
|
11073
|
+
}),
|
|
11074
|
+
layer !== void 0 && (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PackFrame, {
|
|
11075
|
+
session,
|
|
11076
|
+
pack,
|
|
11077
|
+
surface: "backdrop",
|
|
11078
|
+
view,
|
|
11079
|
+
input: frameInput,
|
|
11080
|
+
fill: true,
|
|
11081
|
+
title: t("backdrop")
|
|
11082
|
+
}), layer)
|
|
11083
|
+
] });
|
|
11084
|
+
}
|
|
11085
|
+
//#endregion
|
|
11086
|
+
//#region src/client/interface/InterfaceTab.tsx
|
|
11087
|
+
/** The tab of the story's interface pack: a page of its own beside Chat. */
|
|
11088
|
+
function InterfaceTab({ sessionId, frameInput, t }) {
|
|
11089
|
+
const session = roleplaySessionOf(sessionId);
|
|
11090
|
+
const payload = usePack(session);
|
|
11091
|
+
const pack = payload?.pack ?? void 0;
|
|
11092
|
+
const tab = pack?.surfaces.tab;
|
|
11093
|
+
const view = usePlayerView(session, tab !== void 0);
|
|
11094
|
+
if (session === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11095
|
+
className: PackFrame_module_css_default.message,
|
|
11096
|
+
children: t("notRoleplay")
|
|
11097
|
+
});
|
|
11098
|
+
if (payload === void 0) return null;
|
|
11099
|
+
if (pack === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11100
|
+
className: PackFrame_module_css_default.message,
|
|
11101
|
+
children: [payload.problems.length === 0 ? t("noPack") : t("problems"), payload.problems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
11102
|
+
className: PackFrame_module_css_default.problems,
|
|
11103
|
+
children: payload.problems.map((problem, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: problem.file === "" ? problem.message : `${problem.file}: ${problem.message}` }, index))
|
|
11104
|
+
})]
|
|
11105
|
+
});
|
|
11106
|
+
if (tab === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11107
|
+
className: PackFrame_module_css_default.message,
|
|
11108
|
+
children: t("noTab")
|
|
11109
|
+
});
|
|
11110
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11111
|
+
className: PackFrame_module_css_default.tab,
|
|
11112
|
+
"data-rp": "tab",
|
|
11113
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PackFrame, {
|
|
11114
|
+
session,
|
|
11115
|
+
pack,
|
|
11116
|
+
surface: "tab",
|
|
11117
|
+
view,
|
|
11118
|
+
input: frameInput(sessionId),
|
|
11119
|
+
fill: true,
|
|
11120
|
+
title: tab.title === "" ? pack.name : tab.title
|
|
11121
|
+
})
|
|
11122
|
+
});
|
|
11123
|
+
}
|
|
11124
|
+
//#endregion
|
|
11125
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/interface/SidebarPage.module.css.mjs
|
|
11126
|
+
const css$4 = ".rp_Ptco8a_page{flex-direction:column;width:100%;height:100%;min-height:0;display:flex}.rp_Ptco8a_bar{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:4px 8px;display:flex}.rp_Ptco8a_name{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.rp_Ptco8a_content{flex:1 1 0;min-height:0;position:relative}.rp_Ptco8a_message{color:var(--dsw-alias-label-secondary);margin:0;padding:16px;font-size:13px;line-height:20px}.rp_Ptco8a_entry{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsl-guide-entry-radius,var(--dsw-radius-sm));background:var(--dsw-alias-bg-layer-1);align-items:center;gap:14px;width:100%;min-height:56px;padding:14px 20px;display:flex;position:relative;overflow:hidden}.rp_Ptco8a_main{border-radius:0;width:100%;height:100%;position:absolute;inset:0}.rp_Ptco8a_icon{width:26px;height:26px;color:var(--dsw-alias-label-secondary);pointer-events:none;flex:none;justify-content:center;align-items:center;display:flex;position:relative}.rp_Ptco8a_text{pointer-events:none;flex-direction:column;flex:1;gap:3px;min-width:0;display:flex;position:relative}.rp_Ptco8a_title{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:1.4;overflow:hidden}.rp_Ptco8a_description{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.4;overflow:hidden}";
|
|
11127
|
+
const key$4 = "src/client/interface/SidebarPage.module.css";
|
|
11128
|
+
let tag$4 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$4) + "]");
|
|
11129
|
+
if (tag$4 === null) {
|
|
11130
|
+
tag$4 = document.createElement("style");
|
|
11131
|
+
tag$4.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
11132
|
+
tag$4.dataset.pluginCss = key$4;
|
|
11133
|
+
document.head.appendChild(tag$4);
|
|
11134
|
+
}
|
|
11135
|
+
tag$4.textContent = css$4;
|
|
11136
|
+
var SidebarPage_module_css_default = {
|
|
11137
|
+
"bar": "rp_Ptco8a_bar",
|
|
11138
|
+
"name": "rp_Ptco8a_name",
|
|
11139
|
+
"content": "rp_Ptco8a_content",
|
|
11140
|
+
"main": "rp_Ptco8a_main",
|
|
11141
|
+
"page": "rp_Ptco8a_page",
|
|
11142
|
+
"message": "rp_Ptco8a_message",
|
|
11143
|
+
"entry": "rp_Ptco8a_entry",
|
|
11144
|
+
"icon": "rp_Ptco8a_icon",
|
|
11145
|
+
"text": "rp_Ptco8a_text",
|
|
11146
|
+
"title": "rp_Ptco8a_title",
|
|
11147
|
+
"description": "rp_Ptco8a_description"
|
|
11148
|
+
};
|
|
11149
|
+
//#endregion
|
|
11150
|
+
//#region src/client/interface/SidebarPage.tsx
|
|
11151
|
+
/** The kind of the tab type, and the identity it registers its card and body under. */
|
|
11152
|
+
const SIDEBAR_KIND = "roleplay-pack";
|
|
11153
|
+
const SIDEBAR_ID = "@dsh-agentic-roleplay/core/interface-sidebar";
|
|
11154
|
+
/**
|
|
11155
|
+
* The entry of the guide page of the right sidebar that opens the pack's own page, drawn like the entries of DSH's own
|
|
11156
|
+
* pages. It is there only for a story whose pack has such a page, so an ordinary chat's guide is left as it was.
|
|
11157
|
+
*/
|
|
11158
|
+
function SidebarGuide({ sessionId, useTabInfo, description, t }) {
|
|
11159
|
+
const pack = usePack(roleplaySessionOf(sessionId))?.pack ?? void 0;
|
|
11160
|
+
const page = pack?.surfaces.sidebar;
|
|
11161
|
+
const { tab } = useTabInfo();
|
|
11162
|
+
if (pack === void 0 || page === void 0) return null;
|
|
11163
|
+
const title = page.title === "" ? pack.name : page.title;
|
|
11164
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11165
|
+
className: SidebarPage_module_css_default.entry,
|
|
11166
|
+
"data-sidebar-right-guide-entry": SIDEBAR_KIND,
|
|
11167
|
+
children: [
|
|
11168
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11169
|
+
variant: "ghost",
|
|
11170
|
+
className: SidebarPage_module_css_default.main,
|
|
11171
|
+
"aria-label": title,
|
|
11172
|
+
onClick: () => {
|
|
11173
|
+
tab.actions.openTab(SIDEBAR_KIND, { replaceTab: true });
|
|
11174
|
+
}
|
|
11175
|
+
}),
|
|
11176
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11177
|
+
className: SidebarPage_module_css_default.icon,
|
|
11178
|
+
"aria-hidden": "true",
|
|
11179
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconGlobeOutlineRegular, { size: description === void 0 ? 22 : 26 })
|
|
11180
|
+
}),
|
|
11181
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
11182
|
+
className: SidebarPage_module_css_default.text,
|
|
11183
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11184
|
+
className: SidebarPage_module_css_default.title,
|
|
11185
|
+
"aria-hidden": "true",
|
|
11186
|
+
children: title
|
|
11187
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11188
|
+
className: SidebarPage_module_css_default.description,
|
|
11189
|
+
"aria-hidden": "true",
|
|
11190
|
+
children: t("sidebarDescription")
|
|
11191
|
+
})]
|
|
11192
|
+
})
|
|
11193
|
+
]
|
|
11194
|
+
});
|
|
11195
|
+
}
|
|
11196
|
+
/**
|
|
11197
|
+
* The body of the tab: a bar of ours with a way back to the guide, and under it the pack's page, which has the rest of
|
|
11198
|
+
* the sidebar to itself. The page is kept while the tab is hidden, so what it draws goes on between looks.
|
|
11199
|
+
*/
|
|
11200
|
+
function SidebarBody({ sessionId, useTabInfo, frameInput, t }) {
|
|
11201
|
+
const session = roleplaySessionOf(sessionId);
|
|
11202
|
+
const { tab } = useTabInfo();
|
|
11203
|
+
const pack = usePack(session)?.pack ?? void 0;
|
|
11204
|
+
const page = pack?.surfaces.sidebar;
|
|
11205
|
+
const view = usePlayerView(session, tab.visible && page !== void 0);
|
|
11206
|
+
const back = () => {
|
|
11207
|
+
tab.actions.openTab("guide", { replaceTab: true });
|
|
11208
|
+
};
|
|
11209
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11210
|
+
className: SidebarPage_module_css_default.page,
|
|
11211
|
+
"data-rp": "sidebar",
|
|
11212
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11213
|
+
className: SidebarPage_module_css_default.bar,
|
|
11214
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11215
|
+
variant: "ghost",
|
|
11216
|
+
size: "sm",
|
|
11217
|
+
onClick: back,
|
|
11218
|
+
children: ["← ", t("sidebarBack")]
|
|
11219
|
+
}), pack !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11220
|
+
className: SidebarPage_module_css_default.name,
|
|
11221
|
+
children: page?.title === void 0 || page.title === "" ? pack.name : page.title
|
|
11222
|
+
})]
|
|
11223
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11224
|
+
className: SidebarPage_module_css_default.content,
|
|
11225
|
+
children: session === void 0 || pack === void 0 || page === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11226
|
+
className: SidebarPage_module_css_default.message,
|
|
11227
|
+
children: t("sidebarNone")
|
|
11228
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PackFrame, {
|
|
11229
|
+
session,
|
|
11230
|
+
pack,
|
|
11231
|
+
surface: "sidebar",
|
|
11232
|
+
view,
|
|
11233
|
+
input: frameInput,
|
|
11234
|
+
fill: true,
|
|
11235
|
+
title: page.title === "" ? pack.name : page.title
|
|
11236
|
+
})
|
|
11237
|
+
})]
|
|
11238
|
+
});
|
|
11239
|
+
}
|
|
11240
|
+
//#endregion
|
|
11241
|
+
//#region src/client/interface/locales.ts
|
|
11242
|
+
const dictionaries$3 = {
|
|
11243
|
+
en: {
|
|
11244
|
+
tab: "Interface",
|
|
11245
|
+
notRoleplay: "This chat is not a roleplay session.",
|
|
11246
|
+
noPack: "This story has no interface pack. A world can carry one in its ui folder, or you can put one in the ui folder of your roleplay folder and name it in the story's settings.",
|
|
11247
|
+
noTab: "The interface pack of this story has no tab.",
|
|
11248
|
+
problems: "The interface pack cannot be used:",
|
|
11249
|
+
hud: "Status",
|
|
11250
|
+
dock: "Actions",
|
|
11251
|
+
opening: "Opening",
|
|
11252
|
+
backdrop: "Backdrop",
|
|
11253
|
+
sidebar: "Sidebar page",
|
|
11254
|
+
sidebarTitle: "Interface page",
|
|
11255
|
+
sidebarDescription: "A page of this story's interface pack",
|
|
11256
|
+
sidebarBack: "Back",
|
|
11257
|
+
sidebarNone: "This story's interface pack has no page for the sidebar."
|
|
11258
|
+
},
|
|
11259
|
+
zh: {
|
|
11260
|
+
tab: "界面",
|
|
11261
|
+
notRoleplay: "此聊天不是角色扮演会话。",
|
|
11262
|
+
noPack: "此故事没有界面包。世界可以在其 ui 文件夹中携带界面包,也可以把界面包放进角色扮演目录的 ui 文件夹,并在故事设置中指定名称。",
|
|
11263
|
+
noTab: "此故事的界面包没有标签页。",
|
|
11264
|
+
problems: "无法使用界面包:",
|
|
11265
|
+
hud: "状态",
|
|
11266
|
+
dock: "操作",
|
|
11267
|
+
opening: "开场",
|
|
11268
|
+
backdrop: "背景",
|
|
11269
|
+
sidebar: "侧栏页面",
|
|
11270
|
+
sidebarTitle: "界面页面",
|
|
11271
|
+
sidebarDescription: "此故事界面包的一个页面",
|
|
11272
|
+
sidebarBack: "返回",
|
|
11273
|
+
sidebarNone: "此故事的界面包没有侧栏页面。"
|
|
11274
|
+
}
|
|
11275
|
+
};
|
|
11276
|
+
//#endregion
|
|
11277
|
+
//#region src/client/interface/index.ts
|
|
11278
|
+
const NAMESPACE$4 = "roleplay.interface";
|
|
11279
|
+
const VIEW_ID$2 = "roleplay-interface";
|
|
11280
|
+
/** The shell activates a data target for every view tab; the pack's tab reads from the host itself, so its target is empty. */
|
|
11281
|
+
const target = {
|
|
11282
|
+
target: VIEW_ID$2,
|
|
11283
|
+
create: () => ({
|
|
11284
|
+
empty: {},
|
|
11285
|
+
replace: () => ({}),
|
|
11286
|
+
apply: () => ({})
|
|
11287
|
+
})
|
|
11288
|
+
};
|
|
11289
|
+
/**
|
|
11290
|
+
* Interface packs: what a story's files add to the page. The status strip and the pack's colours and skin come with the
|
|
11291
|
+
* dock above the input box; the tab is offered only when some pack has one, which the host is asked when the page loads.
|
|
11292
|
+
*/
|
|
11293
|
+
function registerInterface(ctx) {
|
|
11294
|
+
const t = ctx.locale.bind(NAMESPACE$4);
|
|
11295
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$4, dictionaries$3), "roleplay: interface dictionaries");
|
|
11296
|
+
ctx.inject(["uiConversation"], (scope) => {
|
|
11297
|
+
const input = (sessionId) => {
|
|
11298
|
+
const facade = facadeOf(scope, sessionId);
|
|
11299
|
+
return {
|
|
11300
|
+
say: (text) => {
|
|
11301
|
+
facade.fill(text, true);
|
|
11302
|
+
},
|
|
11303
|
+
fill: (text) => {
|
|
11304
|
+
facade.fill(text, false);
|
|
11305
|
+
},
|
|
11306
|
+
open: (surface) => {
|
|
11307
|
+
if (surface === "sidebar") scope.get("sidebarRight")?.openTab(SIDEBAR_KIND);
|
|
11308
|
+
else scope.uiConversation.binding(sessionId).activate(VIEW_ID$2);
|
|
11309
|
+
}
|
|
11310
|
+
};
|
|
11311
|
+
};
|
|
11312
|
+
const overrideTokens = (source, tokens) => scope.get("theme")?.overrideTokens(source, tokens) ?? (() => void 0);
|
|
11313
|
+
for (const [surface, order] of [
|
|
11314
|
+
["opening", 1],
|
|
11315
|
+
["hud", 3],
|
|
11316
|
+
["dock", 20]
|
|
11317
|
+
]) scope.slots.inject("conversation.input.dock", () => scope.slots.register({
|
|
11318
|
+
name: "conversation.input.dock",
|
|
11319
|
+
id: `roleplay-${surface}`,
|
|
11320
|
+
order,
|
|
11321
|
+
locale: NAMESPACE$4,
|
|
11322
|
+
inject: (sessionId) => ({
|
|
11323
|
+
surface,
|
|
11324
|
+
frameInput: input(sessionId),
|
|
11325
|
+
overrideTokens
|
|
11326
|
+
})
|
|
11327
|
+
}, PackDock));
|
|
11328
|
+
scope.inject(["sidebarRight", "sidebarRightTabs"], (right) => {
|
|
11329
|
+
right.effect(() => right.sidebarRightTabs.register({
|
|
11330
|
+
id: SIDEBAR_ID,
|
|
11331
|
+
kind: SIDEBAR_KIND,
|
|
11332
|
+
keepMounted: true,
|
|
11333
|
+
title: () => t("sidebarTitle"),
|
|
11334
|
+
guide: [{
|
|
11335
|
+
id: "page",
|
|
11336
|
+
order: 30,
|
|
11337
|
+
title: () => t("sidebarTitle"),
|
|
11338
|
+
description: () => t("sidebarDescription"),
|
|
11339
|
+
icon: _deepseek_ai_dsh_client_ui_primitives.IconGlobeOutlineRegular
|
|
11340
|
+
}]
|
|
11341
|
+
}), "roleplay: sidebar tab type");
|
|
11342
|
+
right.effect(() => right.slots.inject("sidebar.right.tab.guide.entry", () => right.slots.register({
|
|
11343
|
+
name: "sidebar.right.tab.guide.entry",
|
|
11344
|
+
key: SIDEBAR_ID,
|
|
11345
|
+
locale: NAMESPACE$4,
|
|
11346
|
+
inject: (sessionId) => ({ sessionId })
|
|
11347
|
+
}, SidebarGuide)), "roleplay: sidebar guide entry");
|
|
11348
|
+
right.effect(() => right.slots.inject("sidebar.right.pane.tab", () => right.slots.register({
|
|
11349
|
+
name: "sidebar.right.pane.tab",
|
|
11350
|
+
key: SIDEBAR_ID,
|
|
11351
|
+
locale: NAMESPACE$4,
|
|
11352
|
+
inject: (sessionId) => ({
|
|
11353
|
+
sessionId,
|
|
11354
|
+
frameInput: input(sessionId)
|
|
11355
|
+
})
|
|
11356
|
+
}, SidebarBody)), "roleplay: sidebar body");
|
|
11357
|
+
});
|
|
11358
|
+
let offered = false;
|
|
11359
|
+
availability().then((found) => {
|
|
11360
|
+
if (!found.tab || offered) return;
|
|
11361
|
+
offered = true;
|
|
11362
|
+
scope.uiConversation.views.register(target);
|
|
11363
|
+
scope.slots.inject("conversation.view", () => scope.slots.register({
|
|
11364
|
+
name: "conversation.view",
|
|
11365
|
+
id: VIEW_ID$2,
|
|
11366
|
+
order: 18,
|
|
11367
|
+
label: () => t("tab"),
|
|
11368
|
+
locale: NAMESPACE$4,
|
|
11369
|
+
inject: () => ({ frameInput: input })
|
|
11370
|
+
}, InterfaceTab));
|
|
11371
|
+
}).catch((error) => {
|
|
11372
|
+
console.warn("roleplay: the interface packs could not be looked up", error);
|
|
11373
|
+
});
|
|
11374
|
+
});
|
|
11375
|
+
}
|
|
11376
|
+
//#endregion
|
|
11377
|
+
//#region src/shared/authoring-chat.ts
|
|
11378
|
+
const PREFIX = "world-author-";
|
|
11379
|
+
/** The authored world named by a dedicated authoring chat. */
|
|
11380
|
+
function authoredWorldOf(chatSessionId) {
|
|
11381
|
+
if (!chatSessionId.startsWith(PREFIX)) return void 0;
|
|
11382
|
+
try {
|
|
11383
|
+
const id = decodeURIComponent(chatSessionId.slice(13));
|
|
11384
|
+
return id === "" ? void 0 : id;
|
|
11385
|
+
} catch {
|
|
11386
|
+
return;
|
|
11387
|
+
}
|
|
11388
|
+
}
|
|
11389
|
+
//#endregion
|
|
11390
|
+
//#region src/client/world/session-source.ts
|
|
11391
|
+
/** The story of a roleplay session, as the World tab reads and edits it. */
|
|
11392
|
+
function sessionSource(session) {
|
|
11393
|
+
const id = encodeURIComponent(session);
|
|
11394
|
+
return {
|
|
11395
|
+
load: async (signal) => await answer$2(await fetch(`${API_PREFIX}/sessions/world?id=${id}`, {
|
|
11396
|
+
credentials: "same-origin",
|
|
11397
|
+
signal
|
|
11398
|
+
})),
|
|
11399
|
+
saveCharacter: async (key, edit, signal) => await put(`${API_PREFIX}/sessions/world/character?id=${id}&key=${encodeURIComponent(key)}`, edit, signal),
|
|
11400
|
+
savePlace: async (key, edit, signal) => await put(`${API_PREFIX}/sessions/world/place?id=${id}&key=${encodeURIComponent(key)}`, edit, signal),
|
|
11401
|
+
saveThing: async (key, edit, signal) => await put(`${API_PREFIX}/sessions/world/thing?id=${id}&key=${encodeURIComponent(key)}`, edit, signal),
|
|
11402
|
+
saveFaction: async (key, edit, signal) => await put(`${API_PREFIX}/sessions/world/faction?id=${id}&key=${encodeURIComponent(key)}`, edit, signal),
|
|
11403
|
+
saveLore: async (key, edit, signal) => await put(`${API_PREFIX}/sessions/world/lore?id=${id}&key=${encodeURIComponent(key)}`, edit, signal),
|
|
11404
|
+
savePlots: async (edit, signal) => await put(`${API_PREFIX}/sessions/world/plots?id=${id}`, edit, signal),
|
|
11405
|
+
saveRelation: async (edit, signal) => await put(`${API_PREFIX}/sessions/world/relation?id=${id}`, edit, signal),
|
|
11406
|
+
saveNarrationVoice: async (voice, signal) => await put(`${API_PREFIX}/sessions/world/narration-voice?id=${id}`, { voice }, signal),
|
|
11407
|
+
listVoices: async (signal) => await listVoices(`${API_PREFIX}/speech/voices`, signal),
|
|
11408
|
+
generatePortrait: async (key, signal) => await post(`${API_PREFIX}/sessions/world/character/portrait?id=${id}&key=${encodeURIComponent(key)}`, signal),
|
|
11409
|
+
uploadPortrait: async (key, file, signal) => await postFile(`${API_PREFIX}/sessions/world/character/portrait/upload?id=${id}&key=${encodeURIComponent(key)}`, file, signal)
|
|
11410
|
+
};
|
|
11411
|
+
}
|
|
11412
|
+
//#endregion
|
|
11413
|
+
//#region src/client/world/WorldTab.tsx
|
|
11414
|
+
/** The story of the current chat, to read and to author. Ordinary DSH chats have ids of the same shape, so the host decides whether this one is a roleplay session. */
|
|
11415
|
+
function WorldTab({ t, sessionId }) {
|
|
11416
|
+
const session = roleplaySessionOf(sessionId);
|
|
11417
|
+
const world = authoredWorldOf(sessionId);
|
|
11418
|
+
const source = (0, react.useMemo)(() => session !== void 0 ? sessionSource(session) : world !== void 0 ? worldSource(world) : void 0, [session, world]);
|
|
11419
|
+
if (source === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11420
|
+
style: {
|
|
11421
|
+
padding: 24,
|
|
11422
|
+
fontSize: 13
|
|
11423
|
+
},
|
|
11424
|
+
children: t("notRoleplay")
|
|
11425
|
+
});
|
|
11426
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorldEditor, {
|
|
11427
|
+
t,
|
|
11428
|
+
source,
|
|
11429
|
+
notEditable: t("notRoleplay")
|
|
11430
|
+
});
|
|
11431
|
+
}
|
|
11432
|
+
//#endregion
|
|
11433
|
+
//#region src/client/world/index.ts
|
|
11434
|
+
const NAMESPACE$3 = "roleplay.world";
|
|
11435
|
+
const VIEW_ID$1 = "roleplay-world";
|
|
11436
|
+
/** The shell activates a data target for every view tab; this tab reads from the host itself, so its target is empty. */
|
|
11437
|
+
const worldTarget = {
|
|
11438
|
+
target: VIEW_ID$1,
|
|
11439
|
+
create: () => ({
|
|
11440
|
+
empty: {},
|
|
11441
|
+
replace: () => ({}),
|
|
11442
|
+
apply: () => ({})
|
|
10157
11443
|
})
|
|
10158
11444
|
};
|
|
10159
11445
|
/** Adds the World tab beside Chat: the state of the story, by the part of the world. */
|
|
10160
11446
|
function registerWorld(ctx) {
|
|
10161
11447
|
const t = ctx.locale.bind(NAMESPACE$3);
|
|
10162
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$3, dictionaries$
|
|
11448
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$3, dictionaries$9), "roleplay: world dictionaries");
|
|
10163
11449
|
ctx.inject(["uiConversation"], (scope) => {
|
|
10164
11450
|
scope.uiConversation.views.register(worldTarget);
|
|
10165
11451
|
scope.slots.inject("conversation.view", () => scope.slots.register({
|
|
@@ -10172,8 +11458,8 @@ window.__ModuleLoader__.load({
|
|
|
10172
11458
|
});
|
|
10173
11459
|
}
|
|
10174
11460
|
//#endregion
|
|
10175
|
-
//#region \0css-module:/home/
|
|
10176
|
-
const css$3 = ".
|
|
11461
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/chat-settings/ChatSettingsView.module.css.mjs
|
|
11462
|
+
const css$3 = ".rp_wLpbxW_view{box-sizing:border-box;flex-direction:column;gap:16px;width:100%;max-width:640px;margin:0 auto;padding:24px 24px 240px;display:flex}.rp_wLpbxW_title{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_wLpbxW_description{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_wLpbxW_field{flex-direction:column;gap:6px;max-width:200px;display:flex}.rp_wLpbxW_label{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_wLpbxW_help{max-width:560px;color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_wLpbxW_actions{align-items:center;gap:12px;display:flex}.rp_wLpbxW_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:40px 0;font-size:13px}.rp_wLpbxW_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_wLpbxW_saved{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_wLpbxW_row{flex-direction:column;gap:6px;display:flex}.rp_wLpbxW_notice{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);margin:0;padding:8px 12px;font-size:12px}.rp_wLpbxW_activity{color:var(--dsw-alias-label-secondary);flex-direction:column;gap:6px;font-size:13px;display:flex}.rp_wLpbxW_activity summary{cursor:pointer;color:var(--dsw-alias-label-primary);font-weight:500}.rp_wLpbxW_link{font:inherit;color:var(--dsw-alias-state-business-primary);cursor:pointer;background:0 0;border:0;align-self:flex-start;padding:0;font-size:12px}.rp_wLpbxW_table{border-collapse:collapse;width:100%;font-size:12px}.rp_wLpbxW_table th,.rp_wLpbxW_table td{border-bottom:1px solid var(--dsw-alias-border-l4);text-align:left;vertical-align:top;overflow-wrap:anywhere;padding:3px 8px 3px 0}.rp_wLpbxW_table th{color:var(--dsw-alias-label-tertiary);font-weight:400}.rp_wLpbxW_table th:first-child,.rp_wLpbxW_table td:first-child,.rp_wLpbxW_table th:nth-child(3),.rp_wLpbxW_table td:nth-child(3),.rp_wLpbxW_table th:nth-child(4),.rp_wLpbxW_table td:nth-child(4),.rp_wLpbxW_table th:nth-child(5),.rp_wLpbxW_table td:nth-child(5){white-space:nowrap}.rp_wLpbxW_run{flex-direction:column;gap:4px;padding:4px 0 8px;display:flex}.rp_wLpbxW_pre{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;margin:4px 0;padding:6px 8px;font-size:12px;overflow:auto}.rp_wLpbxW_reasons{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;margin:4px 0;padding-left:20px;font-size:12px}.rp_wLpbxW_select{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;max-width:320px;height:28px;color:var(--dsw-alias-label-primary);font:inherit;padding:0 8px;font-size:13px}.rp_wLpbxW_list{color:var(--dsw-alias-label-tertiary);margin:0;padding-left:18px;font-size:12px;line-height:18px}";
|
|
10177
11463
|
const key$3 = "src/client/chat-settings/ChatSettingsView.module.css";
|
|
10178
11464
|
let tag$3 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$3) + "]");
|
|
10179
11465
|
if (tag$3 === null) {
|
|
@@ -10184,18 +11470,26 @@ window.__ModuleLoader__.load({
|
|
|
10184
11470
|
}
|
|
10185
11471
|
tag$3.textContent = css$3;
|
|
10186
11472
|
var ChatSettingsView_module_css_default = {
|
|
10187
|
-
"
|
|
10188
|
-
"
|
|
10189
|
-
"
|
|
10190
|
-
"
|
|
10191
|
-
"view": "
|
|
10192
|
-
"
|
|
10193
|
-
"
|
|
10194
|
-
"label": "
|
|
10195
|
-
"
|
|
10196
|
-
"
|
|
10197
|
-
"
|
|
10198
|
-
"
|
|
11473
|
+
"title": "rp_wLpbxW_title",
|
|
11474
|
+
"pre": "rp_wLpbxW_pre",
|
|
11475
|
+
"select": "rp_wLpbxW_select",
|
|
11476
|
+
"table": "rp_wLpbxW_table",
|
|
11477
|
+
"view": "rp_wLpbxW_view",
|
|
11478
|
+
"field": "rp_wLpbxW_field",
|
|
11479
|
+
"row": "rp_wLpbxW_row",
|
|
11480
|
+
"label": "rp_wLpbxW_label",
|
|
11481
|
+
"help": "rp_wLpbxW_help",
|
|
11482
|
+
"run": "rp_wLpbxW_run",
|
|
11483
|
+
"saved": "rp_wLpbxW_saved",
|
|
11484
|
+
"description": "rp_wLpbxW_description",
|
|
11485
|
+
"message": "rp_wLpbxW_message",
|
|
11486
|
+
"link": "rp_wLpbxW_link",
|
|
11487
|
+
"notice": "rp_wLpbxW_notice",
|
|
11488
|
+
"activity": "rp_wLpbxW_activity",
|
|
11489
|
+
"reasons": "rp_wLpbxW_reasons",
|
|
11490
|
+
"list": "rp_wLpbxW_list",
|
|
11491
|
+
"error": "rp_wLpbxW_error",
|
|
11492
|
+
"actions": "rp_wLpbxW_actions"
|
|
10199
11493
|
};
|
|
10200
11494
|
//#endregion
|
|
10201
11495
|
//#region src/client/chat-settings/settings-api.ts
|
|
@@ -10227,6 +11521,453 @@ window.__ModuleLoader__.load({
|
|
|
10227
11521
|
signal
|
|
10228
11522
|
}));
|
|
10229
11523
|
}
|
|
11524
|
+
/** Forgets the chat's stored search vectors. */
|
|
11525
|
+
async function resetVectors(id, signal) {
|
|
11526
|
+
const response = await fetch(`${API_PREFIX}/sessions/vectors/reset?id=${encodeURIComponent(id)}`, {
|
|
11527
|
+
method: "POST",
|
|
11528
|
+
credentials: "same-origin",
|
|
11529
|
+
signal
|
|
11530
|
+
});
|
|
11531
|
+
if (!response.ok) throw new Error(`${response.status} ${response.statusText}`.trim());
|
|
11532
|
+
}
|
|
11533
|
+
/** What a helper run was told and did; nothing when the run was not kept or has been dropped. */
|
|
11534
|
+
async function loadRun(id, run, signal) {
|
|
11535
|
+
const response = await fetch(`${API_PREFIX}/sessions/activity/run?id=${encodeURIComponent(id)}&run=${encodeURIComponent(run)}`, {
|
|
11536
|
+
credentials: "same-origin",
|
|
11537
|
+
signal
|
|
11538
|
+
});
|
|
11539
|
+
if (response.status === 404) return void 0;
|
|
11540
|
+
if (!response.ok) throw new Error(`${response.status} ${response.statusText}`.trim());
|
|
11541
|
+
return await response.json();
|
|
11542
|
+
}
|
|
11543
|
+
async function interfaceReply(response) {
|
|
11544
|
+
if (!response.ok) {
|
|
11545
|
+
const body = await response.json().catch(() => void 0);
|
|
11546
|
+
const problems = Array.isArray(body?.problems) ? body.problems.map((problem) => `${problem.path ?? ""} ${problem.message ?? ""}`.trim()).join("; ") : "";
|
|
11547
|
+
throw new Error(`${typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim()}${problems === "" ? "" : ` (${problems})`}`);
|
|
11548
|
+
}
|
|
11549
|
+
return await response.json();
|
|
11550
|
+
}
|
|
11551
|
+
/** The interface pack of the chat's story: the one in use, the ones it could use, and how the world's compare with its copies. */
|
|
11552
|
+
async function loadInterfaceStatus(id, signal) {
|
|
11553
|
+
return await interfaceReply(await fetch(`${API_PREFIX}/sessions/interface/status?id=${encodeURIComponent(id)}`, {
|
|
11554
|
+
credentials: "same-origin",
|
|
11555
|
+
signal
|
|
11556
|
+
}));
|
|
11557
|
+
}
|
|
11558
|
+
/** Brings the world's interface packs into the chat's story. */
|
|
11559
|
+
async function syncInterface(id, signal) {
|
|
11560
|
+
return await interfaceReply(await fetch(`${API_PREFIX}/sessions/interface/sync?id=${encodeURIComponent(id)}`, {
|
|
11561
|
+
method: "POST",
|
|
11562
|
+
credentials: "same-origin",
|
|
11563
|
+
signal
|
|
11564
|
+
}));
|
|
11565
|
+
}
|
|
11566
|
+
//#endregion
|
|
11567
|
+
//#region src/client/chat-settings/InterfaceSection.tsx
|
|
11568
|
+
const message = (failure) => failure instanceof Error ? failure.message : String(failure);
|
|
11569
|
+
/**
|
|
11570
|
+
* The interface pack of the story: which one is in use or why none is, a choice of the packs the story could use (kept
|
|
11571
|
+
* with the other settings, so it is saved with them), and, when the world's packs are not what the story copied, a way
|
|
11572
|
+
* to bring them in.
|
|
11573
|
+
*/
|
|
11574
|
+
function InterfaceSection({ t, session, value, onChange, saved, disabled }) {
|
|
11575
|
+
const [status, setStatus] = (0, react.useState)(void 0);
|
|
11576
|
+
const [failure, setFailure] = (0, react.useState)(void 0);
|
|
11577
|
+
const [report, setReport] = (0, react.useState)(void 0);
|
|
11578
|
+
const [sure, setSure] = (0, react.useState)(false);
|
|
11579
|
+
const [version, setVersion] = (0, react.useState)(0);
|
|
11580
|
+
(0, react.useEffect)(() => {
|
|
11581
|
+
const abort = new AbortController();
|
|
11582
|
+
loadInterfaceStatus(session, abort.signal).then((next) => {
|
|
11583
|
+
setStatus(next);
|
|
11584
|
+
setFailure(void 0);
|
|
11585
|
+
}, (error) => {
|
|
11586
|
+
if (!abort.signal.aborted) setFailure(message(error));
|
|
11587
|
+
});
|
|
11588
|
+
return () => {
|
|
11589
|
+
abort.abort();
|
|
11590
|
+
};
|
|
11591
|
+
}, [
|
|
11592
|
+
session,
|
|
11593
|
+
saved,
|
|
11594
|
+
version
|
|
11595
|
+
]);
|
|
11596
|
+
const update = () => {
|
|
11597
|
+
setSure(false);
|
|
11598
|
+
syncInterface(session, new AbortController().signal).then((done) => {
|
|
11599
|
+
setReport(t("packUpdated", {
|
|
11600
|
+
updated: done.updated.join(", ") || "-",
|
|
11601
|
+
added: done.added.join(", ") || "-"
|
|
11602
|
+
}));
|
|
11603
|
+
setFailure(void 0);
|
|
11604
|
+
setVersion((number) => number + 1);
|
|
11605
|
+
}, (error) => {
|
|
11606
|
+
setReport(void 0);
|
|
11607
|
+
setFailure(t("packSyncFailed", { message: message(error) }));
|
|
11608
|
+
});
|
|
11609
|
+
};
|
|
11610
|
+
if (status === void 0) return failure === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11611
|
+
className: ChatSettingsView_module_css_default.error,
|
|
11612
|
+
role: "alert",
|
|
11613
|
+
children: t("packLoadFailed", { message: failure })
|
|
11614
|
+
});
|
|
11615
|
+
const inUse = status.available.find((entry) => entry.id === status.active);
|
|
11616
|
+
const changed = status.world?.packs.filter((entry) => entry.state === "different").map((entry) => entry.id) ?? [];
|
|
11617
|
+
const fresh = status.world?.packs.filter((entry) => entry.state === "new").map((entry) => entry.id) ?? [];
|
|
11618
|
+
const broken = status.world?.packs.filter((entry) => entry.problems.length > 0).map((entry) => entry.id) ?? [];
|
|
11619
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
11620
|
+
className: ChatSettingsView_module_css_default.activity,
|
|
11621
|
+
"data-testid": "roleplay-interface-pack",
|
|
11622
|
+
children: [
|
|
11623
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("packTitle") }),
|
|
11624
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11625
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11626
|
+
children: t("packHelp")
|
|
11627
|
+
}),
|
|
11628
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11629
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11630
|
+
children: status.setting === "none" ? t("packOff") : inUse === void 0 ? t("packNone") : t("packActive", { name: inUse.name })
|
|
11631
|
+
}),
|
|
11632
|
+
inUse !== void 0 && inUse.surfaces.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11633
|
+
className: ChatSettingsView_module_css_default.help,
|
|
11634
|
+
children: t("packSurfaces", { surfaces: inUse.surfaces.join(", ") })
|
|
11635
|
+
}),
|
|
11636
|
+
status.problems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11637
|
+
role: "alert",
|
|
11638
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11639
|
+
className: ChatSettingsView_module_css_default.error,
|
|
11640
|
+
children: t("packProblems")
|
|
11641
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
11642
|
+
className: ChatSettingsView_module_css_default.list,
|
|
11643
|
+
children: status.problems.map((problem, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: problem.file === "" ? problem.message : `${problem.file}: ${problem.message}` }, index))
|
|
11644
|
+
})]
|
|
11645
|
+
}),
|
|
11646
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
11647
|
+
className: ChatSettingsView_module_css_default.field,
|
|
11648
|
+
style: { maxWidth: "none" },
|
|
11649
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11650
|
+
className: ChatSettingsView_module_css_default.label,
|
|
11651
|
+
children: t("packChoose")
|
|
11652
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
11653
|
+
className: ChatSettingsView_module_css_default.select,
|
|
11654
|
+
value,
|
|
11655
|
+
disabled,
|
|
11656
|
+
onChange: (event) => {
|
|
11657
|
+
onChange(event.target.value);
|
|
11658
|
+
},
|
|
11659
|
+
children: [
|
|
11660
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
11661
|
+
value: "",
|
|
11662
|
+
children: t("packFirst")
|
|
11663
|
+
}),
|
|
11664
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
11665
|
+
value: "none",
|
|
11666
|
+
children: t("packPlain")
|
|
11667
|
+
}),
|
|
11668
|
+
status.available.map((entry) => {
|
|
11669
|
+
const name = status.available.filter((other) => other.name === entry.name).length > 1 ? `${entry.name} — ${entry.id}` : entry.name;
|
|
11670
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
11671
|
+
value: entry.id,
|
|
11672
|
+
children: entry.problems.length > 0 ? t("packBroken", { name }) : entry.from === "root" ? t("packFromRoot", { name }) : name
|
|
11673
|
+
}, entry.id);
|
|
11674
|
+
})
|
|
11675
|
+
]
|
|
11676
|
+
})]
|
|
11677
|
+
}),
|
|
11678
|
+
changed.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11679
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11680
|
+
children: t("packWorldChanged", { names: changed.join(", ") })
|
|
11681
|
+
}),
|
|
11682
|
+
fresh.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11683
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11684
|
+
children: t("packWorldNew", { names: fresh.join(", ") })
|
|
11685
|
+
}),
|
|
11686
|
+
broken.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11687
|
+
className: ChatSettingsView_module_css_default.error,
|
|
11688
|
+
children: t("packWorldProblems", { names: broken.join(", ") })
|
|
11689
|
+
}),
|
|
11690
|
+
(changed.length > 0 || fresh.length > 0) && broken.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11691
|
+
variant: "ghost",
|
|
11692
|
+
size: "sm",
|
|
11693
|
+
disabled,
|
|
11694
|
+
onClick: () => {
|
|
11695
|
+
if (sure) update();
|
|
11696
|
+
else setSure(true);
|
|
11697
|
+
},
|
|
11698
|
+
children: sure ? t("packUpdateConfirm") : t("packUpdate")
|
|
11699
|
+
}), sure && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
11700
|
+
type: "button",
|
|
11701
|
+
className: ChatSettingsView_module_css_default.link,
|
|
11702
|
+
onClick: () => {
|
|
11703
|
+
setSure(false);
|
|
11704
|
+
},
|
|
11705
|
+
children: t("vectorsCancel")
|
|
11706
|
+
})] }),
|
|
11707
|
+
report !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11708
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11709
|
+
role: "status",
|
|
11710
|
+
children: report
|
|
11711
|
+
}),
|
|
11712
|
+
failure !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11713
|
+
className: ChatSettingsView_module_css_default.error,
|
|
11714
|
+
role: "alert",
|
|
11715
|
+
children: failure
|
|
11716
|
+
})
|
|
11717
|
+
]
|
|
11718
|
+
});
|
|
11719
|
+
}
|
|
11720
|
+
//#endregion
|
|
11721
|
+
//#region src/client/chat-settings/VectorsSection.tsx
|
|
11722
|
+
/** What the search by meaning stands on, and a way to start it again with another embedding model. */
|
|
11723
|
+
function VectorsSection({ t, status, onReset, disabled }) {
|
|
11724
|
+
const [sure, setSure] = (0, react.useState)(false);
|
|
11725
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
11726
|
+
className: ChatSettingsView_module_css_default.activity,
|
|
11727
|
+
"data-testid": "roleplay-vectors",
|
|
11728
|
+
children: [
|
|
11729
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("vectorsTitle") }),
|
|
11730
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11731
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11732
|
+
children: !status.available ? t("vectorsUnavailable") : status.model === void 0 ? t("vectorsNone", { pending: status.pending }) : t("vectorsStored", {
|
|
11733
|
+
model: status.model,
|
|
11734
|
+
dimensions: status.dimensions ?? 0,
|
|
11735
|
+
embedded: status.embedded,
|
|
11736
|
+
pending: status.pending
|
|
11737
|
+
})
|
|
11738
|
+
}),
|
|
11739
|
+
status.model !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
11740
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11741
|
+
variant: "ghost",
|
|
11742
|
+
size: "sm",
|
|
11743
|
+
disabled,
|
|
11744
|
+
onClick: () => {
|
|
11745
|
+
if (sure) {
|
|
11746
|
+
setSure(false);
|
|
11747
|
+
onReset();
|
|
11748
|
+
} else setSure(true);
|
|
11749
|
+
},
|
|
11750
|
+
children: sure ? t("vectorsConfirm") : t("vectorsReset")
|
|
11751
|
+
}),
|
|
11752
|
+
sure && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
11753
|
+
type: "button",
|
|
11754
|
+
className: ChatSettingsView_module_css_default.link,
|
|
11755
|
+
onClick: () => {
|
|
11756
|
+
setSure(false);
|
|
11757
|
+
},
|
|
11758
|
+
children: t("vectorsCancel")
|
|
11759
|
+
}),
|
|
11760
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11761
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11762
|
+
children: t("vectorsHelp")
|
|
11763
|
+
})
|
|
11764
|
+
] })
|
|
11765
|
+
]
|
|
11766
|
+
});
|
|
11767
|
+
}
|
|
11768
|
+
//#endregion
|
|
11769
|
+
//#region src/client/chat-settings/ActivityList.tsx
|
|
11770
|
+
const seconds = (ms) => `${(ms / 1e3).toFixed(ms < 1e4 ? 1 : 0)} s`;
|
|
11771
|
+
/** What the story's helper agents did lately and how long it took, newest first, to see where a slow turn went or why a helper gave up. */
|
|
11772
|
+
function ActivityList({ t, session, entries, onRefresh }) {
|
|
11773
|
+
const shown = entries.slice(-20).reverse();
|
|
11774
|
+
const [open, setOpen] = (0, react.useState)();
|
|
11775
|
+
const toggle = (run) => {
|
|
11776
|
+
if (open?.run === run) {
|
|
11777
|
+
setOpen(void 0);
|
|
11778
|
+
return;
|
|
11779
|
+
}
|
|
11780
|
+
setOpen({
|
|
11781
|
+
run,
|
|
11782
|
+
detail: "loading"
|
|
11783
|
+
});
|
|
11784
|
+
loadRun(session, run, new AbortController().signal).then((detail) => {
|
|
11785
|
+
setOpen((current) => current?.run === run ? {
|
|
11786
|
+
run,
|
|
11787
|
+
detail: detail ?? "gone"
|
|
11788
|
+
} : current);
|
|
11789
|
+
}, (failure) => {
|
|
11790
|
+
setOpen((current) => current?.run === run ? {
|
|
11791
|
+
run,
|
|
11792
|
+
detail: { error: failure instanceof Error ? failure.message : String(failure) }
|
|
11793
|
+
} : current);
|
|
11794
|
+
});
|
|
11795
|
+
};
|
|
11796
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
11797
|
+
className: ChatSettingsView_module_css_default.activity,
|
|
11798
|
+
"data-testid": "roleplay-activity",
|
|
11799
|
+
children: [
|
|
11800
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("activityTitle") }),
|
|
11801
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11802
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11803
|
+
children: t("activityHelp")
|
|
11804
|
+
}),
|
|
11805
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
11806
|
+
type: "button",
|
|
11807
|
+
className: ChatSettingsView_module_css_default.link,
|
|
11808
|
+
onClick: onRefresh,
|
|
11809
|
+
children: t("activityRefresh")
|
|
11810
|
+
}),
|
|
11811
|
+
shown.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11812
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11813
|
+
children: t("activityEmpty")
|
|
11814
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
|
|
11815
|
+
className: ChatSettingsView_module_css_default.table,
|
|
11816
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
11817
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityWhen") }),
|
|
11818
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityHelper") }),
|
|
11819
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityModel") }),
|
|
11820
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityTook") }),
|
|
11821
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityCalls") }),
|
|
11822
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityResult") }),
|
|
11823
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {})
|
|
11824
|
+
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: shown.flatMap((entry) => [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
11825
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: new Date(entry.at).toLocaleTimeString() }),
|
|
11826
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.label }),
|
|
11827
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.model === "" ? t("activityOwnModel") : entry.model }),
|
|
11828
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: seconds(entry.ms) }),
|
|
11829
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.calls }),
|
|
11830
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
11831
|
+
className: entry.error === void 0 ? void 0 : ChatSettingsView_module_css_default.error,
|
|
11832
|
+
title: entry.error,
|
|
11833
|
+
children: entry.error === void 0 ? t("activityDone") : t("activityFailed", { reason: entry.error })
|
|
11834
|
+
}),
|
|
11835
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.run === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
11836
|
+
type: "button",
|
|
11837
|
+
className: ChatSettingsView_module_css_default.link,
|
|
11838
|
+
onClick: () => {
|
|
11839
|
+
toggle(entry.run);
|
|
11840
|
+
},
|
|
11841
|
+
children: open?.run === entry.run ? t("runHide") : t("runShow")
|
|
11842
|
+
}) })
|
|
11843
|
+
] }, `${entry.at}-${entry.label}`), ...entry.run !== void 0 && open?.run === entry.run ? [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
11844
|
+
colSpan: 7,
|
|
11845
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RunView, {
|
|
11846
|
+
t,
|
|
11847
|
+
detail: open.detail
|
|
11848
|
+
})
|
|
11849
|
+
}) }, `${entry.at}-${entry.label}-run`)] : []]) })]
|
|
11850
|
+
})
|
|
11851
|
+
]
|
|
11852
|
+
});
|
|
11853
|
+
}
|
|
11854
|
+
function RunView({ t, detail }) {
|
|
11855
|
+
if (detail === "loading") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11856
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11857
|
+
children: t("loading")
|
|
11858
|
+
});
|
|
11859
|
+
if (detail === "gone") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11860
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11861
|
+
children: t("runGone")
|
|
11862
|
+
});
|
|
11863
|
+
if ("error" in detail) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11864
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11865
|
+
role: "alert",
|
|
11866
|
+
children: t("runFailed", { message: detail.error })
|
|
11867
|
+
});
|
|
11868
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11869
|
+
className: ChatSettingsView_module_css_default.run,
|
|
11870
|
+
"data-testid": "roleplay-run",
|
|
11871
|
+
children: [
|
|
11872
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("runPersona") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
11873
|
+
className: ChatSettingsView_module_css_default.pre,
|
|
11874
|
+
children: detail.persona
|
|
11875
|
+
})] }),
|
|
11876
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
11877
|
+
open: true,
|
|
11878
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("runPrompt") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
11879
|
+
className: ChatSettingsView_module_css_default.pre,
|
|
11880
|
+
children: detail.prompt
|
|
11881
|
+
})]
|
|
11882
|
+
}),
|
|
11883
|
+
detail.recalled !== void 0 && detail.recalled.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("runRecalled") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
11884
|
+
className: ChatSettingsView_module_css_default.reasons,
|
|
11885
|
+
"data-testid": "roleplay-run-recalled",
|
|
11886
|
+
children: detail.recalled.map((memory, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [
|
|
11887
|
+
`${memory.clarity}, turn ${memory.turn}: ${memory.text}`,
|
|
11888
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}),
|
|
11889
|
+
whyText(t, memory.why)
|
|
11890
|
+
] }, index))
|
|
11891
|
+
})] }),
|
|
11892
|
+
detail.calls.map((call, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { children: [
|
|
11893
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
|
|
11894
|
+
className: call.failed ? ChatSettingsView_module_css_default.error : void 0,
|
|
11895
|
+
children: `${index + 1}. ${call.tool}${call.failed ? ` (${t("runRefused")})` : ""}`
|
|
11896
|
+
}),
|
|
11897
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
11898
|
+
className: ChatSettingsView_module_css_default.pre,
|
|
11899
|
+
children: call.args
|
|
11900
|
+
}),
|
|
11901
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
11902
|
+
className: ChatSettingsView_module_css_default.pre,
|
|
11903
|
+
children: call.outcome
|
|
11904
|
+
})
|
|
11905
|
+
] }, index)),
|
|
11906
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("runResult") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
11907
|
+
className: ChatSettingsView_module_css_default.pre,
|
|
11908
|
+
children: detail.result ?? t("runNoResult")
|
|
11909
|
+
})] })
|
|
11910
|
+
]
|
|
11911
|
+
});
|
|
11912
|
+
}
|
|
11913
|
+
const figure = (value) => (Math.round(value * 100) / 100).toString();
|
|
11914
|
+
/** The reasons a thing came back, one short line. */
|
|
11915
|
+
function whyText(t, why) {
|
|
11916
|
+
if (why === void 0) return "";
|
|
11917
|
+
return [
|
|
11918
|
+
t("whyCues", {
|
|
11919
|
+
people: figure(why.cues.people),
|
|
11920
|
+
words: figure(why.cues.words),
|
|
11921
|
+
place: figure(why.cues.place)
|
|
11922
|
+
}),
|
|
11923
|
+
...why.lexical === void 0 ? [] : [t("whyIndex", { value: figure(why.lexical) })],
|
|
11924
|
+
...why.dense === void 0 ? [] : [t("whyMeaning", { value: figure(why.dense) })],
|
|
11925
|
+
...why.rerank === void 0 ? [] : [t("whyRerank", { value: figure(why.rerank) })],
|
|
11926
|
+
t("whyMatters", { value: why.importance }),
|
|
11927
|
+
t("whyAge", { value: figure(why.ageDays) }),
|
|
11928
|
+
...why.retention === void 0 ? [] : [t("whyKept", { value: figure(why.retention) })],
|
|
11929
|
+
t("whyScore", { value: figure(why.score) }),
|
|
11930
|
+
...why.linked === void 0 ? [] : [t("whyLinked", {
|
|
11931
|
+
people: why.linked.people,
|
|
11932
|
+
tags: why.linked.tags,
|
|
11933
|
+
place: why.linked.place ? t("whyLinkedPlace") : ""
|
|
11934
|
+
})]
|
|
11935
|
+
].join(" · ");
|
|
11936
|
+
}
|
|
11937
|
+
//#endregion
|
|
11938
|
+
//#region src/client/chat-settings/InterventionList.tsx
|
|
11939
|
+
/** What the story's triggers delivered lately, and whether the game master or the characters took it up, newest first. */
|
|
11940
|
+
function InterventionList({ t, entries }) {
|
|
11941
|
+
const shown = [...entries].reverse();
|
|
11942
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
11943
|
+
className: ChatSettingsView_module_css_default.activity,
|
|
11944
|
+
"data-testid": "roleplay-interventions",
|
|
11945
|
+
children: [
|
|
11946
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("interventionsTitle") }),
|
|
11947
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11948
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11949
|
+
children: t("interventionsHelp")
|
|
11950
|
+
}),
|
|
11951
|
+
shown.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11952
|
+
className: ChatSettingsView_module_css_default.description,
|
|
11953
|
+
children: t("interventionsEmpty")
|
|
11954
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
|
|
11955
|
+
className: ChatSettingsView_module_css_default.table,
|
|
11956
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
11957
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("interventionTurn") }),
|
|
11958
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("interventionKind") }),
|
|
11959
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("interventionText") }),
|
|
11960
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("interventionStatus") })
|
|
11961
|
+
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: shown.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
11962
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.turn }),
|
|
11963
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.kind === "beat" ? t("interventionBeat") : t("interventionCue", { who: entry.characters.join(", ") }) }),
|
|
11964
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.text }),
|
|
11965
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: t(entry.status === "waiting" ? "interventionWaiting" : entry.status === "taken" ? "interventionTaken" : "interventionLapsed") })
|
|
11966
|
+
] }, `${entry.turn}-${entry.kind}-${entry.trigger}-${entry.text}`)) })]
|
|
11967
|
+
})
|
|
11968
|
+
]
|
|
11969
|
+
});
|
|
11970
|
+
}
|
|
10230
11971
|
//#endregion
|
|
10231
11972
|
//#region src/client/chat-settings/ChatSettingsView.tsx
|
|
10232
11973
|
/** The settings of one chat. Ordinary DSH chats have ids of the same shape, so the host decides whether this one is a roleplay session. */
|
|
@@ -10281,6 +12022,30 @@ window.__ModuleLoader__.load({
|
|
|
10281
12022
|
});
|
|
10282
12023
|
setSaved(false);
|
|
10283
12024
|
};
|
|
12025
|
+
const reset = () => {
|
|
12026
|
+
if (session === void 0) return;
|
|
12027
|
+
resetVectors(session, new AbortController().signal).then(refreshActivity, (failure) => {
|
|
12028
|
+
setError(t("vectorsFailed", { message: failure instanceof Error ? failure.message : String(failure) }));
|
|
12029
|
+
});
|
|
12030
|
+
};
|
|
12031
|
+
const refreshActivity = () => {
|
|
12032
|
+
if (session === void 0) return;
|
|
12033
|
+
loadSettings(session, new AbortController().signal).then((next) => {
|
|
12034
|
+
setLoad({
|
|
12035
|
+
status: "ready",
|
|
12036
|
+
payload: {
|
|
12037
|
+
...payload,
|
|
12038
|
+
activity: next.activity,
|
|
12039
|
+
interventions: next.interventions,
|
|
12040
|
+
vectors: next.vectors,
|
|
12041
|
+
pendingRecords: next.pendingRecords,
|
|
12042
|
+
pendingConsolidation: next.pendingConsolidation
|
|
12043
|
+
}
|
|
12044
|
+
});
|
|
12045
|
+
}, (failure) => {
|
|
12046
|
+
setError(failure instanceof Error ? failure.message : String(failure));
|
|
12047
|
+
});
|
|
12048
|
+
};
|
|
10284
12049
|
const save = () => {
|
|
10285
12050
|
if (session === void 0 || !changed) return;
|
|
10286
12051
|
setSaving(true);
|
|
@@ -10338,8 +12103,35 @@ window.__ModuleLoader__.load({
|
|
|
10338
12103
|
},
|
|
10339
12104
|
options,
|
|
10340
12105
|
disabled: saving,
|
|
12106
|
+
hidden: ["interface.pack"],
|
|
10341
12107
|
locked: payload.clockMode === "simulated" ? { "clock.mode": { real: t("clockLocked") } } : {}
|
|
10342
12108
|
}),
|
|
12109
|
+
session !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InterfaceSection, {
|
|
12110
|
+
t,
|
|
12111
|
+
session,
|
|
12112
|
+
value: String(drafts["interface.pack"] ?? ""),
|
|
12113
|
+
onChange: (next) => {
|
|
12114
|
+
change("interface.pack", next);
|
|
12115
|
+
},
|
|
12116
|
+
saved: payload.settings.interface.pack,
|
|
12117
|
+
disabled: saving
|
|
12118
|
+
}),
|
|
12119
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(VectorsSection, {
|
|
12120
|
+
t,
|
|
12121
|
+
status: payload.vectors,
|
|
12122
|
+
disabled: saving,
|
|
12123
|
+
onReset: reset
|
|
12124
|
+
}),
|
|
12125
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InterventionList, {
|
|
12126
|
+
t,
|
|
12127
|
+
entries: payload.interventions
|
|
12128
|
+
}),
|
|
12129
|
+
session !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActivityList, {
|
|
12130
|
+
t,
|
|
12131
|
+
session,
|
|
12132
|
+
entries: payload.activity,
|
|
12133
|
+
onRefresh: refreshActivity
|
|
12134
|
+
}),
|
|
10343
12135
|
error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10344
12136
|
className: ChatSettingsView_module_css_default.error,
|
|
10345
12137
|
role: "alert",
|
|
@@ -10371,6 +12163,80 @@ window.__ModuleLoader__.load({
|
|
|
10371
12163
|
notRoleplay: "This chat is not a roleplay session, so it has no roleplay settings.",
|
|
10372
12164
|
pendingConsolidation: "{count} character(s), place(s) or thing(s) made up in play are waiting to be fitted into the world (connected to the rest, given relationships). It is done in the background.",
|
|
10373
12165
|
pendingRecords: "{count} round(s) are waiting to be written into the story's memory. The game master records them when the story moves on, or once too many pile up.",
|
|
12166
|
+
interventionsTitle: "What the world put in front of the story",
|
|
12167
|
+
interventionsHelp: "Beats and cues that triggers delivered lately. A beat is for the game master to weave in; a cue is for characters. Taken up means it was used; lapsed means nobody did within its time.",
|
|
12168
|
+
interventionsEmpty: "No trigger has delivered anything yet.",
|
|
12169
|
+
interventionTurn: "Turn",
|
|
12170
|
+
interventionKind: "For",
|
|
12171
|
+
interventionText: "What",
|
|
12172
|
+
interventionStatus: "Became of it",
|
|
12173
|
+
interventionBeat: "Game master (beat)",
|
|
12174
|
+
interventionCue: "Cue for {who}",
|
|
12175
|
+
interventionWaiting: "Waiting",
|
|
12176
|
+
interventionTaken: "Taken up",
|
|
12177
|
+
interventionLapsed: "Lapsed, nobody took it up",
|
|
12178
|
+
activityTitle: "What the helpers did lately",
|
|
12179
|
+
activityHelp: "Characters, the record keeper, the suggestion writer and the authors run in the background of a turn. The latest runs are listed here, with how long each took.",
|
|
12180
|
+
activityRefresh: "Refresh",
|
|
12181
|
+
activityEmpty: "No helper has run yet.",
|
|
12182
|
+
activityWhen: "Ended",
|
|
12183
|
+
activityHelper: "Helper",
|
|
12184
|
+
activityModel: "Model",
|
|
12185
|
+
activityTook: "Took",
|
|
12186
|
+
activityCalls: "Calls",
|
|
12187
|
+
activityResult: "Result",
|
|
12188
|
+
activityOwnModel: "chat model",
|
|
12189
|
+
activityDone: "done",
|
|
12190
|
+
activityFailed: "failed: {reason}",
|
|
12191
|
+
runShow: "Show",
|
|
12192
|
+
runHide: "Hide",
|
|
12193
|
+
runGone: "This run was not kept, or has been dropped to make room for newer ones.",
|
|
12194
|
+
runFailed: "Could not load the run: {message}",
|
|
12195
|
+
runPersona: "Instructions",
|
|
12196
|
+
runPrompt: "What it was asked",
|
|
12197
|
+
runRefused: "refused",
|
|
12198
|
+
runResult: "Result",
|
|
12199
|
+
runRecalled: "What it was reminded of, and why",
|
|
12200
|
+
whyCues: "cues: names {people}, words {words}, place {place}",
|
|
12201
|
+
whyIndex: "words search {value}",
|
|
12202
|
+
whyMeaning: "meaning search {value}",
|
|
12203
|
+
whyRerank: "reranker {value}",
|
|
12204
|
+
whyMatters: "matters {value}/5",
|
|
12205
|
+
whyAge: "{value} story days ago",
|
|
12206
|
+
whyKept: "still in mind {value}",
|
|
12207
|
+
whyScore: "ranked {value}",
|
|
12208
|
+
whyLinked: "came to mind with another memory (shares {people} people, {tags} tags{place})",
|
|
12209
|
+
whyLinkedPlace: ", the place",
|
|
12210
|
+
runNoResult: "It submitted no result.",
|
|
12211
|
+
vectorsTitle: "Search by meaning",
|
|
12212
|
+
vectorsUnavailable: "Vector search is not available here, so memories are found by their words only.",
|
|
12213
|
+
vectorsNone: "No vectors are stored yet ({pending} texts waiting). They are made in the background once an embedding model is selected and the story searches.",
|
|
12214
|
+
vectorsStored: "Made by {model} ({dimensions} dimensions): {embedded} stored, {pending} waiting.",
|
|
12215
|
+
vectorsReset: "Reset vectors",
|
|
12216
|
+
vectorsConfirm: "Click again to forget them",
|
|
12217
|
+
vectorsCancel: "Cancel",
|
|
12218
|
+
vectorsHelp: "Use this after you select another embedding model. The texts stay; they are embedded again by the new model as the story needs them, and until then memories are found by their words.",
|
|
12219
|
+
vectorsFailed: "Could not reset the vectors: {message}",
|
|
12220
|
+
packTitle: "Interface pack",
|
|
12221
|
+
packHelp: "A pack changes how this story looks and can add a status strip, buttons, an opening card, a backdrop or a tab. A world can carry packs; yours go in the ui folder of your roleplay folder.",
|
|
12222
|
+
packActive: "In use: {name}",
|
|
12223
|
+
packNone: "No pack is in use.",
|
|
12224
|
+
packOff: "Packs are turned off for this story.",
|
|
12225
|
+
packProblems: "The pack cannot be used:",
|
|
12226
|
+
packChoose: "Pack",
|
|
12227
|
+
packFirst: "The first pack of the story",
|
|
12228
|
+
packPlain: "None (plain chat)",
|
|
12229
|
+
packFromRoot: "{name} (from your ui folder)",
|
|
12230
|
+
packWorldChanged: "The world has changed {names} since this story started.",
|
|
12231
|
+
packWorldNew: "The world has {names}, which this story does not have.",
|
|
12232
|
+
packWorldProblems: "The world's packs cannot be brought in yet: {names} has problems.",
|
|
12233
|
+
packUpdate: "Update from the world",
|
|
12234
|
+
packUpdateConfirm: "Replace the story's copies?",
|
|
12235
|
+
packUpdated: "Updated: {updated}. Added: {added}. The replaced copies were kept in the story's .trash folder.",
|
|
12236
|
+
packSyncFailed: "Could not update the packs: {message}",
|
|
12237
|
+
packSurfaces: "Shows: {surfaces}",
|
|
12238
|
+
packLoadFailed: "Could not read the interface pack: {message}",
|
|
12239
|
+
packBroken: "{name} (has problems)",
|
|
10374
12240
|
save: "Save",
|
|
10375
12241
|
saving: "Saving…",
|
|
10376
12242
|
saved: "Saved.",
|
|
@@ -10385,12 +12251,86 @@ window.__ModuleLoader__.load({
|
|
|
10385
12251
|
notRoleplay: "此对话不是角色扮演存档,没有角色扮演设置。",
|
|
10386
12252
|
pendingConsolidation: "有 {count} 个在故事中新建的角色、地点或物品等待融入世界(与其余部分建立连接和关系),将在后台完成。",
|
|
10387
12253
|
pendingRecords: "有 {count} 个回合等待写入故事记忆。主持人会在故事推进时记录,积压过多时也会自动记录。",
|
|
12254
|
+
interventionsTitle: "世界摆到故事面前的东西",
|
|
12255
|
+
interventionsHelp: "触发器最近送出的节拍与提示。节拍交给游戏主持人织入故事,提示交给角色。“已采用”表示被用上了,“已失效”表示在期限内没有人理会。",
|
|
12256
|
+
interventionsEmpty: "还没有触发器送出过任何东西。",
|
|
12257
|
+
interventionTurn: "回合",
|
|
12258
|
+
interventionKind: "送给",
|
|
12259
|
+
interventionText: "内容",
|
|
12260
|
+
interventionStatus: "结果",
|
|
12261
|
+
interventionBeat: "游戏主持人(节拍)",
|
|
12262
|
+
interventionCue: "给 {who} 的提示",
|
|
12263
|
+
interventionWaiting: "等待中",
|
|
12264
|
+
interventionTaken: "已采用",
|
|
12265
|
+
interventionLapsed: "已失效,无人理会",
|
|
12266
|
+
activityTitle: "助手最近做了什么",
|
|
12267
|
+
activityHelp: "角色、记录员、建议作者和世界作者都在每一轮的后台运行。这里列出最近的运行及各自耗时。",
|
|
12268
|
+
activityRefresh: "刷新",
|
|
12269
|
+
activityEmpty: "还没有助手运行过。",
|
|
12270
|
+
activityWhen: "结束于",
|
|
12271
|
+
activityHelper: "助手",
|
|
12272
|
+
activityModel: "模型",
|
|
12273
|
+
activityTook: "耗时",
|
|
12274
|
+
activityCalls: "调用",
|
|
12275
|
+
activityResult: "结果",
|
|
12276
|
+
activityOwnModel: "对话模型",
|
|
12277
|
+
activityDone: "完成",
|
|
12278
|
+
activityFailed: "失败:{reason}",
|
|
12279
|
+
runShow: "查看",
|
|
12280
|
+
runHide: "收起",
|
|
12281
|
+
runGone: "这次运行没有保留,或已被较新的运行挤出。",
|
|
12282
|
+
runFailed: "无法加载这次运行:{message}",
|
|
12283
|
+
runPersona: "指令",
|
|
12284
|
+
runPrompt: "被问的内容",
|
|
12285
|
+
runRefused: "被拒绝",
|
|
12286
|
+
runResult: "结果",
|
|
12287
|
+
runRecalled: "它被提醒了什么,以及原因",
|
|
12288
|
+
whyCues: "线索:人名 {people},字词 {words},地点 {place}",
|
|
12289
|
+
whyIndex: "字词检索 {value}",
|
|
12290
|
+
whyMeaning: "含义检索 {value}",
|
|
12291
|
+
whyRerank: "重排序 {value}",
|
|
12292
|
+
whyMatters: "重要性 {value}/5",
|
|
12293
|
+
whyAge: "{value} 个故事日前",
|
|
12294
|
+
whyKept: "记忆保留 {value}",
|
|
12295
|
+
whyScore: "排名分 {value}",
|
|
12296
|
+
whyLinked: "与另一条记忆一同想起(共有 {people} 个人物、{tags} 个标签{place})",
|
|
12297
|
+
whyLinkedPlace: "、地点",
|
|
12298
|
+
runNoResult: "它没有提交结果。",
|
|
12299
|
+
vectorsTitle: "按含义检索",
|
|
12300
|
+
vectorsUnavailable: "此处无法使用向量检索,记忆只按字词查找。",
|
|
12301
|
+
vectorsNone: "尚未存储向量({pending} 条文本等待中)。选择嵌入模型并在故事检索时会在后台生成。",
|
|
12302
|
+
vectorsStored: "由 {model}({dimensions} 维)生成:已存储 {embedded} 条,等待 {pending} 条。",
|
|
12303
|
+
vectorsReset: "重置向量",
|
|
12304
|
+
vectorsConfirm: "再次点击以清除",
|
|
12305
|
+
vectorsCancel: "取消",
|
|
12306
|
+
vectorsHelp: "更换嵌入模型后使用。文本会保留,之后按需由新模型重新生成向量,在此之前记忆只按字词查找。",
|
|
12307
|
+
vectorsFailed: "无法重置向量:{message}",
|
|
12308
|
+
packTitle: "界面包",
|
|
12309
|
+
packHelp: "界面包会改变此故事的外观,并可添加状态条、按钮、开场卡片、背景或标签页。世界可以自带界面包;你自己的放在角色扮演目录的 ui 文件夹中。",
|
|
12310
|
+
packActive: "使用中:{name}",
|
|
12311
|
+
packNone: "没有使用界面包。",
|
|
12312
|
+
packOff: "此故事已关闭界面包。",
|
|
12313
|
+
packProblems: "无法使用此界面包:",
|
|
12314
|
+
packChoose: "界面包",
|
|
12315
|
+
packFirst: "故事中的第一个包",
|
|
12316
|
+
packPlain: "无(普通聊天)",
|
|
12317
|
+
packFromRoot: "{name}(来自你的 ui 文件夹)",
|
|
12318
|
+
packWorldChanged: "自此故事开始以来,世界已更改:{names}。",
|
|
12319
|
+
packWorldNew: "世界有此故事没有的包:{names}。",
|
|
12320
|
+
packWorldProblems: "暂时无法带入世界的界面包:{names} 有问题。",
|
|
12321
|
+
packUpdate: "从世界更新",
|
|
12322
|
+
packUpdateConfirm: "替换故事中的副本?",
|
|
12323
|
+
packUpdated: "已更新:{updated}。已添加:{added}。被替换的副本保存在故事的 .trash 文件夹中。",
|
|
12324
|
+
packSyncFailed: "无法更新界面包:{message}",
|
|
12325
|
+
packSurfaces: "显示位置:{surfaces}",
|
|
12326
|
+
packLoadFailed: "无法读取界面包:{message}",
|
|
12327
|
+
packBroken: "{name}(有问题)",
|
|
10388
12328
|
save: "保存",
|
|
10389
12329
|
saving: "正在保存…",
|
|
10390
12330
|
saved: "已保存。",
|
|
10391
12331
|
saveFailed: "无法保存设置:{message}"
|
|
10392
12332
|
}
|
|
10393
|
-
}, dictionaries$
|
|
12333
|
+
}, dictionaries$6);
|
|
10394
12334
|
//#endregion
|
|
10395
12335
|
//#region src/client/chat-settings/index.ts
|
|
10396
12336
|
const NAMESPACE$2 = "roleplay.chatSettings";
|
|
@@ -10694,8 +12634,8 @@ window.__ModuleLoader__.load({
|
|
|
10694
12634
|
}
|
|
10695
12635
|
};
|
|
10696
12636
|
//#endregion
|
|
10697
|
-
//#region \0css-module:/home/
|
|
10698
|
-
const css$2 = ".
|
|
12637
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/NarrationView.module.css.mjs
|
|
12638
|
+
const css$2 = ".rp_NFPimG_output{flex-direction:column;gap:8px;min-width:0;margin:8px 0;display:flex}.rp_NFPimG_narration{color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:13px;line-height:22px}.rp_NFPimG_line{align-items:flex-start;gap:10px;min-width:0;display:flex}.rp_NFPimG_avatar{color:#fff;border-radius:14px;flex:none;justify-content:center;align-items:center;width:28px;height:28px;font-size:12px;font-weight:500;display:flex}.rp_NFPimG_speech{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);flex-direction:column;gap:2px;min-width:0;max-width:100%;padding:6px 10px;display:flex}.rp_NFPimG_name{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.rp_NFPimG_words{color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:20px}.rp_NFPimG_note{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_NFPimG_preview{opacity:.8}.rp_NFPimG_oocNote,.rp_NFPimG_oocRefused{border-left:2px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);margin:0;padding:6px 10px;font-size:12px;line-height:18px}.rp_NFPimG_oocRefused{border-left-color:var(--dsw-alias-state-error-primary)}.rp_NFPimG_oocLabel{font-weight:500}.rp_NFPimG_images{flex-direction:column;align-items:flex-start;gap:6px;margin:8px 0 12px;display:flex}.rp_NFPimG_sceneImage{object-fit:contain;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:auto;max-width:min(100%,480px);height:auto;max-height:50vh;display:block}.rp_NFPimG_imageButton{cursor:zoom-in;background:0 0;border:0;padding:0}.rp_NFPimG_imageStatus,.rp_NFPimG_imageError{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_NFPimG_imageError{color:var(--dsw-alias-state-error-primary)}.rp_NFPimG_playAll,.rp_NFPimG_playLine{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0}.rp_NFPimG_playAll{float:right;margin:0 0 8px 12px;font-size:12px}.rp_NFPimG_playLine{margin-left:8px;padding:0 3px;font-size:10px}.rp_NFPimG_playAll:disabled,.rp_NFPimG_playLine:disabled{cursor:wait;opacity:.5}";
|
|
10699
12639
|
const key$2 = "src/client/transcript/NarrationView.module.css";
|
|
10700
12640
|
let tag$2 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$2) + "]");
|
|
10701
12641
|
if (tag$2 === null) {
|
|
@@ -10706,25 +12646,25 @@ window.__ModuleLoader__.load({
|
|
|
10706
12646
|
}
|
|
10707
12647
|
tag$2.textContent = css$2;
|
|
10708
12648
|
var NarrationView_module_css_default = {
|
|
10709
|
-
"
|
|
10710
|
-
"speech": "
|
|
10711
|
-
"
|
|
10712
|
-
"
|
|
10713
|
-
"
|
|
10714
|
-
"
|
|
10715
|
-
"
|
|
10716
|
-
"
|
|
10717
|
-
"
|
|
10718
|
-
"
|
|
10719
|
-
"
|
|
10720
|
-
"
|
|
10721
|
-
"
|
|
10722
|
-
"
|
|
10723
|
-
"
|
|
10724
|
-
"
|
|
10725
|
-
"
|
|
10726
|
-
"
|
|
10727
|
-
"
|
|
12649
|
+
"images": "rp_NFPimG_images",
|
|
12650
|
+
"speech": "rp_NFPimG_speech",
|
|
12651
|
+
"preview": "rp_NFPimG_preview",
|
|
12652
|
+
"oocRefused": "rp_NFPimG_oocRefused",
|
|
12653
|
+
"words": "rp_NFPimG_words",
|
|
12654
|
+
"name": "rp_NFPimG_name",
|
|
12655
|
+
"narration": "rp_NFPimG_narration",
|
|
12656
|
+
"avatar": "rp_NFPimG_avatar",
|
|
12657
|
+
"sceneImage": "rp_NFPimG_sceneImage",
|
|
12658
|
+
"oocNote": "rp_NFPimG_oocNote",
|
|
12659
|
+
"playLine": "rp_NFPimG_playLine",
|
|
12660
|
+
"note": "rp_NFPimG_note",
|
|
12661
|
+
"line": "rp_NFPimG_line",
|
|
12662
|
+
"playAll": "rp_NFPimG_playAll",
|
|
12663
|
+
"imageButton": "rp_NFPimG_imageButton",
|
|
12664
|
+
"output": "rp_NFPimG_output",
|
|
12665
|
+
"imageStatus": "rp_NFPimG_imageStatus",
|
|
12666
|
+
"oocLabel": "rp_NFPimG_oocLabel",
|
|
12667
|
+
"imageError": "rp_NFPimG_imageError"
|
|
10728
12668
|
};
|
|
10729
12669
|
//#endregion
|
|
10730
12670
|
//#region src/client/transcript/PreviewNode.tsx
|
|
@@ -10789,6 +12729,7 @@ window.__ModuleLoader__.load({
|
|
|
10789
12729
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10790
12730
|
className: NarrationView_module_css_default.output,
|
|
10791
12731
|
"data-testid": "roleplay-narration",
|
|
12732
|
+
"data-rp": "narration",
|
|
10792
12733
|
children: [
|
|
10793
12734
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
10794
12735
|
type: "button",
|
|
@@ -10803,10 +12744,11 @@ window.__ModuleLoader__.load({
|
|
|
10803
12744
|
data.ooc !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
10804
12745
|
className: data.ooc.legal ? NarrationView_module_css_default.oocNote : NarrationView_module_css_default.oocRefused,
|
|
10805
12746
|
"data-testid": "roleplay-ooc",
|
|
12747
|
+
"data-rp": "ooc",
|
|
10806
12748
|
children: [
|
|
10807
12749
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10808
12750
|
className: NarrationView_module_css_default.oocLabel,
|
|
10809
|
-
children: t(data.ooc.legal ? "oocDone" : "oocRefused")
|
|
12751
|
+
children: t(data.ooc.question === true ? "oocAnswer" : data.ooc.legal ? "oocDone" : "oocRefused")
|
|
10810
12752
|
}),
|
|
10811
12753
|
" ",
|
|
10812
12754
|
data.ooc.note
|
|
@@ -10814,12 +12756,15 @@ window.__ModuleLoader__.load({
|
|
|
10814
12756
|
}),
|
|
10815
12757
|
data.segments.map((segment, index) => segment.type === "narration" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10816
12758
|
className: NarrationView_module_css_default.narration,
|
|
12759
|
+
"data-rp": "prose",
|
|
10817
12760
|
children: segment.text
|
|
10818
12761
|
}, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10819
12762
|
className: NarrationView_module_css_default.line,
|
|
10820
12763
|
"data-testid": "roleplay-utterance",
|
|
12764
|
+
"data-rp": "utterance",
|
|
10821
12765
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10822
12766
|
className: NarrationView_module_css_default.avatar,
|
|
12767
|
+
"data-rp": "avatar",
|
|
10823
12768
|
style: { background: `hsl(${hueOf(segment.name)} 32% 40%)` },
|
|
10824
12769
|
"aria-hidden": "true",
|
|
10825
12770
|
children: Array.from(segment.name)[0]?.toUpperCase()
|
|
@@ -10827,6 +12772,7 @@ window.__ModuleLoader__.load({
|
|
|
10827
12772
|
className: NarrationView_module_css_default.speech,
|
|
10828
12773
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10829
12774
|
className: NarrationView_module_css_default.name,
|
|
12775
|
+
"data-rp": "speaker",
|
|
10830
12776
|
children: [segment.name, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
10831
12777
|
type: "button",
|
|
10832
12778
|
className: NarrationView_module_css_default.playLine,
|
|
@@ -10839,6 +12785,7 @@ window.__ModuleLoader__.load({
|
|
|
10839
12785
|
})]
|
|
10840
12786
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10841
12787
|
className: NarrationView_module_css_default.words,
|
|
12788
|
+
"data-rp": "words",
|
|
10842
12789
|
children: segment.text
|
|
10843
12790
|
})]
|
|
10844
12791
|
})]
|
|
@@ -10950,8 +12897,8 @@ window.__ModuleLoader__.load({
|
|
|
10950
12897
|
};
|
|
10951
12898
|
}
|
|
10952
12899
|
//#endregion
|
|
10953
|
-
//#region \0css-module:/home/
|
|
10954
|
-
const css$1 = ".
|
|
12900
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/SuggestionsDock.module.css.mjs
|
|
12901
|
+
const css$1 = ".rp_rWH4DG_dock{box-sizing:border-box;flex-direction:column;align-items:stretch;gap:4px;width:min(800px,100%);min-width:0;margin:0 auto 8px;padding:0 16px;display:flex}.rp_rWH4DG_label{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px}.rp_rWH4DG_chip{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;color:var(--dsw-alias-label-secondary);font:inherit;text-align:left;cursor:pointer;overflow-wrap:anywhere;background:0 0;padding:4px 10px;font-size:13px;line-height:20px}.rp_rWH4DG_chip:hover,.rp_rWH4DG_chip:focus-visible{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary);outline:none}.rp_rWH4DG_card{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);flex-direction:column;gap:2px;padding:6px 10px;display:flex}.rp_rWH4DG_lines{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;margin:0;padding-left:16px;font-size:13px;line-height:20px}";
|
|
10955
12902
|
const key$1 = "src/client/transcript/SuggestionsDock.module.css";
|
|
10956
12903
|
let tag$1 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$1) + "]");
|
|
10957
12904
|
if (tag$1 === null) {
|
|
@@ -10962,11 +12909,11 @@ window.__ModuleLoader__.load({
|
|
|
10962
12909
|
}
|
|
10963
12910
|
tag$1.textContent = css$1;
|
|
10964
12911
|
var SuggestionsDock_module_css_default = {
|
|
10965
|
-
"
|
|
10966
|
-
"
|
|
10967
|
-
"
|
|
10968
|
-
"
|
|
10969
|
-
"
|
|
12912
|
+
"dock": "rp_rWH4DG_dock",
|
|
12913
|
+
"lines": "rp_rWH4DG_lines",
|
|
12914
|
+
"label": "rp_rWH4DG_label",
|
|
12915
|
+
"chip": "rp_rWH4DG_chip",
|
|
12916
|
+
"card": "rp_rWH4DG_card"
|
|
10970
12917
|
};
|
|
10971
12918
|
//#endregion
|
|
10972
12919
|
//#region src/client/transcript/SuggestionsDock.tsx
|
|
@@ -10976,7 +12923,7 @@ window.__ModuleLoader__.load({
|
|
|
10976
12923
|
/**
|
|
10977
12924
|
* What the player could do next, as chips stacked above the input; clicking one fills the input (the player may
|
|
10978
12925
|
* edit it before sending). They are made in the background once the output of a turn is shown, so the dock asks
|
|
10979
|
-
* the host for them for a while. What other characters did meanwhile (the `away` note) is a card above them, from the same notes. Shown only while they are the latest thing in the chat: once the player has sent
|
|
12926
|
+
* the host for them for a while. What other characters did meanwhile (the `away` note) is a card above them, from the same notes; what the world check found at the start (the `world` note) is another. Shown only while they are the latest thing in the chat: once the player has sent
|
|
10980
12927
|
* something, or a turn is running, they are gone.
|
|
10981
12928
|
*/
|
|
10982
12929
|
function SuggestionsDock({ useChat, useSession, pick, notes, t }) {
|
|
@@ -10989,9 +12936,11 @@ window.__ModuleLoader__.load({
|
|
|
10989
12936
|
});
|
|
10990
12937
|
const [offered, setOffered] = (0, react.useState)([]);
|
|
10991
12938
|
const [meanwhile, setMeanwhile] = (0, react.useState)([]);
|
|
12939
|
+
const [unfinished, setUnfinished] = (0, react.useState)([]);
|
|
10992
12940
|
(0, react.useEffect)(() => {
|
|
10993
12941
|
setOffered([]);
|
|
10994
12942
|
setMeanwhile([]);
|
|
12943
|
+
setUnfinished([]);
|
|
10995
12944
|
if (latest === void 0) return void 0;
|
|
10996
12945
|
let stopped = false;
|
|
10997
12946
|
let timer;
|
|
@@ -11000,6 +12949,8 @@ window.__ModuleLoader__.load({
|
|
|
11000
12949
|
if (stopped) return;
|
|
11001
12950
|
const away = found.find((note) => note.kind === "away")?.lines ?? [];
|
|
11002
12951
|
setMeanwhile((previous) => previous.join("\n") === away.join("\n") ? previous : away);
|
|
12952
|
+
const world = found.find((note) => note.kind === "world")?.lines ?? [];
|
|
12953
|
+
setUnfinished((previous) => previous.join("\n") === world.join("\n") ? previous : world);
|
|
11003
12954
|
const lines = found.find((note) => note.kind === "suggestions")?.lines;
|
|
11004
12955
|
if (lines !== void 0 && lines.length > 0) setOffered(lines);
|
|
11005
12956
|
else if (attempt < GIVE_UP_AFTER) timer = setTimeout(() => {
|
|
@@ -11015,11 +12966,23 @@ window.__ModuleLoader__.load({
|
|
|
11015
12966
|
if (timer !== void 0) clearTimeout(timer);
|
|
11016
12967
|
};
|
|
11017
12968
|
}, [latest, notes]);
|
|
11018
|
-
if (running || offered.length === 0 && meanwhile.length === 0) return null;
|
|
12969
|
+
if (running || offered.length === 0 && meanwhile.length === 0 && unfinished.length === 0) return null;
|
|
11019
12970
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11020
12971
|
className: SuggestionsDock_module_css_default.dock,
|
|
11021
12972
|
"data-testid": "roleplay-suggestions",
|
|
12973
|
+
"data-rp": "suggestions",
|
|
11022
12974
|
children: [
|
|
12975
|
+
unfinished.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
12976
|
+
className: SuggestionsDock_module_css_default.card,
|
|
12977
|
+
"data-testid": "roleplay-world-findings",
|
|
12978
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
12979
|
+
className: SuggestionsDock_module_css_default.label,
|
|
12980
|
+
children: t("worldFindings")
|
|
12981
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
12982
|
+
className: SuggestionsDock_module_css_default.lines,
|
|
12983
|
+
children: unfinished.map((line) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: line }, line))
|
|
12984
|
+
})]
|
|
12985
|
+
}),
|
|
11023
12986
|
meanwhile.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11024
12987
|
className: SuggestionsDock_module_css_default.card,
|
|
11025
12988
|
"data-testid": "roleplay-meanwhile",
|
|
@@ -11038,6 +13001,7 @@ window.__ModuleLoader__.load({
|
|
|
11038
13001
|
offered.map((text) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
11039
13002
|
type: "button",
|
|
11040
13003
|
className: SuggestionsDock_module_css_default.chip,
|
|
13004
|
+
"data-rp": "suggestion",
|
|
11041
13005
|
title: t("suggestionHint"),
|
|
11042
13006
|
onClick: () => {
|
|
11043
13007
|
pick(text);
|
|
@@ -11048,8 +13012,8 @@ window.__ModuleLoader__.load({
|
|
|
11048
13012
|
});
|
|
11049
13013
|
}
|
|
11050
13014
|
//#endregion
|
|
11051
|
-
//#region \0css-module:/home/
|
|
11052
|
-
const css = ".
|
|
13015
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/TurnsDock.module.css.mjs
|
|
13016
|
+
const css = ".rp_f4YLlq_dock{box-sizing:border-box;width:min(800px,100%);min-width:0;color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0 auto 8px;padding:0 16px;font-size:12px;display:flex}.rp_f4YLlq_group{align-items:center;gap:2px;display:flex}.rp_f4YLlq_button{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;padding:2px 8px;line-height:18px}.rp_f4YLlq_button:hover:not(:disabled),.rp_f4YLlq_button:focus-visible{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary);outline:none}.rp_f4YLlq_button:disabled{opacity:.5;cursor:default}.rp_f4YLlq_count{text-align:center;min-width:32px}.rp_f4YLlq_select{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);max-width:220px;color:var(--dsw-alias-label-secondary);font:inherit;background:0 0;padding:2px 4px}.rp_f4YLlq_error{color:var(--dsw-alias-state-error-primary,#d1242f)}";
|
|
11053
13017
|
const key = "src/client/transcript/TurnsDock.module.css";
|
|
11054
13018
|
let tag = document.querySelector("style[data-plugin-css=" + JSON.stringify(key) + "]");
|
|
11055
13019
|
if (tag === null) {
|
|
@@ -11060,12 +13024,12 @@ window.__ModuleLoader__.load({
|
|
|
11060
13024
|
}
|
|
11061
13025
|
tag.textContent = css;
|
|
11062
13026
|
var TurnsDock_module_css_default = {
|
|
11063
|
-
"
|
|
11064
|
-
"
|
|
11065
|
-
"
|
|
11066
|
-
"
|
|
11067
|
-
"
|
|
11068
|
-
"
|
|
13027
|
+
"select": "rp_f4YLlq_select",
|
|
13028
|
+
"dock": "rp_f4YLlq_dock",
|
|
13029
|
+
"button": "rp_f4YLlq_button",
|
|
13030
|
+
"count": "rp_f4YLlq_count",
|
|
13031
|
+
"error": "rp_f4YLlq_error",
|
|
13032
|
+
"group": "rp_f4YLlq_group"
|
|
11069
13033
|
};
|
|
11070
13034
|
//#endregion
|
|
11071
13035
|
//#region src/client/transcript/withdrawn.ts
|
|
@@ -11134,6 +13098,7 @@ window.__ModuleLoader__.load({
|
|
|
11134
13098
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11135
13099
|
className: TurnsDock_module_css_default.dock,
|
|
11136
13100
|
"data-testid": "roleplay-turns",
|
|
13101
|
+
"data-rp": "turns",
|
|
11137
13102
|
children: [
|
|
11138
13103
|
style,
|
|
11139
13104
|
alternatives.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -11264,6 +13229,7 @@ window.__ModuleLoader__.load({
|
|
|
11264
13229
|
swapNext: "The next turn played from the same place",
|
|
11265
13230
|
oocDone: "Out of character:",
|
|
11266
13231
|
oocRefused: "Out of character, refused:",
|
|
13232
|
+
oocAnswer: "Out of character, answer:",
|
|
11267
13233
|
redo: "↷ Forward",
|
|
11268
13234
|
branch: "⑂ Branch from…",
|
|
11269
13235
|
after: "After",
|
|
@@ -11273,6 +13239,7 @@ window.__ModuleLoader__.load({
|
|
|
11273
13239
|
repaired: "Corrected so that every spoken line is exactly what the character said.",
|
|
11274
13240
|
suggestions: "You could",
|
|
11275
13241
|
meanwhile: "Meanwhile",
|
|
13242
|
+
worldFindings: "Unfinished in this world",
|
|
11276
13243
|
suggestionHint: "Put it in the input box",
|
|
11277
13244
|
sceneImage: "Illustration of this scene",
|
|
11278
13245
|
imageGenerating: "Creating illustration…",
|
|
@@ -11299,6 +13266,7 @@ window.__ModuleLoader__.load({
|
|
|
11299
13266
|
swapNext: "从同一处出发的下一个回合",
|
|
11300
13267
|
oocDone: "场外:",
|
|
11301
13268
|
oocRefused: "场外,已拒绝:",
|
|
13269
|
+
oocAnswer: "场外,回答:",
|
|
11302
13270
|
redo: "↷ 前进",
|
|
11303
13271
|
branch: "⑂ 分支自…",
|
|
11304
13272
|
after: "在此之后:",
|
|
@@ -11308,6 +13276,7 @@ window.__ModuleLoader__.load({
|
|
|
11308
13276
|
repaired: "已修正,确保每句台词与角色原话一致。",
|
|
11309
13277
|
suggestions: "你可以",
|
|
11310
13278
|
meanwhile: "与此同时",
|
|
13279
|
+
worldFindings: "这个世界尚未完善之处",
|
|
11311
13280
|
suggestionHint: "填入输入框",
|
|
11312
13281
|
sceneImage: "本场景插图",
|
|
11313
13282
|
imageGenerating: "正在生成插图…",
|
|
@@ -11326,25 +13295,6 @@ window.__ModuleLoader__.load({
|
|
|
11326
13295
|
//#endregion
|
|
11327
13296
|
//#region src/client/transcript/index.ts
|
|
11328
13297
|
const NAMESPACE = "roleplay.transcript";
|
|
11329
|
-
/** What can be done with the input box of a session: put words in it, and send them. Resolved on use, so a client without it fails at the click. */
|
|
11330
|
-
function facadeOf(scope, sessionId) {
|
|
11331
|
-
const input = () => {
|
|
11332
|
-
const actx = scope.get("sessions")?.scope(sessionId);
|
|
11333
|
-
const conversation = actx?.get("conversation");
|
|
11334
|
-
if (actx === void 0 || conversation === void 0) throw new Error("the input of this chat is not available");
|
|
11335
|
-
return conversation.input.for(actx);
|
|
11336
|
-
};
|
|
11337
|
-
return {
|
|
11338
|
-
pick: (text) => {
|
|
11339
|
-
input().setDraft(text);
|
|
11340
|
-
},
|
|
11341
|
-
fill: (text, send) => {
|
|
11342
|
-
const facade = input();
|
|
11343
|
-
facade.setDraft(text);
|
|
11344
|
-
if (send) facade.submit();
|
|
11345
|
-
}
|
|
11346
|
-
};
|
|
11347
|
-
}
|
|
11348
13298
|
/** The turns of a roleplay session, as the host keeps them. */
|
|
11349
13299
|
async function timelineOf(chat) {
|
|
11350
13300
|
const id = roleplaySessionOf(chat);
|
|
@@ -11445,6 +13395,7 @@ window.__ModuleLoader__.load({
|
|
|
11445
13395
|
registerChatSettings(ctx);
|
|
11446
13396
|
registerWorld(ctx);
|
|
11447
13397
|
registerGallery(ctx);
|
|
13398
|
+
registerInterface(ctx);
|
|
11448
13399
|
registerBranchNaming(ctx);
|
|
11449
13400
|
}
|
|
11450
13401
|
//#endregion
|