@dsh-agentic-roleplay/core 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as chatSessionId, i as VARIABLE_VISIBILITIES, n as VARIABLE_KINDS, o as roleplaySessionOf, r as VARIABLE_SUBJECTS } from "./access-DtOxFKBK.js";
2
- import { A as loadDice, At as InvalidEditProblems, Bt as pictureOf, C as populateRoutines, Ct as updateLorebookInfo, D as TRIGGERS_FILE_NAME, E as routineProblems, Ft as parseRelationEdit, G as partsOf, Gt as DICE_READINGS, H as loadCharacters, Ht as LORE_KINDS, I as loadLocations, It as parseThingEdit, J as loadVariables, Jt as authoringChatSessionId, K as withPlayer, Kt as DICE_RESULTS, Lt as IMPORT_COMMAND, M as CALENDAR_FILE_NAME, Mt as parseFactionEdit, N as loadCalendar, Nt as parseLoreEdit, P as parseCalendarFile, Pt as parsePlaceEdit, R as loadItems, Rt as ImportCardError, S as populateLore, St as reserveLorebook, T as populateVariables, Ut as LORE_SCOPES, V as CHARACTERS_DIR, Vt as readCard, Wt as DICE_COMPARISONS, X as variableProblems, Y as parseVariablesFile, _ as populateDice, _t as isLorebookName, at as IMPORT_FOLDER, b as populateKnowledge, bt as lorebookDirectory, ct as parseChoices, d as vetUrl, dt as parseWorldInfoEdit, f as loadValidatedWorld, ft as addLorebookEntries, g as populateClock, gt as entriesOf, h as populateCharacters, ht as deleteLorebookEntry, it as parseCharacterFile, j as parseDiceFile, jt as parseCharacterEdit, k as DICE_FILE_NAME, kt as subfolders, l as markReady, lt as WORLD_FILE_NAME, m as populateCalendar, mt as deleteLorebook, ot as ImportNotFoundError, p as knowsCharacter, pt as createLorebook, q as VARIABLES_FILE_NAME, qt as authoredWorldOf, rt as CHARACTER_FILE_NAME, st as ImportStore, t as AuthoringTools, u as guardedLookup, ut as parseWorldFile, v as populateFactions, vt as listLorebooks, w as populateTriggers, wt as writeLorebookEntry, x as populateLocations, y as populateItems, yt as loadLorebook, zt as isPng } from "./authoring-tools-BKltdiea.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-BAnUyRtS.js";
4
- import { a as presetChatSessionId, n as narrationImportMessage, o as presetOfChat } from "./preset-author-tools-C26kj6t5.js";
2
+ import { $ as variableProblems, A as loadDice, Bt as parseThingEdit, C as populateRoutines, Ct as loadLorebook, D as TRIGGERS_FILE_NAME, Dt as updateLorebookInfo, E as routineProblems, Et as reserveLorebook, Ft as parseCharacterEdit, Gt as readCard, H as loadCharacters, Ht as ImportCardError, I as loadLocations, It as parseFactionEdit, J as partsOf, Jt as DICE_COMPARISONS, Kt as LORE_KINDS, Lt as parseLoreEdit, M as CALENDAR_FILE_NAME, N as loadCalendar, Nt as subfolders, Ot as writeLorebookEntry, P as parseCalendarFile, Pt as InvalidEditProblems, Q as parseVariablesFile, Qt as authoringChatSessionId, R as loadItems, Rt as parsePlaceEdit, S as populateLore, St as listLorebooks, T as populateVariables, Ut as isPng, V as CHARACTERS_DIR, Vt as IMPORT_COMMAND, Wt as pictureOf, X as VARIABLES_FILE_NAME, Xt as DICE_RESULTS, Y as withPlayer, Yt as DICE_READINGS, Z as loadVariables, Zt as authoredWorldOf, _ as populateDice, _t as createLorebook, b as populateKnowledge, bt as entriesOf, ct as IMPORT_FOLDER, d as vetUrl, dt as parseChoices, f as loadValidatedWorld, g as populateClock, gt as addLorebookEntries, h as populateCharacters, ht as parseWorldInfoEdit, j as parseDiceFile, k as DICE_FILE_NAME, l as markReady, lt as ImportNotFoundError, m as populateCalendar, mt as parseWorldFile, ot as CHARACTER_FILE_NAME, p as knowsCharacter, pt as WORLD_FILE_NAME, qt as LORE_SCOPES, st as parseCharacterFile, t as AuthoringTools, u as guardedLookup, ut as ImportStore, v as populateFactions, vt as deleteLorebook, w as populateTriggers, wt as lorebookDirectory, x as populateLocations, xt as isLorebookName, y as populateItems, yt as deleteLorebookEntry, zt as parseRelationEdit } from "./authoring-tools-q34iq3hW.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-D9RrMK5g.js";
4
+ import { a as presetChatSessionId, n as narrationImportMessage, o as presetOfChat } from "./preset-author-tools-8kv1Glxe.js";
5
5
  import { C as readWorldPrompt, S as listWorldPrompts, _ as savePresetFromWorld, d as isPresetName, f as listPresets, g as reservePreset, l as createPresetFromShipped, m as presetDirectory, p as loadPreset, s as PRESET_FILE, u as deletePreset, w as writeWorldPrompt, x as deleteWorldPrompt, y as updatePresetInfo } from "./route-DRTJ_vcA.js";
