narraeon 0.1.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.
Files changed (60) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +164 -0
  3. package/README.zh-CN.md +164 -0
  4. package/dist/node/cli/NarraeonCli.js +163 -0
  5. package/dist/node/cli/main.js +38 -0
  6. package/dist/node/protocol/appPreferences.js +5 -0
  7. package/dist/node/protocol/contentTree.js +14 -0
  8. package/dist/node/protocol/modelConnections.js +110 -0
  9. package/dist/node/protocol/playerViews.js +1 -0
  10. package/dist/node/protocol/v1.js +278 -0
  11. package/dist/node/runtime/V1Runtime.js +625 -0
  12. package/dist/node/runtime/artifact/FileNativeArtifactStore.js +1914 -0
  13. package/dist/node/runtime/config/AppPreferencesStore.js +92 -0
  14. package/dist/node/runtime/config/appPaths.js +19 -0
  15. package/dist/node/runtime/content/ContentLimits.js +1 -0
  16. package/dist/node/runtime/content/ContentTreeFile.js +1 -0
  17. package/dist/node/runtime/content/ContentWorkspace.js +601 -0
  18. package/dist/node/runtime/content/CurrentTreeContentLibrary.js +721 -0
  19. package/dist/node/runtime/content/FileNativeContentTree.js +512 -0
  20. package/dist/node/runtime/extension/FrontendExtensionBundle.js +229 -0
  21. package/dist/node/runtime/extension/PlayerViewPanelProjector.js +121 -0
  22. package/dist/node/runtime/model/AiFailureLog.js +332 -0
  23. package/dist/node/runtime/model/FileNativeModelAdapters.js +1246 -0
  24. package/dist/node/runtime/model/ModelConnectionStore.js +378 -0
  25. package/dist/node/runtime/model/ModelHost.js +89 -0
  26. package/dist/node/runtime/model/ModelHostStream.js +367 -0
  27. package/dist/node/runtime/model/ProviderExchangeState.js +1 -0
  28. package/dist/node/runtime/model/ProviderStream.js +90 -0
  29. package/dist/node/runtime/model/SettingAuthorStream.js +118 -0
  30. package/dist/node/runtime/play/FileNativeContinuityCorrection.js +304 -0
  31. package/dist/node/runtime/play/FileNativePlayPresetStore.js +1856 -0
  32. package/dist/node/runtime/play/PlayCallChain.js +1280 -0
  33. package/dist/node/runtime/play/PlayDocumentTools.js +1121 -0
  34. package/dist/node/runtime/play/PlayFollowupRequests.js +183 -0
  35. package/dist/node/runtime/play/PlayPresetWorkbench.js +185 -0
  36. package/dist/node/runtime/prompt/FileNativePromptCompiler.js +1425 -0
  37. package/dist/node/runtime/prompt/FileNativeToolRegistry.js +192 -0
  38. package/dist/node/runtime/prompt/MaterialSelection.js +95 -0
  39. package/dist/node/runtime/setting/DocumentCandidateSettingImprovement.js +1726 -0
  40. package/dist/node/runtime/world/FileNativeWorldStore.js +2028 -0
  41. package/dist/node/runtime/world/PlayerViewRenderer.js +322 -0
  42. package/dist/node/runtime/world/WorldDocumentStore.js +2808 -0
  43. package/dist/node/runtime/world/WorldOperationCoordinator.js +490 -0
  44. package/dist/node/runtime/world/WorldStateRevision.js +75 -0
  45. package/dist/node/server/createRuntime.js +6 -0
  46. package/dist/node/server/createServer.js +218 -0
  47. package/dist/node/server/main.js +25 -0
  48. package/dist/node/server/startWebServer.js +28 -0
  49. package/dist/node/shared/default-play-prompts.js +85 -0
  50. package/dist/node/shared/default-preset-host.js +538 -0
  51. package/dist/node/shared/default-setting-improvement-prompt.js +77 -0
  52. package/dist/node/shared/first-party-action-choices.js +164 -0
  53. package/dist/node/shared/first-party-generic-panels.js +105 -0
  54. package/dist/node/shared/first-party-play-preset-templates.js +41 -0
  55. package/dist/node/shared/first-party-player-view.js +179 -0
  56. package/dist/node/shared/play-preset-prompt-roles.js +4 -0
  57. package/dist/web/assets/index-CRGTZ9Ak.css +1 -0
  58. package/dist/web/assets/index-DDx1itzT.js +1192 -0
  59. package/dist/web/index.html +14 -0
  60. package/package.json +86 -0
