@dsh-agentic-roleplay/core 0.8.2 → 0.9.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 (40) hide show
  1. package/lib/{authoring-tools-BgmC2oqU.js → authoring-tools-CdHlvx32.js} +1909 -53
  2. package/lib/authoring.js +135 -32
  3. package/lib/client.js +347 -347
  4. package/lib/doctor.js +1 -1
  5. package/lib/{gallery-D1V4h8vh.js → gallery-BKh7eu80.js} +2 -2
  6. package/lib/{generator-CLPosooC.js → generator-DdZ1-sgv.js} +2 -2
  7. package/lib/{hooks-rQTTeOC4.js → hooks-CcQj_dJo.js} +2 -2
  8. package/lib/images.js +4 -4
  9. package/lib/index.js +14 -14
  10. package/lib/{library-Dfu0dgRj.js → library-QFL6Z_Nr.js} +2 -2
  11. package/lib/{lorebook-author-tools-BAaAqZZm.js → lorebook-author-tools-DWBnYo1E.js} +6 -6
  12. package/lib/lorebook-authoring.js +4 -4
  13. package/lib/orchestration.js +8 -8
  14. package/lib/{pack-jail-CN-314ln.js → pack-jail-BMy6NcCY.js} +21 -723
  15. package/lib/{packs-DIj5BEfq.js → packs-BREPSfHy.js} +2 -2
  16. package/lib/{presenter-agent-DR0KvLE0.js → presenter-agent-B49-_iUm.js} +4 -4
  17. package/lib/{preset-CscHj1-Y.js → preset-BqgY1Tz4.js} +3 -3
  18. package/lib/{preset-author-tools-CxluF8qc.js → preset-author-tools-BB_Dcv2o.js} +6 -6
  19. package/lib/preset-authoring.js +5 -5
  20. package/lib/{presets-HB8kJTaE.js → presets-Bwnrx7p0.js} +22 -11
  21. package/lib/{reflection-Dg1xtOTW.js → reflection-CUWG-6Qg.js} +6 -6
  22. package/lib/{text-DyRN4nDP.js → text-CbGQhK1-.js} +4 -3
  23. package/lib/{turn-guard-g_hDn0jR.js → turn-guard-Bb8Ew-1z.js} +2 -2
  24. package/package.json +2 -2
  25. package/prompts/en/checks/decide-sheet.md +1 -0
  26. package/prompts/en/checks/fidelity.md +7 -0
  27. package/prompts/en/checks/gaps.md +4 -0
  28. package/prompts/en/checks/notice.md +3 -0
  29. package/prompts/en/import/finish-draft.md +1 -1
  30. package/prompts/en/import/finish-ok.md +3 -1
  31. package/prompts/en/import/notice-repair.md +2 -2
  32. package/prompts/en/import/repair-again.md +2 -2
  33. package/prompts/zh/checks/decide-sheet.md +1 -0
  34. package/prompts/zh/checks/fidelity.md +7 -0
  35. package/prompts/zh/checks/gaps.md +4 -0
  36. package/prompts/zh/checks/notice.md +3 -0
  37. package/prompts/zh/import/finish-draft.md +1 -1
  38. package/prompts/zh/import/finish-ok.md +3 -1
  39. package/prompts/zh/import/notice-repair.md +2 -2
  40. package/prompts/zh/import/repair-again.md +2 -2
@@ -1,4 +1,4 @@
1
- import { q as Reader } from "./hooks-rQTTeOC4.js";
1
+ import { q as Reader } from "./hooks-CcQj_dJo.js";
2
2
  import { dirname, extname, join, posix, sep } from "node:path";
3
3
  import { copyFileSync, cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, renameSync } from "node:fs";
4
4
  import { createHash } from "node:crypto";
@@ -836,4 +836,4 @@ function anyTab(bases) {
836
836
  }
837
837
  export { API_PREFIX as _, packIds as a, describePack as c, packPath as d, readPack as f, SURFACE_NAMES as g, PACK_MEDIA_TYPES as h, inheritPacks as i, 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 };
838
838
 
839
- //# sourceMappingURL=packs-DIj5BEfq.js.map
839
+ //# sourceMappingURL=packs-BREPSfHy.js.map
@@ -1,8 +1,8 @@
1
1
  import { t as promptFor } from "./access-CfQWbNZP.js";
2
2
  import { c as runChild } from "./child-lYYeOwl2.js";
3
- import { n as generateTransientImage, t as generateReferenceImage } from "./generator-CLPosooC.js";
4
- import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-D1V4h8vh.js";
5
- import { c as nextSceneSerial, u as referenceImagePath } from "./library-Dfu0dgRj.js";
3
+ import { n as generateTransientImage, t as generateReferenceImage } from "./generator-DdZ1-sgv.js";
4
+ import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-BKh7eu80.js";
5
+ import { c as nextSceneSerial, u as referenceImagePath } from "./library-QFL6Z_Nr.js";
6
6
  import { dirname, join, relative } from "node:path";
7
7
  import { existsSync } from "node:fs";
8
8
  import { createHash, randomUUID } from "node:crypto";
@@ -846,4 +846,4 @@ async function runImagePresenter(job) {
846
846
  }
847
847
  export { tokensOf as a, searchImages as i, interpretImage as n, present as o, imageTools as r, presentedFor as s, runImagePresenter as t };
848
848
 
849
- //# sourceMappingURL=presenter-agent-DR0KvLE0.js.map
849
+ //# sourceMappingURL=presenter-agent-B49-_iUm.js.map
@@ -1,6 +1,6 @@
1
- import { Pt as ImportCardError, r as MAX_PREVIEW_TEXT } from "./authoring-tools-BgmC2oqU.js";
1
+ import { Zt as ImportCardError, r as MAX_PREVIEW_TEXT } from "./authoring-tools-CdHlvx32.js";
2
2
  import { l as SAMPLING_RANGES } from "./child-lYYeOwl2.js";
3
- import { J as cleanText } from "./presets-HB8kJTaE.js";
3
+ import { J as cleanText } from "./presets-Bwnrx7p0.js";
4
4
  // src/host/import/preset.ts
