@dsh-agentic-roleplay/core 0.12.2 → 0.12.3
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/{authoring-tools-BZr4bgBy.js → authoring-tools-hacA5fG-.js} +1904 -1849
- package/lib/authoring.js +39 -32
- package/lib/client.js +440 -440
- package/lib/doctor.js +1 -1
- package/lib/{hooks-Dtq5KZQX.js → hooks-DlrFO4aQ.js} +199 -40
- package/lib/index.js +37 -26
- package/lib/{lorebook-author-tools-BjcEUo22.js → lorebook-author-tools-dupq-kb_.js} +4 -4
- package/lib/lorebook-authoring.js +5 -5
- package/lib/orchestration.js +4 -4
- package/lib/{pack-jail-Dt0VTsu0.js → pack-jail-Bq0fzKi4.js} +38 -11
- package/lib/{packs-DWfR2Ted.js → packs-D-7EU3yU.js} +2 -2
- package/lib/{preset-Dv5YF2qj.js → preset-RHcOG55T.js} +3 -3
- package/lib/{preset-author-tools-BUzO9mTW.js → preset-author-tools-Dwxnpv6V.js} +5 -5
- package/lib/preset-authoring.js +5 -5
- package/lib/{reflection-Dd3pEiZB.js → reflection-DibpEUQK.js} +4 -4
- package/lib/{serial-BUaJGwVy.js → serial-CDGoXYh-.js} +1197 -1216
- package/lib/{turn-guard-87NE-Cnp.js → turn-guard-DDxikrq7.js} +2 -2
- package/package.json +3 -2
package/lib/authoring.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { t as guardAuthoringTurns } from "./turn-guard-
|
|
1
|
+
import { $ as checkWorld, A as loadWorldParts, At as UPDATE_FOLDER, C as cardChanges, D as worldFieldChanges, E as pictureChange, F as editsSince, Ft as readSource, It as COMMANDS_FILE_NAME, M as CHECK_COMMANDS, N as CHECK_COMMAND_DESCRIPTIONS, Nt as cardTools, O as editWorldInfo, Pt as entitiesByPiece, S as addressChanges, St as DICE_FILE_NAME, T as matchPieces, Tt as CALENDAR_FILE_NAME, Xt as authoredWorldOf, b as CHECKS, j as loadCardEvidence, k as readWorldInfo, l as importTools, n as limitAuthoringAgents, o as contextOf, p as isReviewing, s as importHooks, v as checkImported, w as diffText, x as runChecks, y as presentReport } from "./authoring-tools-hacA5fG-.js";
|
|
2
|
+
import { t as guardAuthoringTurns } from "./turn-guard-DDxikrq7.js";
|
|
3
3
|
import { n as silenceRuntimeContext, t as silenceHarnessDevContext } from "./dev-context-Cgv_wZbG.js";
|
|
4
|
-
import { B as deleteTriggerDocument, D as editWorldPlots, G as parseVariablesEdit, H as writeTriggerDocument, K as parseDiceEdit, M as readWorldEditor, O as editWorldRelation, Q as translateTools, U as parseCalendarEdit, V as readTriggerDocuments, X as presetTools, a as deleteWorldPackFile, c as createAuthoredEntity, d as replaceAuthoredEntity, f as editCalendar, g as editVariables, i as checkWorldPack, l as deleteAuthoredEntity, m as editDice, nt as finishUpdate, o as listWorldPacks, p as editCommands, q as parseCommandsEdit, r as registerPackJail, rt as pendingUpdate, s as AUTHORED_ENTITY_KINDS, u as readAuthoredEntityDocument } from "./pack-jail-
|
|
4
|
+
import { B as deleteTriggerDocument, D as editWorldPlots, G as parseVariablesEdit, H as writeTriggerDocument, K as parseDiceEdit, M as readWorldEditor, O as editWorldRelation, Q as translateTools, U as parseCalendarEdit, V as readTriggerDocuments, X as presetTools, a as deleteWorldPackFile, c as createAuthoredEntity, d as replaceAuthoredEntity, f as editCalendar, g as editVariables, i as checkWorldPack, l as deleteAuthoredEntity, m as editDice, nt as finishUpdate, o as listWorldPacks, p as editCommands, q as parseCommandsEdit, r as registerPackJail, rt as pendingUpdate, s as AUTHORED_ENTITY_KINDS, u as readAuthoredEntityDocument } from "./pack-jail-Bq0fzKi4.js";
|
|
5
5
|
import { i as translator, r as languageOf } from "./text-Dfv8S8eq.js";
|
|
6
|
-
import { $ as deleteWorldPrompt,
|
|
7
|
-
import { B as parsePlotsFile, at as shippedPromptsDirectory, q as formatIssue } from "./hooks-
|
|
8
|
-
import { g as SURFACE_NAMES, m as PACK_LIMITS, p as PACK_ACTIONS } from "./packs-
|
|
6
|
+
import { $ as deleteWorldPrompt, Ct as IMPORT_FOLDER, Et as PICTURE_FILE, F as parseWorldInfoEdit, It as parseRelationEdit, Q as PROSE_PROMPTS, Wt as VARIABLES_FILE_NAME, et as listWorldPrompts, jt as InvalidEditProblems, nt as writeWorldPrompt, tt as readWorldPrompt } from "./serial-CDGoXYh-.js";
|
|
7
|
+
import { B as parsePlotsFile, at as shippedPromptsDirectory, ht as registerCommands, q as formatIssue } from "./hooks-DlrFO4aQ.js";
|
|
8
|
+
import { g as SURFACE_NAMES, m as PACK_LIMITS, p as PACK_ACTIONS } from "./packs-D-7EU3yU.js";
|
|
9
9
|
import "./access-Csp80TFX.js";
|
|
10
10
|
import { join, relative } from "node:path";
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
@@ -1323,7 +1323,7 @@ function checkTools(reader, judging) {
|
|
|
1323
1323
|
})
|
|
1324
1324
|
];
|
|
1325
1325
|
}
|
|
1326
|
-
// src/host/checks/
|
|
1326
|
+
// src/host/checks/commands.ts
|
|
1327
1327
|
/** The tool each kit is run with, for the notice of a check command. */
|
|
1328
1328
|
const KIT_TOOLS = {
|
|
1329
1329
|
consistency: "check_world",
|
|
@@ -1331,34 +1331,41 @@ const KIT_TOOLS = {
|
|
|
1331
1331
|
quality: "check_quality",
|
|
1332
1332
|
playability: "check_play"
|
|
1333
1333
|
};
|
|
1334
|
-
/**
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1334
|
+
/**
|
|
1335
|
+
* The check commands (`/check`, `/check-world`, ...) of a world authoring chat. Running one tells the assistant which kits to run and what to do with what they find, and what the person
|
|
1336
|
+
* added after the name (`deep` lets a model judge too) is passed on as it was typed.
|
|
1337
|
+
*/
|
|
1338
|
+
function checkCommands(ctx, prompting) {
|
|
1339
|
+
registerCommands(ctx, Object.entries(CHECK_COMMANDS).map(([name, kits]) => ({
|
|
1340
|
+
name,
|
|
1341
|
+
description: CHECK_COMMAND_DESCRIPTIONS[name] ?? name,
|
|
1342
|
+
hint: "[deep] [what to look at]",
|
|
1343
|
+
recordInput: false,
|
|
1344
|
+
handler: ({ agent, rawInput }) => {
|
|
1345
|
+
const world = authoredWorldOf(agent.session.id);
|
|
1346
|
+
if (world === void 0 || agent.session.header.origin === "subagent") return {
|
|
1347
|
+
kind: "error",
|
|
1348
|
+
text: `/${name} runs in the authoring chat of a world`
|
|
1349
|
+
};
|
|
1350
|
+
const request = rawInput.trim();
|
|
1351
|
+
const notice = prompting.prompts().text("checks/notice", prompting.languages().get(world), {
|
|
1352
|
+
command: `/${name}`,
|
|
1353
|
+
tools: kits.map((kit) => KIT_TOOLS[kit]).join(", "),
|
|
1354
|
+
request: request === "" ? "-" : request
|
|
1355
|
+
});
|
|
1356
|
+
agent.followup(createUserMessage({
|
|
1354
1357
|
content: [{
|
|
1355
1358
|
type: "text",
|
|
1356
1359
|
text: notice
|
|
1357
1360
|
}],
|
|
1358
1361
|
source: { kind: "roleplay" }
|
|
1359
|
-
})
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
+
}));
|
|
1363
|
+
return {
|
|
1364
|
+
kind: "success",
|
|
1365
|
+
text: `Running ${kits.length === 1 ? "the check" : "the checks"}…`
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
})));
|
|
1362
1369
|
}
|
|
1363
1370
|
// src/authoring.ts
|
|
1364
1371
|
const name = "@dsh-agentic-roleplay/core/authoring";
|
|
@@ -1397,8 +1404,8 @@ function apply(ctx) {
|
|
|
1397
1404
|
settings: () => ctx.roleplayImport.settings,
|
|
1398
1405
|
prompting
|
|
1399
1406
|
})) ctx.tools.register(tool);
|
|
1400
|
-
importHooks(ctx, ctx.roleplayWorlds, prompting);
|
|
1401
|
-
|
|
1407
|
+
importHooks(ctx, ctx.roleplayWorlds, prompting, ctx.roleplayImport.state);
|
|
1408
|
+
checkCommands(ctx, prompting);
|
|
1402
1409
|
updateHooks(ctx, ctx.roleplayWorlds, (world) => ctx.roleplayAuthoringLanguages.get(world));
|
|
1403
1410
|
const reviewing = async (chat) => {
|
|
1404
1411
|
const id = authoredWorldOf(chat);
|