@dsh-agentic-roleplay/core 0.7.0 → 0.7.2

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 (45) hide show
  1. package/README.md +1 -1
  2. package/lib/access-DtOxFKBK.js +150 -0
  3. package/lib/{authoring-tools-BWjEr_lF.js → authoring-tools-q34iq3hW.js} +160 -74
  4. package/lib/authoring.js +494 -31
  5. package/lib/{child-D5SVNk4O.js → child-CyCViUKa.js} +48 -7
  6. package/lib/client.js +1094 -604
  7. package/lib/client.js.map +1 -1
  8. package/lib/compaction.js +3 -3
  9. package/lib/doctor.js +3 -3
  10. package/lib/{gallery-C7VOJ3xH.js → gallery-BxZGOgMb.js} +2 -2
  11. package/lib/{generator-CO8usAjE.js → generator-BFmSYvR8.js} +2 -2
  12. package/lib/helper.js +1 -1
  13. package/lib/{hooks-DufjUf1p.js → hooks-HnqXO8mM.js} +6 -245
  14. package/lib/images.js +4 -4
  15. package/lib/index.js +168 -104
  16. package/lib/{library-DsDc6fQa.js → library-BGxPKs9a.js} +6 -3
  17. package/lib/{lorebook-author-tools-v-PM8Kbs.js → lorebook-author-tools-D9RrMK5g.js} +31 -28
  18. package/lib/lorebook-authoring.js +8 -3
  19. package/lib/{narration-_dA9oIt2.js → narration-DvFBqmqe.js} +9 -132
  20. package/lib/orchestration.js +11 -10
  21. package/lib/{pack-jail--Ij90LeY.js → pack-jail-MPekqSuQ.js} +14 -12
  22. package/lib/{packs-DWKnL4YX.js → packs-jowC-MN_.js} +2 -2
  23. package/lib/{presenter-agent-BHSbyWwZ.js → presenter-agent-DvZtnf0Q.js} +6 -6
  24. package/lib/{preset-CDNyJhfU.js → preset-VatN-845.js} +3 -3
  25. package/lib/{preset-author-tools-D7Azdlaq.js → preset-author-tools-8kv1Glxe.js} +11 -10
  26. package/lib/preset-authoring.js +9 -4
  27. package/lib/{reflection-CRCWK2E1.js → reflection-CvOZGjmn.js} +9 -170
  28. package/lib/{presets-D11bxWX0.js → route-DRTJ_vcA.js} +165 -4
  29. package/lib/text-JbWfTHbr.js +295 -0
  30. package/lib/turn-guard-BvCs1VxB.js +53 -0
  31. package/package.json +2 -2
  32. package/prompts/en/import/cut-off.md +1 -0
  33. package/prompts/en/import/finish-failed.md +1 -1
  34. package/prompts/en/import/finish-ok.md +1 -1
  35. package/prompts/en/roleplay/decide-instruction.md +1 -0
  36. package/prompts/en/roleplay/decide-irrelevant.md +1 -0
  37. package/prompts/en/world/procedure.md +1 -1
  38. package/prompts/zh/import/cut-off.md +1 -0
  39. package/prompts/zh/import/finish-failed.md +1 -1
  40. package/prompts/zh/import/finish-ok.md +1 -1
  41. package/prompts/zh/roleplay/decide-instruction.md +1 -0
  42. package/prompts/zh/roleplay/decide-irrelevant.md +1 -0
  43. package/prompts/zh/world/procedure.md +1 -1
  44. package/lib/access-EbNdZFbk.js +0 -25
  45. package/lib/text-CT1re6XT.js +0 -18
@@ -1,25 +0,0 @@
1
- //#region src/shared/chat.ts
2
- const CHAT_PREFIX = "session-";
3
- const UUID_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
4
- /** The DSH chat of a roleplay session is named after the session's id. */
5
- function chatSessionId(sessionId) {
6
- return `${CHAT_PREFIX}${sessionId}`;
7
- }
8
- /** The roleplay session a DSH chat id could belong to; ordinary DSH chats have ids of the same shape. */
9
- function roleplaySessionOf(chat) {
10
- if (!chat.startsWith(CHAT_PREFIX)) return void 0;
11
- const id = chat.slice(8);
12
- return UUID_V4.test(id) ? id : void 0;
13
- }
14
- //#endregion
15
- //#region src/host/prompts/access.ts
16
- /** The prompt `id` in `language`, from the library of the agent's own context. */
17
- function promptFor(agent, id, language, variables) {
18
- const library = agent.ctx.get("roleplayPrompts");
19
- if (library === void 0) throw new Error("the prompt library is not running");
20
- return library.text(id, language, variables, roleplaySessionOf(agent.session.id));
21
- }
22
- //#endregion
23
- export { chatSessionId as n, roleplaySessionOf as r, promptFor as t };
24
-
25
- //# sourceMappingURL=access-EbNdZFbk.js.map
@@ -1,18 +0,0 @@
1
- //#region src/shared/text.ts
2
- /** Remove characters from either end without a backtracking regular expression. */
3
- function trimCharacters(value, characters, edge = "both") {
4
- let start = 0;
5
- let end = value.length;
6
- if (edge !== "end") while (start < end && characters.includes(value[start])) start += 1;
7
- if (edge !== "start") while (end > start && characters.includes(value[end - 1])) end -= 1;
8
- return value.slice(start, end);
9
- }
10
- /** A path-like name without its last extension. */
11
- function withoutExtension(value) {
12
- const dot = value.lastIndexOf(".");
13
- return dot < 0 ? value : value.slice(0, dot);
14
- }
15
- //#endregion
16
- export { withoutExtension as n, trimCharacters as t };
17
-
18
- //# sourceMappingURL=text-CT1re6XT.js.map