@dsmm/dsmm 0.3.2 → 0.3.3
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.md +2 -2
- package/cordis.patch.yml +0 -9
- package/docs/agent-presets.md +5 -5
- package/docs/compatibility.md +2 -6
- package/docs/migration-from-ocmm.md +1 -1
- package/docs/roadmap.md +5 -12
- package/docs/settings-status.md +1 -1
- package/lib/client/ChildrenPanel.d.ts +1 -4
- package/lib/client/ChildrenPanel.js +3 -3
- package/lib/client/DeploymentPage.d.ts +1 -3
- package/lib/client/DeploymentPage.js +2 -2
- package/lib/client/PermissionsPanel.d.ts +1 -3
- package/lib/client/PermissionsPanel.js +2 -3
- package/lib/client/children-locales.d.ts +4 -4
- package/lib/client/controller.js +4 -1
- package/lib/client/deployment-locales.js +0 -1
- package/lib/client/deployment-modules.js +1 -1
- package/lib/client/index.js +2 -7
- package/lib/client/locales.js +131 -119
- package/lib/client/permission-locales.d.ts +0 -26
- package/lib/client/permission-locales.js +0 -20
- package/lib/client.js +1837 -3634
- package/lib/index.d.ts +0 -2
- package/lib/index.js +9 -22
- package/lib/native-admission.d.ts +0 -3
- package/lib/native-admission.js +12 -45
- package/lib/permission-fs-search.js +1 -2
- package/lib/permission-fs.js +1 -2
- package/lib/permission-web.js +1 -2
- package/lib/preset-materializer.js +3 -3
- package/lib/preset-registry.d.ts +20 -2
- package/lib/preset-registry.js +46 -17
- package/lib/profile-diagnostics.js +1 -1
- package/lib/profile-remote.js +1 -3
- package/lib/role-policy.js +2 -2
- package/lib/role-subagents.js +2 -1
- package/lib/roles.d.ts +2 -0
- package/lib/roles.js +2 -0
- package/lib/settings.d.ts +1 -3
- package/lib/settings.js +4 -9
- package/package.json +1 -5
- package/lib/client/ChildPermissions.d.ts +0 -43
- package/lib/client/ChildPermissions.js +0 -100
- package/lib/client/HistoryContinuation.d.ts +0 -7
- package/lib/client/HistoryContinuation.js +0 -22
- package/lib/client/PermissionPanelEntry.d.ts +0 -8
- package/lib/client/PermissionPanelEntry.js +0 -11
- package/lib/client/TemporaryPermissions.d.ts +0 -21
- package/lib/client/TemporaryPermissions.js +0 -94
- package/lib/client/history-controller.d.ts +0 -29
- package/lib/client/history-controller.js +0 -111
- package/lib/client/history-entry.d.ts +0 -11
- package/lib/client/history-entry.js +0 -106
- package/lib/client/history-locales.d.ts +0 -95
- package/lib/client/history-locales.js +0 -41
- package/lib/client/temporary-permission-client.d.ts +0 -20
- package/lib/client/temporary-permission-client.js +0 -52
- package/lib/client/temporary-permission-entry.d.ts +0 -6
- package/lib/client/temporary-permission-entry.js +0 -56
- package/lib/history-candidates.d.ts +0 -30
- package/lib/history-candidates.js +0 -176
- package/lib/history-codec.d.ts +0 -11
- package/lib/history-codec.js +0 -102
- package/lib/history-contract.d.ts +0 -44
- package/lib/history-contract.js +0 -2
- package/lib/history-controller.d.ts +0 -42
- package/lib/history-controller.js +0 -329
- package/lib/history-policy.d.ts +0 -4
- package/lib/history-policy.js +0 -8
- package/lib/history-remote.d.ts +0 -28
- package/lib/history-remote.js +0 -17
- package/lib/history-rpc.d.ts +0 -24
- package/lib/history-rpc.js +0 -136
- package/lib/history-support.d.ts +0 -15
- package/lib/history-support.js +0 -21
- package/lib/history-types.d.ts +0 -67
- package/lib/history-types.js +0 -2
- package/lib/permission-child-control.d.ts +0 -36
- package/lib/permission-child-control.js +0 -164
- package/lib/permission-exec-argv.d.ts +0 -32
- package/lib/permission-exec-argv.js +0 -171
- package/lib/permission-temporary-files.d.ts +0 -19
- package/lib/permission-temporary-files.js +0 -248
- package/lib/permission-temporary-grants.d.ts +0 -106
- package/lib/permission-temporary-grants.js +0 -198
- package/lib/permission-temporary-install.d.ts +0 -25
- package/lib/permission-temporary-install.js +0 -86
- package/lib/permission-temporary-remote.d.ts +0 -19
- package/lib/permission-temporary-remote.js +0 -75
- package/lib/permission-temporary-rpc.d.ts +0 -37
- package/lib/permission-temporary-rpc.js +0 -154
- package/lib/permission-temporary-types.d.ts +0 -47
- package/lib/permission-temporary-types.js +0 -2
- package/lib/permission-temporary-web.d.ts +0 -11
- package/lib/permission-temporary-web.js +0 -154
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-gateway@0.2.1-rc.2.patch +0 -13291
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-remotes@0.2.1-rc.2.patch +0 -9133
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-client-ui-approval@0.2.1-rc.2.patch +0 -156
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-subagent@0.2.1-rc.2.patch +0 -3546
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-user-approval@0.2.1-rc.2.patch +0 -431
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-web@0.2.1-rc.2.patch +0 -119
- package/patches/dsh-approval-settlement/README.md +0 -41
- package/patches/dsh-approval-settlement/metadata.json +0 -10
- package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-loop@0.2.1-rc.2.patch +0 -383
- package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-preset-registry@0.2.1-rc.2.patch +0 -55
- package/patches/dsh-session-activation/@deepseek-ai__dsh-api-session-controller@0.2.1-rc.2.patch +0 -16673
- package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-subagent@0.2.1-rc.2.patch +0 -29
- package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-workspace@0.2.1-rc.2.patch +0 -196
- package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence-jsonl@0.2.1-rc.2.patch +0 -35
- package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence@0.2.1-rc.2.patch +0 -40
package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-subagent@0.2.1-rc.2.patch
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
diff --git a/lib/client.js b/lib/client.js
|
|
2
|
-
index 91354c1003b5d794f8ecb91aa5ccc450866a92dc..57c72bb14051576dda79d160a18dc8701b529d7d 100644
|
|
3
|
-
--- a/lib/client.js
|
|
4
|
-
+++ b/lib/client.js
|
|
5
|
-
@@ -759,11 +759,23 @@ window.__ModuleLoader__.load({
|
|
6
|
-
const address = parseSubagentChatAddress(resourceAddress);
|
|
7
|
-
if (address === void 0) throw new Error(`ui-subagent: invalid chat resource address "${resourceAddress}"`);
|
|
8
|
-
if (isAbortRequested(signal)) return;
|
|
9
|
-
+ let history;
|
|
10
|
-
+ if (sessions.historyRequired) {
|
|
11
|
-
+ try {
|
|
12
|
-
+ history = await sessions.prepareHistoryOpen(address, { signal });
|
|
13
|
-
+ } catch (error) {
|
|
14
|
-
+ if (isAbortRequested(signal)) return;
|
|
15
|
-
+ throw error;
|
|
16
|
-
+ }
|
|
17
|
-
+ if (isAbortRequested(signal)) return;
|
|
18
|
-
+ }
|
|
19
|
-
const reference = sessions.retain(address, {
|
|
20
|
-
source: "sidebarChat",
|
|
21
|
-
- signal
|
|
22
|
-
+ signal,
|
|
23
|
-
+ ...history === void 0 ? {} : { history }
|
|
24
|
-
});
|
|
25
|
-
try {
|
|
26
|
-
+ if (isAbortRequested(signal)) return;
|
|
27
|
-
yield {
|
|
28
|
-
ok: true,
|
|
29
|
-
value: {
|
package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-workspace@0.2.1-rc.2.patch
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
diff --git a/lib/client.js b/lib/client.js
|
|
2
|
-
index 5cca45b3eb659eef174c44206668b4c36bdad1e1..c38d7d0029dd215d2b7baff7258a4c425dde2321 100644
|
|
3
|
-
--- a/lib/client.js
|
|
4
|
-
+++ b/lib/client.js
|
|
5
|
-
@@ -1368,6 +1368,7 @@ window.__ModuleLoader__.load({
|
|
6
|
-
lifetime = new AbortController();
|
|
7
|
-
selection = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({}, { persist: { name: "dsh.sessions.current" } });
|
|
8
|
-
mainReference;
|
|
9
|
-
+ historyNavigation;
|
|
10
|
-
/**
|
|
11
|
-
* @param ctx - Client root Context.
|
|
12
|
-
* @param directoryPicker - the directory-picking Remote namespace.
|
|
13
|
-
@@ -1400,7 +1401,11 @@ window.__ModuleLoader__.load({
|
|
14
|
-
/**
|
|
15
|
-
* @param reuse - preset for the reused or created blank; absent creates a fresh Session.
|
|
16
|
-
*/
|
|
17
|
-
- async connectBlank(workspaceId, reuse) {
|
|
18
|
-
+ async connectBlank(workspaceId, reuse, signal = this.lifetime.signal) {
|
|
19
|
-
+ if (this.sessions.historyRequired) {
|
|
20
|
-
+ await this.sessions.prepareHistoryConnection({ signal });
|
|
21
|
-
+ signal.throwIfAborted();
|
|
22
|
-
+ }
|
|
23
|
-
const workspace = this.workspaces.list.getSnapshot().items.find((item) => item.workspaceId === workspaceId);
|
|
24
|
-
if (workspace === void 0) throw new Error(`uiWorkspace.connectWorkspace: unknown workspace ${workspaceId}`);
|
|
25
|
-
if (reuse === void 0) return this.sessions.create({ workspaceId });
|
|
26
|
-
@@ -1468,16 +1473,28 @@ window.__ModuleLoader__.load({
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
openSession(target) {
|
|
30
|
-
- this.replaceMain(target, this.lifetime.signal, "reveal");
|
|
31
|
-
+ if (!this.sessions.historyRequired) {
|
|
32
|
-
+ this.replaceMain(target, this.lifetime.signal, "reveal");
|
|
33
|
-
+ return;
|
|
34
|
-
+ }
|
|
35
|
-
+ const navigation = this.beginHistoryNavigation();
|
|
36
|
-
+ this.replaceMain(target, navigation, "reveal").catch((error) => {
|
|
37
|
-
+ if (!navigation.aborted) this.notify({ kind: "createFailed", message: creationFailureMessage(error) });
|
|
38
|
-
+ });
|
|
39
|
-
+ }
|
|
40
|
-
+ beginHistoryNavigation() {
|
|
41
|
-
+ this.historyNavigation?.abort();
|
|
42
|
-
+ this.historyNavigation = new AbortController();
|
|
43
|
-
+ return AbortSignal.any([this.ctx.layout.beginNavigation(), this.lifetime.signal, this.historyNavigation.signal]);
|
|
44
|
-
}
|
|
45
|
-
openWorkspace(workspaceId, beforeOpen, options = {}) {
|
|
46
|
-
return this.openWorkspaceSession(workspaceId, beforeOpen, options);
|
|
47
|
-
}
|
|
48
|
-
async openWorkspaceSession(workspaceId, beforeOpen, reuse) {
|
|
49
|
-
- const navigation = AbortSignal.any([this.ctx.layout.beginNavigation(), this.lifetime.signal]);
|
|
50
|
-
+ const navigation = this.sessions.historyRequired ? this.beginHistoryNavigation() : AbortSignal.any([this.ctx.layout.beginNavigation(), this.lifetime.signal]);
|
|
51
|
-
let sessionId;
|
|
52
|
-
try {
|
|
53
|
-
- sessionId = await this.connectBlank(workspaceId, reuse);
|
|
54
|
-
+ sessionId = await this.connectBlank(workspaceId, reuse, navigation);
|
|
55
|
-
} catch (error) {
|
|
56
|
-
if (!navigation.aborted) this.notify({
|
|
57
|
-
kind: "createFailed",
|
|
58
|
-
@@ -1486,9 +1503,10 @@ window.__ModuleLoader__.load({
|
|
59
|
-
throw error;
|
|
60
|
-
}
|
|
61
|
-
if (navigation.aborted) return;
|
|
62
|
-
- this.replaceMain(sessionId, navigation, "reveal", beforeOpen);
|
|
63
|
-
+ await this.replaceMain(sessionId, navigation, "reveal", beforeOpen);
|
|
64
|
-
}
|
|
65
|
-
async forkSession(sessionId, onCreated, options) {
|
|
66
|
-
+ if (this.sessions.historyRequired) await this.sessions.prepareHistoryConnection({ signal: this.lifetime.signal });
|
|
67
|
-
return this.sessions.fork({
|
|
68
|
-
sessionId,
|
|
69
|
-
increaseTitle: true,
|
|
70
|
-
@@ -1589,6 +1607,10 @@ window.__ModuleLoader__.load({
|
|
71
|
-
initial = "done";
|
|
72
|
-
}, (reason) => {
|
|
73
|
-
if (this.lifetime.signal.aborted) return;
|
|
74
|
-
+ if (this.sessions.historyRequired && reason?.name === "AbortError") {
|
|
75
|
-
+ initial = "done";
|
|
76
|
-
+ return;
|
|
77
|
-
+ }
|
|
78
|
-
initial = "waiting";
|
|
79
|
-
console.warn("initial Session restoration failed:", reason);
|
|
80
|
-
});
|
|
81
|
-
@@ -1603,18 +1625,21 @@ window.__ModuleLoader__.load({
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
async restoreSelection(workspaces, sessions) {
|
|
85
|
-
+ const preparedNavigation = this.sessions.historyRequired ? this.beginHistoryNavigation() : void 0;
|
|
86
|
-
+ if (preparedNavigation) await this.sessions.prepareHistoryConnection({ signal: preparedNavigation });
|
|
87
|
-
+ preparedNavigation?.throwIfAborted();
|
|
88
|
-
const saved = this.selection.getSnapshot();
|
|
89
|
-
if (saved.subagentAddress !== void 0) {
|
|
90
|
-
- this.replaceMain(saved.subagentAddress, this.lifetime.signal, "preserve");
|
|
91
|
-
+ await this.replaceMain(saved.subagentAddress, preparedNavigation ?? this.lifetime.signal, "preserve");
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const summary = saved.sessionId === void 0 ? void 0 : sessions.byId[saved.sessionId];
|
|
95
|
-
const workspace = summary === void 0 ? void 0 : workspaces.items.find((item) => item.sessionIds.includes(summary.id));
|
|
96
|
-
if (summary !== void 0 && (!summary.blank || workspace === void 0)) {
|
|
97
|
-
- this.replaceMain(summary.id, this.lifetime.signal, "preserve");
|
|
98
|
-
+ await this.replaceMain(summary.id, preparedNavigation ?? this.lifetime.signal, "preserve");
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
- const navigation = AbortSignal.any([this.ctx.layout.beginNavigation(), this.lifetime.signal]);
|
|
102
|
-
+ const navigation = preparedNavigation ?? AbortSignal.any([this.ctx.layout.beginNavigation(), this.lifetime.signal]);
|
|
103
|
-
let sessionId;
|
|
104
|
-
if (summary !== void 0 && workspace !== void 0 && summary.cwd === workspace.path && !workspaces.archivedSessionIds.includes(summary.id)) sessionId = await this.restoreBlank(workspace.workspaceId, summary.id);
|
|
105
|
-
let target = workspace?.workspaceId ?? recentWorkspace(workspaces.items, sessions.byId);
|
|
106
|
-
@@ -1624,7 +1649,7 @@ window.__ModuleLoader__.load({
|
|
107
|
-
target = prepared?.workspaceId;
|
|
108
|
-
}
|
|
109
|
-
if (sessionId === void 0 && target !== void 0) sessionId = await this.connectWorkspace(target);
|
|
110
|
-
- if (sessionId !== void 0 && !navigation.aborted) this.replaceMain(sessionId, navigation, "preserve");
|
|
111
|
-
+ if (sessionId !== void 0 && !navigation.aborted) await this.replaceMain(sessionId, navigation, "preserve");
|
|
112
|
-
}
|
|
113
|
-
async initializeDefaultWorkspace(signal) {
|
|
114
|
-
try {
|
|
115
|
-
@@ -1642,6 +1667,7 @@ window.__ModuleLoader__.load({
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
clearMain() {
|
|
119
|
-
+ this.historyNavigation?.abort();
|
|
120
|
-
const previous = this.mainReference;
|
|
121
|
-
this.mainReference = void 0;
|
|
122
|
-
this.selection.set({});
|
|
123
|
-
@@ -1649,6 +1675,7 @@ window.__ModuleLoader__.load({
|
|
124
|
-
this.ctx.layout.selectPanel(null);
|
|
125
|
-
}
|
|
126
|
-
replaceMain(target, signal, panel, beforeOpen) {
|
|
127
|
-
+ if (this.sessions.historyRequired) return this.replaceMainRequired(target, signal, panel, beforeOpen);
|
|
128
|
-
signal.throwIfAborted();
|
|
129
|
-
const reference = this.sessions.retain(target, { source: "mainView" });
|
|
130
|
-
try {
|
|
131
|
-
@@ -1672,6 +1699,37 @@ window.__ModuleLoader__.load({
|
|
132
|
-
previous?.release();
|
|
133
|
-
if (panel === "reveal") this.ctx.layout.selectPanel(null);
|
|
134
|
-
}
|
|
135
|
-
+ async replaceMainRequired(target, signal, panel, beforeOpen) {
|
|
136
|
-
+ signal.throwIfAborted();
|
|
137
|
-
+ const address = typeof target === "string" ? target : Object.freeze(structuredClone(target));
|
|
138
|
-
+ const history = await this.sessions.prepareHistoryOpen(address, { signal });
|
|
139
|
-
+ signal.throwIfAborted();
|
|
140
|
-
+ const reference = this.sessions.retain(address, { source: "mainView", history });
|
|
141
|
-
+ let cancelled;
|
|
142
|
-
+ try {
|
|
143
|
-
+ await new Promise((resolve, reject) => {
|
|
144
|
-
+ cancelled = () => reject(signal.reason);
|
|
145
|
-
+ signal.addEventListener("abort", cancelled, { once: true });
|
|
146
|
-
+ Promise.resolve(reference.ready).then(resolve, reject);
|
|
147
|
-
+ if (signal.aborted) cancelled();
|
|
148
|
-
+ });
|
|
149
|
-
+ signal.throwIfAborted();
|
|
150
|
-
+ this.sessions.binding(reference.sessionId);
|
|
151
|
-
+ beforeOpen?.(reference.sessionId);
|
|
152
|
-
+ signal.throwIfAborted();
|
|
153
|
-
+ const subagentAddress = typeof address === "string" ? this.sessions.subagentAddress(reference.sessionId) : address;
|
|
154
|
-
+ this.selection.set({ sessionId: reference.sessionId, ...subagentAddress === void 0 ? {} : { subagentAddress } });
|
|
155
|
-
+ } catch (error) {
|
|
156
|
-
+ reference.release();
|
|
157
|
-
+ throw error;
|
|
158
|
-
+ } finally {
|
|
159
|
-
+ if (cancelled) signal.removeEventListener("abort", cancelled);
|
|
160
|
-
+ }
|
|
161
|
-
+ const previous = this.mainReference;
|
|
162
|
-
+ this.mainReference = reference;
|
|
163
|
-
+ previous?.release();
|
|
164
|
-
+ if (panel === "reveal") this.ctx.layout.selectPanel(null);
|
|
165
|
-
+ }
|
|
166
|
-
};
|
|
167
|
-
/**
|
|
168
|
-
* `error` as the Session Controller's creation failure, or undefined when it
|
|
169
|
-
diff --git a/lib/types/client/navigation.d.ts b/lib/types/client/navigation.d.ts
|
|
170
|
-
index 18081beb299a351e2f225faad63fa3f8c406a90c..0f0e53ca0ca3801261f88a4dc3422d0ae883ad55 100644
|
|
171
|
-
--- a/lib/types/client/navigation.d.ts
|
|
172
|
-
+++ b/lib/types/client/navigation.d.ts
|
|
173
|
-
@@ -126,6 +126,7 @@ declare class UiWorkspaceService extends Service implements UiWorkspace {
|
|
174
|
-
private readonly lifetime;
|
|
175
|
-
private readonly selection;
|
|
176
|
-
private mainReference;
|
|
177
|
-
+ private historyNavigation;
|
|
178
|
-
/**
|
|
179
|
-
* @param ctx - Client root Context.
|
|
180
|
-
* @param directoryPicker - the directory-picking Remote namespace.
|
|
181
|
-
@@ -156,6 +157,7 @@ declare class UiWorkspaceService extends Service implements UiWorkspace {
|
|
182
|
-
*/
|
|
183
|
-
private restoreBlank;
|
|
184
|
-
openSession(target: SessionTarget): void;
|
|
185
|
-
+ private beginHistoryNavigation;
|
|
186
|
-
openWorkspace(workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void, options?: Pick<StartSessionOptions, 'agentPreset'>): Promise<void>;
|
|
187
|
-
private openWorkspaceSession;
|
|
188
|
-
forkSession(sessionId: SessionId, onCreated?: (childId: SessionId) => void, options?: Pick<Parameters<ISessions['fork']>[0], 'allowMigration'>): Promise<SessionId>;
|
|
189
|
-
@@ -178,6 +180,7 @@ declare class UiWorkspaceService extends Service implements UiWorkspace {
|
|
190
|
-
private clearArchivedCurrent;
|
|
191
|
-
private clearMain;
|
|
192
|
-
private replaceMain;
|
|
193
|
-
+ private replaceMainRequired;
|
|
194
|
-
}
|
|
195
|
-
export { UiWorkspaceService };
|
|
196
|
-
//# sourceMappingURL=navigation.d.ts.map
|
package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence-jsonl@0.2.1-rc.2.patch
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
diff --git a/lib/index.js b/lib/index.js
|
|
2
|
-
index 8247fd4f6fb1114ae1080f5e98b124e10376468f..3044242107b3e9c7ead8337f4c61f910adfc0711 100644
|
|
3
|
-
--- a/lib/index.js
|
|
4
|
-
+++ b/lib/index.js
|
|
5
|
-
@@ -2401,6 +2401,7 @@ function waitWithAbort(operation, signal) {
|
|
6
|
-
* flush, and never existed if the process crashes before that.
|
|
7
|
-
*/
|
|
8
|
-
var JsonlSessionPersistence = class extends SessionPersistence {
|
|
9
|
-
+ writeAdmission = Object.freeze({ lockedInspection: 1 });
|
|
10
|
-
config;
|
|
11
|
-
tracker;
|
|
12
|
-
/** Backend label for diagnostics and effects; shadows `Service.name` without changing the service key. */
|
|
13
|
-
@@ -2525,6 +2526,22 @@ var JsonlSessionPersistence = class extends SessionPersistence {
|
|
14
|
-
lease = await this.acquireLease(id, void 0, dirname(resolved.currentPath));
|
|
15
|
-
const prepared = await this.requireStoredLog(id, options?.signal);
|
|
16
|
-
options?.signal?.throwIfAborted();
|
|
17
|
-
+ if (options?.validateWriteAdmission !== void 0) {
|
|
18
|
-
+ const immutable = value => {
|
|
19
|
-
+ if (value !== null && typeof value === "object") {
|
|
20
|
-
+ for (const child of Object.values(value)) immutable(child);
|
|
21
|
-
+ Object.freeze(value);
|
|
22
|
-
+ }
|
|
23
|
-
+ return value;
|
|
24
|
-
+ };
|
|
25
|
-
+ const inspection = immutable(structuredClone({ meta: prepared.meta, inheritedEventCount: prepared.inheritedEventCount, events: prepared.events, sourceVersion: prepared.status === "prepared" ? prepared.publication.source.sourceVersion : SESSION_FORMAT_VERSION, migrationRequired: prepared.status === "prepared" }));
|
|
26
|
-
+ const result = options.validateWriteAdmission(inspection);
|
|
27
|
-
+ if (result !== void 0) {
|
|
28
|
-
+ Promise.resolve(result).catch(() => {});
|
|
29
|
-
+ throw new TypeError("Write admission must complete synchronously without a return value");
|
|
30
|
-
+ }
|
|
31
|
-
+ options?.signal?.throwIfAborted();
|
|
32
|
-
+ }
|
|
33
|
-
let stored;
|
|
34
|
-
if (prepared.status === "prepared") stored = await this.publishStoredMigration(id, prepared);
|
|
35
|
-
else stored = prepared;
|
package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence@0.2.1-rc.2.patch
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
diff --git a/lib/index.js b/lib/index.js
|
|
2
|
-
index 5fa994b23973e17d50d156be8026bf6e0ece60be..806f98d4677cced389c019a8bb6eaf55f240ca7c 100644
|
|
3
|
-
--- a/lib/index.js
|
|
4
|
-
+++ b/lib/index.js
|
|
5
|
-
@@ -259,6 +259,7 @@ function assertContiguous(id, events, cursor) {
|
|
6
|
-
* on this backend instance observe at least that prefix.
|
|
7
|
-
*/
|
|
8
|
-
var SessionPersistence = class extends Service {
|
|
9
|
-
+ writeAdmission;
|
|
10
|
-
/** Process-local instance identity, stable through Context proxies and distinct after service replacement. */
|
|
11
|
-
identity = Symbol("sessionPersistence");
|
|
12
|
-
constructor(ctx) {
|
|
13
|
-
diff --git a/lib/types/index.d.ts b/lib/types/index.d.ts
|
|
14
|
-
index fd44f3aa1f4f060b2b65fd756664a1acee2ac81e..dbdb8685ae631eef3232c970e30aa9e14c8e3532 100644
|
|
15
|
-
--- a/lib/types/index.d.ts
|
|
16
|
-
+++ b/lib/types/index.d.ts
|
|
17
|
-
@@ -59,7 +59,14 @@ export interface SessionInspection extends SessionStorageMetadata {
|
|
18
|
-
readonly events: readonly SessionEvent[];
|
|
19
|
-
}
|
|
20
|
-
/** Options for {@link SessionPersistence.open}. */
|
|
21
|
-
+export interface SessionWriteInspection extends SessionInspection {
|
|
22
|
-
+ readonly sourceVersion: number;
|
|
23
|
-
+ readonly migrationRequired: boolean;
|
|
24
|
-
+}
|
|
25
|
-
+/** Options for {@link SessionPersistence.open}. */
|
|
26
|
-
export interface SessionPersistenceOpenOptions {
|
|
27
|
-
+ /** Synchronous veto under the writer lease, before migration publication or handle grant. */
|
|
28
|
-
+ readonly validateWriteAdmission?: (inspection: SessionWriteInspection) => undefined;
|
|
29
|
-
/** Optional cancellation observed before backend work starts. */
|
|
30
|
-
readonly signal?: AbortSignal;
|
|
31
|
-
}
|
|
32
|
-
@@ -99,6 +106,8 @@ declare module '@deepseek-ai/cordis' {
|
|
33
|
-
* on this backend instance observe at least that prefix.
|
|
34
|
-
*/
|
|
35
|
-
export declare abstract class SessionPersistence extends Service {
|
|
36
|
-
+ /** Defined only by backends implementing the locked synchronous admission contract. */
|
|
37
|
-
+ readonly writeAdmission?: Readonly<{ lockedInspection: 1 }>;
|
|
38
|
-
/** Process-local instance identity, stable through Context proxies and distinct after service replacement. */
|
|
39
|
-
readonly identity: symbol;
|
|
40
|
-
constructor(ctx: Context);
|