narraeon 0.5.5 → 0.5.7
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/README.zh-CN.md +1 -1
- package/dist/node/protocol/appPreferences.js +4 -2
- package/dist/node/protocol/playFailure.js +13 -0
- package/dist/node/protocol/protagonistTemplates.js +13 -0
- package/dist/node/protocol/v1.js +25 -19
- package/dist/node/protocol/worldArchives.js +7 -0
- package/dist/node/runtime/V1Runtime.js +48 -6
- package/dist/node/runtime/archive/WorldArchiveZip.js +202 -0
- package/dist/node/runtime/archive/WorldArchives.js +389 -0
- package/dist/node/runtime/config/AppPreferencesStore.js +23 -10
- package/dist/node/runtime/config/ProtagonistTemplateStore.js +134 -0
- package/dist/node/runtime/content/ContentWorkspace.js +5 -0
- package/dist/node/runtime/history/HistoryBackground.js +84 -0
- package/dist/node/runtime/history/HistoryQuery.js +7 -2
- package/dist/node/runtime/history/HistoryRendering.js +31 -4
- package/dist/node/runtime/history/StoryExport.js +33 -0
- package/dist/node/runtime/model/FileNativeModelAdapters.js +34 -2
- package/dist/node/runtime/model/ModelHost.js +12 -1
- package/dist/node/runtime/model/ModelHostStream.js +11 -3
- package/dist/node/runtime/play/FileNativeContinuityCorrection.js +2 -0
- package/dist/node/runtime/play/FileNativePlayAdvanceStore.js +5 -0
- package/dist/node/runtime/play/FileNativePlayTimelineStore.js +91 -4
- package/dist/node/runtime/play/LegacyModelBindingFailure.js +10 -0
- package/dist/node/runtime/play/PlayCallChain.js +212 -61
- package/dist/node/runtime/play/PlayCallChainError.js +3 -1
- package/dist/node/runtime/play/PlayContinuity.js +3 -20
- package/dist/node/runtime/play/PlayFailure.js +20 -0
- package/dist/node/runtime/play/PlayTraceRetention.js +10 -11
- package/dist/node/runtime/prompt/FileNativePromptCompiler.js +12 -59
- package/dist/node/runtime/prompt/FileNativeToolRegistry.js +2 -2
- package/dist/node/runtime/world/FileNativeAuthorityV3.js +7 -4
- package/dist/node/runtime/world/FileNativeHistoryProjection.js +11 -0
- package/dist/node/runtime/world/FileNativeWorldStore.js +250 -55
- package/dist/node/runtime/world/WorldActivity.js +143 -0
- package/dist/node/runtime/world/WorldYamlRendering.js +28 -0
- package/dist/node/server/createServer.js +48 -0
- package/dist/node/shared/default-preset-host.js +18 -8
- package/dist/node/shared/default-setting-improvement-prompt.js +4 -0
- package/dist/node/shared/history-use-guidance.js +2 -2
- package/dist/node/shared/ordered-play-prompts.js +2 -2
- package/dist/node/shared/sample-packages/index.js +10 -0
- package/dist/node/shared/sample-packages/rainy-inn-en.js +194 -0
- package/dist/node/shared/sample-packages/rainy-inn-zh.js +194 -0
- package/dist/web/assets/index-DxNtxzLR.js +1255 -0
- package/dist/web/assets/{index-CVN48xrw.css → index-DzOnu9uv.css} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +6 -2
- package/dist/web/assets/index-DTFZQan4.js +0 -1223
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
export const rainyInnChinese = {
|
|
2
|
+
title: "雨灯旅店的一封信",
|
|
3
|
+
files: [
|
|
4
|
+
{
|
|
5
|
+
path: "opening.md",
|
|
6
|
+
contents: `雨水沿着旅店的檐角落下,门上的小铜铃还在轻轻晃动。你面前的柜台亮着一盏暖黄的灯,湿伞架旁飘来姜茶的香气。
|
|
7
|
+
|
|
8
|
+
柜台后,一位系着墨绿围裙的女人把空的蓝瓷碟翻过来,又放回原处。「刚才还在这里的。」她低声说。
|
|
9
|
+
|
|
10
|
+
窗边穿灰色针织衫的客人抬起头:「是一个浅蓝信封,明早要寄给我妹妹。还没有封口。」她看向柜台边抱着登记簿的年轻邮差。邮差停下擦拭书角的手,神情有些茫然。
|
|
11
|
+
|
|
12
|
+
女人转向你,递来一条干毛巾:「先擦擦雨吧。我们正找一封信——你愿意帮忙看看吗?」柜台、伞架和窗边的小桌都在灯光里,她等着你的回答。
|
|
13
|
+
`,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
path: "world/current-situation.yaml",
|
|
17
|
+
contents: `$document:
|
|
18
|
+
id: situation.rainy-inn
|
|
19
|
+
ref: current-situation
|
|
20
|
+
title: 灯下的空瓷碟
|
|
21
|
+
summary: 雨灯旅店大厅里的一次小小寻物。
|
|
22
|
+
aliases: []
|
|
23
|
+
背景:
|
|
24
|
+
时间: 秋日,雨夜,晚上九点
|
|
25
|
+
地点: 溪桥镇,雨灯旅店大厅
|
|
26
|
+
在场人物:
|
|
27
|
+
- $ref: character.shen-he
|
|
28
|
+
- $ref: character.lin-lan
|
|
29
|
+
- $ref: character.zhou-cheng
|
|
30
|
+
进行中事件:
|
|
31
|
+
寻信: 林岚发现寄给妹妹的浅蓝信封不在柜台蓝瓷碟上;大厅里尚未有人开始系统寻找。
|
|
32
|
+
待回应:
|
|
33
|
+
说话者: { $ref: character.shen-he }
|
|
34
|
+
邀请: 先擦擦雨吧。我们正找一封信——你愿意帮忙看看吗?
|
|
35
|
+
短期局面:
|
|
36
|
+
- 你刚抵达门口,沈禾递来的干毛巾尚未被接过。
|
|
37
|
+
- 周澄抱着登记簿,刚停下擦拭湿书角的动作。
|
|
38
|
+
`,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
path: "world/characters/shen-he.yaml",
|
|
42
|
+
contents: `$document:
|
|
43
|
+
id: character.shen-he
|
|
44
|
+
ref: shen-he
|
|
45
|
+
title: 沈禾
|
|
46
|
+
summary: 雨灯旅店的店主,做事细致,待客温和。
|
|
47
|
+
aliases: [沈老板]
|
|
48
|
+
外貌: 短发,眉眼柔和,袖口上有一点面粉。
|
|
49
|
+
衣着: 米色衬衣,墨绿围裙,布鞋。
|
|
50
|
+
性格: 耐心,遇到疏漏先寻找补救办法,不轻易责怪人。
|
|
51
|
+
关系:
|
|
52
|
+
林岚:
|
|
53
|
+
对象: { $ref: character.lin-lan }
|
|
54
|
+
看法: 常住的熟客,珍惜她带来的植物故事;希望她今晚能安心休息。
|
|
55
|
+
周澄:
|
|
56
|
+
对象: { $ref: character.zhou-cheng }
|
|
57
|
+
看法: 邻居家的年轻邮差,热心但偶尔忙中出错;愿意让他说明情况。
|
|
58
|
+
认知:
|
|
59
|
+
信件: 记得把林岚的浅蓝信封放在蓝瓷碟上,此后忙着烧姜茶,没有留意柜台。
|
|
60
|
+
依据: { $ref: event.letter-entrusted }
|
|
61
|
+
`,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
path: "world/characters/lin-lan.yaml",
|
|
65
|
+
contents: `$document:
|
|
66
|
+
id: character.lin-lan
|
|
67
|
+
ref: lin-lan
|
|
68
|
+
title: 林岚
|
|
69
|
+
summary: 途经溪桥镇的植物绘图员,喜欢用信分享见闻。
|
|
70
|
+
aliases: []
|
|
71
|
+
外貌: 戴圆框眼镜,指尖有淡淡的铅笔灰。
|
|
72
|
+
衣着: 灰色针织衫,深蓝长裤,晾在伞架旁的棕色雨披。
|
|
73
|
+
性格: 观察细致,说话慢,担心时会反复核对细节。
|
|
74
|
+
关系:
|
|
75
|
+
沈禾:
|
|
76
|
+
对象: { $ref: character.shen-he }
|
|
77
|
+
看法: 熟悉而可靠的店主,信不见了也不认为她会故意隐瞒。
|
|
78
|
+
周澄:
|
|
79
|
+
对象: { $ref: character.zhou-cheng }
|
|
80
|
+
看法: 今晚才认识的邮差,相信他熟悉寄信流程,尚不了解他的习惯。
|
|
81
|
+
重要物品:
|
|
82
|
+
给妹妹的信: 浅蓝信封,未封口,内有一页见闻和一张手绘叶片图;原计划明早寄出。
|
|
83
|
+
认知:
|
|
84
|
+
信件: 知道自己把信交给了沈禾;只看到现在瓷碟空了,不知道它后来去了哪里。
|
|
85
|
+
依据: { $ref: event.letter-entrusted }
|
|
86
|
+
`,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
path: "world/characters/zhou-cheng.yaml",
|
|
90
|
+
contents: `$document:
|
|
91
|
+
id: character.zhou-cheng
|
|
92
|
+
ref: zhou-cheng
|
|
93
|
+
title: 周澄
|
|
94
|
+
summary: 镇上的年轻邮差,雨天也会顺路帮邻居跑腿。
|
|
95
|
+
aliases: [小周]
|
|
96
|
+
外貌: 头发被雨压得贴在额前,笑起来有浅酒窝。
|
|
97
|
+
衣着: 蓝色雨衣敞着扣子,条纹衬衣,湿了鞋尖的帆布鞋。
|
|
98
|
+
性格: 热心,做事容易分心;一旦发现自己弄错,愿意承认并帮忙补救。
|
|
99
|
+
关系:
|
|
100
|
+
沈禾:
|
|
101
|
+
对象: { $ref: character.shen-he }
|
|
102
|
+
看法: 从小认识的邻居,信任她,也在意自己能否帮上忙。
|
|
103
|
+
林岚:
|
|
104
|
+
对象: { $ref: character.lin-lan }
|
|
105
|
+
看法: 刚认识的客人,她的植物画很有趣,想请她解释画里的树叶。
|
|
106
|
+
认知:
|
|
107
|
+
自己记得的动作: 刚才挪开柜台上的浅蓝信封给湿登记簿腾地方,顺手把它夹进登记簿封底;以为那只是空信封。
|
|
108
|
+
当前理解: 尚未听清林岚在找什么,没有把她的信与自己挪过的信封联系起来。
|
|
109
|
+
随身物品:
|
|
110
|
+
登记簿: 抱在手里,封底书角被雨打湿。
|
|
111
|
+
`,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
path: "world/locations/rain-lantern-inn.yaml",
|
|
115
|
+
contents: `$document:
|
|
116
|
+
id: location.rain-lantern-inn
|
|
117
|
+
ref: rain-lantern-inn
|
|
118
|
+
title: 雨灯旅店
|
|
119
|
+
summary: 溪桥镇桥头的小旅店,邻里常来避雨喝茶。
|
|
120
|
+
aliases: []
|
|
121
|
+
大厅: 木柜台正对入口,柜台上有蓝瓷碟和铜灯;窗边放着小桌,门旁是伞架。
|
|
122
|
+
日常: 客人可在大厅休息、喝姜茶,店主替熟客暂存待寄信件。
|
|
123
|
+
`,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
path: "world/events/letter-entrusted.yaml",
|
|
127
|
+
contents: `$document:
|
|
128
|
+
id: event.letter-entrusted
|
|
129
|
+
ref: letter-entrusted
|
|
130
|
+
title: 柜台上的托付
|
|
131
|
+
summary: 林岚把待寄信件交给沈禾暂存的一次托付。
|
|
132
|
+
aliases: []
|
|
133
|
+
时间: 今晚约半小时前
|
|
134
|
+
经过: 林岚将未封口的浅蓝信封交给沈禾,说明里面有给妹妹的信和叶片图;沈禾当着她的面放在柜台蓝瓷碟上。
|
|
135
|
+
原话: 林岚说「明早我再来封口,麻烦先放这里」。沈禾答应替她暂存。
|
|
136
|
+
来源: 林岚与沈禾当时都在柜台旁。
|
|
137
|
+
`,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
path: "control/frame.yaml",
|
|
141
|
+
contents: `format: narraeon.world-frame/v1
|
|
142
|
+
bindings:
|
|
143
|
+
currentSituation: "@current-situation"
|
|
144
|
+
instructions:
|
|
145
|
+
- markdown: blocks/world.md
|
|
146
|
+
context:
|
|
147
|
+
- slot: { kind: catalog, directory: characters, maxEntries: 3 }
|
|
148
|
+
- slot: { kind: catalog, directory: locations, maxEntries: 4 }
|
|
149
|
+
- slot: { kind: catalog, directory: events, maxEntries: 12 }
|
|
150
|
+
- slot: { kind: document, document: "@rain-lantern-inn" }
|
|
151
|
+
- slot:
|
|
152
|
+
kind: reference_targets
|
|
153
|
+
from:
|
|
154
|
+
document: "@current-situation"
|
|
155
|
+
locator: { yaml: [在场人物] }
|
|
156
|
+
maxEntries: 3
|
|
157
|
+
- slot: { kind: current_situation }
|
|
158
|
+
- slot: { kind: additional_materials }
|
|
159
|
+
`,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
path: "control/blocks/world.md",
|
|
163
|
+
contents: `<!-- opening.md 是玩家看到的开场;world/current-situation.yaml 记录背景与待回应局面;characters/ 各自保存人物状态、关系与认知;locations/ 保存地点;events/ 保存共同往事;frame.yaml 选择游玩材料;player-views.yaml 选择状态栏原值。可从这些文件改写自己的故事。 -->
|
|
164
|
+
|
|
165
|
+
# 本世界的题材与边界
|
|
166
|
+
|
|
167
|
+
以小镇旅店的日常交谈和轻微悬疑为主,线索来自物件、记忆和误会。保持温暖、适合所有年龄;不引入暴力、成人内容或威胁生命的阴谋。信件的私人内容由收信人与写信人决定是否分享。
|
|
168
|
+
|
|
169
|
+
## 本世界的文档与保存位置
|
|
170
|
+
|
|
171
|
+
人物之间的关系、各自看法与认知写在各自的 world/characters/ 人物文档中,不设统一真相或秘密字段。需要共同引用的事件经过写在 world/events/,人物通过引用关联,不重复抄写经过。地点的持续变化写回 world/locations/。信件先作为所属人物的重要物品维护,需要独立转移追踪时再建文档。
|
|
172
|
+
`,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
path: "control/player-views.yaml",
|
|
176
|
+
contents: `format: narraeon.player-views/v1
|
|
177
|
+
views:
|
|
178
|
+
- id: scene-status
|
|
179
|
+
title: 此刻
|
|
180
|
+
items:
|
|
181
|
+
- id: time
|
|
182
|
+
label: 时间
|
|
183
|
+
select:
|
|
184
|
+
document: "@current-situation"
|
|
185
|
+
locator: { yaml: [背景, 时间] }
|
|
186
|
+
- id: place
|
|
187
|
+
label: 地点
|
|
188
|
+
select:
|
|
189
|
+
document: "@current-situation"
|
|
190
|
+
locator: { yaml: [背景, 地点] }
|
|
191
|
+
`,
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
};
|