5
5
  /** The older preset layout keeps its texts under fixed keys. */
6
6
  const LEGACY_KEYS = [
@@ -239,4 +239,4 @@ function selectPrompts(file, enabled, keepSampling) {
239
239
  }
240
240
  export { readPreset as n, selectPrompts as r, previewPreset as t };
241
241
 
242
- //# sourceMappingURL=preset-CscHj1-Y.js.map
242
+ //# sourceMappingURL=preset-BqgY1Tz4.js.map
@@ -1,9 +1,9 @@
1
1
  import "./access-CfQWbNZP.js";
2
- import { G as listWorldPrompts, K as readWorldPrompt, Q as IMPORT_FOLDER, U as PROSE_PROMPTS, W as deleteWorldPrompt, Z as withPlayer, c as presetDirectory, l as readPreset, p as updatePresetInfo, q as writeWorldPrompt, t as PRESET_FILE, x as extractStyleFrom } from "./presets-HB8kJTaE.js";
3
- import { n as readPreset$1 } from "./preset-CscHj1-Y.js";
4
- import { i as contextOf } from "./authoring-tools-BgmC2oqU.js";
5
- import { i as translator, r as languageOf } from "./text-DyRN4nDP.js";
6
- import { at as shippedPromptsDirectory, it as shippedLanguages, tt as languageOf$1 } from "./hooks-rQTTeOC4.js";
2
+ import { G as listWorldPrompts, K as readWorldPrompt, Q as IMPORT_FOLDER, U as PROSE_PROMPTS, W as deleteWorldPrompt, Z as withPlayer, c as presetDirectory, l as readPreset, p as updatePresetInfo, q as writeWorldPrompt, t as PRESET_FILE, x as extractStyleFrom } from "./presets-Bwnrx7p0.js";
3
+ import { n as readPreset$1 } from "./preset-BqgY1Tz4.js";
4
+ import { i as contextOf } from "./authoring-tools-CdHlvx32.js";
5
+ import { i as translator, r as languageOf } from "./text-CbGQhK1-.js";
6
+ import { at as shippedPromptsDirectory, it as shippedLanguages, tt as languageOf$1 } from "./hooks-CcQj_dJo.js";
7
7
  import { join } from "node:path";
8
8
  import { existsSync } from "node:fs";
9
9
  import { readFile, rm } from "node:fs/promises";
@@ -278,4 +278,4 @@ async function presetApproval(exec, next, carries) {
278
278
  }
279
279
  export { presetChatSessionId as a, presetAuthorTools as i, narrationImportMessage as n, presetOfChat as o, presetApproval as r, PresetReader as t };
280
280
 
281
- //# sourceMappingURL=preset-author-tools-CxluF8qc.js.map
281
+ //# sourceMappingURL=preset-author-tools-BB_Dcv2o.js.map
@@ -1,8 +1,8 @@
1
- import { n as limitAuthoringAgents } from "./authoring-tools-BgmC2oqU.js";
2
- import { t as guardAuthoringTurns } from "./turn-guard-g_hDn0jR.js";
3
- import { i as presetAuthorTools, o as presetOfChat, r as presetApproval, t as PresetReader } from "./preset-author-tools-CxluF8qc.js";
4
- import "./hooks-rQTTeOC4.js";
5
- import { c as presetDirectory } from "./presets-HB8kJTaE.js";
1
+ import { n as limitAuthoringAgents } from "./authoring-tools-CdHlvx32.js";
2
+ import { t as guardAuthoringTurns } from "./turn-guard-Bb8Ew-1z.js";
3
+ import { i as presetAuthorTools, o as presetOfChat, r as presetApproval, t as PresetReader } from "./preset-author-tools-BB_Dcv2o.js";
4
+ import "./hooks-CcQj_dJo.js";
5
+ import { c as presetDirectory } from "./presets-Bwnrx7p0.js";
6
6
  import { join } from "node:path";
7
7
  import { existsSync } from "node:fs";
8
8
  // src/preset-authoring.ts
@@ -1,8 +1,8 @@
1
1
  import { i as VARIABLE_VISIBILITIES, n as VARIABLE_KINDS, r as VARIABLE_SUBJECTS } from "./access-CfQWbNZP.js";
2
2
  import "./narration-CjB_KwwY.js";
3
- import { J as formatIssue, K as readDocument, X as LANGUAGE_FOLDER, Y as errorMessage, Z as PROMPTS_FOLDER, at as shippedPromptsDirectory, it as shippedLanguages, nt as listFiles, q as Reader, rt as promptProblem, tt as languageOf } from "./hooks-rQTTeOC4.js";
3
+ import { J as formatIssue, K as readDocument, X as LANGUAGE_FOLDER, Y as errorMessage, Z as PROMPTS_FOLDER, at as shippedPromptsDirectory, it as shippedLanguages, nt as listFiles, q as Reader, rt as promptProblem, tt as languageOf } from "./hooks-CcQj_dJo.js";
4
4
  import { u as parseSampling } from "./child-lYYeOwl2.js";
5
- import { C as trOf, S as slug, b as mapLimit, w as uniqueKey, x as norm } from "./library-Dfu0dgRj.js";
5
+ import { C as trOf, S as slug, b as mapLimit, w as uniqueKey, x as norm } from "./library-QFL6Z_Nr.js";
6
6
  import { dirname, join } from "node:path";
7
7
  import { existsSync, readFileSync, readdirSync } from "node:fs";
8
8
  import { createHash, randomUUID } from "node:crypto";
@@ -1513,21 +1513,32 @@ function variableProblems(world) {
1513
1513
  }
1514
1514
  return problems;
1515
1515
  }
1516
+ // src/shared/authoring-commands.ts
1517
+ /** The command a message starts with, when its name is one of `names` (not a longer word that starts with it). */
1518
+ function parseAuthoringCommand(text, names) {
1519
+ const value = text.trimStart();
1520
+ if (!value.startsWith("/")) return void 0;
1521
+ const end = value.search(/\s/u);
1522
+ const word = (end < 0 ? value : value.slice(0, end)).slice(1).toLowerCase();
1523
+ return names.includes(word) ? {
1524
+ name: word,
1525
+ rest: end < 0 ? "" : value.slice(end).trim()
1526
+ } : void 0;
1527
+ }
1516
1528
  // src/shared/import-card.ts
