narraeon 0.7.6 → 0.7.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/dist/node/runtime/play/FileNativeContinuityCorrection.js +12 -4
- package/dist/node/runtime/play/PlayCallChain.js +6 -12
- package/dist/node/runtime/play/PlayDocumentTools.js +37 -6
- package/dist/node/runtime/prompt/FileNativePromptCompiler.js +2 -2
- package/dist/node/runtime/prompt/FileNativeToolRegistry.js +10 -3
- package/dist/node/runtime/prompt/WorldMaterialCoverage.js +0 -67
- package/dist/node/runtime/world/WorldDocumentStore.js +441 -389
- package/dist/node/runtime/world/WorldStateRevision.js +6 -3
- package/dist/node/shared/ordered-play-prompts.js +2 -2
- package/dist/web/assets/{index-Cj2JYCia.js → index-Da0tdDij.js} +2 -2
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WorldDocumentStore, } from "./WorldDocumentStore.js";
|
|
1
|
+
import { WorldDocumentStore, formatWorldDocumentLocator, } from "./WorldDocumentStore.js";
|
|
2
2
|
export function beginWorldStateRevision(files) {
|
|
3
3
|
const snapshot = WorldDocumentStore.open({
|
|
4
4
|
layout: "world_state",
|
|
@@ -63,8 +63,11 @@ export function fileNativeStateChanges(candidate) {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
export function worldDocumentRevisionFailureMessage(diagnostics) {
|
|
66
|
-
return (diagnostics
|
|
67
|
-
|
|
66
|
+
return (diagnostics
|
|
67
|
+
.map(({ message, locator }) => locator === undefined
|
|
68
|
+
? message
|
|
69
|
+
: `${message} (${formatWorldDocumentLocator(locator)})`)
|
|
70
|
+
.join("; ") || "The revision is invalid");
|
|
68
71
|
}
|
|
69
72
|
function revisionFileRecord(snapshot) {
|
|
70
73
|
return Object.fromEntries(snapshot.files.map((file) => {
|
|
@@ -100,7 +100,7 @@ export function builtinPlayPrompts(locale) {
|
|
|
100
100
|
|
|
101
101
|
只可调用请求随附的工具。目录使用预加载索引或工具返回的 @dir-*,无需重复列目录确认;文档和历史使用返回的 @句柄。工具结果标明读取范围、完整性及 cursor;目录摘要不等于正文。材料覆盖中完整正文与精确读取取得对应范围的写入资格,界面绑定标注不扩大写入资格。初始世界材料只在全新上下文加载一次;后续成功工具调用与回执更新当前值和读取资格,不必重读自己刚成功写入的内容。全新上下文不继承旧对话的读取与写入资格。
|
|
102
102
|
|
|
103
|
-
world_patch 的 YAML locator 可以包含 map key 和从零开始的数组下标;remove
|
|
103
|
+
world_patch 的 YAML locator 可以包含 map key 和从零开始的数组下标;add 与 replace 是 upsert,无论目标是否存在都写入,下标达到或超过长度时追加;remove 删除一个精确位置,目标不存在时为无操作。每条 edit 独立结算:失败的 edit 被跳过,其余照常生效;回执列出失败项时,已生效的 edit 不要重发,只补发列出的 edit。未提供的元数据保持原值。world_retire 从目录注入中退役文档,文档仍可读取、引用和恢复。工具响应的成功状态变化与后续最终叙事分别提交,后续失败不回滚已提交变化。成功写入回执表示当前值已改变;以真实回执的结算状态为准,模型文字不能提交世界。
|
|
104
104
|
|
|
105
105
|
包含工具调用的响应属于中间步,其中的文字尚未展示或提交为最终叙事。收到全部工具结果后,根据回执在最终正文中呈现本轮尚未展示的内容,并与已提交状态一致;没有工具调用的非空正文结束本次循环并由 Runtime 提交。world_checkpoint 登记历史重放边界并向玩家建议从此开始全新上下文;在随后非空且无工具调用的最终正文成功提交后生效,边界包含该正文;登记后仍可继续工具调用。登记不结束世界内事件,也不自动切换上下文,玩家自行选择。全新上下文补入边界后的已提交玩家原文与最终叙事,排除开场白、工具和推理。何时登记由检查点政策块规定。
|
|
106
106
|
|
|
@@ -109,7 +109,7 @@ ${historyUseGuidance(locale)}`
|
|
|
109
109
|
|
|
110
110
|
Use only attached tools. Directories use @dir-* handles from the preload or tool results; do not list them again just to confirm a handle; documents and history use returned @handles. Results identify read scope, completeness and cursor; directory summaries are not document bodies. Complete injected bodies and exact reads obtain write authorization within their corresponding scopes; player-view annotations do not widen it. Initial world materials load once per fresh context. Later successful tool calls and receipts update current values and read scopes; do not re-read merely to confirm your own successful writes. A fresh context does not inherit an old conversation's read or write authorization.
|
|
111
111
|
|
|
112
|
-
YAML world_patch locators accept map keys and zero-based array indexes; remove deletes one exact location. Omitted metadata remains unchanged. world_retire removes a document from catalog injection while keeping it readable, referenceable and restorable. Successful tool-response state changes and later final narrative commit separately; later failure does not roll back committed changes. Successful write receipts change current values; the actual receipt determines settlement, not model prose.
|
|
112
|
+
YAML world_patch locators accept map keys and zero-based array indexes; add and replace are upserts that write whether or not the target exists, and an index past the end appends; remove deletes one exact location and is a no-op when it is absent. Each edit settles on its own: a failed edit is skipped and the others still apply, so when a receipt lists failed edits, send again only those. Omitted metadata remains unchanged. world_retire removes a document from catalog injection while keeping it readable, referenceable and restorable. Successful tool-response state changes and later final narrative commit separately; later failure does not roll back committed changes. Successful write receipts change current values; the actual receipt determines settlement, not model prose.
|
|
113
113
|
|
|
114
114
|
Responses containing tool calls are intermediate steps; their text has not yet been displayed or committed as final narrative. After all tool results, use the receipts to present this turn's still-unshown content in final prose consistent with committed state. A nonempty tool-free response ends this loop and Runtime commits it. world_checkpoint registers the history-replay boundary and suggests a fresh context from that point to the player; it takes effect after the subsequent nonempty tool-free final prose successfully commits, including that prose, and further tool calls may follow registration. Registration neither ends an in-world event nor switches context, which the player chooses. Fresh-context replay contains committed player originals and final narratives after the boundary, excluding the opening, tools and reasoning. The checkpoint policy block decides when to register.
|
|
115
115
|
|
|
@@ -1241,7 +1241,7 @@ These are hypothetical branches: choose success or failure only from the actual
|
|
|
1241
1241
|
|
|
1242
1242
|
只可调用请求随附的工具。目录使用预加载索引或工具返回的 @dir-*,无需重复列目录确认;文档和历史使用返回的 @句柄。工具结果标明读取范围、完整性及 cursor;目录摘要不等于正文。材料覆盖中完整正文与精确读取取得对应范围的写入资格,界面绑定标注不扩大写入资格。初始世界材料只在全新上下文加载一次;后续成功工具调用与回执更新当前值和读取资格,不必重读自己刚成功写入的内容。全新上下文不继承旧对话的读取与写入资格。
|
|
1243
1243
|
|
|
1244
|
-
world_patch 的 YAML locator 可以包含 map key 和从零开始的数组下标;remove
|
|
1244
|
+
world_patch 的 YAML locator 可以包含 map key 和从零开始的数组下标;add 与 replace 是 upsert,无论目标是否存在都写入,下标达到或超过长度时追加;remove 删除一个精确位置,目标不存在时为无操作。每条 edit 独立结算:失败的 edit 被跳过,其余照常生效;回执列出失败项时,已生效的 edit 不要重发,只补发列出的 edit。未提供的元数据保持原值。world_retire 从目录注入中退役文档,文档仍可读取、引用和恢复。工具响应的成功状态变化与后续最终叙事分别提交,后续失败不回滚已提交变化。成功写入回执表示当前值已改变;以真实回执的结算状态为准,模型文字不能提交世界。
|
|
1245
1245
|
|
|
1246
1246
|
包含工具调用的响应属于中间步,其中的文字尚未展示或提交为最终叙事。收到全部工具结果后,根据回执在最终正文中呈现本轮尚未展示的内容,并与已提交状态一致;没有工具调用的非空正文结束本次循环并由 Runtime 提交。world_checkpoint 登记历史重放边界并向玩家建议从此开始全新上下文;在随后非空且无工具调用的最终正文成功提交后生效,边界包含该正文;登记后仍可继续工具调用。登记不结束世界内事件,也不自动切换上下文,玩家自行选择。全新上下文补入边界后的已提交玩家原文与最终叙事,排除开场白、工具和推理。何时登记由检查点政策块规定。
|
|
1247
1247
|
|
|
@@ -1249,7 +1249,7 @@ ${gt(e)}`:`# Tools and response settlement
|
|
|
1249
1249
|
|
|
1250
1250
|
Use only attached tools. Directories use @dir-* handles from the preload or tool results; do not list them again just to confirm a handle; documents and history use returned @handles. Results identify read scope, completeness and cursor; directory summaries are not document bodies. Complete injected bodies and exact reads obtain write authorization within their corresponding scopes; player-view annotations do not widen it. Initial world materials load once per fresh context. Later successful tool calls and receipts update current values and read scopes; do not re-read merely to confirm your own successful writes. A fresh context does not inherit an old conversation's read or write authorization.
|
|
1251
1251
|
|
|
1252
|
-
YAML world_patch locators accept map keys and zero-based array indexes; remove deletes one exact location. Omitted metadata remains unchanged. world_retire removes a document from catalog injection while keeping it readable, referenceable and restorable. Successful tool-response state changes and later final narrative commit separately; later failure does not roll back committed changes. Successful write receipts change current values; the actual receipt determines settlement, not model prose.
|
|
1252
|
+
YAML world_patch locators accept map keys and zero-based array indexes; add and replace are upserts that write whether or not the target exists, and an index past the end appends; remove deletes one exact location and is a no-op when it is absent. Each edit settles on its own: a failed edit is skipped and the others still apply, so when a receipt lists failed edits, send again only those. Omitted metadata remains unchanged. world_retire removes a document from catalog injection while keeping it readable, referenceable and restorable. Successful tool-response state changes and later final narrative commit separately; later failure does not roll back committed changes. Successful write receipts change current values; the actual receipt determines settlement, not model prose.
|
|
1253
1253
|
|
|
1254
1254
|
Responses containing tool calls are intermediate steps; their text has not yet been displayed or committed as final narrative. After all tool results, use the receipts to present this turn's still-unshown content in final prose consistent with committed state. A nonempty tool-free response ends this loop and Runtime commits it. world_checkpoint registers the history-replay boundary and suggests a fresh context from that point to the player; it takes effect after the subsequent nonempty tool-free final prose successfully commits, including that prose, and further tool calls may follow registration. Registration neither ends an in-world event nor switches context, which the player chooses. Fresh-context replay contains committed player originals and final narratives after the boundary, excluding the opening, tools and reasoning. The checkpoint policy block decides when to register.
|
|
1255
1255
|
|
package/dist/web/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="color-scheme" content="dark" />
|
|
7
7
|
<title>Narraeon</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Da0tdDij.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-BjxBYYQi.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|