Register settings via installSettingsSection for shipped dsh.

SettingsProvider.installSection is not on 0.1.1-rc.2; without the standalone helper the netxops namespace never appears on the Plugins tab.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-04 22:51:50 +08:00
parent 99ded2fe2d
commit ca91031fd0
3 changed files with 20 additions and 19 deletions

View file

@ -13,6 +13,7 @@ import type { Context, Fiber } from '@deepseek-ai/cordis'
import z from '@deepseek-ai/schemastery'
import { credentialRef } from '@deepseek-ai/dsh-credentials'
import type {} from '@deepseek-ai/dsh-credentials'
import { installSettingsSection } from '@deepseek-ai/dsh-settings'
import type {} from '@deepseek-ai/dsh-settings'
import * as McpClient from '@deepseek-ai/dsh-mcp-client'
@ -118,15 +119,16 @@ export function apply(ctx: Context, config: Config = Config({})): void {
// Composition defaults first (works even when settings provider is absent).
remount()
ctx.inject(['settings'], (settingsCtx) => {
settingsCtx.settings.installSection(ctx, NETXOPS_SETTINGS_NAMESPACE, Config, config, {
setSource: (current) => {
source = current
},
onChange: () => {
remount()
},
})
// Shipped dsh 0.1.1-rc.2 exports the standalone helper; SettingsProvider has
// no `.installSection` method there. Newer cookbooks moved it onto the
// provider — keep the helper call so the Plugins tab can see `netxops`.
installSettingsSection(ctx, NETXOPS_SETTINGS_NAMESPACE, Config, config, {
setSource: (current) => {
source = current
},
onChange: () => {
remount()
},
})
ctx.on('credentials/reference-updated', (ref) => {