@dsh-agentic-roleplay/core 0.3.6 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{tools-Dy1fgP6B.js → authoring-tools-C2BHkEFP.js} +129 -25
- package/lib/authoring.js +7 -5
- package/lib/{child-CFjnaTZt.js → child-DsixtqTw.js} +94 -2
- package/lib/client.js +3758 -2276
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +3 -2
- 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-BBgciEEK.js → hooks-CHmUksFS.js} +1963 -236
- package/lib/images.js +4 -4
- package/lib/index.js +847 -254
- package/lib/{library-9JB9zw5a.js → library-COIktKBa.js} +4 -3
- package/lib/{lorebook-author-tools-Bj31z1cu.js → lorebook-author-tools-CaT74Q7v.js} +118 -43
- package/lib/lorebook-authoring.js +5 -3
- package/lib/{settings-CA6icLL_.js → narration-DstnwrvX.js} +148 -2
- package/lib/orchestration.js +344 -37
- package/lib/{pack-jail-2XztyYAX.js → pack-jail-CEDDI4Xw.js} +170 -13
- package/lib/{packs-xHRCcGdb.js → packs-DB_9xiCp.js} +7 -4
- package/lib/{presenter-agent-DnNEG_Mn.js → presenter-agent-Gu34bZwd.js} +6 -6
- package/lib/preset-BL1d40oG.js +242 -0
- package/lib/{preset-author-tools-BxycmoAr.js → preset-author-tools-B2wZXKZo.js} +7 -7
- package/lib/preset-authoring.js +6 -3
- package/lib/{presets-gkBWAiVb.js → presets-Dc15L6OU.js} +9 -26
- package/lib/{reflection-q0UpwXlx.js → reflection-BWMVdHhR.js} +51 -17
- package/package.json +2 -2
- package/packs/scene/map.html +1 -0
- package/packs/scene/strip.html +1 -0
- package/prompts/en/import/lorebook.md +2 -1
- package/prompts/en/import/style.md +1 -0
- package/prompts/en/lorebook/procedure.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/roleplay/record-keeper.md +3 -3
- package/prompts/en/world/procedure.md +1 -1
- package/prompts/zh/import/lorebook.md +2 -1
- package/prompts/zh/import/style.md +1 -0
- package/prompts/zh/lorebook/procedure.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/roleplay/record-keeper.md +3 -3
- package/prompts/zh/world/procedure.md +1 -1
- package/lib/hooks-DkwFGtNH.js +0 -1060
- package/lib/language-BgyxtB2h.js +0 -38
- package/lib/load-CVwJjIJ5.js +0 -486
- package/lib/narration-DK2kiIjE.js +0 -141
- package/lib/preset-D0FMSeZ9.js +0 -59
package/lib/compaction.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as roleplaySessionOf, t as promptFor } from "./access-EbNdZFbk.js";
|
|
2
|
-
import { a as liveSettings, t as decodeOutput } from "./narration-
|
|
2
|
+
import { a as liveSettings, t as decodeOutput } from "./narration-DstnwrvX.js";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { sessionFolder } from "@dsh-agentic-roleplay/state";
|
|
5
5
|
import BasicCompactionEngine from "@deepseek-ai/dsh-compaction-basic";
|
|
@@ -292,7 +292,8 @@ var RoleplayCompaction = class extends BasicCompactionEngine {
|
|
|
292
292
|
if (config?.provider === void 0 || config.model === void 0) throw new Error("the conversation limit follows the model, but this chat has none selected: set the limit in the chat settings");
|
|
293
293
|
const window = (await this.ctx.llm.resolveModelInfo(config.provider, config.model, signal)).context?.contextWindow;
|
|
294
294
|
if (window === void 0) throw new Error(`the conversation limit follows the model, but the context window of ${config.provider}/${config.model} is not known: set the limit in the chat settings or the model's contextWindow in the provider`);
|
|
295
|
-
|
|
295
|
+
const share = Math.round(window * context.limitRatio);
|
|
296
|
+
return Math.max(MIN_LIMIT, context.workingTokens > 0 ? Math.min(share, context.workingTokens) : share);
|
|
296
297
|
}
|
|
297
298
|
async summarize(input, agent, signal) {
|
|
298
299
|
const fold = this.folds.get(agent.session.id);
|
package/lib/doctor.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { n as chatSessionId } from "./access-EbNdZFbk.js";
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import { a as liveSettings } from "./narration-DK2kiIjE.js";
|
|
2
|
+
import { a as liveSettings } from "./narration-DstnwrvX.js";
|
|
3
|
+
import { i as externalTools, t as externalToolLimit } from "./hooks-CHmUksFS.js";
|
|
5
4
|
import { n as doctorSessionOf } from "./doctor-chat-ByDfCMeo.js";
|
|
6
|
-
import { t as externalToolLimit } from "./hooks-DkwFGtNH.js";
|
|
7
5
|
import { join } from "node:path";
|
|
8
6
|
import { existsSync } from "node:fs";
|
|
9
7
|
import { SessionId } from "@deepseek-ai/dsh-session";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as mediaTypeOf, h as writeImageFileMetadata, m as sidecarOf, p as readImageFileMetadata, r as LIBRARY_FOLDER, v as mapLimit } from "./library-
|
|
1
|
+
import { f as mediaTypeOf, h as writeImageFileMetadata, m as sidecarOf, p as readImageFileMetadata, r as LIBRARY_FOLDER, v as mapLimit } from "./library-COIktKBa.js";
|
|
2
2
|
import { join, sep } from "node:path";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { lstat, mkdir, readFile, readdir, realpath, rename, stat, writeFile } from "node:fs/promises";
|
|
@@ -192,4 +192,4 @@ async function updateImage(sessionFolder, path, update) {
|
|
|
192
192
|
//#endregion
|
|
193
193
|
export { updateImage as i, galleryFile as n, listGallery as r, describeGalleryImage as t };
|
|
194
194
|
|
|
195
|
-
//# sourceMappingURL=gallery-
|
|
195
|
+
//# sourceMappingURL=gallery-CDYKJf_O.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as referenceImagePath, l as sceneImagePath, u as writeImage } from "./library-
|
|
1
|
+
import { c as referenceImagePath, l as sceneImagePath, u as writeImage } from "./library-COIktKBa.js";
|
|
2
2
|
//#region src/host/images/generator.ts
|
|
3
3
|
const unique = (values) => [...new Set(values.map((value) => value.trim()).filter((value) => value !== ""))];
|
|
4
4
|
/** What a reference image shows: the subject and its stable look. */
|
|
@@ -142,4 +142,4 @@ async function generateTransientImage(service, request) {
|
|
|
142
142
|
//#endregion
|
|
143
143
|
export { uploadReferenceImage as a, transientPrompt as i, generateTransientImage as n, referencePrompt as r, generateReferenceImage as t };
|
|
144
144
|
|
|
145
|
-
//# sourceMappingURL=generator-
|
|
145
|
+
//# sourceMappingURL=generator-BR1ugzln.js.map
|