Preface

DeepSeek Harness (DSH) adopts a plugin-based architecture, allowing the Agent toolbox to be extended with additional capabilities. yiyunet/dsh-dingtalk-connector is a DSH plugin designed to provide access to DingTalk AI Table (multidimensional table / aitable) data within DSH.

This plugin does not call DingTalk REST APIs directly. Instead, it wraps the official CLI dws to perform operations. This approach reduces endpoint maintenance costs and leverages the authentication and pagination logic built into dws to improve stability. After installation, the plugin registers 10 dingtalk_aitable_* tools with DSH and provides a “DingTalk Docs” settings panel.

Core Capabilities

The plugin provides full CRUD support for DingTalk AI Tables, while balancing security and practical functionality:

  • Data operations: Supports query, create, update, and delete operations for Base (file), data tables, and fields.
  • Record management: Supports querying records by ID or condition (full pull is supported), as well as batch writing, updating, and deleting records.
  • Discovery and scanning: Provides candidate Base discovery and readability validation to help confirm which Bases are accessible.
  • Data export: Supports full CSV export, with a BOM header included and overwrite support for files with the same name.
  • Scheduled tasks: Supports creating, listing, deleting, starting/stopping, and immediately running scheduled export jobs.
  • Security controls: Includes a self-check tool for version/authorization and a controlled pass-through capability (dingtalk_aitable_raw).

Installation and Prerequisites

This plugin depends on the external CLI dws. The following conditions must be met before installation:

  1. Runtime environment: Node.js version ≥ 22.19.
  2. DingTalk CLI (dws): dingtalk-workspace-cli must be installed globally.
  3. DingTalk-side authorization: The “AI Table record read/write” permission must be enabled in the DingTalk developer console, and the application must be added as an editable collaborator on the target Base.

Installation Steps

# 1. 安装插件
dsh plugin --profile web add @yiyunet/dsh-dingtalk-connector

# 2. 重启 dsh web 以加载插件

# 3. 使用辅助脚本检查环境(可选)
npx @yiyunet/dsh-dingtalk-connector install
npx @yiyunet/dsh-dingtalk-connector doctor

Configuration

The plugin relies on the cordis.patch.yml file for configuration. The key configuration items are described below:

Configuration Item Default Value Description
dwsCommand dws Command name on PATH
dwsEntry None Recommended on Windows: Points to the absolute path of the dws JS entry to avoid shell injection risks
timeoutMs 60000 Timeout for a single command
clientIdEnv / clientSecretEnv DWS_CLIENT_ID / DWS_CLIENT_SECRET Environment variable names used for credentials
allowWrite false Toggle: allows create / update operations
allowDelete false Toggle: allows delete operations (independent switch, and each operation requires confirmation)
maxBatch 30 Maximum number of records per batch operation

Security Configuration for dwsEntry

In a Windows environment, .cmd files must be launched through a shell. The shell parses special characters in arguments (such as quotes, &, \|). If record text contains these characters, it may lead to injection attacks. The plugin returns an error when it detects an unsafe launch method.

To resolve this completely, point dwsEntry to the JS entry of dws (for example, a path under npm root -g) to bypass shell launch entirely.

# cordis.patch.yml 示例
dwsEntry: '<npm root -g>/dingtalk-workspace-cli/bin/dws.js'

Tool List

After installation, DSH registers the following 10 tools:

  1. dingtalk_aitable_diagnose: Self-check tool that verifies version, authorization status, and command registration.
  2. dingtalk_aitable_base: Base file management (query/create/update/delete).
  3. dingtalk_aitable_table: Data table management (query tables and fields, create/update/delete).
  4. dingtalk_aitable_field: Field management (query/create/update/delete).
  5. dingtalk_aitable_record_query: Query records by ID or condition; all=true performs a full pull.
  6. dingtalk_aitable_record_write: Batch write/update/delete records.
  7. dingtalk_aitable_raw: Controlled pass-through that can execute any subcommand in the registry.
  8. dingtalk_aitable_scan: Candidate Base discovery and readability validation.
  9. dingtalk_aitable_export_csv: Full CSV export (with BOM, overwrites the same-name file).
  10. dingtalk_sync_job: Scheduled export job management (create/list/delete/start/stop/run immediately).

Security Mechanism: Dual Lock

Delete operations require dual confirmation:
1. Configuration-layer lock: allowDelete: true must be enabled in the configuration file.
2. Interaction-layer lock: Each delete operation requires the confirm=true parameter, indicating that consent has been obtained.

Notes

  • Three-layer dependency: The plugin itself is pure JS, but it depends on the external CLI dws. If Node, dws, or DingTalk-side authorization is missing, operations will fail.
  • List limitation: The official DingTalk API does not provide an interface to “list all Bases.” The plugin’s scan function is a combination of “candidates ∪ manual entries” and does not guarantee exhaustive coverage of all Bases.
  • Default gates: For security reasons, write and delete gates are disabled by default. To enable them, you must modify allowWrite and allowDelete in the configuration file.
  • Timer mechanism: Scheduled export jobs run inside the DSH host process. If DSH is closed, jobs do not run. After restart, trigger points are recalculated.

Summary

yiyunet/dsh-dingtalk-connector provides standard capabilities for interacting with DingTalk AI Tables in DeepSeek Harness. By wrapping the dws CLI, it avoids the risks associated with自行 maintaining REST endpoints and provides practical features such as CSV export and scheduled tasks. For agent developers who need to handle DingTalk multidimensional table data, this is a reliable tool choice.

Project address: https://github.com/yiyunet/dsh-dingtalk-connector