@dsh-agentic-roleplay/core 0.6.0 → 0.7.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.
package/lib/doctor.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as chatSessionId } from "./access-EbNdZFbk.js";
2
2
  import { a as liveSettings } from "./narration-_dA9oIt2.js";
3
- import { i as externalTools, t as externalToolLimit } from "./hooks-BLperIIB.js";
3
+ import { i as externalTools, t as externalToolLimit } from "./hooks-DufjUf1p.js";
4
4
  import { n as doctorSessionOf } from "./doctor-chat-ByDfCMeo.js";
5
5
  import { join } from "node:path";
6
6
  import { existsSync } from "node:fs";
@@ -244,7 +244,11 @@ const ZH = {
244
244
  "{name} went to {place}.": "{name}去了{place}。",
245
245
  "## MCP resource servers\n\nUse {tools} with the server argument naming an MCP server.": "## MCP 资源服务器\n\n使用 {tools},server 参数填 MCP 服务器的名称。",
246
246
  "## MCP resource servers\n\nUse {tools} with one of these names as the server argument: {servers}.": "## MCP 资源服务器\n\n使用 {tools},server 参数填下列名称之一:{servers}。",
247
- "{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 并给出与之相悖的编号;新了解到的内容另写成一条新信念"
247
+ "{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 并给出与之相悖的编号;新了解到的内容另写成一条新信念",
248
+ "Import this card into this newly created world.": "把这张卡片导入这个新建的世界。",
249
+ "Turn the SillyTavern lorebook I uploaded into this lorebook: call {tool} with file {file}.": "把我上传的 SillyTavern 世界书转成这本世界书:调用 {tool},文件为 {file}。",
250
+ "Turn the SillyTavern preset I uploaded into this preset's prompts: call {tool} with file {file}.": "把我上传的 SillyTavern 预设转成这个预设的提示词:调用 {tool},文件为 {file}。",
251
+ "Apply the narration preset I uploaded to this world: call {tool} with file {file}.": "把我上传的叙述预设应用到这个世界:调用 {tool},文件为 {file}。"
248
252
  };
249
253
  //#endregion
250
254
  //#region ../dsh-roleplay-model/src/messages.ts
@@ -343,6 +347,8 @@ var PromptLibrary = class extends Service {
343
347
  this.root = root;
344
348
  this.shipped = shipped;
345
349
  }
350
+ /** True while the prompts folder is being synced: files that are missing are then read from the package and not written, so the sync never sees a file appear. */
351
+ frozen = () => false;
346
352
  get directory() {
347
353
  return join(this.root.path, PROMPTS_FOLDER);
348
354
  }
@@ -393,6 +399,7 @@ var PromptLibrary = class extends Service {
393
399
  if (source === void 0) throw new Error(`there is no prompt ${id} in ${language} or en`);
394
400
  const target = source.startsWith(join(this.shipped, language)) ? found : join(this.directory, "en", `${id}.md`);
395
401
  if (!this.usable(target, id)) {
402
+ if (this.frozen()) return source;
396
403
  mkdirSync(dirname(target), { recursive: true });
397
404
  copyFileSync(source, target);
398
405
  }
@@ -3657,6 +3664,7 @@ function installHooks(ctx, deps) {
3657
3664
  if (owner === void 0 || store === void 0) return decision;
3658
3665
  const text = payload.messages.filter((message) => message.source.kind === "user").flatMap((message) => message.content.flatMap((block) => block.type === "text" ? [block.text] : [])).join("\n");
3659
3666
  if (!store.settings().background.concurrent) await engine.quiesce(owner.chat);
3667
+ await ctx.roleplayOrchestration.unitFree(owner.chat);
3660
3668
  await timelines.begin(owner.chat, payload.turn, text);
3661
3669
  const cast = store.cast();
3662
3670
  const ooc = parseOoc(text);
@@ -3754,4 +3762,4 @@ function installHooks(ctx, deps) {
3754
3762
  //#endregion
3755
3763
  export { listFiles as $, answerLimits as A, loadPlots as B, readNotes as C, describeWhen as D, describeTime as E, STORY_LANGUAGES as F, formatIssue as G, plotReferenceProblems as H, isStoryLanguage as I, PROMPTS_FOLDER as J, errorMessage as K, textLanguage as L, plotProgressOf as M, populatePlots as N, zoneOf as O, LANGUAGE_NAMES as P, languageOf as Q, wrongLanguage as R, notesOfSession as S, ClockError as T, readDocument as U, parsePlotsFile as V, Reader as W, copyWorldPrompts as X, PromptLibrary as Y, inheritPrompts as Z, readRunDetail as _, externalWithheld as a, InvalidWorldError as at, readWithdrawn as b, record as c, SessionNotFoundError as ct, toolEnabled as d, translator as dt, promptProblem as et, MAX_OOC_ANSWER as f, readActivity as g, readDecisionStats as h, externalTools as i, InvalidStartError as it, PLOTS_METADATA_KEY as j, RESULTS as k, AUTHORING_NEEDS as l, WorldNotFoundError as lt, readUsage as m, installHooks as n, shippedPromptsDirectory as nt, PREVIEW_TOOL as o, ReflectionRefusedError as ot, storesOf as p, LANGUAGE_FOLDER as q, externalGiven as r, AgentUnavailableError as rt, createTools$1 as s, SessionArchivedError as st, externalToolLimit as t, shippedLanguages as tt, characterRunner as u, languageOf$1 as ut, readVerdicts as v, observeAsPlayer as w, addToNote as x, writeVerdicts as y, PLOTS_FILE_NAME as z };
3756
3764
 
3757
- //# sourceMappingURL=hooks-BLperIIB.js.map
3765
+ //# sourceMappingURL=hooks-DufjUf1p.js.map