@dsmm/dsmm 0.3.0 → 0.3.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.md +26 -40
- package/cordis.patch.yml +9 -13
- package/docs/agent-presets.md +26 -14
- package/docs/compatibility.md +24 -68
- package/docs/deferred-native-approval-risk.md +8 -12
- package/docs/design.md +25 -254
- package/docs/lsp.md +2 -2
- package/docs/migration-from-ocmm.md +38 -51
- package/docs/model-routing.md +21 -21
- package/docs/native-permissions.md +17 -7
- package/docs/profiles.md +13 -9
- package/docs/releasing.md +25 -311
- package/docs/roadmap.md +52 -241
- package/docs/runtime-recovery.md +29 -91
- package/docs/safety-guards.md +19 -16
- package/docs/settings-status.md +23 -11
- package/docs/skill-sync.md +17 -17
- package/docs/web-fetch-fakeip.md +82 -0
- package/lib/child-capture.d.ts +12 -2
- package/lib/child-capture.js +22 -5
- package/lib/client/ChildPermissions.d.ts +43 -0
- package/lib/client/ChildPermissions.js +100 -0
- package/lib/client/ChildrenPanel.d.ts +5 -5
- package/lib/client/ChildrenPanel.js +6 -18
- package/lib/client/DeploymentFields.d.ts +32 -0
- package/lib/client/DeploymentFields.js +70 -0
- package/lib/client/DeploymentPage.d.ts +21 -6
- package/lib/client/DeploymentPage.js +80 -112
- package/lib/client/HistoryContinuation.d.ts +7 -0
- package/lib/client/HistoryContinuation.js +22 -0
- package/lib/client/NativeCommandEntries.d.ts +17 -0
- package/lib/client/NativeCommandEntries.js +68 -0
- package/lib/client/PermissionPanelEntry.d.ts +8 -0
- package/lib/client/PermissionPanelEntry.js +11 -0
- package/lib/client/PermissionsPanel.d.ts +3 -1
- package/lib/client/PermissionsPanel.js +10 -9
- package/lib/client/ProfilesSection.js +8 -6
- package/lib/client/RoleAvailability.js +1 -1
- package/lib/client/RoleToolView-data.d.ts +35 -0
- package/lib/client/RoleToolView-data.js +52 -0
- package/lib/client/RoleToolView-locales.d.ts +36 -0
- package/lib/client/RoleToolView-locales.js +20 -0
- package/lib/client/RoleToolView.d.ts +10 -0
- package/lib/client/RoleToolView.js +47 -0
- package/lib/client/SessionProfiles.js +51 -24
- package/lib/client/TemporaryPermissions.d.ts +21 -0
- package/lib/client/TemporaryPermissions.js +94 -0
- package/lib/client/children-controller.d.ts +2 -8
- package/lib/client/children-controller.js +1 -26
- package/lib/client/children-locales.d.ts +27 -52
- package/lib/client/children-locales.js +8 -12
- package/lib/client/configuration-display.d.ts +5 -0
- package/lib/client/configuration-display.js +11 -0
- package/lib/client/controller.d.ts +18 -0
- package/lib/client/controller.js +118 -28
- package/lib/client/deployment-controller.d.ts +13 -1
- package/lib/client/deployment-controller.js +84 -24
- package/lib/client/deployment-data.d.ts +1 -0
- package/lib/client/deployment-data.js +4 -1
- package/lib/client/deployment-locales.d.ts +43 -0
- package/lib/client/deployment-locales.js +45 -19
- package/lib/client/deployment-modules.d.ts +9 -0
- package/lib/client/deployment-modules.js +24 -0
- package/lib/client/deployment-workspace.d.ts +48 -0
- package/lib/client/deployment-workspace.js +123 -0
- package/lib/client/history-controller.d.ts +29 -0
- package/lib/client/history-controller.js +111 -0
- package/lib/client/history-entry.d.ts +11 -0
- package/lib/client/history-entry.js +106 -0
- package/lib/client/history-locales.d.ts +95 -0
- package/lib/client/history-locales.js +41 -0
- package/lib/client/index.js +26 -76
- package/lib/client/locales.d.ts +13 -0
- package/lib/client/locales.js +104 -86
- package/lib/client/permission-controller.d.ts +1 -0
- package/lib/client/permission-controller.js +3 -2
- package/lib/client/permission-locales.d.ts +51 -0
- package/lib/client/permission-locales.js +59 -19
- package/lib/client/session-labels.js +4 -3
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +9 -8
- package/lib/client/temporary-permission-client.d.ts +20 -0
- package/lib/client/temporary-permission-client.js +52 -0
- package/lib/client/temporary-permission-entry.d.ts +6 -0
- package/lib/client/temporary-permission-entry.js +56 -0
- package/lib/client.js +5691 -3439
- package/lib/commands.js +2 -0
- package/lib/config-file-store.d.ts +3 -0
- package/lib/config-file-store.js +4 -2
- package/lib/config-revision.d.ts +5 -0
- package/lib/config-revision.js +11 -0
- package/lib/core-permission-authority.js +11 -41
- package/lib/deployment-config.d.ts +9 -2
- package/lib/deployment-config.js +35 -8
- package/lib/deployment-permission-rules.js +19 -7
- package/lib/dsh-types.d.ts +1 -1
- package/lib/history-candidates.d.ts +30 -0
- package/lib/history-candidates.js +176 -0
- package/lib/history-codec.d.ts +11 -0
- package/lib/history-codec.js +102 -0
- package/lib/history-contract.d.ts +44 -0
- package/lib/history-contract.js +2 -0
- package/lib/history-controller.d.ts +42 -0
- package/lib/history-controller.js +329 -0
- package/lib/history-policy.d.ts +4 -0
- package/lib/history-policy.js +8 -0
- package/lib/history-remote.d.ts +28 -0
- package/lib/history-remote.js +17 -0
- package/lib/history-rpc.d.ts +24 -0
- package/lib/history-rpc.js +136 -0
- package/lib/history-support.d.ts +15 -0
- package/lib/history-support.js +21 -0
- package/lib/history-types.d.ts +67 -0
- package/lib/history-types.js +2 -0
- package/lib/host-llm-startup.js +3 -3
- package/lib/host-llm.d.ts +9 -3
- package/lib/host-llm.js +48 -8
- package/lib/index.d.ts +18 -20
- package/lib/index.js +147 -415
- package/lib/lifetime.d.ts +4 -0
- package/lib/lifetime.js +22 -0
- package/lib/live-pi-ai-owner.d.ts +1 -0
- package/lib/live-pi-ai-owner.js +8 -4
- package/lib/mode.d.ts +3 -2
- package/lib/mode.js +28 -41
- package/lib/model-routing.d.ts +2 -8
- package/lib/model-routing.js +59 -175
- package/lib/native-admission.d.ts +77 -0
- package/lib/native-admission.js +503 -0
- package/lib/native-pi-ai-wire.d.ts +3 -1
- package/lib/native-pi-ai-wire.js +47 -13
- package/lib/permission-child-control.d.ts +36 -0
- package/lib/permission-child-control.js +164 -0
- package/lib/permission-control.d.ts +2 -3
- package/lib/permission-control.js +7 -0
- package/lib/permission-controller.js +2 -2
- package/lib/permission-exec-argv.d.ts +32 -0
- package/lib/permission-exec-argv.js +171 -0
- package/lib/permission-fs-search.js +2 -1
- package/lib/permission-fs.js +2 -1
- package/lib/permission-native-rules.js +3 -3
- package/lib/permission-temporary-files.d.ts +19 -0
- package/lib/permission-temporary-files.js +248 -0
- package/lib/permission-temporary-grants.d.ts +106 -0
- package/lib/permission-temporary-grants.js +198 -0
- package/lib/permission-temporary-install.d.ts +25 -0
- package/lib/permission-temporary-install.js +86 -0
- package/lib/permission-temporary-remote.d.ts +19 -0
- package/lib/permission-temporary-remote.js +75 -0
- package/lib/permission-temporary-rpc.d.ts +37 -0
- package/lib/permission-temporary-rpc.js +154 -0
- package/lib/permission-temporary-types.d.ts +47 -0
- package/lib/permission-temporary-types.js +2 -0
- package/lib/permission-temporary-web.d.ts +11 -0
- package/lib/permission-temporary-web.js +154 -0
- package/lib/permission-web.js +2 -1
- package/lib/preset-registry.js +3 -2
- package/lib/preset-skills.d.ts +3 -12
- package/lib/preset-skills.js +28 -58
- package/lib/profile-diagnostics.d.ts +1 -1
- package/lib/profile-diagnostics.js +2 -2
- package/lib/profile-remote.js +61 -22
- package/lib/profile-rpc.d.ts +4 -3
- package/lib/profile-rpc.js +35 -37
- package/lib/profile-runtime.d.ts +42 -74
- package/lib/profile-runtime.js +314 -617
- package/lib/profile-store.d.ts +20 -8
- package/lib/profile-store.js +112 -63
- package/lib/profile-types.d.ts +19 -4
- package/lib/profiles.d.ts +3 -1
- package/lib/profiles.js +9 -7
- package/lib/prompt-content.d.ts +1 -0
- package/lib/prompt-content.js +4 -1
- package/lib/prompts.d.ts +2 -12
- package/lib/prompts.js +11 -66
- package/lib/role-control-remote.d.ts +1 -4
- package/lib/role-control-remote.js +8 -36
- package/lib/role-control-rpc.d.ts +10 -36
- package/lib/role-control-rpc.js +112 -269
- package/lib/role-control-types.d.ts +3 -26
- package/lib/role-control-types.js +3 -4
- package/lib/role-identity.d.ts +5 -0
- package/lib/role-identity.js +10 -0
- package/lib/role-invocation.d.ts +3 -3
- package/lib/role-invocation.js +2 -2
- package/lib/role-llm-runtime.js +5 -11
- package/lib/role-policy.d.ts +19 -50
- package/lib/role-policy.js +136 -508
- package/lib/role-providers.d.ts +5 -8
- package/lib/role-providers.js +20 -86
- package/lib/role-routing.d.ts +1 -3
- package/lib/role-routing.js +24 -34
- package/lib/role-subagents.d.ts +5 -14
- package/lib/role-subagents.js +163 -108
- package/lib/runtime-integration.d.ts +5 -78
- package/lib/runtime-integration.js +11 -697
- package/lib/session-metadata.d.ts +13 -12
- package/lib/session-metadata.js +6 -31
- package/lib/session-scope.js +2 -1
- package/lib/settings.d.ts +5 -18
- package/lib/settings.js +19 -43
- package/lib/skills.d.ts +1 -0
- package/lib/skills.js +5 -1
- package/lib/state.d.ts +3 -2
- package/lib/state.js +26 -10
- package/lib/status.d.ts +1 -9
- package/lib/status.js +3 -55
- package/lib/web-fetch-address-policy.d.ts +24 -0
- package/lib/web-fetch-address-policy.js +189 -0
- package/lib/web-fetch-fakeip.d.ts +25 -0
- package/lib/web-fetch-fakeip.js +107 -0
- package/package.json +124 -106
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-gateway@0.2.1-rc.2.patch +13291 -0
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-remotes@0.2.1-rc.2.patch +9133 -0
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-client-ui-approval@0.2.1-rc.2.patch +156 -0
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-subagent@0.2.1-rc.2.patch +3546 -0
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-user-approval@0.2.1-rc.2.patch +431 -0
- package/patches/dsh-approval-settlement/@deepseek-ai__dsh-web@0.2.1-rc.2.patch +119 -0
- package/patches/dsh-approval-settlement/README.md +41 -0
- package/patches/dsh-approval-settlement/metadata.json +10 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-loop@0.2.1-rc.2.patch +383 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-preset-registry@0.2.1-rc.2.patch +55 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-api-session-controller@0.2.1-rc.2.patch +16673 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-subagent@0.2.1-rc.2.patch +29 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-workspace@0.2.1-rc.2.patch +196 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence-jsonl@0.2.1-rc.2.patch +35 -0
- package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence@0.2.1-rc.2.patch +40 -0
- package/docs/research/deepseek-v4-pro.md +0 -74
- package/docs/research/oh-dsh.md +0 -96
- package/lib/agent-registry.d.ts +0 -36
- package/lib/agent-registry.js +0 -75
- package/lib/child-admission.d.ts +0 -40
- package/lib/child-admission.js +0 -151
- package/lib/delivery-authority.d.ts +0 -83
- package/lib/delivery-authority.js +0 -397
- package/lib/native-child-evidence.d.ts +0 -40
- package/lib/native-child-evidence.js +0 -104
- package/lib/role-runs.d.ts +0 -138
- package/lib/role-runs.js +0 -335
- package/lib/session-persistence.d.ts +0 -36
- package/lib/session-persistence.js +0 -304
- package/lib/subagent-runtime.d.ts +0 -57
- package/lib/subagent-runtime.js +0 -257
- package/prompts/deepseek-flash.md +0 -11
- package/prompts/deepseek-v4-pro.md +0 -14
|
@@ -0,0 +1,29 @@
|
|
|
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: {
|
|
@@ -0,0 +1,196 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
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;
|
|
@@ -0,0 +1,40 @@
|
|
|
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);
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# DeepSeek V4 Pro Prompt Calibration Notes
|
|
2
|
-
|
|
3
|
-
Date: 2026-08-21
|
|
4
|
-
|
|
5
|
-
## Status of evidence
|
|
6
|
-
|
|
7
|
-
The user reports that DeepSeek V4 Pro currently shows an overfitting-like behavior and needs specialized prompting to activate its full capability. Public official sources reviewed for this design do not state that diagnosis directly. The design therefore treats "overfitting" as a field observation and uses official model behavior to derive safe calibration rules.
|
|
8
|
-
|
|
9
|
-
## Official and public facts used
|
|
10
|
-
|
|
11
|
-
1. The DeepSeek API documents `deepseek-v4-pro` thinking mode with `reasoning_effort` and `extra_body: { "thinking": { "type": "enabled" } }`.
|
|
12
|
-
2. In thinking mode, sampling controls such as `temperature`, `top_p`, `presence_penalty`, and `frequency_penalty` are documented as ineffective in the official API path.
|
|
13
|
-
3. Thinking mode supports tool calls.
|
|
14
|
-
4. Tool-calling conversations in thinking mode require reasoning content to be preserved across subsequent user interaction turns; otherwise the integration can fail or lose the model's reasoning continuity.
|
|
15
|
-
5. DeepSeek V4 Pro public model material describes non-think, think-high, and think-max operating modes. Think-max uses an additional prompt/prefix mechanism and is intended for the hardest reasoning tasks.
|
|
16
|
-
6. General API usage does not accept the `developer` role, even though the open encoding docs mention it for an internal search-agent pipeline.
|
|
17
|
-
|
|
18
|
-
## dsmm calibration implications
|
|
19
|
-
|
|
20
|
-
### Prompt structure
|
|
21
|
-
|
|
22
|
-
DeepSeek V4 Pro calibration should be concrete and trigger-based:
|
|
23
|
-
|
|
24
|
-
- classify the task before acting;
|
|
25
|
-
- decompose architectural/debugging/migration work before editing;
|
|
26
|
-
- use tools for repository-specific facts;
|
|
27
|
-
- avoid claiming file state without reading/searching;
|
|
28
|
-
- keep the final answer concise while letting reasoning effort do the heavy lifting;
|
|
29
|
-
- make review and evidence gates explicit.
|
|
30
|
-
|
|
31
|
-
Avoid vague text such as "use your full intelligence" as the primary mechanism. It is acceptable as a short reinforcement, but the main prompt should specify observable behaviors.
|
|
32
|
-
|
|
33
|
-
### Reasoning policy
|
|
34
|
-
|
|
35
|
-
Recommended default policy for dsmm settings:
|
|
36
|
-
|
|
37
|
-
```yaml
|
|
38
|
-
dsmm:
|
|
39
|
-
prompts:
|
|
40
|
-
deepseekV4ProCalibration: auto
|
|
41
|
-
models:
|
|
42
|
-
defaultReasoningEffort: high
|
|
43
|
-
maxReasoningForArchitecturalWork: true
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Interpretation:
|
|
47
|
-
|
|
48
|
-
- `off`: no DeepSeek-specific overlay.
|
|
49
|
-
- `auto`: apply overlay only when the active model is detected as DeepSeek V4 Pro.
|
|
50
|
-
- `strict`: apply overlay and prefer max reasoning for architecture, migration, review, runtime-safety, or hard-reasoning tasks.
|
|
51
|
-
|
|
52
|
-
### Tool-call continuity
|
|
53
|
-
|
|
54
|
-
dsmm should not itself assume it can manage DeepSeek API message encoding. If dsh exposes a hook or adapter setting for reasoning-content retention, dsmm v0.6 should verify it for DeepSeek V4 Pro tool calls. Until then, dsmm docs should warn that provider/adapter correctness matters for thinking-mode tool use.
|
|
55
|
-
|
|
56
|
-
### Mode boundary
|
|
57
|
-
|
|
58
|
-
The calibration overlay belongs inside dsmm's `deepwork` custom mode or dsmm-managed role scopes. It should not be global, because ordinary dsh sessions may prefer concise non-think behavior.
|
|
59
|
-
|
|
60
|
-
## Draft calibration text shape
|
|
61
|
-
|
|
62
|
-
The final prompt should be maintained in source files, but its shape should remain close to this:
|
|
63
|
-
|
|
64
|
-
```text
|
|
65
|
-
When the active model is DeepSeek V4 Pro and dsmm deepwork mode is active:
|
|
66
|
-
- Treat complex coding, architecture, migration, debugging, and review tasks as deliberate reasoning tasks.
|
|
67
|
-
- First classify the task and identify the evidence needed.
|
|
68
|
-
- Use repository and documentation tools before making repo-specific claims.
|
|
69
|
-
- For multi-step work, maintain a visible plan or task list and verify each completed boundary.
|
|
70
|
-
- Use concise user-facing answers; do not expose private chain-of-thought.
|
|
71
|
-
- Prefer high reasoning effort by default; use max only for configured high-rigor tasks.
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
This text is intentionally behavioral rather than motivational. It should compose with dsh's own model adapter rather than fighting the adapter's chat template.
|
package/docs/research/oh-dsh.md
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
# oh-dsh Research Notes
|
|
2
|
-
|
|
3
|
-
Source target: `https://github.com/hust-open-atom-club/oh-dsh`
|
|
4
|
-
|
|
5
|
-
## Project shape
|
|
6
|
-
|
|
7
|
-
oh-dsh is a dsh runtime distribution that combines desktop, web, and TUI surfaces. The repo is organized around a top-level package plus workspace plugins under `plugins/`, with separate patch layers for desktop and web profiles.
|
|
8
|
-
|
|
9
|
-
Relevant observed structure:
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
oh-dsh/
|
|
13
|
-
bin/
|
|
14
|
-
src/
|
|
15
|
-
cli.ts
|
|
16
|
-
profile.ts
|
|
17
|
-
plugin.ts
|
|
18
|
-
contracts.ts
|
|
19
|
-
runtime*.ts
|
|
20
|
-
plugins/
|
|
21
|
-
desktop-frame/
|
|
22
|
-
better-sidebar-runtime/
|
|
23
|
-
plugin-marketplace/
|
|
24
|
-
skins/
|
|
25
|
-
vision/
|
|
26
|
-
shared/
|
|
27
|
-
tui/
|
|
28
|
-
cordis.patch.yml
|
|
29
|
-
web/cordis.patch.yml
|
|
30
|
-
docs/
|
|
31
|
-
tests/
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Bundle and profile pattern
|
|
35
|
-
|
|
36
|
-
oh-dsh follows dsh's package manifest model:
|
|
37
|
-
|
|
38
|
-
- top-level package exports the Host plugin entry, client entry, and compiled patch;
|
|
39
|
-
- `dsh.bundle.patch` points to the shipped `cordis.patch.yml`;
|
|
40
|
-
- profile assembly lists dsh base/web/headless bundles plus oh-dsh's own bundle;
|
|
41
|
-
- user patch layers remain separate from shipped bundle patches.
|
|
42
|
-
|
|
43
|
-
This is directly useful for dsmm: ship dsmm as a bundle layer and let users override it from their profile patch.
|
|
44
|
-
|
|
45
|
-
## Patch organization
|
|
46
|
-
|
|
47
|
-
oh-dsh uses patch rows to disable upstream defaults and insert its own plugin rows. The key idea is not the specific desktop plugins, but the pattern:
|
|
48
|
-
|
|
49
|
-
```yaml
|
|
50
|
-
- insert:
|
|
51
|
-
- id: oh-desktop-frame
|
|
52
|
-
name: '@oh-dsh/desktop-frame'
|
|
53
|
-
- id: oh-vision
|
|
54
|
-
name: '@oh-dsh/vision'
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
For dsmm, the equivalent is a small set of rows for the dsmm Host plugin, mode definition, settings namespace, prompts, and skill provider.
|
|
58
|
-
|
|
59
|
-
## Host/Client separation
|
|
60
|
-
|
|
61
|
-
oh-dsh packages can expose both Host and Client entries. Host plugins provide services and register prompt/tool/settings contributions. Client plugins inject browser UI surfaces.
|
|
62
|
-
|
|
63
|
-
dsmm MVP should stay Host-only. A client/settings panel can come later, after the dsh plugin APIs and dsmm settings model are stable.
|
|
64
|
-
|
|
65
|
-
## Settings seam
|
|
66
|
-
|
|
67
|
-
oh-dsh distinguishes two planes:
|
|
68
|
-
|
|
69
|
-
- composition plane: profile bundle rows and `cordis.patch.yml` decide which plugins exist;
|
|
70
|
-
- settings plane: user-editable YAML/JSON controls personal preferences.
|
|
71
|
-
|
|
72
|
-
dsmm should adopt this split. Deepwork availability is composition; mode name, auto-entry, calibration strictness, and skill toggles are settings.
|
|
73
|
-
|
|
74
|
-
## Custom mode relevance
|
|
75
|
-
|
|
76
|
-
oh-dsh tracks dsh mode/plan-mode design notes. The important behavior for dsmm is that a mode is session-scoped state, not a global prompt mutation. A mode contributes model-visible instructions while active and can be entered through commands or UI mode selection.
|
|
77
|
-
|
|
78
|
-
Current public dsh documentation exposes `@deepseek-ai/dsh-plan-mode`, not a generic arbitrary named `@deepseek-ai/dsh-mode` package. dsmm should therefore implement its own `deepwork` mode plugin using the same principles, or adapt to an upstream generic mode package if it becomes available. This satisfies the requirement that deepwork should be opt-in rather than global.
|
|
79
|
-
|
|
80
|
-
## Borrowed design decisions
|
|
81
|
-
|
|
82
|
-
1. Ship defaults as a bundle patch, not as instructions for users to paste manually.
|
|
83
|
-
2. Keep profile/user patch layers override-friendly.
|
|
84
|
-
3. Separate Host capability registration from optional Client UI.
|
|
85
|
-
4. Use a settings namespace for user-editable behavior.
|
|
86
|
-
5. Treat mode as the activation boundary for workflow behavior.
|
|
87
|
-
|
|
88
|
-
## Not copied into MVP
|
|
89
|
-
|
|
90
|
-
- Electron desktop shell.
|
|
91
|
-
- Web/TUI UI composition.
|
|
92
|
-
- Plugin marketplace transaction system.
|
|
93
|
-
- Vision tool integration.
|
|
94
|
-
- Sidebar and panel controls.
|
|
95
|
-
|
|
96
|
-
Those features are valuable in oh-dsh, but dsmm's MVP is a workflow/mode bundle rather than a UI runtime distribution.
|
package/lib/agent-registry.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
import { AgentRegistry } from "@deepseek-ai/dsh-agent";
|
|
3
|
-
import type { Agent, AgentHandle, CreateAgentOptions, ResumeAgentOptions } from "@deepseek-ai/dsh-agent";
|
|
4
|
-
import type { SessionId } from "@deepseek-ai/dsh-session";
|
|
5
|
-
import { SubagentError } from "@deepseek-ai/dsh-subagent";
|
|
6
|
-
export interface ManagedCreation {
|
|
7
|
-
readonly registry: AgentRegistry;
|
|
8
|
-
readonly parent: Agent;
|
|
9
|
-
readonly childId: SessionId;
|
|
10
|
-
readonly kind: "fresh" | "cold";
|
|
11
|
-
readonly delegationMode?: "one-shot" | "continuable";
|
|
12
|
-
readonly owner: object;
|
|
13
|
-
readonly ownerSignal?: AbortSignal;
|
|
14
|
-
entered(agent: Agent): void;
|
|
15
|
-
claimed: boolean;
|
|
16
|
-
child?: Agent;
|
|
17
|
-
retired: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare function managedCancellation(reason: unknown): SubagentError;
|
|
20
|
-
export declare function isManagedCancellation(error: unknown): boolean;
|
|
21
|
-
export declare const exactRegistry: (registry: AgentRegistry) => AgentRegistry;
|
|
22
|
-
export declare function duringManagedCreation<T>(operation: ManagedCreation, run: () => T): T;
|
|
23
|
-
export declare function currentManagedCreation(): ManagedCreation | undefined;
|
|
24
|
-
export declare function duringActivationOwnership<T>(signal: AbortSignal, run: () => T): T;
|
|
25
|
-
export declare function activationOwnerSignal(): AbortSignal | undefined;
|
|
26
|
-
/** Startup-only agents provider. Factory, traced caller, ownership and handles stay native. */
|
|
27
|
-
export declare class DsmmAgentRegistry extends AgentRegistry {
|
|
28
|
-
readonly managedLifetime: AbortController;
|
|
29
|
-
constructor(ctx: Context);
|
|
30
|
-
create(options: CreateAgentOptions): Promise<AgentHandle>;
|
|
31
|
-
resume(options: ResumeAgentOptions): Promise<AgentHandle>;
|
|
32
|
-
enter(agent: Agent, owner: Agent | undefined): () => void;
|
|
33
|
-
private creation;
|
|
34
|
-
}
|
|
35
|
-
export default DsmmAgentRegistry;
|
|
36
|
-
//# sourceMappingURL=agent-registry.d.ts.map
|
package/lib/agent-registry.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
-
import { symbols } from "@deepseek-ai/cordis";
|
|
3
|
-
import { AgentRegistry } from "@deepseek-ai/dsh-agent";
|
|
4
|
-
import { SubagentError } from "@deepseek-ai/dsh-subagent";
|
|
5
|
-
import { scopeLifetime } from "./delivery-authority.js";
|
|
6
|
-
const creations = new AsyncLocalStorage();
|
|
7
|
-
const holders = new AsyncLocalStorage();
|
|
8
|
-
const cancellations = new WeakSet();
|
|
9
|
-
export function managedCancellation(reason) {
|
|
10
|
-
const error = new SubagentError("Managed activation owner cancelled", "ABORTED", { cause: reason });
|
|
11
|
-
cancellations.add(error);
|
|
12
|
-
return error;
|
|
13
|
-
}
|
|
14
|
-
export function isManagedCancellation(error) { return typeof error === "object" && error !== null && cancellations.has(error); }
|
|
15
|
-
export const exactRegistry = (registry) => Reflect.get(registry, symbols.original) ?? registry;
|
|
16
|
-
export function duringManagedCreation(operation, run) { return creations.run(operation, run); }
|
|
17
|
-
export function currentManagedCreation() { return creations.getStore(); }
|
|
18
|
-
export function duringActivationOwnership(signal, run) { return holders.run(signal, run); }
|
|
19
|
-
export function activationOwnerSignal() { return holders.getStore(); }
|
|
20
|
-
/** Startup-only agents provider. Factory, traced caller, ownership and handles stay native. */
|
|
21
|
-
export class DsmmAgentRegistry extends AgentRegistry {
|
|
22
|
-
managedLifetime = new AbortController();
|
|
23
|
-
constructor(ctx) {
|
|
24
|
-
if (ctx.get("agents") !== undefined)
|
|
25
|
-
throw new SubagentError("DSMM agents requires one startup provider; restart to change it.", "DUPLICATE_PROVIDER");
|
|
26
|
-
super(ctx);
|
|
27
|
-
scopeLifetime(ctx, "dsmm.agents: retire managed residency", () => this.managedLifetime.abort());
|
|
28
|
-
}
|
|
29
|
-
create(options) {
|
|
30
|
-
return this.creation("fresh", options.sessionId, options.parentAgent, options.signal, signal => super.create(signal === options.signal ? options : { ...options, signal }));
|
|
31
|
-
}
|
|
32
|
-
resume(options) {
|
|
33
|
-
return this.creation("cold", options.resumeSessionId, options.parentAgent, options.signal, signal => super.resume(signal === options.signal ? options : { ...options, signal }));
|
|
34
|
-
}
|
|
35
|
-
enter(agent, owner) {
|
|
36
|
-
const detach = super.enter(agent, owner);
|
|
37
|
-
const operation = creations.getStore();
|
|
38
|
-
if (operation?.claimed && operation.registry === exactRegistry(this) && operation.parent === owner && operation.childId === agent.id) {
|
|
39
|
-
try {
|
|
40
|
-
operation.entered(agent);
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
detach();
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return detach;
|
|
48
|
-
}
|
|
49
|
-
async creation(kind, id, parent, source, run) {
|
|
50
|
-
const operation = creations.getStore();
|
|
51
|
-
if (operation !== undefined && operation.registry === exactRegistry(this) && operation.parent === parent
|
|
52
|
-
&& operation.childId === id && operation.kind === kind) {
|
|
53
|
-
if (operation.claimed || operation.retired || this.managedLifetime.signal.aborted || source === undefined) {
|
|
54
|
-
throw new SubagentError("Managed creation requires its exact unused operation", "UNAUTHORIZED");
|
|
55
|
-
}
|
|
56
|
-
operation.claimed = true;
|
|
57
|
-
}
|
|
58
|
-
if (source === undefined)
|
|
59
|
-
return run(source);
|
|
60
|
-
// Creation-only cancellation must not end an accepted root or native child residency.
|
|
61
|
-
const relay = new AbortController();
|
|
62
|
-
const abort = () => relay.abort(source.reason);
|
|
63
|
-
source.addEventListener("abort", abort, { once: true });
|
|
64
|
-
if (source.aborted)
|
|
65
|
-
abort();
|
|
66
|
-
try {
|
|
67
|
-
return await run(relay.signal);
|
|
68
|
-
}
|
|
69
|
-
finally {
|
|
70
|
-
source.removeEventListener("abort", abort);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
export default DsmmAgentRegistry;
|
|
75
|
-
//# sourceMappingURL=agent-registry.js.map
|
package/lib/child-admission.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
import type { Agent } from "@deepseek-ai/dsh-agent";
|
|
3
|
-
import type { ChildAdmissionCompletion, DsmmChildAdmissionAuthority, LegacyChildEvidenceReader, ParentAdmissionTicket } from "./child-admission-contract.js";
|
|
4
|
-
import type { ChildAdmissionEvidence, ChildAdmissionEvidenceView, ChildEvidenceField } from "./child-capture.js";
|
|
5
|
-
import type { DeliveryPolicyBinding, DsmmDeliveryAuthority } from "./delivery-authority.js";
|
|
6
|
-
import type { DshAgent } from "./dsh-types.js";
|
|
7
|
-
import type { NativeChildHistory } from "./native-child-evidence.js";
|
|
8
|
-
import type { DsmmProfileAdmission, DsmmSettings } from "./settings.js";
|
|
9
|
-
export interface ChildAdmissionCollaborators {
|
|
10
|
-
/** A owns resident/durable capture lookup and corruption-vs-absence decisions. */
|
|
11
|
-
resolveOriginalChildEvidence(ticket: ParentAdmissionTicket, childId: string, signal: AbortSignal, readLegacy: LegacyChildEvidenceReader): Promise<ChildAdmissionEvidence>;
|
|
12
|
-
/** B owns fresh invocation capture, role identity and target ceiling validation. */
|
|
13
|
-
childAdmission: ChildAdmissionCompletion;
|
|
14
|
-
assertDelivery(ticket: ParentAdmissionTicket, childId: string, evidence: ChildAdmissionEvidence): void;
|
|
15
|
-
classifyParent(parent: Agent): "dsmm" | "native";
|
|
16
|
-
}
|
|
17
|
-
export interface ChildAdmissionBindingOptions {
|
|
18
|
-
readonly ctx: Context;
|
|
19
|
-
readonly owner: object;
|
|
20
|
-
readonly deliveryAuthority: DsmmDeliveryAuthority<DsmmProfileAdmission, ChildAdmissionEvidence>;
|
|
21
|
-
readonly collaborators: ChildAdmissionCollaborators;
|
|
22
|
-
readonly nativeSubstrate: DsmmSettings;
|
|
23
|
-
/** The exact public Host query service, borrowed in the same scope as the native catalog. */
|
|
24
|
-
readonly nativeHistory: NativeChildHistory;
|
|
25
|
-
}
|
|
26
|
-
/** Connects A's structural contract to C1's opaque ticket provenance without manufacturing Agents. */
|
|
27
|
-
export declare function createChildAdmissionBinding(options: ChildAdmissionBindingOptions): {
|
|
28
|
-
authority: DsmmChildAdmissionAuthority;
|
|
29
|
-
policy: DeliveryPolicyBinding<DsmmProfileAdmission, ChildAdmissionEvidence>;
|
|
30
|
-
childAdmission: ChildAdmissionCompletion;
|
|
31
|
-
readLegacy: LegacyChildEvidenceReader;
|
|
32
|
-
resolveOriginalEvidence: (ticket: ParentAdmissionTicket, id: string, signal: AbortSignal) => Promise<ChildAdmissionEvidence>;
|
|
33
|
-
bind(scope: Context): () => void;
|
|
34
|
-
onAdmissionGuardsInstalled(): void;
|
|
35
|
-
/** Holder owner calls this before native disposal/drain; no replacement residency is revoked. */
|
|
36
|
-
revokeBeforeDispose(parent: DshAgent, dispose: () => void | Promise<void>): Promise<void>;
|
|
37
|
-
};
|
|
38
|
-
/** DTO consumers supply the CURRENT direct-parent epoch; original epochs are not an authorization equality test. */
|
|
39
|
-
export declare function projectChildAdmissionEvidence(evidence: ChildAdmissionEvidence, parentAdmissionEpoch: string, parentDenied?: readonly ChildEvidenceField[]): ChildAdmissionEvidenceView;
|
|
40
|
-
//# sourceMappingURL=child-admission.d.ts.map
|