dsh-mnemon 0.5.41 → 0.5.43

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 CHANGED
@@ -83,7 +83,7 @@ The default **Layered strategy** keeps runtime memory resident and reads the oth
83
83
  | [![The Turn skills line under a reply: release-notes, suggested 1](https://raw.githubusercontent.com/omdsh-dev/dsh-mnemon/main/docs/assets/skills-v0.5.34/en/chat-skills.jpg)](https://github.com/omdsh-dev/dsh-mnemon/blob/main/docs/en/guides/skills.md#in-a-conversation) | [![A draft of release-notes with its backtest, Current 40 → Draft 93 +53, and the diff](https://raw.githubusercontent.com/omdsh-dev/dsh-mnemon/main/docs/assets/skills-v0.5.34/en/skills-draft.jpg)](https://github.com/omdsh-dev/dsh-mnemon/blob/main/docs/en/guides/skills.md#evolution) |
84
84
 
85
85
  - **Manage.** Switch a skill off for the model or the `/` menu, use it in the conversation in one click, edit it, and go back to any earlier version.
86
- - **Evolve.** With self-evolution on, finished conversations are reviewed in the background for corrections, "from now on" instructions, failed tools and reusable procedures. A suggestion cites the steps it rests on; a task Agent drafts the new `SKILL.md`, which is backtested against the current version before you adopt it. Nothing changes without your **Adopt**.
86
+ - **Evolve.** With self-evolution on, finished conversations are reviewed in the background for corrections, "from now on" instructions, failed tools and reusable procedures. A suggestion cites the steps it rests on; a task Agent drafts the new `SKILL.md`, which is backtested against the current version before you adopt it. Manual **Adopt** remains the default; opt-in automatic adoption can process new idle-review suggestions after complete, non-regressing backtests.
87
87
  - **Test.** Each skill has its own cases, from reviews, from recorded conversations or written by hand, and a backtest scores any version on them.
88
88
  - **Install.** The market searches skills.sh's open index and reads any GitHub repository, any site publishing an Agent Skills discovery index, and curated catalogs; every install is previewed, with security reviews where they exist.
89
89
  - **In the conversation.** A line under each turn names the skills it used and what its review suggested, each one click from its page.
package/README.zh-CN.md CHANGED
@@ -84,7 +84,7 @@
84
84
  | [![回复下方的本回合技能一行:release-notes · 建议 1](https://raw.githubusercontent.com/omdsh-dev/dsh-mnemon/main/docs/assets/skills-v0.5.34/zh-CN/chat-skills.jpg)](https://github.com/omdsh-dev/dsh-mnemon/blob/main/docs/zh-CN/guides/skills.md#对话中) | [![release-notes 的草案:回测“当前 40 → 草案 93 +53”与差异](https://raw.githubusercontent.com/omdsh-dev/dsh-mnemon/main/docs/assets/skills-v0.5.34/zh-CN/skills-draft.jpg)](https://github.com/omdsh-dev/dsh-mnemon/blob/main/docs/zh-CN/guides/skills.md#进化) |
85
85
 
86
86
  - **管理。** 让技能不被模型加载或不出现在 `/` 菜单里,一键在对话中使用,直接编辑,并能回到任意历史版本。
87
- - **进化。** 开启自进化后,对话结束会在后台复盘,寻找多次纠正、“以后都这样做”的指示、工具失败和可复用的流程。每条建议都标出所依据的步骤;任务 Agent 写出新的 `SKILL.md`,先与当前版本回测对比,再由你采纳。没有你的**采纳**,什么都不会改。
87
+ - **进化。** 开启自进化后,对话结束会在后台复盘,寻找多次纠正、“以后都这样做”的指示、工具失败和可复用的流程。每条建议都标出所依据的步骤;任务 Agent 写出新的 `SKILL.md`,先与当前版本回测对比,再由你采纳。默认仍须手动**采纳**;可显式开启自动采纳,让新的空闲审查建议在完整回测不退步时落地。
88
88
  - **测试。** 每个技能都有自己的用例,来自复盘、记录的对话或手写,任意版本都能在这些用例上回测打分。
89
89
  - **安装。** 市场可以搜索 skills.sh 的开放索引,读取任意 GitHub 仓库、任何按 Agent Skills 发现协议发布技能的网站,以及技能目录;每次安装前都能预览,有安全审核的会一并显示。
90
90
  - **对话中。** 每个回合下方的一行列出这一回合用到的技能和复盘提出的建议,点一下就能打开。
package/lib/bundle.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as prepareStarterResolution } from "./starter-resolution-xVjONc6g.js";
1
+ import { t as prepareStarterResolution } from "./starter-resolution-CTY14Exj.js";
2
2
  //#region src/bundle.ts
3
3
  const groupKey = Symbol.for("cordis.group");
4
4
  const init = Symbol.for("cordis.init");
package/lib/client.js CHANGED
@@ -318,6 +318,7 @@ window.__ModuleLoader__.load({
318
318
  allowUpdate: true,
319
319
  targetScope: "user",
320
320
  autoBacktest: true,
321
+ autoAdopt: false,
321
322
  draftMaxTokens: 32768,
322
323
  draftRetryMaxTokens: 65536,
323
324
  hints: true,
@@ -1188,7 +1189,13 @@ window.__ModuleLoader__.load({
1188
1189
  "runtime.result.localCompaction": "本地画像整理完成:未写入记忆空间,已更新{target} · 当前 {count} 条",
1189
1190
  "runtime.result.localArchive": "容量整理完成:没有可写的记忆空间,已先把 {archived} 条移入本地归档,再更新{target} · 当前 {count} 条",
1190
1191
  "runtime.readOnly": "当前为只读模式;运行时记忆仍会进入上下文,但不能在此修改。",
1191
- "runtime.footnote": "memories.json 是唯一事实源;两个 Markdown 文件由控制层生成,不应直接编辑。"
1192
+ "runtime.footnote": "memories.json 是唯一事实源;两个 Markdown 文件由控制层生成,不应直接编辑。",
1193
+ "runtime.pinned": "已固定",
1194
+ "runtime.pin": "固定",
1195
+ "runtime.unpin": "取消固定",
1196
+ "runtime.pinnedNotice": "条目已固定,容量整理时会保留在运行时记忆中。",
1197
+ "runtime.unpinnedNotice": "已取消固定,恢复通常的容量维护规则。",
1198
+ "runtime.pinBudget": "固定:{count} 条 · 投影字符 {used} / {limit}"
1192
1199
  };
1193
1200
  var en$3 = {
1194
1201
  "nav.runtime": "Runtime",
@@ -1235,7 +1242,13 @@ window.__ModuleLoader__.load({
1235
1242
  "runtime.result.localCompaction": "Local profile compaction complete: no Memory Space write; updated {target} · {count} entries",
1236
1243
  "runtime.result.localArchive": "Capacity maintenance complete: with no Memory Space to write to, moved {archived} entries to the local archive, then updated {target} · {count} entries",
1237
1244
  "runtime.readOnly": "Read only here: runtime memory still enters context but cannot be changed on this page.",
1238
- "runtime.footnote": "memories.json is the only source of truth. The control plane generates both Markdown files; do not edit them directly."
1245
+ "runtime.footnote": "memories.json is the only source of truth. The control plane generates both Markdown files; do not edit them directly.",
1246
+ "runtime.pinned": "Pinned",
1247
+ "runtime.pin": "Pin",
1248
+ "runtime.unpin": "Unpin",
1249
+ "runtime.pinnedNotice": "Entry pinned. It stays in hot memory during capacity maintenance.",
1250
+ "runtime.unpinnedNotice": "Entry unpinned. Normal capacity rules apply.",
1251
+ "runtime.pinBudget": "Pinned: {count} entries · {used} / {limit} projection characters"
1239
1252
  };
1240
1253
  //#endregion
1241
1254
  //#region plugins/dsh-mnemon-source-documents/presentation/locales.json
@@ -1288,6 +1301,12 @@ window.__ModuleLoader__.load({
1288
1301
  "documents.selectText": "在左侧查看活跃项目知识或沿 Mnemon 引用打开归档原文。",
1289
1302
  "documents.coldArchive": "归档原文",
1290
1303
  "documents.edit": "编辑",
1304
+ "documents.delete": "删除",
1305
+ "documents.deleteConfirm": "永久删除这份档案?",
1306
+ "documents.deleteDescription": "将永久移除档案记录和托管副本,无法撤销。不会建立记忆空间冷索引,也不会修改已有记忆空间条目或项目源文件。",
1307
+ "documents.deleteNow": "永久删除",
1308
+ "documents.deleting": "删除中…",
1309
+ "documents.deleted": "档案已永久删除。",
1291
1310
  "documents.path": "托管路径",
1292
1311
  "documents.revision": "修订",
1293
1312
  "documents.hash": "内容哈希",
@@ -1351,6 +1370,12 @@ window.__ModuleLoader__.load({
1351
1370
  "documents.selectText": "Read active project knowledge or follow a Mnemon reference to an archived original.",
1352
1371
  "documents.coldArchive": "Archived original",
1353
1372
  "documents.edit": "Edit",
1373
+ "documents.delete": "Delete",
1374
+ "documents.deleteConfirm": "Permanently delete this document?",
1375
+ "documents.deleteDescription": "This permanently removes the document record and managed copy and cannot be undone. No Memory Space index is created. Existing Memory Space entries and original project files remain unchanged.",
1376
+ "documents.deleteNow": "Delete permanently",
1377
+ "documents.deleting": "Deleting…",
1378
+ "documents.deleted": "Document permanently deleted.",
1354
1379
  "documents.path": "Managed path",
1355
1380
  "documents.revision": "Revision",
1356
1381
  "documents.hash": "Content hash",
@@ -2708,6 +2733,8 @@ window.__ModuleLoader__.load({
2708
2733
  "config.workspaceScopeHint": "每个工作区自己的 .mnemon 目录",
2709
2734
  "config.dataDirectory": "数据目录",
2710
2735
  "config.runtimeUserScopeTitle": "用户画像范围",
2736
+ "config.runtimeInheritance": "子 Agent 自动继承 Runtime 记忆",
2737
+ "config.runtimeInheritanceHint": "默认关闭。开启后,新建子 Agent 自动获得用户画像和工作记忆。已派发任务沿用原设置;任务明确提供的上下文和记忆工具不受影响。",
2711
2738
  "config.runtimeUserScopeStorage": "跟随存储范围",
2712
2739
  "config.runtimeUserScopeStorageHint": "与 MEMORY.md 在同一目录",
2713
2740
  "config.runtimeUserScopeGlobal": "全局共享",
@@ -2786,6 +2813,7 @@ window.__ModuleLoader__.load({
2786
2813
  "board.relationNeeds": "需要“{component}”",
2787
2814
  "board.relationNeededBy": "“{component}”依赖它",
2788
2815
  "options.aria": "“{component}”的选项",
2816
+ "options.emptySourcesConfirm": "当前未选择任何记忆源。保存后 Agent 的热记忆、档案和记忆空间读写将不可用。若想恢复自动选择,请取消并点击恢复默认。确定保存空列表吗?",
2789
2817
  "options.apply": "应用",
2790
2818
  "options.fix": "先修正标出的选项",
2791
2819
  "options.applying": "正在应用…",
@@ -3144,6 +3172,8 @@ window.__ModuleLoader__.load({
3144
3172
  "skills.targetScope.project": "项目",
3145
3173
  "skills.targetScope.storage": "跟随存储范围",
3146
3174
  "skills.evolutionHint": "后台复盘并建议改进技能;会创建落盘的任务及子代理会话,Mnemon 不自动删除这些记录",
3175
+ "skills.autoAdopt": "自动采纳新建议",
3176
+ "skills.autoAdoptHint": "默认关闭。需要自动回测:仅处理新的空闲审查建议,全部启用的文本用例不退步才采纳,最多重写两次;未测出或超出每轮用例上限时转人工审查。回测是文本模拟,不验证真实外部操作。",
3147
3177
  "skills.autoBacktest": "草案自动回测",
3148
3178
  "skills.autoBacktestHint": "草案写好后,用测试用例与当前版本对比",
3149
3179
  "skills.parameters": "复盘参数",
@@ -3532,6 +3562,8 @@ window.__ModuleLoader__.load({
3532
3562
  "config.workspaceScopeHint": "Each workspace keeps its own .mnemon directory",
3533
3563
  "config.dataDirectory": "Data directory",
3534
3564
  "config.runtimeUserScopeTitle": "User profile scope",
3565
+ "config.runtimeInheritance": "Automatically share Runtime memory with subagents",
3566
+ "config.runtimeInheritanceHint": "Off by default. New subagents receive the user profile and working memory when enabled. Existing tasks keep their setting; explicit task context and memory tools are unaffected.",
3535
3567
  "config.runtimeUserScopeStorage": "Follow storage scope",
3536
3568
  "config.runtimeUserScopeStorageHint": "Kept with MEMORY.md",
3537
3569
  "config.runtimeUserScopeGlobal": "Shared globally",
@@ -3610,6 +3642,7 @@ window.__ModuleLoader__.load({
3610
3642
  "board.relationNeeds": "Needs “{component}”",
3611
3643
  "board.relationNeededBy": "“{component}” depends on it",
3612
3644
  "options.aria": "Options of “{component}”",
3645
+ "options.emptySourcesConfirm": "No memory sources are selected. Saving disables Agent access to runtime memory, documents and memory spaces. To restore automatic selection, cancel and reset this option to default. Save an empty selection?",
3613
3646
  "options.apply": "Apply",
3614
3647
  "options.fix": "Fix the marked options first",
3615
3648
  "options.applying": "Applying…",
@@ -3968,6 +4001,8 @@ window.__ModuleLoader__.load({
3968
4001
  "skills.targetScope.project": "Project",
3969
4002
  "skills.targetScope.storage": "Follow storage",
3970
4003
  "skills.evolutionHint": "Review conversations and suggest skills. Task and subagent sessions are saved locally; Mnemon does not automatically delete them.",
4004
+ "skills.autoAdopt": "Automatically adopt new suggestions",
4005
+ "skills.autoAdoptHint": "Off by default; requires automatic backtests. Draft new idle-review suggestions and adopt only with no regression on all enabled text cases, retrying at most twice. Unmeasured or over-limit cases need manual review. Text simulations do not verify real external actions.",
3971
4006
  "skills.autoBacktest": "Backtest drafts",
3972
4007
  "skills.autoBacktestHint": "Compare a new draft with the current version on its test cases",
3973
4008
  "skills.parameters": "Review parameters",
@@ -4588,7 +4623,7 @@ window.__ModuleLoader__.load({
4588
4623
  };
4589
4624
  //#endregion
4590
4625
  //#region \0dsh-mnemon-css:/home/runner/work/dsh-mnemon/dsh-mnemon/plugins/dsh-mnemon-source-documents/presentation/page.module.css.mjs
4591
- const css$10 = ".IIa07q_documentSummary{grid-template-columns:.7fr .7fr 1.6fr;gap:12px;margin-bottom:12px;display:grid}.IIa07q_documentSummary article{border:.5px solid var(--mn-card-line);border-radius:var(--dsw-radius-lg);min-width:0;min-height:92px;padding:14px 16px}.IIa07q_documentSummary article>span{color:var(--mn-faint);font-size:12px;line-height:18px;display:block}.IIa07q_documentSummary article>strong{font-variant-numeric:tabular-nums;margin:4px 0 2px;font-size:20px;font-weight:500;line-height:28px;display:block}.IIa07q_documentSummary article>small{color:var(--mn-faint);font-size:12px;line-height:18px}.IIa07q_documentCapacity>div{background:var(--mn-fill);border-radius:999px;height:4px;margin:8px 0 6px;overflow:hidden}.IIa07q_documentCapacity>div i{border-radius:inherit;background:var(--dsw-alias-brand-primary);height:100%;transition:width .3s;display:block}.IIa07q_documentToolbar{border:.5px solid var(--mn-card-line);border-radius:var(--dsw-radius-lg);align-items:center;gap:8px;margin-bottom:12px;padding:8px;display:flex}.IIa07q_documentToolbar form{flex:1;align-items:center;gap:8px;min-width:260px;display:flex}.IIa07q_documentSearch{flex:1}.IIa07q_documentEditor input,.IIa07q_documentEditor textarea{border:.5px solid var(--mn-field-line);border-radius:var(--dsw-radius-md);width:100%;color:var(--mn-text);background:var(--mn-input);outline:0;padding:6px 10px;font-size:13px;line-height:20px}.IIa07q_documentEditor input:focus,.IIa07q_documentEditor textarea:focus{border-color:var(--mn-accent)}.IIa07q_documentToolbar>div{border-radius:var(--dsw-radius-md);background:var(--mn-hover);align-items:center;gap:2px;padding:3px;display:flex}.IIa07q_documentToolbar>div button{border-radius:var(--dsw-radius-sm);min-height:28px;color:var(--mn-muted);cursor:pointer;background:0 0;border:0;padding:0 12px;font-size:13px;font-weight:500;line-height:20px}.IIa07q_documentToolbar>div button:hover{color:var(--mn-text)}.IIa07q_documentToolbar>div button[data-active]{color:var(--mn-text);background:var(--mn-layer-1);box-shadow:var(--dsw-elevation-soft)}.IIa07q_documentToolbar>div b{color:var(--mn-faint);font-variant-numeric:tabular-nums;margin-left:6px;font-size:12px;font-weight:400}.IIa07q_documentWorkspace{grid-template-columns:minmax(250px,310px) minmax(0,1fr);gap:12px;min-height:590px;display:grid}.IIa07q_documentList,.IIa07q_documentReader{border:.5px solid var(--mn-card-line);border-radius:var(--dsw-radius-lg);min-width:0;overflow:hidden}.IIa07q_documentList{align-self:stretch}.IIa07q_documentList>header{border-bottom:.5px solid var(--mn-line);min-height:44px;color:var(--mn-faint);justify-content:space-between;align-items:center;padding:0 14px;font-size:12px;line-height:18px;display:flex}.IIa07q_documentList>header code{color:var(--mn-muted)}.IIa07q_documentList>button{--mn-provider-color:var(--mn-faint);border-radius:var(--dsw-radius-md);width:calc(100% - 12px);color:var(--mn-text);text-align:left;cursor:pointer;background:0 0;border:0;margin:6px 6px 0;padding:10px 12px;transition:background-color .15s;display:block}.IIa07q_documentList>button:hover{background:var(--mn-hover)}.IIa07q_documentList>button[data-selected]{background:var(--mn-fill)}.IIa07q_documentList>button>div{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.IIa07q_documentList>button strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.IIa07q_documentList>button time{color:var(--mn-faint);font-variant-numeric:tabular-nums;flex:none;font-size:11px}.IIa07q_documentList>button p{color:var(--mn-faint);-webkit-line-clamp:2;-webkit-box-orient:vertical;margin:4px 0 6px;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.IIa07q_documentList>button footer{color:var(--mn-faint);align-items:center;gap:8px;font-size:11px;line-height:16px;display:flex}.IIa07q_documentList>button footer code{margin-left:auto}.IIa07q_documentList>button footer em{color:var(--mn-danger);font-style:normal}.IIa07q_documentListEmpty{min-height:230px;color:var(--mn-muted);text-align:center;align-content:center;place-items:center;gap:4px;padding:24px;display:grid}.IIa07q_documentListEmpty>span{color:var(--mn-faint);margin-bottom:6px;font-size:24px;line-height:1}.IIa07q_documentListEmpty p{color:var(--mn-faint);margin:0;font-size:12px;line-height:18px}.IIa07q_documentReader{padding:clamp(16px,2vw,24px)}.IIa07q_documentReader>.IIa07q_emptyState{background:0 0;border:0;height:100%}.IIa07q_documentDetail>header{border-bottom:.5px solid var(--mn-line);justify-content:space-between;align-items:flex-start;gap:16px;padding-bottom:14px;display:flex}.IIa07q_documentDetail>header span{color:var(--mn-faint);font-size:12px;line-height:18px}.IIa07q_documentDetail>header h3{margin:2px 0;font-size:16px;font-weight:500;line-height:24px}.IIa07q_documentDetail>header p{color:var(--mn-faint);margin:0;font-size:12px;line-height:18px}.IIa07q_documentDetail>dl{border:.5px solid var(--mn-line);border-radius:var(--dsw-radius-md);grid-template-columns:2fr .45fr .8fr .55fr;margin:12px 0;display:grid;overflow:hidden}.IIa07q_documentDetail>dl>div{min-width:0;padding:8px 10px}.IIa07q_documentDetail>dl>div+div{border-left:.5px solid var(--mn-line)}.IIa07q_documentDetail dt{color:var(--mn-faint);margin-bottom:2px;font-size:11px;line-height:16px}.IIa07q_documentDetail dd{text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:12px;line-height:18px;overflow:hidden}.IIa07q_documentSources{flex-wrap:wrap;align-items:center;gap:6px;margin:12px 0;display:flex}.IIa07q_documentSources>span{color:var(--mn-faint);margin-right:4px;font-size:12px}.IIa07q_documentSources code,.IIa07q_documentArchiveReceipt code{color:var(--mn-muted);background:var(--mn-fill);border-radius:999px;padding:1px 8px;font-size:11px;line-height:17px}.IIa07q_markdownBody{overflow-wrap:anywhere;border:.5px solid var(--mn-line);border-radius:var(--dsw-radius-md);min-height:310px;color:var(--mn-text);margin:16px 0 0;padding:clamp(16px,2.5vw,28px);font-size:14px;line-height:1.75}.IIa07q_markdownBody>:first-child{margin-top:0}.IIa07q_markdownBody>:last-child{margin-bottom:0}.IIa07q_markdownBody h1,.IIa07q_markdownBody h2,.IIa07q_markdownBody h3,.IIa07q_markdownBody h4{color:var(--mn-text);margin:1.5em 0 .6em;font-weight:500;line-height:1.35}.IIa07q_markdownBody h1{border-bottom:.5px solid var(--mn-line);padding-bottom:.35em;font-size:1.6em}.IIa07q_markdownBody h2{border-bottom:.5px solid var(--mn-line);padding-bottom:.3em;font-size:1.35em}.IIa07q_markdownBody h3{font-size:1.15em}.IIa07q_markdownBody p,.IIa07q_markdownBody ul,.IIa07q_markdownBody ol,.IIa07q_markdownBody blockquote,.IIa07q_markdownBody table,.IIa07q_markdownBody pre{margin:.85em 0}.IIa07q_markdownBody ul,.IIa07q_markdownBody ol{padding-left:1.6em}.IIa07q_markdownBody li+li{margin-top:.3em}.IIa07q_markdownBody blockquote{border-left:2px solid var(--mn-line-strong);color:var(--mn-muted);margin-inline:0;padding:.1em 1em}.IIa07q_markdownBody code{border-radius:var(--dsw-radius-xs);color:var(--mn-text);background:var(--dsw-alias-markdown-inline-code,var(--mn-fill));font:.88em/1.55 var(--mn-code);padding:.15em .4em}.IIa07q_markdownBody pre{border-radius:var(--dsw-radius-md);background:var(--dsw-alias-markdown-code-block,var(--mn-fill));max-width:100%;padding:12px 16px;overflow:auto}.IIa07q_markdownBody pre code{background:0 0;padding:0;font-size:12px}.IIa07q_markdownBody a{color:var(--dsw-alias-link,var(--mn-accent));text-underline-offset:3px;text-decoration-thickness:1px}.IIa07q_markdownBody hr{border:0;border-top:.5px solid var(--mn-line);margin:1.8em 0}.IIa07q_markdownBody table{border-collapse:collapse;max-width:100%;display:block;overflow-x:auto}.IIa07q_markdownBody th,.IIa07q_markdownBody td{border:.5px solid var(--mn-line);text-align:left;vertical-align:top;padding:8px 10px}.IIa07q_markdownBody th{background:var(--mn-fill);font-weight:500}.IIa07q_markdownBody img{border-radius:var(--dsw-radius-sm);max-width:100%;height:auto}.IIa07q_documentArchiveReceipt{border-radius:var(--dsw-radius-md);background:color-mix(in srgb, var(--mn-success) 8%, transparent);margin:12px 0;padding:10px 12px}.IIa07q_documentArchiveReceipt p{color:var(--mn-muted);margin:2px 0 8px;font-size:12px;line-height:18px}.IIa07q_documentArchiveReceipt div{flex-wrap:wrap;gap:6px;display:flex}.IIa07q_documentDanger{border-top:.5px solid var(--mn-line);justify-content:flex-end;align-items:center;gap:8px;min-height:56px;margin-top:12px;padding-top:12px;display:flex}.IIa07q_documentDanger>div{margin-right:auto}.IIa07q_documentDanger strong{font-size:13px;font-weight:500;line-height:20px;display:block}.IIa07q_documentDanger p{color:var(--mn-faint);margin:2px 0 0;font-size:12px;line-height:18px}.IIa07q_documentDanger>span{color:var(--mn-danger);margin-right:auto;font-size:12px}.IIa07q_documentEditor{border:.5px solid var(--mn-card-line);border-radius:var(--dsw-radius-lg);margin-bottom:12px;padding:16px}.IIa07q_documentReader>.IIa07q_documentEditor{background:0 0;border:0;margin:0;padding:0}.IIa07q_documentEditor>header{justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:12px;display:flex}.IIa07q_documentEditor h3{margin:0;font-size:14px;font-weight:500;line-height:22px}.IIa07q_documentEditor header p{color:var(--mn-faint);margin:2px 0 0;font-size:12px;line-height:18px}.IIa07q_documentEditor header>span,.IIa07q_documentEditor header>code{color:var(--mn-muted);background:var(--mn-fill);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.IIa07q_documentEditor label{color:var(--mn-muted);gap:6px;margin-top:12px;font-size:12px;font-weight:500;line-height:18px;display:grid}.IIa07q_documentEditor textarea{resize:vertical;line-height:1.65}.IIa07q_documentEditorMeta{grid-template-columns:.8fr 1.2fr;gap:12px;display:grid}.IIa07q_documentEditorMeta label{margin:0}.IIa07q_documentEditor footer{justify-content:flex-end;gap:8px;margin-top:12px;display:flex}@media (width<=1000px){.IIa07q_documentWorkspace{grid-template-columns:minmax(220px,270px) minmax(0,1fr)}.IIa07q_documentDetail>dl{grid-template-columns:repeat(2,minmax(0,1fr))}.IIa07q_documentDetail>dl>div+div{border-left:0}.IIa07q_documentDetail>dl>div:nth-child(2n){border-left:.5px solid var(--mn-line)}.IIa07q_documentDetail>dl>div:nth-child(n+3){border-top:.5px solid var(--mn-line)}}@media (width<=760px){.IIa07q_documentSummary{grid-template-columns:repeat(2,minmax(0,1fr))}.IIa07q_documentCapacity{grid-column:1/-1}.IIa07q_documentToolbar{flex-direction:column;align-items:stretch}.IIa07q_documentToolbar form{min-width:0}.IIa07q_documentToolbar>div,.IIa07q_documentToolbar>button{width:100%}.IIa07q_documentToolbar>div button{flex:1}.IIa07q_documentWorkspace{grid-template-columns:1fr;min-height:0}.IIa07q_documentList{-webkit-overflow-scrolling:touch;max-height:330px;overflow:auto}.IIa07q_documentReader{min-height:430px}.IIa07q_documentEditorMeta{grid-template-columns:1fr}}@media (width<=520px){.IIa07q_documentDetail>header,.IIa07q_documentDanger{flex-direction:column;align-items:flex-start}.IIa07q_documentDetail>header>div:last-child,.IIa07q_documentDetail>header button{width:100%}.IIa07q_documentDanger>div,.IIa07q_documentDanger>span{margin-right:0}.IIa07q_documentDanger>button{width:100%}.IIa07q_documentDetail>dl{grid-template-columns:1fr}.IIa07q_documentDetail>dl>div:nth-child(2n){border-left:0}.IIa07q_documentDetail>dl>div+div{border-top:.5px solid var(--mn-line)}.IIa07q_markdownBody{padding:16px;font-size:13px}}";
4626
+ const css$10 = ".IIa07q_documentSummary{grid-template-columns:.7fr .7fr 1.6fr;gap:12px;margin-bottom:12px;display:grid}.IIa07q_documentSummary article{border:.5px solid var(--mn-card-line);border-radius:var(--dsw-radius-lg);min-width:0;min-height:92px;padding:14px 16px}.IIa07q_documentSummary article>span{color:var(--mn-faint);font-size:12px;line-height:18px;display:block}.IIa07q_documentSummary article>strong{font-variant-numeric:tabular-nums;margin:4px 0 2px;font-size:20px;font-weight:500;line-height:28px;display:block}.IIa07q_documentSummary article>small{color:var(--mn-faint);font-size:12px;line-height:18px}.IIa07q_documentCapacity>div{background:var(--mn-fill);border-radius:999px;height:4px;margin:8px 0 6px;overflow:hidden}.IIa07q_documentCapacity>div i{border-radius:inherit;background:var(--dsw-alias-brand-primary);height:100%;transition:width .3s;display:block}.IIa07q_documentToolbar{border:.5px solid var(--mn-card-line);border-radius:var(--dsw-radius-lg);align-items:center;gap:8px;margin-bottom:12px;padding:8px;display:flex}.IIa07q_documentToolbar form{flex:1;align-items:center;gap:8px;min-width:260px;display:flex}.IIa07q_documentSearch{flex:1}.IIa07q_documentEditor input,.IIa07q_documentEditor textarea{border:.5px solid var(--mn-field-line);border-radius:var(--dsw-radius-md);width:100%;color:var(--mn-text);background:var(--mn-input);outline:0;padding:6px 10px;font-size:13px;line-height:20px}.IIa07q_documentEditor input:focus,.IIa07q_documentEditor textarea:focus{border-color:var(--mn-accent)}.IIa07q_documentToolbar>div{border-radius:var(--dsw-radius-md);background:var(--mn-hover);align-items:center;gap:2px;padding:3px;display:flex}.IIa07q_documentToolbar>div button{border-radius:var(--dsw-radius-sm);min-height:28px;color:var(--mn-muted);cursor:pointer;background:0 0;border:0;padding:0 12px;font-size:13px;font-weight:500;line-height:20px}.IIa07q_documentToolbar>div button:hover{color:var(--mn-text)}.IIa07q_documentToolbar>div button[data-active]{color:var(--mn-text);background:var(--mn-layer-1);box-shadow:var(--dsw-elevation-soft)}.IIa07q_documentToolbar>div b{color:var(--mn-faint);font-variant-numeric:tabular-nums;margin-left:6px;font-size:12px;font-weight:400}.IIa07q_documentWorkspace{grid-template-columns:minmax(250px,310px) minmax(0,1fr);gap:12px;min-height:590px;display:grid}.IIa07q_documentList,.IIa07q_documentReader{border:.5px solid var(--mn-card-line);border-radius:var(--dsw-radius-lg);min-width:0;overflow:hidden}.IIa07q_documentList{align-self:stretch}.IIa07q_documentList>header{border-bottom:.5px solid var(--mn-line);min-height:44px;color:var(--mn-faint);justify-content:space-between;align-items:center;padding:0 14px;font-size:12px;line-height:18px;display:flex}.IIa07q_documentList>header code{color:var(--mn-muted)}.IIa07q_documentList>button{--mn-provider-color:var(--mn-faint);border-radius:var(--dsw-radius-md);width:calc(100% - 12px);color:var(--mn-text);text-align:left;cursor:pointer;background:0 0;border:0;margin:6px 6px 0;padding:10px 12px;transition:background-color .15s;display:block}.IIa07q_documentList>button:hover{background:var(--mn-hover)}.IIa07q_documentList>button[data-selected]{background:var(--mn-fill)}.IIa07q_documentList>button>div{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.IIa07q_documentList>button strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.IIa07q_documentList>button time{color:var(--mn-faint);font-variant-numeric:tabular-nums;flex:none;font-size:11px}.IIa07q_documentList>button p{color:var(--mn-faint);-webkit-line-clamp:2;-webkit-box-orient:vertical;margin:4px 0 6px;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.IIa07q_documentList>button footer{color:var(--mn-faint);align-items:center;gap:8px;font-size:11px;line-height:16px;display:flex}.IIa07q_documentList>button footer code{margin-left:auto}.IIa07q_documentList>button footer em{color:var(--mn-danger);font-style:normal}.IIa07q_documentListEmpty{min-height:230px;color:var(--mn-muted);text-align:center;align-content:center;place-items:center;gap:4px;padding:24px;display:grid}.IIa07q_documentListEmpty>span{color:var(--mn-faint);margin-bottom:6px;font-size:24px;line-height:1}.IIa07q_documentListEmpty p{color:var(--mn-faint);margin:0;font-size:12px;line-height:18px}.IIa07q_documentReader{padding:clamp(16px,2vw,24px)}.IIa07q_documentReader>.IIa07q_emptyState{background:0 0;border:0;height:100%}.IIa07q_documentDetail>header{border-bottom:.5px solid var(--mn-line);justify-content:space-between;align-items:flex-start;gap:16px;padding-bottom:14px;display:flex}.IIa07q_documentDetail>header span{color:var(--mn-faint);font-size:12px;line-height:18px}.IIa07q_documentDetail>header h3{margin:2px 0;font-size:16px;font-weight:500;line-height:24px}.IIa07q_documentDetail>header p{color:var(--mn-faint);margin:0;font-size:12px;line-height:18px}.IIa07q_documentActions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.IIa07q_documentDetail>dl{border:.5px solid var(--mn-line);border-radius:var(--dsw-radius-md);grid-template-columns:2fr .45fr .8fr .55fr;margin:12px 0;display:grid;overflow:hidden}.IIa07q_documentDetail>dl>div{min-width:0;padding:8px 10px}.IIa07q_documentDetail>dl>div+div{border-left:.5px solid var(--mn-line)}.IIa07q_documentDetail dt{color:var(--mn-faint);margin-bottom:2px;font-size:11px;line-height:16px}.IIa07q_documentDetail dd{text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:12px;line-height:18px;overflow:hidden}.IIa07q_documentSources{flex-wrap:wrap;align-items:center;gap:6px;margin:12px 0;display:flex}.IIa07q_documentSources>span{color:var(--mn-faint);margin-right:4px;font-size:12px}.IIa07q_documentSources code,.IIa07q_documentArchiveReceipt code{color:var(--mn-muted);background:var(--mn-fill);border-radius:999px;padding:1px 8px;font-size:11px;line-height:17px}.IIa07q_markdownBody{overflow-wrap:anywhere;border:.5px solid var(--mn-line);border-radius:var(--dsw-radius-md);min-height:310px;color:var(--mn-text);margin:16px 0 0;padding:clamp(16px,2.5vw,28px);font-size:14px;line-height:1.75}.IIa07q_markdownBody>:first-child{margin-top:0}.IIa07q_markdownBody>:last-child{margin-bottom:0}.IIa07q_markdownBody h1,.IIa07q_markdownBody h2,.IIa07q_markdownBody h3,.IIa07q_markdownBody h4{color:var(--mn-text);margin:1.5em 0 .6em;font-weight:500;line-height:1.35}.IIa07q_markdownBody h1{border-bottom:.5px solid var(--mn-line);padding-bottom:.35em;font-size:1.6em}.IIa07q_markdownBody h2{border-bottom:.5px solid var(--mn-line);padding-bottom:.3em;font-size:1.35em}.IIa07q_markdownBody h3{font-size:1.15em}.IIa07q_markdownBody p,.IIa07q_markdownBody ul,.IIa07q_markdownBody ol,.IIa07q_markdownBody blockquote,.IIa07q_markdownBody table,.IIa07q_markdownBody pre{margin:.85em 0}.IIa07q_markdownBody ul,.IIa07q_markdownBody ol{padding-left:1.6em}.IIa07q_markdownBody li+li{margin-top:.3em}.IIa07q_markdownBody blockquote{border-left:2px solid var(--mn-line-strong);color:var(--mn-muted);margin-inline:0;padding:.1em 1em}.IIa07q_markdownBody code{border-radius:var(--dsw-radius-xs);color:var(--mn-text);background:var(--dsw-alias-markdown-inline-code,var(--mn-fill));font:.88em/1.55 var(--mn-code);padding:.15em .4em}.IIa07q_markdownBody pre{border-radius:var(--dsw-radius-md);background:var(--dsw-alias-markdown-code-block,var(--mn-fill));max-width:100%;padding:12px 16px;overflow:auto}.IIa07q_markdownBody pre code{background:0 0;padding:0;font-size:12px}.IIa07q_markdownBody a{color:var(--dsw-alias-link,var(--mn-accent));text-underline-offset:3px;text-decoration-thickness:1px}.IIa07q_markdownBody hr{border:0;border-top:.5px solid var(--mn-line);margin:1.8em 0}.IIa07q_markdownBody table{border-collapse:collapse;max-width:100%;display:block;overflow-x:auto}.IIa07q_markdownBody th,.IIa07q_markdownBody td{border:.5px solid var(--mn-line);text-align:left;vertical-align:top;padding:8px 10px}.IIa07q_markdownBody th{background:var(--mn-fill);font-weight:500}.IIa07q_markdownBody img{border-radius:var(--dsw-radius-sm);max-width:100%;height:auto}.IIa07q_documentArchiveReceipt{border-radius:var(--dsw-radius-md);background:color-mix(in srgb, var(--mn-success) 8%, transparent);margin:12px 0;padding:10px 12px}.IIa07q_documentArchiveReceipt p{color:var(--mn-muted);margin:2px 0 8px;font-size:12px;line-height:18px}.IIa07q_documentArchiveReceipt div{flex-wrap:wrap;gap:6px;display:flex}.IIa07q_documentDanger{border-top:.5px solid var(--mn-line);justify-content:flex-end;align-items:center;gap:8px;min-height:56px;margin-top:12px;padding-top:12px;display:flex}.IIa07q_documentDanger>div{margin-right:auto}.IIa07q_documentDanger strong{font-size:13px;font-weight:500;line-height:20px;display:block}.IIa07q_documentDanger p{color:var(--mn-faint);margin:2px 0 0;font-size:12px;line-height:18px}.IIa07q_documentDanger>span{color:var(--mn-danger);margin-right:auto;font-size:12px}.IIa07q_documentEditor{border:.5px solid var(--mn-card-line);border-radius:var(--dsw-radius-lg);margin-bottom:12px;padding:16px}.IIa07q_documentReader>.IIa07q_documentEditor{background:0 0;border:0;margin:0;padding:0}.IIa07q_documentEditor>header{justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:12px;display:flex}.IIa07q_documentEditor h3{margin:0;font-size:14px;font-weight:500;line-height:22px}.IIa07q_documentEditor header p{color:var(--mn-faint);margin:2px 0 0;font-size:12px;line-height:18px}.IIa07q_documentEditor header>span,.IIa07q_documentEditor header>code{color:var(--mn-muted);background:var(--mn-fill);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.IIa07q_documentEditor label{color:var(--mn-muted);gap:6px;margin-top:12px;font-size:12px;font-weight:500;line-height:18px;display:grid}.IIa07q_documentEditor textarea{resize:vertical;line-height:1.65}.IIa07q_documentEditorMeta{grid-template-columns:.8fr 1.2fr;gap:12px;display:grid}.IIa07q_documentEditorMeta label{margin:0}.IIa07q_documentEditor footer{justify-content:flex-end;gap:8px;margin-top:12px;display:flex}@media (width<=1000px){.IIa07q_documentWorkspace{grid-template-columns:minmax(220px,270px) minmax(0,1fr)}.IIa07q_documentDetail>dl{grid-template-columns:repeat(2,minmax(0,1fr))}.IIa07q_documentDetail>dl>div+div{border-left:0}.IIa07q_documentDetail>dl>div:nth-child(2n){border-left:.5px solid var(--mn-line)}.IIa07q_documentDetail>dl>div:nth-child(n+3){border-top:.5px solid var(--mn-line)}}@media (width<=760px){.IIa07q_documentSummary{grid-template-columns:repeat(2,minmax(0,1fr))}.IIa07q_documentCapacity{grid-column:1/-1}.IIa07q_documentToolbar{flex-direction:column;align-items:stretch}.IIa07q_documentToolbar form{min-width:0}.IIa07q_documentToolbar>div,.IIa07q_documentToolbar>button{width:100%}.IIa07q_documentToolbar>div button{flex:1}.IIa07q_documentWorkspace{grid-template-columns:1fr;min-height:0}.IIa07q_documentList{-webkit-overflow-scrolling:touch;max-height:330px;overflow:auto}.IIa07q_documentReader{min-height:430px}.IIa07q_documentEditorMeta{grid-template-columns:1fr}}@media (width<=520px){.IIa07q_documentDetail>header,.IIa07q_documentDanger{flex-direction:column;align-items:flex-start}.IIa07q_documentDetail>header>div:last-child,.IIa07q_documentDetail>header button{width:100%}.IIa07q_documentDanger>div,.IIa07q_documentDanger>span{margin-right:0}.IIa07q_documentDanger>button{width:100%}.IIa07q_documentDetail>dl{grid-template-columns:1fr}.IIa07q_documentDetail>dl>div:nth-child(2n){border-left:0}.IIa07q_documentDetail>dl>div+div{border-top:.5px solid var(--mn-line)}.IIa07q_markdownBody{padding:16px;font-size:13px}}";
4592
4627
  const tagId$9 = "dsh-mnemon-source-documents/presentation/page.module.css";
4593
4628
  if (typeof document !== "undefined") {
4594
4629
  let tag = document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$9) + "]");
@@ -4600,6 +4635,7 @@ window.__ModuleLoader__.load({
4600
4635
  if (tag.textContent !== css$10) tag.textContent = css$10;
4601
4636
  }
4602
4637
  var page_module_css_default$1 = {
4638
+ "documentActions": "IIa07q_documentActions",
4603
4639
  "documentArchiveReceipt": "IIa07q_documentArchiveReceipt",
4604
4640
  "documentCapacity": "IIa07q_documentCapacity",
4605
4641
  "documentDanger": "IIa07q_documentDanger",
@@ -5177,6 +5213,7 @@ window.__ModuleLoader__.load({
5177
5213
  field.input === "source-list" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SourceChoice, {
5178
5214
  field,
5179
5215
  value,
5216
+ defaultAll: entry.typeId === "scoped" && field.key === "sourceKeys",
5180
5217
  sources: props.dashboard.sources,
5181
5218
  name: sourceName,
5182
5219
  labelledBy: `${control}-label`,
@@ -5221,6 +5258,7 @@ window.__ModuleLoader__.load({
5221
5258
  t,
5222
5259
  onDiscard: () => setDraft(initial(entry)),
5223
5260
  onApply: () => {
5261
+ if (entry.typeId === "scoped" && Array.isArray(config.sourceKeys) && config.sourceKeys.length === 0 && !window.confirm(t("options.emptySourcesConfirm"))) return;
5224
5262
  props.onApply(config);
5225
5263
  }
5226
5264
  })]
@@ -5230,9 +5268,15 @@ window.__ModuleLoader__.load({
5230
5268
  function SourceChoice(props) {
5231
5269
  const { field, value, t } = props;
5232
5270
  const eligible = props.sources.filter((source) => field.sourceRoles === void 0 || field.sourceRoles.length === 0 || field.sourceRoles.includes(source.role));
5233
- const missing = value.sources.filter((key) => !eligible.some((source) => source.sourceInstanceKey === key));
5271
+ const defaultRoles = [
5272
+ "working-context",
5273
+ "narrative",
5274
+ "durable-evidence"
5275
+ ];
5276
+ const selected = !value.own && props.defaultAll ? eligible.filter((source) => defaultRoles.includes(source.role)).sort((a, b) => defaultRoles.indexOf(a.role) - defaultRoles.indexOf(b.role) || a.sourceInstanceKey.localeCompare(b.sourceInstanceKey)).map((source) => source.sourceInstanceKey) : value.sources;
5277
+ const missing = selected.filter((key) => !eligible.some((source) => source.sourceInstanceKey === key));
5234
5278
  const several = (sourceTypeId) => eligible.filter((source) => source.sourceTypeId === sourceTypeId).length > 1;
5235
- const toggle = (key, on) => props.onChange(on ? [...value.sources, key] : value.sources.filter((item) => item !== key));
5279
+ const toggle = (key, on) => props.onChange(on ? [...selected, key] : selected.filter((item) => item !== key));
5236
5280
  if (eligible.length === 0 && missing.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
5237
5281
  className: MnemonSettingsCard_module_css_default.optionEmpty,
5238
5282
  children: t("options.noSources")
@@ -5244,7 +5288,7 @@ window.__ModuleLoader__.load({
5244
5288
  children: [eligible.map((source) => {
5245
5289
  const label = props.name(source.sourceTypeId, source.label);
5246
5290
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Checkbox, {
5247
- checked: value.sources.includes(source.sourceInstanceKey),
5291
+ checked: selected.includes(source.sourceInstanceKey),
5248
5292
  disabled: props.disabled,
5249
5293
  label: several(source.sourceTypeId) ? `${label} · ${source.sourceInstanceKey}` : label,
5250
5294
  onChange: (on) => toggle(source.sourceInstanceKey, on)
@@ -12084,6 +12128,7 @@ window.__ModuleLoader__.load({
12084
12128
  const allowCreate = useLive(saved.allowCreate, write("allowCreate"));
12085
12129
  const allowUpdate = useLive(saved.allowUpdate, write("allowUpdate"));
12086
12130
  const autoBacktest = useLive(saved.autoBacktest, write("autoBacktest"));
12131
+ const autoAdopt = useLive(saved.autoAdopt, write("autoAdopt"));
12087
12132
  const hints = useLive(saved.hints, write("hints"));
12088
12133
  const sidebar = useLive(saved.sidebar, write("sidebar"));
12089
12134
  const destination = useStaged({ targetScope: saved.targetScope }, async (draft) => {
@@ -12211,6 +12256,14 @@ window.__ModuleLoader__.load({
12211
12256
  disabled,
12212
12257
  onChange: autoBacktest.set
12213
12258
  }),
12259
+ evolution.value && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleRow, {
12260
+ id: "mnemon-skills-auto-adopt",
12261
+ label: t("skills.autoAdopt"),
12262
+ hint: t("skills.autoAdoptHint"),
12263
+ checked: autoAdopt.value,
12264
+ disabled: disabled || !autoBacktest.value,
12265
+ onChange: autoAdopt.set
12266
+ }),
12214
12267
  evolution.value && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
12215
12268
  className: MnemonSettingsCard_module_css_default.advanced,
12216
12269
  children: [
@@ -12264,7 +12317,7 @@ window.__ModuleLoader__.load({
12264
12317
  })
12265
12318
  ]
12266
12319
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WriteFailure, {
12267
- error: evolution.failed ?? allowCreate.failed ?? allowUpdate.failed ?? autoBacktest.failed ?? hints.failed ?? sidebar.failed,
12320
+ error: evolution.failed ?? allowCreate.failed ?? allowUpdate.failed ?? autoBacktest.failed ?? autoAdopt.failed ?? hints.failed ?? sidebar.failed,
12268
12321
  t
12269
12322
  })]
12270
12323
  });
@@ -12655,6 +12708,16 @@ window.__ModuleLoader__.load({
12655
12708
  });
12656
12709
  const disabled = !page.writable || snapshot.status === "loading" || !snapshot.writable;
12657
12710
  const configured = snapshot.value?.runtimeMemory;
12711
+ const inheritance = useLive(configured?.inheritToSubagents === true, async (value) => {
12712
+ await scope.mutate([{
12713
+ op: "set",
12714
+ path: ["runtimeMemory"],
12715
+ value: {
12716
+ ...configured,
12717
+ inheritToSubagents: value
12718
+ }
12719
+ }]);
12720
+ });
12658
12721
  const savedLimits = {
12659
12722
  userLimitBytes: String(configured?.userLimitBytes ?? RUNTIME_MEMORY_LIMITS.user),
12660
12723
  memoryLimitBytes: String(configured?.memoryLimitBytes ?? RUNTIME_MEMORY_LIMITS.memory)
@@ -12671,82 +12734,103 @@ window.__ModuleLoader__.load({
12671
12734
  }]);
12672
12735
  });
12673
12736
  const invalid = RUNTIME_LIMITS.find((key) => runtimeLimitValue(limits.draft[key]) === void 0);
12674
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
12675
- className: MnemonSettingsCard_module_css_default.panelSection,
12676
- "aria-label": t("config.runtimeUserScopeTitle"),
12677
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12678
- className: MnemonSettingsCard_module_css_default.rows,
12679
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectRow, {
12680
- id: "mnemon-runtime-user-scope",
12681
- label: t("config.runtimeUserScopeTitle"),
12682
- value: profile.value,
12683
- disabled,
12684
- onChange: profile.set,
12685
- options: [{
12686
- value: "storage",
12687
- label: t("config.runtimeUserScopeStorage"),
12688
- detail: t("config.runtimeUserScopeStorageHint")
12689
- }, {
12690
- value: "global",
12691
- label: t("config.runtimeUserScopeGlobal"),
12692
- detail: t("config.runtimeUserScopeGlobalHint")
12693
- }]
12694
- })
12695
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WriteFailure, {
12696
- error: profile.failed,
12697
- t
12698
- })]
12699
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
12700
- className: MnemonSettingsCard_module_css_default.panelSection,
12701
- "aria-labelledby": "mnemon-runtime-limits",
12702
- children: [
12703
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12704
- className: MnemonSettingsCard_module_css_default.panelHeading,
12705
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
12706
- id: "mnemon-runtime-limits",
12707
- children: t("config.runtimeLimitsTitle")
12708
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
12709
- id: "mnemon-runtime-limits-hint",
12710
- children: t("config.runtimeLimitsHint", {
12711
- user: RUNTIME_MEMORY_LIMITS.user / 1024,
12712
- memory: RUNTIME_MEMORY_LIMITS.memory / 1024
12713
- })
12714
- })]
12715
- }),
12716
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12717
- className: MnemonSettingsCard_module_css_default.fieldGrid,
12718
- children: RUNTIME_LIMITS.map((key) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [t(`config.runtime.${key}`), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
12719
- type: "number",
12720
- min: "1",
12721
- max: RUNTIME_MEMORY_LIMIT_MAX_BYTES,
12722
- step: "1",
12723
- inputMode: "numeric",
12724
- value: limits.draft[key],
12725
- disabled: disabled || limits.saving,
12726
- "aria-describedby": "mnemon-runtime-limits-hint",
12727
- "aria-invalid": runtimeLimitValue(limits.draft[key]) === void 0,
12728
- onChange: (event) => limits.edit({ [key]: event.target.value })
12729
- })] }, key))
12730
- }),
12731
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PanelActions, {
12732
- dirty: limits.dirty,
12733
- saving: limits.saving,
12734
- applied: limits.applied,
12735
- failed: limits.failed,
12736
- disabled,
12737
- t,
12738
- note: t("config.runtimeLimitsApply"),
12739
- invalid: invalid === void 0 ? null : t("config.runtimeLimitInvalid", {
12740
- field: t(`config.runtime.${invalid}`),
12741
- max: RUNTIME_MEMORY_LIMIT_MAX_BYTES
12737
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
12738
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
12739
+ className: MnemonSettingsCard_module_css_default.panelSection,
12740
+ "aria-label": t("config.runtimeUserScopeTitle"),
12741
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12742
+ className: MnemonSettingsCard_module_css_default.rows,
12743
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectRow, {
12744
+ id: "mnemon-runtime-user-scope",
12745
+ label: t("config.runtimeUserScopeTitle"),
12746
+ value: profile.value,
12747
+ disabled,
12748
+ onChange: profile.set,
12749
+ options: [{
12750
+ value: "storage",
12751
+ label: t("config.runtimeUserScopeStorage"),
12752
+ detail: t("config.runtimeUserScopeStorageHint")
12753
+ }, {
12754
+ value: "global",
12755
+ label: t("config.runtimeUserScopeGlobal"),
12756
+ detail: t("config.runtimeUserScopeGlobalHint")
12757
+ }]
12758
+ })
12759
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WriteFailure, {
12760
+ error: profile.failed,
12761
+ t
12762
+ })]
12763
+ }),
12764
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
12765
+ className: MnemonSettingsCard_module_css_default.panelSection,
12766
+ "aria-label": t("config.runtimeInheritance"),
12767
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12768
+ className: MnemonSettingsCard_module_css_default.rows,
12769
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleRow, {
12770
+ id: "mnemon-runtime-inherit-subagents",
12771
+ label: t("config.runtimeInheritance"),
12772
+ hint: t("config.runtimeInheritanceHint"),
12773
+ checked: inheritance.value,
12774
+ disabled,
12775
+ onChange: inheritance.set
12776
+ })
12777
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WriteFailure, {
12778
+ error: inheritance.failed,
12779
+ t
12780
+ })]
12781
+ }),
12782
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
12783
+ className: MnemonSettingsCard_module_css_default.panelSection,
12784
+ "aria-labelledby": "mnemon-runtime-limits",
12785
+ children: [
12786
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12787
+ className: MnemonSettingsCard_module_css_default.panelHeading,
12788
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
12789
+ id: "mnemon-runtime-limits",
12790
+ children: t("config.runtimeLimitsTitle")
12791
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
12792
+ id: "mnemon-runtime-limits-hint",
12793
+ children: t("config.runtimeLimitsHint", {
12794
+ user: RUNTIME_MEMORY_LIMITS.user / 1024,
12795
+ memory: RUNTIME_MEMORY_LIMITS.memory / 1024
12796
+ })
12797
+ })]
12742
12798
  }),
12743
- onDiscard: limits.discard,
12744
- onApply: () => {
12745
- limits.apply();
12746
- }
12747
- })
12748
- ]
12749
- })] });
12799
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12800
+ className: MnemonSettingsCard_module_css_default.fieldGrid,
12801
+ children: RUNTIME_LIMITS.map((key) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [t(`config.runtime.${key}`), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
12802
+ type: "number",
12803
+ min: "1",
12804
+ max: RUNTIME_MEMORY_LIMIT_MAX_BYTES,
12805
+ step: "1",
12806
+ inputMode: "numeric",
12807
+ value: limits.draft[key],
12808
+ disabled: disabled || limits.saving,
12809
+ "aria-describedby": "mnemon-runtime-limits-hint",
12810
+ "aria-invalid": runtimeLimitValue(limits.draft[key]) === void 0,
12811
+ onChange: (event) => limits.edit({ [key]: event.target.value })
12812
+ })] }, key))
12813
+ }),
12814
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PanelActions, {
12815
+ dirty: limits.dirty,
12816
+ saving: limits.saving,
12817
+ applied: limits.applied,
12818
+ failed: limits.failed,
12819
+ disabled,
12820
+ t,
12821
+ note: t("config.runtimeLimitsApply"),
12822
+ invalid: invalid === void 0 ? null : t("config.runtimeLimitInvalid", {
12823
+ field: t(`config.runtime.${invalid}`),
12824
+ max: RUNTIME_MEMORY_LIMIT_MAX_BYTES
12825
+ }),
12826
+ onDiscard: limits.discard,
12827
+ onApply: () => {
12828
+ limits.apply();
12829
+ }
12830
+ })
12831
+ ]
12832
+ })
12833
+ ] });
12750
12834
  }
