@dsh-agentic-roleplay/core 0.3.2 → 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 +15 -255
- package/lib/child-CFjnaTZt.js +435 -0
- package/lib/client.js +2852 -586
- package/lib/client.js.map +1 -1
- package/lib/{deliver-BSsDtF6X.js → deliver-CpZOxBX5.js} +145 -1622
- package/lib/doctor-chat-ByDfCMeo.js +17 -0
- package/lib/doctor.js +171 -0
- package/lib/{gallery-DS5-qH9F.js → gallery-CtFDL22W.js} +2 -2
- package/lib/{generator-BzeepLd2.js → generator-B6FxlKOV.js} +2 -378
- package/lib/hooks-KTCR3fNJ.js +1060 -0
- package/lib/images.js +3 -3
- package/lib/index.js +1365 -201
- package/lib/language-DWVwi1R7.js +520 -0
- package/lib/orchestration.js +142 -1146
- package/lib/{documents-B5XAdfo2.js → pack-jail-CybSNzxr.js} +869 -80
- package/lib/{packs-BCGK9KZV.js → packs-BYjrAen6.js} +4 -518
- package/lib/{presenter-agent-Cp-J0onD.js → presenter-agent-CiEVKcjJ.js} +4 -3
- package/lib/reflection-waxFg1x-.js +1843 -0
- package/package.json +3 -2
- package/prompts/en/doctor/persona.md +1 -0
- package/prompts/en/doctor/procedure.md +5 -0
- package/prompts/en/doctor/welcome.md +1 -0
- package/prompts/en/import/character.md +1 -0
- package/prompts/en/roleplay/record-keeper.md +2 -2
- package/prompts/en/roleplay/reflection-check.md +5 -0
- package/prompts/en/roleplay/reflection.md +2 -0
- package/prompts/zh/doctor/persona.md +1 -0
- package/prompts/zh/doctor/procedure.md +5 -0
- package/prompts/zh/doctor/welcome.md +1 -0
- package/prompts/zh/import/character.md +1 -0
- package/prompts/zh/roleplay/record-keeper.md +2 -2
- package/prompts/zh/roleplay/reflection-check.md +5 -0
- package/prompts/zh/roleplay/reflection.md +2 -0
package/lib/client.js
CHANGED
|
@@ -26,16 +26,16 @@ window.__ModuleLoader__.load({
|
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/panel/PageTabs.module.css.mjs
|
|
29
|
-
const css$
|
|
30
|
-
const key$
|
|
31
|
-
let tag$
|
|
32
|
-
if (tag$
|
|
33
|
-
tag$
|
|
34
|
-
tag$
|
|
35
|
-
tag$
|
|
36
|
-
document.head.appendChild(tag$
|
|
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
40
|
"tabs": "rp_Poldga_tabs",
|
|
41
41
|
"tab": "rp_Poldga_tab"
|
|
@@ -82,20 +82,20 @@ 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
|
+
"panel": "rp_ua5gBa_panel",
|
|
96
97
|
"title": "rp_ua5gBa_title",
|
|
97
98
|
"body": "rp_ua5gBa_body",
|
|
98
|
-
"panel": "rp_ua5gBa_panel",
|
|
99
99
|
"header": "rp_ua5gBa_header"
|
|
100
100
|
};
|
|
101
101
|
//#endregion
|
|
@@ -131,122 +131,1184 @@ window.__ModuleLoader__.load({
|
|
|
131
131
|
onChange: (id) => {
|
|
132
132
|
actions.selectPage(id);
|
|
133
133
|
}
|
|
134
|
-
})]
|
|
135
|
-
}), active !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
136
|
-
className: RoleplayPanel_module_css_default.body,
|
|
137
|
-
role: "tabpanel",
|
|
138
|
-
id: panelId(active.id),
|
|
139
|
-
"aria-labelledby": tabId(active.id),
|
|
140
|
-
children: renderSlot("roleplay.page", {}, { only: active.id })
|
|
141
|
-
}, active.id)]
|
|
134
|
+
})]
|
|
135
|
+
}), active !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
136
|
+
className: RoleplayPanel_module_css_default.body,
|
|
137
|
+
role: "tabpanel",
|
|
138
|
+
id: panelId(active.id),
|
|
139
|
+
"aria-labelledby": tabId(active.id),
|
|
140
|
+
children: renderSlot("roleplay.page", {}, { only: active.id })
|
|
141
|
+
}, active.id)]
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/client/panel/locales.ts
|
|
146
|
+
const dictionaries$16 = {
|
|
147
|
+
en: {
|
|
148
|
+
label: "Role Play",
|
|
149
|
+
heading: "DSH Agentic Role Play",
|
|
150
|
+
navLabel: "Role Play sections"
|
|
151
|
+
},
|
|
152
|
+
zh: {
|
|
153
|
+
label: "角色扮演",
|
|
154
|
+
heading: "DSH 智能体角色扮演",
|
|
155
|
+
navLabel: "角色扮演栏目"
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/client/panel/pages-source.ts
|
|
160
|
+
/**
|
|
161
|
+
* Pages registered into `roleplay.page`, ordered, with their current labels.
|
|
162
|
+
* Labels are functions of the active language, so the list is rebuilt when
|
|
163
|
+
* either the registrations or the language change.
|
|
164
|
+
*/
|
|
165
|
+
function createPagesSource(ctx) {
|
|
166
|
+
const store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)([]);
|
|
167
|
+
const sync = () => {
|
|
168
|
+
const next = ctx.slots.entriesOfSlot("roleplay.page").map(({ options }) => ({
|
|
169
|
+
id: options.id,
|
|
170
|
+
order: options.order ?? 0,
|
|
171
|
+
label: (0, _deepseek_ai_dsh_client_ui_slots.resolveSlotLabel)(options.label) ?? options.id
|
|
172
|
+
})).sort((a, b) => a.order - b.order).map(({ id, label }) => ({
|
|
173
|
+
id,
|
|
174
|
+
label
|
|
175
|
+
}));
|
|
176
|
+
const previous = store.getSnapshot();
|
|
177
|
+
if (previous.length === next.length && previous.every((page, index) => page.id === next[index]?.id && page.label === next[index]?.label)) return;
|
|
178
|
+
store.set(next);
|
|
179
|
+
};
|
|
180
|
+
return {
|
|
181
|
+
store,
|
|
182
|
+
start: () => {
|
|
183
|
+
sync();
|
|
184
|
+
const disposers = [ctx.slots.subscribe("roleplay.page", sync), ctx.locale.subscribe(sync)];
|
|
185
|
+
return () => {
|
|
186
|
+
for (const dispose of disposers) dispose();
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/client/panel/panel-store.ts
|
|
193
|
+
function createPanelStore() {
|
|
194
|
+
return (0, _deepseek_ai_dsh_client_store.defineStore)({
|
|
195
|
+
init: () => ({ page: void 0 }),
|
|
196
|
+
actions: { selectPage: (draft, id) => {
|
|
197
|
+
draft.page = id;
|
|
198
|
+
} }
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/client/panel/index.ts
|
|
203
|
+
const NAMESPACE$11 = "roleplay.panel";
|
|
204
|
+
/** Adds the Role Play entry to the sidebar and the main panel it opens. */
|
|
205
|
+
function registerPanel(ctx) {
|
|
206
|
+
const t = ctx.locale.bind(NAMESPACE$11);
|
|
207
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$11, dictionaries$16), "roleplay: panel dictionaries");
|
|
208
|
+
const pages = createPagesSource(ctx);
|
|
209
|
+
ctx.effect(() => pages.start(), "roleplay: page list");
|
|
210
|
+
const handle = createPanelStore();
|
|
211
|
+
const instance = handle.create();
|
|
212
|
+
const store = {
|
|
213
|
+
...handle,
|
|
214
|
+
create: () => instance
|
|
215
|
+
};
|
|
216
|
+
ctx.slots.inject("main", () => ctx.slots.register({
|
|
217
|
+
name: "main",
|
|
218
|
+
key: PANEL_ID,
|
|
219
|
+
locale: NAMESPACE$11,
|
|
220
|
+
store,
|
|
221
|
+
inject: () => ({ hooks: { pages: pages.store } }),
|
|
222
|
+
children: { "roleplay.page": {
|
|
223
|
+
kind: "list",
|
|
224
|
+
scope: "root"
|
|
225
|
+
} }
|
|
226
|
+
}, RoleplayPanel));
|
|
227
|
+
ctx.slots.inject("sidebar.panellist", () => ctx.slots.register({
|
|
228
|
+
name: "sidebar.panellist",
|
|
229
|
+
id: PANEL_ID,
|
|
230
|
+
order: 5,
|
|
231
|
+
label: () => t("label"),
|
|
232
|
+
locale: NAMESPACE$11
|
|
233
|
+
}, PanelIcon));
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
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
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/shared/worlds.ts
|
|
247
|
+
/** Path prefix of the plugin's HTTP API. Relative, so a mounted deployment resolves it against the page. */
|
|
248
|
+
const API_PREFIX = "roleplay-api";
|
|
249
|
+
function worldCoverPath(id, version) {
|
|
250
|
+
return `${API_PREFIX}/worlds/cover?${new URLSearchParams({
|
|
251
|
+
id,
|
|
252
|
+
v: version
|
|
253
|
+
})}`;
|
|
254
|
+
}
|
|
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
|
+
]
|
|
142
1126
|
});
|
|
143
1127
|
}
|
|
144
1128
|
//#endregion
|
|
145
|
-
//#region src/client/
|
|
1129
|
+
//#region src/client/pages/catalogue/locales.ts
|
|
146
1130
|
const dictionaries$15 = {
|
|
147
1131
|
en: {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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"
|
|
151
1206
|
},
|
|
152
1207
|
zh: {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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: "打开对话"
|
|
156
1282
|
}
|
|
157
1283
|
};
|
|
158
1284
|
//#endregion
|
|
159
|
-
//#region src/client/
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
* either the registrations or the language change.
|
|
164
|
-
*/
|
|
165
|
-
function createPagesSource(ctx) {
|
|
166
|
-
const store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)([]);
|
|
167
|
-
const sync = () => {
|
|
168
|
-
const next = ctx.slots.entriesOfSlot("roleplay.page").map(({ options }) => ({
|
|
169
|
-
id: options.id,
|
|
170
|
-
order: options.order ?? 0,
|
|
171
|
-
label: (0, _deepseek_ai_dsh_client_ui_slots.resolveSlotLabel)(options.label) ?? options.id
|
|
172
|
-
})).sort((a, b) => a.order - b.order).map(({ id, label }) => ({
|
|
173
|
-
id,
|
|
174
|
-
label
|
|
175
|
-
}));
|
|
176
|
-
const previous = store.getSnapshot();
|
|
177
|
-
if (previous.length === next.length && previous.every((page, index) => page.id === next[index]?.id && page.label === next[index]?.label)) return;
|
|
178
|
-
store.set(next);
|
|
179
|
-
};
|
|
180
|
-
return {
|
|
181
|
-
store,
|
|
182
|
-
start: () => {
|
|
183
|
-
sync();
|
|
184
|
-
const disposers = [ctx.slots.subscribe("roleplay.page", sync), ctx.locale.subscribe(sync)];
|
|
185
|
-
return () => {
|
|
186
|
-
for (const dispose of disposers) dispose();
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
//#endregion
|
|
192
|
-
//#region src/client/panel/panel-store.ts
|
|
193
|
-
function createPanelStore() {
|
|
194
|
-
return (0, _deepseek_ai_dsh_client_store.defineStore)({
|
|
195
|
-
init: () => ({ page: void 0 }),
|
|
196
|
-
actions: { selectPage: (draft, id) => {
|
|
197
|
-
draft.page = id;
|
|
198
|
-
} }
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region src/client/panel/index.ts
|
|
203
|
-
const NAMESPACE$10 = "roleplay.panel";
|
|
204
|
-
/** Adds the Role Play entry to the sidebar and the main panel it opens. */
|
|
205
|
-
function registerPanel(ctx) {
|
|
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) {
|
|
206
1289
|
const t = ctx.locale.bind(NAMESPACE$10);
|
|
207
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$10, dictionaries$15), "roleplay:
|
|
208
|
-
const
|
|
209
|
-
ctx.effect(() =>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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"),
|
|
219
1303
|
locale: NAMESPACE$10,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
children: { "roleplay.page": {
|
|
223
|
-
kind: "list",
|
|
224
|
-
scope: "root"
|
|
225
|
-
} }
|
|
226
|
-
}, RoleplayPanel));
|
|
227
|
-
ctx.slots.inject("sidebar.panellist", () => ctx.slots.register({
|
|
228
|
-
name: "sidebar.panellist",
|
|
229
|
-
id: PANEL_ID,
|
|
230
|
-
order: 5,
|
|
231
|
-
label: () => t("label"),
|
|
232
|
-
locale: NAMESPACE$10
|
|
233
|
-
}, PanelIcon));
|
|
1304
|
+
inject: () => catalogue.inject()
|
|
1305
|
+
}, CataloguePage));
|
|
234
1306
|
}
|
|
235
1307
|
//#endregion
|
|
236
1308
|
//#region src/shared/avatars.ts
|
|
237
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. */
|
|
238
1310
|
const AVATARS_WORLD_ID = "@avatars";
|
|
239
1311
|
//#endregion
|
|
240
|
-
//#region src/shared/worlds.ts
|
|
241
|
-
/** Path prefix of the plugin's HTTP API. Relative, so a mounted deployment resolves it against the page. */
|
|
242
|
-
const API_PREFIX = "roleplay-api";
|
|
243
|
-
function worldCoverPath(id, version) {
|
|
244
|
-
return `${API_PREFIX}/worlds/cover?${new URLSearchParams({
|
|
245
|
-
id,
|
|
246
|
-
v: version
|
|
247
|
-
})}`;
|
|
248
|
-
}
|
|
249
|
-
//#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
|
-
"voiceInline": "rp_5ZMIxq_voiceInline",
|
|
749
|
-
"help": "rp_5ZMIxq_help",
|
|
750
|
-
"field": "rp_5ZMIxq_field",
|
|
751
1831
|
"tabsSpace": "rp_5ZMIxq_tabsSpace",
|
|
752
|
-
"error": "rp_5ZMIxq_error",
|
|
753
1832
|
"empty": "rp_5ZMIxq_empty",
|
|
754
|
-
"grid": "rp_5ZMIxq_grid",
|
|
755
|
-
"head": "rp_5ZMIxq_head",
|
|
756
|
-
"row": "rp_5ZMIxq_row",
|
|
757
|
-
"portraitError": "rp_5ZMIxq_portraitError",
|
|
758
1833
|
"sheet": "rp_5ZMIxq_sheet",
|
|
759
|
-
"
|
|
1834
|
+
"goal": "rp_5ZMIxq_goal",
|
|
1835
|
+
"sectionTitle": "rp_5ZMIxq_sectionTitle",
|
|
1836
|
+
"initial": "rp_5ZMIxq_initial",
|
|
760
1837
|
"placeholder": "rp_5ZMIxq_placeholder",
|
|
761
|
-
"portraitAction": "rp_5ZMIxq_portraitAction",
|
|
762
|
-
"wide": "rp_5ZMIxq_wide",
|
|
763
1838
|
"panel": "rp_5ZMIxq_panel",
|
|
764
|
-
"
|
|
765
|
-
"
|
|
766
|
-
"
|
|
767
|
-
"goal": "rp_5ZMIxq_goal",
|
|
768
|
-
"barText": "rp_5ZMIxq_barText",
|
|
1839
|
+
"grid": "rp_5ZMIxq_grid",
|
|
1840
|
+
"body": "rp_5ZMIxq_body",
|
|
1841
|
+
"portraitError": "rp_5ZMIxq_portraitError",
|
|
769
1842
|
"nameInput": "rp_5ZMIxq_nameInput",
|
|
770
|
-
"tabOn": "rp_5ZMIxq_tabOn",
|
|
771
|
-
"area": "rp_5ZMIxq_area",
|
|
772
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",
|
|
773
1849
|
"missing": "rp_5ZMIxq_missing",
|
|
774
1850
|
"bar": "rp_5ZMIxq_bar",
|
|
1851
|
+
"tabOn": "rp_5ZMIxq_tabOn",
|
|
1852
|
+
"row": "rp_5ZMIxq_row",
|
|
1853
|
+
"label": "rp_5ZMIxq_label",
|
|
775
1854
|
"select": "rp_5ZMIxq_select",
|
|
1855
|
+
"portraitAction": "rp_5ZMIxq_portraitAction",
|
|
1856
|
+
"portraitBox": "rp_5ZMIxq_portraitBox",
|
|
776
1857
|
"meta": "rp_5ZMIxq_meta",
|
|
777
|
-
"
|
|
778
|
-
"
|
|
779
|
-
"
|
|
1858
|
+
"barText": "rp_5ZMIxq_barText",
|
|
1859
|
+
"voiceInline": "rp_5ZMIxq_voiceInline",
|
|
1860
|
+
"wide": "rp_5ZMIxq_wide",
|
|
780
1861
|
"tabs": "rp_5ZMIxq_tabs",
|
|
781
|
-
"
|
|
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: [
|
|
@@ -2378,51 +3573,51 @@ window.__ModuleLoader__.load({
|
|
|
2378
3573
|
});
|
|
2379
3574
|
}
|
|
2380
3575
|
//#endregion
|
|
2381
|
-
//#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$
|
|
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
|
|
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
|
-
"
|
|
2394
|
-
"head": "rp_7pEHTW_head",
|
|
3588
|
+
"toolbar": "rp_7pEHTW_toolbar",
|
|
2395
3589
|
"edge": "rp_7pEHTW_edge",
|
|
2396
3590
|
"filter": "rp_7pEHTW_filter",
|
|
3591
|
+
"graphInspector": "rp_7pEHTW_graphInspector",
|
|
3592
|
+
"space": "rp_7pEHTW_space",
|
|
3593
|
+
"actions": "rp_7pEHTW_actions",
|
|
3594
|
+
"graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
|
|
2397
3595
|
"edgeTitle": "rp_7pEHTW_edgeTitle",
|
|
3596
|
+
"entities": "rp_7pEHTW_entities",
|
|
3597
|
+
"inspector": "rp_7pEHTW_inspector",
|
|
3598
|
+
"filterOn": "rp_7pEHTW_filterOn",
|
|
3599
|
+
"error": "rp_7pEHTW_error",
|
|
3600
|
+
"node_item": "rp_7pEHTW_node_item",
|
|
2398
3601
|
"edgeOn": "rp_7pEHTW_edgeOn",
|
|
2399
|
-
"form": "rp_7pEHTW_form",
|
|
2400
|
-
"wide": "rp_7pEHTW_wide",
|
|
2401
3602
|
"notice": "rp_7pEHTW_notice",
|
|
2402
|
-
"
|
|
3603
|
+
"perspective": "rp_7pEHTW_perspective",
|
|
2403
3604
|
"node": "rp_7pEHTW_node",
|
|
2404
|
-
"
|
|
2405
|
-
"
|
|
2406
|
-
"
|
|
2407
|
-
"
|
|
2408
|
-
"toolbar": "rp_7pEHTW_toolbar",
|
|
2409
|
-
"entities": "rp_7pEHTW_entities",
|
|
3605
|
+
"edgeKind": "rp_7pEHTW_edgeKind",
|
|
3606
|
+
"list": "rp_7pEHTW_list",
|
|
3607
|
+
"empty": "rp_7pEHTW_empty",
|
|
3608
|
+
"form": "rp_7pEHTW_form",
|
|
2410
3609
|
"node_faction": "rp_7pEHTW_node_faction",
|
|
2411
|
-
"
|
|
3610
|
+
"check": "rp_7pEHTW_check",
|
|
2412
3611
|
"workspace": "rp_7pEHTW_workspace",
|
|
2413
|
-
"
|
|
3612
|
+
"node_character": "rp_7pEHTW_node_character",
|
|
3613
|
+
"head": "rp_7pEHTW_head",
|
|
2414
3614
|
"status": "rp_7pEHTW_status",
|
|
2415
|
-
"
|
|
2416
|
-
"filterOn": "rp_7pEHTW_filterOn",
|
|
2417
|
-
"list": "rp_7pEHTW_list",
|
|
3615
|
+
"wide": "rp_7pEHTW_wide",
|
|
2418
3616
|
"node_location": "rp_7pEHTW_node_location",
|
|
2419
|
-
"inspector": "rp_7pEHTW_inspector",
|
|
2420
|
-
"edgeKind": "rp_7pEHTW_edgeKind",
|
|
2421
|
-
"check": "rp_7pEHTW_check",
|
|
2422
|
-
"node_item": "rp_7pEHTW_node_item",
|
|
2423
|
-
"graphInspector": "rp_7pEHTW_graphInspector",
|
|
2424
3617
|
"metrics": "rp_7pEHTW_metrics",
|
|
2425
|
-
"graphEdge": "rp_7pEHTW_graphEdge"
|
|
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 = {
|
|
3753
|
-
"message": "rp_h_sbFq_message",
|
|
3754
4948
|
"frame": "rp_h_sbFq_frame",
|
|
3755
4949
|
"problems": "rp_h_sbFq_problems",
|
|
3756
4950
|
"hud": "rp_h_sbFq_hud",
|
|
4951
|
+
"tab": "rp_h_sbFq_tab",
|
|
3757
4952
|
"fill": "rp_h_sbFq_fill",
|
|
3758
|
-
"
|
|
4953
|
+
"message": "rp_h_sbFq_message"
|
|
3759
4954
|
};
|
|
3760
4955
|
//#endregion
|
|
3761
4956
|
//#region src/client/widgets/pack-frame/theme.ts
|
|
@@ -3987,26 +5182,44 @@ window.__ModuleLoader__.load({
|
|
|
3987
5182
|
const saveVariables = async (world, variables, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/variables?${query(world)}`, init("PUT", signal, { variables })));
|
|
3988
5183
|
const loadWorldPacks = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/interface?${query(world)}`, init("GET", signal)));
|
|
3989
5184
|
const loadPackPreview = async (world, pack, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/interface/preview?${query(world)}&pack=${encodeURIComponent(pack)}`, init("GET", signal)));
|
|
5185
|
+
/** The playable characters of an authored world, for choosing whom an opening is for. */
|
|
5186
|
+
async function loadPlayable(worldId, signal) {
|
|
5187
|
+
const response = await fetch(`${API_PREFIX}/worlds/characters?id=${encodeURIComponent(worldId)}`, {
|
|
5188
|
+
credentials: "same-origin",
|
|
5189
|
+
signal
|
|
5190
|
+
});
|
|
5191
|
+
if (!response.ok) throw new Error(`${response.status} ${response.statusText}`.trim());
|
|
5192
|
+
const { characters } = await response.json();
|
|
5193
|
+
return characters.filter((character) => character.role === "playable").map(({ id, name }) => ({
|
|
5194
|
+
id,
|
|
5195
|
+
name
|
|
5196
|
+
}));
|
|
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;
|
|
3990
5203
|
//#endregion
|
|
3991
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
|
|
3992
|
-
const css$
|
|
3993
|
-
const key$
|
|
3994
|
-
let tag$
|
|
3995
|
-
if (tag$
|
|
3996
|
-
tag$
|
|
3997
|
-
tag$
|
|
3998
|
-
tag$
|
|
3999
|
-
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);
|
|
4000
5213
|
}
|
|
4001
|
-
tag$
|
|
5214
|
+
tag$22.textContent = css$22;
|
|
4002
5215
|
var PacksPanel_module_css_default = {
|
|
4003
5216
|
"note": "rp_FLaP7q_note",
|
|
5217
|
+
"stageTall": "rp_FLaP7q_stageTall",
|
|
4004
5218
|
"group": "rp_FLaP7q_group",
|
|
4005
|
-
"
|
|
5219
|
+
"files": "rp_FLaP7q_files",
|
|
4006
5220
|
"controls": "rp_FLaP7q_controls",
|
|
4007
|
-
"
|
|
4008
|
-
"log": "rp_FLaP7q_log"
|
|
4009
|
-
"files": "rp_FLaP7q_files"
|
|
5221
|
+
"stage": "rp_FLaP7q_stage",
|
|
5222
|
+
"log": "rp_FLaP7q_log"
|
|
4010
5223
|
};
|
|
4011
5224
|
//#endregion
|
|
4012
5225
|
//#region src/client/world-editor/PacksPanel.tsx
|
|
@@ -4016,6 +5229,7 @@ window.__ModuleLoader__.load({
|
|
|
4016
5229
|
wide: 1100
|
|
4017
5230
|
};
|
|
4018
5231
|
const MAX_LOG = 8;
|
|
5232
|
+
const TEXT_FILE = /\.(html|css|js|json|txt|svg)$/i;
|
|
4019
5233
|
/** A preview keeps nothing and has no turns played: what a surface asks to keep stays in memory until it is reloaded. */
|
|
4020
5234
|
function previewBackend() {
|
|
4021
5235
|
const kept = /* @__PURE__ */ new Map();
|
|
@@ -4038,6 +5252,10 @@ window.__ModuleLoader__.load({
|
|
|
4038
5252
|
const [reload, setReload] = (0, react.useState)(0);
|
|
4039
5253
|
const [preview, setPreview] = (0, react.useState)();
|
|
4040
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)();
|
|
4041
5259
|
(0, react.useEffect)(() => {
|
|
4042
5260
|
const abort = new AbortController();
|
|
4043
5261
|
loadWorldPacks(worldId, abort.signal).then(setPacks, (failure) => {
|
|
@@ -4091,6 +5309,80 @@ window.__ModuleLoader__.load({
|
|
|
4091
5309
|
preview,
|
|
4092
5310
|
reload
|
|
4093
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
|
+
};
|
|
4094
5386
|
const refresh = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
4095
5387
|
variant: "ghost",
|
|
4096
5388
|
size: "sm",
|
|
@@ -4124,6 +5416,60 @@ window.__ModuleLoader__.load({
|
|
|
4124
5416
|
className: CharactersPanel_module_css_default.sheet,
|
|
4125
5417
|
children: [
|
|
4126
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
|
+
}),
|
|
4127
5473
|
packs === void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: say("loading") }),
|
|
4128
5474
|
packs !== void 0 && !Array.isArray(packs) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4129
5475
|
className: CharactersPanel_module_css_default.error,
|
|
@@ -4161,22 +5507,116 @@ window.__ModuleLoader__.load({
|
|
|
4161
5507
|
pack.surfaces[name]?.file
|
|
4162
5508
|
] }, name))
|
|
4163
5509
|
] }),
|
|
4164
|
-
pack.files.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
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")
|
|
4177
5564
|
})
|
|
4178
|
-
]
|
|
4179
|
-
})
|
|
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
|
+
}),
|
|
4180
5620
|
pack.problems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4181
5621
|
className: CharactersPanel_module_css_default.error,
|
|
4182
5622
|
role: "alert",
|
|
@@ -4369,8 +5809,93 @@ window.__ModuleLoader__.load({
|
|
|
4369
5809
|
expired: "expired",
|
|
4370
5810
|
dormant: "dormant"
|
|
4371
5811
|
};
|
|
4372
|
-
|
|
4373
|
-
|
|
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
|
+
};
|
|
4374
5899
|
const say = (key, values) => t(`trig_${key}`, values);
|
|
4375
5900
|
const names = namesOf(world);
|
|
4376
5901
|
const story = world.triggers?.some((trigger) => trigger.status !== void 0) === true;
|
|
@@ -4394,6 +5919,58 @@ window.__ModuleLoader__.load({
|
|
|
4394
5919
|
className: CharactersPanel_module_css_default.sheet,
|
|
4395
5920
|
children: [
|
|
4396
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
|
+
}),
|
|
4397
5974
|
world.triggersProblem !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4398
5975
|
className: CharactersPanel_module_css_default.error,
|
|
4399
5976
|
role: "alert",
|
|
@@ -4431,6 +6008,57 @@ window.__ModuleLoader__.load({
|
|
|
4431
6008
|
children: say("then")
|
|
4432
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)) })] }),
|
|
4433
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
|
+
}),
|
|
4434
6062
|
trigger.problems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4435
6063
|
className: CharactersPanel_module_css_default.error,
|
|
4436
6064
|
role: "alert",
|
|
@@ -4443,6 +6071,49 @@ window.__ModuleLoader__.load({
|
|
|
4443
6071
|
})]
|
|
4444
6072
|
});
|
|
4445
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
|
+
}
|
|
4446
6117
|
//#endregion
|
|
4447
6118
|
//#region src/client/world-editor/InfoPanel.tsx
|
|
4448
6119
|
const draftOf$3 = (info) => ({
|
|
@@ -4477,7 +6148,8 @@ window.__ModuleLoader__.load({
|
|
|
4477
6148
|
if (JSON.stringify(lines(draft.rules)) !== JSON.stringify(lines(saved.rules))) edit["rules"] = lines(draft.rules);
|
|
4478
6149
|
const cleaned = (list) => list.map((entry) => ({
|
|
4479
6150
|
title: entry.title.trim(),
|
|
4480
|
-
text: entry.text.trim()
|
|
6151
|
+
text: entry.text.trim(),
|
|
6152
|
+
...(entry.character ?? "") === "" ? {} : { character: entry.character }
|
|
4481
6153
|
})).filter((entry) => entry.text !== "");
|
|
4482
6154
|
if (JSON.stringify(cleaned(draft.alternates)) !== JSON.stringify(cleaned(saved.alternates))) edit["alternateOpenings"] = cleaned(draft.alternates);
|
|
4483
6155
|
return edit;
|
|
@@ -4488,6 +6160,14 @@ window.__ModuleLoader__.load({
|
|
|
4488
6160
|
const [saved, setSaved] = (0, react.useState)();
|
|
4489
6161
|
const [draft, setDraft] = (0, react.useState)();
|
|
4490
6162
|
const [status, setStatus] = (0, react.useState)({ state: "idle" });
|
|
6163
|
+
const [playable, setPlayable] = (0, react.useState)([]);
|
|
6164
|
+
(0, react.useEffect)(() => {
|
|
6165
|
+
const abort = new AbortController();
|
|
6166
|
+
loadPlayable(worldId, abort.signal).then(setPlayable, () => void 0);
|
|
6167
|
+
return () => {
|
|
6168
|
+
abort.abort();
|
|
6169
|
+
};
|
|
6170
|
+
}, [worldId]);
|
|
4491
6171
|
(0, react.useEffect)(() => {
|
|
4492
6172
|
const abort = new AbortController();
|
|
4493
6173
|
loadInfo(worldId, abort.signal).then((value) => {
|
|
@@ -4673,6 +6353,36 @@ window.__ModuleLoader__.load({
|
|
|
4673
6353
|
}
|
|
4674
6354
|
})]
|
|
4675
6355
|
}),
|
|
6356
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6357
|
+
className: CharactersPanel_module_css_default.field,
|
|
6358
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6359
|
+
className: CharactersPanel_module_css_default.label,
|
|
6360
|
+
children: t("infoAlternateFor")
|
|
6361
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
6362
|
+
className: CharactersPanel_module_css_default.select,
|
|
6363
|
+
value: entry.character ?? "",
|
|
6364
|
+
onChange: (event) => {
|
|
6365
|
+
setAlternates(draft.alternates.map((item, at) => at === index ? {
|
|
6366
|
+
...item,
|
|
6367
|
+
character: event.target.value
|
|
6368
|
+
} : item));
|
|
6369
|
+
},
|
|
6370
|
+
children: [
|
|
6371
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6372
|
+
value: "",
|
|
6373
|
+
children: t("infoAlternateAny")
|
|
6374
|
+
}),
|
|
6375
|
+
playable.map((character) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6376
|
+
value: character.id,
|
|
6377
|
+
children: character.name
|
|
6378
|
+
}, character.id)),
|
|
6379
|
+
entry.character !== void 0 && entry.character !== "" && !playable.some((character) => character.id === entry.character) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6380
|
+
value: entry.character,
|
|
6381
|
+
children: entry.character
|
|
6382
|
+
})
|
|
6383
|
+
]
|
|
6384
|
+
})]
|
|
6385
|
+
}),
|
|
4676
6386
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
4677
6387
|
variant: "ghost",
|
|
4678
6388
|
size: "sm",
|
|
@@ -5496,6 +7206,41 @@ window.__ModuleLoader__.load({
|
|
|
5496
7206
|
id: "list_checks",
|
|
5497
7207
|
agent: "gameMaster",
|
|
5498
7208
|
default: true
|
|
7209
|
+
},
|
|
7210
|
+
{
|
|
7211
|
+
id: "recall_my_memories",
|
|
7212
|
+
agent: "characters",
|
|
7213
|
+
default: true
|
|
7214
|
+
},
|
|
7215
|
+
{
|
|
7216
|
+
id: "recall_my_known_entities",
|
|
7217
|
+
agent: "characters",
|
|
7218
|
+
default: true
|
|
7219
|
+
},
|
|
7220
|
+
{
|
|
7221
|
+
id: "recall_my_lore",
|
|
7222
|
+
agent: "characters",
|
|
7223
|
+
default: true
|
|
7224
|
+
},
|
|
7225
|
+
{
|
|
7226
|
+
id: "search_events",
|
|
7227
|
+
agent: "records",
|
|
7228
|
+
default: true
|
|
7229
|
+
},
|
|
7230
|
+
{
|
|
7231
|
+
id: "list_threads",
|
|
7232
|
+
agent: "records",
|
|
7233
|
+
default: true
|
|
7234
|
+
},
|
|
7235
|
+
{
|
|
7236
|
+
id: "list_relationships",
|
|
7237
|
+
agent: "records",
|
|
7238
|
+
default: true
|
|
7239
|
+
},
|
|
7240
|
+
{
|
|
7241
|
+
id: "list_items",
|
|
7242
|
+
agent: "records",
|
|
7243
|
+
default: true
|
|
5499
7244
|
}
|
|
5500
7245
|
];
|
|
5501
7246
|
/** Whether an agent of this kind has a tool, by what the switches say and, failing that, by default. A tool this version does not offer is never on. */
|
|
@@ -5553,28 +7298,28 @@ window.__ModuleLoader__.load({
|
|
|
5553
7298
|
}
|
|
5554
7299
|
//#endregion
|
|
5555
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
|
|
5556
|
-
const css$
|
|
5557
|
-
const key$
|
|
5558
|
-
let tag$
|
|
5559
|
-
if (tag$
|
|
5560
|
-
tag$
|
|
5561
|
-
tag$
|
|
5562
|
-
tag$
|
|
5563
|
-
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);
|
|
5564
7309
|
}
|
|
5565
|
-
tag$
|
|
7310
|
+
tag$21.textContent = css$21;
|
|
5566
7311
|
var ToolSwitches_module_css_default = {
|
|
5567
|
-
"external": "rp_CjoFLq_external",
|
|
5568
7312
|
"title": "rp_CjoFLq_title",
|
|
5569
|
-
"
|
|
7313
|
+
"error": "rp_CjoFLq_error",
|
|
7314
|
+
"toolText": "rp_CjoFLq_toolText",
|
|
7315
|
+
"default": "rp_CjoFLq_default",
|
|
5570
7316
|
"agent": "rp_CjoFLq_agent",
|
|
7317
|
+
"root": "rp_CjoFLq_root",
|
|
7318
|
+
"external": "rp_CjoFLq_external",
|
|
7319
|
+
"tool": "rp_CjoFLq_tool",
|
|
5571
7320
|
"agentName": "rp_CjoFLq_agentName",
|
|
5572
|
-
"toolText": "rp_CjoFLq_toolText",
|
|
5573
|
-
"help": "rp_CjoFLq_help",
|
|
5574
7321
|
"hint": "rp_CjoFLq_hint",
|
|
5575
|
-
"
|
|
5576
|
-
"default": "rp_CjoFLq_default",
|
|
5577
|
-
"error": "rp_CjoFLq_error"
|
|
7322
|
+
"help": "rp_CjoFLq_help"
|
|
5578
7323
|
};
|
|
5579
7324
|
//#endregion
|
|
5580
7325
|
//#region src/client/widgets/tool-switches/ToolSwitches.tsx
|
|
@@ -6572,46 +8317,46 @@ window.__ModuleLoader__.load({
|
|
|
6572
8317
|
const imageUrl = (target, image) => `${route(target, "/file")}&path=${encodeURIComponent(image.path)}&v=${encodeURIComponent(image.createdAt)}`;
|
|
6573
8318
|
//#endregion
|
|
6574
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
|
|
6575
|
-
const css$
|
|
6576
|
-
const key$
|
|
6577
|
-
let tag$
|
|
6578
|
-
if (tag$
|
|
6579
|
-
tag$
|
|
6580
|
-
tag$
|
|
6581
|
-
tag$
|
|
6582
|
-
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);
|
|
6583
8328
|
}
|
|
6584
|
-
tag$
|
|
8329
|
+
tag$20.textContent = css$20;
|
|
6585
8330
|
var GalleryView_module_css_default = {
|
|
6586
|
-
"
|
|
6587
|
-
"
|
|
6588
|
-
"
|
|
6589
|
-
"
|
|
6590
|
-
"
|
|
6591
|
-
"editField": "rp_9pSHmG_editField",
|
|
8331
|
+
"note": "rp_9pSHmG_note",
|
|
8332
|
+
"editLabel": "rp_9pSHmG_editLabel",
|
|
8333
|
+
"toolbar": "rp_9pSHmG_toolbar",
|
|
8334
|
+
"image": "rp_9pSHmG_image",
|
|
8335
|
+
"status": "rp_9pSHmG_status",
|
|
6592
8336
|
"cell": "rp_9pSHmG_cell",
|
|
6593
|
-
"editArea": "rp_9pSHmG_editArea",
|
|
6594
8337
|
"count": "rp_9pSHmG_count",
|
|
6595
|
-
"thumb": "rp_9pSHmG_thumb",
|
|
6596
|
-
"editHelp": "rp_9pSHmG_editHelp",
|
|
6597
|
-
"grid": "rp_9pSHmG_grid",
|
|
6598
|
-
"status": "rp_9pSHmG_status",
|
|
6599
|
-
"open": "rp_9pSHmG_open",
|
|
6600
|
-
"reusable": "rp_9pSHmG_reusable",
|
|
6601
|
-
"detail": "rp_9pSHmG_detail",
|
|
6602
|
-
"tags": "rp_9pSHmG_tags",
|
|
6603
|
-
"toolbar": "rp_9pSHmG_toolbar",
|
|
6604
|
-
"note": "rp_9pSHmG_note",
|
|
6605
8338
|
"edit": "rp_9pSHmG_edit",
|
|
8339
|
+
"large": "rp_9pSHmG_large",
|
|
8340
|
+
"editField": "rp_9pSHmG_editField",
|
|
8341
|
+
"actions": "rp_9pSHmG_actions",
|
|
8342
|
+
"reusable": "rp_9pSHmG_reusable",
|
|
8343
|
+
"editHelp": "rp_9pSHmG_editHelp",
|
|
8344
|
+
"error": "rp_9pSHmG_error",
|
|
8345
|
+
"thumb": "rp_9pSHmG_thumb",
|
|
6606
8346
|
"page": "rp_9pSHmG_page",
|
|
6607
|
-
"
|
|
6608
|
-
"message": "rp_9pSHmG_message",
|
|
6609
|
-
"image": "rp_9pSHmG_image",
|
|
8347
|
+
"grid": "rp_9pSHmG_grid",
|
|
6610
8348
|
"caption": "rp_9pSHmG_caption",
|
|
8349
|
+
"message": "rp_9pSHmG_message",
|
|
8350
|
+
"pre": "rp_9pSHmG_pre",
|
|
8351
|
+
"tags": "rp_9pSHmG_tags",
|
|
8352
|
+
"editButton": "rp_9pSHmG_editButton",
|
|
8353
|
+
"facts": "rp_9pSHmG_facts",
|
|
6611
8354
|
"editInput": "rp_9pSHmG_editInput",
|
|
8355
|
+
"detail": "rp_9pSHmG_detail",
|
|
8356
|
+
"select": "rp_9pSHmG_select",
|
|
8357
|
+
"editArea": "rp_9pSHmG_editArea",
|
|
6612
8358
|
"statusError": "rp_9pSHmG_statusError",
|
|
6613
|
-
"
|
|
6614
|
-
"select": "rp_9pSHmG_select"
|
|
8359
|
+
"open": "rp_9pSHmG_open"
|
|
6615
8360
|
};
|
|
6616
8361
|
//#endregion
|
|
6617
8362
|
//#region src/client/widgets/gallery-view/GalleryView.tsx
|
|
@@ -6941,24 +8686,24 @@ window.__ModuleLoader__.load({
|
|
|
6941
8686
|
}
|
|
6942
8687
|
//#endregion
|
|
6943
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
|
|
6944
|
-
const css$
|
|
6945
|
-
const key$
|
|
6946
|
-
let tag$
|
|
6947
|
-
if (tag$
|
|
6948
|
-
tag$
|
|
6949
|
-
tag$
|
|
6950
|
-
tag$
|
|
6951
|
-
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);
|
|
6952
8697
|
}
|
|
6953
|
-
tag$
|
|
8698
|
+
tag$19.textContent = css$19;
|
|
6954
8699
|
var WorldEditor_module_css_default = {
|
|
6955
|
-
"
|
|
6956
|
-
"drawerItem": "rp__swA3a_drawerItem",
|
|
8700
|
+
"message": "rp__swA3a_message",
|
|
6957
8701
|
"view": "rp__swA3a_view",
|
|
8702
|
+
"drawerItem": "rp__swA3a_drawerItem",
|
|
8703
|
+
"warning": "rp__swA3a_warning",
|
|
6958
8704
|
"drawer": "rp__swA3a_drawer",
|
|
6959
8705
|
"drawerItemOn": "rp__swA3a_drawerItemOn",
|
|
6960
|
-
"content": "rp__swA3a_content"
|
|
6961
|
-
"message": "rp__swA3a_message"
|
|
8706
|
+
"content": "rp__swA3a_content"
|
|
6962
8707
|
};
|
|
6963
8708
|
//#endregion
|
|
6964
8709
|
//#region src/client/world-editor/WorldEditor.tsx
|
|
@@ -7314,6 +9059,8 @@ window.__ModuleLoader__.load({
|
|
|
7314
9059
|
section === "triggers" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggersPanel, {
|
|
7315
9060
|
t,
|
|
7316
9061
|
world: load.world,
|
|
9062
|
+
source,
|
|
9063
|
+
onChanged: changed,
|
|
7317
9064
|
actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
7318
9065
|
variant: "ghost",
|
|
7319
9066
|
size: "sm",
|
|
@@ -7341,38 +9088,38 @@ window.__ModuleLoader__.load({
|
|
|
7341
9088
|
}
|
|
7342
9089
|
//#endregion
|
|
7343
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
|
|
7344
|
-
const css$
|
|
7345
|
-
const key$
|
|
7346
|
-
let tag$
|
|
7347
|
-
if (tag$
|
|
7348
|
-
tag$
|
|
7349
|
-
tag$
|
|
7350
|
-
tag$
|
|
7351
|
-
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);
|
|
7352
9099
|
}
|
|
7353
|
-
tag$
|
|
9100
|
+
tag$18.textContent = css$18;
|
|
7354
9101
|
var AvatarsPage_module_css_default = {
|
|
7355
|
-
"
|
|
7356
|
-
"actions": "rp_pQOzEG_actions",
|
|
9102
|
+
"open": "rp_pQOzEG_open",
|
|
7357
9103
|
"placeholder": "rp_pQOzEG_placeholder",
|
|
7358
|
-
"name": "rp_pQOzEG_name",
|
|
7359
|
-
"grid": "rp_pQOzEG_grid",
|
|
7360
|
-
"editTitle": "rp_pQOzEG_editTitle",
|
|
7361
|
-
"viewport": "rp_pQOzEG_viewport",
|
|
7362
9104
|
"count": "rp_pQOzEG_count",
|
|
9105
|
+
"actions": "rp_pQOzEG_actions",
|
|
7363
9106
|
"card": "rp_pQOzEG_card",
|
|
9107
|
+
"name": "rp_pQOzEG_name",
|
|
9108
|
+
"field": "rp_pQOzEG_field",
|
|
9109
|
+
"editHeader": "rp_pQOzEG_editHeader",
|
|
7364
9110
|
"message": "rp_pQOzEG_message",
|
|
9111
|
+
"editTitle": "rp_pQOzEG_editTitle",
|
|
9112
|
+
"editBody": "rp_pQOzEG_editBody",
|
|
9113
|
+
"viewport": "rp_pQOzEG_viewport",
|
|
7365
9114
|
"form": "rp_pQOzEG_form",
|
|
7366
|
-
"page": "rp_pQOzEG_page",
|
|
7367
|
-
"portrait": "rp_pQOzEG_portrait",
|
|
7368
|
-
"editHeader": "rp_pQOzEG_editHeader",
|
|
7369
|
-
"label": "rp_pQOzEG_label",
|
|
7370
9115
|
"toolbar": "rp_pQOzEG_toolbar",
|
|
7371
|
-
"
|
|
7372
|
-
"
|
|
9116
|
+
"label": "rp_pQOzEG_label",
|
|
9117
|
+
"portrait": "rp_pQOzEG_portrait",
|
|
9118
|
+
"error": "rp_pQOzEG_error",
|
|
7373
9119
|
"text": "rp_pQOzEG_text",
|
|
9120
|
+
"grid": "rp_pQOzEG_grid",
|
|
7374
9121
|
"summary": "rp_pQOzEG_summary",
|
|
7375
|
-
"
|
|
9122
|
+
"page": "rp_pQOzEG_page"
|
|
7376
9123
|
};
|
|
7377
9124
|
//#endregion
|
|
7378
9125
|
//#region src/client/pages/avatars/AvatarsPage.tsx
|
|
@@ -7676,7 +9423,21 @@ window.__ModuleLoader__.load({
|
|
|
7676
9423
|
sw_tool_roll_dice: "Roll dice",
|
|
7677
9424
|
sw_tool_roll_dice_hint: "Rolls plain dice (2d6+1, d100) for what has no check, so that no number is made up.",
|
|
7678
9425
|
sw_tool_list_checks: "List checks",
|
|
7679
|
-
sw_tool_list_checks_hint: "Shows the world's checks and when each is used."
|
|
9426
|
+
sw_tool_list_checks_hint: "Shows the world's checks and when each is used.",
|
|
9427
|
+
sw_tool_recall_my_memories: "Recall memories",
|
|
9428
|
+
sw_tool_recall_my_memories_hint: "Lets a character look up what it remembers when the scene names something its brief left out.",
|
|
9429
|
+
sw_tool_recall_my_known_entities: "Recall known places and things",
|
|
9430
|
+
sw_tool_recall_my_known_entities_hint: "Lets a character look up the places, things and people it knows of.",
|
|
9431
|
+
sw_tool_recall_my_lore: "Recall lore",
|
|
9432
|
+
sw_tool_recall_my_lore_hint: "Lets a character read the canon it explicitly knows.",
|
|
9433
|
+
sw_tool_search_events: "Search events",
|
|
9434
|
+
sw_tool_search_events_hint: "Lets the record keeper search what already happened before it writes.",
|
|
9435
|
+
sw_tool_list_threads: "List open threads",
|
|
9436
|
+
sw_tool_list_threads_hint: "Lets the record keeper see the story threads that are still open.",
|
|
9437
|
+
sw_tool_list_relationships: "List relationships",
|
|
9438
|
+
sw_tool_list_relationships_hint: "Lets the record keeper see how characters stand with each other.",
|
|
9439
|
+
sw_tool_list_items: "List things",
|
|
9440
|
+
sw_tool_list_items_hint: "Lets the record keeper see the things in the story and where they are."
|
|
7680
9441
|
},
|
|
7681
9442
|
zh: {
|
|
7682
9443
|
sw_title: "工具",
|
|
@@ -7698,7 +9459,21 @@ window.__ModuleLoader__.load({
|
|
|
7698
9459
|
sw_tool_roll_dice: "掷骰子",
|
|
7699
9460
|
sw_tool_roll_dice_hint: "为没有检定的事掷普通骰子(2d6+1、d100),不让任何数字被编造。",
|
|
7700
9461
|
sw_tool_list_checks: "列出检定",
|
|
7701
|
-
sw_tool_list_checks_hint: "显示世界的检定以及各自的使用场合。"
|
|
9462
|
+
sw_tool_list_checks_hint: "显示世界的检定以及各自的使用场合。",
|
|
9463
|
+
sw_tool_recall_my_memories: "回忆往事",
|
|
9464
|
+
sw_tool_recall_my_memories_hint: "当场景提到简报中没有的内容时,角色可以查阅自己记得的事。",
|
|
9465
|
+
sw_tool_recall_my_known_entities: "回忆所知的地点与事物",
|
|
9466
|
+
sw_tool_recall_my_known_entities_hint: "角色可以查阅自己知道的地点、物品和人物。",
|
|
9467
|
+
sw_tool_recall_my_lore: "回忆典故",
|
|
9468
|
+
sw_tool_recall_my_lore_hint: "角色可以阅读自己明确知道的设定。",
|
|
9469
|
+
sw_tool_search_events: "搜索事件",
|
|
9470
|
+
sw_tool_search_events_hint: "记录员在写入前可以搜索已经发生的事。",
|
|
9471
|
+
sw_tool_list_threads: "列出未了线索",
|
|
9472
|
+
sw_tool_list_threads_hint: "记录员可以查看仍未了结的故事线索。",
|
|
9473
|
+
sw_tool_list_relationships: "列出关系",
|
|
9474
|
+
sw_tool_list_relationships_hint: "记录员可以查看角色之间的关系。",
|
|
9475
|
+
sw_tool_list_items: "列出物品",
|
|
9476
|
+
sw_tool_list_items_hint: "记录员可以查看故事中的物品及其位置。"
|
|
7702
9477
|
}
|
|
7703
9478
|
};
|
|
7704
9479
|
//#endregion
|
|
@@ -7860,6 +9635,8 @@ window.__ModuleLoader__.load({
|
|
|
7860
9635
|
variableVisibility_public: "Anyone present",
|
|
7861
9636
|
variableVisibility_private: "Only itself",
|
|
7862
9637
|
variableVisibility_hidden: "Nobody (game master only)",
|
|
9638
|
+
infoAlternateFor: "For",
|
|
9639
|
+
infoAlternateAny: "Any character",
|
|
7863
9640
|
infoAlternates: "Other openings",
|
|
7864
9641
|
infoAlternatesHelp: "Other ways the story can begin. The player picks one when starting a session; each is one narration, shown instead of the opening message.",
|
|
7865
9642
|
infoAlternateTitle: "Title",
|
|
@@ -7923,6 +9700,12 @@ window.__ModuleLoader__.load({
|
|
|
7923
9700
|
portraitFailed: "Could not generate portrait: {message}",
|
|
7924
9701
|
portraitSaveFirst: "Save the visual identity before generating.",
|
|
7925
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.",
|
|
7926
9709
|
playable: "Playable",
|
|
7927
9710
|
npc: "Character",
|
|
7928
9711
|
principal: "Principal",
|
|
@@ -8133,6 +9916,8 @@ window.__ModuleLoader__.load({
|
|
|
8133
9916
|
variableVisibility_public: "在场者皆可",
|
|
8134
9917
|
variableVisibility_private: "仅自己",
|
|
8135
9918
|
variableVisibility_hidden: "无人(仅主持人)",
|
|
9919
|
+
infoAlternateFor: "适用于",
|
|
9920
|
+
infoAlternateAny: "任何角色",
|
|
8136
9921
|
infoAlternates: "其他开场",
|
|
8137
9922
|
infoAlternatesHelp: "故事的其他开始方式。玩家开始会话时选择其一;每个都是一段叙述,会代替开场白显示。",
|
|
8138
9923
|
infoAlternateTitle: "标题",
|
|
@@ -8196,6 +9981,12 @@ window.__ModuleLoader__.load({
|
|
|
8196
9981
|
portraitFailed: "无法生成肖像:{message}",
|
|
8197
9982
|
portraitSaveFirst: "请先保存视觉身份。",
|
|
8198
9983
|
portraitIdentityRequired: "请先添加并保存视觉身份,再生成肖像。",
|
|
9984
|
+
imageMissing: "暂无图片",
|
|
9985
|
+
imageUpload: "上传 PNG 图片",
|
|
9986
|
+
imageGenerate: "生成图片",
|
|
9987
|
+
imageRetry: "重新生成图片",
|
|
9988
|
+
imageFailed: "无法生成图片:{message}",
|
|
9989
|
+
imageIdentityRequired: "请先添加并保存视觉身份,再生成图片;不添加也可以直接上传 PNG。",
|
|
8199
9990
|
playable: "可扮演",
|
|
8200
9991
|
npc: "角色",
|
|
8201
9992
|
principal: "主要",
|
|
@@ -8372,6 +10163,18 @@ window.__ModuleLoader__.load({
|
|
|
8372
10163
|
all: "all of: {parts}",
|
|
8373
10164
|
any: "any of: {parts}",
|
|
8374
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…",
|
|
8375
10178
|
edit: "changes the story’s records ({events} event(s))",
|
|
8376
10179
|
beat: "tells the game master: “{text}”",
|
|
8377
10180
|
cue: "{audience} notice: “{text}”",
|
|
@@ -8422,6 +10225,18 @@ window.__ModuleLoader__.load({
|
|
|
8422
10225
|
all: "以下全部成立:{parts}",
|
|
8423
10226
|
any: "以下任一成立:{parts}",
|
|
8424
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: "正在保存…",
|
|
8425
10240
|
edit: "修改故事记录({events} 个事件)",
|
|
8426
10241
|
beat: "告诉游戏主持人:“{text}”",
|
|
8427
10242
|
cue: "{audience}察觉:“{text}”",
|
|
@@ -8431,8 +10246,25 @@ window.__ModuleLoader__.load({
|
|
|
8431
10246
|
}
|
|
8432
10247
|
}, "trig_")), prefixed({
|
|
8433
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.",
|
|
8434
10266
|
title: "Interface",
|
|
8435
|
-
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.",
|
|
8436
10268
|
none: "This world carries no interface pack.",
|
|
8437
10269
|
loading: "Reading the packs…",
|
|
8438
10270
|
loadFailed: "Could not read the packs: {message}",
|
|
@@ -8468,8 +10300,25 @@ window.__ModuleLoader__.load({
|
|
|
8468
10300
|
noSurfaces: "The pack has no surface to preview."
|
|
8469
10301
|
},
|
|
8470
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: "文件按原样写入,并像开始故事时那样检查界面包。",
|
|
8471
10320
|
title: "界面",
|
|
8472
|
-
help: "这个世界携带的界面包:放在它 ui
|
|
10321
|
+
help: "这个世界携带的界面包:放在它 ui 文件夹里的文件,可以改变故事的外观并添加自己的界面。可以在这里编辑界面包的文本文件,也可以让创作助手来创建或修改。由这个世界开始的故事在开始时会得到一份拷贝,有问题的界面包会使故事无法开始。",
|
|
8473
10322
|
none: "这个世界没有携带界面包。",
|
|
8474
10323
|
loading: "正在读取界面包…",
|
|
8475
10324
|
loadFailed: "无法读取界面包:{message}",
|
|
@@ -8652,16 +10501,6 @@ window.__ModuleLoader__.load({
|
|
|
8652
10501
|
inject: () => avatars.inject()
|
|
8653
10502
|
}, AvatarsPage));
|
|
8654
10503
|
}
|
|
8655
|
-
//#endregion
|
|
8656
|
-
//#region src/client/chat/open-chat.ts
|
|
8657
|
-
/** Resolves the workspace service on use, so a client without it fails at the click, not at load. */
|
|
8658
|
-
function createChatOpener(ctx) {
|
|
8659
|
-
return (chatSessionId) => {
|
|
8660
|
-
const workspace = ctx.get("uiWorkspace");
|
|
8661
|
-
if (workspace === void 0) throw new Error("the chat is not available in this client");
|
|
8662
|
-
workspace.openSession(chatSessionId);
|
|
8663
|
-
};
|
|
8664
|
-
}
|
|
8665
10504
|
/** Page by what fits on screen, but never below the minimum page. */
|
|
8666
10505
|
function pagingFor(fit) {
|
|
8667
10506
|
return fit >= 10 ? {
|
|
@@ -8682,16 +10521,16 @@ window.__ModuleLoader__.load({
|
|
|
8682
10521
|
}
|
|
8683
10522
|
//#endregion
|
|
8684
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
|
|
8685
|
-
const css$
|
|
8686
|
-
const key$
|
|
8687
|
-
let tag$
|
|
8688
|
-
if (tag$
|
|
8689
|
-
tag$
|
|
8690
|
-
tag$
|
|
8691
|
-
tag$
|
|
8692
|
-
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);
|
|
8693
10532
|
}
|
|
8694
|
-
tag$
|
|
10533
|
+
tag$17.textContent = css$17;
|
|
8695
10534
|
var Pager_module_css_default = {
|
|
8696
10535
|
"position": "rp_KBAD0W_position",
|
|
8697
10536
|
"pager": "rp_KBAD0W_pager"
|
|
@@ -8729,16 +10568,16 @@ window.__ModuleLoader__.load({
|
|
|
8729
10568
|
}
|
|
8730
10569
|
//#endregion
|
|
8731
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
|
|
8732
|
-
const css$
|
|
8733
|
-
const key$
|
|
8734
|
-
let tag$
|
|
8735
|
-
if (tag$
|
|
8736
|
-
tag$
|
|
8737
|
-
tag$
|
|
8738
|
-
tag$
|
|
8739
|
-
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);
|
|
8740
10579
|
}
|
|
8741
|
-
tag$
|
|
10580
|
+
tag$16.textContent = css$16;
|
|
8742
10581
|
var ProblemList_module_css_default = { "problems": "rp_LZh3Iq_problems" };
|
|
8743
10582
|
//#endregion
|
|
8744
10583
|
//#region src/client/widgets/problem-list/ProblemList.tsx
|
|
@@ -8754,22 +10593,22 @@ window.__ModuleLoader__.load({
|
|
|
8754
10593
|
] }, `${problem.path}:${problem.message}`)) })]
|
|
8755
10594
|
});
|
|
8756
10595
|
}
|
|
8757
|
-
//#endregion
|
|
8758
|
-
//#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
|
|
8759
|
-
const css$
|
|
8760
|
-
const key$
|
|
8761
|
-
let tag$
|
|
8762
|
-
if (tag$
|
|
8763
|
-
tag$
|
|
8764
|
-
tag$
|
|
8765
|
-
tag$
|
|
8766
|
-
document.head.appendChild(tag$
|
|
8767
|
-
}
|
|
8768
|
-
tag$
|
|
10596
|
+
//#endregion
|
|
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
|
|
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);
|
|
10606
|
+
}
|
|
10607
|
+
tag$15.textContent = css$15;
|
|
8769
10608
|
var DeleteSessionDialog_module_css_default = {
|
|
8770
10609
|
"error": "rp_FifHrW_error",
|
|
8771
|
-
"warning": "rp_FifHrW_warning",
|
|
8772
10610
|
"question": "rp_FifHrW_question",
|
|
10611
|
+
"warning": "rp_FifHrW_warning",
|
|
8773
10612
|
"body": "rp_FifHrW_body"
|
|
8774
10613
|
};
|
|
8775
10614
|
//#endregion
|
|
@@ -8866,39 +10705,39 @@ window.__ModuleLoader__.load({
|
|
|
8866
10705
|
}
|
|
8867
10706
|
//#endregion
|
|
8868
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
|
|
8869
|
-
const css$
|
|
8870
|
-
const key$
|
|
8871
|
-
let tag$
|
|
8872
|
-
if (tag$
|
|
8873
|
-
tag$
|
|
8874
|
-
tag$
|
|
8875
|
-
tag$
|
|
8876
|
-
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);
|
|
8877
10716
|
}
|
|
8878
|
-
tag$
|
|
10717
|
+
tag$14.textContent = css$14;
|
|
8879
10718
|
var SessionsPage_module_css_default = {
|
|
8880
|
-
"turnsColumn": "rp_24z4eW_turnsColumn",
|
|
8881
|
-
"nameColumn": "rp_24z4eW_nameColumn",
|
|
8882
|
-
"archived": "rp_24z4eW_archived",
|
|
8883
|
-
"notice": "rp_24z4eW_notice",
|
|
8884
|
-
"actionsColumn": "rp_24z4eW_actionsColumn",
|
|
8885
|
-
"actions": "rp_24z4eW_actions",
|
|
8886
|
-
"spinning": "rp_24z4eW_spinning",
|
|
8887
|
-
"toolbar": "rp_24z4eW_toolbar",
|
|
8888
|
-
"table": "rp_24z4eW_table",
|
|
8889
|
-
"viewport": "rp_24z4eW_viewport",
|
|
8890
10719
|
"fits": "rp_24z4eW_fits",
|
|
10720
|
+
"table": "rp_24z4eW_table",
|
|
10721
|
+
"spinning": "rp_24z4eW_spinning",
|
|
10722
|
+
"actions": "rp_24z4eW_actions",
|
|
10723
|
+
"nameColumn": "rp_24z4eW_nameColumn",
|
|
10724
|
+
"turnsColumn": "rp_24z4eW_turnsColumn",
|
|
8891
10725
|
"timeColumn": "rp_24z4eW_timeColumn",
|
|
8892
10726
|
"scrolls": "rp_24z4eW_scrolls",
|
|
8893
|
-
"badge": "rp_24z4eW_badge",
|
|
8894
|
-
"page": "rp_24z4eW_page",
|
|
8895
10727
|
"worldColumn": "rp_24z4eW_worldColumn",
|
|
8896
|
-
"
|
|
8897
|
-
"
|
|
8898
|
-
"
|
|
10728
|
+
"notice": "rp_24z4eW_notice",
|
|
10729
|
+
"message": "rp_24z4eW_message",
|
|
10730
|
+
"actionsColumn": "rp_24z4eW_actionsColumn",
|
|
8899
10731
|
"spin": "rp_24z4eW_spin",
|
|
10732
|
+
"viewport": "rp_24z4eW_viewport",
|
|
10733
|
+
"archived": "rp_24z4eW_archived",
|
|
10734
|
+
"count": "rp_24z4eW_count",
|
|
8900
10735
|
"number": "rp_24z4eW_number",
|
|
8901
|
-
"
|
|
10736
|
+
"name": "rp_24z4eW_name",
|
|
10737
|
+
"secondary": "rp_24z4eW_secondary",
|
|
10738
|
+
"toolbar": "rp_24z4eW_toolbar",
|
|
10739
|
+
"badge": "rp_24z4eW_badge",
|
|
10740
|
+
"page": "rp_24z4eW_page"
|
|
8902
10741
|
};
|
|
8903
10742
|
//#endregion
|
|
8904
10743
|
//#region src/client/pages/sessions/SessionsPage.tsx
|
|
@@ -9403,27 +11242,27 @@ window.__ModuleLoader__.load({
|
|
|
9403
11242
|
}
|
|
9404
11243
|
//#endregion
|
|
9405
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
|
|
9406
|
-
const css$
|
|
9407
|
-
const key$
|
|
9408
|
-
let tag$
|
|
9409
|
-
if (tag$
|
|
9410
|
-
tag$
|
|
9411
|
-
tag$
|
|
9412
|
-
tag$
|
|
9413
|
-
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);
|
|
9414
11253
|
}
|
|
9415
|
-
tag$
|
|
11254
|
+
tag$13.textContent = css$13;
|
|
9416
11255
|
var WorldCard_module_css_default = {
|
|
9417
|
-
"placeholder": "rp_Bvxx5q_placeholder",
|
|
9418
|
-
"play": "rp_Bvxx5q_play",
|
|
9419
|
-
"openButton": "rp_Bvxx5q_openButton",
|
|
9420
|
-
"image": "rp_Bvxx5q_image",
|
|
9421
11256
|
"tag": "rp_Bvxx5q_tag",
|
|
9422
|
-
"cover": "rp_Bvxx5q_cover",
|
|
9423
11257
|
"card": "rp_Bvxx5q_card",
|
|
9424
|
-
"tags": "rp_Bvxx5q_tags",
|
|
9425
11258
|
"info": "rp_Bvxx5q_info",
|
|
9426
|
-
"
|
|
11259
|
+
"tags": "rp_Bvxx5q_tags",
|
|
11260
|
+
"name": "rp_Bvxx5q_name",
|
|
11261
|
+
"cover": "rp_Bvxx5q_cover",
|
|
11262
|
+
"openButton": "rp_Bvxx5q_openButton",
|
|
11263
|
+
"play": "rp_Bvxx5q_play",
|
|
11264
|
+
"placeholder": "rp_Bvxx5q_placeholder",
|
|
11265
|
+
"image": "rp_Bvxx5q_image"
|
|
9427
11266
|
};
|
|
9428
11267
|
//#endregion
|
|
9429
11268
|
//#region src/client/widgets/world-card/WorldCard.tsx
|
|
@@ -9506,21 +11345,21 @@ window.__ModuleLoader__.load({
|
|
|
9506
11345
|
}
|
|
9507
11346
|
//#endregion
|
|
9508
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
|
|
9509
|
-
const css$
|
|
9510
|
-
const key$
|
|
9511
|
-
let tag$
|
|
9512
|
-
if (tag$
|
|
9513
|
-
tag$
|
|
9514
|
-
tag$
|
|
9515
|
-
tag$
|
|
9516
|
-
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);
|
|
9517
11356
|
}
|
|
9518
|
-
tag$
|
|
11357
|
+
tag$12.textContent = css$12;
|
|
9519
11358
|
var AvatarChoices_module_css_default = {
|
|
9520
|
-
"summary": "rp_YCstOG_summary",
|
|
9521
11359
|
"text": "rp_YCstOG_text",
|
|
9522
|
-
"
|
|
9523
|
-
"
|
|
11360
|
+
"name": "rp_YCstOG_name",
|
|
11361
|
+
"summary": "rp_YCstOG_summary",
|
|
11362
|
+
"option": "rp_YCstOG_option"
|
|
9524
11363
|
};
|
|
9525
11364
|
//#endregion
|
|
9526
11365
|
//#region src/client/widgets/avatar-choices/AvatarChoices.tsx
|
|
@@ -9549,29 +11388,29 @@ window.__ModuleLoader__.load({
|
|
|
9549
11388
|
}
|
|
9550
11389
|
//#endregion
|
|
9551
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
|
|
9552
|
-
const css$
|
|
9553
|
-
const key$
|
|
9554
|
-
let tag$
|
|
9555
|
-
if (tag$
|
|
9556
|
-
tag$
|
|
9557
|
-
tag$
|
|
9558
|
-
tag$
|
|
9559
|
-
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);
|
|
9560
11399
|
}
|
|
9561
|
-
tag$
|
|
11400
|
+
tag$11.textContent = css$11;
|
|
9562
11401
|
var StartSessionDialog_module_css_default = {
|
|
9563
|
-
"
|
|
11402
|
+
"optionName": "rp_AnbLKG_optionName",
|
|
9564
11403
|
"advancedToggle": "rp_AnbLKG_advancedToggle",
|
|
9565
|
-
"
|
|
9566
|
-
"
|
|
11404
|
+
"error": "rp_AnbLKG_error",
|
|
11405
|
+
"field": "rp_AnbLKG_field",
|
|
9567
11406
|
"label": "rp_AnbLKG_label",
|
|
9568
|
-
"
|
|
9569
|
-
"advancedBody": "rp_AnbLKG_advancedBody",
|
|
11407
|
+
"optionSummary": "rp_AnbLKG_optionSummary",
|
|
9570
11408
|
"optionText": "rp_AnbLKG_optionText",
|
|
9571
|
-
"
|
|
11409
|
+
"message": "rp_AnbLKG_message",
|
|
11410
|
+
"option": "rp_AnbLKG_option",
|
|
9572
11411
|
"advanced": "rp_AnbLKG_advanced",
|
|
9573
|
-
"
|
|
9574
|
-
"
|
|
11412
|
+
"form": "rp_AnbLKG_form",
|
|
11413
|
+
"advancedBody": "rp_AnbLKG_advancedBody"
|
|
9575
11414
|
};
|
|
9576
11415
|
//#endregion
|
|
9577
11416
|
//#region src/client/pages/worlds/AddAvatarsDialog.tsx
|
|
@@ -10433,25 +12272,25 @@ window.__ModuleLoader__.load({
|
|
|
10433
12272
|
}
|
|
10434
12273
|
//#endregion
|
|
10435
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
|
|
10436
|
-
const css$
|
|
10437
|
-
const key$
|
|
10438
|
-
let tag$
|
|
10439
|
-
if (tag$
|
|
10440
|
-
tag$
|
|
10441
|
-
tag$
|
|
10442
|
-
tag$
|
|
10443
|
-
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);
|
|
10444
12283
|
}
|
|
10445
|
-
tag$
|
|
12284
|
+
tag$10.textContent = css$10;
|
|
10446
12285
|
var SettingsFields_module_css_default = {
|
|
12286
|
+
"group": "rp_Rhi3yq_group",
|
|
10447
12287
|
"row": "rp_Rhi3yq_row",
|
|
10448
|
-
"
|
|
12288
|
+
"field": "rp_Rhi3yq_field",
|
|
10449
12289
|
"error": "rp_Rhi3yq_error",
|
|
12290
|
+
"groupTitle": "rp_Rhi3yq_groupTitle",
|
|
12291
|
+
"label": "rp_Rhi3yq_label",
|
|
10450
12292
|
"help": "rp_Rhi3yq_help",
|
|
10451
|
-
"
|
|
10452
|
-
"area": "rp_Rhi3yq_area",
|
|
10453
|
-
"group": "rp_Rhi3yq_group",
|
|
10454
|
-
"groupTitle": "rp_Rhi3yq_groupTitle"
|
|
12293
|
+
"area": "rp_Rhi3yq_area"
|
|
10455
12294
|
};
|
|
10456
12295
|
//#endregion
|
|
10457
12296
|
//#region src/client/settings-form/SettingsFields.tsx
|
|
@@ -10650,6 +12489,18 @@ window.__ModuleLoader__.load({
|
|
|
10650
12489
|
body: file
|
|
10651
12490
|
}));
|
|
10652
12491
|
}
|
|
12492
|
+
/** Sends a narration preset to a world, which has its authoring chat turn it into the world's prose prompts. */
|
|
12493
|
+
async function uploadPreset(worldId, file, language) {
|
|
12494
|
+
return await answer$1(await fetch(`${API_PREFIX}/worlds/import/preset?id=${encodeURIComponent(worldId)}&language=${encodeURIComponent(language)}`, {
|
|
12495
|
+
method: "POST",
|
|
12496
|
+
credentials: "same-origin",
|
|
12497
|
+
headers: {
|
|
12498
|
+
"x-file-name": encodeURIComponent(file.name),
|
|
12499
|
+
"content-type": "application/json"
|
|
12500
|
+
},
|
|
12501
|
+
body: file
|
|
12502
|
+
}));
|
|
12503
|
+
}
|
|
10653
12504
|
async function startImport(id, choices, language) {
|
|
10654
12505
|
return await answer$1(await fetch(`${API_PREFIX}/worlds/import/start?id=${encodeURIComponent(id)}`, {
|
|
10655
12506
|
method: "POST",
|
|
@@ -10695,19 +12546,19 @@ window.__ModuleLoader__.load({
|
|
|
10695
12546
|
const storyLanguageOf = (code) => code.trim().toLowerCase().startsWith("zh") ? "zh" : "en";
|
|
10696
12547
|
//#endregion
|
|
10697
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
|
|
10698
|
-
const css$
|
|
10699
|
-
const key$
|
|
10700
|
-
let tag$
|
|
10701
|
-
if (tag$
|
|
10702
|
-
tag$
|
|
10703
|
-
tag$
|
|
10704
|
-
tag$
|
|
10705
|
-
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);
|
|
10706
12557
|
}
|
|
10707
|
-
tag$
|
|
12558
|
+
tag$9.textContent = css$9;
|
|
10708
12559
|
var TranslateBanner_module_css_default = {
|
|
10709
|
-
"error": "rp_Lx8vJa_error",
|
|
10710
12560
|
"banner": "rp_Lx8vJa_banner",
|
|
12561
|
+
"error": "rp_Lx8vJa_error",
|
|
10711
12562
|
"text": "rp_Lx8vJa_text"
|
|
10712
12563
|
};
|
|
10713
12564
|
//#endregion
|
|
@@ -10793,6 +12644,8 @@ window.__ModuleLoader__.load({
|
|
|
10793
12644
|
summary: avatar.summary
|
|
10794
12645
|
}))];
|
|
10795
12646
|
const selected = players.find((player) => player.value === choice)?.value ?? players[0]?.value;
|
|
12647
|
+
const chosenOpening = opening === "" ? void 0 : dialog.openings[Number(opening)];
|
|
12648
|
+
const openingValid = chosenOpening !== void 0 && (chosenOpening.character === void 0 || chosenOpening.character === selected);
|
|
10796
12649
|
const base = {
|
|
10797
12650
|
...DEFAULT_SETTINGS,
|
|
10798
12651
|
prompts: { language: t("language") }
|
|
@@ -10832,7 +12685,7 @@ window.__ModuleLoader__.load({
|
|
|
10832
12685
|
name,
|
|
10833
12686
|
...selected.startsWith("avatar:") ? { playerAvatar: selected.slice(7) } : { playerCharacterId: selected },
|
|
10834
12687
|
avatars: bringing.map((avatar) => avatar.key),
|
|
10835
|
-
|
|
12688
|
+
...!openingValid ? {} : { opening: Number(opening) },
|
|
10836
12689
|
...startTime.trim() === "" || shown["clock.mode"] === "real" ? {} : { startingTime: startTime.trim() },
|
|
10837
12690
|
settings: fromDrafts(base, shown, options)
|
|
10838
12691
|
});
|
|
@@ -10904,13 +12757,13 @@ window.__ModuleLoader__.load({
|
|
|
10904
12757
|
}, player.value))
|
|
10905
12758
|
]
|
|
10906
12759
|
}),
|
|
10907
|
-
dialog.status === "ready" && dialog.openings.
|
|
12760
|
+
dialog.status === "ready" && dialog.openings.some((entry) => entry.character === void 0 || entry.character === selected) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
10908
12761
|
className: StartSessionDialog_module_css_default.field,
|
|
10909
12762
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10910
12763
|
className: StartSessionDialog_module_css_default.label,
|
|
10911
12764
|
children: t("startOpening")
|
|
10912
12765
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
10913
|
-
value: opening,
|
|
12766
|
+
value: openingValid ? opening : "",
|
|
10914
12767
|
disabled: dialog.submitting,
|
|
10915
12768
|
onChange: (event) => {
|
|
10916
12769
|
setOpening(event.target.value);
|
|
@@ -10918,10 +12771,10 @@ window.__ModuleLoader__.load({
|
|
|
10918
12771
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
10919
12772
|
value: "",
|
|
10920
12773
|
children: t("startOpeningDefault")
|
|
10921
|
-
}), dialog.openings.
|
|
12774
|
+
}), dialog.openings.flatMap((entry, index) => entry.character === void 0 || entry.character === selected ? [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
10922
12775
|
value: String(index),
|
|
10923
|
-
children: title
|
|
10924
|
-
}, index))]
|
|
12776
|
+
children: entry.title
|
|
12777
|
+
}, index)] : [])]
|
|
10925
12778
|
})]
|
|
10926
12779
|
}),
|
|
10927
12780
|
dialog.status === "ready" && shown["clock.mode"] !== "real" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
@@ -11170,36 +13023,36 @@ window.__ModuleLoader__.load({
|
|
|
11170
13023
|
}
|
|
11171
13024
|
//#endregion
|
|
11172
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
|
|
11173
|
-
const css$
|
|
11174
|
-
const key$
|
|
11175
|
-
let tag$
|
|
11176
|
-
if (tag$
|
|
11177
|
-
tag$
|
|
11178
|
-
tag$
|
|
11179
|
-
tag$
|
|
11180
|
-
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);
|
|
11181
13034
|
}
|
|
11182
|
-
tag$
|
|
13035
|
+
tag$8.textContent = css$8;
|
|
11183
13036
|
var WorldsPage_module_css_default = {
|
|
11184
|
-
"
|
|
13037
|
+
"toolbar": "rp_FHUyRq_toolbar",
|
|
13038
|
+
"viewport": "rp_FHUyRq_viewport",
|
|
13039
|
+
"fits": "rp_FHUyRq_fits",
|
|
11185
13040
|
"toolbarActions": "rp_FHUyRq_toolbarActions",
|
|
11186
|
-
"count": "rp_FHUyRq_count",
|
|
11187
13041
|
"spin": "rp_FHUyRq_spin",
|
|
11188
|
-
"
|
|
11189
|
-
"
|
|
11190
|
-
"
|
|
13042
|
+
"notice": "rp_FHUyRq_notice",
|
|
13043
|
+
"count": "rp_FHUyRq_count",
|
|
13044
|
+
"grid": "rp_FHUyRq_grid",
|
|
11191
13045
|
"editHeader": "rp_FHUyRq_editHeader",
|
|
13046
|
+
"starter": "rp_FHUyRq_starter",
|
|
11192
13047
|
"message": "rp_FHUyRq_message",
|
|
11193
|
-
"
|
|
11194
|
-
"starters": "rp_FHUyRq_starters",
|
|
13048
|
+
"authorButton": "rp_FHUyRq_authorButton",
|
|
11195
13049
|
"editTitle": "rp_FHUyRq_editTitle",
|
|
11196
|
-
"spinning": "rp_FHUyRq_spinning",
|
|
11197
|
-
"page": "rp_FHUyRq_page",
|
|
11198
|
-
"notice": "rp_FHUyRq_notice",
|
|
11199
|
-
"grid": "rp_FHUyRq_grid",
|
|
11200
13050
|
"editBody": "rp_FHUyRq_editBody",
|
|
11201
|
-
"
|
|
11202
|
-
"
|
|
13051
|
+
"scrolls": "rp_FHUyRq_scrolls",
|
|
13052
|
+
"starters": "rp_FHUyRq_starters",
|
|
13053
|
+
"spinning": "rp_FHUyRq_spinning",
|
|
13054
|
+
"cell": "rp_FHUyRq_cell",
|
|
13055
|
+
"page": "rp_FHUyRq_page"
|
|
11203
13056
|
};
|
|
11204
13057
|
//#endregion
|
|
11205
13058
|
//#region src/client/pages/worlds/StarterWorlds.tsx
|
|
@@ -11258,45 +13111,45 @@ window.__ModuleLoader__.load({
|
|
|
11258
13111
|
}
|
|
11259
13112
|
//#endregion
|
|
11260
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
|
|
11261
|
-
const css$
|
|
11262
|
-
const key$
|
|
11263
|
-
let tag$
|
|
11264
|
-
if (tag$
|
|
11265
|
-
tag$
|
|
11266
|
-
tag$
|
|
11267
|
-
tag$
|
|
11268
|
-
document.head.appendChild(tag$
|
|
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);
|
|
11269
13122
|
}
|
|
11270
|
-
tag$
|
|
13123
|
+
tag$7.textContent = css$7;
|
|
11271
13124
|
var ImportCardPage_module_css_default = {
|
|
11272
|
-
"
|
|
13125
|
+
"tags": "rp_DmG_oG_tags",
|
|
13126
|
+
"fieldMeta": "rp_DmG_oG_fieldMeta",
|
|
13127
|
+
"about": "rp_DmG_oG_about",
|
|
11273
13128
|
"fieldHead": "rp_DmG_oG_fieldHead",
|
|
13129
|
+
"row": "rp_DmG_oG_row",
|
|
11274
13130
|
"entryHead": "rp_DmG_oG_entryHead",
|
|
13131
|
+
"section": "rp_DmG_oG_section",
|
|
13132
|
+
"header": "rp_DmG_oG_header",
|
|
13133
|
+
"label": "rp_DmG_oG_label",
|
|
13134
|
+
"field": "rp_DmG_oG_field",
|
|
13135
|
+
"entryTitle": "rp_DmG_oG_entryTitle",
|
|
11275
13136
|
"text": "rp_DmG_oG_text",
|
|
13137
|
+
"choiceText": "rp_DmG_oG_choiceText",
|
|
11276
13138
|
"page": "rp_DmG_oG_page",
|
|
11277
13139
|
"space": "rp_DmG_oG_space",
|
|
11278
|
-
"
|
|
11279
|
-
"
|
|
11280
|
-
"entryTitle": "rp_DmG_oG_entryTitle",
|
|
11281
|
-
"fieldMeta": "rp_DmG_oG_fieldMeta",
|
|
11282
|
-
"tags": "rp_DmG_oG_tags",
|
|
11283
|
-
"note": "rp_DmG_oG_note",
|
|
11284
|
-
"noPicture": "rp_DmG_oG_noPicture",
|
|
13140
|
+
"title": "rp_DmG_oG_title",
|
|
13141
|
+
"preview": "rp_DmG_oG_preview",
|
|
11285
13142
|
"entryOff": "rp_DmG_oG_entryOff",
|
|
11286
13143
|
"error": "rp_DmG_oG_error",
|
|
11287
|
-
"
|
|
11288
|
-
"choice": "rp_DmG_oG_choice",
|
|
11289
|
-
"choiceText": "rp_DmG_oG_choiceText",
|
|
11290
|
-
"body": "rp_DmG_oG_body",
|
|
11291
|
-
"top": "rp_DmG_oG_top",
|
|
11292
|
-
"header": "rp_DmG_oG_header",
|
|
11293
|
-
"title": "rp_DmG_oG_title",
|
|
11294
|
-
"section": "rp_DmG_oG_section",
|
|
11295
|
-
"about": "rp_DmG_oG_about",
|
|
13144
|
+
"note": "rp_DmG_oG_note",
|
|
11296
13145
|
"heading": "rp_DmG_oG_heading",
|
|
11297
|
-
"
|
|
11298
|
-
"
|
|
11299
|
-
"
|
|
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"
|
|
11300
13153
|
};
|
|
11301
13154
|
//#endregion
|
|
11302
13155
|
//#region src/client/pages/worlds/ImportCardPage.tsx
|
|
@@ -11652,6 +13505,9 @@ window.__ModuleLoader__.load({
|
|
|
11652
13505
|
const [uploading, setUploading] = (0, react.useState)(false);
|
|
11653
13506
|
const [importNotice, setImportNotice] = (0, react.useState)();
|
|
11654
13507
|
const picker = (0, react.useRef)(null);
|
|
13508
|
+
const presetPicker = (0, react.useRef)(null);
|
|
13509
|
+
const [presetBusy, setPresetBusy] = (0, react.useState)(false);
|
|
13510
|
+
const [presetNotice, setPresetNotice] = (0, react.useState)();
|
|
11655
13511
|
const source = (0, react.useMemo)(() => editing === void 0 ? void 0 : worldSource(editing.id), [editing]);
|
|
11656
13512
|
(0, react.useEffect)(() => {
|
|
11657
13513
|
load();
|
|
@@ -11677,6 +13533,19 @@ window.__ModuleLoader__.load({
|
|
|
11677
13533
|
setImportNotice(t("importUploadFailed", { message: failure instanceof Error ? failure.message : String(failure) }));
|
|
11678
13534
|
});
|
|
11679
13535
|
};
|
|
13536
|
+
const choosePreset = (world, file) => {
|
|
13537
|
+
if (file === void 0) return;
|
|
13538
|
+
setPresetBusy(true);
|
|
13539
|
+
setPresetNotice(void 0);
|
|
13540
|
+
uploadPreset(world, file, t("language")).then((opened) => {
|
|
13541
|
+
setPresetBusy(false);
|
|
13542
|
+
if (!opened.started) setPresetNotice(t("presetNotStarted", { message: opened.failure ?? "" }));
|
|
13543
|
+
openChat(opened.chatSessionId);
|
|
13544
|
+
}, (failure) => {
|
|
13545
|
+
setPresetBusy(false);
|
|
13546
|
+
setPresetNotice(t("presetFailed", { message: failure instanceof Error ? failure.message : String(failure) }));
|
|
13547
|
+
});
|
|
13548
|
+
};
|
|
11680
13549
|
if (importing !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11681
13550
|
className: WorldsPage_module_css_default.page,
|
|
11682
13551
|
"data-testid": "roleplay-world-import",
|
|
@@ -11714,8 +13583,28 @@ window.__ModuleLoader__.load({
|
|
|
11714
13583
|
className: WorldsPage_module_css_default.editTitle,
|
|
11715
13584
|
children: editing.name
|
|
11716
13585
|
}),
|
|
13586
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
13587
|
+
ref: presetPicker,
|
|
13588
|
+
type: "file",
|
|
13589
|
+
accept: ".json,application/json",
|
|
13590
|
+
hidden: true,
|
|
13591
|
+
"data-testid": "roleplay-preset-input",
|
|
13592
|
+
onChange: (event) => {
|
|
13593
|
+
choosePreset(editing.id, event.target.files?.[0]);
|
|
13594
|
+
event.target.value = "";
|
|
13595
|
+
}
|
|
13596
|
+
}),
|
|
11717
13597
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11718
13598
|
className: WorldsPage_module_css_default.authorButton,
|
|
13599
|
+
variant: "outline",
|
|
13600
|
+
size: "sm",
|
|
13601
|
+
disabled: presetBusy,
|
|
13602
|
+
onClick: () => {
|
|
13603
|
+
presetPicker.current?.click();
|
|
13604
|
+
},
|
|
13605
|
+
children: presetBusy ? t("presetOpening") : t("importPreset")
|
|
13606
|
+
}),
|
|
13607
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
11719
13608
|
variant: "outline",
|
|
11720
13609
|
size: "sm",
|
|
11721
13610
|
onClick: () => {
|
|
@@ -11739,6 +13628,11 @@ window.__ModuleLoader__.load({
|
|
|
11739
13628
|
role: "alert",
|
|
11740
13629
|
children: t("authorWorldFailed", { message: state.authoring.error })
|
|
11741
13630
|
}),
|
|
13631
|
+
presetNotice !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
13632
|
+
className: WorldsPage_module_css_default.notice,
|
|
13633
|
+
role: "alert",
|
|
13634
|
+
children: presetNotice
|
|
13635
|
+
}),
|
|
11742
13636
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TranslateBanner, {
|
|
11743
13637
|
t,
|
|
11744
13638
|
worldId: editing.id,
|
|
@@ -12309,6 +14203,10 @@ window.__ModuleLoader__.load({
|
|
|
12309
14203
|
worldFolderHelp: "A new folder directly inside the roleplay worlds directory.",
|
|
12310
14204
|
worldName: "World name",
|
|
12311
14205
|
createWorldFailed: "Could not create the world: {message}",
|
|
14206
|
+
importPreset: "Import narration preset",
|
|
14207
|
+
presetOpening: "Opening…",
|
|
14208
|
+
presetFailed: "Could not import the preset: {message}",
|
|
14209
|
+
presetNotStarted: "The authoring chat opened but the preset was not applied: {message}. Ask it to apply the preset you uploaded.",
|
|
12312
14210
|
authorWorld: "Author with AI",
|
|
12313
14211
|
openingAuthor: "Opening…",
|
|
12314
14212
|
authorWorldFailed: "Could not open the authoring chat: {message}",
|
|
@@ -12414,6 +14312,10 @@ window.__ModuleLoader__.load({
|
|
|
12414
14312
|
worldFolderHelp: "将在角色扮演 worlds 目录下直接创建这个文件夹。",
|
|
12415
14313
|
worldName: "世界名称",
|
|
12416
14314
|
createWorldFailed: "无法创建世界:{message}",
|
|
14315
|
+
importPreset: "导入叙述预设",
|
|
14316
|
+
presetOpening: "正在打开…",
|
|
14317
|
+
presetFailed: "无法导入预设:{message}",
|
|
14318
|
+
presetNotStarted: "世界编辑对话已打开,但预设没有应用:{message}。可以请它应用你上传的预设。",
|
|
12417
14319
|
authorWorld: "使用 AI 编辑",
|
|
12418
14320
|
openingAuthor: "正在打开…",
|
|
12419
14321
|
authorWorldFailed: "无法打开世界编辑对话:{message}",
|
|
@@ -12505,8 +14407,9 @@ window.__ModuleLoader__.load({
|
|
|
12505
14407
|
return this.face;
|
|
12506
14408
|
}
|
|
12507
14409
|
async load() {
|
|
12508
|
-
|
|
12509
|
-
|
|
14410
|
+
const { status, refreshing } = this.store.getSnapshot();
|
|
14411
|
+
if (status === "loading" || refreshing) return;
|
|
14412
|
+
if (status === "idle") this.store.update((draft) => {
|
|
12510
14413
|
draft.status = "loading";
|
|
12511
14414
|
});
|
|
12512
14415
|
await this.run("/worlds", {});
|
|
@@ -12784,21 +14687,21 @@ window.__ModuleLoader__.load({
|
|
|
12784
14687
|
};
|
|
12785
14688
|
//#endregion
|
|
12786
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
|
|
12787
|
-
const css$
|
|
12788
|
-
const key$
|
|
12789
|
-
let tag$
|
|
12790
|
-
if (tag$
|
|
12791
|
-
tag$
|
|
12792
|
-
tag$
|
|
12793
|
-
tag$
|
|
12794
|
-
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);
|
|
12795
14698
|
}
|
|
12796
|
-
tag$
|
|
14699
|
+
tag$6.textContent = css$6;
|
|
12797
14700
|
var BranchDialog_module_css_default = {
|
|
12798
|
-
"error": "rp_Dy1TaW_error",
|
|
12799
14701
|
"label": "rp_Dy1TaW_label",
|
|
12800
14702
|
"form": "rp_Dy1TaW_form",
|
|
12801
|
-
"field": "rp_Dy1TaW_field"
|
|
14703
|
+
"field": "rp_Dy1TaW_field",
|
|
14704
|
+
"error": "rp_Dy1TaW_error"
|
|
12802
14705
|
};
|
|
12803
14706
|
//#endregion
|
|
12804
14707
|
//#region src/client/branch/BranchDialog.tsx
|
|
@@ -13256,28 +15159,28 @@ window.__ModuleLoader__.load({
|
|
|
13256
15159
|
}
|
|
13257
15160
|
//#endregion
|
|
13258
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
|
|
13259
|
-
const css$
|
|
13260
|
-
const key$
|
|
13261
|
-
let tag$
|
|
13262
|
-
if (tag$
|
|
13263
|
-
tag$
|
|
13264
|
-
tag$
|
|
13265
|
-
tag$
|
|
13266
|
-
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);
|
|
13267
15170
|
}
|
|
13268
|
-
tag$
|
|
15171
|
+
tag$5.textContent = css$5;
|
|
13269
15172
|
var SidebarPage_module_css_default = {
|
|
13270
|
-
"text": "rp_Ptco8a_text",
|
|
13271
|
-
"name": "rp_Ptco8a_name",
|
|
13272
|
-
"icon": "rp_Ptco8a_icon",
|
|
13273
|
-
"page": "rp_Ptco8a_page",
|
|
13274
|
-
"main": "rp_Ptco8a_main",
|
|
13275
|
-
"content": "rp_Ptco8a_content",
|
|
13276
15173
|
"title": "rp_Ptco8a_title",
|
|
15174
|
+
"page": "rp_Ptco8a_page",
|
|
13277
15175
|
"bar": "rp_Ptco8a_bar",
|
|
15176
|
+
"content": "rp_Ptco8a_content",
|
|
15177
|
+
"main": "rp_Ptco8a_main",
|
|
15178
|
+
"message": "rp_Ptco8a_message",
|
|
15179
|
+
"name": "rp_Ptco8a_name",
|
|
15180
|
+
"text": "rp_Ptco8a_text",
|
|
13278
15181
|
"description": "rp_Ptco8a_description",
|
|
13279
15182
|
"entry": "rp_Ptco8a_entry",
|
|
13280
|
-
"
|
|
15183
|
+
"icon": "rp_Ptco8a_icon"
|
|
13281
15184
|
};
|
|
13282
15185
|
//#endregion
|
|
13283
15186
|
//#region src/client/interface/SidebarPage.tsx
|
|
@@ -13539,7 +15442,9 @@ window.__ModuleLoader__.load({
|
|
|
13539
15442
|
saveNarrationVoice: async (voice, signal) => await put(`${API_PREFIX}/sessions/world/narration-voice?id=${id}`, { voice }, signal),
|
|
13540
15443
|
listVoices: async (signal) => await listVoices(`${API_PREFIX}/speech/voices`, signal),
|
|
13541
15444
|
generatePortrait: async (key, signal) => await post(`${API_PREFIX}/sessions/world/character/portrait?id=${id}&key=${encodeURIComponent(key)}`, signal),
|
|
13542
|
-
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)
|
|
13543
15448
|
};
|
|
13544
15449
|
}
|
|
13545
15450
|
//#endregion
|
|
@@ -13592,37 +15497,37 @@ window.__ModuleLoader__.load({
|
|
|
13592
15497
|
}
|
|
13593
15498
|
//#endregion
|
|
13594
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
|
|
13595
|
-
const css$
|
|
13596
|
-
const key$
|
|
13597
|
-
let tag$
|
|
13598
|
-
if (tag$
|
|
13599
|
-
tag$
|
|
13600
|
-
tag$
|
|
13601
|
-
tag$
|
|
13602
|
-
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);
|
|
13603
15508
|
}
|
|
13604
|
-
tag$
|
|
15509
|
+
tag$4.textContent = css$4;
|
|
13605
15510
|
var ChatSettingsView_module_css_default = {
|
|
15511
|
+
"activity": "rp_wLpbxW_activity",
|
|
15512
|
+
"error": "rp_wLpbxW_error",
|
|
13606
15513
|
"pre": "rp_wLpbxW_pre",
|
|
13607
15514
|
"title": "rp_wLpbxW_title",
|
|
15515
|
+
"help": "rp_wLpbxW_help",
|
|
15516
|
+
"label": "rp_wLpbxW_label",
|
|
15517
|
+
"reasons": "rp_wLpbxW_reasons",
|
|
15518
|
+
"select": "rp_wLpbxW_select",
|
|
15519
|
+
"description": "rp_wLpbxW_description",
|
|
15520
|
+
"saved": "rp_wLpbxW_saved",
|
|
15521
|
+
"list": "rp_wLpbxW_list",
|
|
15522
|
+
"view": "rp_wLpbxW_view",
|
|
13608
15523
|
"field": "rp_wLpbxW_field",
|
|
15524
|
+
"row": "rp_wLpbxW_row",
|
|
13609
15525
|
"link": "rp_wLpbxW_link",
|
|
13610
15526
|
"message": "rp_wLpbxW_message",
|
|
13611
|
-
"table": "rp_wLpbxW_table",
|
|
13612
|
-
"run": "rp_wLpbxW_run",
|
|
13613
|
-
"list": "rp_wLpbxW_list",
|
|
13614
15527
|
"notice": "rp_wLpbxW_notice",
|
|
13615
|
-
"
|
|
13616
|
-
"error": "rp_wLpbxW_error",
|
|
13617
|
-
"help": "rp_wLpbxW_help",
|
|
15528
|
+
"run": "rp_wLpbxW_run",
|
|
13618
15529
|
"actions": "rp_wLpbxW_actions",
|
|
13619
|
-
"
|
|
13620
|
-
"view": "rp_wLpbxW_view",
|
|
13621
|
-
"row": "rp_wLpbxW_row",
|
|
13622
|
-
"activity": "rp_wLpbxW_activity",
|
|
13623
|
-
"reasons": "rp_wLpbxW_reasons",
|
|
13624
|
-
"select": "rp_wLpbxW_select",
|
|
13625
|
-
"description": "rp_wLpbxW_description"
|
|
15530
|
+
"table": "rp_wLpbxW_table"
|
|
13626
15531
|
};
|
|
13627
15532
|
//#endregion
|
|
13628
15533
|
//#region src/client/chat-settings/settings-api.ts
|
|
@@ -13675,6 +15580,22 @@ window.__ModuleLoader__.load({
|
|
|
13675
15580
|
throw new Error(typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim());
|
|
13676
15581
|
}
|
|
13677
15582
|
}
|
|
15583
|
+
/** Opens the session doctor chat of the story, made when it is first asked for. */
|
|
15584
|
+
async function openDoctor(id, title, language, signal) {
|
|
15585
|
+
const response = await fetch(`${API_PREFIX}/sessions/doctor?id=${encodeURIComponent(id)}`, {
|
|
15586
|
+
method: "POST",
|
|
15587
|
+
credentials: "same-origin",
|
|
15588
|
+
headers: { "content-type": "application/json" },
|
|
15589
|
+
body: JSON.stringify({
|
|
15590
|
+
title,
|
|
15591
|
+
language
|
|
15592
|
+
}),
|
|
15593
|
+
signal
|
|
15594
|
+
});
|
|
15595
|
+
const body = await response.json().catch(() => void 0);
|
|
15596
|
+
if (!response.ok || typeof body?.chatSessionId !== "string") throw new Error(typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim());
|
|
15597
|
+
return body.chatSessionId;
|
|
15598
|
+
}
|
|
13678
15599
|
/** What a helper run was told and did; nothing when the run was not kept or has been dropped. */
|
|
13679
15600
|
async function loadRun(id, run, signal) {
|
|
13680
15601
|
const response = await fetch(`${API_PREFIX}/sessions/activity/run?id=${encodeURIComponent(id)}&run=${encodeURIComponent(run)}`, {
|
|
@@ -13970,8 +15891,53 @@ window.__ModuleLoader__.load({
|
|
|
13970
15891
|
});
|
|
13971
15892
|
}
|
|
13972
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
|
|
13973
15902
|
//#region src/client/chat-settings/ActivityList.tsx
|
|
13974
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
|
+
}
|
|
13975
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. */
|
|
13976
15942
|
function ActivityList({ t, session, entries, onRefresh }) {
|
|
13977
15943
|
const shown = entries.slice(-20).reverse();
|
|
@@ -14023,6 +15989,7 @@ window.__ModuleLoader__.load({
|
|
|
14023
15989
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityModel") }),
|
|
14024
15990
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityTook") }),
|
|
14025
15991
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityCalls") }),
|
|
15992
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityTokens") }),
|
|
14026
15993
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityResult") }),
|
|
14027
15994
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {})
|
|
14028
15995
|
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: shown.flatMap((entry) => [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
@@ -14031,6 +15998,7 @@ window.__ModuleLoader__.load({
|
|
|
14031
15998
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.model === "" ? t("activityOwnModel") : entry.model }),
|
|
14032
15999
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: seconds(entry.ms) }),
|
|
14033
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) }),
|
|
14034
16002
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
14035
16003
|
className: entry.error === void 0 ? void 0 : ChatSettingsView_module_css_default.error,
|
|
14036
16004
|
title: entry.error,
|
|
@@ -14045,7 +16013,7 @@ window.__ModuleLoader__.load({
|
|
|
14045
16013
|
children: open?.run === entry.run ? t("runHide") : t("runShow")
|
|
14046
16014
|
}) })
|
|
14047
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", {
|
|
14048
|
-
colSpan:
|
|
16016
|
+
colSpan: 8,
|
|
14049
16017
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RunView, {
|
|
14050
16018
|
t,
|
|
14051
16019
|
detail: open.detail
|
|
@@ -14175,7 +16143,7 @@ window.__ModuleLoader__.load({
|
|
|
14175
16143
|
//#endregion
|
|
14176
16144
|
//#region src/client/chat-settings/ChatSettingsView.tsx
|
|
14177
16145
|
/** The settings of one chat. Ordinary DSH chats have ids of the same shape, so the host decides whether this one is a roleplay session. */
|
|
14178
|
-
function ChatSettingsView({ t, sessionId }) {
|
|
16146
|
+
function ChatSettingsView({ t, sessionId, openChat }) {
|
|
14179
16147
|
const session = roleplaySessionOf(sessionId);
|
|
14180
16148
|
const [load, setLoad] = (0, react.useState)(session === void 0 ? { status: "not-roleplay" } : { status: "loading" });
|
|
14181
16149
|
const [drafts, setDrafts] = (0, react.useState)({});
|
|
@@ -14248,6 +16216,13 @@ window.__ModuleLoader__.load({
|
|
|
14248
16216
|
setError(t("reflectFailed", { message: failure instanceof Error ? failure.message : String(failure) }));
|
|
14249
16217
|
});
|
|
14250
16218
|
};
|
|
16219
|
+
const askDoctor = () => {
|
|
16220
|
+
if (session === void 0) return;
|
|
16221
|
+
setError(void 0);
|
|
16222
|
+
openDoctor(session, t("doctorChat"), t("language"), new AbortController().signal).then(openChat, (failure) => {
|
|
16223
|
+
setError(t("doctorFailed", { message: failure instanceof Error ? failure.message : String(failure) }));
|
|
16224
|
+
});
|
|
16225
|
+
};
|
|
14251
16226
|
const refreshActivity = () => {
|
|
14252
16227
|
if (session === void 0) return;
|
|
14253
16228
|
loadSettings(session, new AbortController().signal).then((next) => {
|
|
@@ -14256,6 +16231,7 @@ window.__ModuleLoader__.load({
|
|
|
14256
16231
|
payload: {
|
|
14257
16232
|
...payload,
|
|
14258
16233
|
activity: next.activity,
|
|
16234
|
+
usage: next.usage,
|
|
14259
16235
|
interventions: next.interventions,
|
|
14260
16236
|
vectors: next.vectors,
|
|
14261
16237
|
reflection: next.reflection,
|
|
@@ -14370,6 +16346,23 @@ window.__ModuleLoader__.load({
|
|
|
14370
16346
|
onStart: reflect,
|
|
14371
16347
|
onRefresh: refreshActivity
|
|
14372
16348
|
}),
|
|
16349
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
16350
|
+
className: ChatSettingsView_module_css_default.activity,
|
|
16351
|
+
"data-testid": "roleplay-doctor",
|
|
16352
|
+
children: [
|
|
16353
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("doctorTitle") }),
|
|
16354
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
16355
|
+
className: ChatSettingsView_module_css_default.description,
|
|
16356
|
+
children: t("doctorHelp")
|
|
16357
|
+
}),
|
|
16358
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
16359
|
+
variant: "ghost",
|
|
16360
|
+
size: "sm",
|
|
16361
|
+
onClick: askDoctor,
|
|
16362
|
+
children: t("doctorOpen")
|
|
16363
|
+
}) })
|
|
16364
|
+
]
|
|
16365
|
+
}),
|
|
14373
16366
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(VectorsSection, {
|
|
14374
16367
|
t,
|
|
14375
16368
|
status: payload.vectors,
|
|
@@ -14380,6 +16373,10 @@ window.__ModuleLoader__.load({
|
|
|
14380
16373
|
t,
|
|
14381
16374
|
entries: payload.interventions
|
|
14382
16375
|
}),
|
|
16376
|
+
session !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UsageTable, {
|
|
16377
|
+
t,
|
|
16378
|
+
usage: payload.usage
|
|
16379
|
+
}),
|
|
14383
16380
|
session !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActivityList, {
|
|
14384
16381
|
t,
|
|
14385
16382
|
session,
|
|
@@ -14439,6 +16436,16 @@ window.__ModuleLoader__.load({
|
|
|
14439
16436
|
activityModel: "Model",
|
|
14440
16437
|
activityTook: "Took",
|
|
14441
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.",
|
|
14442
16449
|
activityResult: "Result",
|
|
14443
16450
|
activityOwnModel: "chat model",
|
|
14444
16451
|
activityDone: "done",
|
|
@@ -14482,6 +16489,12 @@ window.__ModuleLoader__.load({
|
|
|
14482
16489
|
reflectNothing: "No character had enough new to sort.",
|
|
14483
16490
|
reflectRunning: "The characters are sorting what they took in…",
|
|
14484
16491
|
reflectNow: "Reflect now",
|
|
16492
|
+
language: "en",
|
|
16493
|
+
doctorTitle: "Session doctor",
|
|
16494
|
+
doctorHelp: "A separate chat where an assistant reads this story's records, looks for what does not fit and proposes fixes. Each change is shown to you for approval before it is made.",
|
|
16495
|
+
doctorOpen: "Open the session doctor",
|
|
16496
|
+
doctorChat: "Session doctor",
|
|
16497
|
+
doctorFailed: "Could not open the session doctor: {message}",
|
|
14485
16498
|
reflectHelp: "Each character with something new sorts it into what it believes: beliefs are merged, firmed up or let go, each resting on events it took in. It runs in the background; you can keep playing.",
|
|
14486
16499
|
reflectFailed: "Could not start the reflection: {message}",
|
|
14487
16500
|
reflectError: "The last pass failed: {message}",
|
|
@@ -14541,6 +16554,16 @@ window.__ModuleLoader__.load({
|
|
|
14541
16554
|
activityModel: "模型",
|
|
14542
16555
|
activityTook: "耗时",
|
|
14543
16556
|
activityCalls: "调用",
|
|
16557
|
+
activityTokens: "令牌",
|
|
16558
|
+
usageTitle: "每回合令牌用量",
|
|
16559
|
+
usageHelp: "每个回合用了多少,以模型服务报告的数字为准:游戏主持人,以及为这个回合工作的助手(角色、记录员、建议等,包括回合送出之后完成的工作)。服务没有报告用量的请求不计入。“缓存”是服务从缓存中读取的部分,通常花费更少。",
|
|
16560
|
+
usageTurn: "回合",
|
|
16561
|
+
usageMaster: "游戏主持人",
|
|
16562
|
+
usageHelpers: "助手",
|
|
16563
|
+
usageRuns: "助手运行次数",
|
|
16564
|
+
usageTotal: "合计",
|
|
16565
|
+
usageCached: "缓存 {count}",
|
|
16566
|
+
usageEmpty: "还没有统计过任何回合。",
|
|
14544
16567
|
activityResult: "结果",
|
|
14545
16568
|
activityOwnModel: "对话模型",
|
|
14546
16569
|
activityDone: "完成",
|
|
@@ -14584,6 +16607,12 @@ window.__ModuleLoader__.load({
|
|
|
14584
16607
|
reflectNothing: "没有角色积攒了足够多的新见闻。",
|
|
14585
16608
|
reflectRunning: "角色们正在整理所见所闻……",
|
|
14586
16609
|
reflectNow: "立即反思",
|
|
16610
|
+
language: "zh",
|
|
16611
|
+
doctorTitle: "会话医生",
|
|
16612
|
+
doctorHelp: "一个独立的对话:助手会阅读这个故事的记录,找出对不上的地方并提出修复。每一处修改在执行前都会交给你批准。",
|
|
16613
|
+
doctorOpen: "打开会话医生",
|
|
16614
|
+
doctorChat: "会话医生",
|
|
16615
|
+
doctorFailed: "无法打开会话医生:{message}",
|
|
14587
16616
|
reflectHelp: "每个有新见闻的角色会把它们整理成自己的信念:合并、巩固或放下,每一条都要依据它接收到的事件。反思在后台进行,你可以继续游玩。",
|
|
14588
16617
|
reflectFailed: "无法开始反思:{message}",
|
|
14589
16618
|
reflectError: "上一次反思失败:{message}",
|
|
@@ -14637,11 +16666,206 @@ window.__ModuleLoader__.load({
|
|
|
14637
16666
|
id: VIEW_ID,
|
|
14638
16667
|
order: 20,
|
|
14639
16668
|
label: () => t("tab"),
|
|
14640
|
-
locale: NAMESPACE$2
|
|
16669
|
+
locale: NAMESPACE$2,
|
|
16670
|
+
inject: () => ({ openChat: createChatOpener(ctx) })
|
|
14641
16671
|
}, ChatSettingsView));
|
|
14642
16672
|
});
|
|
14643
16673
|
}
|
|
14644
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
|
|
14645
16869
|
//#region src/client/settings/locales.ts
|
|
14646
16870
|
const dictionaries$1 = {
|
|
14647
16871
|
en: {
|
|
@@ -14651,6 +16875,17 @@ window.__ModuleLoader__.load({
|
|
|
14651
16875
|
rootPath: "Data folder",
|
|
14652
16876
|
rootPathHint: "Characters, sessions and their media live here. Use an absolute path or one starting with ~.",
|
|
14653
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.",
|
|
14654
16889
|
overridden: "Overridden",
|
|
14655
16890
|
reset: "Reset to default",
|
|
14656
16891
|
invalid: "Enter a folder path.",
|
|
@@ -14667,6 +16902,17 @@ window.__ModuleLoader__.load({
|
|
|
14667
16902
|
rootPath: "数据文件夹",
|
|
14668
16903
|
rootPathHint: "角色、会话及其媒体文件都存放在这里。请填写绝对路径,或以 ~ 开头的路径。",
|
|
14669
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: "已有另一个目录使用这个名称。",
|
|
14670
16916
|
overridden: "已覆盖",
|
|
14671
16917
|
reset: "恢复默认",
|
|
14672
16918
|
invalid: "请填写文件夹路径。",
|
|
@@ -14694,12 +16940,12 @@ window.__ModuleLoader__.load({
|
|
|
14694
16940
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
14695
16941
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: t("title") }),
|
|
14696
16942
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("description") }),
|
|
14697
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
16943
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.SettingsForm, {
|
|
14698
16944
|
labels: formLabels(t),
|
|
14699
16945
|
state,
|
|
14700
16946
|
onSave: props.save,
|
|
14701
16947
|
onDiscard: props.discard,
|
|
14702
|
-
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, {
|
|
14703
16949
|
id: "roleplay-root-path",
|
|
14704
16950
|
label: t("rootPath"),
|
|
14705
16951
|
hint: t("rootPathHint"),
|
|
@@ -14715,7 +16961,14 @@ window.__ModuleLoader__.load({
|
|
|
14715
16961
|
onReset: () => {
|
|
14716
16962
|
props.resetField("rootPath");
|
|
14717
16963
|
}
|
|
14718
|
-
})
|
|
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
|
+
})]
|
|
14719
16972
|
})
|
|
14720
16973
|
] });
|
|
14721
16974
|
}
|
|
@@ -14726,10 +16979,11 @@ window.__ModuleLoader__.load({
|
|
|
14726
16979
|
form;
|
|
14727
16980
|
store;
|
|
14728
16981
|
constructor(scope) {
|
|
14729
|
-
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]);
|
|
14730
16983
|
this.store = this.form.bind(() => ({
|
|
14731
16984
|
...this.form.shell(),
|
|
14732
|
-
rootPath: this.form.field("rootPath")
|
|
16985
|
+
rootPath: this.form.field("rootPath"),
|
|
16986
|
+
catalogues: this.form.field("catalogues")
|
|
14733
16987
|
}));
|
|
14734
16988
|
}
|
|
14735
16989
|
inject() {
|
|
@@ -14930,28 +17184,28 @@ window.__ModuleLoader__.load({
|
|
|
14930
17184
|
}
|
|
14931
17185
|
tag$2.textContent = css$2;
|
|
14932
17186
|
var NarrationView_module_css_default = {
|
|
14933
|
-
"sceneImage": "rp_NFPimG_sceneImage",
|
|
14934
|
-
"output": "rp_NFPimG_output",
|
|
14935
|
-
"speech": "rp_NFPimG_speech",
|
|
14936
|
-
"imageButton": "rp_NFPimG_imageButton",
|
|
14937
17187
|
"diceList": "rp_NFPimG_diceList",
|
|
14938
|
-
"
|
|
14939
|
-
"
|
|
14940
|
-
"oocRefused": "rp_NFPimG_oocRefused",
|
|
17188
|
+
"avatar": "rp_NFPimG_avatar",
|
|
17189
|
+
"speech": "rp_NFPimG_speech",
|
|
14941
17190
|
"note": "rp_NFPimG_note",
|
|
14942
|
-
"
|
|
14943
|
-
"narration": "rp_NFPimG_narration",
|
|
14944
|
-
"name": "rp_NFPimG_name",
|
|
14945
|
-
"imageStatus": "rp_NFPimG_imageStatus",
|
|
17191
|
+
"line": "rp_NFPimG_line",
|
|
14946
17192
|
"imageError": "rp_NFPimG_imageError",
|
|
14947
|
-
"
|
|
17193
|
+
"name": "rp_NFPimG_name",
|
|
14948
17194
|
"playLine": "rp_NFPimG_playLine",
|
|
14949
|
-
"
|
|
14950
|
-
"
|
|
17195
|
+
"sceneImage": "rp_NFPimG_sceneImage",
|
|
17196
|
+
"dice": "rp_NFPimG_dice",
|
|
17197
|
+
"narration": "rp_NFPimG_narration",
|
|
17198
|
+
"output": "rp_NFPimG_output",
|
|
14951
17199
|
"oocNote": "rp_NFPimG_oocNote",
|
|
17200
|
+
"oocRefused": "rp_NFPimG_oocRefused",
|
|
17201
|
+
"oocLabel": "rp_NFPimG_oocLabel",
|
|
17202
|
+
"preview": "rp_NFPimG_preview",
|
|
17203
|
+
"words": "rp_NFPimG_words",
|
|
14952
17204
|
"images": "rp_NFPimG_images",
|
|
14953
|
-
"
|
|
14954
|
-
"
|
|
17205
|
+
"imageButton": "rp_NFPimG_imageButton",
|
|
17206
|
+
"imageStatus": "rp_NFPimG_imageStatus",
|
|
17207
|
+
"playAll": "rp_NFPimG_playAll",
|
|
17208
|
+
"diceSummary": "rp_NFPimG_diceSummary"
|
|
14955
17209
|
};
|
|
14956
17210
|
//#endregion
|
|
14957
17211
|
//#region src/client/transcript/PreviewNode.tsx
|
|
@@ -15216,10 +17470,10 @@ window.__ModuleLoader__.load({
|
|
|
15216
17470
|
}
|
|
15217
17471
|
tag$1.textContent = css$1;
|
|
15218
17472
|
var SuggestionsDock_module_css_default = {
|
|
15219
|
-
"label": "rp_rWH4DG_label",
|
|
15220
17473
|
"dock": "rp_rWH4DG_dock",
|
|
15221
17474
|
"chip": "rp_rWH4DG_chip",
|
|
15222
17475
|
"card": "rp_rWH4DG_card",
|
|
17476
|
+
"label": "rp_rWH4DG_label",
|
|
15223
17477
|
"lines": "rp_rWH4DG_lines"
|
|
15224
17478
|
};
|
|
15225
17479
|
//#endregion
|
|
@@ -15244,10 +17498,12 @@ window.__ModuleLoader__.load({
|
|
|
15244
17498
|
const [offered, setOffered] = (0, react.useState)([]);
|
|
15245
17499
|
const [meanwhile, setMeanwhile] = (0, react.useState)([]);
|
|
15246
17500
|
const [unfinished, setUnfinished] = (0, react.useState)([]);
|
|
17501
|
+
const [unwritten, setUnwritten] = (0, react.useState)(0);
|
|
15247
17502
|
(0, react.useEffect)(() => {
|
|
15248
17503
|
setOffered([]);
|
|
15249
17504
|
setMeanwhile([]);
|
|
15250
17505
|
setUnfinished([]);
|
|
17506
|
+
setUnwritten(0);
|
|
15251
17507
|
if (latest === void 0) return void 0;
|
|
15252
17508
|
let stopped = false;
|
|
15253
17509
|
let timer;
|
|
@@ -15258,9 +17514,11 @@ window.__ModuleLoader__.load({
|
|
|
15258
17514
|
setMeanwhile((previous) => previous.join("\n") === away.join("\n") ? previous : away);
|
|
15259
17515
|
const world = found.find((note) => note.kind === "world")?.lines ?? [];
|
|
15260
17516
|
setUnfinished((previous) => previous.join("\n") === world.join("\n") ? previous : world);
|
|
17517
|
+
const waiting = found.find((note) => note.kind === "unwritten")?.count ?? 0;
|
|
17518
|
+
setUnwritten(waiting);
|
|
15261
17519
|
const lines = found.find((note) => note.kind === "suggestions")?.lines;
|
|
15262
17520
|
if (lines !== void 0 && lines.length > 0) setOffered(lines);
|
|
15263
|
-
|
|
17521
|
+
if ((lines === void 0 || lines.length === 0 || waiting > 0) && attempt < GIVE_UP_AFTER) timer = setTimeout(() => {
|
|
15264
17522
|
look(attempt + 1);
|
|
15265
17523
|
}, POLL_MS);
|
|
15266
17524
|
}).catch((error) => {
|
|
@@ -15273,12 +17531,17 @@ window.__ModuleLoader__.load({
|
|
|
15273
17531
|
if (timer !== void 0) clearTimeout(timer);
|
|
15274
17532
|
};
|
|
15275
17533
|
}, [latest, notes]);
|
|
15276
|
-
if (running || offered.length === 0 && meanwhile.length === 0 && unfinished.length === 0) return null;
|
|
17534
|
+
if (running || offered.length === 0 && meanwhile.length === 0 && unfinished.length === 0 && unwritten === 0) return null;
|
|
15277
17535
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
15278
17536
|
className: SuggestionsDock_module_css_default.dock,
|
|
15279
17537
|
"data-testid": "roleplay-suggestions",
|
|
15280
17538
|
"data-rp": "suggestions",
|
|
15281
17539
|
children: [
|
|
17540
|
+
unwritten > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
17541
|
+
className: SuggestionsDock_module_css_default.label,
|
|
17542
|
+
"data-testid": "roleplay-unwritten",
|
|
17543
|
+
children: t("unwritten", { count: unwritten })
|
|
17544
|
+
}),
|
|
15282
17545
|
unfinished.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
15283
17546
|
className: SuggestionsDock_module_css_default.card,
|
|
15284
17547
|
"data-testid": "roleplay-world-findings",
|
|
@@ -15331,12 +17594,12 @@ window.__ModuleLoader__.load({
|
|
|
15331
17594
|
}
|
|
15332
17595
|
tag.textContent = css;
|
|
15333
17596
|
var TurnsDock_module_css_default = {
|
|
15334
|
-
"button": "rp_f4YLlq_button",
|
|
15335
|
-
"count": "rp_f4YLlq_count",
|
|
15336
|
-
"select": "rp_f4YLlq_select",
|
|
15337
17597
|
"error": "rp_f4YLlq_error",
|
|
17598
|
+
"select": "rp_f4YLlq_select",
|
|
17599
|
+
"button": "rp_f4YLlq_button",
|
|
15338
17600
|
"group": "rp_f4YLlq_group",
|
|
15339
|
-
"dock": "rp_f4YLlq_dock"
|
|
17601
|
+
"dock": "rp_f4YLlq_dock",
|
|
17602
|
+
"count": "rp_f4YLlq_count"
|
|
15340
17603
|
};
|
|
15341
17604
|
//#endregion
|
|
15342
17605
|
//#region src/client/transcript/withdrawn.ts
|
|
@@ -15525,6 +17788,7 @@ window.__ModuleLoader__.load({
|
|
|
15525
17788
|
//#region src/client/transcript/locales.ts
|
|
15526
17789
|
const dictionaries = {
|
|
15527
17790
|
en: {
|
|
17791
|
+
unwritten: "{count} round(s) not yet written into the story's memory",
|
|
15528
17792
|
speakAll: "Play narration",
|
|
15529
17793
|
speakLine: "Play this line",
|
|
15530
17794
|
speaking: "Generating speech…",
|
|
@@ -15564,6 +17828,7 @@ window.__ModuleLoader__.load({
|
|
|
15564
17828
|
dicePlayer: "You rolled:"
|
|
15565
17829
|
},
|
|
15566
17830
|
zh: {
|
|
17831
|
+
unwritten: "有 {count} 个回合尚未写入故事记忆",
|
|
15567
17832
|
speakAll: "播放整段",
|
|
15568
17833
|
speakLine: "播放这句台词",
|
|
15569
17834
|
speaking: "正在生成语音…",
|
|
@@ -15702,6 +17967,7 @@ window.__ModuleLoader__.load({
|
|
|
15702
17967
|
registerPanel(ctx);
|
|
15703
17968
|
registerWorldsPage(ctx);
|
|
15704
17969
|
registerAvatarsPage(ctx);
|
|
17970
|
+
registerCataloguePage(ctx);
|
|
15705
17971
|
registerSessionsPage(ctx);
|
|
15706
17972
|
registerTranscript(ctx);
|
|
15707
17973
|
registerChatSettings(ctx);
|