@dsh-agentic-roleplay/core 0.4.1 → 0.5.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/{child-DsixtqTw.js → access-tN5D3WI8.js} +21 -14
- package/lib/{authoring-tools-C2BHkEFP.js → authoring-tools-Ch_3oIKC.js} +6 -5
- package/lib/authoring.js +5 -5
- package/lib/client.js +304 -304
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +17 -23
- package/lib/doctor.js +2 -2
- package/lib/{gallery-CDYKJf_O.js → gallery-C7VOJ3xH.js} +2 -2
- package/lib/{generator-BR1ugzln.js → generator-CO8usAjE.js} +2 -2
- package/lib/{hooks-CHmUksFS.js → hooks-C7gt2c01.js} +3 -3
- package/lib/images.js +4 -4
- package/lib/index.js +32 -22
- package/lib/{library-COIktKBa.js → library-DsDc6fQa.js} +2 -2
- package/lib/{lorebook-author-tools-CaT74Q7v.js → lorebook-author-tools-DII7Xt7Q.js} +5 -5
- package/lib/lorebook-authoring.js +3 -3
- package/lib/orchestration.js +15 -9
- package/lib/{pack-jail-CEDDI4Xw.js → pack-jail-AzR6dCNm.js} +9 -9
- package/lib/{packs-DB_9xiCp.js → packs-C7g534Mi.js} +2 -2
- package/lib/{presenter-agent-Gu34bZwd.js → presenter-agent-BsC6Vftz.js} +5 -6
- package/lib/{preset-BL1d40oG.js → preset-Drfu_K-H.js} +3 -3
- package/lib/{preset-author-tools-B2wZXKZo.js → preset-author-tools-CdIsFhQw.js} +5 -5
- package/lib/preset-authoring.js +4 -4
- package/lib/{presets-Dc15L6OU.js → presets-CADd77WB.js} +3 -3
- package/lib/{reflection-BWMVdHhR.js → reflection-CUGuPAZR.js} +7 -7
- package/lib/text-CT1re6XT.js +18 -0
- package/package.json +37 -41
- package/lib/access-EbNdZFbk.js +0 -25
package/lib/access-EbNdZFbk.js
DELETED
|
@@ -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
|