dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
Kingdee Cloud Starry Sky (金蝶云星空) WebAPI plugin for DeepSeek Harness (DSH) — typed agent tools to query, save, submit, audit, un-audit, view and delete bills/base data and to invoke BOS custom services.
English | Chinese
Kingdee Cloud Starry Sky secondary-development plugin for DeepSeek Harness (DSH).
dsh-kingdee gives the DSH agent a first-class, credential-safe way to act on a Kingdee Cloud Starry Sky tenant through its WebAPI: typed tools for querying, saving, submitting, auditing, un-auditing, viewing and deleting bills/base data, and for invoking BOS custom services. A companion domain skill (kingdee-bos) teaches the field/enum/status conventions and the boundary between the data layer and the platform-plugin layer.
kdservice-sessionid session (sent as both a request header and a cookie), stable cursor pagination (orderString, limit, startRow), direct bill number (numbers) workflow actions, and auto-submit/audit (isAutoSubmitAndAudit).AuthService.ValidateUser, or a third-party application against AuthService.LoginByAppSecret (the mode Kingdee requires on public-cloud tenants opened after 2022-11-29). Both attach the same kdservice-sessionid session; no fabricated auth header is used, and the login responses are classified by their own LoginResultType shape rather than the business envelope.kingdee_* tools. Each one is listed below in the Tools table.mock: true flag swaps in a local transport so you can demo and test the pipeline without a reachable tenant.icon.svg artwork and bilingual manifest resources (locale/en.json, locale/zh.json) conforming to DSH 0.2.1-rc.2 display conventions for Plugin Manager.🧩 Scope. This plugin covers the data/service layer of Kingdee Cloud secondary development. The platform-plugin layer (server-side C# form/list plugins, UI layout, background events) uses the BOS integration development environment and is not reachable through the WebAPI. The
kingdee-bosskill documents that boundary.
# Add the bundle to a DSH profile and enable it
dsh plugin --profile web add dsh-kingdee
DeepSeek Harness 0.2.1-rc.2 compatibility. 0.15.0 is verified against DeepSeek Harness 0.2.1-rc.2 and moves its
@deepseek-ai/dsh-*devDependencies to that release. Its ownengines.dshrange is unchanged at>=0.1.7-alpha.2 <0.3.0(the range widened in 0.11.0), so 0.14.0 remains admitted on 0.2.1-rc.2 as well — 0.15.0 is not a mandatory upgrade. Since DeepSeek Harness 0.2.1-alpha.4 an ownengines.dshrange decides admission alone and the@deepseek-ai/dsh/@deepseek-ai/dsh-*peers are ignored for that check; both rules match prereleases against the range. The older0.10.0declares^0.1.7-alpha.2, which excludes 0.2.x, and is refused at load on 0.2.x. An incompatible row is refused and an incompatible bundle is skipped. On 0.2.x, upgrade withdsh plugin --profile web add dsh-kingdee@0.15.0.Note on CLI syntax: per DeepSeek Harness 0.2.1-alpha.1 upgrade specifications,
--profile <name>must precede forwarded subcommands such asadd,remove, orupdate. Putting--profileafter the subcommand forwards the flag to pnpm and fails.The remedy the harness prints for a refusal is
dsh plugin allow-version <package@version> --dsh-version <runtime> --accept-risk(or the plugin manager), which records an exact-version exemption in the profile'scompatibility.json. That is a risk acknowledgement, not a compatibility fix, and it grants one exact plugin version on one exact runtime: a plugin upgrade or a harness upgrade does not inherit the grant.
Verified against deepseek-harness 0.2.1-rc.2 with plugin 0.15.0:
pnpm run typecheckclean,pnpm run buildclean, 15 unit tests passing (pnpm test), and the harness's own compatibility check admittingdsh-kingdee@0.15.0on runtime0.2.1-rc.2. No live-tenant verification was performed.
See CONFIG.md for full configuration, INSTALL.md for setup, USAGE.md for the tool reference, and UPDATE.md / UNINSTALL.md for upgrades and removal. Release history is in CHANGELOG.md / CHANGELOG.zh.md.
Register the plugin and set connection details in the Plugins → kingdee settings card (or in cordis.yml): WebAPI base URL, acctId, and the authentication mode.
Put the secrets in the environment (or in the credentials store) under the references you configured. The same reference names work on every OS — only the way you set them differs:
# Linux / macOS (sh)
export DSH_KINGDEE_USER=your_username
export DSH_KINGDEE_PASSWORD=your_password
# app mode: DSH_KINGDEE_USER holds the integration user, and is required
export DSH_KINGDEE_APP_SECRET=your_app_secret
# Windows — PowerShell (current session)
$env:DSH_KINGDEE_USER = "your_username"
$env:DSH_KINGDEE_PASSWORD = "your_password"
$env:DSH_KINGDEE_APP_SECRET = "your_app_secret" # app mode (USER = integration user)
REM Windows — Command Prompt (current session)
set DSH_KINGDEE_USER=your_username
set DSH_KINGDEE_PASSWORD=your_password
set DSH_KINGDEE_APP_SECRET=your_app_secret
Or store the value in the DSH credential store instead of the shell environment: set it once in the DSH settings UI (credential values are write-only — the page only ever sees a redacted descriptor), or edit $DSH_HOME/.credentials.yaml directly. The reference name is what the plugin config carries; the value never enters a config file.
See INSTALL.md for the per-OS details (including persistent setx / [Environment]::SetEnvironmentVariable).
Ask the agent to query something:
Query sales order number SO-20260701 on Kingdee Cloud.
The agent loads the kingdee-bos skill and calls kingdee_query with formId=SAL_SaleOrder.
To try it without a real tenant, set mock: true in the plugin config — the tools then return canned Kingdee envelopes. The settings card exposes the non-secret connection fields but not mock, so this one is set in configuration:
config:
mock: true
See INSTALL.md for the full snippet.
| Tool | Description | Key parameters |
|---|---|---|
kingdee_query | ExecuteBillQuery — query bills / base data | formId, fieldKeys[], filter?, topCount?, organization? |
kingdee_query_business_data | Structured query (QueryBusinessData) | formId, fieldKeys[], filter?, topCount?, organization? |
kingdee_save | Save (create/update) a bill or base record | formId, data, interaction? |
kingdee_batch_save | Batch-save several records in one call | formId, records[], interaction? |
kingdee_submit | Submit one or more records | formId, ids[], numbers? |
kingdee_unsubmit | Un-submit records | formId, ids[] |
kingdee_audit | Audit records | formId, ids[] |
kingdee_unaudit | Un-audit records | formId, ids[] |
kingdee_view | View a single record by id | formId, id |
kingdee_delete | Delete records by id | formId, ids[] |
kingdee_delete_draft | Delete draft records | formId, ids[] |
kingdee_invoke | Invoke a BOS custom service | serviceName, payload?, formId? |
kingdee_logout | Log out of the current session | — |
kingdee_list_datacenters | List data centers / tenants at the base URL | — |
The table follows the same order as the per-tool reference in USAGE.md.
Every tool returns a normalized canonical value; a Kingdee IsSuccess=false message becomes a typed error (kd/business-error, kd/auth-failed, …) instead of prose for the model to parse.
dsh-kingdee targets Kingdee Cloud Starry Sky V9.1 Enterprise Edition (patch PT-163015 → product version 9.1.0.20250807) and stays backward-compatible with V9.0 / V8.x.
V9.1 has no breaking WebAPI changes. No renamed or removed operation, no cookie rename, no URL-convention change, and no new required header. The classic {baseUrl}/{stub path}.common.kdsvc + kdservice-sessionid session protocol this plugin speaks is unchanged.
What V9.1 did change at the interface layer:
Delete now returns a correct FNumber — SuccessEntitys[].Number can be trusted as-is from 9.1.0.20250807 on.Operational consequences:
app (third-party) mode over account/password where possible.FormId instead of trusting an empty row set.Evidence honesty. The login services' named request keys (acctID / username / appid / appsecret / lcid), the Limit row cap (~2000) and the listDataCenterService default name are community-attested, not officially published by Kingdee. The authoritative per-tenant source is the product itself: sign in as an administrator, then open Common Settings → Dynamic Service Definition → WebAPI, pick the business object and operation, and read that operation's parameter list and sample call.
src/
├─ kd-core/ framework-free Kingdee WebAPI client (pure logic)
│ ├─ auth.ts user / app authentication
│ ├─ client.ts the operations set + session management
│ ├─ envelope.ts envelope parsing & normalization
│ ├─ errors.ts typed error mapping
│ ├─ transport.ts transport seam (real HTTP via fetch)
│ └─ mock.ts offline mock transport
├─ index.ts DSH host plugin: registers the kingdee_* tools + exports the Config schema
├─ tools.ts typed tool wrappers (defineTool)
├─ config.ts plugin config schema + credential resolution
└─ client/
└─ settings-card.ts browser settings card (scaffold)
skills/
└─ kingdee-bos/ domain skill: field/enum/status conventions + boundary
kd-core is published as dsh-kingdee/kd-core and has no DSH dependency, so the same logic can be wrapped later by a thin MCP server.
The framework-free core is verified by 15 unit tests that run with the Node built-in test runner (Node ≥ 22, TS type-stripping). No DSH install is needed for the core:
pnpm test # node --test "test/**/*.test.ts"
The DSH host/plugin half (src/index.ts, tools.ts, config.ts, client/) imports @deepseek-ai/* peer packages and is compiled inside a DSH profile, where those peers resolve. Build and typecheck therefore use the DSH toolchain:
pnpm install && pnpm run typecheck # requires the deepseek-harness monorepo (or a DSH profile) for peers
The repository is TypeScript throughout; there is no JavaScript source to keep in
sync. The bilingual-documents gate is
scripts/check-docs-language.ts, which CI runs
with bare Node (no dependencies installed) before the install step:
node scripts/check-docs-language.ts
https://api.kingdee.com/galaxyapi/) with API-signature authentication (LoginByApiSignHeaders). This plugin does not implement that path — it speaks the classic kdsvc session protocol only. On such a tenant a classic session cannot be established at all, so every operation fails at login; a tenant/gateway that still exposes the classic WebAPI is required../client bundle reproduces its artifact. The shared clientBundle tsdown preset lives inside the harness repository and is not published, so this package emits the documented factory format itself.MIT — see LICENSE.