dsh-bailinghub 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,51 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.4.0 - 2026-09-08
4
+
5
+ ### For users
6
+
7
+ - Use independently authorized accounts for the same system in one conversation. Select Store A,
8
+ Store B, or both before the first message; the Agent chooses the correct authorization for each
9
+ available business tool without changing the global connection. Existing permissions and approvals
10
+ still apply. Different Hubs, Client Apps, and workspaces are outside this release.
11
+ - **New conversations now default to ordinary chat.** Login and connection defaults no longer enable
12
+ business access. Use `/bailinghub scope set <connection-key>...` and wait for confirmation before
13
+ the first message; later selection changes require a new conversation. See the [migration guide](docs/MIGRATION_VNEXT.md).
14
+ - Follow visible user/assistant messages, turn boundaries, and links to original business runs in
15
+ a separate conversation archive with Core 0.6.1. Multi-account runs keep their own call summaries;
16
+ the combined reply is not broadcast into each account's memory. Hidden reasoning is excluded.
17
+ - Check `/bailinghub archive status` and retry `/bailinghub archive sync` after a failed upload or
18
+ restart. Saved events retain their original identity; retries do not execute business actions again.
19
+ - Recover the original saved scope after an offline reopen on the same runtime once connectivity
20
+ returns and every original authorization is valid. Revocation, identity replacement, and storage
21
+ conflicts still block the whole scope. Scope restoration does not restore unfinished invocations,
22
+ approvals, or tasks after a process restart.
23
+
24
+ ### Reliability and integration
25
+
26
+ - Persist non-secret scope snapshots and a separate private visible-text outbox with revision checks,
27
+ cross-process locks, and atomic file replacement. Expose host selection, restore, archive status,
28
+ and archive sync APIs. Reopened unlocked drafts require explicit confirmation; started conversations
29
+ without valid locked scope cannot adopt current defaults. Metadata alone does not lock a draft.
30
+ - Share matching typed business tools once. Multi-authorization calls use a host-issued reference
31
+ outside the unchanged business arguments; single-authorization arguments remain unchanged. Keep
32
+ the 12-tool total budget, reject conflicting declarations, and retain original invocation bindings
33
+ across turns of the same live conversation.
34
+ - Preserve stable archive event ids, original run links, and acknowledgement cursors through ambiguous
35
+ network retries. Report detectable missing history as `recovery_gap`, and unavailable history as
36
+ unverified. Local write failures and unsaved events remain visible while uploads are blocked.
37
+ Archive capability network failures report pending, not a false storage error.
38
+ - Recheck the original scope after asynchronous archive capability discovery and opening, so a
39
+ revocation confirmed during that work cannot return a misleading synchronized status or allow upload.
40
+ Concurrent business and archive callers wait for the current whole-scope validation.
41
+ - Keep cancelled turns ended when their original run response arrives late. Retain only the original
42
+ audit link, without reactivating tools, dispatching remaining members, or replacing a newer turn.
43
+ - Pin exact `bailinghub-mcp-server@0.4.0`. Injected older SDKs retain business operations with an
44
+ explicit unsupported archive status. Keep the separate public `0.1.1` static MCP path unchanged.
45
+
46
+ The archive stores plaintext visible task text locally, including acknowledged events, until the
47
+ host/operator removes it. It does not export all past conversations or attachments. Review
48
+ [Privacy](PRIVACY.md) before enabling business scope; release verification is not production adoption.
4
49
 
5
50
  ## 0.3.0 - 2026-09-01
6
51
 
package/PRIVACY.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Privacy
2
2
 
3
- This bundle adds no telemetry and stores no BailingHub credentials or task payloads.
3
+ This bundle adds no telemetry and stores no BailingHub credentials. Version 0.4.0
4
+ persists session-scope metadata and, when the SDK supports conversation archives, a separate
5
+ private outbox containing visible task text as described below.
4
6
 
5
7
  Task text submitted through the installed tools is sent to the BailingHub deployment chosen
6
8
  by the operator. DeepSeek Harness, the configured model provider, BailingHub, and the target
@@ -10,13 +12,14 @@ using personal, confidential, or regulated data.
10
12
  Do not include tokens, private URLs, personal information, or production payloads in public
11
13
  issues, screenshots, or compatibility reports.
12
14
 
