Stop requiring dsh-client-store in the Plugins card bundle.

Shipped dsh web seed has no client-store entry; use a private snapshot store and only externalize platform seed modules.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-04 22:38:52 +08:00
parent e45657b1ee
commit 69a4820369
6 changed files with 78 additions and 25 deletions

View file

@ -333,8 +333,27 @@ function NetxopsCard(props) {
});
}
// src/client/snapshot-store.ts
function createSnapshotStore(init) {
let state = init;
const listeners = new Set;
return {
getSnapshot: () => state,
subscribe: (listener) => {
listeners.add(listener);
return () => {
listeners.delete(listener);
};
},
set: (next) => {
state = next;
for (const listener of [...listeners])
listener();
}
};
}
// src/client/card-form.ts
var import_dsh_client_store = require("@deepseek-ai/dsh-client-store");
function textField(field) {
return {
field,
@ -363,7 +382,7 @@ class CardForm {
});
}
bind(project) {
const store = import_dsh_client_store.createSnapshotStore(project());
const store = createSnapshotStore(project());
this.listeners.add(() => {
store.set(project());
});