@telosmaylx/dsh-session-notify 0.1.11 → 0.1.13
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/README.en.md +21 -31
- package/README.ja.md +21 -31
- package/README.ko.md +21 -31
- package/README.md +21 -31
- package/README.zh-TW.md +21 -31
- package/lib/client.js +2451 -2220
- package/package.json +74 -74
- package/scripts/tmp-i18n-check.mjs +0 -70
package/package.json
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@telosmaylx/dsh-session-notify",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "DSH session completion notifier: appends a plugin system message to the session log on turn/end and pushes browser notifications (Web Notification + toast), with a fully customizable official settings panel (presets, 5-language templates, cache-hit rate & tok/s from official projections).",
|
|
5
|
-
"private": false,
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "./lib/index.js",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"default": "./lib/index.js"
|
|
11
|
-
},
|
|
12
|
-
"./client": {
|
|
13
|
-
"default": "./lib/client.js"
|
|
14
|
-
},
|
|
15
|
-
"./core": {
|
|
16
|
-
"default": "./lib/core.js"
|
|
17
|
-
},
|
|
18
|
-
"./package.json": "./package.json"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"lib",
|
|
22
|
-
"scripts",
|
|
23
|
-
"cordis.patch.yml",
|
|
24
|
-
"README.md",
|
|
25
|
-
"README.en.md",
|
|
26
|
-
"README.zh-TW.md",
|
|
27
|
-
"README.ja.md",
|
|
28
|
-
"README.ko.md",
|
|
29
|
-
"LICENSE"
|
|
30
|
-
],
|
|
31
|
-
"publishConfig": {
|
|
32
|
-
"access": "public"
|
|
33
|
-
},
|
|
34
|
-
"keywords": [
|
|
35
|
-
"deepseek-harness",
|
|
36
|
-
"dsh",
|
|
37
|
-
"dsh-plugin",
|
|
38
|
-
"session-notify",
|
|
39
|
-
"notification",
|
|
40
|
-
"completion-reminder",
|
|
41
|
-
"agent"
|
|
42
|
-
],
|
|
43
|
-
"author": "dsh-session-notify contributors",
|
|
44
|
-
"license": "MIT",
|
|
45
|
-
"repository": {
|
|
46
|
-
"type": "git",
|
|
47
|
-
"url": "git+https://github.com/TelosmaYLX/dsh-session-notify.git"
|
|
48
|
-
},
|
|
49
|
-
"homepage": "https://github.com/TelosmaYLX/dsh-session-notify#readme",
|
|
50
|
-
"bugs": {
|
|
51
|
-
"url": "https://github.com/TelosmaYLX/dsh-session-notify/issues"
|
|
52
|
-
},
|
|
53
|
-
"peerDependencies": {
|
|
54
|
-
"cordis": ">=4.0.0-rc <5"
|
|
55
|
-
},
|
|
56
|
-
"engines": {
|
|
57
|
-
"node": ">=22"
|
|
58
|
-
},
|
|
59
|
-
"dsh": {
|
|
60
|
-
"bundle": {
|
|
61
|
-
"patch": "./cordis.patch.yml"
|
|
62
|
-
},
|
|
63
|
-
"client": {
|
|
64
|
-
"inject": [
|
|
65
|
-
"@deepseek-ai/dsh-client-runtime"
|
|
66
|
-
],
|
|
67
|
-
"platform": "web"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
"scripts": {
|
|
71
|
-
"build": "bash scripts/build.sh || node --check lib/index.js && node --check lib/core.js && node --check lib/client.js",
|
|
72
|
-
"prepublishOnly": "node --check lib/index.js && node --check lib/core.js && node --check lib/client.js"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@telosmaylx/dsh-session-notify",
|
|
3
|
+
"version": "0.1.13",
|
|
4
|
+
"description": "DSH session completion notifier: appends a plugin system message to the session log on turn/end and pushes browser notifications (Web Notification + toast), with a fully customizable official settings panel (presets, 5-language templates, cache-hit rate & tok/s from official projections).",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./lib/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"default": "./lib/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./client": {
|
|
13
|
+
"default": "./lib/client.js"
|
|
14
|
+
},
|
|
15
|
+
"./core": {
|
|
16
|
+
"default": "./lib/core.js"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"lib",
|
|
22
|
+
"scripts",
|
|
23
|
+
"cordis.patch.yml",
|
|
24
|
+
"README.md",
|
|
25
|
+
"README.en.md",
|
|
26
|
+
"README.zh-TW.md",
|
|
27
|
+
"README.ja.md",
|
|
28
|
+
"README.ko.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"deepseek-harness",
|
|
36
|
+
"dsh",
|
|
37
|
+
"dsh-plugin",
|
|
38
|
+
"session-notify",
|
|
39
|
+
"notification",
|
|
40
|
+
"completion-reminder",
|
|
41
|
+
"agent"
|
|
42
|
+
],
|
|
43
|
+
"author": "dsh-session-notify contributors",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/TelosmaYLX/dsh-session-notify.git"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://github.com/TelosmaYLX/dsh-session-notify#readme",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/TelosmaYLX/dsh-session-notify/issues"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"cordis": ">=4.0.0-rc <5"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=22"
|
|
58
|
+
},
|
|
59
|
+
"dsh": {
|
|
60
|
+
"bundle": {
|
|
61
|
+
"patch": "./cordis.patch.yml"
|
|
62
|
+
},
|
|
63
|
+
"client": {
|
|
64
|
+
"inject": [
|
|
65
|
+
"@deepseek-ai/dsh-client-runtime"
|
|
66
|
+
],
|
|
67
|
+
"platform": "web"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"scripts": {
|
|
71
|
+
"build": "bash scripts/build.sh || node --check lib/index.js && node --check lib/core.js && node --check lib/client.js",
|
|
72
|
+
"prepublishOnly": "node --check lib/index.js && node --check lib/core.js && node --check lib/client.js"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// 检查 5 语言 i18n 键一致性:解析 lib/client.js 的 5 个语言块,对比键集合与空值
|
|
2
|
-
import { readFileSync } from 'node:fs'
|
|
3
|
-
|
|
4
|
-
const src = readFileSync('lib/client.js', 'utf8')
|
|
5
|
-
const lines = src.split('\n')
|
|
6
|
-
|
|
7
|
-
// 找到每个语言块的起始行
|
|
8
|
-
const LANG_KEYS = ['zh', "'zh-tw'", 'en', 'ja', 'ko']
|
|
9
|
-
const blocks = {}
|
|
10
|
-
for (let i = 0; i < lines.length; i++) {
|
|
11
|
-
const m = /^\s*(?:'([a-z-]+)'|([a-z]+))\s*:\s*\{/.exec(lines[i])
|
|
12
|
-
if (m) {
|
|
13
|
-
const key = m[1] || m[2]
|
|
14
|
-
// 只收集 I18N 主块(在 i18n 区域 40-180 行附近,避免误抓其他对象)
|
|
15
|
-
if (i < 200 && (LANG_KEYS.includes("'" + key + "'") || LANG_KEYS.includes(key))) {
|
|
16
|
-
// 读取到闭合的 }, 或 }, 或 }, 或
|
|
17
|
-
let block = ''
|
|
18
|
-
let j = i
|
|
19
|
-
let depth = 0
|
|
20
|
-
let started = false
|
|
21
|
-
for (; j < lines.length; j++) {
|
|
22
|
-
const l = lines[j]
|
|
23
|
-
for (const ch of l) {
|
|
24
|
-
if (ch === '{') { depth++; started = true }
|
|
25
|
-
else if (ch === '}') depth--
|
|
26
|
-
}
|
|
27
|
-
block += l + '\n'
|
|
28
|
-
if (started && depth <= 0) break
|
|
29
|
-
}
|
|
30
|
-
blocks[key] = block
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (Object.keys(blocks).length < 5) {
|
|
36
|
-
console.log('FAIL: 只找到语言块:', Object.keys(blocks))
|
|
37
|
-
process.exit(1)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// 提取键:匹配 key: 'value' 或 key: "value"(含嵌套对象如 fields: {...} —— 只取顶层键)
|
|
41
|
-
function extractKeys(block) {
|
|
42
|
-
const keys = new Set()
|
|
43
|
-
const re = /^\s*([A-Za-z][A-Za-z0-9]*)\s*:/gm
|
|
44
|
-
let m
|
|
45
|
-
while ((m = re.exec(block))) keys.add(m[1])
|
|
46
|
-
// 去掉块首行(语言名,如 "zh: {" / "'zh-tw': {")
|
|
47
|
-
keys.delete('zh'); keys.delete('en'); keys.delete('ja'); keys.delete('ko')
|
|
48
|
-
return keys
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const zhKeys = extractKeys(blocks['zh'])
|
|
52
|
-
console.log('zh 键数量:', zhKeys.size)
|
|
53
|
-
|
|
54
|
-
let allOk = true
|
|
55
|
-
for (const lang of ['zh-tw', 'en', 'ja', 'ko']) {
|
|
56
|
-
const k = extractKeys(blocks[lang])
|
|
57
|
-
const missing = [...zhKeys].filter((x) => !k.has(x))
|
|
58
|
-
const extra = [...k].filter((x) => !zhKeys.has(x))
|
|
59
|
-
console.log(`\n[${lang}] 键数 ${k.size}`)
|
|
60
|
-
if (missing.length) { console.log(' 缺少(相对zh):', missing.join(', ')); allOk = false }
|
|
61
|
-
if (extra.length) console.log(' 多余(相对zh):', extra.join(', '))
|
|
62
|
-
// 检查关键值是否为空
|
|
63
|
-
for (const key of [...zhKeys]) {
|
|
64
|
-
const vm = new RegExp('\\b' + key + '\\s*:\\s*([\'"])(.*?)\\1').exec(blocks[lang])
|
|
65
|
-
if (vm && vm[2] === '' ) { console.log(` [${lang}] 键 ${key} 值为空!`); allOk = false }
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
console.log('\n===== i18n 键一致性: ' + (allOk ? 'PASS' : 'FAIL') + ' =====')
|
|
70
|
-
process.exit(allOk ? 0 : 1)
|