@dsh-agentic-roleplay/core 0.11.1 → 0.12.1
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/{access-Md1YTSX1.js → access-DifaiHrI.js} +3 -15
- package/lib/{authoring-tools-BFdw7ahj.js → authoring-tools-VOaXzr_R.js} +58 -766
- package/lib/authoring.js +136 -13
- package/lib/{child-C9nPIy9j.js → child-DzZ-aI6k.js} +130 -2
- package/lib/client.js +17093 -2269
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +3 -3
- package/lib/dev-context-Bdm-eVer.js +40 -0
- package/lib/doctor.js +5 -3
- package/lib/{gallery-BWHmjogd.js → gallery-Ctz-UoFk.js} +3 -3
- package/lib/{generator-QCdm8nUh.js → generator-Cv6WWmZT.js} +2 -2
- package/lib/helper.js +15 -1
- package/lib/{hooks-C2U1-8ur.js → hooks-BdR3mBeM.js} +751 -344
- package/lib/images.js +4 -4
- package/lib/index.js +342 -463
- package/lib/jail-Cp4zEfip.js +107 -0
- package/lib/{library-4zmCAshR.js → library-BU2A_Dx8.js} +3 -3
- package/lib/{lorebook-author-tools-Bjfjt3bg.js → lorebook-author-tools-DUKcQu8P.js} +20 -7
- package/lib/lorebook-authoring.js +12 -5
- package/lib/{narration-b_VBEUWn.js → narration-CDsJ5wxH.js} +29 -2
- package/lib/orchestration.js +615 -48
- package/lib/{pack-jail-Ci9bIeDI.js → pack-jail-CzHQu0n3.js} +559 -23
- package/lib/{packs-CYkozh8Q.js → packs-BZ-45J4-.js} +2 -2
- package/lib/{presenter-agent-CqkAL03Q.js → presenter-agent-C2ZkoxZu.js} +9 -9
- package/lib/{preset-B-35yUmt.js → preset-BPnRPW-1.js} +4 -4
- package/lib/{preset-author-tools-BUymqZM5.js → preset-author-tools-DBqPwn-o.js} +9 -8
- package/lib/preset-authoring.js +11 -6
- package/lib/{reflection-B9N0z3KY.js → reflection-Cuy0YLv0.js} +22 -16
- package/lib/{presets-_U-xroo0.js → serial-BZNeK57v.js} +1305 -331
- package/lib/service-mRKwpWjX.js +140 -0
- package/lib/{text-C2AGl7Je.js → text-Dfv8S8eq.js} +27 -2
- package/lib/{turn-guard-C0M3rXEN.js → turn-guard-xaFxYc1T.js} +3 -3
- package/locale/de.json +6 -0
- package/locale/en.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +34 -34
- package/prompts/en/import/finish-ok.md +1 -1
- package/prompts/en/import/generator.md +1 -1
- package/prompts/en/import/style.md +2 -1
- package/prompts/en/import/variables.md +2 -1
- package/prompts/en/roleplay/character-lookup.md +1 -1
- package/prompts/en/roleplay/decide-errand.md +1 -0
- package/prompts/en/roleplay/decide-message.md +1 -0
- package/prompts/en/roleplay/dream.md +1 -0
- package/prompts/en/roleplay/gate-repeat.md +1 -0
- package/prompts/en/world/procedure.md +1 -1
- package/prompts/zh/import/finish-ok.md +1 -1
- package/prompts/zh/import/generator.md +1 -1
- package/prompts/zh/import/style.md +2 -1
- package/prompts/zh/import/variables.md +2 -1
- package/prompts/zh/roleplay/character-lookup.md +1 -1
- package/prompts/zh/roleplay/decide-errand.md +1 -0
- package/prompts/zh/roleplay/decide-message.md +1 -0
- package/prompts/zh/roleplay/dream.md +1 -0
- package/prompts/zh/roleplay/gate-repeat.md +1 -0
- package/prompts/zh/world/procedure.md +1 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { j as roleplaySessionOf } from "./child-DzZ-aI6k.js";
|
|
2
|
+
import { i as isInside } from "./service-mRKwpWjX.js";
|
|
3
|
+
import { dirname, isAbsolute, resolve } from "node:path";
|
|
4
|
+
import { readdirSync, realpathSync, statSync } from "node:fs";
|
|
5
|
+
// src/host/workspace/jail.ts
|
|
6
|
+
/** DSH's file tools whose path is a `file_path` argument, and those that search under a `path`. */
|
|
7
|
+
const FILE_TOOLS = [
|
|
8
|
+
"read",
|
|
9
|
+
"read_image",
|
|
10
|
+
"write",
|
|
11
|
+
"edit"
|
|
12
|
+
];
|
|
13
|
+
const SEARCH_TOOLS = ["glob", "grep"];
|
|
14
|
+
const WRITING = ["write", "edit"];
|
|
15
|
+
const PATCHING = "apply_patch";
|
|
16
|
+
const PATCH_FILES = /^\*\*\* (?:Add|Update|Delete) File: (.+)$|^\*\*\* Move to: (.+)$/gmu;
|
|
17
|
+
/** The real path of a file that may not exist yet: the nearest folder above it that does, followed through links, with the rest put back. */
|
|
18
|
+
function realPathOf(path) {
|
|
19
|
+
const rest = [];
|
|
20
|
+
let current = resolve(path);
|
|
21
|
+
for (;;) try {
|
|
22
|
+
return rest.reduceRight((made, part) => resolve(made, part), realpathSync(current));
|
|
23
|
+
} catch (error) {
|
|
24
|
+
if (error.code !== "ENOENT" && error.code !== "ENOTDIR") throw error;
|
|
25
|
+
const up = dirname(current);
|
|
26
|
+
if (up === current) return resolve(path);
|
|
27
|
+
rest.push(current.slice(up.length + 1));
|
|
28
|
+
current = up;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const MOST_LISTED = 30;
|
|
32
|
+
/** Where a model that tried to read a folder is sent: what the folder holds. A bare "not a regular file" made helpers try the same folder twenty times. */
|
|
33
|
+
function folderListing(path) {
|
|
34
|
+
try {
|
|
35
|
+
if (!statSync(path).isDirectory()) return void 0;
|
|
36
|
+
const names = readdirSync(path, { withFileTypes: true }).map((entry) => entry.isDirectory() ? `${entry.name}/` : entry.name).sort();
|
|
37
|
+
const shown = names.slice(0, MOST_LISTED).join(", ");
|
|
38
|
+
return `${path} is a folder, not a file, so it cannot be read. It holds: ${names.length === 0 ? "nothing" : shown}${names.length > MOST_LISTED ? ` and ${names.length - MOST_LISTED} more` : ""}. Read one of those files by its whole path (${path}/<name>)`;
|
|
39
|
+
} catch {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Why a path is out of reach for a story, or nothing when it is inside a folder the story may use (and may write, when it writes). */
|
|
44
|
+
function folderProblem(path, writing, roots, workspace) {
|
|
45
|
+
if (!isAbsolute(path)) return `give the whole path (it is not relative to anything the tools know): the story's workspace is ${workspace}`;
|
|
46
|
+
const real = realPathOf(path);
|
|
47
|
+
const found = roots.filter((root) => isInside(root.path, real));
|
|
48
|
+
if (found.length === 0) return `${path} is outside the folders this story's tools may use: its workspace ${workspace}${roots.length > 1 ? ` and ${roots.filter((root) => root.path !== workspace).map((root) => `${root.path} (${root.write ? "read and write" : "read only"})`).join(", ")}` : ""}. Nothing, not another path and not sandbox_permissions, lifts that: tell the person if it is needed`;
|
|
49
|
+
if (writing && !found.some((root) => root.write)) return `${path} is in a folder this story may only read: tell the person if it should be changed`;
|
|
50
|
+
}
|
|
51
|
+
function patchPaths(patch) {
|
|
52
|
+
return [...patch.matchAll(PATCH_FILES)].map((match) => (match[1] ?? match[2] ?? "").trim()).filter((path) => path !== "");
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Keeps DSH's file tools of a story's agents (the game master and its helpers) inside the story's workspace and the folders the person gave the story.
|
|
56
|
+
* It stands first in the chain, so that what it refuses cannot be let through by a listener after it. Shell and terminal tools are not held to folders:
|
|
57
|
+
* they stay off unless the person turns them on.
|
|
58
|
+
*/
|
|
59
|
+
async function foldersJail(exec, next, deps) {
|
|
60
|
+
const header = exec.agent?.session.header;
|
|
61
|
+
const chat = header?.origin === "subagent" ? header.parentSession : exec.agent?.session.id;
|
|
62
|
+
const session = chat === void 0 ? void 0 : roleplaySessionOf(chat);
|
|
63
|
+
if (session === void 0) return await next();
|
|
64
|
+
const files = FILE_TOOLS.includes(exec.name);
|
|
65
|
+
const search = SEARCH_TOOLS.includes(exec.name);
|
|
66
|
+
if (!files && !search && exec.name !== PATCHING) return await next();
|
|
67
|
+
const roots = await deps.roots(session);
|
|
68
|
+
if (roots === void 0) return await next();
|
|
69
|
+
const args = exec.arguments;
|
|
70
|
+
const check = (paths, writing) => {
|
|
71
|
+
for (const path of paths) {
|
|
72
|
+
if (typeof path !== "string" || path === "" || path.startsWith("~")) return {
|
|
73
|
+
kind: "deny",
|
|
74
|
+
reason: `the path must be a whole path inside the story's workspace ${deps.workspace()} or a folder it was given`
|
|
75
|
+
};
|
|
76
|
+
const problem = folderProblem(path, writing, roots, deps.workspace());
|
|
77
|
+
if (problem !== void 0) return {
|
|
78
|
+
kind: "deny",
|
|
79
|
+
reason: problem
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
if (files) {
|
|
84
|
+
const refused = check([args["file_path"]], WRITING.includes(exec.name));
|
|
85
|
+
if (refused !== void 0) return refused;
|
|
86
|
+
const listing = exec.name === "read" || exec.name === "read_image" ? folderListing(args["file_path"]) : void 0;
|
|
87
|
+
return listing === void 0 ? await next() : {
|
|
88
|
+
kind: "deny",
|
|
89
|
+
reason: listing
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (search) return check([args["path"] ?? deps.workspace()], false) ?? await next();
|
|
93
|
+
const patch = args["patch"] ?? args["input"];
|
|
94
|
+
const paths = typeof patch === "string" ? patchPaths(patch) : [];
|
|
95
|
+
if (paths.length === 0) return {
|
|
96
|
+
kind: "deny",
|
|
97
|
+
reason: "apply_patch must name its files: write them as whole paths inside the story's folders"
|
|
98
|
+
};
|
|
99
|
+
return check(paths, true) ?? await next();
|
|
100
|
+
}
|
|
101
|
+
/** Puts the jail first in the chain of `tools/pre-execute`. */
|
|
102
|
+
function registerFoldersJail(ctx, deps) {
|
|
103
|
+
ctx.on("tools/pre-execute", (exec, next) => foldersJail(exec, next, deps), { prepend: true });
|
|
104
|
+
}
|
|
105
|
+
export { registerFoldersJail as t };
|
|
106
|
+
|
|
107
|
+
//# sourceMappingURL=jail-Cp4zEfip.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as atomicWrite } from "./access-
|
|
2
|
-
import { i as translator, n as withoutExtension, r as languageOf, t as trimCharacters } from "./text-
|
|
1
|
+
import { n as atomicWrite } from "./access-DifaiHrI.js";
|
|
2
|
+
import { i as translator, n as withoutExtension, r as languageOf, t as trimCharacters } from "./text-Dfv8S8eq.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-
|
|
377
|
+
//# sourceMappingURL=library-BU2A_Dx8.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./access-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { i as translator, r as languageOf } from "./text-
|
|
6
|
-
import {
|
|
1
|
+
import "./access-DifaiHrI.js";
|
|
2
|
+
import { Rt as ImportCardError, i as contextOf, r as MAX_PREVIEW_TEXT } from "./authoring-tools-VOaXzr_R.js";
|
|
3
|
+
import { B as createPresetFromGuidance, bt as IMPORT_FOLDER, cn as LORE_KINDS, dt as lorebookDirectory, ft as readLorebook$1, gt as cleanText, ht as writeLorebookEntry, ln as LORE_SCOPES, mt as updateLorebookInfo, ot as deleteLorebookEntry, st as entriesOf, ut as loadLorebook, vt as partsOf, yt as withPlayer } from "./serial-BZNeK57v.js";
|
|
4
|
+
import { F as textLanguage, I as wrongLanguage, it as shippedPromptsDirectory } from "./hooks-BdR3mBeM.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-BU2A_Dx8.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";
|
|
@@ -151,6 +151,14 @@ const isSteeringTarget = (value) => Object.hasOwn(STEERING_TARGETS, value);
|
|
|
151
151
|
const RULES_TARGETS = ["game-master", "character-rules"];
|
|
152
152
|
/** Whether writing to the prompt changes how the models are told to run the game, not only how the story reads. */
|
|
153
153
|
const isRulesTarget = (target) => RULES_TARGETS.includes(target);
|
|
154
|
+
/** Words of the answer's own vocabulary that a constrained reply wrote into the guidance field instead of the instruction. */
|
|
155
|
+
const LABELS = /* @__PURE__ */ new Set([
|
|
156
|
+
"knowledge",
|
|
157
|
+
"steering",
|
|
158
|
+
"skip",
|
|
159
|
+
...Object.keys(STEERING_TARGETS)
|
|
160
|
+
]);
|
|
161
|
+
const isLabel = (guidance) => LABELS.has(guidance.toLowerCase()) || /^[a-z][a-z0-9_-]*$/i.test(guidance);
|
|
154
162
|
const DECISIONS_SCHEMA = {
|
|
155
163
|
type: "object",
|
|
156
164
|
properties: { entries: {
|
|
@@ -247,6 +255,7 @@ function problemOf(answer, batch) {
|
|
|
247
255
|
const given = answer.entries ?? [];
|
|
248
256
|
const wanted = new Set(batch.map((entry) => entry.ref));
|
|
249
257
|
const seen = /* @__PURE__ */ new Set();
|
|
258
|
+
const language = textLanguage(batch.map((entry) => entry.text).join(" "));
|
|
250
259
|
for (const decision of given) {
|
|
251
260
|
if (!wanted.has(decision.ref)) return `entry ${decision.ref} was not given; the entries are ${[...wanted].join(", ")}`;
|
|
252
261
|
if (seen.has(decision.ref)) return `entry ${decision.ref} is decided twice`;
|
|
@@ -255,6 +264,9 @@ function problemOf(answer, batch) {
|
|
|
255
264
|
if (decision.role === "knowledge" && decision.scope === "listed" && decision.has_secrets !== true && strings(decision.known_by).length === 0) return `entry ${decision.ref} is listed but names nobody who knows it: use everyone, or name them`;
|
|
256
265
|
if (decision.role === "steering" && (!isSteeringTarget(text(decision.target)) || text(decision.guidance) === "")) return `entry ${decision.ref} is steering: say where it belongs (${Object.keys(STEERING_TARGETS).join(", ")}) and give the guidance`;
|
|
257
266
|
const source = batch.find((entry) => entry.ref === decision.ref);
|
|
267
|
+
if (decision.role === "steering" && isLabel(text(decision.guidance))) return `the guidance for entry ${decision.ref} is a label ("${text(decision.guidance)}"), not an instruction: write what the entry asks for`;
|
|
268
|
+
const wrong = decision.role === "steering" && language !== void 0 ? wrongLanguage(language, { [`the guidance for entry ${decision.ref}`]: text(decision.guidance) }) : void 0;
|
|
269
|
+
if (wrong !== void 0) return wrong;
|
|
258
270
|
if (decision.role === "steering" && source !== void 0 && source.text.length > MAX_STEERING_SOURCE_CHARS) return `entry ${decision.ref} is ${source.text.length} characters long, too long to be an instruction: an entry that describes a person, a place or history is knowledge, and what is thrown away as steering is lost. Make it knowledge, or skip it if it is neither`;
|
|
259
271
|
if (decision.role === "steering" && source !== void 0 && text(decision.guidance).length < source.text.length * MIN_STEERING_SHARE) return `the guidance for entry ${decision.ref} is much shorter than the entry (${text(decision.guidance).length} of ${source.text.length} characters): keep everything the entry asks for, or, if it is not an instruction, make it knowledge`;
|
|
260
272
|
}
|
|
@@ -644,6 +656,7 @@ async function lorebookApproval(exec, next, state) {
|
|
|
644
656
|
if (!LOREBOOK_MUTATION_TOOLS.includes(exec.name) || exec.agent === void 0 || lorebookOfChat(exec.agent.session.id) === void 0) return await next();
|
|
645
657
|
const args = exec.arguments;
|
|
646
658
|
const chat = exec.agent.session.id;
|
|
659
|
+
if (state.auto?.() === true && !(exec.name === "apply_steering" && state.waiting(chat).rules)) return await next();
|
|
647
660
|
if (exec.name === "import_lorebook") {
|
|
648
661
|
if (!state.carries(chat)) return await next();
|
|
649
662
|
return {
|
|
@@ -696,4 +709,4 @@ async function lorebookApproval(exec, next, state) {
|
|
|
696
709
|
}
|
|
697
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 };
|
|
698
711
|
|
|
699
|
-
//# sourceMappingURL=lorebook-author-tools-
|
|
712
|
+
//# sourceMappingURL=lorebook-author-tools-DUKcQu8P.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { n as limitAuthoringAgents
|
|
2
|
-
import { t as guardAuthoringTurns } from "./turn-guard-
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
1
|
+
import { n as limitAuthoringAgents } from "./authoring-tools-VOaXzr_R.js";
|
|
2
|
+
import { t as guardAuthoringTurns } from "./turn-guard-xaFxYc1T.js";
|
|
3
|
+
import { t as silenceHarnessDevContext } from "./dev-context-Bdm-eVer.js";
|
|
4
|
+
import { d as lorebookOfChat, i as lorebookAuthorTools, n as LorebookReader, o as pendingTargets, r as lorebookApproval } from "./lorebook-author-tools-DUKcQu8P.js";
|
|
5
|
+
import "./hooks-BdR3mBeM.js";
|
|
6
|
+
import { dt as lorebookDirectory } from "./serial-BZNeK57v.js";
|
|
5
7
|
import { join } from "node:path";
|
|
6
8
|
import { existsSync, readdirSync } from "node:fs";
|
|
7
9
|
// src/lorebook-authoring.ts
|
|
@@ -17,6 +19,7 @@ const inject = [
|
|
|
17
19
|
];
|
|
18
20
|
/** The lorebook authoring chat: reads and writes the entries of one library lorebook, each write approved by the person. */
|
|
19
21
|
function apply(ctx) {
|
|
22
|
+
silenceHarnessDevContext(ctx);
|
|
20
23
|
const library = () => ctx.roleplayRoot.path;
|
|
21
24
|
const reader = new LorebookReader(library);
|
|
22
25
|
const prompting = {
|
|
@@ -44,9 +47,13 @@ function apply(ctx) {
|
|
|
44
47
|
const book = lorebookOfChat(chat);
|
|
45
48
|
return book === void 0 ? void 0 : ctx.roleplayAuthoringLanguages.get(`lorebook:${book}`);
|
|
46
49
|
}, () => ctx.roleplayImport.settings.reasoning);
|
|
50
|
+
ctx.on("session/event", (session, event) => {
|
|
51
|
+
if (event.type === "turn/end" && session.header.origin !== "subagent" && lorebookOfChat(session.id) !== void 0) ctx.roleplayImport.turnEnded(session.id);
|
|
52
|
+
});
|
|
47
53
|
ctx.on("tools/pre-execute", (exec, next) => lorebookApproval(exec, next, {
|
|
48
54
|
carries,
|
|
49
|
-
waiting
|
|
55
|
+
waiting,
|
|
56
|
+
auto: () => ctx.roleplayImport.settings.approval === "auto"
|
|
50
57
|
}));
|
|
51
58
|
const languageOf = (context) => {
|
|
52
59
|
const chat = context.agent?.session.id;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as atomicWriteSync } from "./access-
|
|
1
|
+
import { i as atomicWriteSync } from "./access-DifaiHrI.js";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
4
4
|
// ../dsh-roleplay-model/src/clock.ts
|
|
@@ -14,8 +14,11 @@ const DECISION_SITES = [
|
|
|
14
14
|
"reflection",
|
|
15
15
|
"agency",
|
|
16
16
|
"refusal",
|
|
17
|
+
"repeats",
|
|
17
18
|
"rules",
|
|
18
19
|
"secrets",
|
|
20
|
+
"messages",
|
|
21
|
+
"errands",
|
|
19
22
|
"variables",
|
|
20
23
|
"reuse"
|
|
21
24
|
];
|
|
@@ -37,6 +40,12 @@ const DECISION_MODES = [
|
|
|
37
40
|
];
|
|
38
41
|
/** What a gate can be set to: the modes of any site, or off. */
|
|
39
42
|
const GATE_MODES = ["off", ...DECISION_MODES];
|
|
43
|
+
/** What the repeat check can be set to: a gate's modes, or `strict`, which refuses every repeated sentence by code alone, with no model, and so may refuse a repeat that was meant. */
|
|
44
|
+
const REPEAT_MODES = [
|
|
45
|
+
"off",
|
|
46
|
+
"strict",
|
|
47
|
+
...DECISION_MODES
|
|
48
|
+
];
|
|
40
49
|
const emptySiteStats = () => ({
|
|
41
50
|
runs: 0,
|
|
42
51
|
items: 0,
|
|
@@ -136,6 +145,18 @@ const SETTINGS_SPEC = {
|
|
|
136
145
|
joint: flag(true),
|
|
137
146
|
summary: flag(true)
|
|
138
147
|
},
|
|
148
|
+
schedule: { enabled: flag(true) },
|
|
149
|
+
autonomy: {
|
|
150
|
+
enabled: flag(false),
|
|
151
|
+
messages: flag(true),
|
|
152
|
+
maxUnanswered: integer(1, 20, 3),
|
|
153
|
+
idleMinutes: integer(1, 10080, 15),
|
|
154
|
+
awayHours: integer(1, 720, 12),
|
|
155
|
+
chance: ratio(0, 1, .05),
|
|
156
|
+
decay: ratio(0, 1, .5),
|
|
157
|
+
transitionChance: ratio(0, 1, .4),
|
|
158
|
+
messageGapMinutes: integer(5, 10080, 180)
|
|
159
|
+
},
|
|
139
160
|
sampling: {
|
|
140
161
|
master: ratio(0, 2, .7),
|
|
141
162
|
characters: ratio(0, 2, .8),
|
|
@@ -188,11 +209,17 @@ const SETTINGS_SPEC = {
|
|
|
188
209
|
reflection: choice(DECISION_MODES, "llm"),
|
|
189
210
|
agency: choice(GATE_MODES, "off"),
|
|
190
211
|
refusal: choice(GATE_MODES, "off"),
|
|
212
|
+
repeats: choice(REPEAT_MODES, "off"),
|
|
213
|
+
repeatTurns: integer(1, 30, 6),
|
|
214
|
+
repeatChars: integer(6, 60, 12),
|
|
191
215
|
rules: choice(EXTRA_MODES, "off"),
|
|
192
216
|
secrets: choice(EXTRA_MODES, "off"),
|
|
217
|
+
messages: choice(EXTRA_MODES, "off"),
|
|
218
|
+
errands: choice(EXTRA_MODES, "on"),
|
|
193
219
|
variables: choice(GATE_MODES, "llm"),
|
|
194
220
|
reuse: choice(EXTRA_MODES, "off"),
|
|
195
221
|
gateThreshold: ratio(.1, .95, .5),
|
|
222
|
+
reuseThreshold: ratio(.1, .95, .85),
|
|
196
223
|
confidence: ratio(0, 1, .7)
|
|
197
224
|
},
|
|
198
225
|
interface: { pack: text(60, "") },
|
|
@@ -458,4 +485,4 @@ function decodeOutput(text) {
|
|
|
458
485
|
}
|
|
459
486
|
export { emptyStats as _, liveSettings as a, writeSettings as c, parseSettings as d, parseSwitchboard as f, GATE_SITES as g, DECISION_SITES as h, InvalidSettingsError as i, DEFAULT_SETTINGS as l, rulesOf as m, encodeOutput as n, readSettings as o, WORLD_RULES_KEY as p, encodePreview as r, useChildReasoning as s, decodeOutput as t, SETTINGS_SPEC as u };
|
|
460
487
|
|
|
461
|
-
//# sourceMappingURL=narration-
|
|
488
|
+
//# sourceMappingURL=narration-CDsJ5wxH.js.map
|