13
- ## Native Agent Client 0.3.0
15
+ ## Native Agent Client 0.4.0
14
16
 
15
- The native 0.3.0 plugin sends each direct human user turn to BailingHub Core and receives
16
- model-visible instructions, memory, reference-only knowledge, governance, and active tool schemas.
17
- Business tool arguments and governed results cross the same boundary. At completion it sends only
18
- the hash-aliased assistant message id, visible final text, legal status, optional model/runtime
19
- labels, and numeric public usage. It ignores `assistant/chunk` and never uploads hidden reasoning.
17
+ After explicit nonempty scope selection, the native 0.4.0 plugin sends each direct human user turn
18
+ to BailingHub Core and receives model-visible instructions, memory, reference-only knowledge, governance, and active tool schemas.
19
+ Business tool arguments and governed results cross the same boundary. At completion it sends a
20
+ hash-aliased message id, legal status, optional model/runtime labels, and numeric public usage. A single-authorization run receives the visible final answer;
21
+ multi-authorization runs receive only their own deterministic call summaries. It ignores
22
+ `assistant/chunk` and never uploads hidden reasoning.
20
23
 
21
24
  Browser authorization, refresh, and credential storage remain SDK-owned; this adapter stores no
22
25
  BailingHub credential. The SDK uses macOS Keychain, Windows CurrentUser DPAPI, or an explicitly
@@ -26,3 +29,94 @@ business-system retention boundaries before enabling the plugin.
26
29
  The multi-connection registry contains public connection name, Hub URL, client app id, workspace,
27
30
  timestamps, and current-selection state. It does not contain access tokens, refresh tokens, model
28
31
  keys, business cookies, prompts, tool arguments, or business results.
