@vanadium-23/dsh-ping 0.1.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/DESIGN.md +168 -0
- package/LICENSE +21 -0
- package/README.md +161 -0
- package/bin/dsh-ping.mjs +8 -0
- package/cordis.patch.yml +8 -0
- package/lib/channels-CpGxdbPv.js +426 -0
- package/lib/index.js +421 -0
- package/lib/smoke.js +65 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/channels.d.ts +109 -0
- package/lib/types/channels.d.ts.map +1 -0
- package/lib/types/channels.js +204 -0
- package/lib/types/channels.js.map +1 -0
- package/lib/types/decide.d.ts +110 -0
- package/lib/types/decide.d.ts.map +1 -0
- package/lib/types/decide.js +145 -0
- package/lib/types/decide.js.map +1 -0
- package/lib/types/defaults.d.ts +64 -0
- package/lib/types/defaults.d.ts.map +1 -0
- package/lib/types/defaults.js +51 -0
- package/lib/types/defaults.js.map +1 -0
- package/lib/types/index.d.ts +36 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +330 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/protocol.d.ts +122 -0
- package/lib/types/protocol.d.ts.map +1 -0
- package/lib/types/protocol.js +107 -0
- package/lib/types/protocol.js.map +1 -0
- package/lib/types/smoke.d.ts +17 -0
- package/lib/types/smoke.d.ts.map +1 -0
- package/lib/types/smoke.js +66 -0
- package/lib/types/smoke.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standalone toast smoke test — no harness required.
|
|
3
|
+
*
|
|
4
|
+
* `node lib/smoke.js [text]` raises one real Windows toast with the exact code
|
|
5
|
+
* path the plugin uses, which is how the notification channel gets verified on
|
|
6
|
+
* a machine without starting a session.
|
|
7
|
+
* @module dsh-ping/smoke
|
|
8
|
+
*/
|
|
9
|
+
import { realpathSync } from 'node:fs';
|
|
10
|
+
import { resolve } from 'node:path';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { buildNotice } from "./decide.js";
|
|
13
|
+
import { sendToastSync } from "./channels.js";
|
|
14
|
+
import { DEFAULTS, resolveConfig } from "./defaults.js";
|
|
15
|
+
/**
|
|
16
|
+
* Raise one test toast.
|
|
17
|
+
* @param argv - words appended to the default body text.
|
|
18
|
+
* @returns the process exit code.
|
|
19
|
+
*/
|
|
20
|
+
export function runSmoke(argv) {
|
|
21
|
+
const cfg = resolveConfig(undefined);
|
|
22
|
+
const text = argv.join(' ').trim() === ''
|
|
23
|
+
? '这是一条 dsh-ping 自检通知(命令行)。看到它就说明 Windows 通知链路是通的。'
|
|
24
|
+
: argv.join(' ').trim();
|
|
25
|
+
const notice = buildNotice({ kind: 'done', sessionId: 'smoke', sessionTitle: 'dsh-ping 自检', detail: text, durationMs: 0 }, cfg.titles, cfg.maxBodyChars);
|
|
26
|
+
const result = sendToastSync(notice, {
|
|
27
|
+
appId: cfg.toastAppId,
|
|
28
|
+
sound: cfg.toastSoundDone,
|
|
29
|
+
long: false,
|
|
30
|
+
...(cfg.powershellPath === '' ? {} : { powershellPath: cfg.powershellPath }),
|
|
31
|
+
});
|
|
32
|
+
if (!result.started) {
|
|
33
|
+
process.stdout.write(`dsh-ping: 这台机器上无法发送 Windows 通知(${result.output})\n`);
|
|
34
|
+
return 1;
|
|
35
|
+
}
|
|
36
|
+
if (result.code !== 0) {
|
|
37
|
+
process.stdout.write(`dsh-ping: 通知助手以退出码 ${String(result.code)} 失败\n${result.output}\n`);
|
|
38
|
+
return 1;
|
|
39
|
+
}
|
|
40
|
+
process.stdout.write(`dsh-ping: 已交给 Windows 通知中心「${notice.title}」 — ${notice.lines.join(' · ')}\n`);
|
|
41
|
+
process.stdout.write('屏幕上没弹窗的话,检查 设置 → 系统 → 通知 是否为 Windows PowerShell 放行,以及「专注助手」是否开启。\n');
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
/** The configured default headings, exported for the CLI banner. */
|
|
45
|
+
export const SMOKE_TITLES = DEFAULTS.titles;
|
|
46
|
+
/**
|
|
47
|
+
* Whether this module is the process entry point.
|
|
48
|
+
* @returns true when argv[1] resolves to this module.
|
|
49
|
+
*/
|
|
50
|
+
function invokedAsScript() {
|
|
51
|
+
const entry = process.argv[1];
|
|
52
|
+
if (entry === undefined)
|
|
53
|
+
return false;
|
|
54
|
+
try {
|
|
55
|
+
const self = realpathSync(fileURLToPath(import.meta.url));
|
|
56
|
+
const invoked = realpathSync(resolve(entry));
|
|
57
|
+
return process.platform === 'win32' ? self.toLowerCase() === invoked.toLowerCase() : self === invoked;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (invokedAsScript()) {
|
|
64
|
+
process.exitCode = runSmoke(process.argv.slice(2));
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=smoke.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smoke.js","sourceRoot":"","sources":["../../src/smoke.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAEvD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAuB;IAC9C,MAAM,GAAG,GAAG,aAAa,CAAC,SAAS,CAAC,CAAA;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE;QACvC,CAAC,CAAC,iDAAiD;QAC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AoE;AACpE,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAA;AAE3C;;;GAGG;AACH,SAAS,eAAe;IACtB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC7B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAA;IACrC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,YAAY,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;QACzD,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;QAC5C,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAA;IACvG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,IAAI,eAAe,EAAE,EAAE,CAAC;IACtB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACpD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vanadium-23/dsh-ping",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Desktop notifications for DeepSeek Harness: a Windows toast (plus console line and optional webhook) the moment a turn finishes, an agent errors, or the agent is waiting on your approval or answer",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Niobium-41-nb/dsh-ping.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "lib/index.js",
|
|
12
|
+
"types": "lib/types/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./lib/types/index.d.ts",
|
|
16
|
+
"default": "./lib/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./smoke": "./lib/smoke.js",
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"bin": {
|
|
22
|
+
"dsh-ping": "./bin/dsh-ping.mjs"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"lib",
|
|
26
|
+
"bin",
|
|
27
|
+
"cordis.patch.yml",
|
|
28
|
+
"README.md",
|
|
29
|
+
"DESIGN.md"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@deepseek-ai/schemastery": "^3.18.2"
|
|
36
|
+
},
|
|
37
|
+
"peerDependenciesMeta": {
|
|
38
|
+
"@deepseek-ai/schemastery": {
|
|
39
|
+
"optional": true
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
44
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
45
|
+
"@types/node": "^22.20.0",
|
|
46
|
+
"tsdown": "^0.22.2",
|
|
47
|
+
"typescript": "^6.0.3"
|
|
48
|
+
},
|
|
49
|
+
"dsh": {
|
|
50
|
+
"bundle": {
|
|
51
|
+
"patch": "./cordis.patch.yml"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"dsh",
|
|
56
|
+
"deepseek-harness",
|
|
57
|
+
"cordis",
|
|
58
|
+
"notification",
|
|
59
|
+
"toast",
|
|
60
|
+
"windows",
|
|
61
|
+
"attention"
|
|
62
|
+
],
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
}
|
|
66
|
+
}
|