@dsh-agentic-roleplay/core 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/icon.svg +13 -0
  2. package/lib/{authoring-tools-C6Hzy8jU.js → authoring-tools-C9cmcUbD.js} +424 -31
  3. package/lib/authoring.js +6 -6
  4. package/lib/{child-C8r8AFpm.js → child-C9nPIy9j.js} +7 -3
  5. package/lib/client.js +2196 -728
  6. package/lib/client.js.map +1 -1
  7. package/lib/compaction.js +1 -1
  8. package/lib/doctor.js +2 -2
  9. package/lib/helper.js +8 -1
  10. package/lib/{hooks-BuQ61nvQ.js → hooks-BpLN_hhT.js} +180 -153
  11. package/lib/images.js +1 -1
  12. package/lib/index.js +456 -61
  13. package/lib/{lorebook-author-tools-B6_Jj8oe.js → lorebook-author-tools-Cg7QQemi.js} +4 -4
  14. package/lib/lorebook-authoring.js +4 -4
  15. package/lib/orchestration.js +65 -15
  16. package/lib/{pack-jail-OZSgU85i.js → pack-jail-D5j5mIq6.js} +12 -8
  17. package/lib/{packs-B88bxt8E.js → packs-Cc05FrId.js} +2 -2
  18. package/lib/{presenter-agent-D-WNs626.js → presenter-agent-UKbKYXMO.js} +3 -3
  19. package/lib/{preset-DNuqvMan.js → preset-Be4lz6vB.js} +4 -4
  20. package/lib/{preset-author-tools-CDwavcTb.js → preset-author-tools-C3s0iSfv.js} +5 -5
  21. package/lib/preset-authoring.js +5 -5
  22. package/lib/{presets-9_MNxwaw.js → presets-Cl9sU3Qs.js} +52 -10
  23. package/lib/{reflection-BvM0w1R4.js → reflection-I9z-PvFK.js} +8 -6
  24. package/lib/{turn-guard-Ygdww1Wt.js → turn-guard-B9pGCeir.js} +3 -3
  25. package/package.json +4 -2
  26. package/prompts/en/checks/decide-opening.md +7 -1
  27. package/prompts/en/roleplay/record-keeper.md +2 -1
  28. package/prompts/zh/checks/decide-opening.md +7 -1
  29. package/prompts/zh/roleplay/record-keeper.md +2 -1
package/lib/authoring.js CHANGED
@@ -1,10 +1,10 @@
1
- import { $ as readSource, A as editsSince, C as worldFieldChanges, D as loadCardEvidence, E as loadWorldParts, J as UPDATE_FOLDER, O as CHECK_COMMANDS, Q as entitiesByPiece, S as pictureChange, T as readWorldInfo, Z as cardTools, _ as runChecks, a as importHooks, b as diffText, g as CHECKS, gt as checkWorld, h as presentReport, i as contextOf, l as isReviewing, m as checkImported, n as limitAuthoringAgents, nt as parseWorldInfoEdit, o as importTools, on as authoredWorldOf, v as addressChanges, w as editWorldInfo, x as matchPieces, y as cardChanges } from "./authoring-tools-C6Hzy8jU.js";
2
- import { t as guardAuthoringTurns } from "./turn-guard-Ygdww1Wt.js";
3
- import { C as readWorldEditor, L as presetTools, M as deleteTriggerDocument, N as readTriggerDocuments, P as writeTriggerDocument, U as finishUpdate, W as pendingUpdate, _ as editWorldPlots, a as deleteWorldPackFile, c as createAuthoredEntity, d as replaceAuthoredEntity, i as checkWorldPack, l as deleteAuthoredEntity, o as listWorldPacks, r as registerPackJail, s as AUTHORED_ENTITY_KINDS, u as readAuthoredEntityDocument, v as editWorldRelation, z as translateTools } from "./pack-jail-OZSgU85i.js";
4
- import { $ as IMPORT_FOLDER, At as InvalidEditProblems, Ft as parseRelationEdit, G as deleteWorldPrompt, J as writeWorldPrompt, K as listWorldPrompts, W as PROSE_PROMPTS, dt as parseAuthoringCommand, nt as PICTURE_FILE, q as readWorldPrompt } from "./presets-9_MNxwaw.js";
1
+ import { $ as readSource, A as editsSince, C as worldFieldChanges, D as loadCardEvidence, E as loadWorldParts, J as UPDATE_FOLDER, O as CHECK_COMMANDS, Q as entitiesByPiece, S as pictureChange, T as readWorldInfo, Z as cardTools, _ as runChecks, a as importHooks, b as diffText, g as CHECKS, h as presentReport, i as contextOf, l as isReviewing, ln as authoredWorldOf, m as checkImported, n as limitAuthoringAgents, nt as parseWorldInfoEdit, o as importTools, v as addressChanges, vt as checkWorld, w as editWorldInfo, x as matchPieces, y as cardChanges } from "./authoring-tools-C9cmcUbD.js";
2
+ import { t as guardAuthoringTurns } from "./turn-guard-B9pGCeir.js";
3
+ import { C as readWorldEditor, L as presetTools, M as deleteTriggerDocument, N as readTriggerDocuments, P as writeTriggerDocument, U as finishUpdate, W as pendingUpdate, _ as editWorldPlots, a as deleteWorldPackFile, c as createAuthoredEntity, d as replaceAuthoredEntity, i as checkWorldPack, l as deleteAuthoredEntity, o as listWorldPacks, r as registerPackJail, s as AUTHORED_ENTITY_KINDS, u as readAuthoredEntityDocument, v as editWorldRelation, z as translateTools } from "./pack-jail-D5j5mIq6.js";
4
+ import { $ as IMPORT_FOLDER, At as InvalidEditProblems, Ft as parseRelationEdit, G as deleteWorldPrompt, J as writeWorldPrompt, K as listWorldPrompts, W as PROSE_PROMPTS, dt as parseAuthoringCommand, nt as PICTURE_FILE, q as readWorldPrompt } from "./presets-Cl9sU3Qs.js";
5
5
  import { i as translator, r as languageOf } from "./text-CzqhC8sT.js";
