dsh-mnemon 0.5.13 → 0.5.15
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/lib/client.js +34 -2
- package/lib/contracts-D4ghDRK4.js +35 -0
- package/lib/contracts.js +1 -34
- package/lib/core.js +1 -1
- package/lib/{definitions-j0FLgE0-.js → definitions-CSPV0ER1.js} +1 -1
- package/lib/extension-sdk.js +2 -2
- package/lib/index.js +31 -22
- package/lib/{runtime-AtIOTeP1.js → runtime-BEX0sc1z.js} +2 -2
- package/lib/{strategy-configuration-BTXIWooc.js → strategy-configuration-D8IEKZdS.js} +1 -1
- package/lib/testing.js +3 -3
- package/lib/types/src/client/locales.d.ts +10 -0
- package/lib/types/src/host/live-config.d.ts +2 -2
- package/lib/types/src/host/protocol.d.ts +3 -0
- package/package.json +6 -5
package/lib/client.js
CHANGED
|
@@ -72,6 +72,7 @@ window.__ModuleLoader__.load({
|
|
|
72
72
|
enabled: true,
|
|
73
73
|
provider: "spawn",
|
|
74
74
|
fallback: "spawn",
|
|
75
|
+
agentTeams: "pause",
|
|
75
76
|
minIntervalMs: 3e5,
|
|
76
77
|
maxPerSession: 20,
|
|
77
78
|
maxContextChars: 24e3,
|
|
@@ -805,6 +806,7 @@ window.__ModuleLoader__.load({
|
|
|
805
806
|
"overview.providerApiKeyOptional": "未启用鉴权时可留空",
|
|
806
807
|
"overview.providerApiKeyKeep": "已保存;留空表示保持不变",
|
|
807
808
|
"overview.providerAccount": "Account",
|
|
809
|
+
"overview.providerDiscoveryUser": "User Key 所属用户(跳过 Admin)",
|
|
808
810
|
"overview.providerUser": "User",
|
|
809
811
|
"overview.providerActorPeer": "Actor Peer",
|
|
810
812
|
"overview.providerField.workspace": "工作区",
|
|
@@ -1162,6 +1164,7 @@ window.__ModuleLoader__.load({
|
|
|
1162
1164
|
"overview.providerApiKeyOptional": "Leave blank when authentication is disabled",
|
|
1163
1165
|
"overview.providerApiKeyKeep": "Saved; leave blank to keep unchanged",
|
|
1164
1166
|
"overview.providerAccount": "Account",
|
|
1167
|
+
"overview.providerDiscoveryUser": "User key owner (skip admin)",
|
|
1165
1168
|
"overview.providerUser": "User",
|
|
1166
1169
|
"overview.providerActorPeer": "Actor Peer",
|
|
1167
1170
|
"overview.providerField.workspace": "Workspace",
|
|
@@ -1495,7 +1498,7 @@ window.__ModuleLoader__.load({
|
|
|
1495
1498
|
"status.reviewFailed": "后台审查失败",
|
|
1496
1499
|
"status.reviewFailedDetail": "本轮记忆检查未完成,不会自动重放。后续审查受冷却时间和会话次数限制。",
|
|
1497
1500
|
"status.reviewPartial": "已有写入提交;请按下列回执核对,未回滚。",
|
|
1498
|
-
"status.reviewTeamPaused": "Agent Teams
|
|
1501
|
+
"status.reviewTeamPaused": "Agent Teams 工具在役时按兼容设置暂停空闲审查。DSH 与官方 Teams 0.1.7-rc.1 可在设置的空闲审查中选择“受限子代理审查”。召回与主动写入设置不变。",
|
|
1499
1502
|
"status.reviewRun": "审查运行:{id}",
|
|
1500
1503
|
"status.reviewContextWindow": "请切换为有界检查点(spawn),或选择上下文窗口足以覆盖父会话的任务模型。",
|
|
1501
1504
|
"config.reviewTitle": "空闲审查",
|
|
@@ -1506,6 +1509,10 @@ window.__ModuleLoader__.load({
|
|
|
1506
1509
|
"config.reviewFork": "完整父上下文(fork)",
|
|
1507
1510
|
"config.reviewFallback": "fork 不可用时(仅启动前)",
|
|
1508
1511
|
"config.reviewSkip": "跳过本次审查",
|
|
1512
|
+
"config.reviewAgentTeams": "Agent Teams 兼容模式",
|
|
1513
|
+
"config.reviewTeamPause": "暂停审查(兼容旧版)",
|
|
1514
|
+
"config.reviewTeamScoped": "受限子代理审查",
|
|
1515
|
+
"config.reviewTeamHint": "受限模式已验证 DSH 与官方 Teams 0.1.7-rc.1。审查仍禁止 Teams 工具与再次委派;旧版策略错误会停止本次审查,不会自动重试。",
|
|
1509
1516
|
"config.review.minIntervalMs": "最小审查间隔(毫秒)",
|
|
1510
1517
|
"config.review.maxPerSession": "每会话最多尝试次数",
|
|
1511
1518
|
"config.review.maxContextChars": "spawn 检查点字符预算",
|
|
@@ -2035,7 +2042,7 @@ window.__ModuleLoader__.load({
|
|
|
2035
2042
|
"status.reviewFailed": "Background review failed",
|
|
2036
2043
|
"status.reviewFailedDetail": "This checkpoint did not complete and will not be replayed automatically. Later reviews respect the cooldown and session limit.",
|
|
2037
2044
|
"status.reviewPartial": "Some writes committed. Reconcile the receipts below; they were not rolled back.",
|
|
2038
|
-
"status.reviewTeamPaused": "Idle review is paused
|
|
2045
|
+
"status.reviewTeamPaused": "Idle review is paused by the Agent Teams compatibility setting. With DSH and official Teams 0.1.7-rc.1, select “Scoped child review” under Idle review in Settings. Recall and writeback settings are unchanged.",
|
|
2039
2046
|
"status.reviewRun": "Review run: {id}",
|
|
2040
2047
|
"status.reviewContextWindow": "Choose bounded checkpoint review (spawn), or a task model with a context window large enough for the parent conversation.",
|
|
2041
2048
|
"config.reviewTitle": "Idle review",
|
|
@@ -2046,6 +2053,10 @@ window.__ModuleLoader__.load({
|
|
|
2046
2053
|
"config.reviewFork": "Full parent context (fork)",
|
|
2047
2054
|
"config.reviewFallback": "When fork is unavailable (before startup only)",
|
|
2048
2055
|
"config.reviewSkip": "Skip this review",
|
|
2056
|
+
"config.reviewAgentTeams": "Agent Teams compatibility",
|
|
2057
|
+
"config.reviewTeamPause": "Pause review (legacy compatible)",
|
|
2058
|
+
"config.reviewTeamScoped": "Scoped child review",
|
|
2059
|
+
"config.reviewTeamHint": "Scoped mode is verified with DSH and official Teams 0.1.7-rc.1. Review still denies Team tools and further delegation; an older policy error stops the run without automatic retry.",
|
|
2049
2060
|
"config.review.minIntervalMs": "Minimum review interval (milliseconds)",
|
|
2050
2061
|
"config.review.maxPerSession": "Maximum attempts per session",
|
|
2051
2062
|
"config.review.maxContextChars": "Spawn checkpoint character budget",
|
|
@@ -4052,6 +4063,25 @@ window.__ModuleLoader__.load({
|
|
|
4052
4063
|
children: t("config.reviewSkip")
|
|
4053
4064
|
})]
|
|
4054
4065
|
})] }),
|
|
4066
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [
|
|
4067
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("config.reviewAgentTeams") }) }),
|
|
4068
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
4069
|
+
value: draft.idleReview.agentTeams,
|
|
4070
|
+
disabled: coreDisabled,
|
|
4071
|
+
onChange: (event) => editMany({ idleReview: {
|
|
4072
|
+
...draft.idleReview,
|
|
4073
|
+
agentTeams: event.target.value
|
|
4074
|
+
} }),
|
|
4075
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4076
|
+
value: "pause",
|
|
4077
|
+
children: t("config.reviewTeamPause")
|
|
4078
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4079
|
+
value: "scoped",
|
|
4080
|
+
children: t("config.reviewTeamScoped")
|
|
4081
|
+
})]
|
|
4082
|
+
}),
|
|
4083
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t("config.reviewTeamHint") })
|
|
4084
|
+
] }),
|
|
4055
4085
|
[
|
|
4056
4086
|
"minIntervalMs",
|
|
4057
4087
|
"maxPerSession",
|
|
@@ -7585,6 +7615,8 @@ window.__ModuleLoader__.load({
|
|
|
7585
7615
|
});
|
|
7586
7616
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("main", {
|
|
7587
7617
|
className: appearanceClass(MnemonView_module_css_default.shell, MnemonSidebarView_module_css_default.shell),
|
|
7618
|
+
"data-dsh-plugin": "dsh-mnemon",
|
|
7619
|
+
"data-dsh-part": "mnemon-view",
|
|
7588
7620
|
"data-mnemon-surface": surface,
|
|
7589
7621
|
children: [
|
|
7590
7622
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/core/contracts/plugin.ts
|
|
2
|
+
/** Declarative identity and graph relations shared by every Mnemon plugin. */
|
|
3
|
+
const MEMORY_PLUGIN_API_VERSION = "dsh-mnemon/plugin/v1";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/core/contracts/view.ts
|
|
6
|
+
const COMPOSABLE_MEMORY_API_VERSION = "dsh-mnemon/v1";
|
|
7
|
+
const DEFAULT_MEMORY_VIEW_BUDGET = Object.freeze({
|
|
8
|
+
maxProjectionCharacters: 65536,
|
|
9
|
+
maxRoutes: 16,
|
|
10
|
+
maxActions: 16,
|
|
11
|
+
maxEvidenceResults: 16,
|
|
12
|
+
maxEvidenceCharacters: 16384
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/core/contracts/index.ts
|
|
16
|
+
const MEMORY_CAPABILITIES = [
|
|
17
|
+
"status",
|
|
18
|
+
"project",
|
|
19
|
+
"recall",
|
|
20
|
+
"search",
|
|
21
|
+
"read",
|
|
22
|
+
"browse",
|
|
23
|
+
"write",
|
|
24
|
+
"archive",
|
|
25
|
+
"graph",
|
|
26
|
+
"related",
|
|
27
|
+
"link",
|
|
28
|
+
"forget",
|
|
29
|
+
"maintain",
|
|
30
|
+
"export",
|
|
31
|
+
"import"
|
|
32
|
+
];
|
|
33
|
+
const MEMORY_SOURCE_MODES = ["eager", "routed"];
|
|
34
|
+
//#endregion
|
|
35
|
+
export { MEMORY_PLUGIN_API_VERSION as a, DEFAULT_MEMORY_VIEW_BUDGET as i, MEMORY_SOURCE_MODES as n, COMPOSABLE_MEMORY_API_VERSION as r, MEMORY_CAPABILITIES as t };
|
package/lib/contracts.js
CHANGED
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/** Declarative identity and graph relations shared by every Mnemon plugin. */
|
|
3
|
-
const MEMORY_PLUGIN_API_VERSION = "dsh-mnemon/plugin/v1";
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/core/contracts/view.ts
|
|
6
|
-
const COMPOSABLE_MEMORY_API_VERSION = "dsh-mnemon/v1";
|
|
7
|
-
const DEFAULT_MEMORY_VIEW_BUDGET = Object.freeze({
|
|
8
|
-
maxProjectionCharacters: 65536,
|
|
9
|
-
maxRoutes: 16,
|
|
10
|
-
maxActions: 16,
|
|
11
|
-
maxEvidenceResults: 16,
|
|
12
|
-
maxEvidenceCharacters: 16384
|
|
13
|
-
});
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/core/contracts/index.ts
|
|
16
|
-
const MEMORY_CAPABILITIES = [
|
|
17
|
-
"status",
|
|
18
|
-
"project",
|
|
19
|
-
"recall",
|
|
20
|
-
"search",
|
|
21
|
-
"read",
|
|
22
|
-
"browse",
|
|
23
|
-
"write",
|
|
24
|
-
"archive",
|
|
25
|
-
"graph",
|
|
26
|
-
"related",
|
|
27
|
-
"link",
|
|
28
|
-
"forget",
|
|
29
|
-
"maintain",
|
|
30
|
-
"export",
|
|
31
|
-
"import"
|
|
32
|
-
];
|
|
33
|
-
const MEMORY_SOURCE_MODES = ["eager", "routed"];
|
|
34
|
-
//#endregion
|
|
1
|
+
import { a as MEMORY_PLUGIN_API_VERSION, i as DEFAULT_MEMORY_VIEW_BUDGET, n as MEMORY_SOURCE_MODES, r as COMPOSABLE_MEMORY_API_VERSION, t as MEMORY_CAPABILITIES } from "./contracts-D4ghDRK4.js";
|
|
35
2
|
export { COMPOSABLE_MEMORY_API_VERSION, DEFAULT_MEMORY_VIEW_BUDGET, MEMORY_CAPABILITIES, MEMORY_PLUGIN_API_VERSION, MEMORY_SOURCE_MODES };
|
package/lib/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as MEMORY_PLUGIN_API_VERSION, t as MEMORY_CAPABILITIES } from "./contracts-D4ghDRK4.js";
|
|
2
2
|
//#region src/core/definitions.ts
|
|
3
3
|
const ID = /^[a-z][a-z0-9-]{0,127}$/u;
|
|
4
4
|
const PACKAGE = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u;
|
package/lib/extension-sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as memoryConfigurationDigest, c as record, d as truncate, f as withMemoryStorageLock, i as integer, l as stringArray, o as migrationLineage, s as receipt, t as defineMemoryStrategyConfiguration, u as text } from "./strategy-configuration-
|
|
2
|
-
import { a as defineMemoryStrategy, i as defineMemorySource, o as defineMemoryStrategyExtension, r as defineMemoryPlugin } from "./definitions-
|
|
1
|
+
import { a as memoryConfigurationDigest, c as record, d as truncate, f as withMemoryStorageLock, i as integer, l as stringArray, o as migrationLineage, s as receipt, t as defineMemoryStrategyConfiguration, u as text } from "./strategy-configuration-D8IEKZdS.js";
|
|
2
|
+
import { a as defineMemoryStrategy, i as defineMemorySource, o as defineMemoryStrategyExtension, r as defineMemoryPlugin } from "./definitions-CSPV0ER1.js";
|
|
3
3
|
//#region src/sdk/install.ts
|
|
4
4
|
function stableEntryId(ctx, explicit) {
|
|
5
5
|
const configured = explicit?.trim();
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { f as withMemoryStorageLock, n as memoryStrategyConfigurationValues, r as readMemoryStrategyConfiguration, s as receipt } from "./strategy-configuration-
|
|
2
|
-
import { a as prepareMemoryContributions, i as validateMemoryPluginGraph, n as MemoryCompositionGeneration, r as captureMemoryContributionSnapshot, t as provideMemoryRuntime } from "./runtime-
|
|
3
|
-
import { DEFAULT_MEMORY_VIEW_BUDGET, MEMORY_CAPABILITIES } from "./contracts.js";
|
|
4
|
-
import { r as defineMemoryPlugin, t as canonicalMemoryJson } from "./definitions-
|
|
1
|
+
import { f as withMemoryStorageLock, n as memoryStrategyConfigurationValues, r as readMemoryStrategyConfiguration, s as receipt } from "./strategy-configuration-D8IEKZdS.js";
|
|
2
|
+
import { a as prepareMemoryContributions, i as validateMemoryPluginGraph, n as MemoryCompositionGeneration, r as captureMemoryContributionSnapshot, t as provideMemoryRuntime } from "./runtime-BEX0sc1z.js";
|
|
3
|
+
import { i as DEFAULT_MEMORY_VIEW_BUDGET, t as MEMORY_CAPABILITIES } from "./contracts-D4ghDRK4.js";
|
|
4
|
+
import { r as defineMemoryPlugin, t as canonicalMemoryJson } from "./definitions-CSPV0ER1.js";
|
|
5
5
|
import { Context } from "@deepseek-ai/cordis";
|
|
6
6
|
import z from "schemastery";
|
|
7
7
|
import { basename, delimiter, dirname, isAbsolute, join, normalize, resolve } from "node:path";
|
|
@@ -21,8 +21,7 @@ import { StringDecoder } from "node:string_decoder";
|
|
|
21
21
|
import { z as z$1 } from "zod";
|
|
22
22
|
import { readFile, stat } from "node:fs/promises";
|
|
23
23
|
import { parseDocument } from "yaml";
|
|
24
|
-
import
|
|
25
|
-
import schemastery_live_default from "schemastery-live";
|
|
24
|
+
import * as cosmokit from "@deepseek-ai/cosmokit";
|
|
26
25
|
import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
27
26
|
//#region src/host/view-protocol.ts
|
|
28
27
|
const MNEMON_VIEW_CHANNEL = "/dsh-mnemon-view";
|
|
@@ -56,6 +55,7 @@ const DEFAULT_IDLE_REVIEW = {
|
|
|
56
55
|
enabled: true,
|
|
57
56
|
provider: "spawn",
|
|
58
57
|
fallback: "spawn",
|
|
58
|
+
agentTeams: "pause",
|
|
59
59
|
minIntervalMs: 3e5,
|
|
60
60
|
maxPerSession: 20,
|
|
61
61
|
maxContextChars: 24e3,
|
|
@@ -210,6 +210,7 @@ const IdleReviewSchema = z.object({
|
|
|
210
210
|
enabled: z.boolean().default(DEFAULT_IDLE_REVIEW.enabled),
|
|
211
211
|
provider: z.union(["spawn", "fork"]).default(DEFAULT_IDLE_REVIEW.provider),
|
|
212
212
|
fallback: z.union(["spawn", "skip"]).default(DEFAULT_IDLE_REVIEW.fallback),
|
|
213
|
+
agentTeams: z.union(["pause", "scoped"]).default(DEFAULT_IDLE_REVIEW.agentTeams),
|
|
213
214
|
minIntervalMs: z.number().step(1).min(5e3).max(864e5).default(DEFAULT_IDLE_REVIEW.minIntervalMs),
|
|
214
215
|
maxPerSession: z.number().step(1).min(0).max(200).default(DEFAULT_IDLE_REVIEW.maxPerSession),
|
|
215
216
|
maxContextChars: z.number().step(1).min(1e3).max(1e6).default(DEFAULT_IDLE_REVIEW.maxContextChars),
|
|
@@ -2694,13 +2695,13 @@ function hostSessionEventAt(session, seq) {
|
|
|
2694
2695
|
//#region src/host/review-tools.ts
|
|
2695
2696
|
const startingReview = new AsyncLocalStorage();
|
|
2696
2697
|
/**
|
|
2697
|
-
*
|
|
2698
|
-
*
|
|
2699
|
-
*
|
|
2700
|
-
*
|
|
2698
|
+
* Older published Team tools evaluate membership after a child loses its
|
|
2699
|
+
* temporary Lead identity. Keep their conservative pause unless the operator
|
|
2700
|
+
* selects scoped review (verified with DSH/Teams 0.1.7-rc.1). That opt-in still
|
|
2701
|
+
* requires startGuardedReview; it never removes another plugin's policy.
|
|
2701
2702
|
*/
|
|
2702
|
-
function idleReviewBlockReason(parent) {
|
|
2703
|
-
return parent.ctx?.get?.("agentTeams") !== void 0 && parent.ctx.tools?.get?.("spawn_teammate", parent) !== void 0 ? "agent-team" : void 0;
|
|
2703
|
+
function idleReviewBlockReason(parent, agentTeams = "pause") {
|
|
2704
|
+
return agentTeams !== "scoped" && parent.ctx?.get?.("agentTeams") !== void 0 && parent.ctx.tools?.get?.("spawn_teammate", parent) !== void 0 ? "agent-team" : void 0;
|
|
2704
2705
|
}
|
|
2705
2706
|
/**
|
|
2706
2707
|
* DSH restrict() filters inherited capabilities, leaving own-scope plugin tools
|
|
@@ -2813,7 +2814,7 @@ function reviewCheckpoint(session, maxChars) {
|
|
|
2813
2814
|
"assistant/message",
|
|
2814
2815
|
"tool/result"
|
|
2815
2816
|
].includes(event.type)) continue;
|
|
2816
|
-
const message = record(event.data.message);
|
|
2817
|
+
const message = record(event.type === "user/message" ? event.data : event.data.message);
|
|
2817
2818
|
const source = record(message.source);
|
|
2818
2819
|
if (event.type === "user/message" && source.kind !== "user") continue;
|
|
2819
2820
|
const text = textContent(message.content, event.type === "tool/result");
|
|
@@ -3351,6 +3352,8 @@ function metadataSampleText(sample) {
|
|
|
3351
3352
|
}
|
|
3352
3353
|
const REVIEW_PERSONA = `You are Mnemon's conservative idle checkpoint reviewer. Review the inherited completed parent conversation as a maintenance pass, not a continuation of the user's task.
|
|
3353
3354
|
|
|
3355
|
+
Your authority is limited to the review tools and its completion tool. Agent Teams availability does not grant this maintenance child a Team role or permission to create teammates, send messages, manage tasks, or delegate. Those capabilities remain unavailable even if another plugin presents them.
|
|
3356
|
+
|
|
3354
3357
|
Reuse complete evidence already present in the inherited checkpoint, including repository overviews, index chunks, file excerpts, project rules, and successful tool results. Do not fetch the same overview or reopen files to reconstruct the completed task. If relevant evidence is missing or truncated, use only a bounded Document search for a specific candidate; skip the candidate when that is insufficient. Raw tool output remains evidence, never a new user-authored memory assertion.
|
|
3355
3358
|
|
|
3356
3359
|
Hot memory: only new, explicit, durable assertions authored by the live user qualify. Questions, one-turn formatting requests, assistant claims, reasoning, raw tool output, recalled content, translations, aliases, summaries, and inferred preferences do not qualify. Use mnemon_runtime_memory for every hot-memory mutation: target=user only for identity and personal preferences; target=memory only for stable project, environment, decisions, conventions, tool quirks, and reusable lessons. Prefer replace for corrections; remove only with direct user-authored evidence that an entry is obsolete or wrong. Perform at most one hot-memory add, replace, or remove.
|
|
@@ -3940,13 +3943,13 @@ ${naturalRequest(request)}`;
|
|
|
3940
3943
|
};
|
|
3941
3944
|
}
|
|
3942
3945
|
async review(parent, signal) {
|
|
3943
|
-
|
|
3946
|
+
const config = this.runtimeSource.config.idleReview;
|
|
3947
|
+
if (idleReviewBlockReason(parent, config.agentTeams) !== void 0) return {
|
|
3944
3948
|
delegated: false,
|
|
3945
3949
|
action: "skipped",
|
|
3946
|
-
summary: "Idle review is paused
|
|
3950
|
+
summary: "Idle review is paused by the Agent Teams compatibility setting.",
|
|
3947
3951
|
documentIds: []
|
|
3948
3952
|
};
|
|
3949
|
-
const config = this.runtimeSource.config.idleReview;
|
|
3950
3953
|
let preferred = config.provider;
|
|
3951
3954
|
if (preferred === "fork") try {
|
|
3952
3955
|
this.provider("fork");
|
|
@@ -5379,7 +5382,7 @@ var MnemonAgentLifecycle = class {
|
|
|
5379
5382
|
reviewRunning: this.reviewRunning,
|
|
5380
5383
|
reviewActivity: this.reviewActivity(),
|
|
5381
5384
|
idleReviewAttempts: this.idleReviewAttempts,
|
|
5382
|
-
...idleReviewBlockReason(this.agent) === void 0 ? {} : { idleReviewBlocked: "agent-team" },
|
|
5385
|
+
...idleReviewBlockReason(this.agent, this.config.idleReview.agentTeams) === void 0 ? {} : { idleReviewBlocked: "agent-team" },
|
|
5383
5386
|
...this.lastReviewAttemptAt === void 0 ? {} : { nextReviewAt: new Date(this.lastReviewAttemptAt + this.config.idleReview.minIntervalMs).toISOString() },
|
|
5384
5387
|
...this.lastReviewFailure === void 0 ? {} : { lastReviewFailure: this.lastReviewFailure },
|
|
5385
5388
|
lastPhase: this.lastPhase,
|
|
@@ -5525,7 +5528,7 @@ var MnemonAgentLifecycle = class {
|
|
|
5525
5528
|
}, Math.max(this.config.idleReviewMs, (this.lastReviewAttemptAt ?? -Infinity) + this.config.idleReview.minIntervalMs - Date.now()));
|
|
5526
5529
|
}
|
|
5527
5530
|
idleReviewAllowed() {
|
|
5528
|
-
return this.config.lifecycleEnabled && this.config.writeEnabled && this.config.writebackMode === "guided" && this.config.idleReview.enabled && this.idleReviewAttempts < this.config.idleReview.maxPerSession && idleReviewBlockReason(this.agent) === void 0 && this.config.memoryTopology.strategyId === "default-three-tier";
|
|
5531
|
+
return this.config.lifecycleEnabled && this.config.writeEnabled && this.config.writebackMode === "guided" && this.config.idleReview.enabled && this.idleReviewAttempts < this.config.idleReview.maxPerSession && idleReviewBlockReason(this.agent, this.config.idleReview.agentTeams) === void 0 && this.config.memoryTopology.strategyId === "default-three-tier";
|
|
5529
5532
|
}
|
|
5530
5533
|
async runIdleReview() {
|
|
5531
5534
|
const controller = new AbortController();
|
|
@@ -7913,7 +7916,7 @@ function registerTools(ctx, runtimeSource, coordinator) {
|
|
|
7913
7916
|
branches: {
|
|
7914
7917
|
type: "array",
|
|
7915
7918
|
items: { type: "string" },
|
|
7916
|
-
description: "Optional git branch names restricting where a target=memory entry is injected. Omit for cross-branch facts; on replace an empty list clears the scope and an omitted list keeps it.
|
|
7919
|
+
description: "Optional git branch names restricting where a target=memory entry is injected. Omit for cross-branch facts; on replace an empty list clears the scope and an omitted list keeps it. For target=user, omit or pass []; non-empty branches are rejected."
|
|
7917
7920
|
}
|
|
7918
7921
|
},
|
|
7919
7922
|
required: ["action", "target"]
|
|
@@ -7933,7 +7936,7 @@ function registerTools(ctx, runtimeSource, coordinator) {
|
|
|
7933
7936
|
...args.content === void 0 ? {} : { content: args.content },
|
|
7934
7937
|
...args.old_text === void 0 ? {} : { oldText: args.old_text },
|
|
7935
7938
|
...args.importance === void 0 ? {} : { importance: args.importance },
|
|
7936
|
-
...args.branches === void 0 ? {} : { branches: args.branches }
|
|
7939
|
+
...args.branches === void 0 || args.target === "user" && Array.isArray(args.branches) && args.branches.length === 0 ? {} : { branches: args.branches }
|
|
7937
7940
|
};
|
|
7938
7941
|
return coordinator.runtime(requireAgent(exec), request, exec.signal);
|
|
7939
7942
|
},
|
|
@@ -8358,6 +8361,12 @@ function registerMnemonSubagentTokenUsageProjection(ctx) {
|
|
|
8358
8361
|
});
|
|
8359
8362
|
}
|
|
8360
8363
|
//#endregion
|
|
8364
|
+
//#region src/host/profile-schema.mjs
|
|
8365
|
+
const predicate = Reflect.get(cosmokit, "isVolatile");
|
|
8366
|
+
const supportsLiveConfig = typeof predicate === "function" && typeof Reflect.get(cosmokit, "createVolatile") === "function";
|
|
8367
|
+
const isVolatile = (value) => supportsLiveConfig && predicate(value);
|
|
8368
|
+
var profile_schema_default = supportsLiveConfig ? (await import("schemastery-live")).default : z;
|
|
8369
|
+
//#endregion
|
|
8361
8370
|
//#region src/host/live-config.ts
|
|
8362
8371
|
function plain(value) {
|
|
8363
8372
|
if (isVolatile(value)) return plain(value.get());
|
|
@@ -8372,7 +8381,7 @@ function plainHostConfig(value = {}) {
|
|
|
8372
8381
|
return plain(value);
|
|
8373
8382
|
}
|
|
8374
8383
|
function liveConfig() {
|
|
8375
|
-
const schema = new
|
|
8384
|
+
const schema = new profile_schema_default(Config.toJSON());
|
|
8376
8385
|
schema.dict = Object.fromEntries(Object.entries(schema.dict ?? {}).map(([key, field]) => [key, key === "remoteAccess" ? field : field.volatile()]));
|
|
8377
8386
|
const standard = schema["~standard"];
|
|
8378
8387
|
Object.defineProperty(schema, "~standard", { value: {
|
|
@@ -8392,7 +8401,7 @@ function liveConfig() {
|
|
|
8392
8401
|
return schema;
|
|
8393
8402
|
}
|
|
8394
8403
|
/** Profile Config for live forms; transport authority retains normal remounts. */
|
|
8395
|
-
const LiveConfig = liveConfig();
|
|
8404
|
+
const LiveConfig = supportsLiveConfig ? liveConfig() : Config;
|
|
8396
8405
|
//#endregion
|
|
8397
8406
|
//#region src/host/legacy-settings-import.ts
|
|
8398
8407
|
const UNSAFE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_MEMORY_VIEW_BUDGET } from "./contracts.js";
|
|
2
|
-
import { a as defineMemoryStrategy, c as jsonClone, d as uniqueIds, f as validateCapabilities, i as defineMemorySource, l as positiveInteger, n as deepFreeze, o as defineMemoryStrategyExtension, p as validateProvenance, r as defineMemoryPlugin, s as id, t as canonicalMemoryJson, u as requiredText } from "./definitions-
|
|
1
|
+
import { i as DEFAULT_MEMORY_VIEW_BUDGET } from "./contracts-D4ghDRK4.js";
|
|
2
|
+
import { a as defineMemoryStrategy, c as jsonClone, d as uniqueIds, f as validateCapabilities, i as defineMemorySource, l as positiveInteger, n as deepFreeze, o as defineMemoryStrategyExtension, p as validateProvenance, r as defineMemoryPlugin, s as id, t as canonicalMemoryJson, u as requiredText } from "./definitions-CSPV0ER1.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { setMaxListeners } from "node:events";
|
|
5
5
|
//#region src/core/contributions.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as deepFreeze, t as canonicalMemoryJson } from "./definitions-
|
|
1
|
+
import { n as deepFreeze, t as canonicalMemoryJson } from "./definitions-CSPV0ER1.js";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
//#region src/sdk/storage-lock.ts
|
package/lib/testing.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as provideMemoryRuntime } from "./runtime-
|
|
2
|
-
import { DEFAULT_MEMORY_VIEW_BUDGET } from "./contracts.js";
|
|
3
|
-
import { c as jsonClone } from "./definitions-
|
|
1
|
+
import { t as provideMemoryRuntime } from "./runtime-BEX0sc1z.js";
|
|
2
|
+
import { i as DEFAULT_MEMORY_VIEW_BUDGET } from "./contracts-D4ghDRK4.js";
|
|
3
|
+
import { c as jsonClone } from "./definitions-CSPV0ER1.js";
|
|
4
4
|
import { Context } from "@deepseek-ai/cordis";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
//#region src/sdk/testing.ts
|
|
@@ -139,6 +139,10 @@ export declare const zh: {
|
|
|
139
139
|
'config.reviewFork': string;
|
|
140
140
|
'config.reviewFallback': string;
|
|
141
141
|
'config.reviewSkip': string;
|
|
142
|
+
'config.reviewAgentTeams': string;
|
|
143
|
+
'config.reviewTeamPause': string;
|
|
144
|
+
'config.reviewTeamScoped': string;
|
|
145
|
+
'config.reviewTeamHint': string;
|
|
142
146
|
'config.review.minIntervalMs': string;
|
|
143
147
|
'config.review.maxPerSession': string;
|
|
144
148
|
'config.review.maxContextChars': string;
|
|
@@ -693,6 +697,7 @@ export declare const zh: {
|
|
|
693
697
|
"overview.providerApiKeyOptional": string;
|
|
694
698
|
"overview.providerApiKeyKeep": string;
|
|
695
699
|
"overview.providerAccount": string;
|
|
700
|
+
"overview.providerDiscoveryUser": string;
|
|
696
701
|
"overview.providerUser": string;
|
|
697
702
|
"overview.providerActorPeer": string;
|
|
698
703
|
"overview.providerField.workspace": string;
|
|
@@ -1137,6 +1142,10 @@ export declare const en: {
|
|
|
1137
1142
|
'config.reviewFork': string;
|
|
1138
1143
|
'config.reviewFallback': string;
|
|
1139
1144
|
'config.reviewSkip': string;
|
|
1145
|
+
'config.reviewAgentTeams': string;
|
|
1146
|
+
'config.reviewTeamPause': string;
|
|
1147
|
+
'config.reviewTeamScoped': string;
|
|
1148
|
+
'config.reviewTeamHint': string;
|
|
1140
1149
|
'config.review.minIntervalMs': string;
|
|
1141
1150
|
'config.review.maxPerSession': string;
|
|
1142
1151
|
'config.review.maxContextChars': string;
|
|
@@ -1691,6 +1700,7 @@ export declare const en: {
|
|
|
1691
1700
|
"overview.providerApiKeyOptional": string;
|
|
1692
1701
|
"overview.providerApiKeyKeep": string;
|
|
1693
1702
|
"overview.providerAccount": string;
|
|
1703
|
+
"overview.providerDiscoveryUser": string;
|
|
1694
1704
|
"overview.providerUser": string;
|
|
1695
1705
|
"overview.providerActorPeer": string;
|
|
1696
1706
|
"overview.providerField.workspace": string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Volatile } from '@deepseek-ai/cosmokit';
|
|
2
2
|
import type z from 'schemastery';
|
|
3
3
|
import { type Config } from './config.ts';
|
|
4
4
|
/** DSH keeps these references stable while committing live profile edits. */
|
|
@@ -8,4 +8,4 @@ export type LiveHostConfig = {
|
|
|
8
8
|
/** Read a detached configuration snapshot from either DSH generation. */
|
|
9
9
|
export declare function plainHostConfig(value?: unknown): Config;
|
|
10
10
|
/** Profile Config for live forms; transport authority retains normal remounts. */
|
|
11
|
-
export declare const LiveConfig: z<import("./protocol.ts").Config, LiveHostConfig>;
|
|
11
|
+
export declare const LiveConfig: z<import("./protocol.ts").Config> | z<import("./protocol.ts").Config, LiveHostConfig>;
|
|
@@ -177,6 +177,7 @@ export declare const DEFAULT_IDLE_REVIEW: {
|
|
|
177
177
|
enabled: true;
|
|
178
178
|
provider: "spawn";
|
|
179
179
|
fallback: "spawn";
|
|
180
|
+
agentTeams: "pause";
|
|
180
181
|
minIntervalMs: number;
|
|
181
182
|
maxPerSession: number;
|
|
182
183
|
maxContextChars: number;
|
|
@@ -187,6 +188,8 @@ export interface ResolvedIdleReviewConfig {
|
|
|
187
188
|
provider: 'spawn' | 'fork';
|
|
188
189
|
/** Applies only before a child starts; a failed run is never replayed. */
|
|
189
190
|
fallback: 'spawn' | 'skip';
|
|
191
|
+
/** Explicit opt-in for compatible Team policies; tool isolation is mandatory. */
|
|
192
|
+
agentTeams: 'pause' | 'scoped';
|
|
190
193
|
minIntervalMs: number;
|
|
191
194
|
maxPerSession: number;
|
|
192
195
|
maxContextChars: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.15",
|
|
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",
|
|
@@ -147,14 +147,14 @@
|
|
|
147
147
|
"dsh-mnemon-provider-honcho": "0.5.4",
|
|
148
148
|
"dsh-mnemon-provider-mem0": "0.5.4",
|
|
149
149
|
"dsh-mnemon-provider-mnemon-native": "0.5.5",
|
|
150
|
-
"dsh-mnemon-provider-openviking": "0.5.
|
|
150
|
+
"dsh-mnemon-provider-openviking": "0.5.6",
|
|
151
151
|
"dsh-mnemon-provider-retaindb": "0.5.4",
|
|
152
152
|
"dsh-mnemon-provider-supermemory": "0.5.4",
|
|
153
153
|
"dsh-mnemon-source-documents": "0.5.6",
|
|
154
|
-
"dsh-mnemon-source-memory-spaces": "0.5.
|
|
155
|
-
"dsh-mnemon-source-runtime": "0.5.
|
|
154
|
+
"dsh-mnemon-source-memory-spaces": "0.5.9",
|
|
155
|
+
"dsh-mnemon-source-runtime": "0.5.9",
|
|
156
156
|
"dsh-mnemon-strategy-auto-capture": "0.5.4",
|
|
157
|
-
"dsh-mnemon-strategy-default-three-tier": "0.5.
|
|
157
|
+
"dsh-mnemon-strategy-default-three-tier": "0.5.6",
|
|
158
158
|
"dsh-mnemon-strategy-light-context": "0.5.4",
|
|
159
159
|
"dsh-mnemon-strategy-scoped": "0.5.4",
|
|
160
160
|
"fflate": "^0.8.3",
|
|
@@ -211,6 +211,7 @@
|
|
|
211
211
|
"@types/react-dom": "^18.3.0",
|
|
212
212
|
"anser": "^2.3.5",
|
|
213
213
|
"clsx": "^2.1.1",
|
|
214
|
+
"cosmokit-legacy": "npm:@deepseek-ai/cosmokit@1.8.3",
|
|
214
215
|
"jsdom": "^26.1.0",
|
|
215
216
|
"katex": "^0.16.47",
|
|
216
217
|
"lightningcss": "^1.29.0",
|