dsh-dingtalk 0.1.1 → 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/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
@@ -17,6 +17,10 @@ Example:
17
17
 
18
18
  > Send a message to the DingTalk group: title "Build complete", body "Pipeline #123 passed ✅".
19
19
 
20
+ ## Compatibility
21
+
22
+ Verified against `@deepseek-ai/dsh@0.1.1-rc.2` on 2026-08-26. Built for the cordis patch-bundle plugin model (`cordis.patch.yml` + `dsh.bundle.patch`). No runtime imports of `@deepseek-ai/*` internals.
23
+
20
24
  ## Installation
21
25
 
22
26
  ```sh
@@ -25,6 +29,15 @@ dsh plugin --profile web add dsh-dingtalk
25
29
 
26
30
  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
31
 
32
+ ## Uninstall
33
+
34
+ ```bash
35
+ dsh plugin --profile web remove dsh-dingtalk
36
+ ```
37
+
38
+ Then restart the web service. To clean up fully, also remove the plugin entry from your profile `cordis.patch.yml` if you overrode it.
39
+
40
+
28
41
  ## Step 1: Get the webhook and signing secret
29
42
 
30
43
  Use DingTalk's **custom robot** method — **no enterprise app or admin permission needed**:
@@ -113,4 +126,4 @@ pnpm test # 构建 + node --test(加签算法/配置解析/客户端封
113
126
 
114
127
  ## License
115
128
 
116
- MIT. This is a community plugin, not affiliated with DeepSeek or DingTalk; `@deepseek-ai/*` is an officially reserved namespace.
129
+ MIT. This is a community plugin, not affiliated with DeepSeek or DingTalk; `@deepseek-ai/*` is an officially reserved namespace.
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.1-rc.2` 上验证(2026-08-26)。遵循 cordis 组合包补丁模型(`cordis.patch.yml` + `dsh.bundle.patch`),运行时不 import 任何 `@deepseek-ai/*` 内部模块。
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,60 +1,59 @@
1
- {
2
- "name": "dsh-dingtalk",
3
- "version": "0.1.1",
4
- "description": "钉钉群机器人单向通知工具(DeepSeek Harness 插件):agent 推送 Markdown / 纯文本消息到钉钉群,支持加签安全模式。",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "types": "lib/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./lib/index.d.ts",
11
- "default": "./lib/index.js"
12
- },
13
- "./client": "./lib/client.js",
14
- "./cordis.patch.yml": "./cordis.patch.yml",
15
- "./package.json": "./package.json"
16
- },
17
- "files": [
18
- "lib",
19
- "cordis.patch.yml",
20
- "README.md",
21
- "README.en.md"
22
- ],
23
- "scripts": {
24
- "build": "tsc",
25
- "prepare": "tsc",
26
- "prepublishOnly": "pnpm run build",
27
- "test": "pnpm run build && node --test \"test/*.test.mjs\""
28
- },
29
- "keywords": [
30
- "dsh-plugin",
31
- "deepseek-harness",
32
- "dsh",
33
- "dingtalk",
34
- "dingtalk-robot",
35
- "webhook"
36
- ],
37
- "author": "stardustlc",
38
- "license": "MIT",
39
- "packageManager": "pnpm@11.7.0",
40
- "engines": {
41
- "node": ">=20"
42
- },
43
- "dsh": {
44
- "bundle": {
45
- "patch": "./cordis.patch.yml"
46
- }
47
- },
48
- "devDependencies": {
49
- "@types/node": "^26.2.0",
50
- "typescript": "^5.7.3"
51
- },
52
- "repository": {
53
- "url": "git+https://github.com/STARDUSTLC666/dsh-dingtalk.git",
54
- "type": "git"
55
- },
56
- "bugs": {
57
- "url": "https://github.com/STARDUSTLC666/dsh-dingtalk/issues"
58
- },
59
- "homepage": "https://github.com/STARDUSTLC666/dsh-dingtalk#readme"
60
- }
1
+ {
2
+ "name": "dsh-dingtalk",
3
+ "version": "0.2.0",
4
+ "description": "钉钉群机器人单向通知工具(DeepSeek Harness 插件):agent 推送 Markdown / 纯文本消息到钉钉群,支持加签安全模式。",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./client": "./lib/client.js",
14
+ "./cordis.patch.yml": "./cordis.patch.yml",
15
+ "./package.json": "./package.json"
16
+ },
17
+ "files": [
18
+ "lib",
19
+ "cordis.patch.yml",
20
+ "README.md",
21
+ "README.en.md"
22
+ ],
23
+ "scripts": {
24
+ "build": "tsc",
25
+ "prepublishOnly": "pnpm run build",
26
+ "test": "pnpm run build && node --test \"test/*.test.mjs\""
27
+ },
28
+ "keywords": [
29
+ "dsh-plugin",
30
+ "deepseek-harness",
31
+ "dsh",
32
+ "dingtalk",
33
+ "dingtalk-robot",
34
+ "webhook"
35
+ ],
36
+ "author": "stardustlc",
37
+ "license": "MIT",
38
+ "packageManager": "pnpm@11.7.0",
39
+ "engines": {
40
+ "node": ">=22"
41
+ },
42
+ "dsh": {
43
+ "bundle": {
44
+ "patch": "./cordis.patch.yml"
45
+ }
46
+ },
47
+ "devDependencies": {
48
+ "@types/node": "^26.2.0",
49
+ "typescript": "^5.7.3"
50
+ },
51
+ "repository": {
52
+ "url": "git+https://github.com/STARDUSTLC666/dsh-dingtalk.git",
53
+ "type": "git"
54
+ },
55
+ "bugs": {
56
+ "url": "https://github.com/STARDUSTLC666/dsh-dingtalk/issues"
57
+ },
58
+ "homepage": "https://github.com/STARDUSTLC666/dsh-dingtalk#readme"
59
+ }