@blade-hq/agent-client 2612.0.0-beta.83 → 2612.0.0-beta.85

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 CHANGED
@@ -169,6 +169,7 @@ await client.sessions.updateSession(id, { intent: "新标题" })
169
169
  await client.sessions.deleteSession(id)
170
170
  await client.sessions.getSessionTurns(id) // 历史消息(投影格式,与实时流同构)
171
171
  await client.sessions.getRunResult(id, executionId) // 所有者查询持久执行结果;尚无结束记录返回 null
172
+ await client.sessions.getRequestEvidence(id, requestId) // 所有者按原请求查询全部保留分支的消费身份
172
173
  const page = await client.sessions.getSessionTurnsPage(id) // 聊天首屏 recent page
173
174
  await client.sessions.getSessionTurnsPage(id, { before: page.nextBefore! })
174
175
  // 从某条用户发言定位到最新(消息导航点窗口外的发言):调用参数是 SessionTurnsQuery
@@ -178,6 +179,8 @@ const index = await client.sessions.getSessionTurnIndex(id) // SessionTurnIndex
178
179
  const first = index.items[0] // SessionTurnIndexItem
179
180
  ```
180
181
 
182
+ `getRequestEvidence` 仅查询原请求的消费身份,不返回消息正文。`consumed` 带 `executionId`,`not_found` 表示完整根历史中没有该请求;`unknown` 带 `reason`,表示匹配记录的执行身份不完整或冲突。缺文件、损坏、不完整读取和不符合契约的响应均抛错,不能当作未消费。查询覆盖 rewind 前保留的分支;是否重试仍须结合原请求回执并沿用原 `PreparedSend`。
183
+
181
184
  创建会话时可以绑定 Streamable HTTP MCP 来源,并用可选 `description` 提供用途说明。
182
185
  默认 `exposure: "lazy"` 只保存来源配置,创建时不连接 MCP;模型初始只看到来源名称和说明。
183
186
  通过 `lazy_tool_search({query: "所需能力", limit: 8})` 全局搜索并获得命中工具的完整标识、
@@ -855,7 +858,7 @@ chat.renderers = {
855
858
  - **声明式会话**:`SessionDefinition`、`SolutionDefinition`、`SkillDefinition`、`SkillFile`、`SessionConfig`、`TextFile`、`SessionSetupError`、`SessionSetupStage`
856
859
  - **会话消息队列**:`SessionQueueSnapshot`、`QueuedMessage`、`QueuedMessageStatus`、`QueueOperationResult`
857
860
  - **页面协作**:`CommandHandler`、`BladeChatMountRenderers`、`MountRenderer`、`MountRendererObject`、`MountResult`、`MountHandle`
858
- - **会话资源(REST)**:`SessionsResource`、`CreateSessionRequest`、`McpSourceConfig`、`PaginatedSessionsResult`、`SessionInfo`、`SessionStatus`、`SessionDetail`、`DEFAULT_REPLAY_SPEED`、`ReplaySpeed`、`ReplayState`、`SessionTurnsPage`、`SessionTurnsQuery`、`SessionRunResult`、`FileEntry`、`UploadFileEntry`、`UploadFilesOptions`、`AppCliDefinition`、`AppCliAttachment`
861
+ - **会话资源(REST)**:`SessionsResource`、`CreateSessionRequest`、`McpSourceConfig`、`PaginatedSessionsResult`、`SessionInfo`、`SessionStatus`、`SessionDetail`、`DEFAULT_REPLAY_SPEED`、`ReplaySpeed`、`ReplayState`、`SessionTurnsPage`、`SessionTurnsQuery`、`SessionRequestEvidence`、`SessionRunResult`、`FileEntry`、`UploadFileEntry`、`UploadFilesOptions`、`AppCliDefinition`、`AppCliAttachment`
859
862
  - **模型目录**:`ModelsResource`、`ModelCatalog`、`ModelOption`
860
863
  - **沙盒脚本**:`SandboxResource`、`SandboxScriptRequest`、`SandboxScriptResult`。`client.sandbox.execute({ script, cwd, timeout })` 在当前登录用户的沙盒执行脚本,无需创建智能体会话;`cwd` 使用绝对路径,`timeout` 单位为秒,默认及最大值为 120。结果包含合并诊断输出 `output`、独立标准输出 `stdout` 及其截断标志 `stdout_truncated`、可为空的退出码、超时标志和错误信息;无法启动或无法确认停止时应检查 `error`,不能仅凭退出码判断成功。
861
864
  - **远程电脑**:`ComputersResource`、`SessionComputer`、`AccountComputer`
@@ -227,7 +227,7 @@ var ToolProvider = class {
227
227
 
228
228
  // src/version.ts
229
229
  var SDK_NAME = "agent-client";
230
- var SDK_VERSION = true ? "2612.0.0-beta.83" : "1.1.1";
230
+ var SDK_VERSION = true ? "2612.0.0-beta.85" : "1.1.1";
231
231
 
232
232
  // src/auth-login.ts
233
233
  function isAuthCallbackMessage(value) {
@@ -4112,8 +4112,8 @@ var SessionsResource = class {
4112
4112
  return this.client.json("GET", `/api/sessions/${sessionId}/tasks`);
4113
4113
  }
4114
4114
  /** Durable result for this execution; null until its run_end is committed. Owner only. */
4115
- getRunResult(sessionId, runId) {
4116
- return this.client.json("GET", `/api/sessions/${encodeURIComponent(sessionId)}/runs/${encodeURIComponent(runId)}`);
4115
+ getRunResult(sessionId, runId, init) {
4116
+ return this.client.jsonFromInit(`/api/sessions/${encodeURIComponent(sessionId)}/runs/${encodeURIComponent(runId)}`, init);
4117
4117
  }
4118
4118
  async getSessionTurns(sessionId) {
4119
4119
  const entries = await this.client.json(
@@ -4196,6 +4196,14 @@ var SessionsResource = class {
4196
4196
  getSessionContextStats(sessionId, init) {
4197
4197
  return this.client.jsonFromInit(`/api/sessions/${sessionId}/context-stats`, init);
4198
4198
  }
4199
+ /** Owner-only consumption evidence across all retained branches. Throws on an invalid response. */
4200
+ async getRequestEvidence(sessionId, requestId, init) {
4201
+ const value = await this.client.jsonFromInit(`/api/sessions/${encodeURIComponent(sessionId)}/history?request_id=${encodeURIComponent(requestId)}`, init);
4202
+ if (!value || value.requestId !== requestId || !["consumed", "not_found", "unknown"].includes(value.status) || (value.status === "consumed" ? typeof value.executionId !== "string" || !value.executionId.trim() : value.executionId !== void 0) || value.status === "unknown" && value.reason !== "request_identity_incomplete_or_conflicting") {
4203
+ throw new Error("Invalid request history evidence");
4204
+ }
4205
+ return value;
4206
+ }
4199
4207
  getSessionHistory(sessionId, init) {
4200
4208
  return this.client.jsonFromInit(`/api/sessions/${sessionId}/history`, init);
4201
4209
  }
@@ -9802,4 +9810,4 @@ export {
9802
9810
  formatAskUserAnswer,
9803
9811
  attachPackPageBridge
9804
9812
  };
9805
- //# sourceMappingURL=chunk-J5HK3PPV.js.map
9813
+ //# sourceMappingURL=chunk-AKYL4RUF.js.map