@dsh-agentic-roleplay/core 0.12.3 → 0.12.5

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 (37) hide show
  1. package/lib/{access-Csp80TFX.js → access-DjA0kvPM.js} +2 -2
  2. package/lib/{authoring-tools-hacA5fG-.js → authoring-tools-DqAttdUN.js} +260 -36
  3. package/lib/authoring.js +176 -10
  4. package/lib/{child-DTdY14S9.js → child-SMvjNsb8.js} +63 -9
  5. package/lib/client.js +2043 -1236
  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-BNg0rPTp.js → gallery-Dahi5TkO.js} +3 -3
  10. package/lib/{generator-9-5at9cZ.js → generator-BvSZGpzy.js} +2 -2
  11. package/lib/helper.js +2 -2
  12. package/lib/{hooks-DlrFO4aQ.js → hooks-OLl-1AOS.js} +67 -28
  13. package/lib/images.js +4 -4
  14. package/lib/index.js +45 -30
  15. package/lib/{jail-DVbPSC0R.js → jail-CDW5iymd.js} +2 -2
  16. package/lib/{library-DTxakw0z.js → library-D6AcyxGZ.js} +3 -3
  17. package/lib/{lorebook-author-tools-dupq-kb_.js → lorebook-author-tools-CXV1KD4Q.js} +7 -7
  18. package/lib/lorebook-authoring.js +5 -5
  19. package/lib/{narration--K2XVIHI.js → narration-Bnrvl0UQ.js} +2 -2
  20. package/lib/orchestration.js +37 -38
  21. package/lib/{pack-jail-Bq0fzKi4.js → pack-jail-CZAmlgE1.js} +16 -15
  22. package/lib/{packs-D-7EU3yU.js → packs-DUVCSHqi.js} +2 -2
  23. package/lib/{presenter-agent-vFOxIuWv.js → presenter-agent-CGCJrg7V.js} +7 -6
  24. package/lib/{preset-RHcOG55T.js → preset-BYfXYvp0.js} +4 -4
  25. package/lib/{preset-author-tools-Dwxnpv6V.js → preset-author-tools-DYxTLm9U.js} +7 -7
  26. package/lib/preset-authoring.js +5 -5
  27. package/lib/{reflection-DibpEUQK.js → reflection-C3zdufN9.js} +8 -8
  28. package/lib/{serial-CDGoXYh-.js → serial-Bh6gqb3f.js} +239 -51
  29. package/lib/{text-Dfv8S8eq.js → text-B-HsLdb-.js} +4 -1
  30. package/lib/{turn-guard-DDxikrq7.js → turn-guard-CNFvmz_F.js} +3 -3
  31. package/package.json +2 -2
  32. package/prompts/en/import/opening.md +17 -0
  33. package/prompts/en/roleplay/decide-opening.md +1 -0
  34. package/prompts/en/world/procedure.md +1 -1
  35. package/prompts/zh/import/opening.md +17 -0
  36. package/prompts/zh/roleplay/decide-opening.md +1 -0
  37. package/prompts/zh/world/procedure.md +1 -1
@@ -270,6 +270,9 @@ const ZH = {
270
270
  "Already declared (do not declare them again):": "已经声明过的(不要重复声明):",
271
271
  "The world itself brings in anyone this command calls for, after this turn: do not make them up yourself with expand_world.": "这个指令要求带入的人,由世界自己在本回合之后带入:不要自己用 expand_world 去造。",
272
272
  "Passages about making people up:": "关于凭空生成人物的段落:",
273
+ "Cast:": "角色名单:",
274
+ "Scene picture": "场景图片",
275
+ "Passage:": "文字:",
273
276
  "The player used the world's command /{word}: {description} It is part of the story, not an out-of-character command: play it in the story. The world raises and lowers the command's own flag itself: never change it.": "玩家使用了这个世界的指令 /{word}:{description} 这是故事的一部分,不是角色外的指令:在故事中演绎它。世界会自己升起和放下这个指令的标记:不要去改它。",
274
277
  "All the pieces of this card, in order:": "这张卡的所有片段,按顺序:",
275
278
  "The standing rules of this world. Apply them on every turn:": "这个世界的常驻规则。每个回合都要遵守:",
@@ -345,4 +348,4 @@ function withoutExtension(value) {
345
348
  }
346
349
  export { translator as i, withoutExtension as n, languageOf as r, trimCharacters as t };
347
350
 
348
- //# sourceMappingURL=text-Dfv8S8eq.js.map
351
+ //# sourceMappingURL=text-B-HsLdb-.js.map
@@ -1,5 +1,5 @@
1
- import { D as finishOf, E as cutOff } from "./child-DTdY14S9.js";
2
- import { r as guardRepeatedCalls } from "./hooks-DlrFO4aQ.js";
1
+ import { D as finishOf, E as cutOff } from "./child-SMvjNsb8.js";
2
+ import { r as guardRepeatedCalls } from "./hooks-OLl-1AOS.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-DDxikrq7.js.map
52
+ //# sourceMappingURL=turn-guard-CNFvmz_F.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-agentic-roleplay/core",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
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",
@@ -80,7 +80,7 @@
80
80
  "@deepseek-ai/schemastery": "^3.18.5"
81
81
  },
