dsh-dafeiyu-emotion 0.2.6 → 0.2.8
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/CHANGELOG.md +12 -1
- package/README.md +3 -3
- package/docs/MARKETPLACE.md +1 -1
- package/docs/RELEASE-0.2.7.md +15 -0
- package/docs/RELEASE-0.2.8.md +16 -0
- package/package.json +1 -1
- package/scripts/test-analyze-handler.mjs +4 -1
- package/scripts/test-config-schema.mjs +27 -1
- package/src/index.js +27 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.8
|
|
4
|
+
|
|
5
|
+
- Fixed `backendRoot` showing as `[object Object]` on the settings page. DSH projects volatile `Config` fields as `{ get() }` refs; `readSettings()` and `resolveOptions()` now unwrap them before path/string/number handling.
|
|
6
|
+
- Added `plainConfig` regression coverage so a volatile ref can never be stringified into a fake path again.
|
|
7
|
+
|
|
8
|
+
## 0.2.7
|
|
9
|
+
|
|
10
|
+
- Fixed a host activation failure: `apply` read `ctx.settings` while the plugin only declared `webServer`. Cordis throws `cannot get property "settings" without inject`, so the whole host plugin failed to mount and `/plugins/dsh-dafeiyu-emotion/config` returned 404.
|
|
11
|
+
- Added `settings` to the declared inject list so the host can mount and register the health, analyze and config routes.
|
|
12
|
+
- Added a regression assertion that both `webServer` and `settings` are declared dependencies.
|
|
13
|
+
|
|
3
14
|
## 0.2.6
|
|
4
15
|
|
|
5
16
|
- Fixed a blocking `Config` validation error: the 12 MiB `maxAudioBytes` default violated the old 1 MiB step relative to the 256 KiB minimum. Removed the schema step so the shipped default and the settings inputs validate.
|
|
@@ -17,7 +28,7 @@
|
|
|
17
28
|
|
|
18
29
|
- Exported the Schemastery `Config` schema so DSH can persist setting changes from the panel.
|
|
19
30
|
- Marked every config field volatile, matching the DSH settings service contract.
|
|
20
|
-
- 0.2.4 shipped the settings UI; on hosts that require a registered volatile schema, saving failed.
|
|
31
|
+
- 0.2.4 shipped the settings UI; on hosts that require a registered volatile schema, saving failed. 0.2.5 added the schema but its 1 MiB step rejected the 12 MiB default; install 0.2.6 instead.
|
|
21
32
|
|
|
22
33
|
## 0.2.4
|
|
23
34
|
|
package/README.md
CHANGED
|
@@ -111,9 +111,9 @@ dsh plugin --profile desktop add github:LiDu-china/dsh-dafeiyu-emotion
|
|
|
111
111
|
### 通过 Release tarball
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
curl -L -o dsh-dafeiyu-emotion-0.2.
|
|
115
|
-
https://github.com/LiDu-china/dsh-dafeiyu-emotion/releases/download/v0.2.
|
|
116
|
-
dsh plugin --profile desktop add "D:/path/to/dsh-dafeiyu-emotion-0.2.
|
|
114
|
+
curl -L -o dsh-dafeiyu-emotion-0.2.8.tgz \
|
|
115
|
+
https://github.com/LiDu-china/dsh-dafeiyu-emotion/releases/download/v0.2.8/dsh-dafeiyu-emotion-0.2.8.tgz
|
|
116
|
+
dsh plugin --profile desktop add "D:/path/to/dsh-dafeiyu-emotion-0.2.8.tgz"
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
> DSH Desktop 的 profile 由 Electron 应用管理;命令行安装请使用桌面应用自带的 `dsh` 命令。
|
package/docs/MARKETPLACE.md
CHANGED
|
@@ -72,7 +72,7 @@ https://github.com/LiDu-china/dsh-dafeiyu-emotion/releases/download/v0.2.3/dsh-d
|
|
|
72
72
|
dsh plugin --profile desktop add dsh-dafeiyu-emotion
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
Published as `dsh-dafeiyu-emotion@0.2.
|
|
75
|
+
Published as `dsh-dafeiyu-emotion@0.2.8` on npm. The 1024Store entry refreshes its one-click install automatically. GitHub-source and Release-tarball installs remain available as fallbacks.
|
|
76
76
|
|
|
77
77
|
## Privacy
|
|
78
78
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## 0.2.7
|
|
2
|
+
|
|
3
|
+
修复设置页显示“设置暂时不可用 / 读取设置失败(404)”的 Host 激活问题。
|
|
4
|
+
|
|
5
|
+
- 0.2.5/0.2.6 在 `apply` 中读取了 `ctx.settings`,但插件只声明了 `webServer` 依赖。Cordis 会抛 `cannot get property "settings" without inject`,导致整个 Host 插件没有挂载,`/plugins/dsh-dafeiyu-emotion/config` 返回 404。
|
|
6
|
+
- 0.2.7 把 `settings` 加入声明依赖,Host 现在可以正常注册 health、analyze 和 config 路由。
|
|
7
|
+
- 新增回归断言:`webServer` 和 `settings` 必须同时出现在 `inject` 中。
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
dsh plugin --profile desktop add dsh-dafeiyu-emotion
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
升级后请完全退出并重新启动 the agent harness,让 Host 重新加载插件。
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## 0.2.8
|
|
2
|
+
|
|
3
|
+
修复设置页把增强后端目录显示成 `[object Object]` 的问题。
|
|
4
|
+
|
|
5
|
+
- DSH 的 settings 服务会把 `Config` 的 volatile 字段投影成 `{ get() }` 引用。
|
|
6
|
+
- 0.2.7 直接对引用做 `String()`,得到 `[object Object]`,再被 `resolve()` 拼成 `C:\...\profiles\desktop\[object Object]`,于是状态卡显示“后端目录不存在”。
|
|
7
|
+
- 0.2.8 在 `readSettings()` 和 `resolveOptions()` 中统一用 `plainConfig()` 递归解包,再处理路径、语言和数字。
|
|
8
|
+
- 新增回归测试,确保 volatile ref 不会被字符串化成假路径。
|
|
9
|
+
|
|
10
|
+
## 安装
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
dsh plugin --profile desktop add dsh-dafeiyu-emotion
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
升级后请完全退出并重新启动 the agent harness,让 Host 重新读取 0.2.8。
|
package/package.json
CHANGED
|
@@ -2,7 +2,10 @@ import assert from 'node:assert/strict'
|
|
|
2
2
|
import { EventEmitter } from 'node:events'
|
|
3
3
|
import { Readable } from 'node:stream'
|
|
4
4
|
|
|
5
|
-
import { apply } from '../src/index.js'
|
|
5
|
+
import { apply, inject } from '../src/index.js'
|
|
6
|
+
|
|
7
|
+
assert.ok(inject.includes('webServer'), 'webServer must be a declared dependency')
|
|
8
|
+
assert.ok(inject.includes('settings'), 'settings must be a declared dependency')
|
|
6
9
|
|
|
7
10
|
const ANALYZE = '/plugins/dsh-dafeiyu-emotion/analyze'
|
|
8
11
|
const HEALTH = '/plugins/dsh-dafeiyu-emotion/health'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import assert from 'node:assert/strict'
|
|
2
2
|
|
|
3
|
-
import { Config } from '../src/index.js'
|
|
3
|
+
import { Config, plainConfig, resolveOptions } from '../src/index.js'
|
|
4
4
|
|
|
5
5
|
// The DSH settings service parses the schema with its defaults before a plugin
|
|
6
6
|
// row can become configurable. A default that violates its own step/min/max
|
|
@@ -50,4 +50,30 @@ assert.throws(
|
|
|
50
50
|
'unknown languages must be rejected by the schema',
|
|
51
51
|
)
|
|
52
52
|
|
|
53
|
+
// DSH projects volatile fields as { get() } refs. They must be unwrapped
|
|
54
|
+
// before path resolution; otherwise backendRoot becomes "[object Object]".
|
|
55
|
+
{
|
|
56
|
+
const ref = (value) => ({ get: () => value })
|
|
57
|
+
assert.deepEqual(
|
|
58
|
+
plainConfig({
|
|
59
|
+
backendRoot: ref('D:/voice-sense'),
|
|
60
|
+
nested: { language: ref('auto') },
|
|
61
|
+
}),
|
|
62
|
+
{
|
|
63
|
+
backendRoot: 'D:/voice-sense',
|
|
64
|
+
nested: { language: 'auto' },
|
|
65
|
+
},
|
|
66
|
+
)
|
|
67
|
+
const options = resolveOptions({
|
|
68
|
+
backendRoot: ref('D:/voice-sense'),
|
|
69
|
+
pythonPath: ref(''),
|
|
70
|
+
language: ref('auto'),
|
|
71
|
+
maxAudioBytes: ref(8 * 1024 * 1024),
|
|
72
|
+
})
|
|
73
|
+
assert.equal(options.backendRoot.includes('[object Object]'), false)
|
|
74
|
+
assert.ok(options.backendRoot.endsWith('voice-sense'))
|
|
75
|
+
assert.equal(options.language, 'auto')
|
|
76
|
+
assert.equal(options.maxAudioBytes, 8 * 1024 * 1024)
|
|
77
|
+
}
|
|
78
|
+
|
|
53
79
|
console.log('config schema tests passed')
|
package/src/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { fileURLToPath } from 'node:url'
|
|
|
8
8
|
import Schema from '@deepseek-ai/schemastery'
|
|
9
9
|
|
|
10
10
|
export const name = 'dsh-dafeiyu-emotion'
|
|
11
|
-
export const inject = ['webServer']
|
|
11
|
+
export const inject = ['webServer', 'settings']
|
|
12
12
|
|
|
13
13
|
const ANALYZE_ENDPOINT = '/plugins/dsh-dafeiyu-emotion/analyze'
|
|
14
14
|
const HEALTH_ENDPOINT = '/plugins/dsh-dafeiyu-emotion/health'
|
|
@@ -137,17 +137,32 @@ function asNumber(value, fallback) {
|
|
|
137
137
|
return Number.isFinite(numeric) ? numeric : fallback
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* DSH settings projects volatile Config fields as live refs (`{ get() }`).
|
|
142
|
+
* Unwrap them before path/string/number handling, otherwise String(ref)
|
|
143
|
+
* becomes "[object Object]" and a path is resolved into the profile cwd.
|
|
144
|
+
*/
|
|
145
|
+
function plainConfig(value) {
|
|
146
|
+
if (value && typeof value.get === 'function') return plainConfig(value.get())
|
|
147
|
+
if (Array.isArray(value)) return value.map(plainConfig)
|
|
148
|
+
if (value && typeof value === 'object') {
|
|
149
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, plainConfig(child)]))
|
|
150
|
+
}
|
|
151
|
+
return value
|
|
152
|
+
}
|
|
153
|
+
|
|
140
154
|
function resolveOptions(raw = {}) {
|
|
155
|
+
const value = plainConfig(raw)
|
|
141
156
|
return {
|
|
142
|
-
enabled:
|
|
143
|
-
backendRoot: String(
|
|
144
|
-
? resolve(String(
|
|
157
|
+
enabled: value.enabled !== false,
|
|
158
|
+
backendRoot: String(value.backendRoot || process.env.DSH_DAFEIYU_EMOTION_BACKEND || DEFAULTS.backendRoot).trim()
|
|
159
|
+
? resolve(String(value.backendRoot || process.env.DSH_DAFEIYU_EMOTION_BACKEND || DEFAULTS.backendRoot))
|
|
145
160
|
: '',
|
|
146
|
-
pythonPath: String(
|
|
147
|
-
language: ['zh', 'en', 'auto'].includes(
|
|
148
|
-
maxAudioBytes: Math.min(32 * 1024 * 1024, Math.max(256 * 1024, asNumber(
|
|
149
|
-
startupTimeoutMs: Math.min(600000, Math.max(10000, asNumber(
|
|
150
|
-
requestTimeoutMs: Math.min(600000, Math.max(10000, asNumber(
|
|
161
|
+
pythonPath: String(value.pythonPath || '').trim(),
|
|
162
|
+
language: ['zh', 'en', 'auto'].includes(value.language) ? value.language : DEFAULTS.language,
|
|
163
|
+
maxAudioBytes: Math.min(32 * 1024 * 1024, Math.max(256 * 1024, asNumber(value.maxAudioBytes, DEFAULTS.maxAudioBytes))),
|
|
164
|
+
startupTimeoutMs: Math.min(600000, Math.max(10000, asNumber(value.startupTimeoutMs, DEFAULTS.startupTimeoutMs))),
|
|
165
|
+
requestTimeoutMs: Math.min(600000, Math.max(10000, asNumber(value.requestTimeoutMs, DEFAULTS.requestTimeoutMs))),
|
|
151
166
|
}
|
|
152
167
|
}
|
|
153
168
|
|
|
@@ -209,7 +224,7 @@ function readSettings(service) {
|
|
|
209
224
|
try {
|
|
210
225
|
const entry = service.describe().find((row) => row?.ns === SETTINGS_NAMESPACE)
|
|
211
226
|
if (!entry) return null
|
|
212
|
-
return { ...(entry.value || {}), ...(entry.user || {}) }
|
|
227
|
+
return plainConfig({ ...(entry.value || {}), ...(entry.user || {}) })
|
|
213
228
|
} catch {
|
|
214
229
|
return null
|
|
215
230
|
}
|
|
@@ -1032,6 +1047,8 @@ export {
|
|
|
1032
1047
|
createConfigHandler,
|
|
1033
1048
|
decorateAnalysis,
|
|
1034
1049
|
normalizeConfigPatch,
|
|
1050
|
+
plainConfig,
|
|
1035
1051
|
publicConfig,
|
|
1052
|
+
resolveOptions,
|
|
1036
1053
|
transcribeWithSpeech,
|
|
1037
1054
|
}
|