@deepseek-ai/dsh-client-ui-settings 0.1.6-alpha.2 → 0.1.7-alpha.2
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/README.i18n.yaml +2 -2
- package/README.md +20 -11
- package/README.zh.md +20 -11
- package/lib/client.js +281 -117
- package/lib/index.js +18 -4
- package/lib/types/client/{settings-contract.d.ts → config-form-types.d.ts} +16 -27
- package/lib/types/client/{settings-scope.d.ts → config-form.d.ts} +55 -37
- package/lib/types/client/contract/slots.d.ts +18 -1
- package/lib/types/client/developer-tools.d.ts +22 -0
- package/lib/types/client/index.d.ts +6 -24
- package/lib/types/client/settings-mirror.d.ts +2 -2
- package/lib/types/developer-tools-settings.d.ts +20 -0
- package/lib/types/index.d.ts +17 -3
- package/package.json +13 -11
package/lib/index.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
//#region lib/types/developer-tools-settings.js
|
|
3
|
+
/** Shared Web and desktop developer-tool preference stored by the Host. */
|
|
4
|
+
/** New installations and missing values enable the full interface. */
|
|
5
|
+
const DeveloperToolsSettingsFields = { enabled: z.boolean().default(true) };
|
|
6
|
+
z.object(DeveloperToolsSettingsFields);
|
|
7
|
+
//#endregion
|
|
1
8
|
//#region lib/types/index.js
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
9
|
+
/** Live preferences projected to the browser. */
|
|
10
|
+
const Config = z.object({ enabled: DeveloperToolsSettingsFields["enabled"].volatile() });
|
|
11
|
+
/** Host preferences are consumed through the configuration form projection.
|
|
12
|
+
* @param ctx Plugin context used for optional settings presentation.
|
|
13
|
+
*/
|
|
14
|
+
function apply(ctx) {
|
|
15
|
+
ctx.inject(["settings"], (child) => {
|
|
16
|
+
child.effect(() => child.settings.configure({ auto: false }, ctx.fiber));
|
|
17
|
+
});
|
|
18
|
+
}
|
|
5
19
|
//#endregion
|
|
6
|
-
export { apply };
|
|
20
|
+
export { Config, apply };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Client configuration values and atomic write operations.
|
|
3
3
|
*/
|
|
4
4
|
import type { SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client';
|
|
5
5
|
/** Client-side sync state of one settings namespace. */
|
|
6
|
-
export interface
|
|
6
|
+
export interface ConfigFormSnapshot<T> {
|
|
7
7
|
/**
|
|
8
8
|
* `loading` until the first accepted section, `ready` while one stands, and
|
|
9
9
|
* `unavailable` when the namespace is not exposed to this client or the
|
|
@@ -30,26 +30,12 @@ export interface SettingsScopeSnapshot<T> {
|
|
|
30
30
|
/** `host` syncs with the Host document; `memory` keeps a remote browser process-local. */
|
|
31
31
|
mode: 'host' | 'memory';
|
|
32
32
|
}
|
|
33
|
-
/** Domain-owned description of one settings namespace consumed by a browser plugin. */
|
|
34
|
-
export interface SettingsScopeSpec<T> {
|
|
35
|
-
/** Settings namespace registered by the owning Host plugin. */
|
|
36
|
-
namespace: string;
|
|
37
|
-
/**
|
|
38
|
-
* Narrow one wire section; undefined keeps the last accepted value. The
|
|
39
|
-
* default validates the section against the namespace's own serialized wire
|
|
40
|
-
* schema, so domains add a decoder only to narrow beyond that schema.
|
|
41
|
-
*/
|
|
42
|
-
decode?: (section: unknown) => T | undefined;
|
|
43
|
-
}
|
|
44
33
|
/**
|
|
45
|
-
*
|
|
46
|
-
* mirror of the Host-side `SettingsScope` owner seam. Domain services read
|
|
47
|
-
* and observe the snapshot and route explicit user choices through its
|
|
48
|
-
* mutation methods.
|
|
34
|
+
* Accepted values and serialized writes shared by editors of one Host entry.
|
|
49
35
|
*/
|
|
50
|
-
export interface
|
|
36
|
+
export interface ConfigForm<T> {
|
|
51
37
|
/** @returns the current sync snapshot (stable reference until the next change). */
|
|
52
|
-
getSnapshot():
|
|
38
|
+
getSnapshot(): ConfigFormSnapshot<T>;
|
|
53
39
|
/**
|
|
54
40
|
* Observe snapshot replacements.
|
|
55
41
|
* @param listener - invoked after each snapshot change.
|
|
@@ -63,24 +49,27 @@ export interface SettingsScope<T> {
|
|
|
63
49
|
* the latest queued or mirrored revision.
|
|
64
50
|
* @param ops - ordered field operations copied when queued.
|
|
65
51
|
* @param expectedRevision - optional fixed revision read by the domain editor.
|
|
66
|
-
* @returns
|
|
52
|
+
* @returns true for Host acceptance, false for refusal or skipped writes, after any latest-write recovery.
|
|
53
|
+
* Transport failures reject.
|
|
67
54
|
*/
|
|
68
|
-
mutate(ops: readonly SettingsPathOpView[], expectedRevision?: number): Promise<
|
|
55
|
+
mutate(ops: readonly SettingsPathOpView[], expectedRevision?: number): Promise<boolean>;
|
|
69
56
|
/**
|
|
70
57
|
* Queue one field write. Rapid writes preserve mutation order, each carries
|
|
71
58
|
* the latest known namespace revision, and only the latest settlement may
|
|
72
|
-
* publish; a
|
|
59
|
+
* publish; a Host-refused latest write reloads Host state instead.
|
|
73
60
|
* @param field - scalar field inside the namespace section.
|
|
74
61
|
* @param value - JSON-shaped value selected by the user.
|
|
75
|
-
* @returns
|
|
62
|
+
* @returns true for Host acceptance, false for refusal or skipped writes, after any latest-write recovery.
|
|
63
|
+
* Transport failures reject.
|
|
76
64
|
*/
|
|
77
|
-
set(field: string, value: unknown): Promise<
|
|
65
|
+
set(field: string, value: unknown): Promise<boolean>;
|
|
78
66
|
/**
|
|
79
67
|
* Queue one field clear, so the field re-inherits the composition layer.
|
|
80
68
|
* Shares {@link set}'s ordering, revision, and recovery contract.
|
|
81
69
|
* @param field - scalar field inside the namespace section.
|
|
82
|
-
* @returns
|
|
70
|
+
* @returns true for Host acceptance, false for refusal or skipped writes, after any latest-write recovery.
|
|
71
|
+
* Transport failures reject.
|
|
83
72
|
*/
|
|
84
|
-
unset(field: string): Promise<
|
|
73
|
+
unset(field: string): Promise<boolean>;
|
|
85
74
|
}
|
|
86
|
-
//# sourceMappingURL=
|
|
75
|
+
//# sourceMappingURL=config-form-types.d.ts.map
|
|
@@ -1,23 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* per-namespace derivation over the shared {@link SettingsDescribeMirror} and
|
|
4
|
-
* the serialized write path. Reads never touch the wire here: the
|
|
5
|
-
* mirror is the one `settings.describe` reader, and every scope is a selector
|
|
6
|
-
* over its snapshot.
|
|
7
|
-
*/
|
|
1
|
+
/** Shared entry values and ordered writes over the Host configuration mirror. */
|
|
2
|
+
import { DeveloperToolsPreference } from './developer-tools.ts';
|
|
8
3
|
import { Service } from '@deepseek-ai/cordis';
|
|
9
4
|
import type { Context } from '@deepseek-ai/cordis';
|
|
10
5
|
import type { SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client';
|
|
11
6
|
import type { SettingsSchemaService } from './schema.ts';
|
|
12
|
-
import type {
|
|
7
|
+
import type { ConfigForm, ConfigFormSnapshot } from './config-form-types.ts';
|
|
13
8
|
import { SettingsDescribeMirror, type SettingsDescribeFace } from './settings-mirror.ts';
|
|
9
|
+
/** Domain-owned description of one settings namespace consumed by a browser plugin. */
|
|
10
|
+
interface ConfigFormSpec<T> {
|
|
11
|
+
/** Settings namespace registered by the owning Host plugin. */
|
|
12
|
+
namespace: string;
|
|
13
|
+
/**
|
|
14
|
+
* Narrow one wire section; undefined keeps the last accepted value. The
|
|
15
|
+
* default validates the section against the namespace's own serialized wire
|
|
16
|
+
* schema, so domains add a decoder only to narrow beyond that schema.
|
|
17
|
+
*/
|
|
18
|
+
decode?: (section: unknown) => T | undefined;
|
|
19
|
+
}
|
|
14
20
|
/**
|
|
15
21
|
* One namespace's derived view over the shared describe mirror, plus that
|
|
16
22
|
* namespace's serialized Host writes. Writes carry the latest known namespace
|
|
17
23
|
* revision, fold their answers back into the mirror, and teardown waits for
|
|
18
24
|
* the operation already crossing the wire.
|
|
19
25
|
*/
|
|
20
|
-
export declare class
|
|
26
|
+
export declare class ConfigFormController<T> implements ConfigForm<T> {
|
|
21
27
|
private readonly ctx;
|
|
22
28
|
private readonly spec;
|
|
23
29
|
private readonly mirror;
|
|
@@ -36,15 +42,15 @@ export declare class SettingsScopeController<T> implements SettingsScope<T> {
|
|
|
36
42
|
private pendingRevision;
|
|
37
43
|
/**
|
|
38
44
|
* @param ctx - the providing plugin's context, whose `remote.settings`
|
|
39
|
-
* namespace carries this
|
|
45
|
+
* namespace carries this form's writes (reads ride the mirror).
|
|
40
46
|
* @param spec - namespace identity and optional narrowing decoder.
|
|
41
|
-
* @param mirror - the shared describe mirror this
|
|
47
|
+
* @param mirror - the shared describe mirror this form derives from.
|
|
42
48
|
* @param persistence - client-selected Host persistence; non-loopback pages may remain process-local.
|
|
43
49
|
* @param schema - settings-owned schema operations.
|
|
44
50
|
*/
|
|
45
|
-
constructor(ctx: Context, spec:
|
|
51
|
+
constructor(ctx: Context, spec: ConfigFormSpec<T>, mirror: SettingsDescribeMirror, persistence: 'host' | 'memory', schema: SettingsSchemaService);
|
|
46
52
|
/** @returns the current sync snapshot (stable reference until the next change). */
|
|
47
|
-
getSnapshot():
|
|
53
|
+
getSnapshot(): ConfigFormSnapshot<T>;
|
|
48
54
|
/**
|
|
49
55
|
* Observe snapshot replacements.
|
|
50
56
|
* @param listener - invoked after each snapshot change.
|
|
@@ -52,27 +58,27 @@ export declare class SettingsScopeController<T> implements SettingsScope<T> {
|
|
|
52
58
|
*/
|
|
53
59
|
subscribe(listener: () => void): () => void;
|
|
54
60
|
/**
|
|
55
|
-
* Queue one field write; see {@link
|
|
61
|
+
* Queue one field write; see {@link ConfigForm.set} for the ordering,
|
|
56
62
|
* revision, and recovery contract.
|
|
57
63
|
* @param field - scalar field inside the namespace section.
|
|
58
64
|
* @param value - JSON-shaped value selected by the user.
|
|
59
|
-
* @returns
|
|
65
|
+
* @returns whether the Host accepted the write, after any recovery read.
|
|
60
66
|
*/
|
|
61
|
-
set(field: string, value: unknown): Promise<
|
|
67
|
+
set(field: string, value: unknown): Promise<boolean>;
|
|
62
68
|
/**
|
|
63
|
-
* Queue one field clear; see {@link
|
|
69
|
+
* Queue one field clear; see {@link ConfigForm.unset} for the ordering,
|
|
64
70
|
* revision, and recovery contract.
|
|
65
71
|
* @param field - scalar field inside the namespace section.
|
|
66
|
-
* @returns
|
|
72
|
+
* @returns whether the Host accepted the clear, after any recovery read.
|
|
67
73
|
*/
|
|
68
|
-
unset(field: string): Promise<
|
|
74
|
+
unset(field: string): Promise<boolean>;
|
|
69
75
|
/**
|
|
70
|
-
* Queue one atomic namespace mutation; see {@link
|
|
76
|
+
* Queue one atomic namespace mutation; see {@link ConfigForm.mutate}.
|
|
71
77
|
* @param ops - ordered field operations copied when queued.
|
|
72
78
|
* @param expectedRevision - optional fixed revision read by the domain editor.
|
|
73
|
-
* @returns
|
|
79
|
+
* @returns whether the Host accepted the mutation, after any recovery read.
|
|
74
80
|
*/
|
|
75
|
-
mutate(ops: readonly SettingsPathOpView[], expectedRevision?: number): Promise<
|
|
81
|
+
mutate(ops: readonly SettingsPathOpView[], expectedRevision?: number): Promise<boolean>;
|
|
76
82
|
/** Reload Host state for the latest failed write; superseded failures leave recovery to it. */
|
|
77
83
|
private recover;
|
|
78
84
|
/**
|
|
@@ -87,7 +93,7 @@ export declare class SettingsScopeController<T> implements SettingsScope<T> {
|
|
|
87
93
|
}
|
|
88
94
|
declare module '@deepseek-ai/cordis' {
|
|
89
95
|
interface Context {
|
|
90
|
-
|
|
96
|
+
configForms: ConfigForms;
|
|
91
97
|
}
|
|
92
98
|
}
|
|
93
99
|
/**
|
|
@@ -97,19 +103,22 @@ declare module '@deepseek-ai/cordis' {
|
|
|
97
103
|
* cross-plugin collaboration through cordis services
|
|
98
104
|
* (`packages/client/tsdown.client.ts`).
|
|
99
105
|
*/
|
|
100
|
-
export declare class
|
|
106
|
+
export declare class ConfigForms extends Service {
|
|
107
|
+
private readonly forms;
|
|
108
|
+
/** Shared developer-tool preference owned by this settings provider. */
|
|
109
|
+
readonly developerTools: DeveloperToolsPreference;
|
|
101
110
|
private readonly mirror;
|
|
102
111
|
private readonly schema;
|
|
103
112
|
private readonly persistence;
|
|
104
113
|
/**
|
|
105
114
|
* The PROVIDING fiber, kept because a Service reads `ctx` as its *consumer's*
|
|
106
|
-
* fiber: letting a
|
|
115
|
+
* fiber: letting a shared form write through the caller's context would make
|
|
107
116
|
* every caller declare `remote.settings` in its own `inject`.
|
|
108
117
|
*/
|
|
109
118
|
private readonly owner;
|
|
110
119
|
/**
|
|
111
120
|
* @param ctx - the providing plugin's context.
|
|
112
|
-
* @param config - the shared describe mirror every
|
|
121
|
+
* @param config - the shared describe mirror every shared form derives from,
|
|
113
122
|
* the settings-owned schema operations, and the Host persistence the provider
|
|
114
123
|
* resolved from `remote.$host`.
|
|
115
124
|
*/
|
|
@@ -121,21 +130,30 @@ export declare class SettingsScopeBinder extends Service {
|
|
|
121
130
|
/**
|
|
122
131
|
* The shared mirror's read/fold face for cross-namespace surfaces (schema
|
|
123
132
|
* introspection, the served-namespace directory). Per-namespace consumers
|
|
124
|
-
* use {@link
|
|
133
|
+
* use {@link get}; both derive from the same snapshot, so they can never
|
|
125
134
|
* disagree about the document.
|
|
126
135
|
* @returns the describe face over the shared mirror.
|
|
127
136
|
*/
|
|
128
137
|
describe(): SettingsDescribeFace;
|
|
138
|
+
/** Get the shared form values and write queue for one Host plugin entry.
|
|
139
|
+
* @param entryId Unique Host plugin entry id.
|
|
140
|
+
* @returns The entry's form, owned by this provider.
|
|
141
|
+
*/
|
|
142
|
+
get<T>(entryId: string): ConfigForm<T>;
|
|
129
143
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* @
|
|
137
|
-
*
|
|
144
|
+
* Keep a registration alive while the Host serves any of some namespaces:
|
|
145
|
+
* `register` runs once one of them is in the describe mirror, and its
|
|
146
|
+
* disposer runs when none is or when the returned disposer runs. A plugin
|
|
147
|
+
* whose page edits a namespace another plugin owns registers the page
|
|
148
|
+
* through this, so a deployment that never composed the owner shows no
|
|
149
|
+
* trace of the page. The caller owns the returned disposer and wraps it in
|
|
150
|
+
* `ctx.effect`; unlike {@link bind}, nothing is registered on the caller's
|
|
151
|
+
* context here.
|
|
152
|
+
* @param namespaces - the settings namespaces the registration follows.
|
|
153
|
+
* @param register - registers the contribution, given every namespace the Host serves; returns its disposer.
|
|
154
|
+
* @returns the disposer ending the watch and any live registration.
|
|
138
155
|
*/
|
|
139
|
-
|
|
156
|
+
whileServed(namespaces: readonly string[], register: (served: ReadonlySet<string>) => () => void): () => void;
|
|
140
157
|
}
|
|
141
|
-
|
|
158
|
+
export {};
|
|
159
|
+
//# sourceMappingURL=config-form.d.ts.map
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
*/
|
|
11
11
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
12
12
|
interface SlotMap {
|
|
13
|
+
/** Optional sidebar account launcher; opens the shell-owned settings panel. */
|
|
14
|
+
'settings.launcher': {
|
|
15
|
+
kind: 'single';
|
|
16
|
+
scope: 'root';
|
|
17
|
+
owner: SettingsLauncherOwnerProps;
|
|
18
|
+
};
|
|
13
19
|
/**
|
|
14
20
|
* The sidebar-foot trigger row content: icon + label, supplied as slot
|
|
15
21
|
* content (the accessible name comes from the content — rail state
|
|
@@ -109,7 +115,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
109
115
|
* through your own inject face and `host.call`. Declared at runtime by
|
|
110
116
|
* ui-settings-general's General entry; the type lives here with every other
|
|
111
117
|
* settings slot type, because this package is the settings domain's base
|
|
112
|
-
* layer and every registrant already depends on it for `ctx.
|
|
118
|
+
* layer and every registrant already depends on it for `ctx.configForms`.
|
|
113
119
|
*/
|
|
114
120
|
'settings.general.item': {
|
|
115
121
|
kind: 'list';
|
|
@@ -153,9 +159,20 @@ export interface SettingsSectionOwnerProps {
|
|
|
153
159
|
export interface SettingsOnboardingOwnerProps {
|
|
154
160
|
/** Stable id of the step currently selected by the coordinator. */
|
|
155
161
|
stepId: string;
|
|
162
|
+
/** User explicitly reopened this step outside first-run onboarding. */
|
|
163
|
+
explicit?: boolean;
|
|
156
164
|
/** Complete or skip this step and transfer ownership to the next entry. */
|
|
157
165
|
complete: () => void;
|
|
158
166
|
/** Open the settings panel directly on one registered section. */
|
|
159
167
|
openSection: (id: string) => void;
|
|
160
168
|
}
|
|
169
|
+
/** Sidebar launcher geometry and settings navigation. */
|
|
170
|
+
export interface SettingsLauncherOwnerProps {
|
|
171
|
+
/** Whether the sidebar shows labels. */
|
|
172
|
+
wide: boolean;
|
|
173
|
+
/** Open the settings panel. */
|
|
174
|
+
openSettings: () => void;
|
|
175
|
+
/** @param id - registered onboarding editor to open explicitly. */
|
|
176
|
+
openOnboarding: (id: string) => void;
|
|
177
|
+
}
|
|
161
178
|
//# sourceMappingURL=slots.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** One accepted preference drives every developer-tool consumer. */
|
|
2
|
+
import { type ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
|
|
3
|
+
import type { DeveloperToolsSettings } from '../developer-tools-settings.ts';
|
|
4
|
+
import type { ConfigForm } from './config-form-types.ts';
|
|
5
|
+
/** Shared preference; Host-backed features stay disabled until an accepted value arrives. */
|
|
6
|
+
export declare class DeveloperToolsPreference {
|
|
7
|
+
private readonly scope;
|
|
8
|
+
/** Accepted enablement, observable through renderer-bound hooks. */
|
|
9
|
+
readonly enabled: ObservableSnapshot<boolean>;
|
|
10
|
+
private readonly local;
|
|
11
|
+
/**
|
|
12
|
+
* @param scope - settings-owned namespace controller.
|
|
13
|
+
*/
|
|
14
|
+
constructor(scope: ConfigForm<DeveloperToolsSettings>);
|
|
15
|
+
/**
|
|
16
|
+
* Persist a Host choice with ordered writes, or update the shared browser-local choice.
|
|
17
|
+
* @param enabled - requested developer-tool mode.
|
|
18
|
+
* @returns settlement after local publication or Host acceptance; rejects after a refused write recovers.
|
|
19
|
+
*/
|
|
20
|
+
setEnabled(enabled: boolean): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=developer-tools.d.ts.map
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Settings domain base plugin, browser half. Provides `ctx.settingsScope`, the
|
|
3
|
-
* settings-namespace scope service every preference row binds its durable
|
|
4
|
-
* section through, and owns the one `settings.describe` reader in the browser:
|
|
5
|
-
* the describe mirror, whose invalidation subscriptions
|
|
6
|
-
* (`settings/document-updated`, `connection/reset`) live here so every derived
|
|
7
|
-
* surface refreshes from a single wire read. It depends on no `ui-*`
|
|
8
|
-
* presentation package, so any feature that owns a preference can reach it:
|
|
9
|
-
* the settings SHELL — the `sidebar.settings` occupant, its navigation, and
|
|
10
|
-
* the chrome — lives in ui-settings-general, because a shell dependency on
|
|
11
|
-
* ui-sidebar would close a reference cycle through ui-layout and ui-theme.
|
|
12
|
-
* Export discipline: packages/client/AGENTS.md.
|
|
13
|
-
*/
|
|
1
|
+
/** Shared configuration forms and their Host describe mirror. */
|
|
14
2
|
import type { Context } from '@deepseek-ai/cordis';
|
|
15
|
-
export type { SettingsGeneralItemOwnerProps, SettingsHeaderOwnerProps, SettingsOnboardingOwnerProps, SettingsPluginsTabOwnerProps, SettingsSectionOwnerProps, SettingsTriggerOwnerProps, } from './contract/slots.ts';
|
|
16
|
-
export type {
|
|
17
|
-
export type {
|
|
3
|
+
export type { SettingsLauncherOwnerProps, SettingsGeneralItemOwnerProps, SettingsHeaderOwnerProps, SettingsOnboardingOwnerProps, SettingsPluginsTabOwnerProps, SettingsSectionOwnerProps, SettingsTriggerOwnerProps, } from './contract/slots.ts';
|
|
4
|
+
export type { ConfigForms } from './config-form.ts';
|
|
5
|
+
export type { ConfigForm, ConfigFormSnapshot } from './config-form-types.ts';
|
|
18
6
|
export type { SettingsSchemaService } from './schema.ts';
|
|
19
7
|
export type { SchemaNode } from './schema.ts';
|
|
20
8
|
export type { SettingsDescribeFace, SettingsDescribeView, SettingsMirrorSnapshot, } from './settings-mirror.ts';
|
|
@@ -23,14 +11,8 @@ export type { SettingsDescribeFace, SettingsDescribeView, SettingsMirrorSnapshot
|
|
|
23
11
|
* forwarded settings invalidation it refreshes on.
|
|
24
12
|
*/
|
|
25
13
|
export declare const inject: string[];
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* mirror, and keep that mirror fresh on the two signals that can move the
|
|
29
|
-
* settings document: a document commit and a (re)connect.
|
|
30
|
-
*
|
|
31
|
-
* Constructing the service in this plugin's fiber keeps its traced methods
|
|
32
|
-
* bound to each consuming plugin's context.
|
|
33
|
-
* @param ctx - client root context.
|
|
14
|
+
/** Provide shared forms and refresh them on document changes and reconnects.
|
|
15
|
+
* @param ctx Client provider context.
|
|
34
16
|
*/
|
|
35
17
|
export declare function apply(ctx: Context): void;
|
|
36
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Client mirror of the Host settings document: the one `settings.describe`
|
|
3
3
|
* reader in the browser. Every settings consumer derives from this store —
|
|
4
|
-
*
|
|
5
|
-
* surfaces through the
|
|
4
|
+
* shared entry forms through `ConfigForms.get`, cross-namespace
|
|
5
|
+
* surfaces through the provider's shared describe face — so startup cost and
|
|
6
6
|
* freshness are properties of this class, not of how many features own a
|
|
7
7
|
* preference. The Host stays the fact source: the mirror re-reads on the
|
|
8
8
|
* invalidations its owning plugin subscribes to and folds write answers in
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Shared Web and desktop developer-tool preference stored by the Host. */
|
|
2
|
+
import z from '@deepseek-ai/schemastery';
|
|
3
|
+
/** Namespace for developer UI and HTML preview capabilities. */
|
|
4
|
+
export declare const DEVELOPER_TOOLS_NAMESPACE = "ui-settings";
|
|
5
|
+
/** Persisted developer-tool choice. */
|
|
6
|
+
export interface DeveloperToolsSettings {
|
|
7
|
+
/** Enable diagnostic views, preset selection, change summaries and scripted HTML previews. */
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** New installations and missing values enable the full interface. */
|
|
11
|
+
export declare const DeveloperToolsSettingsFields: {
|
|
12
|
+
enabled: z<boolean, boolean, "defined">;
|
|
13
|
+
};
|
|
14
|
+
/** Schema for shared configuration values. */
|
|
15
|
+
export declare const DeveloperToolsSettingsSchema: z<Schemastery.ObjectS<NoInfer<{
|
|
16
|
+
enabled: z<boolean, boolean, "defined">;
|
|
17
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
18
|
+
enabled: z<boolean, boolean, "defined">;
|
|
19
|
+
}>>, "plain">;
|
|
20
|
+
//# sourceMappingURL=developer-tools-settings.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { Volatile, Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import z from '@deepseek-ai/schemastery';
|
|
3
|
+
/** Runtime preferences projected to the browser. */
|
|
4
|
+
export interface Config {
|
|
5
|
+
/** Whether developer tools are enabled. */
|
|
6
|
+
enabled: Volatile<boolean>;
|
|
7
|
+
}
|
|
8
|
+
/** Live preferences projected to the browser. */
|
|
9
|
+
export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
10
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
11
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
12
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
13
|
+
}>>, "plain">;
|
|
14
|
+
/** Host preferences are consumed through the configuration form projection.
|
|
15
|
+
* @param ctx Plugin context used for optional settings presentation.
|
|
16
|
+
*/
|
|
17
|
+
export declare function apply(ctx: Context): void;
|
|
4
18
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-settings",
|
|
3
|
-
"description": "Settings domain base plugin:
|
|
4
|
-
"version": "0.1.
|
|
3
|
+
"description": "Settings domain base plugin: shared configuration forms and the canonical settings slot-type contract",
|
|
4
|
+
"version": "0.1.7-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -35,25 +35,27 @@
|
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@deepseek-ai/cordis": "
|
|
38
|
+
"@deepseek-ai/cordis": "~4.0.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/react": "~18.3.1",
|
|
42
42
|
"react": "^18.2.0",
|
|
43
|
-
"@deepseek-ai/cordis": "
|
|
44
|
-
"@deepseek-ai/dsh-api-remotes": "
|
|
45
|
-
"@deepseek-ai/dsh-client-
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-client-
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/
|
|
50
|
-
"@deepseek-ai/dsh-util-values": "^0.1.6-alpha.2"
|
|
43
|
+
"@deepseek-ai/cordis": "~4.0.4",
|
|
44
|
+
"@deepseek-ai/dsh-api-remotes": "0.1.7-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-client-store": "0.1.7-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-client-test-runtime": "0.1.7-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.7-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-util-values": "0.1.7-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-settings": "0.1.7-alpha.2"
|
|
51
50
|
},
|
|
52
51
|
"files": [
|
|
53
52
|
"lib/index.js",
|
|
54
53
|
"lib/client.js",
|
|
55
54
|
"lib/types/**/*.d.ts"
|
|
56
55
|
],
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@deepseek-ai/schemastery": "~3.18.4"
|
|
58
|
+
},
|
|
57
59
|
"scripts": {
|
|
58
60
|
"bundle": "tsdown",
|
|
59
61
|
"watch": "tsdown --watch"
|