@blade-hq/agent-client 2612.0.0-beta.67 → 2612.0.0-beta.68
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 +3 -1
- package/dist/{chunk-QJTETIVA.js → chunk-T2R7FOOX.js} +10 -22
- package/dist/chunk-T2R7FOOX.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +3 -1
- package/dist/internal.js.map +1 -1
- package/dist/resources/connectors.d.ts +7 -2
- package/dist/schemas/message.d.ts +1 -1
- package/dist/session/state.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.md +4 -1
- package/dist/chunk-QJTETIVA.js.map +0 -1
package/README.md
CHANGED
|
@@ -782,6 +782,8 @@ chat.renderers = {
|
|
|
782
782
|
|
|
783
783
|
飞书的 `disconnect(name)` 仅停用 BA 绑定,保留 SW 账号与 PA 订阅。重新启用通过显式 `finish` 动作完成;停止推送可用 `pause`;移除连接并重新关联使用 `authorize(name, "remove", undefined, { expected_connection_id: view.connection_id })`。仅 SW 确认移除后清空旧绑定和目录,保留当前用户 PAT;不会删除飞书后台应用或自动发起新关联。成功后的目录暂不可读仍返回 disconnected 与 `catalog_unavailable=true`,不恢复旧应用。
|
|
784
784
|
|
|
785
|
+
连接器列表的可选 `icon` 字段是包内图片的 data URL,可直接显示;未声明或图片无效时为空,不传给安装插件的图标下载接口。
|
|
786
|
+
|
|
785
787
|
`client.connectors.list()` 列出当前用户沙盒中创建的连接器及随项目发布的内置连接器,来源分别为 `personal`、`builtin`,无需商店安装;`listForSession(sessionId)` 同时返回当前对话的启用状态。`read(name)` 获取认证表单与连接状态;`connect(name, update)` 保存个人配置并执行真实认证;`verify(name)` 验证已有连接;`disconnect(name)` 清除普通连接器的连接和个人配置(飞书仅停用 BA)。每用户每连接器只有一个连接,修改账号更新原连接;密码与私有状态不通过读取接口返回。认证通过后,用 `sessions.setSessionPluginActivation(sessionId, name, true)` 在沙盒对话中启用;包内容变化后需要重新连接。
|
|
786
788
|
|
|
787
789
|
相关类型:`ConnectorsResource`、`AccountConnector`、`ConnectorConnection`、`ConnectorConnectionView`。
|
|
@@ -1015,6 +1017,6 @@ BA 桌面使用同源 `/api/auth/sdk/desktop-session` 建立自身 cookie 会话
|
|
|
1015
1017
|
|
|
1016
1018
|
## 托管连接契约
|
|
1017
1019
|
|
|
1018
|
-
`client.connectors` 的连接声明支持 `browser`、`device`、`managed`。`browser` 仍在用户沙盒打开登录页;`managed` 表示由部署绑定的 SW 管理认证,包内 url 为空,不要调用 `startBrowserAuthorization`。通过 `authorize(name, "
|
|
1020
|
+
`client.connectors` 的连接声明支持 `browser`、`device`、`managed`。`browser` 仍在用户沙盒打开登录页;`managed` 表示由部署绑定的 SW 管理认证,包内 url 为空,不要调用 `startBrowserAuthorization`。通过 `authorization(name)` 获取公共连接状态,通过 `authorize(name, "credentials", undefined, {email, authorization_code})` 提交卡片凭据并启用邮箱。凭据只透传给 SW,不进入 View、聊天或持久化状态;PAT 由 BA 服务端用于访问 SW。
|
|
1019
1021
|
|
|
1020
1022
|
`push_identity` 是 SW 提供的公开事件身份,`reference_scope` 用于保留查询或文件来源,均不含凭据。飞书继续携带 app_id,邮箱只有 connection_id;不要替旧引用补当前来源,也不要为邮箱虚构应用编号。文件仍用鉴权的 `uploadFile` / `downloadFile`,不能直接请求 SW 或采信任意下载 URL。邮箱当前只交付通道与类型,品牌包、授权页面、共享连接 UI 及 PA 推送随后续任务切换。
|
|
@@ -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.
|
|
230
|
+
var SDK_VERSION = true ? "2612.0.0-beta.68" : "1.1.1";
|
|
231
231
|
|
|
232
232
|
// src/auth-login.ts
|
|
233
233
|
function isAuthCallbackMessage(value) {
|
|
@@ -1067,17 +1067,6 @@ function attachToolEvidence(call, evidence) {
|
|
|
1067
1067
|
// src/schemas/message.ts
|
|
1068
1068
|
function inferToolStatus(resultStr) {
|
|
1069
1069
|
if (resultStr.includes('"Cancelled by user"')) return "cancelled";
|
|
1070
|
-
try {
|
|
1071
|
-
const parsed = JSON.parse(resultStr);
|
|
1072
|
-
if (typeof parsed === "object" && parsed !== null) {
|
|
1073
|
-
if ("error" in parsed && parsed.error) return "error";
|
|
1074
|
-
const nested = parsed.result;
|
|
1075
|
-
if (typeof nested === "object" && nested !== null && "error" in nested && nested.error) {
|
|
1076
|
-
return "error";
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
} catch {
|
|
1080
|
-
}
|
|
1081
1070
|
return "done";
|
|
1082
1071
|
}
|
|
1083
1072
|
|
|
@@ -5259,14 +5248,12 @@ function parentForkToolCallIdFromTurn(turn) {
|
|
|
5259
5248
|
}
|
|
5260
5249
|
return null;
|
|
5261
5250
|
}
|
|
5262
|
-
function
|
|
5263
|
-
const
|
|
5264
|
-
if (
|
|
5265
|
-
if (
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
return JSON.stringify(block.content);
|
|
5269
|
-
}).join("");
|
|
5251
|
+
function messageContentFromTurn(turn) {
|
|
5252
|
+
const contents = turn.blocks.filter((block) => block.type === "text").map((block) => normalizeMessageContent(block.content));
|
|
5253
|
+
if (contents.length === 0) return "";
|
|
5254
|
+
if (contents.length === 1) return contents[0];
|
|
5255
|
+
if (contents.every((content) => typeof content === "string")) return contents.join("");
|
|
5256
|
+
return contents.flatMap((content) => typeof content === "string" ? [{ type: "text", text: content }] : content);
|
|
5270
5257
|
}
|
|
5271
5258
|
function workspaceNotificationContent(turn) {
|
|
5272
5259
|
const block = turn.blocks.find(
|
|
@@ -5372,7 +5359,7 @@ function projectionToMessage(turn) {
|
|
|
5372
5359
|
...turn.started_at ? { timestamp: turn.started_at } : {}
|
|
5373
5360
|
};
|
|
5374
5361
|
}
|
|
5375
|
-
const content =
|
|
5362
|
+
const content = messageContentFromTurn(turn) || workspaceNotificationContent(turn);
|
|
5376
5363
|
const reasoning = buildReasoning(turn);
|
|
5377
5364
|
const toolCalls = turn.tool_calls.length > 0 ? turn.tool_calls.map((toolCall) => ({
|
|
5378
5365
|
id: toolCall.id,
|
|
@@ -9344,6 +9331,7 @@ export {
|
|
|
9344
9331
|
toReplaySnapshot,
|
|
9345
9332
|
createInitialSessionState,
|
|
9346
9333
|
parentForkToolCallIdFromTurn,
|
|
9334
|
+
messageContentFromTurn,
|
|
9347
9335
|
reconcileOptimisticUserTurns,
|
|
9348
9336
|
reconcileHistoricalUserTurns,
|
|
9349
9337
|
withTurns,
|
|
@@ -9359,4 +9347,4 @@ export {
|
|
|
9359
9347
|
parseAskUserQuestion,
|
|
9360
9348
|
formatAskUserAnswer
|
|
9361
9349
|
};
|
|
9362
|
-
//# sourceMappingURL=chunk-
|
|
9350
|
+
//# sourceMappingURL=chunk-T2R7FOOX.js.map
|