32
+
33
+ ## Same-system authorization selection
34
+
35
+ Version 0.4.0 includes only the authorization keys explicitly selected for a DSH
36
+ conversation, restricted to the same Hub/client/workspace binding. Unset or empty scope means
37
+ ordinary chat: no BailingHub run starts, no BailingHub business tool is registered, and the plugin
38
+ does not send that conversation's user input to a business system. Logging in or selecting a
39
+ registry default does not select a conversation scope. This does not change the data boundary of
40
+ DSH, the configured model provider, or unrelated host tools.
41
+
42
+ The host snapshots the selected connection bindings and exposes only session-local authorization
43
+ references, local display names, and availability as the selection directory. It does not expose
44
+ the raw registry, credentials, connection keys, or Session inspection responses to the model.
45
+ Local display names are user-controlled labels, not verified business identity claims.
46
+
47
+ After the full selection is validated, each user turn is sent to a separate Core run under each
48
+ selected authorization to obtain its instructions, governance, memory, and reference-only
49
+ knowledge. The local Agent and its model
50
+ provider therefore receive context from multiple authorized identities in the same conversation.
51
+ Authorization labels preserve attribution; they do not create isolation from the local model.
52
+ Use separate conversations when those identities' data must not share that boundary.
53
+ The host must await and display scope confirmation before sending the first message. That first
54
+ user message freezes the selection. A failed selection or any unavailable selected
55
+ authorization pauses all BailingHub business access for the conversation, without switching to a
56
+ default or silently retaining a subset.
57
+
58
+ Each business call uses only its selected authorization. Recovery retains the original
59
+ authorization and invocation. At completion, multi-authorization runs receive separate
60
+ deterministic summaries of their own governed calls, not the combined visible final answer or
61
+ another authorization's results. SDK 0.4.0 with Core 0.6.1 also receives the combined visible
62
+ conversation through the independent archive boundary below. Single-authorization conversations
63
+ retain the existing visible-answer completion flow.
64
+ Hidden reasoning is never uploaded by the adapter.
65
+
66
+ The host checks the captured connection key, workspace, and original Agent Session id before
67
+ transport operations without projecting those inspection fields into the model's directory.
68
+ Invocation bindings are local to the running conversation; a new conversation or process restart
69
+ does not recover unknown invocation ids from that map.
70
+
71
+ The default file adapter saves scope schema/version, DSH session id, revision, lock/state, public
72
+ Hub/client/workspace binding, and the selected connection keys, sanitized labels, workspace, and
73
+ original Agent Session ids. These identifiers stay host-side; the snapshot contains no access or
74
+ refresh token, browser credential, prompt, business argument/result, or invocation state. Files
75
+ are stored under `$DSH_HOME/plugins/dsh-bailinghub/session-scopes` (`~/.dsh` is the default home),
76
+ with hashed session filenames and, on POSIX, mode-0600 files and mode-0700 directories. They remain local until
77
+ removed by the host/operator; the adapter does not upload them. An embedded host may inject its
78
+ own durable store and retention policy. The explicit memory store is not persistent, and storage
79
+ failure never causes an automatic switch to it.
80
+
81
+ On reopening a conversation, only a valid locked scope is restored after its binding and original
82
+ Agent Sessions are rechecked. A stored unlocked draft needs explicit scope confirmation again;
83
+ loading it does not query its old authorizations or send them user input. A failed replacement
84
+ write can leave that draft on disk, but it still cannot reactivate automatically in a new runtime.
85
+ Configuration or metadata history alone does not lock a never-started draft. Missing or invalid
86
+ scope snapshots on started conversations do not adopt current registry connections.
87
+ Restoring that scope does not recover pending business invocations, approvals, completions, or
88
+ tasks across a process restart.
89
+
90
+ ## Visible conversation archive
91
+
92
+ For a nonempty frozen scope, SDK 0.4.0 with Core 0.6.1 receives the claimed user messages,
93
+ visible assistant text, turn boundaries, and original run links as one conversation audit owned
94
+ by the complete selected authorization set. Visible text may itself contain personal or business
95
+ data; the adapter does not claim to redact arbitrary secrets pasted into that text. It never adds
96
+ SDK credentials, hidden reasoning, raw provider requests, attachments, or arbitrary tool payloads.
97
+ The combined conversation is not broadcast to each authorization's memory. Empty scope remains
98
+ outside this archive boundary. Review the whole selected group's data-sharing permission before
99
+ sending the first message.
100
+ If an original run response arrives after cancellation, only its audit link is retained for that
101
+ ended turn; it does not reactivate business tools, dispatch remaining members, or replace a newer turn.
102
+
103
+ The independent outbox lives under `$DSH_HOME/plugins/dsh-bailinghub/conversation-outbox` by default.
104
+ It contains a random persistent archive id, frozen public bindings/original Session ids, visible
105
+ events, hashes, and synchronization cursor. POSIX directories use `0700` and files `0600`; text is
106
+ not encrypted by this adapter. Outboxes remain on disk, including acknowledged events, until the
107
+ host/operator removes them. Hosts may inject a different durable store and retention policy;
108
+ there is no automatic retention cleanup or deletion of the separate Hub audit. Removing a local
109
+ outbox loses retry identity/history and must not be treated as deleting the remote record.
110
+
111
+ Network failures preserve successfully written events for later upload. Local write failures do
112
+ not prove durable capture. Reopened DSH history is checked for detectable missing visible events,
113
+ reported as `recovery_gap`; unavailable host history is marked unverified. Previously unarchived
114
+ messages, attachments, and hidden content are not claimed as a complete transcript. The archive
115
+ does not restore business invocation or approval execution after restart. An older SDK reports
116
+ unsupported without creating an outbox, and business calls remain available.
117
+
118
+ An offline reopen keeps the original frozen scope closed until every member can be revalidated.
119
+ A later retry on the same runtime may recover a temporary network failure, but cannot recover
120
+ confirmed revocation, replacement identity, or a storage conflict. Archive status retains known
121
+ unsaved events and history gaps while upload is blocked. Revocation confirmed during asynchronous
122
+ archive capability discovery or opening is rechecked before reporting availability or uploading.
package/README.md CHANGED
@@ -2,242 +2,171 @@
2
2
 
3
3
  [简体中文](docs/README.zh-CN.md) | English
4
4
 
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.
5
+ Ask your local DeepSeek Harness Agent to work with a business system connected to BailingHub:
6
+ find records, update allowed fields, and follow the system's existing approval rules.
7
+ BailingHub records which authorization was used and what each business action returned.
9
8
 