1517
1529
  /** The message the plugin sends on the player's behalf to start the import in the new world's authoring chat. */
1518
1530
  const IMPORT_COMMAND = "/import-st";
1519
1531
  /** The command in a message, with the card it names, or nothing when the message is not the command. */
1520
1532
  function parseImportCommand(text) {
1521
- const value = text.trimStart();
1522
- if (value.slice(0, 10).toLowerCase() !== "/import-st" || value.length > 10 && !/\s/u.test(value[10])) return void 0;
1523
- const body = value.slice(10).trimStart();
1524
- const boundary = body.search(/\s/u);
1533
+ const command = parseAuthoringCommand(text, [IMPORT_COMMAND.slice(1)]);
1534
+ if (command === void 0) return void 0;
1535
+ const boundary = command.rest.search(/\s/u);
1525
1536
  return boundary < 0 ? {
1526
- card: body,
1537
+ card: command.rest,
1527
1538
  request: ""
1528
1539
  } : {
1529
- card: body.slice(0, boundary),
1530
- request: body.slice(boundary).trim()
1540
+ card: command.rest.slice(0, boundary),
1541
+ request: command.rest.slice(boundary).trim()
1531
1542
  };
1532
1543
  }
1533
1544
  // src/host/import/store.ts
@@ -3988,6 +3999,6 @@ async function createPresetFromGuidance(root, request, guidance, shipped = shipp
3988
3999
  });
3989
4000
  }
3990
4001
  }
3991
- export { ImportNotFoundError as $, sourcesFor as A, parsePlaceEdit as At, noAt as B, inert as C, parseCharacterFile as Ct, pruneLoreSubjects as D, parseCharacterEdit as Dt, pruneLinks as E, InvalidEditProblems as Et, isLeftOut as F, WEEKDAY_NAMES as Ft, listWorldPrompts as G, yesAt as H, announceProblem as I, DEFAULT_SLOTS as It, cleanText as J, readWorldPrompt as K, askYesNo as L, INTENT_STATUSES as Lt, classifyItems as M, parseThingEdit as Mt, findEntity as N, LORE_KINDS as Nt, pruneMembers as O, parseFactionEdit as Ot, ROLES as P, LORE_SCOPES as Pt, IMPORT_FOLDER as Q, mergeReports as R, extractVariables as S, CHARACTER_FILE_NAME as St, pruneKnowledge as T, readIdentifier as Tt, PROSE_PROMPTS as U, routeVerdicts as V, deleteWorldPrompt as W, partsOf as X, itemise as Y, withPlayer as Z, characterDocument as _, SLOTS_FILE_NAME as _t, isPresetName as a, writeChoices as at, extractStyle as b, FACTION_FILE_NAME as bt, presetDirectory as c, VARIABLES_FILE_NAME as ct, savePresetFromWorld as d, variableProblems as dt, ImportStore as et, sha as f, LORE_FILE_NAME as ft, asWritten as g, ITEM_FILE_NAME as gt, addLore as h, parseLocationFile as ht, deletePreset as i, readImportFolder as it, buildRoster as j, parseRelationEdit as jt, pruneRelationships as k, parseLoreEdit as kt, readPreset as l, loadVariables as lt, STANDING_PROMPT as m, LOCATION_FILE_NAME as mt, createPresetFromGuidance as n, openingText as nt, listPresets as o, IMPORT_COMMAND as ot, updatePresetInfo as p, parseLoreFile as pt, writeWorldPrompt as q, createPresetFromShipped as r, parseChoices as rt, loadPreset as s, parseImportCommand as st, PRESET_FILE as t, PICTURE_FILE as tt, reservePreset as u, parseVariablesFile as ut, emptyExtracted as v, parseItemFile as vt, loreDocuments as w, readVariableValues as wt, extractStyleFrom as x, parseFactionFile as xt, extractEntities as y, parseSlotsFile as yt, modeFor as z };
4002
+ export { ImportNotFoundError as $, sourcesFor as A, parseLoreEdit as At, noAt as B, inert as C, CHARACTER_FILE_NAME as Ct, pruneLoreSubjects as D, InvalidEditProblems as Dt, pruneLinks as E, readIdentifier as Et, isLeftOut as F, LORE_SCOPES as Ft, listWorldPrompts as G, yesAt as H, announceProblem as I, WEEKDAY_NAMES as It, cleanText as J, readWorldPrompt as K, askYesNo as L, DEFAULT_SLOTS as Lt, classifyItems as M, parseRelationEdit as Mt, findEntity as N, parseThingEdit as Nt, pruneMembers as O, parseCharacterEdit as Ot, ROLES as P, LORE_KINDS as Pt, IMPORT_FOLDER as Q, mergeReports as R, INTENT_STATUSES as Rt, extractVariables as S, parseFactionFile as St, pruneKnowledge as T, readVariableValues as Tt, PROSE_PROMPTS as U, routeVerdicts as V, deleteWorldPrompt as W, partsOf as X, itemise as Y, withPlayer as Z, characterDocument as _, ITEM_FILE_NAME as _t, isPresetName as a, writeChoices as at, extractStyle as b, parseSlotsFile as bt, presetDirectory as c, parseAuthoringCommand as ct, savePresetFromWorld as d, parseVariablesFile as dt, ImportStore as et, sha as f, variableProblems as ft, asWritten as g, parseLocationFile as gt, addLore as h, LOCATION_FILE_NAME as ht, deletePreset as i, readImportFolder as it, buildRoster as j, parsePlaceEdit as jt, pruneRelationships as k, parseFactionEdit as kt, readPreset as l, VARIABLES_FILE_NAME as lt, STANDING_PROMPT as m, parseLoreFile as mt, createPresetFromGuidance as n, openingText as nt, listPresets as o, IMPORT_COMMAND as ot, updatePresetInfo as p, LORE_FILE_NAME as pt, writeWorldPrompt as q, createPresetFromShipped as r, parseChoices as rt, loadPreset as s, parseImportCommand as st, PRESET_FILE as t, PICTURE_FILE as tt, reservePreset as u, loadVariables as ut, emptyExtracted as v, SLOTS_FILE_NAME as vt, loreDocuments as w, parseCharacterFile as wt, extractStyleFrom as x, FACTION_FILE_NAME as xt, extractEntities as y, parseItemFile as yt, modeFor as z };
3992
4003
 
