bailinghub 0.6.1 → 0.8.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 +8 -7
- package/README.md +7 -7
- package/docker-compose.images.yml +2 -2
- package/docs/AGENT_AUTH_API.en.md +112 -1
- package/docs/AGENT_AUTH_API.md +99 -1
- package/docs/AGENT_CLIENT_QUICKSTART.en.md +32 -5
- package/docs/AGENT_CLIENT_QUICKSTART.md +27 -4
- package/docs/AGENT_CLIENT_RUNTIME_API.en.md +46 -0
- package/docs/AGENT_CLIENT_RUNTIME_API.md +38 -1
- package/docs/AGENT_CONVERSATION_AUDIT.en.md +109 -4
- package/docs/AGENT_CONVERSATION_AUDIT.md +84 -3
- package/docs/AGENT_SUBJECT_DISPLAY.en.md +95 -0
- package/docs/AGENT_SUBJECT_DISPLAY.md +95 -0
- package/docs/AGENT_SYSTEM_INFO.en.md +99 -0
- package/docs/AGENT_SYSTEM_INFO.md +97 -0
- package/docs/AGENT_TASK_CONTROL.en.md +25 -0
- package/docs/AGENT_TASK_CONTROL.md +94 -0
- package/docs/AGENT_TASK_CONTROL_FOUNDATION.md +134 -0
- package/docs/CHANGELOG.en.md +24 -1
- package/docs/CHANGELOG.md +24 -1
- package/docs/COMPATIBILITY.en.md +2 -0
- package/docs/CONTRACT.en.md +2 -0
- package/docs/CONTRACT.md +2 -0
- package/docs/GENERATED_ARTIFACTS.en.md +46 -0
- package/docs/GENERATED_ARTIFACTS.md +108 -0
- package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
- package/docs/INDEPENDENT_VALIDATION.md +4 -4
- package/docs/INVOCATION_RECEIPTS.md +111 -0
- package/docs/LOCAL_AGENT_SETUP.en.md +116 -0
- package/docs/LOCAL_AGENT_SETUP.md +116 -0
- package/docs/README.en.md +9 -0
- package/docs/README.md +9 -0
- package/docs/RELEASE_NOTES_NEXT.en.md +3 -0
- package/docs/RELEASE_NOTES_NEXT.md +3 -0
- package/docs/RELEASE_NOTES_v0.7.0.en.md +116 -0
- package/docs/RELEASE_NOTES_v0.7.0.md +116 -0
- package/docs/RELEASE_NOTES_v0.8.0.en.md +40 -0
- package/docs/RELEASE_NOTES_v0.8.0.md +62 -0
- package/docs/SDK.en.md +31 -0
- package/docs/TOOL_RATE_LIMITS.md +50 -0
- package/docs/UPGRADE_v0.8.0.en.md +71 -0
- package/docs/UPGRADE_v0.8.0.md +73 -0
- package/docs/user-guide/conversations.en.md +4 -2
- package/docs/user-guide/conversations.md +4 -2
- package/docs//345/205/274/345/256/271/346/200/247/344/270/216/345/215/207/347/272/247.md +2 -0
- package/package.json +1 -1
- package/schemas/config/route.schema.json +16 -2
- package/schemas/config/tool-provider.schema.json +2 -1
- package/scripts/check-doc-links.mjs +2 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-release-consistency.test.mjs +2 -2
- package/scripts/e2e-console.mjs +32 -2
- package/scripts/install.sh +1 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +2 -0
- package/scripts/sdk-agent-auth-lifecycle-check.mjs +178 -0
- package/scripts/sdk-runtime-test.mjs +5 -2
- package/scripts/verify-github-repo.mjs +2 -0
- package/sdk/php/README.md +29 -0
- package/sdk/php/src/AgentAuth.php +100 -4
- package/sdk/php/src/HubClient.php +2 -1
- package/sdk/php7/README.md +31 -0
- package/sdk/php7/src/AgentAuth.php +99 -4
- package/sdk/php7/src/HubClient.php +2 -1
- package/sql/058_agent_conversation_member_bindings.sql +9 -0
- package/sql/059_agent_subject_display.sql +5 -0
- package/sql/060_agent_artifacts.sql +11 -0
- package/sql/061_tool_rate_limit_policies.sql +3 -0
- package/sql/062_agent_task_control.sql +92 -0
- package/sql/README.en.md +15 -0
- package/sql/README.md +25 -0
- package/src/adapters/storage/object-storage.ts +15 -3
- package/src/adapters/storage/oss-signature.test.ts +40 -0
- package/src/adapters/storage/oss-signature.ts +21 -0
- package/src/app/agent-artifacts.test.ts +165 -0
- package/src/app/agent-artifacts.ts +85 -0
- package/src/app/agent-client-runtime.test.ts +76 -1
- package/src/app/agent-client-runtime.ts +13 -0
- package/src/app/agent-conversation-audit.ts +20 -0
- package/src/app/agent-invocation-snapshot.ts +35 -0
- package/src/app/agent-system-info.ts +41 -0
- package/src/app/agent-task-control.ts +187 -0
- package/src/app/agent-task-runtime.ts +68 -0
- package/src/app/agent-tool-invocations.test.ts +329 -1
- package/src/app/agent-tool-invocations.ts +239 -14
- package/src/app/agent-tool-job.test.ts +11 -1
- package/src/app/agent-tool-job.ts +8 -1
- package/src/app/builtin-tools.ts +4 -0
- package/src/app/oss-edition.ts +1 -0
- package/src/app/tool-approvals.ts +4 -0
- package/src/app/tool-assembly.ts +5 -0
- package/src/core/config/agent-setup.ts +37 -0
- package/src/core/config/artifact-config.ts +15 -0
- package/src/core/config/client-agent-setup.ts +25 -0
- package/src/core/config/config-codec.ts +3 -1
- package/src/core/config/config-models.ts +11 -1
- package/src/core/config/config-schema.test.ts +11 -0
- package/src/core/config/route-config.test.ts +28 -0
- package/src/core/config/route-config.ts +44 -4
- package/src/core/contracts/agent-subject-display.test.ts +19 -0
- package/src/core/contracts/agent-subject-display.ts +36 -0
- package/src/core/contracts/tool-rate-limits.test.ts +59 -0
- package/src/core/contracts/tool-rate-limits.ts +48 -0
- package/src/core/contracts/tools.ts +122 -43
- package/src/core/contracts/types.ts +18 -1
- package/src/core/runtime/agent-conversation-audit.test.ts +19 -1
- package/src/core/runtime/agent-conversation-audit.ts +39 -0
- package/src/core/runtime/agent-task-control.test.ts +114 -0
- package/src/core/runtime/agent-task-control.ts +227 -0
- package/src/infrastructure/config/config-agent-artifact-repository.ts +32 -0
- package/src/infrastructure/config/config-agent-auth-business-sessions.test.ts +120 -0
- package/src/infrastructure/config/config-agent-auth-lifecycle-race.test.ts +152 -0
- package/src/infrastructure/config/config-agent-auth-repository.test.ts +2 -0
- package/src/infrastructure/config/config-agent-auth-repository.ts +208 -18
- package/src/infrastructure/config/config-agent-client-runtime-repository.ts +7 -1
- package/src/infrastructure/config/config-agent-conversation-audit-cross-binding.test.ts +120 -0
- package/src/infrastructure/config/config-agent-conversation-audit-repository.ts +117 -23
- package/src/infrastructure/config/config-agent-subject-display.test.ts +103 -0
- package/src/infrastructure/config/config-agent-task-control-journal-mysql.test.ts +315 -0
- package/src/infrastructure/config/config-agent-task-control-mysql.test.ts +331 -0
- package/src/infrastructure/config/config-agent-task-control-repository.ts +640 -0
- package/src/infrastructure/config/config-client-repository.ts +21 -0
- package/src/infrastructure/config/config-rate-limit-ledger.integration.test.ts +52 -0
- package/src/infrastructure/config/config-rate-limit-ledger.ts +48 -0
- package/src/infrastructure/config/config-route-agent-setup.test.ts +59 -0
- package/src/infrastructure/config/config-route-repository.ts +24 -0
- package/src/infrastructure/config/config-storage-bucket-repository.ts +2 -2
- package/src/infrastructure/config/config-tool-provider-repository.ts +4 -4
- package/src/infrastructure/config/configstore.ts +16 -4
- package/src/infrastructure/schema/core-schema-migrator.test.ts +90 -0
- package/src/routes/admin-access.ts +37 -0
- package/src/routes/admin-agent-clients.ts +11 -0
- package/src/routes/admin-agent-setup.test.ts +130 -0
- package/src/routes/admin-agent-setup.ts +68 -0
- package/src/routes/admin-agent-tasks.ts +32 -0
- package/src/routes/admin-client-agent-setup.test.ts +93 -0
- package/src/routes/admin-dispatch-config.ts +2 -0
- package/src/routes/admin-tool-providers.test.ts +22 -0
- package/src/routes/admin-tool-providers.ts +9 -1
- package/src/routes/admin.ts +3 -0
- package/src/routes/agent-api.test.ts +76 -0
- package/src/routes/agent-api.ts +49 -1
- package/src/routes/agent-artifacts.ts +29 -0
- package/src/routes/agent-auth-lifecycle-http.test.ts +177 -0
- package/src/routes/agent-auth-lifecycle.test.ts +193 -0
- package/src/routes/agent-auth.test.ts +1 -1
- package/src/routes/agent-auth.ts +206 -16
- package/src/routes/agent-conversation-audit-cross-binding-http.test.ts +122 -0
- package/src/routes/agent-conversation-audit.ts +8 -2
- package/src/routes/agent-subject-display-http.test.ts +145 -0
- package/src/routes/agent-system-info.test.ts +132 -0
- package/src/routes/agent-task-control-http-mysql.test.ts +246 -0
- package/src/routes/private.ts +1 -0
- package/src/routes/run.ts +2 -1
- package/src/test-support/agent-auth-business-query-fixture.ts +43 -0
- package/src/test-support/agent-auth-lifecycle-fixture.ts +288 -0
- package/src/test-support/agent-conversation-audit-fixture.ts +30 -6
- package/src/test-support/agent-conversation-audit-http-fixture.ts +84 -0
- package/src/test-support/agent-task-control-mysql-fixture.ts +75 -0
- package/web/connect/bailing-connect-php.tgz +0 -0
- package/web/connect/bailing-connect-php7.tgz +0 -0
- package/web/console/assets/{Accounts-Ca_VnSu9.js → Accounts-BRCR3O0P.js} +1 -1
- package/web/console/assets/AgentClients-Bf7sUUs_.js +1 -0
- package/web/console/assets/AgentClients-i52AI6YV.css +1 -0
- package/web/console/assets/AgentTasks--bqL_QKg.js +2 -0
- package/web/console/assets/AgentTasks-C8ox3TyS.css +1 -0
- package/web/console/assets/{Approvals-CMvPWacY.js → Approvals-BIbZvInm.js} +1 -1
- package/web/console/assets/{Audit-CIRqOCnL.js → Audit-KyPSmBdZ.js} +1 -1
- package/web/console/assets/{BrandLockup-BrytmTTH.js → BrandLockup-Sv5DU2G6.js} +1 -1
- package/web/console/assets/{Channels-CApxH2TB.js → Channels-B9n4fbxg.js} +1 -1
- package/web/console/assets/{ChatEntries-CJon3bWJ.js → ChatEntries-xsOCUXi_.js} +1 -1
- package/web/console/assets/Clients-CI3DBDHf.js +3 -0
- package/web/console/assets/Clients-CSHIsaWU.css +1 -0
- package/web/console/assets/{Cost-BbhlQFP8.js → Cost-JgNXQPlN.js} +1 -1
- package/web/console/assets/{Credentials-kqr1W0K7.js → Credentials-B5UUUdt0.js} +1 -1
- package/web/console/assets/{Diagnostics-Kljt9XTH.js → Diagnostics-BMGciWQb.js} +1 -1
- package/web/console/assets/{Executors-DnsB-Xz4.js → Executors-CRbboOCZ.js} +1 -1
- package/web/console/assets/{Kb-DLZSAFWP.js → Kb-CgLNGjRp.js} +1 -1
- package/web/console/assets/{Login-DiTjPWmN.js → Login-C52JmXzx.js} +1 -1
- package/web/console/assets/{Projects-CXcVCgCD.js → Projects-CDOvHPVS.js} +1 -1
- package/web/console/assets/Routes-DkMIjMQA.css +1 -0
- package/web/console/assets/Routes-X9vHLpKW.js +124 -0
- package/web/console/assets/Runs-CvGTV8I-.css +1 -0
- package/web/console/assets/Runs-DYNDXsqk.js +3 -0
- package/web/console/assets/{Setup-FqoCKmfZ.js → Setup-B91P6i1x.js} +1 -1
- package/web/console/assets/Shell-Bj6C8Hgo.css +1 -0
- package/web/console/assets/Shell-BsRa7bQQ.js +1 -0
- package/web/console/assets/StorageBuckets-CVgpZRWY.css +1 -0
- package/web/console/assets/StorageBuckets-DkuDM0oX.js +1 -0
- package/web/console/assets/{SystemSettings-gTQAazu7.js → SystemSettings-B7Mqj3k1.js} +1 -1
- package/web/console/assets/{SystemStatus-DAmUUNqO.js → SystemStatus-Db93b6dc.js} +1 -1
- package/web/console/assets/{Targets-CZmDcjsE.js → Targets-CuuIYeZO.js} +1 -1
- package/web/console/assets/Tools-CHiqz9XZ.js +2 -0
- package/web/console/assets/Tools-DU8ei6sd.css +1 -0
- package/web/console/assets/index-UGvfF3Xr.js +2 -0
- package/web/console/assets/{request-r7GHVJzw.js → request-DeGya810.js} +1 -1
- package/web/console/assets/{schema-BVn_hB7M.js → schema-BqlqLw1R.js} +1 -1
- package/web/console/index.html +1 -1
- package/web-admin/scripts/agent-task-control-smoke.mjs +120 -0
- package/web-admin/scripts/subject-display-ui.mjs +78 -0
- package/web-admin/src/components/AgentSetupPanel.vue +275 -0
- package/web-admin/src/components/ClientConversations.vue +21 -4
- package/web-admin/src/components/ToolRateLimitEditor.vue +28 -0
- package/web-admin/src/components/conversation-audit.ts +20 -0
- package/web-admin/src/layout/Shell.vue +1 -1
- package/web-admin/src/pages/AgentClients.vue +99 -23
- package/web-admin/src/pages/AgentTasks.vue +281 -0
- package/web-admin/src/pages/Clients.vue +4 -1
- package/web-admin/src/pages/Routes.vue +10 -1
- package/web-admin/src/pages/StorageBuckets.vue +6 -6
- package/web-admin/src/pages/Tools.vue +53 -4
- package/web-admin/src/router.ts +2 -0
- package/web-admin/tests/conversation-audit.fixture.mjs +13 -10
- package/web-admin/tests/conversation-audit.test.mjs +63 -1
- package/web/console/assets/AgentClients-BPIvlLYY.js +0 -1
- package/web/console/assets/AgentClients-DsWADpzr.css +0 -1
- package/web/console/assets/Clients-BSA1rlTB.js +0 -3
- package/web/console/assets/Clients-CNIVs7Qn.css +0 -1
- package/web/console/assets/Routes-CXGl9SMM.css +0 -1
- package/web/console/assets/Routes-DN9_d9Po.js +0 -124
- package/web/console/assets/Runs-Cwbe6thL.js +0 -3
- package/web/console/assets/Runs-D8UmjP5G.css +0 -1
- package/web/console/assets/Shell-BEqpONiy.js +0 -1
- package/web/console/assets/Shell-D9Uw-fsa.css +0 -1
- package/web/console/assets/StorageBuckets-CkORbYXY.js +0 -1
- package/web/console/assets/StorageBuckets-GnXnVvF0.css +0 -1
- package/web/console/assets/Tools-A20oaMaQ.css +0 -1
- package/web/console/assets/Tools-CIHInlHL.js +0 -2
- package/web/console/assets/index-BkLbd7Cc.js +0 -2
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# 本地智能体附件空间:让生成结果进入业务流程
|
|
2
|
+
|
|
3
|
+
配套版本:Core 0.8.0 / SDK 0.6.0 / DSH 0.6.0。新能力需部署方升级并按宿主契约接入;业务权限、审批和原身份约束保持。
|
|
4
|
+
|
|
5
|
+
## 解决什么问题
|
|
6
|
+
|
|
7
|
+
本地智能体已经能生成图片,但生成结果往往停留在客户端目录中。需要交给业务系统使用时,用户还要下载、上传,再把地址贴回对话。
|
|
8
|
+
|
|
9
|
+
附件空间连接“本地生成结果”和“业务可用地址”:宿主登记当前会话获准使用的图片,智能体按引用选择附件和目标授权,中枢保存图片并返回 URL。智能体随后可把地址交给已经接入的业务工具,无需用户手动搬运。
|
|
10
|
+
|
|
11
|
+
首期交付会话级图片登记、受控上传和原上传结果恢复,支持 PNG、JPEG、WebP。名称中的“附件”描述通用用途,不表示本期已支持 PDF、Word、视频或所有文件格式。
|
|
12
|
+
|
|
13
|
+
| 场景 | 附件空间解决的步骤 | 业务工具负责的步骤 |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| 制作活动海报 | 保存海报并取得可用地址 | 把地址设为活动页或内容封面 |
|
|
16
|
+
| 生成经营图表 | 保存 PNG 图表并取得可用地址 | 将图表关联到报告或运营页面 |
|
|
17
|
+
| 维护商城商品 | 保存多张商品展示图并逐项返回结果 | 设置主图、轮播图或其他图片字段 |
|
|
18
|
+
|
|
19
|
+
这些业务动作需要对应系统已经提供接收图片 URL 的能力,不是中枢内置的业务接口。图片生成服务仍由客户端选用。
|
|
20
|
+
|
|
21
|
+
## 上传完成后发生什么
|
|
22
|
+
|
|
23
|
+
流程为:生成图片 → 登记会话附件 → 上传到所选授权对应的存储 → 取得 ready URL。到这里附件上传已完成,后续业务操作可以直接使用这些 URL。
|
|
24
|
+
|
|
25
|
+
正常成功后不需要为了每次使用而重复查询或上传。只有上传结果不确定、重新打开会话需要恢复回执时,才查询原上传记录。批量上传返回逐项结果,已成功项复用原地址,失败项按原记录恢复。
|
|
26
|
+
|
|
27
|
+
业务工具调用是独立动作,沿用原授权和审批规则,是否完成以业务回执为准。例如设置完整图片列表前先确认所需图片全部 ready,并保留用户未要求删除的已有图片。
|
|
28
|
+
|
|
29
|
+
## 管理员在哪里开启
|
|
30
|
+
|
|
31
|
+
1. 在“媒体存储”登记普通 COS 或 OSS:桶名、地域、凭据、公开访问地址、写入前缀。OSS 使用 V4 签名,地域如 `cn-shanghai`;COS 如 `ap-shanghai`。自定义 endpoint 留空即可;填写时须为完整桶访问主机,包含桶名。
|
|
32
|
+
2. 打开“智能体客户端 → 配置接入 → 工具与审批”,选择工作空间,在“生成图片上传”启用并选择已登记存储。
|
|
33
|
+
3. 客户端安装配套 SDK/DSH,接入生成产物目录与持久恢复记录。业务工具自身仍在原工具源、scope、写操作清单和审批规则中配置。
|
|
34
|
+
|
|
35
|
+
也支持显式登记服务器本地存储。用于本能力时填写能访问该实例 `/uploads` 的完整公开地址;不会因桶缺失或停用自动换到其他存储。
|
|
36
|
+
|
|
37
|
+
文件保留由私有化部署方管理,本功能不设置到期时间,不随会话结束或授权撤销清理文件。没有额外“永久保存”判定。第一期用于公开展示图片;上传对象采用公开读取,不要用来上传私有文档。
|
|
38
|
+
|
|
39
|
+
工作空间配置示例:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"agent_client": {
|
|
44
|
+
"enabled": true,
|
|
45
|
+
"artifact_upload": {
|
|
46
|
+
"enabled": true,
|
|
47
|
+
"bucket": "agent-attachments",
|
|
48
|
+
"max_bytes": 6291456,
|
|
49
|
+
"allowed_mimes": ["image/png", "image/jpeg", "image/webp"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
默认关闭。第一期 PNG/JPEG/WebP,单图不超过 6 MiB,客户端每批最多 8 张,可配置更小上限。实际文件头、摘要、字节数与声明不符会拒绝;不接收路径、任意远端 URL 或模型上下文中的 base64 文件。
|
|
56
|
+
|
|
57
|
+
## 接口与恢复契约
|
|
58
|
+
|
|
59
|
+
认证使用原 Agent Session Bearer。每次请求重新校验接入方、会话、workspace 与 audience;SDK/DSH 进一步固定并整组验证用户显式选定的授权,任何原成员失效都不切换默认或降级子集。
|
|
60
|
+
|
|
61
|
+
- `POST /agent-api/v1/workspaces/{workspace}/artifacts/{upload_id}`:原始图片字节;`Content-Type` 为 MIME。`x-bailing-artifact` 是下列 JSON 的 UTF-8 base64url 编码(只编码小型元数据,文件不编码进正文)。
|
|
62
|
+
- `GET` 同一路径:查询原上传结果。上传 ID 为 64 位小写十六进制。查询不创建业务 run,不执行业务操作。
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"name": "campaign-banner.png",
|
|
67
|
+
"mime": "image/png",
|
|
68
|
+
"bytes": 12345,
|
|
69
|
+
"sha256": "<64位文件摘要>",
|
|
70
|
+
"client_conversation_id": "<原会话关联>",
|
|
71
|
+
"client_turn_id": "<原轮次关联>"
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
可附 `run_id`,必须属于同一原 Session、workspace、会话和轮次。没有业务 run 时可直接上传,以会话/轮次关联记录,上传不会向其他系统广播正文或创建业务 run。
|
|
76
|
+
|
|
77
|
+
`artifact_run_turn_mismatch` 是严格限定的拒绝原因:Core 已确认该 run 属于同一原 Agent Session、接入方、workspace 和会话,且 run 的轮次有效,但与上传轮次不同。此请求在上传记录预留和文件存储之前被拒绝;错误回执不会返回其他轮次的标识或正文。缺失 run、身份/路由/会话不符或旧 run 缺少有效轮次,仍返回 `artifact_run_mismatch`。
|
|
78
|
+
|
|
79
|
+
配套 DSH 仅在收到这个精确错误、查询原 upload_id 明确不存在、原身份和文件仍有效时,才持久保存纠正记录:保留原上传 ID、内容、目标、会话与轮次,移除被确认属于另一轮的可选 run 关联,再补传同一上传。原本地记录仍保留。已有 ready/pending 回执、网络结果不明、泛化 `artifact_run_mismatch` 或恢复记录损坏均不能触发该纠正;上传成功不代表业务动作已执行。旧 SDK 未识别新错误时应保持阻断,升级配套候选后再恢复。
|
|
80
|
+
|
|
81
|
+
返回 `schema_version=bailing.agent-artifact.v1`、原标识/元数据、`visibility=public`、`state=ready|pending`。ready 包含 URL 与 `next_action=use_url`;pending 为 `retry_same_upload`。资源记录不返回桶配置、密钥或服务端诊断正文。
|
|
82
|
+
|
|
83
|
+
同一 Session 的同一 upload_id 固定元数据、内容与存储目标。相同请求重放返回原记录;更换内容或目标返回冲突。网络回包丢失先 GET;ready 直接使用原 URL,pending/未写入才补传原文件。若文件已保存但数据库确认失败,补传可能再次 PUT 同一对象键和相同字节,不生成另一条图片引用;若桶启用版本管理,可能留下存储版本,这是存储层行为。
|
|
84
|
+
|
|
85
|
+
| 错误 | 下一步 |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| artifact_upload_pending / 网络中断 | 查询原 upload_id;必要时补传同一文件到原授权 |
|
|
88
|
+
| artifact_content_mismatch / artifact_type_not_allowed / artifact_too_large | 修正文件或配置;不要把无效数据当成功 |
|
|
89
|
+
| artifact_conflict / artifact_storage_changed | 保留原记录,核对原文件或存储配置,不自动换桶 |
|
|
90
|
+
| artifact_run_turn_mismatch | 使用配套 DSH 的原记录纠正流程;不改文件名、不换授权或新建上传 ID |
|
|
91
|
+
| artifact_run_mismatch | 原执行关联无法确认;保持阻断,不根据错误猜测图片来源或移除关联 |
|
|
92
|
+
| artifact_upload_disabled / artifact_storage_unavailable | 在上述集中入口检查开关与存储 |
|
|
93
|
+
| artifact_unsupported | 安装配套版本;已有业务工具流程不受影响 |
|
|
94
|
+
| 授权失效 | 阻断本会话整组;不换授权重试 |
|
|
95
|
+
|
|
96
|
+
## 升级边界
|
|
97
|
+
|
|
98
|
+
新增 `sql/060_agent_artifacts.sql`,只增加图片上传记录表;工作空间开关保存在既有 agent_client JSON 中。自用实例部署时按原迁移流程应用 060。商业 Host 须单独评估配置仓储、租户迁移清单与版本 pin;旧宿主缺少可选 agentArtifacts 仓储时明确 unsupported,不自动部署或迁移其他环境。
|
|
99
|
+
|
|
100
|
+
商城等业务后端如果已经接收图片 URL,无须为这条链路改变能力声明或审批规则。生成文件的识别、读取与目录持久化由客户端宿主负责,不能假定远端中枢能读取客户端电脑的路径。其他 MCP 宿主/执行器需要各自适配,不因 SDK 新增接口自动获得本地文件权限。
|
|
101
|
+
|
|
102
|
+
## 与附件上传分开跟踪的已知问题
|
|
103
|
+
|
|
104
|
+
本次配套候选已补齐[工具限额配置与原调用恢复](TOOL_RATE_LIMITS.md):按原时间窗口计数,支持继承、自定义或关闭中枢单工具限额;可重试的出站前拒绝保留原参数。恢复仍使用原 invocation,结果不确定的写操作不重发,旧调用丢失的参数也不会被猜补。这不改变 ready 附件的 URL。
|
|
105
|
+
|
|
106
|
+
DSH 的附件列表源错误目前也可能被通用分类简化为 unknown_failure;上传逐项回执不受该提示问题影响。对应候选仍按这两类结果分别验收,不承诺任意业务批量任务自动完成。
|
|
107
|
+
|
|
108
|
+
OSS V4 按[官方签名说明](https://www.alibabacloud.com/help/en/oss/developer-reference/recommend-to-use-signature-version-4)实现,并与官方 ali-oss 6.23.0 的合成签名向量交叉核验。真实桶连通性在部署方配置存储后验收。
|
|
@@ -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.8.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.8.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.8.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.8.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.8.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.8.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.8.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.8.0.md)。
|
|
171
171
|
|
|
172
172
|
扩展验证请在同一 Issue 模板中选择对应路径,并说明是否获得过维护者的直接帮助。
|
|
173
173
|
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# 原调用只读回执 / Read-only invocation receipts
|
|
2
|
+
|
|
3
|
+
## 中文使用说明
|
|
4
|
+
|
|
5
|
+
配套版本:Core 0.8.0 / SDK 0.6.0 / DSH 0.6.0。新能力需部署方升级并按宿主契约接入;业务权限、审批和原身份约束保持。
|
|
6
|
+
|
|
7
|
+
比如,智能体为商城商品提交了上架请求,用户已批准,但客户端还没有继续执行。此时“看看进度”应只显示“已批准,尚未执行”。另一个常见场景是修改商品后连接中断,智能体需要查看原记录,判断中枢是否已经收到了结果。
|
|
8
|
+
|
|
9
|
+
本接口只查看原调用的结果、当前审批和执行日志。查询不执行上架、不消耗审批,也不改变原调用状态。`resume` 仍可能继续原操作,不能用来替代只读查询。回执中的 `business_operation_performed: false` 只表示这次查询没有执行业务,不表示原操作从未执行。
|
|
10
|
+
|
|
11
|
+
调用方必须保留原调用 ID 与原授权,查询时仍需通过当前权限校验。中枢全局暂停期间可以查询;授权撤销后不能换另一把授权读取。网络临时故障可以重试同一次查询;原记录找不到或结果仍未知时,应保留原 ID 核对,不能重新创建一次业务操作。
|
|
12
|
+
|
|
13
|
+
这一片无需数据库迁移,需使用配套 Core 和 SDK 候选。它提供后续任务视图需要的查询基础;任务累计预算、任务暂停按钮和 DSH 模型工具另行接入。下面给出具体请求、返回字段与兼容规则。
|
|
14
|
+
|
|
15
|
+
## Contract overview
|
|
16
|
+
|
|
17
|
+
An assistant may lose the confirmation for a product update, or reopen a conversation while a write is waiting for approval. Reading what the Hub already knows must not silently send the update again.
|
|
18
|
+
|
|
19
|
+
Invocation inspection reads the original Hub record, execution journal and approval state. It does not create a run, invoke a tool, consume an approval, decrypt frozen arguments, reserve a dispatch attempt, or change the original invocation state. This is a separate operation from `POST .../resume`, which may perform the original operation's first dispatch after approval or a confirmed rejection before dispatch.
|
|
20
|
+
|
|
21
|
+
## Negotiate support
|
|
22
|
+
|
|
23
|
+
Use the original Agent Session's Bearer token:
|
|
24
|
+
|
|
25
|
+
```http
|
|
26
|
+
GET /agent-api/v1/tool-invocations/inspection-capabilities
|
|
27
|
+
Authorization: Bearer <agent-access-token>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"schema_version": "bailing.agent-invocation-inspection-capabilities.v1",
|
|
33
|
+
"receipt_schema": "bailing.agent-invocation-receipt.v1",
|
|
34
|
+
"read_only": true
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
An older Hub that does not advertise this exact contract is unsupported. Do not substitute `resume`, invoke a replacement operation, or infer support from a package version. Negotiation authenticates the Agent Session without creating a business run or loading a tool catalog.
|
|
39
|
+
|
|
40
|
+
## Read the original receipt
|
|
41
|
+
|
|
42
|
+
```http
|
|
43
|
+
GET /agent-api/v1/tool-invocations/<original-64-hex-invocation-id>/receipt
|
|
44
|
+
Authorization: Bearer <original-agent-access-token>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Both GET endpoints accept no query parameters and return `Cache-Control: no-store`. The receipt endpoint accepts the original identifier only; it does not accept replacement arguments, a new target, a tool name, or a task identifier.
|
|
48
|
+
|
|
49
|
+
Example: an original update is waiting for its explicit continuation after approval:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"schema_version": "bailing.agent-invocation-receipt.v1",
|
|
54
|
+
"read_only": true,
|
|
55
|
+
"business_operation_performed": false,
|
|
56
|
+
"invocation_id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
57
|
+
"agent_run_id": "22222222-2222-4222-8222-222222222222",
|
|
58
|
+
"route": "catalog-agent",
|
|
59
|
+
"tool": "product_update",
|
|
60
|
+
"observed_at": "2026-09-15T00:00:00.000Z",
|
|
61
|
+
"result": {
|
|
62
|
+
"schema_version": "bailing.agent-tool-invocation.v1",
|
|
63
|
+
"invocation_id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
64
|
+
"route": "catalog-agent",
|
|
65
|
+
"tool": "product_update",
|
|
66
|
+
"state": "awaiting_approval",
|
|
67
|
+
"ok": false,
|
|
68
|
+
"auto_retry_allowed": false,
|
|
69
|
+
"text": "The governed tool invocation is awaiting approval.",
|
|
70
|
+
"approval_id": 1
|
|
71
|
+
},
|
|
72
|
+
"result_source": "job",
|
|
73
|
+
"dispatch_state": "not_dispatched",
|
|
74
|
+
"approval": { "status": "approved", "approval_id": 1 },
|
|
75
|
+
"journal_state": "absent"
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The saved result and the latest approval observation intentionally remain distinct. Approval becoming `approved` does not make the business operation successful and inspection does not continue it.
|
|
80
|
+
|
|
81
|
+
## Interpret the observations
|
|
82
|
+
|
|
83
|
+
| Field | Meaning |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `read_only`, `business_operation_performed` | This request only inspected records. These fields do not claim that the original operation never ran. |
|
|
86
|
+
| `invocation_id`, `agent_run_id`, `route`, `tool` | Original verified coordinates. A new user turn must not replace the original run or target. |
|
|
87
|
+
| `observed_at` | Observation time, not a dispatch permit or an atomic policy decision. |
|
|
88
|
+
| `result` | An allowlisted original invocation result, a projection of journal evidence, or `null` when no valid result is available. Raw job metadata and frozen arguments are excluded. |
|
|
89
|
+
| `result_source` | `job`, `journal`, or `none`. A completed journal can reveal a saved result even when the job still has an older prefix; inspection does not persist this projection. |
|
|
90
|
+
| `dispatch_state` | `not_dispatched` means existing evidence confirms a rejection or wait before dispatch; `attempted` means an execution attempt may have reached the business system; `unknown` means that distinction cannot be verified. `attempted` is not proof that the business system received or completed it. |
|
|
91
|
+
| `approval.status` | `none`, `pending`, `approved`, or `denied`; the latter three include the original `approval_id`. |
|
|
92
|
+
| `journal_state` | `absent`, `dispatching`, `response_recorded`, `completed`, `uncertain`, `evidence_degraded`, or `unknown`. `response_recorded` alone does not promise completion of the original execution evidence. |
|
|
93
|
+
|
|
94
|
+
Unresolved journal evidence projects `reconciliation_required` with `auto_retry_allowed: false`. Inspecting a malformed stored result returns `result: null`, not a fabricated success. A journal whose completion cannot be verified also remains unresolved.
|
|
95
|
+
|
|
96
|
+
The nested result preserves the existing invocation result contract. In particular, an old `auto_retry_allowed: true` describes that original result; it does not authorize the receipt consumer to automatically invoke or resume anything. Explicit continuation remains a distinct governed operation using the original invocation and original parameters.
|
|
97
|
+
|
|
98
|
+
These are observations of separately persisted records. A concurrent operation or approval can progress while they are read. Refresh the receipt to observe later evidence; never convert this read into a claim that it atomically grants or denies a future dispatch.
|
|
99
|
+
|
|
100
|
+
## Authorization and boundaries
|
|
101
|
+
|
|
102
|
+
- The original Agent Session must still be valid, the Client enabled, and the original route and specific tool currently authorized. Historical parameter schemas and execution fingerprints need not stay unchanged merely to inspect existing evidence.
|
|
103
|
+
- The Hub verifies the original job marker, Agent Session, Client, principal, subject and invocation coordinates. If the original runtime run exists, its session, client, route and thread association must also match. A missing historical runtime row is not reconstructed from conversation text.
|
|
104
|
+
- The host must retain and validate its complete original selected authorization set before using the original connection. This receipt API does not independently claim to implement a task's multi-member authorization ledger, cross-Hub access, or administrator audit permissions.
|
|
105
|
+
- Inspection works while the global Hub execution pause is enabled. Pause still blocks invoke and resume. Authentication can update the existing session `last_seen_at`; this does not update business data, invocation state, approval use, or the dispatch journal.
|
|
106
|
+
- Current authorization failure remains a failure. Do not fall back to another Agent Session, default authorization, remaining subset, or an administrator credential.
|
|
107
|
+
- An authenticated `invocation_not_found` is absence of a verifiable original record, not proof that a previous business write did not happen. Keep the original identifiers and inspect the original evidence through an authorized operator; do not issue a replacement write.
|
|
108
|
+
|
|
109
|
+
## Integration scope
|
|
110
|
+
|
|
111
|
+
The standalone receipt addition requires no migration. The later [paired task-control candidate](AGENT_TASK_CONTROL.en.md) builds on it with migration 062, whole-group verification for managed calls, budgets, pause/cancel and host integration. It still does not automatically reconcile unknown outcomes with a business provider. Non-enrolled original invocation behavior remains unchanged.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Configure a local agent in one place
|
|
2
|
+
|
|
3
|
+
English | [简体中文](LOCAL_AGENT_SETUP.md)
|
|
4
|
+
|
|
5
|
+
Open **Agent Clients → Connection Setup**, then choose **Configure Connection** on the application's row, to connect an existing business system to a local agent. The panel brings authorization, system descriptions, tools and approvals, and connection checks into four steps.
|
|
6
|
+
|
|
7
|
+
Settings stay in their existing Client and business route records. The older pages retain advanced controls and link to this entry point; there is no second set of application identities or business capabilities to maintain.
|
|
8
|
+
|
|
9
|
+
## Understand the three roles
|
|
10
|
+
|
|
11
|
+
| Name | What it controls | Example |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| Client | Which application connects, where users authorize, and which workspaces it may use | The client identifier and fixed authorization page for a support application |
|
|
14
|
+
| Workspace (business route) | System purpose, tool sources, and local-agent execution settings | Customer support or inventory operations |
|
|
15
|
+
| Agent Session | The authorized user, tenant/account, and permitted business scope | An operator acting for a particular account |
|
|
16
|
+
|
|
17
|
+
Allowing a Client to use a workspace does not give every user all its business permissions. Requests still use the original business identity and pass scope checks, approvals, and final authorization in the business system.
|
|
18
|
+
|
|
19
|
+
Several Clients may share a workspace. Changes to its descriptions or tool sources affect other entry points using that route. Decide whether a separate workspace is needed before introducing independent settings.
|
|
20
|
+
|
|
21
|
+
## Step 1: Authorization entry
|
|
22
|
+
|
|
23
|
+
Find the existing Client and choose **Configure Connection**. If the application is not registered yet, use **New Client** first.
|
|
24
|
+
|
|
25
|
+
Check that it is enabled, enter the fixed HTTPS authorization page supplied by the business system, choose the permitted workspaces, and save. The business page handles login, account selection, and permission confirmation. Do not duplicate a Client record for every user or store.
|
|
26
|
+
|
|
27
|
+
The Client enabled switch is shared with its other entry points. Disabling it can affect an embedded chat or another integration using the same Client. To stop local-agent tool calls only, use the tool switch in step 3.
|
|
28
|
+
|
|
29
|
+
## Step 2: System description
|
|
30
|
+
|
|
31
|
+
Select the workspace, enable the local agent, and fill in four fields:
|
|
32
|
+
|
|
33
|
+
- **System name:** the product or module name, such as “Customer Support”.
|
|
34
|
+
- **Short purpose:** what it usually handles, such as customer questions, tickets, and follow-ups.
|
|
35
|
+
- **Typical domains:** a few useful categories, such as ticket lookup or response preparation.
|
|
36
|
+
- **Boundaries:** work handled elsewhere, such as inventory adjustments.
|
|
37
|
+
|
|
38
|
+
Save the workspace. Compatible clients provide these descriptions for the conversation's selected targets before the first tool search, helping the model choose where to look. Single-account, multiple-account, and multiple-system conversations use the same structure.
|
|
39
|
+
|
|
40
|
+
Missing metadata, older versions, or temporary description failures may display “System purpose unknown”; existing authorization and on-demand tool discovery remain available through their original flow. A description is not a permission grant or an instruction to bypass rules. See the [system information contract](AGENT_SYSTEM_INFO.en.md).
|
|
41
|
+
|
|
42
|
+
## Step 3: Tools and approvals
|
|
43
|
+
|
|
44
|
+
Enable local-agent tool calls, select registered tool providers and allowed scopes, and choose exact write operations when needed.
|
|
45
|
+
|
|
46
|
+
| Setting | Meaning |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| Local agent enabled | Enables local conversation orchestration; tool access has a separate switch |
|
|
49
|
+
| Tool calls enabled | Opens discovery and invocation, still subject to providers and authorization |
|
|
50
|
+
| Provider scope allowlist | Selects capabilities from the business declarations |
|
|
51
|
+
| Allowed write operations | Explicit operation IDs; empty means no writes, and `*` is not accepted |
|
|
52
|
+
| Additional approvals | Can tighten existing approval requirements, never remove them |
|
|
53
|
+
|
|
54
|
+
An existing read-only route permission still prevents writes even if operations are selected. The panel shows this setting; the route's permission and audience rules remain in advanced route configuration.
|
|
55
|
+
|
|
56
|
+
Choose **Read Tool Catalog** to see a table of business-action descriptions and operation IDs, whether each is a read or write, and its current configuration. Review these actions before adjusting scopes, allowed writes, and approvals.
|
|
57
|
+
|
|
58
|
+
Reading the catalog does not execute an operation or prove that an end user may execute it. Additional orchestration rules and active-tool limits remain under advanced runtime settings, separate from the product description.
|
|
59
|
+
|
|
60
|
+
Save the workspace. Steps 2 and 3 edit the same workspace settings; save changes you want to keep before switching workspaces.
|
|
61
|
+
|
|
62
|
+
## Step 4: Check the connection
|
|
63
|
+
|
|
64
|
+
Review the saved Client, authorization page, and workspace states, then generate connection settings. These tell the local client where the Hub is and which Client and workspace to use, plus a local display label. They contain no tokens and do not authorize a user automatically.
|
|
65
|
+
|
|
66
|
+
Give these public settings to the local client. The user then signs in and confirms authorization on the business page. A new conversation explicitly selects its authorization scope and keeps it fixed after the first message; changing scope follows the client's new-conversation flow.
|
|
67
|
+
|
|
68
|
+
“Connection settings ready” is not proof that tools are available or that business work has executed. The client must validate the user and actual authorization. After that, use your test process to verify a permitted read, a controlled action, and approval when required.
|
|
69
|
+
|
|
70
|
+
Authorized devices, runs, and usage remain under **Devices and Activity** on the same page.
|
|
71
|
+
|
|
72
|
+
## Resolve setup problems
|
|
73
|
+
|
|
74
|
+
| State | Next step |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| Description missing | Use existing discovery and add a product description later |
|
|
77
|
+
| Connection ready, tool calls disabled | Check the step 3 switch, providers, and scope |
|
|
78
|
+
| Workspace disabled or read-only | Review advanced route settings; the panel does not silently change them |
|
|
79
|
+
| Permission denied | Use an administrator with the relevant Client or route permissions |
|
|
80
|
+
| Configuration changed concurrently | Close and reopen the panel, review current values, and save again |
|
|
81
|
+
| Host cannot save these settings | Upgrade its matching persistence implementation; do not fall back to overwriting the whole record |
|
|
82
|
+
|
|
83
|
+
## API appendix: narrow updates
|
|
84
|
+
|
|
85
|
+
These endpoints use administrator authentication and RBAC, not an end user's Agent bearer. Client and route settings are saved separately; the panel does not provide a transaction across both records.
|
|
86
|
+
|
|
87
|
+
### Client settings
|
|
88
|
+
|
|
89
|
+
`GET /admin/api/clients/:app_id/agent-setup` returns `app_id`, `name`, `enabled`, `agent_authorize_url`, `allowed_routes`, and `revision`, without the Client Token.
|
|
90
|
+
|
|
91
|
+
`PUT` to the same path requires exactly these four fields:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"expected_revision": "<revision returned by GET>",
|
|
96
|
+
"enabled": true,
|
|
97
|
+
"agent_authorize_url": "https://business.example.com/agent/authorize",
|
|
98
|
+
"allowed_routes": ["helpdesk"]
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Set `agent_authorize_url` to `null` to clear it. `allowed_routes` accepts up to 256 entries and retains the existing workspace/`*` meaning; explicit workspaces make the affected scope easier to assess. The revision covers these three editable settings. Saving updates only them, without rotating tokens or changing other Client properties.
|
|
103
|
+
|
|
104
|
+
GET requires `clients:read`; PUT requires `clients:write`. Errors include 403 `forbidden`, 404 `client_not_found`, and 400 `invalid_agent_setup` or an existing configuration validation error.
|
|
105
|
+
|
|
106
|
+
### Workspace settings
|
|
107
|
+
|
|
108
|
+
`GET /admin/api/routes/:route_key/agent-setup` returns `route_key`, `name`, `enabled`, `permission`, `revision`, `agent_client`, `tool_sources`, and `agent_direct`. `permission` is read-only and must not be sent in a PUT.
|
|
109
|
+
|
|
110
|
+
`PUT` requires exactly `expected_revision`, `agent_client`, `tool_sources`, and `agent_direct`. `agent_client` and `agent_direct` may be `null`; `tool_sources: []` clears source selection. Edit freshly read values while preserving existing instructions, tool limits, and extra source settings. See the [complete example](AGENT_SYSTEM_INFO.en.md#console-configuration-api).
|
|
111
|
+
|
|
112
|
+
GET requires `routes:read`; PUT requires `routes:write`. The full route revision is compared, but only `agent_client`, `tools`, and the update timestamp are written. Target, permission, audience, memory, knowledge, and unrelated settings remain unchanged. Errors include 404 `route_not_found` and 400 `invalid_request` or an existing route validation error.
|
|
113
|
+
|
|
114
|
+
Both revision formats are 64 hexadecimal characters. A concurrent edit returns 409 `agent_setup_conflict`; a host without the corresponding atomic persistence operation returns 503 `agent_setup_unsupported`. Neither path silently overwrites a conflicting record. Successful saves return the new projection and revision.
|
|
115
|
+
|
|
116
|
+
This feature uses existing storage fields and adds no migration. Business APIs, approval rules, fixed conversation scope, and archive protocols remain unchanged.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# 在一个入口配置本地智能体
|
|
2
|
+
|
|
3
|
+
[English](LOCAL_AGENT_SETUP.en.md) | 简体中文
|
|
4
|
+
|
|
5
|
+
希望让用户在本地智能体里操作已有业务系统时,打开 **智能体客户端 → 接入配置**,在应用行点击“配置接入”。面板把授权入口、系统说明、工具与审批、连接检查放在一起,按四步完成即可。
|
|
6
|
+
|
|
7
|
+
这些设置继续保存在原接入方和业务路由中。旧页面保留高级配置,并提供返回集中入口的链接;无需重复创建一套接入方或业务能力。
|
|
8
|
+
|
|
9
|
+
## 先分清三个角色
|
|
10
|
+
|
|
11
|
+
| 名称 | 决定什么 | 例子 |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| 接入方(Client) | 哪个应用来连接、去哪里确认业务身份、最多能连接哪些工作空间 | 客服应用的接入标识与固定授权页 |
|
|
14
|
+
| 工作空间(workspace,对应业务路由) | 这个业务范围负责什么、使用哪些工具源、允许本地智能体怎样调用 | 客服工单空间、库存空间 |
|
|
15
|
+
| 用户的业务授权(Agent Session) | 当前是谁、属于哪个租户或账户、这次实际允许哪些业务范围 | 某位操作员在某个账户下的授权 |
|
|
16
|
+
|
|
17
|
+
接入方允许连接一个空间,不等于其中每个用户都拥有全部业务权限。调用时仍使用原业务身份,经过范围裁剪、审批与业务系统最终授权。
|
|
18
|
+
|
|
19
|
+
一个工作空间可以被多个接入方使用。修改其中的工具源或系统说明会影响所有使用这条路由的入口;如果需要独立配置,应先由管理员明确是否使用不同工作空间。
|
|
20
|
+
|
|
21
|
+
## 第一步:授权入口
|
|
22
|
+
|
|
23
|
+
在应用列表找到已有接入方,点击“配置接入”。尚未登记应用时,先通过“新建接入方”完成登记。
|
|
24
|
+
|
|
25
|
+
确认接入方启用,填写业务系统提供的固定 HTTPS 授权页,再选择允许连接的工作空间,点击“保存授权入口”。授权页应由业务系统负责登录、选择业务账户并确认权限;不为每个用户或门店复制一个中枢接入方。
|
|
26
|
+
|
|
27
|
+
“允许此接入方连接中枢”是接入方的共用开关。关闭它也可能影响同一接入方的网页聊天或其他入口;只想停止本地工具调用时,应调整第三步的工具开关。
|
|
28
|
+
|
|
29
|
+
## 第二步:系统说明
|
|
30
|
+
|
|
31
|
+
选择要配置的工作空间,开启“启用本地智能体”,填写四项说明:
|
|
32
|
+
|
|
33
|
+
- **业务系统名称**:产品或业务模块的正式名称,例如“客户服务系统”。
|
|
34
|
+
- **一句话介绍**:它通常负责什么,例如“处理客户咨询、服务工单和售后跟进”。
|
|
35
|
+
- **典型业务方向**:几项便于理解的业务领域,例如“工单查询”“回复准备”。
|
|
36
|
+
- **系统边界**:哪些事情应交给其他系统,例如“库存调整由库存系统处理”。
|
|
37
|
+
|
|
38
|
+
保存后,支持此功能的客户端会在首次搜索工具之前,把本会话已选目标的说明提供给智能体。它就能先分清目标,再查询具体允许的动作。单授权、同系统多授权和跨系统授权都使用同一套说明结构。
|
|
39
|
+
|
|
40
|
+
说明没有填写、旧版本尚不支持或暂时读取失败时,可以显示“系统用途未知”;已有授权和按需工具查询继续使用原流程。说明不是权限承诺,也不能写成要求模型绕过规则的指令。详细字段见[系统说明契约](AGENT_SYSTEM_INFO.md)。
|
|
41
|
+
|
|
42
|
+
## 第三步:工具与审批
|
|
43
|
+
|
|
44
|
+
打开“允许本地智能体调用工具”,选择已经登记的业务工具源和允许使用的 scope,再按需要勾选精确的写操作。
|
|
45
|
+
|
|
46
|
+
| 设置 | 实际含义 |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| 本地智能体已启用 | 允许本地会话编排;工具通道还需单独开启 |
|
|
49
|
+
| 允许调用工具 | 开放工具发现和调用通道;仍需有效工具源与授权 |
|
|
50
|
+
| 工具源的 scope 范围 | 从业务声明中筛选可进入此空间的能力 |
|
|
51
|
+
| 允许的写操作 | 精确指定写动作;留空不开放写入,不能填 `*` |
|
|
52
|
+
| 额外要求审批 | 在原规则上进一步收紧,不会取消业务声明中的审批 |
|
|
53
|
+
|
|
54
|
+
如果原工作空间的权限档是只读,即使选择写操作仍不会开放写入。页面会显示这个状态,原权限档与受众规则继续在路由高级配置中管理。
|
|
55
|
+
|
|
56
|
+
点击“读取工具目录”后,简表会列出每项业务动作的说明和操作标识、类型是查询还是写入,以及当前配置状态。可以先看懂动作,再调整 scope、写入清单和审批设置。
|
|
57
|
+
|
|
58
|
+
读取目录不会执行业务动作,也不等于最终用户已获准执行。补充编排规则和每轮工具上限放在“高级运行设置”,与第二步的产品介绍分别维护。
|
|
59
|
+
|
|
60
|
+
点击“保存工作空间”。第二步和第三步编辑的是同一工作空间配置;切换工作空间前先保存需要保留的修改。
|
|
61
|
+
|
|
62
|
+
## 第四步:检查连接
|
|
63
|
+
|
|
64
|
+
检查已保存的接入方、授权页和各工作空间状态,再点击“生成连接配置”。生成内容用于告诉客户端 **中枢在哪里、连接哪个应用和工作空间**,以及本机连接的显示名称;它不包含 Token,也不会自动替用户完成业务授权。
|
|
65
|
+
|
|
66
|
+
把这些公开连接参数交给本地客户端,随后由用户在业务授权页登录并确认。新会话显式选择授权范围,首消息后保持原范围;更换范围时按客户端规则新建会话。
|
|
67
|
+
|
|
68
|
+
“连接条件已配置”不表示工具一定可用,更不表示已经执行了业务。客户端仍要重新核对身份和实际授权。业务授权确认完成后,再按自己的测试流程验证一个允许的查询、一个受控动作及需要时的审批。
|
|
69
|
+
|
|
70
|
+
授权设备、运行记录和用量仍在同页的“设备与运行”查看。
|
|
71
|
+
|
|
72
|
+
## 保存或连接没有成功时
|
|
73
|
+
|
|
74
|
+
| 页面状态 | 下一步 |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| 系统说明未提供 | 可先使用原工具查询,再补充定位说明 |
|
|
77
|
+
| 可连接,但工具通道未开启 | 在第三步检查工具开关、工具源和范围 |
|
|
78
|
+
| 工作空间已停用或权限档只读 | 在原路由高级配置中核对;集中面板不会暗中改变它们 |
|
|
79
|
+
| 没有读取或保存权限 | 使用具备对应接入方、路由权限的管理员账户 |
|
|
80
|
+
| 配置已被其他操作更新 | 关闭面板重新打开,核对最新值后再保存 |
|
|
81
|
+
| 当前宿主不支持集中保存 | 升级配套宿主实现;不要回退为整行覆盖配置 |
|
|
82
|
+
|
|
83
|
+
## 接口附录:集中配置的保存边界
|
|
84
|
+
|
|
85
|
+
下列接口仅供管理控制台使用,沿用管理员认证与 RBAC,不使用终端用户的 Agent bearer。两类配置分别保存,不是跨接入方和路由的整体事务。
|
|
86
|
+
|
|
87
|
+
### 接入方设置
|
|
88
|
+
|
|
89
|
+
`GET /admin/api/clients/:app_id/agent-setup` 返回 `app_id`、`name`、`enabled`、`agent_authorize_url`、`allowed_routes`、`revision`。响应不包含 Client Token。
|
|
90
|
+
|
|
91
|
+
`PUT` 同一路径必须且只能提供以下四个字段:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"expected_revision": "<GET 返回的 revision>",
|
|
96
|
+
"enabled": true,
|
|
97
|
+
"agent_authorize_url": "https://business.example.com/agent/authorize",
|
|
98
|
+
"allowed_routes": ["helpdesk"]
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`agent_authorize_url` 可设为 `null` 清除。`allowed_routes` 最多 256 项,沿用现有 workspace 与 `*` 语义;显式选择空间便于判断影响范围。`revision` 比较上述三个可编辑设置,保存只更新这三项,不轮换 Token,不改其他接入方属性。
|
|
103
|
+
|
|
104
|
+
GET 需要 `clients:read`,PUT 需要 `clients:write`。无权限为 403 `forbidden`;不存在为 404 `client_not_found`;格式错误为 400 `invalid_agent_setup` 或现有配置校验错误。
|
|
105
|
+
|
|
106
|
+
### 工作空间设置
|
|
107
|
+
|
|
108
|
+
`GET /admin/api/routes/:route_key/agent-setup` 返回 `route_key`、`name`、`enabled`、`permission`、`revision`、`agent_client`、`tool_sources`、`agent_direct`。`permission` 是只读展示字段,不允许随 PUT 修改。
|
|
109
|
+
|
|
110
|
+
`PUT` 同一路径必须且只能提供 `expected_revision`、`agent_client`、`tool_sources`、`agent_direct`。`agent_client` 和 `agent_direct` 可以为 `null`;`tool_sources: []` 清除工具源选择。请求应基于刚读取的值编辑,保留已有指令、工具上限及工具源附加选项。完整示例见[系统说明接口](AGENT_SYSTEM_INFO.md#控制台集中配置接口)。
|
|
111
|
+
|
|
112
|
+
GET 需要 `routes:read`,PUT 需要 `routes:write`。保存比较完整路由修订,仅更新 `agent_client`、`tools` 和更新时间;路由目标、权限档、受众、记忆、知识与其他配置保持原值。不存在为 404 `route_not_found`;无效输入为 400 `invalid_request` 或现有路由配置校验错误。
|
|
113
|
+
|
|
114
|
+
两类保存的修订均为 64 位十六进制字符串。并发冲突返回 409 `agent_setup_conflict`;缺少对应宿主原子保存实现返回 503 `agent_setup_unsupported`,不会静默覆盖。成功返回最新投影与修订。
|
|
115
|
+
|
|
116
|
+
集中配置和系统说明沿用现有存储字段,本轮功能不新增数据库迁移,不改变业务 API、审批、固定会话范围或归档协议。
|
package/docs/README.en.md
CHANGED
|
@@ -6,6 +6,8 @@ This directory contains public documentation for the open-source BailingHub proj
|
|
|
6
6
|
|
|
7
7
|
| Document | Purpose |
|
|
8
8
|
|---|---|
|
|
9
|
+
| [RELEASE_NOTES_v0.8.0.md](RELEASE_NOTES_v0.8.0.md) · [English](RELEASE_NOTES_v0.8.0.en.md) | v0.8.0: long tasks, original receipts, attachments and upgrade boundaries. |
|
|
10
|
+
| [RELEASE_NOTES_v0.7.0.md](RELEASE_NOTES_v0.7.0.md) · [English](RELEASE_NOTES_v0.7.0.en.md) | v0.7.0 shop/inventory scenarios, upgrade steps and limits. |
|
|
9
11
|
| [user-guide/conversations.en.md](user-guide/conversations.en.md) | Multi-account conversations, full-text review and offline recovery for users. |
|
|
10
12
|
| [QUICKSTART.en.md](QUICKSTART.en.md) | Install BailingHub, run the Docker demo, create the first route, and connect the first business tool. |
|
|
11
13
|
| [DEMO.en.md](DEMO.en.md) | Docker demo walkthrough: hub, MySQL, demo business system, tool provider, audit, and trace. |
|
|
@@ -13,9 +15,16 @@ This directory contains public documentation for the open-source BailingHub proj
|
|
|
13
15
|
| [INDEPENDENT_VALIDATION.md](INDEPENDENT_VALIDATION.md) | Chinese independent validation task. |
|
|
14
16
|
| [AGENT_CLIENT_QUICKSTART.en.md](AGENT_CLIENT_QUICKSTART.en.md) | End-to-end Agent Client setup and configuration ownership. |
|
|
15
17
|
| [AGENT_CLIENT_QUICKSTART.md](AGENT_CLIENT_QUICKSTART.md) | Chinese Agent Client integration guide. |
|
|
18
|
+
| [LOCAL_AGENT_SETUP.en.md](LOCAL_AGENT_SETUP.en.md) | Four-step console setup: authorization, descriptions, tools/approvals, and connection checks. |
|
|
19
|
+
| [LOCAL_AGENT_SETUP.md](LOCAL_AGENT_SETUP.md) | Chinese local-agent setup guide. |
|
|
20
|
+
| [AGENT_SYSTEM_INFO.en.md](AGENT_SYSTEM_INFO.en.md) | Controlled descriptions before first tool discovery, with original binding and compatibility rules. |
|
|
21
|
+
| [AGENT_SYSTEM_INFO.md](AGENT_SYSTEM_INFO.md) | Chinese system-information contract. |
|
|
22
|
+
| [AGENT_SUBJECT_DISPLAY.en.md](AGENT_SUBJECT_DISPLAY.en.md) | Business authorization display names: responsibilities, new approvals and existing-session synchronization. |
|
|
16
23
|
| [AGENT_AUTH_API.en.md](AGENT_AUTH_API.en.md) | Agent Auth v1, PKCE, trusted business identity, and revocation. |
|
|
17
24
|
| [AGENT_AUTH_API.md](AGENT_AUTH_API.md) | Chinese Agent Auth v1 protocol. |
|
|
25
|
+
| [INVOCATION_RECEIPTS.md](INVOCATION_RECEIPTS.md) | Candidate: read an original receipt without continuing its business operation. |
|
|
18
26
|
| [AGENT_CLIENT_RUNTIME_API.en.md](AGENT_CLIENT_RUNTIME_API.en.md) | Agent Client Runtime v1 workspaces, turns, tools, and completion contract. |
|
|
27
|
+
| [AGENT_TASK_CONTROL.en.md](AGENT_TASK_CONTROL.en.md) · [Chinese](AGENT_TASK_CONTROL.md) | Core 0.8.0: cumulative task budgets, actual dispatch, pause and SDK/DSH host integration. |
|
|
19
28
|
| [AGENT_CLIENT_RUNTIME_API.md](AGENT_CLIENT_RUNTIME_API.md) | Chinese Agent Client Runtime v1 contract. |
|
|
20
29
|
| [AGENT_CONVERSATION_AUDIT.en.md](AGENT_CONVERSATION_AUDIT.en.md) | Complete visible conversation audit, member confirmation, run ownership and admin pagination. |
|
|
21
30
|
| [AGENT_CONVERSATION_AUDIT.md](AGENT_CONVERSATION_AUDIT.md) | Chinese complete conversation audit protocol. |
|
package/docs/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
| 文档 | 用途 |
|
|
10
10
|
|---|---|
|
|
11
|
+
| [RELEASE_NOTES_v0.8.0.md](RELEASE_NOTES_v0.8.0.md) · [English](RELEASE_NOTES_v0.8.0.en.md) | v0.8.0: long tasks, original receipts, attachments and upgrade boundaries. |
|
|
12
|
+
| [RELEASE_NOTES_v0.7.0.md](RELEASE_NOTES_v0.7.0.md) · [English](RELEASE_NOTES_v0.7.0.en.md) | v0.7.0:商城与库存场景、配套升级和限制。 |
|
|
11
13
|
| [user-guide/conversations.md](user-guide/conversations.md) | 普通用户的多账户对话、完整沟通追溯和离线恢复指南。 |
|
|
12
14
|
| [QUICKSTART.md](QUICKSTART.md) | 从零部署百灵中枢,适合准备接入真实业务系统的开发者。 |
|
|
13
15
|
| [QUICKSTART.en.md](QUICKSTART.en.md) | English quickstart for Docker demo, first route, and first business tool. |
|
|
@@ -17,9 +19,16 @@
|
|
|
17
19
|
| [INDEPENDENT_VALIDATION.en.md](INDEPENDENT_VALIDATION.en.md) | English independent validation task, pass criteria, and report path. |
|
|
18
20
|
| [AGENT_CLIENT_QUICKSTART.md](AGENT_CLIENT_QUICKSTART.md) | 智能体客户端从 Core、业务授权页、通用 SDK 到本地宿主插件的完整接入路径。 |
|
|
19
21
|
| [AGENT_CLIENT_QUICKSTART.en.md](AGENT_CLIENT_QUICKSTART.en.md) | English end-to-end Agent Client integration guide and configuration ownership. |
|
|
22
|
+
| [LOCAL_AGENT_SETUP.md](LOCAL_AGENT_SETUP.md) | 管理员四步集中配置:授权入口、系统说明、工具与审批、连接检查。 |
|
|
23
|
+
| [LOCAL_AGENT_SETUP.en.md](LOCAL_AGENT_SETUP.en.md) | English local-agent setup guide and narrow configuration APIs. |
|
|
24
|
+
| [AGENT_SYSTEM_INFO.md](AGENT_SYSTEM_INFO.md) | 首次能力搜索前的受控系统定位,包含授权绑定与兼容降级契约。 |
|
|
25
|
+
| [AGENT_SYSTEM_INFO.en.md](AGENT_SYSTEM_INFO.en.md) | English selected-system descriptions and host read contract. |
|
|
26
|
+
| [AGENT_SUBJECT_DISPLAY.md](AGENT_SUBJECT_DISPLAY.md) | 业务授权显示名称:三方职责、新授权与旧会话名称同步。 |
|
|
20
27
|
| [AGENT_AUTH_API.md](AGENT_AUTH_API.md) | Agent Auth v1:业务登录态绑定、PKCE、Token 交换与会话撤销的语言无关契约。 |
|
|
21
28
|
| [AGENT_AUTH_API.en.md](AGENT_AUTH_API.en.md) | English Agent Auth v1 protocol and trusted business-identity boundary. |
|
|
29
|
+
| [INVOCATION_RECEIPTS.md](INVOCATION_RECEIPTS.md) | 只读核对原调用、审批与执行日志;与可能继续业务的 resume 分开。 |
|
|
22
30
|
| [AGENT_CLIENT_RUNTIME_API.md](AGENT_CLIENT_RUNTIME_API.md) | Agent Client Runtime v1:工作区、turn、能力搜索、工具执行与完成回传。 |
|
|
31
|
+
| [AGENT_TASK_CONTROL.md](AGENT_TASK_CONTROL.md) · [English](AGENT_TASK_CONTROL.en.md) | Core 0.8.0:跨轮任务额度、实际派发、暂停及 SDK/DSH 宿主接入。 |
|
|
23
32
|
| [AGENT_CLIENT_RUNTIME_API.en.md](AGENT_CLIENT_RUNTIME_API.en.md) | English Agent Client Runtime v1 contract. |
|
|
24
33
|
| [AGENT_CONVERSATION_AUDIT.md](AGENT_CONVERSATION_AUDIT.md) | 完整可见对话审计:逐授权成员确认、幂等文本事件、run 关联和管理员分页读取。 |
|
|
25
34
|
| [AGENT_CONVERSATION_AUDIT.en.md](AGENT_CONVERSATION_AUDIT.en.md) | English complete conversation audit protocol and authorization boundary. |
|