@dsh-agentic-roleplay/core 0.3.0 → 0.3.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.
Files changed (36) hide show
  1. package/lib/authoring.js +18 -223
  2. package/lib/client.js +903 -478
  3. package/lib/client.js.map +1 -1
  4. package/lib/compaction.js +1 -1
  5. package/lib/{deliver--uMhC6oO.js → deliver-BDW5WZvc.js} +579 -195
  6. package/lib/{documents-7GMc5NnW.js → documents-DtlY2IRt.js} +857 -12
  7. package/lib/{gallery-DUeBMHQX.js → gallery-DACG5eh2.js} +2 -2
  8. package/lib/{generator-HPifO3Kk.js → generator-DGYcLMp7.js} +2 -2
  9. package/lib/images.js +3 -3
  10. package/lib/index.js +181 -11
  11. package/lib/{narration-CKZTk5UE.js → narration-5ig7Dg28.js} +3 -2
  12. package/lib/orchestration.js +366 -274
  13. package/lib/{packs-alJTiDM2.js → packs-CkRZDCsV.js} +49 -5
  14. package/lib/{presenter-agent-PX1WVaJB.js → presenter-agent-PK9JYExk.js} +3 -3
  15. package/package.json +4 -4
  16. package/packs/scene/strip.js +1 -1
  17. package/prompts/en/roleplay/character-decide.md +1 -1
  18. package/prompts/en/roleplay/character-rules.md +1 -1
  19. package/prompts/en/roleplay/chronicler.md +1 -1
  20. package/prompts/en/roleplay/game-master.md +1 -1
  21. package/prompts/en/roleplay/reflection.md +2 -2
  22. package/prompts/en/roleplay/style.md +1 -1
  23. package/prompts/en/roleplay/suggester.md +1 -1
  24. package/prompts/en/translate/document.md +6 -0
  25. package/prompts/en/translate/glossary.md +5 -0
  26. package/prompts/en/translate/notice.md +2 -0
  27. package/prompts/zh/roleplay/character-decide.md +1 -1
  28. package/prompts/zh/roleplay/character-rules.md +1 -1
  29. package/prompts/zh/roleplay/chronicler.md +1 -1
  30. package/prompts/zh/roleplay/game-master.md +1 -1
  31. package/prompts/zh/roleplay/reflection.md +2 -2
  32. package/prompts/zh/roleplay/style.md +1 -1
  33. package/prompts/zh/roleplay/suggester.md +1 -1
  34. package/prompts/zh/translate/document.md +6 -0
  35. package/prompts/zh/translate/glossary.md +5 -0
  36. package/prompts/zh/translate/notice.md +2 -0
@@ -89,7 +89,16 @@ function languageOf(tag) {
89
89
  if (!LANGUAGE.test(primary)) throw new Error(`"${tag}" is not a language`);
90
90
  return primary;
91
91
  }
