@dsh-agentic-roleplay/core 0.11.1 → 0.12.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.
Files changed (50) hide show
  1. package/lib/{access-Md1YTSX1.js → access-DAw54-NI.js} +3 -15
  2. package/lib/{authoring-tools-BFdw7ahj.js → authoring-tools-4NgDhIJV.js} +51 -11
  3. package/lib/authoring.js +8 -8
  4. package/lib/{child-C9nPIy9j.js → child-D3QUNb3m.js} +121 -2
  5. package/lib/client.js +1013 -449
  6. package/lib/client.js.map +1 -1
  7. package/lib/compaction.js +3 -3
  8. package/lib/doctor.js +3 -3
  9. package/lib/{gallery-BWHmjogd.js → gallery-Ct6nm4UQ.js} +3 -3
  10. package/lib/{generator-QCdm8nUh.js → generator-CI8fOnXy.js} +2 -2
  11. package/lib/helper.js +13 -1
  12. package/lib/{hooks-C2U1-8ur.js → hooks-BNeoGMHZ.js} +722 -334
  13. package/lib/images.js +4 -4
  14. package/lib/index.js +234 -20
  15. package/lib/jail-BIF79PJO.js +107 -0
  16. package/lib/{library-4zmCAshR.js → library-BF9ZMSFz.js} +3 -3
  17. package/lib/{lorebook-author-tools-Bjfjt3bg.js → lorebook-author-tools-DBk-V0hp.js} +7 -7
  18. package/lib/lorebook-authoring.js +4 -4
  19. package/lib/{narration-b_VBEUWn.js → narration-xvErE2yp.js} +29 -2
  20. package/lib/orchestration.js +593 -47
  21. package/lib/{pack-jail-Ci9bIeDI.js → pack-jail-C8EyX9Ix.js} +12 -11
  22. package/lib/{packs-CYkozh8Q.js → packs-S0SzrVv-.js} +2 -2
  23. package/lib/{presenter-agent-CqkAL03Q.js → presenter-agent-Bc478nTA.js} +6 -6
  24. package/lib/{preset-B-35yUmt.js → preset-SJZyw0kt.js} +4 -4
  25. package/lib/{preset-author-tools-BUymqZM5.js → preset-author-tools-CzogjK42.js} +7 -7
  26. package/lib/preset-authoring.js +5 -5
  27. package/lib/{presets-_U-xroo0.js → presets-DQ5rioMh.js} +231 -48
  28. package/lib/{reflection-B9N0z3KY.js → reflection-buQiSdvq.js} +15 -8
  29. package/lib/service-mRKwpWjX.js +140 -0
  30. package/lib/{text-C2AGl7Je.js → text-Dfv8S8eq.js} +27 -2
  31. package/lib/{turn-guard-C0M3rXEN.js → turn-guard-BSAba8sp.js} +3 -3
  32. package/package.json +3 -3
  33. package/prompts/en/import/finish-ok.md +1 -1
  34. package/prompts/en/import/generator.md +1 -1
  35. package/prompts/en/import/style.md +1 -1
  36. package/prompts/en/import/variables.md +2 -1
  37. package/prompts/en/roleplay/character-lookup.md +1 -1
  38. package/prompts/en/roleplay/decide-errand.md +1 -0
  39. package/prompts/en/roleplay/decide-message.md +1 -0
  40. package/prompts/en/roleplay/dream.md +1 -0
  41. package/prompts/en/roleplay/gate-repeat.md +1 -0
  42. package/prompts/zh/import/finish-ok.md +1 -1
  43. package/prompts/zh/import/generator.md +1 -1
  44. package/prompts/zh/import/style.md +1 -1
  45. package/prompts/zh/import/variables.md +2 -1
  46. package/prompts/zh/roleplay/character-lookup.md +1 -1
  47. package/prompts/zh/roleplay/decide-errand.md +1 -0
  48. package/prompts/zh/roleplay/decide-message.md +1 -0
  49. package/prompts/zh/roleplay/dream.md +1 -0
  50. package/prompts/zh/roleplay/gate-repeat.md +1 -0
package/lib/compaction.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as liveSettings, t as decodeOutput } from "./narration-b_VBEUWn.js";
2
- import { l as roleplaySessionOf, t as promptFor } from "./access-Md1YTSX1.js";
3
- import { E as tokensOf, l as runChild, n as childModel, r as childSampling } from "./child-C9nPIy9j.js";
1
+ import { a as liveSettings, t as decodeOutput } from "./narration-xvErE2yp.js";
2
+ import { j as roleplaySessionOf, k as tokensOf, l as runChild, n as childModel, r as childSampling } from "./child-D3QUNb3m.js";
3
+ import { t as promptFor } from "./access-DAw54-NI.js";
4
4
  import { join } from "node:path";
