@dsh-agentic-roleplay/core 0.12.1 → 0.12.2

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 (32) hide show
  1. package/cordis.patch.yml +108 -0
  2. package/lib/{access-DifaiHrI.js → access-Csp80TFX.js} +2 -2
  3. package/lib/{authoring-tools-VOaXzr_R.js → authoring-tools-BZr4bgBy.js} +9 -7
  4. package/lib/authoring.js +9 -8
  5. package/lib/{child-DzZ-aI6k.js → child-DTdY14S9.js} +45 -6
  6. package/lib/client.js +820 -561
  7. package/lib/client.js.map +1 -1
  8. package/lib/compaction.js +3 -3
  9. package/lib/{dev-context-Bdm-eVer.js → dev-context-Cgv_wZbG.js} +12 -2
  10. package/lib/doctor.js +5 -4
  11. package/lib/{gallery-Ctz-UoFk.js → gallery-BNg0rPTp.js} +3 -3
  12. package/lib/{generator-Cv6WWmZT.js → generator-9-5at9cZ.js} +2 -2
  13. package/lib/helper.js +4 -10
  14. package/lib/{hooks-BdR3mBeM.js → hooks-Dtq5KZQX.js} +19 -7
  15. package/lib/images.js +4 -4
  16. package/lib/index.js +39 -28
  17. package/lib/{jail-Cp4zEfip.js → jail-DVbPSC0R.js} +2 -2
  18. package/lib/{library-BU2A_Dx8.js → library-DTxakw0z.js} +2 -2
  19. package/lib/{lorebook-author-tools-DUKcQu8P.js → lorebook-author-tools-BjcEUo22.js} +6 -6
  20. package/lib/lorebook-authoring.js +7 -6
  21. package/lib/{narration-CDsJ5wxH.js → narration--K2XVIHI.js} +2 -2
  22. package/lib/orchestration.js +12 -12
  23. package/lib/{pack-jail-CzHQu0n3.js → pack-jail-Dt0VTsu0.js} +11 -11
  24. package/lib/{packs-BZ-45J4-.js → packs-DWfR2Ted.js} +2 -2
  25. package/lib/{presenter-agent-C2ZkoxZu.js → presenter-agent-vFOxIuWv.js} +6 -6
  26. package/lib/{preset-BPnRPW-1.js → preset-Dv5YF2qj.js} +4 -4
  27. package/lib/{preset-author-tools-DBqPwn-o.js → preset-author-tools-BUzO9mTW.js} +6 -6
  28. package/lib/preset-authoring.js +7 -6
  29. package/lib/{reflection-Cuy0YLv0.js → reflection-Dd3pEiZB.js} +7 -7
  30. package/lib/{serial-BZNeK57v.js → serial-BUaJGwVy.js} +67 -7
  31. package/lib/{turn-guard-xaFxYc1T.js → turn-guard-87NE-Cnp.js} +3 -3
  32. package/package.json +3 -3
package/lib/compaction.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as liveSettings, t as decodeOutput } from "./narration-CDsJ5wxH.js";
2
- import { j as roleplaySessionOf, k as tokensOf, l as runChild, n as childModel, r as childSampling } from "./child-DzZ-aI6k.js";
3
- import { t as promptFor } from "./access-DifaiHrI.js";
1
+ import { a as liveSettings, t as decodeOutput } from "./narration--K2XVIHI.js";
2
+ import { j as roleplaySessionOf, k as tokensOf, l as runChild, n as childModel, r as childSampling } from "./child-DTdY14S9.js";
3
+ import { t as promptFor } from "./access-Csp80TFX.js";
4
4
  import { join } from "node:path";
5
5
  import { sessionFolder } from "@dsh-agentic-roleplay/state";
6
6
  import BasicCompactionEngine from "@deepseek-ai/dsh-compaction-basic";
@@ -35,6 +35,16 @@ function silenceHarnessDevContext(ctx) {
35
35
  });
36
36
  }
37
37
  }
38
- export { silenceHarnessDevContext as t };
38
+ /** Removes DSH runtime facts from agents that receive their working context elsewhere. */
39
+ function silenceRuntimeContext(ctx) {
40
+ ctx.effect(() => ctx.systemPrompt.suppressRuntimeContext(), "roleplay: runtime context");
41
+ ctx.systemPrompt.context({
42
+ name: "working-directory:current",
43
+ order: ctx.systemPrompt.getContextOrder("WORKING_DIRECTORY"),
44
+ interpolate: false,
45
+ text: ""
46
+ });
47
+ }
48
+ export { silenceRuntimeContext as n, silenceHarnessDevContext as t };
39
49
 
40
- //# sourceMappingURL=dev-context-Bdm-eVer.js.map
50
+ //# sourceMappingURL=dev-context-Cgv_wZbG.js.map
package/lib/doctor.js CHANGED
@@ -1,8 +1,8 @@
1
- import { t as silenceHarnessDevContext } from "./dev-context-Bdm-eVer.js";
2
- import { A as chatSessionId } from "./child-DzZ-aI6k.js";
1
+ import { n as silenceRuntimeContext, t as silenceHarnessDevContext } from "./dev-context-Cgv_wZbG.js";
2
+ import { A as chatSessionId } from "./child-DTdY14S9.js";
3
3
  import { n as doctorSessionOf } from "./doctor-chat-hL1a61hp.js";
4
- import { o as externalTools, t as externalToolLimit } from "./hooks-BdR3mBeM.js";
5
- import { a as liveSettings } from "./narration-CDsJ5wxH.js";
4
+ import { o as externalTools, t as externalToolLimit } from "./hooks-Dtq5KZQX.js";
5
+ import { a as liveSettings } from "./narration--K2XVIHI.js";
6
6
  import { join } from "node:path";
7
7
  import { createTools, isSessionId, sessionDatabase, sessionFolder } from "@dsh-agentic-roleplay/state";
8
8
  import { existsSync } from "node:fs";
@@ -79,6 +79,7 @@ function doctorApproval(exec) {
79
79
  }
80
80
  function apply(ctx) {
81
81
  silenceHarnessDevContext(ctx);
82
+ silenceRuntimeContext(ctx);
82
83
  const sessionsDir = () => join(ctx.roleplayRoot.path, "sessions");
83
84
  const resolve = (chat) => {
84
85
  const id = doctorSessionOf(chat);
@@ -1,5 +1,5 @@
1
- import { n as atomicWrite } from "./access-DifaiHrI.js";
2
- import { _ as writeImageFileMetadata, a as LIBRARY_FOLDER, g as sidecarOf, h as readImageFileMetadata, m as mediaTypeOf, x as mapLimit } from "./library-BU2A_Dx8.js";
1
+ import { n as atomicWrite } from "./access-Csp80TFX.js";
2
+ import { _ as writeImageFileMetadata, a as LIBRARY_FOLDER, g as sidecarOf, h as readImageFileMetadata, m as mediaTypeOf, x as mapLimit } from "./library-DTxakw0z.js";
3
3
  import { join, sep } from "node:path";
4
4
  import { lstat, readFile, readdir, realpath, stat } from "node:fs/promises";
5
5
  // src/host/images/gallery.ts
@@ -187,4 +187,4 @@ async function updateImage(sessionFolder, path, update) {
187
187
  }
188
188
  export { updateImage as i, galleryFile as n, listGallery as r, describeGalleryImage as t };
189
189
 
190
- //# sourceMappingURL=gallery-Ctz-UoFk.js.map
190
+ //# sourceMappingURL=gallery-BNg0rPTp.js.map
@@ -1,4 +1,4 @@
1
- import { d as sceneImagePath, f as writeImage, u as referenceImagePath } from "./library-BU2A_Dx8.js";
1
+ import { d as sceneImagePath, f as writeImage, u as referenceImagePath } from "./library-DTxakw0z.js";
2
2
  // src/host/images/generator.ts
3
3
  const unique = (values) => [...new Set(values.map((value) => value.trim()).filter((value) => value !== ""))];
4
4
  /** What a reference image shows: the subject and its stable look. */
@@ -147,4 +147,4 @@ async function generateTransientImage(service, request) {
147
147
  }
148
148
  export { uploadReferenceImage as a, transientPrompt as i, generateTransientImage as n, referencePrompt as r, generateReferenceImage as t };
149
149
 
150
- //# sourceMappingURL=generator-Cv6WWmZT.js.map
150
+ //# sourceMappingURL=generator-9-5at9cZ.js.map
package/lib/helper.js CHANGED
@@ -1,7 +1,7 @@
1
- import { t as silenceHarnessDevContext } from "./dev-context-Bdm-eVer.js";
2
- import { o as helpers } from "./child-DzZ-aI6k.js";
1
+ import { n as silenceRuntimeContext, t as silenceHarnessDevContext } from "./dev-context-Cgv_wZbG.js";
2
+ import { o as helpers } from "./child-DTdY14S9.js";
3
3
  import { a as workspaceOf, n as storyRoots } from "./service-mRKwpWjX.js";
4
- import { t as registerFoldersJail } from "./jail-Cp4zEfip.js";
4
+ import { t as registerFoldersJail } from "./jail-DVbPSC0R.js";
5
5
  import { join } from "node:path";
6
6
  import { sessionFolder } from "@dsh-agentic-roleplay/state";
7
7
  // src/helper.ts
@@ -22,13 +22,7 @@ function apply(ctx) {
22
22
  return agent === void 0 ? "" : helpers.get(agent.session.id)?.persona ?? "";
23
23
  }
24
24
  });