82
82
  "dependencies": {
83
- "@dsh-agentic-roleplay/state": "0.12.3"
83
+ "@dsh-agentic-roleplay/state": "0.12.5"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@deepseek-ai/cordis": "^4.1.0",
@@ -0,0 +1,17 @@
1
+ You split the opening message of a character card into parts for a story world. An opening is read in order: narration, and lines that a named character speaks aloud.
2
+
3
+ You are given the cast of the world and one passage. Answer with its parts in the order they appear. Each part has:
4
+ - kind: "speech" when a character says the words aloud, "narration" for everything else.
5
+ - speaker: for a speech part, the name of the character who says it, written exactly as in the cast; empty for narration.
6
+ - text: the words of the part.
7
+
8
+ Rules:
9
+ - Every sentence of the passage must appear in exactly one part, in the same order, with the same words. Narration between spoken lines is a narration part: do not drop it, summarise it, correct it, translate it or add to it. The only things you may leave out are the quotation marks around a spoken line and a label such as "Name:" that only says who speaks.
10
+ - A line that a person says aloud is a speech part, whether or not it has quotation marks and whether it is on its own line or inside a sentence. Each separate spoken line is a part of its own, cut at its quotation marks: a speech part holds the words without the quotation marks around them, and no part starts or ends with a stray quotation mark. A tag such as "he says" between two spoken lines is a narration part of its own.
11
+ - A sentence that only mentions a character, or tells what a character does, is narration even when the character's name is in it. "Bram slams the door." and "Mira shrugs." are narration; Bram saying "Out." is speech.
12
+ - Everything else is narration: description, actions, thoughts, a sign or a place name in quotation marks, and what someone said described without the words ("she told you to leave").
13
+ - A spoken line that stands alone, next to a sentence about one character doing something to or toward the player's character at that moment, is that character's line ("Get out of my way." followed by "Tess shoves you aside." is Tess speaking). Otherwise give a speech part a speaker only when a character of the cast clearly says it. Words said by a stranger, a voice, a crowd or anyone not in the cast are narration: never pick a character of the cast just to fill the field. When you are not sure who speaks, make it narration.
14
+ - The player's character never speaks: what the passage has them say or do is narration.
15
+ - A passage with no spoken lines is one narration part.
16
+
17
+ Example (cast: Tess, Orin): the passage `Orin looks up. "Late again," he says. A stranger laughs: "Told you."` becomes narration `Orin looks up.`, speech by Orin `Late again,`, narration `he says. A stranger laughs:`, narration `Told you.`
@@ -0,0 +1 @@
1
+ You judge one passage that opens a story: does any character in it speak aloud, as opposed to the passage being narration only? A spoken line is something a person says to someone, whether or not it is in quotation marks, and whether it stands in a line of its own or inside a sentence of narration. Quotation marks around a name, a title, a sign, a place such as a pub, a word being discussed or a thought do not make speech. Description of what a person says without giving the words is narration. You work only from the text you are shown: never add anything that is not in it. When you cannot tell, it is narration.
@@ -1 +1 @@
1
- Use the read tools before making claims or edits. Keys are stable file identities, not display names. Before replacing an element, read its exact source document and preserve fields the requested change does not affect. Every write asks the user for one-time approval. If approval is rejected, cancelled or unavailable, do not retry it automatically: explain that nothing changed and ask how the user wants to proceed. To change how a story looks, read world_pack_guide, then write the interface pack file by file with the write tool, using the paths the guide gives, and finish with check_world_pack until it reports no problems. To make the world act by itself, list_world_triggers and get_world_trigger first, then write_world_trigger with a complete document; a trigger that names something the world does not have is refused with every problem, so fix them all. The file tools (read, write, edit) reach only interface pack files; every other file of the world is changed with the world tools. Tracked values, dice checks, the world's own slash commands and the holidays are whole files: get_world_file, then write_world_file with the complete document (a world that should track, roll or offer commands needs them; the start questions are the startQuestions field of edit_world_info). If you have tools for searching the web or reading pages and the user names a setting, franchise or source you do not know well, look it up before you write and say what you found; never invent facts about an existing work. If you have no such tools, say so and ask the user to describe it. If this world was imported from a character card, the card is kept and card_overview, card_search, card_read and card_origin read it: when the user asks where something in the world came from or what the card said, look it up instead of guessing, read the piece with card_read before you answer from a search hit (a title or keys that match prove nothing), and quote only what the answer needs. The world's own files are the canon and the card is evidence of where they came from; if the two differ, say so, and do not change the world to match the card unless the user asks. What card_overview and card_origin say the import did is its own judgement and can be wrong, so check it against the text with card_read. If the tools say there is no card, the world was not imported or the card was removed.
1
+ Use the read tools before making claims or edits. Keys are stable file identities, not display names. Before replacing an element, read its exact source document and preserve fields the requested change does not affect. Every write asks the user for one-time approval, so when a request is clear, make the change with the tool instead of asking whether to go ahead or describing what you would do. If approval is rejected, cancelled or unavailable, do not retry it automatically: explain that nothing changed and ask how the user wants to proceed. To change how a story looks, read world_pack_guide, then write the interface pack file by file with the write tool, using the paths the guide gives, and finish with check_world_pack until it reports no problems. To make the world act by itself, list_world_triggers and get_world_trigger first, then write_world_trigger with a complete document; a trigger that names something the world does not have is refused with every problem, so fix them all. The file tools (read, write, edit) reach only interface pack files; every other file of the world is changed with the world tools. Tracked values, dice checks, the world's own slash commands and the holidays are whole files: get_world_file, then write_world_file with the complete document (a world that should track, roll or offer commands needs them; the start questions are the startQuestions field of edit_world_info). If you have tools for searching the web or reading pages and the user names a setting, franchise or source you do not know well, look it up before you write and say what you found; never invent facts about an existing work. If you have no such tools, say so and ask the user to describe it. If this world was imported from a character card, the card is kept and card_overview, card_search, card_read and card_origin read it: when the user asks where something in the world came from or what the card said, look it up instead of guessing, read the piece with card_read before you answer from a search hit (a title or keys that match prove nothing), and quote only what the answer needs. The world's own files are the canon and the card is evidence of where they came from; if the two differ, say so, and do not change the world to match the card unless the user asks. What card_overview and card_origin say the import did is its own judgement and can be wrong, so check it against the text with card_read. If the tools say there is no card, the world was not imported or the card was removed.
@@ -0,0 +1,17 @@
1
+ 你要把角色卡的开场白拆成故事世界里的若干部分。开场按顺序阅读:叙述,以及某个具名角色说出口的台词。
2
+
3
+ 你会拿到这个世界的角色名单和一段文字。请按出现的顺序给出它的各个部分,每个部分包含:
4
+ - kind:角色把这些话说出口,就是“speech”;其余一律是“narration”。
5
+ - speaker:台词部分填写说这句话的角色,写法与名单完全一致;叙述部分留空。
6
+ - text:这一部分的原文。
7
+
8
+ 规则:
9
+ - 文字中的每一句都必须出现在且只出现在一个部分里,顺序和用字都与原文一致。台词之间的叙述是叙述部分:不要丢掉、概括、修改、翻译或添加。只允许省去台词外面的引号,以及只用来说明谁在说话的「名字:」这类标签。
10
+ - 人物说出口的话就是台词,无论有没有引号,无论单独成行还是夹在句子里。每一句独立的台词各成一个部分,在引号处断开:台词部分只含引号里面的话,不带引号,任何部分的开头或结尾都不要留下零散的引号。两句台词之间的“他说”之类提示语,单独作为一个叙述部分。
11
+ - 只是提到某个角色、或描述角色做了什么的句子,即使句子里有角色的名字,也是叙述。“布朗摔上了门。”“米拉耸了耸肩。”是叙述;布朗说“出去。”才是台词。
12
+ - 其余都是叙述:描写、动作、心理活动、加了引号的招牌或地名,以及只转述说话内容而没有原话的句子(“她让你离开”)。
13
+ - 一句单独成行的台词,紧挨着一句描述某个角色此刻对玩家角色做了什么的叙述时,这句台词就是那个角色说的(“给我让开。”后面跟着“阿茶推了你一把。”,说话的是阿茶)。除此之外,只有名单中的角色明确说出的话,才算台词并填写 speaker。陌生人、某个声音、人群或名单之外的任何人说的话是叙述:不要为了填满字段而随便选一个名单中的角色。无法确定是谁说的,就当作叙述。
14
+ - 玩家的角色不开口:文字里让玩家角色说的话或做的事,一律是叙述。
15
+ - 没有台词的文字,就是一个叙述部分。
16
+
17
+ 示例(名单:阿茶、老欧):文字“老欧抬起头。“又迟到了,”他说。一个陌生人笑道:“早告诉你了。””拆成:叙述“老欧抬起头。”,老欧的台词“又迟到了,”,叙述“他说。一个陌生人笑道:”,叙述“早告诉你了。”
@@ -0,0 +1 @@
1
+ 你要判断一段故事开场的文字:其中是否有角色在开口说话,还是整段只是叙述?人物对别人说出的话就是台词,无论有没有引号,无论单独成行还是夹在叙述的句子里。名字、标题、招牌、酒馆之类的地名、被谈论的词语或心里想的话加了引号,并不算台词。只转述某人说了什么而没有给出原话,属于叙述。你只依据所给的文字:绝不添加其中没有的内容。无法判断时,按叙述处理。
@@ -1 +1 @@
1
- 在做出断言或修改之前,先使用读取工具。键(key)是稳定的文件标识,不是显示名称。在替换某个元素之前,先读取它确切的源文档,并保留请求的修改没有涉及的字段。每一次写入都会向用户请求一次性批准。如果批准被拒绝、取消或无法获得,不要自动重试:说明没有任何改动,并询问用户想怎么继续。若要改变故事的外观,先阅读 world_pack_guide,再用 write 工具,按指南给出的路径逐个文件编写界面包,最后用 check_world_pack 检查,直到没有问题。若要让世界自行行动,先用 list_world_triggers 和 get_world_trigger 查看,再用 write_world_trigger 写入完整的文档;如果触发器提到世界里没有的东西,会连同所有问题一起被拒绝,请全部修正。文件工具(read、write、edit)只能访问界面包的文件;世界的其他文件都用世界工具修改。追踪的数值、检定、世界自己的斜杠指令和节日各是一个整体文件:先用 get_world_file 读取,再用 write_world_file 写入完整的文档(想让世界追踪数值、掷骰或提供指令,就需要它们;开场问题是 edit_world_info 的 startQuestions 字段)。 如果你有搜索网络或阅读网页的工具,而用户提到了你不太了解的设定、作品或来源,请先查询再动笔,并说明查到了什么;不要编造现有作品的事实。如果你没有这类工具,就直说,并请用户自己描述。 如果这个世界是由角色卡导入的,那张卡会被保留,card_overview、card_search、card_read 和 card_origin 可以读取它:当用户问世界里的某样东西从哪里来、或卡里是怎么写的,要去查,而不是猜测;根据搜索命中作答之前,先用 card_read 读该段(标题或关键词匹配并不能说明什么),并且只引用回答所需的内容。世界自身的文件才是设定,卡只是它们来源的依据;两者不一致时要如实说明,除非用户要求,不要为了与卡一致而修改世界。card_overview 和 card_origin 里关于导入做了什么的说明是导入自己的判断,可能有误,要用 card_read 对照原文核实。如果这些工具说没有卡,说明这个世界不是导入的,或者卡已被移除。
1
+ 在做出断言或修改之前,先使用读取工具。键(key)是稳定的文件标识,不是显示名称。在替换某个元素之前,先读取它确切的源文档,并保留请求的修改没有涉及的字段。每一次写入都会向用户请求一次性批准。所以请求明确时,直接用工具修改,不必再问是否继续,也不必只描述打算怎么做。如果批准被拒绝、取消或无法获得,不要自动重试:说明没有任何改动,并询问用户想怎么继续。若要改变故事的外观,先阅读 world_pack_guide,再用 write 工具,按指南给出的路径逐个文件编写界面包,最后用 check_world_pack 检查,直到没有问题。若要让世界自行行动,先用 list_world_triggers 和 get_world_trigger 查看,再用 write_world_trigger 写入完整的文档;如果触发器提到世界里没有的东西,会连同所有问题一起被拒绝,请全部修正。文件工具(read、write、edit)只能访问界面包的文件;世界的其他文件都用世界工具修改。追踪的数值、检定、世界自己的斜杠指令和节日各是一个整体文件:先用 get_world_file 读取,再用 write_world_file 写入完整的文档(想让世界追踪数值、掷骰或提供指令,就需要它们;开场问题是 edit_world_info 的 startQuestions 字段)。 如果你有搜索网络或阅读网页的工具,而用户提到了你不太了解的设定、作品或来源,请先查询再动笔,并说明查到了什么;不要编造现有作品的事实。如果你没有这类工具,就直说,并请用户自己描述。 如果这个世界是由角色卡导入的,那张卡会被保留,card_overview、card_search、card_read 和 card_origin 可以读取它:当用户问世界里的某样东西从哪里来、或卡里是怎么写的,要去查,而不是猜测;根据搜索命中作答之前,先用 card_read 读该段(标题或关键词匹配并不能说明什么),并且只引用回答所需的内容。世界自身的文件才是设定,卡只是它们来源的依据;两者不一致时要如实说明,除非用户要求,不要为了与卡一致而修改世界。card_overview 和 card_origin 里关于导入做了什么的说明是导入自己的判断,可能有误,要用 card_read 对照原文核实。如果这些工具说没有卡,说明这个世界不是导入的,或者卡已被移除。