dsh-voice-mode 0.7.44 → 0.7.45
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 +9 -7
- package/README.md +9 -7
- package/SECURITY.md +1 -1
- package/THIRD_PARTY_NOTICES.md +31 -2
- package/lib/client.js +316 -191
- package/lib/index.js +1304 -609
- package/lib/tts-vits-worker.cjs +1 -1
- package/package.json +3 -2
- package/scripts/check-anchors.mjs +42 -3
package/lib/tts-vits-worker.cjs
CHANGED
|
@@ -25,7 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
// src/tts-vits-worker.ts
|
|
26
26
|
var import_sherpa_onnx = __toESM(require("sherpa-onnx"), 1);
|
|
27
27
|
|
|
28
|
-
//
|
|
28
|
+
// node_modules/.pnpm/@voice-mode+core@file+vendor+voice-mode-core-0.1.0.tgz/node_modules/@voice-mode/core/dist/segmenter.js
|
|
29
29
|
function sanitizeForTts(text) {
|
|
30
30
|
return String(text).replace(/[*_#|^=+~`]/g, " ").replace(/\s{2,}/g, " ").replace(/([\u3400-\u9fff])\s+(?=[\u3400-\u9fff])/g, "$1").trim();
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/qishuilalala"
|
|
7
7
|
},
|
|
8
8
|
"icon": "./icon.svg",
|
|
9
|
-
"version": "0.7.
|
|
9
|
+
"version": "0.7.45",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"main": "lib/index.js",
|
|
12
12
|
"types": "./lib/index.d.ts",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"sherpa-onnx-node": "1.13.6"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
|
-
"@deepseek-ai/cordis": "^4.0.1",
|
|
101
|
+
"@deepseek-ai/cordis": "^4.0.1 || ^4.2.0-alpha.1",
|
|
102
102
|
"react": "^18.2.0"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
"@deepseek-ai/dsh-system-prompt": "0.1.5-rc.3",
|
|
110
110
|
"@types/node": "^26.6.5",
|
|
111
111
|
"@types/react": "^19.3.0",
|
|
112
|
+
"@voice-mode/core": "file:./vendor/voice-mode-core-0.1.0.tgz",
|
|
112
113
|
"esbuild": "^0.28.2",
|
|
113
114
|
"msedge-tts": "^2.1.1",
|
|
114
115
|
"playwright-core": "1.65.1",
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
* 上是否存在(默认 0.1.1-rc.2 与 0.1.2-alpha.4)。
|
|
6
6
|
*
|
|
7
7
|
* 目的:dsh 每次 minor 升级都可能删/改客户端锚点包(0.1.1→0.1.2 已删 dsh-client-runtime、
|
|
8
|
-
* 降级 dsh-client-ui-slots
|
|
9
|
-
*
|
|
8
|
+
* 降级 dsh-client-ui-slots;0.2.3 线起 dsh-client-ui-settings-plugins 停发)。升级 dsh 前先跑本脚本,
|
|
9
|
+
* 若某个锚点在新版本线缺失,脚本非零退出并点名,避免「升级后客户端静默挂不上」。
|
|
10
|
+
*
|
|
11
|
+
* 已登记例外(KNOWN_ABSENT):为兼容旧宿主而**必须保留**的 inject 条目,在上游某条版本线
|
|
12
|
+
* 已停发。这类缺失按 ⚠ 提示、不判失败;未登记的缺失仍是 ❌ 失败。判据见 docs/compat-contract.md。
|
|
10
13
|
*
|
|
11
14
|
* 用法:
|
|
12
15
|
* node scripts/check-anchors.mjs [目标版本...]
|
|
@@ -38,9 +41,40 @@ const DEFAULT_TARGETS = [
|
|
|
38
41
|
'0.2.1-rc.5',
|
|
39
42
|
'0.2.2-rc.1',
|
|
40
43
|
'0.2.2-rc.5',
|
|
44
|
+
'0.2.3-alpha.2',
|
|
41
45
|
]
|
|
42
46
|
const targets = process.argv.slice(2).length ? process.argv.slice(2) : DEFAULT_TARGETS
|
|
43
47
|
|
|
48
|
+
/**
|
|
49
|
+
* 已登记的「锚点包在该版本线不再发布」例外。
|
|
50
|
+
* 条目保留 inject 是为了旧宿主(≤0.1.5 的 settings.plugin.item 由该包声明);新宿主缺包时
|
|
51
|
+
* 客户端按 system.ts 的 graphRows 静默跳过,实测不报错(见 compat-contract §32)。
|
|
52
|
+
*/
|
|
53
|
+
const KNOWN_ABSENT = [
|
|
54
|
+
{ anchor: '@deepseek-ai/dsh-client-ui-settings-plugins', from: '0.2.3-alpha.0', note: '0.2.3 线起停发;设置卡槽位改由 dsh-client-ui-plugin-manager 声明' },
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
/** 粗粒度版本比较:只比较数字段与预发布后缀的存在性,够用于「某线之后」判定。 */
|
|
58
|
+
function verKey(v) {
|
|
59
|
+
const m = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(v)
|
|
60
|
+
if (!m) return null
|
|
61
|
+
return { nums: [Number(m[1]), Number(m[2]), Number(m[3])], pre: m[4] ?? '' }
|
|
62
|
+
}
|
|
63
|
+
function atLeast(version, floor) {
|
|
64
|
+
const a = verKey(version), b = verKey(floor)
|
|
65
|
+
if (!a || !b) return false
|
|
66
|
+
for (let i = 0; i < 3; i++) {
|
|
67
|
+
if (a.nums[i] !== b.nums[i]) return a.nums[i] > b.nums[i]
|
|
68
|
+
}
|
|
69
|
+
if (a.pre === b.pre) return true
|
|
70
|
+
if (a.pre === '') return true // 正式版高于同号预发布
|
|
71
|
+
if (b.pre === '') return false
|
|
72
|
+
return a.pre.localeCompare(b.pre, 'en', { numeric: true }) >= 0
|
|
73
|
+
}
|
|
74
|
+
function registeredAbsent(anchor, target) {
|
|
75
|
+
return KNOWN_ABSENT.find((e) => e.anchor === anchor && atLeast(target, e.from)) ?? null
|
|
76
|
+
}
|
|
77
|
+
|
|
44
78
|
if (anchors.length === 0) {
|
|
45
79
|
console.error('package.json 未声明 dsh.client.inject 锚点')
|
|
46
80
|
process.exit(1)
|
|
@@ -76,12 +110,16 @@ for (const anchor of anchors) {
|
|
|
76
110
|
}
|
|
77
111
|
|
|
78
112
|
let failures = 0
|
|
113
|
+
let excused = 0
|
|
79
114
|
for (const target of targets) {
|
|
80
115
|
console.log(`\n=== 目标 dsh ${target} 下的锚点存在性 ===`)
|
|
81
116
|
for (const anchor of anchors) {
|
|
82
117
|
const versions = versionsByAnchor.get(anchor)
|
|
83
118
|
if (versions && versions.has(target)) {
|
|
84
119
|
console.log(` ✅ ${anchor} @ ${target}`)
|
|
120
|
+
} else if (registeredAbsent(anchor, target)) {
|
|
121
|
+
console.log(` ⚠ ${anchor} @ ${target} 未发布(已登记例外:${registeredAbsent(anchor, target).note})`)
|
|
122
|
+
excused++
|
|
85
123
|
} else {
|
|
86
124
|
console.error(` ❌ ${anchor} @ ${target} 不存在`)
|
|
87
125
|
failures++
|
|
@@ -93,4 +131,5 @@ if (failures > 0) {
|
|
|
93
131
|
console.error(`\n✗ 有 ${failures} 个锚点缺失:dsh.client.inject 需收敛为交集,或等待该包在新版本提供。`)
|
|
94
132
|
process.exit(1)
|
|
95
133
|
}
|
|
96
|
-
|
|
134
|
+
const excusedNote = excused > 0 ? `(另有 ${excused} 项已登记例外,见 KNOWN_ABSENT)` : ''
|
|
135
|
+
console.log(`\n✓ ${targets.length} 个目标版本的锚点检查通过${excusedNote}。`)
|