@world-engines/protocol-ts 0.1.0-alpha.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/LICENSE +46 -0
- package/dist/entity-prop-envelope.d.ts +36 -0
- package/dist/entity-prop-envelope.js +50 -0
- package/dist/gen/v1/auth.d.ts +46 -0
- package/dist/gen/v1/auth.js +278 -0
- package/dist/gen/v1/billing.d.ts +71 -0
- package/dist/gen/v1/billing.js +521 -0
- package/dist/gen/v1/common.d.ts +65 -0
- package/dist/gen/v1/common.js +387 -0
- package/dist/gen/v1/llm.d.ts +317 -0
- package/dist/gen/v1/llm.js +3557 -0
- package/dist/gen/v1/mcp.d.ts +373 -0
- package/dist/gen/v1/mcp.js +3190 -0
- package/dist/gen/v1/moderation.d.ts +51 -0
- package/dist/gen/v1/moderation.js +368 -0
- package/dist/gen/v1/neutral_scenario_source.d.ts +80 -0
- package/dist/gen/v1/neutral_scenario_source.js +569 -0
- package/dist/gen/v1/relation_kind.d.ts +105 -0
- package/dist/gen/v1/relation_kind.js +562 -0
- package/dist/gen/v1/rest/admin.d.ts +432 -0
- package/dist/gen/v1/rest/admin.js +4957 -0
- package/dist/gen/v1/rest/asset.d.ts +205 -0
- package/dist/gen/v1/rest/asset.js +2200 -0
- package/dist/gen/v1/rest/auth.d.ts +275 -0
- package/dist/gen/v1/rest/auth.js +2896 -0
- package/dist/gen/v1/rest/billing.d.ts +101 -0
- package/dist/gen/v1/rest/billing.js +866 -0
- package/dist/gen/v1/rest/common.d.ts +179 -0
- package/dist/gen/v1/rest/common.js +1358 -0
- package/dist/gen/v1/rest/creator.d.ts +354 -0
- package/dist/gen/v1/rest/creator.js +4169 -0
- package/dist/gen/v1/rest/messaging.d.ts +190 -0
- package/dist/gen/v1/rest/messaging.js +2017 -0
- package/dist/gen/v1/rest/moderation.d.ts +61 -0
- package/dist/gen/v1/rest/moderation.js +569 -0
- package/dist/gen/v1/rest/pet.d.ts +98 -0
- package/dist/gen/v1/rest/pet.js +698 -0
- package/dist/gen/v1/rest/project_transfer.d.ts +470 -0
- package/dist/gen/v1/rest/project_transfer.js +5266 -0
- package/dist/gen/v1/rest/scenario.d.ts +756 -0
- package/dist/gen/v1/rest/scenario.js +8768 -0
- package/dist/gen/v1/rest/stock_bounty.d.ts +154 -0
- package/dist/gen/v1/rest/stock_bounty.js +1547 -0
- package/dist/gen/v1/rest/stocks.d.ts +465 -0
- package/dist/gen/v1/rest/stocks.js +5200 -0
- package/dist/gen/v1/rest/support_ticket.d.ts +61 -0
- package/dist/gen/v1/rest/support_ticket.js +511 -0
- package/dist/gen/v1/rest/users.d.ts +292 -0
- package/dist/gen/v1/rest/users.js +2879 -0
- package/dist/gen/v1/rest/violations.d.ts +52 -0
- package/dist/gen/v1/rest/violations.js +338 -0
- package/dist/gen/v1/sav.d.ts +987 -0
- package/dist/gen/v1/sav.js +12327 -0
- package/dist/gen/v1/save.d.ts +68 -0
- package/dist/gen/v1/save.js +595 -0
- package/dist/gen/v1/scenario_part_source.d.ts +94 -0
- package/dist/gen/v1/scenario_part_source.js +913 -0
- package/dist/gen/v1/session.d.ts +49 -0
- package/dist/gen/v1/session.js +311 -0
- package/dist/gen/v1/view_state.d.ts +267 -0
- package/dist/gen/v1/view_state.js +3239 -0
- package/dist/gen/v1/world.d.ts +82 -0
- package/dist/gen/v1/world.js +707 -0
- package/dist/gen/v1/world_memory.d.ts +545 -0
- package/dist/gen/v1/world_memory.js +5816 -0
- package/dist/gen/v1/world_memory_privacy.d.ts +96 -0
- package/dist/gen/v1/world_memory_privacy.js +994 -0
- package/dist/gen/v1/ws_frame.d.ts +1626 -0
- package/dist/gen/v1/ws_frame.js +18253 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/ladybug-extraction.d.ts +36 -0
- package/dist/ladybug-extraction.js +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { ErrorInfo } from "./common.js";
|
|
3
|
+
/**
|
|
4
|
+
* 渐进式召回的截断原因。调用方必须把 UNSPECIFIED 与 truncated=false 绑定;
|
|
5
|
+
* truncated=true 时原因必须非 UNSPECIFIED,禁止把预算耗尽伪装成完整结果。
|
|
6
|
+
*/
|
|
7
|
+
export declare enum RetrievalTruncationReason {
|
|
8
|
+
RETRIEVAL_TRUNCATION_REASON_UNSPECIFIED = 0,
|
|
9
|
+
RETRIEVAL_TRUNCATION_REASON_BYTE_BUDGET = 1,
|
|
10
|
+
RETRIEVAL_TRUNCATION_REASON_RESULT_LIMIT = 2,
|
|
11
|
+
RETRIEVAL_TRUNCATION_REASON_DEADLINE = 3,
|
|
12
|
+
UNRECOGNIZED = -1
|
|
13
|
+
}
|
|
14
|
+
export declare function retrievalTruncationReasonFromJSON(object: any): RetrievalTruncationReason;
|
|
15
|
+
export declare function retrievalTruncationReasonToJSON(object: RetrievalTruncationReason): string;
|
|
16
|
+
export declare enum RetrievalMatchArm {
|
|
17
|
+
RETRIEVAL_MATCH_ARM_UNSPECIFIED = 0,
|
|
18
|
+
RETRIEVAL_MATCH_ARM_VECTOR = 1,
|
|
19
|
+
RETRIEVAL_MATCH_ARM_KEYWORD = 2,
|
|
20
|
+
RETRIEVAL_MATCH_ARM_RELATIONAL = 3,
|
|
21
|
+
RETRIEVAL_MATCH_ARM_TRIE = 4,
|
|
22
|
+
RETRIEVAL_MATCH_ARM_NGRAM = 5,
|
|
23
|
+
UNRECOGNIZED = -1
|
|
24
|
+
}
|
|
25
|
+
export declare function retrievalMatchArmFromJSON(object: any): RetrievalMatchArm;
|
|
26
|
+
export declare function retrievalMatchArmToJSON(object: RetrievalMatchArm): string;
|
|
27
|
+
export declare enum RecallRealworldProvenance {
|
|
28
|
+
RECALL_REALWORLD_PROVENANCE_UNSPECIFIED = 0,
|
|
29
|
+
RECALL_REALWORLD_PROVENANCE_HAS_PROTOTYPE = 1,
|
|
30
|
+
RECALL_REALWORLD_PROVENANCE_FICTIONAL = 2,
|
|
31
|
+
UNRECOGNIZED = -1
|
|
32
|
+
}
|
|
33
|
+
export declare function recallRealworldProvenanceFromJSON(object: any): RecallRealworldProvenance;
|
|
34
|
+
export declare function recallRealworldProvenanceToJSON(object: RecallRealworldProvenance): string;
|
|
35
|
+
export declare enum McpTool {
|
|
36
|
+
MCP_TOOL_UNSPECIFIED = 0,
|
|
37
|
+
/** MCP_TOOL_GRAPH_QUERY - 玩家图向量 db 查询 */
|
|
38
|
+
MCP_TOOL_GRAPH_QUERY = 1,
|
|
39
|
+
/** MCP_TOOL_VECTOR_SEARCH - 向量近邻搜索 */
|
|
40
|
+
MCP_TOOL_VECTOR_SEARCH = 2,
|
|
41
|
+
/** MCP_TOOL_FULL_TEXT_SEARCH - 全文搜索 */
|
|
42
|
+
MCP_TOOL_FULL_TEXT_SEARCH = 3,
|
|
43
|
+
/** MCP_TOOL_ENTITY_GET - 按 id 取实体 */
|
|
44
|
+
MCP_TOOL_ENTITY_GET = 4,
|
|
45
|
+
/** MCP_TOOL_RELATION_LIST - 列实体的关系 */
|
|
46
|
+
MCP_TOOL_RELATION_LIST = 5,
|
|
47
|
+
/** MCP_TOOL_SAVE_COMMIT_LOCK - 存档冲突仲裁前置锁 */
|
|
48
|
+
MCP_TOOL_SAVE_COMMIT_LOCK = 6,
|
|
49
|
+
/** MCP_TOOL_WORLD_EVENT_EMIT - 写入世界事件 */
|
|
50
|
+
MCP_TOOL_WORLD_EVENT_EMIT = 7,
|
|
51
|
+
/** MCP_TOOL_GRAPH_RAG_SEARCH - GraphRAG 组合检索 */
|
|
52
|
+
MCP_TOOL_GRAPH_RAG_SEARCH = 8,
|
|
53
|
+
/** MCP_TOOL_EXPLORE_WORLD - director 高层探索 服务端拦截路由到子代理 不反向穿透客户端 */
|
|
54
|
+
MCP_TOOL_EXPLORE_WORLD = 9,
|
|
55
|
+
/** MCP_TOOL_PROPOSE_ACTION - 多人场景行动提案 Phase2 接线 服务端拦截不反向穿透客户端 */
|
|
56
|
+
MCP_TOOL_PROPOSE_ACTION = 10,
|
|
57
|
+
/** MCP_TOOL_SCENE_CLAIM - 场景占用声明 客户端 WS 帧驱动 非导演工具 (ADR-0058 wire 冻结保留 ADR-0059 导演只用 propose_action) */
|
|
58
|
+
MCP_TOOL_SCENE_CLAIM = 11,
|
|
59
|
+
/** MCP_TOOL_TURN_ACQUIRE - 回合获取 客户端 WS 帧驱动 非导演工具 */
|
|
60
|
+
MCP_TOOL_TURN_ACQUIRE = 12,
|
|
61
|
+
UNRECOGNIZED = -1
|
|
62
|
+
}
|
|
63
|
+
export declare function mcpToolFromJSON(object: any): McpTool;
|
|
64
|
+
export declare function mcpToolToJSON(object: McpTool): string;
|
|
65
|
+
/**
|
|
66
|
+
* 反向 MCP 工具的连接级能力声明。所有哈希均为 64 位小写十六进制 SHA-256。
|
|
67
|
+
* max_request_bytes/max_result_bytes 必须非零;timeout_ms 必须非零。
|
|
68
|
+
* read_only=false 的 effect 工具若 schema/hash 不一致,服务端必须 fail closed。
|
|
69
|
+
*/
|
|
70
|
+
export interface McpToolCapability {
|
|
71
|
+
tool_name: string;
|
|
72
|
+
contract_version: number;
|
|
73
|
+
read_only: boolean;
|
|
74
|
+
idempotent: boolean;
|
|
75
|
+
max_request_bytes: number;
|
|
76
|
+
max_result_bytes: number;
|
|
77
|
+
input_schema_sha256: string;
|
|
78
|
+
output_schema_sha256: string;
|
|
79
|
+
supports_cancel: boolean;
|
|
80
|
+
/** v1 固定为 false;在新增独立 progress frame 前禁止声明 true。 */
|
|
81
|
+
supports_progress: boolean;
|
|
82
|
+
timeout_ms: number;
|
|
83
|
+
_unknownFields?: {
|
|
84
|
+
[key: number]: Uint8Array[];
|
|
85
|
+
} | undefined;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* 客户端在 Hello 中发送的连接级不可变能力清单。
|
|
89
|
+
* generation 在同一逻辑客户端每次清单变化时单调递增;tools 按 tool_name UTF-8 字节序排序且不重复。
|
|
90
|
+
* manifest_sha256 绑定 generation、contract_version 与完整规范化 tools 清单。
|
|
91
|
+
*/
|
|
92
|
+
export interface McpSessionCapabilities {
|
|
93
|
+
generation: string;
|
|
94
|
+
contract_version: number;
|
|
95
|
+
tools: McpToolCapability[];
|
|
96
|
+
manifest_sha256: string;
|
|
97
|
+
_unknownFields?: {
|
|
98
|
+
[key: number]: Uint8Array[];
|
|
99
|
+
} | undefined;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 服务端在 HelloAck 中返回的能力交集。accepted_tools 只能来自客户端清单与服务端清单的严格交集。
|
|
103
|
+
* manifest_sha256 必须逐字回显已校验的客户端 manifest;legacy=true 时 accepted_tools 必须为空。
|
|
104
|
+
*/
|
|
105
|
+
export interface McpSessionCapabilityAck {
|
|
106
|
+
generation: string;
|
|
107
|
+
contract_version: number;
|
|
108
|
+
accepted_tools: McpToolCapability[];
|
|
109
|
+
manifest_sha256: string;
|
|
110
|
+
legacy: boolean;
|
|
111
|
+
_unknownFields?: {
|
|
112
|
+
[key: number]: Uint8Array[];
|
|
113
|
+
} | undefined;
|
|
114
|
+
}
|
|
115
|
+
/** MCP 反向穿透 服务端发起调用 客户端 wasm 执行后回包 */
|
|
116
|
+
export interface McpToolCall {
|
|
117
|
+
call_id: string;
|
|
118
|
+
tool_name: string;
|
|
119
|
+
arguments_json: Uint8Array;
|
|
120
|
+
_unknownFields?: {
|
|
121
|
+
[key: number]: Uint8Array[];
|
|
122
|
+
} | undefined;
|
|
123
|
+
}
|
|
124
|
+
export interface McpToolResult {
|
|
125
|
+
call_id: string;
|
|
126
|
+
ok: boolean;
|
|
127
|
+
result_json: Uint8Array;
|
|
128
|
+
error?: ErrorInfo | undefined;
|
|
129
|
+
_unknownFields?: {
|
|
130
|
+
[key: number]: Uint8Array[];
|
|
131
|
+
} | undefined;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* 一条批量召回查询。query_index 在同一请求中必须唯一。
|
|
135
|
+
* query_embedding_f32_le 是严格 little-endian IEEE-754 Float32 连续字节;长度必须等于
|
|
136
|
+
* embedding_dimension * 4,且每个分量必须是 finite(拒绝 NaN/Inf)。
|
|
137
|
+
* descriptor_sha256 必须是 64 位小写十六进制,并与批请求 descriptor_sha256 完全一致。
|
|
138
|
+
* content_byte_budget 是该 query 的 summaries 作为父 RetrieveBatchResponse.summaries repeated
|
|
139
|
+
* occurrence 编码时占用的 protobuf 字节子预算:每项均包含父字段 tag、length prefix 与完整
|
|
140
|
+
* RecallSummaryV1 encoded bytes。它必须非零且不大于所属批请求 content_byte_budget。
|
|
141
|
+
*/
|
|
142
|
+
export interface RetrievalQueryV1 {
|
|
143
|
+
query_index: number;
|
|
144
|
+
query_embedding_f32_le: Uint8Array;
|
|
145
|
+
embedding_dimension: number;
|
|
146
|
+
descriptor_sha256: string;
|
|
147
|
+
query_text: string;
|
|
148
|
+
fields: string[];
|
|
149
|
+
edge_kinds: string[];
|
|
150
|
+
depth: number;
|
|
151
|
+
content_byte_budget: number;
|
|
152
|
+
_unknownFields?: {
|
|
153
|
+
[key: number]: Uint8Array[];
|
|
154
|
+
} | undefined;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* 一次只读快照上的批量召回。operation_id 非空且在重试中保持不变;
|
|
158
|
+
* runtime_scope_sha256/descriptor_sha256 均为 64 位小写十六进制。
|
|
159
|
+
* queries 必须按 query_index 严格升序且无重复。content_byte_budget 是完整
|
|
160
|
+
* RetrieveBatchResponse protobuf message encoded byte length 的硬上限,包含响应内全部 field tag、
|
|
161
|
+
* length prefix、varint/fixed、repeated/map 嵌套、content_bytes 与预算回显字段本身;只排除外层
|
|
162
|
+
* McpToolResult、WS frame 与加密 framing。content_byte_budget/turn_remaining_content_bytes 必须
|
|
163
|
+
* 非零;turn remaining 不得超过单 turn 硬上限 1048576,content budget 必须
|
|
164
|
+
* <= min(262144, turn_remaining_content_bytes),每条 query 的子预算还必须 <= content budget。
|
|
165
|
+
* turn remaining 不是 actor 授权值:它必须逐值等于 host-owned TurnWorkBudget 在当前 active
|
|
166
|
+
* connection/turn ledger 中的剩余额度,并与 operation_id/runtime scope 在同一原子 CAS 内校验、
|
|
167
|
+
* 预留和最终扣减;不匹配、ledger 不存在或 CAS 失败均必须在查询前 fail closed。外层 WS 独立
|
|
168
|
+
* 执行传输帧上限,不能替代本预算。
|
|
169
|
+
*/
|
|
170
|
+
export interface RetrieveBatchRequest {
|
|
171
|
+
operation_id: string;
|
|
172
|
+
runtime_scope_sha256: string;
|
|
173
|
+
descriptor_sha256: string;
|
|
174
|
+
queries: RetrievalQueryV1[];
|
|
175
|
+
content_byte_budget: number;
|
|
176
|
+
turn_remaining_content_bytes: number;
|
|
177
|
+
_unknownFields?: {
|
|
178
|
+
[key: number]: Uint8Array[];
|
|
179
|
+
} | undefined;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 单条结构化命中原因。arm 必须非 UNSPECIFIED,rank 从 1 开始,score 必须 finite。
|
|
183
|
+
* matched_terms 与 relation_edge_kinds 必须去重并按 UTF-8 字节序稳定排序;不适用时为空。
|
|
184
|
+
*/
|
|
185
|
+
export interface RecallMatchReasonV1 {
|
|
186
|
+
arm: RetrievalMatchArm;
|
|
187
|
+
rank: number;
|
|
188
|
+
score: number;
|
|
189
|
+
matched_terms: string[];
|
|
190
|
+
relation_edge_kinds: string[];
|
|
191
|
+
_unknownFields?: {
|
|
192
|
+
[key: number]: Uint8Array[];
|
|
193
|
+
} | undefined;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* 摘要的最小来源证据。seed_entity_id/hop 记录图扩展路径;source_message_id/turn_id/write_seq
|
|
197
|
+
* 记录玩家世界写入来源,作者基线实体可省略这三项。realworld_provenance 与 prototype_name
|
|
198
|
+
* 遵循 ADR-0131;只有 HAS_PROTOTYPE 可携带非空 prototype_name。
|
|
199
|
+
*/
|
|
200
|
+
export interface RecallProvenanceV1 {
|
|
201
|
+
seed_entity_id: string;
|
|
202
|
+
hop: number;
|
|
203
|
+
source_message_id: string;
|
|
204
|
+
turn_id: string;
|
|
205
|
+
write_seq: string;
|
|
206
|
+
realworld_provenance: RecallRealworldProvenance;
|
|
207
|
+
prototype_name: string;
|
|
208
|
+
_unknownFields?: {
|
|
209
|
+
[key: number]: Uint8Array[];
|
|
210
|
+
} | undefined;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* 渐进披露第一阶段返回的最小摘要。why_matched 与 provenance 均必须非空并稳定排序,
|
|
214
|
+
* 第一阶段必须能结构化审计“为何命中”及“事实来自哪里”。field_values_utf8 的值是对应字段的
|
|
215
|
+
* 完整 UTF-8 字节,edge_lists_utf8_json 的值是按稳定键排序的 canonical UTF-8 JSON 数组;
|
|
216
|
+
* 禁止截断单个 UTF-8 值或 JSON 值。why_matched 按 arm 数值、rank、UTF-8 字节序排序;
|
|
217
|
+
* provenance 按 seed_entity_id、hop、source_message_id 的 UTF-8 字节序排序。content_sha256
|
|
218
|
+
* 绑定除自身以外的全部规范化内容,包含 why_matched/provenance,但不绑定 protobuf framing。
|
|
219
|
+
*/
|
|
220
|
+
export interface RecallSummaryV1 {
|
|
221
|
+
query_index: number;
|
|
222
|
+
recall_id: string;
|
|
223
|
+
entity_id: string;
|
|
224
|
+
entity_kind: string;
|
|
225
|
+
display_name: string;
|
|
226
|
+
summary: string;
|
|
227
|
+
relevance_score: number;
|
|
228
|
+
available_fields: string[];
|
|
229
|
+
available_edge_kinds: string[];
|
|
230
|
+
materialized_depth: number;
|
|
231
|
+
field_values_utf8: {
|
|
232
|
+
[key: string]: Uint8Array;
|
|
233
|
+
};
|
|
234
|
+
edge_lists_utf8_json: {
|
|
235
|
+
[key: string]: Uint8Array;
|
|
236
|
+
};
|
|
237
|
+
content_sha256: string;
|
|
238
|
+
why_matched: RecallMatchReasonV1[];
|
|
239
|
+
provenance: RecallProvenanceV1[];
|
|
240
|
+
_unknownFields?: {
|
|
241
|
+
[key: number]: Uint8Array[];
|
|
242
|
+
} | undefined;
|
|
243
|
+
}
|
|
244
|
+
export interface RecallSummaryV1_FieldValuesUtf8Entry {
|
|
245
|
+
key: string;
|
|
246
|
+
value: Uint8Array;
|
|
247
|
+
_unknownFields?: {
|
|
248
|
+
[key: number]: Uint8Array[];
|
|
249
|
+
} | undefined;
|
|
250
|
+
}
|
|
251
|
+
export interface RecallSummaryV1_EdgeListsUtf8JsonEntry {
|
|
252
|
+
key: string;
|
|
253
|
+
value: Uint8Array;
|
|
254
|
+
_unknownFields?: {
|
|
255
|
+
[key: number]: Uint8Array[];
|
|
256
|
+
} | undefined;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* summaries 先按 query_index、再按稳定 recall_id 排序。content_bytes 必须等于回填最终字段值后
|
|
260
|
+
* RetrieveBatchResponse.encode(response).finish().byteLength,包含本响应内全部 protobuf framing、
|
|
261
|
+
* content_bytes 与 content_byte_budget 自身,只排除外层 McpToolResult、WS frame 与加密 framing。
|
|
262
|
+
* producer 必须迭代编码直到 content_bytes 达到 fixed point,再 readback 重编码确认相等;consumer
|
|
263
|
+
* 必须重编码核验相等后才按该值原子扣减 turn remaining。content_bytes 必须
|
|
264
|
+
* <= content_byte_budget,且 content_byte_budget 必须原样回显已校验的请求预算。
|
|
265
|
+
* operation_id/runtime_scope_sha256/descriptor_sha256 必须逐值等于原请求;continuation_token 只能由
|
|
266
|
+
* host 签发并绑定上述三元组、下一 query/recall 游标和预算 ledger,actor 不能自造或跨 scope 重放。
|
|
267
|
+
* truncated=false 时 reason 必须 UNSPECIFIED、continuation_token 为空且 omitted_summary_count=0;
|
|
268
|
+
* truncated=true 时 reason 必须非 UNSPECIFIED,并在完整 summary 边界停止。若同一 query 尚有
|
|
269
|
+
* 后续结果,continuation_token 必须非空;否则 next_query_index 指向首个未开始的 query。
|
|
270
|
+
*/
|
|
271
|
+
export interface RetrieveBatchResponse {
|
|
272
|
+
operation_id: string;
|
|
273
|
+
runtime_scope_sha256: string;
|
|
274
|
+
descriptor_sha256: string;
|
|
275
|
+
summaries: RecallSummaryV1[];
|
|
276
|
+
content_bytes: number;
|
|
277
|
+
truncated: boolean;
|
|
278
|
+
truncation_reason: RetrievalTruncationReason;
|
|
279
|
+
next_query_index?: number | undefined;
|
|
280
|
+
continuation_token: string;
|
|
281
|
+
omitted_summary_count: number;
|
|
282
|
+
content_byte_budget: number;
|
|
283
|
+
_unknownFields?: {
|
|
284
|
+
[key: number]: Uint8Array[];
|
|
285
|
+
} | undefined;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* 对第一阶段 recall_id 做受控展开。query_index、operation_id、runtime scope 与 descriptor
|
|
289
|
+
* 必须和原批请求/响应一致;recall_ids/fields/edge_kinds 均须非空、去重并稳定排序。
|
|
290
|
+
* content_byte_budget 是完整 RetrievalExpandResponse protobuf message encoded byte length 的硬上限,
|
|
291
|
+
* 采用与 RetrieveBatchRequest 完全相同的 framing/fixed-point 口径;turn remaining 同样只扣最终
|
|
292
|
+
* response encoded bytes。turn remaining 必须逐值等于同一 host-owned active connection/turn ledger,
|
|
293
|
+
* 并与本 operation/scope 做原子 CAS;actor 声明没有授权性。content budget 必须
|
|
294
|
+
* <= min(262144, turn remaining),否则展开前 fail closed。continuation_token 必须是 host 签发且绑定
|
|
295
|
+
* operation_id、runtime_scope_sha256、descriptor_sha256、query_index、recall 游标与预算 ledger 的原 token。
|
|
296
|
+
*/
|
|
297
|
+
export interface RetrievalExpandRequest {
|
|
298
|
+
operation_id: string;
|
|
299
|
+
runtime_scope_sha256: string;
|
|
300
|
+
descriptor_sha256: string;
|
|
301
|
+
query_index: number;
|
|
302
|
+
recall_ids: string[];
|
|
303
|
+
fields: string[];
|
|
304
|
+
edge_kinds: string[];
|
|
305
|
+
depth: number;
|
|
306
|
+
content_byte_budget: number;
|
|
307
|
+
continuation_token: string;
|
|
308
|
+
turn_remaining_content_bytes: number;
|
|
309
|
+
_unknownFields?: {
|
|
310
|
+
[key: number]: Uint8Array[];
|
|
311
|
+
} | undefined;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* summaries 只包含本次请求 recall_ids 的完整原子投影,并保持请求顺序。
|
|
315
|
+
* 截断只能发生在完整字段值、完整 edge list 或完整 summary 边界;任何部分 UTF-8/JSON
|
|
316
|
+
* 值都必须 fail closed。truncated 字段组合规则与 RetrieveBatchResponse 相同。content_bytes 必须
|
|
317
|
+
* 等于回填最终值后 RetrievalExpandResponse.encode(response).finish().byteLength,并执行同样的
|
|
318
|
+
* fixed-point/readback 校验;它必须 <= content_byte_budget,且预算原样回显已校验的展开请求值。
|
|
319
|
+
* response 的 operation_id/runtime_scope_sha256/descriptor_sha256/query_index 必须逐值等于请求;
|
|
320
|
+
* 后续 continuation_token 只能由 host 续签到同一绑定,禁止跨 operation/scope/descriptor 重放。
|
|
321
|
+
*/
|
|
322
|
+
export interface RetrievalExpandResponse {
|
|
323
|
+
operation_id: string;
|
|
324
|
+
runtime_scope_sha256: string;
|
|
325
|
+
descriptor_sha256: string;
|
|
326
|
+
query_index: number;
|
|
327
|
+
summaries: RecallSummaryV1[];
|
|
328
|
+
content_bytes: number;
|
|
329
|
+
truncated: boolean;
|
|
330
|
+
truncation_reason: RetrievalTruncationReason;
|
|
331
|
+
continuation_token: string;
|
|
332
|
+
omitted_field_count: number;
|
|
333
|
+
omitted_edge_count: number;
|
|
334
|
+
omitted_summary_count: number;
|
|
335
|
+
content_byte_budget: number;
|
|
336
|
+
_unknownFields?: {
|
|
337
|
+
[key: number]: Uint8Array[];
|
|
338
|
+
} | undefined;
|
|
339
|
+
}
|
|
340
|
+
export declare const McpToolCapability: MessageFns<McpToolCapability>;
|
|
341
|
+
export declare const McpSessionCapabilities: MessageFns<McpSessionCapabilities>;
|
|
342
|
+
export declare const McpSessionCapabilityAck: MessageFns<McpSessionCapabilityAck>;
|
|
343
|
+
export declare const McpToolCall: MessageFns<McpToolCall>;
|
|
344
|
+
export declare const McpToolResult: MessageFns<McpToolResult>;
|
|
345
|
+
export declare const RetrievalQueryV1: MessageFns<RetrievalQueryV1>;
|
|
346
|
+
export declare const RetrieveBatchRequest: MessageFns<RetrieveBatchRequest>;
|
|
347
|
+
export declare const RecallMatchReasonV1: MessageFns<RecallMatchReasonV1>;
|
|
348
|
+
export declare const RecallProvenanceV1: MessageFns<RecallProvenanceV1>;
|
|
349
|
+
export declare const RecallSummaryV1: MessageFns<RecallSummaryV1>;
|
|
350
|
+
export declare const RecallSummaryV1_FieldValuesUtf8Entry: MessageFns<RecallSummaryV1_FieldValuesUtf8Entry>;
|
|
351
|
+
export declare const RecallSummaryV1_EdgeListsUtf8JsonEntry: MessageFns<RecallSummaryV1_EdgeListsUtf8JsonEntry>;
|
|
352
|
+
export declare const RetrieveBatchResponse: MessageFns<RetrieveBatchResponse>;
|
|
353
|
+
export declare const RetrievalExpandRequest: MessageFns<RetrievalExpandRequest>;
|
|
354
|
+
export declare const RetrievalExpandResponse: MessageFns<RetrievalExpandResponse>;
|
|
355
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
356
|
+
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
357
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
358
|
+
} : Partial<T>;
|
|
359
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
360
|
+
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
361
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
362
|
+
} & {
|
|
363
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
364
|
+
};
|
|
365
|
+
interface MessageFns<T> {
|
|
366
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
367
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
368
|
+
fromJSON(object: any): T;
|
|
369
|
+
toJSON(message: T): unknown;
|
|
370
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
371
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
372
|
+
}
|
|
373
|
+
export {};
|