bailinghub 0.6.1 โ 0.7.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 +9 -5
- package/README.md +8 -5
- 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.md +4 -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/CHANGELOG.en.md +14 -1
- package/docs/CHANGELOG.md +14 -1
- package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
- package/docs/INDEPENDENT_VALIDATION.md +4 -4
- package/docs/LOCAL_AGENT_SETUP.en.md +116 -0
- package/docs/LOCAL_AGENT_SETUP.md +116 -0
- package/docs/README.en.md +6 -0
- package/docs/README.md +6 -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/SDK.en.md +31 -0
- package/docs/user-guide/conversations.en.md +4 -2
- package/docs/user-guide/conversations.md +4 -2
- package/package.json +1 -1
- package/schemas/config/route.schema.json +15 -2
- package/scripts/check-doc-links.mjs +1 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-release-consistency.test.mjs +2 -2
- package/scripts/install.sh +1 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +1 -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 +1 -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/README.en.md +15 -0
- package/sql/README.md +25 -0
- package/src/app/agent-conversation-audit.ts +20 -0
- package/src/app/agent-system-info.ts +41 -0
- package/src/app/agent-tool-invocations.ts +16 -4
- package/src/core/config/agent-setup.ts +37 -0
- package/src/core/config/client-agent-setup.ts +25 -0
- 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 +43 -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/types.ts +15 -0
- package/src/core/runtime/agent-conversation-audit.test.ts +19 -1
- package/src/core/runtime/agent-conversation-audit.ts +39 -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-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-client-repository.ts +21 -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/configstore.ts +7 -3
- 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-client-agent-setup.test.ts +93 -0
- package/src/routes/admin-dispatch-config.ts +2 -0
- package/src/routes/agent-api.ts +7 -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/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/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-ChL9k-XA.js} +1 -1
- package/web/console/assets/AgentClients-Bs7UgVDj.js +1 -0
- package/web/console/assets/AgentClients-DkgPTEbq.css +1 -0
- package/web/console/assets/{Approvals-CMvPWacY.js โ Approvals-Bs6FGbp2.js} +1 -1
- package/web/console/assets/{Audit-CIRqOCnL.js โ Audit-4WWYhkFM.js} +1 -1
- package/web/console/assets/{BrandLockup-BrytmTTH.js โ BrandLockup-D2GhCipL.js} +1 -1
- package/web/console/assets/{Channels-CApxH2TB.js โ Channels-CmoGpiCJ.js} +1 -1
- package/web/console/assets/{ChatEntries-CJon3bWJ.js โ ChatEntries-BFRMtwta.js} +1 -1
- package/web/console/assets/Clients-CSHIsaWU.css +1 -0
- package/web/console/assets/Clients-DGkkSXyA.js +3 -0
- package/web/console/assets/{Cost-BbhlQFP8.js โ Cost-BmGt0MfS.js} +1 -1
- package/web/console/assets/{Credentials-kqr1W0K7.js โ Credentials-CR-sYINT.js} +1 -1
- package/web/console/assets/{Diagnostics-Kljt9XTH.js โ Diagnostics-DAPbKSJp.js} +1 -1
- package/web/console/assets/{Executors-DnsB-Xz4.js โ Executors-CgpiT3o8.js} +1 -1
- package/web/console/assets/{Kb-DLZSAFWP.js โ Kb-Cm9dVSQw.js} +1 -1
- package/web/console/assets/{Login-DiTjPWmN.js โ Login-CyUcsTZ_.js} +1 -1
- package/web/console/assets/{Projects-CXcVCgCD.js โ Projects-DldFPgWg.js} +1 -1
- package/web/console/assets/Routes-DkMIjMQA.css +1 -0
- package/web/console/assets/Routes-DubfjlBD.js +124 -0
- package/web/console/assets/Runs-1hxgkuR4.js +3 -0
- package/web/console/assets/Runs-CvGTV8I-.css +1 -0
- package/web/console/assets/{Setup-FqoCKmfZ.js โ Setup-DBLOnI2_.js} +1 -1
- package/web/console/assets/{Shell-BEqpONiy.js โ Shell-gJ5Vz_E7.js} +1 -1
- package/web/console/assets/{StorageBuckets-CkORbYXY.js โ StorageBuckets-DkDW16tj.js} +1 -1
- package/web/console/assets/{SystemSettings-gTQAazu7.js โ SystemSettings-cDkudo2y.js} +1 -1
- package/web/console/assets/{SystemStatus-DAmUUNqO.js โ SystemStatus-DZd6s8OX.js} +1 -1
- package/web/console/assets/{Targets-CZmDcjsE.js โ Targets-DYNGq1NU.js} +1 -1
- package/web/console/assets/{Tools-CIHInlHL.js โ Tools-DpWM59vV.js} +1 -1
- package/web/console/assets/{index-BkLbd7Cc.js โ index-DGqs28gI.js} +2 -2
- package/web/console/assets/{request-r7GHVJzw.js โ request-B7MLvOqo.js} +1 -1
- package/web/console/assets/{schema-BVn_hB7M.js โ schema-CMuwjYdJ.js} +1 -1
- package/web/console/index.html +1 -1
- package/web-admin/scripts/subject-display-ui.mjs +78 -0
- package/web-admin/src/components/AgentSetupPanel.vue +262 -0
- package/web-admin/src/components/ClientConversations.vue +21 -4
- package/web-admin/src/components/conversation-audit.ts +20 -0
- package/web-admin/src/pages/AgentClients.vue +97 -23
- package/web-admin/src/pages/Clients.vue +4 -1
- package/web-admin/src/pages/Routes.vue +10 -1
- 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
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# BailingHub v0.7.0: use several business systems in one conversation
|
|
2
|
+
|
|
3
|
+
> Release date: 2026-09-10. Upgrade baseline: Core 0.6.1 and SDK/DSH 0.4.0.
|
|
4
|
+
> Full client pairing: Core 0.7.0, SDK 0.5.0 and DSH 0.5.0, released as separate projects.
|
|
5
|
+
> [็ฎไฝไธญๆ](RELEASE_NOTES_v0.7.0.md)
|
|
6
|
+
|
|
7
|
+
Suppose you have connected a shop and an inventory system. You want to ask:
|
|
8
|
+
|
|
9
|
+
> โCheck how many tumblers are in stock. If any are available, change the corresponding shop product's price to 59 and list it. If none are available, leave it unlisted.โ
|
|
10
|
+
|
|
11
|
+
The 0.6 release pairing already supports several accounts from one system in a conversation. This extension follows that direction: explicitly select authorizations from several systems on the same Hub, discover their tools as needed, and use the appropriate authority for each action while keeping a connected visible conversation.
|
|
12
|
+
|
|
13
|
+
This is an illustrative integration, with a confirmed mapping between the two products. The inventory system must expose stock lookup; the shop must expose price updates and product listing. BailingHub does not supply these business functions. Actual account permissions and approval rules continue to apply.
|
|
14
|
+
|
|
15
|
+
| Part of the request | Responsible system | What to check |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| Look up stock | Inventory, using the selected inventory authorization | The actual product and returned quantity |
|
|
18
|
+
| Change the price if stock exists | Shop, using the selected shop authorization | The corresponding product's stored price |
|
|
19
|
+
| List the product | Shop, retaining its listing permission and approval rules | The result, pending approval or failure |
|
|
20
|
+
|
|
21
|
+
A successful price change followed by a pending listing approval is not โall done.โ Administrators can inspect each original action from the conversation. Stock lookup is a point-in-time observation, not a stock reservation or automatic synchronization between systems.
|
|
22
|
+
|
|
23
|
+
## What changes and which problems it solves
|
|
24
|
+
|
|
25
|
+
### New: select several systems and use the right authorization for each step
|
|
26
|
+
|
|
27
|
+
The Agent uses inventory tools to check stock and shop tools to update the price and listing. Even if both systems call a tool โfind product,โ their calls retain separate ownership.
|
|
28
|
+
|
|
29
|
+
If a turn only asks the current shop price, selection alone does not send the full input to inventory, load its business context or mark it as executed. Unselected systems cannot be added implicitly. The first message freezes the scope; changing it requires a new conversation. Existing conversations never expand automatically.
|
|
30
|
+
|
|
31
|
+
### New: understand a system before searching its tools
|
|
32
|
+
|
|
33
|
+
A shop usually handles product presentation, online selling and promotions; inventory handles stock and movements. Administrators can maintain the system name, purpose, typical business areas and boundaries. Compatible clients provide the selected systems' descriptions before the first capability search, without a hard-coded product dictionary in every client.
|
|
34
|
+
|
|
35
|
+
Descriptions explain purpose, not permission. Actual actions still require authorized discovery. โNot loadedโ means tools have not yet been requested. Reading descriptions creates no business run.
|
|
36
|
+
|
|
37
|
+
### New: show the actual business subject after authorization
|
|
38
|
+
|
|
39
|
+
After approving access to โBrand flagship store,โ a compatible client can display โShop system ยท Brand flagship store.โ The business backend reads the name from the confirmed subject and supplies it through Core, SDK and the plugin.
|
|
40
|
+
|
|
41
|
+
Authorization subject display is generic: it can describe an organization, account, project, workspace or store. It is separate from system purpose. Duplicate names do not merge identities, and renames do not replace authorizations or rewrite conversation history. Missing names are explicitly pending; the backend can update an existing authorization's name.
|
|
42
|
+
|
|
43
|
+
### Improved: configure local Agent access from one entry point
|
|
44
|
+
|
|
45
|
+
Use **Agent Clients โ Setup** for the authorization entry, system description, tools and approvals, and connection checks. The tool directory explains each action, its read/write type and configuration status.
|
|
46
|
+
|
|
47
|
+
These settings still belong to the original client application and route; no duplicate registration is required. Advanced route permissions remain available. Centralized setup neither enables every write operation nor removes business-required approval.
|
|
48
|
+
|
|
49
|
+
### New: let a business backend find and manage its authorizations
|
|
50
|
+
|
|
51
|
+
When a shop operator is disabled, the backend can find the relevant Agent Sessions and withdraw their access to product lookup, price changes or listing. Consumed authorizations now link to the resulting Session; an application can list its own Sessions and revoke access by original authorization.
|
|
52
|
+
|
|
53
|
+
The business backend must connect these APIs to its account, tenant and permission lifecycle. Core does not automatically subscribe to those events. Queries are limited to the owning application and return no access credentials.
|
|
54
|
+
|
|
55
|
+
### Extended: trace a conversation to actions in different systems
|
|
56
|
+
|
|
57
|
+
Complete visible conversation archives already exist in 0.6. This extension adds cross-system member and execution bindings. Administrators can follow stock lookup, price changes and listing to each system's original authorization and run.
|
|
58
|
+
|
|
59
|
+
Pending or failed actions must not be reported as completed. Archive recovery resends saved records without repeating business writes; known missing original text remains visibly incomplete.
|
|
60
|
+
|
|
61
|
+
## Who should prepare an upgrade
|
|
62
|
+
|
|
63
|
+
| Role | Required or optional work |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| Hub administrator | Upgrade Core and apply new migrations; add system descriptions and access configuration as needed. |
|
|
66
|
+
| DSH user | Use the matched plugin and its exact SDK dependency; authorize each target and select the new conversation's scope before its first message. |
|
|
67
|
+
| Custom client developer | Upgrade SDK/DSH host dependencies and check target selection, scope restoration, storage and display. A package replacement does not implement a custom UI automatically. |
|
|
68
|
+
| Business backend developer | Existing actions remain unchanged. To provide names, use the updated business SDK or API; to withdraw access proactively, integrate session lookup and revocation. |
|
|
69
|
+
| Existing same-system user | Keep the existing flow and original scopes; descriptions and names are optional additions. |
|
|
70
|
+
| Web chat, Client API or other adapter user | No requirement to adopt a DSH client. Assess Core upgrades for the integration actually used. |
|
|
71
|
+
|
|
72
|
+
## Upgrade preparation
|
|
73
|
+
|
|
74
|
+
Use **Core 0.7.0 + SDK 0.5.0 + DSH 0.5.0**. Prepare Core before upgrading clients. The plugin installs its exact SDK dependency; old 0.4.0 clients do not enable the new cross-system and display experience. Check each projectโs Release for availability.
|
|
75
|
+
|
|
76
|
+
After backup and migration preparation, npm deployments use:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm install --save-exact bailinghub@0.7.0
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
For an existing DeepSeek Harness environment:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
dsh plugin --profile web add dsh-bailinghub@0.5.0
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Custom clients use `bailinghub-mcp-server@0.5.0`. Source installs use the immutable `v0.7.0` Tag; image deployments select `bailinghub:0.7.0`. See [operations](OPERATIONS.en.md), [installation](QUICKSTART.en.md) and [DSH compatibility](https://github.com/bailinghub/bailinghub-dsh-plugin/blob/main/docs/COMPATIBILITY.md).
|
|
89
|
+
|
|
90
|
+
1. Back up the database and preserve the old deployment, configuration, original scopes, visible events and pending archive records.
|
|
91
|
+
2. Upgrade Core first. Relative to 0.6.1, migrations 058 add cross-system member bindings and 059 add subject display. Use the official migrator to apply every unapplied migration according to its ledger. Older installations may also need earlier files. Migration 059 does not guess or backfill names.
|
|
92
|
+
3. Upgrade the matched SDK and client. Custom stores must retain full cross-system bindings, original Session identities, events and revisions; today's authorization list cannot reconstruct old conversations. Custom Core hosts also need the new optional repository capabilities documented in the integration contracts.
|
|
93
|
+
4. Add system descriptions and business-supplied names as needed. Update an original valid authorization's name without replacing its connection or identity.
|
|
94
|
+
5. In a new test conversation, select two systems, perform an allowed query and a permitted low-risk action, and inspect the target, business result and original execution association. Approval-required actions must still enter the original approval flow.
|
|
95
|
+
|
|
96
|
+
Also check that a single selected system cannot access another, duplicate names and renames preserve identity, reopening restores the original scope, and archive-only retry never repeats writes.
|
|
97
|
+
|
|
98
|
+
For rollback, retain new database fields and client records and follow the relevant operations guide. Older clients cannot use the new cross-system scope. Report unsupported combinations; do not erase records or widen authorization to continue.
|
|
99
|
+
|
|
100
|
+
## Limits
|
|
101
|
+
|
|
102
|
+
- One Hub and administrator audit domain, with a distinct original Agent Session for each target. Cross-Hub scopes and several selected routes sharing one Session are unsupported.
|
|
103
|
+
- The Agent plans steps. This is not a durable workflow scheduler, distributed transaction, automatic rollback or cross-process business task recovery engine.
|
|
104
|
+
- Matching product names or IDs across systems are not identity evidence. Use confirmed mappings or explicit user identification.
|
|
105
|
+
- Queried business results enter the local conversation; visible text is archived in the administrator audit domain. This is not automatic redaction or a field-level sharing policy. Choose information appropriate for the shared context.
|
|
106
|
+
- Missing metadata or unsupported old versions remain explicit. They do not prove loaded tools or authorize switching to a default connection.
|
|
107
|
+
|
|
108
|
+
## Further reading
|
|
109
|
+
|
|
110
|
+
- [Four-step local Agent setup](LOCAL_AGENT_SETUP.en.md)
|
|
111
|
+
- [Authorization subject display](AGENT_SUBJECT_DISPLAY.en.md)
|
|
112
|
+
- [Authorization and revocation API](AGENT_AUTH_API.en.md)
|
|
113
|
+
- [Cross-system client integration](https://github.com/bailinghub/bailinghub-dsh-plugin/blob/main/docs/CROSS_SYSTEM_CONVERSATIONS.md)
|
|
114
|
+
- [Visible conversation and execution associations](AGENT_CONVERSATION_AUDIT.en.md)
|
|
115
|
+
|
|
116
|
+
ACC, independent adapters and business systems retain their own release boundaries.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# BailingHub v0.7.0๏ผๅจไธไธชไผ่ฏ้ไฝฟ็จๅคไธชไธๅก็ณป็ป
|
|
2
|
+
|
|
3
|
+
> ๅๅธๆฅๆ๏ผ2026-09-10ใๅ็บงๅบ็บฟ๏ผCore 0.6.1ใSDK/DSH 0.4.0ใ
|
|
4
|
+
> ๅฎๆดๅฎขๆท็ซฏ้
ๅฅไธบ Core 0.7.0ใSDK 0.5.0ใDSH 0.5.0๏ผไธไธช้กน็ฎๅๅซๅๅธๅๅฎ่ฃ
ใ
|
|
5
|
+
> [English](RELEASE_NOTES_v0.7.0.en.md)
|
|
6
|
+
|
|
7
|
+
ๅ่ฎพไฝ ๅทฒ็ปๆฅๅ
ฅๅๅๅๅบๅญ็ณป็ป๏ผๅธๆๅฏนๅฉๆ่ฏด๏ผ
|
|
8
|
+
|
|
9
|
+
> โๅ
ๆฅไธไธไฟๆธฉๆฏ่ฟๆๅคๅฐๅบๅญใๆ่ดง็่ฏ๏ผๆๅๅ่ฟๆฌพๅๅ็ๅฎไปทๆนไธบ 59 ๅ
ๅนถไธๆถ๏ผๆฒก่ดงๅฐฑๅ
ไธ่ฆไธๆถใโ
|
|
10
|
+
|
|
11
|
+
ไปฅๅ๏ผ0.6 ้
ๅฅๅฎขๆท็ซฏๅทฒ็ปๅฏไปฅๅจๅไธไผ่ฏไฝฟ็จๅไธ็ณป็ป็ๅคไธช่ดฆๆท๏ผไฝไธ่ฝๆไธๅไธๅก็ณป็ป็ๆๆไธ่ตท้ๅ
ฅ่ฟไธชไผ่ฏใๆฌๆฌกๆฒฟ็่ฟๆก่ทฏ็บฟ็ปง็ปญๆฉๅฑ๏ผๅจๅไธไธญๆขๅ
๏ผ็จๆทๅฏไปฅๅ
้ๅฎๅคไธช็ณป็ป็ๆๆ๏ผๅฉๆๆ้่ฆๆฅๆพๅ่ช็ๅทฅๅ
ท๏ผๅไฝฟ็จๅฏนๅบๆ้ๆง่ก๏ผๅนถๅ
ณ่ๅฐๅไธๆฎตๅฏ่งๆฒ้ใ
|
|
12
|
+
|
|
13
|
+
ไปฅไธๆฏ้็จๅบๆฏ็คบไพ๏ผๅๅฎไธค่พนๅๅ็ๅฏนๅบๅ
ณ็ณปๅทฒ็ป็กฎ่ฎคใๅบๅญ็ณป็ป้่ฆๆไพๅบๅญๆฅ่ฏข๏ผๅๅ้่ฆๆไพๆนไปทใไธๆถ็ญไธๅก่ฝๅ๏ผ่ฟไบๅจไฝไธๆฏไธญๆขๅ
็ฝฎ็ๅๅๅ่ฝ๏ผๆฏ้กนๆไฝไปๅๅฎ้
ๆๆๅๅฎกๆน็บฆๆใ
|
|
14
|
+
|
|
15
|
+
| ่ฟๅฅ่ฏไธญ็ไบๆ
| ่ฐๆฅๅค็ | ๅฎๆๅๆฅ็ไปไน |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| ๆฅ่ฏขไฟๆธฉๆฏๅบๅญ | ๅบๅญ็ณป็ป๏ผไฝฟ็จๆฌๆฌก้ๆฉ็ๅบๅญๆๆ | ่ฟๅ็ๅบๅญๆฐ้ๅๅ
ทไฝๅๅ |
|
|
18
|
+
| ๆ่ดงๆถ่ฐๆดๅๅๅฎไปท | ๅๅ็ณป็ป๏ผไฝฟ็จๆฌๆฌก้ๆฉ็ๅๅๆๆ | ๅๅไธญๅฏนๅบๅๅ็ๅฎ้
ๅฎไปท |
|
|
19
|
+
| ๅฐๅๅไธๆถ | ๅๅ็ณป็ป๏ผ็ปง็ปญ้ตๅฎไธๆถๆ้ไธๅฎกๆน | ๅฎ้
ไธๆถ็ปๆ๏ผๆๅพ
ๅฎกๆนใๅคฑ่ดฅ็่ฎฐๅฝ |
|
|
20
|
+
|
|
21
|
+
ไพๅฆ๏ผๆนไปทๅทฒ็ปๅฎๆใไธๆถไปๅพ
ๅฎกๆนๆถ๏ผไธ่ฝ่ฏดโๅ
จ้จๅฎๆโใ็ฎก็ๅๅฏไปฅไปๅไธๆฎตๆฒ้่ฟฝๅฐ่ฟไธคไธชๅจไฝๅ่ช็ๅๅงๆง่ก่ฎฐๅฝใๅบๅญๆฅ่ฏขๅๆ ๅฝๆถ็็ปๆ๏ผไธ็ญไบๅทฒ็ป้ๅฎๅบๅญ๏ผไนไธๅปบ็ซไธคไธช็ณป็ป็่ชๅจๅบๅญๅๆญฅใ
|
|
22
|
+
|
|
23
|
+
## ๆดๆฐไบไปไน๏ผ่งฃๅณไบไปไน้ฎ้ข
|
|
24
|
+
|
|
25
|
+
### ๆฐๅข๏ผไธๆฌก้ๆฉๅคไธช็ณป็ป๏ผๆๆฏไธๆญฅ็ไปปๅกไฝฟ็จๅฏนๅบๆๆ
|
|
26
|
+
|
|
27
|
+
ๅจ็คบไพไธญ๏ผ็จๆทๅ
้ๆฉๅๅๅๅบๅญ็ณป็ป็ๆๆใๆฅ่ฏขๅบๅญไฝฟ็จๅบๅญ็ณป็ป็ๅทฅๅ
ทไธๆ้๏ผไฟฎๆนๅฎไปทใไธๆถๅๅไฝฟ็จๅๅ็ณป็ป็ๅทฅๅ
ทไธๆ้ใไธคไธช็ณป็ปๅณไฝฟๅญๅจๅๅ็โๆฅ่ฏขๅๅโๅทฅๅ
ท๏ผไนไฟ็ๅ่ช็่ฐ็จๅฝๅฑใ
|
|
28
|
+
|
|
29
|
+
ๅฆๆ่ฟ่ฝฎๅช้ฎโๅๅ้่ฟๆฌพๅๅ็ฐๅจๅๅคๅฐ้ฑโ๏ผๅบๅญ็ณป็ปไธไผๅ ไธบ่ขซ้ไธญๅฐฑ่ชๅจๆฅๆถๅฎๆด็จๆท่พๅ
ฅใๅ ่ฝฝไธๅกไธไธๆๆ่ขซๆ ๆๅทฒๆง่กใๆช้ไธญ็็ณป็ปไธ่ฝ่ขซไธดๆถๅ ๅ
ฅใ็ฌฌไธๆฌกๅ้ๆถๆฏๅ่ๅดๅบๅฎ๏ผๅขๅๆๆ้่ฆๆฐๅปบไผ่ฏ๏ผๅทฒๆไผ่ฏไธไผ่ชๅจๆฉๅคงๅฐๆฐๆฅๅ
ฅ็็ณป็ปใ
|
|
30
|
+
|
|
31
|
+
### ๆฐๅข๏ผๅจ็ฌฌไธๆฌกๆ็ดขๅทฅๅ
ทๅ๏ผๅ
็ฅ้็ณป็ป่ด่ดฃไปไน
|
|
32
|
+
|
|
33
|
+
ไพๅฆ๏ผโๅๅ็ณป็ปโ้ๅธธ่ด่ดฃๅๅๅฑ็คบใ็บฟไธๅฎๅๅ่ฅ้ๆดปๅจ๏ผโๅบๅญ็ณป็ปโ่ด่ดฃๅบๅญไธๅบๅ
ฅๅบใ็ฎก็ๅๅฏไปฅ็ปดๆค็ณป็ปๅ็งฐใ็ฎ็ญ็จ้ใๅ
ธๅไธๅกๆนๅๅ่พน็๏ผ้
ๅฅๅฎขๆท็ซฏๅจ้ฆๆฌก่ฝๅๆ็ดขๅๅฐๅทฒ้็ฎๆ ็่ฏดๆๆไพ็ปๅฉๆใ
|
|
34
|
+
|
|
35
|
+
่ฟๆ ท๏ผๅผๅ่
ไธๅฟ
ๅจๆฏไธไธชๅฎขๆท็ซฏ้็กฌ็ผ็ ไบงๅ่ฏๅ
ธใ็ณป็ป่ฏดๆๅช่งฃ้ไบงๅๅฎไฝ๏ผๅฎ้
่ฝ่ฐ็จไปไนไป่ฆๆ่ฟไปฝๆๆๆฅ่ฏขใโๅฐๆชๅ ่ฝฝโ่กจ็คบๅทฅๅ
ท่ฟๆชๆฅ่ฏข๏ผๅนถไธ่กจ็คบ็ณป็ปๆฒกๆ่ฝๅ๏ผ่ฏปๅ็ณป็ป่ฏดๆๆฌ่บซไธๅๅปบไธๅก่ฟ่ก่ฎฐๅฝใ
|
|
36
|
+
|
|
37
|
+
### ๆฐๅข๏ผๆๆๆๅๅ๏ผๆพ็คบ็ๅฎไธๅกๅฏน่ฑก็ๅ็งฐ
|
|
38
|
+
|
|
39
|
+
ไพๅฆ๏ผ็จๆทๅจๅๅ้กต้ข็กฎ่ฎคๆๆ็ปโๅ็ๆ่ฐๅบโ๏ผ่ฟๅๆฏๆๆญคๅ่ฝ็ๅฎขๆท็ซฏๅ๏ผๅฏไปฅ็ๅฐโๅๅ็ณป็ป ยท ๅ็ๆ่ฐๅบโใไธๅกๅ็ซฏไปๅทฒ็กฎ่ฎค็็ๅฎๅฏน่ฑก่ฏปๅๅ็งฐ๏ผๆไบค็ปไธญๆข๏ผ็ฑ SDK ๅๆไปถไผ ็ปๅฎขๆท็ซฏใ
|
|
40
|
+
|
|
41
|
+
่ฟ้้็จ้็จ็ๆๆไธปไฝๅฑ็คบไฟกๆฏ๏ผ้็จไบ็ป็ปใ่ดฆๆทใ้กน็ฎใๅทฅไฝๅบๆ้จๅบใ็ณป็ป่ฏดๆ่ด่ดฃ่งฃ้โ่ฟๆฏไปไน็ณป็ปโ๏ผๆๆๅ็งฐ่ด่ดฃ่ฏดๆโ่ฟไปฝๆๆๅฏนๅบ่ฐโใๅๅๅฏน่ฑกไธไผๅ ๆญคๅๅนถ๏ผๆนๅไนไธไผ้ๅปบๆๆๆๆนๅๅๅฒไผ่ฏๅ
ณ่ใๆงๆๆ็ผบๅฐๅ็งฐๆถๆ็กฎๆ็คบๅพ
ๅๆญฅ๏ผๅฏ็ฑไธๅกๅ็ซฏ็ปๅๆๆ่กฅๅใ
|
|
42
|
+
|
|
43
|
+
### ๆน่ฟ๏ผไปไธไธชๅ
ฅๅฃๅฎๆๆฌๅฐๆบ่ฝไฝ็ๆฅๅ
ฅ้
็ฝฎ
|
|
44
|
+
|
|
45
|
+
็ฎก็ๅๆๅผโๆบ่ฝไฝๅฎขๆท็ซฏ โ ๆฅๅ
ฅ้
็ฝฎโ๏ผไพๆฌก้
็ฝฎๆๆๅ
ฅๅฃใ็ณป็ป่ฏดๆใๅทฅๅ
ทไธๅฎกๆน๏ผๅๆฃๆฅ่ฟๆฅๆกไปถใๅทฅๅ
ท็ฎๅฝๅๆถๅฑ็คบๅจไฝ่ฏดๆใๆฅ่ฏขๆๅๅ
ฅ็ฑปๅไธ้
็ฝฎ็ถๆ๏ผๅๅฐๅจๆฅๅ
ฅๆนๅ่ทฏ็ฑ้กต้ขไน้ดๆฅๅๅฏปๆพใ
|
|
46
|
+
|
|
47
|
+
่ฟไบ่ฎพ็ฝฎไปไฟๅญๅฐๅๆฅๅ
ฅๆนๅไธๅก่ทฏ็ฑ๏ผไธ้่ฆ้ๅค็ป่ฎฐไธๅก็ณป็ปใๅ่ทฏ็ฑ็้ซ็บงๆ้่ฎพ็ฝฎไปไฟ็๏ผ้ไธญๅ
ฅๅฃไธไผ่ชๅจๅผๆพๅ
จ้จๅๆไฝ๏ผไนไธ่ฝๅๆถไธๅก็ณป็ปๅๆ็ๅฎกๆน่ฆๆฑใ
|
|
48
|
+
|
|
49
|
+
### ๆฐๅข๏ผไธๅกๅ็ซฏๅฏไปฅๆพๅๅนถ็ฎก็่ชๅทฑ็ญพๅบ็ๆๆ
|
|
50
|
+
|
|
51
|
+
ไพๅฆ๏ผๆไฝๅๅๆไฝๅ่ขซๅ็จๅ๏ผไธๅกๅ็ซฏ้่ฆๆพๅบๅฏนๅบ็ๆบ่ฝไฝไผ่ฏ๏ผๆถๅๅ
ถๆฅ่ฏขๅๅใๆนไปทๆไธๆถ็่ฎฟ้ฎๆๆใๆฌ็่กฅ้ฝๅทฒๅฎๆๆข็ ็ๆๆไธๆ็ปไผ่ฏไน้ด็ๅ
ณ่๏ผๆฏๆๆฅๅ
ฅๆนๆฅ่ฏข่ชๅทฑ็ไผ่ฏ๏ผๅนถๆๅๆๆๆค้ใ
|
|
52
|
+
|
|
53
|
+
ไธๅก็ณป็ป้่ฆๆ่ฟไบๆฅๅฃๆฅๅฐ่ชๅทฑ็่ดฆๅทๅ็จใ็งๆท็ฆ็จๆๆ้ๆค้ๆต็จ๏ผไธญๆขไธไผ่ชๅจ่ฎข้
่ฟไบไธๅกไบไปถใๆฅๅฃๅชๅ
่ฎธๆฅ่ฏขๆฌๆฅๅ
ฅๆน็่ฎฐๅฝ๏ผไธ่ฟๅ่ฎฟ้ฎๅญๆฎใ
|
|
54
|
+
|
|
55
|
+
### ๆฉๅฑ๏ผไปๅฎๆดๆฒ้่ฟฝๅฐไธๅ็ณป็ป็ๅๅงๆไฝ
|
|
56
|
+
|
|
57
|
+
0.6 ๅทฒๆๅฎๆดๅฏ่งๅฏน่ฏๅฝๆกฃ๏ผๆฌ็ๆๆๅๅๆง่กๅ
ณ่ๆฉๅฑๅฐไธๅ็ณป็ปใ็ฎก็ๅๅฏไปฅๅ
็็จๆท็่ฏทๆฑไธๅฉๆๅๅค๏ผๅๆฅ็ๅบๅญๆฅ่ฏขใไฟฎๆนๅฎไปทๅๅๅไธๆถๅๅซๅฑไบๅชไปฝๆๆใๅชไธช็ณป็ป็ๆง่ก่ฎฐๅฝใ
|
|
58
|
+
|
|
59
|
+
ๆไธๆญฅ็ญๅพ
ๅฎกๆนๆๅคฑ่ดฅๆถ๏ผไธ่ฝๆๅ
ถไป็ณป็ปไธ่ตทๆ่ฟฐไธบๅฎๆใๆขๅคๅฝๆกฃๅช่กฅไผ ๅทฒ็ปไฟๅญ็่ฎฐๅฝ๏ผไธ้ๅคไธๅกๅๅ
ฅ๏ผๅๅฒๅๆๅญๅจไฟๅญ็ผบๅฃๆถ็ปง็ปญๅฆๅฎๆพ็คบใ
|
|
60
|
+
|
|
61
|
+
## ่ฐ้่ฆๅ็บง๏ผๅๅซๅไปไน
|
|
62
|
+
|
|
63
|
+
| ไฝฟ็จๆนๅผ | ้่ฆ้
ๅ็้จๅ |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| ็ปดๆค BailingHub ไธญๆข | ๅ็บง Core๏ผๅบ็จๆฌ็ๆฐๅข่ฟ็งป๏ผๆ้่ฆ่กฅๅ
็ณป็ป่ฏดๆไธๆฅๅ
ฅ้
็ฝฎใ |
|
|
66
|
+
| ไฝฟ็จ DSH ๆไปถ | ไฝฟ็จๆฌ็้
ๅฅๆไปถๅๅ
ถ็ฒพ็กฎ SDK ไพ่ต๏ผๅๅซๆๆ๏ผๅจๆฐไผ่ฏ้ฆๆถๆฏๅๆ็กฎ้ๆฉ็ฎๆ ใ |
|
|
67
|
+
| ๅผๅ่ชๅทฑ็ๆบ่ฝไฝๅฎขๆท็ซฏ | ๅ็บง Agent Client SDK / DSH ๅฎฟไธปไพ่ต๏ผๆ ธๅฏนๅค็ณป็ป็ฎๆ ๅฑ็คบใ่ๅดๆขๅคใๆไน
ๅญๅจๅๅ็งฐๅฑ็คบใไป
ๆฟๆขๅ
ไธไปฃ่กจๆๆ็้ขๅทฒ่ชๅจๅฎๆๆฅๅ
ฅใ |
|
|
68
|
+
| ็ปดๆคไธๅก็ณป็ปๅ็ซฏ | ๅทฒๆฅๅ
ฅ็ไธๅกๅจไฝ็ปง็ปญๆฒฟ็จใ้่ฆ่ชๅจๅ็งฐๆถ๏ผๅ็บงๅฏนๅบไธๅก SDK ๆๆๆฐๆฅๅฃๆไบคไธปไฝๅ็งฐ๏ผ้่ฆไธปๅจๅๆถ่ฎฟ้ฎๆถ๏ผๅฏนๆฅๆๆๆฅ่ฏขไธๆค้ใ |
|
|
69
|
+
| ๅชไฝฟ็จๅทฒๆๅ็ณป็ปๅคๆๆ | ๅๆต็จไฟ็๏ผๆงไผ่ฏไธๆฉๅคงไธบๅค็ณป็ป๏ผๅฏไปฅๆ้่ฆ้็จๆฐๅขๅ็งฐไธ็ณป็ป่ฏดๆใ |
|
|
70
|
+
| ไฝฟ็จ็ฝ้กต่ๅคฉใClient API ๆๅ
ถไป็ๆ้้
ๅจ | ไธๅ ๆฌ็ๆฐๅขๆฌๅฐไผ่ฏๅ่ฝ่่ฆๆฑๆน้ ๆ DSH ๅฎขๆท็ซฏ๏ผๆ่ช่บซไฝฟ็จๆนๅผๆ ธๅฏน Core ๅ็บงๅฝฑๅใ |
|
|
71
|
+
|
|
72
|
+
## ๅฆไฝๅ็บง
|
|
73
|
+
|
|
74
|
+
ไฝฟ็จ **Core 0.7.0 + SDK 0.5.0 + DSH 0.5.0**ใๅ
ๅๅคไธญๆข๏ผๅๅ็บงๅฎขๆท็ซฏ๏ผๆไปถไผๅฎ่ฃ
็ฒพ็กฎ SDK ไพ่ตใๆง 0.4.0 ๅฎขๆท็ซฏไธไผ่ทๅพๆฐ่ทจ็ณป็ปไธๅ็งฐไฝ้ช๏ผๅๅๅธๅๅ
็ๅฏ็จ็ถๆไปฅๅ
ถ Release ไธบๅใ
|
|
75
|
+
|
|
76
|
+
ๆ่ฟ็ปดๆๅๅคไปฝๅนถๅๅค่ฟ็งปๅ๏ผnpm ้จ็ฝฒๅฏไฝฟ็จ๏ผ
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm install --save-exact bailinghub@0.7.0
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
ๅทฒๆ DeepSeek Harness ็ฏๅขๅฎ่ฃ
้
ๅฅๆไปถ๏ผ
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
dsh plugin --profile web add dsh-bailinghub@0.5.0
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
่ช็ ๅฎขๆท็ซฏไฝฟ็จ `bailinghub-mcp-server@0.5.0`ใๆบ็ ้จ็ฝฒไฝฟ็จไธๅฏๅ `v0.7.0` Tag๏ผ้ๅ้จ็ฝฒ้ๆฉ `bailinghub:0.7.0`ใๅฎๆดๆญฅ้ชค่ง[่ฟ็ปดๆๅ](OPERATIONS.md)ใ[ๅฎ่ฃ
ๆๅ](QUICKSTART.md)ๅ[ๅฎขๆท็ซฏๅ
ผๅฎน่ฏดๆ](https://github.com/bailinghub/bailinghub-dsh-plugin/blob/main/docs/COMPATIBILITY.md)ใ
|
|
89
|
+
|
|
90
|
+
1. **ไฟ็็ฐๆๆฐๆฎๅ้
็ฝฎใ** ๅคไปฝๆฐๆฎๅบ๏ผไฟ็ๅ้จ็ฝฒ็ๆฌ๏ผไปฅๅๅฎขๆท็ซฏๅไผ่ฏ่ๅดใ็ๅฎไบไปถๅๅพ
ไผ ๅฝๆกฃ่ฎฐๅฝใ
|
|
91
|
+
2. **ๅ
ๅ็บงไธญๆขๅนถ่ฟ็งปใ** ไป 0.6.1 ๅ็บงๆฐๅข 058๏ผ่ทจ็ณป็ปไผ่ฏๆๅ็ปๅฎ๏ผไธ 059๏ผๆๆไธปไฝๅฑ็คบไฟกๆฏ๏ผ๏ผไฝฟ็จๆญฃๅผ่ฟ็งปๅจๆ่ดฆๆฌๆง่กๅ
จ้จๅฐๆชๅบ็จ็ๆไปถใๆดๆฉ็ๆฌ่ฟ่ฆๅ
ๅซๅ่ช็ผบๅคฑ็ๅๅฒ่ฟ็งป๏ผไธ่ฝๅชๆๅทฅๆง่กๆๅไธคไธชๆไปถใ059 ไธไผ่ชๅจ็ๆตๆๅๅกซๆงๆๆๅ็งฐใ
|
|
92
|
+
3. **ๅๅ็บง้
ๅฅ SDK ๅๅฎขๆท็ซฏใ** DSH ็ๆญฃๅผๅ
ไพ่ต็ฒพ็กฎๅน้
็ SDKใ่ชๅฎไนๅญๅจ้่ฆไฟ็ๅค็ณป็ป่ๅด่ฎฐๅฝ็ๅฎๆด็ปๅฎใๅไผ่ฏ่บซไปฝใไบไปถไธไฟฎ่ฎขไฟกๆฏ๏ผไธ่ฝ็จๅฝๅๆๆๅ่กจ้ๅปบๆงไผ่ฏใ่ชๅฎไนไธญๆขๅฎฟไธป่ฟ้ๆๅ
ผๅฎน่ฏดๆๆฅๅ
ฅๆฐๅขไปๅจ่ฝๅใ
|
|
93
|
+
4. **ๆ้่ฆๅฎๅไธๅกไฟกๆฏใ** ็ฎก็ๅๅกซๅ็ณป็ป่ฏดๆ๏ผไธๅกๅ็ซฏๅจๆๆๆถๆไบค็ๅฎไธปไฝๅ็งฐ๏ผๆ็ปๅๆๆๆๆ่กฅๅใๅฎขๆท็ซฏๆพ็คบๆๆฐๅ็งฐ๏ผๅ
้จ่ฟๆฅไธๆๆ่บซไปฝ็ปง็ปญ็ฌ็ซไฟๅญใ
|
|
94
|
+
5. **็จๅ
่ฎธ็ๆต่ฏๅจไฝๆ ธๅฏน็ปๆใ** ๆฐๅปบไผ่ฏ้ๆฉไธคไธช็ณป็ป๏ผๅ
้ช่ฏๆฅ่ฏข๏ผๅ้ช่ฏไธไธชๅ
่ฎธ็ไฝ้ฃ้ฉๅจไฝ๏ผๆ ธๅฏนๅฎ้
็ฎๆ ใๅๅฐ็ปๆๅๅไธๆฎตๆฒ้ไธญ็ๆง่กๅ
ณ่ใ้่ฆๅฎกๆน็ๅจไฝไปๅบ่ฟๅ
ฅๅๅฎกๆนๆต็จใ
|
|
95
|
+
|
|
96
|
+
ๅ็บงๅ่ฟๅบๆฃๆฅ๏ผๅช้ไธไธช็ณป็ปๆถไธไผ่ฎฟ้ฎๅฆไธไธช๏ผๅๅๆๆนๅไธไผๆนๅๆๆ่บซไปฝ๏ผ้ๅผๅไผ่ฏ่ฝๆขๅคๅ่ๅด๏ผๅช้่ฏๅฝๆกฃไธไผ้ๅคไธๅกๅจไฝใ
|
|
97
|
+
|
|
98
|
+
ๅฆ้ๅ้๏ผไฟ็ๆฐๆฐๆฎๅบๅญๆฎตไธๅฎขๆท็ซฏ่ฎฐๅฝ๏ผๆๅฏนๅบ็ๆฌๅ็บงๆๅๆไฝใๆงๅฎขๆท็ซฏไธ่ฝๆฎๆญคไฝฟ็จๆฐ็ๅค็ณป็ป่ๅด๏ผ้ๅฐไธๆฏๆๆถๅบๆ็กฎๆ็คบ๏ผไธ่ฝ้่ฟๅ ้คๆฐ่ฎฐๅฝๆๆฉๅคงๆๆๆฅ็ปง็ปญๆง่กใ
|
|
99
|
+
|
|
100
|
+
## ไฝฟ็จ่พน็
|
|
101
|
+
|
|
102
|
+
- ๅค็ณป็ป่ๅด้ๅไธ Hubใๅไธ็ฎก็ๅฎก่ฎกๅ๏ผๆฏไธช็ฎๆ ไฝฟ็จ็ฌ็ซ็ๅ Agent Session๏ผไธๆฏๆ่ทจ Hub๏ผไนไธๆฏๆๆๅไธไธช Session ๅฝไฝๅคไธชๆ้่ทฏ็ฑ็ๆๆใ
|
|
103
|
+
- ๅฉๆ่ด่ดฃ่งๅๆญฅ้ชคใๆฌ็ๆฒกๆๆฐๅขๆไน
ไปปๅก่ฐๅบฆใ่ทจ็ณป็ปไบๅกใ่ชๅจๅๆปๆ่ทจ่ฟ็จๆขๅคๆชๅฎๆไธๅกไปปๅก็ๅผๆใ
|
|
104
|
+
- ไธๅ็ณป็ป็ๅๅๅฏน่ฑกๆ็ธๅ็ผๅทไธไปฃ่กจๅไธไธๅก่บซไปฝใๅ
ณ่้่ฆๅทฒ็กฎ่ฎค็ไธๅกๆ ๅฐๆ็จๆทๆ็กฎๆๅฎ๏ผไธ่ฝๅญๅฑ็คบๅ็ๆตใ
|
|
105
|
+
- ็ณป็ปๆฅ่ฏข็ปๆ่ฟๅ
ฅๆฌๅฐๅฉๆๅไผๅไธๅไธๆฎตๆฒ้๏ผๅฎๆดๅฏ่งๆญฃๆๅฝๆกฃไพไธญๆข็ฎก็ๅฎก่ฎกๅไฝฟ็จใ่ฟไธๆฏ่ชๅจ่ฑๆๆ่ทจ็ณป็ปๆฐๆฎๅ
ฑไบซ็ญ็ฅ๏ผๆฅๅ
ฅๆนๅบ้ๆฉ้ๅๅ
ฑไบซ็ๅบๆฏใ
|
|
106
|
+
- ๆง็ๆฌไธๆฏๆๆฐๅญๆฎตๆถๆพ็คบๆช็ฅใ็ผบๅคฑๆไธๆฏๆ๏ผไธๅๅ
ๅทฒๅ ่ฝฝ่ฝๅ๏ผไธ่ชๅจ้ๅ้ป่ฎคๆๆใ
|
|
107
|
+
|
|
108
|
+
## ่ฟไธๆญฅ้
่ฏป
|
|
109
|
+
|
|
110
|
+
- [ๅๆญฅ้
็ฝฎๆฌๅฐๆบ่ฝไฝ](LOCAL_AGENT_SETUP.md)
|
|
111
|
+
- [ๆๆไธปไฝๅ็งฐๆฅๅ
ฅ](AGENT_SUBJECT_DISPLAY.md)
|
|
112
|
+
- [ๆๆๆฅๅฃไธไธปๅจๆค้](AGENT_AUTH_API.md)
|
|
113
|
+
- [่ทจ็ณป็ปไผ่ฏไธๅฎขๆท็ซฏๆฅๅ
ฅ](https://github.com/bailinghub/bailinghub-dsh-plugin/blob/main/docs/CROSS_SYSTEM_CONVERSATIONS.md)
|
|
114
|
+
- [ๅฎๆดๅฏ่งๅฏน่ฏไธๆง่กๅ
ณ่](AGENT_CONVERSATION_AUDIT.md)
|
|
115
|
+
|
|
116
|
+
ACCใ็ฌ็ซ็ๆ้้
ๅจไธไธๅก็ณป็ปไฟๆๅ่ชๅๅธ่พน็ใ
|
package/docs/SDK.en.md
CHANGED
|
@@ -161,6 +161,33 @@ public function memberQuery(): void
|
|
|
161
161
|
}
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
+
## Agent authorization lifecycle (Core 0.7.0)
|
|
165
|
+
|
|
166
|
+
PHP 8.1+ and PHP 7.3 provide the optional server-side `AgentAuth` helper for browser consent.
|
|
167
|
+
The additions in this branch let the business backend find the device session created by an
|
|
168
|
+
authorization and withdraw access when a device is lost or an operator leaves. They require
|
|
169
|
+
Core 0.7.0 and the matching PHP/PHP7 SDK bundles. Core 0.6.1 does not include these lifecycle methods.
|
|
170
|
+
|
|
171
|
+
```php
|
|
172
|
+
$auth = new \Bailing\Connect\AgentAuth('https://hub.example.com', $clientToken);
|
|
173
|
+
$page = $auth->listSessions(['tenant' => (string) $tenantId, 'limit' => 20]);
|
|
174
|
+
$context = $auth->context($authorizationId); // Existing fields plus session on consumed records.
|
|
175
|
+
$result = $auth->revokeAuthorization($authorizationId);
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Only the current Client App is queried. The backend must also authorize its caller to manage the
|
|
179
|
+
requested tenant or operator. An operator filter requires `principal_id` and `tenant`; an empty
|
|
180
|
+
tenant explicitly selects a tenantless identity. Pass an opaque `next_cursor` with the original
|
|
181
|
+
filters until it is null; pages reflect current state rather than a frozen snapshot.
|
|
182
|
+
Expiry follows the refresh/session lifetime, and `active` is not proof of current business access.
|
|
183
|
+
Missing session mappings must not be inferred. Revocation is idempotent for the same authorization;
|
|
184
|
+
a timeout/503 or a consumed record's missing-mapping 404 must not be reported as success.
|
|
185
|
+
`revokeSession()` remains available for a known Session ID, and Client Tokens stay server-side.
|
|
186
|
+
|
|
187
|
+
Node and Python currently have no separate `AgentAuth` helper. Use the same backend HTTP contract
|
|
188
|
+
without introducing another authorization protocol. See [Agent Auth v1](AGENT_AUTH_API.en.md)
|
|
189
|
+
and the [integration quickstart](AGENT_CLIENT_QUICKSTART.en.md).
|
|
190
|
+
|
|
164
191
|
## Contract Test
|
|
165
192
|
|
|
166
193
|
All SDKs are validated against the same tool contract:
|
|
@@ -175,3 +202,7 @@ npm run sdk:test-p1
|
|
|
175
202
|
```
|
|
176
203
|
|
|
177
204
|
These tests build SDK-generated specs, compile them through the hub's OpenAPI tool compiler, verify runtime helpers across PHP/Node/Python, and compile or source-check the Java/Go/.NET SDKs depending on the local toolchain.
|
|
205
|
+
|
|
206
|
+
The runtime checks use `php` by default for both PHP source variants. Set
|
|
207
|
+
`BAILING_SDK_PHP7_BINARY` to a real PHP 7.3/7.4 executable to verify that interpreter; running the
|
|
208
|
+
PHP 7-compatible source on PHP 8 does not establish PHP 7 runtime coverage.
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
If you manage stores A and B in the same business system, you can select both authorizations for a conversation, then let the agent use the appropriate account for each action. Stores are an example: these may be any two authorized accounts in the same system.
|
|
6
6
|
|
|
7
|
+
On one Hub you can also select shop and inventory authorizations: check stock, then perform permitted shop price or listing actions. System descriptions explain the roles and authorization names identify the business subjects. Product mappings must be confirmed; see [v0.7.0 scenarios](../RELEASE_NOTES_v0.7.0.en.md).
|
|
8
|
+
|
|
7
9
|
## What you need
|
|
8
10
|
|
|
9
|
-
Deploy **BailingHub 0.
|
|
11
|
+
Deploy **BailingHub 0.7.0** and use **dsh-bailinghub 0.5.0**, which depends on the independent **bailinghub-mcp-server 0.5.0** SDK. A custom client must integrate conversation scope, original visible history and archive APIs. Upgrading only the Hub does not make an older client upload a full transcript.
|
|
10
12
|
|
|
11
13
|
Your business system must already expose the operations you need, and you must authorize A and B separately. This upgrade does not require rewriting existing business capabilities or approval rules. Start with the [public Docker demo](../DEMO.en.md) to learn query, approval and execution; that demo does not replace client installation and account authorization.
|
|
12
14
|
|
|
@@ -37,4 +39,4 @@ Full text belongs to the deployed Hub's administration audit domain, readable by
|
|
|
37
39
|
|
|
38
40
|
The archive currently covers visible text and original execution links, not hidden reasoning, attachments or arbitrary local tool output. Older records containing only execution summaries continue to identify missing transcript text.
|
|
39
41
|
|
|
40
|
-
See the [v0.
|
|
42
|
+
See the [v0.7.0 upgrade notes](../RELEASE_NOTES_v0.7.0.en.md). Client developers can continue with the [integration guide](../AGENT_CLIENT_QUICKSTART.en.md) and [conversation archive API](../AGENT_CONVERSATION_AUDIT.en.md).
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
ๅฆๆไฝ ็ฎก็ๅไธ็ณป็ป้็ AใB ไธคๅฎถ้จๅบ๏ผ่ฟๅปๅฏ่ฝ่ฆๅ
ๅๆข่ดฆๆท๏ผๅๅๅซๆ้ฎใ้
ๅฅ็ๆฐๅฎขๆท็ซฏๅฏไปฅ่ฎฉไฝ ๅ
้ๅฅฝๆฌๆฌกๅฏน่ฏๅ
่ฎธไฝฟ็จ็ๆๆ๏ผๅ็ฑ Agent ไธบๆฏๆฌกๆไฝ้ๆฉๅฏนๅบ่ดฆๆทใ้จๅบๅชๆฏ็คบไพ๏ผๅฎไนๅฏไปฅๆฏๅไธ็ณป็ปไธญ็ไธคไธชไธๅก่ดฆๆทใ
|
|
6
6
|
|
|
7
|
+
ๅจๅไธไธญๆข้๏ผไนๅฏ้ๆฉๅๅไธๅบๅญไธคไธช็ณป็ป๏ผๅ
ๆฅๅบๅญ๏ผๅไฝฟ็จๅๅๅ
่ฎธ็ๆนไปทๆไธๆถๅจไฝใ็ณป็ป่ฏดๆ่งฃ้ๅ่ช็จ้๏ผๆๆๅ็งฐๅฑ็คบๅฎ้
ไธๅกๅฏน่ฑก๏ผไธค่พนๅๅๆ ๅฐ้ๅทฒ็กฎ่ฎคใ่ง[v0.7.0 ๅบๆฏ่ฏดๆ](../RELEASE_NOTES_v0.7.0.md)ใ
|
|
8
|
+
|
|
7
9
|
## ๅผๅงๅ้่ฆไปไน
|
|
8
10
|
|
|
9
|
-
้จ็ฝฒ่
ๅๅค BailingHub **0.
|
|
11
|
+
้จ็ฝฒ่
ๅๅค BailingHub **0.7.0**๏ผๆฌๅฐๅฎขๆท็ซฏไฝฟ็จ **dsh-bailinghub 0.5.0**๏ผๅฎไพ่ต็ฌ็ซ็ **bailinghub-mcp-server 0.5.0** SDKใไฝฟ็จ่ช็ ๅฎขๆท็ซฏๆถ๏ผๅผๅ่
้่ฆๆฅๅ
ฅไผ่ฏ่ๅดใๅๅงๅฏ่งๅๅฒๅๅฝๆกฃๆฅๅฃใๅ็ฌๅ็บงไธญๆข๏ผไธไผ่ฎฉๆงๅฎขๆท็ซฏ่ชๅจไธไผ ๅฎๆดๅฏน่ฏใ
|
|
10
12
|
|
|
11
13
|
ไธๅก็ณป็ปๅทฒ็ปๆฅๅ
ฅๅนถๅผๆพไบ้่ฆ็ๆไฝ๏ผไฝ ไนๅทฒ็ปๅๅซๅฎๆ AใB ็ไธๅกๆๆใๆญคๆฌกๅ็บงไธ่ฆๆฑ้ๅๆขๆไธๅก่ฝๅๆๅฎกๆน่งๅใ่ฟๆฒกๆๆฅๅ
ฅไธๅก็ณป็ปๆถ๏ผๅ
่ฟ่ก[ๅ
ฌๅผ Docker Demo](../DEMO.md)ไบ่งฃๆฅ่ฏขใๅฎกๆนๅๆง่ก๏ผ่ฏฅ Demo ไธๆฟไปฃๅค่ดฆๆทๅฎขๆท็ซฏ็ๅฎ่ฃ
ไธๆๆใ
|
|
12
14
|
|
|
@@ -37,4 +39,4 @@
|
|
|
37
39
|
|
|
38
40
|
ๅฝๅๅฝๆกฃ่ๅดๆฏๅฎขๆท็ซฏๅฎ้
ๅฏ่ง็ๆๆฌไธๅๆง่กๅ
ณ่๏ผไธๅ
ๅซ้่ๆจ็ใ้ไปถๆไปปๆๆฌๅฐๅทฅๅ
ท็ๅๅง่พๅบใๅช็ๅฐไบๆไปฝๆๆ็ๆง่กๆ่ฆใๅดๆฒกๆๅฎๆดๅๆ็ๆง่ฎฐๅฝ๏ผไปไผๆ็กฎ่กจ็คบๅๆ็ผบๅคฑใ
|
|
39
41
|
|
|
40
|
-
้จ็ฝฒไธๅ็บง่ฏท็ [v0.
|
|
42
|
+
้จ็ฝฒไธๅ็บง่ฏท็ [v0.7.0 ่ฏดๆ](../RELEASE_NOTES_v0.7.0.md)๏ผๅฎขๆท็ซฏๅผๅ่
่ฏท็[ๆฅๅ
ฅๆๅ](../AGENT_CLIENT_QUICKSTART.md)ๅ[ๅฎๆดๅฏน่ฏๆฅๅฃ](../AGENT_CONVERSATION_AUDIT.md)ใ
|
package/package.json
CHANGED
|
@@ -131,12 +131,25 @@
|
|
|
131
131
|
"agent_client": {
|
|
132
132
|
"type": "object",
|
|
133
133
|
"title": "ๆฌๅฐ Agent Runtime",
|
|
134
|
-
"description": "ๆฌๅฐ Agent
|
|
134
|
+
"description": "ๆฌๅฐ Agent ็ผๆ็ๆพๅผๅผๅ
ณใ็ณป็ป่ฏดๆใ่กฅๅ
ๆไปคๅๆฏ่ฝฎไธปๅจๅทฅๅ
ทไธ้๏ผ็ผบ็ๆถๅ
ผๅฎน tools.agent_direct.enabledใ",
|
|
135
135
|
"additionalProperties": false,
|
|
136
136
|
"properties": {
|
|
137
137
|
"enabled": { "type": "boolean" },
|
|
138
138
|
"instructions": { "type": "string", "maxLength": 20000 },
|
|
139
|
-
"active_tool_limit": { "type": "integer", "minimum": 1, "maximum": 12 }
|
|
139
|
+
"active_tool_limit": { "type": "integer", "minimum": 1, "maximum": 12 },
|
|
140
|
+
"system_info": {
|
|
141
|
+
"type": "object",
|
|
142
|
+
"title": "ไธๅก็ณป็ป่ฏดๆ",
|
|
143
|
+
"description": "้ฆๆฌกๆฅๆพๅทฅๅ
ทๅๅฏ่ฏปๅ็ไบงๅๅฎไฝๆฐๆฎ๏ผไธๆไบๅทฅๅ
ทๆ้๏ผไนไธไฝไธบๆจกๅ็ณป็ปๆไปคใ",
|
|
144
|
+
"additionalProperties": false,
|
|
145
|
+
"required": ["name", "summary", "domains", "boundaries"],
|
|
146
|
+
"properties": {
|
|
147
|
+
"name": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$", "title": "็ณป็ปๅ็งฐ" },
|
|
148
|
+
"summary": { "type": "string", "minLength": 1, "maxLength": 400, "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$", "title": "็ฎ็ญ็จ้" },
|
|
149
|
+
"domains": { "type": "array", "maxItems": 6, "items": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$" }, "title": "ๅ
ธๅไธๅกๆนๅ" },
|
|
150
|
+
"boundaries": { "type": "array", "maxItems": 6, "items": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$" }, "title": "ไธๅก่พน็" }
|
|
151
|
+
}
|
|
152
|
+
}
|
|
140
153
|
}
|
|
141
154
|
},
|
|
142
155
|
"budget": {
|
|
@@ -103,6 +103,7 @@ const englishCompanions = {
|
|
|
103
103
|
'docs/RELEASE_NOTES_v0.3.4.md': 'docs/RELEASE_NOTES_v0.3.4.en.md',
|
|
104
104
|
'docs/RELEASE_NOTES_v0.5.0.md': 'docs/RELEASE_NOTES_v0.5.0.en.md',
|
|
105
105
|
'docs/RELEASE_NOTES_v0.5.1.md': 'docs/RELEASE_NOTES_v0.5.1.en.md',
|
|
106
|
+
'docs/RELEASE_NOTES_v0.7.0.md': 'docs/RELEASE_NOTES_v0.7.0.en.md',
|
|
106
107
|
'docs/RELEASE_NOTES_v0.6.1.md': 'docs/RELEASE_NOTES_v0.6.1.en.md',
|
|
107
108
|
'docs/RELEASE_NOTES_v0.6.0.md': 'docs/RELEASE_NOTES_v0.6.0.en.md',
|
|
108
109
|
'docs/TOOLS_DESIGN.md': 'docs/TOOLS_DESIGN.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.
|
|
12
|
+
[ -n "$TAG" ] || TAG="0.7.0"
|
|
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.
|
|
42
|
-
assert.equal(result.stableVersion, '0.
|
|
41
|
+
assert.equal(result.version, '0.7.0');
|
|
42
|
+
assert.equal(result.stableVersion, '0.7.0');
|
|
43
43
|
assert.equal(result.publishTag, 'latest');
|
|
44
44
|
});
|
|
45
45
|
|
package/scripts/install.sh
CHANGED
|
@@ -275,7 +275,7 @@ write_env() {
|
|
|
275
275
|
TOOL_SECRET="${DEMO_TOOL_SECRET:-$(secret)}"
|
|
276
276
|
CLIENT_TOKEN="${DEMO_CLIENT_TOKEN:-$(secret)}"
|
|
277
277
|
IMAGE_TAG="${BAILING_IMAGE_TAG:-$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$APP_DIR/package.json" | head -1)}"
|
|
278
|
-
[ -n "$IMAGE_TAG" ] || IMAGE_TAG="0.
|
|
278
|
+
[ -n "$IMAGE_TAG" ] || IMAGE_TAG="0.7.0"
|
|
279
279
|
IMAGE_REGISTRY="${BAILING_IMAGE_REGISTRY:-$DEFAULT_IMAGE_REGISTRY}"
|
|
280
280
|
IMAGE_NAMESPACE="${BAILING_IMAGE_NAMESPACE:-$DEFAULT_IMAGE_NAMESPACE}"
|
|
281
281
|
cat > "$ENV_FILE" <<EOF
|
|
@@ -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.
|
|
12
|
+
[ -n "$TAG" ] || TAG="0.7.0"
|
|
13
13
|
NODE_IMAGE="${BAILING_NODE_IMAGE:-node:22-bookworm-slim}"
|
|
14
14
|
PLATFORM="${BAILING_IMAGE_PLATFORM:-linux/amd64}"
|
|
15
15
|
PUSH="${BAILING_PUSH_IMAGES:-0}"
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { createServer } from 'node:http';
|
|
2
|
+
|
|
3
|
+
// Invoked by sdk-runtime-test.mjs so lifecycle checks share its runtime matrix.
|
|
4
|
+
export async function checkAgentAuthLifecycle({ root, runAsync, ok, closeServer }) {
|
|
5
|
+
const authorizationId = '11111111-1111-4111-8111-111111111111';
|
|
6
|
+
const unmappedId = '33333333-3333-4333-8333-333333333333';
|
|
7
|
+
const sessionId = '22222222-2222-4222-8222-222222222222';
|
|
8
|
+
const session = { session_id: sessionId, state: 'revoked', expires_at: '2030-02-01T00:00:00.000Z', revoked_at: '2030-01-02T00:00:00.000Z' };
|
|
9
|
+
const item = {
|
|
10
|
+
...session, authorization_id: authorizationId, client_app_id: 'merchant-agent',
|
|
11
|
+
device_label: 'Test device', principal: { id: '็จๆท +/?&=๐', tenant: '็งๆท&=' },
|
|
12
|
+
on_behalf_of: 'tenant:user +/?&=๐', allowed_routes: ['staff-route'],
|
|
13
|
+
created_at: '2030-01-01T00:00:00.000Z', last_seen_at: '2030-01-01T01:00:00.000Z',
|
|
14
|
+
};
|
|
15
|
+
const filters = {
|
|
16
|
+
authorization_id: authorizationId, on_behalf_of: item.on_behalf_of,
|
|
17
|
+
principal_id: item.principal.id, tenant: item.principal.tenant,
|
|
18
|
+
state: 'revoked', limit: 100, cursor: 'next_page-1',
|
|
19
|
+
};
|
|
20
|
+
const invalid = [
|
|
21
|
+
{ unknown: 'field' }, { client_app_id: 'other-app' }, { 0: 'active' },
|
|
22
|
+
{ authorization_id: null }, { authorization_id: '-'.repeat(36) },
|
|
23
|
+
{ authorization_id: '11111111-1111-0111-8111-111111111111' },
|
|
24
|
+
{ authorization_id: '11111111-1111-4111-0111-111111111111' },
|
|
25
|
+
{ on_behalf_of: '' }, { on_behalf_of: 'x'.repeat(192) }, { on_behalf_of: [] },
|
|
26
|
+
{ principal_id: 'u' }, { principal_id: '', tenant: '' },
|
|
27
|
+
{ principal_id: 'u'.repeat(129), tenant: '' },
|
|
28
|
+
{ tenant: null }, { tenant: 't'.repeat(129) },
|
|
29
|
+
{ on_behalf_of: ' user' }, { tenant: 'tenant ' }, { tenant: '\uFEFFtenant' },
|
|
30
|
+
{ tenant: 'a\u0000b' }, { tenant: 'a\u007fb' },
|
|
31
|
+
{ tenant: '๐'.repeat(65) }, { state: 'all' }, { state: [] },
|
|
32
|
+
{ limit: 0 }, { limit: 101 }, { limit: '20' }, { limit: 1.5 }, { limit: true },
|
|
33
|
+
{ cursor: '' }, { cursor: null }, { cursor: 'with=' }, { cursor: 'with+' },
|
|
34
|
+
{ cursor: 'with/' }, { cursor: 'next\n' }, { cursor: 'a'.repeat(2049) },
|
|
35
|
+
];
|
|
36
|
+
const invalidDisplays = [
|
|
37
|
+
{}, { name: '' }, { name: ' ' }, { name: 42 }, { name: 'a', scope: '*' },
|
|
38
|
+
{ name: 'a'.repeat(121) }, { name: '๐'.repeat(61) }, { name: 'a\nb' },
|
|
39
|
+
{ name: '\ta' }, { name: 'a\u007f' }, { name: 'a\u0085' }, { name: 'a\u2028b' },
|
|
40
|
+
{ name: 'a\u2029b' }, [], 'Account A',
|
|
41
|
+
];
|
|
42
|
+
const requests = [];
|
|
43
|
+
const server = createServer(async (req, res) => {
|
|
44
|
+
let body = '';
|
|
45
|
+
for await (const chunk of req) body += chunk;
|
|
46
|
+
requests.push({ method: req.method, url: req.url, body, headers: req.headers });
|
|
47
|
+
res.setHeader('Content-Type', 'application/json');
|
|
48
|
+
const url = new URL(req.url, 'http://fixture.invalid');
|
|
49
|
+
if (url.pathname === `/agent-auth/v1/authorizations/${authorizationId}`) {
|
|
50
|
+
res.end(JSON.stringify({ status: 'consumed', requested_routes: ['staff-route'], session }));
|
|
51
|
+
} else if (url.pathname === `/agent-auth/v1/authorizations/${unmappedId}`) {
|
|
52
|
+
res.end(JSON.stringify({ status: 'consumed', requested_routes: ['staff-route'], session: null }));
|
|
53
|
+
} else if (url.pathname === '/agent-auth/v1/sessions') {
|
|
54
|
+
res.end(JSON.stringify({ list: [item], next_cursor: url.search ? null : 'next_page-1' }));
|
|
55
|
+
} else if (url.pathname === `/agent-auth/v1/authorizations/${authorizationId}/revoke`) {
|
|
56
|
+
res.end(JSON.stringify({ authorization_id: authorizationId, revoked: true, session_id: sessionId }));
|
|
57
|
+
} else if (url.pathname === `/agent-auth/v1/authorizations/${authorizationId}/approve`) {
|
|
58
|
+
res.end(JSON.stringify({ redirect_uri: 'http://127.0.0.1:12345/callback?code=synthetic-code' }));
|
|
59
|
+
} else if (url.pathname === `/agent-auth/v1/sessions/${sessionId}/subject-display`) {
|
|
60
|
+
const display = JSON.parse(body).subject_display;
|
|
61
|
+
res.end(JSON.stringify({ ...item, state: 'active', subject_display: display, subject_display_status: display ? 'provided' : 'missing' }));
|
|
62
|
+
} else if (url.pathname.endsWith('/deny') || url.pathname.endsWith('/revoke') || url.pathname === '/body-check') {
|
|
63
|
+
res.end('{}');
|
|
64
|
+
} else {
|
|
65
|
+
res.statusCode = 404;
|
|
66
|
+
res.end('{"error":"not found"}');
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
await new Promise((resolve, reject) => { server.once('error', reject); server.listen(0, '127.0.0.1', resolve); });
|
|
70
|
+
const encoded = (value) => Buffer.from(JSON.stringify(value)).toString('base64');
|
|
71
|
+
try {
|
|
72
|
+
for (const variant of ['php', 'php7']) {
|
|
73
|
+
const command = variant === 'php7' ? (process.env.BAILING_SDK_PHP7_BINARY || 'php') : 'php';
|
|
74
|
+
const start = requests.length;
|
|
75
|
+
const result = await runAsync(command, ['-r', `
|
|
76
|
+
require '${root}/sdk/${variant}/src/HubClient.php';
|
|
77
|
+
require '${root}/sdk/${variant}/src/AgentAuth.php';
|
|
78
|
+
$auth = new Bailing\\Connect\\AgentAuth('http://127.0.0.1:${server.address().port}', 'synthetic-client-token');
|
|
79
|
+
$out = array('runtime' => PHP_VERSION);
|
|
80
|
+
$out['context'] = $auth->context('${authorizationId}');
|
|
81
|
+
$out['unmapped'] = $auth->context('${unmappedId}');
|
|
82
|
+
$out['default'] = $auth->listSessions();
|
|
83
|
+
$out['filtered'] = $auth->listSessions(json_decode(base64_decode('${encoded(filters)}'), true));
|
|
84
|
+
$out['tenantless'] = $auth->listSessions(array('principal_id' => 'u', 'tenant' => '', 'limit' => 1));
|
|
85
|
+
$out['tenant'] = $auth->listSessions(array('tenant' => str_repeat('๐', 64)));
|
|
86
|
+
$out['revoke'] = $auth->revokeAuthorization('${authorizationId}');
|
|
87
|
+
$out['repeat'] = $auth->revokeAuthorization('${authorizationId}');
|
|
88
|
+
$auth->deny('${authorizationId}');
|
|
89
|
+
$auth->revokeSession('${sessionId}');
|
|
90
|
+
$hub = new Bailing\\Connect\\HubClient('http://127.0.0.1:${server.address().port}', 'synthetic-client-token');
|
|
91
|
+
$hub->post('/body-check', array('nested' => array(), 'value' => 'kept'));
|
|
92
|
+
$hub->post('/body-check', array('nonempty-list'));
|
|
93
|
+
$principal = array('id' => 'user-a', 'tenant' => 'tenant-a');
|
|
94
|
+
$out['approveOld'] = $auth->approve('${authorizationId}', $principal, 'tenant-a:user-a', array('staff-route'));
|
|
95
|
+
$out['approveNamed'] = $auth->approve('${authorizationId}', $principal, 'tenant-a:user-a', array('staff-route'), array('name' => ' Account A '));
|
|
96
|
+
$out['approveMissing'] = $auth->approve('${authorizationId}', $principal, 'tenant-a:user-a', array('staff-route'), null);
|
|
97
|
+
$out['named'] = $auth->updateSubjectDisplay('${sessionId}', array('name' => 'ใAccount Aใ'));
|
|
98
|
+
$out['cleared'] = $auth->updateSubjectDisplay('${sessionId}', null);
|
|
99
|
+
$out['unicodeName'] = $auth->updateSubjectDisplay('${sessionId}', array('name' => str_repeat('๐', 60)));
|
|
100
|
+
$out['invalidDisplays'] = array();
|
|
101
|
+
foreach (json_decode(base64_decode('${encoded(invalidDisplays)}'), true) as $display) {
|
|
102
|
+
try { $auth->updateSubjectDisplay('${sessionId}', $display); $out['invalidDisplays'][] = false; }
|
|
103
|
+
catch (Throwable $e) { $out['invalidDisplays'][] = true; }
|
|
104
|
+
try { $auth->approve('${authorizationId}', $principal, 'tenant-a:user-a', array('staff-route'), $display); $out['invalidDisplays'][] = false; }
|
|
105
|
+
catch (Throwable $e) { $out['invalidDisplays'][] = true; }
|
|
106
|
+
}
|
|
107
|
+
try { $auth->updateSubjectDisplay('${sessionId}', array('name' => "\\xFF")); $out['invalidDisplayUtf8'] = false; }
|
|
108
|
+
catch (Throwable $e) { $out['invalidDisplayUtf8'] = true; }
|
|
109
|
+
try { $auth->updateSubjectDisplay('not-a-uuid', null); $out['invalidDisplayId'] = false; }
|
|
110
|
+
catch (Throwable $e) { $out['invalidDisplayId'] = true; }
|
|
111
|
+
$out['invalid'] = array();
|
|
112
|
+
foreach (json_decode(base64_decode('${encoded(invalid)}'), true) as $filters) {
|
|
113
|
+
try { $auth->listSessions($filters); $out['invalid'][] = false; }
|
|
114
|
+
catch (InvalidArgumentException $e) { $out['invalid'][] = true; }
|
|
115
|
+
}
|
|
116
|
+
try { $auth->listSessions(array('tenant' => "\\xFF")); $out['invalidUtf8'] = false; }
|
|
117
|
+
catch (InvalidArgumentException $e) { $out['invalidUtf8'] = true; }
|
|
118
|
+
try { $auth->revokeAuthorization('not-a-uuid'); $out['invalidId'] = false; }
|
|
119
|
+
catch (InvalidArgumentException $e) { $out['invalidId'] = true; }
|
|
120
|
+
echo json_encode($out, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
|
121
|
+
`]);
|
|
122
|
+
let data;
|
|
123
|
+
try { data = JSON.parse(result.stdout); } catch {}
|
|
124
|
+
const captured = requests.slice(start);
|
|
125
|
+
const label = `${variant.toUpperCase()} AgentAuth lifecycle`;
|
|
126
|
+
ok(`${label} runs on PHP ${data?.runtime ?? 'unknown'}`, result.status === 0 && !!data, result.stderr || result.stdout);
|
|
127
|
+
ok(`${label} preserves consumed context and missing-session projection`,
|
|
128
|
+
JSON.stringify(data?.context?.session) === JSON.stringify(session)
|
|
129
|
+
&& data?.context?.requested_routes?.[0] === 'staff-route'
|
|
130
|
+
&& data?.unmapped?.session === null);
|
|
131
|
+
ok(`${label} returns list metadata and opaque/null cursors unchanged`,
|
|
132
|
+
JSON.stringify(data?.default?.list) === JSON.stringify([item])
|
|
133
|
+
&& data?.default?.next_cursor === 'next_page-1' && data?.filtered?.next_cursor === null);
|
|
134
|
+
const listRequests = captured.filter((request) => request.url.startsWith('/agent-auth/v1/sessions') && request.method === 'GET');
|
|
135
|
+
const query = new URL(listRequests[1]?.url ?? '/', 'http://fixture.invalid');
|
|
136
|
+
ok(`${label} uses only whitelisted RFC3986 query fields without broadening`,
|
|
137
|
+
listRequests[0]?.url === '/agent-auth/v1/sessions'
|
|
138
|
+
&& JSON.stringify(Object.fromEntries(query.searchParams)) === JSON.stringify(Object.fromEntries(Object.entries(filters).map(([key, value]) => [key, String(value)])))
|
|
139
|
+
&& listRequests[1]?.url.includes('%20') && !listRequests[1]?.url.includes('+')
|
|
140
|
+
&& listRequests[2]?.url === '/agent-auth/v1/sessions?principal_id=u&tenant=&limit=1'
|
|
141
|
+
&& new URL(listRequests[3]?.url ?? '/', 'http://fixture.invalid').searchParams.get('tenant') === '๐'.repeat(64));
|
|
142
|
+
ok(`${label} rejects ${invalid.length + 2} invalid filters/IDs before HTTP`,
|
|
143
|
+
data?.invalid?.length === invalid.length && data.invalid.every(Boolean)
|
|
144
|
+
&& data?.invalidUtf8 === true && data?.invalidId === true && captured.length === 18);
|
|
145
|
+
ok(`${label} uses idempotent revoke-authorization path and empty object bodies`,
|
|
146
|
+
JSON.stringify(data?.revoke) === JSON.stringify({ authorization_id: authorizationId, revoked: true, session_id: sessionId })
|
|
147
|
+
&& JSON.stringify(data?.repeat) === JSON.stringify(data?.revoke)
|
|
148
|
+
&& captured.slice(6, 10).every((request) => request.method === 'POST' && request.body === '{}')
|
|
149
|
+
&& captured[6]?.url === `/agent-auth/v1/authorizations/${authorizationId}/revoke`
|
|
150
|
+
&& captured[7]?.url === captured[6]?.url);
|
|
151
|
+
ok(`${label} keeps non-empty HubClient bodies unchanged`,
|
|
152
|
+
captured[10]?.body === '{"nested":[],"value":"kept"}' && captured[11]?.body === '["nonempty-list"]');
|
|
153
|
+
const approvals = captured.filter((request) => request.url.endsWith('/approve'));
|
|
154
|
+
ok(`${label} keeps four-argument approval compatible and transmits explicit display/null`,
|
|
155
|
+
approvals.length === 3 && approvals.every((request) => request.method === 'POST')
|
|
156
|
+
&& !Object.hasOwn(JSON.parse(approvals[0].body), 'subject_display')
|
|
157
|
+
&& JSON.stringify(JSON.parse(approvals[1].body).subject_display) === JSON.stringify({ name: 'Account A' })
|
|
158
|
+
&& JSON.parse(approvals[2].body).subject_display === null
|
|
159
|
+
&& JSON.parse(approvals[1].body).principal.id === 'user-a');
|
|
160
|
+
const updates = captured.filter((request) => request.url.endsWith('/subject-display'));
|
|
161
|
+
ok(`${label} updates only display via PUT and preserves returned session metadata`,
|
|
162
|
+
updates.length === 3 && updates.every((request) => request.method === 'PUT'
|
|
163
|
+
&& Object.keys(JSON.parse(request.body)).join(',') === 'subject_display')
|
|
164
|
+
&& data?.named?.subject_display?.name === 'Account A' && data?.named?.subject_display_status === 'provided'
|
|
165
|
+
&& data?.named?.session_id === sessionId && data?.named?.principal?.id === item.principal.id
|
|
166
|
+
&& data?.cleared?.subject_display === null && data?.cleared?.subject_display_status === 'missing'
|
|
167
|
+
&& data?.unicodeName?.subject_display?.name === '๐'.repeat(60));
|
|
168
|
+
ok(`${label} rejects invalid display objects, controls, length, UTF-8 and IDs before HTTP`,
|
|
169
|
+
data?.invalidDisplays?.length === invalidDisplays.length * 2 && data.invalidDisplays.every(Boolean)
|
|
170
|
+
&& data?.invalidDisplayUtf8 === true && data?.invalidDisplayId === true && captured.length === 18);
|
|
171
|
+
ok(`${label} sends only server-side Client Token headers`, captured.every((request) =>
|
|
172
|
+
request.headers.authorization === 'Bearer synthetic-client-token'
|
|
173
|
+
&& !request.url.includes('synthetic-client-token') && !request.body.includes('synthetic-client-token')));
|
|
174
|
+
}
|
|
175
|
+
} finally {
|
|
176
|
+
await closeServer(server);
|
|
177
|
+
}
|
|
178
|
+
}
|