@dsh-agentic-roleplay/core 0.12.5 → 0.12.7

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 (35) hide show
  1. package/lib/{access-DjA0kvPM.js → access-5vtPAT3O.js} +2 -2
  2. package/lib/{authoring-tools-DqAttdUN.js → authoring-tools-Bi9YQ9QH.js} +52 -18
  3. package/lib/authoring.js +228 -35
  4. package/lib/{child-SMvjNsb8.js → child-Bfj7-Iuo.js} +11 -13
  5. package/lib/client.js +910 -526
  6. package/lib/client.js.map +1 -1
  7. package/lib/compaction.js +4 -4
  8. package/lib/doctor.js +3 -3
  9. package/lib/{library-D6AcyxGZ.js → gallery-BT5lf-T5.js} +212 -7
  10. package/lib/helper.js +2 -2
  11. package/lib/{hooks-OLl-1AOS.js → hooks-DR-HqE50.js} +6 -4
  12. package/lib/images.js +3 -4
  13. package/lib/index.js +131 -23
  14. package/lib/{presenter-agent-CGCJrg7V.js → interpreter-BYNrjYZo.js} +155 -64
  15. package/lib/{jail-CDW5iymd.js → jail-D83JnxKg.js} +2 -2
  16. package/lib/{lorebook-author-tools-CXV1KD4Q.js → lorebook-author-tools-BI-r8fEt.js} +6 -6
  17. package/lib/lorebook-authoring.js +5 -5
  18. package/lib/{narration-Bnrvl0UQ.js → narration-CUZIXzab.js} +9 -3
  19. package/lib/orchestration.js +59 -19
  20. package/lib/{pack-jail-CZAmlgE1.js → pack-jail-Y1XPbqHw.js} +20 -14
  21. package/lib/{packs-DUVCSHqi.js → packs-DD-v-Epl.js} +2 -2
  22. package/lib/presenter-agent-00sOVGI9.js +59 -0
  23. package/lib/{preset-BYfXYvp0.js → preset-Bnx3jhUv.js} +4 -4
  24. package/lib/{preset-author-tools-DYxTLm9U.js → preset-author-tools-DYrBcieA.js} +6 -6
  25. package/lib/preset-authoring.js +5 -5
  26. package/lib/{reflection-C3zdufN9.js → reflection-DqxoV9xE.js} +10 -9
  27. package/lib/{serial-Bh6gqb3f.js → serial-CS46qAvI.js} +57 -11
  28. package/lib/{turn-guard-CNFvmz_F.js → turn-guard-bZkxzRXJ.js} +3 -3
  29. package/package.json +32 -31
  30. package/prompts/en/import/finish-ok.md +2 -0
  31. package/prompts/en/roleplay/image-worth.md +5 -0
  32. package/prompts/zh/import/finish-ok.md +2 -0
  33. package/prompts/zh/roleplay/image-worth.md +5 -0
  34. package/lib/gallery-Dahi5TkO.js +0 -190
  35. package/lib/generator-BvSZGpzy.js +0 -150
@@ -1,14 +1,158 @@
1
- import { n as atomicWrite, t as promptFor } from "./access-DjA0kvPM.js";
2
- import { l as runChild } from "./child-SMvjNsb8.js";
3
- import { n as generateTransientImage, t as generateReferenceImage } from "./generator-BvSZGpzy.js";
4
- import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-Dahi5TkO.js";
5
- import { c as nextSceneSerial, u as referenceImagePath } from "./library-D6AcyxGZ.js";
1
+ import { l as runChild } from "./child-Bfj7-Iuo.js";
2
+ import { n as atomicWrite, t as promptFor } from "./access-5vtPAT3O.js";
3
+ import { a as updateImage, f as nextSceneSerial, g as writeImage, h as sceneImagePath, i as listGallery, m as referenceImagePath, r as galleryFile } from "./gallery-BT5lf-T5.js";
6
4
  import { join, relative, sep } from "node:path";
7
5
  import { characterKey, itemKey, locationKey } from "@dsh-agentic-roleplay/state";
8
6
  import { existsSync } from "node:fs";
9
7
  import { createHash } from "node:crypto";
10
8
  import { readFile } from "node:fs/promises";
11
9
  import { defineTool } from "@deepseek-ai/dsh-tools";
