dsh-dafeiyu-emotion 0.2.8 → 0.2.10
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 +13 -0
- package/README.md +3 -3
- package/docs/MARKETPLACE.md +1 -1
- package/docs/RELEASE-0.2.10.md +20 -0
- package/docs/RELEASE-0.2.9.md +17 -0
- package/package.json +1 -1
- package/scripts/test-analyze-handler.mjs +15 -1
- package/scripts/test-config-schema.mjs +15 -0
- package/src/index.js +21 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.10
|
|
4
|
+
|
|
5
|
+
- Removed `settings` from the hard inject list. A hard `settings` dependency can deadlock host startup while the settings service is still building plugin `Config` projections.
|
|
6
|
+
- Settings are now resolved with `ctx.inject(['settings'], ...)` after the host is up; `/config` is read-only until then and becomes writable when the service arrives.
|
|
7
|
+
- Added a regression assertion that `settings` is not a hard dependency.
|
|
8
|
+
|
|
9
|
+
## 0.2.9
|
|
10
|
+
|
|
11
|
+
- Fixed the host startup timeout: `apply` synchronously called `settings.describe()` while the host was still mounting plugins, which could deadlock startup for 60 seconds.
|
|
12
|
+
- `apply` now uses the patch config only; settings are read/written through `/config` after the host is up.
|
|
13
|
+
- Added cycle/depth guards to `plainConfig()` so an unexpected volatile-ref cycle cannot hang startup or a settings request.
|
|
14
|
+
- Added a regression test where `settings.describe()` throws if called during `apply`.
|
|
15
|
+
|
|
3
16
|
## 0.2.8
|
|
4
17
|
|
|
5
18
|
- 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.
|
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.10.tgz \
|
|
115
|
+
https://github.com/LiDu-china/dsh-dafeiyu-emotion/releases/download/v0.2.10/dsh-dafeiyu-emotion-0.2.10.tgz
|
|
116
|
+
dsh plugin --profile desktop add "D:/path/to/dsh-dafeiyu-emotion-0.2.10.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.9` 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,20 @@
|
|
|
1
|
+
## 0.2.10
|
|
2
|
+
|
|
3
|
+
修复 Host 启动阶段的依赖死锁,并修正 volatile 配置解包。
|
|
4
|
+
|
|
5
|
+
- 移除 `settings` 硬依赖。改为 `ctx.inject(['settings'], ...)` 动态获取,避免 settings 服务尚未就绪时插件 fiber 一直 pending。
|
|
6
|
+
- `apply` 不再调用 `settings.describe()`,只在 `/config` 请求时读取运行时配置。
|
|
7
|
+
- `plainConfig()` 改为递归栈 + `finally` 清理,修复共享对象被误判为循环引用而丢失的问题。
|
|
8
|
+
- 新增共享引用、真实循环、`settings.describe()` 不应在启动阶段调用的回归测试。
|
|
9
|
+
|
|
10
|
+
## 注意
|
|
11
|
+
|
|
12
|
+
当前环境如果仍无法启动,请先确认 `magpie-mcp-git` / `magpie-mcp-anysearch` 没有阻塞 Host 启动。这两个 MCP 客户端在连接不可用时会等待重试,可能把 Host 启动拖过 60 秒。
|
|
13
|
+
|
|
14
|
+
## 安装
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
dsh plugin --profile desktop add dsh-dafeiyu-emotion
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
升级后请完全退出并重新启动 the agent harness。
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## 0.2.9
|
|
2
|
+
|
|
3
|
+
修复“the agent harness 打不开 / Host startup exceeded 60 seconds”。
|
|
4
|
+
|
|
5
|
+
- 根因:0.2.8 在 `apply` 期间同步调用 `settings.describe()`。此时 Host 还在挂载插件,遍历所有插件配置可能造成启动死锁,最终 60 秒超时。
|
|
6
|
+
- 0.2.9 的 `apply` 只读取 `cordis.patch.yml` 的 patch 配置,不再在启动事务里调用 `settings.describe()`。
|
|
7
|
+
- 设置页的读取/写入仍通过 `/plugins/dsh-dafeiyu-emotion/config`;`PATCH` 会更新共享运行时配置并调用 `settings.update()` 持久化。
|
|
8
|
+
- `plainConfig()` 增加循环引用和深度保护,避免异常 volatile ref 卡死启动或设置请求。
|
|
9
|
+
- 新增回归测试:`settings.describe()` 在 `apply` 期间如果被调用会直接抛错。
|
|
10
|
+
|
|
11
|
+
## 安装
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
dsh plugin --profile desktop add dsh-dafeiyu-emotion
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
升级后请完全退出并重新启动 the agent harness。若之前因 0.2.8 无法启动,可先进入安全模式或临时移除插件,再安装 0.2.9。
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { Readable } from 'node:stream'
|
|
|
5
5
|
import { apply, inject } from '../src/index.js'
|
|
6
6
|
|
|
7
7
|
assert.ok(inject.includes('webServer'), 'webServer must be a declared dependency')
|
|
8
|
-
assert.
|
|
8
|
+
assert.equal(inject.includes('settings'), false, 'settings must be resolved dynamically, not as a hard dependency')
|
|
9
9
|
|
|
10
10
|
const ANALYZE = '/plugins/dsh-dafeiyu-emotion/analyze'
|
|
11
11
|
const HEALTH = '/plugins/dsh-dafeiyu-emotion/health'
|
|
@@ -14,6 +14,12 @@ function makeCtx(speechToText) {
|
|
|
14
14
|
const handlers = new Map()
|
|
15
15
|
const ctx = {
|
|
16
16
|
logger: { debug() {}, info() {}, error() {} },
|
|
17
|
+
settings: {
|
|
18
|
+
async update() {},
|
|
19
|
+
describe() {
|
|
20
|
+
throw new Error('settings.describe must not run during host startup')
|
|
21
|
+
},
|
|
22
|
+
},
|
|
17
23
|
effect(run) {
|
|
18
24
|
const dispose = run()
|
|
19
25
|
return typeof dispose === 'function' ? dispose : () => {}
|
|
@@ -40,6 +46,14 @@ function makeCtx(speechToText) {
|
|
|
40
46
|
return typeof dispose === 'function' ? dispose : () => {}
|
|
41
47
|
},
|
|
42
48
|
})
|
|
49
|
+
} else if (dependencies.includes('settings')) {
|
|
50
|
+
callback({
|
|
51
|
+
settings: ctx.settings,
|
|
52
|
+
effect(run) {
|
|
53
|
+
const dispose = run()
|
|
54
|
+
return typeof dispose === 'function' ? dispose : () => {}
|
|
55
|
+
},
|
|
56
|
+
})
|
|
43
57
|
}
|
|
44
58
|
},
|
|
45
59
|
}
|
|
@@ -74,6 +74,21 @@ assert.throws(
|
|
|
74
74
|
assert.ok(options.backendRoot.endsWith('voice-sense'))
|
|
75
75
|
assert.equal(options.language, 'auto')
|
|
76
76
|
assert.equal(options.maxAudioBytes, 8 * 1024 * 1024)
|
|
77
|
+
|
|
78
|
+
const shared = { x: 1 }
|
|
79
|
+
assert.deepEqual(
|
|
80
|
+
plainConfig({ a: shared, b: shared }),
|
|
81
|
+
{ a: { x: 1 }, b: { x: 1 } },
|
|
82
|
+
'a shared object must survive in both branches',
|
|
83
|
+
)
|
|
84
|
+
assert.deepEqual(
|
|
85
|
+
plainConfig({ a: [shared, shared] }),
|
|
86
|
+
{ a: [{ x: 1 }, { x: 1 }] },
|
|
87
|
+
'a shared array element must survive twice',
|
|
88
|
+
)
|
|
89
|
+
const cycle = {}
|
|
90
|
+
cycle.self = cycle
|
|
91
|
+
assert.deepEqual(plainConfig(cycle), { self: undefined }, 'a real cycle must be cut')
|
|
77
92
|
}
|
|
78
93
|
|
|
79
94
|
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']
|
|
12
12
|
|
|
13
13
|
const ANALYZE_ENDPOINT = '/plugins/dsh-dafeiyu-emotion/analyze'
|
|
14
14
|
const HEALTH_ENDPOINT = '/plugins/dsh-dafeiyu-emotion/health'
|
|
@@ -142,11 +142,18 @@ function asNumber(value, fallback) {
|
|
|
142
142
|
* Unwrap them before path/string/number handling, otherwise String(ref)
|
|
143
143
|
* becomes "[object Object]" and a path is resolved into the profile cwd.
|
|
144
144
|
*/
|
|
145
|
-
function plainConfig(value) {
|
|
146
|
-
if (
|
|
147
|
-
if (Array.isArray(value)) return value.map(plainConfig)
|
|
145
|
+
function plainConfig(value, stack = new WeakSet(), depth = 0) {
|
|
146
|
+
if (depth > 20) return undefined
|
|
148
147
|
if (value && typeof value === 'object') {
|
|
149
|
-
|
|
148
|
+
if (stack.has(value)) return undefined
|
|
149
|
+
stack.add(value)
|
|
150
|
+
try {
|
|
151
|
+
if (typeof value.get === 'function') return plainConfig(value.get(), stack, depth + 1)
|
|
152
|
+
if (Array.isArray(value)) return value.map((child) => plainConfig(child, stack, depth + 1))
|
|
153
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, plainConfig(child, stack, depth + 1)]))
|
|
154
|
+
} finally {
|
|
155
|
+
stack.delete(value)
|
|
156
|
+
}
|
|
150
157
|
}
|
|
151
158
|
return value
|
|
152
159
|
}
|
|
@@ -951,12 +958,16 @@ function createAnalyzeHandler(runtime, backend, getSpeechToText) {
|
|
|
951
958
|
|
|
952
959
|
export function apply(ctx, rawConfig = {}) {
|
|
953
960
|
const logger = ctx.logger ?? console
|
|
954
|
-
|
|
961
|
+
// Resolve settings through ctx.inject below instead of a hard dependency.
|
|
962
|
+
// A hard `settings` inject can deadlock host startup while the settings
|
|
963
|
+
// service is still building the plugin Config projections.
|
|
964
|
+
let settingsService
|
|
955
965
|
const runtime = {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
966
|
+
// Do not call settings.describe() here: this runs inside the host's
|
|
967
|
+
// startup transaction and describing every plugin can deadlock the host.
|
|
968
|
+
// The patch config is authoritative at mount time; PATCH updates the
|
|
969
|
+
// shared runtime object and settings.update persists it for the next boot.
|
|
970
|
+
options: resolveOptions(rawConfig),
|
|
960
971
|
}
|
|
961
972
|
const backend = new VoiceBackend(runtime.options, logger)
|
|
962
973
|
if (runtime.options.backendRoot && !existsSync(runtime.options.backendRoot)) {
|
|
@@ -965,11 +976,6 @@ export function apply(ctx, rawConfig = {}) {
|
|
|
965
976
|
let speechToText
|
|
966
977
|
ctx.inject(['settings'], (settingsCtx) => {
|
|
967
978
|
settingsService = settingsCtx.settings
|
|
968
|
-
const stored = readSettings(settingsService)
|
|
969
|
-
if (!stored) return
|
|
970
|
-
const before = { ...runtime.options }
|
|
971
|
-
Object.assign(runtime.options, resolveOptions({ ...runtime.options, ...stored }))
|
|
972
|
-
backend.syncOptions(before)
|
|
973
979
|
})
|
|
974
980
|
ctx.inject(['speechToText'], (speechCtx) => {
|
|
975
981
|
speechToText = speechCtx.speechToText
|