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

@ -1,6 +1,7 @@
// src/index.ts // src/index.ts
import z from "@deepseek-ai/schemastery"; import z from "@deepseek-ai/schemastery";
import { credentialRef } from "@deepseek-ai/dsh-credentials"; import { credentialRef } from "@deepseek-ai/dsh-credentials";
import { installSettingsSection } from "@deepseek-ai/dsh-settings";
import * as McpClient from "@deepseek-ai/dsh-mcp-client"; import * as McpClient from "@deepseek-ai/dsh-mcp-client";
var name = "netxops"; var name = "netxops";
var inject = ["tools"]; var inject = ["tools"];
@ -69,8 +70,7 @@ function apply(ctx, config = Config2({})) {
}); });
}; };
remount(); remount();
ctx.inject(["settings"], (settingsCtx) => { installSettingsSection(ctx, NETXOPS_SETTINGS_NAMESPACE, Config2, config, {
settingsCtx.settings.installSection(ctx, NETXOPS_SETTINGS_NAMESPACE, Config2, config, {
setSource: (current) => { setSource: (current) => {
source = current; source = current;
}, },
@ -78,7 +78,6 @@ function apply(ctx, config = Config2({})) {
remount(); remount();
} }
}); });
});
ctx.on("credentials/reference-updated", (ref) => { ctx.on("credentials/reference-updated", (ref) => {
if (String(ref) === source().tokenCredentialRef) if (String(ref) === source().tokenCredentialRef)
remount(); remount();

View file

@ -1,6 +1,6 @@
{ {
"name": "dsh-netxops", "name": "dsh-netxops",
"version": "0.1.8", "version": "0.1.9",
"description": "DeepSeek Harness Netx Ops: host bridge + Plugins settings card + agent preset", "description": "DeepSeek Harness Netx Ops: host bridge + Plugins settings card + agent preset",
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",

View file

@ -13,6 +13,7 @@ import type { Context, Fiber } from '@deepseek-ai/cordis'
import z from '@deepseek-ai/schemastery' import z from '@deepseek-ai/schemastery'
import { credentialRef } from '@deepseek-ai/dsh-credentials' import { credentialRef } from '@deepseek-ai/dsh-credentials'
import type {} 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 type {} from '@deepseek-ai/dsh-settings'
import * as McpClient from '@deepseek-ai/dsh-mcp-client' import * as McpClient from '@deepseek-ai/dsh-mcp-client'
@ -118,8 +119,10 @@ export function apply(ctx: Context, config: Config = Config({})): void {
// Composition defaults first (works even when settings provider is absent). // Composition defaults first (works even when settings provider is absent).
remount() remount()
ctx.inject(['settings'], (settingsCtx) => { // Shipped dsh 0.1.1-rc.2 exports the standalone helper; SettingsProvider has
settingsCtx.settings.installSection(ctx, NETXOPS_SETTINGS_NAMESPACE, Config, config, { // 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) => { setSource: (current) => {
source = current source = current
}, },
@ -127,7 +130,6 @@ export function apply(ctx: Context, config: Config = Config({})): void {
remount() remount()
}, },
}) })
})
ctx.on('credentials/reference-updated', (ref) => { ctx.on('credentials/reference-updated', (ref) => {
if (String(ref) === source().tokenCredentialRef) remount() if (String(ref) === source().tokenCredentialRef) remount()