dsh-mnemon 0.4.4 → 0.4.6
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 +7 -3
- package/README.zh-CN.md +7 -3
- package/lib/client.js +82 -6
- package/lib/index.js +32 -9
- package/lib/types/src/client/better-sidebar.d.ts +13 -0
- package/lib/types/src/client/workspace-mount.d.ts +14 -0
- package/lib/types/src/contracts.d.ts +29 -18
- package/lib/types/src/session-events.d.ts +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<p align="center">
|
|
25
25
|
<a href="./docs/en/capabilities.md"><strong>Explore the capability map</strong></a> ·
|
|
26
26
|
<a href="./docs/en/getting-started.md">Start in five minutes</a> ·
|
|
27
|
-
<a href="./docs/en/releases/v0.4.
|
|
27
|
+
<a href="./docs/en/releases/v0.4.6.md">Read the v0.4.6 notes</a> ·
|
|
28
28
|
<a href="https://github.com/omdsh-dev/dsh-mnemon/blob/e6ca446e45bdd17991f3c7c98560456de465282b/docs/assets/media/dsh-mnemon-memory-system-demo.mp4">Watch the widescreen demo</a>
|
|
29
29
|
</p>
|
|
30
30
|
|
|
@@ -44,6 +44,10 @@ v0.4.3 aligns the collapsed Memory System icon with neighboring sidebar controls
|
|
|
44
44
|
|
|
45
45
|
v0.4.4 fixes session history failures on older DSH hosts by supporting both session projection contracts. Newer hosts and existing projection checkpoints remain compatible. See the [patch release notes](./docs/en/releases/v0.4.4.md).
|
|
46
46
|
|
|
47
|
+
v0.4.5 registers Memory System with an installed Better Sidebar while keeping the normal DSH Sidebar entry and both client activation orders working. See the [patch release notes](./docs/en/releases/v0.4.5.md).
|
|
48
|
+
|
|
49
|
+
v0.4.6 keeps DSH 0.1.1-rc.2 as the stable baseline while adding capability-detected support for the Session event snapshots used by DSH 0.1.2-alpha.4 and alpha.5. See the [patch release notes](./docs/en/releases/v0.4.6.md).
|
|
50
|
+
|
|
47
51
|
## Understand the scope in 30 seconds
|
|
48
52
|
|
|
49
53
|
| Tier | Keep here | How it reaches the Agent | Managed by |
|
|
@@ -118,7 +122,7 @@ Windows users can install the official v0.2.3-or-newer release ZIP. The expected
|
|
|
118
122
|
|
|
119
123
|
### 2. Install DSH and the plugin
|
|
120
124
|
|
|
121
|
-
The registry installation remains verified against DSH 0.1.1-rc.2, whose complete profiles require Node.js `^22.19.0 || >=24.0.0`; Node 20 lacks host primitives used by rc.2. Source compatibility is also verified against the
|
|
125
|
+
The registry installation remains verified against stable DSH 0.1.1-rc.2, whose complete profiles require Node.js `^22.19.0 || >=24.0.0`; Node 20 lacks host primitives used by rc.2. Source compatibility is also verified against the latest DSH 0.1.2-alpha.5 preview while rc.2 remains the recommended registry target. The dsh-mnemon package itself retains Node.js 20 compatibility for older compatible DSH hosts. Use the exact published version below for a reproducible installation; plugin authors can follow the [alpha source workflow](./docs/en/development.md#dsh-012-alpha5-source-verification).
|
|
122
126
|
|
|
123
127
|
```sh
|
|
124
128
|
npm install -g @deepseek-ai/dsh@0.1.1-rc.2
|
|
@@ -218,7 +222,7 @@ See [Operations, security, and troubleshooting](./docs/en/operations.md) for bac
|
|
|
218
222
|
| Back up, update, or troubleshoot | [Operations](./docs/en/operations.md) |
|
|
219
223
|
| Integrate tools, commands, or RPC | [Interface reference](./docs/en/interfaces.md) |
|
|
220
224
|
| Build a Layer, Adapter, Strategy, Guard, or MemorySource extension | [Extension guide](./docs/en/extensions.md) |
|
|
221
|
-
| Review the release | [v0.4.
|
|
225
|
+
| Review the release | [v0.4.6 release notes](./docs/en/releases/v0.4.6.md) |
|
|
222
226
|
|
|
223
227
|
See the [documentation hub](./docs/en/README.md) for the full map.
|
|
224
228
|
|
package/README.zh-CN.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<p align="center">
|
|
25
25
|
<a href="./docs/zh-CN/capabilities.md"><strong>先看能力地图</strong></a> ·
|
|
26
26
|
<a href="./docs/zh-CN/getting-started.md">5 分钟开始</a> ·
|
|
27
|
-
<a href="./docs/zh-CN/releases/v0.4.
|
|
27
|
+
<a href="./docs/zh-CN/releases/v0.4.6.md">v0.4.6 升级说明</a> ·
|
|
28
28
|
<a href="https://github.com/omdsh-dev/dsh-mnemon/blob/e6ca446e45bdd17991f3c7c98560456de465282b/docs/assets/media/dsh-mnemon-memory-system-demo.mp4">观看宽屏实机演示</a>
|
|
29
29
|
</p>
|
|
30
30
|
|
|
@@ -44,6 +44,10 @@ v0.4.3 让折叠后的记忆系统图标与侧栏相邻控件对齐,并保留
|
|
|
44
44
|
|
|
45
45
|
v0.4.4 同时支持新旧 DSH 会话投影接口,修复旧版宿主读取会话历史失败的问题,并保持新版宿主和已有投影检查点兼容。详见[补丁发布说明](./docs/zh-CN/releases/v0.4.4.md)。
|
|
46
46
|
|
|
47
|
+
v0.4.5 在已安装 Better Sidebar 时向其注册记忆系统,同时保留 DSH 普通 Sidebar 入口,并兼容两种客户端加载顺序。详见[补丁发布说明](./docs/zh-CN/releases/v0.4.5.md)。
|
|
48
|
+
|
|
49
|
+
v0.4.6 继续以 DSH 0.1.1-rc.2 作为稳定基线,并通过能力检测兼容 DSH 0.1.2-alpha.4 与 alpha.5 的 Session 事件快照接口。详见[补丁发布说明](./docs/zh-CN/releases/v0.4.6.md)。
|
|
50
|
+
|
|
47
51
|
## 30 秒理解能力边界
|
|
48
52
|
|
|
49
53
|
| 层级 | 适合保存 | 如何进入 Agent 上下文 | 由谁管理 |
|
|
@@ -118,7 +122,7 @@ Windows 推荐安装 v0.2.3 或更高版本的官方 ZIP;标准安装目录与
|
|
|
118
122
|
|
|
119
123
|
### 2. 安装 DSH 与插件
|
|
120
124
|
|
|
121
|
-
Registry
|
|
125
|
+
Registry 安装仍以稳定的 DSH 0.1.1-rc.2 验证;其完整 profile 需要 Node.js `^22.19.0 || >=24.0.0`,Node 20 缺少 rc.2 使用的宿主原语。源码兼容性也已针对最新的 DSH 0.1.2-alpha.5 预览版验证,rc.2 仍是推荐的 registry 安装目标。dsh-mnemon 包本身仍为较旧且兼容的 DSH Host 保留 Node.js 20 支持。下面显式指定已发布版本以保证可复现安装;插件作者可参照 [alpha 源码验证流程](./docs/zh-CN/development.md#dsh-012-alpha5-源码验证)。
|
|
122
126
|
|
|
123
127
|
```sh
|
|
124
128
|
npm install -g @deepseek-ai/dsh@0.1.1-rc.2
|
|
@@ -218,7 +222,7 @@ dsh plugin --profile headless add "link:/absolute/path/to/dsh-mnemon"
|
|
|
218
222
|
| 备份、更新或排障 | [运维指南](./docs/zh-CN/operations.md) |
|
|
219
223
|
| 接入工具、命令或 RPC | [接口参考](./docs/zh-CN/interfaces.md) |
|
|
220
224
|
| 开发 Layer、Adapter、Strategy、Guard 或 MemorySource 扩展 | [扩展开发指南](./docs/zh-CN/extensions.md) |
|
|
221
|
-
| 查看本次升级 | [v0.4.
|
|
225
|
+
| 查看本次升级 | [v0.4.6 发布说明](./docs/zh-CN/releases/v0.4.6.md) |
|
|
222
226
|
|
|
223
227
|
完整目录见[文档中心](./docs/zh-CN/README.md)。
|
|
224
228
|
|
package/lib/client.js
CHANGED
|
@@ -11931,14 +11931,16 @@ window.__ModuleLoader__.load({
|
|
|
11931
11931
|
const SSH_ACTIVE_ATTR = "data-dsh-ssh-active";
|
|
11932
11932
|
const ACTIVATE_EVENT = "dsh-panel-activate";
|
|
11933
11933
|
const SIDEBAR_CONTEXT_SELECTOR = "[data-dsh-taskboard-entry], [data-dsh-ssh-entry], [class*=\"sessionRow\"], [class*=\"projectRow\"], [class*=\"searchResultRow\"], [class*=\"searchResultWorkspace\"], [class*=\"newSession\"]";
|
|
11934
|
-
|
|
11934
|
+
/** Shared sidebar-sized view used by both the legacy workspace and Better Sidebar. */
|
|
11935
|
+
function MnemonPanel({ ctx, settings, t, onClose, scope }) {
|
|
11935
11936
|
const subscribeLocale = (0, react.useCallback)((listener) => ctx.locale.subscribe(listener), [ctx.locale]);
|
|
11936
11937
|
const getLocaleSnapshot = (0, react.useCallback)(() => ctx.locale.getSnapshot(), [ctx.locale]);
|
|
11937
11938
|
const locale = (0, react.useSyncExternalStore)(subscribeLocale, getLocaleSnapshot, getLocaleSnapshot);
|
|
11938
11939
|
const sessions = (0, react.useSyncExternalStore)((listener) => ctx.sessions.list.subscribe(listener), () => ctx.sessions.list.getSnapshot(), () => ctx.sessions.list.getSnapshot());
|
|
11939
11940
|
const workspaces = (0, react.useSyncExternalStore)((listener) => ctx.workspaces.list.subscribe(listener), () => ctx.workspaces.list.getSnapshot(), () => ctx.workspaces.list.getSnapshot());
|
|
11940
11941
|
const [selectedWorkspaceId, setSelectedWorkspaceId] = (0, react.useState)();
|
|
11941
|
-
const
|
|
11942
|
+
const sessionId = scope?.sessionId ?? sessions.current;
|
|
11943
|
+
const currentCwd = scope === void 0 ? sessions.current === void 0 ? void 0 : sessions.byId[sessions.current]?.cwd : scope.cwd;
|
|
11942
11944
|
const normalizePath = (value) => value.replace(/[\\/]+$/u, "");
|
|
11943
11945
|
const effectiveWorkspace = currentCwd === void 0 ? void 0 : workspaces.items.find((workspace) => normalizePath(workspace.path) === normalizePath(currentCwd));
|
|
11944
11946
|
const fallbackWorkspace = effectiveWorkspace ?? workspaces.items[0];
|
|
@@ -11966,12 +11968,12 @@ window.__ModuleLoader__.load({
|
|
|
11966
11968
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MnemonView, {
|
|
11967
11969
|
connection: ctx.connection,
|
|
11968
11970
|
settingsScope: settings,
|
|
11969
|
-
...
|
|
11971
|
+
...sessionId === void 0 ? {} : { sessionId },
|
|
11970
11972
|
...resolvedSelectedId === void 0 ? {} : { workspaceId: resolvedSelectedId },
|
|
11971
11973
|
workspaceSelection: selection,
|
|
11972
11974
|
t,
|
|
11973
11975
|
locale: locale.active,
|
|
11974
|
-
onClose
|
|
11976
|
+
...onClose === void 0 ? {} : { onClose }
|
|
11975
11977
|
});
|
|
11976
11978
|
}
|
|
11977
11979
|
function conversationColumn() {
|
|
@@ -12084,6 +12086,71 @@ window.__ModuleLoader__.load({
|
|
|
12084
12086
|
};
|
|
12085
12087
|
}
|
|
12086
12088
|
//#endregion
|
|
12089
|
+
//#region src/client/better-sidebar.tsx
|
|
12090
|
+
/** Stable type id exposed to Better Sidebar and its persisted tab state. */
|
|
12091
|
+
const MNEMON_BETTER_SIDEBAR_TAB_ID = "dsh-mnemon:memory";
|
|
12092
|
+
function MnemonTabIcon({ size }) {
|
|
12093
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
12094
|
+
"aria-hidden": "true",
|
|
12095
|
+
viewBox: "0 0 16 16",
|
|
12096
|
+
width: size,
|
|
12097
|
+
height: size,
|
|
12098
|
+
fill: "none",
|
|
12099
|
+
stroke: "currentColor",
|
|
12100
|
+
strokeWidth: "1.5",
|
|
12101
|
+
strokeLinecap: "round",
|
|
12102
|
+
strokeLinejoin: "round",
|
|
12103
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ellipse", {
|
|
12104
|
+
cx: "8",
|
|
12105
|
+
cy: "3.5",
|
|
12106
|
+
rx: "5",
|
|
12107
|
+
ry: "2"
|
|
12108
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 3.5v4c0 1.1 2.2 2 5 2s5-.9 5-2v-4M3 7.5v4c0 1.1 2.2 2 5 2s5-.9 5-2v-4" })]
|
|
12109
|
+
});
|
|
12110
|
+
}
|
|
12111
|
+
/**
|
|
12112
|
+
* Register Mnemon through Better Sidebar's documented optional service.
|
|
12113
|
+
*
|
|
12114
|
+
* The service is deliberately a soft dependency. Watching Cordis service
|
|
12115
|
+
* changes makes installation order and HMR irrelevant while preserving the
|
|
12116
|
+
* standalone Mnemon sidebar on profiles that do not install Better Sidebar.
|
|
12117
|
+
*/
|
|
12118
|
+
function mountBetterSidebarTab(ctx, settings, t) {
|
|
12119
|
+
let current;
|
|
12120
|
+
const reconcile = () => {
|
|
12121
|
+
const service = ctx.get("betterSidebar");
|
|
12122
|
+
if (current?.service === service) return;
|
|
12123
|
+
current?.dispose();
|
|
12124
|
+
current = void 0;
|
|
12125
|
+
if (service === void 0) return;
|
|
12126
|
+
current = {
|
|
12127
|
+
service,
|
|
12128
|
+
dispose: service.registerTab({
|
|
12129
|
+
id: MNEMON_BETTER_SIDEBAR_TAB_ID,
|
|
12130
|
+
title: () => t("tab.label"),
|
|
12131
|
+
icon: (size) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MnemonTabIcon, { size }),
|
|
12132
|
+
order: 55,
|
|
12133
|
+
single: true,
|
|
12134
|
+
component: ({ scope }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MnemonPanel, {
|
|
12135
|
+
ctx,
|
|
12136
|
+
settings,
|
|
12137
|
+
t,
|
|
12138
|
+
scope
|
|
12139
|
+
})
|
|
12140
|
+
})
|
|
12141
|
+
};
|
|
12142
|
+
};
|
|
12143
|
+
reconcile();
|
|
12144
|
+
const unsubscribe = ctx.on("internal/service", (name) => {
|
|
12145
|
+
if (name === "betterSidebar") reconcile();
|
|
12146
|
+
});
|
|
12147
|
+
return () => {
|
|
12148
|
+
unsubscribe();
|
|
12149
|
+
current?.dispose();
|
|
12150
|
+
current = void 0;
|
|
12151
|
+
};
|
|
12152
|
+
}
|
|
12153
|
+
//#endregion
|
|
12087
12154
|
//#region src/client/subagent-token-usage.tsx
|
|
12088
12155
|
/** Mnemon compatibility shim for DSH's fork-backed subagent token metric. */
|
|
12089
12156
|
const MNEMON_SUBAGENT_TOKEN_USAGE_KEY = "mnemonSubagentTokenUsage";
|
|
@@ -12281,9 +12348,18 @@ window.__ModuleLoader__.load({
|
|
|
12281
12348
|
const mode = snapshot.status === "loading" || snapshot.value?.tabEnabled === false ? void 0 : normalizeDisplayMode(snapshot.value?.displayMode);
|
|
12282
12349
|
if (activeMemoryWorkspace?.mode === mode) return;
|
|
12283
12350
|
activeMemoryWorkspace?.dispose();
|
|
12284
|
-
|
|
12351
|
+
if (mode === void 0) {
|
|
12352
|
+
activeMemoryWorkspace = void 0;
|
|
12353
|
+
return;
|
|
12354
|
+
}
|
|
12355
|
+
const disposeView = mode === "builtin" ? mountBuiltinMemoryView(ctx, settings, namespace, translate) : mountMnemonWorkspace(ctx, settings, translate);
|
|
12356
|
+
const disposeBetterSidebar = mode === "sidebar" ? mountBetterSidebarTab(ctx, settings, translate) : () => {};
|
|
12357
|
+
activeMemoryWorkspace = {
|
|
12285
12358
|
mode,
|
|
12286
|
-
dispose:
|
|
12359
|
+
dispose: () => {
|
|
12360
|
+
disposeBetterSidebar();
|
|
12361
|
+
disposeView();
|
|
12362
|
+
}
|
|
12287
12363
|
};
|
|
12288
12364
|
};
|
|
12289
12365
|
ctx.effect(() => {
|
package/lib/index.js
CHANGED
|
@@ -6085,6 +6085,29 @@ var LiveMnemonRuntime = class {
|
|
|
6085
6085
|
}
|
|
6086
6086
|
};
|
|
6087
6087
|
//#endregion
|
|
6088
|
+
//#region src/session-events.ts
|
|
6089
|
+
function eventArray(value) {
|
|
6090
|
+
return Array.isArray(value) ? value : void 0;
|
|
6091
|
+
}
|
|
6092
|
+
/**
|
|
6093
|
+
* Materialize one immutable event-log snapshot across supported DSH releases.
|
|
6094
|
+
* Capability detection keeps alpha and stable rc behavior on one code path.
|
|
6095
|
+
*/
|
|
6096
|
+
function hostSessionEvents(session) {
|
|
6097
|
+
if (typeof session.snapshotEvents === "function") {
|
|
6098
|
+
const events = eventArray(session.snapshotEvents());
|
|
6099
|
+
if (events !== void 0) return events;
|
|
6100
|
+
}
|
|
6101
|
+
const events = eventArray(session.events);
|
|
6102
|
+
if (events !== void 0) return events;
|
|
6103
|
+
throw new TypeError("Unsupported DSH Session event API: expected snapshotEvents() or events[]");
|
|
6104
|
+
}
|
|
6105
|
+
/** Read one exact event without materializing the alpha log when possible. */
|
|
6106
|
+
function hostSessionEventAt(session, seq) {
|
|
6107
|
+
if (typeof session.eventAt === "function") return session.eventAt(seq);
|
|
6108
|
+
return hostSessionEvents(session)[seq];
|
|
6109
|
+
}
|
|
6110
|
+
//#endregion
|
|
6088
6111
|
//#region src/subagent.ts
|
|
6089
6112
|
function isAgentRuntimeSource$1(value) {
|
|
6090
6113
|
return typeof value === "object" && value !== null && "forAgent" in value && typeof value.forAgent === "function";
|
|
@@ -6519,7 +6542,7 @@ function subagentFailureDetail(run, result) {
|
|
|
6519
6542
|
const diagnostic = safeFailureDetail(result.diagnostic);
|
|
6520
6543
|
if (diagnostic !== "") return diagnostic;
|
|
6521
6544
|
}
|
|
6522
|
-
const events = run.localAgent
|
|
6545
|
+
const events = run.localAgent === void 0 ? [] : hostSessionEvents(run.localAgent.session);
|
|
6523
6546
|
for (let index = events.length - 1; index >= 0; index -= 1) {
|
|
6524
6547
|
const event = events[index];
|
|
6525
6548
|
if (event?.type !== "turn/end") continue;
|
|
@@ -7877,7 +7900,7 @@ function agentMemoryScope(agent, graph) {
|
|
|
7877
7900
|
/** The durable log, not a parent session id, identifies the executing turn. */
|
|
7878
7901
|
function openAgentTurn(agent) {
|
|
7879
7902
|
let open;
|
|
7880
|
-
for (const event of agent.session
|
|
7903
|
+
for (const event of hostSessionEvents(agent.session)) {
|
|
7881
7904
|
const turn = typeof event.data.turn === "number" ? event.data.turn : void 0;
|
|
7882
7905
|
if (event.type === "turn/start" && turn !== void 0) open = turn;
|
|
7883
7906
|
else if (event.type === "turn/end" && turn === open) open = void 0;
|
|
@@ -8181,7 +8204,7 @@ var MnemonAgentLifecycle = class {
|
|
|
8181
8204
|
startSource: this.startSource,
|
|
8182
8205
|
primePending: this.primePending,
|
|
8183
8206
|
guidedTurns: this.guidedTurns.size,
|
|
8184
|
-
memoryToolCalls: memoryToolCalls(this.agent.session
|
|
8207
|
+
memoryToolCalls: memoryToolCalls(hostSessionEvents(this.agent.session)),
|
|
8185
8208
|
idleReviewPending: this.idleReviewTimer !== void 0,
|
|
8186
8209
|
reviewRunning: this.reviewRunning,
|
|
8187
8210
|
reviewActivity: this.reviewActivity(),
|
|
@@ -8200,11 +8223,11 @@ var MnemonAgentLifecycle = class {
|
|
|
8200
8223
|
}
|
|
8201
8224
|
/** Incremental snapshot of settled Mnemon activity in this durable log. */
|
|
8202
8225
|
turnMemoryActivities() {
|
|
8203
|
-
return this.memoryActivity.snapshot(this.agent.session
|
|
8226
|
+
return this.memoryActivity.snapshot(hostSessionEvents(this.agent.session));
|
|
8204
8227
|
}
|
|
8205
8228
|
/** Plain text of one finalized assistant message, from this agent's session log. */
|
|
8206
8229
|
assistantMessageText(messageId) {
|
|
8207
|
-
return assistantMessageText(this.agent.session
|
|
8230
|
+
return assistantMessageText(hostSessionEvents(this.agent.session), messageId);
|
|
8208
8231
|
}
|
|
8209
8232
|
memoryWake() {
|
|
8210
8233
|
const pinned = this.memoryTurn?.current;
|
|
@@ -8225,7 +8248,7 @@ var MnemonAgentLifecycle = class {
|
|
|
8225
8248
|
cueAlreadyVisible() {
|
|
8226
8249
|
const nodes = this.agent.session.surface?.nodes;
|
|
8227
8250
|
if (nodes === void 0) return this.cueInjected;
|
|
8228
|
-
for (const seq of nodes) if (isOwnUserMessageEvent(this.agent.session
|
|
8251
|
+
for (const seq of nodes) if (isOwnUserMessageEvent(hostSessionEventAt(this.agent.session, seq))) return true;
|
|
8229
8252
|
return false;
|
|
8230
8253
|
}
|
|
8231
8254
|
/**
|
|
@@ -8315,14 +8338,14 @@ var MnemonAgentLifecycle = class {
|
|
|
8315
8338
|
if (!this.config.lifecycleEnabled || !this.config.writeEnabled || this.config.writebackMode !== "guided") return;
|
|
8316
8339
|
this.cancelIdleReview(true);
|
|
8317
8340
|
const activity = this.ensureTurnActivity(turn);
|
|
8318
|
-
const tools = completedToolActivity(this.agent.session
|
|
8341
|
+
const tools = completedToolActivity(hostSessionEvents(this.agent.session), turn);
|
|
8319
8342
|
activity.toolCallCount = tools.count;
|
|
8320
8343
|
activity.toolNames = tools.names;
|
|
8321
8344
|
if (!this.reviewActivity().eligible || !this.reviewAdmitted(turn)) return;
|
|
8322
8345
|
this.idleReviewTimer = setTimeout(() => {
|
|
8323
8346
|
this.idleReviewTimer = void 0;
|
|
8324
8347
|
if (this.agent.status !== "idle") return;
|
|
8325
|
-
if (!this.agent.session.
|
|
8348
|
+
if (!hostSessionEvents(this.agent.session).some((event) => event.type === "turn/end" && eventTurn(event) === turn) || !this.reviewActivity().eligible || !this.reviewAdmitted(turn)) return;
|
|
8326
8349
|
this.runIdleReview();
|
|
8327
8350
|
}, this.config.idleReviewMs);
|
|
8328
8351
|
}
|
|
@@ -8394,7 +8417,7 @@ var MnemonAgentLifecycle = class {
|
|
|
8394
8417
|
explicitCandidate ||= activity.explicitCandidate;
|
|
8395
8418
|
completedNonMemoryTool ||= activity.toolCallCount > 0 && [...activity.toolNames].some((name) => !name.startsWith("mnemon_"));
|
|
8396
8419
|
}
|
|
8397
|
-
const assistantTextLength = this.agent.session.
|
|
8420
|
+
const assistantTextLength = hostSessionEvents(this.agent.session).filter((event) => {
|
|
8398
8421
|
const turn = eventTurn(event);
|
|
8399
8422
|
return turn !== void 0 && turns.has(turn);
|
|
8400
8423
|
}).map(assistantEventTextLength).reduce((total, length) => total + length, 0);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ClientSettingsScope, Config } from '../shared/contracts.ts';
|
|
2
|
+
import type { MnemonClientContext } from './dsh-compat.ts';
|
|
3
|
+
import type { MnemonTranslate } from './locales.ts';
|
|
4
|
+
/** Stable type id exposed to Better Sidebar and its persisted tab state. */
|
|
5
|
+
export declare const MNEMON_BETTER_SIDEBAR_TAB_ID = "dsh-mnemon:memory";
|
|
6
|
+
/**
|
|
7
|
+
* Register Mnemon through Better Sidebar's documented optional service.
|
|
8
|
+
*
|
|
9
|
+
* The service is deliberately a soft dependency. Watching Cordis service
|
|
10
|
+
* changes makes installation order and HMR irrelevant while preserving the
|
|
11
|
+
* standalone Mnemon sidebar on profiles that do not install Better Sidebar.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mountBetterSidebarTab(ctx: MnemonClientContext, settings: ClientSettingsScope<Config>, t: MnemonTranslate): () => void;
|
|
@@ -2,5 +2,19 @@ import type { ClientSettingsScope, Config } from '../shared/contracts.ts';
|
|
|
2
2
|
import type { MnemonClientContext } from './dsh-compat.ts';
|
|
3
3
|
import type { MnemonTranslate } from './locales.ts';
|
|
4
4
|
export declare const MNEMON_VIEW_SELECTOR = "[data-dsh-mnemon-view]";
|
|
5
|
+
interface MnemonPanelProps {
|
|
6
|
+
ctx: MnemonClientContext;
|
|
7
|
+
settings: ClientSettingsScope<Config>;
|
|
8
|
+
t: MnemonTranslate;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
scope?: MnemonWorkspaceScope;
|
|
11
|
+
}
|
|
12
|
+
export interface MnemonWorkspaceScope {
|
|
13
|
+
sessionId: string;
|
|
14
|
+
cwd?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Shared sidebar-sized view used by both the legacy workspace and Better Sidebar. */
|
|
17
|
+
export declare function MnemonPanel({ ctx, settings, t, onClose, scope }: MnemonPanelProps): JSX.Element;
|
|
5
18
|
/** Mount the sidebar row and its stateful center-column workspace as one unit. */
|
|
6
19
|
export declare function mountMnemonWorkspace(ctx: MnemonClientContext, settings: ClientSettingsScope<Config>, t: MnemonTranslate): () => void;
|
|
20
|
+
export {};
|
|
@@ -129,6 +129,34 @@ export interface HostSessionEvent {
|
|
|
129
129
|
time?: number;
|
|
130
130
|
data: Record<string, unknown>;
|
|
131
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Minimum session log surface shared by the stable DSH rc line and the 0.1.2
|
|
134
|
+
* alpha line. rc.2 exposes the immutable log through `events`; alpha.4+
|
|
135
|
+
* replaces that property with range snapshots and indexed reads.
|
|
136
|
+
*/
|
|
137
|
+
export interface HostSession {
|
|
138
|
+
header?: {
|
|
139
|
+
origin?: 'subagent';
|
|
140
|
+
parentSession?: string;
|
|
141
|
+
delegationDepth?: number;
|
|
142
|
+
cwd?: string;
|
|
143
|
+
agentPreset?: string;
|
|
144
|
+
};
|
|
145
|
+
/** Stable rc.2 event-log accessor. */
|
|
146
|
+
events?: readonly HostSessionEvent[];
|
|
147
|
+
/** DSH 0.1.2-alpha.4+ event-log accessor. */
|
|
148
|
+
snapshotEvents?(fromSeq?: number, toSeqExclusive?: number): readonly HostSessionEvent[];
|
|
149
|
+
/** DSH 0.1.2-alpha.4+ indexed event accessor. */
|
|
150
|
+
eventAt?(seq: number): HostSessionEvent | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* Model-visible event sequences, in order. Optional because not every host
|
|
153
|
+
* publishes a surface projection; when absent, callers fall back to
|
|
154
|
+
* session-scoped state.
|
|
155
|
+
*/
|
|
156
|
+
surface?: {
|
|
157
|
+
readonly nodes: readonly number[];
|
|
158
|
+
};
|
|
159
|
+
}
|
|
132
160
|
export type HostPreStepDecision = {
|
|
133
161
|
kind: 'reject';
|
|
134
162
|
} | {
|
|
@@ -156,24 +184,7 @@ export interface HostAgent {
|
|
|
156
184
|
model?: string;
|
|
157
185
|
maxTokens?: number;
|
|
158
186
|
};
|
|
159
|
-
session:
|
|
160
|
-
header?: {
|
|
161
|
-
origin?: 'subagent';
|
|
162
|
-
parentSession?: string;
|
|
163
|
-
delegationDepth?: number;
|
|
164
|
-
cwd?: string;
|
|
165
|
-
agentPreset?: string;
|
|
166
|
-
};
|
|
167
|
-
events: readonly HostSessionEvent[];
|
|
168
|
-
/**
|
|
169
|
-
* Model-visible event sequences, in order. Optional because not every host
|
|
170
|
-
* publishes a surface projection; when absent, callers fall back to
|
|
171
|
-
* session-scoped state.
|
|
172
|
-
*/
|
|
173
|
-
surface?: {
|
|
174
|
-
readonly nodes: readonly number[];
|
|
175
|
-
};
|
|
176
|
-
};
|
|
187
|
+
session: HostSession;
|
|
177
188
|
ctx: HostAgentContext;
|
|
178
189
|
followup(message: HostUserMessage): void;
|
|
179
190
|
steer(message: HostUserMessage): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HostSession, HostSessionEvent } from './contracts.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Materialize one immutable event-log snapshot across supported DSH releases.
|
|
4
|
+
* Capability detection keeps alpha and stable rc behavior on one code path.
|
|
5
|
+
*/
|
|
6
|
+
export declare function hostSessionEvents(session: HostSession): readonly HostSessionEvent[];
|
|
7
|
+
/** Read one exact event without materializing the alpha log when possible. */
|
|
8
|
+
export declare function hostSessionEventAt(session: HostSession, seq: number): HostSessionEvent | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Composable three-tier memory control plane for DeepSeek Harness: persistent runtime context, searchable project documents, pluggable long-term memory, guarded strategies, WebUI, and headless tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|