6
6
  import { c as copyPreset, d as switchPreset, f as readTimeline, h as defaultBoundaries, i as reflectionStatus, l as presetStatus, m as pathTo, o as TimelineError, p as writeTimeline, u as recordPreset } from "./reflection-CvOZGjmn.js";
7
7
  import { a as liveSettings, c as writeSettings, d as parseSettings, i as InvalidSettingsError, l as DEFAULT_SETTINGS, n as encodeOutput, o as readSettings, p as WORLD_RULES_KEY, s as useChildReasoning, u as SETTINGS_SPEC } from "./narration-DvFBqmqe.js";
@@ -9,8 +9,8 @@ import { C as readNotes, G as formatIssue, H as plotReferenceProblems, K as erro
9
9
  import { i as translator, r as languageOf$1, t as trimCharacters } from "./text-JbWfTHbr.js";
10
10
  import { d as sharedSamplingOf, i as childSamplingOf, u as parseSampling } from "./child-CyCViUKa.js";
11
11
  import { S as uniqueKey, a as inheritImages, b as slug, c as referenceImagePath, l as sceneImagePath, t as addToLibrary } from "./library-BGxPKs9a.js";
12
- import { A as worldEntityImageFile, B as readWorldInfo, C as readWorldEditor, D as uploadWorldCharacterPortrait, E as replaceFile, F as loadWorldParts, I as PRESET_FILE$1, L as presetMessage, O as uploadWorldEntityImage, S as generateWorldEntityImage, T as removeWorldTrigger, U as languageOfDocuments, V as translateMessage, W as readWorldDocuments, _ as editWorldPlots$1, a as deleteWorldPackFile, b as entityFolder, c as createAuthoredEntity, f as editWorldCharacter$1, g as editWorldPlace$1, h as editWorldNarrationVoice, j as writeWorldTrigger, k as worldCharacterPortraitFile, l as deleteAuthoredEntity, m as editWorldLore$1, n as packFileProblem, p as editWorldFaction$1, t as MAX_PACK_TEXT, u as readAuthoredEntityDocument, v as editWorldRelation$1, w as readWorldTrigger, x as generateWorldCharacterPortrait, y as editWorldThing$1, z as editWorldInfo } from "./pack-jail-DLGguGS3.js";
13
- import { n as readPreset, r as selectPrompts, t as previewPreset } from "./preset-CXbC0NeU.js";
12
+ import { A as worldEntityImageFile, B as readWorldInfo, C as readWorldEditor, D as uploadWorldCharacterPortrait, E as replaceFile, F as loadWorldParts, I as PRESET_FILE$1, L as presetMessage, O as uploadWorldEntityImage, S as generateWorldEntityImage, T as removeWorldTrigger, U as languageOfDocuments, V as translateMessage, W as readWorldDocuments, _ as editWorldPlots$1, a as deleteWorldPackFile, b as entityFolder, c as createAuthoredEntity, f as editWorldCharacter$1, g as editWorldPlace$1, h as editWorldNarrationVoice, j as writeWorldTrigger, k as worldCharacterPortraitFile, l as deleteAuthoredEntity, m as editWorldLore$1, n as packFileProblem, p as editWorldFaction$1, t as MAX_PACK_TEXT, u as readAuthoredEntityDocument, v as editWorldRelation$1, w as readWorldTrigger, x as generateWorldCharacterPortrait, y as editWorldThing$1, z as editWorldInfo } from "./pack-jail-MPekqSuQ.js";
13
+ import { n as readPreset, r as selectPrompts, t as previewPreset } from "./preset-VatN-845.js";
14
14
  import { t as doctorChatSessionId } from "./doctor-chat-ByDfCMeo.js";
15
15
  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-jowC-MN_.js";
16
16
  import { a as uploadReferenceImage, t as generateReferenceImage } from "./generator-BFmSYvR8.js";
@@ -3090,7 +3090,7 @@ function languageField(value) {
3090
3090
  throw new InvalidEditProblems([error instanceof Error ? error.message : String(error)]);
3091
3091
  }
3092
3092
  }
