bailinghub 0.3.3 → 0.3.4

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.
Files changed (71) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -0
  3. package/docker-compose.images.yml +2 -2
  4. package/docs/CHANGELOG.en.md +12 -0
  5. package/docs/CHANGELOG.md +12 -0
  6. package/docs/CONTRACT.en.md +12 -0
  7. package/docs/CONTRACT.md +3 -1
  8. package/docs/DEMO.en.md +6 -0
  9. package/docs/DEMO.md +2 -0
  10. package/docs/INDEPENDENT_VALIDATION.en.md +9 -6
  11. package/docs/INDEPENDENT_VALIDATION.md +9 -6
  12. package/docs/QUICKSTART.en.md +14 -0
  13. package/docs/QUICKSTART.md +1 -1
  14. package/docs/README.en.md +2 -0
  15. package/docs/README.md +2 -0
  16. package/docs/RELEASE_NOTES_v0.3.4.en.md +38 -0
  17. package/docs/RELEASE_NOTES_v0.3.4.md +38 -0
  18. package/docs/user-guide/concepts.en.md +8 -1
  19. package/docs/user-guide/concepts.md +3 -1
  20. package/docs/user-guide/console-map.md +1 -1
  21. package/package.json +1 -1
  22. package/scripts/check-doc-links.mjs +1 -0
  23. package/scripts/check-image-tags.sh +1 -1
  24. package/scripts/check-release-consistency.test.mjs +5 -5
  25. package/scripts/e2e-console.mjs +38 -10
  26. package/scripts/install.sh +1 -1
  27. package/scripts/publish-images.sh +1 -1
  28. package/scripts/release-audit.mjs +1 -0
  29. package/scripts/verify-github-repo.mjs +1 -0
  30. package/src/core/runtime/execution-runtime.test.ts +12 -4
  31. package/src/core/runtime/execution-runtime.ts +1 -1
  32. package/src/routes/chat-mount.test.ts +9 -1
  33. package/src/routes/chat.ts +13 -7
  34. package/web/console/assets/{Accounts-08VltF2i.js → Accounts-CAwrtBiS.js} +1 -1
  35. package/web/console/assets/{Approvals-CqgmsMau.js → Approvals-C2BZ86T3.js} +1 -1
  36. package/web/console/assets/{Audit-bPlpSQt3.js → Audit-B-E4Y_Up.js} +1 -1
  37. package/web/console/assets/{BrandLockup-DhX07g3G.js → BrandLockup-C18u8Lx5.js} +1 -1
  38. package/web/console/assets/{Channels-BZe0pLgx.js → Channels-DTy8ylH-.js} +1 -1
  39. package/web/console/assets/ChatEntries-9xbRiQov.css +1 -0
  40. package/web/console/assets/ChatEntries-DvD-4IeE.js +7 -0
  41. package/web/console/assets/Clients--D7NQJKk.css +1 -0
  42. package/web/console/assets/{Clients-BVVZfX3r.js → Clients-DWs9JFr0.js} +2 -2
  43. package/web/console/assets/{Cost-DANcjr_p.js → Cost-2SSYs1AT.js} +1 -1
  44. package/web/console/assets/{Credentials-D_8tP2Xa.js → Credentials-B79LtxCE.js} +1 -1
  45. package/web/console/assets/{Diagnostics-Bw1WImFe.js → Diagnostics-BakcRYvb.js} +1 -1
  46. package/web/console/assets/{Executors-fuieN2Sl.js → Executors-BXoyo28u.js} +1 -1
  47. package/web/console/assets/{Kb-BaMi_7xf.js → Kb-ISbzquab.js} +1 -1
  48. package/web/console/assets/{Login-Cmz2ppY8.js → Login-Dlu6Wgcf.js} +1 -1
  49. package/web/console/assets/{Projects-D6xIgFB3.js → Projects-DFzmtnqg.js} +1 -1
  50. package/web/console/assets/{Routes-B90i3ZNa.js → Routes-B-hm9HGY.js} +1 -1
  51. package/web/console/assets/{Runs-9qpwotOj.js → Runs-hMRu1im3.js} +1 -1
  52. package/web/console/assets/Setup-CrBAV-b9.js +1 -0
  53. package/web/console/assets/Setup-D7nxgn-9.css +1 -0
  54. package/web/console/assets/{Shell-Dm6eFcl1.js → Shell-B1a8DvXQ.js} +1 -1
  55. package/web/console/assets/{StorageBuckets-DY8WuJlM.js → StorageBuckets-BRfL_eHb.js} +1 -1
  56. package/web/console/assets/{SystemSettings-O_NMPzq_.js → SystemSettings-CyirVLbq.js} +1 -1
  57. package/web/console/assets/{SystemStatus-Cok3S7S3.js → SystemStatus-DZ_OR7sk.js} +1 -1
  58. package/web/console/assets/{Targets-YWBoxqvy.js → Targets-CtIMa66c.js} +1 -1
  59. package/web/console/assets/{Tools-BgXDw7Mg.js → Tools-BfDZHt01.js} +1 -1
  60. package/web/console/assets/{index-S_J0I0Zh.js → index-DBiByFiO.js} +2 -2
  61. package/web/console/assets/{request-FM608Kfz.js → request-DY2cxQqZ.js} +1 -1
  62. package/web/console/assets/{schema-DWnFqTkB.js → schema-6mCQ7rR5.js} +1 -1
  63. package/web/console/index.html +1 -1
  64. package/web-admin/src/pages/ChatEntries.vue +28 -17
  65. package/web-admin/src/pages/Clients.vue +2 -2
  66. package/web-admin/src/pages/Setup.vue +12 -8
  67. package/web/console/assets/ChatEntries-BweMx_CU.css +0 -1
  68. package/web/console/assets/ChatEntries-Ca0lcGqn.js +0 -7
  69. package/web/console/assets/Clients-DcTYN-Js.css +0 -1
  70. package/web/console/assets/Setup-BIjCiA2i.js +0 -1
  71. package/web/console/assets/Setup-BuyKFofL.css +0 -1
