dsh-dingtalk 0.1.1 → 0.2.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 stardustlc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # dsh-dingtalk
2
2
 
3
+ ![npm](https://img.shields.io/npm/v/dsh-dingtalk) ![downloads](https://img.shields.io/npm/dm/dsh-dingtalk) ![license](https://img.shields.io/github/license/STARDUSTLC666/dsh-dingtalk) ![stars](https://img.shields.io/github/stars/STARDUSTLC666/dsh-dingtalk?style=social)
4
+
3
5
  [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
4
6
 
5
7
  DeepSeek Harness DingTalk group robot notification plugin: lets the agent **push Markdown / plain-text messages to a DingTalk group one-way**. Pure plugin implementation, zero core changes, works out of the box.
@@ -17,6 +19,10 @@ Example:
17
19
 
18
20
  > Send a message to the DingTalk group: title "Build complete", body "Pipeline #123 passed ✅".
19
21
 
22
+ ## Compatibility
23
+
24
+ Verified with official `@deepseek-ai/dsh@0.1.5-rc.1` and Node `24.16.0` on 2026-09-11: all 18 components load alongside Modlens, with passing tool-schema, skill-registration and offline read-only invocation checks. Uses the `cordis.patch.yml` + `dsh.bundle.patch` bundle model. Node requirements match this Harness release: 22.19 or later within 22.x, or 24 or later. Live external-service workflows require separate configuration and validation.
25
+
20
26
  ## Installation
21
27
 
22
28
  ```sh
@@ -25,6 +31,15 @@ dsh plugin --profile web add dsh-dingtalk
25
31
 
26
32
  After installing, restart `dsh web`. The plugin ships with an empty config and **won't crash startup**; calling any `dingtalk_*` tool before configuration returns a clear Chinese configuration hint.
27
33
 
34
+ ## Uninstall
35
+
36
+ ```bash
37
+ dsh plugin --profile web remove dsh-dingtalk
38
+ ```
39
+
40
+ Then restart the web service. To clean up fully, also remove the plugin entry from your profile `cordis.patch.yml` if you overrode it.
41
+
42
+
28
43
  ## Step 1: Get the webhook and signing secret
29
44
 
30
45
  Use DingTalk's **custom robot** method — **no enterprise app or admin permission needed**:
package/README.md CHANGED
@@ -24,6 +24,10 @@ DeepSeek Harness 钉钉群机器人通知插件:让 agent 能**单向推送 Ma
24
24
 
25
25
  > 帮我给钉钉群发一条消息:标题「构建完成」,正文「流水线 #123 已通过 ✅」。
26
26
 
27
+ ## 兼容性
28
+
29
+ 已在官方 `@deepseek-ai/dsh@0.1.5-rc.1`、Node `24.16.0` 上验证(2026-09-11):18 个组件与 Modlens 同载,工具 schema、技能注册及离线只读调用检查通过。采用 `cordis.patch.yml` + `dsh.bundle.patch` 组合包模型。Node 要求与该版本 Harness 一致:22.19 及以上的 22.x,或 24 及以上。外部服务的实际业务操作需按各组件配置单独验证。
30
+
27
31
  ## 安装
28
32
 
29
33
  ```sh
@@ -32,6 +36,15 @@ dsh plugin --profile web add dsh-dingtalk
32
36
 
33
37
  装好后重启 `dsh web`。插件自带空配置,**不会弄崩启动**;配置前调用任何 `dingtalk_*` 工具都会返回明确的中文配置提示。
34
38
 
39
+ ## 卸载
40
+
41
+ ```bash
42
+ dsh plugin --profile web remove dsh-dingtalk
43
+ ```
44
+
45
+ 卸载后重启 Web 服务。如需彻底清理,可再手动删除自己 profile `cordis.patch.yml` 中覆盖的插件行。
46
+
47
+
35
48
  ## 第一步:拿到 webhook 与加签密钥
36
49
 
37
50
  用钉钉【自定义机器人】方式,**不需要企业应用、不需要管理员权限**:
@@ -126,5 +139,4 @@ MIT。这是一个社区插件,与 DeepSeek 官方及钉钉官方无关;`@de
126
139
 
127
140
  - [dsh-calendar](https://github.com/STARDUSTLC666/dsh-calendar) — CalDAV 日历五件套
128
141
  - [dsh-dingtalk](https://github.com/STARDUSTLC666/dsh-dingtalk) — 钉钉群通知(零依赖)
129
- - [dsh-email](https://github.com/STARDUSTLC666/dsh-email) — 邮件六件套 + Web 设置页
130
-
142
+ - [dsh-email](https://github.com/STARDUSTLC666/dsh-email) — 邮件六件套 + Web 设置页
package/lib/index.js CHANGED
@@ -100,6 +100,39 @@ export function apply(ctx, config = {}) {
100
100
  return { ok: true, msgtype: 'text', title: '', errcode: result.errcode, errmsg: result.errmsg };
101
101
  },
102
102
  });
103
+ ctx.tools.register({
104
+ name: 'dingtalk_health',
105
+ description: 'dsh-dingtalk 自检:检查钉钉机器人 webhook 与加签密钥(secret)配置是否就绪(不发送任何消息)。遇到问题时先运行本工具定位。',
106
+ parameters: compileParameters({}),
107
+ output: {
108
+ schema: { type: 'object', additionalProperties: true },
109
+ render: (_args, value) => {
110
+ const rec = (value ?? {});
111
+ const rawChecks = Array.isArray(rec.checks) ? rec.checks : [];
112
+ const lines = ['dsh-dingtalk 自检' + (rec.ok === true ? ':正常。' : ':发现问题。')];
113
+ for (const item of rawChecks) {
114
+ const c = (item ?? {});
115
+ lines.push('- ' + String(c.name) + ':' + (c.ok === true ? '✅ ' + String(c.detail ?? '') : '❌ ' + String(c.detail ?? '')));
116
+ }
117
+ return oneText(lines.join('\n'));
118
+ },
119
+ },
120
+ async execute() {
121
+ const checks = [];
122
+ let ok = true;
123
+ try {
124
+ const resolved = resolveDingTalkConfig(config);
125
+ checks.push({ name: 'webhook', ok: true, detail: '已配置' });
126
+ const secret = resolved.secret;
127
+ checks.push({ name: '加签密钥', ok: true, detail: typeof secret === 'string' && secret !== '' ? '已配置(加签模式)' : '未配置(关键词/白名单模式)' });
128
+ }
129
+ catch (error) {
130
+ ok = false;
131
+ checks.push({ name: 'webhook', ok: false, detail: error instanceof Error ? error.message : String(error) });
132
+ }
133
+ return { ok, plugin: 'dsh-dingtalk', checks };
134
+ },
135
+ });
103
136
  }
104
137
  export { resolveDingTalkConfig, DINGTALK_SECRET_ENV, DEFAULT_TIMEOUT_MS, clampInt } from './config.js';
105
138
  export { DingTalkClient, DingTalkError, dingTalkErrorMessage } from './client.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-dingtalk",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "钉钉群机器人单向通知工具(DeepSeek Harness 插件):agent 推送 Markdown / 纯文本消息到钉钉群,支持加签安全模式。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -22,7 +22,6 @@
22
22
  ],
23
23
  "scripts": {
24
24
  "build": "tsc",
25
- "prepare": "tsc",
26
25
  "prepublishOnly": "pnpm run build",
27
26
  "test": "pnpm run build && node --test \"test/*.test.mjs\""
28
27
  },
@@ -38,7 +37,7 @@
38
37
  "license": "MIT",
39
38
  "packageManager": "pnpm@11.7.0",
40
39
  "engines": {
41
- "node": ">=20"
40
+ "node": "^22.19.0 || >=24.0.0"
42
41
  },
43
42
  "dsh": {
44
43
  "bundle": {