3993
- //# sourceMappingURL=presets-HB8kJTaE.js.map
4004
+ //# sourceMappingURL=presets-Bwnrx7p0.js.map
@@ -1,10 +1,10 @@
1
1
  import { o as roleplaySessionOf, t as promptFor } from "./access-CfQWbNZP.js";
2
- import { B as noAt, H as yesAt, I as announceProblem, L as askYesNo, R as mergeReports, V as routeVerdicts, f as sha, o as listPresets, s as loadPreset } from "./presets-HB8kJTaE.js";
3
- import { A as answerLimits, D as describeWhen, E as describeTime, R as wrongLanguage, Z as PROMPTS_FOLDER, et as inheritPrompts } from "./hooks-rQTTeOC4.js";
4
- import { i as translator, r as languageOf, t as trimCharacters } from "./text-DyRN4nDP.js";
2
+ import { B as noAt, H as yesAt, I as announceProblem, L as askYesNo, R as mergeReports, V as routeVerdicts, f as sha, o as listPresets, s as loadPreset } from "./presets-Bwnrx7p0.js";
3
+ import { A as answerLimits, D as describeWhen, E as describeTime, R as wrongLanguage, Z as PROMPTS_FOLDER, et as inheritPrompts } from "./hooks-CcQj_dJo.js";
4
+ import { i as translator, r as languageOf, t as trimCharacters } from "./text-CbGQhK1-.js";
5
5
  import { a as childTrace, c as runChild, n as childModel, r as childSampling, v as estimateAnswer } from "./child-lYYeOwl2.js";
6
- import { s as inheritImages } from "./library-Dfu0dgRj.js";
7
- import { i as inheritPacks } from "./packs-DIj5BEfq.js";
6
+ import { s as inheritImages } from "./library-QFL6Z_Nr.js";
7
+ import { i as inheritPacks } from "./packs-BREPSfHy.js";
8
8
  import { dirname, join } from "node:path";