25
- ctx.effect(() => ctx.systemPrompt.suppressRuntimeContext(), "roleplay: helper runtime context");
26
- ctx.systemPrompt.context({
27
- name: "working-directory:current",
28
- order: ctx.systemPrompt.getContextOrder("WORKING_DIRECTORY"),
29
- interpolate: false,
30
- text: ""
31
- });
25
+ silenceRuntimeContext(ctx);
32
26
  const rootOf = () => ctx.get("roleplayRoot")?.path;
33
27
  registerFoldersJail(ctx, {
34
28
  roots: async (session) => {
@@ -1,6 +1,6 @@
1
- import { C as addTokens, D as finishOf, E as cutOff, O as estimateAnswer, S as NO_TOKENS, a as childTrace, b as estimateTokens, f as tracerOf, j as roleplaySessionOf, l as runChild, n as childModel, r as childSampling, u as TurnTraces, v as requestsOf, x as tokensOf, y as blockText } from "./child-DzZ-aI6k.js";
2
- import { _ as emptyStats, a as liveSettings, h as DECISION_SITES, m as rulesOf, n as encodeOutput, p as WORLD_RULES_KEY, r as encodePreview } from "./narration-CDsJ5wxH.js";
3
- import { t as promptFor } from "./access-DifaiHrI.js";
1
+ import { C as addTokens, D as finishOf, E as cutOff, O as estimateAnswer, S as NO_TOKENS, a as childTrace, b as estimateTokens, f as tracerOf, j as roleplaySessionOf, l as runChild, n as childModel, r as childSampling, u as TurnTraces, v as requestsOf, x as tokensOf, y as blockText } from "./child-DTdY14S9.js";
2
+ import { _ as emptyStats, a as liveSettings, h as DECISION_SITES, m as rulesOf, n as encodeOutput, p as WORLD_RULES_KEY, r as encodePreview } from "./narration--K2XVIHI.js";
3
+ import { t as promptFor } from "./access-Csp80TFX.js";
4
4
  import { i as translator, r as languageOf$1, t as trimCharacters } from "./text-Dfv8S8eq.js";
5
5
  import { n as storyRoots } from "./service-mRKwpWjX.js";
6
6
  import { dirname, join } from "node:path";
@@ -227,6 +227,8 @@ function shippedPromptsDirectory(from = dirname(fileURLToPath(import.meta.url)))
227
227
  if (dirname(directory) === directory) throw new Error("the prompts shipped with the package were not found");
228
228
  }
229
229
  }
230
+ /** A language tag as a world file or a person writes it: `ja`, `zh-CN`, `pt_BR`. */
231
+ const LANGUAGE_TAG = /^[A-Za-z]{2,3}(?:[-_][A-Za-z0-9]{2,8})?$/;
230
232
  /** `zh-CN` and `ZH` are both `zh`; anything that is not a language tag is refused. */
231
233
  function languageOf(tag) {
232
234
  const primary = (tag ?? "en").trim().toLowerCase().split(/[-_]/)[0] ?? "";
@@ -236,7 +238,15 @@ function languageOf(tag) {
236
238
  /** How a language is named inside a prompt, for the instruction to write in it. */
237
239
  const LANGUAGE_NAMES$1 = {
238
240
  en: "English",
239
- zh: "中文"
241
+ zh: "中文",
242
+ ja: "日本語",
243
+ ko: "한국어",
244
+ es: "Español",
245
+ fr: "Français",
246
+ de: "Deutsch",
247
+ pt: "Português",
248
+ ru: "Русский",
249
+ it: "Italiano"
240
250
  };
241
251
  function fill(id, text, given, tag) {
242
252
  const variables = {
@@ -253,7 +263,9 @@ function fill(id, text, given, tag) {
253
263
  const textOf$1 = (path) => readFileSync(path, "utf8").replaceAll("\r\n", "\n");
254
264
  /** A prompt as the package ships it, without a roleplay root: for code that has none, such as tests. */
255
265
  function shippedText(id, language = "en", variables = {}) {
256
- return fill(id, textOf$1(join(shippedPromptsDirectory(), language, `${id}.md`)), variables, language);
266
+ const directory = shippedPromptsDirectory();
267
+ const path = [language, "en"].map((name) => join(directory, name, `${id}.md`)).find((candidate) => existsSync(candidate)) ?? join(directory, language, `${id}.md`);
268
+ return fill(id, textOf$1(path), variables, language);
257
269
  }
258
270
  function listFiles(directory, prefix = "") {
259
271
  return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
@@ -4837,6 +4849,6 @@ function installHooks(ctx, deps) {
4837
4849
  };
4838
4850
  });
4839
4851
  }
4840
- export { inheritPrompts as $, plotProgressOf as A, parsePlotsFile as B, readNotes as C, referent as D, sameWords as E, textLanguage as F, readDocument as G, COMMANDS_KEY as H, wrongLanguage as I, errorMessage as J, Reader as K, readUsage as L, LANGUAGE_NAMES as M, STORY_LANGUAGES as N, RESULTS as O, isStoryLanguage as P, copyWorldPrompts as Q, PLOTS_FILE_NAME as R, notesOfSession as S, defaultBoundaries as T, commandFlagKey as U, plotReferenceProblems as V, commandsOf as W, PROMPTS_FOLDER as X, LANGUAGE_FOLDER as Y, PromptLibrary as Z, readTraces as _, COMPARISONS as _t, externalGiven as a, shippedText as at, readWithdrawn as b, PREVIEW_TOOL as c, InvalidWorldError as ct, toolEnabled as d, SessionNotFoundError as dt, languageOf as et, MAX_OOC_ANSWER as f, WorldNotFoundError as ft, readRunDetail as g, AUTHORING_NEEDS as gt, readActivity as h, zoneOf as ht, characterRunner as i, shippedPromptsDirectory as it, populatePlots as j, PLOTS_METADATA_KEY as k, createTools$1 as l, ReflectionRefusedError as lt, readDecisionStats as m, describeWhen as mt, installHooks as n, promptProblem as nt, externalTools as o, AgentUnavailableError as ot, storesOf as p, ClockError as pt, formatIssue as q, guardRepeatedCalls as r, shippedLanguages as rt, externalWithheld as s, InvalidStartError as st, externalToolLimit as t, listFiles as tt, record as u, SessionArchivedError as ut, readVerdicts as v, observeAsPlayer as w, addToNote as x, writeVerdicts as y, loadPlots as z };
4852
+ export { copyWorldPrompts as $, plotProgressOf as A, parsePlotsFile as B, readNotes as C, referent as D, sameWords as E, textLanguage as F, readDocument as G, COMMANDS_KEY as H, wrongLanguage as I, errorMessage as J, Reader as K, readUsage as L, LANGUAGE_NAMES as M, STORY_LANGUAGES as N, RESULTS as O, isStoryLanguage as P, PromptLibrary as Q, PLOTS_FILE_NAME as R, notesOfSession as S, defaultBoundaries as T, commandFlagKey as U, plotReferenceProblems as V, commandsOf as W, LANGUAGE_TAG as X, LANGUAGE_FOLDER as Y, PROMPTS_FOLDER as Z, readTraces as _, AUTHORING_NEEDS as _t, externalGiven as a, shippedPromptsDirectory as at, readWithdrawn as b, PREVIEW_TOOL as c, InvalidStartError as ct, toolEnabled as d, SessionArchivedError as dt, inheritPrompts as et, MAX_OOC_ANSWER as f, SessionNotFoundError as ft, readRunDetail as g, zoneOf as gt, readActivity as h, describeWhen as ht, characterRunner as i, shippedLanguages as it, populatePlots as j, PLOTS_METADATA_KEY as k, createTools$1 as l, InvalidWorldError as lt, readDecisionStats as m, ClockError as mt, installHooks as n, listFiles as nt, externalTools as o, shippedText as ot, storesOf as p, WorldNotFoundError as pt, formatIssue as q, guardRepeatedCalls as r, promptProblem as rt, externalWithheld as s, AgentUnavailableError as st, externalToolLimit as t, languageOf as tt, record as u, ReflectionRefusedError as ut, readVerdicts as v, COMPARISONS as vt, observeAsPlayer as w, addToNote as x, writeVerdicts as y, loadPlots as z };
4841
4853
 
4842
- //# sourceMappingURL=hooks-BdR3mBeM.js.map
4854
+ //# sourceMappingURL=hooks-Dtq5KZQX.js.map
package/lib/images.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as searchImages, c as presentedFor, n as interpretImage, o as tokensOf, r as imageTools, s as present, t as runImagePresenter } from "./presenter-agent-C2ZkoxZu.js";
2
- import { i as updateImage, r as listGallery } from "./gallery-Ctz-UoFk.js";
3
- import { c as nextSceneSerial, d as sceneImagePath, l as readImageMetadata, o as entityImageDirectory, s as inheritImages, t as addToLibrary, u as referenceImagePath, v as readPngMetadata, y as withPngMetadata } from "./library-BU2A_Dx8.js";
4
- import { i as transientPrompt, n as generateTransientImage, r as referencePrompt, t as generateReferenceImage } from "./generator-Cv6WWmZT.js";
1
+ import { a as searchImages, c as presentedFor, n as interpretImage, o as tokensOf, r as imageTools, s as present, t as runImagePresenter } from "./presenter-agent-vFOxIuWv.js";
2
+ import { i as updateImage, r as listGallery } from "./gallery-BNg0rPTp.js";
3
+ import { c as nextSceneSerial, d as sceneImagePath, l as readImageMetadata, o as entityImageDirectory, s as inheritImages, t as addToLibrary, u as referenceImagePath, v as readPngMetadata, y as withPngMetadata } from "./library-DTxakw0z.js";
4
+ import { i as transientPrompt, n as generateTransientImage, r as referencePrompt, t as generateReferenceImage } from "./generator-9-5at9cZ.js";
5
5
  export { addToLibrary, entityImageDirectory, generateReferenceImage, generateTransientImage, imageTools, inheritImages, interpretImage, listGallery, nextSceneSerial, present, presentedFor, readImageMetadata, readPngMetadata, referenceImagePath, referencePrompt, runImagePresenter, sceneImagePath, searchImages, tokensOf, transientPrompt, updateImage, withPngMetadata };
package/lib/index.js CHANGED
@@ -1,21 +1,21 @@
1
- import { A as chatSessionId, _ as RECOVERY_SHRINK, g as RECOVERY_FLOOR, h as sharedSamplingOf, i as childSamplingOf, j as roleplaySessionOf, m as parseSampling, s as isUnfinishedCall, w as totalTokens } from "./child-DzZ-aI6k.js";
2
- import { Bt as isPng, E as loadWorldParts, F as localChanges, Ft as CHARACTERS_DIR, G as vetUrl, Ht as readCard, I as readOrigin, It as loadCharacters, Kt as authoredWorldOf, L as writeOrigin, Lt as knownOutputCeiling, M as describeChanges, N as hashWorld, P as isUnchanged, R as CatalogueError, Rt as ImportCardError, T as readWorldInfo, U as guardedLookup, Vt as pictureOf, _ as runChecks, at as populateCharacters, bt as loadLocations, c as importPhase, ct as populateFactions, d as markReady, dt as populateLocations, et as checkWorld, f as settleDraft, ft as populateLore, ht as populateVariables, it as populateCalendar, lt as populateItems, mt as populateTriggers, ot as populateClock, p as structureImport, pt as populateRoutines, qt as authoringChatSessionId, rt as knowsCharacter, st as populateDice, t as AuthoringTools, tt as loadValidatedWorld, u as keepDraft, ut as populateKnowledge, w as editWorldInfo, zt as cardFormat } from "./authoring-tools-VOaXzr_R.js";
3
- import { a as lorebookImportMessage, c as readLorebook, d as lorebookOfChat, l as selectEntries, s as previewLorebook, t as LOREBOOK_UPLOAD, u as lorebookChatSessionId } from "./lorebook-author-tools-DUKcQu8P.js";
4
- import { a as presetChatSessionId, n as narrationImportMessage, o as presetOfChat } from "./preset-author-tools-DBqPwn-o.js";
5
- import { A as plotProgressOf, B as parsePlotsFile, C as readNotes, G as readDocument, H as COMMANDS_KEY, J as errorMessage, L as readUsage, Q as copyWorldPrompts, S as notesOfSession, T as defaultBoundaries, V as plotReferenceProblems, X as PROMPTS_FOLDER, Y as LANGUAGE_FOLDER, Z as PromptLibrary, _ as readTraces, b as readWithdrawn, ct as InvalidWorldError, dt as SessionNotFoundError, et as languageOf, ft as WorldNotFoundError, g as readRunDetail, h as readActivity, ht as zoneOf, j as populatePlots, k as PLOTS_METADATA_KEY, lt as ReflectionRefusedError, m as readDecisionStats, nt as promptProblem, o as externalTools, ot as AgentUnavailableError, q as formatIssue, rt as shippedLanguages, st as InvalidStartError, tt as listFiles, ut as SessionArchivedError, w as observeAsPlayer, x as addToNote } from "./hooks-BdR3mBeM.js";
6
- import { a as liveSettings, c as writeSettings, d as parseSettings, i as InvalidSettingsError, l as DEFAULT_SETTINGS, o as readSettings, p as WORLD_RULES_KEY, s as useChildReasoning, u as SETTINGS_SPEC } from "./narration-CDsJ5wxH.js";
7
- import { $ as deleteWorldPrompt, $t as subfolders, Et as readImportFolder, F as parseWorldInfoEdit, G as loadPreset, H as deletePreset, I as combineAnswers, J as reservePreset, K as presetDirectory, L as questionView, M as WORLD_FILE_NAME, N as parseWorldFile, Ot as IMPORT_COMMAND, Pt as sourceSummary, Qt as parseCharacterFile, St as ImportStore, Tt as parseChoices, U as isPresetName, V as createPresetFromShipped, W as listPresets, Y as savePresetFromWorld, Z as updatePresetInfo, an as parseRelationEdit, at as deleteLorebook, bt as IMPORT_FOLDER, cn as LORE_KINDS, ct as isLorebookName, dt as lorebookDirectory, en as InvalidEditProblems, et as listWorldPrompts, ht as writeLorebookEntry, in as parsePlaceEdit, it as createLorebook, ln as LORE_SCOPES, lt as listLorebooks, mt as updateLorebookInfo, nn as parseFactionEdit, nt as writeWorldPrompt, on as parseThingEdit, ot as deleteLorebookEntry, pt as reserveLorebook, rn as parseLoreEdit, rt as addLorebookEntries, sn as guarded, st as entriesOf, tn as parseCharacterEdit, tt as readWorldPrompt, ut as loadLorebook, vt as partsOf, xt as ImportNotFoundError, yt as withPlayer, z as PRESET_FILE } from "./serial-BZNeK57v.js";
8
- import { $ as languageOfDocuments, A as generateWorldCharacterPortrait, C as editWorldFaction$1, D as editWorldPlots$1, E as editWorldPlace$1, F as uploadWorldCharacterPortrait, G as parseVariablesEdit, I as uploadWorldEntityImage, J as PRESET_FILE$1, K as parseDiceEdit, L as worldCharacterPortraitFile, M as readWorldEditor, N as readWorldTrigger, O as editWorldRelation$1, P as removeWorldTrigger, R as worldEntityImageFile, S as editWorldCharacter$1, T as editWorldNarrationVoice, U as parseCalendarEdit, W as parseRoutineEdit, Y as presetMessage, Z as translateMessage, _ as readCalendarDocument, a as deleteWorldPackFile, at as startUpdate, b as readRoutines, c as createAuthoredEntity, ct as authoringTitle, dt as agentServicesOf, et as readWorldDocuments, f as editCalendar, ft as DOCTOR_OPENING_SOURCE, g as editVariables, h as editRoutine, it as revertUpdate, j as generateWorldEntityImage, k as editWorldThing$1, l as deleteAuthoredEntity, lt as ensureAuthoringChat, m as editDice, mt as appendNarratedTurn, n as packFileProblem, ot as updateStatus, p as editCommands, pt as appendEmptyTurn, q as parseCommandsEdit, st as AuthoringSessions, t as MAX_PACK_TEXT, tt as findTargets, u as readAuthoredEntityDocument, ut as AgentSessions, v as readCommandsDocument, w as editWorldLore$1, x as readVariables, y as readDiceDocument, z as writeWorldTrigger } from "./pack-jail-CzHQu0n3.js";
9
- import { i as atomicWriteSync, n as atomicWrite, r as atomicWriteJson } from "./access-DifaiHrI.js";
1
+ import { A as chatSessionId, _ as RECOVERY_SHRINK, g as RECOVERY_FLOOR, h as sharedSamplingOf, i as childSamplingOf, j as roleplaySessionOf, m as parseSampling, s as isUnfinishedCall, w as totalTokens } from "./child-DTdY14S9.js";
2
+ import { Bt as isPng, E as loadWorldParts, F as localChanges, Ft as CHARACTERS_DIR, G as vetUrl, Ht as readCard, I as readOrigin, It as loadCharacters, Kt as authoredWorldOf, L as writeOrigin, Lt as knownOutputCeiling, M as describeChanges, N as hashWorld, P as isUnchanged, R as CatalogueError, Rt as ImportCardError, T as readWorldInfo, U as guardedLookup, Vt as pictureOf, _ as runChecks, at as populateCharacters, bt as loadLocations, c as importPhase, ct as populateFactions, d as markReady, dt as populateLocations, et as checkWorld, f as settleDraft, ft as populateLore, ht as populateVariables, it as populateCalendar, lt as populateItems, mt as populateTriggers, ot as populateClock, p as structureImport, pt as populateRoutines, qt as authoringChatSessionId, rt as knowsCharacter, st as populateDice, t as AuthoringTools, tt as loadValidatedWorld, u as keepDraft, ut as populateKnowledge, w as editWorldInfo, zt as cardFormat } from "./authoring-tools-BZr4bgBy.js";
3
+ import { a as lorebookImportMessage, c as readLorebook, d as lorebookOfChat, l as selectEntries, s as previewLorebook, t as LOREBOOK_UPLOAD, u as lorebookChatSessionId } from "./lorebook-author-tools-BjcEUo22.js";
4
+ import { a as presetChatSessionId, n as narrationImportMessage, o as presetOfChat } from "./preset-author-tools-BUzO9mTW.js";
5
+ import { $ as copyWorldPrompts, A as plotProgressOf, B as parsePlotsFile, C as readNotes, G as readDocument, H as COMMANDS_KEY, J as errorMessage, L as readUsage, Q as PromptLibrary, S as notesOfSession, T as defaultBoundaries, V as plotReferenceProblems, Y as LANGUAGE_FOLDER, Z as PROMPTS_FOLDER, _ as readTraces, b as readWithdrawn, ct as InvalidStartError, dt as SessionArchivedError, ft as SessionNotFoundError, g as readRunDetail, gt as zoneOf, h as readActivity, it as shippedLanguages, j as populatePlots, k as PLOTS_METADATA_KEY, lt as InvalidWorldError, m as readDecisionStats, nt as listFiles, o as externalTools, pt as WorldNotFoundError, q as formatIssue, rt as promptProblem, st as AgentUnavailableError, tt as languageOf, ut as ReflectionRefusedError, w as observeAsPlayer, x as addToNote } from "./hooks-Dtq5KZQX.js";
6
+ import { a as liveSettings, c as writeSettings, d as parseSettings, i as InvalidSettingsError, l as DEFAULT_SETTINGS, o as readSettings, p as WORLD_RULES_KEY, s as useChildReasoning, u as SETTINGS_SPEC } from "./narration--K2XVIHI.js";
7
+ import { $ as deleteWorldPrompt, $t as subfolders, Et as readImportFolder, F as parseWorldInfoEdit, G as loadPreset, H as deletePreset, I as combineAnswers, J as reservePreset, K as presetDirectory, L as questionView, M as WORLD_FILE_NAME, N as parseWorldFile, Ot as IMPORT_COMMAND, Pt as sourceSummary, Qt as parseCharacterFile, St as ImportStore, Tt as parseChoices, U as isPresetName, V as createPresetFromShipped, W as listPresets, Y as savePresetFromWorld, Z as updatePresetInfo, an as parseRelationEdit, at as deleteLorebook, bt as IMPORT_FOLDER, cn as LORE_KINDS, ct as isLorebookName, dt as lorebookDirectory, en as InvalidEditProblems, et as listWorldPrompts, ht as writeLorebookEntry, in as parsePlaceEdit, it as createLorebook, ln as LORE_SCOPES, lt as listLorebooks, mt as updateLorebookInfo, nn as parseFactionEdit, nt as writeWorldPrompt, on as parseThingEdit, ot as deleteLorebookEntry, pt as reserveLorebook, rn as parseLoreEdit, rt as addLorebookEntries, sn as guarded, st as entriesOf, tn as parseCharacterEdit, tt as readWorldPrompt, ut as loadLorebook, vt as partsOf, xt as ImportNotFoundError, yt as withPlayer, z as PRESET_FILE } from "./serial-BUaJGwVy.js";
8
+ import { $ as languageOfDocuments, A as generateWorldCharacterPortrait, C as editWorldFaction$1, D as editWorldPlots$1, E as editWorldPlace$1, F as uploadWorldCharacterPortrait, G as parseVariablesEdit, I as uploadWorldEntityImage, J as PRESET_FILE$1, K as parseDiceEdit, L as worldCharacterPortraitFile, M as readWorldEditor, N as readWorldTrigger, O as editWorldRelation$1, P as removeWorldTrigger, R as worldEntityImageFile, S as editWorldCharacter$1, T as editWorldNarrationVoice, U as parseCalendarEdit, W as parseRoutineEdit, Y as presetMessage, Z as translateMessage, _ as readCalendarDocument, a as deleteWorldPackFile, at as startUpdate, b as readRoutines, c as createAuthoredEntity, ct as authoringTitle, dt as agentServicesOf, et as readWorldDocuments, f as editCalendar, ft as DOCTOR_OPENING_SOURCE, g as editVariables, h as editRoutine, it as revertUpdate, j as generateWorldEntityImage, k as editWorldThing$1, l as deleteAuthoredEntity, lt as ensureAuthoringChat, m as editDice, mt as appendNarratedTurn, n as packFileProblem, ot as updateStatus, p as editCommands, pt as appendEmptyTurn, q as parseCommandsEdit, st as AuthoringSessions, t as MAX_PACK_TEXT, tt as findTargets, u as readAuthoredEntityDocument, ut as AgentSessions, v as readCommandsDocument, w as editWorldLore$1, x as readVariables, y as readDiceDocument, z as writeWorldTrigger } from "./pack-jail-Dt0VTsu0.js";
9
+ import { i as atomicWriteSync, n as atomicWrite, r as atomicWriteJson } from "./access-Csp80TFX.js";
10
10
  import { i as translator, r as languageOf$1, t as trimCharacters } from "./text-Dfv8S8eq.js";
11
- import { _ as snapshotOf, c as copyPreset, d as switchPreset, f as readTimeline, g as pathTo, h as childrenOf, i as reflectionStatus, l as presetStatus, m as START_SNAPSHOT, o as TimelineError, p as writeTimeline, u as recordPreset } from "./reflection-Cuy0YLv0.js";
12
- import { n as readPreset, r as selectPrompts, t as previewPreset } from "./preset-BPnRPW-1.js";
13
- import { C as slug, T as uniqueKey, d as sceneImagePath, s as inheritImages, t as addToLibrary, u as referenceImagePath } from "./library-BU2A_Dx8.js";
11
+ import { _ as snapshotOf, c as copyPreset, d as switchPreset, f as readTimeline, g as pathTo, h as childrenOf, i as reflectionStatus, l as presetStatus, m as START_SNAPSHOT, o as TimelineError, p as writeTimeline, u as recordPreset } from "./reflection-Dd3pEiZB.js";
12
+ import { n as readPreset, r as selectPrompts, t as previewPreset } from "./preset-Dv5YF2qj.js";
13
+ import { C as slug, T as uniqueKey, d as sceneImagePath, s as inheritImages, t as addToLibrary, u as referenceImagePath } from "./library-DTxakw0z.js";
14
14
  import { o as FOLDER_ACCESS, r as InvalidFoldersError, t as StoryFoldersService } from "./service-mRKwpWjX.js";
15
15
  import { t as doctorChatSessionId } from "./doctor-chat-hL1a61hp.js";
16
- import { _ as API_PREFIX, a as packIds, c as describePack, d as packPath, f as readPack, l as isPackId, m as PACK_LIMITS, n as anyTab, o as syncWorldPacks, r as copyWorldPacks, s as worldPackStates, t as activePack, u as packFile } from "./packs-BZ-45J4-.js";
17
- import { a as uploadReferenceImage, t as generateReferenceImage } from "./generator-Cv6WWmZT.js";
18
- import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-Ctz-UoFk.js";
16
+ import { _ as API_PREFIX, a as packIds, c as describePack, d as packPath, f as readPack, l as isPackId, m as PACK_LIMITS, n as anyTab, o as syncWorldPacks, r as copyWorldPacks, s as worldPackStates, t as activePack, u as packFile } from "./packs-DWfR2Ted.js";
17
+ import { a as uploadReferenceImage, t as generateReferenceImage } from "./generator-9-5at9cZ.js";
18
+ import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-BNg0rPTp.js";
19
19
  import { basename, dirname, extname, isAbsolute, join, normalize, relative, resolve, sep } from "node:path";
20
20
  import { SESSION_DATABASE_FILE, addLocalDays, createSessionStore, describeInstant, describeValue, holidaysOn, isSessionId, itemKey, lintWorld, locationKey, openSessionStore, parseInstant, readCalendar, seasonOf, sessionDatabase, sessionFolder, shownVariables, systemTimeZone } from "@dsh-agentic-roleplay/state";
21
21
  import { copyFileSync, cpSync, createReadStream, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
@@ -3361,7 +3361,11 @@ function worldsRoutes({ worlds, createWorld, starter, authorWorld, sayToAuthor,
3361
3361
  } },
3362
3362
  "/worlds/language": { GET: async (_req, res, url) => {
3363
3363
  try {
3364
- sendJson(res, 200, { language: await translation.language(url.searchParams.get("id") ?? "") ?? null });
3364
+ const id = url.searchParams.get("id") ?? "";
3365
+ sendJson(res, 200, {
3366
+ language: await translation.language(id) ?? null,
3367
+ declared: await translation.declared(id) ?? null
3368
+ });
3365
3369
  } catch (error) {
3366
3370
  if (error instanceof WorldNotFoundError) return sendError(res, 404, error.message);
3367
3371
  throw error;
@@ -5831,12 +5835,8 @@ function purgeDepsOf(ctx, storePath) {
5831
5835
  const purgeOf = (ctx, storePath) => (chat) => purgeChat(purgeDepsOf(ctx, storePath), chat);
5832
5836
  // src/host/setup/rows.ts
5833
5837
  const ALL = ["@dsh-agentic-roleplay/all", "dsh-agentic-roleplay"];
5834
- const SINGLE = [
5835
- "@dsh-agentic-roleplay/core",
5836
- "@dsh-agentic-roleplay/state",
5837
- "dsh-agentic-roleplay-core",
5838
- "dsh-roleplay-state"
5839
- ];
5838
+ const CORE = ["@dsh-agentic-roleplay/core", "dsh-agentic-roleplay-core"];
5839
+ const STATE = ["@dsh-agentic-roleplay/state", "dsh-roleplay-state"];
5840
5840
  /**
5841
5841
  * The profile directory DSH launched this plugin in: `DSH_PROFILE_DIR`, which a profile-launched Host carries, or
5842
5842
  * `DSH_HOME/profiles/<DSH_PROFILE>` when only those are set (a `dsh` CLI launch). Both are environment facts; a
@@ -5861,15 +5861,13 @@ function selectedBundles(profileDir) {
5861
5861
  return [];
5862
5862
  }
5863
5863
  }
5864
- /**
5865
- * The layers of single packages that are selected next to the `all` layer. Each of them inserts the same plugin row as `all`, so the profile then holds the row twice
5866
- * and DSH, which writes a plugin's settings through its row, refuses every save of Settings → Role Play.
5867
- */
5864
+ /** Layers made redundant by a selected complete install. Duplicate rows prevent DSH from saving their settings. */
5868
5865
  function redundantLayers(bundles) {
5869
- return bundles.some((name) => ALL.includes(name)) ? bundles.filter((name) => SINGLE.includes(name)) : [];
5866
+ if (bundles.some((name) => ALL.includes(name))) return bundles.filter((name) => CORE.includes(name) || STATE.includes(name));
5867
+ return bundles.some((name) => CORE.includes(name)) ? bundles.filter((name) => STATE.includes(name)) : [];
5870
5868
  }
5871
5869
  function redundantLayersMessage(layers) {
5872
- return `the profile selects ${layers.map((name) => `"${name}"`).join(", ")} next to the all bundle, which already inserts the same plugin rows, so DSH refuses to save the Role Play settings: deselect them (keep the packages installed) and restart`;
5870
+ return `the profile selects ${layers.map((name) => `"${name}"`).join(", ")} next to a layer that already inserts the same plugin rows (the all bundle, or the core package, which includes the state plugin), so DSH refuses to save the Role Play settings: deselect them (keep the packages installed) and restart`;
5873
5871
  }
5874
5872
  // src/host/worlds/lore-entries.ts
5875
5873
  const MAX_TITLE = 200;
@@ -6885,6 +6883,13 @@ async function startSession(deps, request) {
6885
6883
  mode: answers.clockMode
6886
6884
  }
6887
6885
  };
6886
+ if (world.language !== void 0 && (request.settings?.prompts)?.language === void 0) settings = {
6887
+ ...settings,
6888
+ prompts: {
6889
+ ...settings.prompts,
6890
+ language: world.language
6891
+ }
6892
+ };
6888
6893
  const givenAutonomy = (request.settings?.autonomy)?.enabled;
6889
6894
  if (world.autonomy === true && givenAutonomy === void 0) settings = {
6890
6895
  ...settings,
@@ -7680,6 +7685,7 @@ async function loadWorld(folder, dir, file, problems) {
7680
7685
  ...world.autonomy === void 0 ? {} : { autonomy: world.autonomy },
7681
7686
  ...world.narrationVoice === void 0 ? {} : { narrationVoice: world.narrationVoice },
7682
7687
  ...world.sampling === void 0 ? {} : { sampling: world.sampling },
7688
+ ...world.language === void 0 ? {} : { language: world.language },
7683
7689
  ...world.preset === void 0 ? {} : { preset: world.preset },
7684
7690
  ...world.lorebooks === void 0 ? {} : { lorebooks: world.lorebooks }
7685
7691
  };
@@ -10059,6 +10065,11 @@ function apply(ctx, config) {
10059
10065
  },
10060
10066
  translation: {
10061
10067
  language: (id) => worldLanguage(worlds, id),
10068
+ declared: async (id) => {
10069
+ const record = await worlds.find(id);
10070
+ if (record === void 0) throw new WorldNotFoundError(`there is no world with id "${id}"`);
10071
+ return record.language;
10072
+ },
10062
10073
  start: (id, to, title, language) => startTranslation({
10063
10074
  worlds,
10064
10075
  authoring,
@@ -1,4 +1,4 @@
1
- import { j as roleplaySessionOf } from "./child-DzZ-aI6k.js";
1
+ import { j as roleplaySessionOf } from "./child-DTdY14S9.js";
2
2
  import { i as isInside } from "./service-mRKwpWjX.js";
3
3
  import { dirname, isAbsolute, resolve } from "node:path";
4
4
  import { readdirSync, realpathSync, statSync } from "node:fs";
@@ -104,4 +104,4 @@ function registerFoldersJail(ctx, deps) {
104
104
  }
105
105
  export { registerFoldersJail as t };
106
106
 
107
- //# sourceMappingURL=jail-Cp4zEfip.js.map
107
+ //# sourceMappingURL=jail-DVbPSC0R.js.map
@@ -1,4 +1,4 @@
1
- import { n as atomicWrite } from "./access-DifaiHrI.js";
1
+ import { n as atomicWrite } from "./access-Csp80TFX.js";
2
2
  import { i as translator, n as withoutExtension, r as languageOf, t as trimCharacters } from "./text-Dfv8S8eq.js";
3
3
  import { dirname, extname, join } from "node:path";
4
4
  import { existsSync } from "node:fs";
@@ -374,4 +374,4 @@ async function addToLibrary(sessionFolder, bytes, originalName) {
374
374
  }
375
375
  export { slug as C, norm as S, uniqueKey as T, writeImageFileMetadata as _, LIBRARY_FOLDER as a, NoEmbeddingService as b, nextSceneSerial as c, sceneImagePath as d, writeImage as f, sidecarOf as g, readImageFileMetadata as h, libraryHashes as i, readImageMetadata as l, mediaTypeOf as m, addToLibraryOnce as n, entityImageDirectory as o, MEDIA_TYPES as p, imageExtensionOf as r, inheritImages as s, addToLibrary as t, referenceImagePath as u, readPngMetadata as v, trOf as w, mapLimit as x, withPngMetadata as y };
376
376
 
377
- //# sourceMappingURL=library-BU2A_Dx8.js.map
377
+ //# sourceMappingURL=library-DTxakw0z.js.map
@@ -1,9 +1,9 @@
1
- import "./access-DifaiHrI.js";
2
- import { Rt as ImportCardError, i as contextOf, r as MAX_PREVIEW_TEXT } from "./authoring-tools-VOaXzr_R.js";
3
- import { B as createPresetFromGuidance, bt as IMPORT_FOLDER, cn as LORE_KINDS, dt as lorebookDirectory, ft as readLorebook$1, gt as cleanText, ht as writeLorebookEntry, ln as LORE_SCOPES, mt as updateLorebookInfo, ot as deleteLorebookEntry, st as entriesOf, ut as loadLorebook, vt as partsOf, yt as withPlayer } from "./serial-BZNeK57v.js";
4
- import { F as textLanguage, I as wrongLanguage, it as shippedPromptsDirectory } from "./hooks-BdR3mBeM.js";
1
+ import "./access-Csp80TFX.js";
2
+ import { Rt as ImportCardError, i as contextOf, r as MAX_PREVIEW_TEXT } from "./authoring-tools-BZr4bgBy.js";
3
+ import { B as createPresetFromGuidance, bt as IMPORT_FOLDER, cn as LORE_KINDS, dt as lorebookDirectory, ft as readLorebook$1, gt as cleanText, ht as writeLorebookEntry, ln as LORE_SCOPES, mt as updateLorebookInfo, ot as deleteLorebookEntry, st as entriesOf, ut as loadLorebook, vt as partsOf, yt as withPlayer } from "./serial-BUaJGwVy.js";
4
+ import { F as textLanguage, I as wrongLanguage, at as shippedPromptsDirectory } from "./hooks-Dtq5KZQX.js";
5
5
  import { i as translator, r as languageOf } from "./text-Dfv8S8eq.js";
6
- import { C as slug, T as uniqueKey, w as trOf, x as mapLimit } from "./library-BU2A_Dx8.js";
6
+ import { C as slug, T as uniqueKey, w as trOf, x as mapLimit } from "./library-DTxakw0z.js";
7
7
  import { join } from "node:path";
8
8
  import { existsSync, readFileSync } from "node:fs";
9
9
  import { readFile, rm, writeFile } from "node:fs/promises";
@@ -709,4 +709,4 @@ async function lorebookApproval(exec, next, state) {
709
709
  }
710
710
  export { lorebookImportMessage as a, readLorebook as c, lorebookOfChat as d, lorebookAuthorTools as i, selectEntries as l, LorebookReader as n, pendingTargets as o, lorebookApproval as r, previewLorebook as s, LOREBOOK_UPLOAD as t, lorebookChatSessionId as u };
711
711
 
712
- //# sourceMappingURL=lorebook-author-tools-DUKcQu8P.js.map
712
+ //# sourceMappingURL=lorebook-author-tools-BjcEUo22.js.map
@@ -1,9 +1,9 @@
1
- import { n as limitAuthoringAgents } from "./authoring-tools-VOaXzr_R.js";
2
- import { t as guardAuthoringTurns } from "./turn-guard-xaFxYc1T.js";
3
- import { t as silenceHarnessDevContext } from "./dev-context-Bdm-eVer.js";
4
- import { d as lorebookOfChat, i as lorebookAuthorTools, n as LorebookReader, o as pendingTargets, r as lorebookApproval } from "./lorebook-author-tools-DUKcQu8P.js";
5
- import "./hooks-BdR3mBeM.js";
6
- import { dt as lorebookDirectory } from "./serial-BZNeK57v.js";
1
+ import { n as limitAuthoringAgents } from "./authoring-tools-BZr4bgBy.js";
2
+ import { t as guardAuthoringTurns } from "./turn-guard-87NE-Cnp.js";
3
+ import { n as silenceRuntimeContext, t as silenceHarnessDevContext } from "./dev-context-Cgv_wZbG.js";
4
+ import { d as lorebookOfChat, i as lorebookAuthorTools, n as LorebookReader, o as pendingTargets, r as lorebookApproval } from "./lorebook-author-tools-BjcEUo22.js";
5
+ import "./hooks-Dtq5KZQX.js";
6
+ import { dt as lorebookDirectory } from "./serial-BUaJGwVy.js";
7
7
  import { join } from "node:path";
8
8
  import { existsSync, readdirSync } from "node:fs";
9
9
  // src/lorebook-authoring.ts
@@ -20,6 +20,7 @@ const inject = [
20
20
  /** The lorebook authoring chat: reads and writes the entries of one library lorebook, each write approved by the person. */
21
21
  function apply(ctx) {
22
22
  silenceHarnessDevContext(ctx);
23
+ silenceRuntimeContext(ctx);
23
24
  const library = () => ctx.roleplayRoot.path;
24
25
  const reader = new LorebookReader(library);
25
26
  const prompting = {
@@ -1,4 +1,4 @@
1
- import { i as atomicWriteSync } from "./access-DifaiHrI.js";
1
+ import { i as atomicWriteSync } from "./access-Csp80TFX.js";
2
2
  import { join } from "node:path";
3
3
  import { existsSync, readFileSync, statSync } from "node:fs";
4
4
  // ../dsh-roleplay-model/src/clock.ts
@@ -485,4 +485,4 @@ function decodeOutput(text) {
485
485
  }
486
486
  export { emptyStats as _, liveSettings as a, writeSettings as c, parseSettings as d, parseSwitchboard as f, GATE_SITES as g, DECISION_SITES as h, InvalidSettingsError as i, DEFAULT_SETTINGS as l, rulesOf as m, encodeOutput as n, readSettings as o, WORLD_RULES_KEY as p, encodePreview as r, useChildReasoning as s, decodeOutput as t, SETTINGS_SPEC as u };
487
487
 
488
- //# sourceMappingURL=narration-CDsJ5wxH.js.map
488
+ //# sourceMappingURL=narration--K2XVIHI.js.map
@@ -1,17 +1,17 @@
1
- import { t as silenceHarnessDevContext } from "./dev-context-Bdm-eVer.js";
2
- import { t as promptFor } from "./access-DifaiHrI.js";
3
- import { D as referent, E as sameWords, H as COMMANDS_KEY, I as wrongLanguage, O as RESULTS, U as commandFlagKey, W as commandsOf, a as externalGiven, at as shippedText, c as PREVIEW_TOOL, d as toolEnabled, et as languageOf, f as MAX_OOC_ANSWER, gt as AUTHORING_NEEDS, ht as zoneOf, i as characterRunner, l as createTools$1, lt as ReflectionRefusedError, mt as describeWhen, n as installHooks, p as storesOf, pt as ClockError, u as record, v as readVerdicts, y as writeVerdicts } from "./hooks-BdR3mBeM.js";
4
- import { A as chatSessionId, O as estimateAnswer, T as currentTurn, a as childTrace, d as sessionOfChat, f as tracerOf, j as roleplaySessionOf, k as tokensOf, l as runChild, n as childModel, r as childSampling, u as TurnTraces } from "./child-DzZ-aI6k.js";
5
- import { a as whereabouts, n as memoryReflector, r as recordFailure, s as Timelines, t as dueReflection } from "./reflection-Cuy0YLv0.js";
6
- import { A as routeVerdicts, E as askYesNo, Mt as splitPanels, O as modeFor, T as announceProblem, fn as INTENT_STATUSES, j as yesAt, k as noAt, n as STANDING_PROMPT, sn as guarded } from "./serial-BZNeK57v.js";
1
+ import { t as silenceHarnessDevContext } from "./dev-context-Cgv_wZbG.js";
2
+ import { t as promptFor } from "./access-Csp80TFX.js";
3
+ import { D as referent, E as sameWords, H as COMMANDS_KEY, I as wrongLanguage, O as RESULTS, U as commandFlagKey, W as commandsOf, _t as AUTHORING_NEEDS, a as externalGiven, c as PREVIEW_TOOL, d as toolEnabled, f as MAX_OOC_ANSWER, gt as zoneOf, ht as describeWhen, i as characterRunner, l as createTools$1, mt as ClockError, n as installHooks, ot as shippedText, p as storesOf, tt as languageOf, u as record, ut as ReflectionRefusedError, v as readVerdicts, y as writeVerdicts } from "./hooks-Dtq5KZQX.js";
4
+ import { A as chatSessionId, O as estimateAnswer, T as currentTurn, a as childTrace, d as sessionOfChat, f as tracerOf, j as roleplaySessionOf, k as tokensOf, l as runChild, n as childModel, r as childSampling, u as TurnTraces } from "./child-DTdY14S9.js";
5
+ import { a as whereabouts, n as memoryReflector, r as recordFailure, s as Timelines, t as dueReflection } from "./reflection-Dd3pEiZB.js";
6
+ import { A as routeVerdicts, E as askYesNo, Mt as splitPanels, O as modeFor, T as announceProblem, fn as INTENT_STATUSES, j as yesAt, k as noAt, n as STANDING_PROMPT, sn as guarded } from "./serial-BUaJGwVy.js";
7
7
  import { i as translator, r as languageOf$1 } from "./text-Dfv8S8eq.js";
8
- import { a as liveSettings, g as GATE_SITES, n as encodeOutput } from "./narration-CDsJ5wxH.js";
9
- import { t as registerFoldersJail } from "./jail-Cp4zEfip.js";
8
+ import { a as liveSettings, g as GATE_SITES, n as encodeOutput } from "./narration--K2XVIHI.js";
9
+ import { t as registerFoldersJail } from "./jail-DVbPSC0R.js";
10
10
  import { a as workspaceOf, n as storyRoots } from "./service-mRKwpWjX.js";
11
- import { C as slug, T as uniqueKey, t as addToLibrary } from "./library-BU2A_Dx8.js";
12
- import { _ as API_PREFIX } from "./packs-BZ-45J4-.js";
13
- import { i as updateImage, r as listGallery, t as describeGalleryImage } from "./gallery-Ctz-UoFk.js";
14
- import { c as presentedFor, i as findImages, n as interpretImage, s as present, t as runImagePresenter } from "./presenter-agent-C2ZkoxZu.js";
11
+ import { C as slug, T as uniqueKey, t as addToLibrary } from "./library-DTxakw0z.js";
12
+ import { _ as API_PREFIX } from "./packs-DWfR2Ted.js";
13
+ import { i as updateImage, r as listGallery, t as describeGalleryImage } from "./gallery-BNg0rPTp.js";
14
+ import { c as presentedFor, i as findImages, n as interpretImage, s as present, t as runImagePresenter } from "./presenter-agent-vFOxIuWv.js";
15
15
  import { join } from "node:path";
16
16
  import { InvalidEditError, characterKey, createDiceTools, createTools, dayPart, describeDuration, describeHolder, describeInstant, describeValue, itemKey, judgedStatements, lintWorld, localTime, locationKey, mentioned, parseRecordsEdit, rollForCheck, seededRoll, sessionDatabase, sessionFolder, systemRoller } from "@dsh-agentic-roleplay/state";
17
17
  import { existsSync } from "node:fs";
@@ -1,14 +1,14 @@
1
- import { A as chatSessionId } from "./child-DzZ-aI6k.js";
2
- import { A as editsSince, At as loadCommands, B as addressesToFetch, C as worldFieldChanges, Ct as FACTIONS_DIR, Dt as parseDiceFile, E as loadWorldParts, Et as loadDice, Ft as CHARACTERS_DIR, Gt as DICE_RESULTS, H as fetchPictures, It as loadCharacters, J as UPDATE_FOLDER, K as cardCharacter, Kt as authoredWorldOf, Mt as CALENDAR_FILE_NAME, Nt as loadCalendar, Ot as COMMANDS_FILE_NAME, Pt as parseCalendarFile, St as loadItems, Tt as DICE_FILE_NAME, Ut as DICE_COMPARISONS, V as candidateUrls, W as mergeReports, Wt as DICE_READINGS, X as cardPieces, Y as baseId, _t as TRIGGERS_FILE_NAME, bt as loadLocations, c as importPhase, gt as routineProblems, i as contextOf, j as writeSnapshot, jt as parseCommandsFile, k as recordProvenance, kt as commandVariable, nt as withScratchStory, q as writePortrait, qt as authoringChatSessionId, rt as knowsCharacter, s as worldOf, tt as loadValidatedWorld, vt as loadTriggers, w as editWorldInfo, wt as loadFactions, x as matchPieces, xt as ITEMS_DIR, yt as LOCATIONS_DIR, z as addressKey } from "./authoring-tools-VOaXzr_R.js";
3
- import { $t as subfolders, Bt as loadLore, Ct as PICTURE_FILE, Dt as writeChoices, Et as readImportFolder, Ft as VARIABLES_FILE_NAME, Gt as ITEM_FILE_NAME, Ht as parseLoreFile, It as loadVariables, Lt as parseVariablesFile, M as WORLD_FILE_NAME, N as parseWorldFile, Qt as parseCharacterFile, Rt as variableProblems, Ut as LOCATION_FILE_NAME, Vt as LORE_FILE_NAME, Wt as parseLocationFile, Xt as parseFactionFile, Yt as FACTION_FILE_NAME, Zt as CHARACTER_FILE_NAME, bt as IMPORT_FOLDER, en as InvalidEditProblems, l as extractStyleFrom, nt as writeWorldPrompt, qt as parseItemFile, yt as withPlayer, zt as LORE_DIR } from "./serial-BZNeK57v.js";
4
- import { n as encodeOutput } from "./narration-CDsJ5wxH.js";
5
- import { a as VARIABLE_KINDS, n as atomicWrite, o as VARIABLE_SUBJECTS, r as atomicWriteJson, s as VARIABLE_VISIBILITIES } from "./access-DifaiHrI.js";
6
- import { B as parsePlotsFile, F as textLanguage, K as Reader, M as LANGUAGE_NAMES, N as STORY_LANGUAGES, P as isStoryLanguage, R as PLOTS_FILE_NAME, V as plotReferenceProblems, X as PROMPTS_FOLDER, ct as InvalidWorldError, ft as WorldNotFoundError, ot as AgentUnavailableError, q as formatIssue, rt as shippedLanguages, z as loadPlots } from "./hooks-BdR3mBeM.js";
1
+ import { A as chatSessionId } from "./child-DTdY14S9.js";
2
+ import { A as editsSince, At as loadCommands, B as addressesToFetch, C as worldFieldChanges, Ct as FACTIONS_DIR, Dt as parseDiceFile, E as loadWorldParts, Et as loadDice, Ft as CHARACTERS_DIR, Gt as DICE_RESULTS, H as fetchPictures, It as loadCharacters, J as UPDATE_FOLDER, K as cardCharacter, Kt as authoredWorldOf, Mt as CALENDAR_FILE_NAME, Nt as loadCalendar, Ot as COMMANDS_FILE_NAME, Pt as parseCalendarFile, St as loadItems, Tt as DICE_FILE_NAME, Ut as DICE_COMPARISONS, V as candidateUrls, W as mergeReports, Wt as DICE_READINGS, X as cardPieces, Y as baseId, _t as TRIGGERS_FILE_NAME, bt as loadLocations, c as importPhase, gt as routineProblems, i as contextOf, j as writeSnapshot, jt as parseCommandsFile, k as recordProvenance, kt as commandVariable, nt as withScratchStory, q as writePortrait, qt as authoringChatSessionId, rt as knowsCharacter, s as worldOf, tt as loadValidatedWorld, vt as loadTriggers, w as editWorldInfo, wt as loadFactions, x as matchPieces, xt as ITEMS_DIR, yt as LOCATIONS_DIR, z as addressKey } from "./authoring-tools-BZr4bgBy.js";
3
+ import { $t as subfolders, Bt as loadLore, Ct as PICTURE_FILE, Dt as writeChoices, Et as readImportFolder, Ft as VARIABLES_FILE_NAME, Gt as ITEM_FILE_NAME, Ht as parseLoreFile, It as loadVariables, Lt as parseVariablesFile, M as WORLD_FILE_NAME, N as parseWorldFile, Qt as parseCharacterFile, Rt as variableProblems, Ut as LOCATION_FILE_NAME, Vt as LORE_FILE_NAME, Wt as parseLocationFile, Xt as parseFactionFile, Yt as FACTION_FILE_NAME, Zt as CHARACTER_FILE_NAME, bt as IMPORT_FOLDER, en as InvalidEditProblems, l as extractStyleFrom, nt as writeWorldPrompt, qt as parseItemFile, yt as withPlayer, zt as LORE_DIR } from "./serial-BUaJGwVy.js";
4
+ import { n as encodeOutput } from "./narration--K2XVIHI.js";
5
+ import { a as VARIABLE_KINDS, n as atomicWrite, o as VARIABLE_SUBJECTS, r as atomicWriteJson, s as VARIABLE_VISIBILITIES } from "./access-Csp80TFX.js";
6
+ import { B as parsePlotsFile, F as textLanguage, K as Reader, M as LANGUAGE_NAMES, N as STORY_LANGUAGES, P as isStoryLanguage, R as PLOTS_FILE_NAME, V as plotReferenceProblems, Z as PROMPTS_FOLDER, it as shippedLanguages, lt as InvalidWorldError, pt as WorldNotFoundError, q as formatIssue, st as AgentUnavailableError, z as loadPlots } from "./hooks-Dtq5KZQX.js";
7
7
  import { i as translator, r as languageOf } from "./text-Dfv8S8eq.js";
8
- import { h as readImageFileMetadata, u as referenceImagePath, x as mapLimit } from "./library-BU2A_Dx8.js";
9
- import { n as readPreset } from "./preset-BPnRPW-1.js";
10
- import { _ as API_PREFIX, a as packIds, d as packPath, f as readPack, h as PACK_MEDIA_TYPES, l as isPackId } from "./packs-BZ-45J4-.js";
11
- import { a as uploadReferenceImage, t as generateReferenceImage } from "./generator-Cv6WWmZT.js";
8
+ import { h as readImageFileMetadata, u as referenceImagePath, x as mapLimit } from "./library-DTxakw0z.js";
9
+ import { n as readPreset } from "./preset-Dv5YF2qj.js";
10
+ import { _ as API_PREFIX, a as packIds, d as packPath, f as readPack, h as PACK_MEDIA_TYPES, l as isPackId } from "./packs-DWfR2Ted.js";
11
+ import { a as uploadReferenceImage, t as generateReferenceImage } from "./generator-9-5at9cZ.js";
12
12
  import { basename, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
13
13
  import { readTriggerDefinition, triggerReferenceProblems } from "@dsh-agentic-roleplay/state";
14
14
  import { existsSync, lstatSync, statSync } from "node:fs";
@@ -3199,4 +3199,4 @@ function registerPackJail(ctx, deps) {
3199
3199
  }
3200
3200
  export { languageOfDocuments as $, generateWorldCharacterPortrait as A, deleteTriggerDocument as B, editWorldFaction as C, editWorldPlots as D, editWorldPlace as E, uploadWorldCharacterPortrait as F, parseVariablesEdit as G, writeTriggerDocument as H, uploadWorldEntityImage as I, PRESET_FILE as J, parseDiceEdit as K, worldCharacterPortraitFile as L, readWorldEditor as M, readWorldTrigger as N, editWorldRelation as O, removeWorldTrigger as P, translateTools as Q, worldEntityImageFile as R, editWorldCharacter as S, editWorldNarrationVoice as T, parseCalendarEdit as U, readTriggerDocuments as V, parseRoutineEdit as W, presetTools as X, presetMessage as Y, translateMessage as Z, readCalendarDocument as _, deleteWorldPackFile as a, startUpdate as at, readRoutines as b, createAuthoredEntity as c, authoringTitle as ct, replaceAuthoredEntity as d, agentServicesOf as dt, readWorldDocuments as et, editCalendar as f, DOCTOR_OPENING_SOURCE as ft, editVariables as g, editRoutine as h, checkWorldPack as i, revertUpdate as it, generateWorldEntityImage as j, editWorldThing as k, deleteAuthoredEntity as l, ensureAuthoringChat as lt, editDice as m, appendNarratedTurn as mt, packFileProblem as n, finishUpdate as nt, listWorldPacks as o, updateStatus as ot, editCommands as p, appendEmptyTurn as pt, parseCommandsEdit as q, registerPackJail as r, pendingUpdate as rt, AUTHORED_ENTITY_KINDS as s, AuthoringSessions as st, MAX_PACK_TEXT as t, findTargets as tt, readAuthoredEntityDocument as u, AgentSessions as ut, readCommandsDocument as v, editWorldLore as w, readVariables as x, readDiceDocument as y, writeWorldTrigger as z };
3201
3201
 
3202
- //# sourceMappingURL=pack-jail-CzHQu0n3.js.map
3202
+ //# sourceMappingURL=pack-jail-Dt0VTsu0.js.map
@@ -1,4 +1,4 @@
1
- import { K as Reader } from "./hooks-BdR3mBeM.js";
1
+ import { K as Reader } from "./hooks-Dtq5KZQX.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-BZ-45J4-.js.map
839
+ //# sourceMappingURL=packs-DWfR2Ted.js.map
@@ -1,8 +1,8 @@
1
- import { n as atomicWrite, t as promptFor } from "./access-DifaiHrI.js";
2
- import { l as runChild } from "./child-DzZ-aI6k.js";
3
- import { n as generateTransientImage, t as generateReferenceImage } from "./generator-Cv6WWmZT.js";
4
- import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-Ctz-UoFk.js";
5
- import { c as nextSceneSerial, u as referenceImagePath } from "./library-BU2A_Dx8.js";
1
+ import { n as atomicWrite, t as promptFor } from "./access-Csp80TFX.js";
2
+ import { l as runChild } from "./child-DTdY14S9.js";
3
+ import { n as generateTransientImage, t as generateReferenceImage } from "./generator-9-5at9cZ.js";
4
+ import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-BNg0rPTp.js";
5
+ import { c as nextSceneSerial, u as referenceImagePath } from "./library-DTxakw0z.js";
6
6
  import { join, relative, sep } from "node:path";
7
7
  import { characterKey, itemKey, locationKey } from "@dsh-agentic-roleplay/state";
8
8
  import { existsSync } from "node:fs";
@@ -844,4 +844,4 @@ async function runImagePresenter(job) {
844
844
  }
845
845
  export { searchImages as a, presentedFor as c, findImages as i, interpretImage as n, tokensOf as o, imageTools as r, present as s, runImagePresenter as t };
846
846
 
847
- //# sourceMappingURL=presenter-agent-C2ZkoxZu.js.map
847
+ //# sourceMappingURL=presenter-agent-vFOxIuWv.js.map
@@ -1,6 +1,6 @@
1
- import { Rt as ImportCardError, r as MAX_PREVIEW_TEXT } from "./authoring-tools-VOaXzr_R.js";
2
- import { p as SAMPLING_RANGES } from "./child-DzZ-aI6k.js";
3
- import { gt as cleanText } from "./serial-BZNeK57v.js";
1
+ import { Rt as ImportCardError, r as MAX_PREVIEW_TEXT } from "./authoring-tools-BZr4bgBy.js";
2
+ import { p as SAMPLING_RANGES } from "./child-DTdY14S9.js";
3
+ import { gt as cleanText } from "./serial-BUaJGwVy.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-BPnRPW-1.js.map
242
+ //# sourceMappingURL=preset-Dv5YF2qj.js.map
@@ -1,9 +1,9 @@
1
- import "./access-DifaiHrI.js";
2
- import { $ as deleteWorldPrompt, K as presetDirectory, Q as PROSE_PROMPTS, Z as updatePresetInfo, bt as IMPORT_FOLDER, et as listWorldPrompts, l as extractStyleFrom, nt as writeWorldPrompt, q as readPreset, tt as readWorldPrompt, yt as withPlayer, z as PRESET_FILE } from "./serial-BZNeK57v.js";
3
- import { n as readPreset$1 } from "./preset-BPnRPW-1.js";
4
- import { i as contextOf } from "./authoring-tools-VOaXzr_R.js";
1
+ import "./access-Csp80TFX.js";
2
+ import { $ as deleteWorldPrompt, K as presetDirectory, Q as PROSE_PROMPTS, Z as updatePresetInfo, bt as IMPORT_FOLDER, et as listWorldPrompts, l as extractStyleFrom, nt as writeWorldPrompt, q as readPreset, tt as readWorldPrompt, yt as withPlayer, z as PRESET_FILE } from "./serial-BUaJGwVy.js";
3
+ import { n as readPreset$1 } from "./preset-Dv5YF2qj.js";
4
+ import { i as contextOf } from "./authoring-tools-BZr4bgBy.js";
5
5
  import { i as translator, r as languageOf } from "./text-Dfv8S8eq.js";
6
- import { et as languageOf$1, it as shippedPromptsDirectory, rt as shippedLanguages } from "./hooks-BdR3mBeM.js";
6
+ import { at as shippedPromptsDirectory, it as shippedLanguages, tt as languageOf$1 } from "./hooks-Dtq5KZQX.js";
7
7
  import { join } from "node:path";
8
8
  import { existsSync } from "node:fs";
9
9
  import { readFile, rm } from "node:fs/promises";
@@ -279,4 +279,4 @@ async function presetApproval(exec, next, carries, auto = () => false) {
279
279
  }
280
280
  export { presetChatSessionId as a, presetAuthorTools as i, narrationImportMessage as n, presetOfChat as o, presetApproval as r, PresetReader as t };
281
281
 
282
- //# sourceMappingURL=preset-author-tools-DBqPwn-o.js.map
282
+ //# sourceMappingURL=preset-author-tools-BUzO9mTW.js.map
@@ -1,9 +1,9 @@
1
- import { n as limitAuthoringAgents } from "./authoring-tools-VOaXzr_R.js";
2
- import { t as guardAuthoringTurns } from "./turn-guard-xaFxYc1T.js";
3
- import { t as silenceHarnessDevContext } from "./dev-context-Bdm-eVer.js";
4
- import { i as presetAuthorTools, o as presetOfChat, r as presetApproval, t as PresetReader } from "./preset-author-tools-DBqPwn-o.js";
5
- import "./hooks-BdR3mBeM.js";
6
- import { K as presetDirectory } from "./serial-BZNeK57v.js";
1
+ import { n as limitAuthoringAgents } from "./authoring-tools-BZr4bgBy.js";
2
+ import { t as guardAuthoringTurns } from "./turn-guard-87NE-Cnp.js";
3
+ import { n as silenceRuntimeContext, t as silenceHarnessDevContext } from "./dev-context-Cgv_wZbG.js";
4
+ import { i as presetAuthorTools, o as presetOfChat, r as presetApproval, t as PresetReader } from "./preset-author-tools-BUzO9mTW.js";
5
+ import "./hooks-Dtq5KZQX.js";
6
+ import { K as presetDirectory } from "./serial-BUaJGwVy.js";
7
7
  import { join } from "node:path";
8
8
  import { existsSync } from "node:fs";
9
9
  // src/preset-authoring.ts
@@ -20,6 +20,7 @@ const inject = [
20
20
  /** The preset authoring chat: reads and writes the prose prompts of one library preset, each write approved by the person. */
21
21
  function apply(ctx) {
22
22
  silenceHarnessDevContext(ctx);
23
+ silenceRuntimeContext(ctx);
23
24
  const library = () => ctx.roleplayRoot.path;
24
25
  const reader = new PresetReader(library);
25
26
  const prompting = {