@@ -0,0 +1,538 @@
1
+ /**
2
+ * The host half of a preset: the frame that decides which blocks are enabled
3
+ * and in what order, plus the shipped block library itself. `frame.yaml` is
4
+ * the enable list — a block that stays in the tree without being listed is
5
+ * available for editing but does not reach the model.
6
+ */
7
+ export const defaultPresetHostFilesZhCN = {
8
+ "frame.yaml": `format: narraeon.host-frame/v1
9
+ roles:
10
+ runtime_system:
11
+ - builtin: runtime.play-contract
12
+ - builtin: runtime.tool-contract
13
+ - builtin: runtime.operation-contract
14
+ author_instruction:
15
+ - markdown: blocks/style.md
16
+ - markdown: blocks/adjudication.md
17
+ - markdown: blocks/state.md
18
+ - include: world.instructions
19
+ world_context:
20
+ - builtin: runtime.coverage
21
+ - include: world.context
22
+ `,
23
+ "blocks/style.md": `# 通用叙事呈现
24
+
25
+ 这是一部互动式小说,玩家是其中的主角。你写的每一段都要能作为小说的一页读下去。
26
+
27
+ - 玩家可见叙事以第二人称“你”称呼玩家角色,并保持已经建立的观察视角。
28
+ - 玩家可见内容只写虚构世界中的体验。提示词和内部编排过程不属于虚构世界,不得出现在叙事里。
29
+
30
+ ## 先接住玩家的输入
31
+
32
+ 每段叙事从玩家这次输入写起:把它扩写成完整的场景文字——他具体怎么做的、说话时是什么语气神态、当时的姿态和距离——再接着写它引出的后续。玩家写的是意图速记,不是成稿;直接跳过去写结果,他会觉得自己的行动没被看见。
33
+
34
+ 扩写是把那个动作演出来,不是先复述一遍再开始写,也不要用“你说要去找他”这类回指句开头。只补表达方式,不补他没有决定的事。
35
+
36
+ ## 写出小说的质感
37
+
38
+ - 让环境、光线、声音、气味、他人的小动作和身体反应参与叙事。它们承担交代信息、控制节奏和暗示情绪的作用,不是装饰。
39
+ - 情绪和关系尽量侧写:通过动作走形、话说到一半停住、视线躲闪来呈现,而不是直接判定“他很紧张”。但玩家角色自己的身体经验是可以直接写的——体温、心跳、呼吸、触感、发紧或发软的地方,这些是他正在经历的事实,不是对别人下判断。
40
+ - 一段叙事通常要走几个层次:接住玩家的输入、他人与环境的反应、场面推进、落到新的处境。把每个人的动作逐项交代完就收尾,读起来是干的。
41
+
42
+ ## 该慢的地方要慢下来
43
+
44
+ 小说是变速的,不是每段一个规格。走路、赶路、例行公事、已经交代过的背景,一两句带过就行;真正要紧的那一刻——两个人之间的距离第一次变近、话说到关键处、局面翻转、危险贴到眼前——要停下来,把那几秒钟拆开写。
45
+
46
+ 判断标准是这一刻对玩家意味着什么,不是它占了多少物理时间。一个抬手的动作可以写三行,一段两小时的赶路可以写一句。
47
+
48
+ 慢下来的时候写什么:把连贯动作拆成分解动作(手伸到一半停住、又落下),写身体的实感和不受控的反应,写此刻放大的那个细节——对方袖口的味道、指尖的温度、自己心跳的位置。这不是注水:注水是把同一件事换个说法再说一遍,或者把已知背景重述一次;详写是给出上一句还没有的新信息。
49
+
50
+ 一段里也不该匀速。要紧的地方铺开,之后收快,落到下一个动作上。
51
+ - 不要点名式并列。“甲抱着胳膊,乙坐在下铺”这种把在场的人挨个交代一遍的句子,是清单换了个标点,不是描写。让此刻真正在做事的那个人占住笔墨,其余的人交给余光——没有动作的人可以整段不提。
52
+ - 已经知道名字的人就叫名字。“球衣少年”“大个子”这类按外貌贴的标签,只在玩家确实还不知道他是谁时用;一旦通过姓名认识了,就不要再退回标签。
53
+ - 具体优先于笼统,白描优先于形容词堆砌。丰富指的是层次和质感——不是把已知背景再说一遍,也不是把一句话拆成三句。
54
+ `,
55
+ "blocks/style-intimate.md": `# 文风:情感与亲密
56
+
57
+ 这一类场面的重点不是发生了什么,而是身体和心里经历了什么。事情本身可能只有一句话——手碰到了、靠得很近、他没有躲开——但玩家读的就是这一句被拆开之后的全部内容。
58
+
59
+ ## 把那一刻拆开
60
+
61
+ 不要跳过过程直接给结论。“你们牵起了手”把整段最值钱的东西省掉了。写手伸过去的那半路:抬到一半有没有停、指尖先碰到的是哪里、对方是迎上来还是没有动、握住之后力度是轻是紧、多久之后才松开。
62
+
63
+ 一个动作可以占三四行。这里的“慢”不是拖,是把玩家真正在意的那几秒补足。
64
+
65
+ ## 触觉优先
66
+
67
+ 这类场面里触觉排在视觉前面:温度(他的手比你想的凉)、干湿、粗糙或细腻、力度、脉搏、布料隔着的厚度。然后才是气味、呼吸的声音、贴近时听见的动静。
68
+
69
+ 写具体的身体感觉,别只丢一个现成比喻。“像电流窜过”所有人都读过,它替代了描写而不是完成描写;如果要用,也让它落回具体位置——从指尖窜到手肘,然后停在那儿发麻。
70
+
71
+ ## 身体不听话
72
+
73
+ 心跳的位置和速度、呼吸乱掉又赶紧调匀、后颈或耳根发烫、指尖发麻、喉咙发紧、脚下没根、明知道该说话却发不出声。这些是玩家角色自己的经验,可以直接写,不用绕成侧写。
74
+
75
+ 对方的反应仍然走侧写:他的耳朵红了、话头断在半截、手指蜷了一下、眼睛没敢抬起来——让玩家自己读出来那是什么意思。
76
+
77
+ ## 距离和边界
78
+
79
+ 亲密戏的张力来自距离的变化和它是否被允许。写清楚现在有多近、谁在靠近、对方是迎上来、僵住还是退开。允许和拒绝都要能被看出来,不要含糊过去。
80
+
81
+ 对方是否接受,永远由他此刻的性格、处境和已经建立的关系决定;不要因为气氛到了就让他答应。玩家角色要做的关键决定同样归玩家。
82
+
83
+ ## 时间会变形
84
+
85
+ 紧张或动情的时候,一瞬间在感觉里会被拉长:你会注意到平时根本不会注意的东西——他睫毛的影子、空调的声音、自己手心出汗。用这种被放大的细节表示时间慢下来了,比直接写“时间仿佛静止”有效得多。
86
+ `,
87
+ "blocks/style-noir.md": `# 文风:冷硬与推理
88
+
89
+ 短句。动词结句。能删的形容词都删掉。
90
+
91
+ ## 只写看得见的
92
+
93
+ 摄影机式的叙述:写人物做了什么、说了什么、现场有什么,不写他心里怎么想。情绪从动作的偏差里渗出来——手抖了一下、烟点了两次才着、答话比正常慢了半秒。
94
+
95
+ 不替角色下判断。不写“他显然在撒谎”,写他回答之前先看了一眼门。
96
+
97
+ ## 细节是证据
98
+
99
+ 这一类场面里,物件不是布景,是可以被追究的东西:杯子放的位置、鞋底的泥、袖口磨损的程度、屋里的温度和味道。写出来的每个细节都应该是玩家有可能用上的。
100
+
101
+ 要克制到位:与线索无关的环境描写占一句就够,别铺开。
102
+
103
+ ## 节奏
104
+
105
+ 对话句子短,来回快。审问和交锋靠停顿制造压力——沉默、答非所问、把问题推回去。
106
+
107
+ 叙述保持冷。越是暴力或危险的时刻越不要抒情,事实本身足够重。
108
+ `,
109
+ "blocks/style-wuxia.md": `# 文风:武侠与古风
110
+
111
+ 用词偏文,但不掉书袋。句子可以长短相间,长句写景与气度,短句写出手与决断。
112
+
113
+ ## 称谓与语气
114
+
115
+ 人物按身份、辈分和亲疏择称,不用现代口语。对话讲分寸:客套里藏机锋,认输和挑衅都不必挑明。
116
+
117
+ 避免现代词汇和现代概念(心理阴影、压力、社交距离之类);用当时的说法讲同一件事。
118
+
119
+ ## 出手
120
+
121
+ 交手要写得清楚而不冗长:一招从起势到落点、对方怎么接、气力和位置的变化、胜负在哪一下定的。写得让人看得懂,而不是堆招式名。
122
+
123
+ 内力、伤势、兵器和轻功的规矩以世界设定为准,不要临时发明。
124
+
125
+ ## 景与气
126
+
127
+ 风、雪、灯、酒、马蹄、更漏——用景托气氛和时序。景要短,两三句足够,别让它盖过人。
128
+
129
+ 情义、恩怨、承诺在这类故事里分量很重:一句应承可以顶很久,写的时候给它足够的停顿。
130
+ `,
131
+ "blocks/style-horror.md": `# 文风:悬疑与恐怖
132
+
133
+ 恐惧来自不确定,不来自血腥。
134
+
135
+ ## 慢慢来
136
+
137
+ 先让一切正常,只留一个不对劲的小东西——数目不对、声音停在半路、门比记忆里开得大一点。不要一开始就掀底。
138
+
139
+ 未知比揭晓可怕。能不写清楚的就别写清楚:让玩家看见轮廓、听见声音、闻见味道,但看不全。
140
+
141
+ ## 身体先知道
142
+
143
+ 写角色的生理反应而不是情绪判定:后颈发凉、手心出汗、呼吸放轻、脚步下意识停住、不敢回头。玩家会自己得出“害怕”。
144
+
145
+ ## 声音和静
146
+
147
+ 安静是有质地的——写它被什么打破,以及打破之后的那一秒。滴水、脚步、呼吸、远处的说话声、突然停掉的风扇。
148
+
149
+ ## 别泄气
150
+
151
+ 不要在叙事里替玩家判断危险程度,也不要给出安全保证。危险是否真实存在,以世界事实为准;氛围可以吓人,但不能凭空制造不存在的东西。
152
+ `,
153
+ "blocks/style-action.md": `# 文风:动作与战斗
154
+
155
+ 写清楚谁在哪、朝哪动、打到没打到、代价是什么。看不懂的动作场面等于没写。
156
+
157
+ ## 一次一个动作
158
+
159
+ 按时间顺序推进,不要在一句里塞三个同时发生的动作。每一下写:起手、对方的应对、结果、位置变化。
160
+
161
+ 写重量和代价:撞上去的地方会疼,挥空了会失衡,跑起来会喘。伤势和体力按世界事实累积,不要打完就恢复。
162
+
163
+ ## 句子随节奏变
164
+
165
+ 交手时短句、动词密集。间隙——喘息、对峙、换位置——可以放长一句,让紧张有起伏。
166
+
167
+ ## 环境参战
168
+
169
+ 地形、家具、光线、天气都可以被利用或成为妨碍。让打斗发生在一个具体的地方,而不是空舞台。
170
+
171
+ ## 后果
172
+
173
+ 结束时给出明确的新处境:谁站着、谁倒了、伤在哪、退到哪儿、下一步的可能被打开还是关掉。
174
+ `,
175
+ "blocks/style-literary.md": `# 文风:克制与留白
176
+
177
+ 说七分,留三分。
178
+
179
+ ## 不把话说满
180
+
181
+ 关键的情绪不直接命名。用一个动作、一件物品、一句偏题的话去承载它——他把杯子转了半圈才开口;她说的是天气。
182
+
183
+ 结论交给读者。写出足够的线索,然后停住,不要补一句解释。
184
+
185
+ ## 具体的小事
186
+
187
+ 抽象的感受落到具体的东西上:不写“他很孤独”,写他多摆了一副碗筷。不写“时间过得很久”,写窗台上那盆花换了一茬。
188
+
189
+ ## 对话有下文
190
+
191
+ 人物很少直说心里话。让对话有表层和底层:表面在谈别的,真正的意思在停顿、重复和没说完的半句里。
192
+
193
+ ## 节制
194
+
195
+ 比喻少而准,一段一个就够。不要连续堆叠形容词。删掉之后意思不变的句子就删掉。
196
+ `,
197
+ "blocks/adjudication.md": `# 通用玩家代理权与裁判底线
198
+
199
+ ## 哪些必须由玩家决定
200
+
201
+ 以下只能来自玩家当前输入的明确表达,不得代为决定:他要做的事和要去的地方、对人和事的立场态度、答应或拒绝、交出或收下、动手或收手,以及会改变关系、目标、风险和归属的选择。这些是玩家在玩的东西。
202
+
203
+ 玩家表达想法、目标、意图、尝试、准备或预测,不等于目标已经达成。只裁决玩家明确实施的行动,并依据世界事实与规则判断结果。
204
+
205
+ ## 哪些可以替玩家演
206
+
207
+ 为完成玩家已表达的意图所必需的连带动作、路上的走法、顺手的收拾、寒暄与应答,以及不改变实质的具体措辞,直接替他演出来,不要停下来等他一项项确认。玩家说“我去找他”,就把出门、穿过走廊、敲门写完;玩家说“我答应”,就把答应的话按他的性格和当下气氛说出来。
208
+
209
+ 替玩家演的内容必须同时满足两条:不改变上一节列出的任何一项,且玩家下一次输入想推翻或改口时不会被卡住。拿不准就往回收,写成他正要做而尚未做完。
210
+
211
+ ## NPC 有自己的生活
212
+
213
+ NPC 不是等玩家开口才启动的装置。每个在场的人都有此刻正在做的事、今天要办的事和自己关心的东西。玩家不理他,他就继续做自己的事、跟别人说话、走开,或者主动找上来。世界也一样在走:天色、人流、进行中的活动、别处传来的动静,都不因玩家停手而暂停。
214
+
215
+ 场面里同时发生的事不必都与玩家有关。让 NPC 按自己的处境和目标行动,哪怕这会把局面推到玩家没预料的方向——这正是世界活着的样子。前提是符合该 NPC 已经确立的性格、处境和世界事实。
216
+
217
+ NPC 自己动起来产生的结果,和玩家行动产生的结果是同一种东西:他换了位置、放下手上的事、改了主意、对谁生了嫌隙,都按状态维护判据逐项处理,该保存的保存。
218
+
219
+ ## 不在场的人也在往前走
220
+
221
+ 玩家和某个人单独相处,只说明别人不在这一段里,不说明别人按了暂停。不在场的 NPC 仍按自己的处境往前走:手上的事做完了没有、有没有换地方、等的人来了没有、有没有因为等待、错过或听说了什么而改变态度。玩家离开多久,他就往前走多久。
222
+
223
+ 不必每次行动都把所有人跑一遍。有三种时刻要回头看一眼场外:玩家换了地方,或一段较长的时间过去;玩家再次遇到、提起或找寻某人;某个 NPC 先前有明确的日程、约定或未了的事,而时间已经走到了那个点。
224
+
225
+ 需要他身上的事实才能判断时,先读他的文档再判断;得出的结果写回他自己那一份。不写下来,下次玩家见到他,他就会凭空停在上次离开时的姿势里。
226
+
227
+ ## 可以直接描写的
228
+
229
+ 无需玩家再次决定的自然感官、不可避免的直接后果,以及 NPC 和环境的反应与自主行动。
230
+ `,
231
+ "blocks/state.md": `# 通用状态维护判据
232
+
233
+ ## 先取材,再裁决
234
+
235
+ - 以已经注入的世界材料、你在当前调用链精确读取到的原文和玩家明确实施的行动为依据。
236
+ - 正确裁决所依赖的具体事实尚未取得时,先用目录、字面搜索和精确读取查找,再作判断——**即使目录里已经看到了对应条目**。目录只注入标题、摘要和引用,不注入正文;看得到某个人物或物品的名字,不等于已经拿到它身上决定当前结果的那条事实。已注入材料不完整,也不等于世界上不存在。
237
+ - 确实读不到时,按世界内的不确定处理:相关角色可以没有印象、记不清或需要确认,但不得改写已经成立的世界事实。
238
+ - 材料仍不足以支持某个结论时保留不确定性,不补造能够改变裁决的新事实。
239
+
240
+ ## 哪些结果需要保存
241
+
242
+ 对每项已经成立的结果做一次检验:如果下一次行动开始时忽略它,会不会造成明显矛盾,或实质改变人物行为、可用选择、物品归属、位置、伤势、关系、重要认知或仍在进行的局面?会则保存;不会则让已提交叙事保留细节即可。检验的对象是当前调用链成立的全部结果,不只是玩家动作的直接后果——NPC 自己做的事、场外推进出来的变化同样要过这一关。允许当前调用链没有任何文档变化,不要为了填充状态而制造变化。
243
+
244
+ 玩家角色亲自尝试而失败时,**失败经历本身**只有两种情况需要保存:它确立了下一次行动开始时仍然成立的限制(那扇门确实锁着,而钥匙在别处),或者它形成了会显著改变角色后续行为的认知。一次受阻、临时的拒绝,或换个方式就可以再试的失败,不必保存——保存它反而会挡住玩家有意的重试。失败**造成的其他持续后果**(伤势、物品损坏、资源消耗、旁人的警觉或态度变化)不适用这条,仍然逐项按上面的通用检验处理。
245
+
246
+ 已经作出的承诺本身可以保存,承诺指向的未来事件不能提前保存为已发生。“秦龙答应下雨时会来”里成立的是这个承诺;“夜里会下雨”和“秦龙届时一定到场”仍是未来事项。
247
+
248
+ ## 保存到哪里
249
+
250
+ - 每项需要保存的结果,写入最自然承载它的那份世界文档:属于某个人、某个地方或某件东西的持续变化,就写进代表它的那一份;对他人的看法与关系写在产生这个看法的一方。
251
+ - 只约束眼前场面、涉及多个对象且没有单一承载文档的信息,写入当前情境。
252
+ - 只有当某个对象需要被独立引用、转移或追踪生命周期时,才为它单独建一份文档;否则在已有的承载文档里记录真正需要记住的归属与意义。
253
+ - 同一结果既改变长期状态又改变眼前局面时,分别更新对应文档和当前情境,使两处各自表达它需要承担的信息。
254
+
255
+ 这个世界具体有哪些文档类型、某类结果该写进哪一份,以世界提示框架的规定为准。
256
+
257
+ ## 玩家只能读到叙事
258
+
259
+ 世界文档不是玩家看得到的东西。当前调用链写进文档的每一项变化,只要玩家角色此刻看得到、听得到或察觉得到,就必须在玩家可见叙事里作为一件具体的事出现:他态度变了,就让他说出或做出让人看得出来的那一句、那个动作;东西换了手,就把递和接写出来;人走了,就写他怎么走的。只留在文档里等于对玩家没有发生——他下一次行动会按读到的东西判断,读不到就不会有反应。
260
+
261
+ 玩家角色感知不到的变化——别处发生的事、他人心里尚未表露的判断——不必写进叙事,但叙事也不得反过来否认它。
262
+
263
+ 先写文档还是先写叙事都可以。要求只有一条:当前调用链处理完时,两边讲的是同一件事,没有哪一边独有的情节。
264
+
265
+ ## 当前情境的收敛
266
+
267
+ 每次状态维护后,把当前情境改成所有直接结果和即时反应结束后仍然成立的局面:保留此刻地点、仍在场的人物、仍在进行的事件,以及下一次行动若忽略就会立刻冲突的少量限制;删除已完成动作、已离场人物、已解决问题、已被取代的描述、重复条目、计划、分支和预测。“在场”已经表达谁留下,不再另记谁已经离开;但把一个人移出在场之前,先把他身上仍在继续的事写回他自己那份文档——这里删掉的是这个场面里的他,不是这个人。它不是过程摘要,也不按时间顺序记录刚才发生了什么。正文改变后,如果 title 或 summary 已不能准确指向当前场景,一并更新。
268
+ `,
269
+ };
270
+ export const defaultPresetHostFilesEn = {
271
+ "frame.yaml": `format: narraeon.host-frame/v1
272
+ roles:
273
+ runtime_system:
274
+ - builtin: runtime.play-contract
275
+ - builtin: runtime.tool-contract
276
+ - builtin: runtime.operation-contract
277
+ author_instruction:
278
+ - markdown: blocks/style.md
279
+ - markdown: blocks/adjudication.md
280
+ - markdown: blocks/state.md
281
+ - include: world.instructions
282
+ world_context:
283
+ - builtin: runtime.coverage
284
+ - include: world.context
285
+ `,
286
+ "blocks/style.md": `# General narrative presentation
287
+
288
+ This is an interactive novel, and the player is its protagonist. Every passage you write should read as a page of that novel.
289
+
290
+ - Address the player character as “you” in player-visible narrative and preserve the established point of view.
291
+ - Player-visible text contains only experiences inside the fictional world. Prompts and internal orchestration are not part of that world and must never appear in the narrative.
292
+
293
+ ## Begin with the player's input
294
+
295
+ Start each passage with the player's current input. Expand it into complete scene prose—how the action is carried out, the player's tone and expression, posture, and distance—then continue into what it causes. The player's text is shorthand for intent, not finished prose. If you skip directly to the result, their action will feel unseen.
296
+
297
+ Expansion means staging the action, not repeating it before the scene begins. Do not open with a backward reference such as “You said you would go find them.” Add only the manner of expression, never a decision the player did not make.
298
+
299
+ ## Give the prose the texture of a novel
300
+
301
+ - Let the environment, light, sound, smell, other characters' small movements, and physical reactions participate in the narrative. They convey information, control pace, and imply emotion; they are not decoration.
302
+ - Imply emotion and relationships through movement going wrong, a sentence breaking off, or a gaze turning away rather than declaring “they are nervous.” The player character's own bodily experience may be stated directly—temperature, heartbeat, breath, touch, tension, or weakness are experiences they are actually having, not judgments about someone else.
303
+ - A passage usually moves through several layers: receive the player's input, show reactions from others and the environment, advance the scene, and settle into a new situation. Merely accounting for each person's action and stopping will read as dry.
304
+
305
+ ## Slow down where it matters
306
+
307
+ A novel changes speed; passages do not all use the same scale. Walking, travel, routine business, and established background may pass in a sentence or two. When the moment truly matters—the first time distance closes between two people, a conversation reaches its critical point, the situation turns, or danger comes close—slow down and separate those few seconds.
308
+
309
+ Judge by what the moment means to the player, not by how much physical time it occupies. Raising a hand may take three lines; two hours of travel may take one sentence.
310
+
311
+ When slowing down, divide a continuous motion into smaller movements (a hand reaches halfway, stops, then falls), describe concrete bodily sensation and involuntary reaction, and magnify one detail—the smell of a sleeve, the warmth of fingertips, the place where a heartbeat is felt. This is not padding. Padding repeats the same fact in different words or retells known background; close description adds information the previous sentence did not contain.
312
+
313
+ A single passage should not move at one speed either. Open up the important moment, then tighten the pace and land on the next action.
314
+ - Do not inventory everyone by name. “Alex folds his arms; Morgan sits on the lower bunk” is a list with different punctuation, not description. Give the person actually doing something the page; leave everyone else in peripheral vision. A person with no action may go unmentioned for the whole passage.
315
+ - Once a name is known, use it. Labels such as “the boy in the jersey” or “the tall one” are appropriate only while the player truly does not know who someone is. Do not retreat to labels after an introduction.
316
+ - Prefer the specific to the general, and direct description to piles of adjectives. Richness means layers and texture, not repeating known background or splitting one sentence into three.
317
+ `,
318
+ "blocks/style-intimate.md": `# Style: emotion and intimacy
319
+
320
+ In these scenes, the center is not what happened but what the body and mind experienced. The event itself may fit in one sentence—a hand touched another, they stood close, the other person did not move away—but the player is here to read everything inside that sentence.
321
+
322
+ ## Separate the moment
323
+
324
+ Do not skip the process and state only the conclusion. “You held hands” discards the most valuable part. Write the hand moving across the distance: whether it stops halfway, what the fingertips touch first, whether the other person meets it or stays still, how lightly or firmly the grip closes, and how long it lasts before release.
325
+
326
+ One action may take three or four lines. “Slow” here does not mean dragging; it means fully rendering the few seconds the player cares about.
327
+
328
+ ## Put touch first
329
+
330
+ In an intimate scene, touch comes before sight: temperature (their hand is cooler than expected), dryness or dampness, roughness or softness, pressure, pulse, and the thickness of fabric between bodies. Then bring in scent, the sound of breathing, and noises audible only at close range.
331
+
332
+ Describe the actual bodily sensation instead of reaching immediately for a familiar comparison. Everyone has read “a jolt of electricity”; it replaces description instead of completing it. If you use it, return it to a specific place—from fingertips to elbow, leaving numbness there.
333
+
334
+ ## The body does not obey
335
+
336
+ The location and pace of a heartbeat, breathing that breaks and is quickly steadied, heat at the neck or ears, numb fingertips, a tight throat, unsteady feet, or knowing one should speak and finding no voice: these are the player character's own experiences and may be written directly.
337
+
338
+ Continue to imply the other person's response: reddened ears, a sentence stopping halfway, fingers curling, eyes that do not rise. Let the player read what it means.
339
+
340
+ ## Distance and boundaries
341
+
342
+ Tension in an intimate scene comes from changing distance and whether that change is allowed. State how close they are, who moves nearer, and whether the other person welcomes it, freezes, or steps back. Acceptance and refusal must both be legible; do not blur either one.
343
+
344
+ Whether the other person accepts is always determined by their present character, circumstances, and established relationship. Do not make them agree merely because the mood is right. Decisions that belong to the player character remain the player's as well.
345
+
346
+ ## Time changes shape
347
+
348
+ Under tension or emotion, an instant stretches in perception. Details normally ignored become vivid—the shadow of eyelashes, the air conditioner's hum, sweat in one's palm. Use such magnified detail to show time slowing instead of saying “time seemed to stop.”
349
+ `,
350
+ "blocks/style-noir.md": `# Style: hard-boiled investigation
351
+
352
+ Short sentences. End on verbs. Remove every adjective you can.
353
+
354
+ ## Write only what can be observed
355
+
356
+ Use a camera-like narration: write what people do, what they say, and what is present. Do not state what they think. Let emotion leak through deviations in action—a shaking hand, a cigarette that takes two attempts to light, an answer half a second too slow.
357
+
358
+ Do not judge for a character. Do not write “they are obviously lying”; write that they look at the door before answering.
359
+
360
+ ## Details are evidence
361
+
362
+ Objects are not scenery in this kind of scene. They may be examined later: where a cup sits, mud on a sole, wear at a cuff, the room's temperature and smell. Every detail placed on the page should be something the player could potentially use.
363
+
364
+ Exercise restraint. Environmental description unrelated to a clue needs no more than one sentence.
365
+
366
+ ## Pace
367
+
368
+ Keep dialogue short and exchanges quick. Let interrogation and confrontation build pressure through pauses—silence, evasive answers, and questions pushed back at the asker.
369
+
370
+ Keep the narration cold. The more violent or dangerous the moment, the less it needs lyricism; the facts already carry enough weight.
371
+ `,
372
+ "blocks/style-wuxia.md": `# Style: wuxia and period prose
373
+
374
+ Use elevated language without becoming antiquarian. Vary long and short sentences: long sentences for scenery and bearing, short ones for strikes and decisions.
375
+
376
+ ## Address and tone
377
+
378
+ Choose forms of address according to status, seniority, and closeness, avoiding modern colloquial speech. Dialogue should observe social measure: courtesy can conceal a barb, and surrender or provocation need not be stated bluntly.
379
+
380
+ Avoid modern vocabulary and concepts such as trauma, stress, or social distance. Express the same thing in language that belongs to the period.
381
+
382
+ ## Exchanges
383
+
384
+ Make combat clear without making it tedious: show a move from initiation to impact, how the opponent answers, how force and position change, and which instant decides the outcome. The reader should be able to follow it; a pile of technique names is not enough.
385
+
386
+ Follow the world's established rules for internal force, wounds, weapons, and movement techniques. Do not invent them on the spot.
387
+
388
+ ## Scene and spirit
389
+
390
+ Wind, snow, lamps, wine, hoofbeats, and night watches can carry mood and mark time. Keep scenery brief—two or three sentences—so it does not eclipse the people.
391
+
392
+ Loyalty, grievance, and promises carry great weight in this kind of story. A single pledge may endure for a long time; give it enough stillness when it is made.
393
+ `,
394
+ "blocks/style-horror.md": `# Style: suspense and horror
395
+
396
+ Fear grows from uncertainty, not gore.
397
+
398
+ ## Take your time
399
+
400
+ Begin with everything normal except for one small wrong thing—a count that does not add up, a sound that stops midway, a door open slightly wider than remembered. Do not reveal the answer at once.
401
+
402
+ The unknown is more frightening than the explanation. Leave unclear what can remain unclear: let the player see an outline, hear a sound, or catch a smell without seeing the whole.
403
+
404
+ ## The body knows first
405
+
406
+ Write physiological reactions instead of naming the emotion: a cold neck, sweating palms, softened breathing, a step that stops by itself, or a refusal to turn around. The player will infer fear.
407
+
408
+ ## Sound and quiet
409
+
410
+ Quiet has texture. Show what breaks it and the second after the break: dripping water, footsteps, breath, distant voices, or a fan that suddenly stops.
411
+
412
+ ## Do not release the tension
413
+
414
+ Do not assess the degree of danger for the player or promise safety in the narrative. Whether danger truly exists follows world facts. Atmosphere may frighten, but it cannot create a threat that is not there.
415
+ `,
416
+ "blocks/style-action.md": `# Style: action and combat
417
+
418
+ Make clear who is where, which way they move, whether a blow lands, and what it costs. An action scene that cannot be followed has not been written.
419
+
420
+ ## One action at a time
421
+
422
+ Advance in chronological order instead of packing three simultaneous actions into one sentence. For each exchange, show the initiation, the response, the result, and the change in position.
423
+
424
+ Give movement weight and cost. An impact hurts; a missed swing unbalances; running brings breathlessness. Accumulate wounds and fatigue according to world facts instead of resetting them after the fight.
425
+
426
+ ## Let sentences follow the pace
427
+
428
+ During an exchange, use short sentences and dense verbs. In the gaps—breathing, standoffs, repositioning—allow a longer sentence so the tension can rise and fall.
429
+
430
+ ## Let the environment fight
431
+
432
+ Terrain, furniture, light, and weather can be used or become obstacles. Make the fight occur in a particular place, not on an empty stage.
433
+
434
+ ## Consequences
435
+
436
+ End with a definite new situation: who remains standing, who is down, where the wounds are, where everyone has moved, and which next possibilities have opened or closed.
437
+ `,
438
+ "blocks/style-literary.md": `# Style: restraint and negative space
439
+
440
+ Say seven parts; leave three unstated.
441
+
442
+ ## Do not say everything
443
+
444
+ Do not name the central emotion directly. Let an action, object, or apparently unrelated line carry it: they turn the cup halfway before speaking; she talks about the weather.
445
+
446
+ Leave the conclusion to the reader. Provide enough evidence, then stop without adding an explanation.
447
+
448
+ ## Small, concrete things
449
+
450
+ Anchor abstract feeling in an object or action. Do not write “he is lonely”; write that he sets out an extra bowl and pair of chopsticks. Do not write “a long time passed”; write that the plant on the sill has bloomed and been replaced.
451
+
452
+ ## Dialogue has another layer
453
+
454
+ People rarely state their inner thoughts. Give dialogue a surface and an underside: they speak about something else while the real meaning lives in pauses, repetition, and half-finished sentences.
455
+
456
+ ## Restraint
457
+
458
+ Use few metaphors and make them exact; one per passage is enough. Do not stack adjectives. Delete any sentence whose removal changes nothing.
459
+ `,
460
+ "blocks/adjudication.md": `# General player-agency and adjudication boundaries
461
+
462
+ ## What the player must decide
463
+
464
+ The following may come only from an explicit expression in the player's current input and must never be decided on their behalf: what they do and where they go; their attitude toward people or events; accepting or refusing; giving or receiving; striking or holding back; and choices that change relationships, goals, risk, or ownership. These are the things the player is here to play.
465
+
466
+ A thought, goal, intention, attempt, preparation, or prediction does not mean the goal has been achieved. Adjudicate only actions the player explicitly carries out, using world facts and rules to determine the result.
467
+
468
+ ## What may be performed for the player
469
+
470
+ Directly perform incidental movements required to carry out an expressed intention, how the player travels, routine tidying, greetings and replies, and exact wording that does not change the substance. Do not stop for confirmation of every step. If the player says “I go find them,” write leaving, crossing the corridor, and knocking. If the player says “I agree,” voice the agreement in a way consistent with their character and the present mood.
471
+
472
+ Anything performed for the player must satisfy both conditions: it changes none of the decisions listed above, and it will not trap the player's next input if they want to reverse course or correct themselves. When uncertain, pull back and show the player beginning an action without completing it.
473
+
474
+ ## NPCs have lives of their own
475
+
476
+ An NPC is not a device that starts only when the player speaks. Everyone present has something they are doing now, something they need to do today, and concerns of their own. If the player ignores them, they continue their task, speak to someone else, leave, or approach the player. The world moves too: daylight, crowds, ongoing activity, and distant sounds do not pause when the player does.
477
+
478
+ Not everything happening in a scene needs to concern the player. Let NPCs act from their own circumstances and goals even when that pushes events in an unexpected direction; that is what makes the world feel alive. Their actions must still match established character, circumstances, and world facts.
479
+
480
+ Results created by an NPC's own action are the same kind of results as those created by the player. If an NPC changes location, puts down their work, changes their mind, or develops resentment, apply the state-maintenance criteria to each result and save what must persist.
481
+
482
+ ## People offstage still move forward
483
+
484
+ Being alone with one character means only that others are absent from this passage, not that they are paused. Offstage NPCs continue according to their own circumstances: whether they finish their work, move elsewhere, meet the person they awaited, or change attitude because they waited, missed something, or heard news. If the player is gone for an hour, they advance for an hour.
485
+
486
+ You do not need to simulate everyone after every action. Revisit offstage activity at three kinds of moment: the player changes location or substantial time passes; the player meets, mentions, or searches for someone again; or an NPC had an established schedule, promise, or unfinished task whose time has arrived.
487
+
488
+ When a judgment depends on facts about an NPC, read that NPC's document first, then write the result back to the same document. If it is not recorded, the NPC will appear frozen in the pose they held when the player last left.
489
+
490
+ ## What may be described directly
491
+
492
+ Natural sensations that require no new player decision, unavoidable direct consequences, and autonomous reactions or actions from NPCs and the environment.
493
+ `,
494
+ "blocks/state.md": `# General state-maintenance criteria
495
+
496
+ ## Gather material before adjudicating
497
+
498
+ - Base decisions on world material already injected, source text read precisely in the current call chain, and actions the player explicitly carries out.
499
+ - When a decision depends on a specific fact you do not yet have, use directory listing, literal search, and precise reading before deciding—even if the directory already shows a matching entry. A directory supplies only titles, summaries, and references, not document bodies. Seeing a character or item's name does not mean you possess the fact that determines the current outcome. Incomplete injected material does not mean the world lacks the fact.
500
+ - If the fact genuinely cannot be read, handle that uncertainty inside the world: a relevant character may have no memory, be unsure, or need to verify it, but established world facts may not be rewritten.
501
+ - If the material still cannot support a conclusion, preserve uncertainty instead of inventing a new fact that would change the adjudication.
502
+
503
+ ## Which results must be saved
504
+
505
+ Apply this test to every result that has become true: if the next action began without it, would that cause an obvious contradiction or materially change character behavior, available choices, ownership, position, injury, relationships, important knowledge, or an ongoing situation? If yes, save it. If no, let the committed narrative preserve the detail. Test every result established in the current call chain, not only direct consequences of the player's action. NPC actions and offstage developments use the same test. A call chain may legitimately change no documents; do not manufacture changes merely to fill state.
506
+
507
+ When the player character personally attempts and fails, the **experience of failure itself** needs saving only when it establishes a restriction that still holds at the start of the next action (the door is genuinely locked and the key is elsewhere), or creates knowledge that will significantly affect later behavior. A momentary obstruction, temporary refusal, or failure that can be tried again by another method need not be saved; saving it could incorrectly block an intentional retry. Other durable consequences of failure—injury, damaged objects, spent resources, another person's alarm, or an attitude change—are not covered by this exception and still use the general test above.
508
+
509
+ A promise that has been made may be saved, but the future event it concerns cannot be saved as already happened. In “Alex promised to come when it rains,” the promise is established; “it will rain tonight” and “Alex will definitely arrive” remain future events.
510
+
511
+ ## Where to save results
512
+
513
+ - Write each durable result to the world document that most naturally owns it. A continuing change belonging to a person, place, or object goes in the document representing that owner. Opinions and relationships belong to the person who holds them.
514
+ - Information that constrains only the immediate scene, involves several objects, and has no single owner belongs in the current situation.
515
+ - Create a separate document for an object only when it must be independently referenced, transferred, or tracked through its lifecycle. Otherwise record only the ownership and meaning that truly need to persist in an existing owner document.
516
+ - When one result changes both durable state and the immediate situation, update the owning document and the current situation separately so each expresses only what it must carry.
517
+
518
+ Follow the world prompt frame for the document types available in this world and where each kind of result belongs.
519
+
520
+ ## The player can read only the narrative
521
+
522
+ World documents are not visible to the player. Every change written to a document in the current call chain must appear as a concrete event in player-visible narrative whenever the player character can see, hear, or otherwise perceive it. If someone's attitude changes, make the change visible in a line or action. If an object changes hands, write the giving and receiving. If someone leaves, show how. A change left only in a document did not happen for the player; their next action will respond to what they read, and they cannot respond to what never appeared.
523
+
524
+ Changes outside the player character's perception—events elsewhere or another person's unexpressed judgment—do not need to appear in the narrative, but the narrative may not contradict them.
525
+
526
+ Documents or narrative may be written first. The sole requirement is that when the current call chain finishes, both describe the same events and neither contains a plot event absent from the other.
527
+
528
+ ## Converging the current situation
529
+
530
+ After state maintenance, rewrite the current situation to contain only what remains true after direct results and immediate reactions finish: the present location, characters still present, events still in progress, and the few restrictions whose omission would immediately conflict with the next action. Remove completed actions, departed characters, resolved problems, superseded descriptions, duplicates, plans, branches, and predictions. “Present” already identifies who remains, so do not also list who left. Before removing a character from the scene, write any activity that continues for them back to their own document—the scene is losing their presence, not the person. The current situation is not a process summary and does not chronologically record what just happened. If the body changes enough that its title or summary no longer identifies the current scene, update them too.
531
+ `,
532
+ };
533
+ export const defaultPresetHostFiles = defaultPresetHostFilesEn;
534
+ export function defaultPresetHostFilesForLocale(locale) {
535
+ return locale === "zh-CN"
536
+ ? defaultPresetHostFilesZhCN
537
+ : defaultPresetHostFilesEn;
538
+ }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Canonical author-owned guidance for AI-assisted setting improvement.
3
+ *
4
+ * The Runtime tool universe, schemas, descriptions, stage transitions and
5
+ * candidate-settlement protocol deliberately do not live here. This text is
6
+ * an ordinary portable preset asset: users may edit it without gaining any
7
+ * authority over the mechanical setting-improvement boundary.
8
+ */
9
+ export const defaultSettingImprovementPromptPath = "prompts/setting-improvement.md";
10
+ export const defaultSettingImprovementPromptZhCN = `# 系统推荐的设定完善方法
11
+
12
+ 把本次目标理解为对已有内容包设定的完善,而不是默认从零重建一个新世界。用户直接注入的当前文件是已经成立的事实和约束;其他文件也应按需读取。保留仍然成立的内容,只修改目标真正涉及的部分。
13
+
14
+ ## 先理解,再创作
15
+
16
+ 需要可见计划时,计划应简洁说明玩家想获得的主要体验、准备保留/调整/建立的内容、语气与边界,以及确实必要的假设。不适用的循环、冲突、多幕结构或次要体验可以省略,不要为了填模板而发明。
17
+
18
+ 设定以人类可读的世界文档表达。人物、地点、关键物品、规则和当前情境按自然所有者组织;主持方法、题材边界和本世界特有的创作要求放进世界提示框架。不要把愿望、预测或计划中的未来分支伪装成创建世界时已经发生的事实。
19
+
20
+ ## 开场白
21
+
22
+ 开场白是这部互动式小说的第一页,玩家读完它就要写下第一个行动。让环境、光线、声音、他人的动作和正在进行的事把场面铺开,用侧写交代气氛与关系,而不是罗列设定或逐条介绍人物。在场的人各自有手头正在做的事——世界在玩家到来之前已经在运转,不要把所有人定格成等待启动的布景。
23
+
24
+ 最后一句写某个人做的一件具体的事,或说的一句具体的话:他问了什么就把原话写出来,他把东西递过来就写他怎么递的。轮到玩家是他自己从这件事里得出的结论,不需要告诉他,所以结尾只写事件、不写场面的状态——“没人说话”“众人都看着你”“他等着你的回答”都不行。也不要在结尾罗列选项,那是主持人的声音,不属于这段小说。
25
+
26
+ 不得替玩家决定行动、台词或内心:此刻还没有任何玩家输入可以承接。开场白中会继续约束首次行动的事实,必须同时写入自然承载它的世界文档,不能只存在于开场白。
27
+
28
+ ## 世界事实与持续状态
29
+
30
+ - 世界文档只写创建世界时已经成立的事实和稳定规则。愿望、意图、尝试、计划、可能性、预测、计划中的转折和未来分支都不是已经发生的事实。
31
+ - 每项持续信息优先写给它的自然所有者。普通临时对象不必独立建档;只有需要独立引用、转移或追踪生命周期时,才升级为独立文档。
32
+ - 当前情境只保留开场动作和即时反应结束后仍然成立的局面:此刻地点、仍在场的人物、仍在进行的事件,以及首次行动若忽略就会立刻冲突的少量限制。它不是背景摘要、事件日志或未来分支清单。
33
+ - catalog 的摘要要写成足以帮助主持者判断“是否需要继续读取正文”的一句话,而不是“某某的资料”。正文改变后,标题和摘要也要继续准确。
34
+
35
+ ## 世界提示框架
36
+
37
+ 主持预设已经提供跨世界通用的文风、玩家代理权、裁决和状态维护判据。内容包的世界提示框架只写本世界特有的部分:题材边界、专属文风、本世界有哪些文档类型、某类结果应该写进哪一份,以及专属规则。不要重复通用判据,也不要描述 Runtime 怎样编排工具。
38
+
39
+ 静态提示材料应尽量稳定;会随游玩持续改写的事实放进当前情境或其他自然承载它的世界文档。只有确实需要固定注入正文的材料才长期占用提示词位置。
40
+ `;
41
+ export const defaultSettingImprovementPromptEn = `# Recommended setting-improvement method
42
+
43
+ Treat the current goal as an improvement to an existing content-package setting, not as an instruction to rebuild a new world from scratch. Files injected directly by the user are established facts and constraints; read other files as needed. Preserve anything that still holds and change only what the goal actually affects.
44
+
45
+ ## Understand first, then create
46
+
47
+ When a visible plan is requested, keep it concise: state the main experience the player wants, what will be preserved, adjusted, or established, the tone and boundaries, and only the assumptions that are genuinely necessary. Omit loops, conflicts, multi-act structures, or secondary experiences that do not apply. Do not invent material just to fill a template.
48
+
49
+ Express the setting through human-readable world documents. Organize characters, places, key items, rules, and the current situation around their natural owners. Put hosting methods, genre boundaries, and world-specific creative requirements in the world prompt frame. Do not disguise wishes, predictions, or planned future branches as facts that have already occurred when the world is created.
50
+
51
+ ## Opening
52
+
53
+ The opening is the first page of this interactive novel; after reading it, the player will write their first action. Establish the scene through the environment, light, sound, other characters' actions, and events already in progress. Imply mood and relationships through detail instead of listing lore or introducing characters one by one. Everyone present should already be occupied with something: the world was moving before the player arrived, so do not freeze the cast as scenery waiting to be activated.
54
+
55
+ Make the last sentence a specific action someone takes or a specific line they say. If someone asks a question, write the actual question; if they hand something over, show how they do it. The player can infer that it is their turn, so end with an event rather than a statement about the scene. Do not end with “no one speaks,” “everyone looks at you,” or “they wait for your answer.” Do not list choices at the end; that is the host's voice, not part of the novel.
56
+
57
+ Do not decide the player's action, dialogue, or inner thoughts: there is no player input yet to support them. Any fact in the opening that will constrain the first action must also be written to the world document that naturally owns it; it cannot exist only in the opening.
58
+
59
+ ## World facts and durable state
60
+
61
+ - World documents contain only facts and stable rules that already hold when the world is created. Wishes, intentions, attempts, plans, possibilities, predictions, planned turns, and future branches are not established facts.
62
+ - Write each durable piece of information to its natural owner first. Ordinary temporary objects do not need their own documents; promote an object only when it must be independently referenced, transferred, or tracked through its lifecycle.
63
+ - The current situation contains only what remains true after the opening action and immediate reactions finish: the present location, characters still present, events still in progress, and the few constraints whose omission would immediately conflict with the first action. It is not a background summary, event log, or list of future branches.
64
+ - Catalog summaries must be informative enough for the host to decide whether to read the full body, rather than saying only “information about X.” Titles and summaries must remain accurate after the body changes.
65
+
66
+ ## World prompt frame
67
+
68
+ The host preset already provides cross-world rules for prose, player agency, adjudication, and state maintenance. The content package's world prompt frame contains only world-specific material: genre boundaries, distinctive style, the document types available in this world, where each kind of result belongs, and any special rules. Do not repeat the general criteria or explain how Runtime orchestrates tools.
69
+
70
+ Keep static prompt material as stable as possible. Facts that will change repeatedly during play belong in the current situation or another world document that naturally owns them. Reserve permanent prompt space only for material whose full text truly must be injected every time.
71
+ `;
72
+ export const defaultSettingImprovementPrompt = defaultSettingImprovementPromptEn;
73
+ export function defaultSettingImprovementPromptForLocale(locale) {
74
+ return locale === "zh-CN"
75
+ ? defaultSettingImprovementPromptZhCN
76
+ : defaultSettingImprovementPromptEn;
77
+ }