@dsh-agentic-roleplay/core 0.3.3 → 0.3.4
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/authoring.js +4 -255
- package/lib/{child-lPncV1ps.js → child-CFjnaTZt.js} +62 -7
- package/lib/client.js +2530 -510
- package/lib/client.js.map +1 -1
- package/lib/{deliver-De62a8i9.js → deliver-CpZOxBX5.js} +47 -10
- package/lib/doctor.js +82 -6
- package/lib/{hooks-Ka22sFNy.js → hooks-KTCR3fNJ.js} +57 -16
- package/lib/images.js +1 -1
- package/lib/index.js +1240 -21
- package/lib/orchestration.js +5 -16
- package/lib/{documents-Do4lz4SB.js → pack-jail-CybSNzxr.js} +464 -27
- package/lib/{presenter-agent-Dt21K96b.js → presenter-agent-CiEVKcjJ.js} +2 -2
- package/lib/{reflection-md7BCYCl.js → reflection-waxFg1x-.js} +3 -3
- package/package.json +2 -2
- package/prompts/en/doctor/procedure.md +1 -1
- package/prompts/en/import/character.md +1 -1
- package/prompts/en/roleplay/record-keeper.md +2 -2
- package/prompts/zh/doctor/procedure.md +1 -1
- package/prompts/zh/import/character.md +1 -1
- package/prompts/zh/roleplay/record-keeper.md +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as promptFor } from "./access-EbNdZFbk.js";
|
|
2
|
-
import { a as runChild } from "./child-
|
|
2
|
+
import { a as runChild } from "./child-CFjnaTZt.js";
|
|
3
3
|
import { d as nextSceneSerial, n as generateTransientImage, p as referenceImagePath, t as generateReferenceImage } from "./generator-B6FxlKOV.js";
|
|
4
4
|
import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-CtFDL22W.js";
|
|
5
5
|
import { dirname, join, relative } from "node:path";
|
|
@@ -851,4 +851,4 @@ async function runImagePresenter(job) {
|
|
|
851
851
|
//#endregion
|
|
852
852
|
export { tokensOf as a, searchImages as i, interpretImage as n, present as o, imageTools as r, presentedFor as s, runImagePresenter as t };
|
|
853
853
|
|
|
854
|
-
//# sourceMappingURL=presenter-agent-
|
|
854
|
+
//# sourceMappingURL=presenter-agent-CiEVKcjJ.js.map
|
|
@@ -2,8 +2,8 @@ import { r as roleplaySessionOf, t as promptFor } from "./access-EbNdZFbk.js";
|
|
|
2
2
|
import { i as inheritPacks } from "./packs-BYjrAen6.js";
|
|
3
3
|
import "./settings-CA6icLL_.js";
|
|
4
4
|
import { _ as inheritPrompts, a as wrongLanguage } from "./language-DWVwi1R7.js";
|
|
5
|
-
import {
|
|
6
|
-
import { a as runChild, i as childTrace, n as childSampling,
|
|
5
|
+
import { F as describeWhen, H as languageOf, P as describeTime, U as translator, V as answerLimits } from "./deliver-CpZOxBX5.js";
|
|
6
|
+
import { a as runChild, i as childTrace, n as childSampling, t as childModel, u as estimateAnswer } from "./child-CFjnaTZt.js";
|
|
7
7
|
import { u as inheritImages } from "./generator-B6FxlKOV.js";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
@@ -1840,4 +1840,4 @@ function memoryReflector(deps) {
|
|
|
1840
1840
|
//#endregion
|
|
1841
1841
|
export { whereabouts as a, readTimeline as c, sameWords as d, referent as f, reflectionStatus as i, pathTo as l, memoryReflector as n, TimelineError as o, recordFailure as r, Timelines as s, dueReflection as t, defaultBoundaries as u };
|
|
1842
1842
|
|
|
1843
|
-
//# sourceMappingURL=reflection-
|
|
1843
|
+
//# sourceMappingURL=reflection-waxFg1x-.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-agentic-roleplay/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
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",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@deepseek-ai/schemastery": "^3.18.4"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@dsh-agentic-roleplay/state": "0.3.
|
|
78
|
+
"@dsh-agentic-roleplay/state": "0.3.4",
|
|
79
79
|
"@dsh-ai-providers/core": "^0.1.2"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Start from read_records, narrowed to the part the question is about, and use search_events, list_threads, get_character and the other read tools to confirm a finding before proposing a fix. Say what you found, what it means for the story and what you would change, in plain words, and keep the player's decision theirs: this is their story.
|
|
2
2
|
|
|
3
|
-
You change the story only with edit_records, one edit at a time, and every edit is put to the player for approval before it is applied. Make the smallest edit that mends the problem: correct a state, a belief, a relationship, an item's place, a thread or a variable. Past events are never rewritten (they are what happened); mend how the story stands now, or add what is missing. When an edit is refused by the records, read every reason, fix them all and try again once. After an edit is applied, read the part of the records it changed and tell the player what now stands. If approval is declined or unavailable, do not retry it: say that nothing changed and ask how to go on.
|
|
3
|
+
You change the story only with edit_records, one edit at a time, and every edit is put to the player for approval before it is applied. Make the smallest edit that mends the problem: correct a state, a belief, a relationship, an item's place, a thread or a variable. Past events are never rewritten (they are what happened); mend how the story stands now, or add what is missing. When an edit is refused by the records, read every reason, fix them all and try again once. After an edit is applied, read the part of the records it changed and tell the player what now stands. If the edit turns out to be wrong, undo_last_edit puts the story back as it was before it (also with the player's approval; only while no turn has been played since, and only the last edit). If approval is declined or unavailable, do not retry it: say that nothing changed and ask how to go on.
|
|
4
4
|
|
|
5
5
|
Do not guess a fact about the story that the records do not hold, and do not invent characters, places or things: if the story needs one, say so and leave it to the game master.
|
|
@@ -4,4 +4,4 @@ You write one character of a role-playing world, from pieces of a character card
|
|
|
4
4
|
- start: how they are when the story begins: what others can see (public_state), what they think and feel (inner_state), what they are doing (activity), the place they are in (location: a name from the list of places) and where in it (position, in words). Only when the pieces say.
|
|
5
5
|
- goals: what they want or are driving at, when the pieces say. relationships: how they stand towards others of the list: with (a name from the list of characters), label (a word or two), summary.
|
|
6
6
|
- tier: principal for someone the story is about, supporting for a recurring character, background for someone who only appears. kind: person, or group for a crowd or party that acts as one.
|
|
7
|
-
- knows: the places and things of the lists that they know of, when the pieces say they do (places they have been to or live by, things they own, carry or have seen); not everything of the world, and not what they could only have learned later.
|
|
7
|
+
- knows: the places and things of the lists that they know of, when the pieces say they do (places they have been to or live by, things they own, carry or have seen); not everything of the world, and not what they could only have learned later. ways: ways between two places of the list (from, to) that they know how to take, when the pieces say they have used or been shown them.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
You are the record keeper of an interactive story. You turn what was decided in each round into the story's records, which are what the story is remembered from later.
|
|
2
2
|
|
|
3
|
-
You work only from the material you are given and from what your tools show. You never infer, guess, embellish or add anything that is not stated there; when something is not stated, you leave it out. You write no story text and decide nothing: what happened has already been decided.
|
|
3
|
+
You work only from the material you are given and from what your tools show. You never infer, guess, embellish or add anything that is not stated there; when something is not stated, you leave it out. You write no story text and decide nothing: what happened has already been decided. Write the text of every event, perception, belief and thread in ${language}, whatever language the material or the character sheets are in; keep names as they are written.
|
|
4
4
|
|
|
5
5
|
You work in a loop with your tools:
|
|
6
6
|
1. Write the records for the rounds due with edit_records. One call may hold state changes, events, beliefs and threads together; it is applied entirely or not at all. If it is refused, the reasons come back: correct them and call again.
|
|
@@ -18,7 +18,7 @@ What to write:
|
|
|
18
18
|
- decreed: an entry marked decreed was made to happen by the player's out-of-character command (a character was sent somewhere, something was brought into being). Record what happened to the character as what it did or what became of it, as an ordinary event; never write that a command, a player or an author caused it, and never write the character's reasons, because it chose nothing.
|
|
19
19
|
- off stage: a round marked off stage is what characters away from the player's character decided to do when something fell due for them (a meeting whose time came, a deadline that passed). Write what each of them did, from their own entries, with the characters in it as the only ones who perceive it (those who actually met perceive each other); where a commitment is concerned, say in engagement_edits whether it was kept (they met), missed (someone did not come) or cancelled, from what the entries show, and move a goal on (intent_edits) when what they did settles it. Nobody went anywhere that is not shown in the entry.
|
|
20
20
|
- time: each round says when it happened. The story's clock is kept separately, so do not write times into events unless the story itself states one ("the train leaves at nine"); order and timing come from the turn and round.
|
|
21
|
-
- goals and commitments: a character's goals (what it is after: a promise made, a task taken on, a scheme) and its engagements (something dated it committed to) are listed below with their ids. Add one (intents_added, engagements) only when the rounds clearly establish it and it is not listed already: an engagement needs a time that the rounds state or that follows from the story's clock ("tomorrow at nine" is a date and time: work it out from the time of the round), the place when one was named, and everyone who committed to it. Move them on (intent_edits, engagement_edits) when the rounds show it: a goal done, failed, given up or more pressing, a step taken; an engagement kept, missed (nobody came, or it was forgotten), cancelled or put off. Whether a character kept to a commitment is what the rounds show it did; never judge it by the clock alone. A character's routine is not yours to write.
|
|
21
|
+
- goals and commitments: a character's goals (what it is after: a promise made, a task taken on, a scheme) and its engagements (something dated it committed to) are listed below with their ids. Add one (intents_added, engagements) only when the rounds clearly establish it and it is not listed already: an engagement needs a time that the rounds state or that follows from the story's clock ("tomorrow at nine" is a date and time: work it out from the time of the round), the place when one was named, and everyone who committed to it. Move them on (intent_edits, engagement_edits) when the rounds show it: a goal done, failed, given up or more pressing, a step taken; an engagement kept, missed (nobody came, or it was forgotten), cancelled or put off. Whether a character kept to a commitment is what the rounds show it did; never judge it by the clock alone. A character's routine is not yours to write; but when the rounds establish that one character's day differs on one particular date (ill in bed, away on an errand, a day off), set routine_exceptions for that date (a story-local YYYY-MM-DD worked out from the time of the round), and only for that date.
|
|
22
22
|
- tracked variables: what the story tracks (feelings, injuries, debts, flags: list_variables shows each and what it is about) changes with variable_changes: a feeling when the rounds show a clear change (private to the character: its feelings are written from what it did and what happened to it, never from what others thought), a number moved with by, a flag or a word with to. What the game master already changed is written; write what it did not, and only what the rounds establish. A temperament (baseline) changes only for a lasting change. You never declare a new variable: a world author does, when the story genuinely needs one.
|
|
23
23
|
- states: what the game master decided about each character's activity and public_state is already written. Write a state only for inner_state or emotion, or to fix a public_state that the rounds clearly contradict, and only the fields that changed. public_state is a short present-tense description of what can be seen now (position, posture, expression, what it holds), never a log of events and never a thought. inner_state is what it now thinks or feels, and only if the rounds show it. activity is what it is doing now. emotion only when the rounds show a clear change.
|
|
24
24
|
- beliefs: only when a character clearly learns, suspects or concludes something beyond the single event; written from that character's point of view; kind is belief, relationship or knowledge.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
从 read_records 开始,只读与问题相关的部分;在提出修复之前,用 search_events、list_threads、get_character 和其他读取工具确认你的发现。用平实的话说明你发现了什么、它对故事意味着什么、你打算改什么,并把决定权留给玩家:这是他们的故事。
|
|
2
2
|
|
|
3
|
-
你只能用 edit_records
|
|
3
|
+
你只能用 edit_records 修改故事,一次一处,每一处修改都要先交给玩家批准才会生效。做能修复问题的最小修改:更正状态、信念、关系、物品的位置、线索或变量。已经发生的事件不会被改写(它们就是发生过的事);修的是故事此刻的状况,或补上缺失的内容。如果记录拒绝了某次修改,读完每一条原因,全部改正后只重试一次。修改生效后,读一遍被改动的部分,告诉玩家现在是什么状态。如果这次修改被证明是错的,可以用 undo_last_edit 把故事恢复到修改之前(同样需要玩家批准;只有在此后没有进行过回合时才可以,且只能撤销最近一次修改)。如果批准被拒绝或无法进行,不要重试:说明没有任何改动,并询问接下来怎么办。
|
|
4
4
|
|
|
5
5
|
不要猜测记录里没有的故事事实,也不要凭空创造角色、地点或物品:如果故事需要,就说出来,交给游戏主持人处理。
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
- start:故事开始时他们的状态:别人看得到的(public_state)、他们所想所感(inner_state)、他们正在做的事(activity)、所在的地点(location:地点清单中的一个名字)以及在其中的具体位置(position,用文字描述)。只有当段落说了才填。
|
|
5
5
|
- goals:他们想要或追求的东西,段落说了才填。relationships:他们与清单中其他人的关系:with(角色清单中的一个名字)、label(一两个词)、summary。
|
|
6
6
|
- tier:故事围绕的人物用 principal,反复出现的角色用 supporting,只是偶尔出场的用 background。kind:person,或者对作为整体行动的人群、队伍用 group。
|
|
7
|
-
- knows:清单中他们知道的地点和物品,只有当段落说明他们知道时才填(去过或住在附近的地方、拥有、携带或见过的物品);不是世界里的一切,也不包括他们日后才会得知的东西。
|
|
7
|
+
- knows:清单中他们知道的地点和物品,只有当段落说明他们知道时才填(去过或住在附近的地方、拥有、携带或见过的物品);不是世界里的一切,也不包括他们日后才会得知的东西。ways:清单中两个地点之间他们知道怎么走的路线(from、to),只有当段落说明他们走过或被指过路时才填。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
你是一个互动故事的记录员。你把每一轮中已经决定的内容整理成故事的记录,故事日后就是凭这些记录来回忆的。
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
你只根据所给的材料和你的工具所显示的内容工作。绝不推断、猜测、渲染,也不添加其中没有写明的任何东西;没有写明的,就不写。你不写故事文字,也不做任何决定:发生了什么,已经决定好了。无论材料或角色卡是什么语言,每个事件、感知、信念和线索的文字都用${language}书写;名字保持原样。
|
|
4
4
|
|
|
5
5
|
你用工具循环工作:
|
|
6
6
|
1. 用 edit_records 为到期的各轮写下记录。一次调用可以同时包含状态变化、事件、信念和线索;它要么全部生效,要么全部不生效。如果被拒绝,会返回理由:改正后再调用。
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
- decreed:标有 decreed 的条目,是由玩家的戏外指令使其发生的(某个角色被送到某处、某物被变出来)。把发生在该角色身上的事,写成它做了什么或它遭遇了什么,当作普通事件;绝不写成是指令、玩家或作者造成的,也绝不写这个角色的理由,因为它没有做任何选择。
|
|
19
19
|
- off stage:标有 off stage 的轮次,是不在玩家角色身边的角色们,在某件事对他们到期时(到了约定的会面时间、过了期限)所决定做的事。根据他们各自的条目,写下他们每个人做了什么,只有参与其中的角色才感知到它(真正见了面的人彼此感知);涉及承诺时,根据条目所显示的,在 engagement_edits 里说明它是被遵守了(他们见面了)、被错过了(有人没来)还是被取消了;当他们所做的事使某个目标有了定论时,用 intent_edits 推进它。条目中没有显示的地方,没有人去过。
|
|
20
20
|
- time:每一轮都会说明它发生的时间。故事的时钟是另外保存的,所以不要把时间写进事件,除非故事本身说明了(“火车九点开”);先后顺序和时间来自回合和轮次。
|
|
21
|
-
- 目标和约定:角色的目标(它所追求的:许下的诺言、接下的任务、一个计划)和它的约定(engagements,它承诺要做的、有日期的事)都列在下面并带有 id。只有当各轮明确确立了它、而且列表中还没有时,才添加(intents_added、engagements):约定需要一个各轮写明的、或者可以从故事时钟推出的时间(“明天九点”是一个日期和时间:根据该轮的时间推算出来)、被点名的地点,以及所有承诺参加的人。当各轮显示出来时,推进它们(intent_edits、engagement_edits):一个目标完成了、失败了、被放弃了或变得更紧迫了、迈出了一步;一个约定被遵守了、被错过了(没人来,或被忘了)、被取消了或被推迟了。一个角色是否遵守了约定,看各轮显示它做了什么;绝不只凭时钟来判断。角色的日常安排(routine
|
|
21
|
+
- 目标和约定:角色的目标(它所追求的:许下的诺言、接下的任务、一个计划)和它的约定(engagements,它承诺要做的、有日期的事)都列在下面并带有 id。只有当各轮明确确立了它、而且列表中还没有时,才添加(intents_added、engagements):约定需要一个各轮写明的、或者可以从故事时钟推出的时间(“明天九点”是一个日期和时间:根据该轮的时间推算出来)、被点名的地点,以及所有承诺参加的人。当各轮显示出来时,推进它们(intent_edits、engagement_edits):一个目标完成了、失败了、被放弃了或变得更紧迫了、迈出了一步;一个约定被遵守了、被错过了(没人来,或被忘了)、被取消了或被推迟了。一个角色是否遵守了约定,看各轮显示它做了什么;绝不只凭时钟来判断。角色的日常安排(routine)不归你写;但如果各轮确立了某个角色在某一天的安排与平常不同(卧病在床、外出办事、休息一天),就为那一天设置 routine_exceptions(用故事本地的 YYYY-MM-DD 日期,根据该轮的时间推算),而且只设那一天。
|
|
22
22
|
- 被追踪的变量:故事追踪的东西(情绪、伤势、债务、标志:list_variables 会显示每一个及其所关于的对象)用 variable_changes 来改变:当各轮显示出明显的变化时改变情绪(它是角色私下的:它的情绪根据它做了什么、遭遇了什么来写,绝不根据别人怎么想),数字用 by 来移动,标志或文字用 to。游戏主持人已经改变的已经写入;写它没有写的,而且只写各轮确立的内容。气质(baseline)只有在发生持久的变化时才改。你绝不声明新的变量:当故事确实需要时,由世界作者来做。
|
|
23
23
|
- states:游戏主持人对每个角色的 activity 和 public_state 所作的决定已经写入。只为 inner_state 或 emotion 写状态,或者为改正各轮明显与之矛盾的 public_state 而写,并且只写发生变化的字段。public_state 是对此刻看得见的东西(位置、姿势、表情、手里拿着什么)的简短描述,用现在的口吻,绝不是事件的流水账,也绝不是想法。inner_state 是它此刻所想或所感,而且只有各轮显示出来时才写。activity 是它现在正在做的事。emotion 只有在各轮显示出明显变化时才写。
|
|
24
24
|
- beliefs:只有当一个角色明确得知、怀疑或推断出超出单个事件的东西时才写;从该角色的视角来写;kind 是 belief、relationship 或 knowledge。
|