6
- import { H as parsePlotsFile, Y as formatIssue, ot as shippedPromptsDirectory } from "./hooks-BuQ61nvQ.js";
7
- import { g as SURFACE_NAMES, m as PACK_LIMITS, p as PACK_ACTIONS } from "./packs-B88bxt8E.js";
6
+ import { G as formatIssue, R as parsePlotsFile, nt as shippedPromptsDirectory } from "./hooks-BpLN_hhT.js";
7
+ import { g as SURFACE_NAMES, m as PACK_LIMITS, p as PACK_ACTIONS } from "./packs-Cc05FrId.js";
8
8
  import "./access-CXtaZNbx.js";
9
9
  import { join, relative } from "node:path";
10
10
  import { createHash } from "node:crypto";
@@ -195,6 +195,10 @@ const MAX_RUN_PROMPT = 24e3;
195
195
  * minutes, a game master's turn never ended), so what the stop decided is not waited on past this.
196
196
  */
197
197
  const STOP_GRACE_MS = 15e3;
198
+ /** The share of its output cap each recovery after the first leaves the game master: a call that runs on is cut sooner, so the next try has to be shorter. */
199
+ const RECOVERY_SHRINK = .5;
200
+ /** The least output a recovery leaves the game master. */
201
+ const RECOVERY_FLOOR = 2048;
198
202
  // src/shared/sampling.ts
199
203
  /** The controls beyond temperature, which apply to the game master and the characters (the helpers that must be exact are never asked more freely). */
200
204
  const SHARED_SAMPLING = [
@@ -376,7 +380,7 @@ const isUnfinishedCall = (error) => error instanceof Error && /parse tool call a
376
380
  async function runChild(task) {
377
381
  for (let attempt = 1;; attempt += 1) {
378
382
  const began = Date.now();
379
- const turnAtStart = currentTurn(task.parent);
383
+ const turnAtStart = task.turn ?? currentTurn(task.parent);
380
384
  const stats = {
381
385
  calls: 0,
382
386
  record: []
@@ -787,6 +791,6 @@ async function execute(task, stats) {
787
791
  }
788
792
  return submitted.value;
789
793
  }
790
- export { tokensOf$1 as C, estimateAnswer as S, addTokens as _, childTrace as a, cutOff as b, runChild as c, sharedSamplingOf as d, requestsOf as f, NO_TOKENS as g, tokensOf as h, childSamplingOf as i, SAMPLING_RANGES as l, estimateTokens as m, childModel as n, helpers as o, blockText as p, childSampling as r, namedModel as s, ChildTimeoutError as t, parseSampling as u, totalTokens as v, finishOf as x, currentTurn as y };
794
+ export { cutOff as C, tokensOf$1 as E, currentTurn as S, estimateAnswer as T, estimateTokens as _, childTrace as a, addTokens as b, namedModel as c, parseSampling as d, sharedSamplingOf as f, blockText as g, requestsOf as h, childSamplingOf as i, runChild as l, RECOVERY_SHRINK as m, childModel as n, helpers as o, RECOVERY_FLOOR as p, childSampling as r, isUnfinishedCall as s, ChildTimeoutError as t, SAMPLING_RANGES as u, tokensOf as v, finishOf as w, totalTokens as x, NO_TOKENS as y };
791
795
 
792
- //# sourceMappingURL=child-C8r8AFpm.js.map
796
+ //# sourceMappingURL=child-C9nPIy9j.js.map