@dsh-agentic-roleplay/core 0.12.3 → 0.12.4

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 (31) hide show
  1. package/lib/{authoring-tools-hacA5fG-.js → authoring-tools-B_qYKK8c.js} +244 -27
  2. package/lib/authoring.js +175 -9
  3. package/lib/client.js +841 -482
  4. package/lib/client.js.map +1 -1
  5. package/lib/doctor.js +1 -1
  6. package/lib/{gallery-BNg0rPTp.js → gallery-Bu6eZMKk.js} +2 -2
  7. package/lib/{generator-9-5at9cZ.js → generator-CTWQWbSW.js} +2 -2
  8. package/lib/{hooks-DlrFO4aQ.js → hooks-YXQZ9G2d.js} +2 -2
  9. package/lib/images.js +4 -4
  10. package/lib/index.js +34 -25
  11. package/lib/{library-DTxakw0z.js → library-BmlHNCah.js} +2 -2
  12. package/lib/{lorebook-author-tools-dupq-kb_.js → lorebook-author-tools-C3rRpMt7.js} +6 -6
  13. package/lib/lorebook-authoring.js +5 -5
  14. package/lib/orchestration.js +8 -8
  15. package/lib/{pack-jail-Bq0fzKi4.js → pack-jail-VbcXiukr.js} +10 -9
  16. package/lib/{packs-D-7EU3yU.js → packs-CzVh2ZNe.js} +2 -2
  17. package/lib/{presenter-agent-vFOxIuWv.js → presenter-agent-CF3fneuJ.js} +4 -4
  18. package/lib/{preset-RHcOG55T.js → preset-C595KRUM.js} +3 -3
  19. package/lib/{preset-author-tools-Dwxnpv6V.js → preset-author-tools-CF_JKKTE.js} +6 -6
  20. package/lib/preset-authoring.js +5 -5
  21. package/lib/{reflection-DibpEUQK.js → reflection-ByIQSOKC.js} +6 -6
  22. package/lib/{serial-CDGoXYh-.js → serial-ULGUKWsu.js} +129 -30
  23. package/lib/{text-Dfv8S8eq.js → text-hiKTooVb.js} +3 -1
  24. package/lib/{turn-guard-DDxikrq7.js → turn-guard-DXMeAJdv.js} +2 -2
  25. package/package.json +2 -2
  26. package/prompts/en/import/opening.md +17 -0
  27. package/prompts/en/roleplay/decide-opening.md +1 -0
  28. package/prompts/en/world/procedure.md +1 -1
  29. package/prompts/zh/import/opening.md +17 -0
  30. package/prompts/zh/roleplay/decide-opening.md +1 -0
  31. package/prompts/zh/world/procedure.md +1 -1
package/lib/doctor.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as silenceRuntimeContext, t as silenceHarnessDevContext } from "./dev-context-Cgv_wZbG.js";
2
2
  import { A as chatSessionId } from "./child-DTdY14S9.js";
3
3
  import { n as doctorSessionOf } from "./doctor-chat-hL1a61hp.js";
4
- import { s as externalTools, t as externalToolLimit } from "./hooks-DlrFO4aQ.js";
4
+ import { s as externalTools, t as externalToolLimit } from "./hooks-YXQZ9G2d.js";
5
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";
@@ -1,5 +1,5 @@
1
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";
2
+ import { _ as writeImageFileMetadata, a as LIBRARY_FOLDER, g as sidecarOf, h as readImageFileMetadata, m as mediaTypeOf, x as mapLimit } from "./library-BmlHNCah.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-BNg0rPTp.js.map
190
+ //# sourceMappingURL=gallery-Bu6eZMKk.js.map
@@ -1,4 +1,4 @@
1
- import { d as sceneImagePath, f as writeImage, u as referenceImagePath } from "./library-DTxakw0z.js";
1
+ import { d as sceneImagePath, f as writeImage, u as referenceImagePath } from "./library-BmlHNCah.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-9-5at9cZ.js.map
150
+ //# sourceMappingURL=generator-CTWQWbSW.js.map
@@ -1,7 +1,7 @@
1
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
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
3
  import { t as promptFor } from "./access-Csp80TFX.js";
4
- import { i as translator, r as languageOf$1, t as trimCharacters } from "./text-Dfv8S8eq.js";
4
+ import { i as translator, r as languageOf$1, t as trimCharacters } from "./text-hiKTooVb.js";
5
5
  import { n as storyRoots } from "./service-mRKwpWjX.js";
6
6
  import { dirname, join } from "node:path";