package/README.en.md CHANGED
@@ -229,7 +229,7 @@ export default buildOpenApiSpec({
229
229
  - [Tool Governance](docs/TOOLS_DESIGN.en.md)
230
230
  - [AI-Friendly Tool Design](docs/AI_FRIENDLY_TOOLS.en.md)
231
231
  - [Third-Party Integration](docs/INTEGRATION.en.md)
232
- - [Latest Release Notes](docs/RELEASE_NOTES_v0.3.3.en.md)
232
+ - [Latest Release Notes](docs/RELEASE_NOTES_v0.3.4.en.md)
233
233
  - [v0.1.7 Release Notes](docs/RELEASE_NOTES_v0.1.7.en.md)
234
234
  - [v0.1.6 Release Notes](docs/RELEASE_NOTES_v0.1.6.en.md)
235
235
  - [v0.1.5 Release Notes](docs/RELEASE_NOTES_v0.1.5.en.md)
package/README.md CHANGED
@@ -229,6 +229,7 @@ BAILING_SMOKE_RUN_ROUTE=<route-key> npm run smoke
229
229
  | `docs/RELEASE_NOTES_v0.3.1.md` | `v0.3.1` PDF 解析安全更新说明 |
230
230
  | `docs/RELEASE_NOTES_v0.3.2.md` | `v0.3.2` 受管演示数据引导说明 |
231
231
  | `docs/RELEASE_NOTES_v0.3.3.md` | `v0.3.3` npm 发布来源元数据纠偏说明 |
232
+ | `docs/RELEASE_NOTES_v0.3.4.md` | `v0.3.4` 匿名预览与可信业务身份引导说明 |
232
233
  | `docs/RELEASE_NOTES_v0.1.0.md` | 首个公开版本的发布说明 |
233
234
  | `docs/兼容性与升级.md` | 版本发布策略:SemVer、稳定契约、数据库结构纪律、发布记录要求 |
234
235
  | `sql/` | 中枢**独立**状态库 DDL(`bz_` 前缀,按序号演进);数据库结构演进纪律见 [sql/README.md](sql/README.md) |
@@ -18,7 +18,7 @@ services:
18
18
  retries: 30
19
19
 
20
20
  demo-business:
21
- image: ${BAILING_DEMO_BUSINESS_IMAGE:-crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailing-demo-business:0.3.3}
21
+ image: ${BAILING_DEMO_BUSINESS_IMAGE:-crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailing-demo-business:0.3.4}
22
22
  environment:
23
23
  DEMO_HOST: 0.0.0.0
24
24
  DEMO_PORT: 19080
@@ -29,7 +29,7 @@ services:
29
29
  - "${BAILING_DEMO_PUBLIC_PORT:-19080}:19080"
30
30
 
31
31
  bailinghub:
32
- image: ${BAILINGHUB_IMAGE:-crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailinghub:0.3.3}
32
+ image: ${BAILINGHUB_IMAGE:-crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailinghub:0.3.4}
33
33
  depends_on:
34
34
  mysql:
35
35
  condition: service_healthy
@@ -24,6 +24,18 @@ Each public version should describe:
24
24
 
25
25
  There are no unreleased changes.
26
26
 
27
+ ## v0.3.4 - Anonymous Preview and Trusted Business Identity Guidance
28
+
29
+ Released on 2026-08-14.
30
+
31
+ - **Correct entry semantics**: the console and standalone page now label the former generic trial-chat action as **Anonymous Preview** and explain that it neither inherits the BailingHub administrator session nor provides a standalone business-login surface.
32
+ - **No-subject guidance**: without a trusted ticket signed by the business backend, the Agent directs the user back to the real business system to sign in and reopen or refresh the assistant. It does not ask for an account, password, token, or user ID.
33
+ - **Separate demo validation path**: after importing demo configuration, Getting Started presents a manual **Run Demo-Subject Smoke** action that creates a real job and trace. Import does not run tasks automatically, and the BailingHub administrator is not promoted into a business subject.
34
+ - **Unchanged security boundary**: without a verified subject, all `subject.required:true` tools, including read-only queries and writes, remain hidden from the Agent. The business system continues to make final authorization decisions.
35
+ - **Database and contracts**: there is no new migration, Schema, API, or protocol change. `054_demo_dataset_state.sql` remains the latest migration.
36
+ - **Validation**: complete `npm run release:check`, no-subject tool-assembly tests, anonymous-preview page contracts, real-browser console E2E, and npm artifact verification.
37
+ - **Related docs**: [RELEASE_NOTES_v0.3.4.en.md](RELEASE_NOTES_v0.3.4.en.md), [Quickstart](QUICKSTART.en.md), [Chat entry and identity contract](CONTRACT.en.md), and [Docker Demo](DEMO.en.md).
38
+
27
39
  ## v0.3.3 - npm Publication Metadata Correction
28
40
 
29
41
  Released on 2026-08-09.
package/docs/CHANGELOG.md CHANGED
@@ -17,6 +17,18 @@
17
17
 
18
18
  当前无待发布变更。
19
19
 
20
+ ## v0.3.4 - 匿名预览与可信业务身份引导
21
+
22
+ 发布日期:2026-08-14。
23
+
24
+ - **入口语义纠偏**:控制台和独立页将原“试聊”明确标识为“匿名预览”,说明它不继承中枢管理员登录态,也没有独立业务登录入口。
25
+ - **无主体引导**:未收到业务后端签发的可信票据时,Agent 会引导用户返回真实业务系统登录并重新打开或刷新助手,不索要账号、密码、Token 或用户 ID。
26
+ - **演示验证分流**:导入演示配置后,上手向导以手动“运行演示主体 Smoke”验证真实 job 和 trace;导入不自动运行任务,中枢管理员不会被提升为业务主体。
27
+ - **安全边界不变**:无验签主体时,所有 `subject.required:true` 工具(包括只读查询和写操作)仍对 Agent 不可见;业务系统仍做最终授权。
28
+ - **数据库与契约**:没有新增迁移、Schema 或 API/协议变化;最新迁移仍为 `054_demo_dataset_state.sql`。
29
+ - **验证方式**:完整 `npm run release:check`、无主体工具装配测试、匿名预览页契约、控制台真实浏览器 E2E 与 npm 制品核对。
30
+ - **相关文档**:[RELEASE_NOTES_v0.3.4.md](RELEASE_NOTES_v0.3.4.md)、[快速开始](QUICKSTART.md)、[聊天入口与身份契约](CONTRACT.md) 与 [Docker Demo](DEMO.md)。
31
+
20
32
  ## v0.3.3 - npm 发布元数据纠偏
21
33
 
22
34
  发布日期:2026-08-09。
@@ -84,6 +84,18 @@ The business system must verify the callback signature before consuming the payl
84
84
 
85
85
  ## Embedded Chat Streaming
86
86
 
87
+ ### Anonymous preview identity boundary
88
+
89
+ The standalone preview link from the Chat Entries console is always anonymous.
90
+ It carries no business ticket, does not inherit a BailingHub administrator
91
+ session, and has no business-login surface of its own. Without a trusted acting
92
+ subject, every tool declared with `subject.required: true` remains hidden,
93
+ including read-only business queries. Administrators validate the built-in demo
94
+ through the Getting Started smoke action. A real embedded page must obtain a
95
+ short-lived visitor ticket from its own authenticated business backend. A
96
+ BailingHub administrator identity must never be promoted to a business acting
97
+ subject.
98
+
87
99
  The embedded widget creates a job with `POST /chat/{entry_key}` and consumes its result through:
88
100
 
89
101
  ```http
package/docs/CONTRACT.md CHANGED
@@ -133,7 +133,9 @@ POST /admin/api/routes/auto-preview
133
133
 
134
134
  防滥用三件套:站点 **Origin 白名单**(浏览器 Origin 不可伪造;空=未限制)、**按 IP 限速**(默认 20/分钟)、入口可停用/删除。CORS 全放开(公开面无 Cookie)。
135
135
 
136
- **身份纪律(与总纲一致)**:网页访客默认是**匿名主体**。`visitor_id` 是组件存 localStorage 的随机串,只用于会话/线索连续性(同访客自动续聊),**不是身份凭证**;metadata 由中枢服务端构造,组件带不进业务操作主体——绑了工具的路由查公开数据可用,写操作业务侧自然拒(on-behalf-of 恒空)。
136
+ **身份纪律(与总纲一致)**:网页访客默认是**匿名主体**。`visitor_id` 是组件存 localStorage 的随机串,只用于会话/线索连续性(同访客自动续聊),**不是身份凭证**;metadata 由中枢服务端构造,组件带不进业务操作主体——只有不要求主体的公开能力可用于匿名访问;声明需要主体的查询和写操作均保持不可见,业务侧仍须依据空或有效的 On-Behalf-Of 做最终授权。
137
+
138
+ **匿名预览边界**:控制台「聊天入口」里的独立预览链接始终不带业务票据,也不继承中枢管理员登录态;该页面没有可供业务用户再次登录的入口。无主体时,所有声明 `subject.required:true` 的工具(包括订单查询等只读能力)在装配阶段保持不可见。内置演示能力由管理员从「上手向导」运行 smoke 验证;真实网页助手则必须由业务后端在自己的登录态里签发下面的短票据。中枢管理员身份不得自动转换为业务操作主体。
137
139
 
138
140
  **签名访客票据**:要让"登录用户"在组件里带可信身份,入口配置「票据签发方」(一个接入方 app_id)后,业务后端在登录态里用**自己的接入方 token** 签发短票:
139
141
 
package/docs/DEMO.en.md CHANGED
@@ -48,6 +48,12 @@ DEMO_PROFILE=stateless-readonly
48
48
  - `full-local` is the complete Docker demo with order lookup, ticket creation, refund approval, and failure tools.
49
49
  - `stateless-readonly` is for shared or embedded evaluation environments. Demo Business must bind to loopback, exposes only order lookup and failure observation, stores no request state, uses no Hub callback, and creates no public chat entry.
50
50
 
51
+ Business tools in both profiles require the trusted demo subject. After import,
52
+ run smoke from Getting Started so the server supplies that fixed demo subject
53
+ and creates a real job and trace. A standalone chat preview does not inherit the
54
+ BailingHub administrator identity; manually binding an entry to the demo route
55
+ does not unlock those tools for an anonymous visitor.
56
+
51
57
  Core records the exact objects it owns, together with their fingerprints, in the durable `bz_demo_datasets` manifest. Refresh and clear fail with `409` if a name is already occupied, a managed object changed, or another configuration references it. Clearing removes only unchanged, unreferenced demo configuration; jobs, messages, traces, and audit history remain intact.
52
58
 
53
59
  The Admin API is:
package/docs/DEMO.md CHANGED
@@ -93,6 +93,8 @@ DEMO_PROFILE=stateless-readonly
93
93
  - `full-local`:Docker 本地完整演示,包含查单、工单、退款审批和故障工具;
94
94
  - `stateless-readonly`:共享或宿主式体验环境,`demo-business` 必须绑定本机回环地址,只声明订单查询与故障观测工具,不保存请求状态、不使用 Hub 回调,也不创建公开聊天入口。
95
95
 
96
+ 两种 profile 的业务工具都要求可信演示主体。导入后应从「上手向导」运行 smoke,由服务端携带固定演示主体生成真实 job 与 trace。聊天入口的独立预览不会继承中枢管理员身份;即使管理员手工把入口绑定到 demo 路由,匿名预览也不会解锁这些工具。
97
+
96
98
  Core 用 `bz_demo_datasets` 中的持久 ownership manifest 记录它实际创建的固定对象和指纹。再次导入只刷新已证明归属的对象;同名占用、指纹漂移或其他配置引用都会返回 `409`,不猜测所有权。清理只删除 manifest 能证明且未被修改的演示配置,任务、消息、trace 和审计账本会继续保留。
97
99
 
98
100
  对应的 Core 后台 API 为:
@@ -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.3.3`;
10
+ - Stable baseline: `v0.3.4`;
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.3.3` 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.
35
+ The installer pulls the official `v0.3.4` 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.3.3 https://github.com/bailinghub/bailinghub.git
49
+ git clone --depth 1 --branch v0.3.4 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)"
@@ -80,6 +80,8 @@ The console is available at <http://localhost:18900/console/>:
80
80
  - Path A uses the random admin password printed when installation completes. It is also stored in the installation directory's `.env`; never attach that file to an Issue;
81
81
  - Path B uses the default demo account `admin / bailing-demo-admin`.
82
82
 
83
+ In **Chat Entries**, confirm that the list action is labeled **Anonymous Preview** and that the preview page states that it neither inherits the BailingHub administrator session nor provides a standalone business-login surface. Do not use anonymous preview to validate subject-required demo tools; the complete demo-subject path is verified by Smoke in the next step.
84
+
83
85
  ## 3. Run the smoke test
84
86
 
85
87
  For Path A, use the command printed by the installer, usually:
@@ -125,12 +127,13 @@ Pass criteria: the process exits with code `0` and ends with:
125
127
 
126
128
  ## 5. Record the result
127
129
 
128
- Record all four checkpoints:
130
+ Record all five checkpoints:
129
131
 
130
132
  | Checkpoint | PASS criteria |
131
133
  |---|---|
132
134
  | Services | Services are healthy in `docker compose ps`, and `/health` is reachable |
133
135
  | Console | You can log in and inspect the demo configuration |
136
+ | Anonymous-preview boundary | The console and preview page state that no administrator session is inherited and direct subject-required demo validation belongs to Smoke |
134
137
  | Smoke | `npm run smoke` exits with code 0 and zero failures |
135
138
  | Business loop | `npm run demo:e2e` exits with code 0 and prints `结果:demo e2e passed` |
136
139
 
@@ -138,7 +141,7 @@ Whether the result is PASS, partial, or failed, please use the [independent vali
138
141
 
139
142
  - BailingHub version, installation path, and the commit SHA when using the source path;
140
143
  - operating system, CPU architecture, Docker, and Compose versions;
141
- - the four checkpoint results;
144
+ - the five checkpoint results;
142
145
  - elapsed time excluding image downloads;
143
146
  - the first blocker and sanitized logs;
144
147
  - whether public docs were sufficient and which step was unclear.
@@ -164,7 +167,7 @@ After the core task passes, you may continue with:
164
167
  - [Trusted rich rendering and chat reliability](RELEASE_NOTES_v0.1.15.en.md).
165
168
  - [Bounded tool runtime and resilient semantic retrieval](RELEASE_NOTES_v0.1.16.en.md).
166
169
  - [Composable Core and Kernel Host API v1](RELEASE_NOTES_v0.3.0.en.md).
167
- - [Current stable release notes](RELEASE_NOTES_v0.3.3.en.md).
170
+ - [Current stable release notes](RELEASE_NOTES_v0.3.4.en.md).
168
171
 
169
172
  Select the relevant track in the same Issue form and disclose whether you received direct maintainer assistance.
170
173
 
@@ -7,7 +7,7 @@
7
7
  ## 验证范围
8
8
 
9
9
  - 验证对象:BailingHub 开源版 Docker demo;
10
- - 稳定基线:`v0.3.3`;
10
+ - 稳定基线:`v0.3.4`;
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.3.3` 官方镜像,生成随机 Token 与后台密码,启动服务并自动运行基础体检。首次管理员只在数据库管理员表为空时创建;对同一持久化数据库进行重启、升级、容器重建或重新安装,不会覆盖已经修改的管理员密码。可选 `/metrics` 端点默认关闭,不影响基础验证。请保留终端输出中的版本、安装模式、耗时和“常用命令”,但不要把密码或 Token 写入反馈。新安装 Docker 后,当前非 root 会话通常仍需使用脚本打印的 `sudo docker compose ...` 命令;重新登录后 Docker 组权限才可能生效。
35
+ 脚本默认拉取 `v0.3.4` 官方镜像,生成随机 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.3.3 https://github.com/bailinghub/bailinghub.git
49
+ git clone --depth 1 --branch v0.3.4 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)"
@@ -80,6 +80,8 @@ curl -fsS http://localhost:18900/health
80
80
  - 路径 A 使用安装完成时打印的随机后台密码;密码也保存在安装目录的 `.env`,不得提交到 Issue;
81
81
  - 路径 B 使用默认 demo 账号 `admin / bailing-demo-admin`。
82
82
 
83
+ 进入“聊天入口”时,确认列表操作显示“匿名预览”,并且预览页明确说明它不继承中枢后台登录态、没有独立业务登录入口。不要用匿名预览验证需主体的 demo 工具;完整演示主体链路由下一步 Smoke 验证。
84
+
83
85
  ## 3. 运行基础体检
84
86
 
85
87
  路径 A 使用安装器打印的命令,通常是:
@@ -125,12 +127,13 @@ docker compose exec -T bailinghub npm run demo:e2e
125
127
 
126
128
  ## 5. 记录结果
127
129
 
128
- 请记录以下四个检查点:
130
+ 请记录以下五个检查点:
129
131
 
130
132
  | 检查点 | PASS 标准 |
131
133
  |---|---|
132
134
  | 服务启动 | `docker compose ps` 中服务正常,`/health` 可访问 |
133
135
  | 控制台 | 可以登录并看到 demo 配置 |
136
+ | 匿名预览边界 | 控制台和预览页均明确说明不继承后台登录态,需主体工具应改用 Smoke 验证 |
134
137
  | 基础体检 | `npm run smoke` 退出码为 0,失败数为 0 |
135
138
  | 业务闭环 | `npm run demo:e2e` 退出码为 0,并输出 `结果:demo e2e passed` |
136
139
 
@@ -138,7 +141,7 @@ docker compose exec -T bailinghub npm run demo:e2e
138
141
 
139
142
  - BailingHub 版本、安装路径,以及源码复现时的提交号;
140
143
  - 操作系统、CPU 架构、Docker 与 Compose 版本;
141
- - 四个检查点的结果;
144
+ - 五个检查点的结果;
142
145
  - 镜像下载之外的实际耗时;
143
146
  - 第一个阻塞点和脱敏日志;
144
147
  - 是否只依赖公开文档,哪一步最不清楚。
@@ -164,7 +167,7 @@ docker compose exec -T bailinghub npm run demo:e2e
164
167
  - [可信富内容渲染与聊天可靠性](RELEASE_NOTES_v0.1.15.md)。
165
168
  - [工具运行时收敛与语义检索韧性](RELEASE_NOTES_v0.1.16.md)。
166
169
  - [可组合 Core 与 Kernel Host API v1](RELEASE_NOTES_v0.3.0.md)。
167
- - [当前稳定版发布说明](RELEASE_NOTES_v0.3.3.md)。
170
+ - [当前稳定版发布说明](RELEASE_NOTES_v0.3.4.md)。
168
171
 
169
172
  扩展验证请在同一 Issue 模板中选择对应路径,并说明是否获得过维护者的直接帮助。
170
173
 
@@ -27,6 +27,20 @@ Key objects:
27
27
  | Tool provider | A business system's agent-callable API catalog, usually OpenAPI with ACC `x-agent-capability` metadata or an SDK-generated spec. |
28
28
  | Runtime ledger | Jobs, messages, audit records, approvals, and trace events stored by the hub. |
29
29
 
30
+ ### Anonymous preview versus authenticated embedding
31
+
32
+ The standalone link opened from the Chat Entries page is an **anonymous
33
+ preview**. It does not inherit the BailingHub console login and it has no
34
+ business-login surface of its own. It is suitable for checking the widget,
35
+ public knowledge, and tools that do not require an acting subject. Tools with
36
+ `subject.required: true`, including read-only business queries, remain hidden.
37
+
38
+ Use the Getting Started smoke action to validate the built-in demo tools. For a
39
+ real embedded assistant, the business backend must sign a short-lived visitor
40
+ ticket from its own authenticated session and render it as `data-ticket`.
41
+ BailingHub verifies that ticket before using its opaque uid as the acting
42
+ subject; the integration token never belongs in browser code.
43
+
30
44
  ## Option A: Docker Demo
31
45
 
32
46
  ```bash
@@ -65,7 +65,7 @@ sh
65
65
  - 智能体技能·触发:本地智能体、脚本或第三方 agent 装个技能就会调中枢;
66
66
  - 本地执行器·干活:见第 6 步。
67
67
 
68
- 还要网页上直接聊?「聊天入口」页新建入口绑这条路由 → 拿一行 `<script>` 贴进任何网页(或直接发「在线演示页」链接给人试)。同步问答、按访客自动续聊;访客默认匿名。要带登录身份:入口配「票据签发方」,业务后端在登录页用自己的接入方 token 签短票(嵌入代码弹窗含 PHP 样例),组件 `data-ticket` 带上 → 验签通过的 uid 进任务元数据,可作工具调用的操作主体,会话跨设备连续。入口默认可上传图片、语音和常见文件(服务器本地 `data/uploads`),也可关联**媒体存储**切到业务对象存储;路由的**多模态输入策略**决定这些素材是先识别/转写/抽取,还是直送具备对应能力的模型或执行器。还能配**外观**(窗口尺寸/位置/头像/气泡图标/标题对齐)、**页面登记**让 Agent 知道访客在哪个页面提问——见下「可选增强」。
68
+ 还要网页上直接聊?「聊天入口」页新建入口绑这条路由 → 拿一行 `<script>` 贴进任意业务页面。控制台提供的独立链接是**匿名预览**:它不继承中枢后台登录态,也没有独立业务登录入口,只适合验证聊天组件、公开问答和不要求主体的工具;所有声明 `subject.required:true` 的能力(包括只读查询)都会保持隐藏。验证内置演示工具请从「上手向导」运行 smoke。真实业务页面要带登录身份时:入口配「票据签发方」,业务后端在自己的登录态里用接入方 token 签短票(嵌入代码弹窗含 PHP 样例),组件 `data-ticket` 带上 → 验签通过的 uid 进任务元数据,可作工具调用的操作主体,会话跨设备连续。入口默认可上传图片、语音和常见文件(服务器本地 `data/uploads`),也可关联**媒体存储**切到业务对象存储;路由的**多模态输入策略**决定这些素材是先识别/转写/抽取,还是直送具备对应能力的模型或执行器。还能配**外观**(窗口尺寸/位置/头像/气泡图标/标题对齐)、**页面登记**让 Agent 知道访客在哪个页面提问——见下「可选增强」。
69
69
 
70
70
  **第 6 步 · 接本地大脑**(需要时,「调度目标」):注册一个 executor 类目标。优先在路由的「调用代码 → 执行器接入」复制短引导交给 Agent;完整、版本化的接入 Skill 也可直接读取:`<中枢地址>/connect/skills/connect-bailinghub-executor/SKILL.md`。
71
71
 
package/docs/README.en.md CHANGED
@@ -97,6 +97,8 @@ This directory contains public documentation for the open-source BailingHub proj
97
97
  | [RELEASE_NOTES_v0.3.2.md](RELEASE_NOTES_v0.3.2.md) | Chinese `v0.3.2` release notes. |
98
98
  | [RELEASE_NOTES_v0.3.3.en.md](RELEASE_NOTES_v0.3.3.en.md) | `v0.3.3` npm publication provenance-metadata correction. |
99
99
  | [RELEASE_NOTES_v0.3.3.md](RELEASE_NOTES_v0.3.3.md) | Chinese `v0.3.3` release notes. |
100
+ | [RELEASE_NOTES_v0.3.4.en.md](RELEASE_NOTES_v0.3.4.en.md) | `v0.3.4` anonymous-preview and trusted-business-identity guidance. |
101
+ | [RELEASE_NOTES_v0.3.4.md](RELEASE_NOTES_v0.3.4.md) | Chinese `v0.3.4` release notes. |
100
102
  | [RELEASE_NOTES_v0.1.0.en.md](RELEASE_NOTES_v0.1.0.en.md) | First public release notes. |
101
103
  | [CHANGELOG.en.md](CHANGELOG.en.md) | Public changelog format and current release summary. |
102
104
  | [COMPATIBILITY.en.md](COMPATIBILITY.en.md) | Versioning, compatibility, migration, and schema discipline. |
package/docs/README.md CHANGED
@@ -110,6 +110,8 @@
110
110
  | [RELEASE_NOTES_v0.3.2.en.md](RELEASE_NOTES_v0.3.2.en.md) | English `v0.3.2` managed demo dataset onboarding. |
111
111
  | [RELEASE_NOTES_v0.3.3.md](RELEASE_NOTES_v0.3.3.md) | `v0.3.3` npm 发布来源元数据纠偏说明。 |
112
112
  | [RELEASE_NOTES_v0.3.3.en.md](RELEASE_NOTES_v0.3.3.en.md) | English `v0.3.3` npm publication provenance-metadata correction. |
113
+ | [RELEASE_NOTES_v0.3.4.md](RELEASE_NOTES_v0.3.4.md) | `v0.3.4` 匿名预览与可信业务身份引导说明。 |
114
+ | [RELEASE_NOTES_v0.3.4.en.md](RELEASE_NOTES_v0.3.4.en.md) | English `v0.3.4` anonymous-preview and trusted-business-identity guidance. |
113
115
  | [RELEASE_NOTES_v0.1.0.md](RELEASE_NOTES_v0.1.0.md) | 首个公开版本的 GitHub Release 草稿。 |
114
116
  | [RELEASE_NOTES_v0.1.0.en.md](RELEASE_NOTES_v0.1.0.en.md) | English release notes. |
115
117
  | [CHANGELOG.md](CHANGELOG.md) | 公开发布后的对外变更记录。 |
@@ -0,0 +1,38 @@
1
+ # BailingHub v0.3.4: Anonymous Preview and Trusted Business Identity Guidance
2
+
3
+ `v0.3.4` clarifies the user journey between a chat-entry preview, the built-in demo, and a real trusted business identity. The console action previously presented as a generic trial chat is now explicitly labeled **Anonymous Preview**, so administrators and visitors are not led to assume that a BailingHub console session automatically becomes a business-operation subject.
4
+
5
+ ## Main changes
6
+
7
+ - **Explicit anonymous-preview semantics**: the chat-entry list, embed dialog, and standalone preview page now state that the preview does not inherit the BailingHub administrator session and has no standalone business-login surface.
8
+ - **Accurate no-subject guidance**: when a conversation has no trusted identity ticket signed by the business backend, the Agent explains that the user must return to the real business system, sign in there, and reopen or refresh the assistant. It must not claim that the preview can perform a login or ask for an account, password, token, or user ID.
9
+ - **Separate demo validation path**: after managed demo configuration is imported, Getting Started presents **Run Demo-Subject Smoke** as the next explicit action. Smoke uses a controlled demo subject and creates a real job and trace. Importing configuration does not run a task automatically and does not promote the administrator into a business subject.
10
+ - **More precise ticket configuration**: the console now explains that the business-identity ticket issuer only declares which client may sign tickets for the entry. A trusted business subject exists only when the backend of an authenticated business system signs a short-lived ticket and its page supplies `data-ticket`.
11
+
12
+ ## Identity and authorization boundary
13
+
14
+ This release does not relax any identity or tool gate:
15
+
16
+ - `visitor_id` remains anonymous conversation continuity data, not an identity credential;
17
+ - without a verified ticket that establishes a trusted subject, every tool declared with `subject.required:true`, including read-only queries and writes, remains hidden from the Agent;
18
+ - ticket verification establishes a trusted business subject and makes subject-required tools eligible, but the real business system must still perform final authorization from On-Behalf-Of and its own permissions;
19
+ - a BailingHub administrator is never automatically converted into a business user.
20
+
21
+ ## Compatibility and upgrade
22
+
23
+ - There is no new database migration or Schema change. `054_demo_dataset_state.sql` remains the latest migration.
24
+ - There is no new or changed HTTP API, Client API, Kernel Host API v1, chat protocol, Executor Protocol, ACC contract, ticket format, tool signature, or approval semantic.
25
+ - Existing anonymous entries and ticket-bearing embeds require no integration change. The changes primarily improve console, preview-page, and no-subject response semantics.
26
+ - Deployments on `v0.3.3` can upgrade as a normal patch release.
27
+
28
+ ## Validation
29
+
30
+ The release gate covers the complete `npm run release:check`, no-subject tool-assembly tests, the anonymous-preview page contract, real-browser console E2E, demo-subject Smoke, bilingual documentation, and npm artifact consistency.
31
+
32
+ ## Related documentation
33
+
34
+ - [Quickstart](QUICKSTART.en.md)
35
+ - [Chat entry and identity contract](CONTRACT.en.md)
36
+ - [Docker Demo](DEMO.en.md)
37
+ - [User guide: core concepts](user-guide/concepts.en.md)
38
+ - [中文发布说明](RELEASE_NOTES_v0.3.4.md)
@@ -0,0 +1,38 @@
1
+ # BailingHub v0.3.4:匿名预览与可信业务身份引导
2
+
3
+ `v0.3.4` 收紧了聊天入口、内置演示和真实业务身份之间的用户引导。控制台原“试聊”入口现在明确标识为“匿名预览”,避免让管理员或访客误以为中枢后台登录态会自动变成业务操作主体。
4
+
5
+ ## 主要变化
6
+
7
+ - **匿名预览语义**:聊天入口列表、嵌入弹窗和独立预览页统一说明,该页不继承中枢管理员登录态,也不提供独立业务登录入口。
8
+ - **无主体时的正确引导**:当会话没有收到业务后端签发的可信身份票据时,Agent 会说明应返回真实业务系统完成登录并重新打开或刷新助手;不会声称预览页可自行登录,也不会索要账号、密码、Token 或用户 ID。
9
+ - **演示验证分流**:导入内置演示配置后,上手向导将“运行演示主体 Smoke”作为明确的下一步。Smoke 使用受控演示主体产生真实 job 和 trace;导入配置本身不会自动运行任务,也不会把管理员提升为业务主体。
10
+ - **票据配置更准确**:控制台明确“业务身份票据签发方”只表示入口支持哪个接入方签票。只有已登录业务系统的后端签发短票并由页面携带 `data-ticket` 时,才会建立可信业务主体。
11
+
12
+ ## 身份与授权边界
13
+
14
+ 本版本没有放宽身份或工具闸门:
15
+
16
+ - `visitor_id` 仍只用于匿名会话连续性,不是身份凭证;
17
+ - 没有通过验签票据建立可信主体时,所有声明 `subject.required:true` 的工具(包括只读查询和写操作)仍不会向 Agent 暴露;
18
+ - 票据验证只建立可信业务主体并让需主体工具进入候选清单,真实业务系统仍必须根据 On-Behalf-Of 和自身权限做最终授权;
19
+ - 中枢管理员身份不会自动转换为任何业务用户。
20
+
21
+ ## 兼容性与升级
22
+
23
+ - 无新增数据库迁移或 Schema 变化;最新迁移仍为 `054_demo_dataset_state.sql`。
24
+ - 无新增或变更 HTTP API、Client API、Kernel Host API v1、聊天协议、Executor Protocol、ACC、票据格式、工具签名或审批语义。
25
+ - 现有匿名入口和携票据嵌入代码无需修改;主要变化是控制台、预览页和无主体回答的准确语义。
26
+ - 已部署 `v0.3.3` 的实例可按普通补丁版本升级。
27
+
28
+ ## 验证
29
+
30
+ 发布门禁覆盖完整 `npm run release:check`、无主体工具装配测试、匿名预览页契约、控制台真实浏览器 E2E、演示主体 Smoke、双语文档和 npm 制品一致性检查。
31
+
32
+ ## 相关文档
33
+
34
+ - [快速开始](QUICKSTART.md)
35
+ - [聊天入口与身份契约](CONTRACT.md)
36
+ - [Docker Demo](DEMO.md)
37
+ - [用户指南:核心概念](user-guide/concepts.md)
38
+ - [English release notes](RELEASE_NOTES_v0.3.4.en.md)
@@ -39,6 +39,14 @@ Knowledge bases provide retrievable documents such as manuals, policies, product
39
39
 
40
40
  A web chat entry binds a public widget to a route. A business backend may sign a visitor ticket so the hub can carry a trusted acting subject into business-tool calls.
41
41
 
42
+ The standalone link opened from the console is only an anonymous preview. It
43
+ does not inherit the BailingHub administrator session and has no business-login
44
+ surface of its own. Every tool that requires an acting subject, including
45
+ read-only queries and write operations, remains hidden. For authenticated use,
46
+ the business backend signs the identity ticket from its own user session; the
47
+ business system still makes the final authorization decision, and a BailingHub
48
+ administrator is never promoted to a business acting subject.
49
+
42
50
  ## Inbound Channel
43
51
 
44
52
  An inbound channel adapts messages from systems such as WeCom, DingTalk, or Feishu into a route. Channel credentials and reply constraints stay in the channel adapter, not the route core.
@@ -66,4 +74,3 @@ For “let logged-in users ask about their order and create a support request,
66
74
  - support knowledge;
67
75
  - the final reply or callback path;
68
76
  - approval only for operations that require it.
69
-
@@ -148,7 +148,9 @@
148
148
 
149
149
  聊天入口解决的是“用户从网页上怎么和这条路由对话”。
150
150
 
151
- 如果需要让登录用户带可信身份,业务后端应签发访客票据,组件带票进入中枢。中枢只验证票据,真正的权限仍由业务系统在工具接口里裁决。
151
+ 控制台打开的独立链接只是匿名预览:不继承中枢管理员登录态,也没有独立业务登录入口。所有声明需要主体的工具,包括只读查询和写操作,都会保持不可见。
152
+
153
+ 如果需要让已登录业务用户带可信身份,业务后端应在自己的登录态里签发身份票据,组件带票进入中枢。中枢只验证票据,真正的权限仍由业务系统在工具接口里裁决;中枢管理员身份不会自动转换为业务操作主体。
152
154
 
153
155
  ## 入站渠道:让外部平台消息进中枢
154
156
 
@@ -300,7 +300,7 @@
300
300
 
301
301
  - `entry_key`
302
302
  - `<script>` 嵌入代码
303
- - 在线演示地址
303
+ - 匿名预览地址(不继承中枢后台登录态,也没有独立业务登录入口)
304
304
  - 票据签发说明
305
305
  - 评价记录
306
306
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bailinghub",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Open-source ACC runtime and agent control plane for existing business systems.",
@@ -100,6 +100,7 @@ const englishCompanions = {
100
100
  'docs/RELEASE_NOTES_v0.3.1.md': 'docs/RELEASE_NOTES_v0.3.1.en.md',
101
101
  'docs/RELEASE_NOTES_v0.3.2.md': 'docs/RELEASE_NOTES_v0.3.2.en.md',
102
102
  'docs/RELEASE_NOTES_v0.3.3.md': 'docs/RELEASE_NOTES_v0.3.3.en.md',
103
+ 'docs/RELEASE_NOTES_v0.3.4.md': 'docs/RELEASE_NOTES_v0.3.4.en.md',
103
104
  'docs/TOOLS_DESIGN.md': 'docs/TOOLS_DESIGN.en.md',
104
105
  'docs/TOOLS_MODEL.md': 'docs/TOOLS_MODEL.en.md',
105
106
  'docs/AI友好工具设计指南.md': 'docs/AI_FRIENDLY_TOOLS.en.md',
@@ -9,7 +9,7 @@ REGISTRY="${BAILING_IMAGE_REGISTRY:-$DEFAULT_REGISTRY}"
9
9
  NAMESPACE="${BAILING_IMAGE_NAMESPACE:-$DEFAULT_NAMESPACE}"
10
10
  PACKAGE_VERSION="$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' package.json | head -1)"
11
11
  TAG="${BAILING_IMAGE_TAG:-$PACKAGE_VERSION}"
12
- [ -n "$TAG" ] || TAG="0.3.3"
12
+ [ -n "$TAG" ] || TAG="0.3.4"
13
13
  MYSQL_TAG="${BAILING_MYSQL_IMAGE_TAG:-8.4}"
14
14
  MYSQL_IMAGE="${BAILING_MYSQL_IMAGE:-$REGISTRY/$NAMESPACE/bailing-mysql:$MYSQL_TAG}"
15
15
  PLATFORM="${BAILING_IMAGE_PLATFORM:-linux/amd64}"
@@ -38,8 +38,8 @@ function updateJson(root, relativePath, update) {
38
38
  test('current release surface is internally consistent', () => {
39
39
  const result = checkReleaseConsistency({ root: repoRoot });
40
40
  assert.deepEqual(result.findings, []);
41
- assert.equal(result.version, '0.3.3');
42
- assert.equal(result.stableVersion, '0.3.3');
41
+ assert.equal(result.version, '0.3.4');
42
+ assert.equal(result.stableVersion, '0.3.4');
43
43
  assert.equal(result.publishTag, 'latest');
44
44
  });
45
45
 
@@ -51,13 +51,13 @@ for (const [label, tag] of [
51
51
  const root = createFixture();
52
52
  try {
53
53
  updateJson(root, 'package.json', (pkg) => {
54
- pkg.version = '0.3.3-rc.1';
54
+ pkg.version = '0.3.4-rc.1';
55
55
  if (tag === undefined) delete pkg.publishConfig;
56
56
  else pkg.publishConfig = { tag };
57
57
  });
58
58
  updateJson(root, 'package-lock.json', (lock) => {
59
- lock.version = '0.3.3-rc.1';
60
- lock.packages[''].version = '0.3.3-rc.1';
59
+ lock.version = '0.3.4-rc.1';
60
+ lock.packages[''].version = '0.3.4-rc.1';
61
61
  });
62
62
 
63
63
  const result = checkReleaseConsistency({ root });
@@ -60,6 +60,16 @@ const fixtures = {
60
60
  }],
61
61
  clients: [{ app_id: 'demo-app', name: 'Demo 业务系统', token: '****oken', allowed_routes: ['demo_support'], allowed_channels: [], rate_limit_per_min: 60, enabled: true }],
62
62
  routes: [{ route_key: 'demo_support', name: 'Demo 售后助手', target: 'demo-agent', enabled: true, tools: { sources: [{ provider: 'demo-business', allow: ['demo.*'] }], max_calls: 5 } }],
63
+ demoStatus: { available: true, imported: true, empty: false },
64
+ chatEntries: [{
65
+ entry_key: 'demo-chat',
66
+ name: 'Demo 在线助手',
67
+ route_key: 'demo_support',
68
+ allowed_origins: ['https://example.com'],
69
+ ticket_client: 'demo-app',
70
+ rate_limit_per_min: 20,
71
+ enabled: true,
72
+ }],
63
73
  runs: [{ job_id: '00000000-0000-4000-8000-000000000001', request_id: 'demo-e2e', status: 'done', route: 'demo_support', created_at: new Date().toISOString(), updated_at: new Date().toISOString() }],
64
74
  threads: [{
65
75
  thread_id: 1,
@@ -74,6 +84,8 @@ const fixtures = {
74
84
  }],
75
85
  };
76
86
 
87
+ let smokeRequests = 0;
88
+
77
89
  function tracePayload() {
78
90
  return {
79
91
  job: { ...fixtures.runs[0], target: 'demo-agent', usage: { duration_ms: 1200, tokens: 0 }, dispatch: { tools: { sources: [{ provider: 'demo-business', allow: ['demo.*'] }] } } },
@@ -93,8 +105,9 @@ async function mockApi(context) {
93
105
  await context.route('**/health', (route) => route.fulfill({ json: { status: 'ok', paused: false, queue: { running: 0, waiting: 0 }, backend: 'mysql', configBackend: true } }));
94
106
  await context.route('**/admin/api/me', (route) => route.fulfill({ json: { username: 'admin', role: 'admin', perms: ['*'] } }));
95
107
  await context.route('**/admin/api/status', (route) => route.fulfill({ json: { executors: [{ executor_id: 'demo-exec', online: true, targets: ['demo-agent'] }] } }));
96
- await context.route('**/admin/api/smoke', (route) => route.fulfill({
97
- json: {
108
+ await context.route('**/admin/api/smoke', (route) => {
109
+ smokeRequests += 1;
110
+ return route.fulfill({ json: {
98
111
  hub: 'http://127.0.0.1',
99
112
  pass: 3,
100
113
  fail: 0,
@@ -105,16 +118,17 @@ async function mockApi(context) {
105
118
  { name: 'trace', status: 'pass', detail: 'trace ok' },
106
119
  ],
107
120
  run: { route: 'demo_support', request_id: 'demo-e2e', job_id: fixtures.runs[0].job_id, status: 'done' },
108
- },
109
- }));
121
+ } });
122
+ });
110
123
  await context.route('**/admin/api/config-schemas/*', (route) => route.fulfill({ json: { required: [], properties: {} } }));
111
124
  await context.route('**/admin/api/tool-providers/*/tools', (route) => route.fulfill({ json: { tools: [{ name: 'list_demo_orders', scope: 'demo.order.read' }] } }));
112
125
  await context.route('**/admin/api/runs/*/trace', (route) => route.fulfill({ json: tracePayload() }));
113
126
  await context.route('**/admin/api/**', (route) => {
114
127
  const url = new URL(route.request().url());
115
128
  if (url.pathname === '/admin/api/me') return route.fulfill({ json: { username: 'admin', role: 'admin', perms: ['*'] } });
116
- if (url.pathname === '/admin/api/smoke') return route.fulfill({
117
- json: {
129
+ if (url.pathname === '/admin/api/smoke') {
130
+ smokeRequests += 1;
131
+ return route.fulfill({ json: {
118
132
  hub: 'http://127.0.0.1',
119
133
  pass: 3,
120
134
  fail: 0,
@@ -125,8 +139,8 @@ async function mockApi(context) {
125
139
  { name: 'trace', status: 'pass', detail: 'trace ok' },
126
140
  ],
127
141
  run: { route: 'demo_support', request_id: 'demo-e2e', job_id: fixtures.runs[0].job_id, status: 'done' },
128
- },
129
- });
142
+ } });
143
+ }
130
144
  if (url.pathname === '/admin/api/credentials') return route.fulfill({ json: fixtures.credentials });
131
145
  if (url.pathname === '/admin/api/targets') return route.fulfill({ json: fixtures.targets });
132
146
  if (url.pathname === '/admin/api/tool-providers') return route.fulfill({ json: fixtures.providers });
@@ -146,7 +160,8 @@ async function mockApi(context) {
146
160
  });
147
161
  if (url.pathname === '/admin/api/executors') return route.fulfill({ json: [{ executor_id: 'demo-exec', online: true, targets: ['demo-agent'] }] });
148
162
  if (url.pathname === '/admin/api/projects') return route.fulfill({ json: [] });
149
- if (url.pathname === '/admin/api/chat-entries') return route.fulfill({ json: [] });
163
+ if (url.pathname === '/admin/api/demo-dataset/status') return route.fulfill({ json: fixtures.demoStatus });
164
+ if (url.pathname === '/admin/api/chat-entries') return route.fulfill({ json: fixtures.chatEntries });
150
165
  if (url.pathname === '/admin/api/channels') return route.fulfill({ json: [] });
151
166
  if (url.pathname === '/admin/api/kb') return route.fulfill({ json: [] });
152
167
  return route.fulfill({ status: 404, json: { error: `unmocked ${url.pathname}` } });
@@ -174,9 +189,22 @@ try {
174
189
  await expectVisible(page, '配置完成度');
175
190
  await expectVisible(page, '模型凭证');
176
191
  await expectVisible(page, '触发路由');
177
- await page.getByRole('button', { name: '运行 smoke' }).first().click();
192
+ await expectVisible(page, '演示数据已导入,运行演示主体 Smoke');
193
+ if (smokeRequests !== 0) throw new Error('导入演示数据后不应自动运行 Smoke');
194
+ const demoSmokeButton = page.getByRole('button', { name: '运行演示主体 Smoke' }).first();
195
+ if (!(await demoSmokeButton.getAttribute('class'))?.includes('el-button--primary')) {
196
+ throw new Error('演示数据已导入时,运行演示主体 Smoke 应是主 CTA');
197
+ }
198
+ await demoSmokeButton.click();
199
+ if (smokeRequests !== 1) throw new Error('Smoke 应只在用户点击后运行一次');
178
200
  await expectVisible(page, '通过 3');
179
201
 
202
+ await page.getByRole('menuitem', { name: '聊天入口' }).click();
203
+ await expectVisible(page, '“匿名预览”不会继承中枢后台登录状态');
204
+ await expectVisible(page, '包括只读查询和写操作');
205
+ await expectVisible(page, '支持业务身份票据:demo-app');
206
+ await expectVisible(page, '匿名预览');
207
+
180
208
  await page.getByRole('menuitem', { name: '触发路由' }).click();
181
209
  await expectVisible(page, 'Demo 售后助手');
182
210