@dsh-agentic-roleplay/core 0.12.7 → 0.13.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.
Files changed (38) hide show
  1. package/lib/{authoring-tools-Bi9YQ9QH.js → authoring-tools-CKV1UnN7.js} +1089 -129
  2. package/lib/authoring.js +130 -37
  3. package/lib/client.js +1251 -662
  4. package/lib/client.js.map +1 -1
  5. package/lib/doctor.js +1 -1
  6. package/lib/{gallery-BT5lf-T5.js → gallery-CT5uj50b.js} +2 -2
  7. package/lib/{hooks-DR-HqE50.js → hooks-CnxV2uEh.js} +43 -16
  8. package/lib/images.js +3 -3
  9. package/lib/index.js +336 -15
  10. package/lib/{interpreter-BYNrjYZo.js → interpreter-Cz5qsuXk.js} +3 -3
  11. package/lib/{lorebook-author-tools-BI-r8fEt.js → lorebook-author-tools-p3Nfpuxh.js} +6 -6
  12. package/lib/lorebook-authoring.js +5 -5
  13. package/lib/orchestration.js +15 -10
  14. package/lib/{pack-jail-Y1XPbqHw.js → pack-jail-KyZen_gy.js} +9 -9
  15. package/lib/{packs-DD-v-Epl.js → packs-DU171pDX.js} +2 -2
  16. package/lib/{presenter-agent-00sOVGI9.js → presenter-agent-CwDg0WE8.js} +2 -2
  17. package/lib/{preset-Bnx3jhUv.js → preset-BO8iWQ-n.js} +3 -3
  18. package/lib/{preset-author-tools-DYrBcieA.js → preset-author-tools-C83shASm.js} +6 -6
  19. package/lib/preset-authoring.js +5 -5
  20. package/lib/{reflection-DqxoV9xE.js → reflection-CXS87Di3.js} +6 -6
  21. package/lib/{serial-CS46qAvI.js → serial-xcAG57p_.js} +148 -38
  22. package/lib/{text-B-HsLdb-.js → text-KnqhN_Zv.js} +4 -1
  23. package/lib/{turn-guard-bZkxzRXJ.js → turn-guard-CfsGepCg.js} +2 -2
  24. package/package.json +2 -2
  25. package/prompts/en/import/next-stage-go.md +1 -0
  26. package/prompts/en/import/next-stage-paused.md +1 -0
  27. package/prompts/en/import/next-survey-paused.md +1 -0
  28. package/prompts/en/import/notice-staged.md +5 -0
  29. package/prompts/en/import/pause-stages.md +1 -0
  30. package/prompts/en/import/pause-survey.md +1 -0
  31. package/prompts/en/world/procedure.md +3 -0
  32. package/prompts/zh/import/next-stage-go.md +1 -0
  33. package/prompts/zh/import/next-stage-paused.md +1 -0
  34. package/prompts/zh/import/next-survey-paused.md +1 -0
  35. package/prompts/zh/import/notice-staged.md +5 -0
  36. package/prompts/zh/import/pause-stages.md +1 -0
  37. package/prompts/zh/import/pause-survey.md +1 -0
  38. package/prompts/zh/world/procedure.md +3 -0