7
7
  import { DAY, ENGAGEMENT_GRACE, ITEM_ACTIONS, MINUTE, SECOND, addLocalDays, agendaAt, announcements, applyItemPlan, changeItem, changeVariable, clockTime, createCharacterTools, createDiceTools, createTools, dayPart, describeDuration, describeInstant, describeValue, holidaysOn, inAudience, isSessionId, itemKey, localTime, locationKey, mentioned, nextOccurrence, nextTimeOfDay, occurrenceAt, overlap, parseInstant, planItemChange, planVariableChange, readCalendar, rollPlain, seasonOf, sessionDatabase, sessionFolder, shownVariables, tokens } from "@dsh-agentic-roleplay/state";
@@ -5010,4 +5010,4 @@ function installHooks(ctx, deps) {
5010
5010
  }
5011
5011
  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 _, ClockError as _t, MAX_OOC_ANSWER as a, shippedPromptsDirectory as at, readWithdrawn as b, AUTHORING_NEEDS as bt, externalWithheld as c, InvalidStartError as ct, record as d, SessionArchivedError as dt, inheritPrompts as et, toolEnabled as f, SessionNotFoundError as ft, readRunDetail as g, runCommandLine as gt, readActivity as h, registerCommands as ht, characterRunner as i, shippedLanguages as it, populatePlots as j, PLOTS_METADATA_KEY as k, PREVIEW_TOOL as l, InvalidWorldError as lt, readDecisionStats as m, CommandRefusedError as mt, installHooks as n, listFiles as nt, externalGiven as o, shippedText as ot, storesOf as p, WorldNotFoundError as pt, formatIssue as q, guardRepeatedCalls as r, promptProblem as rt, externalTools as s, AgentUnavailableError as st, externalToolLimit as t, languageOf as tt, createTools$1 as u, ReflectionRefusedError as ut, readVerdicts as v, describeWhen as vt, observeAsPlayer as w, addToNote as x, COMPARISONS as xt, writeVerdicts as y, zoneOf as yt, loadPlots as z };
5012
5012
 