10
- For example, depending on what the connected business system has exposed, you can ask the local
11
- Agent to:
9
+ **Version 0.4.0 lets one conversation use several authorizations for the same system.** For example,
10
+ after independently authorizing Store A and Store B, select both for a new conversation and ask:
12
11
 
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.
12
+ > Compare today's sales at Store A and Store B. Show each store separately.
17
13
 
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.
14
+ The Agent can choose the right authorization for each call without asking you to switch the active
15
+ connection. Available actions still depend on the capabilities and permissions your system exposes.
16
+ This release does not provide orchestration across different systems or routes.
21
17
 
22
- This is an independent community integration. It is not developed, certified, endorsed, or
23
- recommended by DeepSeek.
24
-
25
- > **Current stable line:** `dsh-bailinghub@0.3.0` uses the native Agent Client flow documented
26
- > below. Public `0.1.1` remains available only as the explicit static MCP compatibility path.
27
-
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
31
-
32
- ```text
33
- DeepSeek Harness local Agent
34
- -> dsh-bailinghub native Cordis adapter
35
- -> bailinghub-mcp-server/sdk
36
- -> BailingHub Agent Auth + Agent API
37
- -> operator-selected business integration and final authorization
38
- ```
39
-
40
- The packages have separate responsibilities:
41
-
42
- - **BailingHub Core** owns Agent Auth, trusted business identity, runtime context, knowledge and
43
- memory projection, capability governance, approvals, invocation state, and audit records.
44
- - **`bailinghub-mcp-server/sdk`** owns browser login, PKCE, credential storage, refresh,
45
- Hub/client/workspace connection selection, and HTTP DTO mapping.
46
- - **`dsh-bailinghub`** owns only DSH session, prompt, command, and dynamic-tool lifecycle
47
- integration. It does not store credentials or call a business API directly.
48
-
49
- This Agent Client is not the BailingHub executor. The executor receives jobs from the Hub for
50
- work that must run near a machine; the Agent Client keeps the interactive reasoning loop on the
51
- user's local DSH Agent.
52
-
53
- ## Before installing
54
-
55
- The deployer and business integrator must prepare these public identifiers in BailingHub:
56
-
57
- 1. A reachable HTTPS BailingHub deployment with the matching Agent Auth and Agent API contracts.
58
- 2. A public Agent Client application id (`clientAppId`).
59
- 3. At least one authorized workspace. In Agent Client v1, the workspace id is the BailingHub
60
- route id.
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.
64
-
65
- The end user does **not** enter a business API URL, business login credential, Tool Provider
66
- signing secret, BailingHub Client Token, or model-provider key into this plugin.
18
+ It also keeps the visible conversation together with links to its business actions. If uploading
19
+ that record fails, it can retry after reconnecting or restarting without repeating those actions.
67
20
 
68
- ## Install the 0.3 line
69
-
70
- Prerequisites:
21
+ This is an independent community integration, not a plugin developed, certified, endorsed, or
22
+ recommended by DeepSeek.
71
23
 
72
- - Node.js `22.19.0+` or `24+`;
73
- - `pnpm` and a DeepSeek Harness release listed in the compatibility matrix;
74
- - the BailingHub preparation above.
24
+ ## Install and start
75
25
 
76
- Install the exact stable version into the DSH Web profile:
26
+ You need Node.js `22.19.0+` or `24+`, pnpm, and a compatible DeepSeek Harness release. Your
27
+ administrator must first connect the business system to BailingHub. The matched release set is
28
+ **BailingHub Core 0.6.1 → BailingHub MCP/SDK 0.4.0 → this plugin 0.4.0**.
77
29
 
78
30
  ```bash
79
31
  npm install --global pnpm @deepseek-ai/dsh@0.1.1-rc.2
80
- dsh plugin --profile web add dsh-bailinghub@0.3.0
32
+ dsh plugin --profile web add dsh-bailinghub@0.4.0
81
33
  ```
82
34
 
83
- `dsh-bailinghub@0.3.0` installs its exact compatible `bailinghub-mcp-server@0.3.0` dependency
84
- automatically. DSH users should not separately guess or install an SDK version.
35
+ The plugin installs its exact `bailinghub-mcp-server@0.4.0` dependency automatically.
36
+ For an existing installation, read the [0.3 to 0.4 migration steps](docs/MIGRATION_VNEXT.md).
85
37
 
86
- ## Configure one Hub connection
38
+ Follow the [getting started guide](docs/GETTING_STARTED.md) to enter your administrator's four
39
+ public connection values and authorize in the browser. Do not put a business password, Client
40
+ Token, signing secret, or model-provider key into this plugin's settings or chat.
87
41
 