@@ -0,0 +1 @@
1
+ stop after the survey and after every stage. After the survey report who and what the world is made of (names, by kind, and who the player plays) and what looked doubtful, and wait; change what the person says is wrong with ${surveyEdit}. After a stage say in a few sentences what it wrote (counts and names), what failed or was left out and why, what is left, and ask whether to go on and whether they have a note for the next stage (it goes in guidance). Do not run the next stage in the same turn. The person may ask to see a document (${show}), to compare a part with the card, or to run a stage again. Before ${finish} say that it writes the world and ask.
@@ -0,0 +1 @@
1
+ stop after the survey and report: how many pieces and what they are, who and what the world is made of (names, by kind, and who the player plays), and what looked doubtful (the survey tells you; you may look at it with ${surveyShow}). Ask whether it is right and wait. Change what the person says is wrong with ${surveyEdit}, and tell them what you changed. When they agree, run every stage in order, one ${stage} call each, then ${finish}, without stopping again.
@@ -1 +1,4 @@
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, 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.
2
+
3
+
4
+ Before the first edit of each turn the world's files are copied into a checkpoint. When the user wants something undone, or asks what you changed, use list_world_checkpoints, diff_world_checkpoint and read_world_checkpoint_file to see what an earlier version held, and put it back with the editing tools; say what you put back. Restoring the whole world is the user's to do in the editor. After they restore it you are told: read the world again before you edit.
@@ -0,0 +1 @@
1
+ 接下来请调用 ${next},card 参数为“${card}”。
@@ -0,0 +1 @@
1
+ 请在这里停下,按这次导入的暂停规则向用户汇报:这个阶段写了什么,哪些失败或被略去及原因,还剩什么(${left})。不要在这一轮里运行下一个阶段。
@@ -0,0 +1 @@
1
+ 请在这里停下,按这次导入的暂停规则向用户汇报:世界由哪些人和事物构成,以及哪些地方存疑。先不要运行任何阶段。
@@ -0,0 +1,5 @@
1
+ 这一轮是把一张角色卡导入这个全新的空世界,由用户通过 /import-st 命令发起。你和用户一起完成它:你做一步,用几句简短的话告诉他这一步做了什么、还剩什么,并按下面的暂停规则停下。导入完成之前,不要自己去修改世界(世界只由 ${finish} 写入),除了暂停规则允许的,也不要向用户提问。
2
+ 你的工具,参数 card 都是“${card}”:${status}(导入进行到哪里:哪些阶段已完成、待做或已过期)、${survey}(读卡片,说明每一段是什么,列出世界由哪些人和事物构成)、${surveyShow} 和 ${surveyEdit}(查看调查结果,在用户说有误时修改它:修改会被保留)、${stage}(写世界的一个部分;阶段依次是 ${stages};每个阶段需要一些时间,用户对它的要求写在 guidance 里)、${show}(某个阶段暂存的内容,可完整查看一份文档)、${audit}(某个阶段漏掉了什么)、${finish}(写入世界并整体检查)。卡片工具(card_overview、card_search、card_read)可以把任何内容与卡片本身对照。
3
+ 这次导入的暂停规则是“${pause}”:${policy}
4
+ 导入目前处于“${phase}”${done}。先调用 ${status}。
5
+ 当 ${finish} 报告成功后,像一位细心的编辑那样检查这个世界,并纠正导入出错的地方(按 ${finish} 的提示)。然后用几句简短的话告诉用户:导入了什么(数量)、略去了什么以及原因、世界里是否有可扮演的角色(如果没有,说明没有找到,并说你可以添加一个)、以及备注中值得他们知道的内容。然后就停下。
@@ -0,0 +1 @@
1
+ 调查结束后停下,每个阶段结束后也停下。调查之后汇报世界由哪些人和事物构成(按类别列出名字,以及玩家扮演谁)和存疑之处,然后等待;用户说有误的地方,用 ${surveyEdit} 修改。每个阶段之后用几句话说明:它写了什么(数量和名字)、哪些失败或被略去及原因、还剩什么,并问是否继续、对下一个阶段有没有要求(写在 guidance 里)。不要在同一轮里运行下一个阶段。用户可以要求查看某份文档(${show})、把某个部分与卡片对照,或重新运行某个阶段。调用 ${finish} 之前说明它会写入世界,并征求同意。
@@ -0,0 +1 @@
1
+ 调查结束后停下并汇报:有多少段、各是什么,世界由哪些人和事物构成(按类别列出名字,以及玩家扮演谁),以及哪些地方存疑(调查会告诉你,也可以用 ${surveyShow} 查看)。问用户是否正确,然后等待。用户说有误的地方,用 ${surveyEdit} 修改,并告诉他你改了什么。用户同意后,按顺序运行每个阶段,每个阶段调用一次 ${stage},然后调用 ${finish},中途不再停下。
@@ -1 +1,4 @@
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 对照原文核实。如果这些工具说没有卡,说明这个世界不是导入的,或者卡已被移除。
2
+
3
+
4
+ 每个回合第一次修改之前,世界的文件会被复制成一个检查点。用户想撤销某些修改,或问你改了什么时,用 list_world_checkpoints、diff_world_checkpoint 和 read_world_checkpoint_file 查看更早的版本是什么样,再用编辑工具把它改回去,并说明你改回了什么。还原整个世界由用户在编辑器里操作;他们还原之后你会收到通知:修改之前先重新读取世界。