@roll-agent/protocol 0.8.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -1
- package/dist/app-output.d.ts +2 -2
- package/dist/index.d.ts +8637 -4864
- package/dist/index.js +178 -30
- package/dist/schema/roll-runtime-protocol-v1.6.schema.json +7186 -0
- package/dist/schema/roll-runtime-protocol-v1.schema.json +326 -11
- package/fixtures/v1.6/valid-context-recovery-event.json +23 -0
- package/fixtures/v1.6/valid-context-recovery-snapshot-response.json +30 -0
- package/fixtures/v1.6/valid-initialize-response.json +36 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ function handleEvent(event: RuntimeEventEnvelopeV13): void {
|
|
|
94
94
|
|
|
95
95
|
协议版本与 npm 包版本相互独立。`RUNTIME_PROTOCOL_VERSION` 表示这个包提供的最新 wire
|
|
96
96
|
schema,并不代表调用方已实现对应 Client 能力。当前支持顺序为
|
|
97
|
-
`["1.5", "1.4", "1.3", "1.2", "1.1", "1.0"]`。`initialize` 请求保持旧 strict 形状;协商到 `"1.2"`、
|
|
97
|
+
`["1.6", "1.5", "1.4", "1.3", "1.2", "1.1", "1.0"]`。`initialize` 请求保持旧 strict 形状;协商到 `"1.2"`、
|
|
98
98
|
`"1.3"` 或 `"1.4"` 后,
|
|
99
99
|
Client 必须用 `client.capabilities.set` 提交单调 `revision` 与当前 Handler methods,Runtime
|
|
100
100
|
返回 registry 交集后才进入 interaction-ready。ACK 可以为空或为请求集的任意子集,顺序按
|
|
@@ -172,6 +172,22 @@ Protocol `"1.0"` / `"1.1"` 的 strict 顶层结构不变,旧 GUI 可以继续
|
|
|
172
172
|
读取时传 `display.value`。两者同样刻意放在既有 JSON 槽位内:strict 顶层结构不变,旧客户端把它们当
|
|
173
173
|
普通 JSON 忽略;`unified` 缺席表示只有统计(超大文件),`truncated: true` 表示正文按上限截断。
|
|
174
174
|
|
|
175
|
+
文件审批绑定生成预览时的完整文件版本。其他调用刷新 read tracker 不会刷新这份审批;执行前版本
|
|
176
|
+
变化时,`edit_file` / `write_file` 返回失败,需要重新读取并提交。单次 `edits` 仍按顺序规划,
|
|
177
|
+
任一编辑失败则不写入。
|
|
178
|
+
|
|
179
|
+
Runtime 1.6 的待审批 `preview.fullDiffAvailable: true` 表示可通过只读 `approval.preview` 读取
|
|
180
|
+
完整预览。参数为 `{ threadId, turnId, approvalId, offset?, maxChars? }`;`offset` 默认 0,
|
|
181
|
+
`maxChars` 默认 12,000、最大 32,000。返回 `{ text, totalChars, nextOffset }`,`nextOffset: null`
|
|
182
|
+
表示结束,偏移以 UTF-16 code units 计数。各页来自审批时的同一份快照,先整体脱敏再切页,不重新读取文件。
|
|
183
|
+
完整正文仅保留到审批结束,不进入持久事件、账本或模型上下文;失效或跨 thread/turn 的读取返回
|
|
184
|
+
`APPROVAL_NOT_FOUND`。旧版协议及 legacy `--server` 不提供此方法,客户端须协商 1.6 后接入。
|
|
185
|
+
|
|
186
|
+
首屏仍最多 12,000 字符;大文件可省略首屏正文,但完整预览可读。`coarse: true` 表示逐行 diff
|
|
187
|
+
计算超时/失败,完整预览改为明确标记的原文/新文对照,此时 `removed` / `added` 分别是原文/新文
|
|
188
|
+
总行数,不能显示为精细改动统计。Ink 审批使用 PgUp/PgDn 查看完整变更,基础 REPL 使用确认菜单的
|
|
189
|
+
“查看完整变更”;原有批准、拒绝和会话授权方式保留。
|
|
190
|
+
|
|
175
191
|
## 文档
|
|
176
192
|
|
|
177
193
|
- [Runtime Protocol v1 参考](https://github.com/steveoon/roll-agent/blob/main/docs/runtime-protocol-v1-reference.md)
|
package/dist/app-output.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export declare const appOutputResultSchema: z.ZodReadonly<z.ZodDiscriminatedUnio
|
|
|
54
54
|
expired: "expired";
|
|
55
55
|
denied: "denied";
|
|
56
56
|
}>;
|
|
57
|
-
}, z.core.$strict>]>>;
|
|
57
|
+
}, z.core.$strict>], "status">>;
|
|
58
58
|
export type AppOutputResult = z.infer<typeof appOutputResultSchema>;
|
|
59
59
|
export declare const appOutputDescriptorSchema: z.ZodReadonly<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
|
|
60
60
|
status: z.ZodLiteral<"rejected">;
|
|
@@ -75,7 +75,7 @@ export declare const appOutputDescriptorSchema: z.ZodReadonly<z.ZodDiscriminated
|
|
|
75
75
|
expired: "expired";
|
|
76
76
|
denied: "denied";
|
|
77
77
|
}>;
|
|
78
|
-
}, z.core.$strict>]>>;
|
|
78
|
+
}, z.core.$strict>], "status">>;
|
|
79
79
|
export type AppOutputDescriptor = z.infer<typeof appOutputDescriptorSchema>;
|
|
80
80
|
export declare function describeAppOutput(result: AppOutputResult): AppOutputDescriptor;
|
|
81
81
|
/** Validate portable, self-contained contracts without dereferencing network resources. */
|