bailinghub 0.3.4 → 0.4.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 +3 -1
- package/README.md +3 -0
- package/docker-compose.images.yml +2 -2
- package/docs/CHANGELOG.en.md +46 -1
- package/docs/CHANGELOG.md +14 -1
- package/docs/COMPATIBILITY.en.md +25 -0
- package/docs/CONTRACT.en.md +79 -8
- package/docs/CONTRACT.md +36 -6
- package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
- package/docs/INDEPENDENT_VALIDATION.md +4 -4
- package/docs/QUICKSTART.en.md +6 -0
- package/docs/QUICKSTART.md +1 -1
- package/docs/README.en.md +2 -0
- package/docs/README.md +2 -0
- package/docs/RELEASE_NOTES_v0.4.0.en.md +39 -0
- package/docs/RELEASE_NOTES_v0.4.0.md +39 -0
- package/docs/STREAMING.en.md +32 -0
- package/docs/STREAMING.md +8 -2
- package/docs/WIDGET_RENDERERS.en.md +123 -6
- package/docs/WIDGET_RENDERERS.md +75 -6
- package/docs/user-guide/console-map.en.md +1 -2
- package/docs/user-guide/console-map.md +2 -2
- package/docs//345/205/274/345/256/271/346/200/247/344/270/216/345/215/207/347/272/247.md +9 -0
- package/package.json +1 -1
- package/schemas/config/chat-entry.schema.json +2 -1
- package/scripts/check-doc-links.mjs +1 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-release-consistency.test.mjs +5 -5
- package/scripts/install.sh +1 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +1 -0
- package/scripts/verify-github-repo.mjs +1 -0
- package/scripts/widget-renderer-test.mjs +244 -16
- package/src/core/config/config-models.test.ts +18 -1
- package/src/core/config/config-models.ts +25 -3
- package/src/core/config/config-schema.test.ts +2 -0
- package/src/core/contracts/types.ts +2 -1
- package/src/core/platform/chat-form.test.ts +147 -0
- package/src/core/platform/chat-form.ts +402 -0
- package/src/core/platform/version.ts +1 -1
- package/src/core/runtime/execution-runtime.test.ts +61 -0
- package/src/core/runtime/execution-runtime.ts +17 -0
- package/src/routes/chat.test.ts +319 -7
- package/src/routes/chat.ts +166 -21
- package/web/console/assets/{Accounts-CAwrtBiS.js → Accounts-DuUY2UJU.js} +1 -1
- package/web/console/assets/{Approvals-C2BZ86T3.js → Approvals-B11mo1dy.js} +1 -1
- package/web/console/assets/{Audit-B-E4Y_Up.js → Audit-CQwJRIJT.js} +1 -1
- package/web/console/assets/{BrandLockup-C18u8Lx5.js → BrandLockup-BIF-h1pi.js} +1 -1
- package/web/console/assets/{Channels-DTy8ylH-.js → Channels-BIploUT-.js} +1 -1
- package/web/console/assets/ChatEntries-Cpg_WV-o.js +7 -0
- package/web/console/assets/ChatEntries-DsYtcXN6.css +1 -0
- package/web/console/assets/{Clients-DWs9JFr0.js → Clients-DS29eUi2.js} +1 -1
- package/web/console/assets/{Cost-2SSYs1AT.js → Cost-BF52tfU2.js} +1 -1
- package/web/console/assets/{Credentials-B79LtxCE.js → Credentials-SwfmQAv6.js} +1 -1
- package/web/console/assets/{Diagnostics-BakcRYvb.js → Diagnostics-CJfbI_8p.js} +1 -1
- package/web/console/assets/{Executors-BXoyo28u.js → Executors-CzlZlznA.js} +1 -1
- package/web/console/assets/{Kb-ISbzquab.js → Kb-CVX22U4k.js} +1 -1
- package/web/console/assets/{Login-Dlu6Wgcf.js → Login-PoUVsBI-.js} +1 -1
- package/web/console/assets/{Projects-DFzmtnqg.js → Projects-DYlbjLQy.js} +1 -1
- package/web/console/assets/{Routes-B-hm9HGY.js → Routes-DSEvGujN.js} +1 -1
- package/web/console/assets/{Runs-hMRu1im3.js → Runs-B-TsYZEt.js} +1 -1
- package/web/console/assets/{Setup-CrBAV-b9.js → Setup-xiPXit_b.js} +1 -1
- package/web/console/assets/{Shell-B1a8DvXQ.js → Shell-DNiWZOYB.js} +1 -1
- package/web/console/assets/{StorageBuckets-BRfL_eHb.js → StorageBuckets-Bjsc3pLd.js} +1 -1
- package/web/console/assets/{SystemSettings-CyirVLbq.js → SystemSettings-CcKF2lJ9.js} +1 -1
- package/web/console/assets/{SystemStatus-DZ_OR7sk.js → SystemStatus-Oj1xjxJn.js} +1 -1
- package/web/console/assets/{Targets-CtIMa66c.js → Targets-y1KllVXT.js} +1 -1
- package/web/console/assets/{Tools-BfDZHt01.js → Tools-DoEP_y9x.js} +1 -1
- package/web/console/assets/{index-DBiByFiO.js → index-CxPIS6G7.js} +2 -2
- package/web/console/assets/{request-DY2cxQqZ.js → request-CBLNpLth.js} +1 -1
- package/web/console/assets/{schema-6mCQ7rR5.js → schema-DzwLpuOy.js} +1 -1
- package/web/console/index.html +1 -1
- package/web/widget/widget.js +493 -14
- package/web-admin/src/pages/ChatEntries.vue +18 -6
- package/web/console/assets/ChatEntries-9xbRiQov.css +0 -1
- package/web/console/assets/ChatEntries-DvD-4IeE.js +0 -7
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.
|
|
232
|
+
- [Latest Release Notes](docs/RELEASE_NOTES_v0.4.0.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)
|
|
@@ -251,6 +251,8 @@ Useful reports include the business context, expected behavior, a minimal reprod
|
|
|
251
251
|
|
|
252
252
|
We welcome independent distributions, industry adaptations, executors, connectors, and independent ACC implementations. Community projects may keep their own names, directions, and governance. Reusable improvements are welcome upstream, and strong independent projects may request a future listing on the official ecosystem surface. A listing is not certification, a service warranty, or a transfer of maintenance responsibility. See [Community Derivatives And Ecosystem Collaboration](docs/ECOSYSTEM.en.md).
|
|
253
253
|
|
|
254
|
+
DeepSeek Harness users can install the independent community plugin [dsh-bailinghub](https://github.com/bailinghub/bailinghub-dsh-plugin) to submit and track governed tasks from the local Harness Web UI against a business route already connected to BailingHub. The plugin reuses the public Client API and the independent MCP Server, does not enter the BailingHub Core distribution, and does not imply DeepSeek development, certification, or endorsement.
|
|
255
|
+
|
|
254
256
|
## Open-Source Foundations and Third-Party Software
|
|
255
257
|
|
|
256
258
|
BailingHub adopts the open [Agent Capability Contract (ACC)](https://www.agentcapability.org), runs its service on Node.js and TypeScript, builds its console with Vue, Element Plus, and Pinia, and uses an independent MySQL service as the default persistent runtime.
|
package/README.md
CHANGED
|
@@ -230,6 +230,7 @@ BAILING_SMOKE_RUN_ROUTE=<route-key> npm run smoke
|
|
|
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
232
|
| `docs/RELEASE_NOTES_v0.3.4.md` | `v0.3.4` 匿名预览与可信业务身份引导说明 |
|
|
233
|
+
| `docs/RELEASE_NOTES_v0.4.0.md` | `v0.4.0` 原生对话表单与聊天入口控制说明 |
|
|
233
234
|
| `docs/RELEASE_NOTES_v0.1.0.md` | 首个公开版本的发布说明 |
|
|
234
235
|
| `docs/兼容性与升级.md` | 版本发布策略:SemVer、稳定契约、数据库结构纪律、发布记录要求 |
|
|
235
236
|
| `sql/` | 中枢**独立**状态库 DDL(`bz_` 前缀,按序号演进);数据库结构演进纪律见 [sql/README.md](sql/README.md) |
|
|
@@ -262,6 +263,8 @@ BailingHub 当前公开版本仍处于早期验证阶段。我们希望它经得
|
|
|
262
263
|
|
|
263
264
|
我们欢迎社区创建独立发行版、行业适配、执行器、连接器和 ACC 独立实现。衍生项目可以保持自己的名称、方向与治理;通用改进欢迎回到上游,优秀的独立项目未来也可以申请在官方生态页面展示。展示不代表官方认证、服务担保或维护责任转移。完整原则见 [社区衍生与生态合作](docs/ECOSYSTEM.md)。
|
|
264
265
|
|
|
266
|
+
DeepSeek Harness 用户可以安装独立社区插件 [dsh-bailinghub](https://github.com/bailinghub/bailinghub-dsh-plugin),直接从本机 Harness Web UI 向已接入 BailingHub 的业务 route 发起并跟踪受控任务。该插件复用公开 Client API 与独立 MCP Server,不进入 BailingHub Core 发行包,也不代表 DeepSeek 官方开发、认证或背书。
|
|
267
|
+
|
|
265
268
|
## 开源基础与第三方软件
|
|
266
269
|
|
|
267
270
|
百灵中枢采用开放的 [ACC(Agent Capability Contract)](https://www.agentcapability.org) 能力声明契约,服务端基于 Node.js / TypeScript,控制台基于 Vue / Element Plus / Pinia,默认使用独立的 MySQL 服务持久化运行状态。
|
|
@@ -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.
|
|
21
|
+
image: ${BAILING_DEMO_BUSINESS_IMAGE:-crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailing-demo-business:0.4.0}
|
|
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.
|
|
32
|
+
image: ${BAILINGHUB_IMAGE:-crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailinghub:0.4.0}
|
|
33
33
|
depends_on:
|
|
34
34
|
mysql:
|
|
35
35
|
condition: service_healthy
|
package/docs/CHANGELOG.en.md
CHANGED
|
@@ -22,7 +22,52 @@ Each public version should describe:
|
|
|
22
22
|
|
|
23
23
|
## Unreleased
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## v0.4.0 - Native Conversational Forms and Chat-Entry Controls
|
|
26
|
+
|
|
27
|
+
Released on 2026-08-25.
|
|
28
|
+
|
|
29
|
+
- **Origin allowlist guardrails**: chat-entry saves now accept only
|
|
30
|
+
`scheme://host[:port]`, canonicalize and deduplicate entries, and report the
|
|
31
|
+
persisted restriction count in the console. A non-allowlisted browser Origin
|
|
32
|
+
is rejected with 403 before a conversation job can start.
|
|
33
|
+
- **Default-open chat entries**: appearance configuration adds an opt-in,
|
|
34
|
+
default-false `default_open` setting. When enabled, existing official widget
|
|
35
|
+
embeds open on load without changing page markup. The existing
|
|
36
|
+
`data-open="1"` force-open behavior remains compatible.
|
|
37
|
+
- **Native conversational forms**: the dependency-free official widget adds
|
|
38
|
+
constrained `bailing-form` v1 controls for text, textarea, number, date,
|
|
39
|
+
boolean, single-select, and multi-select fields, with client/server
|
|
40
|
+
validation, read-only receipts, and history recovery.
|
|
41
|
+
- **Non-blocking continuation contract**: `POST /chat/:entry` compatibly adds
|
|
42
|
+
`interaction_response`, translating submit or cancel into a new user message
|
|
43
|
+
and a new job in the same thread. The source job still reaches `done`; there
|
|
44
|
+
is no `input_required` or new SSE state.
|
|
45
|
+
- **Correlation, idempotency, and security**: the server reloads the
|
|
46
|
+
authoritative form after matching source job, entry, identity, and thread,
|
|
47
|
+
then deduplicates by `submission_id`. Forms cannot request credential or
|
|
48
|
+
payment secrets and do not replace tool approval, business authorization, or
|
|
49
|
+
side-effect gates.
|
|
50
|
+
- **Presentation negotiation**: the LLM receives constrained form-output
|
|
51
|
+
guidance only when the client explicitly advertises `bailing-form`. Other
|
|
52
|
+
clients continue with text questions, and `bailing-chart` remains an
|
|
53
|
+
independent compatible capability.
|
|
54
|
+
- **Ecosystem documentation discovery**: the README links to an independently
|
|
55
|
+
maintained community plugin for DeepSeek Harness. It is not part of
|
|
56
|
+
BailingHub Core and does not imply official DeepSeek development,
|
|
57
|
+
certification, endorsement, or adoption.
|
|
58
|
+
- **Contract and integration impact**: the public boundary advances additively
|
|
59
|
+
to `bailing.contract.v2.14`; `WIDGET_API` and `rendererApiVersion` remain 1,
|
|
60
|
+
with no database migration. Client API v1, Kernel Host API v1, ACC, SDKs,
|
|
61
|
+
tool signatures, approval semantics, and final business authorization are
|
|
62
|
+
unchanged.
|
|
63
|
+
- **Validation**: `npm run typecheck`, focused conversational-form contract and
|
|
64
|
+
route tests, `npm run widget:renderer:test`, `npm run web-admin:check`,
|
|
65
|
+
`npm run docs:check`, `npm test`, and a real local-browser form interaction
|
|
66
|
+
check.
|
|
67
|
+
- **Related docs**: [RELEASE_NOTES_v0.4.0.en.md](RELEASE_NOTES_v0.4.0.en.md),
|
|
68
|
+
[HTTP contract](CONTRACT.en.md), [Widget renderer and form
|
|
69
|
+
contract](WIDGET_RENDERERS.en.md), [Streaming protocol](STREAMING.en.md), and
|
|
70
|
+
[Compatibility](COMPATIBILITY.en.md).
|
|
26
71
|
|
|
27
72
|
## v0.3.4 - Anonymous Preview and Trusted Business Identity Guidance
|
|
28
73
|
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -15,7 +15,20 @@
|
|
|
15
15
|
|
|
16
16
|
## Unreleased
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
## v0.4.0 - 原生对话表单与聊天入口控制
|
|
19
|
+
|
|
20
|
+
发布日期:2026-08-25。
|
|
21
|
+
|
|
22
|
+
- **Origin 白名单防误配**:聊天入口保存时仅接受 `scheme://host[:port]`,统一规范化、去重并在控制台回显实际限制数;非白名单浏览器 Origin 在进入对话任务前返回 403。
|
|
23
|
+
- **聊天入口默认展开**:外观配置新增默认关闭的 `default_open`;开启后已嵌入的官方 Widget 加载即展开,业务页面无需改脚本。既有 `data-open="1"` 强制展开行为保持兼容。
|
|
24
|
+
- **原生对话表单**:官方零依赖 Widget 新增受限 `bailing-form` v1,支持文本、多行文本、数字、日期、布尔、单选和多选,含客户端/服务端双校验、只读回执与历史恢复。
|
|
25
|
+
- **非阻塞续聊契约**:`POST /chat/:entry` 兼容新增 `interaction_response`,把表单提交/取消规范化为同 thread 的新用户消息和新 job;源 job 仍正常 `done`,不新增 `input_required` 或 SSE 状态。
|
|
26
|
+
- **关联、幂等与安全**:服务端按源 job/入口/身份/thread 重读权威表单验值,以 `submission_id` 去重;表单不能要求凭据或支付秘密,不替代工具审批、业务授权或副作用闸门。
|
|
27
|
+
- **展示能力协商**:只在客户端明确声明 `bailing-form` 时向 LLM 注入受约束输出提示;无能力客户端继续使用文字提问,`bailing-chart` 能力保持独立兼容。
|
|
28
|
+
- **生态文档发现**:README 增加独立维护的 DeepSeek Harness 社区插件链接;它不进入 BailingHub Core,也不代表 DeepSeek 官方开发、认证、背书或采用。
|
|
29
|
+
- **契约与对接影响**:公开边界增量到 `bailing.contract.v2.14`;`WIDGET_API` / `rendererApiVersion` 仍为 1,无数据库迁移。Client API v1、Kernel Host API v1、ACC、SDK、工具签名、审批语义和最终业务授权不变。
|
|
30
|
+
- **验证方式**:`npm run typecheck`、对话表单契约/路由测试、`npm run widget:renderer:test`、`npm run web-admin:check`、`npm run docs:check`、`npm test` 与本地真实浏览器表单交互检查。
|
|
31
|
+
- **相关文档**:[RELEASE_NOTES_v0.4.0.md](RELEASE_NOTES_v0.4.0.md)、[公开运行时契约](CONTRACT.md)、[Widget 渲染与表单契约](WIDGET_RENDERERS.md)、[流式协议](STREAMING.md) 与[兼容性与升级](兼容性与升级.md)。
|
|
19
32
|
|
|
20
33
|
## v0.3.4 - 匿名预览与可信业务身份引导
|
|
21
34
|
|
package/docs/COMPATIBILITY.en.md
CHANGED
|
@@ -82,6 +82,31 @@ transition window. The widget core remains dependency-free; see
|
|
|
82
82
|
[WIDGET_RENDERERS.en.md](WIDGET_RENDERERS.en.md) for registration, cleanup, and
|
|
83
83
|
fallback rules.
|
|
84
84
|
|
|
85
|
+
The `bailing-form` v1 addition under `bailing.contract.v2.14` follows that
|
|
86
|
+
compatibility rule:
|
|
87
|
+
|
|
88
|
+
- Existing `{message,...}` chat requests are unchanged.
|
|
89
|
+
`interaction_response` is an optional alternative input to
|
|
90
|
+
`POST /chat/:entry`. This public Chat addition is outside
|
|
91
|
+
`bailing.client-api.v1` and does not change Client API, Kernel Host API, ACC,
|
|
92
|
+
or SDK versions.
|
|
93
|
+
- The official widget adds the built-in `bailing-form` type. Older or custom
|
|
94
|
+
clients still fall back to its safe fenced code block. A custom client should
|
|
95
|
+
advertise `client_capabilities.renderers:["bailing-form"]` only after it
|
|
96
|
+
implements the complete validation and response lifecycle.
|
|
97
|
+
- The renderer `mount` context gains optional `message` and `respond`
|
|
98
|
+
properties. Existing JavaScript destructuring ignores additional properties,
|
|
99
|
+
so both `WIDGET_API` and `rendererApiVersion` remain 1.
|
|
100
|
+
- A form response creates a new job in the same thread. It changes neither the
|
|
101
|
+
source job's terminal state, the `bailing.chat.stream.v1` event set, nor the
|
|
102
|
+
database schema. Existing proxies, SSE clients, and upgrade flows need no new
|
|
103
|
+
waiting state.
|
|
104
|
+
|
|
105
|
+
The official `widget.js` and Chat endpoints ship from the same Hub artifact, so
|
|
106
|
+
a normal upgrade obtains both rendering and response handling. Clear any
|
|
107
|
+
separately cached legacy widget during rollout, and do not advertise the new
|
|
108
|
+
capability from a custom client against an older Hub.
|
|
109
|
+
|
|
85
110
|
## URL Tool Catalog Access Policy Upgrade
|
|
86
111
|
|
|
87
112
|
The release that introduces `053_tool_spec_access_policy.sql` adds two nullable columns to `bz_tool_providers`. Keep the normal backup, `db:init`, and restart order. The public configuration surface always has exactly two values, `signed_required` and `public_allowed`; new URL providers default to the former.
|
package/docs/CONTRACT.en.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# HTTP Contract
|
|
2
2
|
|
|
3
|
-
> Current contract: `bailing.contract.v2.
|
|
3
|
+
> Current contract: `bailing.contract.v2.14`. This is the only network boundary between a business system and BailingHub.
|
|
4
4
|
|
|
5
5
|
This document summarizes the public wire contract between a business system and BailingHub.
|
|
6
6
|
|
|
@@ -96,6 +96,21 @@ short-lived visitor ticket from its own authenticated business backend. A
|
|
|
96
96
|
BailingHub administrator identity must never be promoted to a business acting
|
|
97
97
|
subject.
|
|
98
98
|
|
|
99
|
+
The public entry configuration includes optional appearance settings. The
|
|
100
|
+
`default_open` flag defaults to `false`; when it is `true`, the official widget
|
|
101
|
+
opens its panel after loading. Existing embeds with `data-open="1"` also keep
|
|
102
|
+
forcing the panel open, independently of this entry setting. Because the
|
|
103
|
+
widget fetches entry configuration on every page load, changing this option in
|
|
104
|
+
the console does not require changing host-page markup.
|
|
105
|
+
|
|
106
|
+
Each Origin allowlist item must be an HTTP(S) `scheme://host[:port]` value.
|
|
107
|
+
Chat-entry saves canonicalize and deduplicate origins and reject paths, query
|
|
108
|
+
strings, user information, and fragments. When a browser sends an Origin that
|
|
109
|
+
is not allowlisted, public chat endpoints return 403 before starting a job. An
|
|
110
|
+
empty list remains unrestricted, and requests without a browser Origin remain
|
|
111
|
+
compatible with mini-program and server-side callers. The Origin allowlist is
|
|
112
|
+
therefore a browser anti-embedding boundary, not server-side authentication.
|
|
113
|
+
|
|
99
114
|
The embedded widget creates a job with `POST /chat/{entry_key}` and consumes its result through:
|
|
100
115
|
|
|
101
116
|
```http
|
|
@@ -109,15 +124,71 @@ Incremental text is provisional transport data. It is not a durable conversation
|
|
|
109
124
|
|
|
110
125
|
See [STREAMING.en.md](STREAMING.en.md) for event payloads, reconnect rules, provider fallback, audit boundaries, and multi-replica deployment requirements.
|
|
111
126
|
|
|
127
|
+
### Non-blocking `bailing-form` responses
|
|
128
|
+
|
|
129
|
+
`POST /chat/{entry_key}` accepts exactly one user input shape: a normal non-empty
|
|
130
|
+
`message`, or an `interaction_response` to a form rendered by an earlier final
|
|
131
|
+
reply. Both shapes keep the existing optional `visitor_id`, `ticket`,
|
|
132
|
+
`thread_id`, `context`, and `client_capabilities` fields.
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"visitor_id": "visitor_01HXYZ",
|
|
137
|
+
"thread_id": "support_1",
|
|
138
|
+
"interaction_response": {
|
|
139
|
+
"type": "bailing-form",
|
|
140
|
+
"version": 1,
|
|
141
|
+
"source_job_id": "job_that_rendered_the_form",
|
|
142
|
+
"form_id": "refund_info",
|
|
143
|
+
"submission_id": "01JFORMRESPONSE0001",
|
|
144
|
+
"action": "submit",
|
|
145
|
+
"values": {
|
|
146
|
+
"reason": "The item arrived damaged",
|
|
147
|
+
"method": "original"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The source job has already reached `done`. Submitting or cancelling the form
|
|
154
|
+
creates a new user turn and a new job in the same thread; it does not pause or
|
|
155
|
+
resume the source job and adds no `input_required` or SSE status. `action` is
|
|
156
|
+
`submit` or `cancel`; submit requires a values object, while cancel cannot carry
|
|
157
|
+
non-empty values.
|
|
158
|
+
|
|
159
|
+
The server reloads the immutable final reply from `source_job_id` and validates
|
|
160
|
+
that the source job is done and belongs to the same entry, verified uid or
|
|
161
|
+
anonymous visitor, and thread. Values are validated against the matching source
|
|
162
|
+
form declaration, never against a client-supplied schema. A stable
|
|
163
|
+
`submission_id` matches `[A-Za-z0-9_-]{8,64}`. It makes retries for the same
|
|
164
|
+
source job and form return the original job, optionally with `deduped:true`,
|
|
165
|
+
instead of running twice, and must not be reused for different values. The
|
|
166
|
+
serialized `values` object is capped at 32 KiB.
|
|
167
|
+
|
|
168
|
+
After validation, the server builds a self-contained user message from the
|
|
169
|
+
original field labels and choices. Values are therefore durable conversation
|
|
170
|
+
ledger content. Job metadata and the optional history `interaction` summary
|
|
171
|
+
retain only `type`, `version`, `source_job_id`, `form_id`, `submission_id`, and
|
|
172
|
+
`action`, without duplicating values. Form data remains untrusted user data and
|
|
173
|
+
cannot change identity, routing, tool allowlists, approval, or final business
|
|
174
|
+
authorization. A form must not request passwords, API keys, tokens, private
|
|
175
|
+
keys, or payment credentials, and it is not a substitute for the governed tool
|
|
176
|
+
approval path.
|
|
177
|
+
|
|
178
|
+
If the canonical user message would exceed 4,000 characters, the server returns
|
|
179
|
+
400 instead of silently truncating form values. Keep the same `submission_id`,
|
|
180
|
+
shorten the entered content, and retry.
|
|
181
|
+
|
|
112
182
|
### Optional Widget Renderers
|
|
113
183
|
|
|
114
|
-
Charts and
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
184
|
+
Charts and forms do not add a new server-side attachment type or change the
|
|
185
|
+
canonical `reply` payload. Both consume declarative fenced payloads. A host page
|
|
186
|
+
may register a trusted chart renderer through
|
|
187
|
+
`window.BailingChat.registerRenderer(...)`; the official widget provides the
|
|
188
|
+
constrained `bailing-form` and posts its response through the contract above.
|
|
189
|
+
Unknown types, invalid JSON, oversized payloads, or renderer failures fall back
|
|
190
|
+
to a text code block. See [WIDGET_RENDERERS.en.md](WIDGET_RENDERERS.en.md) for
|
|
191
|
+
the full trust and lifecycle contract.
|
|
121
192
|
|
|
122
193
|
## Tool Provider Spec
|
|
123
194
|
|
package/docs/CONTRACT.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 百灵中枢 · 边界契约
|
|
2
2
|
|
|
3
|
-
> 当前契约:`bailing.contract.v2.
|
|
3
|
+
> 当前契约:`bailing.contract.v2.14`。这是业务系统与中枢之间唯一的网络边界。
|
|
4
4
|
|
|
5
5
|
**冻结它,两边就能各自独立开发。** 任何字段变更都按兼容方式演进(只增不改语义、不删字段)。
|
|
6
6
|
|
|
@@ -121,17 +121,47 @@ POST /admin/api/routes/auto-preview
|
|
|
121
121
|
|
|
122
122
|
| 端点 | 说明 |
|
|
123
123
|
|---|---|
|
|
124
|
-
| `POST /chat/:entry_key` |
|
|
124
|
+
| `POST /chat/:entry_key` | 请求体必须在普通消息 `{message, ...}` 与表单回传 `{interaction_response, ...}` 中**二选一**;其余既有可选字段(`visitor_id` / `ticket` / `thread_id` / `context` / `client_capabilities`)按原语义共用。`thread_id`(字母数字_-,≤32 字符):同一身份下的平行会话切分键——开新会话=换新值,延续已有会话=复用,不带=单线程续聊;会话与对话总账同键切分,且写入 `metadata.thread_id` 供任务详情对账。返回 `{done:false, job_id, visitor_id}` 后,组件通过 SSE 结果流接收状态和最终回答 |
|
|
125
125
|
| `GET /chat/:entry_key/events/:job_id` | **SSE 结果流**:只能订阅本入口发起的任务。基础事件为 `open/status/ping/done/failed/timeout`;支持增量输出时还会发送 `phase/reset/delta`。`done` 携带任务库中的权威最终结果 `{done:true, reply, job_id, visitor_id, references?, attachments?}`。完整语义见 [STREAMING.md](STREAMING.md) |
|
|
126
|
-
| `GET /chat/:entry_key/thread?visitor_id=&thread_id=&ticket=` |
|
|
127
|
-
| `GET /chat/:entry_key/config` | 组件状态与配置:停用入口返回 `{enabled:false}
|
|
126
|
+
| `GET /chat/:entry_key/thread?visitor_id=&thread_id=&ticket=` | **拉服务端会话总账**:组件重开、表单回执恢复,或异步迟到结果(如审批批准后重跑的回复落在另一条任务里)回灌用——按与提问一致的身份重建线索、只读返回正序消息。表单回传对应的用户消息可附带不含表单值的 `interaction` 关联摘要。身份纪律同 `POST /chat`(带票按 uid、无票按 visitor,票坏=401) |
|
|
127
|
+
| `GET /chat/:entry_key/config` | 组件状态与配置:停用入口返回 `{enabled:false}`,组件静默不挂载;启用时返回标题/开场白/主色/品牌,**外观**(默认展开/窗口尺寸/标题对齐/气泡位置与偏移/头像/自定义气泡图标/底部品牌标识)、`upload`。`default_open` 缺省为 `false`;设为 `true` 或脚本带 `data-open="1"` 都会在加载后展开。控制台改完后,业务页面无需改嵌入代码 |
|
|
128
128
|
| `POST /chat/:entry_key/rate/:job_id` | **评价回答**:体 `{rating:"up"\|"down"\|"note", visitor_id, comment?}`;`note` 表示只提交文字反馈,此时 `comment` 必填。只能评自己问出来的那条(visitor_id 须与提问时一致);一答一评,重评覆盖。运营在控制台「聊天入口 → 评价」看汇总 |
|
|
129
129
|
|
|
130
|
+
### 1.1.1 `bailing-form` 非阻塞交互回传
|
|
131
|
+
|
|
132
|
+
当最终 `done.reply` 含有符合 [WIDGET_RENDERERS.md](WIDGET_RENDERERS.md) 的 `bailing-form` fenced payload 时,官方 Widget 可把它渲染为受约束表单。当前助手任务在输出该回答后依然正常进入 `done`;用户提交或取消表单时,Widget 对**同一 `thread_id`** 再发一次 `POST /chat/:entry_key`,创建新的用户轮次和新 job。该机制不引入 `input_required` 或新的 SSE 任务状态。
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"visitor_id": "visitor_01HXYZ",
|
|
137
|
+
"thread_id": "support_1",
|
|
138
|
+
"interaction_response": {
|
|
139
|
+
"type": "bailing-form",
|
|
140
|
+
"version": 1,
|
|
141
|
+
"source_job_id": "job_that_rendered_the_form",
|
|
142
|
+
"form_id": "refund_info",
|
|
143
|
+
"submission_id": "01JFORMRESPONSE0001",
|
|
144
|
+
"action": "submit",
|
|
145
|
+
"values": {
|
|
146
|
+
"reason": "商品破损",
|
|
147
|
+
"method": "original"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
- `action` 只接受 `submit` 或 `cancel`。`submit` 必须带 `values` 对象;`cancel` 不得携带非空值。
|
|
154
|
+
- 服务端不信任客户端回传的 schema。它会重新读取 `source_job_id` 的权威最终回复,校验该 job 已 `done`、属于同一入口、同一已验签 uid 或匿名 visitor、同一 thread,并依据其中同 `form_id` 的不可变表单声明验证字段、必填、长度、范围和选项。
|
|
155
|
+
- `submission_id` 匹配 `[A-Za-z0-9_-]{8,64}`,是这次回传的幂等键。同一身份对同一 `source_job_id + form_id + submission_id` 重试时返回原 job,并可附带 `deduped:true`,不重复运行。客户端不得把同一 `submission_id` 复用给另一组值。`values` 序列化后最大 32 KiB。
|
|
156
|
+
- 校验通过后,服务端按原声明的字段标签与选项生成自包含的用户消息,再进入普通聊天运行时。字段值会随该用户消息进入对话总账;job metadata 与历史 `interaction` 摘要只保留 `type/version/source_job_id/form_id/submission_id/action`,不重复存储值。
|
|
157
|
+
- 规范化后的用户消息超过 4000 字时返回 400,不会静默截断表单值;客户端应保留原 `submission_id`、缩短填写内容后再提交。
|
|
158
|
+
- 表单值仍是不可信用户数据,不能改变身份、路由、工具白名单、审批或业务授权。表单不得索要密码、API Key、Token、私钥或支付凭据;需要审批或产生业务副作用的动作仍须走 §2.4 的工具治理车道。
|
|
159
|
+
|
|
130
160
|
**引用来源**:路由挂了知识库时,回答附 `references: [{seq, title, score, snippet}]`(本次检索命中),正文中模型按 `[n]` 标注实际引用的资料编号——消费方可据此展示"答案出处"。完整快照(含 doc_id)在 job 的 `dispatch.kb_refs`,`/run` 触发的任务同样携带。
|
|
131
161
|
|
|
132
162
|
**富内容**:`reply` 为 markdown;同时附 `attachments`(图片/文件的结构化数组),无 markdown 渲染器的端据此渲染——见 §2.5。
|
|
133
163
|
|
|
134
|
-
防滥用三件套:站点 **Origin 白名单**(浏览器 Origin 不可伪造;空=未限制)、**按 IP 限速**(默认 20
|
|
164
|
+
防滥用三件套:站点 **Origin 白名单**(浏览器 Origin 不可伪造;空=未限制)、**按 IP 限速**(默认 20/分钟)、入口可停用/删除。白名单每项只接受 `scheme://host[:port]`,保存时按 URL origin 规范化并去重;带路径、参数、用户信息或片段的值会拒绝保存。浏览器携带的 Origin 不在白名单时,公开聊天端点在进入任务链路前返回 403。无 Origin 的小程序/服务端请求按既有契约保持兼容;因此 Origin 白名单是浏览器防盗嵌边界,不是服务端身份鉴权。CORS 全放开(公开面无 Cookie),最终是否放行以服务端白名单裁决为准。
|
|
135
165
|
|
|
136
166
|
**身份纪律(与总纲一致)**:网页访客默认是**匿名主体**。`visitor_id` 是组件存 localStorage 的随机串,只用于会话/线索连续性(同访客自动续聊),**不是身份凭证**;metadata 由中枢服务端构造,组件带不进业务操作主体——只有不要求主体的公开能力可用于匿名访问;声明需要主体的查询和写操作均保持不可见,业务侧仍须依据空或有效的 On-Behalf-Of 做最终授权。
|
|
137
167
|
|
|
@@ -593,7 +623,7 @@ AI 的回复是 **GitHub 风味 markdown**。为让没有 markdown 渲染器的
|
|
|
593
623
|
|
|
594
624
|
约束:图片/文件本体存放在业务自己的存储/CDN(中枢只透传 url,不代管二进制);同一 url 在 attachments 内去重。
|
|
595
625
|
|
|
596
|
-
>
|
|
626
|
+
> **聊天组件专用的图表和表单不是新的服务端 `attachments` 类型。** 它们消费回复中的声明式 fenced payload;图表可由宿主通过 `window.BailingChat.registerRenderer(...)` 扩展,`bailing-form` 由官方 Widget 受限渲染并通过 §1.1.1 回传。未知类型、无效 JSON、超限载荷或渲染失败必须降级为纯文本代码块。回复契约保持 `reply/text + attachments` 不变,完整边界见 [WIDGET_RENDERERS.md](WIDGET_RENDERERS.md)。
|
|
597
627
|
|
|
598
628
|
## 2.6 入站渠道:外部平台消息进中枢
|
|
599
629
|
|
|
@@ -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.4.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.4.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.4.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.4.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.4.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.4.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.4.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.4.0.md)。
|
|
171
171
|
|
|
172
172
|
扩展验证请在同一 Issue 模板中选择对应路径,并说明是否获得过维护者的直接帮助。
|
|
173
173
|
|
package/docs/QUICKSTART.en.md
CHANGED
|
@@ -41,6 +41,12 @@ ticket from its own authenticated session and render it as `data-ticket`.
|
|
|
41
41
|
BailingHub verifies that ticket before using its opaque uid as the acting
|
|
42
42
|
subject; the integration token never belongs in browser code.
|
|
43
43
|
|
|
44
|
+
Chat Entry appearance settings can optionally open the official widget as soon
|
|
45
|
+
as an embedded page loads. This setting is off by default, and existing
|
|
46
|
+
`data-open="1"` embeds continue to force the same behavior. Since the widget
|
|
47
|
+
loads entry configuration at startup, changing the setting does not require a
|
|
48
|
+
host-page code change.
|
|
49
|
+
|
|
44
50
|
## Option A: Docker Demo
|
|
45
51
|
|
|
46
52
|
```bash
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -117,7 +117,7 @@ node bailing-executor.mjs --hub <中枢地址> --targets <目标名> \
|
|
|
117
117
|
- **聊天附件上传**(「媒体存储」+「聊天入口」):不开任何对象存储也能用,默认写服务器 `data/uploads` 并返回 `/uploads/*` 公开 URL;生产需要 CDN、生命周期管理或多副本共享时,再登记业务对象存储(当前 COS:region/bucket/AK·SK/公开域名/写入前缀)并让聊天入口关联它。图片、语音、文件都会得到**永久 URL**,一份存储喂三件事:完整追溯 / 多模态输入策略 / 业务接口入参。路由决定图片、语音、文件分别走识别、转写、文本抽取、摘要、直送或忽略;指向业务自己的桶则 URL 即业务 CDN、零转存。见 CONTRACT §2.4e。
|
|
118
118
|
- **对话记忆**(「触发路由 → 对话记忆」):长会话开**滚动摘要**(默认关、不改原行为)——超水位线的早期对话异步压缩成结构化摘要,后续连摘要一起注入,上下文不爆。
|
|
119
119
|
- **页面感知**(「聊天入口 → 页面登记」):配 URL 模式 → 页面名+说明的登记表,AI 据此知道访客在哪页提问、精准定位;路由再开「页面感知检索」可偏置召回本页相关文档(全局仍兜底)。见 CONTRACT §1.2。
|
|
120
|
-
-
|
|
120
|
+
- **组件外观与运营启停**(「聊天入口」):默认展开、窗口尺寸/高度、标题对齐、气泡贴左/右下角与像素偏移、头部头像、自定义气泡图标、底部品牌标识都可配置;入口可在列表一键暂停,已嵌入页面无需删除脚本,恢复后自动重新展示。
|
|
121
121
|
|
|
122
122
|
## 不同形态怎么配(速查)
|
|
123
123
|
|
package/docs/README.en.md
CHANGED
|
@@ -99,6 +99,8 @@ This directory contains public documentation for the open-source BailingHub proj
|
|
|
99
99
|
| [RELEASE_NOTES_v0.3.3.md](RELEASE_NOTES_v0.3.3.md) | Chinese `v0.3.3` release notes. |
|
|
100
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
101
|
| [RELEASE_NOTES_v0.3.4.md](RELEASE_NOTES_v0.3.4.md) | Chinese `v0.3.4` release notes. |
|
|
102
|
+
| [RELEASE_NOTES_v0.4.0.en.md](RELEASE_NOTES_v0.4.0.en.md) | `v0.4.0` native conversational forms and chat-entry controls. |
|
|
103
|
+
| [RELEASE_NOTES_v0.4.0.md](RELEASE_NOTES_v0.4.0.md) | Chinese `v0.4.0` release notes. |
|
|
102
104
|
| [RELEASE_NOTES_v0.1.0.en.md](RELEASE_NOTES_v0.1.0.en.md) | First public release notes. |
|
|
103
105
|
| [CHANGELOG.en.md](CHANGELOG.en.md) | Public changelog format and current release summary. |
|
|
104
106
|
| [COMPATIBILITY.en.md](COMPATIBILITY.en.md) | Versioning, compatibility, migration, and schema discipline. |
|
package/docs/README.md
CHANGED
|
@@ -112,6 +112,8 @@
|
|
|
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
113
|
| [RELEASE_NOTES_v0.3.4.md](RELEASE_NOTES_v0.3.4.md) | `v0.3.4` 匿名预览与可信业务身份引导说明。 |
|
|
114
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. |
|
|
115
|
+
| [RELEASE_NOTES_v0.4.0.md](RELEASE_NOTES_v0.4.0.md) | `v0.4.0` 原生对话表单与聊天入口控制说明。 |
|
|
116
|
+
| [RELEASE_NOTES_v0.4.0.en.md](RELEASE_NOTES_v0.4.0.en.md) | English `v0.4.0` native conversational forms and chat-entry controls. |
|
|
115
117
|
| [RELEASE_NOTES_v0.1.0.md](RELEASE_NOTES_v0.1.0.md) | 首个公开版本的 GitHub Release 草稿。 |
|
|
116
118
|
| [RELEASE_NOTES_v0.1.0.en.md](RELEASE_NOTES_v0.1.0.en.md) | English release notes. |
|
|
117
119
|
| [CHANGELOG.md](CHANGELOG.md) | 公开发布后的对外变更记录。 |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# BailingHub v0.4.0: Native Conversational Forms and Chat-Entry Controls
|
|
2
|
+
|
|
3
|
+
`v0.4.0` adds constrained native conversational forms to the official web widget and completes chat-entry controls for default-open presentation and browser Origin allowlists. Forms reuse the existing presentation-capability negotiation and non-blocking conversation model rather than introducing a second task state or approval protocol.
|
|
4
|
+
|
|
5
|
+
## Main changes
|
|
6
|
+
|
|
7
|
+
- **Native conversational forms**: the dependency-free official widget supports `bailing-form` v1 for text, textarea, number, date, boolean, single-select, and multi-select fields, with client/server validation, submission receipts, and history recovery.
|
|
8
|
+
- **Proactive information collection**: the built-in LLM receives constrained form guidance only when the client explicitly advertises `bailing-form`. When the context shows that several fields are required before the task can continue, the model may emit a form proactively without waiting for the user to request one.
|
|
9
|
+
- **Non-blocking continuation**: the source answer still reaches `done`. Submit, cancel, or skip creates a new user turn and job in the same thread, without adding `input_required` or changing existing SSE terminal semantics.
|
|
10
|
+
- **Default-open entries**: appearance configuration adds a default-false `default_open` setting. When enabled, existing official embeds open on load without page changes; the existing `data-open="1"` force-open behavior remains compatible.
|
|
11
|
+
- **Origin allowlist guardrails**: the console accepts exact `scheme://host[:port]` origins, canonicalizes and deduplicates them, and rejects non-allowlisted browser Origins with 403 before a job starts. Invalid formats or types return 400.
|
|
12
|
+
- **Ecosystem documentation discovery**: the README links to an independently maintained community plugin for DeepSeek Harness. The link is not part of BailingHub Core and does not imply official DeepSeek development, certification, endorsement, or adoption.
|
|
13
|
+
|
|
14
|
+
## Security and trust boundaries
|
|
15
|
+
|
|
16
|
+
- The server reloads the authoritative form from the source job's final reply and matches entry, identity, thread, and `submission_id`; a client-supplied Schema cannot rewrite submission rules.
|
|
17
|
+
- Forms cannot request passwords, tokens, API keys, private keys, or payment credentials, and cannot change identity, routing, tool eligibility, approval, business permissions, or side-effect gates.
|
|
18
|
+
- Ordinary form values follow existing chat semantics and enter the conversation ledger and model context. Deployers remain responsible for their own retention, privacy notice, and compliance policies.
|
|
19
|
+
- The Origin allowlist prevents direct browser re-embedding; it is not server authentication. An empty array remains unrestricted, and existing server or mini-program calls without Origin remain compatible. Use request signing or a business identity ticket when non-browser callers must be restricted.
|
|
20
|
+
- Custom or external executors do not automatically receive the built-in LLM form prompt and must implement the same public output contract themselves.
|
|
21
|
+
|
|
22
|
+
## Compatibility and upgrade
|
|
23
|
+
|
|
24
|
+
- The public contract advances additively to `bailing.contract.v2.14`; `WIDGET_API` and `rendererApiVersion` remain 1.
|
|
25
|
+
- There is no new database migration. `054_demo_dataset_state.sql` remains the latest migration.
|
|
26
|
+
- Client API v1, Kernel Host API v1, Executor Protocol, ACC, SDKs, tool signatures, approval semantics, and final business authorization remain unchanged.
|
|
27
|
+
- Existing chat entries remain collapsed by default, and existing `allowed_origins: []` remains unrestricted. To restrict browser embeds, save exact origins without paths, query strings, or wildcards.
|
|
28
|
+
|
|
29
|
+
## Validation
|
|
30
|
+
|
|
31
|
+
The release gate covers the complete `npm run release:check`, 554 Core tests, real-browser widget interaction, console builds, bilingual documentation, OSS boundaries, security scans, Client API contracts, and npm artifact consistency. Proactive form output, submission continuation, history recovery, default-open presentation, and non-allowlisted browser rejection also completed real end-to-end validation.
|
|
32
|
+
|
|
33
|
+
## Related documentation
|
|
34
|
+
|
|
35
|
+
- [Public runtime contract](CONTRACT.en.md)
|
|
36
|
+
- [Widget renderer and form contract](WIDGET_RENDERERS.en.md)
|
|
37
|
+
- [Streaming protocol](STREAMING.en.md)
|
|
38
|
+
- [Compatibility and upgrade](COMPATIBILITY.en.md)
|
|
39
|
+
- [中文发布说明](RELEASE_NOTES_v0.4.0.md)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# BailingHub v0.4.0:原生对话表单与聊天入口控制
|
|
2
|
+
|
|
3
|
+
`v0.4.0` 为官方网页聊天组件增加受约束的原生对话表单,并补齐聊天入口的默认展开与浏览器 Origin 白名单配置。表单沿用现有展示能力协商与非阻塞会话模型,不建立第二套任务状态或审批协议。
|
|
4
|
+
|
|
5
|
+
## 主要变化
|
|
6
|
+
|
|
7
|
+
- **原生对话表单**:官方零依赖 Widget 支持 `bailing-form` v1,可安全渲染文本、多行文本、数字、日期、布尔、单选和多选字段,并提供客户端/服务端双重校验、提交回执与历史恢复。
|
|
8
|
+
- **主动收集信息**:只有客户端明确声明支持 `bailing-form` 时,内置 LLM 才会收到受限表单输出指引。当上下文表明继续任务必须一次补齐多项信息时,模型可以主动输出表单,无需用户先要求“输出一个表单”。
|
|
9
|
+
- **非阻塞续聊**:源回答仍正常进入 `done`;提交、取消或跳过表单会在同一 thread 创建新的用户轮次和 job,不新增 `input_required`,也不改变既有 SSE 终态。
|
|
10
|
+
- **默认展开**:聊天入口外观新增默认关闭的 `default_open`。开启后现有官方嵌入脚本加载即展开,无需修改业务页面;原有 `data-open="1"` 强制展开方式继续兼容。
|
|
11
|
+
- **Origin 白名单防误配**:控制台只接受精确 `scheme://host[:port]`,保存时规范化并去重;非白名单浏览器 Origin 在创建任务前返回 403,非法或错误类型配置返回 400。
|
|
12
|
+
- **生态文档发现**:README 增加独立维护的 DeepSeek Harness 社区插件链接;该链接不进入 BailingHub Core,也不代表 DeepSeek 官方开发、认证、背书或采用。
|
|
13
|
+
|
|
14
|
+
## 安全与信任边界
|
|
15
|
+
|
|
16
|
+
- 表单 Schema 从源 job 的权威最终回复重新读取;服务端同时核对入口、身份、thread 与 `submission_id`,客户端不能用自带 Schema 改写提交规则。
|
|
17
|
+
- 表单不能请求密码、Token、API Key、私钥或支付凭据,也不能改变身份、路由、工具白名单、审批、业务权限或副作用闸门。
|
|
18
|
+
- 普通表单值会按既有聊天语义进入对话总账和模型上下文,部署方仍需执行自己的数据保留、隐私告知与合规策略。
|
|
19
|
+
- Origin 白名单只防浏览器直接盗嵌,不是服务端鉴权。空数组仍表示不限制;不带 Origin 的小程序或服务端请求继续按既有契约放行,需要限制此类调用时应使用签名或业务票据。
|
|
20
|
+
- 自定义或外部 executor 不会自动获得内置 LLM 的表单提示,接入方需要自行遵守同一公开输出契约。
|
|
21
|
+
|
|
22
|
+
## 兼容性与升级
|
|
23
|
+
|
|
24
|
+
- 公开契约增量到 `bailing.contract.v2.14`;`WIDGET_API` 与 `rendererApiVersion` 仍为 1。
|
|
25
|
+
- 没有新增数据库迁移,最新迁移仍为 `054_demo_dataset_state.sql`。
|
|
26
|
+
- Client API v1、Kernel Host API v1、Executor Protocol、ACC、SDK、工具签名、审批语义与业务系统最终授权保持不变。
|
|
27
|
+
- 既有聊天入口默认保持收起;既有 `allowed_origins: []` 继续表示不限制。需要限制网页嵌入时,应在控制台保存精确来源,不要填写路径、查询参数或通配符。
|
|
28
|
+
|
|
29
|
+
## 验证
|
|
30
|
+
|
|
31
|
+
发布门禁覆盖完整 `npm run release:check`、554 项 Core 测试、Widget 真实浏览器交互、控制台构建、双语文档、OSS 边界、安全扫描、Client API 契约与 npm 制品一致性检查。主动表单、提交续轮、刷新恢复、默认展开和非白名单浏览器拒绝也完成了真实端到端验证。
|
|
32
|
+
|
|
33
|
+
## 相关文档
|
|
34
|
+
|
|
35
|
+
- [公开运行时契约](CONTRACT.md)
|
|
36
|
+
- [Widget 渲染与表单契约](WIDGET_RENDERERS.md)
|
|
37
|
+
- [流式协议](STREAMING.md)
|
|
38
|
+
- [兼容性与升级](兼容性与升级.md)
|
|
39
|
+
- [English release notes](RELEASE_NOTES_v0.4.0.en.md)
|
package/docs/STREAMING.en.md
CHANGED
|
@@ -63,6 +63,38 @@ Reverse proxies and CDNs must disable response buffering, preserve `text/event-s
|
|
|
63
63
|
- Existing clients may ignore `phase`, `reset`, and `delta` and wait for `done`.
|
|
64
64
|
- New clients must treat `done`, not accumulated fragments, as the final authoritative value.
|
|
65
65
|
|
|
66
|
+
### 7.1 Presentation capability negotiation
|
|
67
|
+
|
|
68
|
+
A custom client may advertise only the declarative renderers it has actually
|
|
69
|
+
installed and validated:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"client_capabilities": {
|
|
74
|
+
"renderers": ["bailing-chart", "bailing-form"]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This affects optional model presentation guidance only. It is not an SSE
|
|
80
|
+
field and cannot change identity, authorization, approval, or tool access.
|
|
81
|
+
Charts and forms remain fenced content inside `done.reply`; never mount either
|
|
82
|
+
from provisional `delta` text. Apply the allowlist and fallback rules in
|
|
83
|
+
[WIDGET_RENDERERS.en.md](WIDGET_RENDERERS.en.md) only after `done`.
|
|
84
|
+
|
|
85
|
+
### 7.2 A form response does not add stream states
|
|
86
|
+
|
|
87
|
+
A `bailing-form` is final declarative content in `done.reply`. Its source job
|
|
88
|
+
is already terminal; it never enters a waiting-for-input or `input_required`
|
|
89
|
+
state. Submit or cancel makes a new `POST /chat/:entry_key`, creating a new job
|
|
90
|
+
in the same thread. That new job uses the existing
|
|
91
|
+
`open/status/phase/reset/delta/ping/done/failed/timeout` event set.
|
|
92
|
+
|
|
93
|
+
Retain the source `done.job_id` as `source_job_id` and subscribe separately to
|
|
94
|
+
the new job. Do not keep or resume the closed source-job stream. Cross-device
|
|
95
|
+
receipt recovery comes from the durable `/thread` ledger, not the incremental
|
|
96
|
+
replay window.
|
|
97
|
+
|
|
66
98
|
## 8. Validation
|
|
67
99
|
|
|
68
100
|
```bash
|
package/docs/STREAMING.md
CHANGED
|
@@ -87,12 +87,18 @@
|
|
|
87
87
|
```json
|
|
88
88
|
{
|
|
89
89
|
"client_capabilities": {
|
|
90
|
-
"renderers": ["bailing-chart"]
|
|
90
|
+
"renderers": ["bailing-chart", "bailing-form"]
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
该字段只影响模型收到的可选展示提示,不进入 SSE 事件,不构成身份、授权、审批或工具权限。富内容仍属于 `done.reply` 的一部分;客户端不得在 `delta`
|
|
95
|
+
该字段只影响模型收到的可选展示提示,不进入 SSE 事件,不构成身份、授权、审批或工具权限。富内容仍属于 `done.reply` 的一部分;客户端不得在 `delta` 阶段挂载图表或表单,应在 `done` 后按 [`WIDGET_RENDERERS.md`](WIDGET_RENDERERS.md) 的白名单与失败降级规则处理完整 fenced code block。
|
|
96
|
+
|
|
97
|
+
### 7.2 表单回传不改变流式状态机
|
|
98
|
+
|
|
99
|
+
`bailing-form` 是 `done.reply` 中的最终声明式内容。源 job 输出表单后已经终态 `done`,不会进入“等待填写”或 `input_required`。用户提交/取消表单时,客户端向同一聊天入口发起新 `POST /chat/:entry_key`;服务端在同 thread 创建新 job,该 job 仍使用本文现有的 `open/status/phase/reset/delta/ping/done/failed/timeout` 集合。
|
|
100
|
+
|
|
101
|
+
因此客户端要保留源 `done.job_id` 作为回传的 `source_job_id`,另外订阅新 job 的 SSE;不得继续占用或恢复源 job 的已关闭连接。表单回执的跨设备恢复来自 `/thread` 权威总账,不来自增量回放窗口。
|
|
96
102
|
|
|
97
103
|
## 8. 验证
|
|
98
104
|
|