dsh-bailinghub 0.1.0 → 0.2.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,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0 - 2026-08-26
4
+
5
+ - Add the native Cordis Agent Client adapter that keeps reasoning and orchestration in local DSH
6
+ while BailingHub retains identity, context, capability governance, approval, recovery, and audit.
7
+ - Add browser authorization, isolated connection aliases, dynamic per-turn business tools,
8
+ capability search, exact-invocation resume, and visible-only run completion through the generic
9
+ `bailinghub-mcp-server/sdk` facade.
10
+ - Restrict host configuration to `hubUrl`, `clientAppId`, `workspace`, and `connectionName`; no
11
+ business endpoint, Client Token, model key, or other secret is accepted by the plugin config.
12
+ - Preserve public `0.1.1` as the explicit static MCP/Client Token compatibility path rather than
13
+ silently migrating its credentials or orchestration semantics.
14
+ - Pin `bailinghub-mcp-server@0.2.0` as an ordinary dependency so installing only this plugin also
15
+ installs the exact compatible Agent Client SDK.
16
+ - Document the Core to MCP/SDK to DSH release order and the clean-profile browser-auth acceptance
17
+ gate.
18
+
19
+ ## 0.1.1 - 2026-08-18
20
+
21
+ - Make the project contract accept future SemVer releases while keeping package and lock versions aligned.
22
+ - Keep the npm landing page English-first and retain the Chinese guide under `docs/`.
23
+ - Document the exact release-update surface, focused compatibility smoke, and patch-release recovery path.
24
+
3
25
  ## 0.1.0 - 2026-08-18
4
26
 
5
27
  - Add an installable DeepSeek Harness bundle for BailingHub.
package/PRIVACY.md CHANGED
@@ -9,3 +9,15 @@ using personal, confidential, or regulated data.
9
9
 
10
10
  Do not include tokens, private URLs, personal information, or production payloads in public
11
11
  issues, screenshots, or compatibility reports.
12
+
13
+ ## Native Agent Client 0.2.0
14
+
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.
20
+
21
+ 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.
package/README.md CHANGED
@@ -1,104 +1,190 @@
1
1
  # BailingHub for DeepSeek Harness
2
2
 
3
- [简体中文](README.zh-CN.md) | English
3
+ [简体中文](docs/README.zh-CN.md) | English
4
4
 
5
- Run governed tasks from DeepSeek Harness against a business route already connected to
6
- BailingHub, then track the same job and read its available result. You can do this from the
7
- Harness Web UI on your own computer without opening the embedded chat page in each business
8
- backend.
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.
9
8
 
10
9
  This is an independent community integration. It is not developed, certified, endorsed, or
11
10
  recommended by DeepSeek.
12
11
 
13
- ## What You Get
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
14
 
15
- After installation, DeepSeek Harness discovers three native tools:
15
+ ## How the 0.2 Agent Client fits together
16
16
 
17
- | Harness tool | What it does |
18
- | --- | --- |
19
- | `mcp__bailinghub__submit_governed_job` | Submit task text with a stable request ID |
20
- | `mcp__bailinghub__get_governed_job` | Read the current state and public result of one job |
21
- | `mcp__bailinghub__wait_for_governed_job` | Wait briefly for the same job without resubmitting it |
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.
33
+
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.
37
+
38
+ ## Before installing
39
+
40
+ The deployer and business integrator must prepare these public identifiers in BailingHub:
22
41
 
23
- BailingHub remains the control plane between the model and the business system. The URL,
24
- Client Token, and route are operator configuration, not model arguments. The model cannot
25
- switch to another route or supply administrator, executor, approval, or business-system
26
- credentials through these tools.
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.
27
47
 
28
- ## Install
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
29
52
 
30
53
  Prerequisites:
31
54
 
32
55
  - Node.js `22.19.0+` or `24+`;
