@deepseek-ai/dsh-client-ui-settings-plugins 0.1.0-rc.7 → 0.1.0-rc.8
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/lib/client.js +41 -64
- package/lib/types/client/tab-store.d.ts +8 -17
- package/package.json +16 -21
package/lib/client.js
CHANGED
|
@@ -20,16 +20,16 @@ window.__ModuleLoader__.load({
|
|
|
20
20
|
document.head.appendChild(tag);
|
|
21
21
|
}
|
|
22
22
|
var fields_module_css_default = {
|
|
23
|
-
"
|
|
23
|
+
"badge": "At1oFq_badge",
|
|
24
|
+
"badgeMuted": "At1oFq_badgeMuted",
|
|
25
|
+
"badges": "At1oFq_badges",
|
|
24
26
|
"field": "At1oFq_field",
|
|
25
27
|
"head": "At1oFq_head",
|
|
26
|
-
"
|
|
28
|
+
"hint": "At1oFq_hint",
|
|
29
|
+
"input": "At1oFq_input",
|
|
27
30
|
"inputInvalid": "At1oFq_inputInvalid",
|
|
28
31
|
"invalid": "At1oFq_invalid",
|
|
29
|
-
"
|
|
30
|
-
"badgeMuted": "At1oFq_badgeMuted",
|
|
31
|
-
"badge": "At1oFq_badge",
|
|
32
|
-
"hint": "At1oFq_hint",
|
|
32
|
+
"label": "At1oFq_label",
|
|
33
33
|
"reset": "At1oFq_reset"
|
|
34
34
|
};
|
|
35
35
|
//#endregion
|
|
@@ -162,21 +162,21 @@ window.__ModuleLoader__.load({
|
|
|
162
162
|
document.head.appendChild(tag);
|
|
163
163
|
}
|
|
164
164
|
var PluginCard_module_css_default = {
|
|
165
|
-
"discard": "YyYd_a_discard",
|
|
166
|
-
"header": "YyYd_a_header",
|
|
167
|
-
"pending": "YyYd_a_pending",
|
|
168
|
-
"name": "YyYd_a_name",
|
|
169
165
|
"body": "YyYd_a_body",
|
|
170
|
-
"
|
|
171
|
-
"save": "YyYd_a_save",
|
|
172
|
-
"chevronOpen": "YyYd_a_chevronOpen",
|
|
173
|
-
"chevron": "YyYd_a_chevron",
|
|
166
|
+
"card": "YyYd_a_card",
|
|
174
167
|
"cardOpen": "YyYd_a_cardOpen",
|
|
175
|
-
"
|
|
168
|
+
"chevron": "YyYd_a_chevron",
|
|
169
|
+
"chevronOpen": "YyYd_a_chevronOpen",
|
|
176
170
|
"description": "YyYd_a_description",
|
|
177
|
-
"
|
|
171
|
+
"discard": "YyYd_a_discard",
|
|
172
|
+
"failed": "YyYd_a_failed",
|
|
173
|
+
"footer": "YyYd_a_footer",
|
|
178
174
|
"headText": "YyYd_a_headText",
|
|
179
|
-
"
|
|
175
|
+
"header": "YyYd_a_header",
|
|
176
|
+
"name": "YyYd_a_name",
|
|
177
|
+
"pending": "YyYd_a_pending",
|
|
178
|
+
"readOnly": "YyYd_a_readOnly",
|
|
179
|
+
"save": "YyYd_a_save"
|
|
180
180
|
};
|
|
181
181
|
//#endregion
|
|
182
182
|
//#region lib/types/client/PluginCard.js
|
|
@@ -371,14 +371,14 @@ window.__ModuleLoader__.load({
|
|
|
371
371
|
document.head.appendChild(tag);
|
|
372
372
|
}
|
|
373
373
|
var PluginsSettingsSection_module_css_default = {
|
|
374
|
-
"tabs": "pbvGtq_tabs",
|
|
375
374
|
"cards": "pbvGtq_cards",
|
|
376
|
-
"
|
|
375
|
+
"empty": "pbvGtq_empty",
|
|
377
376
|
"heading": "pbvGtq_heading",
|
|
378
377
|
"intro": "pbvGtq_intro",
|
|
379
|
-
"
|
|
378
|
+
"panel": "pbvGtq_panel",
|
|
380
379
|
"section": "pbvGtq_section",
|
|
381
|
-
"
|
|
380
|
+
"tab": "pbvGtq_tab",
|
|
381
|
+
"tabs": "pbvGtq_tabs"
|
|
382
382
|
};
|
|
383
383
|
//#endregion
|
|
384
384
|
//#region lib/types/client/ConfigurablePluginsTab.js
|
|
@@ -920,47 +920,28 @@ window.__ModuleLoader__.load({
|
|
|
920
920
|
* is never dispatched, so a plugin this deployment did not compose leaves no
|
|
921
921
|
* trace and does not count toward the empty line.
|
|
922
922
|
*/
|
|
923
|
-
/**
|
|
923
|
+
/** Derives the served namespaces from the shared describe mirror and pairs them with the cards that claim them. */
|
|
924
924
|
var ConfigurablePluginsTabController = class {
|
|
925
|
-
|
|
925
|
+
describeFace;
|
|
926
926
|
entries;
|
|
927
927
|
store = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)({
|
|
928
928
|
loaded: false,
|
|
929
929
|
namespaces: []
|
|
930
930
|
});
|
|
931
|
-
/** Last Host answer; kept so a slot mutation republishes without a wire read. */
|
|
932
|
-
served = [];
|
|
933
|
-
loaded = false;
|
|
934
|
-
generation = 0;
|
|
935
931
|
disposed = false;
|
|
932
|
+
unsubscribe;
|
|
936
933
|
/**
|
|
937
|
-
* @param
|
|
934
|
+
* @param describeFace - the shared mirror's describe face; its refreshes
|
|
935
|
+
* (document commits, reconnects) are what keep the served set current.
|
|
938
936
|
* @param entries - reads the cards currently registered into the section's slot.
|
|
939
937
|
*/
|
|
940
|
-
constructor(
|
|
941
|
-
this.
|
|
938
|
+
constructor(describeFace, entries) {
|
|
939
|
+
this.describeFace = describeFace;
|
|
942
940
|
this.entries = entries;
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
}
|
|
948
|
-
/**
|
|
949
|
-
* Re-read the served namespaces from the Host and republish.
|
|
950
|
-
* @returns settlement after the read, or immediately once disposed.
|
|
951
|
-
*/
|
|
952
|
-
async load() {
|
|
953
|
-
if (this.isDisposed()) return;
|
|
954
|
-
const generation = ++this.generation;
|
|
955
|
-
let response;
|
|
956
|
-
try {
|
|
957
|
-
response = await this.api.settings.describe({});
|
|
958
|
-
} catch (_settingsReadFailure) {
|
|
959
|
-
return;
|
|
960
|
-
}
|
|
961
|
-
if (this.isDisposed() || generation !== this.generation || !response.result.ok) return;
|
|
962
|
-
this.served = response.result.value.namespaces.map((view) => view.ns);
|
|
963
|
-
this.loaded = true;
|
|
941
|
+
this.unsubscribe = describeFace.subscribe(() => {
|
|
942
|
+
this.publish();
|
|
943
|
+
});
|
|
944
|
+
describeFace.ensure();
|
|
964
945
|
this.publish();
|
|
965
946
|
}
|
|
966
947
|
/** Republish after the slot ledger changed; a card registered late joins here. */
|
|
@@ -968,10 +949,10 @@ window.__ModuleLoader__.load({
|
|
|
968
949
|
if (this.disposed) return;
|
|
969
950
|
this.publish();
|
|
970
951
|
}
|
|
971
|
-
/** Stop publishing
|
|
952
|
+
/** Stop publishing and stop following the mirror. */
|
|
972
953
|
dispose() {
|
|
973
954
|
this.disposed = true;
|
|
974
|
-
this.
|
|
955
|
+
this.unsubscribe();
|
|
975
956
|
}
|
|
976
957
|
/**
|
|
977
958
|
* Build the face the tab's slot registration injects.
|
|
@@ -981,12 +962,15 @@ window.__ModuleLoader__.load({
|
|
|
981
962
|
return { hooks: { configurablePlugins: this.store } };
|
|
982
963
|
}
|
|
983
964
|
publish() {
|
|
984
|
-
|
|
965
|
+
if (this.disposed) return;
|
|
966
|
+
const mirrored = this.describeFace.getSnapshot();
|
|
967
|
+
const loaded = mirrored.view !== void 0;
|
|
968
|
+
const served = new Set(mirrored.view?.namespaces.map((view) => view.ns) ?? []);
|
|
985
969
|
const namespaces = this.entries().flatMap((entry) => entry.options.key !== void 0 && served.has(entry.options.key) ? [entry.options.key] : []);
|
|
986
970
|
const previous = this.store.getSnapshot();
|
|
987
|
-
if (previous.loaded ===
|
|
971
|
+
if (previous.loaded === loaded && previous.namespaces.length === namespaces.length && previous.namespaces.every((ns, index) => ns === namespaces[index])) return;
|
|
988
972
|
this.store.set({
|
|
989
|
-
loaded
|
|
973
|
+
loaded,
|
|
990
974
|
namespaces
|
|
991
975
|
});
|
|
992
976
|
}
|
|
@@ -1254,20 +1238,13 @@ window.__ModuleLoader__.load({
|
|
|
1254
1238
|
ctx.effect(() => ctx.remote.$on("credentials/updated", (ref) => {
|
|
1255
1239
|
webSearch.refreshCredential(ref);
|
|
1256
1240
|
}), "ui-settings-plugins: credential invalidations");
|
|
1257
|
-
const configurable = new ConfigurablePluginsTabController(
|
|
1241
|
+
const configurable = new ConfigurablePluginsTabController(ctx.settingsScope.describe(), () => ctx.slots.entries("settings.plugin.item"));
|
|
1258
1242
|
ctx.effect(() => () => {
|
|
1259
1243
|
configurable.dispose();
|
|
1260
1244
|
}, "ui-settings-plugins: tab directory");
|
|
1261
|
-
ctx.effect(() => ctx.remote.$on("settings/document-updated", () => {
|
|
1262
|
-
configurable.load();
|
|
1263
|
-
}), "ui-settings-plugins: served-namespace invalidations");
|
|
1264
|
-
ctx.effect(() => ctx.on("connection/reset", () => {
|
|
1265
|
-
configurable.load();
|
|
1266
|
-
}), "ui-settings-plugins: served-namespace reconnect");
|
|
1267
1245
|
ctx.effect(() => ctx.slots.subscribe("settings.plugin.item", () => {
|
|
1268
1246
|
configurable.refresh();
|
|
1269
1247
|
}), "ui-settings-plugins: card ledger");
|
|
1270
|
-
configurable.load();
|
|
1271
1248
|
let tabsVersion = -1;
|
|
1272
1249
|
let tabsRevision = -1;
|
|
1273
1250
|
let tabs = [];
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* is never dispatched, so a plugin this deployment did not compose leaves no
|
|
10
10
|
* trace and does not count toward the empty line.
|
|
11
11
|
*/
|
|
12
|
-
import type {
|
|
12
|
+
import type { SettingsDescribeFace } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
13
13
|
import type { StoredEntry } from '@deepseek-ai/dsh-client-ui-slots';
|
|
14
14
|
import { type SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client';
|
|
15
15
|
/** What the section renders. */
|
|
@@ -38,31 +38,22 @@ export interface ConfigurablePluginsTabFace {
|
|
|
38
38
|
configurablePlugins: SnapshotStore<ConfigurablePluginsTabState>;
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
41
|
+
/** Derives the served namespaces from the shared describe mirror and pairs them with the cards that claim them. */
|
|
42
42
|
export declare class ConfigurablePluginsTabController {
|
|
43
|
-
private readonly
|
|
43
|
+
private readonly describeFace;
|
|
44
44
|
private readonly entries;
|
|
45
45
|
private readonly store;
|
|
46
|
-
/** Last Host answer; kept so a slot mutation republishes without a wire read. */
|
|
47
|
-
private served;
|
|
48
|
-
private loaded;
|
|
49
|
-
private generation;
|
|
50
46
|
private disposed;
|
|
47
|
+
private readonly unsubscribe;
|
|
51
48
|
/**
|
|
52
|
-
* @param
|
|
49
|
+
* @param describeFace - the shared mirror's describe face; its refreshes
|
|
50
|
+
* (document commits, reconnects) are what keep the served set current.
|
|
53
51
|
* @param entries - reads the cards currently registered into the section's slot.
|
|
54
52
|
*/
|
|
55
|
-
constructor(
|
|
56
|
-
/** Opaque read of {@link disposed}: control flow cannot narrow it across awaits. */
|
|
57
|
-
private isDisposed;
|
|
58
|
-
/**
|
|
59
|
-
* Re-read the served namespaces from the Host and republish.
|
|
60
|
-
* @returns settlement after the read, or immediately once disposed.
|
|
61
|
-
*/
|
|
62
|
-
load(): Promise<void>;
|
|
53
|
+
constructor(describeFace: SettingsDescribeFace, entries: () => readonly StoredEntry[]);
|
|
63
54
|
/** Republish after the slot ledger changed; a card registered late joins here. */
|
|
64
55
|
refresh(): void;
|
|
65
|
-
/** Stop publishing
|
|
56
|
+
/** Stop publishing and stop following the mirror. */
|
|
66
57
|
dispose(): void;
|
|
67
58
|
/**
|
|
68
59
|
* Build the face the tab's slot registration injects.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-settings-plugins",
|
|
3
3
|
"description": "Plugins settings section with feature-owned tabs and configurable host-plane plugin cards",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.8",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -43,32 +43,27 @@
|
|
|
43
43
|
},
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"
|
|
46
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.0-rc.8",
|
|
47
47
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-client-
|
|
50
|
-
"@deepseek-ai/dsh-
|
|
51
|
-
"@deepseek-ai/dsh-client-
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.7",
|
|
54
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
|
|
55
|
-
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.7",
|
|
56
|
-
"@deepseek-ai/dsh-client-web-react": "^0.1.0-rc.7"
|
|
48
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.8",
|
|
49
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.8",
|
|
50
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.8",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.8",
|
|
52
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.8"
|
|
57
53
|
},
|
|
58
54
|
"devDependencies": {
|
|
59
55
|
"@types/react": "~18.3.1",
|
|
60
56
|
"react": "^18.2.0",
|
|
61
57
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/dsh-
|
|
64
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.
|
|
65
|
-
"@deepseek-ai/dsh-client-
|
|
66
|
-
"@deepseek-ai/dsh-client-test-runtime": "^0.1.0-rc.
|
|
67
|
-
"@deepseek-ai/dsh-client-ui-
|
|
68
|
-
"@deepseek-ai/dsh-client-ui-
|
|
69
|
-
"@deepseek-ai/dsh-
|
|
70
|
-
"@deepseek-ai/dsh-client-ui-
|
|
71
|
-
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.7"
|
|
58
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.0-rc.8",
|
|
59
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.8",
|
|
60
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.8",
|
|
61
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.8",
|
|
62
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.0-rc.8",
|
|
63
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.8",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.8",
|
|
65
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.8",
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.8"
|
|
72
67
|
},
|
|
73
68
|
"files": [
|
|
74
69
|
"lib/index.js",
|