9
9
  import { copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
10
10
  import { createUserMessage } from "@deepseek-ai/dsh-llm";
@@ -2028,4 +2028,4 @@ function memoryReflector(deps) {
2028
2028
  }
2029
2029
  export { referent as _, whereabouts as a, readTimeline as c, copyPreset as d, presetStatus as f, sameWords as g, defaultBoundaries as h, reflectionStatus as i, writeTimeline as l, switchPreset as m, memoryReflector as n, TimelineError as o, recordPreset as p, recordFailure as r, Timelines as s, dueReflection as t, pathTo as u };
2030
2030
 
2031
- //# sourceMappingURL=reflection-Dg1xtOTW.js.map
2031
+ //# sourceMappingURL=reflection-CUWG-6Qg.js.map
@@ -216,7 +216,7 @@ const ZH = {
216
216
  "## MCP resource servers\n\nUse {tools} with one of these names as the server argument: {servers}.": "## MCP 资源服务器\n\n使用 {tools},server 参数填下列名称之一:{servers}。",
217
217
  "{where}: the text is longer than {max} characters. A belief is not rewritten to hold what speaks against it: leave the text out and list the belief under doubt with the numbers of what speaks against it, and put what was learned as a new belief of its own": "{where}:文字超过 {max} 个字符。不要通过改写信念来容纳与之相悖的事:不要写文字,把这条信念列入 doubt 并给出与之相悖的编号;新了解到的内容另写成一条新信念",
218
218
  "Import this card into this newly created world.": "把这张卡片导入这个新建的世界。",
219
- "The character card this world was made from has a newer version, kept in this world's .import/update folder. Bring the world up to date with it. First call card_diff: it lists what changed between the two versions, which characters, places and things were made from each changed piece, and which files of the world have been edited since the import. Read the pieces you need with card_read (version current is the old card, version new is the new one). Then change only what the new card changed, with your editing tools, and keep what the person has edited since the import. What the card says about the world itself (its description, tags and opening) is changed with edit_world_info. Remove what only a dropped piece made unless the person edited it. Do not add what neither version of the card says. When the world matches the new card, call card_update_finish, then tell me briefly what you changed, what you left alone and why.": "这个世界所依据的角色卡有了新版本,放在这个世界的 .import/update 文件夹里。请让世界与它保持一致。先调用 card_diff:它会列出两个版本之间的变化、每个变化的片段生成了哪些角色、地点和物品,以及导入之后世界里哪些文件被修改过。需要时用 card_read 读取片段(version 为 current 是旧卡,为 new 是新卡)。然后用你的编辑工具只改新卡改动的部分,并保留用户在导入之后做的修改。卡片对世界本身的描述(简介、标签和开场)用 edit_world_info 修改。只由已被删除的片段生成、且用户没有改过的内容,要移除。两个版本的卡都没有写的内容,一概不要添加。世界与新卡一致后,调用 card_update_finish,再简要告诉我:你改了什么、哪些没动以及原因。",
219
+ "The character card this world was made from has a newer version, kept in this world's .import/update folder. Bring the world up to date with it. First call card_diff: it lists what changed between the two versions, which characters, places and things were made from each changed piece, and which files of the world have been edited since the import. Read the pieces you need with card_read (version current is the old card, version new is the new one). Then change only what the new card changed, with your editing tools, and keep what the person has edited since the import. What the card says about the world itself (its description, tags and opening) is changed with edit_world_info. Remove what only a dropped piece made unless the person edited it. Do not add what neither version of the card says. When the world matches the new card, call check_card with version new: it lists what the new card changed that the world does not say yet; deal with each finding or say why you left it. Then call card_update_finish, and tell me briefly what you changed, what you left alone and why.": "这个世界所依据的角色卡有了新版本,放在这个世界的 .import/update 文件夹里。请让世界与它保持一致。先调用 card_diff:它会列出两个版本之间的变化、每个变化的片段生成了哪些角色、地点和物品,以及导入之后世界里哪些文件被修改过。需要时用 card_read 读取片段(version 为 current 是旧卡,为 new 是新卡)。然后用你的编辑工具只改新卡改动的部分,并保留用户在导入之后做的修改。卡片对世界本身的描述(简介、标签和开场)用 edit_world_info 修改。只由已被删除的片段生成、且用户没有改过的内容,要移除。两个版本的卡都没有写的内容,一概不要添加。世界与新卡一致后,调用 check_card 并设 version 为 new:它会列出新卡改动了、而世界里还没有写到的内容;逐条处理,或说明为什么不处理。然后调用 card_update_finish,再简要告诉我:你改了什么、哪些没动以及原因。",
220
220
  "The update from the newer card is not finished. Apply the changes that remain and call card_update_finish. A change you cannot make with your tools, or one you need the person to decide, goes in your report instead; then say what is left.": "按新卡更新还没有完成。请应用剩下的改动,然后调用 card_update_finish。你的工具做不了的改动,或需要用户决定的改动,写进报告里;然后说明还剩什么。",
221
221
  "Turn the SillyTavern lorebook I uploaded into this lorebook: call {tool} with file {file}.": "把我上传的 SillyTavern 世界书转成这本世界书:调用 {tool},文件为 {file}。",
222
222
  "Turn the SillyTavern preset I uploaded into this preset's prompts: call {tool} with file {file}.": "把我上传的 SillyTavern 预设转成这个预设的提示词:调用 {tool},文件为 {file}。",
@@ -267,7 +267,8 @@ const ZH = {
267
267
  "Scenario:": "场景:",
268
268
  "Opening:": "开场:",
269
269
  "Description:": "描述:",
270
- "Creator's notes:": "作者备注:"
270
+ "Creator's notes:": "作者备注:",
271
+ "Document ({where}), about {subject}:": "文档({where}),关于 {subject}:"
271
272
  };
272
273
  // ../dsh-roleplay-model/src/messages.ts
273
274
  /** The language a setting such as `zh-CN` or `en` stands for; English when it is none that is known. */
@@ -300,4 +301,4 @@ function withoutExtension(value) {
300
301
  }
301
302
  export { translator as i, withoutExtension as n, languageOf as r, trimCharacters as t };
302
303
 
303
- //# sourceMappingURL=text-DyRN4nDP.js.map
304
+ //# sourceMappingURL=text-CbGQhK1-.js.map
@@ -1,5 +1,5 @@
1
1
  import { _ as finishOf, g as cutOff } from "./child-lYYeOwl2.js";
2
- import { d as guardRepeatedCalls } from "./hooks-rQTTeOC4.js";
2
+ import { d as guardRepeatedCalls } from "./hooks-CcQj_dJo.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-g_hDn0jR.js.map
52
+ //# sourceMappingURL=turn-guard-Bb8Ew-1z.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-agentic-roleplay/core",
3
- "version": "0.8.2",
3
+ "version": "0.9.0",
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",
@@ -76,7 +76,7 @@
76
76
  "@deepseek-ai/schemastery": "^3.18.5"
77
77
  },
78
78
  "dependencies": {
79
- "@dsh-agentic-roleplay/state": "0.8.2",
79
+ "@dsh-agentic-roleplay/state": "0.9.0",
80
80
  "@dsh-ai-providers/core": "^0.5.0"
81
81
  },
82
82
  "devDependencies": {
@@ -0,0 +1 @@
1
+ Is this character sheet enough to play the character convincingly? It is enough when it tells who the character is, how they talk or carry themselves, and what they want, fear or care about, so that someone who has read nothing else could answer in their voice and decide what they do. It is not enough when it is only a name and a line, or only a list of looks. Answer yes when it is enough, and give the reason in a sentence.
@@ -0,0 +1,7 @@
1
+ You compare one document of a role-playing world with the pieces of the character card it was made from, and report what was lost or made up. You are given the source pieces and the document.
2
+ - The document is about one subject, named above it. Compare only what the source says about that subject; the source pieces may be about other people or places too, and what they say about those belongs to other documents.
3
+ - dropped: a fact the source states about this subject (a name, a date, a number, a cause, a habit, a relationship, a rule) that the document does not state or contradicts. Quote the passage of the source that states it, exactly as it is written there.
4
+ - invented: a fact the document states that the source does not give and that does not follow from it. Quote the passage of the document, exactly as it is written there.
5
+ - Judge by meaning, not by wording: a fact said in other words, or in another language, is kept. Style, order and length are not facts. Do not report what the document leaves out on purpose (instructions to the narrator, text addressed to the player).
6
+ - Report only what you are sure of, at most six of each. Report nothing when the document keeps the facts and adds none.
7
+ - Do not report what follows plainly from the source (a pronoun from a title, a role label, an entry's kind or layout), and give each passage once, with all the facts it holds in one entry.
@@ -0,0 +1,4 @@
1
+ You review a role-playing world the way an editor reads a draft before it is played, and name what is missing for it to play well. You are given a digest of the world: what it says about itself, its characters, places, organisations, background entries and tracked values.
2
+ - Report only gaps you can see in the digest: a place that is described but has nobody and nothing in it to do, a conflict the background mentions that no character or organisation carries, a character who is named but has no reason to act, something the opening promises that the world never sets up, a rule or secret that nothing can ever reveal.
3
+ - Do not invent facts about the source of the world, and do not judge taste or style. Do not repeat what a file check would find (dangling references, unreachable places, duplicate names).
4
+ - For each gap, about is the key of the character, place, organisation or entry it concerns, or "world"; say what is missing, and what would fill it in one sentence. Name at most eight, the ones that matter most for play. Report nothing when you see no gap.
@@ -0,0 +1,3 @@
1
+ The person ran ${command} (what they added: ${request}). Run the checks of this world with ${tools} and read every finding it returns.
2
+ Then act on them as a careful editor. Fix what is plainly wrong with your editing tools, one fix at a time; each edit asks the person as usual. Where a finding needs a choice (which of two duplicates to keep, what a missing thing should be), ask before changing anything. Leave what is acceptable as it is and say why. Do not invent facts to fill a gap; if the world's card is kept, read it (card_read, card_search) first. If a tool says the world has no card, skip it and say so instead of guessing what the card held. A finding that compares with the card is a pointer, not a verdict: read the piece with card_read before you change anything. Start with the quick checks. Call a tool with deep true when the request says deep or thorough, when the quick findings suggest the world is thin, or to confirm an import: that is where a model compares and judges, so it takes longer.
3
+ After your fixes run the same tool again and check that what you fixed is gone and nothing new appeared. Then tell the person in a few short sentences how many findings there were by severity, what you changed, and what is left and why. Then stop.
@@ -1 +1 @@
1
- The world was written, but as a draft: it would not start yet, and the problems are listed above. Repair them now with your editing tools (they run without asking during this turn), reading the original card with card_overview, card_read and card_search to restore what a dangling reference was meant to point at instead of cutting it. Call world_check after each round of fixes: it names the problems of the first part of the world that has any, so fixing one part can show the next, until it reports ok. Change only what is wrong, as little as needed, and never add what the card does not say. Then review the world as a careful editor (places and their ways, starting places, duplicates) and tell the person briefly what was imported, what was repaired and what is left.
1
+ The world was written, but as a draft: it would not start yet, and the problems are listed above. Repair them now with your editing tools (they run without asking during this turn), reading the original card with card_overview, card_read and card_search to restore what a dangling reference was meant to point at instead of cutting it. Call check_world after each round of fixes: it names the problems of the first part of the world that has any, so fixing one part can show the next, until it reports ok. Change only what is wrong, as little as needed, and never add what the card does not say. Then review the world as a careful editor (places and their ways, starting places, duplicates) and tell the person briefly what was imported, what was repaired and what is left.
@@ -2,8 +2,10 @@ The import is done and written into the world. Before you report, review it as a
2
2
  - get_world_overview, then the places with their exits (list_relationships with exits, get_world_element_source): every way between places should lead somewhere the card implies; an exit to an unrelated place, a place nobody can reach, or a place that is in another by mistake is fixed or removed.
3
3
  - Each character's starting place makes sense for the card, and the playable character (if any) starts somewhere the story can begin.
4
4
  - Names, aliases and summaries read as the card meant them; duplicates (the same person twice) are merged by deleting the weaker one.
5
- The card has no player character unless the import says so: notes about a relationship with [PLAYER] are expected, so leave them, and never make a character for the player. Change only what is wrong, as little as needed, and never add what the card does not say. Then tell the person briefly what was imported, what was left out and why, whether there is a playable character (if not, say that none was found and offer to add one), what you corrected, and any notes that matter. End by offering to compare the world with the original card if the person wants it checked (you can read the card with card_overview and card_read), and do not do it now. If the report shows pictures fetched from the card's web addresses, say how many; they are in the world's image library, so every session started from it has them in its gallery.
5
+ The card has no player character unless the import says so: notes about a relationship with [PLAYER] are expected, so leave them, and never make a character for the player. Change only what is wrong, as little as needed, and never add what the card does not say. Then tell the person briefly what was imported, what was left out and why, whether there is a playable character (if not, say that none was found and offer to add one), what you corrected, and any notes that matter. End by saying that the person can check the world again whenever they like with /check (everything), /check-card (against the card) or /check-quality, and that adding deep to the request makes a model compare and judge. If the report shows pictures fetched from the card's web addresses, say how many; they are in the world's image library, so every session started from it has them in its gallery.
6
6
 
7
7
  The import already turned the card's instructions about narration and behaviour into the world's prose prompts (the report lists them). You may adjust those, or write the other prose prompts (roleplay/persona, roleplay/style, roleplay/character-style) with write_world_prompt after reading the original with read_world_prompt, keeping the placeholders it has. Every other prompt holds the rules of the game and is refused to you. Add nothing the card does not ask for.
8
8
 
9
9
  The report also says how many variables the card's panels and meters became (variables.json), how many of the card's other greetings the world offers as openings to choose from when a session starts, and whether the card's picture became the portrait of its character. Mention them briefly.
10
+
11
+ The report comes with `checks`: the checks the program runs on every import, already run and stored with the world (consistency of the world, comparison with the card, authoring quality). Read the findings. An error is for you to fix. A warning is a pointer: read the piece of the card with card_read, then fix what is wrong or say why you left it. An info is only worth a mention. The checks a model judges are not run yet. Run check_card with deep true when the card was long or many of its pieces were rewritten into lore, or when the quick findings show facts lost or made up; run check_quality with deep true when the cast has bare sheets or the world looks thin. After fixing, run the tool again to see that the finding is gone. Do not run them just to run them, and do not fill a gap with something the card does not say.
@@ -1,4 +1,4 @@
1
1
  The import of this card was written into the world as a draft, because the world would not start yet. This turn is its repair, started by the person. You may edit the world with your tools (they run without asking during this turn).
2
- 1. Call world_check. It names the problems of the first part of the world that has any: where each is and what is wrong. Fixing them can show the problems of the next part, so call it again after each round of fixes, until it reports ok.
2
+ 1. Call check_world. It names the problems of the first part of the world that has any: where each is and what is wrong. Fixing them can show the problems of the next part, so call it again after each round of fixes, until it reports ok.
3
3
  2. Read the original card (card_overview, card_read, card_search) to restore what a dangling reference was meant to point at, instead of cutting it: a character, place or organisation the card does have is created with create_world_element; a reference to something the card does not have is removed with the editing tools. Change only what is wrong, as little as needed, and never add what the card does not say.
4
- 3. When world_check reports ok, or when you cannot fix what is left, stop and tell the person in a few short sentences what you fixed and what is left, in the person's language. Do not run the import tools again.
4
+ 3. When check_world reports ok, or when you cannot fix what is left, stop and tell the person in a few short sentences what you fixed and what is left, in the person's language. Do not run the import tools again.
@@ -1,3 +1,3 @@
1
- The world still would not start after your changes, so the turn cannot end yet. These are the problems world_check reports now:
1
+ The world still would not start after your changes, so the turn cannot end yet. These are the problems check_world reports now:
2
2
  ${problems}
3
- Fix them with your editing tools, reading the original card (card_read, card_search) where something it described is missing, then call world_check again. Cut a reference only when the card has nothing it could point at. If you cannot fix what is left, say exactly what is left and why, and stop.
3
+ Fix them with your editing tools, reading the original card (card_read, card_search) where something it described is missing, then call check_world again. Cut a reference only when the card has nothing it could point at. If you cannot fix what is left, say exactly what is left and why, and stop.
@@ -0,0 +1 @@
1
+ 这份角色设定足以让人令人信服地扮演这个角色吗?足够,是指它说明了这个角色是谁、怎么说话或举止,以及想要什么、害怕什么、在乎什么,使得没读过别的材料的人也能用他的口吻回答,并决定他会怎么做。不够,是指它只有名字和一句话,或只有一串外貌描写。足够就回答是,并用一句话说明理由。
@@ -0,0 +1,7 @@
1
+ 你要把一个角色扮演世界的某份文档,与它所依据的角色卡片段对照,报告丢失了什么、编造了什么。你会拿到原文片段和这份文档。
2
+ - 文档只关于一个对象,名字写在文档上方。只对照原文就这个对象说的话;原文片段可能同时讲到别的人或地点,那些内容属于别的文档。
3
+ - dropped(丢失):原文就这个对象陈述的某个事实(名字、日期、数字、原因、习惯、关系、规则),文档没有陈述或与之矛盾。引用陈述它的原文段落,与原文写法完全一致。
4
+ - invented(编造):文档陈述了原文没有给出、也无法由原文推出的某个事实。引用文档中的段落,与文档写法完全一致。
5
+ - 按意思判断,不按措辞:换了说法或换了语言的事实算保留。文风、顺序、篇幅不是事实。文档有意略去的内容(给叙述者的指令、对玩家说的话)不要报告。
6
+ - 只报告你确定的,每类至多六条。文档保留了事实又没有添加时,什么都不报告。
7
+ - 可由原文直接推出的内容(由称呼推出的代词、角色标签、条目的类型或排版)不要报告;每段引文只报告一次,把其中的事实合并在同一条里。
@@ -0,0 +1,4 @@
1
+ 你像编辑在游玩之前审阅草稿那样审阅一个角色扮演世界,指出它要玩得好还缺什么。你会拿到这个世界的概要:它对自身的说明、角色、地点、组织、背景条目和追踪的数值。
2
+ - 只报告你能在概要里看到的缺口:有描述却没有任何人或事可做的地点;背景里提到、却没有任何角色或组织承担的冲突;有名字却没有行动理由的角色;开场白许诺了、世界却从未铺垫的东西;永远不会被任何东西揭示的规则或秘密。
3
+ - 不要编造这个世界来源的事实,也不要评判趣味或文风。不要重复文件检查能发现的问题(悬空引用、无法到达的地点、重名)。
4
+ - 每个缺口,about 是它所涉及的角色、地点、组织或条目的 key,或者 "world";说明缺了什么,以及用一句话说明补上什么。至多列八条,选对游玩最重要的。看不到缺口时什么都不报告。
@@ -0,0 +1,3 @@
1
+ 用户运行了 ${command}(附加内容:${request})。用 ${tools} 检查这个世界,并阅读它返回的每一条发现。
2
+ 然后像一位细心的编辑那样处理:明显有误的,用你的编辑工具一处一处地修正,每次修改照常会请用户批准。如果某条发现需要做选择(两个重复项保留哪一个、缺失的东西应该是什么),先询问,再动手。可以接受的就保持原样,并说明原因。不要为了填补空缺而编造事实;如果世界保留了角色卡,先去读它(card_read、card_search)。 如果某个工具说这个世界没有角色卡,就跳过它并如实说明,不要猜测卡里有什么。与卡比较得出的发现只是线索,不是结论:修改任何东西之前,先用 card_read 读该段原文。 先用快速检查。当请求里说要深入或彻底检查、快速检查的结果显示世界内容单薄、或者要确认一次导入时,调用工具时把 deep 设为 true:那时由模型来比对和判断,耗时更长。
3
+ 修正之后,再运行同一个工具,确认你修正的问题已经消失,也没有出现新的问题。然后用几句话告诉用户:各严重程度的发现各有多少条,你改了什么,还剩下什么以及原因。然后停下。
@@ -1 +1 @@
1
- 世界已经写入,但是作为草稿写入的:它目前还无法开始,上面列出了问题。现在用编辑工具修复它们(本回合内这些工具无需询问即可执行),并用 card_overview、card_read 和 card_search 阅读原始角色卡,恢复悬空引用原本要指向的东西,而不是直接把引用砍掉。每修完一轮就调用 world_check:它会指出世界中第一个有问题的部分,所以修好一处可能露出下一处,直到它报告 ok。只改有问题的地方,改动越小越好,绝不要添加卡里没写的内容。然后像一名细心的编辑那样检查这个世界(地点及其通路、起始地点、重复项),并简要告诉用户导入了什么、修复了什么、还剩什么。
1
+ 世界已经写入,但是作为草稿写入的:它目前还无法开始,上面列出了问题。现在用编辑工具修复它们(本回合内这些工具无需询问即可执行),并用 card_overview、card_read 和 card_search 阅读原始角色卡,恢复悬空引用原本要指向的东西,而不是直接把引用砍掉。每修完一轮就调用 check_world:它会指出世界中第一个有问题的部分,所以修好一处可能露出下一处,直到它报告 ok。只改有问题的地方,改动越小越好,绝不要添加卡里没写的内容。然后像一名细心的编辑那样检查这个世界(地点及其通路、起始地点、重复项),并简要告诉用户导入了什么、修复了什么、还剩什么。
@@ -2,8 +2,10 @@
2
2
  - 先用 get_world_overview,再看各个地点及其出口(list_relationships 的出口、get_world_element_source):每条通路都应通向卡片所暗示的地方;通向毫不相干地点的出口、无法到达的地点、被错误放进另一个地点的地点,都要修正或删除。
3
3
  - 每个角色的起始地点要符合卡片,可扮演的角色(如果有)要从故事能够开始的地方出发。
4
4
  - 名字、别名和简介要符合卡片的本意;重复的人物(同一个人出现两次)删除较弱的那个。
5
- 除非导入另有说明,卡片没有玩家角色:关于与 [PLAYER] 的关系的备注是预料之中的,不要管它们,也绝不要为玩家创建角色。只改错误的地方,改动尽量少,绝不添加卡片没有说的内容。然后简要告诉用户:导入了什么、略去了什么以及原因、是否有可扮演的角色(如果没有,说明没有找到,并主动提出添加一个)、你纠正了什么,以及重要的备注。最后主动提出:如果用户希望,可以把世界与原始角色卡对照检查(用 card_overview 和 card_read 读卡),但现在不要做。如果报告显示从角色卡的网址取回了图片,说明数量;它们存放在世界的图片库中,由此世界开始的每个会话的画廊里都有。
5
+ 除非导入另有说明,卡片没有玩家角色:关于与 [PLAYER] 的关系的备注是预料之中的,不要管它们,也绝不要为玩家创建角色。只改错误的地方,改动尽量少,绝不添加卡片没有说的内容。然后简要告诉用户:导入了什么、略去了什么以及原因、是否有可扮演的角色(如果没有,说明没有找到,并主动提出添加一个)、你纠正了什么,以及重要的备注。最后说明:用户随时可以用 /check(全部)、/check-card(对照角色卡)或 /check-quality 再次检查这个世界,请求里加上 deep 则由模型来比对和判断。如果报告显示从角色卡的网址取回了图片,说明数量;它们存放在世界的图片库中,由此世界开始的每个会话的画廊里都有。
6
6
 
7
7
  导入已把角色卡中关于叙述和角色表现的指令整理成世界的文风提示(报告里列出)。你可以调整它们,或先用 read_world_prompt 读原文,再用 write_world_prompt 写其他文笔类提示(roleplay/persona、roleplay/style、roleplay/character-style),并保留其中的占位符。其他所有提示都是游戏规则,不允许你修改。角色卡没有要求的,一概不要添加。
8
8
 
9
9
  报告还会说明:角色卡的状态栏和数值面板变成了多少个变量(variables.json)、角色卡的其他开场白有多少个成为开始会话时可选的开场、以及角色卡的图片是否成为了对应角色的立绘。请简要提及。
10
+
11
+ 报告附带 `checks`:程序对每次导入都会运行的检查,已经运行并存放在世界里(世界自身的一致性、与卡片的对照、创作质量)。请阅读这些发现。错误由你修复。警告只是线索:先用 card_read 读卡片的对应片段,再修正有误之处,或说明为什么不改。提示只需一提。由模型判断的检查还没有运行。卡片很长、或其中很多片段被改写成了背景条目、或者快速检查显示有事实丢失或被编造时,用 deep 为 true 运行 check_card;角色设定很空、或世界显得单薄时,用 deep 为 true 运行 check_quality。修正之后再运行一次,确认那条发现消失了。不要为了运行而运行,也不要用卡片没有写的内容去填补空缺。
@@ -1,4 +1,4 @@
1
1
  这张卡的导入结果已作为草稿写进世界,因为这个世界目前还无法开始。这一回合是对它的修复,由用户发起。你可以用工具编辑这个世界(本回合内这些工具无需询问即可执行)。
2
- 1. 先调用 world_check。它会指出世界中第一个有问题的部分:每个问题在哪里、错在哪里。修好之后可能会露出下一个部分的问题,所以每修完一轮就再调用一次,直到它报告 ok。
2
+ 1. 先调用 check_world。它会指出世界中第一个有问题的部分:每个问题在哪里、错在哪里。修好之后可能会露出下一个部分的问题,所以每修完一轮就再调用一次,直到它报告 ok。
3
3
  2. 阅读原始角色卡(card_overview、card_read、card_search),用来恢复悬空引用原本要指向的东西,而不是直接把引用砍掉:卡里确实有的角色、地点或组织,用 create_world_element 创建;卡里没有的东西,用编辑工具把引用移除。只改有问题的地方,改动越小越好,绝不要添加卡里没写的内容。
4
- 3. 当 world_check 报告 ok,或者剩下的问题你无法修复时,就停下,用几句话向用户说明你修了什么、还剩什么,使用用户的语言。不要再运行导入工具。
4
+ 3. 当 check_world 报告 ok,或者剩下的问题你无法修复时,就停下,用几句话向用户说明你修了什么、还剩什么,使用用户的语言。不要再运行导入工具。
@@ -1,3 +1,3 @@
1
- 经过你的修改,这个世界仍然无法开始,所以这一回合还不能结束。world_check 现在报告的问题是:
1
+ 经过你的修改,这个世界仍然无法开始,所以这一回合还不能结束。check_world 现在报告的问题是:
2
2
  ${problems}
3
- 用编辑工具修复它们;如果卡里描述过的某样东西缺失了,就阅读原始角色卡(card_read、card_search)把它补回来,然后再次调用 world_check。只有当卡里没有任何可指向的东西时,才删掉那条引用。如果剩下的问题你无法修复,就准确说明还剩什么、为什么,然后停下。
3
+ 用编辑工具修复它们;如果卡里描述过的某样东西缺失了,就阅读原始角色卡(card_read、card_search)把它补回来,然后再次调用 check_world。只有当卡里没有任何可指向的东西时,才删掉那条引用。如果剩下的问题你无法修复,就准确说明还剩什么、为什么,然后停下。