@dsh-agentic-roleplay/core 0.11.0 → 0.11.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-CXtaZNbx.js → access-Md1YTSX1.js} +4 -1
- package/lib/{authoring-tools--6V1pIIL.js → authoring-tools-BFdw7ahj.js} +72 -9
- package/lib/authoring.js +38 -8
- package/lib/client.js +761 -411
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +2 -2
- package/lib/doctor.js +3 -3
- package/lib/{gallery-CtG-bDzz.js → gallery-BWHmjogd.js} +3 -3
- package/lib/{generator-nLoPM5MF.js → generator-QCdm8nUh.js} +9 -3
- package/lib/helper.js +9 -0
- package/lib/{hooks-DORky4KT.js → hooks-C2U1-8ur.js} +676 -15
- package/lib/images.js +4 -4
- package/lib/index.js +225 -19
- package/lib/{library-CH-ahlm0.js → library-4zmCAshR.js} +3 -3
- package/lib/{lorebook-author-tools-BrVde1N-.js → lorebook-author-tools-Bjfjt3bg.js} +7 -7
- package/lib/lorebook-authoring.js +4 -4
- package/lib/{narration-B0hConSw.js → narration-b_VBEUWn.js} +7 -3
- package/lib/orchestration.js +338 -28
- package/lib/{pack-jail-Bk82pX9t.js → pack-jail-Ci9bIeDI.js} +17 -14
- package/lib/{packs-ELfh8yh1.js → packs-CYkozh8Q.js} +2 -2
- package/lib/{presenter-agent-UKbKYXMO.js → presenter-agent-CqkAL03Q.js} +10 -7
- package/lib/{preset-D9Sfc8sf.js → preset-B-35yUmt.js} +3 -3
- package/lib/{preset-author-tools-B3pFL1-e.js → preset-author-tools-BUymqZM5.js} +7 -7
- package/lib/preset-authoring.js +5 -5
- package/lib/{presets-BRt4Xsy4.js → presets-_U-xroo0.js} +27 -8
- package/lib/{reflection-CHiHsY4Y.js → reflection-B9N0z3KY.js} +9 -608
- package/lib/{text-CzqhC8sT.js → text-C2AGl7Je.js} +11 -2
- package/lib/{turn-guard-B53qOWEU.js → turn-guard-C0M3rXEN.js} +2 -2
- package/package.json +2 -2
- package/prompts/en/import/variables.md +1 -0
- package/prompts/en/roleplay/character-decide.md +1 -1
- package/prompts/en/roleplay/decide-reuse.md +3 -0
- package/prompts/en/roleplay/decide-variable.md +1 -0
- package/prompts/en/roleplay/image-presenter.md +1 -0
- package/prompts/en/roleplay/track-values.md +1 -0
- package/prompts/en/roleplay/track-variables.md +1 -0
- package/prompts/zh/import/variables.md +1 -0
- package/prompts/zh/roleplay/character-decide.md +1 -1
- package/prompts/zh/roleplay/decide-reuse.md +3 -0
- package/prompts/zh/roleplay/decide-variable.md +1 -0
- package/prompts/zh/roleplay/image-presenter.md +1 -0
- package/prompts/zh/roleplay/track-values.md +1 -0
- package/prompts/zh/roleplay/track-variables.md +1 -0
|
@@ -278,7 +278,16 @@ const ZH = {
|
|
|
278
278
|
"Opening:": "开场:",
|
|
279
279
|
"Description:": "描述:",
|
|
280
280
|
"Creator's notes:": "作者备注:",
|
|
281
|
-
"Document ({where}), about {subject}:": "文档({where}),关于 {subject}:"
|
|
281
|
+
"Document ({where}), about {subject}:": "文档({where}),关于 {subject}:",
|
|
282
|
+
"you already said exactly this earlier in the story: \"{line}\". Say something new that answers this moment, or give no utterance": "你在故事里早先已经一字不差地说过这句话:“{line}”。请说点回应此刻的新话,或者不说话",
|
|
283
|
+
"What the player wrote:": "玩家写的:",
|
|
284
|
+
"What the characters did and said:": "角色做的事和说的话:",
|
|
285
|
+
"What the player read:": "玩家读到的内容:",
|
|
286
|
+
"The values to look at:": "要查看的数值:",
|
|
287
|
+
"The values that changed, to be given a new value:": "已经改变、要给出新值的数值:",
|
|
288
|
+
"Now: {value}.": "现在:{value}。",
|
|
289
|
+
"the story": "故事",
|
|
290
|
+
"Changes: {rule}": "变化规则:{rule}"
|
|
282
291
|
};
|
|
283
292
|
// ../dsh-roleplay-model/src/messages.ts
|
|
284
293
|
/** The language a setting such as `zh-CN` or `en` stands for; English when it is none that is known. */
|
|
@@ -311,4 +320,4 @@ function withoutExtension(value) {
|
|
|
311
320
|
}
|
|
312
321
|
export { translator as i, withoutExtension as n, languageOf as r, trimCharacters as t };
|
|
313
322
|
|
|
314
|
-
//# sourceMappingURL=text-
|
|
323
|
+
//# sourceMappingURL=text-C2AGl7Je.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as cutOff, w as finishOf } from "./child-C9nPIy9j.js";
|
|
2
|
-
import { d as guardRepeatedCalls } from "./hooks-
|
|
2
|
+
import { d as guardRepeatedCalls } from "./hooks-C2U1-8ur.js";
|
|
3
3
|
import { ReasoningEffortId, createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
4
4
|
// src/host/authoring/turn-guard.ts
|
|
5
5
|
/**
|
|
@@ -49,4 +49,4 @@ function guardAuthoringTurns(ctx, prompts, languageOf, reasoning = () => "") {
|
|
|
49
49
|
}
|
|
50
50
|
export { guardAuthoringTurns as t };
|
|
51
51
|
|
|
52
|
-
//# sourceMappingURL=turn-guard-
|
|
52
|
+
//# sourceMappingURL=turn-guard-C0M3rXEN.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-agentic-roleplay/core",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Core plugin of the agentic roleplay bundle for DeepSeek Harness: roleplay UI, orchestration and storage.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Firefox2100",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@deepseek-ai/schemastery": "^3.18.5"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@dsh-agentic-roleplay/state": "0.11.
|
|
81
|
+
"@dsh-agentic-roleplay/state": "0.11.1",
|
|
82
82
|
"@dsh-ai-providers/core": "^0.6.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
@@ -2,5 +2,6 @@ You find what a character card keeps track of in its story and write it as the d
|
|
|
2
2
|
A variable is a number (affection, money, health, a day count, a level), a flag (true or false: has something happened, does someone know something) or a choice (one of a few named states). Declare only what the card clearly keeps track of: status panels, stat blocks, counters, progress or levelling rules, relationship meters. Do not invent anything the card does not track, and do not declare feelings (valence, arousal and dominance already exist).
|
|
3
3
|
For each: key (lowercase ASCII letters, digits and underscores, starting with a letter, like trust_meter), name, kind (number, flag or choice), subject (character, item, location or world: who or what it is about), visibility (public: everyone can see it, private: only its owner, hidden: only the game master). For a number give min and max when the card gives limits, integer when it counts whole units, and default when the card says where it starts; add bands (up_to and label: "up_to 20 is Hostile") when the card names ranges of values. For a choice give options. Use only when the card limits it to some of the characters, places or things of the list.
|
|
4
4
|
Declare every value a panel or meter shows, one variable each. What the card says about a value belongs in its fields, never in left_out: where it starts is default, its limits are min and max, whole units are integer: true, and named ranges are bands. A value of a person (money, reputation, trust) has subject character; a value of the whole story (the day, the weather) has subject world.
|
|
5
|
+
What the card says about when and how a value changes (an update rule: "raise trust by 1 when the user is kind", "fatigue goes up for each hour of hard work", an update block of a state-tracking framework) goes into update, in a sentence or two, as the card states it: what makes the value rise or fall and by how much. Never invent a rule the card does not give; leave update empty then.
|
|
5
6
|
Leave out, and list in left_out: rules of the game that are not a tracked value, formats of the output, instructions about narration, scripts, and values that belong to one moment of the story and not to the world. When the card tracks nothing, return no variables.
|
|
6
7
|
Declare at most ${max} variables in one answer, the ones the story depends on most first; when the card tracks more, you are asked again for the rest, told which are declared already.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Each time you are asked, decide what ${name} does now and answer
|
|
1
|
+
Each time you are asked, decide what ${name} does now and answer by calling the submit_result tool, never in plain text, filling in these, in this order: thought (first, in your own voice: what you notice in the moment and what you want from it, a sentence or two and at most ${thoughtLimit} characters; no one is shown it), intent (one action, in one or two sentences and at most ${intentLimit} characters, no speech), utterance (only the words said aloud, word for word, in your own voice, at most ${utteranceLimit} characters, with no quotation marks and no description of what you do, which belongs in intent; leave it out if you stay silent) and commitment (low gives up at once, medium tries again if it is easy, high persists). Never repeat words you already said earlier in this scene: if you have nothing new to say, leave the utterance out. Write thought, intent and utterance in ${language}, even when your description is written in another language.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Does the stored picture described below show this moment of the story? Say yes only when it does: the same kind of place, the same people, and nothing in the picture that the moment contradicts. A picture of the same place at a different moment, or with something different in it, is no.
|
|
2
|
+
|
|
3
|
+
The picture: ${description}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Did what just happened change ${subject}'s “${name}”? ${description}${update} It is now ${value}. Say yes only when what happened clearly establishes a change to it by that description; events that do not touch it, or touch it only a little, are no.
|
|
@@ -2,6 +2,7 @@ You are the image presentation agent of an interactive story. You put pictures i
|
|
|
2
2
|
|
|
3
3
|
Canonical identity and transient state are separate:
|
|
4
4
|
- A visual identity contains only traits that remain stable between scenes. Use the entity's authored description and appearance. Do not put expression, pose, current clothing, activity, weather, lighting or surroundings in it. Preserve an existing identity unless the request explicitly corrects it.
|
|
5
|
+
- Negative tags name what the picture must not show for the entity: its opposites and the drift a model tends to make (a different build, hair colour or age). Never put a trait the entity has in them, and never an expression, a pose or an action.
|
|
5
6
|
- A reference image presents one entity clearly and neutrally from its canonical identity. Establish the identity first when it has none. Replace reference.png only when asked for a reference or when a missing reference is required for the task.
|
|
6
7
|
- A transient image illustrates one established moment. Its scene and each subject's transient description contain only what is visibly true now. Use only subjects named or required by the request. Private thoughts and hidden things are not visible.
|
|
7
8
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
For each tracked value listed, say its new value after what has just happened: a number for a number (within its bounds), true or false for a flag, one of its words for a choice. Move a number by an amount that fits what happened and the value's own description. Give a value only for the keys listed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
You look at what has just happened in an interactive story and say, for each tracked value listed, whether it changed. A value changes only when what happened clearly establishes a change by that value's own description; events that do not touch it, or touch it only a little, leave it as it is. Answer with every key listed, each with true or false.
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
变量可以是数字(好感度、金钱、生命、天数、等级)、标记(真或假:某事是否发生过,某人是否知道某事)或选项(几个有名字的状态之一)。只声明卡片明确记录的东西:状态栏、数值面板、计数器、进度或升级规则、关系指标。不要发明卡片没有记录的东西,也不要声明情绪(效价、唤醒度和支配度已经存在)。
|
|
3
3
|
每个变量写:key(小写 ASCII 字母、数字和下划线,以字母开头,例如 trust_meter)、name、kind(number、flag 或 choice)、subject(character、item、location 或 world:它是关于谁或什么的)、visibility(public:所有人可见,private:只有拥有者可见,hidden:只有主持人可见)。数字在卡片给出范围时写 min 和 max,按整数计数时写 integer,卡片说明起点时写 default;卡片给出数值区间的名称时写 bands(up_to 和 label,例如“20 以下是敌对”)。选项写 options。只有当卡片把它限定给列表中的部分角色、地点或物品时才写 only。
|
|
4
4
|
面板或指标显示的每个数值都要声明,一个数值一个变量。卡片对数值说过的话要写进它的字段,不要列入 left_out:起点是 default,范围是 min 和 max,整数计数写 integer: true,有名字的区间写 bands。属于玩家的数值(金钱、声望)subject 为 character;整个故事共有的数值(日期、天气)subject 为 world。
|
|
5
|
+
卡片对数值何时、如何变化的说明(更新规则:“用户友善时信任加 1”“每干一小时重活疲劳就上升”,或状态追踪框架的更新块)写进 update,用一两句话照卡片所述写出:什么会使数值上升或下降,幅度多大。绝不编造卡片没有给出的规则;没有时 update 留空。
|
|
5
6
|
不要保留,并列入 left_out:不属于被追踪数值的游戏规则、输出格式、关于叙述的指令、脚本,以及只属于故事某一刻而不属于世界的数值。卡片没有追踪任何东西时,不返回变量。
|
|
6
7
|
一次回答最多声明 ${max} 个变量,先写故事最依赖的那些;卡片追踪的更多时,会再次询问其余的,并告诉你已经声明了哪些。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
每次被询问时,决定${name}
|
|
1
|
+
每次被询问时,决定${name}此刻做什么,并且通过调用 submit_result 工具来回答,不要用普通文字回答;按这个顺序填写:thought(先用你自己的口吻写:你在此刻注意到了什么、想要什么,一两句话,最多${thoughtLimit}个字;不会展示给任何人)、intent(一个动作,一两句话,最多${intentLimit}个字,不含台词)、utterance(只写说出口的话,一字不差,用你自己的口吻,最多${utteranceLimit}个字,不加引号,也不描写你的动作,那些属于 intent;保持沉默就省略)和 commitment(low 表示立刻放弃,medium 表示容易的话会再试一次,high 表示坚持不懈)。 不要重复你在这一场景里已经说过的话:没有新的话要说,就不要写 utterance。 thought、intent 和 utterance 都用${language}写,即使你的描述是用另一种语言写的。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
刚才发生的事是否改变了${subject}的“${name}”?${description}${update} 它现在是 ${value}。只有当发生的事按这段描述明确确立了对它的改变时才回答是;没有触及它,或只轻微触及它的事件,都回答否。
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
固定身份与瞬时状态是分开的:
|
|
4
4
|
- 视觉身份(visual identity)只包含在不同场景之间保持稳定的特征。使用该实体已有的描述和外貌。不要把表情、姿势、当前的衣着、活动、天气、光线或周围环境放进去。除非请求明确要求更正,否则保留已有的身份。
|
|
5
|
+
- 负面标签(negative tags)写画面不得出现的东西:该实体的反面,以及模型容易出现的偏差(不同的体型、发色或年龄)。绝不把该实体具有的特征写进去,也不写表情、姿势或动作。
|
|
5
6
|
- 参考图(reference image)依据固定身份,清晰而中性地呈现一个实体。实体还没有身份时,先确立身份。只有当被要求生成参考图,或任务需要而参考图缺失时,才替换 reference.png。
|
|
6
7
|
- 瞬时图像(transient image)描绘一个已经确立的时刻。场景以及每个对象的瞬时描述只包含此刻看得见的真实情况。只使用请求点名或必需的对象。私下的想法和隐藏的东西是看不见的。
|
|
7
8
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
针对列出的每个被追踪的数值,说出刚刚发生的事之后它的新值:数字就给数字(在它的范围内),标记就给 true 或 false,选项就给其中一个词。数字的变动幅度要符合发生的事和该数值自己的描述。只为列出的键给值。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
你查看一个互动故事里刚刚发生的事,并针对列出的每个被追踪的数值,说明它是否发生了变化。只有当发生的事按该数值自己的描述明确确立了变化时,它才算变化;没有触及它,或只轻微触及它的事件,让它保持原样。为列出的每个键都给出回答,各为 true 或 false。
|