Adapt settings client for DSH 0.2.0 configForms without breaking boot.

Soft-inject configForms/settingsScope and mark Config fields volatile so desktop 0.2.0 no longer waits forever on the removed settingsScope service.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-10-09 15:31:31 +08:00
parent 30d4df23fa
commit 9b8e873c18
8 changed files with 358 additions and 166 deletions

View file

@ -4,7 +4,7 @@
import type { Context as ClientContext } from '@deepseek-ai/cordis'
import type {} from '@deepseek-ai/dsh-api-remotes/client'
import type { SettingsScope, SettingsScopeSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client'
import type { SettingsFormScope, SettingsFormSnapshot } from './settings-form.ts'
import type { SnapshotStore } from './snapshot-store.ts'
import {
CardForm, textField, booleanField, booleanFieldPersistFalse,
@ -175,7 +175,7 @@ export class NetxopsCardController {
private exportInFlight: Promise<void> | undefined
constructor(
private readonly scope: SettingsScope<NetxopsSettings>,
private readonly scope: SettingsFormScope<NetxopsSettings>,
private readonly ctx: ClientContext,
) {
this.form = new CardForm(
@ -708,7 +708,7 @@ export class NetxopsCardController {
}
}
function refOf(snapshot: SettingsScopeSnapshot<NetxopsSettings>): string {
function refOf(snapshot: SettingsFormSnapshot<NetxopsSettings>): string {
const declared = snapshot.value?.tokenCredentialRef
return declared !== undefined && declared.length > 0 ? declared : DEFAULT_TOKEN_REF
}