dsh-notify-yimit 0.1.9 → 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.
Files changed (2) hide show
  1. package/lib/index.js +15 -3
  2. package/package.json +4 -2
package/lib/index.js CHANGED
@@ -9,9 +9,7 @@ import {
9
9
  import {
10
10
  fileURLToPath
11
11
  } from 'node:url'
12
- import {
13
- resolveDshHome
14
- } from '@deepseek-ai/dsh-home-paths'
12
+ import os from 'node:os'
15
13
 
16
14
  export const name = 'dsh-notify-yimit'
17
15
 
@@ -216,6 +214,20 @@ function mergeConfigPatch(base, patch) {
216
214
  return out
217
215
  }
218
216
 
217
+ // 与宿主 @deepseek-ai/dsh-home-paths 同语义的本地实现。声明成依赖会让 pnpm 把该包
218
+ // 复制进 profile 的 node_modules,顶掉宿主自带的同名插件并破坏 settings namespace 注册。
219
+ function expandHomePath(target) {
220
+ if (target === '~') return os.homedir()
221
+ if (target.startsWith('~/') || target.startsWith('~\\')) return path.join(os.homedir(), target.slice(2))
222
+ return target
223
+ }
224
+
225
+ function resolveDshHome() {
226
+ const fromEnv = process.env.DSH_HOME
227
+ const selected = fromEnv !== void 0 && fromEnv.trim().length > 0 ? fromEnv : path.join(os.homedir(), '.dsh')
228
+ return path.resolve(expandHomePath(selected))
229
+ }
230
+
219
231
  function openConfig() {
220
232
  const home = resolveDshHome()
221
233
  const dir = path.join(home, 'storages', 'dsh-notify-yimit')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-notify-yimit",
3
- "version": "0.1.9",
3
+ "version": "0.2.0",
4
4
  "description": "DeepSeek Harness 通知插件:任务完成 / 任务出错 / 运行中(实时活动)/ 等待审批 / 等待回答 时,通过 Windows 系统通知或插件自定义样式通知提醒用户,支持点击跳转到对应会话;设置页集成在 DSH 设置界面。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -37,12 +37,14 @@
37
37
  "README.md",
38
38
  "README.en.md"
39
39
  ],
40
+ "scripts": {
41
+ "prepublishOnly": "node -e \"const bad = Object.keys(require('./package.json').dependencies || {}).filter((k) => k.startsWith('@deepseek-ai/')); if (bad.length) throw new Error('host packages belong in peerDependencies: ' + bad.join(', '))\""
42
+ },
40
43
  "repository": {
41
44
  "type": "git",
42
45
  "url": "https://github.com/YiMlT/dsh-notify-yimit"
43
46
  },
44
47
  "dependencies": {
45
- "@deepseek-ai/dsh-home-paths": ">=0.1.0-rc.6 <0.3.0-0",
46
48
  "zod": "^4.4.3"
47
49
  },
48
50
  "peerDependencies": {