88
- The native plugin has exactly four host configuration fields:
42
+ ## Choose the accounts for each conversation
89
43
 
90
- | Plugin field | Environment value | Meaning | Secret |
91
- | --- | --- | --- | --- |
92
- | `hubUrl` | `BAILINGHUB_HUB_URL` | Public HTTPS URL of the developer's own BailingHub | No |
93
- | `clientAppId` | `BAILINGHUB_CLIENT_APP_ID` | Public Agent Client application id registered in that Hub | No |
94
- | `workspace` | `BAILINGHUB_WORKSPACE` | Initial authorized workspace/route id | No |
95
- | `connectionName` | `BAILINGHUB_CONNECTION_NAME` | User-selected local connection label | No |
44
+ Authorize each account separately through the original business authorization page. Give each
45
+ connection a clear local name, such as `Store A` and `Store B`, and verify the actual identity on
46
+ that page. The name is a label you provide; it does not prove identity or grant permission.
47
+ Names like `default` and `default-2` do not tell the Agent which store you mean.
96
48
 
97
- Example placeholders:
49
+ In a **new conversation, before the first message**, run:
98
50
 
99
- ```bash
100
- export BAILINGHUB_HUB_URL='https://hub.example.com'
101
- export BAILINGHUB_CLIENT_APP_ID='example-agent-client'
102
- export BAILINGHUB_WORKSPACE='order_assistant'
103
- export BAILINGHUB_CONNECTION_NAME='default'
51
+ ```text
52
+ /bailinghub connections list
53
+ /bailinghub scope set <store-a-connection-key> <store-b-connection-key>
54
+ /bailinghub scope
104
55
  ```
105
56
 
106
- The same four fields may be supplied through the DSH plugin settings surface. Do not add tokens,
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.
57
+ Replace the placeholders with the fixed keys from the list, not connection names. You can select
58
+ just one account. Multiple selections must share the same Hub, Client App, and workspace.
59
+ Wait for the command to confirm the selection, then send your request.
110
60
 
111
- Inspect the composed profile before starting it:
61
+ **New conversations start as ordinary chat until you select their business scope.** Logging in or
62
+ changing the default connection does not enable business tools. `/bailinghub scope none` explicitly
63
+ chooses ordinary chat. The first user message freezes the selection; start a new conversation to
64
+ change accounts or move from ordinary chat to business access.
112
65
 
113
- ```bash
114
- dsh --profile web --dump-config
115
- dsh web
116
- ```
66
+ For the selected accounts, matching tools are shared. The Agent chooses the authorization for each
67
+ call; it does not receive credentials. Every action still uses that account's own permissions and
68
+ approval rules. An approval-required action continues the original call after approval while that
69
+ conversation is still running.
70
+
71
+ If any selected authorization is revoked, replaced, or cannot be checked, business access pauses
72
+ for the whole conversation. The plugin never silently switches to another account. A temporary
73
+ connection failure can be retried with the same original selection after the network returns.
74
+ A confirmed revocation or identity change requires a new conversation with a valid selection.
117
75
 
118
- ## Authorize and use the local Agent
76
+ ## Follow the conversation and its actions
119
77
 
120
- In DSH, run:
78
+ With Core 0.6.1 and SDK 0.4.0, BailingHub can show the visible user and assistant messages, turn
79
+ boundaries, and links to the original business runs as one conversation record. Each authorization
80
+ also keeps its own business-call record; the combined reply is not copied into every account's
81
+ memory.
121
82
 
122
83
  ```text