12751
12835
  /** Each limit as the page shows it: the interval in seconds, the others as stored. */
12752
12836
  const LIMITS = [
@@ -1,6 +1,44 @@
1
1
  import { a as memoryConfigurationDigest, c as record, d as truncate, f as canonicalWorkspacePath, i as integer, l as stringArray, m as withMemoryStorageLock, o as migrationLineage, p as workspaceStorageId, s as receipt, t as defineMemoryStrategyConfiguration, u as text } from "./strategy-configuration-CKP2kRss.js";
2
2
  import { COMPOSABLE_MEMORY_API_VERSION, MEMORY_VIEW_EXTENSION_SLOTS } from "./contracts.js";
3
3
  import { a as defineMemoryStrategy, i as defineMemorySource, o as defineMemoryStrategyExtension, r as defineMemoryPlugin } from "./definitions-DU7MLBhu.js";
4
+ //#region src/sdk/projection-reservation.ts
5
+ /** Reserve complete Source-declared resident data inside the existing View ceiling. */
6
+ function reserveMemoryProjection(spec, sources, budget) {
7
+ const minimums = spec.sources.map((selected) => {
8
+ const source = sources.find((item) => item.sourceInstanceKey === selected.sourceInstanceKey);
9
+ const hints = source?.hints;
10
+ const value = source?.capabilities.includes("project") && hints !== null && typeof hints === "object" && !Array.isArray(hints) ? hints?.minimumProjectionCharacters : void 0;
11
+ if (value === void 0) return 0;
12
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) throw new Error("Invalid minimum projection hint");
13
+ return value;
14
+ });
15
+ if (minimums.every((value) => value === 0)) return spec;
16
+ const minimum = minimums.reduce((sum, value) => sum + value, 0);
17
+ if (minimum > budget) throw new Error(`Pinned memory requires ${minimum} projection characters but the View budget is ${budget}. Unpin entries or increase the View budget.`);
18
+ const allocation = spec.sources.map((selected, index) => Math.max(minimums[index], selected.projection?.maxCharacters ?? 0));
19
+ let excess = allocation.reduce((sum, value) => sum + value, 0) - budget;
20
+ for (let index = allocation.length - 1; index >= 0 && excess > 0; index--) {
21
+ const reclaimed = Math.min(excess, allocation[index] - minimums[index]);
22
+ allocation[index] -= reclaimed;
23
+ excess -= reclaimed;
24
+ }
25
+ return {
26
+ ...spec,
27
+ sources: spec.sources.map((selected, index) => {
28
+ const { projection, ...rest } = selected;
29
+ const characters = allocation[index];
30
+ return {
31
+ ...rest,
32
+ ...minimums[index] > 0 ? { required: true } : {},
33
+ ...characters === 0 ? {} : { projection: {
34
+ mode: projection?.mode ?? "eager",
35
+ maxCharacters: characters
36
+ } }
37
+ };
38
+ })
39
+ };
40
+ }
41
+ //#endregion
4
42
  //#region src/sdk/install.ts
