dsh-bailinghub 0.2.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,5 +1,75 @@
1
1
  # Changelog
2
2
 
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.
49
+
50
+ ## 0.3.0 - 2026-09-01
51
+
52
+ - Add `/bailinghub doctor` for credential-safe host-contract, configuration, SDK, authorization,
53
+ and workspace diagnostics before a business turn starts.
54
+ - Add real lifecycle coverage for DeepSeek Harness `0.1.1-rc.2` and enforce it in Ubuntu,
55
+ Windows, and tagged publication workflows.
56
+ - Make `connectionName` a user-controlled local selector while the business authorization page
57
+ owns login, account switching, tenant selection, and the trusted identity result.
58
+ - Reconcile same-binding connections by trusted `on_behalf_of`: replace an older same-identity
59
+ connection, keep different identities independent, and surface cleanup-required authorization
60
+ as a successful login with an explicit no-reauthorize warning.
61
+ - Preserve an existing alias and Session when same-alias authorization returns a different trusted
62
+ identity; allocate and select a non-conflicting local alias for the new identity.
63
+ - Add user-only `/bailinghub connections list|add|use|remove` lifecycle commands with quoted-name
64
+ parsing, new-session-only selection, existing-session pinning, and revoke-before-remove safety.
65
+ - Restore the SDK registry's current connection before the first new session or user command after
66
+ restart, with validated public metadata and a non-blocking bootstrap-field fallback.
67
+ - Reconcile defaults after connection removal: adopt a remaining current profile, become
68
+ unconfigured after the last removal, and preserve successful removal across registry refresh
69
+ failures without disturbing a valid non-current default.
70
+ - Pin the stable public `bailinghub-mcp-server@0.3.0` SDK, including Windows CurrentUser DPAPI
71
+ credential storage for Agent Session connections.
72
+
3
73
  ## 0.2.0 - 2026-08-26
4
74
 
5
75
  - Add the native Cordis Agent Client adapter that keeps reasoning and orchestration in local DSH
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,14 +12,111 @@ 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.2.0
15
+ ## Native Agent Client 0.4.0
14
16
 
15
- The native 0.2.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
- BailingHub credential. Review DSH, model-provider, BailingHub, and business-system retention
23
- boundaries before enabling the plugin.
25
+ BailingHub credential. The SDK uses macOS Keychain, Windows CurrentUser DPAPI, or an explicitly
26
+ enabled isolated mode-0600 POSIX file store. Review DSH, model-provider, BailingHub, and
27
+ business-system retention boundaries before enabling the plugin.
28
+
29
+ The multi-connection registry contains public connection name, Hub URL, client app id, workspace,
30
+ timestamps, and current-selection state. It does not contain access tokens, refresh tokens, model
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,190 +2,171 @@
2
2
 
3
3
  [简体中文](docs/README.zh-CN.md) | English
4
4
 
5
- Use a local DeepSeek Harness Agent to discover and invoke business capabilities governed by a
6
- self-hosted BailingHub. Reasoning and tool orchestration stay in DSH; BailingHub retains trusted
7
- identity, runtime context, capability trimming, approval, invocation recovery, and audit.
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.
8
8
 
9
- This is an independent community integration. It is not developed, certified, endorsed, or
10
- recommended by DeepSeek.
11
-
12
- > **Current stable line:** `dsh-bailinghub@0.2.0` uses the native Agent Client flow documented
13
- > below. Public `0.1.1` remains available only as the explicit static MCP compatibility path.
14
-
15
- ## How the 0.2 Agent Client fits together
16
-
17
- ```text
18
- DeepSeek Harness local Agent
19
- -> dsh-bailinghub native Cordis adapter
20
- -> bailinghub-mcp-server/sdk
21
- -> BailingHub Agent Auth + Agent API
22
- -> operator-selected business integration and final authorization
23
- ```
24
-
25
- The packages have separate responsibilities:
26
-
27
- - **BailingHub Core** owns Agent Auth, trusted business identity, runtime context, knowledge and
28
- memory projection, capability governance, approvals, invocation state, and audit records.
29
- - **`bailinghub-mcp-server/sdk`** owns browser login, PKCE, credential storage, refresh,
30
- Hub/client/workspace connection isolation, and HTTP DTO mapping.
31
- - **`dsh-bailinghub`** owns only DSH session, prompt, command, and dynamic-tool lifecycle
32
- integration. It does not store credentials or call a business API directly.
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:
33
11
 
