@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.
Files changed (49) hide show
  1. package/lib/{tools-Dy1fgP6B.js → authoring-tools-C2BHkEFP.js} +129 -25
  2. package/lib/authoring.js +7 -5
  3. package/lib/{child-CFjnaTZt.js → child-DsixtqTw.js} +94 -2
  4. package/lib/client.js +3758 -2276
  5. package/lib/client.js.map +1 -1
  6. package/lib/compaction.js +3 -2
  7. package/lib/doctor.js +2 -4
  8. package/lib/{gallery-DIEgETzU.js → gallery-CDYKJf_O.js} +2 -2
  9. package/lib/{generator-DJ48HxPI.js → generator-BR1ugzln.js} +2 -2
  10. package/lib/{deliver-BBgciEEK.js → hooks-CHmUksFS.js} +1963 -236
  11. package/lib/images.js +4 -4
  12. package/lib/index.js +847 -254
  13. package/lib/{library-9JB9zw5a.js → library-COIktKBa.js} +4 -3
  14. package/lib/{lorebook-author-tools-Bj31z1cu.js → lorebook-author-tools-CaT74Q7v.js} +118 -43
  15. package/lib/lorebook-authoring.js +5 -3
  16. package/lib/{settings-CA6icLL_.js → narration-DstnwrvX.js} +148 -2
  17. package/lib/orchestration.js +344 -37
  18. package/lib/{pack-jail-2XztyYAX.js → pack-jail-CEDDI4Xw.js} +170 -13
  19. package/lib/{packs-xHRCcGdb.js → packs-DB_9xiCp.js} +7 -4
  20. package/lib/{presenter-agent-DnNEG_Mn.js → presenter-agent-Gu34bZwd.js} +6 -6
  21. package/lib/preset-BL1d40oG.js +242 -0
  22. package/lib/{preset-author-tools-BxycmoAr.js → preset-author-tools-B2wZXKZo.js} +7 -7
  23. package/lib/preset-authoring.js +6 -3
  24. package/lib/{presets-gkBWAiVb.js → presets-Dc15L6OU.js} +9 -26
  25. package/lib/{reflection-q0UpwXlx.js → reflection-BWMVdHhR.js} +51 -17
  26. package/package.json +2 -2
  27. package/packs/scene/map.html +1 -0
  28. package/packs/scene/strip.html +1 -0
  29. package/prompts/en/import/lorebook.md +2 -1
  30. package/prompts/en/import/style.md +1 -0
  31. package/prompts/en/lorebook/procedure.md +1 -1
  32. package/prompts/en/preset/procedure.md +1 -1
  33. package/prompts/en/roleplay/character-lookup.md +1 -0
  34. package/prompts/en/roleplay/game-master.md +1 -1
  35. package/prompts/en/roleplay/record-keeper.md +3 -3
  36. package/prompts/en/world/procedure.md +1 -1
  37. package/prompts/zh/import/lorebook.md +2 -1
  38. package/prompts/zh/import/style.md +1 -0
  39. package/prompts/zh/lorebook/procedure.md +1 -1
  40. package/prompts/zh/preset/procedure.md +1 -1
  41. package/prompts/zh/roleplay/character-lookup.md +1 -0
  42. package/prompts/zh/roleplay/game-master.md +1 -1
  43. package/prompts/zh/roleplay/record-keeper.md +3 -3
  44. package/prompts/zh/world/procedure.md +1 -1
  45. package/lib/hooks-DkwFGtNH.js +0 -1060
  46. package/lib/language-BgyxtB2h.js +0 -38
  47. package/lib/load-CVwJjIJ5.js +0 -486
  48. package/lib/narration-DK2kiIjE.js +0 -141
  49. 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-DK2kiIjE.js";
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
- return Math.max(MIN_LIMIT, Math.round(window * context.limitRatio));
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 "./load-CVwJjIJ5.js";
3
- import { d as externalTools } from "./deliver-BBgciEEK.js";
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-9JB9zw5a.js";
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-DIEgETzU.js.map
195
+ //# sourceMappingURL=gallery-CDYKJf_O.js.map
@@ -1,4 +1,4 @@
1
- import { c as referenceImagePath, l as sceneImagePath, u as writeImage } from "./library-9JB9zw5a.js";
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-DJ48HxPI.js.map
145
+ //# sourceMappingURL=generator-BR1ugzln.js.map