@mhfire/dsh-im-bridge 0.1.0 → 0.1.1
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/package.json +1 -1
- package/src/index.js +6 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -95,11 +95,13 @@ export function apply(ctx, config) {
|
|
|
95
95
|
const persona = resolvePersona(config)
|
|
96
96
|
|
|
97
97
|
// ── 设置命名空间: 用户可在 GUI 插件配置页 / settings.yaml 覆盖字段(热生效) ──
|
|
98
|
-
|
|
98
|
+
// 规范做法(与 @deepseek-ai/dsh-settings 的 installSettingsSection 一致):
|
|
99
|
+
// 用 ctx.inject(['settings'], cb) 延迟到 settings 服务可用时再注册,
|
|
100
|
+
// 避免 apply 时 settings 尚未挂载导致命名空间缺失(GUI 卡片显示"命名空间不可用")。
|
|
99
101
|
let scope
|
|
100
|
-
|
|
101
|
-
scope = settings.register('im-bridge', Config, { base: { ...config } })
|
|
102
|
-
}
|
|
102
|
+
ctx.inject(['settings'], (sctx) => {
|
|
103
|
+
scope = sctx.settings.register('im-bridge', Config, { base: { ...config } })
|
|
104
|
+
})
|
|
103
105
|
/** 有效配置: 默认值 → cordis patch(base) → 用户 settings.yaml, 热更新 */
|
|
104
106
|
const cfg = () => scope?.value ?? config
|
|
105
107
|
|