@dsh-agentic-roleplay/core 0.7.0 → 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/README.md +1 -1
- package/lib/access-DtOxFKBK.js +150 -0
- package/lib/{authoring-tools-BWjEr_lF.js → authoring-tools-q34iq3hW.js} +160 -74
- package/lib/authoring.js +494 -31
- package/lib/{child-D5SVNk4O.js → child-CyCViUKa.js} +48 -7
- package/lib/client.js +1094 -604
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +3 -3
- package/lib/doctor.js +3 -3
- package/lib/{gallery-C7VOJ3xH.js → gallery-BxZGOgMb.js} +2 -2
- package/lib/{generator-CO8usAjE.js → generator-BFmSYvR8.js} +2 -2
- package/lib/helper.js +1 -1
- package/lib/{hooks-DufjUf1p.js → hooks-HnqXO8mM.js} +6 -245
- package/lib/images.js +4 -4
- package/lib/index.js +168 -104
- package/lib/{library-DsDc6fQa.js → library-BGxPKs9a.js} +6 -3
- package/lib/{lorebook-author-tools-v-PM8Kbs.js → lorebook-author-tools-D9RrMK5g.js} +31 -28
- package/lib/lorebook-authoring.js +8 -3
- package/lib/{narration-_dA9oIt2.js → narration-DvFBqmqe.js} +9 -132
- package/lib/orchestration.js +11 -10
- package/lib/{pack-jail--Ij90LeY.js → pack-jail-MPekqSuQ.js} +14 -12
- package/lib/{packs-DWKnL4YX.js → packs-jowC-MN_.js} +2 -2
- package/lib/{presenter-agent-BHSbyWwZ.js → presenter-agent-DvZtnf0Q.js} +6 -6
- package/lib/{preset-CDNyJhfU.js → preset-VatN-845.js} +3 -3
- package/lib/{preset-author-tools-D7Azdlaq.js → preset-author-tools-8kv1Glxe.js} +11 -10
- package/lib/preset-authoring.js +9 -4
- package/lib/{reflection-CRCWK2E1.js → reflection-CvOZGjmn.js} +9 -170
- package/lib/{presets-D11bxWX0.js → route-DRTJ_vcA.js} +165 -4
- package/lib/text-JbWfTHbr.js +295 -0
- package/lib/turn-guard-BvCs1VxB.js +53 -0
- package/package.json +2 -2
- package/prompts/en/import/cut-off.md +1 -0
- package/prompts/en/import/finish-failed.md +1 -1
- package/prompts/en/import/finish-ok.md +1 -1
- package/prompts/en/roleplay/decide-instruction.md +1 -0
- package/prompts/en/roleplay/decide-irrelevant.md +1 -0
- package/prompts/en/world/procedure.md +1 -1
- package/prompts/zh/import/cut-off.md +1 -0
- package/prompts/zh/import/finish-failed.md +1 -1
- package/prompts/zh/import/finish-ok.md +1 -1
- package/prompts/zh/roleplay/decide-instruction.md +1 -0
- package/prompts/zh/roleplay/decide-irrelevant.md +1 -0
- package/prompts/zh/world/procedure.md +1 -1
- package/lib/access-EbNdZFbk.js +0 -25
- package/lib/text-CT1re6XT.js +0 -18
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "./narration-DvFBqmqe.js";
|
|
2
|
+
import { $ as listFiles, J as PROMPTS_FOLDER, Q as languageOf, et as promptProblem, nt as shippedPromptsDirectory, q as LANGUAGE_FOLDER, tt as shippedLanguages } from "./hooks-HnqXO8mM.js";
|
|
3
|
+
import { u as parseSampling } from "./child-CyCViUKa.js";
|
|
3
4
|
import { dirname, join } from "node:path";
|
|
4
5
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
5
6
|
import { createHash } from "node:crypto";
|
|
@@ -352,6 +353,166 @@ async function createPresetFromGuidance(root, request, guidance, shipped = shipp
|
|
|
352
353
|
}
|
|
353
354
|
}
|
|
354
355
|
//#endregion
|
|
355
|
-
|
|
356
|
+
//#region src/host/decisions/route.ts
|
|
357
|
+
/** The probability from which a yes is taken as a yes, for the confidence a chat asks. */
|
|
358
|
+
const yesAt = (confidence) => (1 + confidence) / 2;
|
|
359
|
+
/** The probability up to which a no is taken as a no. */
|
|
360
|
+
const noAt = (confidence) => (1 - confidence) / 2;
|
|
361
|
+
const clip = (text) => text.length > 120 ? `${text.slice(0, 119)}…` : text;
|
|
362
|
+
const reportOf = (mode, items) => ({
|
|
363
|
+
mode,
|
|
364
|
+
items,
|
|
365
|
+
decided: 0,
|
|
366
|
+
escalated: 0,
|
|
367
|
+
fallbacks: 0,
|
|
368
|
+
agreed: 0,
|
|
369
|
+
disagreed: 0,
|
|
370
|
+
decisionMs: 0,
|
|
371
|
+
llmMs: 0,
|
|
372
|
+
samples: []
|
|
373
|
+
});
|
|
374
|
+
async function timed(run) {
|
|
375
|
+
const started = performance.now();
|
|
376
|
+
return {
|
|
377
|
+
value: await run(),
|
|
378
|
+
ms: Math.round(performance.now() - started)
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Gives each key a verdict the way its site is set to: from the language model, from the decision model, from the decision model where it
|
|
383
|
+
* is confident and the language model elsewhere, or from the language model while comparing it with the decision model. A decision model
|
|
384
|
+
* that cannot be used never stops a story: its keys go to the language model and the report says why.
|
|
385
|
+
*/
|
|
386
|
+
async function routeVerdicts(route, signal) {
|
|
387
|
+
const { mode, keys } = route;
|
|
388
|
+
const report = reportOf(mode, keys.length);
|
|
389
|
+
const verdicts = /* @__PURE__ */ new Map();
|
|
390
|
+
if (keys.length === 0) return {
|
|
391
|
+
verdicts,
|
|
392
|
+
report
|
|
393
|
+
};
|
|
394
|
+
const viaLlm = async (subset) => {
|
|
395
|
+
const { value, ms } = await timed(() => route.llm(subset));
|
|
396
|
+
report.llmMs += ms;
|
|
397
|
+
for (const [key, verdict] of value) verdicts.set(key, verdict);
|
|
398
|
+
};
|
|
399
|
+
const viaDecision = async () => {
|
|
400
|
+
try {
|
|
401
|
+
const { value, ms } = await timed(() => route.probabilities(keys));
|
|
402
|
+
report.decisionMs += ms;
|
|
403
|
+
return value;
|
|
404
|
+
} catch (error) {
|
|
405
|
+
if (signal.aborted) throw error;
|
|
406
|
+
report.problem = error instanceof Error ? error.message : String(error);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
if (mode === "llm") {
|
|
411
|
+
await viaLlm(keys);
|
|
412
|
+
return {
|
|
413
|
+
verdicts,
|
|
414
|
+
report
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
if (mode === "shadow") {
|
|
418
|
+
const [decided] = await Promise.all([viaDecision(), viaLlm(keys)]);
|
|
419
|
+
if (decided === void 0) return {
|
|
420
|
+
verdicts,
|
|
421
|
+
report
|
|
422
|
+
};
|
|
423
|
+
for (const key of keys) {
|
|
424
|
+
const probability = decided.get(key);
|
|
425
|
+
const llm = verdicts.get(key);
|
|
426
|
+
if (probability === void 0 || llm === void 0) continue;
|
|
427
|
+
const decision = probability >= route.yesAt;
|
|
428
|
+
if (decision === llm) report.agreed += 1;
|
|
429
|
+
else {
|
|
430
|
+
report.disagreed += 1;
|
|
431
|
+
if (report.samples.length < 20) report.samples.push({
|
|
432
|
+
turn: route.turn,
|
|
433
|
+
what: clip(route.what(key)),
|
|
434
|
+
probability: Math.round(probability * 1e3) / 1e3,
|
|
435
|
+
decision,
|
|
436
|
+
llm
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return {
|
|
441
|
+
verdicts,
|
|
442
|
+
report
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
const decided = await viaDecision();
|
|
446
|
+
if (decided === void 0) {
|
|
447
|
+
report.fallbacks = keys.length;
|
|
448
|
+
await viaLlm(keys);
|
|
449
|
+
return {
|
|
450
|
+
verdicts,
|
|
451
|
+
report
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
const unsure = [];
|
|
455
|
+
for (const key of keys) {
|
|
456
|
+
const probability = decided.get(key);
|
|
457
|
+
if (probability === void 0) {
|
|
458
|
+
unsure.push(key);
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
if (mode === "hybrid" && probability > route.noAt && probability < route.yesAt) unsure.push(key);
|
|
462
|
+
else verdicts.set(key, probability >= route.yesAt);
|
|
463
|
+
}
|
|
464
|
+
report.decided = keys.length - unsure.length;
|
|
465
|
+
report.escalated = unsure.length;
|
|
466
|
+
if (unsure.length > 0) await viaLlm(unsure);
|
|
467
|
+
return {
|
|
468
|
+
verdicts,
|
|
469
|
+
report
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
/** Asks the decision model one yes-or-no question for each key about one state, in a single request; the answers are probabilities of yes. */
|
|
473
|
+
async function askYesNo(service, state, asks, signal) {
|
|
474
|
+
const questions = Object.fromEntries(asks.map(({ key, instructions }) => [key, {
|
|
475
|
+
type: "noul",
|
|
476
|
+
instructions
|
|
477
|
+
}]));
|
|
478
|
+
const { answers } = await service.decide(state, questions, {
|
|
479
|
+
priority: "background",
|
|
480
|
+
signal
|
|
481
|
+
});
|
|
482
|
+
return new Map(asks.map(({ key }) => [key, answers[key].probability]));
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Says once, through `say`, why a site's decision model could not be used, and again only when the reason changes, so that a story
|
|
486
|
+
* played on without the service does not fill the log.
|
|
487
|
+
*/
|
|
488
|
+
function announceProblem(seen, key, report, say) {
|
|
489
|
+
if (report.problem === void 0) {
|
|
490
|
+
seen.delete(key);
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
if (seen.get(key) === report.problem) return;
|
|
494
|
+
seen.set(key, report.problem);
|
|
495
|
+
say?.(`the decision model could not be used for ${key}, the language model judged instead: ${report.problem}`);
|
|
496
|
+
}
|
|
497
|
+
/** The reports of several routed runs of one site as one: counts and times added, the disagreements kept up to the limit, the latest problem. */
|
|
498
|
+
function mergeReports(mode, reports) {
|
|
499
|
+
const merged = reportOf(mode, 0);
|
|
500
|
+
for (const report of reports) {
|
|
501
|
+
merged.items += report.items;
|
|
502
|
+
merged.decided += report.decided;
|
|
503
|
+
merged.escalated += report.escalated;
|
|
504
|
+
merged.fallbacks += report.fallbacks;
|
|
505
|
+
merged.agreed += report.agreed;
|
|
506
|
+
merged.disagreed += report.disagreed;
|
|
507
|
+
merged.decisionMs += report.decisionMs;
|
|
508
|
+
merged.llmMs += report.llmMs;
|
|
509
|
+
merged.samples.push(...report.samples);
|
|
510
|
+
if (report.problem !== void 0) merged.problem = report.problem;
|
|
511
|
+
}
|
|
512
|
+
merged.samples = merged.samples.slice(-20);
|
|
513
|
+
return merged;
|
|
514
|
+
}
|
|
515
|
+
//#endregion
|
|
516
|
+
export { readWorldPrompt as C, INTENT_TYPES as D, INTENT_STATUSES as E, listWorldPrompts as S, INTENT_HORIZONS as T, savePresetFromWorld as _, routeVerdicts as a, PROSE_PROMPTS as b, createPresetFromGuidance as c, isPresetName as d, listPresets as f, reservePreset as g, readPreset as h, noAt as i, createPresetFromShipped as l, presetDirectory as m, askYesNo as n, yesAt as o, loadPreset as p, mergeReports as r, PRESET_FILE as s, announceProblem as t, deletePreset as u, sha as v, writeWorldPrompt as w, deleteWorldPrompt as x, updatePresetInfo as y };
|
|
356
517
|
|
|
357
|
-
//# sourceMappingURL=
|
|
518
|
+
//# sourceMappingURL=route-DRTJ_vcA.js.map
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
//#region ../dsh-roleplay-model/src/messages-zh.ts
|
|
2
|
+
/** The Chinese of the texts built in code, by the English that stands in the code. A `{name}` is filled in and must stand in both. */
|
|
3
|
+
const ZH = {
|
|
4
|
+
", ": ",",
|
|
5
|
+
"; ": ";",
|
|
6
|
+
": ": ":",
|
|
7
|
+
".": "。",
|
|
8
|
+
" and ": "和",
|
|
9
|
+
"doubtful": "存疑",
|
|
10
|
+
"likely": "较有把握",
|
|
11
|
+
"sure": "确信",
|
|
12
|
+
"open": "畅通",
|
|
13
|
+
"locked": "已上锁",
|
|
14
|
+
"blocked": "被堵住",
|
|
15
|
+
"night": "夜里",
|
|
16
|
+
"morning": "上午",
|
|
17
|
+
"afternoon": "下午",
|
|
18
|
+
"evening": "傍晚",
|
|
19
|
+
"spring": "春季",
|
|
20
|
+
"summer": "夏季",
|
|
21
|
+
"autumn": "秋季",
|
|
22
|
+
"winter": "冬季",
|
|
23
|
+
"today is {holidays}": "今天是{holidays}",
|
|
24
|
+
"Summary": "概述",
|
|
25
|
+
"Personality": "性格",
|
|
26
|
+
"Background": "背景",
|
|
27
|
+
"Appearance": "外貌",
|
|
28
|
+
"How you speak": "说话方式",
|
|
29
|
+
"Talk to {name}.": "和{name}聊聊。",
|
|
30
|
+
"Go to {place}.": "前往{place}。",
|
|
31
|
+
"Take a closer look at {thing}.": "仔细看看{thing}。",
|
|
32
|
+
"Look around carefully.": "仔细观察四周。",
|
|
33
|
+
"Wait and see what happens.": "先等等,看看会发生什么。",
|
|
34
|
+
"Ask what is going on.": "问问这是怎么回事。",
|
|
35
|
+
"Think about what to do next.": "想想接下来该怎么办。",
|
|
36
|
+
"You are {name}.": "你是{name}。",
|
|
37
|
+
"You are also called {names}.": "你也被称作{names}。",
|
|
38
|
+
"age: {value}": "年龄:{value}",
|
|
39
|
+
"gender: {value}": "性别:{value}",
|
|
40
|
+
"pronouns: {value}": "代词:{value}",
|
|
41
|
+
"- {key} ({name}): {use}": "- {key}({name}):{use}",
|
|
42
|
+
"Rolls {dice}.": "掷 {dice}。",
|
|
43
|
+
"Give a target: the difficulty, the number to meet or beat; set it by how hard the attempt is.": "需给出 target:难度,即要达到或超过的数字;按这次尝试的难易来定。",
|
|
44
|
+
"Give a target: the number to stay under; set it by how hard the attempt is.": "需给出 target:要低于的数字;按这次尝试的难易来定。",
|
|
45
|
+
"It adds the character's {variable}.": "它会加上该角色的 {variable}。",
|
|
46
|
+
"Counts the dice that show {hit} or more.": "统计显示 {hit} 或更高的骰子数。",
|
|
47
|
+
"the player's roll": "玩家的掷骰",
|
|
48
|
+
"The player rolled {dice} ({reason}) and got {total}: dice {faces}. This is a fact, decided by the dice: take it into account when you judge the attempt and decide what happens.": "玩家掷了 {dice}({reason}),得到 {total}:骰面 {faces}。这是由骰子决定的事实:在你判断这次尝试、决定发生什么时把它考虑进去。",
|
|
49
|
+
"The checks of this story:": "本故事的检定:",
|
|
50
|
+
"No checks are defined: use roll_dice only.": "没有定义检定:只用 roll_dice。",
|
|
51
|
+
"Situation:": "当前情形:",
|
|
52
|
+
"Now: {time}.": "现在是:{time}。",
|
|
53
|
+
"Where you are:": "你所在之处:",
|
|
54
|
+
"Present:": "在场的人:",
|
|
55
|
+
" (you)": "(你)",
|
|
56
|
+
"What you know is coming:": "你知道即将发生的事:",
|
|
57
|
+
"Just now you notice:": "此刻你注意到:",
|
|
58
|
+
"How you are (what you can tell of yourself):": "你的状态(你自己能感觉到的):",
|
|
59
|
+
"What you can tell of the others here:": "你能看出在场其他人的情况:",
|
|
60
|
+
"What you have on you:": "你身上带着:",
|
|
61
|
+
"Things here: ": "这里有:",
|
|
62
|
+
"Ways out: ": "出路:",
|
|
63
|
+
"Lying about: ": "散落在周围的:",
|
|
64
|
+
"hidden": "隐蔽",
|
|
65
|
+
" holding {things}": ",里面有{things}",
|
|
66
|
+
"; and {count} more": ";另有{count}项",
|
|
67
|
+
"at {feature}": "在{feature}",
|
|
68
|
+
"; and {count} more you can recall if needed": ";另有{count}项,需要时你可以回想起来",
|
|
69
|
+
"What you know exists (this does not tell you where it is now or what state it is in):": "你知道存在的事物(这并不说明它现在在哪里、处于什么状态):",
|
|
70
|
+
"People: ": "人物:",
|
|
71
|
+
"Factions: ": "组织:",
|
|
72
|
+
"Places: ": "地点:",
|
|
73
|
+
"Routes: ": "路径:",
|
|
74
|
+
"Things: ": "物品:",
|
|
75
|
+
"Background you know, to read with recall_my_lore when it bears on the moment: ": "你所知的背景(与当下相关时用 recall_my_lore 查阅):",
|
|
76
|
+
"Your day and what you are after (plans, not orders: keep them, put them off or drop them as the moment and your character suggest):": "你的日程与你想达成的事(只是计划,不是命令:依当下情形和你的性格,可以照做、推迟或放弃):",
|
|
77
|
+
"Your day, now: {activity}{place}, until {until}{note}.": "你此刻的日程:{activity}{place},持续到{until}{note}。",
|
|
78
|
+
"Your day, next: {activity}{place}, from {from}.": "你接下来的日程:{activity}{place},{from}开始。",
|
|
79
|
+
" at {place}": ",在{place}",
|
|
80
|
+
" (not something you would drop lightly)": "(你不会轻易放下)",
|
|
81
|
+
", with {names}": ",与{names}一起",
|
|
82
|
+
"You were to: {title}{place}{with}, at {at}, which has passed and is still open.": "你本应:{title}{place}{with},时间是{at},已经过了,事情仍未了结。",
|
|
83
|
+
"You are due to: {title}{place}{with}, at {at}.": "你约定要:{title}{place}{with},时间是{at}。",
|
|
84
|
+
"What you are after:": "你想达成的事:",
|
|
85
|
+
", by {deadline}, which has passed": ",限期{deadline},已过",
|
|
86
|
+
", by {deadline}": ",限期{deadline}",
|
|
87
|
+
" Next: {plan}.": " 下一步:{plan}。",
|
|
88
|
+
"How you stand with people who bear on this moment (your own view, not objective fact):": "你与和此刻相关的人的关系(是你自己的看法,不是客观事实):",
|
|
89
|
+
" (here)": "(在场)",
|
|
90
|
+
" (not here)": "(不在场)",
|
|
91
|
+
"knows them well": "很了解对方",
|
|
92
|
+
"barely knows them": "几乎不了解对方",
|
|
93
|
+
"trusts them": "信任对方",
|
|
94
|
+
"distrusts them": "不信任对方",
|
|
95
|
+
"is fond of them": "喜欢对方",
|
|
96
|
+
"dislikes them": "不喜欢对方",
|
|
97
|
+
"things are strained between them": "彼此关系紧张",
|
|
98
|
+
"Your affiliations (their goals are pressures and commitments, not commands):": "你的所属组织(其目标是压力和承诺,不是命令):",
|
|
99
|
+
"member": "成员",
|
|
100
|
+
" Goals: {goals}.": " 目标:{goals}。",
|
|
101
|
+
"- {name}: {position}; {status}; commitment {commitment}.": "- {name}:{position};{status};投入程度 {commitment}。",
|
|
102
|
+
" Your view: {attitude}.": " 你的看法:{attitude}。",
|
|
103
|
+
"What you remember that bears on this (only what you took in yourself; do not claim to remember more, and be unsure of what is fuzzy):": "你记得的、与此相关的事(只限你自己亲身经历的;不要声称记得更多,模糊的地方要保持不确定):",
|
|
104
|
+
"What you remember that bears on this: nothing comes to mind.": "你记得的、与此相关的事:想不起任何事。",
|
|
105
|
+
"some time ago": "一段时间以前",
|
|
106
|
+
"just now": "刚才",
|
|
107
|
+
"1 day ago": "1天前",
|
|
108
|
+
"{amount} days ago": "{amount}天前",
|
|
109
|
+
"1 hour ago": "1小时前",
|
|
110
|
+
"{amount} hours ago": "{amount}小时前",
|
|
111
|
+
"1 minute ago": "1分钟前",
|
|
112
|
+
"{amount} minutes ago": "{amount}分钟前",
|
|
113
|
+
"the details are fuzzy": "细节已经模糊",
|
|
114
|
+
"you barely remember": "你几乎记不清了",
|
|
115
|
+
"you are sure of it": "你对此确信无疑",
|
|
116
|
+
"you doubt it": "你对此存疑",
|
|
117
|
+
"something you have seen since speaks against it": "此后你所见所闻有与之相悖的地方",
|
|
118
|
+
"it comes to mind with the rest": "它和其余的事一起浮现在脑海",
|
|
119
|
+
"Earlier in this scene, before this moment:": "这一幕此刻之前发生的事:",
|
|
120
|
+
"What just happened, and what you are reacting to:": "刚才发生的事,以及你在回应的是什么:",
|
|
121
|
+
"- {name} intended: {intent} ({result}) {summary}": "- {name}打算:{intent}({result}){summary}",
|
|
122
|
+
"- {name} said \"{utterance}\" and intended: {intent} ({result}) {summary}": "- {name}说了“{utterance}”,并打算:{intent}({result}){summary}",
|
|
123
|
+
"Your earlier intent did not work out: {intent}\nYou are trying again, knowing the above. Decide again what you do now.": "你先前的打算没有成功:{intent}\n你带着上面这些再试一次。重新决定你现在做什么。",
|
|
124
|
+
"Character: {name}{summary}": "角色:{name}{summary}",
|
|
125
|
+
"What they believe now:": "他们现在的看法:",
|
|
126
|
+
"(nothing yet)": "(暂时没有)",
|
|
127
|
+
"What they have taken in since:": "他们此后经历的事:",
|
|
128
|
+
"Sort their memory.": "请整理他们的记忆。",
|
|
129
|
+
"not acceptable: {problems}": "不可接受:{problems}",
|
|
130
|
+
"{kind}, importance {importance}, {confidence}{about}{dispute}": "{kind},重要性 {importance},{confidence}{about}{dispute}",
|
|
131
|
+
", about {names}": ",关于{names}",
|
|
132
|
+
", something taken in since speaks against it": ",此后经历的事与之相悖",
|
|
133
|
+
"add: at most {max} new beliefs in one pass; merge or choose": "add:一次最多 {max} 条新看法;请合并或取舍",
|
|
134
|
+
"at most {max} changes in one pass": "一次最多 {max} 处修改",
|
|
135
|
+
"{where}: there is no thing it took in numbered {id}": "{where}:没有编号为 {id} 的经历",
|
|
136
|
+
"{where}: confidence is one of {options}": "{where}:confidence 须为 {options} 之一",
|
|
137
|
+
"{where}: unknown kind \"{kind}\"": "{where}:未知的 kind “{kind}”",
|
|
138
|
+
"{where}: say what it believes": "{where}:请写出它相信什么",
|
|
139
|
+
"{where}: at most {max} characters; say it shorter": "{where}:最多 {max} 个字符;请写得更短",
|
|
140
|
+
"{where}: importance runs from {min} to {max}": "{where}:importance 取值为 {min} 到 {max}",
|
|
141
|
+
"{where}: there is no belief numbered {id}": "{where}:没有编号为 {id} 的看法",
|
|
142
|
+
"{where}: one passing moment is not yet a belief; rest it on things from at least two different turns, or on one event that turned the story": "{where}:一个转瞬即逝的瞬间还不是看法;请以至少两个不同回合的经历为依据,或以一件扭转了故事的事件为依据",
|
|
143
|
+
"{where}: to be sure of something it must rest on things from at least two different turns": "{where}:要对某事确信,必须以至少两个不同回合的经历为依据",
|
|
144
|
+
"{where}: \"{name}\" is not a character; name them as they are named": "{where}:“{name}”不是角色;请使用他们的名字",
|
|
145
|
+
"say in a sentence what the belief claims and what the things say, before the verdict": "先用一句话说明这个看法主张什么、这些内容说了什么,再给出判断",
|
|
146
|
+
"the verdict is consistent or contradicted": "判断是 consistent 或 contradicted",
|
|
147
|
+
"a belief that can be true together with all of them names none of them": "与它们全都可以同时成立的看法,不应列出其中任何一条",
|
|
148
|
+
"name the things that cannot be true together with the belief": "写出与这个看法不可能同时成立的内容",
|
|
149
|
+
"there is no thing listed numbered {id}": "列出的内容里没有编号为 {id} 的",
|
|
150
|
+
"thing {id} came before the belief was formed": "内容 {id} 出现在这个看法形成之前",
|
|
151
|
+
"A belief held by {name}: {text}": "{name} 持有的一个看法:{text}",
|
|
152
|
+
"What they took in since that bears on it:": "此后他们接收到的、与之有关的内容:",
|
|
153
|
+
"Can the belief and each of these be true together? Name the ones that cannot be.": "这个看法与其中每一件事能否同时成立?指出不能同时成立的。",
|
|
154
|
+
"{names} could not be sorted this time and will be tried again: {reason}": "{names} 这一次没能整理,下次会再试:{reason}",
|
|
155
|
+
"{where}: belief {id} is already changed in this pass": "{where}:看法 {id} 在这一轮中已经修改过",
|
|
156
|
+
"{where}: say what it took in since that bears on it": "{where}:请写出此后与之相关的经历",
|
|
157
|
+
"{where}: thing {id} came before the belief was formed; cite what came after": "{where}:经历 {id} 发生在看法形成之前;请引用之后发生的事",
|
|
158
|
+
"{where}: say what changes": "{where}:请写出有何改变",
|
|
159
|
+
"{where}: the text must be there and at most {max} characters; leave it out to keep the belief as it is": "{where}:文字不能为空,且最多 {max} 个字符;想保持信念原样就不要写这一项",
|
|
160
|
+
"{where}: the confidence, the importance and the numbers are fields of their own, not part of the text": "{where}:把握程度、重要性和编号是各自独立的字段,不属于文字",
|
|
161
|
+
"{where}: name what speaks against the belief in contradicted_by": "{where}:在 contradicted_by 里写出与该信念相悖的内容的编号",
|
|
162
|
+
"{where}: a belief that something contradicts must be doubted: lower its confidence": "{where}:被事实相悖的看法必须存疑:请降低其 confidence",
|
|
163
|
+
"{where}: to doubt a belief, name what contradicts it in contradicted_by": "{where}:要对看法存疑,请在 contradicted_by 中写明与之相悖的经历",
|
|
164
|
+
"{where}: merge into a belief that stays": "{where}:请合并到保留的看法中",
|
|
165
|
+
"Time: {time}.": "时间:{time}。",
|
|
166
|
+
"The story's time moves only as you say: each round takes what you give it (elapsed_seconds in resolve_round, or the default), and advance_time skips ahead.": "故事的时间只按你说的推进:每一轮耗时由你给定(resolve_round 的 elapsed_seconds,或取默认值),advance_time 可以跳过一段时间。",
|
|
167
|
+
"The player was away for {duration} of real time and the story went on meanwhile: characters have been about their own business, so do not assume anyone is where or as the player left them unless the records say so.": "玩家离开了{duration}的真实时间,其间故事仍在继续:角色们各忙各的事,除非记录另有说明,不要假定任何人还在玩家离开时的位置或状态。",
|
|
168
|
+
"The story's time follows the real clock: it cannot be skipped, and each round takes as long as it really took.": "故事时间跟随真实时钟:无法跳过,每一轮耗时就是它实际花费的时间。",
|
|
169
|
+
"By their routines since you last looked: {moves}.": "按各自的日程,自你上次查看以来:{moves}。",
|
|
170
|
+
"{name} went to {place} ({activity})": "{name}去了{place}({activity})",
|
|
171
|
+
"With the player's character, and their days: {days}. The characters decide for themselves whether to keep to their day; the moment may keep them.": "与玩家角色在一起的人及其日程:{days}。是否照日程行事由角色自己决定;当下的情形也可能拖住他们。",
|
|
172
|
+
", at {place}": ",在{place}",
|
|
173
|
+
"\"{title}\" ({with}{place}) was due {when} and is still open": "“{title}”({with}{place})原定{when},仍未了结",
|
|
174
|
+
"\"{title}\" ({with}{place}) is due {when}": "“{title}”({with}{place})定于{when}",
|
|
175
|
+
"Commitments due soon or overdue: {entries}.": "即将到期或已逾期的约定:{entries}。",
|
|
176
|
+
"named in the move": "被这一步行动点到",
|
|
177
|
+
"in the scene": "在场",
|
|
178
|
+
"own goal: {goal}": "自身目标:{goal}",
|
|
179
|
+
"faction pressure: {goal}": "组织压力:{goal}",
|
|
180
|
+
"high tension toward the player": "对玩家高度紧张",
|
|
181
|
+
"distrusts the player": "不信任玩家",
|
|
182
|
+
"cares about the player": "在意玩家",
|
|
183
|
+
"dislikes the player": "不喜欢玩家",
|
|
184
|
+
"Likely characters to activate, in priority order (advice only; activate only whoever the moment actually reaches):": "可能需要启动的角色,按优先级排列(仅供参考;只启动当下真正牵涉到的人):",
|
|
185
|
+
"socially implicated": "社交上被牵涉",
|
|
186
|
+
"The player's character is in {place}": "玩家角色在{place}",
|
|
187
|
+
"Characters here:": "在这里的角色:",
|
|
188
|
+
"Characters elsewhere (they perceive nothing here unless the moment reaches them):": "在别处的角色(除非当下波及他们,否则感知不到这里的事):",
|
|
189
|
+
"{member} - in {place} ({key})": "{member} - 在{place}({key})",
|
|
190
|
+
"Characters with no place (not part of this scene; they cannot be asked to act):": "没有所在地点的角色(不属于这一幕;不能让他们行动):",
|
|
191
|
+
"the player's character, \"{key}\"": "玩家角色,“{key}”",
|
|
192
|
+
"acts through \"{key}\"": "通过“{key}”行动",
|
|
193
|
+
"Currently: {state}": "目前:{state}",
|
|
194
|
+
"Scene before turn {turn}:": "第 {turn} 回合之前的场景:",
|
|
195
|
+
"What characters have on them:": "角色们身上带着:",
|
|
196
|
+
"The world acted since the last turn, by itself:": "自上一回合以来,世界自行发生的事:",
|
|
197
|
+
"Known beforehand, still to come (who knows of it; it will happen by itself when its time comes):": "事先已知、尚未发生的事(谁知道;时候到了会自行发生):",
|
|
198
|
+
"[known to {who}]": "[知情者:{who}]",
|
|
199
|
+
"Weave these into the story when it fits, then say you did with addressed in narrate (each stays for a few turns and is then let go):": "合适时把这些织入故事,然后在 narrate 的 addressed 中说明已处理(每条会保留几个回合,之后放弃):",
|
|
200
|
+
"What the story keeps track of (change it with variable_changes in an outcome when what happened calls for it):": "故事追踪的内容(发生的事需要时,在结果中用 variable_changes 修改):",
|
|
201
|
+
"Still open in the story:": "故事中仍未了结的事:",
|
|
202
|
+
"Earlier events that bear on what the player just did (from the records of the story):": "与玩家刚才的行动相关的早先事件(来自故事记录):",
|
|
203
|
+
"turn {turn}": "第 {turn} 回合",
|
|
204
|
+
"You were to {title}, at {when}": "你本应{title},时间是{when}",
|
|
205
|
+
"You were to {title} at {place}, at {when}": "你本应在{place}:{title},时间是{when}",
|
|
206
|
+
" ({note})": "({note})",
|
|
207
|
+
"It is {now} now and the time has passed.": "现在是{now},时间已经过了。",
|
|
208
|
+
"It is {now} now.": "现在是{now}。",
|
|
209
|
+
"It was with: {who}.": "同你一起的有:{who}。",
|
|
210
|
+
"You are not with the player's character, and nothing of this happens in front of anyone: decide what you do about it.": "你不和玩家的角色在一起,这件事也不会发生在任何人面前:决定你要怎么处理。",
|
|
211
|
+
"The time you had for \"{goal}\" has passed ({when}; it is {now} now)": "你为“{goal}”预留的时间已过({when};现在是{now})",
|
|
212
|
+
"You are not with the player's character and nothing of this happens in front of anyone: decide what you do about it.": "你不和玩家的角色在一起,这件事也不会发生在任何人面前:决定你要怎么处理。",
|
|
213
|
+
"{names} noticed: {text}": "{names}注意到:{text}",
|
|
214
|
+
"{name} went to {place}.": "{name}去了{place}。",
|
|
215
|
+
"## MCP resource servers\n\nUse {tools} with the server argument naming an MCP server.": "## MCP 资源服务器\n\n使用 {tools},server 参数填 MCP 服务器的名称。",
|
|
216
|
+
"## MCP resource servers\n\nUse {tools} with one of these names as the server argument: {servers}.": "## MCP 资源服务器\n\n使用 {tools},server 参数填下列名称之一:{servers}。",
|
|
217
|
+
"{where}: the text is longer than {max} characters. A belief is not rewritten to hold what speaks against it: leave the text out and list the belief under doubt with the numbers of what speaks against it, and put what was learned as a new belief of its own": "{where}:文字超过 {max} 个字符。不要通过改写信念来容纳与之相悖的事:不要写文字,把这条信念列入 doubt 并给出与之相悖的编号;新了解到的内容另写成一条新信念",
|
|
218
|
+
"Import this card into this newly created world.": "把这张卡片导入这个新建的世界。",
|
|
219
|
+
"Turn the SillyTavern lorebook I uploaded into this lorebook: call {tool} with file {file}.": "把我上传的 SillyTavern 世界书转成这本世界书:调用 {tool},文件为 {file}。",
|
|
220
|
+
"Turn the SillyTavern preset I uploaded into this preset's prompts: call {tool} with file {file}.": "把我上传的 SillyTavern 预设转成这个预设的提示词:调用 {tool},文件为 {file}。",
|
|
221
|
+
"Apply the narration preset I uploaded to this world: call {tool} with file {file}.": "把我上传的叙述预设应用到这个世界:调用 {tool},文件为 {file}。",
|
|
222
|
+
"Card: {name}": "卡片:{name}",
|
|
223
|
+
"Piece: {label}": "片段:{label}",
|
|
224
|
+
"Title: {title}": "标题:{title}",
|
|
225
|
+
"Keys: {keys}": "关键词:{keys}",
|
|
226
|
+
"Card title: {name}": "卡片标题:{name}",
|
|
227
|
+
"The pieces name the card title as a character.": "片段中把卡片标题当作角色提到了。",
|
|
228
|
+
"The card title is not named as a character by any piece.": "没有任何片段把卡片标题当作角色提到。",
|
|
229
|
+
"Names found:": "找到的名字:",
|
|
230
|
+
"{count} pieces": "{count}个片段",
|
|
231
|
+
"about the player's character": "关于玩家的角色",
|
|
232
|
+
"titles: {titles}": "标题:{titles}",
|
|
233
|
+
"characters": "角色",
|
|
234
|
+
"places": "地点",
|
|
235
|
+
"factions": "组织",
|
|
236
|
+
"things": "物品",
|
|
237
|
+
"(none)": "(无)",
|
|
238
|
+
"Make the {kind} that the player plays: {name}": "写出玩家扮演的{kind}:{name}",
|
|
239
|
+
"Make the {kind}: {name}": "写出{kind}:{name}",
|
|
240
|
+
"(also called: {names})": "(又称:{names})",
|
|
241
|
+
"The others in this world, which are the only ones you may refer to:": "这个世界里的其他对象,你只能提到这些:",
|
|
242
|
+
"Source pieces:": "来源片段:",
|
|
243
|
+
"(none: write only what the name itself implies, and leave the rest empty)": "(无:只写名字本身能推出的内容,其余留空)",
|
|
244
|
+
"The entities of this world, which are the only ones the entries may name as subjects:": "这个世界里的对象,条目只能以它们作为主题:",
|
|
245
|
+
"Source piece:": "来源片段:",
|
|
246
|
+
"The instructions of the card:": "卡片的指令:",
|
|
247
|
+
"Characters:": "角色:",
|
|
248
|
+
"Places:": "地点:",
|
|
249
|
+
"Things:": "物品:",
|
|
250
|
+
"The pieces of the card that may describe what it tracks:": "卡片中可能描述其所追踪内容的片段:",
|
|
251
|
+
"Entry {ref}": "条目{ref}",
|
|
252
|
+
"(triggers: {keys})": "(触发词:{keys})",
|
|
253
|
+
"Lorebook: {name}": "世界书:{name}",
|
|
254
|
+
"Authoring {name}": "创作 {name}",
|
|
255
|
+
"Card tags: {tags}": "卡片标签:{tags}",
|
|
256
|
+
"Scenario:": "场景:",
|
|
257
|
+
"Opening:": "开场:",
|
|
258
|
+
"Description:": "描述:",
|
|
259
|
+
"Creator's notes:": "作者备注:"
|
|
260
|
+
};
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region ../dsh-roleplay-model/src/messages.ts
|
|
263
|
+
/** The language a setting such as `zh-CN` or `en` stands for; English when it is none that is known. */
|
|
264
|
+
function languageOf(code) {
|
|
265
|
+
return (code ?? "").trim().toLowerCase().startsWith("zh") ? "zh" : "en";
|
|
266
|
+
}
|
|
267
|
+
const fill = (template, values) => values === void 0 ? template : template.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole);
|
|
268
|
+
const CATALOGUES = { zh: ZH };
|
|
269
|
+
/**
|
|
270
|
+
* The texts the engine builds for a model (briefs, reports, refusals) in a language. The text written in the code is the English one and the key of
|
|
271
|
+
* the others; a text a language lacks is told in English, and a test keeps that from happening.
|
|
272
|
+
*/
|
|
273
|
+
function translator(language) {
|
|
274
|
+
const catalogue = language === "en" ? void 0 : CATALOGUES[language];
|
|
275
|
+
return (text, values) => fill(catalogue?.[text] ?? text, values);
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/shared/text.ts
|
|
279
|
+
/** Remove characters from either end without a backtracking regular expression. */
|
|
280
|
+
function trimCharacters(value, characters, edge = "both") {
|
|
281
|
+
let start = 0;
|
|
282
|
+
let end = value.length;
|
|
283
|
+
if (edge !== "end") while (start < end && characters.includes(value[start])) start += 1;
|
|
284
|
+
if (edge !== "start") while (end > start && characters.includes(value[end - 1])) end -= 1;
|
|
285
|
+
return value.slice(start, end);
|
|
286
|
+
}
|
|
287
|
+
/** A path-like name without its last extension. */
|
|
288
|
+
function withoutExtension(value) {
|
|
289
|
+
const dot = value.lastIndexOf(".");
|
|
290
|
+
return dot < 0 ? value : value.slice(0, dot);
|
|
291
|
+
}
|
|
292
|
+
//#endregion
|
|
293
|
+
export { translator as i, withoutExtension as n, languageOf as r, trimCharacters as t };
|
|
294
|
+
|
|
295
|
+
//# sourceMappingURL=text-JbWfTHbr.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { _ as finishOf, g as cutOff } from "./child-CyCViUKa.js";
|
|
2
|
+
import { ReasoningEffortId, createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
3
|
+
//#region src/host/authoring/turn-guard.ts
|
|
4
|
+
/** Times one turn is steered back after a reply was cut off: a model that rambles again after being told not to will not stop because it is told once more. */
|
|
5
|
+
const MAX_NUDGES = 6;
|
|
6
|
+
/**
|
|
7
|
+
* What keeps an authoring assistant (a chat that edits a world, a preset or a lorebook) from running away, besides the limit on what one request may write.
|
|
8
|
+
* - Its thinking level is the one the settings name for these assistants, when its model offers that level: thinking without end filled the whole request and left a turn with nothing done.
|
|
9
|
+
* - A reply that ran out of room is steered back to act or to sum up. DSH ends a turn whose reply was cut off as soon as it stops, so every stop after the cut-off is steered too, until the assistant finishes by itself.
|
|
10
|
+
* @param languageOf the language the chat's prompts are in, or nothing when the chat is not an authoring chat of this preset.
|
|
11
|
+
* @param reasoning the thinking level the settings give the assistants; empty leaves the chat's own.
|
|
12
|
+
*/
|
|
13
|
+
function guardAuthoringTurns(ctx, prompts, languageOf, reasoning = () => "") {
|
|
14
|
+
const nudged = /* @__PURE__ */ new Map();
|
|
15
|
+
ctx.on("agent/request", async (payload, next) => {
|
|
16
|
+
const config = await next();
|
|
17
|
+
const level = reasoning();
|
|
18
|
+
if (level === "" || payload.agent.session.header.origin === "subagent" || languageOf(payload.agent.session.id) === void 0 || config.reasoningEffort === level) return config;
|
|
19
|
+
try {
|
|
20
|
+
if ((await payload.agent.ctx.llm.resolveModelInfo(config.provider, config.model, payload.signal)).reasoning?.efforts.some((effort) => effort.id === level) !== true) return config;
|
|
21
|
+
} catch {
|
|
22
|
+
return config;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
...config,
|
|
26
|
+
reasoningEffort: ReasoningEffortId(level)
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
ctx.on("agent/turn-stopping", ({ agent, turn }) => {
|
|
30
|
+
if (agent.session.header.origin === "subagent") return;
|
|
31
|
+
const language = languageOf(agent.session.id);
|
|
32
|
+
if (language === void 0) return;
|
|
33
|
+
const key = `${agent.session.id}:${turn}`;
|
|
34
|
+
const told = nudged.get(key) ?? 0;
|
|
35
|
+
if (!(cutOff(agent) || told > 0 && finishOf(agent) !== "stop")) {
|
|
36
|
+
nudged.delete(key);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (told >= MAX_NUDGES) return;
|
|
40
|
+
nudged.set(key, told + 1);
|
|
41
|
+
agent.steer(createUserMessage({
|
|
42
|
+
content: [{
|
|
43
|
+
type: "text",
|
|
44
|
+
text: prompts().text("import/cut-off", language)
|
|
45
|
+
}],
|
|
46
|
+
source: { kind: "roleplay" }
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { guardAuthoringTurns as t };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=turn-guard-BvCs1VxB.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-agentic-roleplay/core",
|
|
3
|
-
"version": "0.7.
|
|
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.
|
|
79
|
+
"@dsh-agentic-roleplay/state": "0.7.2",
|
|
80
80
|
"@dsh-ai-providers/core": "^0.5.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Your last reply was cut off because it ran too long, and nothing in it was acted on. Do not reason at length: decide, and act with a tool call now. If the work is done, or what is left needs the person, finish with a short summary of what was done and what is still open.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
The world was not written, because of these problems. Say so to the person with the problems in plain words
|
|
1
|
+
The world was not written, because of these problems. Say so to the person with the problems in plain words, and stop. Do not edit the world's files to work around them. Run ${build} again at most once, and only if you expect the problems to differ.
|
|
@@ -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
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
You judge one piece of a character card written for a role-playing chat tool: is the piece only an instruction to the AI or the narrator about how to write or run the game, with nothing in it about the story's own characters, places, organisations, objects, history or situation? Instructions are about style, formats, status panels, dice or game mechanics, tracking variables, generating options, or rules for the player's characters. You work only from the text you are shown: never add anything that is not in it. When the piece also describes a person, a place, an organisation, an object, the setting or the starting situation, it is not only an instruction. When you cannot tell, it is not.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
You judge one piece of a character card written for a role-playing chat tool: is the piece only notes to the reader or the card's maker (credits, version notes, links, advertising, a changelog, a blank form or placeholder), with nothing in it about the story's own characters, places, organisations, objects, history or situation, and no instruction for the AI or narrator? You work only from the text you are shown: never add anything that is not in it. When the piece says anything about the story, or tells the AI how to write or run the game, it is not irrelevant. When you cannot tell, it is not.
|
|
@@ -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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
你上一次的回复因为太长被截断了,其中的内容没有被执行。不要长篇推理:立刻做出决定,并通过工具调用去执行。如果工作已经完成,或剩下的需要由用户来决定,就用简短的总结收尾,说明做了什么、还有什么未完成。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
由于下列问题,世界没有写入。请用平实的话把这些问题告诉用户,然后停下。不要通过修改世界的文件来绕过它们。最多再运行一次 ${build},并且只有在你预计这些问题会不同时才这样做。
|
|
@@ -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
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
你要判断一张为角色扮演聊天工具写的角色卡的一个片段:这个片段是否只是给 AI 或叙述者的、关于如何写作或运行游戏的指令,其中完全没有关于故事本身的角色、地点、组织、物品、历史或处境?指令涉及文风、格式、状态栏、骰子或游戏机制、变量追踪、生成选项,或对玩家角色的规则。你只依据所给的文字:绝不添加其中没有的内容。如果这个片段同时描述了某个人、某个地点、某个组织、某件物品、背景设定或开场处境,它就不只是指令。无法判断时,它就不是。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
你要判断一张为角色扮演聊天工具写的角色卡的一个片段:这个片段是否只是写给读者或卡片作者的说明(署名、版本说明、链接、广告、更新日志、空白表单或占位符),其中完全没有关于故事本身的角色、地点、组织、物品、历史或处境,也没有给 AI 或叙述者的指令?你只依据所给的文字:绝不添加其中没有的内容。如果这个片段说到了故事的任何内容,或告诉 AI 如何写作或运行游戏,它就不是无关内容。无法判断时,它就不是。
|
|
@@ -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 对照原文核实。如果这些工具说没有卡,说明这个世界不是导入的,或者卡已被移除。
|