34
- This Agent Client is not the BailingHub executor. The executor receives jobs from the Hub for
35
- work that must run near a machine; the Agent Client keeps the interactive reasoning loop on the
36
- user's local DSH Agent.
12
+ > Compare today's sales at Store A and Store B. Show each store separately.
37
13
 
38
- ## Before installing
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.
39
17
 
40
- The deployer and business integrator must prepare these public identifiers in BailingHub:
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.
41
20
 
42
- 1. A reachable HTTPS BailingHub deployment with the matching Agent Auth and Agent API contracts.
43
- 2. A public Agent Client application id (`clientAppId`).
44
- 3. At least one authorized workspace. In Agent Client v1, the workspace id is the BailingHub
45
- route id.
46
- 4. A business authorization page and governed ACC/Tool Provider integration behind that route.
47
-
48
- The end user does **not** enter a business API URL, business login credential, Tool Provider
49
- signing secret, BailingHub Client Token, or model-provider key into this plugin.
50
-
51
- ## Install the 0.2 line
52
-
53
- Prerequisites:
21
+ This is an independent community integration, not a plugin developed, certified, endorsed, or
22
+ recommended by DeepSeek.
54
23
 
55
- - Node.js `22.19.0+` or `24+`;
56
- - `pnpm` and DeepSeek Harness `0.1.0-rc.7`;
57
- - the BailingHub preparation above.
24
+ ## Install and start
58
25
 
59
- 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**.
60
29
 
61
30
  ```bash
62
- npm install --global pnpm @deepseek-ai/dsh@0.1.0-rc.7
63
- dsh plugin --profile web add dsh-bailinghub@0.2.0
31
+ npm install --global pnpm @deepseek-ai/dsh@0.1.1-rc.2
32
+ dsh plugin --profile web add dsh-bailinghub@0.4.0
64
33
  ```
65
34
 
66
- `dsh-bailinghub@0.2.0` installs its exact compatible `bailinghub-mcp-server@0.2.0` dependency
67
- 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).
68
37
 
69
- ## 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.
70
41
 
71
- The native plugin has exactly four host configuration fields:
42
+ ## Choose the accounts for each conversation
72
43
 
73
- | Plugin field | Environment value | Meaning | Secret |
74
- | --- | --- | --- | --- |
75
- | `hubUrl` | `BAILINGHUB_HUB_URL` | Public HTTPS URL of the developer's own BailingHub | No |
76
- | `clientAppId` | `BAILINGHUB_CLIENT_APP_ID` | Public Agent Client application id registered in that Hub | No |
77
- | `workspace` | `BAILINGHUB_WORKSPACE` | Initial authorized workspace/route id | No |
78
- | `connectionName` | `BAILINGHUB_CONNECTION_NAME` | Local alias for this isolated SDK connection | 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.
79
48
 
80
- Example placeholders:
49
+ In a **new conversation, before the first message**, run:
81
50
 
82
- ```bash
83
- export BAILINGHUB_HUB_URL='https://hub.example.com'
84
- export BAILINGHUB_CLIENT_APP_ID='example-agent-client'
85
- export BAILINGHUB_WORKSPACE='order_assistant'
86
- 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
87
55
  ```
88
56
 
89
- 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.
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.
91
60
 
92
- 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.
93
65
 
94
- ```bash
95
- dsh --profile web --dump-config
96
- dsh web
97
- ```
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.
98
75
 
99
- ## Authorize and use the local Agent
76
+ ## Follow the conversation and its actions
100
77
 
101
- 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.
102
82
 
103
83
  ```text
104
- /bailinghub login
105
- /bailinghub status
106
- /bailinghub workspaces
84
+ /bailinghub archive status
85
+ /bailinghub archive sync
107
86
  ```
108
87
 
109
- `login` opens the system browser. The business-side authorization page confirms the signed-in
110
- business identity and requested workspace, then returns to a random loopback callback protected
111
- by `state` and PKCE S256. Access and refresh tokens remain in SDK-owned secure storage and are
112
- 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.
113
91
 
114
- 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
115
127
 
116
128
  | Command | Purpose |
117
129
  | --- | --- |