5013
- //# sourceMappingURL=hooks-DlrFO4aQ.js.map
5013
+ //# sourceMappingURL=hooks-YXQZ9G2d.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-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";
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-CF3fneuJ.js";
2
+ import { i as updateImage, r as listGallery } from "./gallery-Bu6eZMKk.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-BmlHNCah.js";
4
+ import { i as transientPrompt, n as generateTransientImage, r as referencePrompt, t as generateReferenceImage } from "./generator-CTWQWbSW.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
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 { $ as checkWorld, A as loadWorldParts, B as localChanges, Gt as pictureOf, H as writeOrigin, Ht as ImportCardError, J as guardedLookup, Kt as readCard, L as describeChanges, O as editWorldInfo, Ot as CHARACTERS_DIR, R as hashWorld, U as CatalogueError, Ut as cardFormat, V as readOrigin, Wt as isPng, X as vetUrl, Xt as authoredWorldOf, Zt as authoringChatSessionId, _ as structureImport, _t as loadLocations, a as beginImport, at as populateClock, c as importTextFor, ct as populateItems, d as knownOutputCeiling, dt as populateLore, et as loadValidatedWorld, f as importPhase, ft as populateRoutines, g as settleDraft, h as markReady, i as ImportState, it as populateCharacters, k as readWorldInfo, kt as loadCharacters, lt as populateKnowledge, m as keepDraft, mt as populateVariables, nt as knowsCharacter, ot as populateDice, pt as populateTriggers, rt as populateCalendar, st as populateFactions, t as AuthoringTools, ut as populateLocations, x as runChecks, z as isUnchanged } from "./authoring-tools-hacA5fG-.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-dupq-kb_.js";
4
- import { a as presetChatSessionId, n as narrationImportMessage, o as presetOfChat } from "./preset-author-tools-Dwxnpv6V.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, h as readActivity, it as shippedLanguages, j as populatePlots, k as PLOTS_METADATA_KEY, lt as InvalidWorldError, m as readDecisionStats, mt as CommandRefusedError, nt as listFiles, pt as WorldNotFoundError, q as formatIssue, rt as promptProblem, s as externalTools, st as AgentUnavailableError, tt as languageOf, ut as ReflectionRefusedError, w as observeAsPlayer, x as addToNote, yt as zoneOf } from "./hooks-DlrFO4aQ.js";
2
+ import { $ as checkWorld, $t as authoringChatSessionId, A as loadWorldParts, B as localChanges, Gt as cardFormat, H as writeOrigin, J as guardedLookup, Jt as readCard, Kt as isPng, L as describeChanges, O as editWorldInfo, Ot as CHARACTERS_DIR, Qt as authoredWorldOf, R as hashWorld, U as CatalogueError, V as readOrigin, Wt as ImportCardError, X as vetUrl, _ as structureImport, _t as loadLocations, a as beginImport, at as populateClock, c as importTextFor, ct as populateItems, d as knownOutputCeiling, dt as populateLore, et as loadValidatedWorld, f as importPhase, ft as populateRoutines, g as settleDraft, h as markReady, i as ImportState, it as populateCharacters, k as readWorldInfo, kt as loadCharacters, lt as populateKnowledge, m as keepDraft, mt as populateVariables, nt as knowsCharacter, ot as populateDice, pt as populateTriggers, qt as pictureOf, rt as populateCalendar, st as populateFactions, t as AuthoringTools, ut as populateLocations, x as runChecks, z as isUnchanged } from "./authoring-tools-B_qYKK8c.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-C3rRpMt7.js";
4
+ import { a as presetChatSessionId, n as narrationImportMessage, o as presetOfChat } from "./preset-author-tools-CF_JKKTE.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, h as readActivity, it as shippedLanguages, j as populatePlots, k as PLOTS_METADATA_KEY, lt as InvalidWorldError, m as readDecisionStats, mt as CommandRefusedError, nt as listFiles, pt as WorldNotFoundError, q as formatIssue, rt as promptProblem, s as externalTools, st as AgentUnavailableError, tt as languageOf, ut as ReflectionRefusedError, w as observeAsPlayer, x as addToNote, yt as zoneOf } from "./hooks-YXQZ9G2d.js";
6
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, Ct as IMPORT_FOLDER, F as parseWorldInfoEdit, Ft as parsePlaceEdit, G as loadPreset, H as deletePreset, I as combineAnswers, It as parseRelationEdit, J as reservePreset, K as presetDirectory, L as questionView, Lt as parseThingEdit, M as WORLD_FILE_NAME, Mt as parseCharacterEdit, N as parseWorldFile, Nt as parseFactionEdit, Ot as parseChoices, Pt as parseLoreEdit, St as withPlayer, Tt as ImportStore, U as isPresetName, Ut as sourceSummary, V as createPresetFromShipped, W as listPresets, Y as savePresetFromWorld, Z as updatePresetInfo, an as parseCharacterFile, at as deleteLorebook, cn as LORE_SCOPES, ct as isLorebookName, dt as lorebookDirectory, et as listWorldPrompts, ht as writeLorebookEntry, it as createLorebook, jt as InvalidEditProblems, kt as readImportFolder, lt as listLorebooks, mt as updateLorebookInfo, nt as writeWorldPrompt, on as guarded, ot as deleteLorebookEntry, pt as reserveLorebook, rt as addLorebookEntries, sn as LORE_KINDS, st as entriesOf, tt as readWorldPrompt, ut as loadLorebook, vt as subfolders, wt as ImportNotFoundError, xt as partsOf, z as PRESET_FILE } from "./serial-CDGoXYh-.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-Bq0fzKi4.js";
7
+ import { B as questionView, Bt as parseThingEdit, Dt as ImportNotFoundError, Et as IMPORT_FOLDER, F as parseWorldInfoEdit, Ft as parseCharacterEdit, G as deletePreset, H as PRESET_FILE, It as parseFactionEdit, J as loadPreset, K as isPresetName, Kt as sourceSummary, Lt as parseLoreEdit, M as WORLD_FILE_NAME, Mt as readImportFolder, N as parseWorldFile, Ot as ImportStore, Pt as InvalidEditProblems, Q as savePresetFromWorld, Rt as parsePlaceEdit, Tt as withPlayer, W as createPresetFromShipped, Y as presetDirectory, Z as reservePreset, _t as updateLorebookInfo, at as writeWorldPrompt, cn as parseCharacterFile, ct as deleteLorebook, dn as LORE_SCOPES, dt as isLorebookName, et as updatePresetInfo, ft as listLorebooks, gt as reserveLorebook, it as readWorldPrompt, jt as parseChoices, ln as guarded, lt as deleteLorebookEntry, mt as lorebookDirectory, nt as deleteWorldPrompt, ot as addLorebookEntries, pt as loadLorebook, q as listPresets, rt as listWorldPrompts, st as createLorebook, un as LORE_KINDS, ut as entriesOf, vt as writeLorebookEntry, wt as partsOf, xt as subfolders, z as combineAnswers, zt as parseRelationEdit } from "./serial-ULGUKWsu.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-VbcXiukr.js";
9
9
  import { i as atomicWriteSync, n as atomicWrite, r as atomicWriteJson } from "./access-Csp80TFX.js";
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-DibpEUQK.js";
12
- import { n as readPreset, r as selectPrompts, t as previewPreset } from "./preset-RHcOG55T.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";
10
+ import { i as translator, r as languageOf$1, t as trimCharacters } from "./text-hiKTooVb.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-ByIQSOKC.js";
12
+ import { n as readPreset, r as selectPrompts, t as previewPreset } from "./preset-C595KRUM.js";
13
+ import { C as slug, T as uniqueKey, d as sceneImagePath, s as inheritImages, t as addToLibrary, u as referenceImagePath } from "./library-BmlHNCah.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-D-7EU3yU.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";
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-CzVh2ZNe.js";
17
+ import { a as uploadReferenceImage, t as generateReferenceImage } from "./generator-CTWQWbSW.js";
18
+ import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-Bu6eZMKk.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";
@@ -566,7 +566,7 @@ function lengthOf(text) {
566
566
  return (text.match(CJK)?.length ?? 0) + (text.replace(CJK, " ").match(/[\p{L}\p{N}]+/gu)?.length ?? 0);
567
567
  }