5
5
  import { sessionFolder } from "@dsh-agentic-roleplay/state";
6
6
  import BasicCompactionEngine from "@deepseek-ai/dsh-compaction-basic";
package/lib/doctor.js CHANGED
@@ -1,7 +1,7 @@
1
- import { c as chatSessionId } from "./access-Md1YTSX1.js";
1
+ import { A as chatSessionId } from "./child-D3QUNb3m.js";
2
2
  import { n as doctorSessionOf } from "./doctor-chat-hL1a61hp.js";
3
- import { i as externalTools, t as externalToolLimit } from "./hooks-C2U1-8ur.js";
4
- import { a as liveSettings } from "./narration-b_VBEUWn.js";
3
+ import { o as externalTools, t as externalToolLimit } from "./hooks-BNeoGMHZ.js";
4
+ import { a as liveSettings } from "./narration-xvErE2yp.js";
5
5
  import { join } from "node:path";
6
6
  import { createTools, isSessionId, sessionDatabase, sessionFolder } from "@dsh-agentic-roleplay/state";
7
7
  import { existsSync } from "node:fs";
@@ -1,5 +1,5 @@
1
- import { n as atomicWrite } from "./access-Md1YTSX1.js";
2
- import { _ as writeImageFileMetadata, a as LIBRARY_FOLDER, g as sidecarOf, h as readImageFileMetadata, m as mediaTypeOf, x as mapLimit } from "./library-4zmCAshR.js";
1
+ import { n as atomicWrite } from "./access-DAw54-NI.js";
2
+ import { _ as writeImageFileMetadata, a as LIBRARY_FOLDER, g as sidecarOf, h as readImageFileMetadata, m as mediaTypeOf, x as mapLimit } from "./library-BF9ZMSFz.js";
3
3
  import { join, sep } from "node:path";
4
4
  import { lstat, readFile, readdir, realpath, stat } from "node:fs/promises";
5
5
  // src/host/images/gallery.ts
@@ -187,4 +187,4 @@ async function updateImage(sessionFolder, path, update) {
187
187
  }
188
188
  export { updateImage as i, galleryFile as n, listGallery as r, describeGalleryImage as t };
189
189
 
190
- //# sourceMappingURL=gallery-BWHmjogd.js.map
190
+ //# sourceMappingURL=gallery-Ct6nm4UQ.js.map
@@ -1,4 +1,4 @@
1
- import { d as sceneImagePath, f as writeImage, u as referenceImagePath } from "./library-4zmCAshR.js";
1
+ import { d as sceneImagePath, f as writeImage, u as referenceImagePath } from "./library-BF9ZMSFz.js";
2
2
  // 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. */
@@ -147,4 +147,4 @@ async function generateTransientImage(service, request) {
147
147
  }
148
148
  export { uploadReferenceImage as a, transientPrompt as i, generateTransientImage as n, referencePrompt as r, generateReferenceImage as t };
149
149
 
150
- //# sourceMappingURL=generator-QCdm8nUh.js.map
150
+ //# sourceMappingURL=generator-CI8fOnXy.js.map
package/lib/helper.js CHANGED
@@ -1,4 +1,8 @@
1
- import { o as helpers } from "./child-C9nPIy9j.js";
1
+ import { o as helpers } from "./child-D3QUNb3m.js";
2
+ import { a as workspaceOf, n as storyRoots } from "./service-mRKwpWjX.js";
3
+ import { t as registerFoldersJail } from "./jail-BIF79PJO.js";
4
+ import { join } from "node:path";
5
+ import { sessionFolder } from "@dsh-agentic-roleplay/state";
2
6
  // src/helper.ts
3
7
  const name = "@dsh-agentic-roleplay/core/helper";
4
8
  const inject = ["tools", "systemPrompt"];
@@ -23,6 +27,14 @@ function apply(ctx) {
23
27
  interpolate: false,
24
28
  text: ""
25
29
  });
30
+ const rootOf = () => ctx.get("roleplayRoot")?.path;
31
+ registerFoldersJail(ctx, {
32
+ roots: async (session) => {
33
+ const root = rootOf();
34
+ return root === void 0 ? void 0 : await storyRoots(root, sessionFolder(join(root, "sessions"), session));
35
+ },
36
+ workspace: () => workspaceOf(rootOf() ?? "")
37
+ });
26
38
  ctx.on("agent/created", ({ agent }) => {
27
39
  helpers.get(agent.session.id)?.setup(agent);
28
40
  });