@dsh-agentic-roleplay/core 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/authoring.js +4 -255
- package/lib/{child-lPncV1ps.js → child-CFjnaTZt.js} +62 -7
- package/lib/client.js +2530 -510
- package/lib/client.js.map +1 -1
- package/lib/{deliver-De62a8i9.js → deliver-CpZOxBX5.js} +47 -10
- package/lib/doctor.js +82 -6
- package/lib/{hooks-Ka22sFNy.js → hooks-KTCR3fNJ.js} +57 -16
- package/lib/images.js +1 -1
- package/lib/index.js +1240 -21
- package/lib/orchestration.js +5 -16
- package/lib/{documents-Do4lz4SB.js → pack-jail-CybSNzxr.js} +464 -27
- package/lib/{presenter-agent-Dt21K96b.js → presenter-agent-CiEVKcjJ.js} +2 -2
- package/lib/{reflection-md7BCYCl.js → reflection-waxFg1x-.js} +3 -3
- package/package.json +2 -2
- package/prompts/en/doctor/procedure.md +1 -1
- package/prompts/en/import/character.md +1 -1
- package/prompts/en/roleplay/record-keeper.md +2 -2
- package/prompts/zh/doctor/procedure.md +1 -1
- package/prompts/zh/import/character.md +1 -1
- package/prompts/zh/roleplay/record-keeper.md +2 -2
package/lib/client.js
CHANGED
|
@@ -26,19 +26,19 @@ window.__ModuleLoader__.load({
|
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/panel/PageTabs.module.css.mjs
|
|
29
|
-
const css$
|
|
30
|
-
const key$
|
|
31
|
-
let tag$
|
|
32
|
-
if (tag$
|
|
33
|
-
tag$
|
|
34
|
-
tag$
|
|
35
|
-
tag$
|
|
36
|
-
document.head.appendChild(tag$
|
|
29
|
+
const css$28 = ".rp_Poldga_tabs{scrollbar-width:none;gap:24px;margin-bottom:-1px;display:flex;overflow-x:auto}.rp_Poldga_tabs::-webkit-scrollbar{display:none}.rp_Poldga_tab{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:0;margin:0;padding:8px 0;font-size:13px;line-height:20px;box-shadow:inset 0 -2px #0000}.rp_Poldga_tab:hover{color:var(--dsw-alias-label-primary)}.rp_Poldga_tab[aria-selected=true]{color:var(--dsw-alias-state-business-primary);font-weight:500;box-shadow:inset 0 -2px}.rp_Poldga_tab:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px;border-radius:var(--dsw-radius-xs)}";
|
|
30
|
+
const key$28 = "src/client/panel/PageTabs.module.css";
|
|
31
|
+
let tag$28 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$28) + "]");
|
|
32
|
+
if (tag$28 === null) {
|
|
33
|
+
tag$28 = document.createElement("style");
|
|
34
|
+
tag$28.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
35
|
+
tag$28.dataset.pluginCss = key$28;
|
|
36
|
+
document.head.appendChild(tag$28);
|
|
37
37
|
}
|
|
38
|
-
tag$
|
|
38
|
+
tag$28.textContent = css$28;
|
|
39
39
|
var PageTabs_module_css_default = {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"tabs": "rp_Poldga_tabs",
|
|
41
|
+
"tab": "rp_Poldga_tab"
|
|
42
42
|
};
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/client/panel/PageTabs.tsx
|
|
@@ -82,19 +82,19 @@ window.__ModuleLoader__.load({
|
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/panel/RoleplayPanel.module.css.mjs
|
|
85
|
-
const css$
|
|
86
|
-
const key$
|
|
87
|
-
let tag$
|
|
88
|
-
if (tag$
|
|
89
|
-
tag$
|
|
90
|
-
tag$
|
|
91
|
-
tag$
|
|
92
|
-
document.head.appendChild(tag$
|
|
85
|
+
const css$27 = ".rp_ua5gBa_panel{min-height:0;color:var(--dsw-alias-label-primary);flex-direction:column;flex:1 1 0;display:flex}.rp_ua5gBa_header{border-bottom:.5px solid var(--dsw-alias-border-l2);flex:none;padding:12px 24px 0}.rp_ua5gBa_title{margin:0 0 4px;font-size:14px;font-weight:500;line-height:22px}.rp_ua5gBa_body{flex-direction:column;flex:1 1 0;min-height:0;padding:12px 24px 16px;display:flex}@media (width<=640px){.rp_ua5gBa_header,.rp_ua5gBa_body{padding-inline:16px}}";
|
|
86
|
+
const key$27 = "src/client/panel/RoleplayPanel.module.css";
|
|
87
|
+
let tag$27 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$27) + "]");
|
|
88
|
+
if (tag$27 === null) {
|
|
89
|
+
tag$27 = document.createElement("style");
|
|
90
|
+
tag$27.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
91
|
+
tag$27.dataset.pluginCss = key$27;
|
|
92
|
+
document.head.appendChild(tag$27);
|
|
93
93
|
}
|
|
94
|
-
tag$
|
|
94
|
+
tag$27.textContent = css$27;
|
|
95
95
|
var RoleplayPanel_module_css_default = {
|
|
96
|
-
"title": "rp_ua5gBa_title",
|
|
97
96
|
"panel": "rp_ua5gBa_panel",
|
|
97
|
+
"title": "rp_ua5gBa_title",
|
|
98
98
|
"body": "rp_ua5gBa_body",
|
|
99
99
|
"header": "rp_ua5gBa_header"
|
|
100
100
|
};
|
|
@@ -143,7 +143,7 @@ window.__ModuleLoader__.load({
|
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region src/client/panel/locales.ts
|
|
146
|
-
const dictionaries$
|
|
146
|
+
const dictionaries$16 = {
|
|
147
147
|
en: {
|
|
148
148
|
label: "Role Play",
|
|
149
149
|
heading: "DSH Agentic Role Play",
|
|
@@ -200,11 +200,11 @@ window.__ModuleLoader__.load({
|
|
|
200
200
|
}
|
|
201
201
|
//#endregion
|
|
202
202
|
//#region src/client/panel/index.ts
|
|
203
|
-
const NAMESPACE$
|
|
203
|
+
const NAMESPACE$11 = "roleplay.panel";
|
|
204
204
|
/** Adds the Role Play entry to the sidebar and the main panel it opens. */
|
|
205
205
|
function registerPanel(ctx) {
|
|
206
|
-
const t = ctx.locale.bind(NAMESPACE$
|
|
207
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$
|
|
206
|
+
const t = ctx.locale.bind(NAMESPACE$11);
|
|
207
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$11, dictionaries$16), "roleplay: panel dictionaries");
|
|
208
208
|
const pages = createPagesSource(ctx);
|
|
209
209
|
ctx.effect(() => pages.start(), "roleplay: page list");
|
|
210
210
|
const handle = createPanelStore();
|
|
@@ -216,7 +216,7 @@ window.__ModuleLoader__.load({
|
|
|
216
216
|
ctx.slots.inject("main", () => ctx.slots.register({
|
|
217
217
|
name: "main",
|
|
218
218
|
key: PANEL_ID,
|
|
219
|
-
locale: NAMESPACE$
|
|
219
|
+
locale: NAMESPACE$11,
|
|
220
220
|
store,
|
|
221
221
|
inject: () => ({ hooks: { pages: pages.store } }),
|
|
222
222
|
children: { "roleplay.page": {
|
|
@@ -229,13 +229,19 @@ window.__ModuleLoader__.load({
|
|
|
229
229
|
id: PANEL_ID,
|
|
230
230
|
order: 5,
|
|
231
231
|
label: () => t("label"),
|
|
232
|
-
locale: NAMESPACE$
|
|
232
|
+
locale: NAMESPACE$11
|
|
233
233
|
}, PanelIcon));
|
|
234
234
|
}
|
|
235
235
|
//#endregion
|
|
236
|
-
//#region src/
|
|
237
|
-
/**
|
|
238
|
-
|
|
236
|
+
//#region src/client/chat/open-chat.ts
|
|
237
|
+
/** Resolves the workspace service on use, so a client without it fails at the click, not at load. */
|
|
238
|
+
function createChatOpener(ctx) {
|
|
239
|
+
return (chatSessionId) => {
|
|
240
|
+
const workspace = ctx.get("uiWorkspace");
|
|
241
|
+
if (workspace === void 0) throw new Error("the chat is not available in this client");
|
|
242
|
+
workspace.openSession(chatSessionId);
|
|
243
|
+
};
|
|
244
|
+
}
|
|
239
245
|
//#endregion
|
|
240
246
|
//#region src/shared/worlds.ts
|
|
241
247
|
/** Path prefix of the plugin's HTTP API. Relative, so a mounted deployment resolves it against the page. */
|
|
@@ -247,6 +253,1062 @@ window.__ModuleLoader__.load({
|
|
|
247
253
|
})}`;
|
|
248
254
|
}
|
|
249
255
|
//#endregion
|
|
256
|
+
//#region src/client/pages/catalogue/catalogue-api.ts
|
|
257
|
+
/** The host refused to go on because of something the person can decide: a world they already have, or one they changed. */
|
|
258
|
+
var InstallConflict = class extends Error {
|
|
259
|
+
reason;
|
|
260
|
+
changes;
|
|
261
|
+
constructor(message, reason, changes) {
|
|
262
|
+
super(message);
|
|
263
|
+
this.reason = reason;
|
|
264
|
+
this.changes = changes;
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
async function answer$3(response) {
|
|
268
|
+
if (!response.ok) {
|
|
269
|
+
const body = await response.json().catch(() => void 0);
|
|
270
|
+
const message = typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim();
|
|
271
|
+
if (response.status === 409 && (body?.reason === "exists" || body?.reason === "modified" || body?.reason === "unverified")) throw new InstallConflict(message, body.reason, Array.isArray(body.changes) ? body.changes.filter((line) => typeof line === "string") : []);
|
|
272
|
+
throw new Error(message);
|
|
273
|
+
}
|
|
274
|
+
return await response.json();
|
|
275
|
+
}
|
|
276
|
+
const get = async (path, params, signal) => await answer$3(await fetch(`${API_PREFIX}/catalogue/${path}?${new URLSearchParams(params)}`, {
|
|
277
|
+
credentials: "same-origin",
|
|
278
|
+
signal
|
|
279
|
+
}));
|
|
280
|
+
const loadSources = async (signal) => await get("sources", {}, signal);
|
|
281
|
+
const loadWorlds = async (source, kind, search, sort, offset, signal) => await get("worlds", {
|
|
282
|
+
source,
|
|
283
|
+
kind,
|
|
284
|
+
search,
|
|
285
|
+
sort,
|
|
286
|
+
offset: String(offset)
|
|
287
|
+
}, signal);
|
|
288
|
+
const loadUpdates = async (source, signal) => await get("updates", { source }, signal);
|
|
289
|
+
const loadWorld = async (source, id, signal) => await get("world", {
|
|
290
|
+
source,
|
|
291
|
+
id
|
|
292
|
+
}, signal);
|
|
293
|
+
/** Where the host serves a world's cover from, asked with the catalogue's key. */
|
|
294
|
+
const coverUrl = (source, id) => `${API_PREFIX}/catalogue/cover?${new URLSearchParams({
|
|
295
|
+
source,
|
|
296
|
+
id
|
|
297
|
+
})}`;
|
|
298
|
+
async function install(request) {
|
|
299
|
+
return await answer$3(await fetch(`${API_PREFIX}/catalogue/install`, {
|
|
300
|
+
method: "POST",
|
|
301
|
+
credentials: "same-origin",
|
|
302
|
+
headers: { "content-type": "application/json" },
|
|
303
|
+
body: JSON.stringify(request)
|
|
304
|
+
}));
|
|
305
|
+
}
|
|
306
|
+
async function convert(request) {
|
|
307
|
+
return await answer$3(await fetch(`${API_PREFIX}/catalogue/convert`, {
|
|
308
|
+
method: "POST",
|
|
309
|
+
credentials: "same-origin",
|
|
310
|
+
headers: { "content-type": "application/json" },
|
|
311
|
+
body: JSON.stringify(request)
|
|
312
|
+
}));
|
|
313
|
+
}
|
|
314
|
+
/** The address a catalogue serves a release's archive from. */
|
|
315
|
+
function downloadUrl(baseUrl, versionId) {
|
|
316
|
+
return `${baseUrl.trim().replace(/\/+$/, "")}/versions/${encodeURIComponent(versionId)}/download`;
|
|
317
|
+
}
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/client/pages/catalogue/catalogue-controller.ts
|
|
320
|
+
const messageOf$5 = (error) => error instanceof Error ? error.message : String(error);
|
|
321
|
+
/** The configured catalogues as the host sees them, read again whenever the settings change. */
|
|
322
|
+
var CatalogueController = class {
|
|
323
|
+
openChat;
|
|
324
|
+
store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
|
|
325
|
+
status: "idle",
|
|
326
|
+
sources: [],
|
|
327
|
+
revision: 0
|
|
328
|
+
});
|
|
329
|
+
abort = new AbortController();
|
|
330
|
+
face = {
|
|
331
|
+
hooks: { catalogue: this.store },
|
|
332
|
+
load: () => {
|
|
333
|
+
this.read();
|
|
334
|
+
},
|
|
335
|
+
openChat: (chatSessionId) => {
|
|
336
|
+
this.openChat(chatSessionId);
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
constructor(openChat) {
|
|
340
|
+
this.openChat = openChat;
|
|
341
|
+
}
|
|
342
|
+
inject() {
|
|
343
|
+
return this.face;
|
|
344
|
+
}
|
|
345
|
+
/** Reads them again; the page asks for its worlds again when the sources differ from before. */
|
|
346
|
+
async read() {
|
|
347
|
+
this.store.update((draft) => {
|
|
348
|
+
if (draft.status === "idle") draft.status = "loading";
|
|
349
|
+
});
|
|
350
|
+
try {
|
|
351
|
+
const sources = await loadSources(this.abort.signal);
|
|
352
|
+
this.store.update((draft) => {
|
|
353
|
+
if (JSON.stringify(draft.sources) !== JSON.stringify(sources)) draft.revision += 1;
|
|
354
|
+
draft.status = "ready";
|
|
355
|
+
draft.sources = sources;
|
|
356
|
+
delete draft.error;
|
|
357
|
+
});
|
|
358
|
+
} catch (error) {
|
|
359
|
+
if (this.abort.signal.aborted) return;
|
|
360
|
+
this.store.update((draft) => {
|
|
361
|
+
draft.error = messageOf$5(error);
|
|
362
|
+
if (draft.status === "loading") draft.status = "failed";
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
dispose() {
|
|
367
|
+
this.abort.abort();
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/catalogue/CataloguePage.module.css.mjs
|
|
372
|
+
const css$26 = ".rp_qK1u-G_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_qK1u-G_toolbar{flex-wrap:wrap;flex:none;align-items:center;gap:8px;min-height:32px;display:flex}.rp_qK1u-G_spacer{flex:auto}.rp_qK1u-G_select,.rp_qK1u-G_search{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);height:32px;font:inherit;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);padding:0 8px;font-size:12px}.rp_qK1u-G_search{min-width:200px}.rp_qK1u-G_select:focus-visible,.rp_qK1u-G_search:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}.rp_qK1u-G_status{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}.rp_qK1u-G_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_qK1u-G_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_qK1u-G_grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_qK1u-G_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);min-width:0;font:inherit;text-align:left;color:inherit;background:var(--dsw-alias-settings-card-fill);cursor:pointer;flex-direction:column;padding:0;transition:border-color .12s;display:flex;overflow:hidden}.rp_qK1u-G_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_qK1u-G_card:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_qK1u-G_cover{aspect-ratio:4/3;background:var(--dsw-alias-bg-layer-3)}.rp_qK1u-G_image{object-fit:cover;width:100%;height:100%;display:block}.rp_qK1u-G_placeholder{color:#ffffffd9;background:linear-gradient(145deg, hsl(var(--rp-hue) 38% 46%), hsl(calc(var(--rp-hue) + 35) 38% 32%));user-select:none;justify-content:center;align-items:center;width:100%;height:100%;font-size:36px;font-weight:500;display:flex}.rp_qK1u-G_body{flex-direction:column;gap:4px;padding:8px 10px 10px;display:flex}.rp_qK1u-G_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_qK1u-G_meta{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_qK1u-G_tags{flex-wrap:wrap;gap:4px;display:flex}.rp_qK1u-G_more{justify-content:center;padding:12px 0;display:flex}.rp_qK1u-G_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 24px;font-size:13px}.rp_qK1u-G_form{flex-direction:column;gap:8px;display:flex}.rp_qK1u-G_field{flex-direction:column;gap:4px;display:flex}.rp_qK1u-G_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_qK1u-G_detail{flex-direction:column;gap:8px;font-size:13px;display:flex}.rp_qK1u-G_description{white-space:pre-wrap;max-height:240px;color:var(--dsw-alias-label-secondary);margin:0;overflow-y:auto}.rp_qK1u-G_success{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_qK1u-G_kinds{border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;gap:16px;display:flex}.rp_qK1u-G_kind{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;margin-bottom:-1px;padding:4px 0 6px;font-size:13px}.rp_qK1u-G_kind[aria-selected=true]{border-bottom-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary);font-weight:500}.rp_qK1u-G_kind:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.rp_qK1u-G_updates{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;flex:none;align-items:center;gap:4px 8px;margin:0;padding:0;font-size:12px;list-style:none;display:flex}.rp_qK1u-G_update{border:.5px solid var(--dsw-alias-state-business-primary);border-radius:var(--dsw-radius-sm);font:inherit;color:var(--dsw-alias-state-business-primary);cursor:pointer;background:0 0;padding:2px 8px}.rp_qK1u-G_warning{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);flex-direction:column;gap:8px;padding:8px 12px;font-size:12px;display:flex}.rp_qK1u-G_warning p{margin:0}.rp_qK1u-G_changes{font-family:var(--dsw-font-mono,monospace);color:var(--dsw-alias-label-tertiary);margin:0;padding-left:16px;font-size:11px}.rp_qK1u-G_actions{flex-wrap:wrap;gap:8px;display:flex}";
|
|
373
|
+
const key$26 = "src/client/pages/catalogue/CataloguePage.module.css";
|
|
374
|
+
let tag$26 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$26) + "]");
|
|
375
|
+
if (tag$26 === null) {
|
|
376
|
+
tag$26 = document.createElement("style");
|
|
377
|
+
tag$26.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
378
|
+
tag$26.dataset.pluginCss = key$26;
|
|
379
|
+
document.head.appendChild(tag$26);
|
|
380
|
+
}
|
|
381
|
+
tag$26.textContent = css$26;
|
|
382
|
+
var CataloguePage_module_css_default = {
|
|
383
|
+
"kind": "rp_qK1u-G_kind",
|
|
384
|
+
"message": "rp_qK1u-G_message",
|
|
385
|
+
"actions": "rp_qK1u-G_actions",
|
|
386
|
+
"warning": "rp_qK1u-G_warning",
|
|
387
|
+
"grid": "rp_qK1u-G_grid",
|
|
388
|
+
"toolbar": "rp_qK1u-G_toolbar",
|
|
389
|
+
"more": "rp_qK1u-G_more",
|
|
390
|
+
"card": "rp_qK1u-G_card",
|
|
391
|
+
"notice": "rp_qK1u-G_notice",
|
|
392
|
+
"update": "rp_qK1u-G_update",
|
|
393
|
+
"viewport": "rp_qK1u-G_viewport",
|
|
394
|
+
"page": "rp_qK1u-G_page",
|
|
395
|
+
"meta": "rp_qK1u-G_meta",
|
|
396
|
+
"detail": "rp_qK1u-G_detail",
|
|
397
|
+
"label": "rp_qK1u-G_label",
|
|
398
|
+
"image": "rp_qK1u-G_image",
|
|
399
|
+
"form": "rp_qK1u-G_form",
|
|
400
|
+
"updates": "rp_qK1u-G_updates",
|
|
401
|
+
"tags": "rp_qK1u-G_tags",
|
|
402
|
+
"field": "rp_qK1u-G_field",
|
|
403
|
+
"kinds": "rp_qK1u-G_kinds",
|
|
404
|
+
"spacer": "rp_qK1u-G_spacer",
|
|
405
|
+
"status": "rp_qK1u-G_status",
|
|
406
|
+
"changes": "rp_qK1u-G_changes",
|
|
407
|
+
"search": "rp_qK1u-G_search",
|
|
408
|
+
"cover": "rp_qK1u-G_cover",
|
|
409
|
+
"name": "rp_qK1u-G_name",
|
|
410
|
+
"placeholder": "rp_qK1u-G_placeholder",
|
|
411
|
+
"select": "rp_qK1u-G_select",
|
|
412
|
+
"body": "rp_qK1u-G_body",
|
|
413
|
+
"success": "rp_qK1u-G_success",
|
|
414
|
+
"description": "rp_qK1u-G_description"
|
|
415
|
+
};
|
|
416
|
+
//#endregion
|
|
417
|
+
//#region src/client/pages/catalogue/ImportUrlDialog.tsx
|
|
418
|
+
/** Installs a world from the address of its archive; an address on a configured catalogue's site is asked for with that catalogue's key. */
|
|
419
|
+
function ImportUrlDialog({ t, onClose, onInstalled }) {
|
|
420
|
+
const formId = (0, react.useId)();
|
|
421
|
+
const [address, setAddress] = (0, react.useState)("");
|
|
422
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
423
|
+
const [error, setError] = (0, react.useState)();
|
|
424
|
+
const submit = () => {
|
|
425
|
+
if (address.trim() === "" || busy) return;
|
|
426
|
+
setBusy(true);
|
|
427
|
+
setError(void 0);
|
|
428
|
+
install({ url: address.trim() }).then((result) => {
|
|
429
|
+
onInstalled(result.world.name, result.packs);
|
|
430
|
+
}, (failure) => {
|
|
431
|
+
setBusy(false);
|
|
432
|
+
setError(failure instanceof Error ? failure.message : String(failure));
|
|
433
|
+
});
|
|
434
|
+
};
|
|
435
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
436
|
+
open: true,
|
|
437
|
+
onClose,
|
|
438
|
+
title: t("importTitle"),
|
|
439
|
+
description: t("importHelp"),
|
|
440
|
+
closeLabel: t("close"),
|
|
441
|
+
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
442
|
+
variant: "ghost",
|
|
443
|
+
disabled: busy,
|
|
444
|
+
onClick: onClose,
|
|
445
|
+
children: t("cancel")
|
|
446
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
447
|
+
variant: "primary",
|
|
448
|
+
type: "submit",
|
|
449
|
+
form: formId,
|
|
450
|
+
disabled: busy || address.trim() === "",
|
|
451
|
+
children: busy ? t("installing") : t("importSubmit")
|
|
452
|
+
})] }),
|
|
453
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
454
|
+
id: formId,
|
|
455
|
+
className: CataloguePage_module_css_default.form,
|
|
456
|
+
onSubmit: (event) => {
|
|
457
|
+
event.preventDefault();
|
|
458
|
+
submit();
|
|
459
|
+
},
|
|
460
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
461
|
+
className: CataloguePage_module_css_default.field,
|
|
462
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
463
|
+
className: CataloguePage_module_css_default.label,
|
|
464
|
+
children: t("importAddress")
|
|
465
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
466
|
+
value: address,
|
|
467
|
+
placeholder: t("importAddressPlaceholder"),
|
|
468
|
+
"data-modal-autofocus": true,
|
|
469
|
+
onChange: (event) => {
|
|
470
|
+
setAddress(event.target.value);
|
|
471
|
+
}
|
|
472
|
+
})]
|
|
473
|
+
}), error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
474
|
+
className: CataloguePage_module_css_default.notice,
|
|
475
|
+
role: "alert",
|
|
476
|
+
children: t("installFailed", { message: error })
|
|
477
|
+
})]
|
|
478
|
+
})
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region src/client/pages/catalogue/WorldDialog.tsx
|
|
483
|
+
const sizeOf = (bytes) => bytes >= 1048576 ? `${(bytes / 1024 / 1024).toFixed(1)} MB` : `${Math.max(1, Math.round(bytes / 1024))} KB`;
|
|
484
|
+
const dateOf = (iso) => {
|
|
485
|
+
const date = new Date(iso);
|
|
486
|
+
return Number.isNaN(date.getTime()) ? iso : date.toLocaleDateString();
|
|
487
|
+
};
|
|
488
|
+
const messageOf$4 = (problem) => problem instanceof Error ? problem.message : String(problem);
|
|
489
|
+
/** One entry of a catalogue: what it says about itself, its releases, and installing, updating or converting one of them. */
|
|
490
|
+
function WorldDialog({ t, source, id, name, kind, onClose, onChanged, openChat }) {
|
|
491
|
+
const [detail, setDetail] = (0, react.useState)();
|
|
492
|
+
const [error, setError] = (0, react.useState)();
|
|
493
|
+
const [versionId, setVersionId] = (0, react.useState)("");
|
|
494
|
+
const [busy, setBusy] = (0, react.useState)();
|
|
495
|
+
const [done, setDone] = (0, react.useState)();
|
|
496
|
+
const [failure, setFailure] = (0, react.useState)();
|
|
497
|
+
const [conflict, setConflict] = (0, react.useState)();
|
|
498
|
+
const [started, setStarted] = (0, react.useState)();
|
|
499
|
+
(0, react.useEffect)(() => {
|
|
500
|
+
const abort = new AbortController();
|
|
501
|
+
loadWorld(source.name, id, abort.signal).then((loaded) => {
|
|
502
|
+
setDetail(loaded);
|
|
503
|
+
setVersionId(loaded.versions[0]?.id ?? "");
|
|
504
|
+
}, (problem) => {
|
|
505
|
+
if (!abort.signal.aborted) setError(messageOf$4(problem));
|
|
506
|
+
});
|
|
507
|
+
return () => {
|
|
508
|
+
abort.abort();
|
|
509
|
+
};
|
|
510
|
+
}, [source.name, id]);
|
|
511
|
+
const version = detail?.versions.find((candidate) => candidate.id === versionId);
|
|
512
|
+
const installed = detail?.installed;
|
|
513
|
+
const installedIndex = installed?.versionId === void 0 ? -1 : detail?.versions.findIndex((entry) => entry.id === installed.versionId) ?? -1;
|
|
514
|
+
const selectedIndex = detail?.versions.findIndex((entry) => entry.id === versionId) ?? -1;
|
|
515
|
+
const isInstalledRelease = installed?.versionId !== void 0 && installed.versionId === versionId;
|
|
516
|
+
const newer = installed !== void 0 && !isInstalledRelease && (installedIndex === -1 || selectedIndex < installedIndex);
|
|
517
|
+
const run = (mode, overwriteChanges = false) => {
|
|
518
|
+
if (version === void 0) return;
|
|
519
|
+
setBusy(mode);
|
|
520
|
+
setFailure(void 0);
|
|
521
|
+
setConflict(void 0);
|
|
522
|
+
install({
|
|
523
|
+
url: downloadUrl(source.baseUrl, version.id),
|
|
524
|
+
...version.sha256 === void 0 ? {} : { sha256: version.sha256 },
|
|
525
|
+
mode,
|
|
526
|
+
...overwriteChanges ? { overwriteChanges } : {}
|
|
527
|
+
}).then((result) => {
|
|
528
|
+
setBusy(void 0);
|
|
529
|
+
setDone({
|
|
530
|
+
text: mode === "update" ? t("updated", {
|
|
531
|
+
name: result.world.name,
|
|
532
|
+
version: version.version
|
|
533
|
+
}) : t("installed", { name: result.world.name }),
|
|
534
|
+
packs: result.packs,
|
|
535
|
+
untracked: !result.tracked && mode !== "copy",
|
|
536
|
+
...result.backup === void 0 ? {} : { backup: result.backup }
|
|
537
|
+
});
|
|
538
|
+
onChanged();
|
|
539
|
+
}, (problem) => {
|
|
540
|
+
setBusy(void 0);
|
|
541
|
+
if (problem instanceof InstallConflict && problem.reason !== "exists") setConflict(problem);
|
|
542
|
+
else setFailure(t("installFailed", { message: messageOf$4(problem) }));
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
const runConvert = () => {
|
|
546
|
+
if (version === void 0) return;
|
|
547
|
+
setBusy("convert");
|
|
548
|
+
setFailure(void 0);
|
|
549
|
+
convert({
|
|
550
|
+
source: source.name,
|
|
551
|
+
versionId: version.id,
|
|
552
|
+
language: t("language")
|
|
553
|
+
}).then((result) => {
|
|
554
|
+
setBusy(void 0);
|
|
555
|
+
onChanged();
|
|
556
|
+
if (result.started) try {
|
|
557
|
+
openChat(result.chatSessionId);
|
|
558
|
+
onClose();
|
|
559
|
+
} catch (problem) {
|
|
560
|
+
setFailure(t("convertFailed", { message: messageOf$4(problem) }));
|
|
561
|
+
}
|
|
562
|
+
else setStarted({
|
|
563
|
+
...result,
|
|
564
|
+
name: detail?.name ?? name
|
|
565
|
+
});
|
|
566
|
+
}, (problem) => {
|
|
567
|
+
setBusy(void 0);
|
|
568
|
+
setFailure(t("convertFailed", { message: messageOf$4(problem) }));
|
|
569
|
+
});
|
|
570
|
+
};
|
|
571
|
+
const idle = busy === void 0 && done === void 0 && started === void 0 && conflict === void 0;
|
|
572
|
+
const primary = kind === "card" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
573
|
+
variant: "primary",
|
|
574
|
+
disabled: !idle || version === void 0,
|
|
575
|
+
onClick: runConvert,
|
|
576
|
+
children: busy === "convert" ? t("converting") : t("convert")
|
|
577
|
+
}) : installed === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
578
|
+
variant: "primary",
|
|
579
|
+
disabled: !idle || version === void 0,
|
|
580
|
+
onClick: () => {
|
|
581
|
+
run("new");
|
|
582
|
+
},
|
|
583
|
+
children: busy === "new" ? t("installing") : t("install")
|
|
584
|
+
}) : newer ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
585
|
+
variant: "primary",
|
|
586
|
+
disabled: !idle || version === void 0,
|
|
587
|
+
onClick: () => {
|
|
588
|
+
run("update");
|
|
589
|
+
},
|
|
590
|
+
children: busy === "update" ? t("updating") : t("update")
|
|
591
|
+
}) : void 0;
|
|
592
|
+
const copy = kind === "world" && installed !== void 0 && version !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
593
|
+
variant: "outline",
|
|
594
|
+
disabled: !idle,
|
|
595
|
+
onClick: () => {
|
|
596
|
+
run("copy");
|
|
597
|
+
},
|
|
598
|
+
children: busy === "copy" ? t("installing") : t("installCopy")
|
|
599
|
+
}) : void 0;
|
|
600
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
601
|
+
open: true,
|
|
602
|
+
onClose,
|
|
603
|
+
title: detail?.name ?? name,
|
|
604
|
+
closeLabel: t("close"),
|
|
605
|
+
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
606
|
+
copy,
|
|
607
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
608
|
+
variant: "ghost",
|
|
609
|
+
disabled: busy !== void 0,
|
|
610
|
+
onClick: onClose,
|
|
611
|
+
children: t("close")
|
|
612
|
+
}),
|
|
613
|
+
primary
|
|
614
|
+
] }),
|
|
615
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
616
|
+
className: CataloguePage_module_css_default.detail,
|
|
617
|
+
"data-testid": "roleplay-catalogue-detail",
|
|
618
|
+
children: [
|
|
619
|
+
error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
620
|
+
className: CataloguePage_module_css_default.notice,
|
|
621
|
+
role: "alert",
|
|
622
|
+
children: t("detailFailed", { message: error })
|
|
623
|
+
}),
|
|
624
|
+
detail !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
625
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
626
|
+
className: CataloguePage_module_css_default.meta,
|
|
627
|
+
children: [detail.author === "" ? "" : t("by", { author: detail.author }), detail.language].filter((text) => text !== "").join(" · ")
|
|
628
|
+
}),
|
|
629
|
+
detail.tags.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
630
|
+
className: CataloguePage_module_css_default.tags,
|
|
631
|
+
children: detail.tags.map((tag) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
632
|
+
tone: "neutral",
|
|
633
|
+
children: tag
|
|
634
|
+
}, tag))
|
|
635
|
+
}),
|
|
636
|
+
detail.description !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
637
|
+
className: CataloguePage_module_css_default.description,
|
|
638
|
+
children: detail.description
|
|
639
|
+
}),
|
|
640
|
+
detail.versions.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
641
|
+
className: CataloguePage_module_css_default.notice,
|
|
642
|
+
children: t("noRelease")
|
|
643
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
644
|
+
className: CataloguePage_module_css_default.field,
|
|
645
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
646
|
+
className: CataloguePage_module_css_default.label,
|
|
647
|
+
children: t("version")
|
|
648
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
649
|
+
className: CataloguePage_module_css_default.select,
|
|
650
|
+
value: versionId,
|
|
651
|
+
disabled: busy !== void 0 || done !== void 0,
|
|
652
|
+
onChange: (event) => {
|
|
653
|
+
setVersionId(event.target.value);
|
|
654
|
+
},
|
|
655
|
+
children: detail.versions.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
|
|
656
|
+
value: entry.id,
|
|
657
|
+
children: [t("released", {
|
|
658
|
+
version: entry.version,
|
|
659
|
+
date: dateOf(entry.publishedAt)
|
|
660
|
+
}), entry.byteSize === void 0 ? "" : ` · ${sizeOf(entry.byteSize)}`]
|
|
661
|
+
}, entry.id))
|
|
662
|
+
})]
|
|
663
|
+
}),
|
|
664
|
+
kind === "card" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
665
|
+
className: CataloguePage_module_css_default.success,
|
|
666
|
+
children: t("convertNote")
|
|
667
|
+
}),
|
|
668
|
+
kind === "card" && detail.converted !== void 0 && detail.converted.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
669
|
+
className: CataloguePage_module_css_default.success,
|
|
670
|
+
children: t("convertedBefore", { names: detail.converted.map((world) => world.name).join(", ") })
|
|
671
|
+
}),
|
|
672
|
+
installed !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
673
|
+
className: CataloguePage_module_css_default.success,
|
|
674
|
+
children: [
|
|
675
|
+
installed.versionId === void 0 ? t("installedUnknown") : t("installedFrom", { version: detail.versions.find((entry) => entry.id === installed.versionId)?.version ?? installed.version ?? "" }),
|
|
676
|
+
installed.modified === true ? ` ${t("installedModified")}` : "",
|
|
677
|
+
isInstalledRelease ? ` ${t("installedCurrent")}` : ""
|
|
678
|
+
]
|
|
679
|
+
})
|
|
680
|
+
] }),
|
|
681
|
+
conflict !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
682
|
+
className: CataloguePage_module_css_default.warning,
|
|
683
|
+
role: "alert",
|
|
684
|
+
"data-testid": "roleplay-catalogue-conflict",
|
|
685
|
+
children: [
|
|
686
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: conflict.reason === "modified" ? t("conflictModified") : t("conflictUnverified") }),
|
|
687
|
+
conflict.changes.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("changesHeading") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
688
|
+
className: CataloguePage_module_css_default.changes,
|
|
689
|
+
children: conflict.changes.map((line) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: line }, line))
|
|
690
|
+
})] }),
|
|
691
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
692
|
+
className: CataloguePage_module_css_default.actions,
|
|
693
|
+
children: [
|
|
694
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
695
|
+
variant: "outline",
|
|
696
|
+
size: "sm",
|
|
697
|
+
onClick: () => {
|
|
698
|
+
run("update", true);
|
|
699
|
+
},
|
|
700
|
+
children: t("overwrite")
|
|
701
|
+
}),
|
|
702
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
703
|
+
variant: "outline",
|
|
704
|
+
size: "sm",
|
|
705
|
+
onClick: () => {
|
|
706
|
+
run("copy");
|
|
707
|
+
},
|
|
708
|
+
children: t("keepBoth")
|
|
709
|
+
}),
|
|
710
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
711
|
+
variant: "ghost",
|
|
712
|
+
size: "sm",
|
|
713
|
+
onClick: () => {
|
|
714
|
+
setConflict(void 0);
|
|
715
|
+
},
|
|
716
|
+
children: t("dismiss")
|
|
717
|
+
})
|
|
718
|
+
]
|
|
719
|
+
})
|
|
720
|
+
]
|
|
721
|
+
}),
|
|
722
|
+
failure !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
723
|
+
className: CataloguePage_module_css_default.notice,
|
|
724
|
+
role: "alert",
|
|
725
|
+
children: failure
|
|
726
|
+
}),
|
|
727
|
+
started !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
728
|
+
className: CataloguePage_module_css_default.warning,
|
|
729
|
+
role: "alert",
|
|
730
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("convertNotStarted", {
|
|
731
|
+
name: started.name,
|
|
732
|
+
failure: started.failure ?? ""
|
|
733
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
734
|
+
className: CataloguePage_module_css_default.actions,
|
|
735
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
736
|
+
variant: "outline",
|
|
737
|
+
size: "sm",
|
|
738
|
+
onClick: () => {
|
|
739
|
+
try {
|
|
740
|
+
openChat(started.chatSessionId);
|
|
741
|
+
onClose();
|
|
742
|
+
} catch (problem) {
|
|
743
|
+
setFailure(t("convertFailed", { message: messageOf$4(problem) }));
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
children: t("openChat")
|
|
747
|
+
})
|
|
748
|
+
})]
|
|
749
|
+
}),
|
|
750
|
+
done !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
751
|
+
className: CataloguePage_module_css_default.success,
|
|
752
|
+
role: "status",
|
|
753
|
+
children: [
|
|
754
|
+
done.text,
|
|
755
|
+
done.backup === void 0 ? "" : ` ${t("backupNotice", { backup: done.backup })}`,
|
|
756
|
+
done.packs.length > 0 ? ` ${t("packsNotice", { packs: done.packs.join(", ") })}` : "",
|
|
757
|
+
done.untracked ? ` ${t("untracked")}` : ""
|
|
758
|
+
]
|
|
759
|
+
})
|
|
760
|
+
]
|
|
761
|
+
})
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
//#endregion
|
|
765
|
+
//#region src/client/pages/catalogue/CataloguePage.tsx
|
|
766
|
+
const hueOf$5 = (name) => Array.from(name).reduce((hash, char) => (hash * 31 + char.charCodeAt(0)) % 360, 0);
|
|
767
|
+
/** The worlds of the configured catalogues, to look through and install. */
|
|
768
|
+
function CataloguePage({ t, useCatalogue, load, openChat }) {
|
|
769
|
+
const state = useCatalogue((snapshot) => snapshot);
|
|
770
|
+
const usable = state.sources.filter((source) => source.problem === void 0);
|
|
771
|
+
const [selected, setSelected] = (0, react.useState)("");
|
|
772
|
+
const [kind, setKind] = (0, react.useState)("world");
|
|
773
|
+
const source = usable.find((candidate) => candidate.name === selected) ?? usable[0];
|
|
774
|
+
const [search, setSearch] = (0, react.useState)("");
|
|
775
|
+
const [applied, setApplied] = (0, react.useState)("");
|
|
776
|
+
const [sort, setSort] = (0, react.useState)("recent");
|
|
777
|
+
const [page, setPage] = (0, react.useState)();
|
|
778
|
+
const [loading, setLoading] = (0, react.useState)(false);
|
|
779
|
+
const [more, setMore] = (0, react.useState)(false);
|
|
780
|
+
const [error, setError] = (0, react.useState)();
|
|
781
|
+
const [reload, setReload] = (0, react.useState)(0);
|
|
782
|
+
const [opened, setOpened] = (0, react.useState)();
|
|
783
|
+
const [updates, setUpdates] = (0, react.useState)();
|
|
784
|
+
const [updatesError, setUpdatesError] = (0, react.useState)();
|
|
785
|
+
const [changed, setChanged] = (0, react.useState)(0);
|
|
786
|
+
const [importing, setImporting] = (0, react.useState)(false);
|
|
787
|
+
const [notice, setNotice] = (0, react.useState)();
|
|
788
|
+
const request = (0, react.useRef)(0);
|
|
789
|
+
(0, react.useEffect)(() => {
|
|
790
|
+
load();
|
|
791
|
+
}, [load]);
|
|
792
|
+
const sourceName = source?.name;
|
|
793
|
+
const hasKey = source?.hasKey;
|
|
794
|
+
(0, react.useEffect)(() => {
|
|
795
|
+
if (sourceName === void 0) {
|
|
796
|
+
setPage(void 0);
|
|
797
|
+
return;
|
|
798
|
+
}
|
|
799
|
+
const abort = new AbortController();
|
|
800
|
+
const token = ++request.current;
|
|
801
|
+
setLoading(true);
|
|
802
|
+
setError(void 0);
|
|
803
|
+
loadWorlds(sourceName, kind, applied, sort, 0, abort.signal).then((loaded) => {
|
|
804
|
+
if (token === request.current) {
|
|
805
|
+
setPage(loaded);
|
|
806
|
+
setLoading(false);
|
|
807
|
+
}
|
|
808
|
+
}, (failure) => {
|
|
809
|
+
if (token === request.current && !abort.signal.aborted) {
|
|
810
|
+
setError(failure instanceof Error ? failure.message : String(failure));
|
|
811
|
+
setPage(void 0);
|
|
812
|
+
setLoading(false);
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
return () => {
|
|
816
|
+
abort.abort();
|
|
817
|
+
};
|
|
818
|
+
}, [
|
|
819
|
+
sourceName,
|
|
820
|
+
hasKey,
|
|
821
|
+
kind,
|
|
822
|
+
applied,
|
|
823
|
+
sort,
|
|
824
|
+
reload,
|
|
825
|
+
state.revision
|
|
826
|
+
]);
|
|
827
|
+
(0, react.useEffect)(() => {
|
|
828
|
+
if (sourceName === void 0) {
|
|
829
|
+
setUpdates(void 0);
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
832
|
+
const abort = new AbortController();
|
|
833
|
+
setUpdatesError(void 0);
|
|
834
|
+
loadUpdates(sourceName, abort.signal).then((found) => {
|
|
835
|
+
setUpdates(found);
|
|
836
|
+
}, (failure) => {
|
|
837
|
+
if (!abort.signal.aborted) {
|
|
838
|
+
setUpdates(void 0);
|
|
839
|
+
setUpdatesError(failure instanceof Error ? failure.message : String(failure));
|
|
840
|
+
}
|
|
841
|
+
});
|
|
842
|
+
return () => {
|
|
843
|
+
abort.abort();
|
|
844
|
+
};
|
|
845
|
+
}, [
|
|
846
|
+
sourceName,
|
|
847
|
+
hasKey,
|
|
848
|
+
reload,
|
|
849
|
+
changed,
|
|
850
|
+
state.revision
|
|
851
|
+
]);
|
|
852
|
+
const showMore = () => {
|
|
853
|
+
if (source === void 0 || page?.nextOffset === void 0) return;
|
|
854
|
+
const token = request.current;
|
|
855
|
+
setMore(true);
|
|
856
|
+
loadWorlds(source.name, kind, applied, sort, page.nextOffset, new AbortController().signal).then((next) => {
|
|
857
|
+
if (token === request.current) {
|
|
858
|
+
setPage({
|
|
859
|
+
items: [...page.items, ...next.items],
|
|
860
|
+
...next.nextOffset === void 0 ? {} : { nextOffset: next.nextOffset },
|
|
861
|
+
withKey: next.withKey
|
|
862
|
+
});
|
|
863
|
+
setMore(false);
|
|
864
|
+
}
|
|
865
|
+
}, (failure) => {
|
|
866
|
+
setError(failure instanceof Error ? failure.message : String(failure));
|
|
867
|
+
setMore(false);
|
|
868
|
+
});
|
|
869
|
+
};
|
|
870
|
+
const problems = state.sources.filter((entry) => entry.problem !== void 0);
|
|
871
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
872
|
+
className: CataloguePage_module_css_default.page,
|
|
873
|
+
"data-testid": "roleplay-catalogue-page",
|
|
874
|
+
children: [
|
|
875
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
876
|
+
className: CataloguePage_module_css_default.toolbar,
|
|
877
|
+
children: [
|
|
878
|
+
usable.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
879
|
+
className: CataloguePage_module_css_default.select,
|
|
880
|
+
value: source?.name ?? "",
|
|
881
|
+
"aria-label": t("source"),
|
|
882
|
+
onChange: (event) => {
|
|
883
|
+
setSelected(event.target.value);
|
|
884
|
+
setPage(void 0);
|
|
885
|
+
},
|
|
886
|
+
children: usable.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
887
|
+
value: entry.name,
|
|
888
|
+
children: entry.name
|
|
889
|
+
}, entry.name))
|
|
890
|
+
}),
|
|
891
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("form", {
|
|
892
|
+
onSubmit: (event) => {
|
|
893
|
+
event.preventDefault();
|
|
894
|
+
setApplied(search.trim());
|
|
895
|
+
},
|
|
896
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
897
|
+
className: CataloguePage_module_css_default.search,
|
|
898
|
+
type: "search",
|
|
899
|
+
value: search,
|
|
900
|
+
placeholder: kind === "card" ? t("searchCardsPlaceholder") : t("searchPlaceholder"),
|
|
901
|
+
"aria-label": t("search"),
|
|
902
|
+
disabled: source === void 0,
|
|
903
|
+
onChange: (event) => {
|
|
904
|
+
setSearch(event.target.value);
|
|
905
|
+
}
|
|
906
|
+
})
|
|
907
|
+
}),
|
|
908
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
909
|
+
className: CataloguePage_module_css_default.select,
|
|
910
|
+
value: sort,
|
|
911
|
+
"aria-label": t("sortRecent"),
|
|
912
|
+
disabled: source === void 0,
|
|
913
|
+
onChange: (event) => {
|
|
914
|
+
setSort(event.target.value === "popular" ? "popular" : "recent");
|
|
915
|
+
},
|
|
916
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
917
|
+
value: "recent",
|
|
918
|
+
children: t("sortRecent")
|
|
919
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
920
|
+
value: "popular",
|
|
921
|
+
children: t("sortPopular")
|
|
922
|
+
})]
|
|
923
|
+
}),
|
|
924
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: CataloguePage_module_css_default.spacer }),
|
|
925
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
926
|
+
variant: "outline",
|
|
927
|
+
size: "sm",
|
|
928
|
+
onClick: () => {
|
|
929
|
+
setImporting(true);
|
|
930
|
+
},
|
|
931
|
+
children: t("importUrl")
|
|
932
|
+
}),
|
|
933
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
934
|
+
variant: "outline",
|
|
935
|
+
size: "sm",
|
|
936
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, {}),
|
|
937
|
+
disabled: source === void 0 || loading,
|
|
938
|
+
onClick: () => {
|
|
939
|
+
load();
|
|
940
|
+
setReload((count) => count + 1);
|
|
941
|
+
},
|
|
942
|
+
children: loading ? t("refreshing") : t("refresh")
|
|
943
|
+
})
|
|
944
|
+
]
|
|
945
|
+
}),
|
|
946
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
947
|
+
className: CataloguePage_module_css_default.kinds,
|
|
948
|
+
role: "tablist",
|
|
949
|
+
children: ["world", "card"].map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
950
|
+
type: "button",
|
|
951
|
+
role: "tab",
|
|
952
|
+
className: CataloguePage_module_css_default.kind,
|
|
953
|
+
"aria-selected": kind === entry,
|
|
954
|
+
"data-testid": `roleplay-catalogue-kind-${entry}`,
|
|
955
|
+
onClick: () => {
|
|
956
|
+
setKind(entry);
|
|
957
|
+
setPage(void 0);
|
|
958
|
+
},
|
|
959
|
+
children: entry === "world" ? t("kindWorlds") : t("kindCards")
|
|
960
|
+
}, entry))
|
|
961
|
+
}),
|
|
962
|
+
source !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
963
|
+
className: CataloguePage_module_css_default.status,
|
|
964
|
+
"data-testid": "roleplay-catalogue-key",
|
|
965
|
+
children: source.hasKey ? t("withKey") : `${t("withoutKey")} ${t("withoutKeyHint")}`
|
|
966
|
+
}),
|
|
967
|
+
problems.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
968
|
+
className: CataloguePage_module_css_default.notice,
|
|
969
|
+
role: "alert",
|
|
970
|
+
children: t("sourceProblem", {
|
|
971
|
+
name: entry.name,
|
|
972
|
+
problem: entry.problem ?? ""
|
|
973
|
+
})
|
|
974
|
+
}, entry.name)),
|
|
975
|
+
updatesError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
976
|
+
className: CataloguePage_module_css_default.notice,
|
|
977
|
+
role: "alert",
|
|
978
|
+
children: t("updatesFailed", { message: updatesError })
|
|
979
|
+
}),
|
|
980
|
+
updates?.problems.map((problem) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
981
|
+
className: CataloguePage_module_css_default.notice,
|
|
982
|
+
role: "alert",
|
|
983
|
+
children: t("updatesProblem", {
|
|
984
|
+
name: problem.worldName,
|
|
985
|
+
message: problem.message
|
|
986
|
+
})
|
|
987
|
+
}, problem.worldName)),
|
|
988
|
+
kind === "world" && updates !== void 0 && updates.updates.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
|
|
989
|
+
className: CataloguePage_module_css_default.updates,
|
|
990
|
+
"data-testid": "roleplay-catalogue-updates",
|
|
991
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: t("updatesAvailable") }), updates.updates.map((update) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
992
|
+
type: "button",
|
|
993
|
+
className: CataloguePage_module_css_default.update,
|
|
994
|
+
onClick: () => {
|
|
995
|
+
setOpened({
|
|
996
|
+
id: update.resourceId,
|
|
997
|
+
name: update.worldName,
|
|
998
|
+
kind: "world"
|
|
999
|
+
});
|
|
1000
|
+
},
|
|
1001
|
+
children: t("updateItem", {
|
|
1002
|
+
name: update.worldName,
|
|
1003
|
+
from: update.installedVersion,
|
|
1004
|
+
to: update.latest.version
|
|
1005
|
+
})
|
|
1006
|
+
}) }, update.worldId))]
|
|
1007
|
+
}),
|
|
1008
|
+
notice !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1009
|
+
className: CataloguePage_module_css_default.status,
|
|
1010
|
+
role: "status",
|
|
1011
|
+
children: notice
|
|
1012
|
+
}),
|
|
1013
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1014
|
+
className: CataloguePage_module_css_default.viewport,
|
|
1015
|
+
children: state.status === "idle" || state.status === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1016
|
+
className: CataloguePage_module_css_default.message,
|
|
1017
|
+
children: t("loading")
|
|
1018
|
+
}) : state.status === "failed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1019
|
+
className: CataloguePage_module_css_default.message,
|
|
1020
|
+
role: "alert",
|
|
1021
|
+
children: t("loadFailed", { message: state.error ?? "" })
|
|
1022
|
+
}) : source === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
1023
|
+
className: CataloguePage_module_css_default.message,
|
|
1024
|
+
children: [
|
|
1025
|
+
t("noSources"),
|
|
1026
|
+
" ",
|
|
1027
|
+
t("noSourcesHint")
|
|
1028
|
+
]
|
|
1029
|
+
}) : error !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1030
|
+
className: CataloguePage_module_css_default.message,
|
|
1031
|
+
role: "alert",
|
|
1032
|
+
children: t("loadFailed", { message: error })
|
|
1033
|
+
}) : page === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1034
|
+
className: CataloguePage_module_css_default.message,
|
|
1035
|
+
children: t("loading")
|
|
1036
|
+
}) : page.items.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1037
|
+
className: CataloguePage_module_css_default.message,
|
|
1038
|
+
children: applied === "" ? kind === "card" ? t("emptyCards") : t("empty") : t("emptySearch", { search: applied })
|
|
1039
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
1040
|
+
className: CataloguePage_module_css_default.grid,
|
|
1041
|
+
children: page.items.map((world) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1042
|
+
type: "button",
|
|
1043
|
+
className: CataloguePage_module_css_default.card,
|
|
1044
|
+
"data-testid": "roleplay-catalogue-card",
|
|
1045
|
+
onClick: () => {
|
|
1046
|
+
setOpened({
|
|
1047
|
+
id: world.id,
|
|
1048
|
+
name: world.name,
|
|
1049
|
+
kind: world.kind
|
|
1050
|
+
});
|
|
1051
|
+
},
|
|
1052
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1053
|
+
className: CataloguePage_module_css_default.cover,
|
|
1054
|
+
children: world.hasCover ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
1055
|
+
className: CataloguePage_module_css_default.image,
|
|
1056
|
+
src: coverUrl(source.name, world.id),
|
|
1057
|
+
alt: "",
|
|
1058
|
+
decoding: "async"
|
|
1059
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1060
|
+
className: CataloguePage_module_css_default.placeholder,
|
|
1061
|
+
style: { "--rp-hue": hueOf$5(world.name) },
|
|
1062
|
+
"aria-hidden": "true",
|
|
1063
|
+
children: Array.from(world.name)[0]?.toUpperCase()
|
|
1064
|
+
})
|
|
1065
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1066
|
+
className: CataloguePage_module_css_default.body,
|
|
1067
|
+
children: [
|
|
1068
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1069
|
+
className: CataloguePage_module_css_default.name,
|
|
1070
|
+
children: world.name
|
|
1071
|
+
}),
|
|
1072
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1073
|
+
className: CataloguePage_module_css_default.meta,
|
|
1074
|
+
children: world.author === "" ? "" : t("by", { author: world.author })
|
|
1075
|
+
}),
|
|
1076
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1077
|
+
className: CataloguePage_module_css_default.tags,
|
|
1078
|
+
children: [world.visibility !== "public" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
1079
|
+
tone: "neutral",
|
|
1080
|
+
children: world.visibility === "private" ? t("private") : t("members")
|
|
1081
|
+
}), world.tags.slice(0, 3).map((tag) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
1082
|
+
tone: "neutral",
|
|
1083
|
+
children: tag
|
|
1084
|
+
}, tag))]
|
|
1085
|
+
})
|
|
1086
|
+
]
|
|
1087
|
+
})]
|
|
1088
|
+
}) }, world.id))
|
|
1089
|
+
}), page.nextOffset !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1090
|
+
className: CataloguePage_module_css_default.more,
|
|
1091
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1092
|
+
variant: "outline",
|
|
1093
|
+
size: "sm",
|
|
1094
|
+
disabled: more,
|
|
1095
|
+
onClick: showMore,
|
|
1096
|
+
children: more ? t("loadingMore") : t("more")
|
|
1097
|
+
})
|
|
1098
|
+
})] })
|
|
1099
|
+
}),
|
|
1100
|
+
opened !== void 0 && source !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorldDialog, {
|
|
1101
|
+
t,
|
|
1102
|
+
source,
|
|
1103
|
+
id: opened.id,
|
|
1104
|
+
name: opened.name,
|
|
1105
|
+
kind: opened.kind,
|
|
1106
|
+
openChat,
|
|
1107
|
+
onClose: () => {
|
|
1108
|
+
setOpened(void 0);
|
|
1109
|
+
},
|
|
1110
|
+
onChanged: () => {
|
|
1111
|
+
setNotice(void 0);
|
|
1112
|
+
setChanged((count) => count + 1);
|
|
1113
|
+
}
|
|
1114
|
+
}),
|
|
1115
|
+
importing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImportUrlDialog, {
|
|
1116
|
+
t,
|
|
1117
|
+
onClose: () => {
|
|
1118
|
+
setImporting(false);
|
|
1119
|
+
},
|
|
1120
|
+
onInstalled: (name, packs) => {
|
|
1121
|
+
setImporting(false);
|
|
1122
|
+
setNotice(`${t("installed", { name })}${packs.length > 0 ? ` ${t("packsNotice", { packs: packs.join(", ") })}` : ""}`);
|
|
1123
|
+
}
|
|
1124
|
+
})
|
|
1125
|
+
]
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
//#endregion
|
|
1129
|
+
//#region src/client/pages/catalogue/locales.ts
|
|
1130
|
+
const dictionaries$15 = {
|
|
1131
|
+
en: {
|
|
1132
|
+
nav: "Catalogue",
|
|
1133
|
+
loading: "Loading worlds…",
|
|
1134
|
+
loadFailed: "Could not load the worlds: {message}",
|
|
1135
|
+
noSources: "No catalogue is set up yet.",
|
|
1136
|
+
noSourcesHint: "Add one in Settings, Role Play, with its API address and, to see private worlds, an API key.",
|
|
1137
|
+
sourceProblem: "The catalogue \"{name}\" cannot be used: {problem}.",
|
|
1138
|
+
source: "Catalogue",
|
|
1139
|
+
search: "Search",
|
|
1140
|
+
searchPlaceholder: "Search worlds",
|
|
1141
|
+
sortRecent: "Newest",
|
|
1142
|
+
sortPopular: "Popular",
|
|
1143
|
+
refresh: "Refresh",
|
|
1144
|
+
refreshing: "Refreshing…",
|
|
1145
|
+
importUrl: "Import from address",
|
|
1146
|
+
withKey: "Using your API key: private worlds are shown.",
|
|
1147
|
+
withoutKey: "No API key: only public worlds are shown.",
|
|
1148
|
+
withoutKeyHint: "Add one in Settings, Role Play.",
|
|
1149
|
+
empty: "This catalogue has no published worlds for you.",
|
|
1150
|
+
emptySearch: "No world matches \"{search}\".",
|
|
1151
|
+
more: "Show more",
|
|
1152
|
+
loadingMore: "Loading…",
|
|
1153
|
+
by: "by {author}",
|
|
1154
|
+
private: "Private",
|
|
1155
|
+
members: "Members",
|
|
1156
|
+
close: "Close",
|
|
1157
|
+
cancel: "Cancel",
|
|
1158
|
+
detailFailed: "Could not load this world: {message}",
|
|
1159
|
+
version: "Release",
|
|
1160
|
+
released: "{version}, {date}",
|
|
1161
|
+
noRelease: "This world has no published release yet, so it cannot be installed.",
|
|
1162
|
+
alreadyHave: "You already have this world (\"{name}\").",
|
|
1163
|
+
install: "Install",
|
|
1164
|
+
installing: "Installing…",
|
|
1165
|
+
installed: "Installed \"{name}\". It is in your worlds now.",
|
|
1166
|
+
installFailed: "Could not install: {message}",
|
|
1167
|
+
packsNotice: "It came with interface packs ({packs}). A pack runs its own scripts in a sandbox when you play; look at them first if you do not know the author.",
|
|
1168
|
+
size: "{size}",
|
|
1169
|
+
importTitle: "Import a world from an address",
|
|
1170
|
+
importHelp: "Paste the address of a world archive (a ZIP). If it belongs to a catalogue you added, that catalogue's API key is used; otherwise it is fetched as it is, and it fails if the address needs a sign-in.",
|
|
1171
|
+
importAddress: "Address",
|
|
1172
|
+
importAddressPlaceholder: "https://catalogue.example/api/versions/…/download",
|
|
1173
|
+
importSubmit: "Import",
|
|
1174
|
+
language: "en",
|
|
1175
|
+
kindWorlds: "Worlds",
|
|
1176
|
+
kindCards: "Character cards",
|
|
1177
|
+
searchCardsPlaceholder: "Search character cards",
|
|
1178
|
+
emptyCards: "This catalogue has no published character cards for you.",
|
|
1179
|
+
update: "Update",
|
|
1180
|
+
updating: "Updating…",
|
|
1181
|
+
updated: "Updated \"{name}\" to release {version}.",
|
|
1182
|
+
backupNotice: "Your previous files are kept in {backup}.",
|
|
1183
|
+
installCopy: "Install as a separate copy",
|
|
1184
|
+
installedFrom: "You have this world, installed from release {version}.",
|
|
1185
|
+
installedUnknown: "You have this world, but it was not installed from this catalogue, so its release is not known.",
|
|
1186
|
+
installedModified: "You have changed its files since you installed it.",
|
|
1187
|
+
installedCurrent: "This is the release you have.",
|
|
1188
|
+
untracked: "It was installed from an address that is not a release of a catalogue you added, so it will not be offered updates.",
|
|
1189
|
+
conflictModified: "You changed this world since you installed it. Overwriting replaces your version with the release; your version is kept in the trash folder of your roleplay root. Keeping both installs the release as a separate world, named \"(copy)\", and leaves yours alone.",
|
|
1190
|
+
conflictUnverified: "There is no record of which release this world came from, so there is no telling whether you changed it. Overwriting replaces your version with the release; your version is kept in the trash folder of your roleplay root. Keeping both installs the release as a separate world, named \"(copy)\", and leaves yours alone.",
|
|
1191
|
+
changesHeading: "What differs:",
|
|
1192
|
+
overwrite: "Overwrite my version",
|
|
1193
|
+
keepBoth: "Keep both",
|
|
1194
|
+
dismiss: "Not now",
|
|
1195
|
+
updatesAvailable: "Newer releases of worlds you installed:",
|
|
1196
|
+
updateItem: "{name}: {from} to {to}",
|
|
1197
|
+
updatesFailed: "Could not check for updates: {message}",
|
|
1198
|
+
updatesProblem: "Could not check \"{name}\" for updates: {message}",
|
|
1199
|
+
convert: "Convert to a world",
|
|
1200
|
+
converting: "Converting…",
|
|
1201
|
+
convertNote: "A character card is turned into a new world by the authoring agent, which makes its own choices along the way, so converting the same card twice gives two different worlds. A card therefore never updates or replaces a world: converting it again always makes a new one.",
|
|
1202
|
+
convertedBefore: "You converted this card before ({names}). Converting again makes another new world and does not touch those.",
|
|
1203
|
+
convertFailed: "Could not convert: {message}",
|
|
1204
|
+
convertNotStarted: "The world \"{name}\" was made, but the conversion did not start: {failure}. Open its authoring chat to send the import message yourself.",
|
|
1205
|
+
openChat: "Open the chat"
|
|
1206
|
+
},
|
|
1207
|
+
zh: {
|
|
1208
|
+
nav: "目录",
|
|
1209
|
+
loading: "正在加载世界…",
|
|
1210
|
+
loadFailed: "无法加载世界:{message}",
|
|
1211
|
+
noSources: "还没有设置目录。",
|
|
1212
|
+
noSourcesHint: "请在“设置”的“角色扮演”中添加:填写 API 地址;要查看私有世界,还需填写 API 密钥。",
|
|
1213
|
+
sourceProblem: "目录“{name}”无法使用:{problem}。",
|
|
1214
|
+
source: "目录",
|
|
1215
|
+
search: "搜索",
|
|
1216
|
+
searchPlaceholder: "搜索世界",
|
|
1217
|
+
sortRecent: "最新",
|
|
1218
|
+
sortPopular: "热门",
|
|
1219
|
+
refresh: "刷新",
|
|
1220
|
+
refreshing: "刷新中…",
|
|
1221
|
+
importUrl: "从地址导入",
|
|
1222
|
+
withKey: "正在使用你的 API 密钥:显示私有世界。",
|
|
1223
|
+
withoutKey: "没有 API 密钥:只显示公开世界。",
|
|
1224
|
+
withoutKeyHint: "请在“设置”的“角色扮演”中添加。",
|
|
1225
|
+
empty: "这个目录里没有对你开放的已发布世界。",
|
|
1226
|
+
emptySearch: "没有与“{search}”匹配的世界。",
|
|
1227
|
+
more: "显示更多",
|
|
1228
|
+
loadingMore: "加载中…",
|
|
1229
|
+
by: "作者:{author}",
|
|
1230
|
+
private: "私有",
|
|
1231
|
+
members: "仅成员",
|
|
1232
|
+
close: "关闭",
|
|
1233
|
+
cancel: "取消",
|
|
1234
|
+
detailFailed: "无法加载这个世界:{message}",
|
|
1235
|
+
version: "发布版本",
|
|
1236
|
+
released: "{version},{date}",
|
|
1237
|
+
noRelease: "这个世界还没有已发布的版本,无法安装。",
|
|
1238
|
+
alreadyHave: "你已经有这个世界了(“{name}”)。",
|
|
1239
|
+
install: "安装",
|
|
1240
|
+
installing: "安装中…",
|
|
1241
|
+
installed: "已安装“{name}”,现在可以在你的世界里找到它。",
|
|
1242
|
+
installFailed: "无法安装:{message}",
|
|
1243
|
+
packsNotice: "它带有界面包({packs})。游玩时界面包会在沙盒中运行自己的脚本;如果你不了解作者,请先查看。",
|
|
1244
|
+
size: "{size}",
|
|
1245
|
+
importTitle: "从地址导入世界",
|
|
1246
|
+
importHelp: "粘贴世界压缩包(ZIP)的地址。如果它属于你添加的目录,会使用该目录的 API 密钥;否则按原样获取,地址需要登录时会失败。",
|
|
1247
|
+
importAddress: "地址",
|
|
1248
|
+
importAddressPlaceholder: "https://catalogue.example/api/versions/…/download",
|
|
1249
|
+
importSubmit: "导入",
|
|
1250
|
+
language: "zh",
|
|
1251
|
+
kindWorlds: "世界",
|
|
1252
|
+
kindCards: "角色卡",
|
|
1253
|
+
searchCardsPlaceholder: "搜索角色卡",
|
|
1254
|
+
emptyCards: "这个目录里没有对你开放的已发布角色卡。",
|
|
1255
|
+
update: "更新",
|
|
1256
|
+
updating: "更新中…",
|
|
1257
|
+
updated: "已将“{name}”更新到版本 {version}。",
|
|
1258
|
+
backupNotice: "你之前的文件保存在 {backup}。",
|
|
1259
|
+
installCopy: "另装一份副本",
|
|
1260
|
+
installedFrom: "你已有这个世界,安装自版本 {version}。",
|
|
1261
|
+
installedUnknown: "你已有这个世界,但它不是从这个目录安装的,因此不知道它对应哪个版本。",
|
|
1262
|
+
installedModified: "安装之后,你修改过它的文件。",
|
|
1263
|
+
installedCurrent: "这就是你已有的版本。",
|
|
1264
|
+
untracked: "它是从一个并非你所添加目录的发布版本的地址安装的,因此不会提示更新。",
|
|
1265
|
+
conflictModified: "安装之后你修改过这个世界。选择覆盖会用发布版本替换你的版本,你的版本会保留在角色扮演根目录的回收文件夹中。选择“都保留”会把发布版本另装为一个名为“(copy)”的独立世界,不动你的世界。",
|
|
1266
|
+
conflictUnverified: "没有记录这个世界来自哪个版本,因此无法判断你是否修改过它。选择覆盖会用发布版本替换你的版本,你的版本会保留在角色扮演根目录的回收文件夹中。选择“都保留”会把发布版本另装为一个名为“(copy)”的独立世界,不动你的世界。",
|
|
1267
|
+
changesHeading: "有差异的文件:",
|
|
1268
|
+
overwrite: "覆盖我的版本",
|
|
1269
|
+
keepBoth: "都保留",
|
|
1270
|
+
dismiss: "暂不",
|
|
1271
|
+
updatesAvailable: "你已安装的世界有新版本:",
|
|
1272
|
+
updateItem: "{name}:{from} → {to}",
|
|
1273
|
+
updatesFailed: "无法检查更新:{message}",
|
|
1274
|
+
updatesProblem: "无法检查“{name}”的更新:{message}",
|
|
1275
|
+
convert: "转换为世界",
|
|
1276
|
+
converting: "转换中…",
|
|
1277
|
+
convertNote: "角色卡由创作助手转换为一个新世界,转换过程中它会自行做出选择,所以同一张卡转换两次会得到两个不同的世界。因此角色卡不会更新或替换已有的世界:再次转换总是生成一个新世界。",
|
|
1278
|
+
convertedBefore: "你以前转换过这张卡({names})。再次转换会生成另一个新世界,不会改动那些世界。",
|
|
1279
|
+
convertFailed: "无法转换:{message}",
|
|
1280
|
+
convertNotStarted: "世界“{name}”已创建,但转换没有开始:{failure}。请打开它的创作对话,自己发送导入消息。",
|
|
1281
|
+
openChat: "打开对话"
|
|
1282
|
+
}
|
|
1283
|
+
};
|
|
1284
|
+
//#endregion
|
|
1285
|
+
//#region src/client/pages/catalogue/index.ts
|
|
1286
|
+
const NAMESPACE$10 = "roleplay.catalogue";
|
|
1287
|
+
/** Adds the Catalogue page to the Role Play panel: worlds of the catalogues set up in the settings. */
|
|
1288
|
+
function registerCataloguePage(ctx) {
|
|
1289
|
+
const t = ctx.locale.bind(NAMESPACE$10);
|
|
1290
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$10, dictionaries$15), "roleplay: catalogue dictionaries");
|
|
1291
|
+
const catalogue = new CatalogueController(createChatOpener(ctx));
|
|
1292
|
+
ctx.effect(() => () => {
|
|
1293
|
+
catalogue.dispose();
|
|
1294
|
+
}, "roleplay: catalogue requests");
|
|
1295
|
+
ctx.effect(() => ctx.configForms.get(ENTRY_ID).subscribe(() => {
|
|
1296
|
+
catalogue.read();
|
|
1297
|
+
}), "roleplay: catalogue settings");
|
|
1298
|
+
ctx.slots.inject("roleplay.page", () => ctx.slots.register({
|
|
1299
|
+
name: "roleplay.page",
|
|
1300
|
+
id: "catalogue",
|
|
1301
|
+
order: 3,
|
|
1302
|
+
label: () => t("nav"),
|
|
1303
|
+
locale: NAMESPACE$10,
|
|
1304
|
+
inject: () => catalogue.inject()
|
|
1305
|
+
}, CataloguePage));
|
|
1306
|
+
}
|
|
1307
|
+
//#endregion
|
|
1308
|
+
//#region src/shared/avatars.ts
|
|
1309
|
+
/** The id under which the player avatars are served by the world editor's routes: they are edited as the cast of a world of their own. */
|
|
1310
|
+
const AVATARS_WORLD_ID = "@avatars";
|
|
1311
|
+
//#endregion
|
|
250
1312
|
//#region src/client/avatars-api.ts
|
|
251
1313
|
async function failure$1(response) {
|
|
252
1314
|
const body = await response.json().catch(() => void 0);
|
|
@@ -453,12 +1515,33 @@ window.__ModuleLoader__.load({
|
|
|
453
1515
|
saveLore: async (key, edit, signal) => await put(`${API_PREFIX}/worlds/state/lore?id=${id}&key=${encodeURIComponent(key)}`, edit, signal),
|
|
454
1516
|
addLore: async (title, signal) => await postJson(`${API_PREFIX}/worlds/state/lore?id=${id}`, { title }, signal),
|
|
455
1517
|
removeLore: async (key, signal) => await remove(`${API_PREFIX}/worlds/state/lore?id=${id}&key=${encodeURIComponent(key)}`, signal),
|
|
1518
|
+
readTrigger: async (key, signal) => {
|
|
1519
|
+
const response = await fetch(`${API_PREFIX}/worlds/state/trigger?id=${id}&key=${encodeURIComponent(key)}`, {
|
|
1520
|
+
credentials: "same-origin",
|
|
1521
|
+
signal
|
|
1522
|
+
});
|
|
1523
|
+
if (!response.ok) {
|
|
1524
|
+
const body = await response.json().catch(() => void 0);
|
|
1525
|
+
throw new Error(Array.isArray(body?.problems) ? body.problems.join("; ") : typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim());
|
|
1526
|
+
}
|
|
1527
|
+
return await response.json();
|
|
1528
|
+
},
|
|
1529
|
+
writeTrigger: async (key, document, signal) => await answer$2(await fetch(`${API_PREFIX}/worlds/state/trigger?id=${id}&key=${encodeURIComponent(key)}`, {
|
|
1530
|
+
method: "PUT",
|
|
1531
|
+
credentials: "same-origin",
|
|
1532
|
+
headers: { "content-type": "application/json" },
|
|
1533
|
+
body: JSON.stringify(document),
|
|
1534
|
+
signal
|
|
1535
|
+
})),
|
|
1536
|
+
removeTrigger: async (key, signal) => await remove(`${API_PREFIX}/worlds/state/trigger?id=${id}&key=${encodeURIComponent(key)}`, signal),
|
|
456
1537
|
savePlots: async (edit, signal) => await put(`${API_PREFIX}/worlds/state/plots?id=${id}`, edit, signal),
|
|
457
1538
|
saveRelation: async (edit, signal) => await put(`${API_PREFIX}/worlds/state/relation?id=${id}`, edit, signal),
|
|
458
1539
|
saveNarrationVoice: async (voice, signal) => await put(`${API_PREFIX}/worlds/state/narration-voice?id=${id}`, { voice }, signal),
|
|
459
1540
|
listVoices: async (signal) => await listVoices(`${API_PREFIX}/speech/voices`, signal),
|
|
460
1541
|
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)
|
|
1542
|
+
uploadPortrait: async (key, file, signal) => await postFile(`${API_PREFIX}/worlds/state/character/portrait/upload?id=${id}&key=${encodeURIComponent(key)}`, file, signal),
|
|
1543
|
+
generateImage: async (kind, key, signal) => await post(`${API_PREFIX}/worlds/state/${kind}/image?id=${id}&key=${encodeURIComponent(key)}`, signal),
|
|
1544
|
+
uploadImage: async (kind, key, file, signal) => await postFile(`${API_PREFIX}/worlds/state/${kind}/image/upload?id=${id}&key=${encodeURIComponent(key)}`, file, signal)
|
|
462
1545
|
};
|
|
463
1546
|
}
|
|
464
1547
|
//#endregion
|
|
@@ -734,51 +1817,51 @@ window.__ModuleLoader__.load({
|
|
|
734
1817
|
const isDirty = (character, draft) => Object.keys(editOf$1(character, draft)).length > 0;
|
|
735
1818
|
//#endregion
|
|
736
1819
|
//#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$
|
|
738
|
-
const key$
|
|
739
|
-
let tag$
|
|
740
|
-
if (tag$
|
|
741
|
-
tag$
|
|
742
|
-
tag$
|
|
743
|
-
tag$
|
|
744
|
-
document.head.appendChild(tag$
|
|
1820
|
+
const css$25 = ".rp_5ZMIxq_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_5ZMIxq_tabs{border-bottom:.5px solid var(--dsw-alias-border-l2);flex:none;gap:4px;padding:0 24px;display:flex;overflow-x:auto}.rp_5ZMIxq_tab{font:inherit;white-space:nowrap;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;flex:none;margin-bottom:-1px;padding:12px 10px 10px;font-size:13px;line-height:20px}.rp_5ZMIxq_tabOn{color:var(--dsw-alias-state-business-primary);border-bottom-color:var(--dsw-alias-state-business-primary);font-weight:500}.rp_5ZMIxq_body{flex:1 1 0;min-height:0;overflow-y:auto}.rp_5ZMIxq_sheet{box-sizing:border-box;flex-direction:column;gap:20px;max-width:760px;padding:24px 24px 240px;display:flex}.rp_5ZMIxq_head{align-items:flex-start;gap:20px;display:flex}.rp_5ZMIxq_portrait{aspect-ratio:3/4;object-fit:cover;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);width:150px;height:auto;display:block}.rp_5ZMIxq_portraitBox{border-radius:var(--dsw-radius-lg);width:150px;height:200px;color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;flex:0 0 150px;padding:0;display:block;position:relative}.rp_5ZMIxq_portraitBox:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.rp_5ZMIxq_portraitBox:disabled{cursor:not-allowed}.rp_5ZMIxq_portraitAction{box-sizing:border-box;border-radius:0 0 var(--dsw-radius-lg) var(--dsw-radius-lg);color:#fff;text-align:center;opacity:0;background:#0000009e;padding:7px 6px;font-size:12px;line-height:16px;transition:opacity .12s;position:absolute;bottom:1px;left:1px;right:1px}.rp_5ZMIxq_portraitBox:hover .rp_5ZMIxq_portraitAction,.rp_5ZMIxq_portraitBox:focus-visible .rp_5ZMIxq_portraitAction,.rp_5ZMIxq_portraitBox:disabled .rp_5ZMIxq_portraitAction{opacity:1}.rp_5ZMIxq_portraitError,.rp_5ZMIxq_portraitHint{margin:12px 24px 0;font-size:12px}.rp_5ZMIxq_portraitError{color:var(--dsw-alias-state-danger-primary)}.rp_5ZMIxq_portraitHint{color:var(--dsw-alias-label-secondary)}.rp_5ZMIxq_placeholder{box-sizing:border-box;color:var(--dsw-alias-label-secondary);flex-direction:column;justify-content:center;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_initial{opacity:.6;font-size:48px;font-weight:500;line-height:1}.rp_5ZMIxq_missing{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5ZMIxq_meta{flex-direction:column;flex:1 1 0;gap:10px;min-width:0;display:flex}.rp_5ZMIxq_section{border-top:.5px solid var(--dsw-alias-border-l4);flex-direction:column;gap:6px;padding-top:16px;display:flex}.rp_5ZMIxq_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:500;line-height:20px}.rp_5ZMIxq_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 24px;font-size:13px}.rp_5ZMIxq_section .rp_5ZMIxq_empty{padding:0}.rp_5ZMIxq_tabsSpace{flex:auto}.rp_5ZMIxq_voiceInline{min-width:220px;color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:12px;display:flex}.rp_5ZMIxq_bar{border-bottom:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-2);flex:none;justify-content:flex-end;align-items:center;gap:8px;padding:6px 24px;display:flex}.rp_5ZMIxq_barText{color:var(--dsw-alias-label-secondary);margin-right:auto;font-size:12px}.rp_5ZMIxq_nameInput{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:var(--dsw-alias-label-primary);font:inherit;padding:4px 8px;font-size:14px;line-height:22px}.rp_5ZMIxq_row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_grid{grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:10px 12px;display:grid}.rp_5ZMIxq_field{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_5ZMIxq_wide{grid-column:1/-1}.rp_5ZMIxq_label,.rp_5ZMIxq_help{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5ZMIxq_error{color:var(--dsw-alias-state-error-primary);font-size:12px}.rp_5ZMIxq_select{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:inherit;font:inherit;padding:4px 8px;font-size:13px}.rp_5ZMIxq_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:96px;color:inherit;font:inherit;resize:vertical;padding:6px 8px;font-size:13px;line-height:20px}.rp_5ZMIxq_goal{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);flex-direction:column;gap:8px;padding:10px;display:flex}.rp_5ZMIxq_row>.rp_5ZMIxq_select{width:auto;min-width:110px}.rp_5ZMIxq_select:focus-visible,.rp_5ZMIxq_area:focus-visible,.rp_5ZMIxq_nameInput:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}@media (width<=640px){.rp_5ZMIxq_sheet{padding-inline:16px}.rp_5ZMIxq_head{flex-direction:column}.rp_5ZMIxq_portraitBox,.rp_5ZMIxq_portrait{width:120px}.rp_5ZMIxq_portraitBox{flex-basis:120px;height:160px}.rp_5ZMIxq_bar{flex-wrap:wrap;padding-inline:16px}.rp_5ZMIxq_voiceInline{width:100%;min-width:0}}";
|
|
1821
|
+
const key$25 = "src/client/world-editor/CharactersPanel.module.css";
|
|
1822
|
+
let tag$25 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$25) + "]");
|
|
1823
|
+
if (tag$25 === null) {
|
|
1824
|
+
tag$25 = document.createElement("style");
|
|
1825
|
+
tag$25.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
1826
|
+
tag$25.dataset.pluginCss = key$25;
|
|
1827
|
+
document.head.appendChild(tag$25);
|
|
745
1828
|
}
|
|
746
|
-
tag$
|
|
1829
|
+
tag$25.textContent = css$25;
|
|
747
1830
|
var CharactersPanel_module_css_default = {
|
|
748
|
-
"
|
|
749
|
-
"bar": "rp_5ZMIxq_bar",
|
|
750
|
-
"meta": "rp_5ZMIxq_meta",
|
|
751
|
-
"body": "rp_5ZMIxq_body",
|
|
752
|
-
"placeholder": "rp_5ZMIxq_placeholder",
|
|
753
|
-
"missing": "rp_5ZMIxq_missing",
|
|
1831
|
+
"tabsSpace": "rp_5ZMIxq_tabsSpace",
|
|
754
1832
|
"empty": "rp_5ZMIxq_empty",
|
|
755
|
-
"help": "rp_5ZMIxq_help",
|
|
756
|
-
"voiceInline": "rp_5ZMIxq_voiceInline",
|
|
757
|
-
"wide": "rp_5ZMIxq_wide",
|
|
758
|
-
"error": "rp_5ZMIxq_error",
|
|
759
|
-
"field": "rp_5ZMIxq_field",
|
|
760
|
-
"initial": "rp_5ZMIxq_initial",
|
|
761
|
-
"area": "rp_5ZMIxq_area",
|
|
762
|
-
"nameInput": "rp_5ZMIxq_nameInput",
|
|
763
|
-
"head": "rp_5ZMIxq_head",
|
|
764
|
-
"select": "rp_5ZMIxq_select",
|
|
765
|
-
"portraitHint": "rp_5ZMIxq_portraitHint",
|
|
766
|
-
"label": "rp_5ZMIxq_label",
|
|
767
|
-
"portrait": "rp_5ZMIxq_portrait",
|
|
768
|
-
"goal": "rp_5ZMIxq_goal",
|
|
769
|
-
"grid": "rp_5ZMIxq_grid",
|
|
770
|
-
"row": "rp_5ZMIxq_row",
|
|
771
1833
|
"sheet": "rp_5ZMIxq_sheet",
|
|
772
|
-
"
|
|
773
|
-
"portraitAction": "rp_5ZMIxq_portraitAction",
|
|
1834
|
+
"goal": "rp_5ZMIxq_goal",
|
|
774
1835
|
"sectionTitle": "rp_5ZMIxq_sectionTitle",
|
|
775
|
-
"
|
|
776
|
-
"
|
|
1836
|
+
"initial": "rp_5ZMIxq_initial",
|
|
1837
|
+
"placeholder": "rp_5ZMIxq_placeholder",
|
|
777
1838
|
"panel": "rp_5ZMIxq_panel",
|
|
1839
|
+
"grid": "rp_5ZMIxq_grid",
|
|
1840
|
+
"body": "rp_5ZMIxq_body",
|
|
778
1841
|
"portraitError": "rp_5ZMIxq_portraitError",
|
|
1842
|
+
"nameInput": "rp_5ZMIxq_nameInput",
|
|
779
1843
|
"tab": "rp_5ZMIxq_tab",
|
|
1844
|
+
"section": "rp_5ZMIxq_section",
|
|
1845
|
+
"head": "rp_5ZMIxq_head",
|
|
1846
|
+
"area": "rp_5ZMIxq_area",
|
|
1847
|
+
"error": "rp_5ZMIxq_error",
|
|
1848
|
+
"help": "rp_5ZMIxq_help",
|
|
1849
|
+
"missing": "rp_5ZMIxq_missing",
|
|
1850
|
+
"bar": "rp_5ZMIxq_bar",
|
|
1851
|
+
"tabOn": "rp_5ZMIxq_tabOn",
|
|
1852
|
+
"row": "rp_5ZMIxq_row",
|
|
1853
|
+
"label": "rp_5ZMIxq_label",
|
|
1854
|
+
"select": "rp_5ZMIxq_select",
|
|
1855
|
+
"portraitAction": "rp_5ZMIxq_portraitAction",
|
|
780
1856
|
"portraitBox": "rp_5ZMIxq_portraitBox",
|
|
781
|
-
"
|
|
1857
|
+
"meta": "rp_5ZMIxq_meta",
|
|
1858
|
+
"barText": "rp_5ZMIxq_barText",
|
|
1859
|
+
"voiceInline": "rp_5ZMIxq_voiceInline",
|
|
1860
|
+
"wide": "rp_5ZMIxq_wide",
|
|
1861
|
+
"tabs": "rp_5ZMIxq_tabs",
|
|
1862
|
+
"portrait": "rp_5ZMIxq_portrait",
|
|
1863
|
+
"portraitHint": "rp_5ZMIxq_portraitHint",
|
|
1864
|
+
"field": "rp_5ZMIxq_field"
|
|
782
1865
|
};
|
|
783
1866
|
//#endregion
|
|
784
1867
|
//#region src/client/world-editor/EditorTabs.tsx
|
|
@@ -830,7 +1913,7 @@ window.__ModuleLoader__.load({
|
|
|
830
1913
|
//#endregion
|
|
831
1914
|
//#region src/client/world-editor/CharactersPanel.tsx
|
|
832
1915
|
/** A steady colour per name, for a portrait that does not exist yet. */
|
|
833
|
-
function hueOf$
|
|
1916
|
+
function hueOf$4(name) {
|
|
834
1917
|
let hash = 0;
|
|
835
1918
|
for (const char of name) hash = (hash * 31 + char.charCodeAt(0)) % 360;
|
|
836
1919
|
return hash;
|
|
@@ -852,7 +1935,7 @@ window.__ModuleLoader__.load({
|
|
|
852
1935
|
decoding: "async"
|
|
853
1936
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
854
1937
|
className: `${CharactersPanel_module_css_default.portrait} ${CharactersPanel_module_css_default.placeholder}`,
|
|
855
|
-
style: { background: `hsl(${hueOf$
|
|
1938
|
+
style: { background: `hsl(${hueOf$4(character.name)} 22% 88%)` },
|
|
856
1939
|
role: "img",
|
|
857
1940
|
"aria-label": t("portraitMissing"),
|
|
858
1941
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -1496,6 +2579,100 @@ window.__ModuleLoader__.load({
|
|
|
1496
2579
|
});
|
|
1497
2580
|
}
|
|
1498
2581
|
//#endregion
|
|
2582
|
+
//#region src/client/world-editor/EntityImage.tsx
|
|
2583
|
+
/** A steady colour per name, for a picture that does not exist yet. */
|
|
2584
|
+
function hueOf$3(name) {
|
|
2585
|
+
let hash = 0;
|
|
2586
|
+
for (const char of name) hash = (hash * 31 + char.charCodeAt(0)) % 360;
|
|
2587
|
+
return hash;
|
|
2588
|
+
}
|
|
2589
|
+
/** The reference picture of a place or a thing: shown, generated from its saved visual identity, or brought as a PNG. */
|
|
2590
|
+
function EntityImage({ t, kind, entry, hasIdentity, dirty, source, onChanged }) {
|
|
2591
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
2592
|
+
const [error, setError] = (0, react.useState)();
|
|
2593
|
+
const run = (job) => {
|
|
2594
|
+
setBusy(true);
|
|
2595
|
+
setError(void 0);
|
|
2596
|
+
job().then((next) => {
|
|
2597
|
+
setBusy(false);
|
|
2598
|
+
onChanged(next);
|
|
2599
|
+
}, (failure) => {
|
|
2600
|
+
setBusy(false);
|
|
2601
|
+
setError(failure instanceof Error ? failure.message : String(failure));
|
|
2602
|
+
});
|
|
2603
|
+
};
|
|
2604
|
+
const action = busy ? t("portraitGenerating") : entry.image === void 0 ? t("imageGenerate") : t("imageRetry");
|
|
2605
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2606
|
+
"data-testid": `roleplay-${kind}-image`,
|
|
2607
|
+
children: [
|
|
2608
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2609
|
+
className: CharactersPanel_module_css_default.portraitBox,
|
|
2610
|
+
type: "button",
|
|
2611
|
+
disabled: dirty || busy || !hasIdentity,
|
|
2612
|
+
"aria-label": action,
|
|
2613
|
+
title: action,
|
|
2614
|
+
onClick: () => {
|
|
2615
|
+
run(() => source.generateImage(kind, entry.key, new AbortController().signal));
|
|
2616
|
+
},
|
|
2617
|
+
children: [entry.image !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
2618
|
+
className: CharactersPanel_module_css_default.portrait,
|
|
2619
|
+
src: entry.image,
|
|
2620
|
+
alt: "",
|
|
2621
|
+
loading: "lazy",
|
|
2622
|
+
decoding: "async"
|
|
2623
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2624
|
+
className: `${CharactersPanel_module_css_default.portrait} ${CharactersPanel_module_css_default.placeholder}`,
|
|
2625
|
+
style: { background: `hsl(${hueOf$3(entry.name)} 22% 88%)` },
|
|
2626
|
+
role: "img",
|
|
2627
|
+
"aria-label": t("imageMissing"),
|
|
2628
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2629
|
+
className: CharactersPanel_module_css_default.initial,
|
|
2630
|
+
"aria-hidden": "true",
|
|
2631
|
+
children: Array.from(entry.name)[0]?.toUpperCase()
|
|
2632
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2633
|
+
className: CharactersPanel_module_css_default.missing,
|
|
2634
|
+
children: t("imageMissing")
|
|
2635
|
+
})]
|
|
2636
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2637
|
+
className: CharactersPanel_module_css_default.portraitAction,
|
|
2638
|
+
children: action
|
|
2639
|
+
})]
|
|
2640
|
+
}),
|
|
2641
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
2642
|
+
className: CharactersPanel_module_css_default.portraitHint,
|
|
2643
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2644
|
+
type: "file",
|
|
2645
|
+
accept: "image/png",
|
|
2646
|
+
hidden: true,
|
|
2647
|
+
disabled: dirty || busy,
|
|
2648
|
+
onChange: (event) => {
|
|
2649
|
+
const file = event.target.files?.[0];
|
|
2650
|
+
event.target.value = "";
|
|
2651
|
+
if (file !== void 0) run(() => source.uploadImage(kind, entry.key, file, new AbortController().signal));
|
|
2652
|
+
}
|
|
2653
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2654
|
+
role: "button",
|
|
2655
|
+
tabIndex: 0,
|
|
2656
|
+
children: t("imageUpload")
|
|
2657
|
+
})]
|
|
2658
|
+
}),
|
|
2659
|
+
error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2660
|
+
className: CharactersPanel_module_css_default.portraitError,
|
|
2661
|
+
role: "alert",
|
|
2662
|
+
children: t("imageFailed", { message: error })
|
|
2663
|
+
}),
|
|
2664
|
+
!hasIdentity && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2665
|
+
className: CharactersPanel_module_css_default.portraitHint,
|
|
2666
|
+
children: t("imageIdentityRequired")
|
|
2667
|
+
}),
|
|
2668
|
+
dirty && hasIdentity && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2669
|
+
className: CharactersPanel_module_css_default.portraitHint,
|
|
2670
|
+
children: t("portraitSaveFirst")
|
|
2671
|
+
})
|
|
2672
|
+
]
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
//#endregion
|
|
1499
2676
|
//#region src/client/world-editor/EntityPanels.tsx
|
|
1500
2677
|
const split = (value) => value.split(",").map((part) => part.trim()).filter(Boolean);
|
|
1501
2678
|
const visual = (description, tags, negativeTags, globalId) => description.trim() === "" ? null : {
|
|
@@ -1709,6 +2886,15 @@ window.__ModuleLoader__.load({
|
|
|
1709
2886
|
});
|
|
1710
2887
|
}
|
|
1711
2888
|
}),
|
|
2889
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(EntityImage, {
|
|
2890
|
+
t,
|
|
2891
|
+
kind: "place",
|
|
2892
|
+
entry: place,
|
|
2893
|
+
hasIdentity: place.visualIdentity !== void 0,
|
|
2894
|
+
dirty,
|
|
2895
|
+
source,
|
|
2896
|
+
onChanged
|
|
2897
|
+
}),
|
|
1712
2898
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1713
2899
|
className: CharactersPanel_module_css_default.field,
|
|
1714
2900
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -1949,6 +3135,15 @@ window.__ModuleLoader__.load({
|
|
|
1949
3135
|
});
|
|
1950
3136
|
}
|
|
1951
3137
|
}),
|
|
3138
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(EntityImage, {
|
|
3139
|
+
t,
|
|
3140
|
+
kind: "thing",
|
|
3141
|
+
entry: thing,
|
|
3142
|
+
hasIdentity: thing.visualIdentity !== void 0,
|
|
3143
|
+
dirty,
|
|
3144
|
+
source,
|
|
3145
|
+
onChanged
|
|
3146
|
+
}),
|
|
1952
3147
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1953
3148
|
className: CharactersPanel_module_css_default.row,
|
|
1954
3149
|
children: [
|
|
@@ -2379,50 +3574,50 @@ window.__ModuleLoader__.load({
|
|
|
2379
3574
|
}
|
|
2380
3575
|
//#endregion
|
|
2381
3576
|
//#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
|
|
2382
|
-
const css$
|
|
2383
|
-
const key$
|
|
2384
|
-
let tag$
|
|
2385
|
-
if (tag$
|
|
2386
|
-
tag$
|
|
2387
|
-
tag$
|
|
2388
|
-
tag$
|
|
2389
|
-
document.head.appendChild(tag$
|
|
3577
|
+
const css$24 = ".rp_7pEHTW_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex;position:relative}.rp_7pEHTW_toolbar{border-bottom:.5px solid var(--dsw-alias-border-l2);flex-wrap:wrap;align-items:center;gap:4px;padding:8px 16px;display:flex}.rp_7pEHTW_filter{border-radius:var(--dsw-radius-sm);min-height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:4px 10px}.rp_7pEHTW_filterOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2)}.rp_7pEHTW_filter:focus-visible,.rp_7pEHTW_edge:focus-visible,.rp_7pEHTW_graphEdge:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:-2px}.rp_7pEHTW_space{flex:1}.rp_7pEHTW_perspective{color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:12px;display:flex}.rp_7pEHTW_perspective select{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);max-width:180px;min-height:32px;color:inherit;padding:4px 8px}.rp_7pEHTW_workspace{flex:1 1 0;grid-template-columns:minmax(220px,34%) minmax(320px,1fr);min-height:0;display:grid}.rp_7pEHTW_list{border-right:.5px solid var(--dsw-alias-border-l3);overflow-y:auto}.rp_7pEHTW_edge{border:0;border-bottom:.5px solid var(--dsw-alias-border-l4);width:100%;min-height:48px;color:inherit;text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:8px 16px;display:flex}.rp_7pEHTW_edgeOn{background:var(--dsw-alias-bg-layer-2)}.rp_7pEHTW_edgeTitle{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.rp_7pEHTW_edgeKind{color:var(--dsw-alias-label-tertiary);font-size:11px}.rp_7pEHTW_empty{color:var(--dsw-alias-label-tertiary);padding:20px}.rp_7pEHTW_inspector{min-width:0;padding:24px 24px 240px;overflow-y:auto}.rp_7pEHTW_head h2{margin:0 0 8px;font-size:17px}.rp_7pEHTW_entities{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:6px;display:flex}.rp_7pEHTW_notice{color:var(--dsw-alias-label-secondary);margin:24px 0}.rp_7pEHTW_form{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:24px;display:grid}.rp_7pEHTW_form label{color:var(--dsw-alias-label-tertiary);flex-direction:column;gap:5px;font-size:12px;display:flex}.rp_7pEHTW_form select,.rp_7pEHTW_form textarea{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:inherit;font:inherit;padding:6px 8px}.rp_7pEHTW_form textarea{resize:vertical;min-height:96px}.rp_7pEHTW_form select:focus-visible,.rp_7pEHTW_form textarea:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}.rp_7pEHTW_wide{grid-column:1/-1}.rp_7pEHTW_metrics{grid-column:1/-1;grid-template-columns:repeat(4,minmax(90px,1fr));gap:10px;display:grid}.rp_7pEHTW_check{align-self:end;align-items:center;min-height:32px;flex-direction:row!important}.rp_7pEHTW_actions{border-top:.5px solid var(--dsw-alias-border-l4);flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;margin-top:28px;padding-top:12px;display:flex}.rp_7pEHTW_status{color:var(--dsw-alias-label-secondary);margin-right:auto}.rp_7pEHTW_error{color:var(--dsw-alias-state-error-primary);margin-right:auto}.rp_7pEHTW_graph{background:radial-gradient(circle, var(--dsw-alias-bg-layer-2), transparent 70%);flex:1 1 0;min-height:360px;position:relative;overflow:hidden}.rp_7pEHTW_graph svg{width:100%;height:100%;min-height:520px}.rp_7pEHTW_graphEdge{cursor:pointer;stroke:var(--dsw-alias-border-l1);stroke-width:2px}.rp_7pEHTW_graphEdge:hover,.rp_7pEHTW_graphEdgeOn{stroke:var(--dsw-alias-state-business-primary);stroke-width:4px}.rp_7pEHTW_node circle{fill:var(--dsw-alias-bg-layer-1);stroke:var(--dsw-alias-border-l1);stroke-width:2px}.rp_7pEHTW_node_character circle{fill:color-mix(in srgb, var(--dsw-alias-state-business-primary) 18%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_location circle{fill:color-mix(in srgb, #4a9 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_item circle{fill:color-mix(in srgb, #c90 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_faction circle{fill:color-mix(in srgb, #96c 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node text{fill:var(--dsw-alias-label-primary);pointer-events:none;font-size:11px}.rp_7pEHTW_graphInspector{box-sizing:border-box;border-radius:var(--dsw-radius-panel);background:var(--dsw-alias-bg-layer-1);width:min(480px,100% - 40px);max-height:62%;box-shadow:var(--dsw-elevation-panel);border:0;padding:18px;position:absolute;bottom:20px;right:20px;overflow-y:auto}@media (width<=760px){.rp_7pEHTW_workspace{grid-template-columns:1fr}.rp_7pEHTW_list{border-right:0;border-bottom:.5px solid var(--dsw-alias-border-l3);max-height:220px}.rp_7pEHTW_inspector{padding-inline:16px}.rp_7pEHTW_form{grid-template-columns:1fr}.rp_7pEHTW_wide,.rp_7pEHTW_metrics{grid-column:1}.rp_7pEHTW_metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.rp_7pEHTW_graphInspector{width:calc(100% - 24px);bottom:12px;right:12px}}@media (pointer:coarse){.rp_7pEHTW_filter{min-height:44px}}";
|
|
3578
|
+
const key$24 = "src/client/world-editor/RelationsPanel.module.css";
|
|
3579
|
+
let tag$24 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$24) + "]");
|
|
3580
|
+
if (tag$24 === null) {
|
|
3581
|
+
tag$24 = document.createElement("style");
|
|
3582
|
+
tag$24.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
3583
|
+
tag$24.dataset.pluginCss = key$24;
|
|
3584
|
+
document.head.appendChild(tag$24);
|
|
2390
3585
|
}
|
|
2391
|
-
tag$
|
|
3586
|
+
tag$24.textContent = css$24;
|
|
2392
3587
|
var RelationsPanel_module_css_default = {
|
|
2393
|
-
"
|
|
3588
|
+
"toolbar": "rp_7pEHTW_toolbar",
|
|
3589
|
+
"edge": "rp_7pEHTW_edge",
|
|
3590
|
+
"filter": "rp_7pEHTW_filter",
|
|
2394
3591
|
"graphInspector": "rp_7pEHTW_graphInspector",
|
|
2395
|
-
"
|
|
2396
|
-
"
|
|
2397
|
-
"check": "rp_7pEHTW_check",
|
|
2398
|
-
"entities": "rp_7pEHTW_entities",
|
|
2399
|
-
"wide": "rp_7pEHTW_wide",
|
|
3592
|
+
"space": "rp_7pEHTW_space",
|
|
3593
|
+
"actions": "rp_7pEHTW_actions",
|
|
2400
3594
|
"graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
|
|
3595
|
+
"edgeTitle": "rp_7pEHTW_edgeTitle",
|
|
3596
|
+
"entities": "rp_7pEHTW_entities",
|
|
2401
3597
|
"inspector": "rp_7pEHTW_inspector",
|
|
2402
3598
|
"filterOn": "rp_7pEHTW_filterOn",
|
|
2403
|
-
"
|
|
2404
|
-
"empty": "rp_7pEHTW_empty",
|
|
2405
|
-
"edgeKind": "rp_7pEHTW_edgeKind",
|
|
2406
|
-
"form": "rp_7pEHTW_form",
|
|
2407
|
-
"filter": "rp_7pEHTW_filter",
|
|
2408
|
-
"actions": "rp_7pEHTW_actions",
|
|
2409
|
-
"perspective": "rp_7pEHTW_perspective",
|
|
2410
|
-
"node_location": "rp_7pEHTW_node_location",
|
|
2411
|
-
"edgeOn": "rp_7pEHTW_edgeOn",
|
|
2412
|
-
"node": "rp_7pEHTW_node",
|
|
2413
|
-
"toolbar": "rp_7pEHTW_toolbar",
|
|
2414
|
-
"graph": "rp_7pEHTW_graph",
|
|
3599
|
+
"error": "rp_7pEHTW_error",
|
|
2415
3600
|
"node_item": "rp_7pEHTW_node_item",
|
|
2416
|
-
"
|
|
3601
|
+
"edgeOn": "rp_7pEHTW_edgeOn",
|
|
2417
3602
|
"notice": "rp_7pEHTW_notice",
|
|
3603
|
+
"perspective": "rp_7pEHTW_perspective",
|
|
3604
|
+
"node": "rp_7pEHTW_node",
|
|
3605
|
+
"edgeKind": "rp_7pEHTW_edgeKind",
|
|
3606
|
+
"list": "rp_7pEHTW_list",
|
|
3607
|
+
"empty": "rp_7pEHTW_empty",
|
|
3608
|
+
"form": "rp_7pEHTW_form",
|
|
3609
|
+
"node_faction": "rp_7pEHTW_node_faction",
|
|
3610
|
+
"check": "rp_7pEHTW_check",
|
|
2418
3611
|
"workspace": "rp_7pEHTW_workspace",
|
|
2419
|
-
"metrics": "rp_7pEHTW_metrics",
|
|
2420
|
-
"status": "rp_7pEHTW_status",
|
|
2421
|
-
"edgeTitle": "rp_7pEHTW_edgeTitle",
|
|
2422
|
-
"error": "rp_7pEHTW_error",
|
|
2423
|
-
"edge": "rp_7pEHTW_edge",
|
|
2424
3612
|
"node_character": "rp_7pEHTW_node_character",
|
|
2425
|
-
"head": "rp_7pEHTW_head"
|
|
3613
|
+
"head": "rp_7pEHTW_head",
|
|
3614
|
+
"status": "rp_7pEHTW_status",
|
|
3615
|
+
"wide": "rp_7pEHTW_wide",
|
|
3616
|
+
"node_location": "rp_7pEHTW_node_location",
|
|
3617
|
+
"metrics": "rp_7pEHTW_metrics",
|
|
3618
|
+
"graphEdge": "rp_7pEHTW_graphEdge",
|
|
3619
|
+
"graph": "rp_7pEHTW_graph",
|
|
3620
|
+
"panel": "rp_7pEHTW_panel"
|
|
2426
3621
|
};
|
|
2427
3622
|
//#endregion
|
|
2428
3623
|
//#region src/client/world-editor/RelationsPanel.tsx
|
|
@@ -3739,23 +4934,23 @@ window.__ModuleLoader__.load({
|
|
|
3739
4934
|
};
|
|
3740
4935
|
//#endregion
|
|
3741
4936
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/pack-frame/PackFrame.module.css.mjs
|
|
3742
|
-
const css$
|
|
3743
|
-
const key$
|
|
3744
|
-
let tag$
|
|
3745
|
-
if (tag$
|
|
3746
|
-
tag$
|
|
3747
|
-
tag$
|
|
3748
|
-
tag$
|
|
3749
|
-
document.head.appendChild(tag$
|
|
4937
|
+
const css$23 = ".rp_h_sbFq_frame{background:0 0;border:0;width:100%;display:block}.rp_h_sbFq_fill{height:100%;min-height:0}.rp_h_sbFq_message{color:var(--dsw-alias-label-secondary);margin:0;padding:16px 24px;font-size:13px;line-height:20px}.rp_h_sbFq_problems{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;padding-left:18px;font-size:12px}.rp_h_sbFq_hud{box-sizing:border-box;width:min(800px,100%);margin:0 auto 8px;padding:0 16px}.rp_h_sbFq_tab{flex-direction:column;flex:1 1 0;width:100%;min-height:0;display:flex}";
|
|
4938
|
+
const key$23 = "src/client/widgets/pack-frame/PackFrame.module.css";
|
|
4939
|
+
let tag$23 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$23) + "]");
|
|
4940
|
+
if (tag$23 === null) {
|
|
4941
|
+
tag$23 = document.createElement("style");
|
|
4942
|
+
tag$23.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
4943
|
+
tag$23.dataset.pluginCss = key$23;
|
|
4944
|
+
document.head.appendChild(tag$23);
|
|
3750
4945
|
}
|
|
3751
|
-
tag$
|
|
4946
|
+
tag$23.textContent = css$23;
|
|
3752
4947
|
var PackFrame_module_css_default = {
|
|
4948
|
+
"frame": "rp_h_sbFq_frame",
|
|
3753
4949
|
"problems": "rp_h_sbFq_problems",
|
|
3754
|
-
"message": "rp_h_sbFq_message",
|
|
3755
4950
|
"hud": "rp_h_sbFq_hud",
|
|
3756
|
-
"frame": "rp_h_sbFq_frame",
|
|
3757
4951
|
"tab": "rp_h_sbFq_tab",
|
|
3758
|
-
"fill": "rp_h_sbFq_fill"
|
|
4952
|
+
"fill": "rp_h_sbFq_fill",
|
|
4953
|
+
"message": "rp_h_sbFq_message"
|
|
3759
4954
|
};
|
|
3760
4955
|
//#endregion
|
|
3761
4956
|
//#region src/client/widgets/pack-frame/theme.ts
|
|
@@ -4000,26 +5195,31 @@ window.__ModuleLoader__.load({
|
|
|
4000
5195
|
name
|
|
4001
5196
|
}));
|
|
4002
5197
|
}
|
|
5198
|
+
const packQuery = (world, pack, path) => `${query(world)}&pack=${encodeURIComponent(pack)}${path === void 0 ? "" : `&path=${encodeURIComponent(path)}`}`;
|
|
5199
|
+
const loadPackFile = async (world, pack, path, signal) => (await read$2(await fetch(`${API_PREFIX}/worlds/interface/file?${packQuery(world, pack, path)}`, init("GET", signal)))).text;
|
|
5200
|
+
const savePackFile = async (world, pack, path, text, signal) => (await read$2(await fetch(`${API_PREFIX}/worlds/interface/file?${packQuery(world, pack, path)}`, init("PUT", signal, { text })))).problems;
|
|
5201
|
+
const removePackFile = async (world, pack, path, signal) => (await read$2(await fetch(`${API_PREFIX}/worlds/interface/file?${packQuery(world, pack, path)}`, init("DELETE", signal)))).problems;
|
|
5202
|
+
const createPack = async (world, pack, name, signal) => (await read$2(await fetch(`${API_PREFIX}/worlds/interface/pack?${packQuery(world, pack)}`, init("POST", signal, { name })))).problems;
|
|
4003
5203
|
//#endregion
|
|
4004
5204
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/PacksPanel.module.css.mjs
|
|
4005
|
-
const css$
|
|
4006
|
-
const key$
|
|
4007
|
-
let tag$
|
|
4008
|
-
if (tag$
|
|
4009
|
-
tag$
|
|
4010
|
-
tag$
|
|
4011
|
-
tag$
|
|
4012
|
-
document.head.appendChild(tag$
|
|
5205
|
+
const css$22 = ".rp_FLaP7q_controls{flex-wrap:wrap;align-items:center;gap:8px 16px;margin:8px 0;display:flex}.rp_FLaP7q_group{color:var(--dsw-alias-label-tertiary);align-items:center;gap:4px;font-size:12px;display:inline-flex}.rp_FLaP7q_stage{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-base);max-width:100%;overflow:hidden}.rp_FLaP7q_stageTall{height:420px}.rp_FLaP7q_log{color:var(--dsw-alias-label-secondary);margin:4px 0 0;padding-left:16px;font-size:12px}.rp_FLaP7q_files{columns:2 220px;margin:4px 0 0;padding-left:16px;font-size:12px}.rp_FLaP7q_note{color:var(--dsw-alias-label-tertiary);font-size:12px}";
|
|
5206
|
+
const key$22 = "src/client/world-editor/PacksPanel.module.css";
|
|
5207
|
+
let tag$22 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$22) + "]");
|
|
5208
|
+
if (tag$22 === null) {
|
|
5209
|
+
tag$22 = document.createElement("style");
|
|
5210
|
+
tag$22.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
5211
|
+
tag$22.dataset.pluginCss = key$22;
|
|
5212
|
+
document.head.appendChild(tag$22);
|
|
4013
5213
|
}
|
|
4014
|
-
tag$
|
|
5214
|
+
tag$22.textContent = css$22;
|
|
4015
5215
|
var PacksPanel_module_css_default = {
|
|
4016
5216
|
"note": "rp_FLaP7q_note",
|
|
4017
5217
|
"stageTall": "rp_FLaP7q_stageTall",
|
|
4018
|
-
"controls": "rp_FLaP7q_controls",
|
|
4019
5218
|
"group": "rp_FLaP7q_group",
|
|
5219
|
+
"files": "rp_FLaP7q_files",
|
|
5220
|
+
"controls": "rp_FLaP7q_controls",
|
|
4020
5221
|
"stage": "rp_FLaP7q_stage",
|
|
4021
|
-
"log": "rp_FLaP7q_log"
|
|
4022
|
-
"files": "rp_FLaP7q_files"
|
|
5222
|
+
"log": "rp_FLaP7q_log"
|
|
4023
5223
|
};
|
|
4024
5224
|
//#endregion
|
|
4025
5225
|
//#region src/client/world-editor/PacksPanel.tsx
|
|
@@ -4029,6 +5229,7 @@ window.__ModuleLoader__.load({
|
|
|
4029
5229
|
wide: 1100
|
|
4030
5230
|
};
|
|
4031
5231
|
const MAX_LOG = 8;
|
|
5232
|
+
const TEXT_FILE = /\.(html|css|js|json|txt|svg)$/i;
|
|
4032
5233
|
/** A preview keeps nothing and has no turns played: what a surface asks to keep stays in memory until it is reloaded. */
|
|
4033
5234
|
function previewBackend() {
|
|
4034
5235
|
const kept = /* @__PURE__ */ new Map();
|
|
@@ -4051,6 +5252,10 @@ window.__ModuleLoader__.load({
|
|
|
4051
5252
|
const [reload, setReload] = (0, react.useState)(0);
|
|
4052
5253
|
const [preview, setPreview] = (0, react.useState)();
|
|
4053
5254
|
const [log, setLog] = (0, react.useState)([]);
|
|
5255
|
+
const [editing, setEditing] = (0, react.useState)();
|
|
5256
|
+
const [creating, setCreating] = (0, react.useState)();
|
|
5257
|
+
const [removing, setRemoving] = (0, react.useState)();
|
|
5258
|
+
const [outcome, setOutcome] = (0, react.useState)();
|
|
4054
5259
|
(0, react.useEffect)(() => {
|
|
4055
5260
|
const abort = new AbortController();
|
|
4056
5261
|
loadWorldPacks(worldId, abort.signal).then(setPacks, (failure) => {
|
|
@@ -4104,6 +5309,80 @@ window.__ModuleLoader__.load({
|
|
|
4104
5309
|
preview,
|
|
4105
5310
|
reload
|
|
4106
5311
|
]);
|
|
5312
|
+
const signal = () => new AbortController().signal;
|
|
5313
|
+
const failed = (error) => error instanceof Error ? error.message : String(error);
|
|
5314
|
+
const openFile = (path) => {
|
|
5315
|
+
if (pack === void 0) return;
|
|
5316
|
+
setOutcome(void 0);
|
|
5317
|
+
setEditing({
|
|
5318
|
+
path,
|
|
5319
|
+
text: "",
|
|
5320
|
+
state: "loading"
|
|
5321
|
+
});
|
|
5322
|
+
loadPackFile(worldId, pack.id, path, signal()).then((text) => {
|
|
5323
|
+
setEditing((current) => current?.path === path ? {
|
|
5324
|
+
path,
|
|
5325
|
+
text,
|
|
5326
|
+
state: "ready"
|
|
5327
|
+
} : current);
|
|
5328
|
+
}, (error) => {
|
|
5329
|
+
setEditing({
|
|
5330
|
+
path,
|
|
5331
|
+
text: "",
|
|
5332
|
+
state: "ready",
|
|
5333
|
+
error: say("fileNotSaved", { message: failed(error) })
|
|
5334
|
+
});
|
|
5335
|
+
});
|
|
5336
|
+
};
|
|
5337
|
+
const saveFile = () => {
|
|
5338
|
+
if (pack === void 0 || editing === void 0) return;
|
|
5339
|
+
setEditing({
|
|
5340
|
+
...editing,
|
|
5341
|
+
state: "saving"
|
|
5342
|
+
});
|
|
5343
|
+
savePackFile(worldId, pack.id, editing.path, editing.text, signal()).then((problems) => {
|
|
5344
|
+
setEditing(void 0);
|
|
5345
|
+
setOutcome(problems.length === 0 ? say("savedClean") : say("savedWith", { count: problems.length }));
|
|
5346
|
+
setReload((count) => count + 1);
|
|
5347
|
+
}, (error) => {
|
|
5348
|
+
setEditing({
|
|
5349
|
+
...editing,
|
|
5350
|
+
state: "ready",
|
|
5351
|
+
error: say("fileNotSaved", { message: failed(error) })
|
|
5352
|
+
});
|
|
5353
|
+
});
|
|
5354
|
+
};
|
|
5355
|
+
const removeFile = (path) => {
|
|
5356
|
+
if (pack === void 0) return;
|
|
5357
|
+
setRemoving(void 0);
|
|
5358
|
+
removePackFile(worldId, pack.id, path, signal()).then(() => {
|
|
5359
|
+
setOutcome(void 0);
|
|
5360
|
+
setReload((count) => count + 1);
|
|
5361
|
+
}, (error) => {
|
|
5362
|
+
setOutcome(say("fileNotSaved", { message: failed(error) }));
|
|
5363
|
+
});
|
|
5364
|
+
};
|
|
5365
|
+
const create = () => {
|
|
5366
|
+
if (creating === void 0 || creating.value.trim() === "") return;
|
|
5367
|
+
const value = creating.value.trim();
|
|
5368
|
+
setCreating(void 0);
|
|
5369
|
+
if (creating.kind === "file") {
|
|
5370
|
+
setEditing({
|
|
5371
|
+
path: value,
|
|
5372
|
+
text: "",
|
|
5373
|
+
state: "ready",
|
|
5374
|
+
created: true
|
|
5375
|
+
});
|
|
5376
|
+
return;
|
|
5377
|
+
}
|
|
5378
|
+
createPack(worldId, value, value, signal()).then(() => {
|
|
5379
|
+
setChosen(value);
|
|
5380
|
+
setOutcome(void 0);
|
|
5381
|
+
setReload((count) => count + 1);
|
|
5382
|
+
}, (error) => {
|
|
5383
|
+
setOutcome(say("fileNotSaved", { message: failed(error) }));
|
|
5384
|
+
});
|
|
5385
|
+
};
|
|
4107
5386
|
const refresh = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
4108
5387
|
variant: "ghost",
|
|
4109
5388
|
size: "sm",
|
|
@@ -4137,6 +5416,60 @@ window.__ModuleLoader__.load({
|
|
|
4137
5416
|
className: CharactersPanel_module_css_default.sheet,
|
|
4138
5417
|
children: [
|
|
4139
5418
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: say("help") }),
|
|
5419
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5420
|
+
className: PacksPanel_module_css_default.controls,
|
|
5421
|
+
children: creating === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5422
|
+
variant: "ghost",
|
|
5423
|
+
size: "sm",
|
|
5424
|
+
onClick: () => {
|
|
5425
|
+
setCreating({
|
|
5426
|
+
kind: "pack",
|
|
5427
|
+
value: ""
|
|
5428
|
+
});
|
|
5429
|
+
},
|
|
5430
|
+
children: say("newPack")
|
|
5431
|
+
}), pack !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5432
|
+
variant: "ghost",
|
|
5433
|
+
size: "sm",
|
|
5434
|
+
onClick: () => {
|
|
5435
|
+
setCreating({
|
|
5436
|
+
kind: "file",
|
|
5437
|
+
value: ""
|
|
5438
|
+
});
|
|
5439
|
+
},
|
|
5440
|
+
children: say("newFile")
|
|
5441
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
5442
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
5443
|
+
value: creating.value,
|
|
5444
|
+
placeholder: say(creating.kind === "pack" ? "newPackId" : "newFilePath"),
|
|
5445
|
+
"aria-label": say(creating.kind === "pack" ? "newPackId" : "newFilePath"),
|
|
5446
|
+
onChange: (event) => {
|
|
5447
|
+
setCreating({
|
|
5448
|
+
...creating,
|
|
5449
|
+
value: event.target.value
|
|
5450
|
+
});
|
|
5451
|
+
}
|
|
5452
|
+
}),
|
|
5453
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5454
|
+
size: "sm",
|
|
5455
|
+
onClick: create,
|
|
5456
|
+
children: say("create")
|
|
5457
|
+
}),
|
|
5458
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5459
|
+
variant: "ghost",
|
|
5460
|
+
size: "sm",
|
|
5461
|
+
onClick: () => {
|
|
5462
|
+
setCreating(void 0);
|
|
5463
|
+
},
|
|
5464
|
+
children: say("cancelFile")
|
|
5465
|
+
})
|
|
5466
|
+
] })
|
|
5467
|
+
}),
|
|
5468
|
+
outcome !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5469
|
+
className: PacksPanel_module_css_default.note,
|
|
5470
|
+
role: "status",
|
|
5471
|
+
children: outcome
|
|
5472
|
+
}),
|
|
4140
5473
|
packs === void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: say("loading") }),
|
|
4141
5474
|
packs !== void 0 && !Array.isArray(packs) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4142
5475
|
className: CharactersPanel_module_css_default.error,
|
|
@@ -4156,40 +5489,134 @@ window.__ModuleLoader__.load({
|
|
|
4156
5489
|
pack.version !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [" ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: say("version", { version: pack.version }) })] })
|
|
4157
5490
|
]
|
|
4158
5491
|
}),
|
|
4159
|
-
pack.description !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: pack.description }),
|
|
4160
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [
|
|
4161
|
-
pack.actions.length === 0 ? say("noActions") : `${say("actions")}: ${pack.actions.join(", ")}`,
|
|
4162
|
-
pack.skin === void 0 ? "" : ` · ${say("skin", { file: pack.skin })}`,
|
|
4163
|
-
pack.tokens === 0 ? "" : ` · ${say("tokens", { count: pack.tokens })}`
|
|
4164
|
-
] }),
|
|
4165
|
-
surfaces.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [
|
|
4166
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4167
|
-
className: CharactersPanel_module_css_default.label,
|
|
4168
|
-
children: say("surfaces")
|
|
4169
|
-
}),
|
|
4170
|
-
" ",
|
|
4171
|
-
surfaces.map((name) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: [
|
|
4172
|
-
say(name),
|
|
4173
|
-
": ",
|
|
4174
|
-
pack.surfaces[name]?.file
|
|
4175
|
-
] }, name))
|
|
4176
|
-
] }),
|
|
4177
|
-
pack.files.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
5492
|
+
pack.description !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: pack.description }),
|
|
5493
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [
|
|
5494
|
+
pack.actions.length === 0 ? say("noActions") : `${say("actions")}: ${pack.actions.join(", ")}`,
|
|
5495
|
+
pack.skin === void 0 ? "" : ` · ${say("skin", { file: pack.skin })}`,
|
|
5496
|
+
pack.tokens === 0 ? "" : ` · ${say("tokens", { count: pack.tokens })}`
|
|
5497
|
+
] }),
|
|
5498
|
+
surfaces.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [
|
|
5499
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5500
|
+
className: CharactersPanel_module_css_default.label,
|
|
5501
|
+
children: say("surfaces")
|
|
5502
|
+
}),
|
|
5503
|
+
" ",
|
|
5504
|
+
surfaces.map((name) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: [
|
|
5505
|
+
say(name),
|
|
5506
|
+
": ",
|
|
5507
|
+
pack.surfaces[name]?.file
|
|
5508
|
+
] }, name))
|
|
5509
|
+
] }),
|
|
5510
|
+
pack.files.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
5511
|
+
open: editing !== void 0,
|
|
5512
|
+
children: [
|
|
5513
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", { children: [
|
|
5514
|
+
say("files"),
|
|
5515
|
+
" (",
|
|
5516
|
+
pack.files.length,
|
|
5517
|
+
")"
|
|
5518
|
+
] }),
|
|
5519
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
5520
|
+
className: PacksPanel_module_css_default.files,
|
|
5521
|
+
children: pack.files.map((file) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [
|
|
5522
|
+
file.path,
|
|
5523
|
+
" ",
|
|
5524
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
5525
|
+
className: CharactersPanel_module_css_default.label,
|
|
5526
|
+
children: [file.size, " B"]
|
|
5527
|
+
}),
|
|
5528
|
+
" ",
|
|
5529
|
+
TEXT_FILE.test(file.path) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5530
|
+
variant: "ghost",
|
|
5531
|
+
size: "sm",
|
|
5532
|
+
onClick: () => {
|
|
5533
|
+
openFile(file.path);
|
|
5534
|
+
},
|
|
5535
|
+
children: say("editFile")
|
|
5536
|
+
}),
|
|
5537
|
+
removing === file.path ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5538
|
+
variant: "primary",
|
|
5539
|
+
size: "sm",
|
|
5540
|
+
onClick: () => {
|
|
5541
|
+
removeFile(file.path);
|
|
5542
|
+
},
|
|
5543
|
+
children: say("deleteConfirm", { path: file.path })
|
|
5544
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5545
|
+
variant: "ghost",
|
|
5546
|
+
size: "sm",
|
|
5547
|
+
onClick: () => {
|
|
5548
|
+
setRemoving(void 0);
|
|
5549
|
+
},
|
|
5550
|
+
children: say("cancelFile")
|
|
5551
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5552
|
+
variant: "ghost",
|
|
5553
|
+
size: "sm",
|
|
5554
|
+
onClick: () => {
|
|
5555
|
+
setRemoving(file.path);
|
|
5556
|
+
},
|
|
5557
|
+
children: say("deleteFile")
|
|
5558
|
+
})
|
|
5559
|
+
] }, file.path))
|
|
5560
|
+
}),
|
|
5561
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5562
|
+
className: PacksPanel_module_css_default.note,
|
|
5563
|
+
children: say("textOnly")
|
|
5564
|
+
})
|
|
5565
|
+
]
|
|
5566
|
+
}),
|
|
5567
|
+
editing !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5568
|
+
"data-testid": "roleplay-pack-editor",
|
|
5569
|
+
children: [
|
|
5570
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [
|
|
5571
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5572
|
+
className: CharactersPanel_module_css_default.label,
|
|
5573
|
+
children: editing.path
|
|
5574
|
+
}),
|
|
5575
|
+
" ",
|
|
5576
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5577
|
+
className: PacksPanel_module_css_default.note,
|
|
5578
|
+
children: say("editHelp")
|
|
5579
|
+
})
|
|
5580
|
+
] }),
|
|
5581
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
5582
|
+
className: CharactersPanel_module_css_default.area,
|
|
5583
|
+
rows: 16,
|
|
5584
|
+
spellCheck: false,
|
|
5585
|
+
style: { fontFamily: "monospace" },
|
|
5586
|
+
"aria-label": editing.path,
|
|
5587
|
+
value: editing.state === "loading" ? say("fileLoading") : editing.text,
|
|
5588
|
+
disabled: editing.state !== "ready",
|
|
5589
|
+
onChange: (event) => {
|
|
5590
|
+
setEditing({
|
|
5591
|
+
...editing,
|
|
5592
|
+
text: event.target.value
|
|
5593
|
+
});
|
|
5594
|
+
}
|
|
5595
|
+
}),
|
|
5596
|
+
editing.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5597
|
+
className: CharactersPanel_module_css_default.error,
|
|
5598
|
+
role: "alert",
|
|
5599
|
+
children: editing.error
|
|
5600
|
+
}),
|
|
5601
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [
|
|
5602
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5603
|
+
size: "sm",
|
|
5604
|
+
disabled: editing.state !== "ready",
|
|
5605
|
+
onClick: saveFile,
|
|
5606
|
+
children: editing.state === "saving" ? say("fileSaving") : say("saveFile")
|
|
5607
|
+
}),
|
|
5608
|
+
" ",
|
|
5609
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5610
|
+
variant: "ghost",
|
|
5611
|
+
size: "sm",
|
|
5612
|
+
onClick: () => {
|
|
5613
|
+
setEditing(void 0);
|
|
5614
|
+
},
|
|
5615
|
+
children: say("cancelFile")
|
|
5616
|
+
})
|
|
5617
|
+
] })
|
|
5618
|
+
]
|
|
5619
|
+
}),
|
|
4193
5620
|
pack.problems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4194
5621
|
className: CharactersPanel_module_css_default.error,
|
|
4195
5622
|
role: "alert",
|
|
@@ -4382,8 +5809,93 @@ window.__ModuleLoader__.load({
|
|
|
4382
5809
|
expired: "expired",
|
|
4383
5810
|
dormant: "dormant"
|
|
4384
5811
|
};
|
|
4385
|
-
|
|
4386
|
-
|
|
5812
|
+
const TEMPLATE = {
|
|
5813
|
+
name: "New trigger",
|
|
5814
|
+
when: {
|
|
5815
|
+
type: "event",
|
|
5816
|
+
tag: "alarm"
|
|
5817
|
+
},
|
|
5818
|
+
effects: [{
|
|
5819
|
+
type: "beat",
|
|
5820
|
+
text: "Something stirs."
|
|
5821
|
+
}]
|
|
5822
|
+
};
|
|
5823
|
+
/**
|
|
5824
|
+
* What the world does by itself, in sentences: what each trigger waits for and does, and what is wrong with it. For a world's files each trigger can be edited as its
|
|
5825
|
+
* document (checked as a story start checks it), added and removed; a story's triggers are only shown.
|
|
5826
|
+
*/
|
|
5827
|
+
function TriggersPanel({ t, world, source, onChanged, actions }) {
|
|
5828
|
+
const [editing, setEditing] = (0, react.useState)();
|
|
5829
|
+
const [adding, setAdding] = (0, react.useState)();
|
|
5830
|
+
const [failure, setFailure] = (0, react.useState)();
|
|
5831
|
+
const [removing, setRemoving] = (0, react.useState)();
|
|
5832
|
+
const writable = source.worldId !== void 0 && source.writeTrigger !== void 0 && source.readTrigger !== void 0 && source.removeTrigger !== void 0;
|
|
5833
|
+
const signal = () => new AbortController().signal;
|
|
5834
|
+
const edit = (key) => {
|
|
5835
|
+
setFailure(void 0);
|
|
5836
|
+
setEditing({
|
|
5837
|
+
key,
|
|
5838
|
+
text: "",
|
|
5839
|
+
state: "loading"
|
|
5840
|
+
});
|
|
5841
|
+
source.readTrigger(key, signal()).then((document) => {
|
|
5842
|
+
const { key: _own, ...rest } = document;
|
|
5843
|
+
setEditing((current) => current?.key === key ? {
|
|
5844
|
+
key,
|
|
5845
|
+
text: JSON.stringify(rest, null, 2),
|
|
5846
|
+
state: "ready"
|
|
5847
|
+
} : current);
|
|
5848
|
+
}, (error) => {
|
|
5849
|
+
setEditing(void 0);
|
|
5850
|
+
setFailure(error instanceof Error ? error.message : String(error));
|
|
5851
|
+
});
|
|
5852
|
+
};
|
|
5853
|
+
const save = () => {
|
|
5854
|
+
if (editing === void 0) return;
|
|
5855
|
+
let document;
|
|
5856
|
+
try {
|
|
5857
|
+
document = JSON.parse(editing.text);
|
|
5858
|
+
} catch (error) {
|
|
5859
|
+
setEditing({
|
|
5860
|
+
...editing,
|
|
5861
|
+
error: t("trig_notJson", { message: error instanceof Error ? error.message : String(error) })
|
|
5862
|
+
});
|
|
5863
|
+
return;
|
|
5864
|
+
}
|
|
5865
|
+
setEditing({
|
|
5866
|
+
...editing,
|
|
5867
|
+
state: "saving"
|
|
5868
|
+
});
|
|
5869
|
+
source.writeTrigger(editing.key, document, signal()).then((next) => {
|
|
5870
|
+
setEditing(void 0);
|
|
5871
|
+
onChanged(next);
|
|
5872
|
+
}, (error) => {
|
|
5873
|
+
setEditing({
|
|
5874
|
+
...editing,
|
|
5875
|
+
state: "ready",
|
|
5876
|
+
error: t("trig_saveFailed", { message: error instanceof Error ? error.message : String(error) })
|
|
5877
|
+
});
|
|
5878
|
+
});
|
|
5879
|
+
};
|
|
5880
|
+
const remove = (key) => {
|
|
5881
|
+
setRemoving(void 0);
|
|
5882
|
+
setFailure(void 0);
|
|
5883
|
+
source.removeTrigger(key, signal()).then(onChanged, (error) => {
|
|
5884
|
+
setFailure(t("trig_saveFailed", { message: error instanceof Error ? error.message : String(error) }));
|
|
5885
|
+
});
|
|
5886
|
+
};
|
|
5887
|
+
const add = () => {
|
|
5888
|
+
const key = (adding ?? "").trim();
|
|
5889
|
+
if (key === "") return;
|
|
5890
|
+
setAdding(void 0);
|
|
5891
|
+
setFailure(void 0);
|
|
5892
|
+
setEditing({
|
|
5893
|
+
key,
|
|
5894
|
+
text: JSON.stringify(TEMPLATE, null, 2),
|
|
5895
|
+
state: "ready",
|
|
5896
|
+
created: true
|
|
5897
|
+
});
|
|
5898
|
+
};
|
|
4387
5899
|
const say = (key, values) => t(`trig_${key}`, values);
|
|
4388
5900
|
const names = namesOf(world);
|
|
4389
5901
|
const story = world.triggers?.some((trigger) => trigger.status !== void 0) === true;
|
|
@@ -4407,6 +5919,58 @@ window.__ModuleLoader__.load({
|
|
|
4407
5919
|
className: CharactersPanel_module_css_default.sheet,
|
|
4408
5920
|
children: [
|
|
4409
5921
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: story ? t("trig_helpStory") : t("trig_help") }),
|
|
5922
|
+
failure !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5923
|
+
className: CharactersPanel_module_css_default.error,
|
|
5924
|
+
role: "alert",
|
|
5925
|
+
children: failure
|
|
5926
|
+
}),
|
|
5927
|
+
writable && (adding === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5928
|
+
variant: "ghost",
|
|
5929
|
+
size: "sm",
|
|
5930
|
+
onClick: () => {
|
|
5931
|
+
setAdding("");
|
|
5932
|
+
},
|
|
5933
|
+
children: t("trig_addTrigger")
|
|
5934
|
+
}) }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5935
|
+
className: CharactersPanel_module_css_default.row,
|
|
5936
|
+
children: [
|
|
5937
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
5938
|
+
value: adding,
|
|
5939
|
+
placeholder: t("trig_newKey"),
|
|
5940
|
+
"aria-label": t("trig_newKey"),
|
|
5941
|
+
onChange: (event) => {
|
|
5942
|
+
setAdding(event.target.value);
|
|
5943
|
+
}
|
|
5944
|
+
}),
|
|
5945
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5946
|
+
size: "sm",
|
|
5947
|
+
onClick: add,
|
|
5948
|
+
children: t("trig_editTrigger")
|
|
5949
|
+
}),
|
|
5950
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5951
|
+
variant: "ghost",
|
|
5952
|
+
size: "sm",
|
|
5953
|
+
onClick: () => {
|
|
5954
|
+
setAdding(void 0);
|
|
5955
|
+
},
|
|
5956
|
+
children: t("trig_cancelTrigger")
|
|
5957
|
+
})
|
|
5958
|
+
]
|
|
5959
|
+
})),
|
|
5960
|
+
editing?.created === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggerEditor, {
|
|
5961
|
+
t,
|
|
5962
|
+
editing,
|
|
5963
|
+
onText: (text) => {
|
|
5964
|
+
setEditing({
|
|
5965
|
+
...editing,
|
|
5966
|
+
text
|
|
5967
|
+
});
|
|
5968
|
+
},
|
|
5969
|
+
onSave: save,
|
|
5970
|
+
onCancel: () => {
|
|
5971
|
+
setEditing(void 0);
|
|
5972
|
+
}
|
|
5973
|
+
}),
|
|
4410
5974
|
world.triggersProblem !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4411
5975
|
className: CharactersPanel_module_css_default.error,
|
|
4412
5976
|
role: "alert",
|
|
@@ -4444,6 +6008,57 @@ window.__ModuleLoader__.load({
|
|
|
4444
6008
|
children: say("then")
|
|
4445
6009
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: trigger.effects.map((effect, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: describeEffect(say, names, effect) }, index)) })] }),
|
|
4446
6010
|
meta(trigger).length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: meta(trigger).join(" · ") }),
|
|
6011
|
+
writable && editing?.key !== trigger.key && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [
|
|
6012
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6013
|
+
variant: "ghost",
|
|
6014
|
+
size: "sm",
|
|
6015
|
+
onClick: () => {
|
|
6016
|
+
edit(trigger.key);
|
|
6017
|
+
},
|
|
6018
|
+
children: t("trig_editTrigger")
|
|
6019
|
+
}),
|
|
6020
|
+
" ",
|
|
6021
|
+
removing === trigger.key ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
6022
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6023
|
+
variant: "primary",
|
|
6024
|
+
size: "sm",
|
|
6025
|
+
onClick: () => {
|
|
6026
|
+
remove(trigger.key);
|
|
6027
|
+
},
|
|
6028
|
+
children: t("trig_removeConfirm", { key: trigger.key })
|
|
6029
|
+
}),
|
|
6030
|
+
" ",
|
|
6031
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6032
|
+
variant: "ghost",
|
|
6033
|
+
size: "sm",
|
|
6034
|
+
onClick: () => {
|
|
6035
|
+
setRemoving(void 0);
|
|
6036
|
+
},
|
|
6037
|
+
children: t("trig_cancelTrigger")
|
|
6038
|
+
})
|
|
6039
|
+
] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6040
|
+
variant: "ghost",
|
|
6041
|
+
size: "sm",
|
|
6042
|
+
onClick: () => {
|
|
6043
|
+
setRemoving(trigger.key);
|
|
6044
|
+
},
|
|
6045
|
+
children: t("trig_removeTrigger")
|
|
6046
|
+
})
|
|
6047
|
+
] }),
|
|
6048
|
+
editing !== void 0 && editing.created !== true && editing.key === trigger.key && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggerEditor, {
|
|
6049
|
+
t,
|
|
6050
|
+
editing,
|
|
6051
|
+
onText: (text) => {
|
|
6052
|
+
setEditing({
|
|
6053
|
+
...editing,
|
|
6054
|
+
text
|
|
6055
|
+
});
|
|
6056
|
+
},
|
|
6057
|
+
onSave: save,
|
|
6058
|
+
onCancel: () => {
|
|
6059
|
+
setEditing(void 0);
|
|
6060
|
+
}
|
|
6061
|
+
}),
|
|
4447
6062
|
trigger.problems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4448
6063
|
className: CharactersPanel_module_css_default.error,
|
|
4449
6064
|
role: "alert",
|
|
@@ -4456,6 +6071,49 @@ window.__ModuleLoader__.load({
|
|
|
4456
6071
|
})]
|
|
4457
6072
|
});
|
|
4458
6073
|
}
|
|
6074
|
+
function TriggerEditor({ t, editing, onText, onSave, onCancel }) {
|
|
6075
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6076
|
+
"data-testid": "roleplay-trigger-editor",
|
|
6077
|
+
children: [
|
|
6078
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6079
|
+
className: CharactersPanel_module_css_default.portraitHint,
|
|
6080
|
+
children: t("trig_editHelp")
|
|
6081
|
+
}),
|
|
6082
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
6083
|
+
className: CharactersPanel_module_css_default.area,
|
|
6084
|
+
rows: 14,
|
|
6085
|
+
spellCheck: false,
|
|
6086
|
+
style: { fontFamily: "monospace" },
|
|
6087
|
+
"aria-label": editing.key,
|
|
6088
|
+
value: editing.state === "loading" ? t("trig_editing") : editing.text,
|
|
6089
|
+
disabled: editing.state !== "ready",
|
|
6090
|
+
onChange: (event) => {
|
|
6091
|
+
onText(event.target.value);
|
|
6092
|
+
}
|
|
6093
|
+
}),
|
|
6094
|
+
editing.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6095
|
+
className: CharactersPanel_module_css_default.error,
|
|
6096
|
+
role: "alert",
|
|
6097
|
+
children: editing.error
|
|
6098
|
+
}),
|
|
6099
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [
|
|
6100
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6101
|
+
size: "sm",
|
|
6102
|
+
disabled: editing.state !== "ready",
|
|
6103
|
+
onClick: onSave,
|
|
6104
|
+
children: editing.state === "saving" ? t("trig_saving") : t("trig_saveTrigger")
|
|
6105
|
+
}),
|
|
6106
|
+
" ",
|
|
6107
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6108
|
+
variant: "ghost",
|
|
6109
|
+
size: "sm",
|
|
6110
|
+
onClick: onCancel,
|
|
6111
|
+
children: t("trig_cancelTrigger")
|
|
6112
|
+
})
|
|
6113
|
+
] })
|
|
6114
|
+
]
|
|
6115
|
+
});
|
|
6116
|
+
}
|
|
4459
6117
|
//#endregion
|
|
4460
6118
|
//#region src/client/world-editor/InfoPanel.tsx
|
|
4461
6119
|
const draftOf$3 = (info) => ({
|
|
@@ -5640,26 +7298,26 @@ window.__ModuleLoader__.load({
|
|
|
5640
7298
|
}
|
|
5641
7299
|
//#endregion
|
|
5642
7300
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/tool-switches/ToolSwitches.module.css.mjs
|
|
5643
|
-
const css$
|
|
5644
|
-
const key$
|
|
5645
|
-
let tag$
|
|
5646
|
-
if (tag$
|
|
5647
|
-
tag$
|
|
5648
|
-
tag$
|
|
5649
|
-
tag$
|
|
5650
|
-
document.head.appendChild(tag$
|
|
7301
|
+
const css$21 = ".rp_CjoFLq_root{flex-direction:column;gap:12px;display:flex}.rp_CjoFLq_title{margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_CjoFLq_help{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_CjoFLq_agent{border-top:1px solid var(--dsw-alias-border-l3);flex-direction:column;gap:6px;padding:8px 0;display:flex}.rp_CjoFLq_agentName{font-size:14px;font-weight:500}.rp_CjoFLq_hint{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_CjoFLq_tool{cursor:pointer;align-items:flex-start;gap:8px;font-size:13px;display:flex}.rp_CjoFLq_tool input{margin-top:3px}.rp_CjoFLq_toolText{flex-direction:column;display:flex}.rp_CjoFLq_default{color:var(--dsw-alias-label-tertiary);margin-left:6px;font-size:11px}.rp_CjoFLq_error{color:var(--dsw-alias-state-error-primary,#d33);font-size:12px}.rp_CjoFLq_external{flex-direction:column;gap:6px;margin-top:4px;display:flex}.rp_CjoFLq_external>summary{cursor:pointer}";
|
|
7302
|
+
const key$21 = "src/client/widgets/tool-switches/ToolSwitches.module.css";
|
|
7303
|
+
let tag$21 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$21) + "]");
|
|
7304
|
+
if (tag$21 === null) {
|
|
7305
|
+
tag$21 = document.createElement("style");
|
|
7306
|
+
tag$21.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
7307
|
+
tag$21.dataset.pluginCss = key$21;
|
|
7308
|
+
document.head.appendChild(tag$21);
|
|
5651
7309
|
}
|
|
5652
|
-
tag$
|
|
7310
|
+
tag$21.textContent = css$21;
|
|
5653
7311
|
var ToolSwitches_module_css_default = {
|
|
5654
|
-
"default": "rp_CjoFLq_default",
|
|
5655
|
-
"external": "rp_CjoFLq_external",
|
|
5656
7312
|
"title": "rp_CjoFLq_title",
|
|
5657
|
-
"agentName": "rp_CjoFLq_agentName",
|
|
5658
|
-
"toolText": "rp_CjoFLq_toolText",
|
|
5659
|
-
"tool": "rp_CjoFLq_tool",
|
|
5660
7313
|
"error": "rp_CjoFLq_error",
|
|
5661
|
-
"
|
|
7314
|
+
"toolText": "rp_CjoFLq_toolText",
|
|
7315
|
+
"default": "rp_CjoFLq_default",
|
|
5662
7316
|
"agent": "rp_CjoFLq_agent",
|
|
7317
|
+
"root": "rp_CjoFLq_root",
|
|
7318
|
+
"external": "rp_CjoFLq_external",
|
|
7319
|
+
"tool": "rp_CjoFLq_tool",
|
|
7320
|
+
"agentName": "rp_CjoFLq_agentName",
|
|
5663
7321
|
"hint": "rp_CjoFLq_hint",
|
|
5664
7322
|
"help": "rp_CjoFLq_help"
|
|
5665
7323
|
};
|
|
@@ -6659,44 +8317,44 @@ window.__ModuleLoader__.load({
|
|
|
6659
8317
|
const imageUrl = (target, image) => `${route(target, "/file")}&path=${encodeURIComponent(image.path)}&v=${encodeURIComponent(image.createdAt)}`;
|
|
6660
8318
|
//#endregion
|
|
6661
8319
|
//#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
|
|
6662
|
-
const css$
|
|
6663
|
-
const key$
|
|
6664
|
-
let tag$
|
|
6665
|
-
if (tag$
|
|
6666
|
-
tag$
|
|
6667
|
-
tag$
|
|
6668
|
-
tag$
|
|
6669
|
-
document.head.appendChild(tag$
|
|
8320
|
+
const css$20 = ".rp_9pSHmG_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;padding:16px 24px;display:flex;overflow-y:auto}.rp_9pSHmG_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;display:flex}.rp_9pSHmG_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_9pSHmG_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_9pSHmG_select{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);height:32px;font:inherit;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);padding:0 8px;font-size:12px}.rp_9pSHmG_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 24px;font-size:13px}.rp_9pSHmG_grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_9pSHmG_cell{min-width:0}.rp_9pSHmG_thumb{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);width:100%;font:inherit;text-align:left;color:inherit;cursor:pointer;flex-direction:column;padding:0;display:flex;overflow:hidden}.rp_9pSHmG_open{cursor:zoom-in;background:0 0;border:0;padding:0;display:block}.rp_9pSHmG_thumb:hover{border-color:var(--dsw-alias-border-l4)}.rp_9pSHmG_image{aspect-ratio:1;object-fit:cover;background:var(--dsw-alias-bg-layer-3);width:100%;display:block}.rp_9pSHmG_caption{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-secondary);padding:6px 8px;font-size:12px;overflow:hidden}.rp_9pSHmG_detail{flex-direction:column;gap:12px;width:min(640px,100%);max-height:70vh;display:flex;overflow-y:auto}.rp_9pSHmG_large{border-radius:var(--dsw-radius-lg);object-fit:contain;max-width:100%;max-height:32vh;margin:0 auto;display:block}.rp_9pSHmG_facts{grid-template-columns:max-content 1fr;gap:6px 12px;margin:0;font-size:12px;line-height:18px;display:grid}.rp_9pSHmG_facts dt{color:var(--dsw-alias-label-tertiary)}.rp_9pSHmG_facts dd{min-width:0;color:var(--dsw-alias-label-primary);margin:0}.rp_9pSHmG_pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:160px;overflow-y:auto}.rp_9pSHmG_tags{flex-wrap:wrap;gap:4px;display:flex}.rp_9pSHmG_note{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_9pSHmG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_9pSHmG_status,.rp_9pSHmG_statusError{color:var(--dsw-alias-label-tertiary);padding:0 8px 6px;font-size:11px;line-height:16px}.rp_9pSHmG_statusError{color:var(--dsw-alias-state-error-primary)}.rp_9pSHmG_reusable{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:6px;padding:0 8px 6px;font-size:11px;display:flex}.rp_9pSHmG_reusable input{accent-color:var(--dsw-alias-state-business-primary);margin:0}.rp_9pSHmG_editButton{font:inherit;color:var(--dsw-alias-state-business-primary);cursor:pointer;background:0 0;border:0;align-self:flex-start;margin:0 8px 4px;padding:0;font-size:11px}.rp_9pSHmG_edit{flex-direction:column;gap:12px;width:min(480px,100%);display:flex}.rp_9pSHmG_editField{flex-direction:column;gap:4px;display:flex}.rp_9pSHmG_editLabel{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_9pSHmG_editHelp{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_9pSHmG_editArea,.rp_9pSHmG_editInput{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}.rp_9pSHmG_editArea{resize:vertical;min-height:96px}.rp_9pSHmG_editArea:focus-visible,.rp_9pSHmG_editInput:focus-visible,.rp_9pSHmG_select:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}@media (width<=640px){.rp_9pSHmG_page{padding-inline:16px}.rp_9pSHmG_toolbar{align-items:flex-start}.rp_9pSHmG_grid{grid-template-columns:repeat(auto-fill,minmax(136px,1fr))}}";
|
|
8321
|
+
const key$20 = "src/client/widgets/gallery-view/GalleryView.module.css";
|
|
8322
|
+
let tag$20 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$20) + "]");
|
|
8323
|
+
if (tag$20 === null) {
|
|
8324
|
+
tag$20 = document.createElement("style");
|
|
8325
|
+
tag$20.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
8326
|
+
tag$20.dataset.pluginCss = key$20;
|
|
8327
|
+
document.head.appendChild(tag$20);
|
|
6670
8328
|
}
|
|
6671
|
-
tag$
|
|
8329
|
+
tag$20.textContent = css$20;
|
|
6672
8330
|
var GalleryView_module_css_default = {
|
|
6673
|
-
"
|
|
6674
|
-
"select": "rp_9pSHmG_select",
|
|
6675
|
-
"status": "rp_9pSHmG_status",
|
|
6676
|
-
"thumb": "rp_9pSHmG_thumb",
|
|
6677
|
-
"editInput": "rp_9pSHmG_editInput",
|
|
6678
|
-
"message": "rp_9pSHmG_message",
|
|
8331
|
+
"note": "rp_9pSHmG_note",
|
|
6679
8332
|
"editLabel": "rp_9pSHmG_editLabel",
|
|
8333
|
+
"toolbar": "rp_9pSHmG_toolbar",
|
|
8334
|
+
"image": "rp_9pSHmG_image",
|
|
8335
|
+
"status": "rp_9pSHmG_status",
|
|
8336
|
+
"cell": "rp_9pSHmG_cell",
|
|
8337
|
+
"count": "rp_9pSHmG_count",
|
|
8338
|
+
"edit": "rp_9pSHmG_edit",
|
|
8339
|
+
"large": "rp_9pSHmG_large",
|
|
8340
|
+
"editField": "rp_9pSHmG_editField",
|
|
8341
|
+
"actions": "rp_9pSHmG_actions",
|
|
6680
8342
|
"reusable": "rp_9pSHmG_reusable",
|
|
6681
|
-
"editArea": "rp_9pSHmG_editArea",
|
|
6682
8343
|
"editHelp": "rp_9pSHmG_editHelp",
|
|
6683
|
-
"actions": "rp_9pSHmG_actions",
|
|
6684
8344
|
"error": "rp_9pSHmG_error",
|
|
6685
|
-
"
|
|
6686
|
-
"facts": "rp_9pSHmG_facts",
|
|
6687
|
-
"caption": "rp_9pSHmG_caption",
|
|
6688
|
-
"cell": "rp_9pSHmG_cell",
|
|
6689
|
-
"editField": "rp_9pSHmG_editField",
|
|
6690
|
-
"detail": "rp_9pSHmG_detail",
|
|
8345
|
+
"thumb": "rp_9pSHmG_thumb",
|
|
6691
8346
|
"page": "rp_9pSHmG_page",
|
|
6692
|
-
"count": "rp_9pSHmG_count",
|
|
6693
8347
|
"grid": "rp_9pSHmG_grid",
|
|
6694
|
-
"
|
|
6695
|
-
"
|
|
8348
|
+
"caption": "rp_9pSHmG_caption",
|
|
8349
|
+
"message": "rp_9pSHmG_message",
|
|
6696
8350
|
"pre": "rp_9pSHmG_pre",
|
|
6697
|
-
"toolbar": "rp_9pSHmG_toolbar",
|
|
6698
8351
|
"tags": "rp_9pSHmG_tags",
|
|
6699
8352
|
"editButton": "rp_9pSHmG_editButton",
|
|
8353
|
+
"facts": "rp_9pSHmG_facts",
|
|
8354
|
+
"editInput": "rp_9pSHmG_editInput",
|
|
8355
|
+
"detail": "rp_9pSHmG_detail",
|
|
8356
|
+
"select": "rp_9pSHmG_select",
|
|
8357
|
+
"editArea": "rp_9pSHmG_editArea",
|
|
6700
8358
|
"statusError": "rp_9pSHmG_statusError",
|
|
6701
8359
|
"open": "rp_9pSHmG_open"
|
|
6702
8360
|
};
|
|
@@ -7028,24 +8686,24 @@ window.__ModuleLoader__.load({
|
|
|
7028
8686
|
}
|
|
7029
8687
|
//#endregion
|
|
7030
8688
|
//#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
|
|
7031
|
-
const css$
|
|
7032
|
-
const key$
|
|
7033
|
-
let tag$
|
|
7034
|
-
if (tag$
|
|
7035
|
-
tag$
|
|
7036
|
-
tag$
|
|
7037
|
-
tag$
|
|
7038
|
-
document.head.appendChild(tag$
|
|
8689
|
+
const css$19 = ".rp__swA3a_view{flex:1 1 0;width:100%;min-height:0;display:flex}.rp__swA3a_message{color:var(--dsw-alias-label-secondary);margin:0;padding:24px;font-size:13px}.rp__swA3a_warning{color:var(--dsw-alias-label-primary);border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-2);margin:0 0 12px;padding:8px 12px;font-size:13px}.rp__swA3a_drawer{box-sizing:border-box;border-right:.5px solid var(--dsw-alias-border-l3);flex-direction:column;flex:0 0 168px;gap:2px;padding:16px 8px;display:flex}.rp__swA3a_drawerItem{border-radius:var(--dsw-radius-md);width:100%;font:inherit;text-align:left;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:6px 12px;font-size:13px;line-height:20px;display:block}@media (width<=720px){.rp__swA3a_view{flex-direction:column}.rp__swA3a_drawer{border-right:0;border-bottom:.5px solid var(--dsw-alias-border-l3);flex-direction:row;flex:none;width:100%;padding:8px;overflow-x:auto}.rp__swA3a_drawerItem{white-space:nowrap;flex:none;width:auto}}.rp__swA3a_drawerItem:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.rp__swA3a_drawerItemOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2);font-weight:500}.rp__swA3a_content{flex-direction:column;flex:1 1 0;min-width:0;min-height:0;display:flex}";
|
|
8690
|
+
const key$19 = "src/client/world-editor/WorldEditor.module.css";
|
|
8691
|
+
let tag$19 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$19) + "]");
|
|
8692
|
+
if (tag$19 === null) {
|
|
8693
|
+
tag$19 = document.createElement("style");
|
|
8694
|
+
tag$19.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
8695
|
+
tag$19.dataset.pluginCss = key$19;
|
|
8696
|
+
document.head.appendChild(tag$19);
|
|
7039
8697
|
}
|
|
7040
|
-
tag$
|
|
8698
|
+
tag$19.textContent = css$19;
|
|
7041
8699
|
var WorldEditor_module_css_default = {
|
|
7042
|
-
"
|
|
7043
|
-
"content": "rp__swA3a_content",
|
|
8700
|
+
"message": "rp__swA3a_message",
|
|
7044
8701
|
"view": "rp__swA3a_view",
|
|
7045
|
-
"warning": "rp__swA3a_warning",
|
|
7046
8702
|
"drawerItem": "rp__swA3a_drawerItem",
|
|
8703
|
+
"warning": "rp__swA3a_warning",
|
|
8704
|
+
"drawer": "rp__swA3a_drawer",
|
|
7047
8705
|
"drawerItemOn": "rp__swA3a_drawerItemOn",
|
|
7048
|
-
"
|
|
8706
|
+
"content": "rp__swA3a_content"
|
|
7049
8707
|
};
|
|
7050
8708
|
//#endregion
|
|
7051
8709
|
//#region src/client/world-editor/WorldEditor.tsx
|
|
@@ -7401,6 +9059,8 @@ window.__ModuleLoader__.load({
|
|
|
7401
9059
|
section === "triggers" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggersPanel, {
|
|
7402
9060
|
t,
|
|
7403
9061
|
world: load.world,
|
|
9062
|
+
source,
|
|
9063
|
+
onChanged: changed,
|
|
7404
9064
|
actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
7405
9065
|
variant: "ghost",
|
|
7406
9066
|
size: "sm",
|
|
@@ -7428,38 +9088,38 @@ window.__ModuleLoader__.load({
|
|
|
7428
9088
|
}
|
|
7429
9089
|
//#endregion
|
|
7430
9090
|
//#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
|
|
7431
|
-
const css$
|
|
7432
|
-
const key$
|
|
7433
|
-
let tag$
|
|
7434
|
-
if (tag$
|
|
7435
|
-
tag$
|
|
7436
|
-
tag$
|
|
7437
|
-
tag$
|
|
7438
|
-
document.head.appendChild(tag$
|
|
9091
|
+
const css$18 = ".rp_pQOzEG_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_pQOzEG_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_pQOzEG_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_pQOzEG_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_pQOzEG_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_pQOzEG_grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_pQOzEG_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);align-items:center;gap:4px;min-width:0;padding-right:8px;display:flex}.rp_pQOzEG_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_pQOzEG_open{min-width:0;font:inherit;text-align:left;color:inherit;cursor:pointer;background:0 0;border:0;flex:auto;align-items:center;gap:12px;padding:10px 0 10px 10px;display:flex}.rp_pQOzEG_open:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_pQOzEG_portrait,.rp_pQOzEG_placeholder{border-radius:var(--dsw-radius-lg);object-fit:cover;flex:none;width:48px;height:48px}.rp_pQOzEG_placeholder{color:var(--dsw-alias-label-secondary);justify-content:center;align-items:center;font-size:20px;font-weight:500;display:flex}.rp_pQOzEG_text{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_pQOzEG_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_pQOzEG_summary{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.rp_pQOzEG_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_pQOzEG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_pQOzEG_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_pQOzEG_editTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_pQOzEG_editBody{flex:1 1 0;min-height:0;display:flex}.rp_pQOzEG_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_pQOzEG_field{flex-direction:column;gap:6px;min-width:0;display:flex}.rp_pQOzEG_label{color:var(--dsw-alias-label-secondary);font-size:12px}@media (width<=640px){.rp_pQOzEG_toolbar{align-items:flex-start}.rp_pQOzEG_count{padding-top:6px}.rp_pQOzEG_grid{grid-template-columns:1fr}.rp_pQOzEG_form{min-width:0}}";
|
|
9092
|
+
const key$18 = "src/client/pages/avatars/AvatarsPage.module.css";
|
|
9093
|
+
let tag$18 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$18) + "]");
|
|
9094
|
+
if (tag$18 === null) {
|
|
9095
|
+
tag$18 = document.createElement("style");
|
|
9096
|
+
tag$18.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
9097
|
+
tag$18.dataset.pluginCss = key$18;
|
|
9098
|
+
document.head.appendChild(tag$18);
|
|
7439
9099
|
}
|
|
7440
|
-
tag$
|
|
9100
|
+
tag$18.textContent = css$18;
|
|
7441
9101
|
var AvatarsPage_module_css_default = {
|
|
7442
|
-
"
|
|
7443
|
-
"
|
|
7444
|
-
"page": "rp_pQOzEG_page",
|
|
9102
|
+
"open": "rp_pQOzEG_open",
|
|
9103
|
+
"placeholder": "rp_pQOzEG_placeholder",
|
|
7445
9104
|
"count": "rp_pQOzEG_count",
|
|
7446
9105
|
"actions": "rp_pQOzEG_actions",
|
|
9106
|
+
"card": "rp_pQOzEG_card",
|
|
7447
9107
|
"name": "rp_pQOzEG_name",
|
|
9108
|
+
"field": "rp_pQOzEG_field",
|
|
9109
|
+
"editHeader": "rp_pQOzEG_editHeader",
|
|
7448
9110
|
"message": "rp_pQOzEG_message",
|
|
7449
9111
|
"editTitle": "rp_pQOzEG_editTitle",
|
|
7450
|
-
"
|
|
9112
|
+
"editBody": "rp_pQOzEG_editBody",
|
|
9113
|
+
"viewport": "rp_pQOzEG_viewport",
|
|
7451
9114
|
"form": "rp_pQOzEG_form",
|
|
9115
|
+
"toolbar": "rp_pQOzEG_toolbar",
|
|
7452
9116
|
"label": "rp_pQOzEG_label",
|
|
7453
|
-
"card": "rp_pQOzEG_card",
|
|
7454
9117
|
"portrait": "rp_pQOzEG_portrait",
|
|
7455
|
-
"summary": "rp_pQOzEG_summary",
|
|
7456
|
-
"text": "rp_pQOzEG_text",
|
|
7457
|
-
"grid": "rp_pQOzEG_grid",
|
|
7458
|
-
"placeholder": "rp_pQOzEG_placeholder",
|
|
7459
|
-
"editHeader": "rp_pQOzEG_editHeader",
|
|
7460
9118
|
"error": "rp_pQOzEG_error",
|
|
7461
|
-
"
|
|
7462
|
-
"
|
|
9119
|
+
"text": "rp_pQOzEG_text",
|
|
9120
|
+
"grid": "rp_pQOzEG_grid",
|
|
9121
|
+
"summary": "rp_pQOzEG_summary",
|
|
9122
|
+
"page": "rp_pQOzEG_page"
|
|
7463
9123
|
};
|
|
7464
9124
|
//#endregion
|
|
7465
9125
|
//#region src/client/pages/avatars/AvatarsPage.tsx
|
|
@@ -8040,6 +9700,12 @@ window.__ModuleLoader__.load({
|
|
|
8040
9700
|
portraitFailed: "Could not generate portrait: {message}",
|
|
8041
9701
|
portraitSaveFirst: "Save the visual identity before generating.",
|
|
8042
9702
|
portraitIdentityRequired: "Add and save a visual identity before generating a portrait.",
|
|
9703
|
+
imageMissing: "No picture",
|
|
9704
|
+
imageUpload: "Upload a PNG picture",
|
|
9705
|
+
imageGenerate: "Generate picture",
|
|
9706
|
+
imageRetry: "Regenerate picture",
|
|
9707
|
+
imageFailed: "Could not make the picture: {message}",
|
|
9708
|
+
imageIdentityRequired: "Add and save a visual identity before generating a picture; a PNG can be uploaded without one.",
|
|
8043
9709
|
playable: "Playable",
|
|
8044
9710
|
npc: "Character",
|
|
8045
9711
|
principal: "Principal",
|
|
@@ -8315,6 +9981,12 @@ window.__ModuleLoader__.load({
|
|
|
8315
9981
|
portraitFailed: "无法生成肖像:{message}",
|
|
8316
9982
|
portraitSaveFirst: "请先保存视觉身份。",
|
|
8317
9983
|
portraitIdentityRequired: "请先添加并保存视觉身份,再生成肖像。",
|
|
9984
|
+
imageMissing: "暂无图片",
|
|
9985
|
+
imageUpload: "上传 PNG 图片",
|
|
9986
|
+
imageGenerate: "生成图片",
|
|
9987
|
+
imageRetry: "重新生成图片",
|
|
9988
|
+
imageFailed: "无法生成图片:{message}",
|
|
9989
|
+
imageIdentityRequired: "请先添加并保存视觉身份,再生成图片;不添加也可以直接上传 PNG。",
|
|
8318
9990
|
playable: "可扮演",
|
|
8319
9991
|
npc: "角色",
|
|
8320
9992
|
principal: "主要",
|
|
@@ -8491,6 +10163,18 @@ window.__ModuleLoader__.load({
|
|
|
8491
10163
|
all: "all of: {parts}",
|
|
8492
10164
|
any: "any of: {parts}",
|
|
8493
10165
|
not: "not ({part})",
|
|
10166
|
+
editTrigger: "Edit",
|
|
10167
|
+
saveTrigger: "Save",
|
|
10168
|
+
cancelTrigger: "Cancel",
|
|
10169
|
+
removeTrigger: "Remove",
|
|
10170
|
+
removeConfirm: "Remove “{key}” (kept in the world’s trash)",
|
|
10171
|
+
addTrigger: "Add a trigger",
|
|
10172
|
+
newKey: "Key (letters, digits and hyphens)",
|
|
10173
|
+
notJson: "This is not valid JSON: {message}",
|
|
10174
|
+
saveFailed: "Not saved: {message}",
|
|
10175
|
+
editHelp: "Edit the trigger as it is written in triggers.json: when (a condition), effects (edit, beat or cue), and the optional repeat, cooldown_seconds, chance, priority, expires and announce. It is checked as a story start checks it, and refused with every problem when it names something the world does not have.",
|
|
10176
|
+
editing: "Loading…",
|
|
10177
|
+
saving: "Saving…",
|
|
8494
10178
|
edit: "changes the story’s records ({events} event(s))",
|
|
8495
10179
|
beat: "tells the game master: “{text}”",
|
|
8496
10180
|
cue: "{audience} notice: “{text}”",
|
|
@@ -8541,6 +10225,18 @@ window.__ModuleLoader__.load({
|
|
|
8541
10225
|
all: "以下全部成立:{parts}",
|
|
8542
10226
|
any: "以下任一成立:{parts}",
|
|
8543
10227
|
not: "不满足({part})",
|
|
10228
|
+
editTrigger: "编辑",
|
|
10229
|
+
saveTrigger: "保存",
|
|
10230
|
+
cancelTrigger: "取消",
|
|
10231
|
+
removeTrigger: "删除",
|
|
10232
|
+
removeConfirm: "删除“{key}”(保留在世界的回收文件夹里)",
|
|
10233
|
+
addTrigger: "添加触发器",
|
|
10234
|
+
newKey: "键(字母、数字和连字符)",
|
|
10235
|
+
notJson: "这不是有效的 JSON:{message}",
|
|
10236
|
+
saveFailed: "未保存:{message}",
|
|
10237
|
+
editHelp: "按 triggers.json 中的写法编辑这个触发器:when(条件)、effects(edit、beat 或 cue),以及可选的 repeat、cooldown_seconds、chance、priority、expires 和 announce。保存时会像开始故事时那样检查,若提到世界里没有的东西,会列出全部问题并拒绝。",
|
|
10238
|
+
editing: "正在加载…",
|
|
10239
|
+
saving: "正在保存…",
|
|
8544
10240
|
edit: "修改故事记录({events} 个事件)",
|
|
8545
10241
|
beat: "告诉游戏主持人:“{text}”",
|
|
8546
10242
|
cue: "{audience}察觉:“{text}”",
|
|
@@ -8550,8 +10246,25 @@ window.__ModuleLoader__.load({
|
|
|
8550
10246
|
}
|
|
8551
10247
|
}, "trig_")), prefixed({
|
|
8552
10248
|
en: {
|
|
10249
|
+
newPack: "New pack",
|
|
10250
|
+
newPackId: "Pack name (letters, digits, - and _)",
|
|
10251
|
+
create: "Create",
|
|
10252
|
+
newFile: "New file",
|
|
10253
|
+
newFilePath: "Path in the pack, such as hud.html",
|
|
10254
|
+
editFile: "Edit",
|
|
10255
|
+
saveFile: "Save",
|
|
10256
|
+
cancelFile: "Cancel",
|
|
10257
|
+
deleteFile: "Delete",
|
|
10258
|
+
deleteConfirm: "Delete {path} (kept in the world’s trash)",
|
|
10259
|
+
fileLoading: "Loading…",
|
|
10260
|
+
fileSaving: "Saving…",
|
|
10261
|
+
fileNotSaved: "Not saved: {message}",
|
|
10262
|
+
savedWith: "Saved. The pack still has {count} problem(s), listed above.",
|
|
10263
|
+
savedClean: "Saved. The pack has no problems.",
|
|
10264
|
+
textOnly: "Only text files (html, css, js, json, txt, svg) can be edited here; pictures and fonts are added to the folder by hand.",
|
|
10265
|
+
editHelp: "The file is written as it is, and the pack is checked as a story start checks it.",
|
|
8553
10266
|
title: "Interface",
|
|
8554
|
-
help: "The interface packs this world carries: files in its ui folder that restyle the story and add surfaces of their own.
|
|
10267
|
+
help: "The interface packs this world carries: files in its ui folder that restyle the story and add surfaces of their own. Edit a pack’s text files here, or ask the authoring assistant to make or change one. A story of the world gets a copy when it starts, and a pack with problems stops it.",
|
|
8555
10268
|
none: "This world carries no interface pack.",
|
|
8556
10269
|
loading: "Reading the packs…",
|
|
8557
10270
|
loadFailed: "Could not read the packs: {message}",
|
|
@@ -8587,8 +10300,25 @@ window.__ModuleLoader__.load({
|
|
|
8587
10300
|
noSurfaces: "The pack has no surface to preview."
|
|
8588
10301
|
},
|
|
8589
10302
|
zh: {
|
|
10303
|
+
newPack: "新建界面包",
|
|
10304
|
+
newPackId: "包名(字母、数字、- 和 _)",
|
|
10305
|
+
create: "创建",
|
|
10306
|
+
newFile: "新建文件",
|
|
10307
|
+
newFilePath: "包内路径,例如 hud.html",
|
|
10308
|
+
editFile: "编辑",
|
|
10309
|
+
saveFile: "保存",
|
|
10310
|
+
cancelFile: "取消",
|
|
10311
|
+
deleteFile: "删除",
|
|
10312
|
+
deleteConfirm: "删除 {path}(保留在世界的回收文件夹里)",
|
|
10313
|
+
fileLoading: "正在加载…",
|
|
10314
|
+
fileSaving: "正在保存…",
|
|
10315
|
+
fileNotSaved: "未保存:{message}",
|
|
10316
|
+
savedWith: "已保存。界面包仍有 {count} 个问题,见上方列表。",
|
|
10317
|
+
savedClean: "已保存。界面包没有问题。",
|
|
10318
|
+
textOnly: "这里只能编辑文本文件(html、css、js、json、txt、svg);图片和字体请手动放进文件夹。",
|
|
10319
|
+
editHelp: "文件按原样写入,并像开始故事时那样检查界面包。",
|
|
8590
10320
|
title: "界面",
|
|
8591
|
-
help: "这个世界携带的界面包:放在它 ui
|
|
10321
|
+
help: "这个世界携带的界面包:放在它 ui 文件夹里的文件,可以改变故事的外观并添加自己的界面。可以在这里编辑界面包的文本文件,也可以让创作助手来创建或修改。由这个世界开始的故事在开始时会得到一份拷贝,有问题的界面包会使故事无法开始。",
|
|
8592
10322
|
none: "这个世界没有携带界面包。",
|
|
8593
10323
|
loading: "正在读取界面包…",
|
|
8594
10324
|
loadFailed: "无法读取界面包:{message}",
|
|
@@ -8771,16 +10501,6 @@ window.__ModuleLoader__.load({
|
|
|
8771
10501
|
inject: () => avatars.inject()
|
|
8772
10502
|
}, AvatarsPage));
|
|
8773
10503
|
}
|
|
8774
|
-
//#endregion
|
|
8775
|
-
//#region src/client/chat/open-chat.ts
|
|
8776
|
-
/** Resolves the workspace service on use, so a client without it fails at the click, not at load. */
|
|
8777
|
-
function createChatOpener(ctx) {
|
|
8778
|
-
return (chatSessionId) => {
|
|
8779
|
-
const workspace = ctx.get("uiWorkspace");
|
|
8780
|
-
if (workspace === void 0) throw new Error("the chat is not available in this client");
|
|
8781
|
-
workspace.openSession(chatSessionId);
|
|
8782
|
-
};
|
|
8783
|
-
}
|
|
8784
10504
|
/** Page by what fits on screen, but never below the minimum page. */
|
|
8785
10505
|
function pagingFor(fit) {
|
|
8786
10506
|
return fit >= 10 ? {
|
|
@@ -8801,16 +10521,16 @@ window.__ModuleLoader__.load({
|
|
|
8801
10521
|
}
|
|
8802
10522
|
//#endregion
|
|
8803
10523
|
//#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
|
|
8804
|
-
const css$
|
|
8805
|
-
const key$
|
|
8806
|
-
let tag$
|
|
8807
|
-
if (tag$
|
|
8808
|
-
tag$
|
|
8809
|
-
tag$
|
|
8810
|
-
tag$
|
|
8811
|
-
document.head.appendChild(tag$
|
|
10524
|
+
const css$17 = ".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}";
|
|
10525
|
+
const key$17 = "src/client/widgets/pager/Pager.module.css";
|
|
10526
|
+
let tag$17 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$17) + "]");
|
|
10527
|
+
if (tag$17 === null) {
|
|
10528
|
+
tag$17 = document.createElement("style");
|
|
10529
|
+
tag$17.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
10530
|
+
tag$17.dataset.pluginCss = key$17;
|
|
10531
|
+
document.head.appendChild(tag$17);
|
|
8812
10532
|
}
|
|
8813
|
-
tag$
|
|
10533
|
+
tag$17.textContent = css$17;
|
|
8814
10534
|
var Pager_module_css_default = {
|
|
8815
10535
|
"position": "rp_KBAD0W_position",
|
|
8816
10536
|
"pager": "rp_KBAD0W_pager"
|
|
@@ -8848,16 +10568,16 @@ window.__ModuleLoader__.load({
|
|
|
8848
10568
|
}
|
|
8849
10569
|
//#endregion
|
|
8850
10570
|
//#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
|
|
8851
|
-
const css$
|
|
8852
|
-
const key$
|
|
8853
|
-
let tag$
|
|
8854
|
-
if (tag$
|
|
8855
|
-
tag$
|
|
8856
|
-
tag$
|
|
8857
|
-
tag$
|
|
8858
|
-
document.head.appendChild(tag$
|
|
10571
|
+
const css$16 = ".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)}";
|
|
10572
|
+
const key$16 = "src/client/widgets/problem-list/ProblemList.module.css";
|
|
10573
|
+
let tag$16 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$16) + "]");
|
|
10574
|
+
if (tag$16 === null) {
|
|
10575
|
+
tag$16 = document.createElement("style");
|
|
10576
|
+
tag$16.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
10577
|
+
tag$16.dataset.pluginCss = key$16;
|
|
10578
|
+
document.head.appendChild(tag$16);
|
|
8859
10579
|
}
|
|
8860
|
-
tag$
|
|
10580
|
+
tag$16.textContent = css$16;
|
|
8861
10581
|
var ProblemList_module_css_default = { "problems": "rp_LZh3Iq_problems" };
|
|
8862
10582
|
//#endregion
|
|
8863
10583
|
//#region src/client/widgets/problem-list/ProblemList.tsx
|
|
@@ -8875,21 +10595,21 @@ window.__ModuleLoader__.load({
|
|
|
8875
10595
|
}
|
|
8876
10596
|
//#endregion
|
|
8877
10597
|
//#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
|
|
8878
|
-
const css$
|
|
8879
|
-
const key$
|
|
8880
|
-
let tag$
|
|
8881
|
-
if (tag$
|
|
8882
|
-
tag$
|
|
8883
|
-
tag$
|
|
8884
|
-
tag$
|
|
8885
|
-
document.head.appendChild(tag$
|
|
10598
|
+
const css$15 = ".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}";
|
|
10599
|
+
const key$15 = "src/client/pages/sessions/DeleteSessionDialog.module.css";
|
|
10600
|
+
let tag$15 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$15) + "]");
|
|
10601
|
+
if (tag$15 === null) {
|
|
10602
|
+
tag$15 = document.createElement("style");
|
|
10603
|
+
tag$15.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
10604
|
+
tag$15.dataset.pluginCss = key$15;
|
|
10605
|
+
document.head.appendChild(tag$15);
|
|
8886
10606
|
}
|
|
8887
|
-
tag$
|
|
10607
|
+
tag$15.textContent = css$15;
|
|
8888
10608
|
var DeleteSessionDialog_module_css_default = {
|
|
8889
|
-
"
|
|
8890
|
-
"body": "rp_FifHrW_body",
|
|
10609
|
+
"error": "rp_FifHrW_error",
|
|
8891
10610
|
"question": "rp_FifHrW_question",
|
|
8892
|
-
"
|
|
10611
|
+
"warning": "rp_FifHrW_warning",
|
|
10612
|
+
"body": "rp_FifHrW_body"
|
|
8893
10613
|
};
|
|
8894
10614
|
//#endregion
|
|
8895
10615
|
//#region src/client/pages/sessions/DeleteSessionDialog.tsx
|
|
@@ -8985,39 +10705,39 @@ window.__ModuleLoader__.load({
|
|
|
8985
10705
|
}
|
|
8986
10706
|
//#endregion
|
|
8987
10707
|
//#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
|
|
8988
|
-
const css$
|
|
8989
|
-
const key$
|
|
8990
|
-
let tag$
|
|
8991
|
-
if (tag$
|
|
8992
|
-
tag$
|
|
8993
|
-
tag$
|
|
8994
|
-
tag$
|
|
8995
|
-
document.head.appendChild(tag$
|
|
10708
|
+
const css$14 = ".rp_24z4eW_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_24z4eW_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_24z4eW_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_24z4eW_spinning{animation:.9s linear infinite rp_24z4eW_spin}@keyframes rp_24z4eW_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.rp_24z4eW_spinning{animation:none}}.rp_24z4eW_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_24z4eW_viewport{--rp-row-height:40px;--rp-header-height:32px;flex:1 1 0;min-height:0;overflow-x:auto}.rp_24z4eW_scrolls{overflow-y:auto}.rp_24z4eW_fits{overflow-y:hidden}.rp_24z4eW_table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:720px}.rp_24z4eW_actionsColumn{width:104px}.rp_24z4eW_nameColumn{width:30%}.rp_24z4eW_worldColumn{width:26%}.rp_24z4eW_timeColumn{width:16%}.rp_24z4eW_turnsColumn{width:10%}.rp_24z4eW_table th{height:var(--rp-header-height);border-bottom:.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);text-align:left;color:var(--dsw-alias-label-tertiary);padding:0 12px;font-size:12px;font-weight:400;position:sticky;top:0}.rp_24z4eW_table td{height:var(--rp-row-height);border-bottom:.5px solid var(--dsw-alias-border-l1);text-overflow:ellipsis;white-space:nowrap;padding:0 12px;font-size:13px;overflow:hidden}.rp_24z4eW_name{color:var(--dsw-alias-label-primary);font-weight:500}.rp_24z4eW_secondary{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_24z4eW_table .rp_24z4eW_number{text-align:right}.rp_24z4eW_table .rp_24z4eW_actions{text-align:center;white-space:nowrap;padding:0 8px}.rp_24z4eW_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_24z4eW_archived td{opacity:.6}.rp_24z4eW_badge{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-tertiary);margin-left:6px;padding:0 6px;font-size:11px}@media (width<=640px){.rp_24z4eW_viewport{--rp-row-height:196px;--rp-header-height:0px;overflow-x:hidden}.rp_24z4eW_table,.rp_24z4eW_table tbody,.rp_24z4eW_table tr,.rp_24z4eW_table td{width:100%;display:block}.rp_24z4eW_table{min-width:0}.rp_24z4eW_table colgroup,.rp_24z4eW_table thead{display:none}.rp_24z4eW_table tr{box-sizing:border-box;min-height:var(--rp-row-height);border-bottom:.5px solid var(--dsw-alias-border-l2);padding:10px 12px}.rp_24z4eW_table td{box-sizing:border-box;text-align:start;text-overflow:clip;white-space:normal;overflow-wrap:anywhere;border:0;grid-template-columns:minmax(88px,34%) minmax(0,1fr);align-items:baseline;height:auto;min-height:24px;padding:2px 0;display:grid;overflow:visible}.rp_24z4eW_table td:before{content:attr(data-label);color:var(--dsw-alias-label-tertiary);padding-inline-end:10px;font-size:11px;font-weight:400}.rp_24z4eW_table .rp_24z4eW_number{text-align:start}.rp_24z4eW_table .rp_24z4eW_actions{justify-content:flex-end;min-height:36px;padding-top:4px;display:flex}.rp_24z4eW_table .rp_24z4eW_actions:before{margin-inline-end:auto}}";
|
|
10709
|
+
const key$14 = "src/client/pages/sessions/SessionsPage.module.css";
|
|
10710
|
+
let tag$14 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$14) + "]");
|
|
10711
|
+
if (tag$14 === null) {
|
|
10712
|
+
tag$14 = document.createElement("style");
|
|
10713
|
+
tag$14.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
10714
|
+
tag$14.dataset.pluginCss = key$14;
|
|
10715
|
+
document.head.appendChild(tag$14);
|
|
8996
10716
|
}
|
|
8997
|
-
tag$
|
|
10717
|
+
tag$14.textContent = css$14;
|
|
8998
10718
|
var SessionsPage_module_css_default = {
|
|
8999
|
-
"archived": "rp_24z4eW_archived",
|
|
9000
10719
|
"fits": "rp_24z4eW_fits",
|
|
10720
|
+
"table": "rp_24z4eW_table",
|
|
10721
|
+
"spinning": "rp_24z4eW_spinning",
|
|
9001
10722
|
"actions": "rp_24z4eW_actions",
|
|
9002
10723
|
"nameColumn": "rp_24z4eW_nameColumn",
|
|
9003
|
-
"
|
|
9004
|
-
"toolbar": "rp_24z4eW_toolbar",
|
|
9005
|
-
"secondary": "rp_24z4eW_secondary",
|
|
9006
|
-
"table": "rp_24z4eW_table",
|
|
9007
|
-
"viewport": "rp_24z4eW_viewport",
|
|
9008
|
-
"name": "rp_24z4eW_name",
|
|
10724
|
+
"turnsColumn": "rp_24z4eW_turnsColumn",
|
|
9009
10725
|
"timeColumn": "rp_24z4eW_timeColumn",
|
|
9010
|
-
"
|
|
10726
|
+
"scrolls": "rp_24z4eW_scrolls",
|
|
10727
|
+
"worldColumn": "rp_24z4eW_worldColumn",
|
|
9011
10728
|
"notice": "rp_24z4eW_notice",
|
|
10729
|
+
"message": "rp_24z4eW_message",
|
|
9012
10730
|
"actionsColumn": "rp_24z4eW_actionsColumn",
|
|
9013
10731
|
"spin": "rp_24z4eW_spin",
|
|
9014
|
-
"
|
|
9015
|
-
"
|
|
9016
|
-
"
|
|
10732
|
+
"viewport": "rp_24z4eW_viewport",
|
|
10733
|
+
"archived": "rp_24z4eW_archived",
|
|
10734
|
+
"count": "rp_24z4eW_count",
|
|
9017
10735
|
"number": "rp_24z4eW_number",
|
|
10736
|
+
"name": "rp_24z4eW_name",
|
|
10737
|
+
"secondary": "rp_24z4eW_secondary",
|
|
10738
|
+
"toolbar": "rp_24z4eW_toolbar",
|
|
9018
10739
|
"badge": "rp_24z4eW_badge",
|
|
9019
|
-
"
|
|
9020
|
-
"turnsColumn": "rp_24z4eW_turnsColumn"
|
|
10740
|
+
"page": "rp_24z4eW_page"
|
|
9021
10741
|
};
|
|
9022
10742
|
//#endregion
|
|
9023
10743
|
//#region src/client/pages/sessions/SessionsPage.tsx
|
|
@@ -9522,27 +11242,27 @@ window.__ModuleLoader__.load({
|
|
|
9522
11242
|
}
|
|
9523
11243
|
//#endregion
|
|
9524
11244
|
//#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
|
|
9525
|
-
const css$
|
|
9526
|
-
const key$
|
|
9527
|
-
let tag$
|
|
9528
|
-
if (tag$
|
|
9529
|
-
tag$
|
|
9530
|
-
tag$
|
|
9531
|
-
tag$
|
|
9532
|
-
document.head.appendChild(tag$
|
|
11245
|
+
const css$13 = ".rp_Bvxx5q_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);flex-direction:column;flex:auto;min-width:0;transition:border-color .12s;display:flex;position:relative;overflow:hidden}.rp_Bvxx5q_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_Bvxx5q_card:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_Bvxx5q_cover{background:var(--dsw-alias-bg-layer-3);flex:1 1 0;min-height:0;position:relative;overflow:hidden}.rp_Bvxx5q_image{object-fit:cover;width:100%;height:100%;display:block}.rp_Bvxx5q_placeholder{color:#ffffffd9;background:linear-gradient(145deg, hsl(var(--rp-hue) 38% 46%), hsl(calc(var(--rp-hue) + 35) 38% 32%));user-select:none;justify-content:center;align-items:center;width:100%;height:100%;font-size:40px;font-weight:500;display:flex}.rp_Bvxx5q_play{z-index:2;corner-shape:round;color:#fff;opacity:.6;cursor:pointer;background:#00000059;border:0;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;padding:0;transition:opacity .12s,background-color .12s;display:flex;position:absolute;top:8px;right:8px}.rp_Bvxx5q_card:hover .rp_Bvxx5q_play,.rp_Bvxx5q_play:focus-visible{opacity:1}.rp_Bvxx5q_play:hover{background:#0000008c}.rp_Bvxx5q_play:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_Bvxx5q_info{flex-direction:column;flex:none;gap:4px;padding:8px 10px;display:flex}.rp_Bvxx5q_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.rp_Bvxx5q_tags{gap:4px;display:flex;overflow:hidden;mask-image:linear-gradient(90deg,#000 calc(100% - 20px),#0000)}.rp_Bvxx5q_tag{flex:none}.rp_Bvxx5q_openButton{z-index:1;border-radius:inherit;cursor:pointer;background:0 0;border:0;width:100%;padding:0;position:absolute;inset:0}.rp_Bvxx5q_openButton:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:-2px}";
|
|
11246
|
+
const key$13 = "src/client/widgets/world-card/WorldCard.module.css";
|
|
11247
|
+
let tag$13 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$13) + "]");
|
|
11248
|
+
if (tag$13 === null) {
|
|
11249
|
+
tag$13 = document.createElement("style");
|
|
11250
|
+
tag$13.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
11251
|
+
tag$13.dataset.pluginCss = key$13;
|
|
11252
|
+
document.head.appendChild(tag$13);
|
|
9533
11253
|
}
|
|
9534
|
-
tag$
|
|
11254
|
+
tag$13.textContent = css$13;
|
|
9535
11255
|
var WorldCard_module_css_default = {
|
|
9536
|
-
"
|
|
9537
|
-
"tags": "rp_Bvxx5q_tags",
|
|
11256
|
+
"tag": "rp_Bvxx5q_tag",
|
|
9538
11257
|
"card": "rp_Bvxx5q_card",
|
|
11258
|
+
"info": "rp_Bvxx5q_info",
|
|
11259
|
+
"tags": "rp_Bvxx5q_tags",
|
|
9539
11260
|
"name": "rp_Bvxx5q_name",
|
|
9540
|
-
"placeholder": "rp_Bvxx5q_placeholder",
|
|
9541
|
-
"play": "rp_Bvxx5q_play",
|
|
9542
11261
|
"cover": "rp_Bvxx5q_cover",
|
|
9543
|
-
"
|
|
9544
|
-
"
|
|
9545
|
-
"
|
|
11262
|
+
"openButton": "rp_Bvxx5q_openButton",
|
|
11263
|
+
"play": "rp_Bvxx5q_play",
|
|
11264
|
+
"placeholder": "rp_Bvxx5q_placeholder",
|
|
11265
|
+
"image": "rp_Bvxx5q_image"
|
|
9546
11266
|
};
|
|
9547
11267
|
//#endregion
|
|
9548
11268
|
//#region src/client/widgets/world-card/WorldCard.tsx
|
|
@@ -9625,21 +11345,21 @@ window.__ModuleLoader__.load({
|
|
|
9625
11345
|
}
|
|
9626
11346
|
//#endregion
|
|
9627
11347
|
//#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
|
|
9628
|
-
const css$
|
|
9629
|
-
const key$
|
|
9630
|
-
let tag$
|
|
9631
|
-
if (tag$
|
|
9632
|
-
tag$
|
|
9633
|
-
tag$
|
|
9634
|
-
tag$
|
|
9635
|
-
document.head.appendChild(tag$
|
|
11348
|
+
const css$12 = ".rp_YCstOG_option{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}.rp_YCstOG_option:has(input:checked){border-color:var(--dsw-alias-state-business-primary)}.rp_YCstOG_option input{accent-color:var(--dsw-alias-state-business-primary);margin:3px 0 0}.rp_YCstOG_text{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_YCstOG_name{font-size:13px;font-weight:500}.rp_YCstOG_summary{color:var(--dsw-alias-label-secondary);font-size:12px}";
|
|
11349
|
+
const key$12 = "src/client/widgets/avatar-choices/AvatarChoices.module.css";
|
|
11350
|
+
let tag$12 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$12) + "]");
|
|
11351
|
+
if (tag$12 === null) {
|
|
11352
|
+
tag$12 = document.createElement("style");
|
|
11353
|
+
tag$12.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
11354
|
+
tag$12.dataset.pluginCss = key$12;
|
|
11355
|
+
document.head.appendChild(tag$12);
|
|
9636
11356
|
}
|
|
9637
|
-
tag$
|
|
11357
|
+
tag$12.textContent = css$12;
|
|
9638
11358
|
var AvatarChoices_module_css_default = {
|
|
11359
|
+
"text": "rp_YCstOG_text",
|
|
9639
11360
|
"name": "rp_YCstOG_name",
|
|
9640
|
-
"option": "rp_YCstOG_option",
|
|
9641
11361
|
"summary": "rp_YCstOG_summary",
|
|
9642
|
-
"
|
|
11362
|
+
"option": "rp_YCstOG_option"
|
|
9643
11363
|
};
|
|
9644
11364
|
//#endregion
|
|
9645
11365
|
//#region src/client/widgets/avatar-choices/AvatarChoices.tsx
|
|
@@ -9668,29 +11388,29 @@ window.__ModuleLoader__.load({
|
|
|
9668
11388
|
}
|
|
9669
11389
|
//#endregion
|
|
9670
11390
|
//#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
|
|
9671
|
-
const css$
|
|
9672
|
-
const key$
|
|
9673
|
-
let tag$
|
|
9674
|
-
if (tag$
|
|
9675
|
-
tag$
|
|
9676
|
-
tag$
|
|
9677
|
-
tag$
|
|
9678
|
-
document.head.appendChild(tag$
|
|
11391
|
+
const css$11 = ".rp_AnbLKG_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_AnbLKG_field{border:0;flex-direction:column;gap:6px;min-width:0;margin:0;padding:0;display:flex}.rp_AnbLKG_label{color:var(--dsw-alias-label-secondary);padding:0;font-size:12px}.rp_AnbLKG_option{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}.rp_AnbLKG_option:has(input:checked){border-color:var(--dsw-alias-state-business-primary)}.rp_AnbLKG_option input{accent-color:var(--dsw-alias-state-business-primary);margin:3px 0 0}.rp_AnbLKG_optionText{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_AnbLKG_optionName{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:20px}.rp_AnbLKG_optionSummary{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.rp_AnbLKG_message{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_AnbLKG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_AnbLKG_advanced{flex-direction:column;gap:8px;display:flex}.rp_AnbLKG_advancedToggle{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;align-self:flex-start;align-items:center;gap:6px;padding:0;font-size:12px;display:inline-flex}.rp_AnbLKG_advancedToggle:hover{color:var(--dsw-alias-label-primary)}.rp_AnbLKG_advancedBody{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1);flex-direction:column;gap:12px;max-height:320px;padding:12px;display:flex;overflow-y:auto}@media (width<=520px){.rp_AnbLKG_form{min-width:0}}";
|
|
11392
|
+
const key$11 = "src/client/pages/worlds/StartSessionDialog.module.css";
|
|
11393
|
+
let tag$11 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$11) + "]");
|
|
11394
|
+
if (tag$11 === null) {
|
|
11395
|
+
tag$11 = document.createElement("style");
|
|
11396
|
+
tag$11.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
11397
|
+
tag$11.dataset.pluginCss = key$11;
|
|
11398
|
+
document.head.appendChild(tag$11);
|
|
9679
11399
|
}
|
|
9680
|
-
tag$
|
|
11400
|
+
tag$11.textContent = css$11;
|
|
9681
11401
|
var StartSessionDialog_module_css_default = {
|
|
9682
|
-
"advancedBody": "rp_AnbLKG_advancedBody",
|
|
9683
|
-
"option": "rp_AnbLKG_option",
|
|
9684
|
-
"optionText": "rp_AnbLKG_optionText",
|
|
9685
|
-
"optionSummary": "rp_AnbLKG_optionSummary",
|
|
9686
|
-
"field": "rp_AnbLKG_field",
|
|
9687
11402
|
"optionName": "rp_AnbLKG_optionName",
|
|
9688
|
-
"message": "rp_AnbLKG_message",
|
|
9689
|
-
"error": "rp_AnbLKG_error",
|
|
9690
11403
|
"advancedToggle": "rp_AnbLKG_advancedToggle",
|
|
11404
|
+
"error": "rp_AnbLKG_error",
|
|
11405
|
+
"field": "rp_AnbLKG_field",
|
|
9691
11406
|
"label": "rp_AnbLKG_label",
|
|
11407
|
+
"optionSummary": "rp_AnbLKG_optionSummary",
|
|
11408
|
+
"optionText": "rp_AnbLKG_optionText",
|
|
11409
|
+
"message": "rp_AnbLKG_message",
|
|
11410
|
+
"option": "rp_AnbLKG_option",
|
|
11411
|
+
"advanced": "rp_AnbLKG_advanced",
|
|
9692
11412
|
"form": "rp_AnbLKG_form",
|
|
9693
|
-
"
|
|
11413
|
+
"advancedBody": "rp_AnbLKG_advancedBody"
|
|
9694
11414
|
};
|
|
9695
11415
|
//#endregion
|
|
9696
11416
|
//#region src/client/pages/worlds/AddAvatarsDialog.tsx
|
|
@@ -10552,25 +12272,25 @@ window.__ModuleLoader__.load({
|
|
|
10552
12272
|
}
|
|
10553
12273
|
//#endregion
|
|
10554
12274
|
//#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
|
|
10555
|
-
const css$
|
|
10556
|
-
const key$
|
|
10557
|
-
let tag$
|
|
10558
|
-
if (tag$
|
|
10559
|
-
tag$
|
|
10560
|
-
tag$
|
|
10561
|
-
tag$
|
|
10562
|
-
document.head.appendChild(tag$
|
|
12275
|
+
const css$10 = ".rp_Rhi3yq_row{flex-direction:column;gap:6px;display:flex}.rp_Rhi3yq_field{flex-direction:column;gap:6px;width:min(100%,320px);display:flex}.rp_Rhi3yq_label{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_Rhi3yq_help{max-width:560px;color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_Rhi3yq_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_Rhi3yq_group{border-top:.5px solid var(--dsw-alias-border-l3);flex-direction:column;gap:12px;padding-top:12px;display:flex}.rp_Rhi3yq_groupTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:500}.rp_Rhi3yq_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;max-width:560px;min-height:96px;color:inherit;font:inherit;resize:vertical;padding:6px 8px;font-size:13px}.rp_Rhi3yq_area:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}";
|
|
12276
|
+
const key$10 = "src/client/settings-form/SettingsFields.module.css";
|
|
12277
|
+
let tag$10 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$10) + "]");
|
|
12278
|
+
if (tag$10 === null) {
|
|
12279
|
+
tag$10 = document.createElement("style");
|
|
12280
|
+
tag$10.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
12281
|
+
tag$10.dataset.pluginCss = key$10;
|
|
12282
|
+
document.head.appendChild(tag$10);
|
|
10563
12283
|
}
|
|
10564
|
-
tag$
|
|
12284
|
+
tag$10.textContent = css$10;
|
|
10565
12285
|
var SettingsFields_module_css_default = {
|
|
12286
|
+
"group": "rp_Rhi3yq_group",
|
|
10566
12287
|
"row": "rp_Rhi3yq_row",
|
|
10567
12288
|
"field": "rp_Rhi3yq_field",
|
|
10568
|
-
"groupTitle": "rp_Rhi3yq_groupTitle",
|
|
10569
|
-
"group": "rp_Rhi3yq_group",
|
|
10570
12289
|
"error": "rp_Rhi3yq_error",
|
|
12290
|
+
"groupTitle": "rp_Rhi3yq_groupTitle",
|
|
10571
12291
|
"label": "rp_Rhi3yq_label",
|
|
10572
|
-
"
|
|
10573
|
-
"
|
|
12292
|
+
"help": "rp_Rhi3yq_help",
|
|
12293
|
+
"area": "rp_Rhi3yq_area"
|
|
10574
12294
|
};
|
|
10575
12295
|
//#endregion
|
|
10576
12296
|
//#region src/client/settings-form/SettingsFields.tsx
|
|
@@ -10826,20 +12546,20 @@ window.__ModuleLoader__.load({
|
|
|
10826
12546
|
const storyLanguageOf = (code) => code.trim().toLowerCase().startsWith("zh") ? "zh" : "en";
|
|
10827
12547
|
//#endregion
|
|
10828
12548
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/TranslateBanner.module.css.mjs
|
|
10829
|
-
const css$
|
|
10830
|
-
const key$
|
|
10831
|
-
let tag$
|
|
10832
|
-
if (tag$
|
|
10833
|
-
tag$
|
|
10834
|
-
tag$
|
|
10835
|
-
tag$
|
|
10836
|
-
document.head.appendChild(tag$
|
|
12549
|
+
const css$9 = ".rp_Lx8vJa_banner{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);align-items:center;gap:12px;margin:0 0 8px;padding:8px 12px;font-size:12px;line-height:18px;display:flex}.rp_Lx8vJa_text{flex:auto}.rp_Lx8vJa_error{color:var(--dsw-alias-state-error-primary);margin:0 0 8px;font-size:12px}";
|
|
12550
|
+
const key$9 = "src/client/pages/worlds/TranslateBanner.module.css";
|
|
12551
|
+
let tag$9 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$9) + "]");
|
|
12552
|
+
if (tag$9 === null) {
|
|
12553
|
+
tag$9 = document.createElement("style");
|
|
12554
|
+
tag$9.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
12555
|
+
tag$9.dataset.pluginCss = key$9;
|
|
12556
|
+
document.head.appendChild(tag$9);
|
|
10837
12557
|
}
|
|
10838
|
-
tag$
|
|
12558
|
+
tag$9.textContent = css$9;
|
|
10839
12559
|
var TranslateBanner_module_css_default = {
|
|
10840
|
-
"text": "rp_Lx8vJa_text",
|
|
10841
12560
|
"banner": "rp_Lx8vJa_banner",
|
|
10842
|
-
"error": "rp_Lx8vJa_error"
|
|
12561
|
+
"error": "rp_Lx8vJa_error",
|
|
12562
|
+
"text": "rp_Lx8vJa_text"
|
|
10843
12563
|
};
|
|
10844
12564
|
//#endregion
|
|
10845
12565
|
//#region src/client/pages/worlds/TranslateBanner.tsx
|
|
@@ -11303,35 +13023,35 @@ window.__ModuleLoader__.load({
|
|
|
11303
13023
|
}
|
|
11304
13024
|
//#endregion
|
|
11305
13025
|
//#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
|
|
11306
|
-
const css$
|
|
11307
|
-
const key$
|
|
11308
|
-
let tag$
|
|
11309
|
-
if (tag$
|
|
11310
|
-
tag$
|
|
11311
|
-
tag$
|
|
11312
|
-
tag$
|
|
11313
|
-
document.head.appendChild(tag$
|
|
13026
|
+
const css$8 = ".rp_FHUyRq_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_FHUyRq_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_FHUyRq_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_FHUyRq_toolbarActions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.rp_FHUyRq_spinning{animation:.9s linear infinite rp_FHUyRq_spin}@keyframes rp_FHUyRq_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.rp_FHUyRq_spinning{animation:none}}.rp_FHUyRq_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_FHUyRq_viewport{--rp-card-width:168px;--rp-card-height:288px;--rp-card-gap:16px;flex:1 1 0;min-height:0;padding:4px}.rp_FHUyRq_scrolls{overflow-y:auto}.rp_FHUyRq_fits{overflow:hidden}.rp_FHUyRq_grid{grid-auto-rows:var(--rp-card-height);grid-template-columns:repeat(auto-fill, var(--rp-card-width));gap:var(--rp-card-gap);margin:0;padding:0;list-style:none;display:grid}.rp_FHUyRq_cell{min-width:0;display:flex}.rp_FHUyRq_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_FHUyRq_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex-wrap:wrap;flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_FHUyRq_editTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_FHUyRq_authorButton{margin-left:auto}.rp_FHUyRq_editBody{flex:1 1 0;min-height:0;display:flex}.rp_FHUyRq_starters{flex-direction:column;align-items:center;gap:8px;padding-bottom:24px;display:flex}.rp_FHUyRq_starter{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);text-align:center;max-width:480px;color:var(--dsw-alias-label-secondary);flex-direction:column;align-items:center;gap:6px;padding:12px 16px;font-size:13px;display:flex}@media (width<=640px){.rp_FHUyRq_toolbar{align-items:flex-start}.rp_FHUyRq_count{padding-top:6px}.rp_FHUyRq_toolbarActions{max-width:75%}.rp_FHUyRq_editTitle{text-overflow:ellipsis;white-space:nowrap;flex:calc(100% - 96px);overflow:hidden}.rp_FHUyRq_authorButton{margin-left:0}}";
|
|
13027
|
+
const key$8 = "src/client/pages/worlds/WorldsPage.module.css";
|
|
13028
|
+
let tag$8 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$8) + "]");
|
|
13029
|
+
if (tag$8 === null) {
|
|
13030
|
+
tag$8 = document.createElement("style");
|
|
13031
|
+
tag$8.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
13032
|
+
tag$8.dataset.pluginCss = key$8;
|
|
13033
|
+
document.head.appendChild(tag$8);
|
|
11314
13034
|
}
|
|
11315
|
-
tag$
|
|
13035
|
+
tag$8.textContent = css$8;
|
|
11316
13036
|
var WorldsPage_module_css_default = {
|
|
11317
|
-
"editTitle": "rp_FHUyRq_editTitle",
|
|
11318
|
-
"editHeader": "rp_FHUyRq_editHeader",
|
|
11319
|
-
"grid": "rp_FHUyRq_grid",
|
|
11320
|
-
"message": "rp_FHUyRq_message",
|
|
11321
13037
|
"toolbar": "rp_FHUyRq_toolbar",
|
|
13038
|
+
"viewport": "rp_FHUyRq_viewport",
|
|
13039
|
+
"fits": "rp_FHUyRq_fits",
|
|
13040
|
+
"toolbarActions": "rp_FHUyRq_toolbarActions",
|
|
11322
13041
|
"spin": "rp_FHUyRq_spin",
|
|
11323
13042
|
"notice": "rp_FHUyRq_notice",
|
|
11324
|
-
"
|
|
11325
|
-
"
|
|
11326
|
-
"
|
|
11327
|
-
"editBody": "rp_FHUyRq_editBody",
|
|
11328
|
-
"authorButton": "rp_FHUyRq_authorButton",
|
|
13043
|
+
"count": "rp_FHUyRq_count",
|
|
13044
|
+
"grid": "rp_FHUyRq_grid",
|
|
13045
|
+
"editHeader": "rp_FHUyRq_editHeader",
|
|
11329
13046
|
"starter": "rp_FHUyRq_starter",
|
|
11330
|
-
"
|
|
11331
|
-
"
|
|
11332
|
-
"
|
|
13047
|
+
"message": "rp_FHUyRq_message",
|
|
13048
|
+
"authorButton": "rp_FHUyRq_authorButton",
|
|
13049
|
+
"editTitle": "rp_FHUyRq_editTitle",
|
|
13050
|
+
"editBody": "rp_FHUyRq_editBody",
|
|
13051
|
+
"scrolls": "rp_FHUyRq_scrolls",
|
|
11333
13052
|
"starters": "rp_FHUyRq_starters",
|
|
11334
|
-
"
|
|
13053
|
+
"spinning": "rp_FHUyRq_spinning",
|
|
13054
|
+
"cell": "rp_FHUyRq_cell",
|
|
11335
13055
|
"page": "rp_FHUyRq_page"
|
|
11336
13056
|
};
|
|
11337
13057
|
//#endregion
|
|
@@ -11391,45 +13111,45 @@ window.__ModuleLoader__.load({
|
|
|
11391
13111
|
}
|
|
11392
13112
|
//#endregion
|
|
11393
13113
|
//#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
|
|
11394
|
-
const css$
|
|
11395
|
-
const key$
|
|
11396
|
-
let tag$
|
|
11397
|
-
if (tag$
|
|
11398
|
-
tag$
|
|
11399
|
-
tag$
|
|
11400
|
-
tag$
|
|
11401
|
-
document.head.appendChild(tag$
|
|
11402
|
-
}
|
|
11403
|
-
tag$
|
|
11404
|
-
var ImportCardPage_module_css_default = {
|
|
11405
|
-
"
|
|
11406
|
-
"
|
|
11407
|
-
"
|
|
11408
|
-
"
|
|
11409
|
-
"entry": "rp_DmG_oG_entry",
|
|
11410
|
-
"body": "rp_DmG_oG_body",
|
|
11411
|
-
"entryHead": "rp_DmG_oG_entryHead",
|
|
11412
|
-
"title": "rp_DmG_oG_title",
|
|
11413
|
-
"fieldTitle": "rp_DmG_oG_fieldTitle",
|
|
11414
|
-
"entryTitle": "rp_DmG_oG_entryTitle",
|
|
11415
|
-
"top": "rp_DmG_oG_top",
|
|
11416
|
-
"choice": "rp_DmG_oG_choice",
|
|
11417
|
-
"field": "rp_DmG_oG_field",
|
|
13114
|
+
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:.5px 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:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);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:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg)}.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:.5px 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:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}@media (width<=640px){.rp_DmG_oG_body{padding-inline:16px}.rp_DmG_oG_top{flex-direction:column}.rp_DmG_oG_picture{width:96px;height:128px}.rp_DmG_oG_row{flex-wrap:wrap}}.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}";
|
|
13115
|
+
const key$7 = "src/client/pages/worlds/ImportCardPage.module.css";
|
|
13116
|
+
let tag$7 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$7) + "]");
|
|
13117
|
+
if (tag$7 === null) {
|
|
13118
|
+
tag$7 = document.createElement("style");
|
|
13119
|
+
tag$7.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
13120
|
+
tag$7.dataset.pluginCss = key$7;
|
|
13121
|
+
document.head.appendChild(tag$7);
|
|
13122
|
+
}
|
|
13123
|
+
tag$7.textContent = css$7;
|
|
13124
|
+
var ImportCardPage_module_css_default = {
|
|
13125
|
+
"tags": "rp_DmG_oG_tags",
|
|
13126
|
+
"fieldMeta": "rp_DmG_oG_fieldMeta",
|
|
13127
|
+
"about": "rp_DmG_oG_about",
|
|
13128
|
+
"fieldHead": "rp_DmG_oG_fieldHead",
|
|
11418
13129
|
"row": "rp_DmG_oG_row",
|
|
13130
|
+
"entryHead": "rp_DmG_oG_entryHead",
|
|
13131
|
+
"section": "rp_DmG_oG_section",
|
|
11419
13132
|
"header": "rp_DmG_oG_header",
|
|
11420
|
-
"note": "rp_DmG_oG_note",
|
|
11421
|
-
"fieldHead": "rp_DmG_oG_fieldHead",
|
|
11422
|
-
"choiceText": "rp_DmG_oG_choiceText",
|
|
11423
|
-
"about": "rp_DmG_oG_about",
|
|
11424
13133
|
"label": "rp_DmG_oG_label",
|
|
11425
|
-
"
|
|
11426
|
-
"
|
|
13134
|
+
"field": "rp_DmG_oG_field",
|
|
13135
|
+
"entryTitle": "rp_DmG_oG_entryTitle",
|
|
13136
|
+
"text": "rp_DmG_oG_text",
|
|
13137
|
+
"choiceText": "rp_DmG_oG_choiceText",
|
|
11427
13138
|
"page": "rp_DmG_oG_page",
|
|
11428
|
-
"
|
|
13139
|
+
"space": "rp_DmG_oG_space",
|
|
13140
|
+
"title": "rp_DmG_oG_title",
|
|
11429
13141
|
"preview": "rp_DmG_oG_preview",
|
|
11430
13142
|
"entryOff": "rp_DmG_oG_entryOff",
|
|
11431
|
-
"
|
|
11432
|
-
"
|
|
13143
|
+
"error": "rp_DmG_oG_error",
|
|
13144
|
+
"note": "rp_DmG_oG_note",
|
|
13145
|
+
"heading": "rp_DmG_oG_heading",
|
|
13146
|
+
"top": "rp_DmG_oG_top",
|
|
13147
|
+
"entry": "rp_DmG_oG_entry",
|
|
13148
|
+
"body": "rp_DmG_oG_body",
|
|
13149
|
+
"noPicture": "rp_DmG_oG_noPicture",
|
|
13150
|
+
"picture": "rp_DmG_oG_picture",
|
|
13151
|
+
"fieldTitle": "rp_DmG_oG_fieldTitle",
|
|
13152
|
+
"choice": "rp_DmG_oG_choice"
|
|
11433
13153
|
};
|
|
11434
13154
|
//#endregion
|
|
11435
13155
|
//#region src/client/pages/worlds/ImportCardPage.tsx
|
|
@@ -12687,8 +14407,9 @@ window.__ModuleLoader__.load({
|
|
|
12687
14407
|
return this.face;
|
|
12688
14408
|
}
|
|
12689
14409
|
async load() {
|
|
12690
|
-
|
|
12691
|
-
|
|
14410
|
+
const { status, refreshing } = this.store.getSnapshot();
|
|
14411
|
+
if (status === "loading" || refreshing) return;
|
|
14412
|
+
if (status === "idle") this.store.update((draft) => {
|
|
12692
14413
|
draft.status = "loading";
|
|
12693
14414
|
});
|
|
12694
14415
|
await this.run("/worlds", {});
|
|
@@ -12966,21 +14687,21 @@ window.__ModuleLoader__.load({
|
|
|
12966
14687
|
};
|
|
12967
14688
|
//#endregion
|
|
12968
14689
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/branch/BranchDialog.module.css.mjs
|
|
12969
|
-
const css$
|
|
12970
|
-
const key$
|
|
12971
|
-
let tag$
|
|
12972
|
-
if (tag$
|
|
12973
|
-
tag$
|
|
12974
|
-
tag$
|
|
12975
|
-
tag$
|
|
12976
|
-
document.head.appendChild(tag$
|
|
14690
|
+
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}";
|
|
14691
|
+
const key$6 = "src/client/branch/BranchDialog.module.css";
|
|
14692
|
+
let tag$6 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$6) + "]");
|
|
14693
|
+
if (tag$6 === null) {
|
|
14694
|
+
tag$6 = document.createElement("style");
|
|
14695
|
+
tag$6.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
14696
|
+
tag$6.dataset.pluginCss = key$6;
|
|
14697
|
+
document.head.appendChild(tag$6);
|
|
12977
14698
|
}
|
|
12978
|
-
tag$
|
|
14699
|
+
tag$6.textContent = css$6;
|
|
12979
14700
|
var BranchDialog_module_css_default = {
|
|
12980
|
-
"error": "rp_Dy1TaW_error",
|
|
12981
|
-
"field": "rp_Dy1TaW_field",
|
|
12982
14701
|
"label": "rp_Dy1TaW_label",
|
|
12983
|
-
"form": "rp_Dy1TaW_form"
|
|
14702
|
+
"form": "rp_Dy1TaW_form",
|
|
14703
|
+
"field": "rp_Dy1TaW_field",
|
|
14704
|
+
"error": "rp_Dy1TaW_error"
|
|
12984
14705
|
};
|
|
12985
14706
|
//#endregion
|
|
12986
14707
|
//#region src/client/branch/BranchDialog.tsx
|
|
@@ -13438,28 +15159,28 @@ window.__ModuleLoader__.load({
|
|
|
13438
15159
|
}
|
|
13439
15160
|
//#endregion
|
|
13440
15161
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/interface/SidebarPage.module.css.mjs
|
|
13441
|
-
const css$
|
|
13442
|
-
const key$
|
|
13443
|
-
let tag$
|
|
13444
|
-
if (tag$
|
|
13445
|
-
tag$
|
|
13446
|
-
tag$
|
|
13447
|
-
tag$
|
|
13448
|
-
document.head.appendChild(tag$
|
|
15162
|
+
const css$5 = ".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}";
|
|
15163
|
+
const key$5 = "src/client/interface/SidebarPage.module.css";
|
|
15164
|
+
let tag$5 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$5) + "]");
|
|
15165
|
+
if (tag$5 === null) {
|
|
15166
|
+
tag$5 = document.createElement("style");
|
|
15167
|
+
tag$5.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
15168
|
+
tag$5.dataset.pluginCss = key$5;
|
|
15169
|
+
document.head.appendChild(tag$5);
|
|
13449
15170
|
}
|
|
13450
|
-
tag$
|
|
15171
|
+
tag$5.textContent = css$5;
|
|
13451
15172
|
var SidebarPage_module_css_default = {
|
|
13452
|
-
"icon": "rp_Ptco8a_icon",
|
|
13453
|
-
"content": "rp_Ptco8a_content",
|
|
13454
|
-
"text": "rp_Ptco8a_text",
|
|
13455
15173
|
"title": "rp_Ptco8a_title",
|
|
13456
|
-
"
|
|
15174
|
+
"page": "rp_Ptco8a_page",
|
|
13457
15175
|
"bar": "rp_Ptco8a_bar",
|
|
15176
|
+
"content": "rp_Ptco8a_content",
|
|
13458
15177
|
"main": "rp_Ptco8a_main",
|
|
13459
|
-
"entry": "rp_Ptco8a_entry",
|
|
13460
15178
|
"message": "rp_Ptco8a_message",
|
|
13461
|
-
"
|
|
13462
|
-
"
|
|
15179
|
+
"name": "rp_Ptco8a_name",
|
|
15180
|
+
"text": "rp_Ptco8a_text",
|
|
15181
|
+
"description": "rp_Ptco8a_description",
|
|
15182
|
+
"entry": "rp_Ptco8a_entry",
|
|
15183
|
+
"icon": "rp_Ptco8a_icon"
|
|
13463
15184
|
};
|
|
13464
15185
|
//#endregion
|
|
13465
15186
|
//#region src/client/interface/SidebarPage.tsx
|
|
@@ -13721,7 +15442,9 @@ window.__ModuleLoader__.load({
|
|
|
13721
15442
|
saveNarrationVoice: async (voice, signal) => await put(`${API_PREFIX}/sessions/world/narration-voice?id=${id}`, { voice }, signal),
|
|
13722
15443
|
listVoices: async (signal) => await listVoices(`${API_PREFIX}/speech/voices`, signal),
|
|
13723
15444
|
generatePortrait: async (key, signal) => await post(`${API_PREFIX}/sessions/world/character/portrait?id=${id}&key=${encodeURIComponent(key)}`, signal),
|
|
13724
|
-
uploadPortrait: async (key, file, signal) => await postFile(`${API_PREFIX}/sessions/world/character/portrait/upload?id=${id}&key=${encodeURIComponent(key)}`, file, signal)
|
|
15445
|
+
uploadPortrait: async (key, file, signal) => await postFile(`${API_PREFIX}/sessions/world/character/portrait/upload?id=${id}&key=${encodeURIComponent(key)}`, file, signal),
|
|
15446
|
+
generateImage: async (kind, key, signal) => await post(`${API_PREFIX}/sessions/world/${kind}/image?id=${id}&key=${encodeURIComponent(key)}`, signal),
|
|
15447
|
+
uploadImage: async (kind, key, file, signal) => await postFile(`${API_PREFIX}/sessions/world/${kind}/image/upload?id=${id}&key=${encodeURIComponent(key)}`, file, signal)
|
|
13725
15448
|
};
|
|
13726
15449
|
}
|
|
13727
15450
|
//#endregion
|
|
@@ -13774,37 +15497,37 @@ window.__ModuleLoader__.load({
|
|
|
13774
15497
|
}
|
|
13775
15498
|
//#endregion
|
|
13776
15499
|
//#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
|
|
13777
|
-
const css$
|
|
13778
|
-
const key$
|
|
13779
|
-
let tag$
|
|
13780
|
-
if (tag$
|
|
13781
|
-
tag$
|
|
13782
|
-
tag$
|
|
13783
|
-
tag$
|
|
13784
|
-
document.head.appendChild(tag$
|
|
15500
|
+
const css$4 = ".rp_wLpbxW_view{box-sizing:border-box;flex-direction:column;gap:16px;width:100%;max-width:720px;margin:0 auto;padding:24px 24px 240px;display:flex}.rp_wLpbxW_title{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_wLpbxW_description{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_wLpbxW_field{flex-direction:column;gap:6px;width:min(100%,320px);display:flex}.rp_wLpbxW_label{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_wLpbxW_help{max-width:560px;color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_wLpbxW_actions{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.rp_wLpbxW_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:40px 0;font-size:13px}.rp_wLpbxW_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_wLpbxW_saved{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_wLpbxW_row{flex-direction:column;gap:6px;display:flex}.rp_wLpbxW_notice{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);margin:0;padding:8px 12px;font-size:12px}.rp_wLpbxW_activity{color:var(--dsw-alias-label-secondary);flex-direction:column;gap:6px;font-size:13px;display:flex}.rp_wLpbxW_activity summary{cursor:pointer;color:var(--dsw-alias-label-primary);font-weight:500}.rp_wLpbxW_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:.5px 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:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-markdown-code-block);white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;margin:4px 0;padding:6px 8px;font-size:12px;overflow:auto}.rp_wLpbxW_reasons{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;margin:4px 0;padding-left:20px;font-size:12px}.rp_wLpbxW_select{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;max-width:320px;height:32px;color:var(--dsw-alias-label-primary);font:inherit;padding:0 8px;font-size:13px}.rp_wLpbxW_list{color:var(--dsw-alias-label-tertiary);margin:0;padding-left:18px;font-size:12px;line-height:18px}@media (width<=640px){.rp_wLpbxW_view{padding-inline:16px}.rp_wLpbxW_table{display:block;overflow-x:auto}}";
|
|
15501
|
+
const key$4 = "src/client/chat-settings/ChatSettingsView.module.css";
|
|
15502
|
+
let tag$4 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$4) + "]");
|
|
15503
|
+
if (tag$4 === null) {
|
|
15504
|
+
tag$4 = document.createElement("style");
|
|
15505
|
+
tag$4.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
15506
|
+
tag$4.dataset.pluginCss = key$4;
|
|
15507
|
+
document.head.appendChild(tag$4);
|
|
13785
15508
|
}
|
|
13786
|
-
tag$
|
|
15509
|
+
tag$4.textContent = css$4;
|
|
13787
15510
|
var ChatSettingsView_module_css_default = {
|
|
13788
|
-
"
|
|
13789
|
-
"table": "rp_wLpbxW_table",
|
|
15511
|
+
"activity": "rp_wLpbxW_activity",
|
|
13790
15512
|
"error": "rp_wLpbxW_error",
|
|
13791
|
-
"
|
|
15513
|
+
"pre": "rp_wLpbxW_pre",
|
|
13792
15514
|
"title": "rp_wLpbxW_title",
|
|
13793
|
-
"
|
|
13794
|
-
"
|
|
13795
|
-
"link": "rp_wLpbxW_link",
|
|
13796
|
-
"description": "rp_wLpbxW_description",
|
|
13797
|
-
"view": "rp_wLpbxW_view",
|
|
15515
|
+
"help": "rp_wLpbxW_help",
|
|
15516
|
+
"label": "rp_wLpbxW_label",
|
|
13798
15517
|
"reasons": "rp_wLpbxW_reasons",
|
|
15518
|
+
"select": "rp_wLpbxW_select",
|
|
15519
|
+
"description": "rp_wLpbxW_description",
|
|
15520
|
+
"saved": "rp_wLpbxW_saved",
|
|
13799
15521
|
"list": "rp_wLpbxW_list",
|
|
15522
|
+
"view": "rp_wLpbxW_view",
|
|
15523
|
+
"field": "rp_wLpbxW_field",
|
|
15524
|
+
"row": "rp_wLpbxW_row",
|
|
15525
|
+
"link": "rp_wLpbxW_link",
|
|
15526
|
+
"message": "rp_wLpbxW_message",
|
|
13800
15527
|
"notice": "rp_wLpbxW_notice",
|
|
13801
|
-
"
|
|
13802
|
-
"label": "rp_wLpbxW_label",
|
|
15528
|
+
"run": "rp_wLpbxW_run",
|
|
13803
15529
|
"actions": "rp_wLpbxW_actions",
|
|
13804
|
-
"
|
|
13805
|
-
"activity": "rp_wLpbxW_activity",
|
|
13806
|
-
"select": "rp_wLpbxW_select",
|
|
13807
|
-
"message": "rp_wLpbxW_message"
|
|
15530
|
+
"table": "rp_wLpbxW_table"
|
|
13808
15531
|
};
|
|
13809
15532
|
//#endregion
|
|
13810
15533
|
//#region src/client/chat-settings/settings-api.ts
|
|
@@ -14168,8 +15891,53 @@ window.__ModuleLoader__.load({
|
|
|
14168
15891
|
});
|
|
14169
15892
|
}
|
|
14170
15893
|
//#endregion
|
|
15894
|
+
//#region src/shared/usage.ts
|
|
15895
|
+
const addTokens = (a, b) => ({
|
|
15896
|
+
input: a.input + b.input,
|
|
15897
|
+
cached: a.cached + b.cached,
|
|
15898
|
+
output: a.output + b.output
|
|
15899
|
+
});
|
|
15900
|
+
const totalTokens = (count) => count.input + count.cached + count.output;
|
|
15901
|
+
//#endregion
|
|
14171
15902
|
//#region src/client/chat-settings/ActivityList.tsx
|
|
14172
15903
|
const seconds = (ms) => `${(ms / 1e3).toFixed(ms < 1e4 ? 1 : 0)} s`;
|
|
15904
|
+
const count = (value) => value.toLocaleString();
|
|
15905
|
+
/** Fresh input plus output, and what came from the service's cache beside it when there was any. */
|
|
15906
|
+
const tokenText = (t, tokens) => `${count(tokens.input + tokens.output)}${tokens.cached > 0 ? ` (${t("usageCached", { count: count(tokens.cached) })})` : ""}`;
|
|
15907
|
+
/** What each turn used, newest first: the game master, its helpers, and the sum. */
|
|
15908
|
+
function UsageTable({ t, usage }) {
|
|
15909
|
+
const shown = usage.slice(-20).reverse();
|
|
15910
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
15911
|
+
className: ChatSettingsView_module_css_default.activity,
|
|
15912
|
+
"data-testid": "roleplay-usage",
|
|
15913
|
+
children: [
|
|
15914
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("usageTitle") }),
|
|
15915
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
15916
|
+
className: ChatSettingsView_module_css_default.description,
|
|
15917
|
+
children: t("usageHelp")
|
|
15918
|
+
}),
|
|
15919
|
+
shown.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
15920
|
+
className: ChatSettingsView_module_css_default.description,
|
|
15921
|
+
children: t("usageEmpty")
|
|
15922
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
|
|
15923
|
+
className: ChatSettingsView_module_css_default.table,
|
|
15924
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
15925
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("usageTurn") }),
|
|
15926
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("usageMaster") }),
|
|
15927
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("usageHelpers") }),
|
|
15928
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("usageRuns") }),
|
|
15929
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("usageTotal") })
|
|
15930
|
+
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: shown.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
15931
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.turn }),
|
|
15932
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: tokenText(t, entry.master) }),
|
|
15933
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: tokenText(t, entry.helpers) }),
|
|
15934
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.runs }),
|
|
15935
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: count(totalTokens(addTokens(entry.master, entry.helpers))) })
|
|
15936
|
+
] }, entry.turn)) })]
|
|
15937
|
+
})
|
|
15938
|
+
]
|
|
15939
|
+
});
|
|
15940
|
+
}
|
|
14173
15941
|
/** 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. */
|
|
14174
15942
|
function ActivityList({ t, session, entries, onRefresh }) {
|
|
14175
15943
|
const shown = entries.slice(-20).reverse();
|
|
@@ -14221,6 +15989,7 @@ window.__ModuleLoader__.load({
|
|
|
14221
15989
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityModel") }),
|
|
14222
15990
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityTook") }),
|
|
14223
15991
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityCalls") }),
|
|
15992
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityTokens") }),
|
|
14224
15993
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityResult") }),
|
|
14225
15994
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {})
|
|
14226
15995
|
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: shown.flatMap((entry) => [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
@@ -14229,6 +15998,7 @@ window.__ModuleLoader__.load({
|
|
|
14229
15998
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.model === "" ? t("activityOwnModel") : entry.model }),
|
|
14230
15999
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: seconds(entry.ms) }),
|
|
14231
16000
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.calls }),
|
|
16001
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.tokens === void 0 ? "" : tokenText(t, entry.tokens) }),
|
|
14232
16002
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
14233
16003
|
className: entry.error === void 0 ? void 0 : ChatSettingsView_module_css_default.error,
|
|
14234
16004
|
title: entry.error,
|
|
@@ -14243,7 +16013,7 @@ window.__ModuleLoader__.load({
|
|
|
14243
16013
|
children: open?.run === entry.run ? t("runHide") : t("runShow")
|
|
14244
16014
|
}) })
|
|
14245
16015
|
] }, `${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", {
|
|
14246
|
-
colSpan:
|
|
16016
|
+
colSpan: 8,
|
|
14247
16017
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RunView, {
|
|
14248
16018
|
t,
|
|
14249
16019
|
detail: open.detail
|
|
@@ -14461,6 +16231,7 @@ window.__ModuleLoader__.load({
|
|
|
14461
16231
|
payload: {
|
|
14462
16232
|
...payload,
|
|
14463
16233
|
activity: next.activity,
|
|
16234
|
+
usage: next.usage,
|
|
14464
16235
|
interventions: next.interventions,
|
|
14465
16236
|
vectors: next.vectors,
|
|
14466
16237
|
reflection: next.reflection,
|
|
@@ -14602,6 +16373,10 @@ window.__ModuleLoader__.load({
|
|
|
14602
16373
|
t,
|
|
14603
16374
|
entries: payload.interventions
|
|
14604
16375
|
}),
|
|
16376
|
+
session !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UsageTable, {
|
|
16377
|
+
t,
|
|
16378
|
+
usage: payload.usage
|
|
16379
|
+
}),
|
|
14605
16380
|
session !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActivityList, {
|
|
14606
16381
|
t,
|
|
14607
16382
|
session,
|
|
@@ -14661,6 +16436,16 @@ window.__ModuleLoader__.load({
|
|
|
14661
16436
|
activityModel: "Model",
|
|
14662
16437
|
activityTook: "Took",
|
|
14663
16438
|
activityCalls: "Calls",
|
|
16439
|
+
activityTokens: "Tokens",
|
|
16440
|
+
usageTitle: "Tokens per turn",
|
|
16441
|
+
usageHelp: "What each turn used, as the model service reported it: the game master, and the helpers that worked for the turn (characters, record keeper, suggestions and the rest, including work done after the turn was delivered). Requests the service reported nothing for are not counted. \"Cached\" is what the service read from its cache, which usually costs less.",
|
|
16442
|
+
usageTurn: "Turn",
|
|
16443
|
+
usageMaster: "Game master",
|
|
16444
|
+
usageHelpers: "Helpers",
|
|
16445
|
+
usageRuns: "Helper runs",
|
|
16446
|
+
usageTotal: "Total",
|
|
16447
|
+
usageCached: "{count} cached",
|
|
16448
|
+
usageEmpty: "No turn has been counted yet.",
|
|
14664
16449
|
activityResult: "Result",
|
|
14665
16450
|
activityOwnModel: "chat model",
|
|
14666
16451
|
activityDone: "done",
|
|
@@ -14769,6 +16554,16 @@ window.__ModuleLoader__.load({
|
|
|
14769
16554
|
activityModel: "模型",
|
|
14770
16555
|
activityTook: "耗时",
|
|
14771
16556
|
activityCalls: "调用",
|
|
16557
|
+
activityTokens: "令牌",
|
|
16558
|
+
usageTitle: "每回合令牌用量",
|
|
16559
|
+
usageHelp: "每个回合用了多少,以模型服务报告的数字为准:游戏主持人,以及为这个回合工作的助手(角色、记录员、建议等,包括回合送出之后完成的工作)。服务没有报告用量的请求不计入。“缓存”是服务从缓存中读取的部分,通常花费更少。",
|
|
16560
|
+
usageTurn: "回合",
|
|
16561
|
+
usageMaster: "游戏主持人",
|
|
16562
|
+
usageHelpers: "助手",
|
|
16563
|
+
usageRuns: "助手运行次数",
|
|
16564
|
+
usageTotal: "合计",
|
|
16565
|
+
usageCached: "缓存 {count}",
|
|
16566
|
+
usageEmpty: "还没有统计过任何回合。",
|
|
14772
16567
|
activityResult: "结果",
|
|
14773
16568
|
activityOwnModel: "对话模型",
|
|
14774
16569
|
activityDone: "完成",
|
|
@@ -14877,6 +16672,200 @@ window.__ModuleLoader__.load({
|
|
|
14877
16672
|
});
|
|
14878
16673
|
}
|
|
14879
16674
|
//#endregion
|
|
16675
|
+
//#region src/client/settings/catalogues.ts
|
|
16676
|
+
const rowOf = (value) => {
|
|
16677
|
+
const row = typeof value === "object" && value !== null ? value : {};
|
|
16678
|
+
return {
|
|
16679
|
+
name: typeof row["name"] === "string" ? row["name"] : "",
|
|
16680
|
+
baseUrl: typeof row["baseUrl"] === "string" ? row["baseUrl"] : "",
|
|
16681
|
+
apiKey: typeof row["apiKey"] === "string" ? row["apiKey"] : ""
|
|
16682
|
+
};
|
|
16683
|
+
};
|
|
16684
|
+
/** The rows a draft text holds; the draft is only ever written by this form. */
|
|
16685
|
+
function rowsOf(text) {
|
|
16686
|
+
try {
|
|
16687
|
+
const parsed = JSON.parse(text === "" ? "[]" : text);
|
|
16688
|
+
return Array.isArray(parsed) ? parsed.map(rowOf) : [];
|
|
16689
|
+
} catch {
|
|
16690
|
+
return [];
|
|
16691
|
+
}
|
|
16692
|
+
}
|
|
16693
|
+
function isWebAddress(text) {
|
|
16694
|
+
try {
|
|
16695
|
+
const url = new URL(text.trim());
|
|
16696
|
+
return (url.protocol === "http:" || url.protocol === "https:") && url.username === "" && url.password === "" && url.search === "" && url.hash === "";
|
|
16697
|
+
} catch {
|
|
16698
|
+
return false;
|
|
16699
|
+
}
|
|
16700
|
+
}
|
|
16701
|
+
/** What stops a row from being saved, if anything. */
|
|
16702
|
+
function rowProblem(rows, index) {
|
|
16703
|
+
const row = rows[index];
|
|
16704
|
+
const name = row.name.trim();
|
|
16705
|
+
if (name === "") return "name";
|
|
16706
|
+
if (rows.findIndex((other) => other.name.trim() === name) !== index) return "duplicate";
|
|
16707
|
+
return isWebAddress(row.baseUrl) ? void 0 : "address";
|
|
16708
|
+
}
|
|
16709
|
+
/** The `catalogues` list of the plugin's configuration as a draft: its rows as JSON text; a list with a problem blocks the save. */
|
|
16710
|
+
const cataloguesField = {
|
|
16711
|
+
field: "catalogues",
|
|
16712
|
+
format: (value) => JSON.stringify(Array.isArray(value) ? value.map(rowOf) : []),
|
|
16713
|
+
parse: (text) => {
|
|
16714
|
+
const rows = rowsOf(text);
|
|
16715
|
+
if (rows.some((_, index) => rowProblem(rows, index) !== void 0)) return void 0;
|
|
16716
|
+
return rows.length === 0 ? { kind: "clear" } : {
|
|
16717
|
+
kind: "set",
|
|
16718
|
+
value: rows.map((row) => ({
|
|
16719
|
+
name: row.name.trim(),
|
|
16720
|
+
baseUrl: row.baseUrl.trim(),
|
|
16721
|
+
apiKey: row.apiKey.trim()
|
|
16722
|
+
}))
|
|
16723
|
+
};
|
|
16724
|
+
}
|
|
16725
|
+
};
|
|
16726
|
+
//#endregion
|
|
16727
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/settings/CatalogueSettings.module.css.mjs
|
|
16728
|
+
const css$3 = ".rp_KPhXDa_section{flex-direction:column;gap:8px;margin-top:24px;display:flex}.rp_KPhXDa_title{margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_KPhXDa_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_KPhXDa_row{border-bottom:1px solid var(--dsw-alias-border-l3);grid-template-columns:minmax(80px,1fr) minmax(160px,2fr) minmax(120px,1.5fr) auto;align-items:end;gap:8px;padding-bottom:8px;display:grid}.rp_KPhXDa_field{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_KPhXDa_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_KPhXDa_problem{color:var(--dsw-alias-state-danger-primary,#c0392b);grid-column:1/-1;margin:0;font-size:12px}.rp_KPhXDa_keyHint{color:var(--dsw-alias-label-tertiary);grid-column:1/-1;margin:0;font-size:12px}.rp_KPhXDa_actions{gap:8px;display:flex}";
|
|
16729
|
+
const key$3 = "src/client/settings/CatalogueSettings.module.css";
|
|
16730
|
+
let tag$3 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$3) + "]");
|
|
16731
|
+
if (tag$3 === null) {
|
|
16732
|
+
tag$3 = document.createElement("style");
|
|
16733
|
+
tag$3.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
16734
|
+
tag$3.dataset.pluginCss = key$3;
|
|
16735
|
+
document.head.appendChild(tag$3);
|
|
16736
|
+
}
|
|
16737
|
+
tag$3.textContent = css$3;
|
|
16738
|
+
var CatalogueSettings_module_css_default = {
|
|
16739
|
+
"label": "rp_KPhXDa_label",
|
|
16740
|
+
"field": "rp_KPhXDa_field",
|
|
16741
|
+
"problem": "rp_KPhXDa_problem",
|
|
16742
|
+
"keyHint": "rp_KPhXDa_keyHint",
|
|
16743
|
+
"row": "rp_KPhXDa_row",
|
|
16744
|
+
"title": "rp_KPhXDa_title",
|
|
16745
|
+
"section": "rp_KPhXDa_section",
|
|
16746
|
+
"hint": "rp_KPhXDa_hint",
|
|
16747
|
+
"actions": "rp_KPhXDa_actions"
|
|
16748
|
+
};
|
|
16749
|
+
//#endregion
|
|
16750
|
+
//#region src/client/settings/CatalogueSettings.tsx
|
|
16751
|
+
const PROBLEM_TEXT = {
|
|
16752
|
+
name: "catalogueProblemName",
|
|
16753
|
+
address: "catalogueProblemAddress",
|
|
16754
|
+
duplicate: "catalogueProblemDuplicate"
|
|
16755
|
+
};
|
|
16756
|
+
/** The catalogues worlds can be installed from: a name, the API address and, optionally, a key for the private worlds. */
|
|
16757
|
+
function CatalogueSettings({ t, text, disabled, onEdit }) {
|
|
16758
|
+
const rows = rowsOf(text);
|
|
16759
|
+
const change = (next) => {
|
|
16760
|
+
onEdit(JSON.stringify(next));
|
|
16761
|
+
};
|
|
16762
|
+
const set = (index, patch) => {
|
|
16763
|
+
change(rows.map((row, at) => at === index ? {
|
|
16764
|
+
...row,
|
|
16765
|
+
...patch
|
|
16766
|
+
} : row));
|
|
16767
|
+
};
|
|
16768
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
16769
|
+
className: CatalogueSettings_module_css_default.section,
|
|
16770
|
+
"data-testid": "roleplay-catalogue-settings",
|
|
16771
|
+
children: [
|
|
16772
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
16773
|
+
className: CatalogueSettings_module_css_default.title,
|
|
16774
|
+
children: t("catalogues")
|
|
16775
|
+
}),
|
|
16776
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
16777
|
+
className: CatalogueSettings_module_css_default.hint,
|
|
16778
|
+
children: t("cataloguesHint")
|
|
16779
|
+
}),
|
|
16780
|
+
rows.map((row, index) => {
|
|
16781
|
+
const problem = rowProblem(rows, index);
|
|
16782
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
16783
|
+
className: CatalogueSettings_module_css_default.row,
|
|
16784
|
+
"data-testid": "roleplay-catalogue-row",
|
|
16785
|
+
children: [
|
|
16786
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
16787
|
+
className: CatalogueSettings_module_css_default.field,
|
|
16788
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
16789
|
+
className: CatalogueSettings_module_css_default.label,
|
|
16790
|
+
children: t("catalogueName")
|
|
16791
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
16792
|
+
value: row.name,
|
|
16793
|
+
disabled,
|
|
16794
|
+
onChange: (event) => {
|
|
16795
|
+
set(index, { name: event.target.value });
|
|
16796
|
+
}
|
|
16797
|
+
})]
|
|
16798
|
+
}),
|
|
16799
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
16800
|
+
className: CatalogueSettings_module_css_default.field,
|
|
16801
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
16802
|
+
className: CatalogueSettings_module_css_default.label,
|
|
16803
|
+
children: t("catalogueAddress")
|
|
16804
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
16805
|
+
value: row.baseUrl,
|
|
16806
|
+
disabled,
|
|
16807
|
+
placeholder: "https://catalogue.example/api",
|
|
16808
|
+
onChange: (event) => {
|
|
16809
|
+
set(index, { baseUrl: event.target.value });
|
|
16810
|
+
}
|
|
16811
|
+
})]
|
|
16812
|
+
}),
|
|
16813
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
16814
|
+
className: CatalogueSettings_module_css_default.field,
|
|
16815
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
16816
|
+
className: CatalogueSettings_module_css_default.label,
|
|
16817
|
+
children: t("catalogueKey")
|
|
16818
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
16819
|
+
type: "password",
|
|
16820
|
+
autoComplete: "off",
|
|
16821
|
+
value: row.apiKey,
|
|
16822
|
+
disabled,
|
|
16823
|
+
onChange: (event) => {
|
|
16824
|
+
set(index, { apiKey: event.target.value });
|
|
16825
|
+
}
|
|
16826
|
+
})]
|
|
16827
|
+
}),
|
|
16828
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
16829
|
+
variant: "ghost",
|
|
16830
|
+
size: "sm",
|
|
16831
|
+
disabled,
|
|
16832
|
+
onClick: () => {
|
|
16833
|
+
change(rows.filter((_, at) => at !== index));
|
|
16834
|
+
},
|
|
16835
|
+
children: t("catalogueRemove")
|
|
16836
|
+
}),
|
|
16837
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
16838
|
+
className: CatalogueSettings_module_css_default.keyHint,
|
|
16839
|
+
children: t("catalogueKeyHint")
|
|
16840
|
+
}),
|
|
16841
|
+
problem !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
16842
|
+
className: CatalogueSettings_module_css_default.problem,
|
|
16843
|
+
role: "alert",
|
|
16844
|
+
children: t(PROBLEM_TEXT[problem])
|
|
16845
|
+
})
|
|
16846
|
+
]
|
|
16847
|
+
}, index);
|
|
16848
|
+
}),
|
|
16849
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
16850
|
+
className: CatalogueSettings_module_css_default.actions,
|
|
16851
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
16852
|
+
variant: "outline",
|
|
16853
|
+
size: "sm",
|
|
16854
|
+
disabled,
|
|
16855
|
+
onClick: () => {
|
|
16856
|
+
change([...rows, {
|
|
16857
|
+
name: "",
|
|
16858
|
+
baseUrl: "",
|
|
16859
|
+
apiKey: ""
|
|
16860
|
+
}]);
|
|
16861
|
+
},
|
|
16862
|
+
children: t("catalogueAdd")
|
|
16863
|
+
})
|
|
16864
|
+
})
|
|
16865
|
+
]
|
|
16866
|
+
});
|
|
16867
|
+
}
|
|
16868
|
+
//#endregion
|
|
14880
16869
|
//#region src/client/settings/locales.ts
|
|
14881
16870
|
const dictionaries$1 = {
|
|
14882
16871
|
en: {
|
|
@@ -14886,6 +16875,17 @@ window.__ModuleLoader__.load({
|
|
|
14886
16875
|
rootPath: "Data folder",
|
|
14887
16876
|
rootPathHint: "Characters, sessions and their media live here. Use an absolute path or one starting with ~.",
|
|
14888
16877
|
rootPathPlaceholder: "~/dsh-roleplay",
|
|
16878
|
+
catalogues: "Catalogues",
|
|
16879
|
+
cataloguesHint: "Catalogues to browse and install worlds from. Add a catalogue's API address, and an API key to see its private worlds.",
|
|
16880
|
+
catalogueName: "Name",
|
|
16881
|
+
catalogueAddress: "API address",
|
|
16882
|
+
catalogueKey: "API key",
|
|
16883
|
+
catalogueKeyHint: "Optional. Saved as text in this profile's configuration and sent only to this catalogue's site.",
|
|
16884
|
+
catalogueRemove: "Remove",
|
|
16885
|
+
catalogueAdd: "Add a catalogue",
|
|
16886
|
+
catalogueProblemName: "Give the catalogue a name.",
|
|
16887
|
+
catalogueProblemAddress: "Enter a web address like https://catalogue.example/api.",
|
|
16888
|
+
catalogueProblemDuplicate: "Another catalogue has this name.",
|
|
14889
16889
|
overridden: "Overridden",
|
|
14890
16890
|
reset: "Reset to default",
|
|
14891
16891
|
invalid: "Enter a folder path.",
|
|
@@ -14902,6 +16902,17 @@ window.__ModuleLoader__.load({
|
|
|
14902
16902
|
rootPath: "数据文件夹",
|
|
14903
16903
|
rootPathHint: "角色、会话及其媒体文件都存放在这里。请填写绝对路径,或以 ~ 开头的路径。",
|
|
14904
16904
|
rootPathPlaceholder: "~/dsh-roleplay",
|
|
16905
|
+
catalogues: "目录",
|
|
16906
|
+
cataloguesHint: "可以浏览并安装世界的目录。填写目录的 API 地址;填写 API 密钥后可以看到其中的私有世界。",
|
|
16907
|
+
catalogueName: "名称",
|
|
16908
|
+
catalogueAddress: "API 地址",
|
|
16909
|
+
catalogueKey: "API 密钥",
|
|
16910
|
+
catalogueKeyHint: "可不填。以文本形式保存在本配置中,只会发送给该目录所在的站点。",
|
|
16911
|
+
catalogueRemove: "移除",
|
|
16912
|
+
catalogueAdd: "添加目录",
|
|
16913
|
+
catalogueProblemName: "请给目录起个名称。",
|
|
16914
|
+
catalogueProblemAddress: "请填写网址,例如 https://catalogue.example/api。",
|
|
16915
|
+
catalogueProblemDuplicate: "已有另一个目录使用这个名称。",
|
|
14905
16916
|
overridden: "已覆盖",
|
|
14906
16917
|
reset: "恢复默认",
|
|
14907
16918
|
invalid: "请填写文件夹路径。",
|
|
@@ -14929,12 +16940,12 @@ window.__ModuleLoader__.load({
|
|
|
14929
16940
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
14930
16941
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: t("title") }),
|
|
14931
16942
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("description") }),
|
|
14932
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
16943
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.SettingsForm, {
|
|
14933
16944
|
labels: formLabels(t),
|
|
14934
16945
|
state,
|
|
14935
16946
|
onSave: props.save,
|
|
14936
16947
|
onDiscard: props.discard,
|
|
14937
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.SettingsValueField, {
|
|
16948
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.SettingsValueField, {
|
|
14938
16949
|
id: "roleplay-root-path",
|
|
14939
16950
|
label: t("rootPath"),
|
|
14940
16951
|
hint: t("rootPathHint"),
|
|
@@ -14950,7 +16961,14 @@ window.__ModuleLoader__.load({
|
|
|
14950
16961
|
onReset: () => {
|
|
14951
16962
|
props.resetField("rootPath");
|
|
14952
16963
|
}
|
|
14953
|
-
})
|
|
16964
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CatalogueSettings, {
|
|
16965
|
+
t,
|
|
16966
|
+
text: state.catalogues.text,
|
|
16967
|
+
disabled: !state.writable,
|
|
16968
|
+
onEdit: (text) => {
|
|
16969
|
+
props.edit("catalogues", text);
|
|
16970
|
+
}
|
|
16971
|
+
})]
|
|
14954
16972
|
})
|
|
14955
16973
|
] });
|
|
14956
16974
|
}
|
|
@@ -14961,10 +16979,11 @@ window.__ModuleLoader__.load({
|
|
|
14961
16979
|
form;
|
|
14962
16980
|
store;
|
|
14963
16981
|
constructor(scope) {
|
|
14964
|
-
this.form = new _deepseek_ai_dsh_client_ui_primitives.SettingsFormModel(scope, [(0, _deepseek_ai_dsh_client_ui_primitives.settingsTextField)("rootPath")]);
|
|
16982
|
+
this.form = new _deepseek_ai_dsh_client_ui_primitives.SettingsFormModel(scope, [(0, _deepseek_ai_dsh_client_ui_primitives.settingsTextField)("rootPath"), cataloguesField]);
|
|
14965
16983
|
this.store = this.form.bind(() => ({
|
|
14966
16984
|
...this.form.shell(),
|
|
14967
|
-
rootPath: this.form.field("rootPath")
|
|
16985
|
+
rootPath: this.form.field("rootPath"),
|
|
16986
|
+
catalogues: this.form.field("catalogues")
|
|
14968
16987
|
}));
|
|
14969
16988
|
}
|
|
14970
16989
|
inject() {
|
|
@@ -15165,28 +17184,28 @@ window.__ModuleLoader__.load({
|
|
|
15165
17184
|
}
|
|
15166
17185
|
tag$2.textContent = css$2;
|
|
15167
17186
|
var NarrationView_module_css_default = {
|
|
15168
|
-
"
|
|
15169
|
-
"
|
|
15170
|
-
"narration": "rp_NFPimG_narration",
|
|
15171
|
-
"playAll": "rp_NFPimG_playAll",
|
|
15172
|
-
"preview": "rp_NFPimG_preview",
|
|
17187
|
+
"diceList": "rp_NFPimG_diceList",
|
|
17188
|
+
"avatar": "rp_NFPimG_avatar",
|
|
15173
17189
|
"speech": "rp_NFPimG_speech",
|
|
15174
|
-
"
|
|
15175
|
-
"oocLabel": "rp_NFPimG_oocLabel",
|
|
15176
|
-
"oocNote": "rp_NFPimG_oocNote",
|
|
15177
|
-
"imageButton": "rp_NFPimG_imageButton",
|
|
15178
|
-
"output": "rp_NFPimG_output",
|
|
15179
|
-
"oocRefused": "rp_NFPimG_oocRefused",
|
|
15180
|
-
"diceSummary": "rp_NFPimG_diceSummary",
|
|
17190
|
+
"note": "rp_NFPimG_note",
|
|
15181
17191
|
"line": "rp_NFPimG_line",
|
|
17192
|
+
"imageError": "rp_NFPimG_imageError",
|
|
15182
17193
|
"name": "rp_NFPimG_name",
|
|
17194
|
+
"playLine": "rp_NFPimG_playLine",
|
|
17195
|
+
"sceneImage": "rp_NFPimG_sceneImage",
|
|
15183
17196
|
"dice": "rp_NFPimG_dice",
|
|
15184
|
-
"
|
|
17197
|
+
"narration": "rp_NFPimG_narration",
|
|
17198
|
+
"output": "rp_NFPimG_output",
|
|
17199
|
+
"oocNote": "rp_NFPimG_oocNote",
|
|
17200
|
+
"oocRefused": "rp_NFPimG_oocRefused",
|
|
17201
|
+
"oocLabel": "rp_NFPimG_oocLabel",
|
|
17202
|
+
"preview": "rp_NFPimG_preview",
|
|
15185
17203
|
"words": "rp_NFPimG_words",
|
|
15186
|
-
"
|
|
15187
|
-
"
|
|
15188
|
-
"
|
|
15189
|
-
"
|
|
17204
|
+
"images": "rp_NFPimG_images",
|
|
17205
|
+
"imageButton": "rp_NFPimG_imageButton",
|
|
17206
|
+
"imageStatus": "rp_NFPimG_imageStatus",
|
|
17207
|
+
"playAll": "rp_NFPimG_playAll",
|
|
17208
|
+
"diceSummary": "rp_NFPimG_diceSummary"
|
|
15190
17209
|
};
|
|
15191
17210
|
//#endregion
|
|
15192
17211
|
//#region src/client/transcript/PreviewNode.tsx
|
|
@@ -15451,11 +17470,11 @@ window.__ModuleLoader__.load({
|
|
|
15451
17470
|
}
|
|
15452
17471
|
tag$1.textContent = css$1;
|
|
15453
17472
|
var SuggestionsDock_module_css_default = {
|
|
15454
|
-
"card": "rp_rWH4DG_card",
|
|
15455
17473
|
"dock": "rp_rWH4DG_dock",
|
|
17474
|
+
"chip": "rp_rWH4DG_chip",
|
|
17475
|
+
"card": "rp_rWH4DG_card",
|
|
15456
17476
|
"label": "rp_rWH4DG_label",
|
|
15457
|
-
"lines": "rp_rWH4DG_lines"
|
|
15458
|
-
"chip": "rp_rWH4DG_chip"
|
|
17477
|
+
"lines": "rp_rWH4DG_lines"
|
|
15459
17478
|
};
|
|
15460
17479
|
//#endregion
|
|
15461
17480
|
//#region src/client/transcript/SuggestionsDock.tsx
|
|
@@ -15575,12 +17594,12 @@ window.__ModuleLoader__.load({
|
|
|
15575
17594
|
}
|
|
15576
17595
|
tag.textContent = css;
|
|
15577
17596
|
var TurnsDock_module_css_default = {
|
|
15578
|
-
"
|
|
17597
|
+
"error": "rp_f4YLlq_error",
|
|
15579
17598
|
"select": "rp_f4YLlq_select",
|
|
17599
|
+
"button": "rp_f4YLlq_button",
|
|
15580
17600
|
"group": "rp_f4YLlq_group",
|
|
15581
|
-
"
|
|
15582
|
-
"
|
|
15583
|
-
"dock": "rp_f4YLlq_dock"
|
|
17601
|
+
"dock": "rp_f4YLlq_dock",
|
|
17602
|
+
"count": "rp_f4YLlq_count"
|
|
15584
17603
|
};
|
|
15585
17604
|
//#endregion
|
|
15586
17605
|
//#region src/client/transcript/withdrawn.ts
|
|
@@ -15948,6 +17967,7 @@ window.__ModuleLoader__.load({
|
|
|
15948
17967
|
registerPanel(ctx);
|
|
15949
17968
|
registerWorldsPage(ctx);
|
|
15950
17969
|
registerAvatarsPage(ctx);
|
|
17970
|
+
registerCataloguePage(ctx);
|
|
15951
17971
|
registerSessionsPage(ctx);
|
|
15952
17972
|
registerTranscript(ctx);
|
|
15953
17973
|
registerChatSettings(ctx);
|