5
43
  function locatedEntryId(ctx) {
6
44
  const located = ctx.get("loader", false)?.locate(ctx.fiber)?.trim();
@@ -108,4 +146,4 @@ function defineMemoryViewExtension(definition) {
108
146
  });
109
147
  }
110
148
  //#endregion
111
- export { canonicalWorkspacePath, receipt as createMemoryMutationReceipt, defineMemoryPlugin, defineMemorySource, defineMemoryStrategy, defineMemoryStrategyConfiguration, defineMemoryStrategyExtension, defineMemoryViewExtension, installMemory, memoryConfigurationDigest, integer as memoryInputInteger, migrationLineage as memoryInputMigrationLineage, record as memoryInputRecord, stringArray as memoryInputStringArray, text as memoryInputText, memoryViewExtensionValues, truncate as truncateMemoryText, validateMemoryViewExtension, withMemoryStorageLock, workspaceStorageId };
149
+ export { canonicalWorkspacePath, receipt as createMemoryMutationReceipt, defineMemoryPlugin, defineMemorySource, defineMemoryStrategy, defineMemoryStrategyConfiguration, defineMemoryStrategyExtension, defineMemoryViewExtension, installMemory, memoryConfigurationDigest, integer as memoryInputInteger, migrationLineage as memoryInputMigrationLineage, record as memoryInputRecord, stringArray as memoryInputStringArray, text as memoryInputText, memoryViewExtensionValues, reserveMemoryProjection, truncate as truncateMemoryText, validateMemoryViewExtension, withMemoryStorageLock, workspaceStorageId };