3093
- function createApiHandler({ catalogue, worlds, createWorld, starter, authorWorld, translation, worldCharacters, importer, avatars, worldFiles, worldEditor, sessions, packs, presets, lorebooks, sync, locked, anyLocked, connection, speech, externalTools }) {
3093
+ function createApiHandler({ catalogue, worlds, createWorld, starter, authorWorld, translation, worldCharacters, importer, avatars, worldFiles, worldEditor, sessions, packs, presets, lorebooks, sync, locked, anyLocked, connection, speech, externalTools, redundantLayers }) {
3094
3094
  const routes = {
3095
3095
  "/speech/capabilities": { GET: async (_req, res) => {
3096
3096
  sendJson(res, 200, { streaming: speech.streaming() });
@@ -4162,6 +4162,9 @@ function createApiHandler({ catalogue, worlds, createWorld, starter, authorWorld
4162
4162
  }
4163
4163
  await sendImage(res, image);
4164
4164
  } },
4165
+ "/setup": { GET: async (_req, res) => {
4166
+ sendJson(res, 200, { redundantLayers: redundantLayers?.() ?? [] });
4167
+ } },
4165
4168
  "/tools": { GET: async (_req, res) => {
4166
4169
  sendJson(res, 200, { tools: externalTools?.() ?? [] });
4167
4170
  } },
@@ -4651,6 +4654,35 @@ function purgeDepsOf(ctx, storePath) {
4651
4654
  }
4652
4655
  const purgeOf = (ctx, storePath) => (chat) => purgeChat(purgeDepsOf(ctx, storePath), chat);
4653
4656
  //#endregion
4657
+ //#region src/host/setup/rows.ts
4658
+ const ALL = ["@dsh-agentic-roleplay/all", "dsh-agentic-roleplay"];
4659
+ const SINGLE = [
4660
+ "@dsh-agentic-roleplay/core",
4661
+ "@dsh-agentic-roleplay/state",
4662
+ "dsh-agentic-roleplay-core",
4663
+ "dsh-roleplay-state"
4664
+ ];
4665
+ /** The bundle layers the profile has selected, in order; none when the profile cannot be read. */
4666
+ function selectedBundles(profileDir) {
4667
+ if (profileDir === void 0) return [];
4668
+ try {
4669
+ const bundles = JSON.parse(readFileSync(join(profileDir, "package.json"), "utf8")).dsh?.profile?.bundles;
4670
+ return Array.isArray(bundles) ? bundles.filter((name) => typeof name === "string") : [];
4671
+ } catch {
4672
+ return [];
4673
+ }
4674
+ }
4675
+ /**
4676
+ * The layers of single packages that are selected next to the `all` layer. Each of them inserts the same plugin row as `all`, so the profile then holds the row twice
4677
+ * and DSH, which writes a plugin's settings through its row, refuses every save of Settings → Role Play.
4678
+ */
4679
+ function redundantLayers(bundles) {
4680
+ return bundles.some((name) => ALL.includes(name)) ? bundles.filter((name) => SINGLE.includes(name)) : [];
4681
+ }
4682
+ function redundantLayersMessage(layers) {
4683
+ return `the profile selects ${layers.map((name) => `"${name}"`).join(", ")} next to the all bundle, which already inserts the same plugin rows, so DSH refuses to save the Role Play settings: deselect them (keep the packages installed) and restart`;
4684
+ }
4685
+ //#endregion
4654
4686
  //#region src/host/worlds/daily-life.ts
4655
4687
  /** The day each character lives, and the places its windows may name. */
4656
4688
  async function readRoutines(world) {
@@ -8623,7 +8655,8 @@ const Config = z.object({
8623
8655
  importTemperature: z.number().min(0).max(2).default(.2).volatile(),
8624
8656
  importTimeoutMinutes: z.number().min(0).max(240).default(15).volatile(),
8625
8657
  importDecisions: z.union([z.const("llm"), z.const("decision")]).default("llm").volatile(),
8626
- importConfidence: z.number().min(0).max(1).default(.7).volatile()
8658
+ importConfidence: z.number().min(0).max(1).default(.7).volatile(),
8659
+ authoringApproval: z.union([z.const("ask"), z.const("auto")]).default("ask").volatile()
8627
8660
  });
8628
8661
  //#endregion
8629
8662
  //#region src/index.ts
@@ -8631,6 +8664,9 @@ const name = "@dsh-agentic-roleplay/core";
8631
8664
  /** Sessions are kept by the state plugin, which the bundle installs with this one. */
8632
8665
  const inject = ["roleplayState"];
8633
8666
  function apply(ctx, config) {
8667
+ const layers = () => redundantLayers(selectedBundles(ctx.get("profileContext")?.dir));
8668
+ const repeated = layers();
8669
+ if (repeated.length > 0) ctx.logger.error(redundantLayersMessage(repeated));
8634
8670
  ctx.inject(["aiProviders"], (scope) => {
8635
8671
  const providers = Reflect.get(scope, "aiProviders");
8636
8672
  scope.effect(() => providers.policy(({ options }) => {
@@ -8682,7 +8718,8 @@ function apply(ctx, config) {
8682
8718
  temperature: config.importTemperature.get(),
8683
8719
  timeoutMinutes: config.importTimeoutMinutes.get(),
8684
8720
  decisions: config.importDecisions.get() === "decision" ? "decision" : "llm",
8685
- confidence: config.importConfidence.get()
8721
+ confidence: config.importConfidence.get(),
8722
+ approval: config.authoringApproval.get() === "auto" ? "auto" : "ask"
8686
8723
  }));
8687
8724
  const settingsDeps = {
8688
8725
  sessionsDir: () => join(root.path, "sessions"),
@@ -8868,6 +8905,7 @@ function apply(ctx, config) {
8868
8905
  return await addAvatarsToWorld(await avatarsWorld(root.path), world, keys, locations);
8869
8906
  }
8870
8907
  },
8908
+ redundantLayers: layers,
8871
8909
  externalTools: () => {
8872
8910
  const registry = ctx.get("tools");
8873
8911
  return registry === void 0 ? [] : externalTools(registry);
@@ -1,5 +1,5 @@
1
1
  import "./access-DtOxFKBK.js";
2
- import { Ct as updateLorebookInfo, G as partsOf, Ht as LORE_KINDS, K as withPlayer, Rt as ImportCardError, Ut as LORE_SCOPES, W as cleanText, at as IMPORT_FOLDER, bt as lorebookDirectory, gt as entriesOf, ht as deleteLorebookEntry, i as contextOf, r as MAX_PREVIEW_TEXT, wt as writeLorebookEntry, xt as readLorebook$1, yt as loadLorebook } from "./authoring-tools-BKltdiea.js";
2
+ import { Ct as loadLorebook, Dt as updateLorebookInfo, Ht as ImportCardError, J as partsOf, K as cleanText, Kt as LORE_KINDS, Ot as writeLorebookEntry, Tt as readLorebook$1, Y as withPlayer, bt as entriesOf, ct as IMPORT_FOLDER, i as contextOf, qt as LORE_SCOPES, r as MAX_PREVIEW_TEXT, wt as lorebookDirectory, yt as deleteLorebookEntry } from "./authoring-tools-q34iq3hW.js";
3
3
  import { c as createPresetFromGuidance } from "./route-DRTJ_vcA.js";
4
4
  import { nt as shippedPromptsDirectory } from "./hooks-HnqXO8mM.js";
5
5
  import { i as translator, r as languageOf } from "./text-JbWfTHbr.js";
@@ -699,4 +699,4 @@ async function lorebookApproval(exec, next, state) {
699
699
  //#endregion
700
700
  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 };
701
701
 
702
- //# sourceMappingURL=lorebook-author-tools-BAnUyRtS.js.map
702
+ //# sourceMappingURL=lorebook-author-tools-D9RrMK5g.js.map
@@ -1,5 +1,5 @@
1
- import { bt as lorebookDirectory, n as limitAuthoringAgents } from "./authoring-tools-BKltdiea.js";
2
- import { d as lorebookOfChat, i as lorebookAuthorTools, n as LorebookReader, o as pendingTargets, r as lorebookApproval } from "./lorebook-author-tools-BAnUyRtS.js";
1
+ import { n as limitAuthoringAgents, wt as lorebookDirectory } from "./authoring-tools-q34iq3hW.js";
2
+ import { d as lorebookOfChat, i as lorebookAuthorTools, n as LorebookReader, o as pendingTargets, r as lorebookApproval } from "./lorebook-author-tools-D9RrMK5g.js";
3
3
  import "./hooks-HnqXO8mM.js";
4
4
  import { t as guardAuthoringTurns } from "./turn-guard-BvCs1VxB.js";
5
5
  import { join } from "node:path";
@@ -1,12 +1,12 @@
1
1
  import "./access-DtOxFKBK.js";
2
- import { $ as ITEM_FILE_NAME, At as InvalidEditProblems, B as loadFactions, D as TRIGGERS_FILE_NAME, Dt as LORE_FILE_NAME, Et as loadLore, F as LOCATIONS_DIR, H as loadCharacters, I as loadLocations, J as loadVariables, K as withPlayer, L as ITEMS_DIR, N as loadCalendar, O as loadTriggers, Ot as parseLoreFile, Q as parseLocationFile, R as loadItems, T as populateVariables, Tt as LORE_DIR, U as extractStyleFrom, V as CHARACTERS_DIR, Z as LOCATION_FILE_NAME, at as IMPORT_FOLDER, et as parseItemFile, f as loadValidatedWorld, h as populateCharacters, i as contextOf, it as parseCharacterFile, kt as subfolders, lt as WORLD_FILE_NAME, nt as parseFactionFile, p as knowsCharacter, qt as authoredWorldOf, rt as CHARACTER_FILE_NAME, s as worldOf, tt as FACTION_FILE_NAME, ut as parseWorldFile, x as populateLocations, y as populateItems, z as FACTIONS_DIR } from "./authoring-tools-BKltdiea.js";
2
+ import { At as loadLore, B as loadFactions, D as TRIGGERS_FILE_NAME, F as LOCATIONS_DIR, H as loadCharacters, I as loadLocations, L as ITEMS_DIR, Mt as parseLoreFile, N as loadCalendar, Nt as subfolders, O as loadTriggers, Pt as InvalidEditProblems, R as loadItems, T as populateVariables, U as extractStyleFrom, V as CHARACTERS_DIR, Y as withPlayer, Z as loadVariables, Zt as authoredWorldOf, at as parseFactionFile, ct as IMPORT_FOLDER, et as LOCATION_FILE_NAME, f as loadValidatedWorld, h as populateCharacters, i as contextOf, it as FACTION_FILE_NAME, jt as LORE_FILE_NAME, kt as LORE_DIR, mt as parseWorldFile, nt as ITEM_FILE_NAME, ot as CHARACTER_FILE_NAME, p as knowsCharacter, pt as WORLD_FILE_NAME, rt as parseItemFile, s as worldOf, st as parseCharacterFile, tt as parseLocationFile, x as populateLocations, y as populateItems, z as FACTIONS_DIR } from "./authoring-tools-q34iq3hW.js";
3
3
  import { w as writeWorldPrompt } from "./route-DRTJ_vcA.js";
4
4
  import { f as parseSwitchboard } from "./narration-DvFBqmqe.js";
5
5
  import { B as loadPlots, F as STORY_LANGUAGES, G as formatIssue, H as plotReferenceProblems, I as isStoryLanguage, J as PROMPTS_FOLDER, L as textLanguage, P as LANGUAGE_NAMES, V as parsePlotsFile, at as InvalidWorldError, tt as shippedLanguages, z as PLOTS_FILE_NAME } from "./hooks-HnqXO8mM.js";
6
6
  import { i as translator, r as languageOf } from "./text-JbWfTHbr.js";
7
7
  import { u as parseSampling } from "./child-CyCViUKa.js";
8
8
  import { c as referenceImagePath, v as mapLimit } from "./library-BGxPKs9a.js";
9
- import { n as readPreset } from "./preset-CXbC0NeU.js";
9
+ import { n as readPreset } from "./preset-VatN-845.js";
10
10
  import { _ as API_PREFIX, a as packIds, d as packPath, f as readPack, h as PACK_MEDIA_TYPES, l as isPackId } from "./packs-jowC-MN_.js";
11
11
  import { a as uploadReferenceImage, t as generateReferenceImage } from "./generator-BFmSYvR8.js";
12
12
  import { basename, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
@@ -2141,4 +2141,4 @@ function registerPackJail(ctx, deps) {
2141
2141
  //#endregion
2142
2142
  export { worldEntityImageFile as A, readWorldInfo as B, readWorldEditor as C, uploadWorldCharacterPortrait as D, replaceFile$1 as E, loadWorldParts as F, translateTools as H, PRESET_FILE as I, presetMessage as L, deleteTriggerDocument as M, readTriggerDocuments as N, uploadWorldEntityImage as O, writeTriggerDocument as P, presetTools as R, generateWorldEntityImage as S, removeWorldTrigger as T, languageOfDocuments as U, translateMessage as V, readWorldDocuments as W, editWorldPlots as _, deleteWorldPackFile as a, entityFolder as b, createAuthoredEntity as c, replaceAuthoredEntity as d, editWorldCharacter as f, editWorldPlace as g, editWorldNarrationVoice as h, checkWorldPack as i, writeWorldTrigger as j, worldCharacterPortraitFile as k, deleteAuthoredEntity as l, editWorldLore as m, packFileProblem as n, listWorldPacks as o, editWorldFaction as p, registerPackJail as r, AUTHORED_ENTITY_KINDS as s, MAX_PACK_TEXT as t, readAuthoredEntityDocument as u, editWorldRelation as v, readWorldTrigger as w, generateWorldCharacterPortrait as x, editWorldThing as y, editWorldInfo as z };
2143
2143
 
2144
- //# sourceMappingURL=pack-jail-DLGguGS3.js.map
2144
+ //# sourceMappingURL=pack-jail-MPekqSuQ.js.map
@@ -1,4 +1,4 @@
1
- import { Rt as ImportCardError, W as cleanText, r as MAX_PREVIEW_TEXT } from "./authoring-tools-BKltdiea.js";
1
+ import { Ht as ImportCardError, K as cleanText, r as MAX_PREVIEW_TEXT } from "./authoring-tools-q34iq3hW.js";
2
2
  import { l as SAMPLING_RANGES } from "./child-CyCViUKa.js";
3
3
  //#region src/host/import/preset.ts
4
4
  /** The older preset layout keeps its texts under fixed keys. */
@@ -239,4 +239,4 @@ function selectPrompts(file, enabled, keepSampling) {
239
239
  //#endregion
240
240
  export { readPreset as n, selectPrompts as r, previewPreset as t };
241
241
 
242
- //# sourceMappingURL=preset-CXbC0NeU.js.map
242
+ //# sourceMappingURL=preset-VatN-845.js.map
@@ -1,9 +1,9 @@
1
1
  import "./access-DtOxFKBK.js";
2
- import { K as withPlayer, U as extractStyleFrom, at as IMPORT_FOLDER, i as contextOf } from "./authoring-tools-BKltdiea.js";
2
+ import { U as extractStyleFrom, Y as withPlayer, ct as IMPORT_FOLDER, i as contextOf } from "./authoring-tools-q34iq3hW.js";
3
3
  import { C as readWorldPrompt, S as listWorldPrompts, b as PROSE_PROMPTS, h as readPreset, m as presetDirectory, s as PRESET_FILE, w as writeWorldPrompt, x as deleteWorldPrompt, y as updatePresetInfo } from "./route-DRTJ_vcA.js";
4
4
  import { Q as languageOf, nt as shippedPromptsDirectory, tt as shippedLanguages } from "./hooks-HnqXO8mM.js";
5
5
  import { i as translator, r as languageOf$1 } from "./text-JbWfTHbr.js";
6
- import { n as readPreset$1 } from "./preset-CXbC0NeU.js";
6
+ import { n as readPreset$1 } from "./preset-VatN-845.js";
7
7
  import { join } from "node:path";
8
8
  import { existsSync } from "node:fs";
9
9
  import { defineTool } from "@deepseek-ai/dsh-tools";
@@ -280,4 +280,4 @@ async function presetApproval(exec, next, carries) {
280
280
  //#endregion
281
281
  export { presetChatSessionId as a, presetAuthorTools as i, narrationImportMessage as n, presetOfChat as o, presetApproval as r, PresetReader as t };
282
282
 
283
- //# sourceMappingURL=preset-author-tools-C26kj6t5.js.map
283
+ //# sourceMappingURL=preset-author-tools-8kv1Glxe.js.map
@@ -1,5 +1,5 @@
1
- import { n as limitAuthoringAgents } from "./authoring-tools-BKltdiea.js";
2
- import { i as presetAuthorTools, o as presetOfChat, r as presetApproval, t as PresetReader } from "./preset-author-tools-C26kj6t5.js";
1
+ import { n as limitAuthoringAgents } from "./authoring-tools-q34iq3hW.js";
2
+ import { i as presetAuthorTools, o as presetOfChat, r as presetApproval, t as PresetReader } from "./preset-author-tools-8kv1Glxe.js";
3
3
  import { m as presetDirectory } from "./route-DRTJ_vcA.js";
4
4
  import "./hooks-HnqXO8mM.js";
5
5
  import { t as guardAuthoringTurns } from "./turn-guard-BvCs1VxB.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-agentic-roleplay/core",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Core plugin of the agentic roleplay bundle for DeepSeek Harness: roleplay UI, orchestration and storage.",
5
5
  "author": {
6
6
  "name": "Firefox2100",
@@ -76,7 +76,7 @@
76
76
  "@deepseek-ai/schemastery": "^3.18.5"
77
77
  },
78
78
  "dependencies": {
79
- "@dsh-agentic-roleplay/state": "0.7.1",
79
+ "@dsh-agentic-roleplay/state": "0.7.2",
80
80
  "@dsh-ai-providers/core": "^0.5.0"
81
81
  },
82
82
  "devDependencies": {
@@ -2,7 +2,7 @@ The import is done and written into the world. Before you report, review it as a
2
2
  - get_world_overview, then the places with their exits (list_relationships with exits, get_world_element_source): every way between places should lead somewhere the card implies; an exit to an unrelated place, a place nobody can reach, or a place that is in another by mistake is fixed or removed.
3
3
  - Each character's starting place makes sense for the card, and the playable character (if any) starts somewhere the story can begin.
4
4
  - Names, aliases and summaries read as the card meant them; duplicates (the same person twice) are merged by deleting the weaker one.
5
- The card has no player character unless the import says so: notes about a relationship with [PLAYER] are expected, so leave them, and never make a character for the player. Change only what is wrong, as little as needed, and never add what the card does not say. Then tell the person briefly what was imported, what was left out and why, whether there is a playable character (if not, say that none was found and offer to add one), what you corrected, and any notes that matter. If the report shows pictures fetched from the card's web addresses, say how many; they are in the world's image library, so every session started from it has them in its gallery.
5
+ The card has no player character unless the import says so: notes about a relationship with [PLAYER] are expected, so leave them, and never make a character for the player. Change only what is wrong, as little as needed, and never add what the card does not say. Then tell the person briefly what was imported, what was left out and why, whether there is a playable character (if not, say that none was found and offer to add one), what you corrected, and any notes that matter. End by offering to compare the world with the original card if the person wants it checked (you can read the card with card_overview and card_read), and do not do it now. If the report shows pictures fetched from the card's web addresses, say how many; they are in the world's image library, so every session started from it has them in its gallery.
6
6
 
7
7
  The import already turned the card's instructions about narration and behaviour into the world's prose prompts (the report lists them). You may adjust those, or write the other prose prompts (roleplay/persona, roleplay/style, roleplay/character-style) with write_world_prompt after reading the original with read_world_prompt, keeping the placeholders it has. Every other prompt holds the rules of the game and is refused to you. Add nothing the card does not ask for.
8
8
 
@@ -1 +1 @@
1
- Use the read tools before making claims or edits. Keys are stable file identities, not display names. Before replacing an element, read its exact source document and preserve fields the requested change does not affect. Every write asks the user for one-time approval. If approval is rejected, cancelled or unavailable, do not retry it automatically: explain that nothing changed and ask how the user wants to proceed. To change how a story looks, read world_pack_guide, then write the interface pack file by file with the write tool, using the paths the guide gives, and finish with check_world_pack until it reports no problems. To make the world act by itself, list_world_triggers and get_world_trigger first, then write_world_trigger with a complete document; a trigger that names something the world does not have is refused with every problem, so fix them all. If you have tools for searching the web or reading pages and the user names a setting, franchise or source you do not know well, look it up before you write and say what you found; never invent facts about an existing work. If you have no such tools, say so and ask the user to describe it.
1
+ Use the read tools before making claims or edits. Keys are stable file identities, not display names. Before replacing an element, read its exact source document and preserve fields the requested change does not affect. Every write asks the user for one-time approval. If approval is rejected, cancelled or unavailable, do not retry it automatically: explain that nothing changed and ask how the user wants to proceed. To change how a story looks, read world_pack_guide, then write the interface pack file by file with the write tool, using the paths the guide gives, and finish with check_world_pack until it reports no problems. To make the world act by itself, list_world_triggers and get_world_trigger first, then write_world_trigger with a complete document; a trigger that names something the world does not have is refused with every problem, so fix them all. If you have tools for searching the web or reading pages and the user names a setting, franchise or source you do not know well, look it up before you write and say what you found; never invent facts about an existing work. If you have no such tools, say so and ask the user to describe it. If this world was imported from a character card, the card is kept and card_overview, card_search, card_read and card_origin read it: when the user asks where something in the world came from or what the card said, look it up instead of guessing, read the piece with card_read before you answer from a search hit (a title or keys that match prove nothing), and quote only what the answer needs. The world's own files are the canon and the card is evidence of where they came from; if the two differ, say so, and do not change the world to match the card unless the user asks. What card_overview and card_origin say the import did is its own judgement and can be wrong, so check it against the text with card_read. If the tools say there is no card, the world was not imported or the card was removed.
@@ -2,7 +2,7 @@
2
2
  - 先用 get_world_overview,再看各个地点及其出口(list_relationships 的出口、get_world_element_source):每条通路都应通向卡片所暗示的地方;通向毫不相干地点的出口、无法到达的地点、被错误放进另一个地点的地点,都要修正或删除。
3
3
  - 每个角色的起始地点要符合卡片,可扮演的角色(如果有)要从故事能够开始的地方出发。
4
4
  - 名字、别名和简介要符合卡片的本意;重复的人物(同一个人出现两次)删除较弱的那个。
5
- 除非导入另有说明,卡片没有玩家角色:关于与 [PLAYER] 的关系的备注是预料之中的,不要管它们,也绝不要为玩家创建角色。只改错误的地方,改动尽量少,绝不添加卡片没有说的内容。然后简要告诉用户:导入了什么、略去了什么以及原因、是否有可扮演的角色(如果没有,说明没有找到,并主动提出添加一个)、你纠正了什么,以及重要的备注。如果报告显示从角色卡的网址取回了图片,说明数量;它们存放在世界的图片库中,由此世界开始的每个会话的画廊里都有。
5
+ 除非导入另有说明,卡片没有玩家角色:关于与 [PLAYER] 的关系的备注是预料之中的,不要管它们,也绝不要为玩家创建角色。只改错误的地方,改动尽量少,绝不添加卡片没有说的内容。然后简要告诉用户:导入了什么、略去了什么以及原因、是否有可扮演的角色(如果没有,说明没有找到,并主动提出添加一个)、你纠正了什么,以及重要的备注。最后主动提出:如果用户希望,可以把世界与原始角色卡对照检查(用 card_overview 和 card_read 读卡),但现在不要做。如果报告显示从角色卡的网址取回了图片,说明数量;它们存放在世界的图片库中,由此世界开始的每个会话的画廊里都有。
6
6
 
7
7
  导入已把角色卡中关于叙述和角色表现的指令整理成世界的文风提示(报告里列出)。你可以调整它们,或先用 read_world_prompt 读原文,再用 write_world_prompt 写其他文笔类提示(roleplay/persona、roleplay/style、roleplay/character-style),并保留其中的占位符。其他所有提示都是游戏规则,不允许你修改。角色卡没有要求的,一概不要添加。
8
8
 
@@ -1 +1 @@
1
- 在做出断言或修改之前,先使用读取工具。键(key)是稳定的文件标识,不是显示名称。在替换某个元素之前,先读取它确切的源文档,并保留请求的修改没有涉及的字段。每一次写入都会向用户请求一次性批准。如果批准被拒绝、取消或无法获得,不要自动重试:说明没有任何改动,并询问用户想怎么继续。若要改变故事的外观,先阅读 world_pack_guide,再用 write 工具,按指南给出的路径逐个文件编写界面包,最后用 check_world_pack 检查,直到没有问题。若要让世界自行行动,先用 list_world_triggers 和 get_world_trigger 查看,再用 write_world_trigger 写入完整的文档;如果触发器提到世界里没有的东西,会连同所有问题一起被拒绝,请全部修正。 如果你有搜索网络或阅读网页的工具,而用户提到了你不太了解的设定、作品或来源,请先查询再动笔,并说明查到了什么;不要编造现有作品的事实。如果你没有这类工具,就直说,并请用户自己描述。
1
+ 在做出断言或修改之前,先使用读取工具。键(key)是稳定的文件标识,不是显示名称。在替换某个元素之前,先读取它确切的源文档,并保留请求的修改没有涉及的字段。每一次写入都会向用户请求一次性批准。如果批准被拒绝、取消或无法获得,不要自动重试:说明没有任何改动,并询问用户想怎么继续。若要改变故事的外观,先阅读 world_pack_guide,再用 write 工具,按指南给出的路径逐个文件编写界面包,最后用 check_world_pack 检查,直到没有问题。若要让世界自行行动,先用 list_world_triggers 和 get_world_trigger 查看,再用 write_world_trigger 写入完整的文档;如果触发器提到世界里没有的东西,会连同所有问题一起被拒绝,请全部修正。 如果你有搜索网络或阅读网页的工具,而用户提到了你不太了解的设定、作品或来源,请先查询再动笔,并说明查到了什么;不要编造现有作品的事实。如果你没有这类工具,就直说,并请用户自己描述。 如果这个世界是由角色卡导入的,那张卡会被保留,card_overview、card_search、card_read 和 card_origin 可以读取它:当用户问世界里的某样东西从哪里来、或卡里是怎么写的,要去查,而不是猜测;根据搜索命中作答之前,先用 card_read 读该段(标题或关键词匹配并不能说明什么),并且只引用回答所需的内容。世界自身的文件才是设定,卡只是它们来源的依据;两者不一致时要如实说明,除非用户要求,不要为了与卡一致而修改世界。card_overview 和 card_origin 里关于导入做了什么的说明是导入自己的判断,可能有误,要用 card_read 对照原文核实。如果这些工具说没有卡,说明这个世界不是导入的,或者卡已被移除。