dsh-bailinghub 0.2.0 → 0.3.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/CHANGELOG.md +25 -0
- package/PRIVACY.md +9 -4
- package/README.md +83 -31
- package/SECURITY.md +22 -4
- package/docs/AGENT_CLIENT_CONTRACT.md +74 -12
- package/docs/COMPATIBILITY.md +28 -12
- package/docs/GETTING_STARTED.md +92 -0
- package/docs/GETTING_STARTED.zh-CN.md +83 -0
- package/docs/MIGRATION_VNEXT.md +39 -17
- package/docs/PROJECT_BOUNDARIES.md +3 -2
- package/docs/README.zh-CN.md +69 -27
- package/lib/runtime.js +423 -27
- package/lib/transport.js +5 -1
- package/package.json +14 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.3.0 - 2026-09-01
|
|
6
|
+
|
|
7
|
+
- Add `/bailinghub doctor` for credential-safe host-contract, configuration, SDK, authorization,
|
|
8
|
+
and workspace diagnostics before a business turn starts.
|
|
9
|
+
- Add real lifecycle coverage for DeepSeek Harness `0.1.1-rc.2` and enforce it in Ubuntu,
|
|
10
|
+
Windows, and tagged publication workflows.
|
|
11
|
+
- Make `connectionName` a user-controlled local selector while the business authorization page
|
|
12
|
+
owns login, account switching, tenant selection, and the trusted identity result.
|
|
13
|
+
- Reconcile same-binding connections by trusted `on_behalf_of`: replace an older same-identity
|
|
14
|
+
connection, keep different identities independent, and surface cleanup-required authorization
|
|
15
|
+
as a successful login with an explicit no-reauthorize warning.
|
|
16
|
+
- Preserve an existing alias and Session when same-alias authorization returns a different trusted
|
|
17
|
+
identity; allocate and select a non-conflicting local alias for the new identity.
|
|
18
|
+
- Add user-only `/bailinghub connections list|add|use|remove` lifecycle commands with quoted-name
|
|
19
|
+
parsing, new-session-only selection, existing-session pinning, and revoke-before-remove safety.
|
|
20
|
+
- Restore the SDK registry's current connection before the first new session or user command after
|
|
21
|
+
restart, with validated public metadata and a non-blocking bootstrap-field fallback.
|
|
22
|
+
- Reconcile defaults after connection removal: adopt a remaining current profile, become
|
|
23
|
+
unconfigured after the last removal, and preserve successful removal across registry refresh
|
|
24
|
+
failures without disturbing a valid non-current default.
|
|
25
|
+
- Pin the stable public `bailinghub-mcp-server@0.3.0` SDK, including Windows CurrentUser DPAPI
|
|
26
|
+
credential storage for Agent Session connections.
|
|
27
|
+
|
|
3
28
|
## 0.2.0 - 2026-08-26
|
|
4
29
|
|
|
5
30
|
- Add the native Cordis Agent Client adapter that keeps reasoning and orchestration in local DSH
|
package/PRIVACY.md
CHANGED
|
@@ -10,14 +10,19 @@ using personal, confidential, or regulated data.
|
|
|
10
10
|
Do not include tokens, private URLs, personal information, or production payloads in public
|
|
11
11
|
issues, screenshots, or compatibility reports.
|
|
12
12
|
|
|
13
|
-
## Native Agent Client 0.
|
|
13
|
+
## Native Agent Client 0.3.0
|
|
14
14
|
|
|
15
|
-
The native 0.
|
|
15
|
+
The native 0.3.0 plugin sends each direct human user turn to BailingHub Core and receives
|
|
16
16
|
model-visible instructions, memory, reference-only knowledge, governance, and active tool schemas.
|
|
17
17
|
Business tool arguments and governed results cross the same boundary. At completion it sends only
|
|
18
18
|
the hash-aliased assistant message id, visible final text, legal status, optional model/runtime
|
|
19
19
|
labels, and numeric public usage. It ignores `assistant/chunk` and never uploads hidden reasoning.
|
|
20
20
|
|
|
21
21
|
Browser authorization, refresh, and credential storage remain SDK-owned; this adapter stores no
|
|
22
|
-
BailingHub credential.
|
|
23
|
-
|
|
22
|
+
BailingHub credential. The SDK uses macOS Keychain, Windows CurrentUser DPAPI, or an explicitly
|
|
23
|
+
enabled isolated mode-0600 POSIX file store. Review DSH, model-provider, BailingHub, and
|
|
24
|
+
business-system retention boundaries before enabling the plugin.
|
|
25
|
+
|
|
26
|
+
The multi-connection registry contains public connection name, Hub URL, client app id, workspace,
|
|
27
|
+
timestamps, and current-selection state. It does not contain access tokens, refresh tokens, model
|
|
28
|
+
keys, business cookies, prompts, tool arguments, or business results.
|
package/README.md
CHANGED
|
@@ -2,17 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](docs/README.zh-CN.md) | English
|
|
4
4
|
|
|
5
|
-
Use
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Use your local DeepSeek Harness Agent to operate the admin side of an online store, SaaS product,
|
|
6
|
+
or other business system through BailingHub. Ask it to look up data, update records, or run other
|
|
7
|
+
actions available to the connected account. The existing business identity, permissions, and
|
|
8
|
+
approval rules still apply, and BailingHub keeps the authorization and action trail.
|
|
9
|
+
|
|
10
|
+
For example, depending on what the connected business system has exposed, you can ask the local
|
|
11
|
+
Agent to:
|
|
12
|
+
|
|
13
|
+
- find an order, customer, product, or employee record;
|
|
14
|
+
- update an allowed field or business status;
|
|
15
|
+
- run another permitted admin action;
|
|
16
|
+
- return the result while BailingHub records the corresponding tool steps.
|
|
17
|
+
|
|
18
|
+
Reasoning and tool orchestration stay in DSH. BailingHub supplies the authorized business context,
|
|
19
|
+
available capabilities, approval state, invocation recovery, and audit records required for the
|
|
20
|
+
local Agent to act safely.
|
|
8
21
|
|
|
9
22
|
This is an independent community integration. It is not developed, certified, endorsed, or
|
|
10
23
|
recommended by DeepSeek.
|
|
11
24
|
|
|
12
|
-
> **Current stable line:** `dsh-bailinghub@0.
|
|
25
|
+
> **Current stable line:** `dsh-bailinghub@0.3.0` uses the native Agent Client flow documented
|
|
13
26
|
> below. Public `0.1.1` remains available only as the explicit static MCP compatibility path.
|
|
14
27
|
|
|
15
|
-
|
|
28
|
+
For the shortest end-user path, follow the [three-minute getting started guide](docs/GETTING_STARTED.md).
|
|
29
|
+
|
|
30
|
+
## How the 0.3 Agent Client fits together
|
|
16
31
|
|
|
17
32
|
```text
|
|
18
33
|
DeepSeek Harness local Agent
|
|
@@ -27,7 +42,7 @@ The packages have separate responsibilities:
|
|
|
27
42
|
- **BailingHub Core** owns Agent Auth, trusted business identity, runtime context, knowledge and
|
|
28
43
|
memory projection, capability governance, approvals, invocation state, and audit records.
|
|
29
44
|
- **`bailinghub-mcp-server/sdk`** owns browser login, PKCE, credential storage, refresh,
|
|
30
|
-
Hub/client/workspace connection
|
|
45
|
+
Hub/client/workspace connection selection, and HTTP DTO mapping.
|
|
31
46
|
- **`dsh-bailinghub`** owns only DSH session, prompt, command, and dynamic-tool lifecycle
|
|
32
47
|
integration. It does not store credentials or call a business API directly.
|
|
33
48
|
|
|
@@ -43,27 +58,29 @@ The deployer and business integrator must prepare these public identifiers in Ba
|
|
|
43
58
|
2. A public Agent Client application id (`clientAppId`).
|
|
44
59
|
3. At least one authorized workspace. In Agent Client v1, the workspace id is the BailingHub
|
|
45
60
|
route id.
|
|
46
|
-
4.
|
|
61
|
+
4. One stable, account- and tenant-neutral business authorization entry configured on the Hub
|
|
62
|
+
Client App, plus a governed ACC/Tool Provider integration behind that route. The business page
|
|
63
|
+
must handle sign-in, account switching, and tenant selection before it approves the request.
|
|
47
64
|
|
|
48
65
|
The end user does **not** enter a business API URL, business login credential, Tool Provider
|
|
49
66
|
signing secret, BailingHub Client Token, or model-provider key into this plugin.
|
|
50
67
|
|
|
51
|
-
## Install the 0.
|
|
68
|
+
## Install the 0.3 line
|
|
52
69
|
|
|
53
70
|
Prerequisites:
|
|
54
71
|
|
|
55
72
|
- Node.js `22.19.0+` or `24+`;
|
|
56
|
-
- `pnpm` and DeepSeek Harness
|
|
73
|
+
- `pnpm` and a DeepSeek Harness release listed in the compatibility matrix;
|
|
57
74
|
- the BailingHub preparation above.
|
|
58
75
|
|
|
59
76
|
Install the exact stable version into the DSH Web profile:
|
|
60
77
|
|
|
61
78
|
```bash
|
|
62
|
-
npm install --global pnpm @deepseek-ai/dsh@0.1.
|
|
63
|
-
dsh plugin --profile web add dsh-bailinghub@0.
|
|
79
|
+
npm install --global pnpm @deepseek-ai/dsh@0.1.1-rc.2
|
|
80
|
+
dsh plugin --profile web add dsh-bailinghub@0.3.0
|
|
64
81
|
```
|
|
65
82
|
|
|
66
|
-
`dsh-bailinghub@0.
|
|
83
|
+
`dsh-bailinghub@0.3.0` installs its exact compatible `bailinghub-mcp-server@0.3.0` dependency
|
|
67
84
|
automatically. DSH users should not separately guess or install an SDK version.
|
|
68
85
|
|
|
69
86
|
## Configure one Hub connection
|
|
@@ -75,7 +92,7 @@ The native plugin has exactly four host configuration fields:
|
|
|
75
92
|
| `hubUrl` | `BAILINGHUB_HUB_URL` | Public HTTPS URL of the developer's own BailingHub | No |
|
|
76
93
|
| `clientAppId` | `BAILINGHUB_CLIENT_APP_ID` | Public Agent Client application id registered in that Hub | No |
|
|
77
94
|
| `workspace` | `BAILINGHUB_WORKSPACE` | Initial authorized workspace/route id | No |
|
|
78
|
-
| `connectionName` | `BAILINGHUB_CONNECTION_NAME` |
|
|
95
|
+
| `connectionName` | `BAILINGHUB_CONNECTION_NAME` | User-selected local connection label | No |
|
|
79
96
|
|
|
80
97
|
Example placeholders:
|
|
81
98
|
|
|
@@ -87,7 +104,9 @@ export BAILINGHUB_CONNECTION_NAME='default'
|
|
|
87
104
|
```
|
|
88
105
|
|
|
89
106
|
The same four fields may be supplied through the DSH plugin settings surface. Do not add tokens,
|
|
90
|
-
authorization URLs, business domains, or credentials to the Cordis patch.
|
|
107
|
+
authorization URLs, business domains, or credentials to the Cordis patch. The Hub resolves the
|
|
108
|
+
Client App to its single business authorization entry. `connectionName` is only a user-controlled
|
|
109
|
+
local selector; it is not an account, tenant, or identity claim.
|
|
91
110
|
|
|
92
111
|
Inspect the composed profile before starting it:
|
|
93
112
|
|
|
@@ -102,19 +121,26 @@ In DSH, run:
|
|
|
102
121
|
|
|
103
122
|
```text
|
|
104
123
|
/bailinghub login
|
|
124
|
+
/bailinghub doctor
|
|
105
125
|
/bailinghub status
|
|
106
126
|
/bailinghub workspaces
|
|
107
127
|
```
|
|
108
128
|
|
|
109
|
-
`login` opens the system browser
|
|
110
|
-
business
|
|
111
|
-
|
|
112
|
-
|
|
129
|
+
`login` opens the system browser at the single business authorization entry configured by the Hub
|
|
130
|
+
operator. That business page owns sign-in, account switching, and tenant selection, confirms the
|
|
131
|
+
resulting business identity and requested workspace, then returns to a random loopback callback
|
|
132
|
+
protected by `state` and PKCE S256. Access and refresh tokens remain in SDK-owned secure storage
|
|
133
|
+
and are never written to the plugin configuration or printed by the command.
|
|
113
134
|
|
|
114
135
|
Useful commands:
|
|
115
136
|
|
|
116
137
|
| Command | Purpose |
|
|
117
138
|
| --- | --- |
|
|
139
|
+
| `/bailinghub doctor` | Check host APIs, public configuration, SDK resolution, authorization, and workspace reachability without printing credentials |
|
|
140
|
+
| `/bailinghub connections list` | List local public connection metadata and authorization state without tokens |
|
|
141
|
+
| `/bailinghub connections add <name> <hub-url> <client-app-id> <workspace>` | Create and select another local connection instance for new sessions; the public binding may match an existing instance |
|
|
142
|
+
| `/bailinghub connections use <name-or-key>` | Select a registered connection for new sessions only |
|
|
143
|
+
| `/bailinghub connections remove <name-or-key>` | Remotely revoke its Agent Session, then remove its local credential and metadata |
|
|
118
144
|
| `/bailinghub login` | Authorize the configured Hub/client/workspace in the browser |
|
|
119
145
|
| `/bailinghub status` | Inspect the selected connection without printing credentials |
|
|
120
146
|
| `/bailinghub workspaces` | List workspaces allowed by the current business authorization |
|
|
@@ -122,12 +148,37 @@ Useful commands:
|
|
|
122
148
|
| `/bailinghub sync` | Retry a pending visible completion record without repeating a tool call |
|
|
123
149
|
| `/bailinghub logout` | Revoke and remove the selected Agent Session |
|
|
124
150
|
|
|
125
|
-
The
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
`
|
|
151
|
+
The four plugin fields are the bootstrap connection. Additional connections can be registered with
|
|
152
|
+
`connections add`; the BailingHub console's Agent Client page can generate the same secret-free
|
|
153
|
+
command. On restart, the adapter reads the SDK registry before the first new Agent session or user
|
|
154
|
+
command and adopts its current connection's public metadata; a missing or unavailable registry
|
|
155
|
+
safely falls back to the four bootstrap fields. Quote a connection name when it contains spaces.
|
|
156
|
+
After `connections use`, run `/bailinghub login` if that binding is not authorized yet.
|
|
157
|
+
|
|
158
|
+
Connection selection is a user-only slash command and is never exposed as a model tool. It affects
|
|
159
|
+
only Agent sessions created afterward; existing sessions remain pinned to their original
|
|
160
|
+
connection and workspace. `/bailinghub use <workspace>` remains a different operation: it succeeds
|
|
161
|
+
only when the current Agent Session already authorizes that workspace.
|
|
162
|
+
|
|
163
|
+
After removing the selected connection, the adapter reads the SDK registry and adopts the remaining
|
|
164
|
+
current connection for new sessions, including connections without an alias. Removing the final
|
|
165
|
+
connection leaves the adapter explicitly unconfigured. A failed post-remove registry read never
|
|
166
|
+
turns a successful removal into an error; removing a non-current connection also preserves the
|
|
167
|
+
still-valid default when that refresh is unavailable.
|
|
168
|
+
|
|
169
|
+
For the same `Hub + clientAppId + workspace` public binding, browser authorization determines the
|
|
170
|
+
identity from the business page and its trusted `on_behalf_of` result. If that identity is already
|
|
171
|
+
authorized under another local connection name, the SDK replaces the older local connection and
|
|
172
|
+
revokes its old Agent Session. A different trusted identity remains an independent connection.
|
|
173
|
+
If login starts from a `connectionName` that already belongs to another identity, the SDK keeps
|
|
174
|
+
that original alias and Session, gives the newly authorized identity an available local alias such
|
|
175
|
+
as `default-2`, and selects the new alias for future sessions. Use `connections list` to see both
|
|
176
|
+
and `connections use <name-or-key>` to switch explicitly.
|
|
177
|
+
If login returns `cleanupRequired: true`, the newly selected connection is still authorized, but
|
|
178
|
+
one or more existing same-binding connections need explicit cleanup. Their identity may still be
|
|
179
|
+
unconfirmed when inspection was deferred. Do not authorize again; inspect
|
|
180
|
+
`connections list` and retry `/bailinghub connections remove <name-or-key>` for the reported old
|
|
181
|
+
entry.
|
|
131
182
|
|
|
132
183
|
For the first acceptance check, start a new DSH conversation and perform one read-only request,
|
|
133
184
|
then one permitted mutation. Confirm the same conversation, run, visible final answer, and tool
|
|
@@ -139,10 +190,11 @@ current-turn dynamic schemas. Use native tool mode for governed business actions
|
|
|
139
190
|
|
|
140
191
|
## Security and privacy boundary
|
|
141
192
|
|
|
142
|
-
- The model cannot choose a Hub URL, workspace,
|
|
143
|
-
capability revision through tool arguments.
|
|
144
|
-
- The SDK stores credentials in macOS Keychain.
|
|
145
|
-
|
|
193
|
+
- The model cannot choose a Hub URL, workspace, local connection, business identity, credential,
|
|
194
|
+
approval result, or capability revision through tool arguments.
|
|
195
|
+
- The SDK stores credentials in macOS Keychain. On Windows it protects credential files under
|
|
196
|
+
LocalAppData with CurrentUser DPAPI; unavailable Windows PowerShell or DPAPI fails closed without
|
|
197
|
+
a plaintext fallback. Linux and other POSIX systems require an explicit secure file-store opt-in.
|
|
146
198
|
- BailingHub revalidates identity, scope, approval, idempotency, and invocation state on every
|
|
147
199
|
governed call. The downstream business system still performs final authorization.
|
|
148
200
|
- The adapter sends visible user input, governed tool arguments/results, and the visible final
|
|
@@ -176,13 +228,13 @@ mcp__bailinghub__get_governed_job
|
|
|
176
228
|
mcp__bailinghub__wait_for_governed_job
|
|
177
229
|
```
|
|
178
230
|
|
|
179
|
-
The 0.
|
|
180
|
-
explicit and follow the [0.1-to-0.
|
|
231
|
+
The 0.3 Agent Client does not automatically consume or migrate the 0.1 Client Token. Keep versions
|
|
232
|
+
explicit and follow the [0.1-to-0.3 migration boundary](docs/MIGRATION_VNEXT.md) when testing or
|
|
181
233
|
rolling back.
|
|
182
234
|
|
|
183
235
|
## Compatibility and feedback
|
|
184
236
|
|
|
185
|
-
Version 0.
|
|
237
|
+
Version 0.3.0 is verified only against the versions listed in
|
|
186
238
|
[docs/COMPATIBILITY.md](docs/COMPATIBILITY.md). DeepSeek Harness remains a developer preview, so
|
|
187
239
|
every Harness release requires a new native lifecycle smoke test.
|
|
188
240
|
|
package/SECURITY.md
CHANGED
|
@@ -19,15 +19,33 @@ configuration and are never model tool arguments.
|
|
|
19
19
|
|
|
20
20
|
Non-loopback HTTP is denied by default. Do not enable insecure HTTP on an untrusted network.
|
|
21
21
|
|
|
22
|
-
## Native 0.
|
|
22
|
+
## Native 0.3.0 boundary
|
|
23
23
|
|
|
24
|
-
The native 0.
|
|
24
|
+
The native 0.3.0 plugin accepts only `hubUrl`, `clientAppId`, `workspace`, and
|
|
25
25
|
`connectionName`. The generic SDK owns browser authorization, refresh, and secure credential
|
|
26
|
-
storage; business endpoints and final authorization remain Core/business-system concerns.
|
|
26
|
+
storage; business endpoints and final authorization remain Core/business-system concerns. The
|
|
27
|
+
Hub Client App owns one business authorization entry. That business page, not the plugin or model,
|
|
28
|
+
handles login, account switching, tenant selection, and the trusted `on_behalf_of` identity.
|
|
29
|
+
|
|
30
|
+
The multi-connection registry stores only public Hub/client/workspace metadata. `connectionName`
|
|
31
|
+
is a user-only local selector, not an identity claim. After browser
|
|
32
|
+
authorization, the SDK replaces an older same-binding connection only when the trusted
|
|
33
|
+
`on_behalf_of` matches; different trusted identities remain isolated. A same-alias authorization
|
|
34
|
+
for a different identity preserves the original alias and Session and assigns the new identity a
|
|
35
|
+
non-conflicting local alias. If inspection or old-Session revocation is uncertain, the new
|
|
36
|
+
connection stays authorized and explicit cleanup is required.
|
|
37
|
+
Connection add/use/remove are user slash commands, not model tools. Removing an authorized
|
|
38
|
+
connection is remote-revoke-first and keeps the local credential if revocation fails, so it cannot
|
|
39
|
+
falsely report a complete logout.
|
|
27
40
|
|
|
28
41
|
Tools are Agent/run scoped. Message ids are replaced by Core-safe hash aliases, invocation ids are
|
|
29
42
|
stable 64-character digests, and an `accepted_unknown` outcome must resume that exact invocation
|
|
30
43
|
instead of creating a replacement. Completion retries are bounded and reuse one frozen,
|
|
31
|
-
visible-only payload. Version 0.
|
|
44
|
+
visible-only payload. Version 0.3.0 installs `bailinghub-mcp-server@0.3.0` as an exact ordinary
|
|
32
45
|
dependency and resolves its `./sdk` export. It does not depend on ambient modules, an optional
|
|
33
46
|
peer, a range, a dist-tag, or a local path. Public `0.1.1` does not provide that facade.
|
|
47
|
+
|
|
48
|
+
Agent Session credentials use macOS Keychain or Windows CurrentUser DPAPI-protected files under
|
|
49
|
+
LocalAppData. Windows PowerShell or DPAPI unavailability fails closed without a plaintext fallback.
|
|
50
|
+
Linux and other POSIX hosts must explicitly enable the SDK's isolated mode-0600 file store. The
|
|
51
|
+
plugin never receives the credential value and never writes one into Cordis configuration.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Agent Client Host Adapter Contract
|
|
2
2
|
|
|
3
|
-
Status: public native Agent Client contract for `dsh-bailinghub@0.
|
|
4
|
-
of the legacy public `0.1.x` line.
|
|
3
|
+
Status: public native Agent Client contract for `dsh-bailinghub@0.3.0`. This contract is not part
|
|
4
|
+
of the legacy public `0.1.x` line. The multi-connection lifecycle described below is stable with
|
|
5
|
+
BailingHub Core `0.5.1` and `bailinghub-mcp-server@0.3.0`.
|
|
5
6
|
|
|
6
7
|
## Host Configuration
|
|
7
8
|
|
|
@@ -14,9 +15,12 @@ workspace
|
|
|
14
15
|
connectionName
|
|
15
16
|
```
|
|
16
17
|
|
|
17
|
-
`hubUrl`, `clientAppId`, and `workspace` identify a public Hub-side application/workspace.
|
|
18
|
-
`connectionName`
|
|
19
|
-
|
|
18
|
+
`hubUrl`, `clientAppId`, and `workspace` identify a public Hub-side application/workspace binding.
|
|
19
|
+
`connectionName` selects one local SDK connection instance, but it is not an account, tenant, or
|
|
20
|
+
identity claim. The Hub Client App resolves to one stable business authorization endpoint; no
|
|
21
|
+
business endpoint, authorization endpoint, token, secret, or business credential belongs in this
|
|
22
|
+
config. The business authorization page owns sign-in, account switching, tenant selection, and
|
|
23
|
+
the trusted identity ultimately represented by `on_behalf_of`.
|
|
20
24
|
|
|
21
25
|
## Injectable Transport Seam
|
|
22
26
|
|
|
@@ -24,6 +28,11 @@ The default transport is lazily created from `bailinghub-mcp-server/sdk`. Tests
|
|
|
24
28
|
adapters may inject an object with all methods below:
|
|
25
29
|
|
|
26
30
|
```js
|
|
31
|
+
connectionsList({})
|
|
32
|
+
connectionsAdd({ connectionName, hubUrl, clientAppId, workspace })
|
|
33
|
+
connectionsUse(connectionNameOrKey)
|
|
34
|
+
connectionsRemove(connectionNameOrKey)
|
|
35
|
+
|
|
27
36
|
login({ hubUrl, clientAppId, workspace, route, connectionName })
|
|
28
37
|
status({ connectionName })
|
|
29
38
|
logout({ connectionName })
|
|
@@ -56,6 +65,30 @@ The adapter may pass a second host metadata argument (`workspace`, `connectionNa
|
|
|
56
65
|
`AbortSignal`) to turn/tool methods. The framework-neutral SDK DTO is always the first argument;
|
|
57
66
|
an SDK implementation that does not consume host metadata may ignore it.
|
|
58
67
|
|
|
68
|
+
## Browser Identity and Local Reconciliation
|
|
69
|
+
|
|
70
|
+
`/bailinghub login` always starts from the selected Hub/client/workspace binding. The plugin does
|
|
71
|
+
not accept or derive a business URL, account id, tenant id, or identity selector. Core redirects
|
|
72
|
+
to the single authorization endpoint configured for that Client App, and the business page
|
|
73
|
+
performs any login, account switching, or tenant selection required before it approves the
|
|
74
|
+
authorization.
|
|
75
|
+
|
|
76
|
+
The SDK may stage more than one named local instance for the same public binding while browser
|
|
77
|
+
authorization is in progress. After authorization it compares the trusted Session
|
|
78
|
+
`on_behalf_of`, never the local `connectionName`:
|
|
79
|
+
|
|
80
|
+
- the same identity replaces the older local connection and revokes its old Agent Session;
|
|
81
|
+
- a different identity remains a separate named connection; when login was launched from an alias
|
|
82
|
+
already owned by the old identity, the SDK preserves that alias and Session, allocates an
|
|
83
|
+
available alias such as `default-2` to the new identity, and makes the new connection current;
|
|
84
|
+
- an uncertain identity inspection or failed old-Session revoke keeps the new Session authorized
|
|
85
|
+
and returns `cleanupRequired: true` with cleanup metadata.
|
|
86
|
+
|
|
87
|
+
The adapter reports that last result as successful authorization plus a visible warning. It tells
|
|
88
|
+
the user not to authorize again and to retry explicit cleanup with the user-only connection
|
|
89
|
+
lifecycle commands. It does not turn the result into a failed login or let the model perform
|
|
90
|
+
cleanup.
|
|
91
|
+
|
|
59
92
|
## Core HTTP Mapping
|
|
60
93
|
|
|
61
94
|
The SDK, not this adapter, maps those DTOs to:
|
|
@@ -97,9 +130,9 @@ object-rooted input schema, and complete governance metadata (`scope`, `risk`,
|
|
|
97
130
|
Both revision fields are required lowercase 64-character SHA-256 values; shorter labels or
|
|
98
131
|
uppercase digests fail closed.
|
|
99
132
|
|
|
100
|
-
## Verified DSH
|
|
133
|
+
## Verified DSH Lifecycles
|
|
101
134
|
|
|
102
|
-
DSH `0.1.0-rc.7`
|
|
135
|
+
DSH `0.1.0-rc.7` and `0.1.1-rc.2` claim inbox messages before assembling the current step:
|
|
103
136
|
|
|
104
137
|
```text
|
|
105
138
|
agent/inbox/claimed
|
|
@@ -160,9 +193,38 @@ same bounded recovery state when known locally, and never creates a replacement
|
|
|
160
193
|
|
|
161
194
|
## Session and Completion State
|
|
162
195
|
|
|
163
|
-
Connection
|
|
164
|
-
state are isolated per DSH Agent/session.
|
|
165
|
-
|
|
196
|
+
Connection selector, workspace, conversation alias, Core run, active definitions, and completion
|
|
197
|
+
state are isolated per DSH Agent/session. Named connections for different trusted identities own
|
|
198
|
+
separate SDK credentials and Agent Sessions. Same-binding connections that resolve to the same
|
|
199
|
+
trusted identity are reconciled to one local survivor after authorization. A workspace switch
|
|
200
|
+
preserves the selected connection instance and affects future sessions; it is rejected while any
|
|
201
|
+
Core run is active/completing or has an unsynchronized completion payload.
|
|
202
|
+
|
|
203
|
+
After a same-alias login resolves to a different trusted identity, the SDK-returned replacement
|
|
204
|
+
alias becomes the adapter default for new sessions. The retained old alias and the new alias both
|
|
205
|
+
remain visible through `connections list` and user-selectable through `connections use`; existing
|
|
206
|
+
DSH sessions remain pinned as described below.
|
|
207
|
+
|
|
208
|
+
Multi-connection add/use/remove is exposed only through the `/bailinghub connections` user
|
|
209
|
+
command. It is never registered as a model tool. Selecting a connection changes defaults for new
|
|
210
|
+
Agent sessions only; existing states keep their captured connection and workspace. Removing a
|
|
211
|
+
connection is rejected while any run is active or has an unsynchronized completion. The SDK then
|
|
212
|
+
revokes only that instance's remote Agent Session before removing its local credentials and
|
|
213
|
+
registry metadata; a revoke failure preserves both. Repeating add with the same name and public
|
|
214
|
+
binding selects the existing instance; reusing a name for different public metadata fails.
|
|
215
|
+
`connectionName` remains a local user selector and never becomes a trusted identity claim.
|
|
216
|
+
|
|
217
|
+
After a successful remove, the adapter reads the registry again. A valid remaining
|
|
218
|
+
`currentConnectionKey` replaces all four public defaults for future sessions, using the key itself
|
|
219
|
+
when the profile has no alias; no remaining connection sets the adapter to unconfigured. A refresh
|
|
220
|
+
failure does not change the successful remove result. It makes a removed default unavailable, but
|
|
221
|
+
does not invalidate an unchanged non-current default. Existing session state is never rewritten.
|
|
222
|
+
|
|
223
|
+
The four static adapter fields bootstrap SDK construction only. Before the first new Agent session
|
|
224
|
+
or user command after process start, the adapter reads `connectionsList()` and adopts the public
|
|
225
|
+
metadata matching `currentConnectionKey`. Invalid, missing, or unavailable registry data leaves the
|
|
226
|
+
bootstrap defaults in place and must not remove or block unrelated host tools. The lookup is not a
|
|
227
|
+
model tool, and restoring or later selecting a default never mutates an already-created session.
|
|
166
228
|
|
|
167
229
|
The completion request is restricted to:
|
|
168
230
|
|
|
@@ -183,8 +245,8 @@ the first attempt and reused unchanged for up to three automatic attempts. A fai
|
|
|
183
245
|
remains pending in its original run; `/bailinghub sync` starts another bounded attempt batch with
|
|
184
246
|
that same id and payload.
|
|
185
247
|
|
|
186
|
-
DSH
|
|
187
|
-
`cacheWriteTokens`, and `outputTokens`) on each durable `assistant/message`. The adapter sums them
|
|
248
|
+
The verified DSH releases report disjoint camelCase buckets (`inputTokens`, `cacheReadTokens`,
|
|
249
|
+
optional `cacheWriteTokens`, and `outputTokens`) on each durable `assistant/message`. The adapter sums them
|
|
188
250
|
across model steps, exposes total input as Core `input_tokens`, cache reads as the
|
|
189
251
|
`cached_input_tokens` subset, and derives `total_tokens` without adding `reasoningTokens` a second
|
|
190
252
|
time. Unknown, non-finite, and negative metrics are discarded; only the Core public usage
|
package/docs/COMPATIBILITY.md
CHANGED
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
# Compatibility
|
|
2
2
|
|
|
3
|
-
## Native Agent Client 0.
|
|
3
|
+
## Native Agent Client 0.3.0
|
|
4
4
|
|
|
5
5
|
| Component | Verified version |
|
|
6
6
|
| --- | --- |
|
|
7
|
-
| DeepSeek Harness / Cordis lifecycle | `0.1.0-rc.7` |
|
|
7
|
+
| DeepSeek Harness / Cordis lifecycle | `0.1.0-rc.7`; `0.1.1-rc.2` |
|
|
8
8
|
| Node.js | `22.19.0+` or `24+` |
|
|
9
9
|
| DSH tool presentation | Native Tool Mode |
|
|
10
|
-
| Generic Agent Client SDK | `bailinghub-mcp-server@0.
|
|
11
|
-
| BailingHub Core | `bailinghub@0.5.
|
|
10
|
+
| Generic Agent Client SDK | `bailinghub-mcp-server@0.3.0` via `./sdk` |
|
|
11
|
+
| BailingHub Core | `bailinghub@0.5.1`; Agent Auth v1 + Agent Client Runtime v1 |
|
|
12
12
|
| BailingHub turn context | `bailing.agent-turn-context.v1` |
|
|
13
13
|
| BailingHub capability search | `bailing.agent-capability-search.v1` |
|
|
14
14
|
| BailingHub governed invocation | `bailing.agent-tool-invocation.v1` |
|
|
15
15
|
| BailingHub run completion | `bailing.agent-run-completion.v1` |
|
|
16
16
|
|
|
17
|
-
Version 0.
|
|
17
|
+
Version 0.3.0 declares `bailinghub-mcp-server@0.3.0` as an exact ordinary dependency. A clean DSH
|
|
18
18
|
profile must work after installing only the plugin; ambient `node_modules`, peer/optional
|
|
19
19
|
dependencies, dist-tags, ranges, and local `file:` paths are outside the supported contract.
|
|
20
|
-
Compatibility with Core 0.5.
|
|
20
|
+
Compatibility with Core 0.5.1 includes the live Agent Auth/Runtime
|
|
21
21
|
contracts from that release.
|
|
22
22
|
|
|
23
23
|
DeepSeek Harness remains a developer preview. Every Harness version change requires a new smoke
|
|
24
24
|
against its real Cordis lifecycle, prompt waterfall, ToolRuntime, commands, durable session events,
|
|
25
25
|
and Web profile installation before this table can change.
|
|
26
26
|
|
|
27
|
+
`/bailinghub doctor` validates the required host API shape at runtime and reports the releases for
|
|
28
|
+
which that shape has been exercised. This is a diagnostic check, not a substitute for the live
|
|
29
|
+
browser authorization, read/write, approval/recovery, trajectory, and revocation gates below.
|
|
30
|
+
|
|
27
31
|
### Tool-mode and operating-system boundaries
|
|
28
32
|
|
|
29
33
|
- Native Tool Mode is required. DSH Code Mode is deliberately degraded because it cannot safely
|
|
30
|
-
present the current-turn dynamic business schemas in 0.
|
|
34
|
+
present the current-turn dynamic business schemas in 0.3.0.
|
|
31
35
|
- macOS Agent Session credentials use Keychain.
|
|
32
36
|
- Linux and other POSIX systems require the SDK's explicit secure file-store opt-in; the file must
|
|
33
37
|
remain owned by the current user with mode `0600`.
|
|
34
|
-
- Windows Agent Session
|
|
35
|
-
|
|
38
|
+
- Windows Agent Session credentials use CurrentUser DPAPI. Native package installation, SDK
|
|
39
|
+
resolution, and host lifecycle are Windows CI gates; each deployment must still accept its own
|
|
40
|
+
live browser and business authorization flow.
|
|
36
41
|
- Non-loopback Hub connections require HTTPS. Loopback HTTP is for local development only.
|
|
37
42
|
|
|
38
43
|
### Host configuration contract
|
|
@@ -50,6 +55,16 @@ In Agent Client v1, `workspace` is the BailingHub route id. Business endpoints,
|
|
|
50
55
|
URLs, Client Tokens, Tool Provider signing secrets, business credentials, and model-provider keys
|
|
51
56
|
are not DSH plugin configuration.
|
|
52
57
|
|
|
58
|
+
The public binding is the normalized Hub URL, client app id, and workspace tuple.
|
|
59
|
+
`connectionName` is a user-controlled local selector, not an identity claim. The Hub Client App
|
|
60
|
+
supplies one stable business authorization entry, and the business page
|
|
61
|
+
handles login, account switching, and tenant selection. After authorization, the SDK compares the
|
|
62
|
+
trusted `on_behalf_of` within the same public binding: the same identity replaces the older local
|
|
63
|
+
connection, while different identities remain independent. When a same-alias login returns a
|
|
64
|
+
different identity, the old alias and Session remain intact and the new identity receives a
|
|
65
|
+
non-conflicting alias that becomes current. A cleanup-required result keeps the new connection
|
|
66
|
+
authorized and must be resolved explicitly without another authorization attempt.
|
|
67
|
+
|
|
53
68
|
## Public legacy 0.1.x
|
|
54
69
|
|
|
55
70
|
| Component | Published version |
|
|
@@ -65,7 +80,7 @@ Public `dsh-bailinghub@0.1.1` remains a configuration-only bundle. It starts the
|
|
|
65
80
|
operator-configured Hub URL, route-scoped Client Token, and route. It does not establish an Agent
|
|
66
81
|
Session, receive a dynamic capability catalog, or move orchestration into local DSH.
|
|
67
82
|
|
|
68
|
-
The 0.
|
|
83
|
+
The 0.3 line must not mutate the published 0.1 package or reinterpret its configuration. A new
|
|
69
84
|
BailingHub Core release is compatible only after a separate clean legacy profile proves that the
|
|
70
85
|
0.1.1 `/run` and `/jobs/{job_id}` flow still works.
|
|
71
86
|
|
|
@@ -73,8 +88,9 @@ BailingHub Core release is compatible only after a separate clean legacy profile
|
|
|
73
88
|
|
|
74
89
|
Compatibility requires independent evidence for both paths:
|
|
75
90
|
|
|
76
|
-
1. Native 0.
|
|
77
|
-
discovery,
|
|
91
|
+
1. Native 0.3: clean install of only the exact plugin package, browser authorization, workspace
|
|
92
|
+
discovery, same-identity replacement, different-identity isolation, read, permitted mutation,
|
|
93
|
+
approval/resume, visible completion, and Hub trajectory.
|
|
78
94
|
2. Legacy 0.1.1: clean static profile, fixed Client Token route, one submit, and same-job follow-up
|
|
79
95
|
through the unchanged public Client API.
|
|
80
96
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Get started in three minutes
|
|
2
|
+
|
|
3
|
+
This guide is for someone whose organization has already connected a business system to
|
|
4
|
+
BailingHub. If that integration does not exist yet, the BailingHub administrator and business
|
|
5
|
+
developer must prepare it before an end user installs this plugin.
|
|
6
|
+
|
|
7
|
+
## What to ask your administrator for
|
|
8
|
+
|
|
9
|
+
Ask for these four public connection values:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Hub URL
|
|
13
|
+
Client App ID
|
|
14
|
+
Workspace
|
|
15
|
+
Connection Name
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
They identify the BailingHub application and starting workspace. They are not credentials. Do not
|
|
19
|
+
ask the administrator to send you a Client Token, Tool Provider secret, business password, model
|
|
20
|
+
API key, authorization code, browser session cookie, business URL, or tenant-specific login URL.
|
|
21
|
+
|
|
22
|
+
## 1. Install the plugin
|
|
23
|
+
|
|
24
|
+
Install the exact public version into the DSH Web profile:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
dsh plugin --profile web add dsh-bailinghub@0.3.0
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The plugin installs the matching BailingHub SDK automatically.
|
|
31
|
+
|
|
32
|
+
## 2. Enter the four connection values
|
|
33
|
+
|
|
34
|
+
Use the DSH plugin settings page or these environment names:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
export BAILINGHUB_HUB_URL='https://hub.example.com'
|
|
38
|
+
export BAILINGHUB_CLIENT_APP_ID='example-agent-client'
|
|
39
|
+
export BAILINGHUB_WORKSPACE='employee_assistant'
|
|
40
|
+
export BAILINGHUB_CONNECTION_NAME='default'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The values above are placeholders. Use the public values from your own BailingHub administrator.
|
|
44
|
+
Never paste credentials into the Cordis patch or a chat message.
|
|
45
|
+
|
|
46
|
+
## 3. Authorize in the browser
|
|
47
|
+
|
|
48
|
+
Start DSH and run:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
/bailinghub login
|
|
52
|
+
/bailinghub status
|
|
53
|
+
/bailinghub workspaces
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`login` opens the one business-side authorization entry configured for the Client App. Sign in or
|
|
57
|
+
switch account there, select a tenant there when the business system asks, and check the resulting
|
|
58
|
+
business identity and requested workspace before approving. Authorization uses the business
|
|
59
|
+
system's own login; it does not send the business password or business URL to the plugin.
|
|
60
|
+
|
|
61
|
+
`Connection Name` is only a local selector. If the same trusted business identity authorizes the
|
|
62
|
+
same Hub/client/workspace binding again, the SDK replaces the older local connection. A different
|
|
63
|
+
trusted identity remains separate. When the selected name already belongs to the old identity,
|
|
64
|
+
the SDK preserves it and assigns the new identity an available alias such as `default-2`; the new
|
|
65
|
+
alias becomes current. Run `/bailinghub connections list` to see both and
|
|
66
|
+
`/bailinghub connections use <name-or-key>` to switch. If login says cleanup is required, the new
|
|
67
|
+
connection is already authorized, but an existing connection may still need inspection or
|
|
68
|
+
removal: do not authorize again; list connections and remove the reported old entry.
|
|
69
|
+
|
|
70
|
+
## 4. Try one safe business request
|
|
71
|
+
|
|
72
|
+
Start a new conversation and ask for one read-only action that the connected system exposes, for
|
|
73
|
+
example:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
Find the demonstration employee EMP-001 and summarize the visible fields.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Then try one reversible permitted update in a dedicated development workspace. The exact requests
|
|
80
|
+
depend on the capabilities your business system has exposed. An operation that requires approval
|
|
81
|
+
must continue through the existing approval flow; an operation outside the current identity's
|
|
82
|
+
permissions must remain unavailable.
|
|
83
|
+
|
|
84
|
+
## 5. Confirm the result in BailingHub
|
|
85
|
+
|
|
86
|
+
The BailingHub console should show the same visible conversation, Agent Run, governed tool calls,
|
|
87
|
+
approval state, and final result. Do not treat a successful installation alone as proof that a
|
|
88
|
+
business action ran.
|
|
89
|
+
|
|
90
|
+
If setup fails, include the DSH version, plugin version, operating system, the command that failed,
|
|
91
|
+
and redacted error text in a GitHub Issue. Never attach tokens, private URLs, personal information,
|
|
92
|
+
authorization codes, or production payloads.
|