92
- function fill(id, text, variables) {
92
+ /** How a language is named inside a prompt, for the instruction to write in it. */
93
+ const LANGUAGE_NAMES$1 = {
94
+ en: "English",
95
+ zh: "中文"
96
+ };
97
+ function fill(id, text, given, tag) {
98
+ const variables = {
99
+ language: LANGUAGE_NAMES$1[tag] ?? tag,
100
+ ...given
101
+ };
93
102
  return text.trim().replace(/^\$\{([A-Za-z]+)\}[ \t]*(\r?\n|$)/gm, (match, name) => variables[name] === "" ? "" : match).replace(VARIABLE, (_match, name) => {
94
103
  const value = variables[name];
95
104
  if (value === void 0) throw new Error(`prompt ${id} uses \${${name}}, which is not given a value (given: ${Object.keys(variables).join(", ") || "none"})`);
@@ -98,7 +107,7 @@ function fill(id, text, variables) {
98
107
  }
99
108
  /** A prompt as the package ships it, without a roleplay root: for code that has none, such as tests. */
100
109
  function shippedText(id, language = "en", variables = {}) {
101
- return fill(id, readFileSync(join(shippedPromptsDirectory(), language, `${id}.md`), "utf8"), variables);
110
+ return fill(id, readFileSync(join(shippedPromptsDirectory(), language, `${id}.md`), "utf8"), variables, language);
102
111
  }
103
112
  function listFiles(directory, prefix = "") {
104
113
  return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
@@ -138,7 +147,7 @@ var PromptLibrary = class extends Service {
138
147
  if (!ID$1.test(id)) throw new Error(`"${id}" is not a prompt id`);
139
148
  const tag = languageOf(language);
140
149
  const own = session === void 0 ? void 0 : this.override(id, tag, session);
141
- return fill(id, readFileSync(own ?? this.file(id, tag), "utf8"), variables);
150
+ return fill(id, readFileSync(own ?? this.file(id, tag), "utf8"), variables, tag);
142
151
  }
143
152
  override(id, language, session) {
144
153
  if (!SESSION_ID.test(session)) throw new Error(`"${session}" is not a session id`);
@@ -498,6 +507,41 @@ function plotReferenceProblems(plots, entities) {
498
507
  return plots.flatMap((plot) => plot.participants.filter((participant) => !known.has(participant)).map((participant) => `plot "${plot.id}" names unknown participant "${participant}"`));
499
508
  }
500
509
  //#endregion
510
+ //#region src/host/translate/language.ts
511
+ const STORY_LANGUAGES = ["en", "zh"];
512
+ /** Less than this many letters of either script is too little to tell a language. */
513
+ const MIN_LETTERS = 20;
514
+ /** A text is Chinese when this share of its Han and Latin letters is Han: names in the other script do not decide it. */
515
+ const HAN_SHARE = .3;
516
+ const count = (text, pattern) => text.match(pattern)?.length ?? 0;
517
+ /** The language a text is written in, by the script of its letters; nothing when there is too little text to tell. */
518
+ function textLanguage(text) {
519
+ const han = count(text, /\p{Script=Han}/gu);
520
+ const latin = count(text, /\p{Script=Latin}/gu);
521
+ if (han + latin < MIN_LETTERS) return void 0;
522
+ return han / (han + latin) >= HAN_SHARE ? "zh" : "en";
523
+ }
524
+ const isStoryLanguage = (value) => value === "en" || value === "zh";
525
+ const LANGUAGE_NAMES = {
526
+ en: {
527
+ en: "English",
528
+ zh: "英文"
529
+ },
530
+ zh: {
531
+ en: "Chinese",
532
+ zh: "中文"
533
+ }
534
+ };
535
+ /** What is wrong with texts that should be in the chat's language but are written in the other one; nothing when they are right, too short to tell, or the language is not one we can read. */
536
+ function wrongLanguage(wanted, texts) {
537
+ if (!isStoryLanguage(wanted)) return void 0;
538
+ const wrong = Object.entries(texts).flatMap(([name, text]) => {
539
+ const found = text === void 0 ? void 0 : textLanguage(text);
540
+ return found === void 0 || found === wanted ? [] : [`${name} is written in ${LANGUAGE_NAMES[found].en}`];
541
+ });
542
+ return wrong.length === 0 ? void 0 : `${wrong.join(" and ")}: write it in ${LANGUAGE_NAMES[wanted].en} (${LANGUAGE_NAMES[wanted][wanted]})`;
543
+ }
544
+ //#endregion
501
545
  //#region src/shared/worlds.ts
502
546
  /** Path prefix of the plugin's HTTP API. Relative, so a mounted deployment resolves it against the page. */
503
547
  const API_PREFIX = "roleplay-api";
@@ -1331,6 +1375,6 @@ function anyTab(bases) {
1331
1375
  }));
1332
1376
  }
1333
1377
  //#endregion
1334
- export { languageOf as A, SessionArchivedError as B, errorMessage as C, PromptLibrary as D, PROMPTS_FOLDER as E, shippedText as F, INTENT_TYPES as G, WorldNotFoundError as H, AgentUnavailableError as I, InvalidStartError as L, promptProblem as M, shippedLanguages as N, copyWorldPrompts as O, shippedPromptsDirectory as P, InvalidWorldError as R, readDocument as S, formatIssue as T, INTENT_HORIZONS as U, SessionNotFoundError as V, INTENT_STATUSES as W, API_PREFIX as _, packIds as a, parsePlotsFile as b, describePack as c, packPath as d, readPack as f, SURFACE_NAMES as g, PACK_MEDIA_TYPES as h, inheritPacks as i, listFiles as j, inheritPrompts as k, isPackId as l, PACK_LIMITS as m, anyTab as n, syncWorldPacks as o, PACK_ACTIONS as p, copyWorldPacks as r, worldPackStates as s, activePack as t, packFile as u, PLOTS_FILE_NAME as v, Reader as w, plotReferenceProblems as x, loadPlots as y, ReflectionRefusedError as z };
1378
+ export { formatIssue as A, shippedText as B, PLOTS_FILE_NAME as C, readDocument as D, plotReferenceProblems as E, languageOf as F, SessionArchivedError as G, InvalidStartError as H, listFiles as I, INTENT_HORIZONS as J, SessionNotFoundError as K, promptProblem as L, PromptLibrary as M, copyWorldPrompts as N, errorMessage as O, inheritPrompts as P, shippedLanguages as R, wrongLanguage as S, parsePlotsFile as T, InvalidWorldError as U, AgentUnavailableError as V, ReflectionRefusedError as W, INTENT_TYPES as X, INTENT_STATUSES as Y, API_PREFIX as _, packIds as a, isStoryLanguage as b, describePack as c, packPath as d, readPack as f, SURFACE_NAMES as g, PACK_MEDIA_TYPES as h, inheritPacks as i, PROMPTS_FOLDER as j, Reader as k, isPackId as l, PACK_LIMITS as m, anyTab as n, syncWorldPacks as o, PACK_ACTIONS as p, WorldNotFoundError as q, copyWorldPacks as r, worldPackStates as s, activePack as t, packFile as u, LANGUAGE_NAMES as v, loadPlots as w, textLanguage as x, STORY_LANGUAGES as y, shippedPromptsDirectory as z };
1335
1379
 
1336
- //# sourceMappingURL=packs-alJTiDM2.js.map
1380
+ //# sourceMappingURL=packs-CkRZDCsV.js.map
@@ -1,6 +1,6 @@
1
1
  import { t as promptFor } from "./access-EbNdZFbk.js";
2
- import { A as runChild, d as nextSceneSerial, n as generateTransientImage, p as referenceImagePath, t as generateReferenceImage } from "./generator-HPifO3Kk.js";
3
- import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-DUeBMHQX.js";
2
+ import { A as runChild, d as nextSceneSerial, n as generateTransientImage, p as referenceImagePath, t as generateReferenceImage } from "./generator-DGYcLMp7.js";
3
+ import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-DACG5eh2.js";
4
4
  import { dirname, join, relative } from "node:path";
5
5
  import { existsSync } from "node:fs";
6
6
  import { createHash, randomUUID } from "node:crypto";
@@ -850,4 +850,4 @@ async function runImagePresenter(job) {
850
850
  //#endregion
851
851
  export { tokensOf as a, searchImages as i, interpretImage as n, present as o, imageTools as r, presentedFor as s, runImagePresenter as t };
852
852
 
853
- //# sourceMappingURL=presenter-agent-PX1WVaJB.js.map
853
+ //# sourceMappingURL=presenter-agent-PK9JYExk.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-agentic-roleplay/core",
3
- "version": "0.3.0",
3
+ "version": "0.3.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",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "dsh": {
21
21
  "engines": {
22
- "dsh": ">=0.2.0-rc.2 <0.3.0"
22
+ "dsh": ">=0.2.0-rc.2 <0.2.1"
23
23
  },
24
24
  "bundle": {
25
25
  "patch": "./cordis.patch.yml"
@@ -70,11 +70,11 @@
70
70
  ],
71
71
  "license": "GPL-3.0-only",
72
72
  "peerDependencies": {
73
- "@deepseek-ai/dsh": ">=0.2.0-rc.2 <0.3.0",
73
+ "@deepseek-ai/dsh": ">=0.2.0-rc.2 <0.2.1",
74
74
  "@deepseek-ai/schemastery": "^3.18.4"
75
75
  },
76
76
  "dependencies": {
77
- "@dsh-agentic-roleplay/state": "0.3.0",
77
+ "@dsh-agentic-roleplay/state": "0.3.1",
78
78
  "@dsh-ai-providers/core": "^0.1.2"
79
79
  },
80
80
  "devDependencies": {
@@ -11,7 +11,7 @@ function render() {
11
11
  if (view === undefined) return
12
12
  const w = words()
13
13
  text('place', view.place ? view.place.name : w.nowhere)
14
- text('time', view.time ? view.time.text : '')
14
+ text('time', view.time ? [view.time.text, ...view.time.holidays].join(' · ') : '')
15
15
  const here = view.place ? view.place.here.map(person => person.name) : []
16
16
  const tracked = view.variables.filter(entry => entry.subject !== 'the world').map(entry => `${entry.subject}: ${entry.name} ${entry.value}`)
17
17
  text('more', [here.length > 0 ? `${w.with} ${here.join(', ')}` : w.alone, ...tracked].join(' · '))
@@ -1 +1 @@
1
- Each time you are asked, decide what ${name} does now and answer with 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.
1
+ Each time you are asked, decide what ${name} does now and answer with 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.
@@ -1 +1 @@
1
- Rules that always hold: you act only as ${name}. You know only what is in the situation you are given, who is present and what you remember; never use anything else, and do not claim to remember more. You never describe, decide or speak for another character, and you never narrate the world. Stay in character, and write what you answer in the language of your description and of the story. What you say aloud is only speech to the people here: never mention your memories, a lack of them, records, tools or anything outside the story. Your relationships are your own fallible attitudes: let them shape how you interpret ambiguity, what you risk and how you speak, but never treat them as orders or as proof of another person's motives. Low familiarity especially means uncertainty, even when trust or affection is strong.
1
+ Rules that always hold: you act only as ${name}. You know only what is in the situation you are given, who is present and what you remember; never use anything else, and do not claim to remember more. You never describe, decide or speak for another character, and you never narrate the world. Stay in character, and write what you answer in ${language}. What you say aloud is only speech to the people here: never mention your memories, a lack of them, records, tools or anything outside the story. Your relationships are your own fallible attitudes: let them shape how you interpret ambiguity, what you risk and how you speak, but never treat them as orders or as proof of another person's motives. Low familiarity especially means uncertainty, even when trust or affection is strong.
@@ -1 +1 @@
1
- You are the chronicler of an interactive story. You write the account of what has happened, for the game master who runs the story and who will read nothing else of the past. Everything you write must be supported by the material you are given: the events are the objective record and are authoritative; never add, guess or embellish. Keep names, what was promised or discovered, who knows what when it matters, what is still unsettled, and how relationships stand. Write plain past-tense prose in the language of the story, without headings, lists or references to turns or ids.
1
+ You are the chronicler of an interactive story. You write the account of what has happened, for the game master who runs the story and who will read nothing else of the past. Everything you write must be supported by the material you are given: the events are the objective record and are authoritative; never add, guess or embellish. Keep names, what was promised or discovered, who knows what when it matters, what is still unsettled, and how relationships stand. Write plain past-tense prose in ${language}, without headings, lists or references to turns or ids.
@@ -1,7 +1,7 @@
1
1
  You are the game master of an interactive roleplay. The player controls one character. An agent plays every other character. You run each turn only through your tools, in the order below.
2
2
 
3
3
  Rules that always hold:
4
- - Write what you pass to your tools (situations, summaries, narration) in the language of the story, and call characters by the name the scene gives them.
4
+ - Write what you pass to your tools (situations, summaries, narration) in ${language}, and call characters by the name the scene gives them.
5
5
  - Identifiers are copied, never made up. Wherever a tool takes a key (character, place, item, variable, thread, plot), use one exactly as the scene or a list tool shows it; if none fits, the thing is not tracked: leave it out, or ask for it with expand_world. Look a key up (list_characters, list_items, list_locations, list_variables) rather than guess it. A prop that is simply there needs no item change. A thing the story is about to use that does not exist yet (a barricade, a tool, a note, a key) you bring in yourself, as a table's game master would, with introduce_thing (where it lies or who holds it); then use its key. Scenery nobody touches stays part of the place, and a person or place that does not exist yet is asked of the world author.
6
6
  - You never decide, say or think anything for a character. A character's intent and words come only from activate_characters.
7
7
  - You decide only what happens, as outcomes. An outcome must follow from the moment, the characters' intents and what the records say. Do not invent facts, objects, people or events that these do not establish.
@@ -4,6 +4,6 @@ A belief is what the character holds to be true, suspects, or has been told; it
4
4
 
5
5
  A belief is a conclusion, not a copy of a report. It is about the world, a place or other people: what the character now thinks of someone, what they suspect is going on, what they have worked out. Never restate what the character itself did or said, and never write about the character in the third person as if from outside; do not repeat a sentence of what they took in, and do not merge unrelated things into one belief.
6
6
 
7
- Prefer fewer, firmer beliefs. Digest more than you add: merge beliefs that say the same thing into one and drop the rest, let go of a belief that later events settled or overturned, and doubt one that later events contradict instead of stating it more strongly. Add a belief only when a pattern runs through things from different times, or one event plainly changed how the character sees something or someone; a single passing moment is not yet a belief. Every change names the numbers of the things it took in that it rests on, and they are checked. When nothing is firm enough, change nothing: empty lists are a good answer.
7
+ Prefer fewer, firmer beliefs. Digest more than you add: merge beliefs that say the same thing into one and drop the rest, let go of a belief that later events settled or overturned, and doubt one that later events contradict instead of stating it more strongly. Add a belief only when a pattern runs through things from different times, or one event plainly changed how the character sees something or someone; a single passing moment is not yet a belief. Every belief has a confidence: doubtful, likely (when you leave it out) or sure; sure needs things from at least two different turns. When something the character took in since speaks against a belief, do not state the belief more strongly and do not simply let it go: name what speaks against it in contradicted_by and lower its confidence, so that it is held with doubt; let a belief go only when later events settled or overturned it for good. Every change names the numbers of the things it took in that it rests on, and they are checked. When nothing is firm enough, change nothing: empty lists are a good answer.
8
8
 
9
- Write in the language of the story, in one or two sentences a belief, the way the character would put it to themselves.
9
+ Write in ${language}, in one or two sentences a belief, the way the character would put it to themselves.
@@ -1 +1 @@
1
- Write the narration in plain, concrete prose, in the language of the story, keeping to what the player's character can perceive.
1
+ Write the narration in plain, concrete prose, in ${language}, keeping to what the player's character can perceive.
@@ -1,3 +1,3 @@
1
1
  You suggest what the player could do next in an interactive story. You are shown what the player has just read, and who they play. From that alone, and nothing else, you write short lines in the first person that the player might send as their next move ("Ask Clara about the ledger", "Slip out through the cellar").
2
2
 
3
- Each line is different in kind from the others (say something, do something, leave, look closer), is possible in the scene as it stands, follows from what was just read, and is at most ${max} characters. Use only what the text says: never a fact, person, place or object it does not mention, and nothing the player's character could not know. Write in the language of the text. No numbering, no quotation marks, no explanation.
3
+ Each line is different in kind from the others (say something, do something, leave, look closer), is possible in the scene as it stands, follows from what was just read, and is at most ${max} characters. Use only what the text says: never a fact, person, place or object it does not mention, and nothing the player's character could not know. Write in ${language}. No numbering, no quotation marks, no explanation.
@@ -0,0 +1,6 @@
1
+ You translate one file of a role-playing world from ${from} into ${to}. You are given the glossary of the world's names and a list of texts, numbered from 1, to translate.
2
+ - Translate every text into natural ${to}, keeping its meaning, tone, register and every fact. Add nothing, leave nothing out, explain nothing.
3
+ - Use the glossary's rendering for every name in it, in every form the text gives it.
4
+ - Keep unchanged what is not a word: text inside curly braces such as {character:key}, numbers, times and codes.
5
+ - A text that is a short phrase (a tag, a label, a rule) stays a short phrase of the same kind. Speech in quotation marks stays speech.
6
+ - Return one translation for each text, in the same order.
@@ -0,0 +1,5 @@
1
+ You translate the names of a role-playing world from ${from} into ${to}, so that every part of the world will call each person, place and thing the same way. You are given `names`: people, nicknames, places, things, groups, holidays and words that recur inside them. `known` lists renderings that are already fixed for some of those words: use them wherever the word is part of a name.
2
+ - Give one translation for each name, with the source repeated exactly as given. Keep every entry and the order; never merge, skip or add.
3
+ - A person's name gets its usual ${to} rendering, or is transliterated by sound. A place, thing or group is translated by meaning, unless it is a proper name, which is transliterated. Titles and ranks inside a name are translated.
4
+ - A nickname follows the name it belongs to when that is in the list.
5
+ - Keep it short: a name, no explanation. A name that is a code, a brand or has no sensible rendering is returned unchanged.
@@ -0,0 +1,2 @@
1
+ Translate this world into ${to}. Call ${tool} with language "${code}", once, and wait for it: it makes a translated copy next to this world and takes several minutes. Do not edit the world yourself.
2
+ When it returns, tell me in a few short sentences the name of the new world, how many texts were translated and any problem it reports. This world stays as it is.
@@ -1 +1 @@
1
- 每次被询问时,决定${name}此刻做什么,并且按这个顺序回答:thought(先用你自己的口吻写:你在此刻注意到了什么、想要什么,一两句话,最多${thoughtLimit}个字;不会展示给任何人)、intent(一个动作,一两句话,最多${intentLimit}个字,不含台词)、utterance(只写说出口的话,一字不差,用你自己的口吻,最多${utteranceLimit}个字,不加引号,也不描写你的动作,那些属于 intent;保持沉默就省略)和 commitment(low 表示立刻放弃,medium 表示容易的话会再试一次,high 表示坚持不懈)。 不要重复你在这一场景里已经说过的话:没有新的话要说,就不要写 utterance。
1
+ 每次被询问时,决定${name}此刻做什么,并且按这个顺序回答:thought(先用你自己的口吻写:你在此刻注意到了什么、想要什么,一两句话,最多${thoughtLimit}个字;不会展示给任何人)、intent(一个动作,一两句话,最多${intentLimit}个字,不含台词)、utterance(只写说出口的话,一字不差,用你自己的口吻,最多${utteranceLimit}个字,不加引号,也不描写你的动作,那些属于 intent;保持沉默就省略)和 commitment(low 表示立刻放弃,medium 表示容易的话会再试一次,high 表示坚持不懈)。 不要重复你在这一场景里已经说过的话:没有新的话要说,就不要写 utterance。 thought、intent 和 utterance 都用${language}写,即使你的描述是用另一种语言写的。
@@ -1 +1 @@
1
- 始终成立的规则:你只作为${name}行动。你只知道所给情境中的内容、在场的人和你记得的事;绝不使用其他任何东西,也不要声称自己记得更多。你绝不替别的角色描述、决定或说话,也绝不叙述世界。保持角色,回答所用的语言与你的描述和故事一致。你说出口的话只是对在场的人说的:绝不要提到你的记忆、记忆缺失、记录、工具或任何故事之外的东西。你的人际关系是你自己有可能出错的态度:让它们影响你如何解读含糊之处、愿意冒什么风险、怎么说话,但绝不把它们当作命令,也不要把它们当作对方动机的证明。熟悉程度低,尤其意味着不确定,即使信任或好感很强。
1
+ 始终成立的规则:你只作为${name}行动。你只知道所给情境中的内容、在场的人和你记得的事;绝不使用其他任何东西,也不要声称自己记得更多。你绝不替别的角色描述、决定或说话,也绝不叙述世界。保持角色,回答用${language}。你说出口的话只是对在场的人说的:绝不要提到你的记忆、记忆缺失、记录、工具或任何故事之外的东西。你的人际关系是你自己有可能出错的态度:让它们影响你如何解读含糊之处、愿意冒什么风险、怎么说话,但绝不把它们当作命令,也不要把它们当作对方动机的证明。熟悉程度低,尤其意味着不确定,即使信任或好感很强。
@@ -1 +1 @@
1
- 你是一个互动故事的记述者。你要为主持故事的游戏主持人写出已经发生之事的记述,主持人除此之外对过去一无所知。你写的每一句话都必须有所给材料的支持:事件是客观记录,具有权威性;绝不添加、猜测或渲染。要保留名字、被许下或发现的事、在要紧时谁在何时知道了什么、尚未解决的事,以及人物之间的关系现状。用故事所用的语言写平实的过去时叙述文字,不要标题、列表,也不要提到回合或编号。
1
+ 你是一个互动故事的记述者。你要为主持故事的游戏主持人写出已经发生之事的记述,主持人除此之外对过去一无所知。你写的每一句话都必须有所给材料的支持:事件是客观记录,具有权威性;绝不添加、猜测或渲染。要保留名字、被许下或发现的事、在要紧时谁在何时知道了什么、尚未解决的事,以及人物之间的关系现状。用${language}写平实的过去时叙述文字,不要标题、列表,也不要提到回合或编号。
@@ -1,7 +1,7 @@
1
1
  你是一场互动角色扮演的游戏主持人。玩家控制一个角色,由智能体扮演其他每一个角色。你只通过你的工具来主持每一回合,并按下面的顺序进行。
2
2
 
3
3
  始终成立的规则:
4
- - 传给工具的内容(情境、概述、叙述)用故事所用的语言书写,并用场景所给的名字称呼角色。
4
+ - 传给工具的内容(情境、概述、叙述)用${language}书写,并用场景所给的名字称呼角色。
5
5
  - 标识符只能照抄,不能自己编。凡是工具要 key 的地方(角色、地点、物品、变量、线索、剧情),都原样使用场景或列表工具所显示的;没有合适的,就说明它没有被追踪:略过,或用 expand_world 提出。要查 key 就用 list_characters、list_items、list_locations、list_variables,不要猜。只是在那里的道具不需要物品变更。故事马上要用到、却还不存在的东西(路障、工具、字条、钥匙),你像桌游主持人一样用 introduce_thing 自己加入(写明它在哪里或谁拿着),然后使用它的 key。没人会碰的布景仍是地点的一部分;还不存在的人物或地点则请世界作者来处理。
6
6
  - 你绝不替任何角色决定、说出或想任何事。角色的意图和话语只来自 activate_characters。
7
7
  - 你只决定发生了什么,以结果(outcome)的形式给出。结果必须来自此刻的情形、角色们的意图和记录所说的内容。不要编造这些没有确立的事实、物品、人物或事件。
@@ -4,6 +4,6 @@
4
4
 
5
5
  信念是结论,而不是对见闻的复制。它关于世界、某个地方或其他人:角色现在如何看待某人、怀疑发生了什么、推断出了什么。不要复述角色自己做过或说过的事,也不要以旁观者的口吻用第三人称写这个角色;不要照抄见闻中的句子,也不要把不相关的事合并成一条信念。
6
6
 
7
- 宁可少而稳。归纳多于添加:把说同一件事的信念合并成一条,其余的放下;对已被后来的事件定论或推翻的信念予以放下;对被后来的事件反驳的信念,应表达为怀疑,而不是说得更肯定。只有当某种规律贯穿于不同时间的见闻,或某个事件明确改变了角色对某事或某人的看法时才新增信念;单个转瞬即逝的时刻还不算信念。每一项改动都要写明所依据的见闻编号,这些编号会被核对。如果没有足够确定的内容,就什么都不改:空列表是个好答案。
7
+ 宁可少而稳。归纳多于添加:把说同一件事的信念合并成一条,其余的放下;对已被后来的事件定论或推翻的信念予以放下;对被后来的事件反驳的信念,应表达为怀疑,而不是说得更肯定。只有当某种规律贯穿于不同时间的见闻,或某个事件明确改变了角色对某事或某人的看法时才新增信念;单个转瞬即逝的时刻还不算信念。每条信念都有把握程度:存疑(doubtful)、较有把握(likely,不写时即为此项)或确信(sure);确信需要来自至少两个不同回合的见闻。如果角色此后的见闻与某条信念相悖,不要把它说得更肯定,也不要直接放下:在 contradicted_by 里写明相悖的见闻编号,并降低它的把握程度,让它带着疑虑被保留;只有当后来的事件已经彻底定论或推翻它时才放下它。每一项改动都要写明所依据的见闻编号,这些编号会被核对。如果没有足够确定的内容,就什么都不改:空列表是个好答案。
8
8
 
9
- 用故事所用的语言书写,每条信念一两句话,像角色对自己说的那样。
9
+ 用${language}书写,每条信念一两句话,像角色对自己说的那样。
@@ -1 +1 @@
1
- 叙述用朴实、具体的文字,使用故事所用的语言,只写玩家的角色能感知到的内容。
1
+ 叙述用朴实、具体的文字,用${language},只写玩家的角色能感知到的内容。
@@ -1,3 +1,3 @@
1
1
  你为一个互动故事建议玩家接下来可以做什么。你会看到玩家刚刚读到的内容,以及他们扮演的是谁。仅凭这些,不凭其他任何东西,写出几条玩家可能作为下一步发出的第一人称短句(例如“向克拉拉询问账本的事”“从地窖溜出去”)。
2
2
 
3
- 每一条在类型上都与其他的不同(说点什么、做点什么、离开、仔细看看),在当前场景下是可能的,顺着刚才读到的内容而来,并且最多 ${max} 个字符。只使用文字所说的内容:绝不出现文字没有提到的事实、人物、地点或物品,也不要出现玩家角色不可能知道的东西。用文字所用的语言写。不要编号,不要引号,不要解释。
3
+ 每一条在类型上都与其他的不同(说点什么、做点什么、离开、仔细看看),在当前场景下是可能的,顺着刚才读到的内容而来,并且最多 ${max} 个字符。只使用文字所说的内容:绝不出现文字没有提到的事实、人物、地点或物品,也不要出现玩家角色不可能知道的东西。用${language}写。不要编号,不要引号,不要解释。
@@ -0,0 +1,6 @@
1
+ 你要把一个角色扮演世界里的一个文件从${from}翻译成${to}。给你的是这个世界的名字对照表,以及从 1 开始编号的待译文本。
2
+ - 把每段文本翻译成自然的${to},保留原意、语气、文体和每一个事实。不添加、不遗漏、不解释。
3
+ - 对照表中的名字,在文本里以任何形式出现,都用对照表的译法。
4
+ - 不是文字的内容保持不变:花括号里的内容(例如 {character:key})、数字、时间和代号。
5
+ - 简短的短语(标签、称呼、规则)仍然是同类的简短短语;引号里的话仍然是话。
6
+ - 按原来的顺序,为每段文本返回一个译文。
@@ -0,0 +1,5 @@
1
+ 你要把一个角色扮演世界里的名字从${from}翻译成${to},使世界的各个部分对每个人、每个地方、每件东西都用同一种叫法。给你的是 `names`:人名、绰号、地点、物品、团体、节日,以及在这些名字里反复出现的词。`known` 列出其中一些词已经确定的译法:名字中含有这些词时必须使用。
2
+ - 为每个名字给出一个译名,并原样重复原文。保留每一条和原来的顺序,不合并、不遗漏、不添加。
3
+ - 人名用通行的${to}译法,没有的就按读音音译;地点、物品和团体按意思翻译,专有名称则音译;名字中的头衔、官职要翻译。
4
+ - 绰号跟随它所属的名字(该名字在清单中时)。
5
+ - 简短:只要名字,不要解释。代号、品牌或没有合理译法的名字原样返回。
@@ -0,0 +1,2 @@
1
+ 把这个世界翻译成${to}。调用 ${tool},language 为 "${code}",只调用一次并等它完成:它会在这个世界旁边生成一个翻译后的副本,需要几分钟。不要自己修改这个世界。
2
+ 它返回后,用几句简短的话告诉我:新世界的名称、翻译了多少段文字,以及它报告的任何问题。这个世界保持不变。