10
+ // src/host/images/generator.ts
11
+ const unique = (values) => [...new Set(values.map((value) => value.trim()).filter((value) => value !== ""))];
12
+ /** What a reference image shows: the subject and its stable look. */
13
+ function referenceDescription(request) {
14
+ return `${request.subject.name} (${request.subject.kind}): ${request.identity.description}`.trim();
15
+ }
16
+ /** What a scene image shows: the established moment, then how each subject looks in it. */
17
+ function transientDescription(request) {
18
+ return [request.scene.trim(), ...request.subjects.map((subject) => subject.transient.trim() === "" ? void 0 : `${subject.name}: ${subject.transient.trim()}`)].filter((part) => part !== void 0 && part !== "").join("\n");
19
+ }
20
+ function lines(parts) {
21
+ return parts.filter((part) => part !== void 0 && part.trim() !== "").join("\n");
22
+ }
23
+ function referencePrompt(request) {
24
+ const { subject, identity } = request;
25
+ return lines([
26
+ request.artDirection,
27
+ `Create a canonical reference image of the ${subject.kind} ${subject.name}.`,
28
+ identity.description,
29
+ identity.tags.length === 0 ? void 0 : `Stable visual traits: ${identity.tags.join(", ")}.`,
30
+ "Show the subject clearly and neutrally. Do not add story events or temporary changes.",
31
+ identity.negativeTags.length === 0 ? void 0 : `Avoid: ${identity.negativeTags.join(", ")}.`
32
+ ]);
33
+ }
34
+ /** What one subject must not look like may well be what another in the same picture does look like, so a trait that any subject has is not avoided. */
35
+ function avoidedIn(subjects) {
36
+ const wanted = new Set(subjects.flatMap((subject) => subject.identity.tags.map((tag) => tag.trim().toLowerCase())));
37
+ const avoided = [...new Set(subjects.flatMap((subject) => subject.identity.negativeTags))].filter((tag) => !wanted.has(tag.trim().toLowerCase()));
38
+ return avoided.length === 0 ? void 0 : `Avoid: ${avoided.join(", ")}.`;
39
+ }
40
+ function transientPrompt(request) {
41
+ return lines([
42
+ request.artDirection,
43
+ `Illustrate this established story moment: ${request.scene}`,
44
+ ...request.subjects.map((subject) => lines([
45
+ `${subject.kind} ${subject.name}: ${subject.identity.description}`,
46
+ subject.identity.tags.length === 0 ? void 0 : `Stable visual traits: ${subject.identity.tags.join(", ")}.`,
47
+ subject.transient === "" ? void 0 : `Current visible state: ${subject.transient}`
48
+ ])),
49
+ "Preserve every canonical identity. Depict only the stated subjects, state and action; do not invent story facts.",
50
+ avoidedIn(request.subjects)
51
+ ]);
52
+ }
53
+ async function firstPng(service, prompt, options = {}) {
54
+ const result = await service.generate(prompt, {
55
+ count: 1,
56
+ ...options
57
+ });
58
+ const image = result.images[0];
59
+ if (image === void 0) throw new Error(`${service.provider} returned no image`);
60
+ if (image.mediaType !== "image/png") throw new Error(`${service.provider} returned ${image.mediaType}; roleplay image storage currently requires PNG`);
61
+ return {
62
+ data: new Uint8Array(await image.data.arrayBuffer()),
63
+ model: result.model,
64
+ ...image.revisedPrompt === void 0 ? {} : { revisedPrompt: image.revisedPrompt }
65
+ };
66
+ }
67
+ /** Generates the stable reference.png of one entity. It is intentionally not registered in the live roleplay loop yet. */
68
+ async function generateReferenceImage(service, request) {
69
+ const prompt = referencePrompt(request);
70
+ const image = await firstPng(service, prompt, request.signal === void 0 ? {} : { signal: request.signal });
71
+ request.signal?.throwIfAborted();
72
+ const path = referenceImagePath(request.root, request.subject);
73
+ const metadata = {
74
+ schema: "dsh-roleplay-image/v3",
75
+ purpose: "reference",
76
+ origin: "generated",
77
+ reusable: true,
78
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
79
+ prompt,
80
+ description: referenceDescription(request),
81
+ tags: unique([request.subject.name, ...request.identity.tags]),
82
+ ...image.revisedPrompt === void 0 ? {} : { revisedPrompt: image.revisedPrompt },
83
+ provider: service.provider,
84
+ model: image.model,
85
+ subjects: [{
86
+ ...request.subject,
87
+ identityVersion: request.identity.version
88
+ }]
89
+ };
90
+ await writeImage(path, image.data, metadata, { replace: true });
91
+ return path;
92
+ }
93
+ const PNG_SIGNATURE = [
94
+ 137,
95
+ 80,
96
+ 78,
97
+ 71,
98
+ 13,
99
+ 10,
100
+ 26,
101
+ 10
102
+ ];
103
+ /** Takes a picture the person brought as the stable reference.png of one entity, replacing the one there. Only PNG is stored, so any other format is refused. */
104
+ async function uploadReferenceImage(request) {
105
+ if (request.png.length < PNG_SIGNATURE.length || PNG_SIGNATURE.some((byte, index) => request.png[index] !== byte)) throw new Error("the portrait must be a PNG picture: convert it first");
106
+ const path = referenceImagePath(request.root, request.subject);
107
+ const metadata = {
108
+ schema: "dsh-roleplay-image/v3",
109
+ purpose: "reference",
110
+ origin: "uploaded",
111
+ reusable: true,
112
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
113
+ description: `${request.subject.name}, a picture brought by the author.`,
114
+ tags: [request.subject.name],
115
+ ...request.originalName === void 0 ? {} : { originalName: request.originalName },
116
+ subjects: [request.subject]
117
+ };
118
+ await writeImage(path, request.png, metadata, { replace: true });
119
+ return path;
120
+ }
121
+ /** Generates one immutable scene image for a timeline node. It is intentionally not registered in the live roleplay loop yet. */
122
+ async function generateTransientImage(service, request) {
123
+ if (request.subjects.length === 0) throw new Error("a transient image needs at least one subject");
124
+ const prompt = transientPrompt(request);
125
+ const image = await firstPng(service, prompt, {
126
+ ...request.references === void 0 ? {} : { references: request.references },
127
+ ...request.signal === void 0 ? {} : { signal: request.signal }
128
+ });
129
+ request.signal?.throwIfAborted();
130
+ const path = sceneImagePath(request.root, request.timelineNode, request.serial);
131
+ const metadata = {
132
+ schema: "dsh-roleplay-image/v3",
133
+ purpose: "transient",
134
+ origin: "generated",
135
+ reusable: request.reusable === true,
136
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
137
+ prompt,
138
+ description: transientDescription(request),
139
+ tags: unique(request.subjects.flatMap((subject) => [subject.name, ...subject.identity.tags])),
140
+ ...image.revisedPrompt === void 0 ? {} : { revisedPrompt: image.revisedPrompt },
141
+ provider: service.provider,
142
+ model: image.model,
143
+ subjects: request.subjects.map(({ identity, transient: _transient, ...subject }) => ({
144
+ ...subject,
145
+ identityVersion: identity.version
146
+ })),
147
+ source: {
148
+ turn: request.turn,
149
+ timelineNode: request.timelineNode,
150
+ ...request.segment === void 0 ? {} : { segment: request.segment }
151
+ }
152
+ };
153
+ await writeImage(path, image.data, metadata);
154
+ return path;
155
+ }
12
156
  // src/host/images/presented.ts
