bailinghub 0.5.0 → 0.6.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.en.md +146 -185
- package/README.md +135 -206
- package/THIRD_PARTY_NOTICES.md +6 -7
- package/assets/readme-demo-evidence.en-dark.svg +82 -0
- package/assets/readme-demo-evidence.en.svg +82 -0
- package/assets/readme-demo-evidence.zh-CN-dark.svg +82 -0
- package/assets/readme-demo-evidence.zh-CN.svg +82 -0
- package/assets/readme-entry-points.en-dark.svg +71 -0
- package/assets/readme-entry-points.en.svg +71 -0
- package/assets/readme-entry-points.zh-CN-dark.svg +71 -0
- package/assets/readme-entry-points.zh-CN.svg +71 -0
- package/assets/readme-product-overview.en-dark.svg +87 -0
- package/assets/readme-product-overview.en.svg +87 -0
- package/assets/readme-product-overview.zh-CN-dark.svg +87 -0
- package/assets/readme-product-overview.zh-CN.svg +87 -0
- package/docker-compose.images.yml +2 -2
- package/docs/AGENT_AUTH_API.en.md +25 -9
- package/docs/AGENT_AUTH_API.md +17 -5
- package/docs/AGENT_CLIENT_QUICKSTART.en.md +90 -18
- package/docs/AGENT_CLIENT_QUICKSTART.md +74 -16
- package/docs/AGENT_CONVERSATION_AUDIT.en.md +194 -0
- package/docs/AGENT_CONVERSATION_AUDIT.md +111 -0
- package/docs/CHANGELOG.en.md +23 -0
- package/docs/CHANGELOG.md +23 -0
- package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
- package/docs/INDEPENDENT_VALIDATION.md +4 -4
- package/docs/README.en.md +7 -0
- package/docs/README.md +7 -0
- package/docs/RELEASE_NOTES_v0.5.1.en.md +45 -0
- package/docs/RELEASE_NOTES_v0.5.1.md +45 -0
- package/docs/RELEASE_NOTES_v0.6.0.en.md +51 -0
- package/docs/RELEASE_NOTES_v0.6.0.md +51 -0
- package/docs/user-guide/README.en.md +1 -0
- package/docs/user-guide/README.md +1 -0
- package/docs/user-guide/console-map.en.md +2 -0
- package/docs/user-guide/console-map.md +2 -1
- package/docs/user-guide/conversations.en.md +40 -0
- package/docs/user-guide/conversations.md +40 -0
- package/package.json +1 -1
- package/scripts/check-doc-links.mjs +3 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-release-consistency.test.mjs +5 -5
- package/scripts/e2e-console.mjs +89 -0
- package/scripts/generate-readme-assets.mjs +488 -7
- package/scripts/install.sh +1 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +2 -0
- package/scripts/verify-github-repo.mjs +2 -0
- package/sql/057_agent_conversation_audit.sql +55 -0
- package/src/app/agent-conversation-audit.ts +30 -0
- package/src/app/oss-edition.ts +1 -0
- package/src/core/config/agent-direct-console-selection.test.ts +22 -0
- package/src/core/runtime/agent-conversation-audit.test.ts +38 -0
- package/src/core/runtime/agent-conversation-audit.ts +159 -0
- package/src/infrastructure/config/config-agent-auth-repository.test.ts +36 -0
- package/src/infrastructure/config/config-agent-auth-repository.ts +97 -0
- package/src/infrastructure/config/config-agent-client-runtime-repository.test.ts +38 -0
- package/src/infrastructure/config/config-agent-client-runtime-repository.ts +54 -0
- package/src/infrastructure/config/config-agent-conversation-audit-repository.test.ts +146 -0
- package/src/infrastructure/config/config-agent-conversation-audit-repository.ts +262 -0
- package/src/infrastructure/config/configstore.ts +5 -0
- package/src/routes/admin-agent-clients.test.ts +120 -0
- package/src/routes/admin-agent-clients.ts +161 -0
- package/src/routes/admin-conversation-audit.ts +46 -0
- package/src/routes/admin-runtime.test.ts +38 -0
- package/src/routes/admin-runtime.ts +14 -3
- package/src/routes/admin.ts +6 -0
- package/src/routes/agent-api.ts +2 -0
- package/src/routes/agent-conversation-audit.test.ts +131 -0
- package/src/routes/agent-conversation-audit.ts +33 -0
- package/src/test-support/agent-conversation-audit-fixture.ts +123 -0
- package/web/console/assets/{Accounts-D4RRm5D1.js → Accounts-Ca_VnSu9.js} +1 -1
- package/web/console/assets/AgentClients-BPIvlLYY.js +1 -0
- package/web/console/assets/AgentClients-DsWADpzr.css +1 -0
- package/web/console/assets/{Approvals-CsTTKb8o.js → Approvals-CMvPWacY.js} +1 -1
- package/web/console/assets/{Audit-BzvZ7JZw.js → Audit-CIRqOCnL.js} +1 -1
- package/web/console/assets/{BrandLockup-CYcA93wh.js → BrandLockup-BrytmTTH.js} +1 -1
- package/web/console/assets/{Channels-DRQZggqM.js → Channels-CApxH2TB.js} +1 -1
- package/web/console/assets/{ChatEntries-BUB7BWKU.js → ChatEntries-CJon3bWJ.js} +1 -1
- package/web/console/assets/Clients-BSA1rlTB.js +3 -0
- package/web/console/assets/Clients-CNIVs7Qn.css +1 -0
- package/web/console/assets/{Cost-BZgFf1yM.js → Cost-BbhlQFP8.js} +1 -1
- package/web/console/assets/{Credentials-BTe2Q07j.js → Credentials-kqr1W0K7.js} +1 -1
- package/web/console/assets/{Diagnostics-WL-buYli.js → Diagnostics-Kljt9XTH.js} +1 -1
- package/web/console/assets/{Executors-CGZ-7Xmp.js → Executors-DnsB-Xz4.js} +1 -1
- package/web/console/assets/{HelpTip-CT07o3kB.js → HelpTip-i-KJhf5s.js} +1 -1
- package/web/console/assets/{Kb-VVw8oGsT.js → Kb-DLZSAFWP.js} +2 -2
- package/web/console/assets/{Login-rwvmBBPl.js → Login-DiTjPWmN.js} +1 -1
- package/web/console/assets/{Projects-CexaCEY1.js → Projects-CXcVCgCD.js} +1 -1
- package/web/console/assets/Routes-CXGl9SMM.css +1 -0
- package/web/console/assets/Routes-DN9_d9Po.js +124 -0
- package/web/console/assets/Runs-Cwbe6thL.js +3 -0
- package/web/console/assets/Runs-D8UmjP5G.css +1 -0
- package/web/console/assets/{Setup-Djh5yadQ.js → Setup-FqoCKmfZ.js} +1 -1
- package/web/console/assets/Shell-BEqpONiy.js +1 -0
- package/web/console/assets/Shell-D9Uw-fsa.css +1 -0
- package/web/console/assets/{StorageBuckets-CQBR41W1.js → StorageBuckets-CkORbYXY.js} +1 -1
- package/web/console/assets/{SystemSettings-DgnopekD.js → SystemSettings-gTQAazu7.js} +1 -1
- package/web/console/assets/{SystemStatus-Bj8-kPt2.js → SystemStatus-DAmUUNqO.js} +1 -1
- package/web/console/assets/{Targets-BAfCt_nH.js → Targets-CZmDcjsE.js} +1 -1
- package/web/console/assets/{Tools-xjd0NZdE.js → Tools-CIHInlHL.js} +1 -1
- package/web/console/assets/index-BkLbd7Cc.js +2 -0
- package/web/console/assets/{index-DZEQL_yy.js → index-QnmD7N7F.js} +1 -1
- package/web/console/assets/{request-DkNPOweH.js → request-r7GHVJzw.js} +1 -1
- package/web/console/assets/{schema-CgPWAu1_.js → schema-BVn_hB7M.js} +1 -1
- package/web/console/assets/{util-SiQC2MJh.js → util-4bN2dv7B.js} +1 -1
- package/web/console/assets/{vendor-element-D7WRzHhy.js → vendor-element-CZoEjZr8.js} +1 -1
- package/web/console/assets/vendor-mammoth-BUEEDX6A.js +231 -0
- package/web/console/index.html +2 -2
- package/web-admin/package-lock.json +3 -3
- package/web-admin/src/agent-direct-selection.ts +21 -0
- package/web-admin/src/components/ClientConversations.vue +244 -0
- package/web-admin/src/components/conversation-audit.ts +121 -0
- package/web-admin/src/layout/Shell.vue +1 -1
- package/web-admin/src/pages/AgentClients.vue +254 -0
- package/web-admin/src/pages/Clients.vue +4 -2
- package/web-admin/src/pages/Routes.vue +54 -5
- package/web-admin/src/pages/Runs.vue +73 -17
- package/web-admin/src/router.ts +2 -0
- package/web-admin/tests/conversation-audit.fixture.mjs +182 -0
- package/web-admin/tests/conversation-audit.test.mjs +93 -0
- package/web/console/assets/Clients-CQ_MonGL.css +0 -1
- package/web/console/assets/Clients-HhCyrxfz.js +0 -3
- package/web/console/assets/Routes-B9ZHbQAp.js +0 -124
- package/web/console/assets/Routes-BbkFpi6Y.css +0 -1
- package/web/console/assets/Runs-4zDD9VOC.css +0 -1
- package/web/console/assets/Runs-BzFNPTwD.js +0 -3
- package/web/console/assets/Shell-BVIjmoY8.css +0 -1
- package/web/console/assets/Shell-kn763smL.js +0 -1
- package/web/console/assets/index-DfJA7iJS.js +0 -2
- package/web/console/assets/vendor-mammoth-DvgsHdlx.js +0 -231
|
@@ -30,8 +30,8 @@ BailingHub 负责可信业务身份、能力裁剪、审批、幂等、业务调
|
|
|
30
30
|
| `hubUrl` | DSH/宿主部署者 | 宿主插件配置 | 否;只填中枢公开 HTTPS 根地址 |
|
|
31
31
|
| `clientAppId` | DSH/宿主部署者 | 宿主插件配置 | 否;对应中枢“接入方”的 `app_id` |
|
|
32
32
|
| `workspace` | DSH/宿主部署者 | 宿主插件配置 | 否;对应允许的 BailingHub `route_key` |
|
|
33
|
-
| `connectionName` | 最终用户或宿主部署者 | 本机 SDK 连接注册表 |
|
|
34
|
-
| Agent 授权页 URL | 业务开发者/中枢管理员 | BailingHub 接入方配置 |
|
|
33
|
+
| `connectionName` | 最终用户或宿主部署者 | 本机 SDK 连接注册表 | 否;选择一个本机连接实例的可读名称 |
|
|
34
|
+
| Agent 授权页 URL | 业务开发者/中枢管理员 | BailingHub 接入方配置 | 否;同一应用只配一个中立入口,不让最终用户手填 |
|
|
35
35
|
| 接入方 Client Token | 业务后端 | 服务端 Secret/环境变量 | **是;不得进入浏览器、DSH 或公开配置** |
|
|
36
36
|
| Tool Provider Secret | 业务后端与 BailingHub | 两端 Secret/凭据管理 | **是;不得进入 DSH** |
|
|
37
37
|
| Agent access/refresh token | 通用 SDK | Keychain 或显式启用的安全存储 | **是;不得显示或写入插件配置** |
|
|
@@ -45,7 +45,7 @@ BailingHub Client Token、Tool Provider Secret 或业务系统密码的步骤。
|
|
|
45
45
|
|
|
46
46
|
### 3.1 部署 Core 并执行数据库迁移
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
完整对话归档使用 BailingHub0.6.0、Agent Client SDK0.4.0及兼容客户端。Core需要已有迁移055/056及新增057;由一个部署步骤执行迁移,运行时启动不会自动迁移。
|
|
49
49
|
升级后先确认:
|
|
50
50
|
|
|
51
51
|
- `/health` 和 `/health/ready` 正常;
|
|
@@ -72,7 +72,7 @@ Secret 只存在于业务后端与中枢凭据管理中,不进入 route、知
|
|
|
72
72
|
在“路由”中选择刚才的工具源,并配置:
|
|
73
73
|
|
|
74
74
|
1. `tools.agent_direct.enabled=true`,显式开放本地 Agent 工具面;
|
|
75
|
-
2. 只把允许本地 Agent 调用的写操作精确列入 `write_tools
|
|
75
|
+
2. 只把允许本地 Agent 调用的写操作精确列入 `write_tools`;写操作较多时可在控制台点击“全选当前写操作”,它会保存当前目录的 operationId 快照,不会自动授权未来新增写操作;只读能力无需逐项加入该数组;
|
|
76
76
|
3. 工具审批默认继承业务侧 ACC 声明;只有确需额外收紧时才加入 `force_approval_tools`;
|
|
77
77
|
4. 开启“本地 Agent Runtime”,按需填写补充指令和每轮主动工具数(1–12,默认 8);
|
|
78
78
|
5. 配置 route 的受众、租户和角色边界,不使用 `*` 代替生产授权设计。
|
|
@@ -85,18 +85,30 @@ Agent Client 不会收到模型凭据、Tool Provider Secret、业务 API 地址
|
|
|
85
85
|
|
|
86
86
|
- `app_id`:稳定的公开 `clientAppId`,例如 `merchant-agent`;
|
|
87
87
|
- `allowed_routes`:只选择要开放的 route;
|
|
88
|
-
- `agent_authorize_url
|
|
89
|
-
`https://business.example.com/agent/authorize
|
|
88
|
+
- `agent_authorize_url`:业务系统实现的一个稳定、统一 HTTPS 授权入口,例如
|
|
89
|
+
`https://business.example.com/agent/authorize`;不要配置成绑定具体账号、租户或门店的 URL;
|
|
90
90
|
- `enabled=true`,并设置合理限速。
|
|
91
91
|
|
|
92
92
|
中枢创建接入方时会显示一次 Client Token。它只交给业务后端,用于业务授权页服务端调用
|
|
93
93
|
BailingHub Agent Auth 接口。不要把它写入 DSH 配置、网页 JavaScript、URL、README 或截图。
|
|
94
94
|
|
|
95
|
+
创建完成后可打开控制台“智能体客户端”:
|
|
96
|
+
|
|
97
|
+
- 查看哪些既有接入方已经开放 Agent 授权,以及允许的 workspace;
|
|
98
|
+
- 查看 Agent Session 的设备名、可信业务主体、最后活跃与有效期;
|
|
99
|
+
- 远程撤销遗失设备或不再允许的 Agent Session;
|
|
100
|
+
- 按 `hubUrl + clientAppId + workspace + connectionName` 生成不含秘密的 JSON 或 DSH 命令;
|
|
101
|
+
- 查看近期会话、Agent Run、工具调用、Token、失败率与审批状态聚合。
|
|
102
|
+
|
|
103
|
+
该页面复用现有接入方、Agent Session 和 Agent Run 账本,不会创建第二套 Client,也不等同于
|
|
104
|
+
“执行器”。生成的配置不包含 Client Token、Agent Token 或模型 Key。
|
|
105
|
+
|
|
95
106
|
## 4. 业务开发者:建立可信身份授权页
|
|
96
107
|
|
|
97
108
|
BailingHub SDK 提供的是服务端 Agent Auth 方法,不会在任意业务系统中自动生成统一样式的页面。
|
|
98
|
-
|
|
99
|
-
|
|
109
|
+
业务系统负责提供一个符合自身登录和权限体系的稳定统一入口;页面必须先要求用户登录,并在需要
|
|
110
|
+
时允许切换账号、从服务端确认有权访问的租户中进行选择,再由业务后端从选择完成后的当前服务端
|
|
111
|
+
登录态推导 `principal`、`on_behalf_of` 和可授权 route。不要为每个租户或门店创建不同授权 URL。
|
|
100
112
|
|
|
101
113
|
### 4.1 浏览器与后端边界
|
|
102
114
|
|
|
@@ -159,7 +171,8 @@ export BAILINGHUB_CONNECTION_NAME='default'
|
|
|
159
171
|
```
|
|
160
172
|
|
|
161
173
|
`hubUrl` 只填中枢根地址,不带 `/console`、`/agent-api` 或业务接口路径;`workspace` 填 route
|
|
162
|
-
标识,不填业务域名、租户 ID 或聊天入口 ID
|
|
174
|
+
标识,不填业务域名、租户 ID 或聊天入口 ID。插件配置没有业务 URL 字段:授权地址始终由中枢按
|
|
175
|
+
`clientAppId` 返回,业务账号与租户只在该业务授权页中由用户确认。
|
|
163
176
|
|
|
164
177
|
在 DSH 中执行:
|
|
165
178
|
|
|
@@ -170,16 +183,58 @@ export BAILINGHUB_CONNECTION_NAME='default'
|
|
|
170
183
|
|
|
171
184
|
登录命令会在本机随机 `127.0.0.1` 端口建立 PKCE 回调并打开业务系统授权页。授权成功后,SDK
|
|
172
185
|
在 macOS 使用 Keychain 保存凭据;Linux/POSIX 文件回退必须显式启用且文件权限为 `0600`;
|
|
173
|
-
Windows
|
|
186
|
+
Windows 使用当前用户的原生 DPAPI 凭据保护;详细平台要求以独立SDK/插件的兼容矩阵为准。
|
|
174
187
|
|
|
175
188
|
DSH 的模型提供方和模型 API Key 需要在 DSH 自己的模型设置中单独配置。BailingHub 插件既不读取
|
|
176
189
|
也不代管模型 Key。
|
|
177
190
|
|
|
178
|
-
## 6. 多 Hub
|
|
191
|
+
## 6. 多 Hub、多 workspace 与同绑定身份实例
|
|
192
|
+
|
|
193
|
+
公开绑定由 `Hub + clientAppId + workspace` 组成;`connectionName` 只是一个本机连接选择器,不能
|
|
194
|
+
充当可信账号、租户或门店身份。多个实例可以使用同一公开绑定,但每个实例都必须单独
|
|
195
|
+
完成浏览器授权。Core 不信任本机实例名或实例 ID,可信主体仍只来自业务后端批准得到的
|
|
196
|
+
`principal` 与 `on_behalf_of`。
|
|
197
|
+
|
|
198
|
+
每次登录按最小权限原则申请一个 workspace。需要连接另一套中枢、另一条 route,或在同一公开
|
|
199
|
+
绑定下授权另一业务身份时,可由控制台生成命令,或由用户在 DSH 中执行:
|
|
200
|
+
|
|
201
|
+
```text
|
|
202
|
+
/bailinghub connections add "identity-a" https://hub-a.example.com merchant-agent order-assistant
|
|
203
|
+
/bailinghub connections list
|
|
204
|
+
/bailinghub connections use "identity-a"
|
|
205
|
+
/bailinghub login
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
连接切换是用户命令,不是模型工具;它选择连接管理和登录的目标,不会为新会话自动授予业务范围。DSH0.4.0在首消息前必须另外显式选择本次授权,已有会话保持原范围。
|
|
209
|
+
`/bailinghub use <workspace>` 只在当前授权已经允许的 workspace 内切换,不能替代多连接选择。
|
|
210
|
+
删除连接时使用 `/bailinghub connections remove <名称>`:SDK 会先远程撤销 Agent Session,成功
|
|
211
|
+
后再删除该实例的本地凭据;远程撤销失败则保留该实例和凭据供重试。不要复制 access/refresh token
|
|
212
|
+
文件。
|
|
213
|
+
|
|
214
|
+
同一台设备上,如果新连接在相同公开绑定下最终得到与旧连接相同的可信 `on_behalf_of`,SDK 会在
|
|
215
|
+
新授权成功后撤销并移除旧连接,避免同一身份留下重复本机连接;若身份不同,则两个连接保持独立。
|
|
216
|
+
如果新授权已经成功、但旧会话撤销或本地清理失败,结果会标记 `cleanupRequired` 并保留可恢复状态。
|
|
217
|
+
此时不要重新授权,应先按结果列出的旧连接完成清理。Core 的 `bz_agent_sessions` 仍以 `session_id`
|
|
218
|
+
为主键,不执行跨设备的全局身份去重,因此不同设备上的授权仍可独立失效和审计。
|
|
219
|
+
|
|
220
|
+
### 6.1 首消息前选择本次对话的授权
|
|
221
|
+
|
|
222
|
+
先分别授权所需账户,再从 `/bailinghub connections list` 获取各自的 `connectionKey`。在新会话的第一条用户消息之前运行:
|
|
223
|
+
|
|
224
|
+
```text
|
|
225
|
+
/bailinghub scope set <A的connectionKey> <B的connectionKey>
|
|
226
|
+
/bailinghub scope
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
这里使用实际返回的连接key,不使用示例占位符或门店名。只选择A就只能使用A;`/bailinghub scope none`表示只聊天,不访问Hub。确认选择成功后再发送业务请求。DSH0.4.0只接受同一Hub/clientAppId/workspace下的授权集合,不组合不同系统或路由。
|
|
230
|
+
|
|
231
|
+
第一条用户消息后范围固定;改选需要新会话。自研宿主使用`setSessionScope/getSessionScope/restoreSessionScope`,恢复失败不能回退到默认或剩余授权。
|
|
232
|
+
|
|
233
|
+
### 6.2 查看完整对话与重试同步
|
|
234
|
+
|
|
235
|
+
支持的宿主通过SDK0.4.0归档真实可见文本,保留原Session、持久历史与独立待传记录。管理员在“任务→会话→客户端完整对话”阅读沟通并打开各授权的原执行记录。
|
|
179
236
|
|
|
180
|
-
|
|
181
|
-
首个公开版本按最小权限原则每次授权一个 workspace。需要连接另一套中枢或另一条 route 时,使用
|
|
182
|
-
另一个 `connectionName` 并重新完成浏览器授权;不要复用或复制 access/refresh token 文件。
|
|
237
|
+
DSH使用`/bailinghub archive status`查看状态,`/bailinghub archive sync`补传。离线重开后联网,可在同一runtime、同一Session重试原范围核验与同步;原授权明确撤销仍整组阻断。保存失败或历史缺口要单独显示,不能靠重复发消息或重执行业务来补账。归档恢复不等于恢复跨进程丢失的invocation。详见[使用者指南](user-guide/conversations.md)与[归档接口](AGENT_CONVERSATION_AUDIT.md)。
|
|
183
238
|
|
|
184
239
|
## 7. 最小验收
|
|
185
240
|
|
|
@@ -188,7 +243,7 @@ DSH 的模型提供方和模型 API Key 需要在 DSH 自己的模型设置中
|
|
|
188
243
|
1. 全新 DSH Profile 只通过公开包安装,不引用本机路径或本地 tgz;
|
|
189
244
|
2. `/bailinghub login` 打开的域名是开发者配置的业务授权页;
|
|
190
245
|
3. `/bailinghub status` 只显示非秘密会话元数据;
|
|
191
|
-
4.
|
|
246
|
+
4. 首消息前显式选择范围,未选/空范围只聊天;选择A/B后本地Agent能在原范围内查询一项只读能力;
|
|
192
247
|
5. 一项可回滚写操作遵循 ACC/route 审批语义,且不会重复调用;
|
|
193
248
|
6. BailingHub 会话页能看到本地编排边界和中枢治理轨迹;
|
|
194
249
|
7. 日志、页面和包制品中没有 Client Token、Agent token、模型 Key、业务 Cookie、工具参数值或响应正文。
|
|
@@ -198,7 +253,10 @@ DSH 的模型提供方和模型 API Key 需要在 DSH 自己的模型设置中
|
|
|
198
253
|
- **`invalid_client`**:检查 `clientAppId`、接入方是否启用、是否配置授权页,以及 workspace 是否在
|
|
199
254
|
`allowed_routes` 中。
|
|
200
255
|
- **授权页打不开**:生产授权页必须是 HTTPS;仅本机开发允许带端口的 `127.0.0.1`/`::1` HTTP。
|
|
201
|
-
-
|
|
256
|
+
- **打开了固定租户或门店**:`agent_authorize_url` 配错了;应改成业务系统的统一授权入口,并在页面
|
|
257
|
+
内依据当前登录态完成切号或选租户,插件端不要增加业务 URL 配置。
|
|
258
|
+
- **`cleanupRequired`**:新身份授权已经成功,不要再次授权;先按返回的旧连接名称重试撤销或移除。
|
|
259
|
+
- **登录成功但没有业务工具**:先确认本次新会话首消息前已成功设置非空scope;只登录或切换默认连接不等于选择范围。再检查route的工具源、`tools.agent_direct.enabled`、受众策略和
|
|
202
260
|
“本地 Agent Runtime”开关。
|
|
203
261
|
- **写操作要求审批**:先查看业务侧 ACC 声明;route 的 `force_approval_tools` 只能额外收紧,不能
|
|
204
262
|
降低高风险或 ACC 明示审批。
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Agent Conversation Audit v1
|
|
2
|
+
|
|
3
|
+
[中文版](AGENT_CONVERSATION_AUDIT.md)
|
|
4
|
+
|
|
5
|
+
This optional API records the complete **visible** conversation managed by a local
|
|
6
|
+
Agent, and links its turns to separately authorized BailingHub runs. It does not
|
|
7
|
+
merge Agent Sessions, business identities, threads, runtime memory, tool grants,
|
|
8
|
+
approvals or invocation ownership. It does not collect hidden reasoning.
|
|
9
|
+
|
|
10
|
+
The feature requires `sql/057_agent_conversation_audit.sql`. Hosts must explicitly
|
|
11
|
+
apply their normal Core migration process; starting the runtime does not apply
|
|
12
|
+
this migration. Older hosts may omit `ConfigStore.agentConversationAudit`; these
|
|
13
|
+
write and admin read endpoints then report `conversation_audit_unavailable`.
|
|
14
|
+
|
|
15
|
+
## Authorization and storage boundary
|
|
16
|
+
|
|
17
|
+
- Every Agent request uses the existing `Authorization: Bearer <Agent access token>`
|
|
18
|
+
authentication. Tokens are never fields in the archive or event DTOs.
|
|
19
|
+
- A creator freezes the exact member Agent Session UUIDs, client application,
|
|
20
|
+
route and original `client_conversation_id`. The creator must be a member.
|
|
21
|
+
- Each other member confirms with **its own** authenticated bearer. A caller
|
|
22
|
+
cannot confirm a session ID supplied in a body. All members must confirm before
|
|
23
|
+
any event, including the first visible message, can be stored.
|
|
24
|
+
- Only the creator can append events. A conversation UUID or client conversation
|
|
25
|
+
string alone gives no membership, write permission or read permission. There is
|
|
26
|
+
consequently no separate enrollment secret.
|
|
27
|
+
- Every mutation checks current route availability and the client/session route
|
|
28
|
+
allowlist intersection and audience policy. Every event batch also checks all
|
|
29
|
+
frozen members for revocation, refresh expiry and unchanged identity snapshots.
|
|
30
|
+
The mutation transaction locks the group, client, route and session rows until
|
|
31
|
+
commit. A refreshed access token can continue the same Agent Session; replacing
|
|
32
|
+
a session or its principal/on-behalf-of identity cannot replace an old member.
|
|
33
|
+
- Full bodies are readable only through the existing administrator `runs:read`
|
|
34
|
+
permission. There is **no Agent transcript read endpoint**. Administrators see
|
|
35
|
+
only the control-plane data domain supplied by their host; hosts must continue
|
|
36
|
+
enforcing their own tenant isolation and must not combine unrelated tenant
|
|
37
|
+
stores because IDs happen to match.
|
|
38
|
+
- Bodies live in `bz_agent_conversation_events`, not in `bz_messages` or thread
|
|
39
|
+
memory. An authorized multi-store conversation is not copied into each store's
|
|
40
|
+
model context. Existing run completion records keep their original purpose.
|
|
41
|
+
|
|
42
|
+
## Create and confirm membership
|
|
43
|
+
|
|
44
|
+
`POST /agent-api/v1/conversation-audits`
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"client_archive_id": "323e4567-e89b-42d3-a456-426614174001",
|
|
49
|
+
"client_conversation_id": "conversation-stable-id",
|
|
50
|
+
"route": "orders",
|
|
51
|
+
"member_session_ids": [
|
|
52
|
+
"123e4567-e89b-42d3-a456-426614174001",
|
|
53
|
+
"123e4567-e89b-42d3-a456-426614174002"
|
|
54
|
+
],
|
|
55
|
+
"member_labels": {
|
|
56
|
+
"123e4567-e89b-42d3-a456-426614174001": "Store A",
|
|
57
|
+
"123e4567-e89b-42d3-a456-426614174002": "Store B"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`client_archive_id` is a persistent random UUID owned by the host. Creation is
|
|
63
|
+
idempotent within `(creator_session_id, route, client_archive_id)` only when the
|
|
64
|
+
entire frozen input matches. A changed member set, label or original conversation
|
|
65
|
+
ID returns `409`; it does not widen or rewrite the original archive. Distinct
|
|
66
|
+
creators never auto-join through identical client IDs. Labels are optional,
|
|
67
|
+
limited to 128 characters, and are display text rather than identity evidence.
|
|
68
|
+
|
|
69
|
+
The creator is confirmed by its creation request. Each other member sends:
|
|
70
|
+
|
|
71
|
+
`POST /agent-api/v1/conversation-audits/:conversation_id/confirm` with `{}`.
|
|
72
|
+
|
|
73
|
+
Both operations return schema `bailing.agent-conversation-audit.v1` and the
|
|
74
|
+
conversation header described below. `state` is `enrolling` until all members
|
|
75
|
+
confirm, then `ready`. It describes enrollment, not a permanent guarantee that
|
|
76
|
+
all authorizations remain active; every subsequent write revalidates them.
|
|
77
|
+
Replies contain no transcript text, credentials, identity hashes or tool data.
|
|
78
|
+
|
|
79
|
+
## Append visible events
|
|
80
|
+
|
|
81
|
+
`POST /agent-api/v1/conversation-audits/:conversation_id/events`
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"events": [
|
|
86
|
+
{"event_id":"start-1","sequence":1,"client_turn_id":"turn-1","kind":"turn_start"},
|
|
87
|
+
{"event_id":"user-1","sequence":2,"client_turn_id":"turn-1","kind":"user_message","content":"Compare the two selected stores."},
|
|
88
|
+
{"event_id":"run-a","sequence":3,"client_turn_id":"turn-1","kind":"run_link","run_id":"223e4567-e89b-42d3-a456-426614174001","member_session_id":"123e4567-e89b-42d3-a456-426614174001"},
|
|
89
|
+
{"event_id":"answer-1","sequence":4,"client_turn_id":"turn-1","kind":"assistant_message","content":"The complete answer shown to the user."},
|
|
90
|
+
{"event_id":"end-1","sequence":5,"client_turn_id":"turn-1","kind":"turn_end","status":"completed"}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
| Kind | Additional required fields | Meaning |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `turn_start` | none | Begin one host-visible turn. |
|
|
98
|
+
| `user_message` | `content` | Exact visible user text, including follow-up messages. |
|
|
99
|
+
| `assistant_message` | `content` | Exact visible assistant text; multiple visible messages are allowed. |
|
|
100
|
+
| `run_link` | `run_id`, `member_session_id` | Attach a verified original authorization run. |
|
|
101
|
+
| `turn_end` | `status` | `completed`, `failed` or `cancelled`. |
|
|
102
|
+
|
|
103
|
+
Unknown fields and event kinds are rejected. There is no arbitrary metadata,
|
|
104
|
+
reasoning, credential, tool-argument or tool-result field. Text is preserved, not
|
|
105
|
+
silently rewritten or truncated. A host must submit only text visible to its user;
|
|
106
|
+
the server cannot infer whether a client-authored statement was actually shown.
|
|
107
|
+
|
|
108
|
+
Sequences start at 1 and remain strictly contiguous. Each batch is ordered and
|
|
109
|
+
atomic. Identical `sequence` + `event_id` + body retries succeed; different content,
|
|
110
|
+
reused IDs, gaps and conflicting turn histories return `409` without partial writes.
|
|
111
|
+
A normal message or `turn_end` must belong to the current running turn. A late
|
|
112
|
+
`run_link` may attach to an already started, completed or cancelled original turn;
|
|
113
|
+
it never reopens that turn or changes a newer turn's status.
|
|
114
|
+
|
|
115
|
+
For every run link, BailingHub verifies the persisted run's exact member Session,
|
|
116
|
+
client application, route, original `client_conversation_id` and `client_turn_id`.
|
|
117
|
+
The server derives `thread_id`. A run belongs to at most one archive, so old run
|
|
118
|
+
and tool traces can link back without ambiguous matches. This relationship does
|
|
119
|
+
not authorize execution, retry, approval or memory access.
|
|
120
|
+
|
|
121
|
+
Successful append response:
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"schema": "bailing.agent-conversation-audit-ack.v1",
|
|
126
|
+
"conversation_id": "423e4567-e89b-42d3-a456-426614174001",
|
|
127
|
+
"last_sequence": 5
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Hosts should persist the archive UUID, creator/member binding, stable event IDs,
|
|
132
|
+
ordered events and acknowledged sequence before claiming successful archival.
|
|
133
|
+
Lost acknowledgements can be retried unchanged. Restoring an audit queue does not
|
|
134
|
+
restore invocation execution state or grant permission to resume unknown IDs.
|
|
135
|
+
|
|
136
|
+
## Administrator read API
|
|
137
|
+
|
|
138
|
+
`GET /admin/api/conversation-audits?limit=50&offset=0` returns:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"schema": "bailing.agent-conversation-audit-list.v1",
|
|
143
|
+
"items": [],
|
|
144
|
+
"has_more": false,
|
|
145
|
+
"next_offset": null
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Each header includes `conversation_id`, `client_archive_id`,
|
|
150
|
+
`client_conversation_id`, `client_app_id`, `route_key`, `state`, `member_count`,
|
|
151
|
+
`confirmed_count`, `last_sequence`, `message_count`, `turn_count`,
|
|
152
|
+
`last_turn_status`, `created_at` and `updated_at`. The last turn status is initially
|
|
153
|
+
null, then `running`, `completed`, `failed` or `cancelled`. Sequences count all
|
|
154
|
+
event kinds and must not be displayed as message counts.
|
|
155
|
+
|
|
156
|
+
`GET /admin/api/conversation-audits/:id?after_sequence=0&limit=100` returns schema
|
|
157
|
+
`bailing.agent-conversation-audit-detail.v1`, `conversation` (the header),
|
|
158
|
+
`members`, `events`, `has_more` and `next_after_sequence`. Member views contain
|
|
159
|
+
`session_id`, `display_label`, `confirmed`, and, once confirmed, the frozen
|
|
160
|
+
`principal` and `on_behalf_of`. Event views contain the submitted visible fields,
|
|
161
|
+
server `created_at`, and server-derived numeric `thread_id` on run links.
|
|
162
|
+
Read the next page using `next_after_sequence`; no fixed first-1000-message cutoff
|
|
163
|
+
is imposed. Responses use `Cache-Control: no-store`.
|
|
164
|
+
|
|
165
|
+
Existing administrator agent-run traces add optional
|
|
166
|
+
`run.conversation_audit_id` / `run.client_turn_id`; verified tool job traces add
|
|
167
|
+
the same fields under `job`. The original trace endpoint and its full
|
|
168
|
+
thread/run/client/session/route ownership checks remain in use.
|
|
169
|
+
|
|
170
|
+
## Limits and errors
|
|
171
|
+
|
|
172
|
+
The member limit is 64. Each append batch contains 1–50 events, each visible text
|
|
173
|
+
is at most 64,000 UTF-16 code units, total batch text is at most 256 KiB of UTF-8,
|
|
174
|
+
and the HTTP JSON envelope is at most 2 MiB. An archive accepts at most 20,000
|
|
175
|
+
events and 16 MiB of visible text. List pages cap at 100 items; event pages cap at
|
|
176
|
+
200 events. Hosts should batch below these maxima. Limits reject writes rather
|
|
177
|
+
than truncate an allegedly complete transcript.
|
|
178
|
+
|
|
179
|
+
| HTTP | Code | Host interpretation |
|
|
180
|
+
| --- | --- | --- |
|
|
181
|
+
| 400 | `invalid_request` | Invalid or undeclared DTO fields. |
|
|
182
|
+
| 401 | `unauthorized` | Existing Agent bearer authentication failed. |
|
|
183
|
+
| 403 | `conversation_audit_authorization_invalid` | A frozen authorization or route is no longer valid. |
|
|
184
|
+
| 404 | `conversation_audit_not_found` | Unknown archive or unavailable to this identity; do not enumerate membership. |
|
|
185
|
+
| 409 | `conversation_audit_not_ready` | Some members have not confirmed; do not submit text. |
|
|
186
|
+
| 409 | `conversation_audit_conflict` | Frozen membership, event sequence/content, turn or run association conflicts. |
|
|
187
|
+
| 413 | `conversation_audit_limit` | No partial or truncated events were saved. |
|
|
188
|
+
| 503 | `conversation_audit_unavailable` | Optional archive repository is not available. |
|
|
189
|
+
| 500 | `conversation_audit_internal_error` | Storage/internal failure; raw exception details are not returned. |
|
|
190
|
+
|
|
191
|
+
Unknown endpoints, including every Agent transcript GET, return `404`. An older
|
|
192
|
+
Core without these routes may also return `404`; adapters must report archival
|
|
193
|
+
as unsupported, not claim that a complete conversation was uploaded. An archive
|
|
194
|
+
failure must remain visible independently of a successful business operation.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Agent 完整对话审计 v1
|
|
2
|
+
|
|
3
|
+
[English protocol and examples](AGENT_CONVERSATION_AUDIT.en.md)
|
|
4
|
+
|
|
5
|
+
本接口归档本地智能体与用户之间的**可见对话**,将每轮沟通关联到各授权独立的 run。
|
|
6
|
+
它不合并 Agent Session、业务身份、thread、记忆、工具授权、审批或 invocation,也不上传隐藏推理。
|
|
7
|
+
正文单独写入 `bz_agent_conversation_events`,不写入各门店的 `bz_messages` 或模型记忆。
|
|
8
|
+
|
|
9
|
+
部署方需要按自己的 Core 升级流程显式应用新增迁移 `sql/057_agent_conversation_audit.sql`;
|
|
10
|
+
运行时启动不会自动迁移。旧宿主可以不提供可选的 `ConfigStore.agentConversationAudit`,此时新接口明确返回不可用。
|
|
11
|
+
|
|
12
|
+
## 创建与逐成员确认
|
|
13
|
+
|
|
14
|
+
所有写接口继续使用现有 Agent access bearer 鉴权,Token 不进入归档 DTO。
|
|
15
|
+
|
|
16
|
+
`POST /agent-api/v1/conversation-audits` 请求字段:
|
|
17
|
+
|
|
18
|
+
| 字段 | 约定 |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| `client_archive_id` | 宿主持久保存的随机 UUID。 |
|
|
21
|
+
| `client_conversation_id` | 与原 startTurn 相同的客户端稳定会话 ID。 |
|
|
22
|
+
| `route` | 当前已授权的工作区路由。 |
|
|
23
|
+
| `member_session_ids` | 冻结的 1–64 个 Agent Session UUID,创建者必须在内。 |
|
|
24
|
+
| `member_labels` | 可选的 session UUID → 显示名称映射,每个名称最多 128 字符;不能用于身份或权限判断。 |
|
|
25
|
+
|
|
26
|
+
创建幂等键为 `creator_session_id + route + client_archive_id`,重试时完整冻结输入必须相同;
|
|
27
|
+
成员、标签或原会话 ID 改变均返回 `409`,不能修改原归档。
|
|
28
|
+
客户端会话 ID 本身不是归属证明,不同创建者不会因为它相同而自动合并。
|
|
29
|
+
|
|
30
|
+
创建者通过创建请求确认本人。其他成员分别用**自己的 bearer**调用
|
|
31
|
+
`POST /agent-api/v1/conversation-audits/:id/confirm`,请求体为 `{}`,不能在 body 中代填另一个身份。
|
|
32
|
+
创建和确认均返回 `schema: bailing.agent-conversation-audit.v1` 及下文会话头。
|
|
33
|
+
全部成员确认前 `state=enrolling`,完成后为 `ready`;每次写入仍会重新校验授权有效性。
|
|
34
|
+
|
|
35
|
+
只有创建者可以追加正文。只知道归档 UUID 或客户端会话字符串的人无法确认成员、写入或读取正文,
|
|
36
|
+
因此无需另发 enrollment secret。正文写事务会锁定归档、client、route 和成员 Session,
|
|
37
|
+
复核所有成员未撤销、refresh 生命周期有效、原主体快照未改变,且 client/session 的路由白名单交集、
|
|
38
|
+
路由启用和 audience 仍允许访问。access token 刷新可以沿用同一 Session,替换身份不能替换旧成员。
|
|
39
|
+
|
|
40
|
+
## 追加可见事件
|
|
41
|
+
|
|
42
|
+
`POST /agent-api/v1/conversation-audits/:id/events` 接收 `{ "events": [...] }`。
|
|
43
|
+
所有事件都有 `event_id`、`sequence`、`client_turn_id`、`kind`:
|
|
44
|
+
|
|
45
|
+
| kind | 额外必填字段 | 含义 |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| `turn_start` | 无 | 开始一轮宿主对话。 |
|
|
48
|
+
| `user_message` | `content` | 原始可见用户文本,可记录同轮追问。 |
|
|
49
|
+
| `assistant_message` | `content` | 原始可见助手文本,可记录同轮多条公开回复。 |
|
|
50
|
+
| `run_link` | `run_id`, `member_session_id` | 关联某个冻结授权的原始 run。 |
|
|
51
|
+
| `turn_end` | `status` | `completed`、`failed` 或 `cancelled`。 |
|
|
52
|
+
|
|
53
|
+
未声明字段和事件种类一律拒绝,不接受任意 metadata、隐藏推理、凭据或工具参数字段。
|
|
54
|
+
文本保留原始字符,不静默改写或截断;宿主负责只提交用户实际可见的文本,服务端无法凭正文判断是否真实展示过。
|
|
55
|
+
|
|
56
|
+
sequence 从 1 开始严格连续,每批有序、原子写入。
|
|
57
|
+
相同 sequence、event_id 和正文的重试成功;内容冲突、复用 ID、序号缺口或轮次冲突返回 `409`,整批不落库。
|
|
58
|
+
普通消息及 turn_end 必须属于当前正在进行的轮次。
|
|
59
|
+
异步返回的 run_link 可以追加到已经开始、完成或取消的原轮次,但不能重开它,也不能改变更新轮次的状态。
|
|
60
|
+
|
|
61
|
+
run 关联必须匹配数据库中的原 Session、client、route、client_conversation_id、client_turn_id;
|
|
62
|
+
thread_id 由服务端获取。一个 run 最多属于一个完整对话归档,避免旧执行记录的返回链接产生歧义。
|
|
63
|
+
关联关系不赋予执行、重试、审批或跨授权记忆读取权限。
|
|
64
|
+
|
|
65
|
+
成功响应为 `{ "schema": "bailing.agent-conversation-audit-ack.v1", "conversation_id": "<UUID>", "last_sequence": 5 }`。
|
|
66
|
+
宿主应先持久保存归档 UUID、创建者及成员绑定、事件 ID、事件顺序和确认游标,再宣称归档成功。
|
|
67
|
+
ACK 丢失可原样重试。恢复归档队列不等于恢复 invocation 执行状态,也不能续执行未知调用 ID。
|
|
68
|
+
|
|
69
|
+
## 管理员分页读取
|
|
70
|
+
|
|
71
|
+
没有 Agent 正文读取接口;全部 Agent 归档 GET 请求返回 `404`。
|
|
72
|
+
以下接口仅供已有 `runs:read` 权限的管理员,响应设置 `Cache-Control: no-store`。
|
|
73
|
+
宿主继续负责其租户数据域隔离,不能因为字符串相同而跨租户合并数据库查询。
|
|
74
|
+
|
|
75
|
+
`GET /admin/api/conversation-audits?limit=50&offset=0` 返回 schema
|
|
76
|
+
`bailing.agent-conversation-audit-list.v1`、`items`、`has_more`、`next_offset`。
|
|
77
|
+
会话头字段为 conversation_id、client_archive_id、client_conversation_id、client_app_id、route_key、
|
|
78
|
+
state、member_count、confirmed_count、last_sequence、message_count、turn_count、last_turn_status、created_at、updated_at。
|
|
79
|
+
末轮状态初始为 null,之后是 running/completed/failed/cancelled。sequence 统计所有事件,不能当成消息数。
|
|
80
|
+
|
|
81
|
+
`GET /admin/api/conversation-audits/:id?after_sequence=0&limit=100` 返回 schema
|
|
82
|
+
`bailing.agent-conversation-audit-detail.v1`、`conversation`、`members`、`events`、has_more、next_after_sequence。
|
|
83
|
+
成员包含 session_id/display_label/confirmed;确认后有冻结的 principal/on_behalf_of。
|
|
84
|
+
事件包含提交的可见字段、服务端 created_at,run_link 还有数值 thread_id。
|
|
85
|
+
按 next_after_sequence 继续读后页,不受原 thread 前 1000 条消息限制。
|
|
86
|
+
|
|
87
|
+
旧管理员 agent-run trace 的 run、通过归属复核的工具 job trace 的 job,可选增加
|
|
88
|
+
conversation_audit_id 和 client_turn_id,用于返回完整对话。
|
|
89
|
+
原 thread/run/client/session/route 轨迹校验继续保留。
|
|
90
|
+
|
|
91
|
+
## 限额与失败语义
|
|
92
|
+
|
|
93
|
+
成员上限 64;每批 1–50 个事件;单条文本最多 64,000 个 UTF-16 code units;
|
|
94
|
+
每批 UTF-8 正文最多 256 KiB,HTTP JSON 最多 2 MiB;
|
|
95
|
+
每个归档最多 20,000 个事件、16 MiB 正文。列表每页上限 100,事件每页上限 200。
|
|
96
|
+
达到上限明确拒绝,不能把截断文本宣称为完整归档。
|
|
97
|
+
|
|
98
|
+
| HTTP | error | 含义 |
|
|
99
|
+
| --- | --- | --- |
|
|
100
|
+
| 400 | `invalid_request` | DTO 字段无效或未声明。 |
|
|
101
|
+
| 401 | `unauthorized` | 原 Agent bearer 鉴权失败。 |
|
|
102
|
+
| 403 | `conversation_audit_authorization_invalid` | 冻结授权或路由已失效。 |
|
|
103
|
+
| 404 | `conversation_audit_not_found` | 不存在或不属于当前身份,统一隐藏成员枚举信息。 |
|
|
104
|
+
| 409 | `conversation_audit_not_ready` | 成员未全部确认,不接收正文。 |
|
|
105
|
+
| 409 | `conversation_audit_conflict` | 成员、幂等内容、序号、轮次或 run 关联冲突。 |
|
|
106
|
+
| 413 | `conversation_audit_limit` | 超限,整批未落库。 |
|
|
107
|
+
| 503 | `conversation_audit_unavailable` | 可选归档仓储未提供。 |
|
|
108
|
+
| 500 | `conversation_audit_internal_error` | 内部失败,不返回原始数据库或异常详情。 |
|
|
109
|
+
|
|
110
|
+
旧 Core 未提供接口时也可能返回 `404`,适配器必须显示不支持归档。
|
|
111
|
+
业务执行成功与归档成功分别报告,不能因为前者成功而掩盖正文上传失败。
|
package/docs/CHANGELOG.en.md
CHANGED
|
@@ -22,6 +22,29 @@ Each public version should describe:
|
|
|
22
22
|
|
|
23
23
|
## Unreleased
|
|
24
24
|
|
|
25
|
+
## v0.6.0 - Follow the Conversation Through Its Business Actions
|
|
26
|
+
|
|
27
|
+
Planned release date: 2026-09-08.
|
|
28
|
+
|
|
29
|
+
- **One conversation view**: inspect synchronized user messages, intermediate explanations and final replies by turn, then open each account's original execution record.
|
|
30
|
+
- **Multiple accounts in a conversation**: with SDK / DSH 0.4.0, select authorized accounts from the same business system before chatting; the agent chooses the appropriate authorization for each action.
|
|
31
|
+
- **Existing authority stays intact**: identities, approvals and account memory remain separate. Full text is restricted to the Hub administration audit domain and is not broadcast into each account's memory.
|
|
32
|
+
- **Upgrade impact**: migration057 adds three archive tables. Business capability declarations and approval rules do not change. Clients need explicit conversation scope and durable history; follow the upgrade guide.
|
|
33
|
+
- **Verification focus**: recovery in the same runtime after an offline reopening, acknowledgement-loss deduplication, whole-group revocation, visible history gaps and late cancellation responses. A successful business action alone does not prove complete transcript capture.
|
|
34
|
+
- **Related docs**: [v0.6.0 release notes](RELEASE_NOTES_v0.6.0.en.md), [multi-account conversation guide](user-guide/conversations.en.md) and [integration contract](AGENT_CONVERSATION_AUDIT.en.md).
|
|
35
|
+
|
|
36
|
+
## v0.5.1 - Agent Client Management and Bulk Write-Operation Configuration
|
|
37
|
+
|
|
38
|
+
Planned release date: 2026-09-01.
|
|
39
|
+
|
|
40
|
+
- **Agent Client management center**: adds a dedicated console page that summarizes applications with business authorization enabled, available workspaces, Agent Session state, and recent run statistics without creating a second Client, route, or executor resource model.
|
|
41
|
+
- **Session governance**: administrators can filter Agent Sessions by client and state and revoke an individual session. The projection never returns access tokens, refresh tokens, prompts, tool arguments, or business results.
|
|
42
|
+
- **Bulk write-operation configuration**: the route page can select or clear every writable operationId currently declared by the selected tool sources. The stored policy remains an exact operationId list, rejects wildcards, and cannot weaken ACC approval or final business authorization.
|
|
43
|
+
- **Neutral business authorization entry**: the bilingual guides define `agent_authorize_url` as one account- and tenant-neutral entry. The business page still owns login, account switching, and explicit tenant selection, while the business backend derives trusted `principal` and `on_behalf_of` values from the current session. Local `connectionName` only selects a local connection instance.
|
|
44
|
+
- **Database and runtime contracts**: no migration is added, and Agent Client Runtime, Client API, Kernel API, business SDK, Widget, tool-signature, approval, and final-authorization semantics remain unchanged.
|
|
45
|
+
- **Validation**: 612 Core tests, console build and E2E, Client API ecosystem consumers, SDK contracts, Docker Demo, security audit, OSS export, and npm artifact checks.
|
|
46
|
+
- **Related docs**: [RELEASE_NOTES_v0.5.1.en.md](RELEASE_NOTES_v0.5.1.en.md), [Agent Client v1 Integration Guide](AGENT_CLIENT_QUICKSTART.en.md), and [Agent Auth v1](AGENT_AUTH_API.en.md).
|
|
47
|
+
|
|
25
48
|
## v0.5.0 - Revocable Local-Agent Authorization and Governed Local Planning
|
|
26
49
|
|
|
27
50
|
Released on 2026-08-26.
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,29 @@
|
|
|
15
15
|
|
|
16
16
|
## Unreleased
|
|
17
17
|
|
|
18
|
+
## v0.6.0 - 看完整沟通,再追到每次业务操作
|
|
19
|
+
|
|
20
|
+
计划发布日期:2026-09-08。
|
|
21
|
+
|
|
22
|
+
- **完整对话入口**:控制台“任务→会话”可按轮查看客户端已同步的用户输入、中间说明和最终回复,并进入每份授权的原始执行记录。
|
|
23
|
+
- **同一会话,多份授权**:配套 SDK / DSH 0.4.0 后,用户可以先选同一业务系统的 A/B 授权,Agent 按每次操作选择对应权限;Core 保存完整沟通和各自的业务轨迹。
|
|
24
|
+
- **业务权限保持原样**:各授权的业务身份、审批和记忆保持独立。完整正文只在中枢管理审计域可读,不向各账户重复广播混合回复。
|
|
25
|
+
- **升级影响**:新增迁移057的三张归档表;业务侧能力声明和审批规则无需调整。新客户端需要显式选择会话范围,归档需要配套版本及持久历史;详情见下方升级说明。
|
|
26
|
+
- **验证重点**:原会话断网重开后恢复补传、确认回包丢失不重复、撤销任一成员保持阻断、保存失败显示缺口、取消后不恢复已结束操作。单纯业务执行成功不代表对话已完整保存。
|
|
27
|
+
- **相关文档**:[v0.6.0 发布说明](RELEASE_NOTES_v0.6.0.md)、[多账户对话使用指南](user-guide/conversations.md)与[接入契约](AGENT_CONVERSATION_AUDIT.md)。
|
|
28
|
+
|
|
29
|
+
## v0.5.1 - 智能体客户端管理中心与批量写操作配置
|
|
30
|
+
|
|
31
|
+
计划发布日期:2026-09-01。
|
|
32
|
+
|
|
33
|
+
- **智能体客户端管理中心**:新增独立控制台菜单,汇总已启用业务授权的客户端应用、可用工作区、Agent Session 状态与最近运行统计,不创建第二套 Client、路由或执行器资源。
|
|
34
|
+
- **会话治理**:管理员可按客户端和状态查看 Agent Session,并逐个撤销;投影不返回 access token、refresh token、提示词、工具参数或业务结果。
|
|
35
|
+
- **批量写操作配置**:路由页可一次选择或清除当前工具源声明的全部可写 operationId;保存结果仍是精确 operationId 列表,不接受通配符,也不放宽 ACC 审批或业务系统最终授权。
|
|
36
|
+
- **统一业务授权入口**:中英文文档明确 `agent_authorize_url` 是账号与租户中立的统一入口。业务页面继续负责登录、换号与显式租户选择,业务后端从当前会话派生可信 `principal` 与 `on_behalf_of`;本地 `connectionName` 只选择本机连接实例。
|
|
37
|
+
- **数据库与运行契约**:没有新增 migration,也不改变 Agent Client Runtime、Client API、Kernel API、业务 SDK、Widget、工具签名、审批与最终业务授权语义。
|
|
38
|
+
- **验证方式**:Core 612 项单测、控制台构建与 E2E、Client API 生态消费者、SDK 契约、Docker Demo、安全审计、OSS 导出和 npm 制品检查。
|
|
39
|
+
- **相关文档**:[RELEASE_NOTES_v0.5.1.md](RELEASE_NOTES_v0.5.1.md)、[Agent Client v1 接入指南](AGENT_CLIENT_QUICKSTART.md) 与 [Agent Auth v1](AGENT_AUTH_API.md)。
|
|
40
|
+
|
|
18
41
|
## v0.5.0 - 可撤销本地 Agent 授权与受治理本地编排
|
|
19
42
|
|
|
20
43
|
发布日期:2026-08-26。
|
|
@@ -7,7 +7,7 @@ It is not certification, a benchmark, or evidence of production adoption. Passin
|
|
|
7
7
|
## Scope
|
|
8
8
|
|
|
9
9
|
- Target: the open-source BailingHub Docker demo;
|
|
10
|
-
- Stable baseline: `v0.
|
|
10
|
+
- Stable baseline: `v0.6.0`;
|
|
11
11
|
- Data: the bundled demo orders, tickets, refunds, and failure probe;
|
|
12
12
|
- Expected time: about 20 minutes after images and dependencies are available;
|
|
13
13
|
- Not required: a real model key, production API, production credential, or real business data.
|
|
@@ -32,7 +32,7 @@ curl -fsSL https://www.bailinghub.com/install.sh | sh
|
|
|
32
32
|
cd "$HOME/bailinghub"
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
The installer pulls the official `v0.
|
|
35
|
+
The installer pulls the official `v0.6.0` images by default, generates random tokens and an admin password, starts the services, and runs the smoke test. The initial administrator is created only when the administrator table is empty; restarting, upgrading, recreating containers, or reinstalling against the same persistent database does not overwrite a changed password. The optional `/metrics` endpoint remains disabled and does not affect core validation. Keep the reported version, install mode, elapsed time, and the commands printed under `常用命令`, but never include passwords or tokens in your report. After Docker is installed, the current non-root login usually still needs the printed `sudo docker compose ...` commands; Docker group membership may not take effect until the next login.
|
|
36
36
|
|
|
37
37
|
If the default directory is already in use, choose a new empty directory instead of overwriting an existing deployment:
|
|
38
38
|
|
|
@@ -46,7 +46,7 @@ cd "$HOME/bailinghub-validation"
|
|
|
46
46
|
### Path B: local source reproduction
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
git clone --depth 1 --branch v0.
|
|
49
|
+
git clone --depth 1 --branch v0.6.0 https://github.com/bailinghub/bailinghub.git
|
|
50
50
|
cd bailinghub
|
|
51
51
|
git rev-parse HEAD
|
|
52
52
|
export BAILING_TOKEN="$(openssl rand -hex 32)"
|
|
@@ -167,7 +167,7 @@ After the core task passes, you may continue with:
|
|
|
167
167
|
- [Trusted rich rendering and chat reliability](RELEASE_NOTES_v0.1.15.en.md).
|
|
168
168
|
- [Bounded tool runtime and resilient semantic retrieval](RELEASE_NOTES_v0.1.16.en.md).
|
|
169
169
|
- [Composable Core and Kernel Host API v1](RELEASE_NOTES_v0.3.0.en.md).
|
|
170
|
-
- [Current stable release notes](RELEASE_NOTES_v0.
|
|
170
|
+
- [Current stable release notes](RELEASE_NOTES_v0.6.0.en.md).
|
|
171
171
|
|
|
172
172
|
Select the relevant track in the same Issue form and disclose whether you received direct maintainer assistance.
|
|
173
173
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
## 验证范围
|
|
8
8
|
|
|
9
9
|
- 验证对象:BailingHub 开源版 Docker demo;
|
|
10
|
-
- 稳定基线:`v0.
|
|
10
|
+
- 稳定基线:`v0.6.0`;
|
|
11
11
|
- 数据范围:仓库自带的 demo 订单、工单、退款和故障工具;
|
|
12
12
|
- 预计用时:镜像和依赖下载完成后约 20 分钟;
|
|
13
13
|
- 不需要:真实大模型 Key、生产 API、生产凭据或真实业务数据。
|
|
@@ -32,7 +32,7 @@ curl -fsSL https://www.bailinghub.com/install.sh | sh
|
|
|
32
32
|
cd "$HOME/bailinghub"
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
脚本默认拉取 `v0.
|
|
35
|
+
脚本默认拉取 `v0.6.0` 官方镜像,生成随机 Token 与后台密码,启动服务并自动运行基础体检。首次管理员只在数据库管理员表为空时创建;对同一持久化数据库进行重启、升级、容器重建或重新安装,不会覆盖已经修改的管理员密码。可选 `/metrics` 端点默认关闭,不影响基础验证。请保留终端输出中的版本、安装模式、耗时和“常用命令”,但不要把密码或 Token 写入反馈。新安装 Docker 后,当前非 root 会话通常仍需使用脚本打印的 `sudo docker compose ...` 命令;重新登录后 Docker 组权限才可能生效。
|
|
36
36
|
|
|
37
37
|
如果默认目录已被占用,请使用一个新的空目录,不要覆盖现有部署:
|
|
38
38
|
|
|
@@ -46,7 +46,7 @@ cd "$HOME/bailinghub-validation"
|
|
|
46
46
|
### 路径 B:本地源码复现
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
git clone --depth 1 --branch v0.
|
|
49
|
+
git clone --depth 1 --branch v0.6.0 https://github.com/bailinghub/bailinghub.git
|
|
50
50
|
cd bailinghub
|
|
51
51
|
git rev-parse HEAD
|
|
52
52
|
export BAILING_TOKEN="$(openssl rand -hex 32)"
|
|
@@ -167,7 +167,7 @@ docker compose exec -T bailinghub npm run demo:e2e
|
|
|
167
167
|
- [可信富内容渲染与聊天可靠性](RELEASE_NOTES_v0.1.15.md)。
|
|
168
168
|
- [工具运行时收敛与语义检索韧性](RELEASE_NOTES_v0.1.16.md)。
|
|
169
169
|
- [可组合 Core 与 Kernel Host API v1](RELEASE_NOTES_v0.3.0.md)。
|
|
170
|
-
- [当前稳定版发布说明](RELEASE_NOTES_v0.
|
|
170
|
+
- [当前稳定版发布说明](RELEASE_NOTES_v0.6.0.md)。
|
|
171
171
|
|
|
172
172
|
扩展验证请在同一 Issue 模板中选择对应路径,并说明是否获得过维护者的直接帮助。
|
|
173
173
|
|
package/docs/README.en.md
CHANGED
|
@@ -6,6 +6,7 @@ This directory contains public documentation for the open-source BailingHub proj
|
|
|
6
6
|
|
|
7
7
|
| Document | Purpose |
|
|
8
8
|
|---|---|
|
|
9
|
+
| [user-guide/conversations.en.md](user-guide/conversations.en.md) | Multi-account conversations, full-text review and offline recovery for users. |
|
|
9
10
|
| [QUICKSTART.en.md](QUICKSTART.en.md) | Install BailingHub, run the Docker demo, create the first route, and connect the first business tool. |
|
|
10
11
|
| [DEMO.en.md](DEMO.en.md) | Docker demo walkthrough: hub, MySQL, demo business system, tool provider, audit, and trace. |
|
|
11
12
|
| [INDEPENDENT_VALIDATION.en.md](INDEPENDENT_VALIDATION.en.md) | Independent Docker demo task with objective pass criteria and a standard report path. |
|
|
@@ -16,6 +17,8 @@ This directory contains public documentation for the open-source BailingHub proj
|
|
|
16
17
|
| [AGENT_AUTH_API.md](AGENT_AUTH_API.md) | Chinese Agent Auth v1 protocol. |
|
|
17
18
|
| [AGENT_CLIENT_RUNTIME_API.en.md](AGENT_CLIENT_RUNTIME_API.en.md) | Agent Client Runtime v1 workspaces, turns, tools, and completion contract. |
|
|
18
19
|
| [AGENT_CLIENT_RUNTIME_API.md](AGENT_CLIENT_RUNTIME_API.md) | Chinese Agent Client Runtime v1 contract. |
|
|
20
|
+
| [AGENT_CONVERSATION_AUDIT.en.md](AGENT_CONVERSATION_AUDIT.en.md) | Complete visible conversation audit, member confirmation, run ownership and admin pagination. |
|
|
21
|
+
| [AGENT_CONVERSATION_AUDIT.md](AGENT_CONVERSATION_AUDIT.md) | Chinese complete conversation audit protocol. |
|
|
19
22
|
| [user-guide/README.en.md](user-guide/README.en.md) | User and product-owner guide: business goals, console concepts, and scenario-based setup. |
|
|
20
23
|
| [CONTRACT.en.md](CONTRACT.en.md) | Stable HTTP and wire contract between business systems and the hub. |
|
|
21
24
|
| [INTEGRATION.en.md](INTEGRATION.en.md) | Third-party integration guide for tools, signatures, authorization, and callback handling. |
|
|
@@ -107,6 +110,10 @@ This directory contains public documentation for the open-source BailingHub proj
|
|
|
107
110
|
| [RELEASE_NOTES_v0.3.4.md](RELEASE_NOTES_v0.3.4.md) | Chinese `v0.3.4` release notes. |
|
|
108
111
|
| [RELEASE_NOTES_v0.5.0.en.md](RELEASE_NOTES_v0.5.0.en.md) | `v0.5.0` revocable local-Agent authorization and governed local planning. |
|
|
109
112
|
| [RELEASE_NOTES_v0.5.0.md](RELEASE_NOTES_v0.5.0.md) | Chinese `v0.5.0` release notes. |
|
|
113
|
+
| [RELEASE_NOTES_v0.5.1.en.md](RELEASE_NOTES_v0.5.1.en.md) | `v0.5.1` Agent Client management center and bulk write-operation configuration. |
|
|
114
|
+
| [RELEASE_NOTES_v0.6.0.en.md](RELEASE_NOTES_v0.6.0.en.md) | `v0.6.0`: follow a conversation through its business actions, with compatible multi-account clients. |
|
|
115
|
+
| [RELEASE_NOTES_v0.6.0.md](RELEASE_NOTES_v0.6.0.md) | Chinese `v0.6.0` release notes and upgrade guide. |
|
|
116
|
+
| [RELEASE_NOTES_v0.5.1.md](RELEASE_NOTES_v0.5.1.md) | Chinese `v0.5.1` release notes. |
|
|
110
117
|
| [RELEASE_NOTES_v0.1.0.en.md](RELEASE_NOTES_v0.1.0.en.md) | First public release notes. |
|
|
111
118
|
| [CHANGELOG.en.md](CHANGELOG.en.md) | Public changelog format and current release summary. |
|
|
112
119
|
| [COMPATIBILITY.en.md](COMPATIBILITY.en.md) | Versioning, compatibility, migration, and schema discipline. |
|