568
568
  /** Voices of the delivered turns on the way the story went: who spoke how often and how much, and what the narration came to. */
569
- function speakingOf(timeline) {
569
+ function speakingOf$1(timeline) {
570
570
  const voices = /* @__PURE__ */ new Map();
571
571
  const narration = {
572
572
  passages: 0,
@@ -631,7 +631,7 @@ function statisticsOfSession(deps, id) {
631
631
  ...first === void 0 || now === void 0 ? {} : { elapsedSeconds: Math.max(0, Math.round((now - first.to) / 1e3)) }
632
632
  },
633
633
  scenes: places.filter((place, index) => index === 0 || place !== places[index - 1]).length,
634
- ...speakingOf(timeline),
634
+ ...speakingOf$1(timeline),
635
635
  threads: {
636
636
  open: threads.filter((thread) => thread.status === "open").length,
637
637
  resolved: threads.filter((thread) => thread.status !== "open").length
@@ -6850,10 +6850,10 @@ async function startSession(deps, request) {
6850
6850
  const openingIndex = request.opening ?? answers.opening;
6851
6851
  const startingTimeAsked = request.startingTime?.trim() || answers.startingTime;
6852
6852
  if (openingIndex !== void 0 && (!Number.isInteger(openingIndex) || openingIndex < 0 || openingIndex >= (world.alternateOpenings?.length ?? 0))) throw new InvalidStartError(`the world has no alternate opening ${String(openingIndex)}`);
6853
- const opening = openingIndex === void 0 ? openingOf(world, authored) : [{
6853
+ const opening = openingIndex === void 0 ? openingOf(world, authored) : speakingOf(world, world.alternateOpenings[openingIndex].parts ?? [{
6854
6854
  type: "narration",
6855
6855
  text: world.alternateOpenings[openingIndex].text
6856
- }];
6856
+ }], authored, `alternate_openings[${openingIndex}]`);
6857
6857
  const keys = [...new Set(request.avatars ?? [])];
6858
6858
  if (keys.length > 0 && deps.avatars === void 0) throw new InvalidStartError("player avatars are not available");
6859
6859
  const avatars = keys.length === 0 ? void 0 : await deps.avatars();
@@ -6868,6 +6868,11 @@ async function startSession(deps, request) {
6868
6868
  path: `alternate_openings[${index}].character`,
6869
6869
  message: `"${entry.character}" is not a playable character of this world`
6870
6870
  }]);
6871
+ const speakerProblems = (world.alternateOpenings ?? []).flatMap((entry, index) => (entry.parts ?? []).flatMap((part) => part.type === "utterance" && !authored.some((character) => character.id === part.character) ? [{
6872
+ path: `alternate_openings[${index}].parts`,
6873
+ message: `"${part.character}" is not a character of this world`
6874
+ }] : []));
6875
+ openingProblems.push(...speakerProblems);
6871
6876
  if (openingProblems.length > 0) throw new InvalidWorldError(`the alternate openings of "${world.summary.name}" have ${openingProblems.length} problem(s)`, openingProblems);
6872
6877
  const forCharacter = openingIndex === void 0 ? void 0 : world.alternateOpenings[openingIndex].character;
6873
6878
  if (forCharacter !== void 0 && forCharacter !== player.id) throw new InvalidStartError(`this opening is for ${authored.find((character) => character.id === forCharacter)?.name ?? forCharacter}, not for ${player.name}`);
@@ -7058,19 +7063,15 @@ function presetFor(deps, asked, suggested) {
7058
7063
  return { unavailable: [`The world suggests the preset "${name}", which cannot be used here (${reason}), so the story is told in the default style.`] };
7059
7064
  }
7060
7065
  }
7061
- /** The opening of the world with each speaker's name, or the reason it cannot be used. */
7062
- function openingOf(world, characters) {
7063
- if (world.opening === void 0) return [{
7064
- type: "narration",
7065
- text: DEFAULT_OPENING
7066
- }];
7066
+ /** The parts of an opening with each speaker's name, or the reason it cannot be used: a speaker the world does not have. */
7067
+ function speakingOf(world, parts, characters, where) {
7067
7068
  const problems = [];
7068
- const segments = world.opening.map((segment) => {
7069
+ const segments = parts.map((segment) => {
7069
7070
  if (segment.type === "narration") return segment;
7070
7071
  const speaker = characters.find((character) => character.id === segment.character);
7071
7072
  if (speaker === void 0) problems.push({
7072
7073
  path: join(world.directory, WORLD_FILE_NAME),
7073
- message: `opening_message: "${segment.character}" is not a character of this world`
7074
+ message: `${where}: "${segment.character}" is not a character of this world`
7074
7075
  });
7075
7076
  return {
7076
7077
  type: "utterance",
@@ -7082,6 +7083,14 @@ function openingOf(world, characters) {
7082
7083
  if (problems.length > 0) throw new InvalidWorldError(`the opening of "${world.summary.name}" has ${problems.length} problem(s)`, problems);
7083
7084
  return segments;
7084
7085
  }
7086
+ /** The opening of the world with each speaker's name, or the reason it cannot be used. */
7087
+ function openingOf(world, characters) {
7088
+ if (world.opening === void 0) return [{
7089
+ type: "narration",
7090
+ text: DEFAULT_OPENING
7091
+ }];
7092
+ return speakingOf(world, world.opening, characters, "opening_message");
7093
+ }
7085
7094
  // src/host/sessions/rename-session.ts
7086
7095
  /**
7087
7096
  * Give a session a new name, and its chat the same one.
@@ -1,5 +1,5 @@
1
1
  import { n as atomicWrite } from "./access-Csp80TFX.js";
2
- import { i as translator, n as withoutExtension, r as languageOf, t as trimCharacters } from "./text-Dfv8S8eq.js";
2
+ import { i as translator, n as withoutExtension, r as languageOf, t as trimCharacters } from "./text-hiKTooVb.js";
3
3
  import { dirname, extname, join } from "node:path";
4
4
  import { existsSync } from "node:fs";
5
5
  import { createHash } from "node:crypto";
@@ -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-DTxakw0z.js.map
377
+ //# sourceMappingURL=library-BmlHNCah.js.map
@@ -1,9 +1,9 @@
1
1
  import "./access-Csp80TFX.js";
2
- import { Ht as ImportCardError, o as contextOf, r as MAX_PREVIEW_TEXT } from "./authoring-tools-hacA5fG-.js";
3
- import { B as createPresetFromGuidance, Ct as IMPORT_FOLDER, St as withPlayer, cn as LORE_SCOPES, dt as lorebookDirectory, ft as readLorebook$1, ht as writeLorebookEntry, mt as updateLorebookInfo, ot as deleteLorebookEntry, sn as LORE_KINDS, st as entriesOf, ut as loadLorebook, xt as partsOf, yt as cleanText } from "./serial-CDGoXYh-.js";
4
- import { F as textLanguage, I as wrongLanguage, at as shippedPromptsDirectory } from "./hooks-DlrFO4aQ.js";
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-DTxakw0z.js";
2
+ import { Wt as ImportCardError, o as contextOf, r as MAX_PREVIEW_TEXT } from "./authoring-tools-B_qYKK8c.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-ULGUKWsu.js";
4
+ import { F as textLanguage, I as wrongLanguage, at as shippedPromptsDirectory } from "./hooks-YXQZ9G2d.js";
5
+ import { i as translator, r as languageOf } from "./text-hiKTooVb.js";
6
+ import { C as slug, T as uniqueKey, w as trOf, x as mapLimit } from "./library-BmlHNCah.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-dupq-kb_.js.map
712
+ //# sourceMappingURL=lorebook-author-tools-C3rRpMt7.js.map
@@ -1,9 +1,9 @@
1
- import { n as limitAuthoringAgents } from "./authoring-tools-hacA5fG-.js";
2
- import { t as guardAuthoringTurns } from "./turn-guard-DDxikrq7.js";
1
+ import { n as limitAuthoringAgents } from "./authoring-tools-B_qYKK8c.js";
2
+ import { t as guardAuthoringTurns } from "./turn-guard-DXMeAJdv.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-dupq-kb_.js";
5
- import "./hooks-DlrFO4aQ.js";
6
- import { dt as lorebookDirectory } from "./serial-CDGoXYh-.js";
4
+ import { d as lorebookOfChat, i as lorebookAuthorTools, n as LorebookReader, o as pendingTargets, r as lorebookApproval } from "./lorebook-author-tools-C3rRpMt7.js";
5
+ import "./hooks-YXQZ9G2d.js";
6
+ import { mt as lorebookDirectory } from "./serial-ULGUKWsu.js";
7
7
  import { join } from "node:path";
8
8
  import { existsSync, readdirSync } from "node:fs";
9
9
  // src/lorebook-authoring.ts
@@ -1,17 +1,17 @@
1
1
  import { t as silenceHarnessDevContext } from "./dev-context-Cgv_wZbG.js";
2
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 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-DlrFO4aQ.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-YXQZ9G2d.js";
4
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-DibpEUQK.js";
6
- import { A as routeVerdicts, E as askYesNo, O as modeFor, T as announceProblem, Vt as splitPanels, dn as INTENT_STATUSES, j as yesAt, k as noAt, n as STANDING_PROMPT, on as guarded } from "./serial-CDGoXYh-.js";
7
- import { i as translator, r as languageOf$1 } from "./text-Dfv8S8eq.js";
5
+ import { a as whereabouts, n as memoryReflector, r as recordFailure, s as Timelines, t as dueReflection } from "./reflection-ByIQSOKC.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-ULGUKWsu.js";
7
+ import { i as translator, r as languageOf$1 } from "./text-hiKTooVb.js";
8
8
  import { a as liveSettings, g as GATE_SITES, n as encodeOutput } from "./narration--K2XVIHI.js";
9
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-DTxakw0z.js";
12
- import { _ as API_PREFIX } from "./packs-D-7EU3yU.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";
11
+ import { C as slug, T as uniqueKey, t as addToLibrary } from "./library-BmlHNCah.js";
12
+ import { _ as API_PREFIX } from "./packs-CzVh2ZNe.js";
13
+ import { i as updateImage, r as listGallery, t as describeGalleryImage } from "./gallery-Bu6eZMKk.js";
14
+ import { c as presentedFor, i as findImages, n as interpretImage, s as present, t as runImagePresenter } from "./presenter-agent-CF3fneuJ.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
1
  import { A as chatSessionId } from "./child-DTdY14S9.js";
2
- import { A as loadWorldParts, At as UPDATE_FOLDER, Bt as TRIGGERS_FILE_NAME, Ct as loadDice, D as worldFieldChanges, Dt as parseCalendarFile, Et as loadCalendar, F as editsSince, G as addressesToFetch, I as writeSnapshot, It as COMMANDS_FILE_NAME, Jt as DICE_READINGS, K as candidateUrls, Lt as commandVariable, Mt as cardPieces, O as editWorldInfo, Ot as CHARACTERS_DIR, P as recordProvenance, Q as writePortrait, Rt as loadCommands, St as DICE_FILE_NAME, T as matchPieces, Tt as CALENDAR_FILE_NAME, Vt as loadTriggers, W as addressKey, Xt as authoredWorldOf, Y as mergeReports, Yt as DICE_RESULTS, Z as cardCharacter, Zt as authoringChatSessionId, _t as loadLocations, bt as FACTIONS_DIR, et as loadValidatedWorld, f as importPhase, gt as LOCATIONS_DIR, ht as routineProblems, jt as baseId, kt as loadCharacters, nt as knowsCharacter, o as contextOf, q as fetchPictures, qt as DICE_COMPARISONS, tt as withScratchStory, u as worldOf, vt as ITEMS_DIR, wt as parseDiceFile, xt as loadFactions, yt as loadItems, zt as parseCommandsFile } from "./authoring-tools-hacA5fG-.js";
3
- import { At as writeChoices, Ct as IMPORT_FOLDER, Et as PICTURE_FILE, Gt as loadVariables, Jt as LORE_FILE_NAME, Kt as parseVariablesFile, M as WORLD_FILE_NAME, N as parseWorldFile, Qt as ITEM_FILE_NAME, St as withPlayer, Wt as VARIABLES_FILE_NAME, Xt as LOCATION_FILE_NAME, Yt as parseLoreFile, Zt as parseLocationFile, _t as loadLore, an as parseCharacterFile, en as parseItemFile, gt as LORE_DIR, in as CHARACTER_FILE_NAME, jt as InvalidEditProblems, kt as readImportFolder, l as extractStyleFrom, nn as FACTION_FILE_NAME, nt as writeWorldPrompt, qt as variableProblems, rn as parseFactionFile, vt as subfolders } from "./serial-CDGoXYh-.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-B_qYKK8c.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-ULGUKWsu.js";
4
4
  import { n as encodeOutput } from "./narration--K2XVIHI.js";
5
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, 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-DlrFO4aQ.js";
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-DTxakw0z.js";
9
- import { n as readPreset } from "./preset-RHcOG55T.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-D-7EU3yU.js";
11
- import { a as uploadReferenceImage, t as generateReferenceImage } from "./generator-9-5at9cZ.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-YXQZ9G2d.js";
7
+ import { i as translator, r as languageOf } from "./text-hiKTooVb.js";
8
+ import { h as readImageFileMetadata, u as referenceImagePath, x as mapLimit } from "./library-BmlHNCah.js";
9
+ import { n as readPreset } from "./preset-C595KRUM.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-CzVh2ZNe.js";
11
+ import { a as uploadReferenceImage, t as generateReferenceImage } from "./generator-CTWQWbSW.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";
@@ -889,6 +889,7 @@ const FIELDS$1 = {
889
889
  "opening_message[].text",
890
890
  "alternate_openings[].title",
891
891
  "alternate_openings[].text",
892
+ "alternate_openings[].parts[].text",
892
893
  "start_questions[].text",
893
894
  "start_questions[].options[].label",
894
895
  "start_questions[].options[].description",
@@ -3226,4 +3227,4 @@ function registerPackJail(ctx, deps) {
3226
3227
  }
3227
3228
  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 };
3228
3229
 
3229
- //# sourceMappingURL=pack-jail-Bq0fzKi4.js.map
3230
+ //# sourceMappingURL=pack-jail-VbcXiukr.js.map
@@ -1,4 +1,4 @@
1
- import { K as Reader } from "./hooks-DlrFO4aQ.js";
1
+ import { K as Reader } from "./hooks-YXQZ9G2d.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-D-7EU3yU.js.map
839
+ //# sourceMappingURL=packs-CzVh2ZNe.js.map
@@ -1,8 +1,8 @@
1
1
  import { n as atomicWrite, t as promptFor } from "./access-Csp80TFX.js";
2
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";
3
+ import { n as generateTransientImage, t as generateReferenceImage } from "./generator-CTWQWbSW.js";
4
+ import { i as updateImage, n as galleryFile, r as listGallery } from "./gallery-Bu6eZMKk.js";
5
+ import { c as nextSceneSerial, u as referenceImagePath } from "./library-BmlHNCah.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-vFOxIuWv.js.map
847
+ //# sourceMappingURL=presenter-agent-CF3fneuJ.js.map
@@ -1,6 +1,6 @@
1
- import { Ht as ImportCardError, r as MAX_PREVIEW_TEXT } from "./authoring-tools-hacA5fG-.js";
1
+ import { Wt as ImportCardError, r as MAX_PREVIEW_TEXT } from "./authoring-tools-B_qYKK8c.js";
2
2
  import { p as SAMPLING_RANGES } from "./child-DTdY14S9.js";
3
- import { yt as cleanText } from "./serial-CDGoXYh-.js";
3
+ import { St as cleanText } from "./serial-ULGUKWsu.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-RHcOG55T.js.map
242
+ //# sourceMappingURL=preset-C595KRUM.js.map
@@ -1,9 +1,9 @@
1
1
  import "./access-Csp80TFX.js";
2
- import { $ as deleteWorldPrompt, Ct as IMPORT_FOLDER, K as presetDirectory, Q as PROSE_PROMPTS, St as withPlayer, Z as updatePresetInfo, et as listWorldPrompts, l as extractStyleFrom, nt as writeWorldPrompt, q as readPreset, tt as readWorldPrompt, z as PRESET_FILE } from "./serial-CDGoXYh-.js";
3
- import { n as readPreset$1 } from "./preset-RHcOG55T.js";
4
- import { o as contextOf } from "./authoring-tools-hacA5fG-.js";
5
- import { i as translator, r as languageOf } from "./text-Dfv8S8eq.js";
6
- import { at as shippedPromptsDirectory, it as shippedLanguages, tt as languageOf$1 } from "./hooks-DlrFO4aQ.js";
2
+ import { Et as IMPORT_FOLDER, H as PRESET_FILE, Tt as withPlayer, X as readPreset, Y as presetDirectory, at as writeWorldPrompt, et as updatePresetInfo, it as readWorldPrompt, l as extractStyleFrom, nt as deleteWorldPrompt, rt as listWorldPrompts, tt as PROSE_PROMPTS } from "./serial-ULGUKWsu.js";
3
+ import { n as readPreset$1 } from "./preset-C595KRUM.js";
4
+ import { o as contextOf } from "./authoring-tools-B_qYKK8c.js";
5
+ import { i as translator, r as languageOf } from "./text-hiKTooVb.js";
6
+ import { at as shippedPromptsDirectory, it as shippedLanguages, tt as languageOf$1 } from "./hooks-YXQZ9G2d.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-Dwxnpv6V.js.map
282
+ //# sourceMappingURL=preset-author-tools-CF_JKKTE.js.map
@@ -1,9 +1,9 @@
1
- import { n as limitAuthoringAgents } from "./authoring-tools-hacA5fG-.js";
2
- import { t as guardAuthoringTurns } from "./turn-guard-DDxikrq7.js";
1
+ import { n as limitAuthoringAgents } from "./authoring-tools-B_qYKK8c.js";
2
+ import { t as guardAuthoringTurns } from "./turn-guard-DXMeAJdv.js";
3
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-Dwxnpv6V.js";
5
- import "./hooks-DlrFO4aQ.js";
6
- import { K as presetDirectory } from "./serial-CDGoXYh-.js";
4
+ import { i as presetAuthorTools, o as presetOfChat, r as presetApproval, t as PresetReader } from "./preset-author-tools-CF_JKKTE.js";
5
+ import "./hooks-YXQZ9G2d.js";
6
+ import { Y as presetDirectory } from "./serial-ULGUKWsu.js";
7
7
  import { join } from "node:path";
8
8
  import { existsSync } from "node:fs";
9
9
  // src/preset-authoring.ts
@@ -1,10 +1,10 @@
1
1
  import { O as estimateAnswer, a as childTrace, j as roleplaySessionOf, l as runChild, n as childModel, r as childSampling } from "./child-DTdY14S9.js";
2
- import { A as routeVerdicts, D as mergeReports, E as askYesNo, G as loadPreset, T as announceProblem, W as listPresets, X as sha, j as yesAt, k as noAt, t as SerialQueue } from "./serial-CDGoXYh-.js";
2
+ import { $ as sha, A as routeVerdicts, D as mergeReports, E as askYesNo, J as loadPreset, T as announceProblem, j as yesAt, k as noAt, q as listPresets, t as SerialQueue } from "./serial-ULGUKWsu.js";
3
3
  import { t as promptFor } from "./access-Csp80TFX.js";
4
- import { D as referent, I as wrongLanguage, Z as PROMPTS_FOLDER, et as inheritPrompts, vt as describeWhen } from "./hooks-DlrFO4aQ.js";
5
- import { i as translator, r as languageOf } from "./text-Dfv8S8eq.js";
6
- import { s as inheritImages } from "./library-DTxakw0z.js";
7
- import { i as inheritPacks } from "./packs-D-7EU3yU.js";
4
+ import { D as referent, I as wrongLanguage, Z as PROMPTS_FOLDER, et as inheritPrompts, vt as describeWhen } from "./hooks-YXQZ9G2d.js";
5
+ import { i as translator, r as languageOf } from "./text-hiKTooVb.js";
6
+ import { s as inheritImages } from "./library-BmlHNCah.js";
7
+ import { i as inheritPacks } from "./packs-CzVh2ZNe.js";
8
8
  import { dirname, join } from "node:path";
9
9
  import { characterKey, locationKey, sessionDatabase, sessionFolder, tokens } from "@dsh-agentic-roleplay/state";
10
10
  import { copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
@@ -1504,4 +1504,4 @@ function memoryReflector(deps) {
1504
1504
  }
1505
1505
  export { snapshotOf as _, whereabouts as a, copyPreset as c, switchPreset as d, readTimeline as f, pathTo as g, childrenOf as h, reflectionStatus as i, presetStatus as l, START_SNAPSHOT as m, memoryReflector as n, TimelineError as o, writeTimeline as p, recordFailure as r, Timelines as s, dueReflection as t, recordPreset as u };
1506
1506
 
1507
- //# sourceMappingURL=reflection-DibpEUQK.js.map
1507
+ //# sourceMappingURL=reflection-ByIQSOKC.js.map