@dsh-agentic-roleplay/core 0.3.5 → 0.4.0
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/{preset-ClQm7KPQ.js → authoring-tools-C_8ClUkP.js} +542 -261
- package/lib/authoring.js +7 -5
- package/lib/{child-CFjnaTZt.js → child-DsixtqTw.js} +94 -2
- package/lib/client.js +16938 -14212
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +1 -1
- package/lib/doctor.js +2 -4
- package/lib/{gallery-DIEgETzU.js → gallery-CDYKJf_O.js} +2 -2
- package/lib/{generator-DJ48HxPI.js → generator-BR1ugzln.js} +2 -2
- package/lib/{deliver-Cl6bjp7g.js → hooks-B2EhBS_-.js} +1884 -236
- package/lib/images.js +4 -4
- package/lib/index.js +1200 -242
- package/lib/{library-9JB9zw5a.js → library-COIktKBa.js} +4 -3
- package/lib/lorebook-author-tools-C-o0t4dL.js +694 -0
- package/lib/lorebook-authoring.js +69 -0
- package/lib/{settings-CA6icLL_.js → narration-BT9uvQry.js} +145 -2
- package/lib/orchestration.js +34 -21
- package/lib/{pack-jail-ClMpVc__.js → pack-jail-soI-In96.js} +170 -12
- package/lib/{packs-BC2A3geF.js → packs-CJPSe5LI.js} +7 -4
- package/lib/{presenter-agent-DnNEG_Mn.js → presenter-agent-Gu34bZwd.js} +6 -6
- package/lib/preset-3zn8xme7.js +242 -0
- package/lib/{preset-author-tools-Dibp-LY9.js → preset-author-tools-C-X8G40s.js} +24 -18
- package/lib/preset-authoring.js +6 -3
- package/lib/{presets-DNjNxQL5.js → presets-C3mhqqfz.js} +50 -28
- package/lib/{reflection-Bju_LPFn.js → reflection-Btsj0ZLh.js} +51 -17
- package/package.json +3 -2
- package/packs/scene/map.html +1 -0
- package/packs/scene/strip.html +1 -0
- package/prompts/en/import/lorebook.md +8 -0
- package/prompts/en/import/style.md +1 -0
- package/prompts/en/lorebook/persona.md +1 -0
- package/prompts/en/lorebook/procedure.md +1 -0
- package/prompts/en/lorebook/welcome.md +1 -0
- package/prompts/en/preset/persona.md +1 -1
- package/prompts/en/preset/procedure.md +1 -1
- package/prompts/en/roleplay/character-lookup.md +1 -0
- package/prompts/en/roleplay/game-master.md +1 -1
- package/prompts/en/world/procedure.md +1 -1
- package/prompts/zh/import/lorebook.md +8 -0
- package/prompts/zh/import/style.md +1 -0
- package/prompts/zh/lorebook/persona.md +1 -0
- package/prompts/zh/lorebook/procedure.md +1 -0
- package/prompts/zh/lorebook/welcome.md +1 -0
- package/prompts/zh/preset/persona.md +1 -1
- package/prompts/zh/preset/procedure.md +1 -1
- package/prompts/zh/roleplay/character-lookup.md +1 -0
- package/prompts/zh/roleplay/game-master.md +1 -1
- package/prompts/zh/world/procedure.md +1 -1
- package/lib/hooks-DdO_tNhu.js +0 -1060
- package/lib/language-BgyxtB2h.js +0 -38
- package/lib/load-Clkl0T7C.js +0 -486
- package/lib/narration-DK2kiIjE.js +0 -141
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { g as withoutExtension, h as trimCharacters } from "./child-DsixtqTw.js";
|
|
1
2
|
import { dirname, extname, join } from "node:path";
|
|
2
3
|
import { existsSync } from "node:fs";
|
|
3
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -24,7 +25,7 @@ function norm(name) {
|
|
|
24
25
|
/** A file-safe key from a name: the letters and digits of any script joined by hyphens; `fallback` when nothing is left. */
|
|
25
26
|
/** An id made of the letters and digits of a name, in whatever script it is written; a name with none gets the fallback. */
|
|
26
27
|
function slug(name, fallback) {
|
|
27
|
-
const key = name.normalize("NFKC").toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "-")
|
|
28
|
+
const key = trimCharacters(trimCharacters(name.normalize("NFKC").toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "-"), "-").slice(0, 60), "-", "end");
|
|
28
29
|
return key === "" ? fallback : key;
|
|
29
30
|
}
|
|
30
31
|
/** `base`, or `base-2`, `base-3` … the first that `taken` does not hold; the key is added to it. */
|
|
@@ -294,7 +295,7 @@ function imageExtensionOf(bytes) {
|
|
|
294
295
|
}
|
|
295
296
|
/** A file name made of the letters and digits of the name it came with, in any script. */
|
|
296
297
|
function libraryName(original, extension, taken) {
|
|
297
|
-
const stem = original
|
|
298
|
+
const stem = trimCharacters(withoutExtension(original).normalize("NFKC").replace(/[^\p{L}\p{N}]+/gu, "-"), "-").slice(0, 60) || "image";
|
|
298
299
|
for (let n = 1;; n += 1) {
|
|
299
300
|
const name = `${stem}${n === 1 ? "" : `-${n}`}${extension}`;
|
|
300
301
|
if (!taken(name)) return name;
|
|
@@ -331,4 +332,4 @@ async function addToLibrary(sessionFolder, bytes, originalName) {
|
|
|
331
332
|
//#endregion
|
|
332
333
|
export { withPngMetadata as _, inheritImages as a, slug as b, referenceImagePath as c, MEDIA_TYPES as d, mediaTypeOf as f, readPngMetadata as g, writeImageFileMetadata as h, entityImageDirectory as i, sceneImagePath as l, sidecarOf as m, imageExtensionOf as n, nextSceneSerial as o, readImageFileMetadata as p, LIBRARY_FOLDER as r, readImageMetadata as s, addToLibrary as t, writeImage as u, mapLimit as v, uniqueKey as x, norm as y };
|
|
333
334
|
|
|
334
|
-
//# sourceMappingURL=library-
|
|
335
|
+
//# sourceMappingURL=library-COIktKBa.js.map
|