@deepseek-ai/dsh-client-ui-settings-plugins 0.1.0-rc.7 → 0.1.1-rc.1
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 +1 -1
- package/README.zh.md +3 -1
- package/lib/client.js +42 -65
- package/lib/types/client/tab-store.d.ts +8 -17
- package/package.json +16 -21
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/client/ui-settings-plugins/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 0ee0edbebadad8e8e895002cd9eb60a20f45809d
|
|
6
|
+
README.zh.md: b57fe9522dcc37b67f494199b3bb6ef0cf4a2a54
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ A card stages what the user types and writes it only when they save. Each contro
|
|
|
20
20
|
|
|
21
21
|
Saving writes each staged field through the client settings scope, which fences every write with the namespace revision it read, so a form that has drifted from the document is refused rather than overwriting a concurrent change. The Host is the only authority on whether a value was accepted — its validators own the constraints no schema can express — so the card reads the section back afterwards and reports a save that did not land, keeping those drafts for the user to correct.
|
|
22
22
|
|
|
23
|
-
A key can also be written from another surface — the Models page addresses the same reference — which changes no settings section, so the card re-reads on the forwarded `credentials/updated` event for the reference it watches.
|
|
23
|
+
A key can also be written from another surface — the Models page addresses the same reference — which changes no settings section, so the card re-reads on the forwarded `credentials/reference-updated` event for the reference it watches.
|
|
24
24
|
|
|
25
25
|
A field's presence in the raw user layer — not its value — is what marks it overridden; a reset clears that field so it re-inherits the composition layer. Secret-role fields never ride a response, so a key control starts blank, reports only whether one is configured, and writes through the credentials domain rather than the settings section; a blank draft writes nothing and keeps the stored key.
|
|
26
26
|
|
package/README.zh.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
保存时,每个暂存字段都通过客户端 settings scope 写入,该 scope 用读取时的命名空间 revision 为每次写入设栅,因此已与文档脱节的表单会被拒绝,而不是覆盖并发变更。某个值是否被接受只有 Host 说了算——schema 表达不了的约束归它的校验器所有——因此卡片在写入后回读分节,报告没有落盘的保存,并保留这些草稿供用户修改。
|
|
22
22
|
|
|
23
|
-
密钥也可能从别的表层写入——模型页寻址的是同一个引用——而那不改变任何 settings 分节,因此卡片会在转发来的 `credentials/updated` 事件报告它所关注的引用时重读。
|
|
23
|
+
密钥也可能从别的表层写入——模型页寻址的是同一个引用——而那不改变任何 settings 分节,因此卡片会在转发来的 `credentials/reference-updated` 事件报告它所关注的引用时重读。
|
|
24
24
|
|
|
25
25
|
字段是否被覆盖,取决于它是否出现在原始用户层中,而非取决于它的值;重置会清除该字段,使其重新继承组装层。secret 角色的字段绝不搭乘响应,因此密钥控件初始为空、只报告是否已配置,并经由 credentials 领域而非 settings 分节写入;空草稿不写入任何东西,保留已存密钥。
|
|
26
26
|
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
|
|
33
33
|
无;该包既不组装也不发送提供方请求。
|
|
34
34
|
|
|
35
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
36
|
+
|
|
35
37
|
## 已知限制与暂缓事项
|
|
36
38
|
|
|
37
39
|
- **只有宿主平面的插件会出现**——由 agent preset 挂载的插件把配置内联在该 preset 的 `agent.cordis.yml` 中,且根本无法注册 settings 命名空间(同一 preset 挂载第二个会话时会因重复注册而失败),因此本分区不会列出它。编辑那些值仍是 preset 编辑器的职责。
|
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
|
}
|
|
@@ -1251,23 +1235,16 @@ window.__ModuleLoader__.load({
|
|
|
1251
1235
|
const bash = new BashCardController(ctx.settingsScope.bind({ namespace: SHELL_NS }));
|
|
1252
1236
|
const agentLoop = new AgentLoopCardController(ctx.settingsScope.bind({ namespace: AGENT_LOOP_NS }));
|
|
1253
1237
|
const webSearch = new WebSearchCardController(ctx.settingsScope.bind({ namespace: WEB_SEARCH_NS }), api);
|
|
1254
|
-
ctx.effect(() => ctx.remote.$on("credentials/updated", (ref) => {
|
|
1238
|
+
ctx.effect(() => ctx.remote.$on("credentials/reference-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.
|
|
4
|
+
"version": "0.1.1-rc.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -43,32 +43,27 @@
|
|
|
43
43
|
},
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"react": "^18.2.0",
|
|
47
46
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-client-
|
|
50
|
-
"@deepseek-ai/dsh-client-
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-client-
|
|
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"
|
|
47
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.1-rc.1",
|
|
48
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.1-rc.1",
|
|
49
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.1-rc.1",
|
|
50
|
+
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.1",
|
|
51
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.1-rc.1",
|
|
52
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.1"
|
|
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-api-remotes": "^0.1.
|
|
63
|
-
"@deepseek-ai/dsh-client-
|
|
64
|
-
"@deepseek-ai/dsh-client-
|
|
65
|
-
"@deepseek-ai/dsh-client-
|
|
66
|
-
"@deepseek-ai/dsh-client-test-runtime": "^0.1.
|
|
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-api-remotes": "^0.1.1-rc.1",
|
|
59
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.1-rc.1",
|
|
60
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.1-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.1",
|
|
62
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.1-rc.1",
|
|
63
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.1-rc.1",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.1",
|
|
65
|
+
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.1",
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.1-rc.1"
|
|
72
67
|
},
|
|
73
68
|
"files": [
|
|
74
69
|
"lib/index.js",
|