@dsh-agentic-roleplay/core 0.6.1 → 0.7.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/access-DtOxFKBK.js +150 -0
- package/lib/{authoring-tools-BGzzW6O5.js → authoring-tools-BKltdiea.js} +160 -74
- package/lib/authoring.js +10 -5
- package/lib/{child-D5SVNk4O.js → child-CyCViUKa.js} +48 -7
- package/lib/client.js +2157 -780
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +3 -3
- package/lib/doctor.js +3 -3
- package/lib/{gallery-C7VOJ3xH.js → gallery-BxZGOgMb.js} +2 -2
- package/lib/{generator-CO8usAjE.js → generator-BFmSYvR8.js} +2 -2
- package/lib/helper.js +1 -1
- package/lib/{hooks-BLperIIB.js → hooks-HnqXO8mM.js} +10 -241
- package/lib/images.js +4 -4
- package/lib/index.js +1424 -203
- package/lib/{library-DsDc6fQa.js → library-BGxPKs9a.js} +6 -3
- package/lib/{lorebook-author-tools-C-cFiE6E.js → lorebook-author-tools-BAnUyRtS.js} +37 -29
- package/lib/lorebook-authoring.js +8 -3
- package/lib/{narration-_dA9oIt2.js → narration-DvFBqmqe.js} +9 -132
- package/lib/orchestration.js +13 -10
- package/lib/{pack-jail-BKFmbYP8.js → pack-jail-DLGguGS3.js} +20 -13
- package/lib/{packs-ZTG7fWut.js → packs-jowC-MN_.js} +2 -2
- package/lib/{presenter-agent-BHSbyWwZ.js → presenter-agent-DvZtnf0Q.js} +6 -6
- package/lib/{preset-CJLW8Mp0.js → preset-CXbC0NeU.js} +3 -3
- package/lib/{preset-author-tools-1RstgEZs.js → preset-author-tools-C26kj6t5.js} +14 -7
- package/lib/preset-authoring.js +9 -4
- package/lib/{reflection-6qfOC5OT.js → reflection-CvOZGjmn.js} +9 -170
- package/lib/{presets-DcPCnn8O.js → route-DRTJ_vcA.js} +165 -4
- package/lib/text-JbWfTHbr.js +295 -0
- package/lib/turn-guard-BvCs1VxB.js +53 -0
- package/package.json +29 -29
- package/prompts/en/import/cut-off.md +1 -0
- package/prompts/en/import/finish-failed.md +1 -1
- package/prompts/en/roleplay/decide-instruction.md +1 -0
- package/prompts/en/roleplay/decide-irrelevant.md +1 -0
- package/prompts/zh/import/cut-off.md +1 -0
- package/prompts/zh/import/finish-failed.md +1 -1
- package/prompts/zh/roleplay/decide-instruction.md +1 -0
- package/prompts/zh/roleplay/decide-irrelevant.md +1 -0
- package/lib/access-EbNdZFbk.js +0 -25
- package/lib/text-CT1re6XT.js +0 -18
package/lib/compaction.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as liveSettings, t as decodeOutput } from "./narration-
|
|
3
|
-
import {
|
|
1
|
+
import { o as roleplaySessionOf, t as promptFor } from "./access-DtOxFKBK.js";
|
|
2
|
+
import { a as liveSettings, t as decodeOutput } from "./narration-DvFBqmqe.js";
|
|
3
|
+
import { c as runChild, n as childModel, r as childSampling, y as tokensOf } from "./child-CyCViUKa.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,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as liveSettings } from "./narration-
|
|
3
|
-
import { i as externalTools, t as externalToolLimit } from "./hooks-
|
|
1
|
+
import { a as chatSessionId } from "./access-DtOxFKBK.js";
|
|
2
|
+
import { a as liveSettings } from "./narration-DvFBqmqe.js";
|
|
3
|
+
import { i as externalTools, t as externalToolLimit } from "./hooks-HnqXO8mM.js";
|
|
4
4
|
import { n as doctorSessionOf } from "./doctor-chat-ByDfCMeo.js";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { existsSync } from "node:fs";
|
|
@@ -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-BGxPKs9a.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-BxZGOgMb.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-BGxPKs9a.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-BFmSYvR8.js.map
|
package/lib/helper.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as emptyStats, a as liveSettings, h as DECISION_SITES, m as rulesOf, n as encodeOutput, p as WORLD_RULES_KEY, r as encodePreview } from "./narration-
|
|
3
|
-
import { t as trimCharacters } from "./text-
|
|
4
|
-
import {
|
|
1
|
+
import { o as roleplaySessionOf, t as promptFor } from "./access-DtOxFKBK.js";
|
|
2
|
+
import { _ as emptyStats, a as liveSettings, h as DECISION_SITES, m as rulesOf, n as encodeOutput, p as WORLD_RULES_KEY, r as encodePreview } from "./narration-DvFBqmqe.js";
|
|
3
|
+
import { i as translator, r as languageOf$1, t as trimCharacters } from "./text-JbWfTHbr.js";
|
|
4
|
+
import { a as childTrace, c as runChild, f as tokensOf, m as addTokens, n as childModel, p as NO_TOKENS, r as childSampling, v as estimateAnswer } from "./child-CyCViUKa.js";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
import { copyFileSync, cpSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
@@ -28,241 +28,6 @@ const PLOT_NUDGE_MODES = [
|
|
|
28
28
|
"breathing_room"
|
|
29
29
|
];
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../dsh-roleplay-model/src/messages-zh.ts
|
|
32
|
-
/** The Chinese of the texts built in code, by the English that stands in the code. A `{name}` is filled in and must stand in both. */
|
|
33
|
-
const ZH = {
|
|
34
|
-
", ": ",",
|
|
35
|
-
"; ": ";",
|
|
36
|
-
": ": ":",
|
|
37
|
-
".": "。",
|
|
38
|
-
" and ": "和",
|
|
39
|
-
"doubtful": "存疑",
|
|
40
|
-
"likely": "较有把握",
|
|
41
|
-
"sure": "确信",
|
|
42
|
-
"open": "畅通",
|
|
43
|
-
"locked": "已上锁",
|
|
44
|
-
"blocked": "被堵住",
|
|
45
|
-
"night": "夜里",
|
|
46
|
-
"morning": "上午",
|
|
47
|
-
"afternoon": "下午",
|
|
48
|
-
"evening": "傍晚",
|
|
49
|
-
"spring": "春季",
|
|
50
|
-
"summer": "夏季",
|
|
51
|
-
"autumn": "秋季",
|
|
52
|
-
"winter": "冬季",
|
|
53
|
-
"today is {holidays}": "今天是{holidays}",
|
|
54
|
-
"Summary": "概述",
|
|
55
|
-
"Personality": "性格",
|
|
56
|
-
"Background": "背景",
|
|
57
|
-
"Appearance": "外貌",
|
|
58
|
-
"How you speak": "说话方式",
|
|
59
|
-
"Talk to {name}.": "和{name}聊聊。",
|
|
60
|
-
"Go to {place}.": "前往{place}。",
|
|
61
|
-
"Take a closer look at {thing}.": "仔细看看{thing}。",
|
|
62
|
-
"Look around carefully.": "仔细观察四周。",
|
|
63
|
-
"Wait and see what happens.": "先等等,看看会发生什么。",
|
|
64
|
-
"Ask what is going on.": "问问这是怎么回事。",
|
|
65
|
-
"Think about what to do next.": "想想接下来该怎么办。",
|
|
66
|
-
"You are {name}.": "你是{name}。",
|
|
67
|
-
"You are also called {names}.": "你也被称作{names}。",
|
|
68
|
-
"age: {value}": "年龄:{value}",
|
|
69
|
-
"gender: {value}": "性别:{value}",
|
|
70
|
-
"pronouns: {value}": "代词:{value}",
|
|
71
|
-
"- {key} ({name}): {use}": "- {key}({name}):{use}",
|
|
72
|
-
"Rolls {dice}.": "掷 {dice}。",
|
|
73
|
-
"Give a target: the difficulty, the number to meet or beat; set it by how hard the attempt is.": "需给出 target:难度,即要达到或超过的数字;按这次尝试的难易来定。",
|
|
74
|
-
"Give a target: the number to stay under; set it by how hard the attempt is.": "需给出 target:要低于的数字;按这次尝试的难易来定。",
|
|
75
|
-
"It adds the character's {variable}.": "它会加上该角色的 {variable}。",
|
|
76
|
-
"Counts the dice that show {hit} or more.": "统计显示 {hit} 或更高的骰子数。",
|
|
77
|
-
"the player's roll": "玩家的掷骰",
|
|
78
|
-
"The player rolled {dice} ({reason}) and got {total}: dice {faces}. This is a fact, decided by the dice: take it into account when you judge the attempt and decide what happens.": "玩家掷了 {dice}({reason}),得到 {total}:骰面 {faces}。这是由骰子决定的事实:在你判断这次尝试、决定发生什么时把它考虑进去。",
|
|
79
|
-
"The checks of this story:": "本故事的检定:",
|
|
80
|
-
"No checks are defined: use roll_dice only.": "没有定义检定:只用 roll_dice。",
|
|
81
|
-
"Situation:": "当前情形:",
|
|
82
|
-
"Now: {time}.": "现在是:{time}。",
|
|
83
|
-
"Where you are:": "你所在之处:",
|
|
84
|
-
"Present:": "在场的人:",
|
|
85
|
-
" (you)": "(你)",
|
|
86
|
-
"What you know is coming:": "你知道即将发生的事:",
|
|
87
|
-
"Just now you notice:": "此刻你注意到:",
|
|
88
|
-
"How you are (what you can tell of yourself):": "你的状态(你自己能感觉到的):",
|
|
89
|
-
"What you can tell of the others here:": "你能看出在场其他人的情况:",
|
|
90
|
-
"What you have on you:": "你身上带着:",
|
|
91
|
-
"Things here: ": "这里有:",
|
|
92
|
-
"Ways out: ": "出路:",
|
|
93
|
-
"Lying about: ": "散落在周围的:",
|
|
94
|
-
"hidden": "隐蔽",
|
|
95
|
-
" holding {things}": ",里面有{things}",
|
|
96
|
-
"; and {count} more": ";另有{count}项",
|
|
97
|
-
"at {feature}": "在{feature}",
|
|
98
|
-
"; and {count} more you can recall if needed": ";另有{count}项,需要时你可以回想起来",
|
|
99
|
-
"What you know exists (this does not tell you where it is now or what state it is in):": "你知道存在的事物(这并不说明它现在在哪里、处于什么状态):",
|
|
100
|
-
"People: ": "人物:",
|
|
101
|
-
"Factions: ": "组织:",
|
|
102
|
-
"Places: ": "地点:",
|
|
103
|
-
"Routes: ": "路径:",
|
|
104
|
-
"Things: ": "物品:",
|
|
105
|
-
"Background you know, to read with recall_my_lore when it bears on the moment: ": "你所知的背景(与当下相关时用 recall_my_lore 查阅):",
|
|
106
|
-
"Your day and what you are after (plans, not orders: keep them, put them off or drop them as the moment and your character suggest):": "你的日程与你想达成的事(只是计划,不是命令:依当下情形和你的性格,可以照做、推迟或放弃):",
|
|
107
|
-
"Your day, now: {activity}{place}, until {until}{note}.": "你此刻的日程:{activity}{place},持续到{until}{note}。",
|
|
108
|
-
"Your day, next: {activity}{place}, from {from}.": "你接下来的日程:{activity}{place},{from}开始。",
|
|
109
|
-
" at {place}": ",在{place}",
|
|
110
|
-
" (not something you would drop lightly)": "(你不会轻易放下)",
|
|
111
|
-
", with {names}": ",与{names}一起",
|
|
112
|
-
"You were to: {title}{place}{with}, at {at}, which has passed and is still open.": "你本应:{title}{place}{with},时间是{at},已经过了,事情仍未了结。",
|
|
113
|
-
"You are due to: {title}{place}{with}, at {at}.": "你约定要:{title}{place}{with},时间是{at}。",
|
|
114
|
-
"What you are after:": "你想达成的事:",
|
|
115
|
-
", by {deadline}, which has passed": ",限期{deadline},已过",
|
|
116
|
-
", by {deadline}": ",限期{deadline}",
|
|
117
|
-
" Next: {plan}.": " 下一步:{plan}。",
|
|
118
|
-
"How you stand with people who bear on this moment (your own view, not objective fact):": "你与和此刻相关的人的关系(是你自己的看法,不是客观事实):",
|
|
119
|
-
" (here)": "(在场)",
|
|
120
|
-
" (not here)": "(不在场)",
|
|
121
|
-
"knows them well": "很了解对方",
|
|
122
|
-
"barely knows them": "几乎不了解对方",
|
|
123
|
-
"trusts them": "信任对方",
|
|
124
|
-
"distrusts them": "不信任对方",
|
|
125
|
-
"is fond of them": "喜欢对方",
|
|
126
|
-
"dislikes them": "不喜欢对方",
|
|
127
|
-
"things are strained between them": "彼此关系紧张",
|
|
128
|
-
"Your affiliations (their goals are pressures and commitments, not commands):": "你的所属组织(其目标是压力和承诺,不是命令):",
|
|
129
|
-
"member": "成员",
|
|
130
|
-
" Goals: {goals}.": " 目标:{goals}。",
|
|
131
|
-
"- {name}: {position}; {status}; commitment {commitment}.": "- {name}:{position};{status};投入程度 {commitment}。",
|
|
132
|
-
" Your view: {attitude}.": " 你的看法:{attitude}。",
|
|
133
|
-
"What you remember that bears on this (only what you took in yourself; do not claim to remember more, and be unsure of what is fuzzy):": "你记得的、与此相关的事(只限你自己亲身经历的;不要声称记得更多,模糊的地方要保持不确定):",
|
|
134
|
-
"What you remember that bears on this: nothing comes to mind.": "你记得的、与此相关的事:想不起任何事。",
|
|
135
|
-
"some time ago": "一段时间以前",
|
|
136
|
-
"just now": "刚才",
|
|
137
|
-
"1 day ago": "1天前",
|
|
138
|
-
"{amount} days ago": "{amount}天前",
|
|
139
|
-
"1 hour ago": "1小时前",
|
|
140
|
-
"{amount} hours ago": "{amount}小时前",
|
|
141
|
-
"1 minute ago": "1分钟前",
|
|
142
|
-
"{amount} minutes ago": "{amount}分钟前",
|
|
143
|
-
"the details are fuzzy": "细节已经模糊",
|
|
144
|
-
"you barely remember": "你几乎记不清了",
|
|
145
|
-
"you are sure of it": "你对此确信无疑",
|
|
146
|
-
"you doubt it": "你对此存疑",
|
|
147
|
-
"something you have seen since speaks against it": "此后你所见所闻有与之相悖的地方",
|
|
148
|
-
"it comes to mind with the rest": "它和其余的事一起浮现在脑海",
|
|
149
|
-
"Earlier in this scene, before this moment:": "这一幕此刻之前发生的事:",
|
|
150
|
-
"What just happened, and what you are reacting to:": "刚才发生的事,以及你在回应的是什么:",
|
|
151
|
-
"- {name} intended: {intent} ({result}) {summary}": "- {name}打算:{intent}({result}){summary}",
|
|
152
|
-
"- {name} said \"{utterance}\" and intended: {intent} ({result}) {summary}": "- {name}说了“{utterance}”,并打算:{intent}({result}){summary}",
|
|
153
|
-
"Your earlier intent did not work out: {intent}\nYou are trying again, knowing the above. Decide again what you do now.": "你先前的打算没有成功:{intent}\n你带着上面这些再试一次。重新决定你现在做什么。",
|
|
154
|
-
"Character: {name}{summary}": "角色:{name}{summary}",
|
|
155
|
-
"What they believe now:": "他们现在的看法:",
|
|
156
|
-
"(nothing yet)": "(暂时没有)",
|
|
157
|
-
"What they have taken in since:": "他们此后经历的事:",
|
|
158
|
-
"Sort their memory.": "请整理他们的记忆。",
|
|
159
|
-
"not acceptable: {problems}": "不可接受:{problems}",
|
|
160
|
-
"{kind}, importance {importance}, {confidence}{about}{dispute}": "{kind},重要性 {importance},{confidence}{about}{dispute}",
|
|
161
|
-
", about {names}": ",关于{names}",
|
|
162
|
-
", something taken in since speaks against it": ",此后经历的事与之相悖",
|
|
163
|
-
"add: at most {max} new beliefs in one pass; merge or choose": "add:一次最多 {max} 条新看法;请合并或取舍",
|
|
164
|
-
"at most {max} changes in one pass": "一次最多 {max} 处修改",
|
|
165
|
-
"{where}: there is no thing it took in numbered {id}": "{where}:没有编号为 {id} 的经历",
|
|
166
|
-
"{where}: confidence is one of {options}": "{where}:confidence 须为 {options} 之一",
|
|
167
|
-
"{where}: unknown kind \"{kind}\"": "{where}:未知的 kind “{kind}”",
|
|
168
|
-
"{where}: say what it believes": "{where}:请写出它相信什么",
|
|
169
|
-
"{where}: at most {max} characters; say it shorter": "{where}:最多 {max} 个字符;请写得更短",
|
|
170
|
-
"{where}: importance runs from {min} to {max}": "{where}:importance 取值为 {min} 到 {max}",
|
|
171
|
-
"{where}: there is no belief numbered {id}": "{where}:没有编号为 {id} 的看法",
|
|
172
|
-
"{where}: one passing moment is not yet a belief; rest it on things from at least two different turns, or on one event that turned the story": "{where}:一个转瞬即逝的瞬间还不是看法;请以至少两个不同回合的经历为依据,或以一件扭转了故事的事件为依据",
|
|
173
|
-
"{where}: to be sure of something it must rest on things from at least two different turns": "{where}:要对某事确信,必须以至少两个不同回合的经历为依据",
|
|
174
|
-
"{where}: \"{name}\" is not a character; name them as they are named": "{where}:“{name}”不是角色;请使用他们的名字",
|
|
175
|
-
"say in a sentence what the belief claims and what the things say, before the verdict": "先用一句话说明这个看法主张什么、这些内容说了什么,再给出判断",
|
|
176
|
-
"the verdict is consistent or contradicted": "判断是 consistent 或 contradicted",
|
|
177
|
-
"a belief that can be true together with all of them names none of them": "与它们全都可以同时成立的看法,不应列出其中任何一条",
|
|
178
|
-
"name the things that cannot be true together with the belief": "写出与这个看法不可能同时成立的内容",
|
|
179
|
-
"there is no thing listed numbered {id}": "列出的内容里没有编号为 {id} 的",
|
|
180
|
-
"thing {id} came before the belief was formed": "内容 {id} 出现在这个看法形成之前",
|
|
181
|
-
"A belief held by {name}: {text}": "{name} 持有的一个看法:{text}",
|
|
182
|
-
"What they took in since that bears on it:": "此后他们接收到的、与之有关的内容:",
|
|
183
|
-
"Can the belief and each of these be true together? Name the ones that cannot be.": "这个看法与其中每一件事能否同时成立?指出不能同时成立的。",
|
|
184
|
-
"{names} could not be sorted this time and will be tried again: {reason}": "{names} 这一次没能整理,下次会再试:{reason}",
|
|
185
|
-
"{where}: belief {id} is already changed in this pass": "{where}:看法 {id} 在这一轮中已经修改过",
|
|
186
|
-
"{where}: say what it took in since that bears on it": "{where}:请写出此后与之相关的经历",
|
|
187
|
-
"{where}: thing {id} came before the belief was formed; cite what came after": "{where}:经历 {id} 发生在看法形成之前;请引用之后发生的事",
|
|
188
|
-
"{where}: say what changes": "{where}:请写出有何改变",
|
|
189
|
-
"{where}: the text must be there and at most {max} characters; leave it out to keep the belief as it is": "{where}:文字不能为空,且最多 {max} 个字符;想保持信念原样就不要写这一项",
|
|
190
|
-
"{where}: the confidence, the importance and the numbers are fields of their own, not part of the text": "{where}:把握程度、重要性和编号是各自独立的字段,不属于文字",
|
|
191
|
-
"{where}: name what speaks against the belief in contradicted_by": "{where}:在 contradicted_by 里写出与该信念相悖的内容的编号",
|
|
192
|
-
"{where}: a belief that something contradicts must be doubted: lower its confidence": "{where}:被事实相悖的看法必须存疑:请降低其 confidence",
|
|
193
|
-
"{where}: to doubt a belief, name what contradicts it in contradicted_by": "{where}:要对看法存疑,请在 contradicted_by 中写明与之相悖的经历",
|
|
194
|
-
"{where}: merge into a belief that stays": "{where}:请合并到保留的看法中",
|
|
195
|
-
"Time: {time}.": "时间:{time}。",
|
|
196
|
-
"The story's time moves only as you say: each round takes what you give it (elapsed_seconds in resolve_round, or the default), and advance_time skips ahead.": "故事的时间只按你说的推进:每一轮耗时由你给定(resolve_round 的 elapsed_seconds,或取默认值),advance_time 可以跳过一段时间。",
|
|
197
|
-
"The player was away for {duration} of real time and the story went on meanwhile: characters have been about their own business, so do not assume anyone is where or as the player left them unless the records say so.": "玩家离开了{duration}的真实时间,其间故事仍在继续:角色们各忙各的事,除非记录另有说明,不要假定任何人还在玩家离开时的位置或状态。",
|
|
198
|
-
"The story's time follows the real clock: it cannot be skipped, and each round takes as long as it really took.": "故事时间跟随真实时钟:无法跳过,每一轮耗时就是它实际花费的时间。",
|
|
199
|
-
"By their routines since you last looked: {moves}.": "按各自的日程,自你上次查看以来:{moves}。",
|
|
200
|
-
"{name} went to {place} ({activity})": "{name}去了{place}({activity})",
|
|
201
|
-
"With the player's character, and their days: {days}. The characters decide for themselves whether to keep to their day; the moment may keep them.": "与玩家角色在一起的人及其日程:{days}。是否照日程行事由角色自己决定;当下的情形也可能拖住他们。",
|
|
202
|
-
", at {place}": ",在{place}",
|
|
203
|
-
"\"{title}\" ({with}{place}) was due {when} and is still open": "“{title}”({with}{place})原定{when},仍未了结",
|
|
204
|
-
"\"{title}\" ({with}{place}) is due {when}": "“{title}”({with}{place})定于{when}",
|
|
205
|
-
"Commitments due soon or overdue: {entries}.": "即将到期或已逾期的约定:{entries}。",
|
|
206
|
-
"named in the move": "被这一步行动点到",
|
|
207
|
-
"in the scene": "在场",
|
|
208
|
-
"own goal: {goal}": "自身目标:{goal}",
|
|
209
|
-
"faction pressure: {goal}": "组织压力:{goal}",
|
|
210
|
-
"high tension toward the player": "对玩家高度紧张",
|
|
211
|
-
"distrusts the player": "不信任玩家",
|
|
212
|
-
"cares about the player": "在意玩家",
|
|
213
|
-
"dislikes the player": "不喜欢玩家",
|
|
214
|
-
"Likely characters to activate, in priority order (advice only; activate only whoever the moment actually reaches):": "可能需要启动的角色,按优先级排列(仅供参考;只启动当下真正牵涉到的人):",
|
|
215
|
-
"socially implicated": "社交上被牵涉",
|
|
216
|
-
"The player's character is in {place}": "玩家角色在{place}",
|
|
217
|
-
"Characters here:": "在这里的角色:",
|
|
218
|
-
"Characters elsewhere (they perceive nothing here unless the moment reaches them):": "在别处的角色(除非当下波及他们,否则感知不到这里的事):",
|
|
219
|
-
"{member} - in {place} ({key})": "{member} - 在{place}({key})",
|
|
220
|
-
"Characters with no place (not part of this scene; they cannot be asked to act):": "没有所在地点的角色(不属于这一幕;不能让他们行动):",
|
|
221
|
-
"the player's character, \"{key}\"": "玩家角色,“{key}”",
|
|
222
|
-
"acts through \"{key}\"": "通过“{key}”行动",
|
|
223
|
-
"Currently: {state}": "目前:{state}",
|
|
224
|
-
"Scene before turn {turn}:": "第 {turn} 回合之前的场景:",
|
|
225
|
-
"What characters have on them:": "角色们身上带着:",
|
|
226
|
-
"The world acted since the last turn, by itself:": "自上一回合以来,世界自行发生的事:",
|
|
227
|
-
"Known beforehand, still to come (who knows of it; it will happen by itself when its time comes):": "事先已知、尚未发生的事(谁知道;时候到了会自行发生):",
|
|
228
|
-
"[known to {who}]": "[知情者:{who}]",
|
|
229
|
-
"Weave these into the story when it fits, then say you did with addressed in narrate (each stays for a few turns and is then let go):": "合适时把这些织入故事,然后在 narrate 的 addressed 中说明已处理(每条会保留几个回合,之后放弃):",
|
|
230
|
-
"What the story keeps track of (change it with variable_changes in an outcome when what happened calls for it):": "故事追踪的内容(发生的事需要时,在结果中用 variable_changes 修改):",
|
|
231
|
-
"Still open in the story:": "故事中仍未了结的事:",
|
|
232
|
-
"Earlier events that bear on what the player just did (from the records of the story):": "与玩家刚才的行动相关的早先事件(来自故事记录):",
|
|
233
|
-
"turn {turn}": "第 {turn} 回合",
|
|
234
|
-
"You were to {title}, at {when}": "你本应{title},时间是{when}",
|
|
235
|
-
"You were to {title} at {place}, at {when}": "你本应在{place}:{title},时间是{when}",
|
|
236
|
-
" ({note})": "({note})",
|
|
237
|
-
"It is {now} now and the time has passed.": "现在是{now},时间已经过了。",
|
|
238
|
-
"It is {now} now.": "现在是{now}。",
|
|
239
|
-
"It was with: {who}.": "同你一起的有:{who}。",
|
|
240
|
-
"You are not with the player's character, and nothing of this happens in front of anyone: decide what you do about it.": "你不和玩家的角色在一起,这件事也不会发生在任何人面前:决定你要怎么处理。",
|
|
241
|
-
"The time you had for \"{goal}\" has passed ({when}; it is {now} now)": "你为“{goal}”预留的时间已过({when};现在是{now})",
|
|
242
|
-
"You are not with the player's character and nothing of this happens in front of anyone: decide what you do about it.": "你不和玩家的角色在一起,这件事也不会发生在任何人面前:决定你要怎么处理。",
|
|
243
|
-
"{names} noticed: {text}": "{names}注意到:{text}",
|
|
244
|
-
"{name} went to {place}.": "{name}去了{place}。",
|
|
245
|
-
"## MCP resource servers\n\nUse {tools} with the server argument naming an MCP server.": "## MCP 资源服务器\n\n使用 {tools},server 参数填 MCP 服务器的名称。",
|
|
246
|
-
"## MCP resource servers\n\nUse {tools} with one of these names as the server argument: {servers}.": "## MCP 资源服务器\n\n使用 {tools},server 参数填下列名称之一:{servers}。",
|
|
247
|
-
"{where}: the text is longer than {max} characters. A belief is not rewritten to hold what speaks against it: leave the text out and list the belief under doubt with the numbers of what speaks against it, and put what was learned as a new belief of its own": "{where}:文字超过 {max} 个字符。不要通过改写信念来容纳与之相悖的事:不要写文字,把这条信念列入 doubt 并给出与之相悖的编号;新了解到的内容另写成一条新信念"
|
|
248
|
-
};
|
|
249
|
-
//#endregion
|
|
250
|
-
//#region ../dsh-roleplay-model/src/messages.ts
|
|
251
|
-
/** The language a setting such as `zh-CN` or `en` stands for; English when it is none that is known. */
|
|
252
|
-
function languageOf$1(code) {
|
|
253
|
-
return (code ?? "").trim().toLowerCase().startsWith("zh") ? "zh" : "en";
|
|
254
|
-
}
|
|
255
|
-
const fill$1 = (template, values) => values === void 0 ? template : template.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole);
|
|
256
|
-
const CATALOGUES = { zh: ZH };
|
|
257
|
-
/**
|
|
258
|
-
* The texts the engine builds for a model (briefs, reports, refusals) in a language. The text written in the code is the English one and the key of
|
|
259
|
-
* the others; a text a language lacks is told in English, and a test keeps that from happening.
|
|
260
|
-
*/
|
|
261
|
-
function translator(language) {
|
|
262
|
-
const catalogue = language === "en" ? void 0 : CATALOGUES[language];
|
|
263
|
-
return (text, values) => fill$1(catalogue?.[text] ?? text, values);
|
|
264
|
-
}
|
|
265
|
-
//#endregion
|
|
266
31
|
//#region src/host/sessions/errors.ts
|
|
267
32
|
var WorldNotFoundError = class extends Error {};
|
|
268
33
|
/** The world cannot be played as it is; `problems` say what to fix. */
|
|
@@ -343,6 +108,8 @@ var PromptLibrary = class extends Service {
|
|
|
343
108
|
this.root = root;
|
|
344
109
|
this.shipped = shipped;
|
|
345
110
|
}
|
|
111
|
+
/** True while the prompts folder is being synced: files that are missing are then read from the package and not written, so the sync never sees a file appear. */
|
|
112
|
+
frozen = () => false;
|
|
346
113
|
get directory() {
|
|
347
114
|
return join(this.root.path, PROMPTS_FOLDER);
|
|
348
115
|
}
|
|
@@ -393,6 +160,7 @@ var PromptLibrary = class extends Service {
|
|
|
393
160
|
if (source === void 0) throw new Error(`there is no prompt ${id} in ${language} or en`);
|
|
394
161
|
const target = source.startsWith(join(this.shipped, language)) ? found : join(this.directory, "en", `${id}.md`);
|
|
395
162
|
if (!this.usable(target, id)) {
|
|
163
|
+
if (this.frozen()) return source;
|
|
396
164
|
mkdirSync(dirname(target), { recursive: true });
|
|
397
165
|
copyFileSync(source, target);
|
|
398
166
|
}
|
|
@@ -3657,6 +3425,7 @@ function installHooks(ctx, deps) {
|
|
|
3657
3425
|
if (owner === void 0 || store === void 0) return decision;
|
|
3658
3426
|
const text = payload.messages.filter((message) => message.source.kind === "user").flatMap((message) => message.content.flatMap((block) => block.type === "text" ? [block.text] : [])).join("\n");
|
|
3659
3427
|
if (!store.settings().background.concurrent) await engine.quiesce(owner.chat);
|
|
3428
|
+
await ctx.roleplayOrchestration.unitFree(owner.chat);
|
|
3660
3429
|
await timelines.begin(owner.chat, payload.turn, text);
|
|
3661
3430
|
const cast = store.cast();
|
|
3662
3431
|
const ooc = parseOoc(text);
|
|
@@ -3752,6 +3521,6 @@ function installHooks(ctx, deps) {
|
|
|
3752
3521
|
});
|
|
3753
3522
|
}
|
|
3754
3523
|
//#endregion
|
|
3755
|
-
export { listFiles as $, answerLimits as A, loadPlots as B, readNotes as C, describeWhen as D, describeTime as E, STORY_LANGUAGES as F, formatIssue as G, plotReferenceProblems as H, isStoryLanguage as I, PROMPTS_FOLDER as J, errorMessage as K, textLanguage as L, plotProgressOf as M, populatePlots as N, zoneOf as O, LANGUAGE_NAMES as P, languageOf as Q, wrongLanguage as R, notesOfSession as S, ClockError as T, readDocument as U, parsePlotsFile as V, Reader as W, copyWorldPrompts as X, PromptLibrary as Y, inheritPrompts as Z, readRunDetail as _, externalWithheld as a, InvalidWorldError as at, readWithdrawn as b, record as c, SessionNotFoundError as ct, toolEnabled as d,
|
|
3524
|
+
export { listFiles as $, answerLimits as A, loadPlots as B, readNotes as C, describeWhen as D, describeTime as E, STORY_LANGUAGES as F, formatIssue as G, plotReferenceProblems as H, isStoryLanguage as I, PROMPTS_FOLDER as J, errorMessage as K, textLanguage as L, plotProgressOf as M, populatePlots as N, zoneOf as O, LANGUAGE_NAMES as P, languageOf as Q, wrongLanguage as R, notesOfSession as S, ClockError as T, readDocument as U, parsePlotsFile as V, Reader as W, copyWorldPrompts as X, PromptLibrary as Y, inheritPrompts as Z, readRunDetail as _, externalWithheld as a, InvalidWorldError as at, readWithdrawn as b, record as c, SessionNotFoundError as ct, toolEnabled as d, promptProblem as et, MAX_OOC_ANSWER as f, readActivity as g, readDecisionStats as h, externalTools as i, InvalidStartError as it, PLOTS_METADATA_KEY as j, RESULTS as k, AUTHORING_NEEDS as l, WorldNotFoundError as lt, readUsage as m, installHooks as n, shippedPromptsDirectory as nt, PREVIEW_TOOL as o, ReflectionRefusedError as ot, storesOf as p, LANGUAGE_FOLDER as q, externalGiven as r, AgentUnavailableError as rt, createTools$1 as s, SessionArchivedError as st, externalToolLimit as t, shippedLanguages as tt, characterRunner as u, readVerdicts as v, observeAsPlayer as w, addToNote as x, writeVerdicts as y, PLOTS_FILE_NAME as z };
|
|
3756
3525
|
|
|
3757
|
-
//# sourceMappingURL=hooks-
|
|
3526
|
+
//# sourceMappingURL=hooks-HnqXO8mM.js.map
|
package/lib/images.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as withPngMetadata, a as inheritImages, c as referenceImagePath, g as readPngMetadata, i as entityImageDirectory, l as sceneImagePath, o as nextSceneSerial, s as readImageMetadata, t as addToLibrary } from "./library-
|
|
2
|
-
import { i as transientPrompt, n as generateTransientImage, r as referencePrompt, t as generateReferenceImage } from "./generator-
|
|
3
|
-
import { i as updateImage, r as listGallery } from "./gallery-
|
|
4
|
-
import { a as tokensOf, i as searchImages, n as interpretImage, o as present, r as imageTools, s as presentedFor, t as runImagePresenter } from "./presenter-agent-
|
|
1
|
+
import { _ as withPngMetadata, a as inheritImages, c as referenceImagePath, g as readPngMetadata, i as entityImageDirectory, l as sceneImagePath, o as nextSceneSerial, s as readImageMetadata, t as addToLibrary } from "./library-BGxPKs9a.js";
|
|
2
|
+
import { i as transientPrompt, n as generateTransientImage, r as referencePrompt, t as generateReferenceImage } from "./generator-BFmSYvR8.js";
|
|
3
|
+
import { i as updateImage, r as listGallery } from "./gallery-BxZGOgMb.js";
|
|
4
|
+
import { a as tokensOf, i as searchImages, n as interpretImage, o as present, r as imageTools, s as presentedFor, t as runImagePresenter } from "./presenter-agent-DvZtnf0Q.js";
|
|
5
5
|
export { addToLibrary, entityImageDirectory, generateReferenceImage, generateTransientImage, imageTools, inheritImages, interpretImage, listGallery, nextSceneSerial, present, presentedFor, readImageMetadata, readPngMetadata, referenceImagePath, referencePrompt, runImagePresenter, sceneImagePath, searchImages, tokensOf, transientPrompt, updateImage, withPngMetadata };
|