@dsh-agentic-roleplay/core 0.3.6 → 0.4.0
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/{tools-Dy1fgP6B.js → authoring-tools-C_8ClUkP.js} +129 -25
- package/lib/authoring.js +7 -5
- package/lib/{child-CFjnaTZt.js → child-DsixtqTw.js} +94 -2
- package/lib/client.js +3714 -2264
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +1 -1
- package/lib/doctor.js +2 -4
- package/lib/{gallery-DIEgETzU.js → gallery-CDYKJf_O.js} +2 -2
- package/lib/{generator-DJ48HxPI.js → generator-BR1ugzln.js} +2 -2
- package/lib/{deliver-BBgciEEK.js → hooks-B2EhBS_-.js} +1884 -236
- package/lib/images.js +4 -4
- package/lib/index.js +846 -254
- package/lib/{library-9JB9zw5a.js → library-COIktKBa.js} +4 -3
- package/lib/{lorebook-author-tools-Bj31z1cu.js → lorebook-author-tools-C-o0t4dL.js} +118 -43
- package/lib/lorebook-authoring.js +5 -3
- package/lib/{settings-CA6icLL_.js → narration-BT9uvQry.js} +145 -2
- package/lib/orchestration.js +34 -21
- package/lib/{pack-jail-2XztyYAX.js → pack-jail-soI-In96.js} +170 -13
- package/lib/{packs-xHRCcGdb.js → packs-CJPSe5LI.js} +7 -4
- package/lib/{presenter-agent-DnNEG_Mn.js → presenter-agent-Gu34bZwd.js} +6 -6
- package/lib/preset-3zn8xme7.js +242 -0
- package/lib/{preset-author-tools-BxycmoAr.js → preset-author-tools-C-X8G40s.js} +7 -7
- package/lib/preset-authoring.js +6 -3
- package/lib/{presets-gkBWAiVb.js → presets-C3mhqqfz.js} +9 -26
- package/lib/{reflection-q0UpwXlx.js → reflection-Btsj0ZLh.js} +51 -17
- package/package.json +2 -2
- package/packs/scene/map.html +1 -0
- package/packs/scene/strip.html +1 -0
- package/prompts/en/import/lorebook.md +2 -1
- package/prompts/en/import/style.md +1 -0
- package/prompts/en/lorebook/procedure.md +1 -1
- package/prompts/en/preset/procedure.md +1 -1
- package/prompts/en/roleplay/character-lookup.md +1 -0
- package/prompts/en/roleplay/game-master.md +1 -1
- package/prompts/en/world/procedure.md +1 -1
- package/prompts/zh/import/lorebook.md +2 -1
- package/prompts/zh/import/style.md +1 -0
- package/prompts/zh/lorebook/procedure.md +1 -1
- package/prompts/zh/preset/procedure.md +1 -1
- package/prompts/zh/roleplay/character-lookup.md +1 -0
- package/prompts/zh/roleplay/game-master.md +1 -1
- package/prompts/zh/world/procedure.md +1 -1
- package/lib/hooks-DkwFGtNH.js +0 -1060
- package/lib/language-BgyxtB2h.js +0 -38
- package/lib/load-CVwJjIJ5.js +0 -486
- package/lib/narration-DK2kiIjE.js +0 -141
- package/lib/preset-D0FMSeZ9.js +0 -59
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as shippedPromptsDirectory, G as PROMPTS_FOLDER, Q as shippedLanguages, W as LANGUAGE_FOLDER, X as listFiles, Y as languageOf, Z as promptProblem } from "./hooks-B2EhBS_-.js";
|
|
2
|
+
import { s as parseSampling } from "./child-DsixtqTw.js";
|
|
2
3
|
import { dirname, join } from "node:path";
|
|
3
4
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
5
|
import { createHash } from "node:crypto";
|
|
@@ -48,11 +49,7 @@ function fileOf(directory, language, id, shipped) {
|
|
|
48
49
|
/** Every prompt of the story, in a language, and whether the world carries its own version. */
|
|
49
50
|
function listWorldPrompts(directory, language, shipped = shippedPromptsDirectory()) {
|
|
50
51
|
const tag = languageOf(language);
|
|
51
|
-
return readdirSync(join(shipped, "en"), { withFileTypes: true }).filter((entry) => entry.isDirectory() &&
|
|
52
|
-
"import",
|
|
53
|
-
"world",
|
|
54
|
-
"preset"
|
|
55
|
-
].includes(entry.name)).flatMap((entry) => listFiles(join(shipped, "en", entry.name), `${entry.name}/`)).sort().map((id) => ({
|
|
52
|
+
return readdirSync(join(shipped, "en"), { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name === "roleplay").flatMap((entry) => listFiles(join(shipped, "en", entry.name), `${entry.name}/`)).sort().map((id) => ({
|
|
56
53
|
id,
|
|
57
54
|
kind: PROSE_PROMPTS.includes(id) ? "prose" : "rules",
|
|
58
55
|
carried: existsSync(join(directory, PROMPTS_FOLDER, tag, `${id}.md`))
|
|
@@ -104,7 +101,6 @@ const PRESETS_FOLDER = "presets";
|
|
|
104
101
|
const PRESET_FILE = "preset.json";
|
|
105
102
|
const NAME = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
|
|
106
103
|
const MAX_TEXT = 300;
|
|
107
|
-
const SAMPLING_KEYS = ["master", "characters"];
|
|
108
104
|
const isPresetName = (name) => NAME.test(name);
|
|
109
105
|
const presetsDirectory = (root) => join(root, PRESETS_FOLDER);
|
|
110
106
|
function presetDirectory(root, name) {
|
|
@@ -126,20 +122,7 @@ function parseHeader(value, problems) {
|
|
|
126
122
|
}
|
|
127
123
|
return field.trim() || void 0;
|
|
128
124
|
};
|
|
129
|
-
const sampling = {};
|
|
130
|
-
const given = value["sampling"];
|
|
131
|
-
if (given !== void 0 && given !== null) {
|
|
132
|
-
if (!isRecord(given)) problems.push(`${PRESET_FILE}: "sampling" must be an object`);
|
|
133
|
-
else {
|
|
134
|
-
for (const key of Object.keys(given)) if (!SAMPLING_KEYS.includes(key)) problems.push(`${PRESET_FILE}: sampling.${key} is not something a preset sets (${SAMPLING_KEYS.join(", ")})`);
|
|
135
|
-
for (const key of SAMPLING_KEYS) {
|
|
136
|
-
const number = given[key];
|
|
137
|
-
if (number === void 0) continue;
|
|
138
|
-
if (typeof number !== "number" || !Number.isFinite(number) || number < 0 || number > 2) problems.push(`${PRESET_FILE}: sampling.${key} must be a number from 0 to 2`);
|
|
139
|
-
else sampling[key] = number;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
125
|
+
const sampling = parseSampling(value["sampling"], `${PRESET_FILE}: sampling`, problems);
|
|
143
126
|
const title = text("title");
|
|
144
127
|
const description = text("description");
|
|
145
128
|
return {
|
|
@@ -182,13 +165,13 @@ function readPreset(directory, name, shipped = shippedPromptsDirectory()) {
|
|
|
182
165
|
}
|
|
183
166
|
if (files.size === 0 && problems.length === 0) problems.push("the preset carries no prompts");
|
|
184
167
|
const paths = [...files.keys()];
|
|
185
|
-
const ids = [...new Set(paths.map((path) => path.slice(path.indexOf("/") + 1, -3)))].sort();
|
|
168
|
+
const ids = [...new Set(paths.map((path) => path.slice(path.indexOf("/") + 1, -3)))].sort((a, b) => a.localeCompare(b));
|
|
186
169
|
return {
|
|
187
170
|
summary: {
|
|
188
171
|
name,
|
|
189
172
|
title: header.title ?? name,
|
|
190
173
|
description: header.description ?? "",
|
|
191
|
-
languages: [...new Set(paths.map((path) => path.split("/")[0]))].sort(),
|
|
174
|
+
languages: [...new Set(paths.map((path) => path.split("/")[0]))].sort((a, b) => a.localeCompare(b)),
|
|
192
175
|
prompts: ids,
|
|
193
176
|
rules: ids.filter((id) => !PROSE_PROMPTS.includes(id)),
|
|
194
177
|
sampling: header.sampling,
|
|
@@ -324,11 +307,11 @@ async function createPresetFromShipped(root, request, shipped = shippedPromptsDi
|
|
|
324
307
|
}
|
|
325
308
|
}
|
|
326
309
|
/** Makes an empty preset folder that the import is about to fill; it has no prompts yet, so it reads as having problems until it does. */
|
|
327
|
-
async function reservePreset(root, name, title) {
|
|
310
|
+
async function reservePreset(root, name, title, sampling = {}) {
|
|
328
311
|
const target = presetDirectory(root, name);
|
|
329
312
|
if (existsSync(target)) throw new Error(`there is already a preset "${name}"`);
|
|
330
313
|
await mkdir(target, { recursive: true });
|
|
331
|
-
await writeHeader(target, headerFile(title.trim().slice(0, MAX_TEXT) || void 0, void 0,
|
|
314
|
+
await writeHeader(target, headerFile(title.trim().slice(0, MAX_TEXT) || void 0, void 0, sampling));
|
|
332
315
|
return target;
|
|
333
316
|
}
|
|
334
317
|
/**
|
|
@@ -371,4 +354,4 @@ async function createPresetFromGuidance(root, request, guidance, shipped = shipp
|
|
|
371
354
|
//#endregion
|
|
372
355
|
export { readWorldPrompt as _, isPresetName as a, INTENT_STATUSES as b, presetDirectory as c, savePresetFromWorld as d, sha as f, listWorldPrompts as g, deleteWorldPrompt as h, deletePreset as i, readPreset as l, PROSE_PROMPTS as m, createPresetFromGuidance as n, listPresets as o, updatePresetInfo as p, createPresetFromShipped as r, loadPreset as s, PRESET_FILE as t, reservePreset as u, writeWorldPrompt as v, INTENT_TYPES as x, INTENT_HORIZONS as y };
|
|
373
356
|
|
|
374
|
-
//# sourceMappingURL=presets-
|
|
357
|
+
//# sourceMappingURL=presets-C3mhqqfz.js.map
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { r as roleplaySessionOf, t as promptFor } from "./access-EbNdZFbk.js";
|
|
2
|
-
import { f as sha, o as listPresets, s as loadPreset } from "./presets-
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import { a as wrongLanguage } from "./language-BgyxtB2h.js";
|
|
9
|
-
import { i as inheritPacks } from "./packs-xHRCcGdb.js";
|
|
2
|
+
import { f as sha, o as listPresets, s as loadPreset } from "./presets-C3mhqqfz.js";
|
|
3
|
+
import "./narration-BT9uvQry.js";
|
|
4
|
+
import { C as describeTime, D as answerLimits, F as wrongLanguage, G as PROMPTS_FOLDER, J as inheritPrompts, ct as translator, st as languageOf, w as describeWhen } from "./hooks-B2EhBS_-.js";
|
|
5
|
+
import { a as runChild, h as trimCharacters, i as childTrace, n as childSampling, p as estimateAnswer, t as childModel } from "./child-DsixtqTw.js";
|
|
6
|
+
import { a as inheritImages } from "./library-COIktKBa.js";
|
|
7
|
+
import { i as inheritPacks } from "./packs-CJPSe5LI.js";
|
|
10
8
|
import { dirname, join } from "node:path";
|
|
11
9
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
12
10
|
import { createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
@@ -306,7 +304,8 @@ const sharedContext = { brief(request) {
|
|
|
306
304
|
knowledge.factions.length === 0 ? void 0 : `${tr("Factions: ")}${shown(knowledge.factions)}`,
|
|
307
305
|
knowledge.locations.length === 0 ? void 0 : `${tr("Places: ")}${shown(knowledge.locations)}`,
|
|
308
306
|
knowledge.routes.length === 0 ? void 0 : `${tr("Routes: ")}${shown(knowledge.routes)}`,
|
|
309
|
-
knowledge.items.length === 0 ? void 0 : `${tr("Things: ")}${shown(knowledge.items)}
|
|
307
|
+
knowledge.items.length === 0 ? void 0 : `${tr("Things: ")}${shown(knowledge.items)}`,
|
|
308
|
+
knowledge.lore.length === 0 ? void 0 : `${tr("Background you know, to read with recall_my_lore when it bears on the moment: ")}${shown(knowledge.lore)}`
|
|
310
309
|
].filter((line) => line !== void 0);
|
|
311
310
|
if (lines.length > 0) sections.push(`${tr("What you know exists (this does not tell you where it is now or what state it is in):")}\n${lines.join("\n")}`);
|
|
312
311
|
}
|
|
@@ -360,9 +359,8 @@ const acceptsAnyInput = { validate: () => ({ ok: true }) };
|
|
|
360
359
|
/** The game master narrates. */
|
|
361
360
|
const gameMasterNarrates = { narrate: () => Promise.resolve(void 0) };
|
|
362
361
|
/** Compares what was said, ignoring the quotes around it and the way whitespace is laid out. */
|
|
363
|
-
const WRAPPING_QUOTES = /^["“”„«»'‘’]+|["“”„«»'‘’]+$/g;
|
|
364
362
|
function sameWords(a, b) {
|
|
365
|
-
const plain = (text) => text.trim()
|
|
363
|
+
const plain = (text) => trimCharacters(text.trim(), "\"“”„«»'‘’").replace(/\s+/g, " ").trim();
|
|
366
364
|
return plain(a) === plain(b);
|
|
367
365
|
}
|
|
368
366
|
/** How many earlier events the game master is reminded of at most. */
|
|
@@ -719,8 +717,10 @@ function branchTimeline(timeline, boundary, snapshots) {
|
|
|
719
717
|
}
|
|
720
718
|
/** The name of a branch: the story's name with its trailing number counted up, or a 2 added. */
|
|
721
719
|
function branchName(name) {
|
|
722
|
-
const
|
|
723
|
-
|
|
720
|
+
const trimmed = name.trimEnd();
|
|
721
|
+
let start = trimmed.length;
|
|
722
|
+
while (start > 0 && trimmed.charCodeAt(start - 1) >= 48 && trimmed.charCodeAt(start - 1) <= 57) start -= 1;
|
|
723
|
+
const next = start === trimmed.length ? `${name} 2` : `${trimmed.slice(0, start)}${Number(trimmed.slice(start)) + 1}`;
|
|
724
724
|
return next.length > 200 ? `${[...name].slice(0, 190).join("").trimEnd()} 2` : next;
|
|
725
725
|
}
|
|
726
726
|
//#endregion
|
|
@@ -1405,8 +1405,42 @@ function shownOf(session, material) {
|
|
|
1405
1405
|
};
|
|
1406
1406
|
}
|
|
1407
1407
|
const rankOf = (confidence) => MEMORY_CONFIDENCES.indexOf(confidence);
|
|
1408
|
+
function perceptionCitation(text, bracketRequired) {
|
|
1409
|
+
const lower = text.toLowerCase();
|
|
1410
|
+
let from = 0;
|
|
1411
|
+
while (from < lower.length) {
|
|
1412
|
+
const at = lower.indexOf("perception", from);
|
|
1413
|
+
if (at < 0) return false;
|
|
1414
|
+
let end = at + 10;
|
|
1415
|
+
if (lower[end] === "s") end += 1;
|
|
1416
|
+
while (/\s/u.test(lower[end] ?? "")) end += 1;
|
|
1417
|
+
const bracket = lower[end] === "[";
|
|
1418
|
+
if (bracket) end += 1;
|
|
1419
|
+
if ((!bracketRequired || bracket) && /\d/u.test(lower[end] ?? "")) return true;
|
|
1420
|
+
from = at + 1;
|
|
1421
|
+
}
|
|
1422
|
+
return false;
|
|
1423
|
+
}
|
|
1408
1424
|
/** What a model writes into a belief's text when it has not put it in the fields: its confidence, importance or the numbers it rests on. */
|
|
1409
|
-
|
|
1425
|
+
function mixedIntoText(text) {
|
|
1426
|
+
if (perceptionCitation(text, true)) return true;
|
|
1427
|
+
let from = 0;
|
|
1428
|
+
while (from < text.length) {
|
|
1429
|
+
const open = text.indexOf("(", from);
|
|
1430
|
+
if (open < 0) return false;
|
|
1431
|
+
const close = text.indexOf(")", open + 1);
|
|
1432
|
+
if (close < 0) return false;
|
|
1433
|
+
const inside = text.slice(open + 1, close);
|
|
1434
|
+
if (inside.toLowerCase().split(/[^a-z]+/).filter(Boolean).some((word) => [
|
|
1435
|
+
"doubtful",
|
|
1436
|
+
"likely",
|
|
1437
|
+
"sure",
|
|
1438
|
+
"importance"
|
|
1439
|
+
].includes(word)) || perceptionCitation(inside, false)) return true;
|
|
1440
|
+
from = close + 1;
|
|
1441
|
+
}
|
|
1442
|
+
return false;
|
|
1443
|
+
}
|
|
1410
1444
|
/** One step less sure, and no less than doubtful. */
|
|
1411
1445
|
const lowered = (confidence) => MEMORY_CONFIDENCES[Math.max(0, rankOf(confidence) - 1)];
|
|
1412
1446
|
/**
|
|
@@ -1509,7 +1543,7 @@ function proposalProblems(proposal, shown, resolveName, tr = translator("en")) {
|
|
|
1509
1543
|
where,
|
|
1510
1544
|
max: MAX_TEXT
|
|
1511
1545
|
}));
|
|
1512
|
-
if (change.text !== void 0 &&
|
|
1546
|
+
if (change.text !== void 0 && mixedIntoText(change.text)) problems.push(tr("{where}: the confidence, the importance and the numbers are fields of their own, not part of the text", { where }));
|
|
1513
1547
|
if (change.importance !== void 0 && (!Number.isInteger(change.importance) || change.importance < 1 || change.importance > 5)) problems.push(tr("{where}: importance runs from {min} to {max}", {
|
|
1514
1548
|
where,
|
|
1515
1549
|
min: 1,
|
|
@@ -1544,7 +1578,7 @@ function proposalProblems(proposal, shown, resolveName, tr = translator("en")) {
|
|
|
1544
1578
|
where,
|
|
1545
1579
|
max: MAX_TEXT
|
|
1546
1580
|
}));
|
|
1547
|
-
if (change.text !== void 0 &&
|
|
1581
|
+
if (change.text !== void 0 && mixedIntoText(change.text)) problems.push(tr("{where}: the confidence, the importance and the numbers are fields of their own, not part of the text", { where }));
|
|
1548
1582
|
});
|
|
1549
1583
|
const dropped = new Set(drop.map((entry) => entry.id));
|
|
1550
1584
|
drop.forEach((change, index) => {
|
|
@@ -1962,4 +1996,4 @@ function memoryReflector(deps) {
|
|
|
1962
1996
|
//#endregion
|
|
1963
1997
|
export { whereabouts as a, copyPreset as c, switchPreset as d, readTimeline as f, referent as g, sameWords as h, reflectionStatus as i, presetStatus as l, defaultBoundaries as m, memoryReflector as n, TimelineError as o, pathTo as p, recordFailure as r, Timelines as s, dueReflection as t, recordPreset as u };
|
|
1964
1998
|
|
|
1965
|
-
//# sourceMappingURL=reflection-
|
|
1999
|
+
//# sourceMappingURL=reflection-Btsj0ZLh.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-agentic-roleplay/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@deepseek-ai/schemastery": "^3.18.4"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@dsh-agentic-roleplay/state": "0.
|
|
80
|
+
"@dsh-agentic-roleplay/state": "0.4.0",
|
|
81
81
|
"@dsh-ai-providers/core": "^0.1.2"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
package/packs/scene/map.html
CHANGED
package/packs/scene/strip.html
CHANGED
|
@@ -3,5 +3,6 @@ For every entry decide what it is:
|
|
|
3
3
|
- knowledge: a fact about the world (people, places, history, customs, objects, how things work). It is kept word for word, so only give it a short title, a kind and a one-sentence summary.
|
|
4
4
|
- steering: an instruction addressed to the AI about how to write or run the story (tone, tense, perspective, how characters behave, what the narrator must or must not do). Give the target it belongs to and the instruction as short direct guidance to the AI, in the entry's own language, keeping everything it asks for: style (how the narration reads), character-style (how characters speak and act), persona (who the narrator is), game-master (how the game is run) or character-rules (what characters may know and do).
|
|
5
5
|
- skip: neither, or nothing usable (a template, a status panel, a script, an empty or duplicate entry).
|
|
6
|
-
In an instruction, "the character" is the tool's placeholder for the AI itself: write the guidance for the narrator, or for the characters, as the entry means it, never about "the character" as a person. Who knows a fact: use everyone unless the entry itself clearly says that only some characters know it (a secret, a rank's lore, a family tradition). Then use listed and name those characters as the entry does. Do not guess a scope the entry does not state. The triggers shown are only keywords of the tool: ignore them for the decision.
|
|
6
|
+
In an instruction, "the character" is the tool's placeholder for the AI itself: write the guidance for the narrator, or for the characters, as the entry means it, never about "the character" as a person. Who knows a fact: use everyone unless the entry itself clearly says that only some characters know it (a secret, a rank's lore, a family tradition). Then use listed and name those characters as the entry does. Set has_secrets to true for an entry that holds anything not everyone may know: a person's hidden identity, a secret, a hidden motive, private thoughts, or anything the entry marks as hidden or private. Such an entry is never told to everyone: name in known_by the person it is about, or leave it empty and the entry stays with the game master alone. Do not guess a scope the entry does not state. The triggers shown are only keywords of the tool: ignore them for the decision.
|
|
7
|
+
Write titles and summaries in the language the entry is written in. An entry that is long, or that describes a person, a place or history, is knowledge even when it contains advice or rules: never turn it into steering, because steering keeps only a short instruction and the rest is lost.
|
|
7
8
|
Decide every entry, and answer with the number of each.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
You turn the instructions a character card gives to the AI into the style notes of a role-playing world. ${rules}
|
|
2
2
|
Keep only guidance about how the story is written and how the characters behave: voice, tone, perspective, tense, pacing, level of detail, staying in character, manner of speaking, and how a character reacts to what it is asked to do or declines to do. Write it as short, direct guidance to the AI, in the language of the instructions, and keep what the card asks for as faithfully as it can be said in a few sentences.
|
|
3
3
|
Leave out, and list in left_out: rules of the game or how to run it, formats and status panels, instructions about tools, scripts, anything addressed to the player, and anything about specific characters, places or events (those belong to the world, not to the style). Do not add guidance the instructions do not give. When they give none of one kind, leave that field empty.
|
|
4
|
+
The instructions may give the AI a persona of its own (a writer or narrator with a name); never use that name or persona in the notes, and say "the character" or "the narrator" instead. List every such name in persona_names; an answer that contains one is refused.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Use the read tools before making claims or edits. An entry has a title, a kind (history, culture, religion, politics, geography, science, custom, legend or other), a one-sentence summary, a body, and a scope: everyone (common knowledge in the world, the default and what a lorebook is for) or listed (only the characters named in known_by know it; the game master always reads everything). Choose listed only when the entry itself, or the user, says that only some people know it, and name them as the entry does. Entries can relate to other entries of the same book. 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 turn an uploaded SillyTavern lorebook into entries, call import_lorebook with the file the user's message names. Facts become entries word for word; instructions to the AI (how to write, how to behave) are not facts, so they are kept aside. When instructions are waiting, say what they are about, tell the user that prompts other than the persona, style and character style hold rules of the game and that a wrong change can break how the story runs, and only then, if the user agrees, call apply_steering, which makes a new preset in the preset library.
|
|
1
|
+
Use the read tools before making claims or edits. An entry has a title, a kind (history, culture, religion, politics, geography, science, custom, legend or other), a one-sentence summary, a body, and a scope: everyone (common knowledge in the world, the default and what a lorebook is for) or listed (only the characters named in known_by know it; the game master always reads everything). Choose listed only when the entry itself, or the user, says that only some people know it, and name them as the entry does. Entries can relate to other entries of the same book. 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 turn an uploaded SillyTavern lorebook into entries, call import_lorebook with the file the user's message names. Facts become entries word for word; instructions to the AI (how to write, how to behave) are not facts, so they are kept aside. When instructions are waiting, say what they are about, tell the user that prompts other than the persona, style and character style hold rules of the game and that a wrong change can break how the story runs, and only then, if the user agrees, call apply_steering, which makes a new preset in the preset library. 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 +1 @@
|
|
|
1
|
-
Use the read tools before making claims or edits. A preset usually carries the prose prompts, up to three in each language: roleplay/persona (who the narrator is), roleplay/style (how the narration is written) and roleplay/character-style (how characters speak and act). Read the one you are changing first (list_preset_prompts shows which the preset already carries; a prompt it does not carry is read as the shipped default, a good starting point), change only what the request needs, keep every placeholder the original uses (a name in braces after a dollar sign), and write it again in the other languages the preset carries when the user wants them to match. 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 turn an uploaded SillyTavern preset into prompts, call import_narration_preset with the file the user's message names. Other roleplay/ prompts hold rules of the game: touch them only when the user asks, and keep the shipped text and add to it. The suggested temperatures (sampling) are for the narrator (master) and the characters only.
|
|
1
|
+
Use the read tools before making claims or edits. A preset usually carries the prose prompts, up to three in each language: roleplay/persona (who the narrator is), roleplay/style (how the narration is written) and roleplay/character-style (how characters speak and act). Read the one you are changing first (list_preset_prompts shows which the preset already carries; a prompt it does not carry is read as the shipped default, a good starting point), change only what the request needs, keep every placeholder the original uses (a name in braces after a dollar sign), and write it again in the other languages the preset carries when the user wants them to match. 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 turn an uploaded SillyTavern preset into prompts, call import_narration_preset with the file the user's message names. Other roleplay/ prompts hold rules of the game: touch them only when the user asks, and keep the shipped text and add to it. The suggested temperatures (sampling) are for the narrator (master) and the characters only. 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 +1,2 @@
|
|
|
1
1
|
What you remember that bears on the moment is already given to you above, with whatever came to mind along with it. Only if something the situation names is missing from it, ask yourself with recall_my_memories, about that one thing, and no more than a few times in all. When it gives you nothing, there is nothing more to find: do not ask again about the same thing in other words, simply go on with what you know, and never say that you remembered nothing.
|
|
2
|
+
Your own past, skills, training and secrets, and what you know of the world, are not given above: they are the background listed under what you know exists. When the moment asks about any of it, read it with recall_my_lore before you answer, and answer from what it says. When the part about what you remember says nothing comes to mind, do not ask about that same moment.
|
|
@@ -23,7 +23,7 @@ ${preview}
|
|
|
23
23
|
4. Then decide whether to run another round. Run one only if a character was directly addressed by another character, an action calls for an immediate reaction, or something is left hanging that characters would act on; ask only those characters, with what is happening now. Otherwise stop. Hand control back to the player as soon as they are addressed or expected to act. Never run a round to repeat what was said or to fill time. The number of rounds is limited and you are told how many remain.
|
|
24
24
|
5. Decide whether this is a moment worth remembering. The story's memory is not written after every round: it is written when you call record_memory, for every round still waiting. Call it when the story changed phase (a decision made, a secret or fact revealed, a promise or threat, an injury or death, a relationship changed, the place or time moved on, a scene ended), with a short focus naming what matters. Do not call it for small talk or routine movement; those rounds wait and are recorded with the next thing that matters.
|
|
25
25
|
5b. A pacing opportunity is advice, never an event or an instruction to finish a plot. Ignore it when it does not fit. When its named development actually became perceptible through the rounds you resolved, call record_plot_progress with introduced; when the player clearly declined that exact hook, record rejected. Record resolved or abandoned only when play has already settled the whole plot. Never record progress merely because the opportunity was shown to you.
|
|
26
|
-
6. Call narrate with ordered segments. An utterance carries a character's words exactly as received, once each, in the order spoken: never change, add, drop or reorder one. Narration describes only what the player's character can perceive of what the outcomes establish: no new events, no new actions or words of characters, no new facts.
|
|
26
|
+
6. Call narrate with ordered segments. An utterance carries a character's words exactly as received, once each, in the order spoken: never change, add, drop or reorder one. Narration describes only what the player's character can perceive of what the outcomes establish: no new events, no new actions or words of characters, no new facts. Never retell in narration what a character says aloud or what the line already makes plain (the question put, the answer given, the point made): around a line narration shows only manner, gesture and surroundings, and a line is not announced before it is spoken.
|
|
27
27
|
7. Delivering the output ends the turn. Anything you add afterwards is not shown.
|
|
28
28
|
|
|
29
29
|
You may not end a turn before its output is delivered.
|
|
@@ -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.
|
|
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.
|
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
- knowledge:关于世界的事实(人物、地点、历史、习俗、物品、事物如何运作)。它会被原文保留,所以只需给出简短的标题、类型和一句话摘要。
|
|
4
4
|
- steering:写给 AI 的指令,关于如何写作或主持故事(语气、时态、视角、角色的表现、叙述者必须或不得做什么)。给出它所属的目标,并把指令写成简短直接的指引,使用该条目自己的语言,保留它提出的全部要求:style(叙述的文风)、character-style(角色如何说话和行动)、persona(叙述者是谁)、game-master(游戏如何主持)或 character-rules(角色可以知道和做什么)。
|
|
5
5
|
- skip:两者都不是,或没有可用内容(模板、状态栏、脚本、空条目或重复条目)。
|
|
6
|
-
在指令中,“the character”是该工具对 AI 自身的占位词:按条目的本意,把指引写给叙述者或写给角色,不要把它当作某个具体的人来写。谁知道某条事实:除非条目本身明确说明只有部分角色知道(秘密、某个阶层的传闻、家族传统),否则用 everyone。此时用 listed
|
|
6
|
+
在指令中,“the character”是该工具对 AI 自身的占位词:按条目的本意,把指引写给叙述者或写给角色,不要把它当作某个具体的人来写。谁知道某条事实:除非条目本身明确说明只有部分角色知道(秘密、某个阶层的传闻、家族传统),否则用 everyone。此时用 listed,并按条目的称呼写出这些角色。当条目含有并非所有人都可以知道的内容时,把 has_secrets 设为 true:某人隐藏的身份、秘密、隐秘的动机、内心的私密想法,或条目标为隐藏或私密的任何内容。这样的条目绝不会告知所有人:在 known_by 里写出它所描述的那个人,或留空,条目就只有游戏主持人知道。不要猜测条目没有说明的范围。所示的触发词只是该工具的关键词:判断时忽略它们。
|
|
7
|
+
标题和摘要使用条目自己所用的语言。很长的条目,或描述某个人、某个地方、某段历史的条目,即使其中带有建议或规则,也是 knowledge:绝不要把它当作 steering,因为 steering 只保留一条简短的指令,其余都会丢失。
|
|
7
8
|
为每个条目作出决定,并用各自的编号作答。
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
你把角色卡给 AI 的指令,整理成角色扮演世界的文风说明。${rules}
|
|
2
2
|
只保留关于故事如何书写、角色如何表现的指导:语气、口吻、视角、时态、节奏、细节程度、保持角色、说话方式,以及角色对被要求做的事如何反应、如何拒绝。用简短、直接的话写成对 AI 的指导,使用指令所用的语言,并尽量忠实地用几句话说出卡片所要求的。
|
|
3
3
|
不要保留,并列入 left_out:游戏规则或如何运行游戏、格式和状态栏、关于工具的指令、脚本、对玩家说的话,以及关于具体角色、地点或事件的内容(这些属于世界,不属于文风)。不要添加指令没有给出的指导。某一类指令没有给出时,对应字段留空。
|
|
4
|
+
指令可能给 AI 起了自己的名字或身份(例如某位写手或叙述者);说明里不要出现这个名字或身份,请写“角色”或“叙述者”。把所有这类名字列入 persona_names;答案中出现其中任何一个都会被拒绝。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
在作出判断或修改之前,先使用读取工具。条目有标题、类型(history、culture、religion、politics、geography、science、custom、legend 或 other)、一句话摘要、正文,以及适用范围 scope:everyone(世界中的常识,这是默认值,也是世界书的用途)或 listed(只有 known_by 中列出的角色知道;游戏主持人始终能读到全部内容)。只有当条目本身或用户说明只有部分人知道时才选 listed,并按条目的称呼写出这些人。条目可以关联同一本书中的其他条目。每一次写入都需要用户一次性的批准。如果批准被拒绝、被取消或无法获得,不要自动重试:说明没有任何改动,并询问用户希望如何继续。要把上传的 SillyTavern 世界书转换为条目,用用户消息中给出的文件调用 import_lorebook。事实会原文保留为条目;给 AI 的指令(如何写作、如何表现)不是事实,会被单独保存。当有指令在等待处理时,说明它们的内容,告诉用户:除人设、文风和角色风格之外的提示词属于游戏规则,改错可能影响故事的运行;用户同意后,再调用 apply_steering,它会在预设库中创建一个新预设。
|
|
1
|
+
在作出判断或修改之前,先使用读取工具。条目有标题、类型(history、culture、religion、politics、geography、science、custom、legend 或 other)、一句话摘要、正文,以及适用范围 scope:everyone(世界中的常识,这是默认值,也是世界书的用途)或 listed(只有 known_by 中列出的角色知道;游戏主持人始终能读到全部内容)。只有当条目本身或用户说明只有部分人知道时才选 listed,并按条目的称呼写出这些人。条目可以关联同一本书中的其他条目。每一次写入都需要用户一次性的批准。如果批准被拒绝、被取消或无法获得,不要自动重试:说明没有任何改动,并询问用户希望如何继续。要把上传的 SillyTavern 世界书转换为条目,用用户消息中给出的文件调用 import_lorebook。事实会原文保留为条目;给 AI 的指令(如何写作、如何表现)不是事实,会被单独保存。当有指令在等待处理时,说明它们的内容,告诉用户:除人设、文风和角色风格之外的提示词属于游戏规则,改错可能影响故事的运行;用户同意后,再调用 apply_steering,它会在预设库中创建一个新预设。 如果你有搜索网络或阅读网页的工具,而用户提到了你不太了解的设定、作品或来源,请先查询再动笔,并说明查到了什么;不要编造现有作品的事实。如果你没有这类工具,就直说,并请用户自己描述。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
在下结论或修改之前,先用读取类工具查看。预设通常带有行文方面的提示词,每种语言最多三个:roleplay/persona(叙述者是谁)、roleplay/style(叙述怎么写)和 roleplay/character-style(角色怎样说话和行动)。先读你要改的那一个(list_preset_prompts 会显示预设已带有哪些;未带有的提示词读到的是内置默认文本,是个不错的起点),只改请求需要改的部分,保留原文用到的每一个占位符(美元符号后花括号里的名称),用户希望各语言保持一致时,也在预设带有的其他语言中重写。每一次写入都会请用户一次性批准。如果批准被拒绝、取消或无法获得,不要自动重试:说明没有任何改动,并询问用户想怎么继续。要把上传的酒馆(SillyTavern)预设变成提示词,请用用户消息中指明的文件调用 import_narration_preset。其他 roleplay/ 提示词属于游戏规则:只有在用户提出要求时才改动,并保留原有文字、在其后追加。建议温度(sampling)只涉及叙述者(master)和角色(characters)。
|
|
1
|
+
在下结论或修改之前,先用读取类工具查看。预设通常带有行文方面的提示词,每种语言最多三个:roleplay/persona(叙述者是谁)、roleplay/style(叙述怎么写)和 roleplay/character-style(角色怎样说话和行动)。先读你要改的那一个(list_preset_prompts 会显示预设已带有哪些;未带有的提示词读到的是内置默认文本,是个不错的起点),只改请求需要改的部分,保留原文用到的每一个占位符(美元符号后花括号里的名称),用户希望各语言保持一致时,也在预设带有的其他语言中重写。每一次写入都会请用户一次性批准。如果批准被拒绝、取消或无法获得,不要自动重试:说明没有任何改动,并询问用户想怎么继续。要把上传的酒馆(SillyTavern)预设变成提示词,请用用户消息中指明的文件调用 import_narration_preset。其他 roleplay/ 提示词属于游戏规则:只有在用户提出要求时才改动,并保留原有文字、在其后追加。建议温度(sampling)只涉及叙述者(master)和角色(characters)。 如果你有搜索网络或阅读网页的工具,而用户提到了你不太了解的设定、作品或来源,请先查询再动笔,并说明查到了什么;不要编造现有作品的事实。如果你没有这类工具,就直说,并请用户自己描述。
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
与此刻有关的记忆,以及随之浮现的事,上面已经给了你。只有当情境中提到的某件事不在其中时,才用 recall_my_memories 问问自己,只问那一件事,总共不要超过几次。如果它什么也没给你,就说明没有更多可找的:不要换个说法再问同一件事,就按你已知的继续,绝不要说自己什么也没想起来。
|
|
2
|
+
你自己的过往、本领、所受的训练和秘密,以及你对这个世界的了解,上面并没有给出:它们就是“你知道存在的事物”里列出的背景。当此刻问到其中任何一件,先用 recall_my_lore 查阅再回答,并按其所述作答。如果“你记得的事”一栏写着什么也想不起来,就不要再去问同一个时刻。
|
|
@@ -23,7 +23,7 @@ ${preview}
|
|
|
23
23
|
4. 然后决定是否再运行一轮。只有当某个角色被另一个角色直接对话、某个行动需要立即的反应,或者留下了角色们会据此行动的悬而未决之事时才运行;只询问那些角色,并说明现在正在发生什么。否则就停止。一旦玩家被对话或需要由玩家行动,就立刻把控制权交还给玩家。绝不为了重复说过的话或打发时间而运行一轮。轮数是有限制的,你会被告知还剩几轮。
|
|
24
24
|
5. 决定这是否是一个值得记住的时刻。故事的记忆不是每一轮之后都写:它是在你调用 record_memory 时,为所有仍在等待的轮次写入的。当故事换了阶段时调用它(作出了决定、揭示了秘密或事实、许下承诺或发出威胁、受伤或死亡、关系变了、地点或时间向前推进了、一个场景结束了),并用简短的 focus 点明什么要紧。闲聊或例行的移动不要调用;这些轮次会等着,在下一件要紧的事发生时一并被记录。
|
|
25
25
|
5b. 节奏契机(pacing opportunity)只是建议,绝不是事件,也不是让你结束某条情节的指示。不合适时就忽略它。当它所说的发展真的通过你演绎的各轮变得可以被感知时,调用 record_plot_progress 并记为 introduced;当玩家明确拒绝了这个具体的引子时,记为 rejected。只有当玩法已经让整条情节有了定论时,才记为 resolved 或 abandoned。绝不仅仅因为向你展示过这个契机,就记录进展。
|
|
26
|
-
6. 用有序的片段调用 narrate。台词(utterance)原样转述某个角色所说的话,每句只出现一次,按说话的顺序:绝不修改、添加、删去或调换其中任何一句。叙述(narration
|
|
26
|
+
6. 用有序的片段调用 narrate。台词(utterance)原样转述某个角色所说的话,每句只出现一次,按说话的顺序:绝不修改、添加、删去或调换其中任何一句。叙述(narration)只描述玩家的角色能感知到的、结果所确立的内容:不要有新的事件,不要有角色新的行动或话语,不要有新的事实。叙述里绝不要复述角色说出口的话,也不要重复台词本身已经说明白的内容(问了什么、答了什么、要说的重点):台词前后的叙述只写神态、动作和周围的环境,不要在台词出现之前先把它预告一遍。
|
|
27
27
|
7. 交付输出就结束了这一回合。你之后再添加的任何内容都不会显示。
|
|
28
28
|
|
|
29
29
|
在输出交付之前,你不得结束回合。
|
|
@@ -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 写入完整的文档;如果触发器提到世界里没有的东西,会连同所有问题一起被拒绝,请全部修正。 如果你有搜索网络或阅读网页的工具,而用户提到了你不太了解的设定、作品或来源,请先查询再动笔,并说明查到了什么;不要编造现有作品的事实。如果你没有这类工具,就直说,并请用户自己描述。
|