118
- | `/bailinghub login` | Authorize the configured Hub/client/workspace in the browser |
119
- | `/bailinghub status` | Inspect the selected connection without printing credentials |
120
- | `/bailinghub workspaces` | List workspaces allowed by the current business authorization |
121
- | `/bailinghub use <workspace>` | Select another already-authorized workspace for new sessions |
122
- | `/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 |
123
139
  | `/bailinghub logout` | Revoke and remove the selected Agent Session |
124
140
 
125
- The standard v1 login requests only the configured workspace. `use` succeeds only when the
126
- current Agent Session explicitly contains the target workspace; it is not permission to switch to
127
- an arbitrary Hub route. The current command set always operates on this plugin instance's four
128
- configured fields; it does not accept a connection selector. For another Hub or route, use a
129
- second DSH profile/plugin instance, or edit those fields and reload the profile, set a different
130
- `connectionName`, and complete browser authorization again.
131
-
132
- For the first acceptance check, start a new DSH conversation and perform one read-only request,
133
- then one permitted mutation. Confirm the same conversation, run, visible final answer, and tool
134
- invocation trajectory appear in BailingHub. An approval-required capability must resume the
135
- original invocation after approval; it must never create a replacement business call.
136
-
137
- DSH Code Mode is deliberately degraded in this release because it cannot safely present the
138
- current-turn dynamic schemas. Use native tool mode for governed business actions.
139
-
140
- ## Security and privacy boundary
141
-
142
- - The model cannot choose a Hub URL, workspace, identity, credential, approval result, or
143
- capability revision through tool arguments.
144
- - The SDK stores credentials in macOS Keychain. Linux and other POSIX systems require an explicit
145
- secure file-store opt-in; Windows Agent Session storage is not supported in 0.2.0.
146
- - BailingHub revalidates identity, scope, approval, idempotency, and invocation state on every
147
- governed call. The downstream business system still performs final authorization.
148
- - The adapter sends visible user input, governed tool arguments/results, and the visible final
149
- answer required by the Agent Client contracts. It never uploads hidden reasoning chunks.
150
- - This plugin governs only the BailingHub tools it registers. It does not intercept unrelated DSH
151
- tools or model-provider traffic.
152
-
153
- Review [Security](SECURITY.md), [Privacy](PRIVACY.md), the
154
- [Agent Client contract](docs/AGENT_CLIENT_CONTRACT.md), and
155
- [compatibility](docs/COMPATIBILITY.md) before production use.
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).
156
146
 
157
- ## Legacy public 0.1.x static mode
147
+ ## For integrators
158
148
 
159
- Public `dsh-bailinghub@0.1.1` remains an immutable configuration-only bundle. It uses the in-box
160
- DSH MCP Client to start `bailinghub-mcp-server@0.1.1`, binds one operator-provisioned Client Token
161
- to one fixed route, and leaves orchestration in BailingHub.
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.
162
153
 
163
- ```bash
164
- dsh plugin --profile web add dsh-bailinghub@0.1.1
165
-
166
- export BAILINGHUB_BASE_URL='https://hub.example.com'
167
- export BAILINGHUB_CLIENT_TOKEN='replace-with-a-route-scoped-client-token'
168
- export BAILINGHUB_ROUTE='order_assistant'
169
- ```
170
-
171
- It exposes exactly these three tools:
172
-
173
- ```text
174
- mcp__bailinghub__submit_governed_job
175
- mcp__bailinghub__get_governed_job
176
- mcp__bailinghub__wait_for_governed_job
177
- ```
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).
178
159
 
179
- The 0.2 Agent Client does not automatically consume or migrate the 0.1 Client Token. Keep versions
180
- explicit and follow the [0.1-to-0.2 migration boundary](docs/MIGRATION_VNEXT.md) when testing or
181
- 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).
182
162
 
183
- ## Compatibility and feedback
163
+ ## Legacy 0.1.1 and feedback
184
164
 
185
- Version 0.2.0 is verified only against the versions listed in
186
- [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md). DeepSeek Harness remains a developer preview, so
187
- 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).
188
169
 
189
- Report problems through [GitHub Issues](https://github.com/bailinghub/bailinghub-dsh-plugin/issues).
190
- Never include tokens, private deployment URLs, personal information, or production business
191
- 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.