@blade-hq/agent-client 2610.0.0-rc.0 → 2610.0.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 +202 -12
- package/dist/auth.d.ts +0 -1
- package/dist/blade-client.d.ts +22 -1
- package/dist/index.d.ts +31 -9
- package/dist/index.js +1851 -263
- package/dist/index.js.map +1 -1
- package/dist/polling-backoff.d.ts +11 -0
- package/dist/resources/chat-groups.d.ts +31 -0
- package/dist/resources/computers.d.ts +54 -2
- package/dist/resources/plugins.d.ts +43 -0
- package/dist/resources/sessions.d.ts +190 -1
- package/dist/resources/site-visits.d.ts +32 -0
- package/dist/rest.d.ts +8 -0
- package/dist/schemas/mcp-app.d.ts +30 -0
- package/dist/schemas/message-utils.d.ts +10 -0
- package/dist/schemas/message.d.ts +3 -0
- package/dist/schemas/projection.d.ts +25 -1
- package/dist/schemas/session.d.ts +7 -0
- package/dist/session/agent-session.d.ts +152 -18
- package/dist/session/definition.d.ts +6 -1
- package/dist/session/errors.d.ts +11 -0
- package/dist/session/events.d.ts +14 -2
- package/dist/session/history-page.d.ts +9 -0
- package/dist/session/hub.d.ts +1 -0
- package/dist/session/queue.d.ts +104 -0
- package/dist/session/state.d.ts +15 -1
- package/dist/shared/auth-busy.d.ts +9 -0
- package/dist/shared/projection/builder.d.ts +10 -0
- package/dist/shared/projection/helpers.d.ts +2 -2
- package/dist/shared/projection/index.d.ts +1 -1
- package/dist/shared/projection/state.d.ts +7 -0
- package/dist/shared/tool-ui-card.d.ts +60 -0
- package/dist/shared/type-guards.d.ts +2 -0
- package/dist/socket.d.ts +2 -0
- package/dist/types/socket-events.d.ts +186 -2
- package/package.json +1 -1
- package/public-api.md +747 -11
package/README.md
CHANGED
|
@@ -85,6 +85,10 @@ new BladeClient({
|
|
|
85
85
|
})
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
高级宿主可通过 `BladeClientOptions.commandTransport(event, payload, send)` 接管带回执的命令传输,例如浏览器插件让后台持有发送请求,面板关闭后仍能等待请求结束并停止任务。返回原始服务端 ack,失败时抛错;不接管的命令调用 `send()` 使用默认 Socket.IO。事件订阅仍使用原 socket。`client.requestCommand(event, payload, timeoutMs)` 是同一通道的低层入口,普通应用继续使用类型化的 `AgentSession` 方法。
|
|
89
|
+
|
|
90
|
+
底层 `createSocket` 允许指定 `transports`;MV3 service worker 没有 XMLHttpRequest,可使用 `["websocket"]`。不指定时保持 Socket.IO 默认选择。
|
|
91
|
+
|
|
88
92
|
SDK 会固定订阅普通聊天所需的完整实时事件。产品内置 Web 的精简/开发者展示模式不属于
|
|
89
93
|
公共 SDK 契约,也没有对应的构造参数或 Socket.IO 字段。
|
|
90
94
|
|
|
@@ -153,6 +157,8 @@ const chat = await client.sessions.create({
|
|
|
153
157
|
|
|
154
158
|
Solution 和 Skill 都声明为 `{ path, content }[]` 文本文件;SDK 负责准备资源、创建会话和安装 Skill,成功返回时 `chat` 已可使用。已有 Solution 改传 `solution: { id, role }`。模型值是 Server 模型目录中的 ID,LLM 地址与密钥应由 Server 管理。
|
|
155
159
|
|
|
160
|
+
`SkillDefinition.files` 使用 `SkillFile[]`:文本文件仍填写 `path` 和 `content`;二进制文件将内容编码为 base64,并设置 `encoding: "base64"`。自带可执行文件另设 `executable: true`。这两个可选字段适用于沙盒会话,不扩展 Solution 的 `TextFile` 格式。
|
|
161
|
+
|
|
156
162
|
> **`sessionId` 从哪来?** 三种,按需选:
|
|
157
163
|
> 1. **不用管它** —— 首次接入最省事:`client.sessions.create()` 直接建一个新会话,用不着 ID。React 的 `<ChatView />` 不传 `sessionId` 也一样。
|
|
158
164
|
> 2. **自己建、自己存**:`const { session_id } = await client.sessions.createSessionWithRequest({ intent: "季度报表分析" })`。把返回的 `session_id`(后端是蛇形命名)存进你的数据库或 URL,用户下次进来传给 `connect(sessionId)`(前端参数是驼峰),就能接着上次的对话。
|
|
@@ -167,7 +173,81 @@ await client.sessions.getSession(id) // 会话详情
|
|
|
167
173
|
await client.sessions.updateSession(id, { intent: "新标题" })
|
|
168
174
|
await client.sessions.deleteSession(id)
|
|
169
175
|
await client.sessions.getSessionTurns(id) // 历史消息(投影格式,与实时流同构)
|
|
170
|
-
|
|
176
|
+
const page = await client.sessions.getSessionTurnsPage(id) // 聊天首屏 recent page
|
|
177
|
+
await client.sessions.getSessionTurnsPage(id, { before: page.nextBefore! })
|
|
178
|
+
// 从某条用户发言定位到最新(消息导航点窗口外的发言):调用参数是 SessionTurnsQuery
|
|
179
|
+
await client.sessions.getSessionTurnsPage(id, { fromEntryId: "entry-id" })
|
|
180
|
+
// 当前分支上全部可导航的用户发言目录(entry_id + 标题 + 时间,不含消息体)
|
|
181
|
+
const index = await client.sessions.getSessionTurnIndex(id) // SessionTurnIndex
|
|
182
|
+
const first = index.items[0] // SessionTurnIndexItem
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
`SessionTurnsQuery` 的 `before` 与 `fromEntryId` 互斥;定位命中不了当前分支时服务端返回
|
|
186
|
+
404 / 409,而不是空窗口。目录的 `entryId` 与 `/turns` 的 `turn_id` 同源,可直接当 `before` 游标。
|
|
187
|
+
|
|
188
|
+
会话插件可通过 `client.sessions.listSessionPlugins(id)` 查询,并用
|
|
189
|
+
`client.sessions.setSessionPluginActivation(id, name, active)` 切换当前会话。列表项为 `SessionPlugin`;修改结果为 `SessionPluginActivation`,只返回选择和准备状态,安装事实需从列表获取。
|
|
190
|
+
|
|
191
|
+
账号级目录是 `client.plugins.catalog()`(`PluginsResource` 是 `client.plugins`
|
|
192
|
+
的类型)。它**不依赖任何会话**,返回 `PluginCatalogEntry[]`:`name`、`display_name`、
|
|
193
|
+
`icon`、`installed`。没有会话也要展示插件名称与图标的界面(例如首页的输入框连接器)
|
|
194
|
+
用它,而不是先建一个会话。
|
|
195
|
+
|
|
196
|
+
`icon` 是不透明的缓存 token(当前是包内容摘要),**不是路径**:把它交给
|
|
197
|
+
`client.plugins.fetchIcon(name)` 取字节再转 object URL,不要拿它拼 URL,也不要把
|
|
198
|
+
`<img>` 指向接口路径(token 用户会拿到 401/403)。
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
const { plugins } = await client.plugins.catalog()
|
|
202
|
+
// plugins: PluginCatalogEntry[]
|
|
203
|
+
// name 技术 ID:路径、授权、缓存与调用一律用它
|
|
204
|
+
// display_name 包声明的业务名;null 时界面回退到 name
|
|
205
|
+
// icon 包内图标的 opaque token;null 表示没有可用图标
|
|
206
|
+
// installed 当前用户是否安装了它
|
|
207
|
+
|
|
208
|
+
const blob = await client.plugins.fetchIcon(plugins[0].name)
|
|
209
|
+
const url = URL.createObjectURL(blob)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
账号电脑目录是 `client.computers.listAccount()`,返回 `AccountComputerList`。它只回答
|
|
213
|
+
账号事实(登记过哪些电脑、此刻在不在线,`AccountComputer`),**不含**"本次会话能不能
|
|
214
|
+
用它"——那是会话接口 (`client.computers.list`) 的回答。两者混着说,用户就会把在线当成
|
|
215
|
+
已授权。
|
|
216
|
+
|
|
217
|
+
插件可以在包内 `cn.com.bladeai.agent/config.schema.json` 用标准 JSON Schema
|
|
218
|
+
(Draft 2020-12)声明账号、token 或任意业务配置。声明了配置的插件用
|
|
219
|
+
`client.sessions.getSessionPluginConfig(id, name)` 读取声明与当前值,用
|
|
220
|
+
`client.sessions.updateSessionPluginConfig(id, name, { expected_revision, set, remove })`
|
|
221
|
+
保存;两者都要等到插件包已准备(即已激活过)才有内容,没有声明的插件返回
|
|
222
|
+
`state: "not_required"`。
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
const { config } = await client.sessions.getSessionPluginConfig(id, "crm")
|
|
226
|
+
// config: SessionPluginConfigState
|
|
227
|
+
// state "not_required" | "required" | "configured" | "error"
|
|
228
|
+
// schema 包内声明的 JSON Schema(Draft 2020-12)
|
|
229
|
+
// values 已存值,writeOnly 字段已被平台剔除
|
|
230
|
+
// write_only 当前有值的秘密字段 JSON Pointer
|
|
231
|
+
// revision 乐观并发用的版本号
|
|
232
|
+
// errors SessionPluginConfigError[],逐条 { path, message },不含用户输入
|
|
233
|
+
// 列表项 SessionPlugin.config 是 SessionPluginConfigSummary
|
|
234
|
+
// (SessionPluginConfigStateName 之外多一个 "unchecked":列表只报本地已知事实,
|
|
235
|
+
// 不伪报已配置)
|
|
236
|
+
|
|
237
|
+
await client.sessions.updateSessionPluginConfig(id, "crm", {
|
|
238
|
+
expected_revision: config.revision,
|
|
239
|
+
set: [{ path: "/login/password", value: password }], // SessionPluginConfigSet[]
|
|
240
|
+
remove: [],
|
|
241
|
+
} satisfies SessionPluginConfigUpdate)
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
图标用 `client.sessions.fetchSessionPluginIcon(id, name)` 取 `Blob`(自带凭据),
|
|
245
|
+
或 `client.sessions.sessionPluginIconUrl(id, name)` 取已鉴权 URL。
|
|
246
|
+
|
|
247
|
+
`set`/`remove` 只表达显式改动:没出现的字段保持原值,因此表单不需要回传秘密;
|
|
248
|
+
`null` 是一个合法值,不是删除。校验不通过或版本过期时请求被拒绝,磁盘上的旧
|
|
249
|
+
配置保持不变。平台只写用户 Home 下的 `~/.plugin/<plugin_id>/config.json`,不会
|
|
250
|
+
重启 MCP、清缓存或刷新 token。
|
|
171
251
|
|
|
172
252
|
### 会话回放(演示 / 彩排)
|
|
173
253
|
|
|
@@ -314,13 +394,30 @@ await client.computers.setEnabled(sessionId, computer.id, false) // 停用
|
|
|
314
394
|
做电脑选择器时用这几个纯函数,别自己重算状态:
|
|
315
395
|
|
|
316
396
|
```ts
|
|
317
|
-
import {
|
|
397
|
+
import {
|
|
398
|
+
canToggleComputer, computerState, sortComputers,
|
|
399
|
+
computerOS, computerPlatformLabel, computerDaemonVersion,
|
|
400
|
+
} from "@blade-hq/agent-client"
|
|
401
|
+
|
|
402
|
+
sortComputers(computers) // 按接入时间,顺序稳定不随状态变化
|
|
403
|
+
computerState(computer) // ComputerState: "primary" | "enabled" | "offline" | "idle"
|
|
404
|
+
canToggleComputer(computer) // 主运行时返回 false
|
|
318
405
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
406
|
+
computerOS(computer) // ComputerOS: "macos" | "windows" | "linux" | "unknown"
|
|
407
|
+
computerPlatformLabel(computer) // "darwin/arm64"
|
|
408
|
+
computerDaemonVersion(computer) // "dev (bc3ad71d1)",未知时是空串
|
|
322
409
|
```
|
|
323
410
|
|
|
411
|
+
`sortComputers` **刻意不按在线/可用排序**:那样排看着"手边的在前面",代价是电脑
|
|
412
|
+
上下线、勾选状态一变整个列表就重排,用户正要点的那一项会在手指底下跑掉。改名也
|
|
413
|
+
不会挪位置,新接入的稳定排在末尾。
|
|
414
|
+
|
|
415
|
+
`computerOS` 判定的是 daemon 上报的 `runtime.GOOS`,各处自己 `startsWith` 一遍必然会分叉;
|
|
416
|
+
图标怎么画交给界面,这里只回答"是哪一类系统"。
|
|
417
|
+
|
|
418
|
+
`computerDaemonVersion` 返回的是服务端存的完整串——dev 构建带 commit,
|
|
419
|
+
因为 dev 的版本号全都是 `dev`,光看它分不出是哪次构建的二进制。**不要在前端另拼一套格式。**
|
|
420
|
+
|
|
324
421
|
`ComputersResource` 是 `client.computers` 的类型。
|
|
325
422
|
|
|
326
423
|
## AgentSession
|
|
@@ -340,7 +437,9 @@ chat.getState()
|
|
|
340
437
|
// connection, 连接状态:"connected" | "connecting" | "reconnecting" | "disconnected"
|
|
341
438
|
// errorMessage, 最近一次运行错误
|
|
342
439
|
// replay, 回放状态:{ isReplay, speed, sourceSessionId } | null
|
|
440
|
+
// queue, 等待消息队列快照:{ session_id, revision, paused, pause_reason, items }
|
|
343
441
|
// viewerRole, "owner" | "viewer" | null(只读身份改不动会话)
|
|
442
|
+
// nextBefore, loadingOlder, 历史分页游标与加载状态
|
|
344
443
|
// turns, askAnswers, agentLoops, activeCompaction 进阶字段
|
|
345
444
|
// }
|
|
346
445
|
|
|
@@ -354,9 +453,10 @@ const unsubscribe = chat.subscribe(() => rerender(chat.getState()))
|
|
|
354
453
|
```ts
|
|
355
454
|
const accepted = await chat.send("你好") // 服务端接受后为 true;拒绝时为 false
|
|
356
455
|
await chat.send("换个方案", { mode: "planning" }) // 指定模式/模型等选项
|
|
357
|
-
chat.
|
|
358
|
-
await chat.stop() //
|
|
456
|
+
await chat.queueMessage("补充:预算不超过 5 万") // 运行中入队;返回服务端确认结果与冲突原因
|
|
457
|
+
await chat.stop() // 停止当前回复(同时暂停队列,需 resumeQueue 继续)
|
|
359
458
|
await chat.compact() // 手动压缩上下文
|
|
459
|
+
if (chat.hasOlderHistory) await chat.loadOlderHistory()
|
|
360
460
|
chat.dispose() // 彻底释放(什么时候该调见下方说明)
|
|
361
461
|
```
|
|
362
462
|
|
|
@@ -364,6 +464,28 @@ chat.dispose() // 彻底释放(什么时候
|
|
|
364
464
|
> 1. 用户明确关闭或删除了这个会话,之后不会再回来;
|
|
365
465
|
> 2. 页面长期开着并且会不断创建一次性会话(比如批量任务面板),需要主动回收。
|
|
366
466
|
|
|
467
|
+
### 等待消息队列
|
|
468
|
+
|
|
469
|
+
队列由服务端持久化:运行中发送、暂停期间发送都进入队尾,按顺序逐条执行;关掉页面不影响已确认的入队,重新打开恢复真实状态。等待消息**不会**提前伪装成聊天记录——它只在队列区域展示,真正被接收后才进入消息流。
|
|
470
|
+
|
|
471
|
+
```ts
|
|
472
|
+
const result = await chat.queueMessage("顺便看下这个报错") // 入队(运行中排队 / 暂停期间照常入队)
|
|
473
|
+
// result: { ok, conflict, snapshot, message }
|
|
474
|
+
|
|
475
|
+
await chat.updateQueuedMessage(item.id, item.version, "改好的正文")
|
|
476
|
+
await chat.reorderQueuedMessages(queue.revision, pendingIdsInNewOrder) // ordered_ids 必须是当前 pending 条目 id 的完整集合
|
|
477
|
+
await chat.cancelQueuedMessage(item.id, item.version)
|
|
478
|
+
await chat.deliverQueuedMessage(item.id, item.version) // 立即补充:交给当前运行在下一个接收点消费
|
|
479
|
+
await chat.resumeQueue() // 暂停后继续执行
|
|
480
|
+
await chat.refreshQueue() // 手动拉一份权威快照(首次连接与每次重连已自动拉取)
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
`chat.getState().queue` 是 `SessionQueueSnapshot`:`{ session_id, revision, paused, pause_reason, items }`。它只会被 revision 更新的快照替换——乱序到达的旧广播不会把新状态顶回去。`items` 只包含 `pending`(待执行)与 `delivering`(等待接收)。
|
|
484
|
+
|
|
485
|
+
- **冲突处理**:`conflict` 表示乐观并发或状态校验失败,服务端快照已自动刷新到本地,此时保留用户草稿并说明原因即可;`ok=false` 且 `snapshot` 为 null(例如鉴权失败)时不要改动本地队列。`queueMessage` 结果未知(ack 超时)时会用同一个 `client_request_id` 重试一次,不会制造第二条。
|
|
486
|
+
- **可操作性判定**:`canEditQueuedMessage` / `canCancelQueuedMessage` / `canDeliverQueuedMessage` 只对 `pending` 返回 true;文案用 `queuedMessageStatusLabel` 与 `queuePauseReasonLabel`。
|
|
487
|
+
- **自己处理广播**:需要绕过状态机时用 `isSessionQueueSnapshot` + `shouldApplySnapshot` + `EMPTY_SESSION_QUEUE`;解析自定义 ack 用 `parseQueueAck`,返回统一的 `QueueOperationResult`(`QueueAck` 是 ack 的线格式;`code` 是路由失败原因,供调用方决定是否重试)。
|
|
488
|
+
|
|
367
489
|
### 页面协作:让智能体和你的页面互动
|
|
368
490
|
|
|
369
491
|
**页面状态与业务后端 → 智能体**:
|
|
@@ -428,11 +550,15 @@ chat.on("toolCall", (e) => console.log("调用工具", e.toolCall.name))
|
|
|
428
550
|
chat.on("toolResult", (e) => console.log("工具结果", e.toolCall.result))
|
|
429
551
|
chat.on("message", (e) => console.log("新消息", e.message))
|
|
430
552
|
chat.on("chatEnd", (e) => console.log("回复结束", e.status))
|
|
431
|
-
chat.on("error", (e) => console.error(e.message))
|
|
553
|
+
chat.on("error", (e) => console.error(e.message, e.code))
|
|
432
554
|
```
|
|
433
555
|
|
|
556
|
+
`error` 的 `message` 是可以直接展示的业务文案;`code` 是服务端给的机器可读原因(如 `owner_timeout` / `route_broken` / `owner_busy`),调用方据此决定要不要提示重试,不要解析 `message`。同一组原因也以 `AgentSessionError.code` 的形式抛出(`send()` 这类只回布尔值的入口从 `error` 事件拿),队列 API 则通过 `QueueOperationResult.code` 给出。
|
|
557
|
+
|
|
434
558
|
完整事件表见 `AgentSessionEvents` 类型定义(含 `modeChange` / `workspaceChanged` / `artifact` / `notification` / `backgroundTask` / `taskListUpdated` / `rewind` / `replayMismatch` 等)。`toolResult.source` 区分实时结果、首次连接回放和断线重连回放;`on()` 返回取消函数,handler 抛异常只告警、不影响会话。
|
|
435
559
|
|
|
560
|
+
分页响应是 `SessionTurnsPage`,其中 `nextBefore: string | null` 是唯一的“还有更早历史”真值。历史页面指令通过独立的 `HistoricalCommand` 日志恢复,不混进展示页。自定义状态容器可复用 `prependOlder`、`replaceWindow` 与 `LiveRevisionState`,但一般直接使用 `AgentSession` 即可。
|
|
561
|
+
|
|
436
562
|
## iframe 嵌入形态:connectEmbedded
|
|
437
563
|
|
|
438
564
|
如果你不是嵌组件,而是把 **Blade 的聊天页面整个用 iframe 嵌进自己系统**,宿主页面用 `connectEmbedded` 拿到同构的协作 API:
|
|
@@ -476,6 +602,15 @@ PATCH / query / FormData / AbortSignal 等完整 HTTP 语义(否则不够用
|
|
|
476
602
|
> **安全约束**:`client.token` 只应发往 `baseUrl` 同源的接口。不要把它附加到
|
|
477
603
|
> 第三方域名的请求上——那等于把用户的访问凭据交给别人。
|
|
478
604
|
|
|
605
|
+
### 只读轮询退避
|
|
606
|
+
|
|
607
|
+
`new PollingBackoff(3000)` 为轮询维护独立退避状态,参数为正常间隔(大于 0、不超过 60 秒)。
|
|
608
|
+
请求成功后调用 `reset()`,失败后调用 `failed(error)`;`waitMs()` 返回剩余等待毫秒数,
|
|
609
|
+
`0` 表示可以请求,`false` 表示停止。HTTP 错误应传入保留响应头的 `BladeApiError`。
|
|
610
|
+
401/403 等确定性错误停止,网络/5xx 指数退避带抖动且最高 60 秒;`Retry-After`
|
|
611
|
+
可以要求更长等待,超出浏览器定时器范围时停止。策略自身不发送请求,调度器须传递
|
|
612
|
+
AbortSignal、在卸载时停止,并避免将它用于自动重放 POST 等有副作用的操作。
|
|
613
|
+
|
|
479
614
|
## headless:一次性问答
|
|
480
615
|
|
|
481
616
|
```ts
|
|
@@ -561,6 +696,41 @@ transformSlashCommand(skillId, prompt, { local: false, installed: false })
|
|
|
561
696
|
|
|
562
697
|
不传第三个参数时按本地已有处理,和不带这个参数的老用法结果一致。
|
|
563
698
|
|
|
699
|
+
### MCP App 卡片
|
|
700
|
+
|
|
701
|
+
MCP 工具可以通过 `_meta.ui` 在消息流里产出交互卡片(`tool_ui` block)。卡片的
|
|
702
|
+
实例、守卫、可见性、身份和终态规则全部收敛在这一份共享判定里——内置 Web 与
|
|
703
|
+
SDK 渲染的是同一批卡片,不要自己再写一份判断:
|
|
704
|
+
|
|
705
|
+
```ts
|
|
706
|
+
import {
|
|
707
|
+
collectInlineToolUiCards,
|
|
708
|
+
collectPreviewToolUiCards,
|
|
709
|
+
resolveToolUiCardContent,
|
|
710
|
+
buildToolUiCardKey,
|
|
711
|
+
isToolUiCard,
|
|
712
|
+
} from "@blade-hq/agent-client"
|
|
713
|
+
|
|
714
|
+
// 按可见性分类:inline 进消息流,preview 交给你的侧栏/面板(也随 toolPreview 事件推送)
|
|
715
|
+
const inlineCards = collectInlineToolUiCards(messages) // [{ key, toolCallId, card }]
|
|
716
|
+
const previewCards = collectPreviewToolUiCards(messages) // [{ key, toolCall, card, blocks }]
|
|
717
|
+
|
|
718
|
+
// 渲染前解析实际内容;archived 留档卡片只用留档 HTML,绝不回退 resourceUri
|
|
719
|
+
// (历史恢复/刷新不会因此重放一次 MCP 资源读取)
|
|
720
|
+
const resolved = resolveToolUiCardContent(card) // { type: "resource-html" | "resource-uri" | "resource-file", content } | null
|
|
721
|
+
|
|
722
|
+
// 文件卡片按 sourcePath、URI 按地址、无来源 HTML 按 toolCallId 去重。
|
|
723
|
+
// 宿主可先按会话 workspace 将 sourcePath 归一,和文件树中的身份对齐。
|
|
724
|
+
const key = buildToolUiCardKey(toolCallId, resolved.type, resolved.content, card.sourcePath)
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
`resource-file` 来自 `blade ui --html 文件 --preview`:`content`/`sourcePath` 是文件路径,不是 HTML。打开时通过带鉴权的会话文件接口读取当前文件;历史引用也读取最新文件。每次新工具调用都会发 `toolPreview` 通知文件有更新,宿主仍按路径复用一个页签;同次调用的重复事件不重复发送。已打开的 HTML 应保留当前页面和交互状态,提供醒目的“刷新”按钮,让用户决定何时读取最新内容。内联卡片继续使用 HTML 快照。
|
|
728
|
+
|
|
729
|
+
单个 block 判有效用 `isToolUiCard`(严格守卫:`target`/`height` 缺失、archived 无留档
|
|
730
|
+
HTML 一律判无效);`isInternalStatusToolUiCard` 识别内部「阶段进度」卡片(不对用户展示),
|
|
731
|
+
`isAppDevToolUiCard` 识别应用开发会话的预览卡。相关类型:`ToolUiCard`、
|
|
732
|
+
`ToolUiCardContentType`、`InlineToolUiCardEntry`、`PreviewToolUiCardEntry`。
|
|
733
|
+
|
|
564
734
|
## 常见问题
|
|
565
735
|
|
|
566
736
|
| 现象 | 原因与解法 |
|
|
@@ -579,13 +749,33 @@ transformSlashCommand(skillId, prompt, { local: false, installed: false })
|
|
|
579
749
|
|
|
580
750
|
- **客户端与登录**:`BladeClientOptions`、`LoginOptions`、`LoginResult`、`TokenStorageMode`、`UploadProgress`、`BladeApiError`、`AuthResource`、`ProvidersResponse`、`UserInfo`
|
|
581
751
|
- **SDK 身份**:`SDK_NAME`、`SDK_VERSION`
|
|
582
|
-
- **声明式会话**:`SessionDefinition`、`SolutionDefinition`、`SkillDefinition`、`SessionConfig`、`TextFile`、`SessionSetupError`、`SessionSetupStage`
|
|
752
|
+
- **声明式会话**:`SessionDefinition`、`SolutionDefinition`、`SkillDefinition`、`SkillFile`、`SessionConfig`、`TextFile`、`SessionSetupError`、`SessionSetupStage`
|
|
753
|
+
- **会话错误**:`AgentSessionError`(`code` 是服务端路由失败原因,供调用方决定是否重试)
|
|
583
754
|
- **模型目录**:`ModelsResource`、`ModelCatalog`、`ModelOption`
|
|
584
|
-
-
|
|
755
|
+
- **聊天分组资源(REST)**:`ChatGroupsResource`、`ChatGroup`(含 `delete` 永久删除);`client.chatGroups`。旧名 `ChatProjectsResource`、`ChatProject`、`client.chatProjects` 与 `chat_project_id` 字段已随分组改名一并移除,接入方请改用 `chatGroups` 与 `chat_group_id`
|
|
756
|
+
- **插件目录(REST,无会话)**:`PluginsResource`、`PluginCatalogEntry`(`client.plugins`)。首页这类还没有会话的界面用它读名称、业务名与图标 token
|
|
757
|
+
- **账号电脑目录**:`AccountComputer`、`AccountComputerList`(`client.computers.listAccount()`,只读账号事实,不含会话授权)
|
|
758
|
+
- **全站访问统计(REST)**:`SiteVisitsResource`、`SiteVisitsSummary`(`client.siteVisits.record()` 上报一次页面访问、`client.siteVisits.summary()` 只读快照)。这两个操作走独立匿名传输:不带 bearer、不触发 401 登录刷新,只依赖匿名访客 Cookie,供内置 Web 同源使用。
|
|
759
|
+
- **会话资源(REST)**:`SessionsResource`、`CreateSessionRequest`、`ImportSessionOptions`、`AppCliDefinition`、`AppCliAttachment`、`AttachAppOptions`、`PaginatedSessionsResult`、`GlobalSearchResult`、`GlobalSearchResultItem`、`GlobalSearchConversationResult`、`GlobalSearchFileResult`、`SessionHistory`、`SessionContextStats`、`ResultFeedback`、`ResultFeedbackReason`、`ShareLinkResult`、`FileEntry`、`UploadFileEntry`、`UploadFilesOptions`、`SessionProfile`、`SessionDetail`、`SessionInfo`、`SessionStatus`、`SessionPortMapping`、`ModeId`、`TemplateId`、`PrimarySkillSnapshot`、`PrimarySkillParallelMode`、`PrimarySkillStageSpec`、`PrimarySkillStepSpec`、`SkillEditorTemplateId`、`SessionSearchMatch`
|
|
760
|
+
- **会话历史取数**:`SessionTurnsQuery`、`SessionTurnsPage`、`SessionTurnIndex`、`SessionTurnIndexItem`、`isEntryGoneError`(`isEntryGoneError` 区分"这条发言已经不在当前分支上"与"这次没取到":前者说明 `fromEntryId` 定位目标失效,后者只说明本次请求失败)
|
|
585
761
|
- **会话回放**:`ReplayState`、`ReplaySpeed`、`ReplayPreview`、`ReplaySnapshot`、`toReplaySnapshot`、`DEFAULT_REPLAY_SPEED`
|
|
586
762
|
- **会话状态机**:`SessionHub`、`SessionConnectOptions`、`SessionState`、`SendOptions`、`ConnectionStatus`、`AskUserAnswerData`、`AgentLoopInfo`、`ActiveCompactionState`、`createInitialSessionState`、`AgentSessionEventName`
|
|
763
|
+
- **静态历史会话**:`AgentSession.fromTurns(sessionId, turns)` 构造的会话 `isStatic` 为 true——它没有目录接口,宿主拿已加载窗口推导航条目(`turnNavItemsFromMessages`);真实会话不要这么做,timeline 被重写后窗口里还是旧分支的发言,那些 entry id 已经点不到了
|
|
764
|
+
- **长会话跨页定位**:`AgentSession.locateEntry(entryId)`(按稳定 `entry_id` 取"从它往后"的窗口)、`AgentSession.cancelPendingLocate()`(作废在途的那次定位;它只中止定位自己的请求,不牵动运行结束 / 重连的权威刷新)。权威刷新(运行结束 / 重连补数 / 翻页之后的对账)不另记状态:一律按**当前窗口第一条发言**取窗口,那条已经不在分支上(404 / 409)时回落最新一页;`sessions.getSessionTurnIndex(sessionId)` 给出可导航的用户发言目录(`SessionTurnIndex` / `SessionTurnIndexItem`),`getSessionTurnsPage({ fromEntryId })` 与它共用同一份分支投影
|
|
765
|
+
- **会话消息队列**:`SessionQueueSnapshot`、`QueuedMessage`、`QueuedMessageStatus`、`QueueAck`、`QueueOperationResult`、`EMPTY_SESSION_QUEUE`、`isSessionQueueSnapshot`、`shouldApplySnapshot`、`parseQueueAck`、`canEditQueuedMessage`、`canCancelQueuedMessage`、`canDeliverQueuedMessage`、`queuedMessageStatusLabel`、`queuePauseReasonLabel`
|
|
587
766
|
- **页面协作**:`EmbeddedChat`、`EmbeddedChatOptions`、`CommandHandler`、`CommandEnvelope`、`InboundAction`、`InboundEnvelope`、`isCommandEnvelope`、`isInboundEnvelope`
|
|
588
|
-
-
|
|
767
|
+
- **流式 wire 事件(自定义渲染用)**:`ContentDelta`、`ToolCallCreated`、`ToolCallArgumentsDelta`、`ToolResultDelta`、`ToolResultDone`、`LlmResponseDone`、`ChatEnd`、`SystemError`、`SessionStatusEvent`。它们描述 socket 上一帧帧到达的内容,只有自己接管流式拼装时才需要
|
|
768
|
+
- **消息与投影协议**:`MessageContent`、`MessageContentPart`、`TextContentPart`、`ImageUrlContentPart`、`FileContentPart`、`ToolCallInfo`、`ToolBridgeContent`、`CompactionInfo`、`ContextProjectionData`、`ContextProjectionFields`、`ContextDisplayState`、`ContextGroupDisplayState`、`ContextAction`、`ContextSourceInfo`、`MemoryRefInfo`、`ArchivedFileInfo`、`ArchivedToolCallInfo`、`TurnProjection`、`ContentBlock`、`PatchEnvelope`、`MemoryRef`、`PostChatFollowup`、`FinalArtifact`、`ToolCallProjection`、`PendingQuestionRef`、`RunTiming`、`inferToolStatus`、`contextProjectionData`、`getContextDisplayState`、`getContextGroupDisplayState`、`groupAdjacentContextRuns`、`latestPostChatFollowup`、`buildMessageContent`、`normalizeMessageContent`、`isHiddenInternalMessage`、`transformSlashCommand`、`SkillMentionAvailability`、`extractTextAttachments`、`ParsedTextAttachment`、`ParsedTextContext`
|
|
769
|
+
- **MCP Apps 留档与卡片判定**:`McpAppData`、`isMcpAppData`、`McpAppContextState`、`McpAppContextUpdate`、`ToolUiCard`、`ToolUiCardContentType`、`InlineToolUiCardEntry`、`PreviewToolUiCardEntry`、`isToolUiCard`、`resolveToolUiCardContent`、`buildToolUiCardKey`、`isInternalStatusToolUiCard`、`isAppDevToolUiCard`、`collectInlineToolUiCards`、`collectPreviewToolUiCards`(`McpAppContextState` / `McpAppContextUpdate` 配合 `sessions.getMcpAppContext` / `sessions.updateMcpAppContext`:App 保存的状态在下一个新运行才进入模型上下文)
|
|
589
770
|
- **Solution / 任务协议**:`Solution`、`SolutionAppField`、`SolutionAppState`、`SolutionAppUiConfig`、`SolutionRef`、`PublishedSolutionRef`、`ExistingSolutionRef`、`PreparedSolution`、`PreparedSolutionAsset`、`LayoutType`、`BizRole`、`TaskStatus`、`BackgroundTask`、`BackgroundTaskStopResult`
|
|
590
771
|
- **Headless**:`HeadlessResource`、`RunOptions`、`RunResult`、`RunTrace`
|
|
591
|
-
- **低层通道(apps/web 等高级集成)**:`createSocket`、`CreateSocketOptions`、`TypedSocket`、`AsrAudioPayload`、`ClientProjectionBuilder`、`RawEvent`、`acceptedPostChatFollowupCompletesLatestRun`、`reconcileOptimisticUserTurns`
|
|
772
|
+
- **低层通道(apps/web 等高级集成)**:`createSocket`、`CreateSocketOptions`、`TypedSocket`、`AsrAudioPayload`、`AuthBusyReconnect`、`authBusyRetryDelayMs`、`ClientProjectionBuilder`、`RawEvent`、`acknowledgeTurnEvents`、`hasChatRunEvent`、`acceptedPostChatFollowupCompletesLatestRun`、`reconcileOptimisticUserTurns`、`reconcileHistoricalUserTurns`
|
|
773
|
+
### MCP App 留档
|
|
774
|
+
|
|
775
|
+
`McpAppArchive` 是 `client.sessions.getMcpApp(sessionId, sourceId)` 经鉴权返回的归档,包含保存的 HTML 与最新留档输入/结果。`callMcpApp` 在会话 sandbox 内调用该卡片的归档能力;`onMcpAppChanged` 订阅结果变化,返回取消订阅函数。
|
|
776
|
+
|
|
777
|
+
最新调用失败或完成状态未知时,归档同时提供 `previousToolInput` / `previousToolResult`,用于先恢复最后成功的界面再展示错误。读取这些留档不会重新执行工具。
|
|
778
|
+
|
|
779
|
+
会话列表和详情的 `SessionInfo.initiator` 表示首次发起来源:`ui` 为界面,`sdk` 为 SDK;旧会话缺少可靠记录时为 `unknown`,尚未发起会话时为 `null` 或未提供。它不等同于后台运行标记 `is_headless`,后续继续会话不会改变来源。
|
|
780
|
+
|
|
781
|
+
后台唤醒输入可用 `isBackgroundWakeMessage(message)` 识别,它读取消息的结构化通知 block。自定义 UI 应为这类输入显示说明卡片;`isHiddenInternalMessage` 仍将其视为内部输入,避免作为用户发言或回溯导航点。
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export interface AuthOptions {
|
|
2
2
|
token?: string | (() => string | null | undefined);
|
|
3
3
|
}
|
|
4
|
-
export declare function buildAuthHeaders(options: AuthOptions): Record<string, string>;
|
|
5
4
|
export declare function buildSocketAuth(options: AuthOptions): {
|
|
6
5
|
token: string;
|
|
7
6
|
} | undefined;
|
package/dist/blade-client.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ import { HeadlessResource } from "./resources/headless";
|
|
|
5
5
|
import { ComputersResource } from "./resources/computers";
|
|
6
6
|
import { ModelsResource } from "./resources/models";
|
|
7
7
|
import { SessionsResource } from "./resources/sessions";
|
|
8
|
+
import { PluginsResource } from "./resources/plugins";
|
|
9
|
+
import { ChatGroupsResource } from "./resources/chat-groups";
|
|
10
|
+
import { SiteVisitsResource } from "./resources/site-visits";
|
|
8
11
|
import { SessionHub } from "./session/hub";
|
|
9
12
|
import { type TypedSocket } from "./socket";
|
|
10
13
|
export interface BladeClientOptions {
|
|
@@ -22,6 +25,8 @@ export interface BladeClientOptions {
|
|
|
22
25
|
socketToken?: string | (() => string | null | undefined);
|
|
23
26
|
/** login() 取得的令牌存放位置,默认 "local"(localStorage,刷新页面不掉登录)。 */
|
|
24
27
|
tokenStorage?: TokenStorageMode;
|
|
28
|
+
/** Host-owned command transport; event subscriptions stay on the normal socket. */
|
|
29
|
+
commandTransport?: (event: string, payload: Record<string, unknown>, send: () => Promise<Record<string, unknown>>) => Promise<Record<string, unknown>>;
|
|
25
30
|
fetchImpl?: typeof fetch;
|
|
26
31
|
onRefreshSuccess?: () => void | Promise<void>;
|
|
27
32
|
}
|
|
@@ -37,6 +42,14 @@ export declare class BladeClient {
|
|
|
37
42
|
readonly computers: ComputersResource;
|
|
38
43
|
readonly models: ModelsResource;
|
|
39
44
|
readonly sessions: SessionsResource;
|
|
45
|
+
/** 按用户读取的插件目录与图标;没有会话时也能用。 */
|
|
46
|
+
readonly plugins: PluginsResource;
|
|
47
|
+
readonly chatGroups: ChatGroupsResource;
|
|
48
|
+
/**
|
|
49
|
+
* 全站访问统计:匿名读写,不带 bearer 也不触发登录刷新。
|
|
50
|
+
* 只有内置 Web 的同源页面使用,第三方宿主页面不会被自动统计。
|
|
51
|
+
*/
|
|
52
|
+
readonly siteVisits: SiteVisitsResource;
|
|
40
53
|
/** 实时会话中枢:client.sessions.connect() 内部使用,一般不直接访问。 */
|
|
41
54
|
readonly hub: SessionHub;
|
|
42
55
|
constructor(options: BladeClientOptions);
|
|
@@ -70,6 +83,7 @@ export declare class BladeClient {
|
|
|
70
83
|
/** 底层 Socket.IO 实例因后端地址变化而被替换时通知高级集成层。 */
|
|
71
84
|
onSocketReplaced(listener: () => void): () => void;
|
|
72
85
|
socket(): TypedSocket;
|
|
86
|
+
requestCommand(event: string, payload: Record<string, unknown>, timeoutMs: number): Promise<Record<string, unknown>>;
|
|
73
87
|
json<T>(method: HttpMethod, path: string, body?: unknown): Promise<T>;
|
|
74
88
|
jsonFromInit<T>(path: string, init?: RequestInit): Promise<T>;
|
|
75
89
|
text(method: HttpMethod, path: string): Promise<string>;
|
|
@@ -85,10 +99,17 @@ export declare class BladeClient {
|
|
|
85
99
|
private buildHeaders;
|
|
86
100
|
private buildUrl;
|
|
87
101
|
private baseUrlWithTrailingSlash;
|
|
88
|
-
private toBaseRelativePath;
|
|
89
102
|
private isSameBackendUrl;
|
|
90
103
|
private shouldRefreshFor401;
|
|
91
104
|
private hasExplicitBearerToken;
|
|
105
|
+
/**
|
|
106
|
+
* 等一次令牌刷新,但调用方中止请求时不再等下去。
|
|
107
|
+
*
|
|
108
|
+
* 刷新本身是共享的(`refreshPromise`,别的请求也在等它),这里只是让这次已被取消的
|
|
109
|
+
* 请求尽早结束——否则它会一直挂在调用方(定位)的串行队列里,用户改选的新目标要等到
|
|
110
|
+
* 刷新结束才轮得到。
|
|
111
|
+
*/
|
|
112
|
+
private tryRefreshUnlessAborted;
|
|
92
113
|
private tryRefresh;
|
|
93
114
|
private resolveTokenForUrl;
|
|
94
115
|
private resolveRestToken;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
export { BladeClient } from "./blade-client";
|
|
2
2
|
export type { BladeClientOptions, UploadProgress } from "./blade-client";
|
|
3
3
|
export { BladeApiError } from "./rest";
|
|
4
|
+
export { isEntryGoneError } from "./resources/sessions";
|
|
5
|
+
export { PollingBackoff } from "./polling-backoff";
|
|
4
6
|
export type { LoginOptions, LoginResult, TokenStorageMode } from "./auth-login";
|
|
5
7
|
export { EMPTY_PLATFORM_ENDPOINTS, loadPlatformEndpoints, resolveServiceUrl, } from "./platform-endpoints";
|
|
6
8
|
export type { LoadPlatformEndpointsOptions, PlatformEndpoints, PlatformServiceName, } from "./platform-endpoints";
|
|
7
9
|
export { SDK_NAME, SDK_VERSION } from "./version";
|
|
8
10
|
export { AgentSession } from "./session/agent-session";
|
|
9
11
|
export type { AttachAppOptions, SendOptions } from "./session/agent-session";
|
|
12
|
+
export { AgentSessionError } from "./session/errors";
|
|
10
13
|
export { SessionHub } from "./session/hub";
|
|
11
14
|
export type { SessionConnectOptions } from "./session/hub";
|
|
12
15
|
export type { AgentSessionEvents, AgentSessionEventName } from "./session/events";
|
|
16
|
+
export { isMcpAppData } from "./schemas/mcp-app";
|
|
17
|
+
export type { McpAppArchive, McpAppContextState, McpAppContextUpdate, McpAppData, } from "./schemas/mcp-app";
|
|
13
18
|
export { SessionSetupError } from "./session/definition";
|
|
14
|
-
export type { SessionConfig, SessionDefinition, SessionSetupStage, SkillDefinition, TextFile, SolutionDefinition, } from "./session/definition";
|
|
15
|
-
export { createInitialSessionState, reconcileOptimisticUserTurns, toReplaySnapshot, } from "./session/state";
|
|
19
|
+
export type { SessionConfig, SessionDefinition, SessionSetupStage, SkillDefinition, SkillFile, TextFile, SolutionDefinition, } from "./session/definition";
|
|
20
|
+
export { createInitialSessionState, reconcileHistoricalUserTurns, reconcileOptimisticUserTurns, toReplaySnapshot, } from "./session/state";
|
|
16
21
|
export type { AskUserAnswerData, AgentLoopInfo, ActiveCompactionState, ConnectionStatus, ReplaySnapshot, SessionState, } from "./session/state";
|
|
22
|
+
export { EMPTY_SESSION_QUEUE, canCancelQueuedMessage, canDeliverQueuedMessage, canEditQueuedMessage, isSessionQueueSnapshot, parseQueueAck, queuePauseReasonLabel, queuedMessageStatusLabel, shouldApplySnapshot, } from "./session/queue";
|
|
23
|
+
export type { QueueAck, QueueOperationResult, QueuedMessage, QueuedMessageStatus, SessionQueueSnapshot, } from "./session/queue";
|
|
17
24
|
export { connectEmbedded } from "./commands/embedded";
|
|
18
25
|
export type { EmbeddedChat, EmbeddedChatOptions } from "./commands/embedded";
|
|
19
26
|
export type { CommandHandler } from "./commands/registry";
|
|
@@ -22,28 +29,43 @@ export { isCommandEnvelope, isInboundEnvelope } from "./commands/protocol";
|
|
|
22
29
|
export type { AuthResource, ExchangeCodeParams, ExchangeCodeResult, ProvidersResponse, UserInfo, } from "./resources/auth";
|
|
23
30
|
export type { HeadlessResource } from "./resources/headless";
|
|
24
31
|
export { ComputersResource } from "./resources/computers";
|
|
25
|
-
export { canToggleComputer, computerState, sortComputers, } from "./resources/computers";
|
|
26
|
-
export type { ComputerState, SessionComputer, SessionComputerList, } from "./resources/computers";
|
|
32
|
+
export { canToggleComputer, computerDaemonVersion, computerOS, computerPlatformLabel, computerState, sortComputers, } from "./resources/computers";
|
|
33
|
+
export type { AccountComputer, AccountComputerList, ComputerOS, ComputerState, SessionComputer, SessionComputerList, } from "./resources/computers";
|
|
27
34
|
export { ModelsResource } from "./resources/models";
|
|
28
35
|
export type { ModelCatalog, ModelOption } from "./resources/models";
|
|
29
36
|
export type { SessionsResource } from "./resources/sessions";
|
|
30
|
-
export type {
|
|
37
|
+
export type { SessionPlugin, SessionPluginActivation } from "./resources/sessions";
|
|
38
|
+
export type { SessionPluginConfigError, SessionPluginConfigSet, SessionPluginConfigState, SessionPluginConfigStateName, SessionPluginConfigSummary, SessionPluginConfigUpdate, } from "./resources/sessions";
|
|
39
|
+
export { ChatGroupsResource } from "./resources/chat-groups";
|
|
40
|
+
export type { ChatGroup } from "./resources/chat-groups";
|
|
41
|
+
export { PluginsResource } from "./resources/plugins";
|
|
42
|
+
export type { PluginCatalogEntry } from "./resources/plugins";
|
|
43
|
+
export type { SiteVisitsResource, SiteVisitsSummary } from "./resources/site-visits";
|
|
44
|
+
export { hasChatRunEvent } from "./shared/projection";
|
|
45
|
+
export type { CreateSessionRequest, AppCliAttachment, AppCliDefinition, FileEntry, ImportSessionOptions, PaginatedSessionsResult, GlobalSearchConversationResult, GlobalSearchFileResult, GlobalSearchResult, GlobalSearchResultItem, ResultFeedback, ResultFeedbackReason, HistoricalCommand, SessionContextStats, SessionHistory, SessionTurnsPage, SessionTurnsQuery, SessionTurnIndex, SessionTurnIndexItem, ShareLinkResult, UploadFileEntry, UploadFilesOptions, } from "./resources/sessions";
|
|
31
46
|
export type { ArchivedFileInfo, ArchivedToolCallInfo, ChatMessage, CompactionInfo, FileContentPart, ImageUrlContentPart, MemoryRefInfo, MessageContent, MessageContentPart, TextContentPart, ToolBridgeContent, ToolCallInfo, } from "./schemas/message";
|
|
32
|
-
export {
|
|
47
|
+
export { inferToolStatus } from "./schemas/message";
|
|
48
|
+
export type { ChatEnd, ContentDelta, LlmResponseDone, SessionStatusEvent, SystemError, ToolCallArgumentsDelta, ToolCallCreated, ToolResultDelta, ToolResultDone, } from "./schemas/event";
|
|
49
|
+
export { buildMessageContent, chatErrorForDisplay, contentPreview, extractTextAttachments, getFileParts, getImageParts, getTextContent, groupMessagesByLoop, isHiddenInternalMessage, isBackgroundWakeMessage, normalizeMessageContent, transformSlashCommand, } from "./schemas/message-utils";
|
|
33
50
|
export { contextProjectionData, getContextDisplayState, getContextGroupDisplayState, groupAdjacentContextRuns, } from "./schemas/context";
|
|
34
51
|
export type { ContextAction, ContextDisplayState, ContextGroupDisplayState, ContextProjectionData, ContextProjectionFields, ContextSourceInfo, } from "./schemas/context";
|
|
35
52
|
export type { ParsedTextAttachment, ParsedTextContext, SkillMentionAvailability, } from "./schemas/message-utils";
|
|
36
|
-
export type { ContentBlock, FinalArtifact, MemoryRef, PatchEnvelope, PostChatFollowup, TurnProjection, } from "./schemas/projection";
|
|
53
|
+
export type { ContentBlock, FinalArtifact, MemoryRef, PatchEnvelope, PendingQuestionRef, PostChatFollowup, RunTiming, ToolCallProjection, TurnProjection, } from "./schemas/projection";
|
|
37
54
|
export { latestPostChatFollowup } from "./schemas/projection-utils";
|
|
55
|
+
export { buildToolUiCardKey, collectInlineToolUiCards, collectPreviewToolUiCards, isAppDevToolUiCard, isInternalStatusToolUiCard, isToolUiCard, resolveToolUiCardContent, } from "./shared/tool-ui-card";
|
|
56
|
+
export type { InlineToolUiCardEntry, PreviewToolUiCardEntry, ToolUiCard, ToolUiCardContentType, } from "./shared/tool-ui-card";
|
|
57
|
+
export { prependOlder, replaceWindow } from "./session/history-page";
|
|
58
|
+
export type { LiveRevisionState } from "./session/history-page";
|
|
38
59
|
export { DEFAULT_REPLAY_SPEED } from "./schemas/session";
|
|
39
60
|
export { SessionInfo, SessionStatus } from "./schemas/session";
|
|
40
|
-
export type { ModeId, PrimarySkillParallelMode, PrimarySkillSnapshot, ReplayPreview, ReplaySpeed, ReplayState, SessionDetail, SessionPortMapping,
|
|
61
|
+
export type { ModeId, PrimarySkillParallelMode, PrimarySkillSnapshot, PrimarySkillStageSpec, PrimarySkillStepSpec, PublishedSolutionRef, ReplayPreview, ReplaySpeed, ReplayState, SessionDetail, SessionPortMapping, SessionSearchMatch, SkillEditorTemplateId, TemplateId, } from "./schemas/session";
|
|
41
62
|
export { LayoutType } from "./schemas/solution";
|
|
42
63
|
export type { BizRole, Solution, SolutionAppField, SolutionAppState, SolutionAppUiConfig, } from "./schemas/solution";
|
|
43
64
|
export { Task, TaskStatus } from "./schemas/task";
|
|
44
65
|
export type { BackgroundTask, BackgroundTaskStopResult } from "./schemas/background";
|
|
45
|
-
export { acceptedPostChatFollowupCompletesLatestRun, ClientProjectionBuilder } from "./shared/projection";
|
|
66
|
+
export { acceptedPostChatFollowupCompletesLatestRun, acknowledgeTurnEvents, ClientProjectionBuilder, } from "./shared/projection";
|
|
46
67
|
export type { RawEvent } from "./shared/projection";
|
|
68
|
+
export { AuthBusyReconnect, authBusyRetryDelayMs } from "./shared/auth-busy";
|
|
47
69
|
export { createSocket } from "./socket";
|
|
48
70
|
export type { CreateSocketOptions, TypedSocket } from "./socket";
|
|
49
71
|
export type { AsrAudioPayload } from "./types/socket-events";
|