33
- - `pnpm` and `@deepseek-ai/dsh@0.1.0-rc.7`;
34
- - a reachable [BailingHub deployment](https://github.com/bailinghub/bailinghub#quick-start);
35
- - one BailingHub Client Token restricted to the route you want this Harness profile to use.
56
+ - `pnpm` and DeepSeek Harness `0.1.0-rc.7`;
57
+ - the BailingHub preparation above.
58
+
59
+ Install the exact stable version into the DSH Web profile:
36
60
 
37
61
  ```bash
38
62
  npm install --global pnpm @deepseek-ai/dsh@0.1.0-rc.7
39
- dsh plugin --profile web add dsh-bailinghub@0.1.0
63
+ dsh plugin --profile web add dsh-bailinghub@0.2.0
40
64
  ```
41
65
 
42
- Configure the process that starts Harness:
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.
68
+
69
+ ## Configure one Hub connection
70
+
71
+ The native plugin has exactly four host configuration fields:
72
+
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 |
79
+
80
+ Example placeholders:
43
81
 
44
82
  ```bash
45
- export BAILINGHUB_BASE_URL='https://hub.example.com'
46
- export BAILINGHUB_CLIENT_TOKEN='replace-with-a-route-scoped-client-token'
47
- export BAILINGHUB_ROUTE='order_assistant'
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'
48
87
  ```
49
88
 
50
- Then verify the composed profile and start the local Web UI:
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.
91
+
92
+ Inspect the composed profile before starting it:
51
93
 
52
94
  ```bash
53
95
  dsh --profile web --dump-config
54
96
  dsh web
55
97
  ```
56
98
 
57
- The default Web UI is local to your computer. Ask Harness to submit a task through
58
- BailingHub, preserve the returned `job_id`, and wait for or query that same job.
99
+ ## Authorize and use the local Agent
59
100
 
60
- For a first try, use a task supported by your configured route and say explicitly: submit it
61
- once with a stable `request_id`, preserve the returned `job_id`, and query that same job if a
62
- bounded wait times out.
101
+ In DSH, run:
63
102
 
64
- ## Correct Task Flow
103
+ ```text
104
+ /bailinghub login
105
+ /bailinghub status
106
+ /bailinghub workspaces
107
+ ```
65
108
 
66
- 1. Generate one stable `request_id` for one business request.
67
- 2. Call `mcp__bailinghub__submit_governed_job` once.
68
- 3. Preserve its `job_id`.
69
- 4. Call `wait_for_governed_job`, or call `get_governed_job` later.
70
- 5. A wait timeout is not a failed task. Do not submit a replacement request.
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.
71
113
 
72
- ## Identity and Permission Boundary
114
+ Useful commands:
73
115
 
74
- Using the local Harness UI removes the need to open a business backend's embedded chat UI;
75
- it does **not** turn the Harness login or local user into a trusted business identity.
76
- Version `0.1.0` deliberately does not accept an acting subject as tool input. A route or
77
- downstream business system must still resolve trusted identity and perform final
78
- authorization. If the selected action requires identity that the configured path cannot
79
- establish, it should remain unavailable or be rejected.
116
+ | Command | Purpose |
117
+ | --- | --- |
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 |
123
+ | `/bailinghub logout` | Revoke and remove the selected Agent Session |
124
+
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.
156
+
157
+ ## Legacy public 0.1.x static mode
158
+
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.
80
162
 
81
- This bundle governs only tasks submitted through its three BailingHub tools. It does not
82
- intercept or govern every other tool installed in DeepSeek Harness.
163
+ ```bash
164
+ dsh plugin --profile web add dsh-bailinghub@0.1.1
83
165
 
84
- ## Supply-Chain Note
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:
85
172
 
86
- This bundle contains no custom runtime JavaScript, no production dependencies, and no
87
- install scripts. When Harness starts the bundle, its built-in MCP Client runs the pinned
88
- command `npx -y --package=bailinghub-mcp-server@0.1.1 bailinghub-mcp-server` outside the
89
- agent sandbox. The first start may
90
- need npm network access. Review and pin the package before using it in a sensitive
91
- environment; production images may pre-cache the exact version.
173
+ ```text
174
+ mcp__bailinghub__submit_governed_job
175
+ mcp__bailinghub__get_governed_job
176
+ mcp__bailinghub__wait_for_governed_job
177
+ ```
92
178
 
93
- Non-loopback HTTP is rejected by the MCP server by default. Only set
94
- `BAILINGHUB_ALLOW_INSECURE_HTTP=true` on a controlled private network where TLS terminates at
95
- another trusted boundary.
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.
96
182
 
97
- ## Compatibility and Feedback
183
+ ## Compatibility and feedback
98
184
 
99
- The first release is verified against DeepSeek Harness `0.1.0-rc.7`,
100
- `bailinghub-mcp-server@0.1.1`, and BailingHub Client API v1. Harness is still a developer
101
- preview, so each Harness release requires a compatibility smoke test.
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.
102
188
 
103
189
  Report problems through [GitHub Issues](https://github.com/bailinghub/bailinghub-dsh-plugin/issues).
104
190
  Never include tokens, private deployment URLs, personal information, or production business
package/SECURITY.md CHANGED
@@ -4,7 +4,7 @@ Report vulnerabilities through a private GitHub Security Advisory in this reposi
4
4
  Do not put tokens, private deployment URLs, personal information, or raw business payloads
5
5
  in a public issue.
6
6
 
7
- ## Boundary
7
+ ## Public legacy 0.1.x boundary
8
8
 
9
9
  This bundle contributes configuration only. It has no custom runtime JavaScript, production
10
10
  dependencies, or install-time scripts. On Harness startup, the built-in DSH MCP Client runs
@@ -18,3 +18,16 @@ or acting-subject credential. Route, URL, and token stay in operator-controlled
18
18
  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
+
22
+ ## Native 0.2.0 boundary
23
+
24
+ The native 0.2.0 plugin accepts only `hubUrl`, `clientAppId`, `workspace`, and
25
+ `connectionName`. The generic SDK owns browser authorization, refresh, and secure credential
26
+ storage; business endpoints and final authorization remain Core/business-system concerns.
27
+
28
+ Tools are Agent/run scoped. Message ids are replaced by Core-safe hash aliases, invocation ids are
29
+ stable 64-character digests, and an `accepted_unknown` outcome must resume that exact invocation
30
+ instead of creating a replacement. Completion retries are bounded and reuse one frozen,
31
+ visible-only payload. Version 0.2.0 installs `bailinghub-mcp-server@0.2.0` as an exact ordinary
32
+ dependency and resolves its `./sdk` export. It does not depend on ambient modules, an optional
33
+ peer, a range, a dist-tag, or a local path. Public `0.1.1` does not provide that facade.
@@ -0,0 +1,8 @@
1
+ - insert:
2
+ - id: bailinghub-agent-client-vnext
3
+ name: dsh-bailinghub
4
+ config:
5
+ hubUrl: !!js process.env.BAILINGHUB_HUB_URL ?? ''
6
+ clientAppId: !!js process.env.BAILINGHUB_CLIENT_APP_ID ?? ''
7
+ workspace: !!js process.env.BAILINGHUB_WORKSPACE ?? ''
8
+ connectionName: !!js process.env.BAILINGHUB_CONNECTION_NAME ?? 'default'
@@ -0,0 +1,198 @@
1
+ # Agent Client Host Adapter Contract
2
+
3
+ Status: public native Agent Client contract for `dsh-bailinghub@0.2.0`. This contract is not part
4
+ of the legacy public `0.1.x` line.
5
+
6
+ ## Host Configuration
7
+
8
+ The Cordis Config schema contains only:
9
+
10
+ ```text
11
+ hubUrl
12
+ clientAppId
13
+ workspace
14
+ connectionName
15
+ ```
16
+
17
+ `hubUrl`, `clientAppId`, and `workspace` identify a public Hub-side application/workspace.
18
+ `connectionName` is a local SDK alias. No business endpoint, authorization endpoint, token, secret,
19
+ or business credential belongs in this config.
20
+
21
+ ## Injectable Transport Seam
22
+
23
+ The default transport is lazily created from `bailinghub-mcp-server/sdk`. Tests and future host
24
+ adapters may inject an object with all methods below:
25
+
26
+ ```js
27
+ login({ hubUrl, clientAppId, workspace, route, connectionName })
28
+ status({ connectionName })
29
+ logout({ connectionName })
30
+ workspaces({ connectionName })
31
+ use({ workspace, route, connectionName })
32
+
33
+ startTurn({
34
+ clientConversationId,
35
+ clientTurnId,
36
+ userMessageId,
37
+ userInput,
38
+ pageContext?,
39
+ renderers?,
40
+ })
41
+
42
+ searchCapabilities({ query, limit?, runId? })
43
+ invoke({ invocationId, capabilityRevision, agentRunId, tool, arguments })
44
+ resume(invocationId, {}, { workspace, connectionName, signal? })
45
+ completeRun(runId, {
46
+ assistantMessageId,
47
+ content,
48
+ status,
49
+ model?,
50
+ runtime?,
51
+ usage?,
52
+ })
53
+ ```
54
+
55
+ The adapter may pass a second host metadata argument (`workspace`, `connectionName`, and an
56
+ `AbortSignal`) to turn/tool methods. The framework-neutral SDK DTO is always the first argument;
57
+ an SDK implementation that does not consume host metadata may ignore it.
58
+
59
+ ## Core HTTP Mapping
60
+
61
+ The SDK, not this adapter, maps those DTOs to:
62
+
63
+ ```text
64
+ POST /agent-api/v1/workspaces/:route/turns
65
+ POST /agent-api/v1/workspaces/:route/capabilities/search
66
+ POST /agent-api/v1/tool-invocations
67
+ POST /agent-api/v1/tool-invocations/:invocation_id/resume
68
+ POST /agent-api/v1/runs/:run_id/complete
69
+ ```
70
+
71
+ `startTurn` accepts the Core `schema` or `schema_version` alias, but the resolved value must be
72
+ exactly `bailing.agent-turn-context.v1`. Its runtime result is:
73
+
74
+ ```json
75
+ {
76
+ "schema_version": "bailing.agent-turn-context.v1",
77
+ "run_id": "UUID",
78
+ "profile_revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
79
+ "capability_revision": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
80
+ "context": {
81
+ "instructions": "...",
82
+ "page_context": {},
83
+ "renderers": [],
84
+ "memory": null,
85
+ "memory_refs": [],
86
+ "knowledge": [],
87
+ "knowledge_refs": [],
88
+ "governance": {}
89
+ },
90
+ "active_tools": []
91
+ }
92
+ ```
93
+
94
+ At most 12 active tools are accepted. Each tool must use the Core tool-name grammar, an
95
+ object-rooted input schema, and complete governance metadata (`scope`, `risk`,
96
+ `approval_required`, `readonly`, and `idempotent`).
97
+ Both revision fields are required lowercase 64-character SHA-256 values; shorter labels or
98
+ uppercase digests fail closed.
99
+
100
+ ## Verified DSH rc.7 Lifecycle
101
+
102
+ DSH `0.1.0-rc.7` claims inbox messages before assembling the current step:
103
+
104
+ ```text
105
+ agent/inbox/claimed
106
+ -> systemPrompt.assemble()
107
+ -> system-prompt/assemble async waterfall
108
+ -> agent/pre-step
109
+ -> model request
110
+ ```
111
+
112
+ The adapter captures only a claimed message whose `source.kind` is `user`. On the authoritative
113
+ `system-prompt/assemble` waterfall, it calls `startTurn`, registers the returned definitions
114
+ through `agent.ctx.tools.register()`, and also adds their schemas to the already-sampled current
115
+ assembly. Later steps receive the same agent-scoped definitions from the ordinary ToolRuntime
116
+ registry.
117
+
118
+ Stable profile/instructions/governance are system-prompt sections. Memory, reference-only
119
+ knowledge body/refs, page context, and renderers are named runtime-context entries. Knowledge
120
+ content is evidence, never an instruction source.
121
+
122
+ The adapter listens to durable `session/event` values:
123
+
124
+ - `assistant/message`: keep only `content` blocks whose type is `text`, plus model and the
125
+ public numeric usage buckets;
126
+ - `tool/call`: count distinct durable call ids for the public `tool_calls` metric; never copy
127
+ tool arguments or results into completion usage;
128
+ - `turn/end`: freeze the completion DTO and synchronize it;
129
+ - `assistant/chunk`: deliberately ignored, including hidden reasoning chunks.
130
+
131
+ ## Tool Invocation and Recovery
132
+
133
+ Every active Core tool becomes an agent-scoped DSH definition. Its invocation id is a stable
134
+ 64-character lowercase SHA-256 digest of the session, run, DSH call id, and Core tool name. It
135
+ calls the SDK `invoke` DTO without letting the model choose the run, capability revision, route,
136
+ or identity.
137
+
138
+ An SDK error with `disposition === 'accepted_unknown'` starts recovery with the exact invocation
139
+ id; it never repeats the business-tool `invoke`. Likewise, `awaiting_approval`, `in_progress`, and
140
+ retryable `rejected_before_dispatch` results keep the original DSH tool call open while the
141
+ adapter performs bounded `resume` polling. Approval therefore continues the same invocation and
142
+ the same Core run before the local Agent writes its final answer.
143
+
144
+ The default recovery window is at most 120 seconds and 60 resume attempts. `executed`,
145
+ `business_rejected`, `denied`, non-retryable `rejected_before_dispatch`, and
146
+ `reconciliation_required` are terminal and are never polled. If the bounded wait expires while a
147
+ known result is still pending, the tool returns that result plus an `agent_client_wait` marker
148
+ containing the same invocation id and the only legal recovery tool. If no trustworthy invocation
149
+ result was ever received, the safe error still retains only that exact id. Raw transport errors
150
+ are never exposed.
151
+
152
+ Concurrent or replayed executions of the same DSH call share one in-flight operation. A terminal
153
+ result is returned from the per-run cache, while an unfinished replay resumes the same invocation;
154
+ neither path submits another `invoke`. A replay that changes the original tool or arguments fails
155
+ closed.
156
+
157
+ `search_business_capabilities` applies the returned revision/tool set only to the current
158
+ session/run. `resume_governed_tool_invocation` accepts only the exact 64-character id, shares the
159
+ same bounded recovery state when known locally, and never creates a replacement invocation.
160
+
161
+ ## Session and Completion State
162
+
163
+ Connection name, workspace, conversation alias, Core run, active definitions, and completion
164
+ state are isolated per DSH Agent/session. A workspace switch affects future sessions and is
165
+ rejected while any Core run is active/completing or has an unsynchronized completion payload.
166
+
167
+ The completion request is restricted to:
168
+
169
+ ```json
170
+ {
171
+ "assistant_message_id": "stable alias",
172
+ "content": "visible final text",
173
+ "status": "completed | failed | cancelled",
174
+ "model": "optional",
175
+ "runtime": "optional",
176
+ "usage": {}
177
+ }
178
+ ```
179
+
180
+ The adapter supplies the camelCase SDK equivalent. It never passes an event, message object,
181
+ reasoning block, DSH end-reason object, or arbitrary host metadata. The payload is frozen before
182
+ the first attempt and reused unchanged for up to three automatic attempts. A failed completion
183
+ remains pending in its original run; `/bailinghub sync` starts another bounded attempt batch with
184
+ that same id and payload.
185
+
186
+ DSH `0.1.0-rc.7` reports disjoint camelCase buckets (`inputTokens`, `cacheReadTokens`, optional
187
+ `cacheWriteTokens`, and `outputTokens`) on each durable `assistant/message`. The adapter sums them
188
+ across model steps, exposes total input as Core `input_tokens`, cache reads as the
189
+ `cached_input_tokens` subset, and derives `total_tokens` without adding `reasoningTokens` a second
190
+ time. Unknown, non-finite, and negative metrics are discarded; only the Core public usage
191
+ allowlist can leave the host.
192
+
193
+ ## Graceful Degradation
194
+
195
+ Missing/invalid configuration, missing SDK, failed authorization, failed Core context, a tool-name
196
+ collision, or unsupported DSH Code Mode removes the Core business tools and inserts a concise
197
+ status section. The local Agent may continue using unrelated local tools, but it is explicitly
198
+ told not to claim a BailingHub business action was executed.
@@ -1,15 +1,81 @@
1
1
  # Compatibility
2
2
 
3
+ ## Native Agent Client 0.2.0
4
+
3
5
  | Component | Verified version |
4
6
  | --- | --- |
7
+ | DeepSeek Harness / Cordis lifecycle | `0.1.0-rc.7` |
8
+ | Node.js | `22.19.0+` or `24+` |
9
+ | DSH tool presentation | Native Tool Mode |
10
+ | Generic Agent Client SDK | `bailinghub-mcp-server@0.2.0` via `./sdk` |
11
+ | BailingHub Core | `bailinghub@0.5.0`; Agent Auth v1 + Agent Client Runtime v1 |
12
+ | BailingHub turn context | `bailing.agent-turn-context.v1` |
13
+ | BailingHub capability search | `bailing.agent-capability-search.v1` |
14
+ | BailingHub governed invocation | `bailing.agent-tool-invocation.v1` |
15
+ | BailingHub run completion | `bailing.agent-run-completion.v1` |
16
+
17
+ Version 0.2.0 declares `bailinghub-mcp-server@0.2.0` as an exact ordinary dependency. A clean DSH
18
+ profile must work after installing only the plugin; ambient `node_modules`, peer/optional
19
+ dependencies, dist-tags, ranges, and local `file:` paths are outside the supported contract.
20
+ Compatibility with Core 0.5.0 includes migrations 055/056 and the live Agent Auth/Runtime
21
+ contracts from that release.
22
+
23
+ DeepSeek Harness remains a developer preview. Every Harness version change requires a new smoke
24
+ against its real Cordis lifecycle, prompt waterfall, ToolRuntime, commands, durable session events,
25
+ and Web profile installation before this table can change.
26
+
27
+ ### Tool-mode and operating-system boundaries
28
+
29
+ - 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.2.0.
31
+ - macOS Agent Session credentials use Keychain.
32
+ - Linux and other POSIX systems require the SDK's explicit secure file-store opt-in; the file must
33
+ remain owned by the current user with mode `0600`.
34
+ - Windows Agent Session credential storage is not supported by 0.2.0. Do not describe
35
+ Client Token compatibility as native Agent Session support.
36
+ - Non-loopback Hub connections require HTTPS. Loopback HTTP is for local development only.
37
+
38
+ ### Host configuration contract
39
+
40
+ The plugin accepts only these four public routing fields:
41
+
42
+ ```text
43
+ hubUrl
44
+ clientAppId
45
+ workspace
46
+ connectionName
47
+ ```
48
+
49
+ In Agent Client v1, `workspace` is the BailingHub route id. Business endpoints, authorization page
50
+ URLs, Client Tokens, Tool Provider signing secrets, business credentials, and model-provider keys
51
+ are not DSH plugin configuration.
52
+
53
+ ## Public legacy 0.1.x
54
+
55
+ | Component | Published version |
56
+ | --- | --- |
5
57
  | DeepSeek Harness | `0.1.0-rc.7` |
6
58
  | DSH MCP Client | in-box version shipped by `0.1.0-rc.7` |
7
- | BailingHub MCP Server | `0.1.1` |
59
+ | BailingHub MCP Server | exactly `0.1.1` |
8
60
  | BailingHub Client API | `bailing.client-api.v1` |
9
61
  | Node.js | `22.19.0+` |
10
62
 
11
- DeepSeek Harness is currently a developer preview. Compatibility with another Harness release
12
- must be rechecked before changing this table or the package's supported range.
63
+ Public `dsh-bailinghub@0.1.1` remains a configuration-only bundle. It starts the exact
64
+ `bailinghub-mcp-server@0.1.1` stdio command, exposes three fixed governed-job tools, and uses one
65
+ operator-configured Hub URL, route-scoped Client Token, and route. It does not establish an Agent
66
+ Session, receive a dynamic capability catalog, or move orchestration into local DSH.
67
+
68
+ The 0.2 line must not mutate the published 0.1 package or reinterpret its configuration. A new
69
+ BailingHub Core release is compatible only after a separate clean legacy profile proves that the
70
+ 0.1.1 `/run` and `/jobs/{job_id}` flow still works.
71
+
72
+ ## Release compatibility rule
73
+
74
+ Compatibility requires independent evidence for both paths:
75
+
76
+ 1. Native 0.2: clean install of only the exact plugin package, browser authorization, workspace
77
+ discovery, read, permitted mutation, approval/resume, visible completion, and Hub trajectory.
78
+ 2. Legacy 0.1.1: clean static profile, fixed Client Token route, one submit, and same-job follow-up
79
+ through the unchanged public Client API.
13
80
 
14
- The bundle uses DSH's in-box `@deepseek-ai/dsh-mcp-client`; it intentionally does not install a
15
- second copy into the profile. The stdio child is pinned to `bailinghub-mcp-server@0.1.1`.
81
+ Passing one path does not establish compatibility for the other.