123
- /bailinghub login
124
- /bailinghub doctor
125
- /bailinghub status
126
- /bailinghub workspaces
84
+ /bailinghub archive status
85
+ /bailinghub archive sync
127
86
  ```
128
87
 
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.
88
+ `archive status` shows whether the visible record has uploaded. `archive sync` retries the saved
89
+ record without running the business actions again. This is separate from `/bailinghub sync`,
90
+ which retries a pending run completion in the currently running conversation.
134
91
 
135
- Useful commands:
92
+ | Status | What it means |
93
+ | --- | --- |
94
+ | `synced` | Saved events have been acknowledged by the Hub; this does not prove a business action succeeded |
95
+ | `pending` | Upload is unfinished; retry when the connection is available |
96
+ | `blocked` | Original authorization checks prevent upload; inspect `/bailinghub scope` |
97
+ | `unsupported` | The connected SDK or Hub does not support this archive contract |
98
+ | `storage_error` | A local write failed; some visible events may not yet be safely saved |
99
+ | `recovery_gap` | Available DSH history shows missing archive events; the record is incomplete |
100
+
101
+ Reopening a saved business conversation restores its original selected accounts only after every
102
+ original authorization is checked. If it was reopened offline, reconnect and run
103
+ `/bailinghub archive sync` or `/bailinghub scope` in that same conversation to retry the check.
104
+ This recovers scope and saved uploads, **not pending business invocations or approvals after a
105
+ process restart**. A saved draft that never started needs explicit selection again. An older
106
+ started conversation without a valid saved scope cannot adopt today's default account.
107
+
108
+ ## What is shared and stored
109
+
110
+ All selected accounts' context and your visible user request share the same local Agent/model
111
+ conversation. The combined archive requires the full selected authorization set; an authorization
112
+ for only one member is not sufficient to read the mixed conversation. Use separate conversations
113
+ when those accounts' data must remain separate.
114
+
115
+ The plugin captures visible text from business turns enabled with this version, not all past
116
+ conversations, attachments, or hidden reasoning. It cannot remove arbitrary secrets pasted into
117
+ visible text. Missing local writes are reported as gaps when detectable; hosts without durable
118
+ history report unverified coverage.
119
+
120
+ The private local outbox contains **plaintext visible task text**, including events already
121
+ uploaded. It stays under the DSH home until the host/operator removes it; there is no automatic
122
+ retention cleanup. Removing it does not delete the Hub's record. Credentials remain in SDK-owned
123
+ secure storage. Review [Privacy](PRIVACY.md) and [Security](SECURITY.md) before enabling business
124
+ access.
125
+
126
+ ## Commands and administration
136
127
 
137
128
  | Command | Purpose |
138
129
  | --- | --- |
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 |
144
- | `/bailinghub login` | Authorize the configured Hub/client/workspace in the browser |
145
- | `/bailinghub status` | Inspect the selected connection without printing credentials |
146
- | `/bailinghub workspaces` | List workspaces allowed by the current business authorization |
147
- | `/bailinghub use <workspace>` | Select another already-authorized workspace for new sessions |
148
- | `/bailinghub sync` | Retry a pending visible completion record without repeating a tool call |
130
+ | `/bailinghub doctor` | Check setup, SDK, authorization, and workspace without printing credentials |
131
+ | `/bailinghub login` | Authorize the selected connection in the browser |
132
+ | `/bailinghub status` | Inspect that connection's authorization |
133
+ | `/bailinghub connections list` | List connection labels, fixed keys, and authorization state |
134
+ | `/bailinghub connections add <name> <hub-url> <client-app-id> <workspace>` | Register a connection and select it for connection management; quote names containing spaces |
135
+ | `/bailinghub connections use <name-or-key>` | Choose which connection to manage or authorize; does not change a conversation's scope |
136
+ | `/bailinghub connections remove <name-or-key>` | Revoke its Agent Session before removing local credentials |
137
+ | `/bailinghub workspaces` | List workspaces allowed by the current authorization |
138
+ | `/bailinghub use <workspace>` | Select another already-authorized workspace for connection management |
149
139
  | `/bailinghub logout` | Revoke and remove the selected Agent Session |
150
140
 
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.
182
-
183
- For the first acceptance check, start a new DSH conversation and perform one read-only request,
184
- then one permitted mutation. Confirm the same conversation, run, visible final answer, and tool
185
- invocation trajectory appear in BailingHub. An approval-required capability must resume the
186
- original invocation after approval; it must never create a replacement business call.
187
-
188
- DSH Code Mode is deliberately degraded in this release because it cannot safely present the
189
- current-turn dynamic schemas. Use native tool mode for governed business actions.
190
-
191
- ## Security and privacy boundary
192
-
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.
198
- - BailingHub revalidates identity, scope, approval, idempotency, and invocation state on every
199
- governed call. The downstream business system still performs final authorization.
200
- - The adapter sends visible user input, governed tool arguments/results, and the visible final
201
- answer required by the Agent Client contracts. It never uploads hidden reasoning chunks.
202
- - This plugin governs only the BailingHub tools it registers. It does not intercept unrelated DSH
203
- tools or model-provider traffic.
204
-
205
- Review [Security](SECURITY.md), [Privacy](PRIVACY.md), the
206
- [Agent Client contract](docs/AGENT_CLIENT_CONTRACT.md), and
207
- [compatibility](docs/COMPATIBILITY.md) before production use.
208
-
209
- ## Legacy public 0.1.x static mode
210
-
211
- Public `dsh-bailinghub@0.1.1` remains an immutable configuration-only bundle. It uses the in-box
212
- DSH MCP Client to start `bailinghub-mcp-server@0.1.1`, binds one operator-provisioned Client Token
213
- to one fixed route, and leaves orchestration in BailingHub.
214
-
215
- ```bash
216
- dsh plugin --profile web add dsh-bailinghub@0.1.1
141
+ Connection management and scope selection are user commands, not model tools. Reauthorizing the
142
+ same trusted identity replaces its old connection and Agent Session. A different identity remains
143
+ independent. If login reports cleanup required, the new connection is already authorized: inspect
144
+ the listed old entry and retry its removal, rather than authorizing again. Details are in the
145
+ [host contract](docs/AGENT_CLIENT_CONTRACT.md#browser-identity-and-local-reconciliation).
217
146
 
218
- export BAILINGHUB_BASE_URL='https://hub.example.com'
219
- export BAILINGHUB_CLIENT_TOKEN='replace-with-a-route-scoped-client-token'
220
- export BAILINGHUB_ROUTE='order_assistant'
221
- ```
147
+ ## For integrators
222
148
 
223
- It exposes exactly these three tools:
149
+ DSH owns reasoning and tool orchestration. BailingHub Core owns trusted identity, governance,
150
+ approvals, invocation state, and audit. The SDK owns browser authorization, secure credentials,
151
+ and HTTP mapping. This plugin only adapts DSH sessions, prompts, commands, tools, and visible events;
152
+ it does not call your business API directly or govern unrelated DSH tools.
224
153
 
225
- ```text
226
- mcp__bailinghub__submit_governed_job
227
- mcp__bailinghub__get_governed_job
228
- mcp__bailinghub__wait_for_governed_job
229
- ```
154
+ Existing business integrations continue exposing the same capabilities and authorizing each
155
+ identity separately. Custom DSH hosts must implement the [scope selection and restore APIs](docs/AGENT_CLIENT_CONTRACT.md#host-owned-session-scope-api)
156
+ and display confirmation before the first message. The native slash commands already use those
157
+ APIs. Tool envelopes, persistence, event schemas, and recovery limits are documented in the
158
+ [Agent Client contract](docs/AGENT_CLIENT_CONTRACT.md).
230
159
 
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
233
- rolling back.
160
+ Use Native Tool Mode. DSH Code Mode is deliberately degraded because it cannot safely present the
161
+ current-turn dynamic schemas. See the [compatibility matrix](docs/COMPATIBILITY.md).
234
162
 
235
- ## Compatibility and feedback
163
+ ## Legacy 0.1.1 and feedback
236
164
 
237
- Version 0.3.0 is verified only against the versions listed in
238
- [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md). DeepSeek Harness remains a developer preview, so
239
- every Harness release requires a new native lifecycle smoke test.
165
+ Public `dsh-bailinghub@0.1.1` remains the separate static MCP compatibility path. It starts
166
+ `bailinghub-mcp-server@0.1.1`, uses one operator-provided route-scoped Client Token, and leaves
167
+ orchestration in BailingHub. Version 0.4.0 does not read or convert that credential. Keep the exact
168
+ legacy version when using that path and follow the [migration guide](docs/MIGRATION_VNEXT.md).
240
169
 
241
- Report problems through [GitHub Issues](https://github.com/bailinghub/bailinghub-dsh-plugin/issues).
242
- Never include tokens, private deployment URLs, personal information, or production business
243
- payloads.
170
+ Report issues at [GitHub Issues](https://github.com/bailinghub/bailinghub-dsh-plugin/issues) with
171
+ versions and redacted errors. Do not include tokens, private URLs, personal data, or production
172
+ payloads. Compatibility tests and package downloads are not evidence of production adoption.