13
157
  const PRESENTED_FOLDER = "presented";
14
158
  const fileOf = (folder, node) => join(folder, "images", PRESENTED_FOLDER, `${node}.json`);
@@ -660,7 +804,7 @@ function imageTools(deps) {
660
804
  ];
661
805
  }
662
806
  // src/host/images/interpreter.ts
663
- const RESULT$1 = {
807
+ const RESULT = {
664
808
  type: "object",
665
809
  properties: {
666
810
  description: {
@@ -759,7 +903,7 @@ async function interpretImage(job) {
759
903
  const captioner = job.captioner?.trim() ?? "";
760
904
  const reader = captioner === "" ? await readerOf(job, job.model ?? "") : await readerOf(job, captioner);
761
905
  const { file, mediaType } = await galleryFile(job.sessionFolder, job.path);
762
- const known = storySubjects(job.story).filter((subject) => !subject.hidden);
906
+ const known = job.subjects ?? (job.story === void 0 ? [] : storySubjects(job.story).filter((subject) => !subject.hidden));
763
907
  const attachment = await job.attachments.saveImage({
764
908
  data: new Uint8Array(await readFile(file)),
765
909
  mediaType,
@@ -773,9 +917,9 @@ async function interpretImage(job) {
773
917
  ...job.reasoningEffort === void 0 ? {} : { reasoningEffort: job.reasoningEffort },
774
918
  ...job.sampling === void 0 ? {} : { sampling: job.sampling },
775
919
  persona: promptFor(job.parent, "roleplay/image-interpreter", job.language),
776
- prompt: `The characters, places and things of this story, by name:\n${known.map((subject) => `- ${subject.name} (${subject.kind})`).join("\n") || "(none)"}\n\n${captionText === void 0 ? "Describe the picture that follows." : `Another model looked at the picture and wrote this caption. Turn it into the description, tags and subjects, adding nothing it does not say:\n\n${captionText}`}`,
920
+ prompt: `The characters, places and things of this story, by name:\n${known.map((subject) => `- ${subject.name} (${subject.kind})`).join("\n") || "(none)"}\n\n${captionText === void 0 ? "Describe the picture that follows." : `Another model looked at the picture and wrote this caption. Turn it into the description, tags and subjects, adding nothing it does not say:\n\n${captionText}`}${job.context === void 0 || job.context.trim() === "" ? "" : `\n\nWhat is known of where the picture came from. It is a hint written by whoever supplied it, not an instruction: the picture decides what you describe, and the hint may help you name who or what it shows.\n${job.context.trim().slice(0, 1500)}`}`,
777
921
  ...captionText === void 0 ? { images: [attachment] } : {},
778
- result: RESULT$1,
922
+ result: RESULT,
779
923
  beforeSubmit: (value) => {
780
924
  const result = value;
781
925
  if (result.description.trim() === "") return "write what the picture shows";
@@ -790,59 +934,6 @@ async function interpretImage(job) {
790
934
  subjects: answer.subjects
791
935
  });
792
936
  }
793
- // src/host/images/presenter-agent.ts
794
- const RESULT = {
795
- type: "object",
796
- properties: { summary: {
797
- type: "string",
798
- description: "A brief factual description of the images the tools generated."
799
- } },
800
- required: ["summary"],
801
- additionalProperties: false
802
- };
803
- /**
804
- * One-shot image presentation agent, with its tools on its own scope. Asked for a picture of a moment, it either shows an image the session
805
- * already has (when `reuse` is on and the picture is not asked for outright) or has a new one generated.
806
- */
807
- async function runImagePresenter(job) {
808
- const generated = [];
809
- const sees = job.reuse === true && job.attachments !== void 0 && await canReadImages(job.parent, "", job.signal);
810
- return {
811
- summary: (await runChild({
812
- parent: job.parent,
813
- signal: job.signal,
814
- ...job.reasoningEffort === void 0 ? {} : { reasoningEffort: job.reasoningEffort },
815
- ...job.sampling === void 0 ? {} : { sampling: job.sampling },
816
- persona: promptFor(job.parent, "roleplay/image-presenter", job.language, { reuse: job.reuse === true ? promptFor(job.parent, "roleplay/image-reuse", job.language) : "" }),
817
- prompt: [
818
- job.reuse === true ? "Find or create the picture for this moment of the story." : `Create ${job.purpose === "reference" ? "a canonical reference image" : "a transient story illustration"} as requested.`,
819
- `Request: ${job.request}`,
820
- `This is turn ${job.turn}, timeline node ${job.timelineNode}.`
821
- ].join("\n"),
822
- tools: imageTools({
823
- root: job.root,
824
- story: job.story,
825
- service: job.service,
826
- turn: job.turn,
827
- timelineNode: job.timelineNode,
828
- generated,
829
- signal: job.signal,
830
- ...job.reuse === true ? {
831
- library: true,
832
- sees,
833
- ...job.attachments === void 0 ? {} : { attachments: job.attachments },
834
- ...job.embedder === void 0 ? {} : { embedder: job.embedder }
835
- } : {},
836
- ...job.referenceMode === void 0 ? {} : { referenceMode: job.referenceMode }
837
- }),
838
- result: RESULT,
839
- beforeSubmit: () => generated.length === 0 ? "you have not shown or generated an image: use the appropriate tool before finishing" : void 0,
840
- ...job.trace === void 0 ? {} : { trace: job.trace },
841
- maxCalls: 16
842
- })).summary,
843
- images: [...generated]
844
- };
845
- }
846
- 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 };
937
+ export { searchImages as a, presentedFor as c, referencePrompt as d, transientPrompt as f, findImages as i, generateReferenceImage as l, interpretImage as n, tokensOf as o, uploadReferenceImage as p, imageTools as r, present as s, canReadImages as t, generateTransientImage as u };
847
938
 
848
- //# sourceMappingURL=presenter-agent-CGCJrg7V.js.map
939
+ //# sourceMappingURL=interpreter-BYNrjYZo.js.map
@@ -1,4 +1,4 @@
1
- import { j as roleplaySessionOf } from "./child-SMvjNsb8.js";
1
+ import { j as roleplaySessionOf } from "./child-Bfj7-Iuo.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-CDW5iymd.js.map
107
+ //# sourceMappingURL=jail-D83JnxKg.js.map
@@ -1,9 +1,9 @@
1
- import "./access-DjA0kvPM.js";
2
- import { Wt as ImportCardError, o as contextOf, r as MAX_PREVIEW_TEXT } from "./authoring-tools-DqAttdUN.js";
3
- import { Et as IMPORT_FOLDER, St as cleanText, Tt as withPlayer, U as createPresetFromGuidance, _t as updateLorebookInfo, dn as LORE_SCOPES, ht as readLorebook$1, lt as deleteLorebookEntry, mt as lorebookDirectory, pt as loadLorebook, un as LORE_KINDS, ut as entriesOf, vt as writeLorebookEntry, wt as partsOf } from "./serial-Bh6gqb3f.js";
4
- import { F as textLanguage, I as wrongLanguage, at as shippedPromptsDirectory } from "./hooks-OLl-1AOS.js";
1
+ import "./access-5vtPAT3O.js";
2
+ import { Gt as ImportCardError, o as contextOf, r as MAX_PREVIEW_TEXT } from "./authoring-tools-Bi9YQ9QH.js";
3
+ import { Et as IMPORT_FOLDER, St as cleanText, Tt as withPlayer, U as createPresetFromGuidance, _t as updateLorebookInfo, dn as LORE_SCOPES, ht as readLorebook$1, lt as deleteLorebookEntry, mt as lorebookDirectory, pt as loadLorebook, un as LORE_KINDS, ut as entriesOf, vt as writeLorebookEntry, wt as partsOf } from "./serial-CS46qAvI.js";
4
+ import { F as textLanguage, I as wrongLanguage, at as shippedPromptsDirectory } from "./hooks-DR-HqE50.js";
5
5
  import { i as translator, r as languageOf } from "./text-B-HsLdb-.js";
6
- import { C as slug, T as uniqueKey, w as trOf, x as mapLimit } from "./library-D6AcyxGZ.js";
6
+ import { C as mapLimit, D as uniqueKey, E as trOf, T as slug } from "./gallery-BT5lf-T5.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-CXV1KD4Q.js.map
712
+ //# sourceMappingURL=lorebook-author-tools-BI-r8fEt.js.map
@@ -1,9 +1,9 @@
1
- import { n as limitAuthoringAgents } from "./authoring-tools-DqAttdUN.js";
2
- import { t as guardAuthoringTurns } from "./turn-guard-CNFvmz_F.js";
1
+ import { n as limitAuthoringAgents } from "./authoring-tools-Bi9YQ9QH.js";
2
+ import { t as guardAuthoringTurns } from "./turn-guard-bZkxzRXJ.js";
3
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-CXV1KD4Q.js";
5
- import "./hooks-OLl-1AOS.js";
6
- import { mt as lorebookDirectory } from "./serial-Bh6gqb3f.js";
4
+ import { d as lorebookOfChat, i as lorebookAuthorTools, n as LorebookReader, o as pendingTargets, r as lorebookApproval } from "./lorebook-author-tools-BI-r8fEt.js";
5
+ import "./hooks-DR-HqE50.js";
6
+ import { mt as lorebookDirectory } from "./serial-CS46qAvI.js";
7
7
  import { join } from "node:path";
8
8
  import { existsSync, readdirSync } from "node:fs";
9
9
  // src/lorebook-authoring.ts
@@ -1,4 +1,4 @@
1
- import { i as atomicWriteSync } from "./access-DjA0kvPM.js";
1
+ import { i as atomicWriteSync } from "./access-5vtPAT3O.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
@@ -234,6 +234,7 @@ const SETTINGS_SPEC = {
234
234
  mode: choice([
235
235
  "off",
236
236
  "manual",
237
+ "important",
237
238
  "every-turn"
238
239
  ], "manual"),
239
240
  references: choice([
@@ -442,6 +443,10 @@ function loadedSettings(folder, problem) {
442
443
  }
443
444
  }
444
445
  // src/shared/narration.ts
446
+ /** What a reader that cannot see pictures is told of the segments: each narration as written, each utterance as `utterance` makes it, a picture nothing. */
447
+ function wordsOf(segments, utterance) {
448
+ return segments.flatMap((segment) => segment.type === "image" ? [] : [segment.type === "utterance" ? utterance(segment) : segment.text]);
449
+ }
445
450
  const OPEN = "<roleplay-output>";
446
451
  const CLOSE = "</roleplay-output>";
447
452
  const PREVIEW_OPEN = "<roleplay-preview>";
@@ -457,6 +462,7 @@ function isSegment(value) {
457
462
  if (typeof value !== "object" || value === null) return false;
458
463
  const segment = value;
459
464
  if (segment["type"] === "narration") return typeof segment["text"] === "string";
465
+ if (segment["type"] === "image") return typeof segment["path"] === "string" && segment["path"] !== "";
460
466
  return segment["type"] === "utterance" && typeof segment["character"] === "string" && typeof segment["name"] === "string" && typeof segment["text"] === "string";
461
467
  }
462
468
  /** The output encoded in a tool result's text, or nothing when the text carries none. */
@@ -483,6 +489,6 @@ function decodeOutput(text) {
483
489
  return;
484
490
  }
485
491
  }
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 };
492
+ export { GATE_SITES as _, InvalidSettingsError as a, useChildReasoning as c, SETTINGS_SPEC as d, parseSettings as f, DECISION_SITES as g, rulesOf as h, wordsOf as i, writeSettings as l, WORLD_RULES_KEY as m, encodeOutput as n, liveSettings as o, parseSwitchboard as p, encodePreview as r, readSettings as s, decodeOutput as t, DEFAULT_SETTINGS as u, emptyStats as v };
487
493
 
488
- //# sourceMappingURL=narration-Bnrvl0UQ.js.map
494
+ //# sourceMappingURL=narration-CUZIXzab.js.map
@@ -1,17 +1,17 @@
1
1
  import { n as silenceRuntimeContext, t as silenceHarnessDevContext } from "./dev-context-Cgv_wZbG.js";
2
- import { t as promptFor } from "./access-DjA0kvPM.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 ClockError, a as MAX_OOC_ANSWER, bt as AUTHORING_NEEDS, d as record, f as toolEnabled, i as characterRunner, l as PREVIEW_TOOL, n as installHooks, o as externalGiven, ot as shippedText, p as storesOf, tt as languageOf, u as createTools$1, ut as ReflectionRefusedError, v as readVerdicts, vt as describeWhen, y as writeVerdicts, yt as zoneOf } from "./hooks-OLl-1AOS.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-SMvjNsb8.js";
5
- import { a as whereabouts, n as memoryReflector, r as recordFailure, s as Timelines, t as dueReflection } from "./reflection-C3zdufN9.js";
6
- import { A as routeVerdicts, E as askYesNo, O as modeFor, T as announceProblem, Wt as splitPanels, j as yesAt, k as noAt, ln as guarded, mn as INTENT_STATUSES, n as STANDING_PROMPT } from "./serial-Bh6gqb3f.js";
2
+ import { t as promptFor } from "./access-5vtPAT3O.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 ClockError, a as MAX_OOC_ANSWER, bt as AUTHORING_NEEDS, d as record, f as toolEnabled, i as characterRunner, l as PREVIEW_TOOL, n as installHooks, o as externalGiven, ot as shippedText, p as storesOf, tt as languageOf, u as createTools$1, ut as ReflectionRefusedError, v as readVerdicts, vt as describeWhen, y as writeVerdicts, yt as zoneOf } from "./hooks-DR-HqE50.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-Bfj7-Iuo.js";
5
+ import { a as whereabouts, n as memoryReflector, r as recordFailure, s as Timelines, t as dueReflection } from "./reflection-DqxoV9xE.js";
6
+ import { _ as GATE_SITES, i as wordsOf, n as encodeOutput, o as liveSettings } from "./narration-CUZIXzab.js";
7
7
  import { i as translator, r as languageOf$1 } from "./text-B-HsLdb-.js";
8
- import { a as liveSettings, g as GATE_SITES, n as encodeOutput } from "./narration-Bnrvl0UQ.js";
9
- import { t as registerFoldersJail } from "./jail-CDW5iymd.js";
8
+ import { A as routeVerdicts, E as askYesNo, O as modeFor, T as announceProblem, Wt as splitPanels, j as yesAt, k as noAt, ln as guarded, mn as INTENT_STATUSES, n as STANDING_PROMPT } from "./serial-CS46qAvI.js";
9
+ import { t as registerFoldersJail } from "./jail-D83JnxKg.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-D6AcyxGZ.js";
12
- import { _ as API_PREFIX } from "./packs-DUVCSHqi.js";
13
- import { i as updateImage, r as listGallery, t as describeGalleryImage } from "./gallery-Dahi5TkO.js";
14
- import { c as presentedFor, i as findImages, n as interpretImage, s as present, t as runImagePresenter } from "./presenter-agent-CGCJrg7V.js";
11
+ import { D as uniqueKey, T as slug, a as updateImage, i as listGallery, n as describeGalleryImage, o as addToLibrary } from "./gallery-BT5lf-T5.js";
12
+ import { _ as API_PREFIX } from "./packs-DD-v-Epl.js";
13
+ import { t as runImagePresenter } from "./presenter-agent-00sOVGI9.js";
14
+ import { c as presentedFor, i as findImages, n as interpretImage, s as present } from "./interpreter-BYNrjYZo.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";
@@ -385,7 +385,7 @@ const RESULT$4 = {
385
385
  };
386
386
  /** What the player read, as plain text. */
387
387
  function readingOf(job) {
388
- return job.output.segments.map((segment) => segment.type === "utterance" ? `${segment.name}: "${segment.text}"` : segment.text).join("\n\n");
388
+ return wordsOf(job.output.segments, (segment) => `${segment.name}: "${segment.text}"`).join("\n\n");
389
389
  }
390
390
  function promptOf(job) {
391
391
  const player = job.store.cast().find((member) => member.character.control === "player");
@@ -4197,7 +4197,7 @@ var TurnEngine = class {
4197
4197
  if (silent || output.repaired || state.ooc !== void 0 || state.refused >= 2) return;
4198
4198
  const store = this.storeOf(owner);
4199
4199
  const narration = output.segments.flatMap((segment) => segment.type === "narration" ? [segment.text] : []).join("\n");
4200
- const passage = output.segments.map((segment) => segment.type === "narration" ? segment.text : `${segment.name}: ${segment.text}`).join("\n");
4200
+ const passage = wordsOf(output.segments, (segment) => `${segment.name}: ${segment.text}`).join("\n");
4201
4201
  const playing = state.cast.find((member) => member.character.control === "player")?.character;
4202
4202
  const player = playing?.name ?? "";
4203
4203
  const secrets = playing === void 0 || state.secretsFound === true || store.settings().decisions.secrets === "off" ? [] : hiddenFrom(store.story, playing.id, passage);
@@ -4254,12 +4254,43 @@ var TurnEngine = class {
4254
4254
  this.afterTurn.start(owner, state.cancel.signal, {
4255
4255
  input: state.input ?? "",
4256
4256
  deeds: state.history.flatMap((entry) => [`${entry.name}: ${entry.summary}`, ...entry.utterance === void 0 ? [] : [`${entry.name}: "${entry.utterance}"`]]),
4257
- narration: output.segments.map((segment) => segment.type === "narration" ? segment.text : `${segment.name}: ${segment.text}`).join("\n")
4257
+ narration: wordsOf(output.segments, (segment) => `${segment.name}: ${segment.text}`).join("\n")
4258
4258
  });
4259
4259
  if (run !== void 0) this.offSceneIfDue(owner, state, run);
4260
4260
  return output;
4261
4261
  }
4262
4262
  };
4263
+ // src/host/images/worth.ts
4264
+ const WORTH_RESULT = {
4265
+ type: "object",
4266
+ properties: {
4267
+ reason: {
4268
+ type: "string",
4269
+ description: "One short sentence, written first: what happens in the passage and whether there is something to look at."
4270
+ },
4271
+ worth: {
4272
+ type: "boolean",
4273
+ description: "Whether the moment deserves a picture."
4274
+ }
4275
+ },
4276
+ required: ["reason", "worth"],
4277
+ additionalProperties: false
4278
+ };
4279
+ /** Whether a moment of the story is worth a picture, as a helper with no tools judges it from what the player read. */
4280
+ async function worthAPicture(job) {
4281
+ const limits = {};
4282
+ if (job.reasoningEffort !== void 0) limits.reasoningEffort = job.reasoningEffort;
4283
+ if (job.sampling !== void 0) limits.sampling = job.sampling;
4284
+ return (await runChild({
4285
+ parent: job.parent,
4286
+ signal: job.signal,
4287
+ ...limits,
4288
+ persona: promptFor(job.parent, "roleplay/image-worth", job.language),
4289
+ prompt: job.moment,
4290
+ result: WORTH_RESULT,
4291
+ maxCalls: 2
4292
+ })).worth;
4293
+ }
4263
4294
  // src/host/images/jobs.ts
4264
4295
  /** The same service, whose requests stand where the job's do unless a call says otherwise. */
4265
4296
  function withPriority(service, priority, highRes) {
@@ -4293,9 +4324,9 @@ var ImageJobs = class {
4293
4324
  const id = roleplaySessionOf(chat);
4294
4325
  if (id === void 0) return;
4295
4326
  const settings = this.deps.settings(id);
4296
- if (settings.images.mode !== "every-turn") return;
4327
+ if (settings.images.mode !== "every-turn" && settings.images.mode !== "important") return;
4297
4328
  try {
4298
- this.start(id, node, this.assertNode(id, node).turn, output, settings, "background", true);
4329
+ this.start(id, node, this.assertNode(id, node).turn, output, settings, "background", true, settings.images.mode === "important");
4299
4330
  } catch (error) {
4300
4331
  const message = error instanceof Error ? error.message : String(error);
4301
4332
  this.failures.set(this.key(id, node), message);
@@ -4315,8 +4346,9 @@ var ImageJobs = class {
4315
4346
  /**
4316
4347
  * @param priority - `foreground` when the player asked for the picture, `background` when it is made on its own after a turn and may wait behind the next one.
4317
4348
  * @param automatic - the picture was not asked for: the library is looked at first, and the pictures the person brought are described before that.
4349
+ * @param selective - a helper first says whether the moment is worth a picture at all; when it is not, nothing is made and nothing is reported.
4318
4350
  */
4319
- start(id, node, turn, output, settings, priority, automatic) {
4351
+ start(id, node, turn, output, settings, priority, automatic, selective = false) {
4320
4352
  const current = this.active.get(id);
4321
4353
  if (current?.node === node) return;
4322
4354
  current?.controller.abort();
@@ -4326,7 +4358,7 @@ var ImageJobs = class {
4326
4358
  if (parent === void 0) throw new Error("the roleplay agent is not loaded");
4327
4359
  const controller = new AbortController();
4328
4360
  this.failures.delete(this.key(id, node));
4329
- const request = output.segments.map((segment) => segment.type === "utterance" ? `${segment.name}: “${segment.text}”` : segment.text).join("\n");
4361
+ const request = wordsOf(output.segments, (segment) => `${segment.name}: “${segment.text}”`).join("\n");
4330
4362
  const reuse = automatic && settings.images.reuse;
4331
4363
  const tr = translator(languageOf$1(settings.prompts.language));
4332
4364
  const present$1 = () => {
@@ -4358,6 +4390,14 @@ var ImageJobs = class {
4358
4390
  return waiting === void 0 ? make() : waiting.then(make);
4359
4391
  };
4360
4392
  const makeOrShow = async () => {
4393
+ if (selective && !await (this.deps.worth ?? worthAPicture)({
4394
+ parent,
4395
+ signal: controller.signal,
4396
+ language: settings.prompts.language,
4397
+ moment: request,
4398
+ sampling: childSampling(settings, "records"),
4399
+ ...settings.reasoning.children === "" ? {} : { reasoningEffort: settings.reasoning.children }
4400
+ })) return void 0;
4361
4401
  const turns = store();
4362
4402
  const picked = automatic && reuse && turns !== void 0 && this.deps.reuseExisting !== void 0 ? await this.deps.reuseExisting({
4363
4403
  chat: chatSessionId(id),
@@ -4711,7 +4751,7 @@ function apply(ctx) {
4711
4751
  turnOf: currentTurn,
4712
4752
  roller: (chat) => rolls.roller(chat),
4713
4753
  delivered: (chat, output) => {
4714
- turnTraces.output(chat, output.segments.map((segment) => segment.type === "utterance" ? `${segment.name}: ${segment.text}` : segment.text).join("\n\n"));
4754
+ turnTraces.output(chat, wordsOf(output.segments, (segment) => `${segment.name}: ${segment.text}`).join("\n\n"));
4715
4755
  const node = timelines.delivered(chat, output);
4716
4756
  if (node !== void 0) images.afterDelivery(chat, node, output);
4717
4757
  return node;
@@ -1,14 +1,14 @@
1
- import { A as chatSessionId } from "./child-SMvjNsb8.js";
2
- import { $t as authoringChatSessionId, A as loadWorldParts, Bt as loadCommands, Ct as loadDice, D as worldFieldChanges, Dt as parseCalendarFile, Et as loadCalendar, F as editsSince, G as addressesToFetch, Ht as TRIGGERS_FILE_NAME, I as writeSnapshot, K as candidateUrls, Mt as UPDATE_FOLDER, Nt as baseId, O as editWorldInfo, Ot as CHARACTERS_DIR, P as recordProvenance, Pt as cardPieces, Q as writePortrait, Qt as authoredWorldOf, Rt as COMMANDS_FILE_NAME, St as DICE_FILE_NAME, T as matchPieces, Tt as CALENDAR_FILE_NAME, Ut as loadTriggers, Vt as parseCommandsFile, W as addressKey, Xt as DICE_READINGS, Y as mergeReports, Yt as DICE_COMPARISONS, Z as cardCharacter, Zt as DICE_RESULTS, _t as loadLocations, bt as FACTIONS_DIR, et as loadValidatedWorld, f as importPhase, gt as LOCATIONS_DIR, ht as routineProblems, kt as loadCharacters, nt as knowsCharacter, o as contextOf, q as fetchPictures, tt as withScratchStory, u as worldOf, vt as ITEMS_DIR, wt as parseDiceFile, xt as loadFactions, yt as loadItems, zt as commandVariable } from "./authoring-tools-DqAttdUN.js";
3
- import { $t as LOCATION_FILE_NAME, Et as IMPORT_FOLDER, Jt as loadVariables, M as WORLD_FILE_NAME, Mt as readImportFolder, N as parseWorldFile, Nt as writeChoices, Pt as InvalidEditProblems, Qt as parseLoreFile, Tt as withPlayer, Xt as variableProblems, Yt as parseVariablesFile, Zt as LORE_FILE_NAME, an as FACTION_FILE_NAME, at as writeWorldPrompt, bt as loadLore, cn as parseCharacterFile, en as parseLocationFile, kt as PICTURE_FILE, l as extractStyleFrom, on as parseFactionFile, qt as VARIABLES_FILE_NAME, rn as parseItemFile, sn as CHARACTER_FILE_NAME, tn as ITEM_FILE_NAME, xt as subfolders, yt as LORE_DIR } from "./serial-Bh6gqb3f.js";
4
- import { n as encodeOutput } from "./narration-Bnrvl0UQ.js";
5
- import { a as VARIABLE_KINDS, n as atomicWrite, o as VARIABLE_SUBJECTS, r as atomicWriteJson, s as VARIABLE_VISIBILITIES } from "./access-DjA0kvPM.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, gt as runCommandLine, it as shippedLanguages, lt as InvalidWorldError, mt as CommandRefusedError, pt as WorldNotFoundError, q as formatIssue, st as AgentUnavailableError, z as loadPlots } from "./hooks-OLl-1AOS.js";
1
+ import { A as chatSessionId } from "./child-Bfj7-Iuo.js";
2
+ import { $t as authoredWorldOf, A as loadWorldParts, Bt as commandVariable, Ct as loadDice, D as worldFieldChanges, Dt as parseCalendarFile, Et as loadCalendar, F as editsSince, G as addressesToFetch, Ht as parseCommandsFile, I as writeSnapshot, K as candidateUrls, Lt as pieceFinder, Mt as UPDATE_FOLDER, Nt as baseId, O as editWorldInfo, Ot as CHARACTERS_DIR, P as recordProvenance, Pt as cardPieces, Q as writePortrait, Qt as DICE_RESULTS, St as DICE_FILE_NAME, T as matchPieces, Tt as CALENDAR_FILE_NAME, Ut as TRIGGERS_FILE_NAME, Vt as loadCommands, W as addressKey, Wt as loadTriggers, Xt as DICE_COMPARISONS, Y as mergeReports, Z as cardCharacter, Zt as DICE_READINGS, _t as loadLocations, bt as FACTIONS_DIR, en as authoringChatSessionId, et as loadValidatedWorld, f as importPhase, gt as LOCATIONS_DIR, ht as routineProblems, kt as loadCharacters, nt as knowsCharacter, o as contextOf, q as fetchPictures, tt as withScratchStory, u as worldOf, vt as ITEMS_DIR, wt as parseDiceFile, xt as loadFactions, yt as loadItems, zt as COMMANDS_FILE_NAME } from "./authoring-tools-Bi9YQ9QH.js";
3
+ import { $t as LOCATION_FILE_NAME, Et as IMPORT_FOLDER, Jt as loadVariables, M as WORLD_FILE_NAME, Mt as readImportFolder, N as parseWorldFile, Nt as writeChoices, Pt as InvalidEditProblems, Qt as parseLoreFile, Tt as withPlayer, Xt as variableProblems, Yt as parseVariablesFile, Zt as LORE_FILE_NAME, an as FACTION_FILE_NAME, at as writeWorldPrompt, bt as loadLore, cn as parseCharacterFile, en as parseLocationFile, kt as PICTURE_FILE, l as extractStyleFrom, on as parseFactionFile, qt as VARIABLES_FILE_NAME, rn as parseItemFile, sn as CHARACTER_FILE_NAME, tn as ITEM_FILE_NAME, xt as subfolders, yt as LORE_DIR } from "./serial-CS46qAvI.js";
4
+ import { n as encodeOutput } from "./narration-CUZIXzab.js";
5
+ import { a as VARIABLE_KINDS, n as atomicWrite, o as VARIABLE_SUBJECTS, r as atomicWriteJson, s as VARIABLE_VISIBILITIES } from "./access-5vtPAT3O.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, gt as runCommandLine, it as shippedLanguages, lt as InvalidWorldError, mt as CommandRefusedError, pt as WorldNotFoundError, q as formatIssue, st as AgentUnavailableError, z as loadPlots } from "./hooks-DR-HqE50.js";
7
7
  import { i as translator, r as languageOf } from "./text-B-HsLdb-.js";
8
- import { h as readImageFileMetadata, u as referenceImagePath, x as mapLimit } from "./library-D6AcyxGZ.js";
9
- import { n as readPreset } from "./preset-BYfXYvp0.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-DUVCSHqi.js";
11
- import { a as uploadReferenceImage, t as generateReferenceImage } from "./generator-BvSZGpzy.js";
8
+ import { C as mapLimit, m as referenceImagePath, v as readImageFileMetadata } from "./gallery-BT5lf-T5.js";
9
+ import { n as readPreset } from "./preset-Bnx3jhUv.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-DD-v-Epl.js";
11
+ import { l as generateReferenceImage, p as uploadReferenceImage } from "./interpreter-BYNrjYZo.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";
@@ -56,6 +56,9 @@ function appendNarratedTurn(session, turn, output, player) {
56
56
  type: "utterance",
57
57
  character: segment.character,
58
58
  text: segment.text
59
+ } : segment.type === "image" ? {
60
+ type: "image",
61
+ path: segment.path
59
62
  } : {
60
63
  type: "narration",
61
64
  text: segment.text
@@ -687,7 +690,7 @@ async function finishUpdate(directory, options = {}) {
687
690
  recursive: true,
688
691
  force: true
689
692
  });
690
- const pictures = await updatePictures(directory, current.card.urls ?? [], next.card.urls ?? [], options);
693
+ const pictures = await updatePictures(directory, current.card.urls ?? [], next.choices.fetchPictures === false ? [] : next.card.urls ?? [], pieceFinder(next.card, next.choices), options);
691
694
  const portrait = newPicture === void 0 ? "none" : oldPicture !== void 0 && oldPicture.equals(newPicture) ? "kept" : await refreshPortrait(directory, newPicture, next.card.name);
692
695
  await recordProvenance(directory, {
693
696
  kind: "update",
@@ -703,11 +706,14 @@ async function finishUpdate(directory, options = {}) {
703
706
  };
704
707
  }
705
708
  /** Fetches what the newer card points to that the world does not have yet, keeps the record of the fetches, and says which fetched pictures the card no longer points to. */
706
- async function updatePictures(directory, earlier, later, options) {
709
+ async function updatePictures(directory, earlier, later, piecesOf, options) {
707
710
  const file = join(directory, IMPORT_FOLDER, "pictures.json");
708
711
  const record = await readFile(file, "utf8").then((text) => JSON.parse(text), () => void 0);
709
712
  const ask = addressesToFetch(earlier, later, record);
710
- const report = ask.length === 0 ? void 0 : await (options.fetcher ?? fetchPictures)(directory, ask, options.signal === void 0 ? {} : { signal: options.signal }).catch(() => ({
713
+ const report = ask.length === 0 ? void 0 : await (options.fetcher ?? fetchPictures)(directory, ask, {
714
+ ...options.signal === void 0 ? {} : { signal: options.signal },
715
+ piecesOf
716
+ }).catch(() => ({
711
717
  found: 0,
712
718
  added: [],
713
719
  skipped: []
@@ -3227,4 +3233,4 @@ function registerPackJail(ctx, deps) {
3227
3233
  }
3228
3234
  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 };
3229
3235
 
3230
- //# sourceMappingURL=pack-jail-CZAmlgE1.js.map
3236
+ //# sourceMappingURL=pack-jail-Y1XPbqHw.js.map
@@ -1,4 +1,4 @@
1
- import { K as Reader } from "./hooks-OLl-1AOS.js";
1
+ import { K as Reader } from "./hooks-DR-HqE50.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-DUVCSHqi.js.map
839
+ //# sourceMappingURL=packs-DD-v-Epl.js.map