dsh-mnemon 0.2.4 → 0.2.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 +3 -3
- package/README.zh-CN.md +3 -3
- package/lib/client.js +61 -17
- package/lib/index.js +10 -8
- package/lib/types/client/use-request-version.d.ts +8 -0
- package/lib/types/guidance.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<p align="center"><strong>English</strong> · <a href="./README.zh-CN.md">简体中文</a></p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img src="https://img.shields.io/badge/release-v0.2.
|
|
6
|
+
<img src="https://img.shields.io/badge/release-v0.2.6-5b5bd6" alt="release v0.2.6">
|
|
7
7
|
<img src="https://img.shields.io/badge/memory-3%20tiers-087c5b" alt="three memory tiers">
|
|
8
8
|
<img src="https://img.shields.io/badge/providers-9-c66a09" alt="nine providers">
|
|
9
9
|
<img src="https://img.shields.io/badge/Node.js-%E2%89%A520-43853d" alt="Node.js 20 or newer">
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<p align="center">
|
|
23
23
|
<a href="./docs/en/capabilities.md"><strong>Explore the capability map</strong></a> ·
|
|
24
24
|
<a href="./docs/en/getting-started.md">Start in five minutes</a> ·
|
|
25
|
-
<a href="./docs/en/releases/v0.2.
|
|
25
|
+
<a href="./docs/en/releases/v0.2.6.md">Read the v0.2.6 notes</a> ·
|
|
26
26
|
<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>
|
|
27
27
|
</p>
|
|
28
28
|
|
|
@@ -190,7 +190,7 @@ See [Operations, security, and troubleshooting](./docs/en/operations.md) for bac
|
|
|
190
190
|
| Configure scope, routing, and model selection | [Configuration](./docs/en/configuration.md) |
|
|
191
191
|
| Back up, update, or troubleshoot | [Operations](./docs/en/operations.md) |
|
|
192
192
|
| Integrate tools, commands, or RPC | [Interface reference](./docs/en/interfaces.md) |
|
|
193
|
-
| Review the release | [v0.2.
|
|
193
|
+
| Review the release | [v0.2.6 release notes](./docs/en/releases/v0.2.6.md) |
|
|
194
194
|
|
|
195
195
|
See the [documentation hub](./docs/en/README.md) for the full map.
|
|
196
196
|
|
package/README.zh-CN.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<p align="center"><a href="./README.md">English</a> · <strong>简体中文</strong></p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img src="https://img.shields.io/badge/release-v0.2.
|
|
6
|
+
<img src="https://img.shields.io/badge/release-v0.2.6-5b5bd6" alt="发布版本 v0.2.6">
|
|
7
7
|
<img src="https://img.shields.io/badge/%E8%AE%B0%E5%BF%86-3%20%E5%B1%82-087c5b" alt="三层记忆">
|
|
8
8
|
<img src="https://img.shields.io/badge/Provider-9-c66a09" alt="九种 Provider">
|
|
9
9
|
<img src="https://img.shields.io/badge/Node.js-%E2%89%A520-43853d" alt="Node.js 20 或更新版本">
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<p align="center">
|
|
23
23
|
<a href="./docs/zh-CN/capabilities.md"><strong>先看能力地图</strong></a> ·
|
|
24
24
|
<a href="./docs/zh-CN/getting-started.md">5 分钟开始</a> ·
|
|
25
|
-
<a href="./docs/zh-CN/releases/v0.2.
|
|
25
|
+
<a href="./docs/zh-CN/releases/v0.2.6.md">v0.2.6 升级说明</a> ·
|
|
26
26
|
<a href="https://github.com/omdsh-dev/dsh-mnemon/blob/e6ca446e45bdd17991f3c7c98560456de465282b/docs/assets/media/dsh-mnemon-memory-system-demo.mp4">观看宽屏实机演示</a>
|
|
27
27
|
</p>
|
|
28
28
|
|
|
@@ -190,7 +190,7 @@ dsh plugin --profile headless add "link:/absolute/path/to/dsh-mnemon"
|
|
|
190
190
|
| 配置范围、路由与模型 | [配置参考](./docs/zh-CN/configuration.md) |
|
|
191
191
|
| 备份、更新或排障 | [运维指南](./docs/zh-CN/operations.md) |
|
|
192
192
|
| 接入工具、命令或 RPC | [接口参考](./docs/zh-CN/interfaces.md) |
|
|
193
|
-
| 查看本次升级 | [v0.2.
|
|
193
|
+
| 查看本次升级 | [v0.2.6 发布说明](./docs/zh-CN/releases/v0.2.6.md) |
|
|
194
194
|
|
|
195
195
|
完整目录见[文档中心](./docs/zh-CN/README.md)。
|
|
196
196
|
|
package/lib/client.js
CHANGED
|
@@ -243,7 +243,7 @@ window.__ModuleLoader__.load({
|
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
reconnectBody(memoryBodyId) {
|
|
246
|
-
return this.call(
|
|
246
|
+
return this.call(MNEMON_READ_CHANNEL, "body-reconnect", this.scoped({ memoryBodyId }));
|
|
247
247
|
}
|
|
248
248
|
maintainBodyMetadata(memoryBodyIds) {
|
|
249
249
|
return this.call(MNEMON_WRITE_CHANNEL, "body-metadata-maintain", this.scoped({ memoryBodyIds }));
|
|
@@ -2480,6 +2480,25 @@ window.__ModuleLoader__.load({
|
|
|
2480
2480
|
});
|
|
2481
2481
|
}
|
|
2482
2482
|
//#endregion
|
|
2483
|
+
//#region src/client/use-request-version.ts
|
|
2484
|
+
/**
|
|
2485
|
+
* Guards UI state against responses from an older request or an unmounted
|
|
2486
|
+
* component. Starting a request invalidates every earlier version.
|
|
2487
|
+
*/
|
|
2488
|
+
function useRequestVersion() {
|
|
2489
|
+
const current = (0, react.useRef)(0);
|
|
2490
|
+
(0, react.useEffect)(() => () => {
|
|
2491
|
+
current.current += 1;
|
|
2492
|
+
}, []);
|
|
2493
|
+
return (0, react.useMemo)(() => ({
|
|
2494
|
+
begin: () => {
|
|
2495
|
+
current.current += 1;
|
|
2496
|
+
return current.current;
|
|
2497
|
+
},
|
|
2498
|
+
isCurrent: (version) => current.current === version
|
|
2499
|
+
}), []);
|
|
2500
|
+
}
|
|
2501
|
+
//#endregion
|
|
2483
2502
|
//#region src/client/ProviderSettingsSection.tsx
|
|
2484
2503
|
const SAVED_SECRET_MASK = "••••••••••••";
|
|
2485
2504
|
const PREVIEW_CAPABILITIES = {
|
|
@@ -3004,21 +3023,26 @@ window.__ModuleLoader__.load({
|
|
|
3004
3023
|
const [catalog, setCatalog] = (0, react.useState)(() => initialCatalog ?? EMPTY_PROVIDER_CATALOG);
|
|
3005
3024
|
const [loading, setLoading] = (0, react.useState)(client !== null && initialCatalog === void 0);
|
|
3006
3025
|
const [failed, setFailed] = (0, react.useState)(null);
|
|
3026
|
+
const loadRequests = useRequestVersion();
|
|
3007
3027
|
const load = (0, react.useCallback)(async (quiet = false) => {
|
|
3008
3028
|
if (client === null) return;
|
|
3029
|
+
const request = loadRequests.begin();
|
|
3009
3030
|
if (!quiet) setLoading(true);
|
|
3010
3031
|
setFailed(null);
|
|
3011
3032
|
try {
|
|
3012
3033
|
const next = await client.providerServices();
|
|
3034
|
+
if (!loadRequests.isCurrent(request)) return;
|
|
3013
3035
|
cacheCatalog(props.connection, routeKey, next);
|
|
3014
3036
|
setCatalog(next);
|
|
3015
3037
|
} catch (reason) {
|
|
3038
|
+
if (!loadRequests.isCurrent(request)) return;
|
|
3016
3039
|
setFailed(message$1(reason));
|
|
3017
3040
|
} finally {
|
|
3018
|
-
if (!quiet) setLoading(false);
|
|
3041
|
+
if (!quiet && loadRequests.isCurrent(request)) setLoading(false);
|
|
3019
3042
|
}
|
|
3020
3043
|
}, [
|
|
3021
3044
|
client,
|
|
3045
|
+
loadRequests,
|
|
3022
3046
|
props.connection,
|
|
3023
3047
|
routeKey
|
|
3024
3048
|
]);
|
|
@@ -6769,7 +6793,7 @@ window.__ModuleLoader__.load({
|
|
|
6769
6793
|
}
|
|
6770
6794
|
};
|
|
6771
6795
|
const reconnect = async (body) => {
|
|
6772
|
-
if (
|
|
6796
|
+
if (reconnectingBody !== null || editingBody !== null || deletingBody !== null) return;
|
|
6773
6797
|
setReconnectingBody(body.id);
|
|
6774
6798
|
setError(null);
|
|
6775
6799
|
setCatalog((current) => current === null ? current : {
|
|
@@ -7211,13 +7235,13 @@ window.__ModuleLoader__.load({
|
|
|
7211
7235
|
"data-active": body.active || void 0,
|
|
7212
7236
|
"data-healthy": !body.statusLoading && body.healthy || void 0,
|
|
7213
7237
|
"data-status-loading": body.statusLoading || void 0,
|
|
7214
|
-
"data-reconnectable":
|
|
7238
|
+
"data-reconnectable": "",
|
|
7215
7239
|
"data-reconnecting": reconnectingBody === body.id || void 0,
|
|
7216
7240
|
"data-mnemon-default": body.mnemonDefault || void 0,
|
|
7217
7241
|
"data-editing": appearance.surface === "buildin" && editingBody === body.id || void 0,
|
|
7218
|
-
tabIndex:
|
|
7219
|
-
"aria-label":
|
|
7220
|
-
title: reconnectingBody === body.id ? t("overview.reconnecting") : body.error ??
|
|
7242
|
+
tabIndex: 0,
|
|
7243
|
+
"aria-label": t("overview.reconnectAria", { name: body.name }),
|
|
7244
|
+
title: reconnectingBody === body.id ? t("overview.reconnecting") : body.error ?? t("overview.reconnectHint"),
|
|
7221
7245
|
onClick: (event) => {
|
|
7222
7246
|
if (event.target instanceof Element && event.target.closest("button, input, textarea, select, label, a, [role=\"switch\"]") !== null) return;
|
|
7223
7247
|
reconnect(body);
|
|
@@ -7744,11 +7768,13 @@ window.__ModuleLoader__.load({
|
|
|
7744
7768
|
const [relatedLoading, setRelatedLoading] = (0, react.useState)(false);
|
|
7745
7769
|
const [visibleResultLimit, setVisibleResultLimit] = (0, react.useState)(pageSize);
|
|
7746
7770
|
const [visibleRelatedLimit, setVisibleRelatedLimit] = (0, react.useState)(pageSize);
|
|
7771
|
+
const relatedRequests = useRequestVersion();
|
|
7747
7772
|
(0, react.useEffect)(() => {
|
|
7748
7773
|
if (props.seed !== "") setQuery(props.seed);
|
|
7749
7774
|
}, [props.seed]);
|
|
7750
7775
|
const runSearch = async (withAgent) => {
|
|
7751
7776
|
if (query.trim() === "") return;
|
|
7777
|
+
relatedRequests.begin();
|
|
7752
7778
|
setSearchKind(withAgent ? "agent" : "direct");
|
|
7753
7779
|
setSearched(true);
|
|
7754
7780
|
setError(null);
|
|
@@ -7792,21 +7818,23 @@ window.__ModuleLoader__.load({
|
|
|
7792
7818
|
};
|
|
7793
7819
|
const searching = searchKind !== null;
|
|
7794
7820
|
const showRelated = async (insight) => {
|
|
7821
|
+
const request = relatedRequests.begin();
|
|
7795
7822
|
setRelatedTo(insight);
|
|
7796
7823
|
setRelated([]);
|
|
7797
7824
|
setRelatedLoading(true);
|
|
7798
7825
|
setError(null);
|
|
7799
7826
|
setVisibleRelatedLimit(pageSize);
|
|
7800
|
-
if (typeof window.requestAnimationFrame === "function") window.requestAnimationFrame(() => document.getElementById("mnemon-related-pane")?.scrollIntoView({
|
|
7827
|
+
if (typeof window.requestAnimationFrame === "function") window.requestAnimationFrame(() => document.getElementById("mnemon-related-pane")?.scrollIntoView?.({
|
|
7801
7828
|
block: "nearest",
|
|
7802
7829
|
behavior: "smooth"
|
|
7803
7830
|
}));
|
|
7804
7831
|
try {
|
|
7805
|
-
|
|
7832
|
+
const response = await props.client.related(insight.id, insight.memoryBodyId);
|
|
7833
|
+
if (relatedRequests.isCurrent(request)) setRelated(response);
|
|
7806
7834
|
} catch (reason) {
|
|
7807
|
-
setError(message(reason));
|
|
7835
|
+
if (relatedRequests.isCurrent(request)) setError(message(reason));
|
|
7808
7836
|
} finally {
|
|
7809
|
-
setRelatedLoading(false);
|
|
7837
|
+
if (relatedRequests.isCurrent(request)) setRelatedLoading(false);
|
|
7810
7838
|
}
|
|
7811
7839
|
};
|
|
7812
7840
|
const forget = async (insight) => {
|
|
@@ -7963,7 +7991,11 @@ window.__ModuleLoader__.load({
|
|
|
7963
7991
|
className: MnemonView_module_css_default.sectionHeading,
|
|
7964
7992
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t("search.related") }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7965
7993
|
type: "button",
|
|
7966
|
-
onClick: () =>
|
|
7994
|
+
onClick: () => {
|
|
7995
|
+
relatedRequests.begin();
|
|
7996
|
+
setRelatedTo(null);
|
|
7997
|
+
setRelatedLoading(false);
|
|
7998
|
+
},
|
|
7967
7999
|
"aria-label": t("search.closeRelated"),
|
|
7968
8000
|
children: "×"
|
|
7969
8001
|
})]
|
|
@@ -8014,20 +8046,24 @@ window.__ModuleLoader__.load({
|
|
|
8014
8046
|
const [error, setError] = (0, react.useState)(null);
|
|
8015
8047
|
const [visibleEntityLimit, setVisibleEntityLimit] = (0, react.useState)(entityPageSize);
|
|
8016
8048
|
const [visibleInsightLimit, setVisibleInsightLimit] = (0, react.useState)(insightPageSize);
|
|
8049
|
+
const entityRequests = useRequestVersion();
|
|
8017
8050
|
const load = (0, react.useCallback)(async (selected) => {
|
|
8051
|
+
const request = entityRequests.begin();
|
|
8018
8052
|
setLoading(true);
|
|
8019
8053
|
setError(null);
|
|
8020
8054
|
setVisibleInsightLimit(insightPageSize);
|
|
8021
8055
|
if (selected === void 0) setVisibleEntityLimit(entityPageSize);
|
|
8022
8056
|
try {
|
|
8023
|
-
|
|
8057
|
+
const response = await props.client.entities(selected, 20);
|
|
8058
|
+
if (entityRequests.isCurrent(request)) setView(response);
|
|
8024
8059
|
} catch (reason) {
|
|
8025
|
-
setError(message(reason));
|
|
8060
|
+
if (entityRequests.isCurrent(request)) setError(message(reason));
|
|
8026
8061
|
} finally {
|
|
8027
|
-
setLoading(false);
|
|
8062
|
+
if (entityRequests.isCurrent(request)) setLoading(false);
|
|
8028
8063
|
}
|
|
8029
8064
|
}, [
|
|
8030
8065
|
entityPageSize,
|
|
8066
|
+
entityRequests,
|
|
8031
8067
|
insightPageSize,
|
|
8032
8068
|
props.client
|
|
8033
8069
|
]);
|
|
@@ -9415,25 +9451,33 @@ window.__ModuleLoader__.load({
|
|
|
9415
9451
|
const [description, setDescription] = (0, react.useState)("");
|
|
9416
9452
|
const [content, setContent] = (0, react.useState)("");
|
|
9417
9453
|
const [sources, setSources] = (0, react.useState)("");
|
|
9454
|
+
const displayRequests = useRequestVersion();
|
|
9418
9455
|
const display = (0, react.useCallback)(async (nextQuery, nextStatus) => {
|
|
9456
|
+
const request = displayRequests.begin();
|
|
9419
9457
|
setLoading(true);
|
|
9420
9458
|
setError(null);
|
|
9421
9459
|
setVisibleLimit(pageSize);
|
|
9422
9460
|
try {
|
|
9423
9461
|
const current = await props.client.documents();
|
|
9424
9462
|
const filtered = (nextQuery.trim() === "" ? current.documents : (await props.client.searchDocuments(nextQuery, nextStatus === "archived")).results).filter((record) => record.status === nextStatus);
|
|
9463
|
+
if (!displayRequests.isCurrent(request)) return;
|
|
9425
9464
|
setSnapshot(current);
|
|
9426
9465
|
setItems(filtered);
|
|
9427
9466
|
setSelectedId((previous) => previous !== null && filtered.some((record) => record.id === previous) ? previous : filtered[0]?.id ?? null);
|
|
9428
9467
|
} catch (reason) {
|
|
9468
|
+
if (!displayRequests.isCurrent(request)) return;
|
|
9429
9469
|
setError(message(reason));
|
|
9430
9470
|
setSnapshot(null);
|
|
9431
9471
|
setItems([]);
|
|
9432
9472
|
setSelectedId(null);
|
|
9433
9473
|
} finally {
|
|
9434
|
-
setLoading(false);
|
|
9474
|
+
if (displayRequests.isCurrent(request)) setLoading(false);
|
|
9435
9475
|
}
|
|
9436
|
-
}, [
|
|
9476
|
+
}, [
|
|
9477
|
+
displayRequests,
|
|
9478
|
+
pageSize,
|
|
9479
|
+
props.client
|
|
9480
|
+
]);
|
|
9437
9481
|
(0, react.useEffect)(() => {
|
|
9438
9482
|
display(query, status);
|
|
9439
9483
|
}, [
|
package/lib/index.js
CHANGED
|
@@ -896,7 +896,7 @@ var DocumentManager = class {
|
|
|
896
896
|
//#endregion
|
|
897
897
|
//#region src/guidance.ts
|
|
898
898
|
const GUIDANCE_SECTION_NAME = "mnemon:routing";
|
|
899
|
-
const
|
|
899
|
+
const RUNTIME_MEMORY_CONTEXT_NAME = "mnemon:runtime-memory";
|
|
900
900
|
const ROUTING_GUIDANCE = "Use memory only by need. For substantial project records, search active Mnemon Documents before deep recall. Call mnemon_recall when durable history may matter or an exact prior detail is missing; never infer a missing historical rule. New explicit reusable facts normally go to mnemon_runtime_memory. A write completes only with a tool receipt.";
|
|
901
901
|
const RUNTIME_MEMORY_EMPTY_BRACES_VARIABLE = "mnemon_runtime_memory_empty_braces";
|
|
902
902
|
const LITERAL_EMPTY_BRACES = "{{}}";
|
|
@@ -916,20 +916,20 @@ function registerGuidance(ctx, config) {
|
|
|
916
916
|
text: () => config?.routingGuidance === false ? "" : ROUTING_GUIDANCE
|
|
917
917
|
});
|
|
918
918
|
}
|
|
919
|
-
/**
|
|
919
|
+
/** Project the latest committed USER.md/MEMORY.md as DSH's durable runtime-context snapshot. */
|
|
920
920
|
function registerRuntimeMemoryContext(ctx, runtimeMemory) {
|
|
921
921
|
const prompt = systemPrompt(ctx);
|
|
922
922
|
prompt?.variable?.(RUNTIME_MEMORY_EMPTY_BRACES_VARIABLE, () => LITERAL_EMPTY_BRACES);
|
|
923
|
-
prompt?.
|
|
924
|
-
name:
|
|
923
|
+
prompt?.context?.({
|
|
924
|
+
name: RUNTIME_MEMORY_CONTEXT_NAME,
|
|
925
925
|
order: 145,
|
|
926
926
|
text: () => runtimeMemoryPromptText(runtimeMemory)
|
|
927
927
|
});
|
|
928
928
|
}
|
|
929
929
|
/** Shadow the global fallback with the current Agent workspace's hot memory. */
|
|
930
930
|
function registerAgentRuntimeMemoryContext(agent, runtimeMemory) {
|
|
931
|
-
const dispose = scopedSystemPrompt(agent)?.
|
|
932
|
-
name:
|
|
931
|
+
const dispose = scopedSystemPrompt(agent)?.context?.({
|
|
932
|
+
name: RUNTIME_MEMORY_CONTEXT_NAME,
|
|
933
933
|
order: 145,
|
|
934
934
|
text: () => runtimeMemoryPromptText(runtimeMemory())
|
|
935
935
|
});
|
|
@@ -3765,7 +3765,7 @@ function number$1(value) {
|
|
|
3765
3765
|
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
3766
3766
|
}
|
|
3767
3767
|
function delay(ms, signal) {
|
|
3768
|
-
if (signal?.aborted === true) return Promise.reject(signal.reason);
|
|
3768
|
+
if (signal?.aborted === true) return Promise.reject(signal.reason ?? /* @__PURE__ */ new Error("OpenViking request aborted"));
|
|
3769
3769
|
return new Promise((resolve, reject) => {
|
|
3770
3770
|
const aborted = () => {
|
|
3771
3771
|
clearTimeout(timer);
|
|
@@ -4005,6 +4005,7 @@ var OpenVikingProvider = class {
|
|
|
4005
4005
|
return this.requestConnection(connection, path, init, options);
|
|
4006
4006
|
}
|
|
4007
4007
|
async requestConnection(connection, path, init = {}, options = {}) {
|
|
4008
|
+
options.signal?.throwIfAborted();
|
|
4008
4009
|
const controller = new AbortController();
|
|
4009
4010
|
const relay = () => controller.abort(options.signal?.reason);
|
|
4010
4011
|
options.signal?.addEventListener("abort", relay, { once: true });
|
|
@@ -4100,6 +4101,7 @@ var HttpMemoryProvider = class {
|
|
|
4100
4101
|
const label = memoryProviderDescriptor(this.id).label;
|
|
4101
4102
|
if (endpoint === "") throw new Error(`${label} endpoint is not configured`);
|
|
4102
4103
|
if (!path.startsWith("/")) throw new Error(`${label} request path must be absolute`);
|
|
4104
|
+
options.signal?.throwIfAborted();
|
|
4103
4105
|
const controller = new AbortController();
|
|
4104
4106
|
const relay = () => controller.abort(options.signal?.reason);
|
|
4105
4107
|
options.signal?.addEventListener("abort", relay, { once: true });
|
|
@@ -5777,7 +5779,6 @@ var MnemonService = class {
|
|
|
5777
5779
|
}
|
|
5778
5780
|
}
|
|
5779
5781
|
async reconnectBody(id, signal) {
|
|
5780
|
-
this.assertWritable();
|
|
5781
5782
|
const body = this.memoryBodies.list().find((candidate) => candidate.id === id);
|
|
5782
5783
|
if (body === void 0) throw new Error(`unknown memory body: ${id}`);
|
|
5783
5784
|
if (body.provider.id !== "mnemon-native") {
|
|
@@ -9142,6 +9143,7 @@ function createReadHandler(input, lifecycle, runtimeMemory, storage, versions) {
|
|
|
9142
9143
|
case "graph": return success$1(await service.graph(void 0, Array.isArray(payload.memoryBodyIds) ? payload.memoryBodyIds.map(String) : void 0));
|
|
9143
9144
|
case "bodies": return success$1(await service.bodies());
|
|
9144
9145
|
case "body-directory": return success$1(service.bodyDirectory());
|
|
9146
|
+
case "body-reconnect": return success$1(await service.reconnectBody(String(payload.memoryBodyId ?? "")));
|
|
9145
9147
|
case "provider-services": return success$1(service.memoryBodies.providerServices());
|
|
9146
9148
|
case "list": return success$1(await service.list({
|
|
9147
9149
|
...payload.query === void 0 ? {} : { query: String(payload.query) },
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guards UI state against responses from an older request or an unmounted
|
|
3
|
+
* component. Starting a request invalidates every earlier version.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useRequestVersion(): {
|
|
6
|
+
begin: () => number;
|
|
7
|
+
isCurrent: (version: number) => boolean;
|
|
8
|
+
};
|
package/lib/types/guidance.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import type { HostAgent, HostContextShape } from './contracts.ts';
|
|
|
2
2
|
import type { ResolvedConfig } from './config.ts';
|
|
3
3
|
import type { RuntimeMemoryController } from './runtime-memory.ts';
|
|
4
4
|
export declare const GUIDANCE_SECTION_NAME = "mnemon:routing";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const RUNTIME_MEMORY_CONTEXT_NAME = "mnemon:runtime-memory";
|
|
6
6
|
export declare const ROUTING_GUIDANCE = "Use memory only by need. For substantial project records, search active Mnemon Documents before deep recall. Call mnemon_recall when durable history may matter or an exact prior detail is missing; never infer a missing historical rule. New explicit reusable facts normally go to mnemon_runtime_memory. A write completes only with a tool receipt.";
|
|
7
7
|
export declare function registerGuidance(ctx: HostContextShape, config?: Pick<ResolvedConfig, 'routingGuidance'>): void;
|
|
8
|
-
/**
|
|
8
|
+
/** Project the latest committed USER.md/MEMORY.md as DSH's durable runtime-context snapshot. */
|
|
9
9
|
export declare function registerRuntimeMemoryContext(ctx: HostContextShape, runtimeMemory: RuntimeMemoryController): void;
|
|
10
10
|
/** Shadow the global fallback with the current Agent workspace's hot memory. */
|
|
11
11
|
export declare function registerAgentRuntimeMemoryContext(agent: HostAgent, runtimeMemory: () => RuntimeMemoryController): () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Three-tier memory control plane for DeepSeek Harness: persistent runtime context, searchable project documents, pluggable long-term memory, smart routing, supervised agent workflows, WebUI, and headless tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|