dsh-plugin-tool-management 0.14.0 → 0.15.0

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +560 -519
  2. package/docs/images/1-EN.png +0 -0
  3. package/docs/images/1.png +0 -0
  4. package/docs/images/2-EN.png +0 -0
  5. package/docs/images/2.png +0 -0
  6. package/docs/images/3-EN.png +0 -0
  7. package/docs/images/3.png +0 -0
  8. package/docs/images/4-EN.png +0 -0
  9. package/docs/images/4.png +0 -0
  10. package/docs/images/5-EN.png +0 -0
  11. package/docs/images/5.png +0 -0
  12. package/docs/images/6-EN.png +0 -0
  13. package/docs/images/6.png +0 -0
  14. package/docs/images/7-EN.png +0 -0
  15. package/docs/images/7.png +0 -0
  16. package/docs/images/8-EN.png +0 -0
  17. package/docs/images/8.png +0 -0
  18. package/docs/update.md +391 -365
  19. package/lib/audit-log.js +157 -0
  20. package/lib/client.js +3800 -2504
  21. package/lib/compat/patch-dialect.js +3 -1
  22. package/lib/compat/preset-reach.js +37 -6
  23. package/lib/compat/probe.js +149 -7
  24. package/lib/context-inject.js +5 -3
  25. package/lib/index.js +236 -30
  26. package/lib/mcp/loader-token.js +53 -28
  27. package/lib/mcp/manager.js +146 -7
  28. package/lib/memories/archive-engine.js +70 -2
  29. package/lib/memories/archive.js +8 -1
  30. package/lib/memories/index-io.js +6 -0
  31. package/lib/op-registry.js +18 -4
  32. package/lib/ops/compat.js +109 -35
  33. package/lib/ops/scene-records.js +34 -0
  34. package/lib/ops/scene-sync.js +12 -1
  35. package/lib/ops/sessions.js +23 -8
  36. package/lib/ops/snapshot.js +596 -0
  37. package/lib/scenes/candidates.js +10 -5
  38. package/lib/sessions/bridge.js +5 -0
  39. package/lib/sessions/workspace.js +17 -5
  40. package/lib/skills/core.js +12 -3
  41. package/lib/tools/deps.js +1 -1
  42. package/lib/tools/table.js +5 -1
  43. package/package.json +112 -108
@@ -6,7 +6,7 @@
6
6
  // 解析失败 = DSH **下次启动直接起不来**(`CHANGELOG.md` 里记过这次事故)。三条写入路径
7
7
  // (`profiles/<名>/cordis.patch.yml`、`~/.dsh/cordis.patch.yml`、bundle 的 `cordis.patch.yml`)
8
8
  // 走的是同一份方言(前者 `loadOverlayPatches`、后者 `loadOptionalPatches` → `parsePatchList`;
9
- // `userPatchesSchema === entryListSchema`,实测于 dsh-app-boot 0.1.5-rc.2)。
9
+ // `userPatchesSchema === entryListSchema`,实测于 dsh-app-boot 0.1.5-rc.2,0.1.7-rc.2 复核未变)。
10
10
  //
11
11
  // 官方**没有**导出这份 schema(导出清单见同文件 :1575,无 `entryListSchema`),所以只能复刻。
12
12
  // 复刻**必然会过期**(官方加方言 / 换 js-yaml 大版本),因此判定策略是**非对称**的:
@@ -135,6 +135,8 @@ function record(report) {
135
135
  fallback: 'inform-only',
136
136
  detail: (report.kind === 'no-dep' ? '校验依赖不可用' : '复刻可能已过期')
137
137
  + `:${report.detail}(写入照常进行,仅少一道「把启动配置写坏」的拦截)`,
138
+ detailKey: report.kind === 'no-dep' ? 'patch-write-guard.no-dep' : 'patch-write-guard.stale',
139
+ params: { detail: report.detail },
138
140
  });
139
141
  pendingWarnings.push(report.kind === 'no-dep'
140
142
  ? '补丁写入未做解析校验(依赖不可用):' + report.detail
@@ -47,7 +47,7 @@
47
47
  * nothing about the servers behind them — no names, no tool counts, no
48
48
  * enablement, and none of the user's notes.
49
49
  *
50
- * Reading never mounts. `list()`/`read(id)` are roster reads, so building the
50
+ * Reading never mounts. `list()`/`read(id)`/`readDocument(id)` are roster reads, so building the
51
51
  * matrix cannot activate a preset early — the same guarantee
52
52
  * `compositionInventory()` gives the plugin-listing surfaces.
53
53
  *
@@ -57,6 +57,7 @@
57
57
  * point at the switch that overrides it.
58
58
  */
59
59
  import { MCP_CLIENT_MODULE } from '../host-names.js';
60
+ import { noteRuntime } from './runtime-notes.js';
60
61
  /** Whether a preset declares "no extra text": persona `complete: true` or runtime context off. */
61
62
  export function isSuppressingPreset(facts) {
62
63
  return facts.personaComplete === true || facts.includeRuntimeContext === false;
@@ -278,6 +279,36 @@ export function deriveReach(facts, ctx) {
278
279
  // 也是空段(没什么可看的),"有几台 server"由插件页面回答,不是这一列的事。
279
280
  return { scene, memory, agentsMd, skillCatalog, subagent, mcp };
280
281
  }
282
+ /**
283
+ * 读一个预设的组合文本。两代宿主同一个出口:
284
+ * `read(id)`(0.1.5 直返文本)或 `readDocument(id).content`(0.1.7 文档对象)。
285
+ * 两者都不可用时抛错,由调用方决定降级口径 —— reason 文案由此保持单一来源。
286
+ *
287
+ * 兜底路径的可见性(0.15.0):兜底成功**不留运行时上报** —— 上报一律渲染成问题行,
288
+ * 而「read 改名 readDocument 后走兜底」是 0.1.7 的正常形态,不是降级(琥珀只留给故障,
289
+ * 2026-09-28 用户反馈)。走的哪条路由探测表 `preset.roster-surface` 的健康行说明承担;
290
+ * 这里只在**真异常**(readDocument 在场但文档缺 `.content`)时留痕。同 id 覆盖,不堆积。
291
+ */
292
+ export async function readCompositionText(roster, presetId) {
293
+ if (typeof roster.read === 'function') {
294
+ return String((await roster.read(presetId)) ?? '');
295
+ }
296
+ if (typeof roster.readDocument === 'function') {
297
+ const doc = (await roster.readDocument(presetId));
298
+ if (doc === null || typeof doc !== 'object' || doc.content === undefined) {
299
+ // 文档形状的第二次漂移:readDocument 在、`.content` 不在 —— 当年 read 改名的翻版。
300
+ noteRuntime({
301
+ id: 'preset.roster-read-route',
302
+ label: '预设名册读取',
303
+ kind: 'read',
304
+ fallback: 'inform-only',
305
+ detail: `readDocument(${presetId}) 返回的文档没有 content 字段:组合文本按空处理,注入边界将显示「无法判断」。宿主的名册文档契约可能又变了。`,
306
+ });
307
+ }
308
+ return String(doc?.content ?? '');
309
+ }
310
+ throw new Error('预设名单未提供 read()/readDocument():无法读取组合文件');
311
+ }
281
312
  /** Narrow the roster off a cordis context without throwing. */
282
313
  export function presetRosterOf(ctx) {
283
314
  try {
@@ -301,7 +332,7 @@ async function composeRow(roster, meta, ctx) {
301
332
  isDefault,
302
333
  ...(broken === undefined ? {} : { broken }),
303
334
  };
304
- if (typeof roster.read !== 'function') {
335
+ if (typeof roster.read !== 'function' && typeof roster.readDocument !== 'function') {
305
336
  return {
306
337
  ...base,
307
338
  personaComplete: 'unknown',
@@ -315,12 +346,12 @@ async function composeRow(roster, meta, ctx) {
315
346
  skillCatalog: 'unknown',
316
347
  subagent: 'unknown',
317
348
  mcp: 'unknown',
318
- reason: '预设名单未提供 read():无法读取组合文件',
349
+ reason: '预设名单未提供 read()/readDocument():无法读取组合文件',
319
350
  };
320
351
  }
321
352
  let text;
322
353
  try {
323
- text = String((await roster.read(presetId)) ?? '');
354
+ text = await readCompositionText(roster, presetId);
324
355
  }
325
356
  catch (error) {
326
357
  return {
@@ -470,10 +501,10 @@ export async function reachNoticeForAgent(roster, agentCtx, inject) {
470
501
  catch {
471
502
  return '';
472
503
  }
473
- if (presetId === '' || typeof roster.read !== 'function')
504
+ if (presetId === '' || (typeof roster.read !== 'function' && typeof roster.readDocument !== 'function'))
474
505
  return '';
475
506
  try {
476
- return reachNoticeFor(presetId, readCompositionFacts(String((await roster.read(presetId)) ?? '')), inject);
507
+ return reachNoticeFor(presetId, readCompositionFacts(await readCompositionText(roster, presetId)), inject);
477
508
  }
478
509
  catch {
479
510
  return '';
@@ -30,7 +30,7 @@
30
30
  * leave the rest working.
31
31
  */
32
32
  import { createRequire } from 'node:module';
33
- import { existsSync, readFileSync, realpathSync } from 'node:fs';
33
+ import { existsSync, readFileSync, readdirSync, realpathSync, statSync } from 'node:fs';
34
34
  import { dirname, join } from 'node:path';
35
35
  /** Packages whose physical module identity matters to this plugin. */
36
36
  export const IDENTITY_PACKAGES = [
@@ -41,10 +41,15 @@ export const IDENTITY_PACKAGES = [
41
41
  '@deepseek-ai/dsh-storage-domain',
42
42
  '@deepseek-ai/dsh-spill-local',
43
43
  ];
44
- /** Peers this plugin was written and verified against(只声明最低版本,无上界)。 */
45
- export const EXPECTED_PEER_RANGE = '>=0.1.5-rc.2';
44
+ /**
45
+ * peer range 的下界与已验证版本。官方全程走 prerelease 渠道(x.y.z-rc.N),semver 的
46
+ * 预发布规则(prerelease 版本只匹配同 [major,minor,patch] 元组的比较器)意味着**每一代
47
+ * rc 都要显式列进范围**:`>=0.1.5-rc.2` 匹配不了 `0.1.7-rc.2`(实测),所以范围是逐代
48
+ * 枚举的并集。上界依旧不设:宿主跨代升级由运行时能力探测兜底(见下)。
49
+ */
50
+ export const EXPECTED_PEER_RANGE = '^0.1.5-rc.2 || ^0.1.7-rc.2';
46
51
  /** The release this plugin's adapters were last verified against. */
47
- export const VERIFIED_HOST_VERSION = '0.1.5-rc.2';
52
+ export const VERIFIED_HOST_VERSION = '0.1.7-rc.2';
48
53
  /**
49
54
  * peer range 的下界 —— 界面展示用。
50
55
  *
@@ -54,7 +59,7 @@ export const VERIFIED_HOST_VERSION = '0.1.5-rc.2';
54
59
  * 而不是在安装期拒绝整包。展示时只应把「最低要求版本」当事实。
55
60
  * 从 EXPECTED_PEER_RANGE 派生,避免两处手写漂移。
56
61
  */
57
- export const EXPECTED_MIN_HOST_VERSION = EXPECTED_PEER_RANGE.match(/^>=\s*([^\s]+)/)?.[1] ?? VERIFIED_HOST_VERSION;
62
+ export const EXPECTED_MIN_HOST_VERSION = EXPECTED_PEER_RANGE.match(/(\d+\.\d+\.\d+(?:-rc\.\d+)?)/)?.[1] ?? VERIFIED_HOST_VERSION;
58
63
  const isFn = (value) => typeof value === 'function';
59
64
  /** Resolve a package the way this plugin resolves it, without throwing. */
60
65
  function safeResolve(specifier) {
@@ -151,10 +156,17 @@ const PROJECTION_CLASS = { pkg: '@deepseek-ai/dsh-session-projection-cache', tar
151
156
  // `announce` live. Without this entry the doctor could not see the two
152
157
  // capabilities the delete route depends on.
153
158
  const SESSIONS_CLASS = { pkg: '@deepseek-ai/dsh-session', target: 'SessionStore' };
159
+ // 0.15.0 新增的两块契约面 —— 恰是 0.1.7 升级咬人的两处(prepareDocument 返回语义变了、
160
+ // read 改名 readDocument),此前不在表里,故障只能靠用户实测发现。类名按官方安装源码核对
161
+ // (dsh-settings 导出 SettingsForms;dsh-agent-preset-registry 导出 AgentPresetRegistry)。
162
+ const SETTINGS_CLASS = { pkg: '@deepseek-ai/dsh-settings', target: 'SettingsForms' };
163
+ const ROSTER_CLASS = { pkg: '@deepseek-ai/dsh-agent-preset-registry', target: 'AgentPresetRegistry' };
154
164
  const OWNER_CLASSES = {
155
165
  workspace: WORKSPACE_CLASS,
156
166
  projectionCache: PROJECTION_CLASS,
157
167
  sessions: SESSIONS_CLASS,
168
+ settings: SETTINGS_CLASS,
169
+ presetRoster: ROSTER_CLASS,
158
170
  };
159
171
  /** The named export's prototype, or undefined when the package is absent/trimmed. */
160
172
  function classPrototypeOf(ref) {
@@ -221,6 +233,14 @@ function referencePrototypes() {
221
233
  const sessions = classPrototypeOf(SESSIONS_CLASS);
222
234
  if (sessions !== undefined)
223
235
  out.sessions = sessions;
236
+ // 两块新契约面的参考副本:包不在 devDeps/宿主锚点里时优雅缺省(textMatch 记 undefined),
237
+ // 存在性探测不依赖它们。
238
+ const settings = classPrototypeOf(SETTINGS_CLASS);
239
+ if (settings !== undefined)
240
+ out.settings = settings;
241
+ const roster = classPrototypeOf(ROSTER_CLASS);
242
+ if (roster !== undefined)
243
+ out.roster = roster;
224
244
  return out;
225
245
  }
226
246
  /**
@@ -455,6 +475,67 @@ const CAPABILITY_SPECS = [
455
475
  return undefined;
456
476
  },
457
477
  },
478
+ // ---- settings document path(0.1.7 的两处适配面之一)----------------------
479
+ // `prepareDocument()` 在 0.1.7 把返回值从「主目录下的设置文档路径」改成「profile 补丁
480
+ // 路径」(`configEditor.documentPath`)—— 方法一直在、语义变了,方法存在性探测抓不住
481
+ // (0.15.0 的 MCP 页事故就是这么静默发生的)。这一条能拦的是「方法消失 / 签名漂移到
482
+ // 同步抛 TypeError」;**返回值形状**是异步结果,同步探针看不到,那一半由 ensurePaths
483
+ // 的 await 后自检负责(src/index.ts:认 profile 形状上溯 + 主目录不变量检查,异常走
484
+ // noteRuntime)。两半合起来才是这个契约的完整探测。
485
+ {
486
+ id: 'settings.document-path',
487
+ label: '设置文档路径(主目录推导源)',
488
+ kind: 'read',
489
+ owner: 'settings',
490
+ fallback: 'refuse-operation',
491
+ methods: ['prepareDocument'],
492
+ // 零副作用真调:官方实现就是 `Promise.resolve(this.documentPath)`,纯读。拿不到
493
+ // 异步结果没关系 —— 同步 TypeError(签名漂移)才是这一层要拦的。
494
+ probe: (t) => callableWithSentinel(t, 'prepareDocument'),
495
+ // 健康行也常显观测路径(官方 SettingsForms 有同步的 `documentPath` getter,
496
+ // prepareDocument 就是它的 Promise 包装):语义再变,页面上这行字一眼见底。
497
+ describe: (t) => {
498
+ try {
499
+ const p = t.documentPath;
500
+ return typeof p === 'string' && p !== '' ? `观测路径:${p}` : undefined;
501
+ }
502
+ catch {
503
+ return undefined;
504
+ }
505
+ },
506
+ },
507
+ // ---- agent preset roster(0.1.7 的两处适配面之二)-------------------------
508
+ // 0.1.7 把 `read(id)`(直返组合文本)改名成 `readDocument(id)`(返回文档对象,组合
509
+ // YAML 在 `.content`)。读取口是「read 优先、readDocument 兜底」双入口
510
+ // (preset-reach.ts 的 readCompositionText),两个名字**任一在场即可** —— 这正是
511
+ // methods 列表表达不了的 either-or,用 probe 写。list / composedPreset 缺一个,
512
+ // 注入边界矩阵与边界提示就瞎一半,同为必需。
513
+ {
514
+ id: 'preset.roster-surface',
515
+ label: '预设名册读取面',
516
+ kind: 'read',
517
+ owner: 'presetRoster',
518
+ fallback: 'inform-only',
519
+ probe: (t) => {
520
+ const o = t;
521
+ const hasRead = isFn(o.read);
522
+ const hasDoc = isFn(o.readDocument);
523
+ if (!hasRead && !hasDoc)
524
+ return 'read 与 readDocument 都缺失:组合文本读不到,注入边界矩阵与极简兜底注入失明';
525
+ const missing = ['list', 'composedPreset'].filter((name) => !isFn(o[name]));
526
+ if (missing.length > 0)
527
+ return `名册缺少 ${missing.join(', ')}:注入边界矩阵不完整`;
528
+ return undefined;
529
+ },
530
+ // 健康行附注实际走的读取路。0.1.7 起 `read` 改名 `readDocument`,兜底成功是**正常形态**
531
+ // 而非降级 —— 这句话只出现在绿色行上(运行时上报会渲染成问题行,那里不放)。
532
+ describe: (t) => {
533
+ const o = t;
534
+ if (!isFn(o.read) && isFn(o.readDocument))
535
+ return '读取走 readDocument(宿主 0.1.7 起的形态)';
536
+ return undefined;
537
+ },
538
+ },
458
539
  ];
459
540
  /**
460
541
  * The capability sets each operation depends on, grouped by how the plugin
@@ -564,10 +645,21 @@ function inspectCapability(spec, target, reference) {
564
645
  textMatch,
565
646
  };
566
647
  }
648
+ // describe 是健康行也带的观测值(如 settings 的 documentPath);只挂 ok 路径,
649
+ // 摸宿主属性一律 try/catch —— 观测失败就少一句后缀,不把好端端的能力报成问题。
650
+ let described = '';
651
+ if (spec.describe !== undefined) {
652
+ try {
653
+ const extra = spec.describe(target);
654
+ if (typeof extra === 'string' && extra !== '')
655
+ described = `;${extra}`;
656
+ }
657
+ catch { /* 观测值拿不到就算了 */ }
658
+ }
567
659
  return {
568
660
  ...base,
569
661
  state: 'ok',
570
- detail: textMatch === false ? '成员齐备(实现文本与本插件适配的版本不同,按能力使用)' : '成员齐备',
662
+ detail: (textMatch === false ? '成员齐备(实现文本与本插件适配的版本不同,按能力使用)' : '成员齐备') + described,
571
663
  missing: [],
572
664
  ...(textMatch === undefined ? {} : { textMatch }),
573
665
  };
@@ -647,12 +739,18 @@ export function assessHost(ctx) {
647
739
  const registry = unwrap(get('workspaceRegistry'));
648
740
  const cache = unwrap(get('sessionProjectionCache'));
649
741
  const sessions = unwrap(ctx.sessions !== undefined ? ctx.sessions : get('sessions'));
742
+ // settings 走 ctx 属性优先(插件 inject 清单里的正式服务),roster 走服务名查找
743
+ // ('agentPresets' 与 preset-reach.ts 的 presetRosterOf 同名 —— 注入矩阵实际用的就是它)。
744
+ const settings = unwrap(ctx.settings !== undefined ? ctx.settings : get('settings'));
745
+ const roster = unwrap(get('agentPresets'));
650
746
  const references = referencePrototypes();
651
747
  const targets = {
652
748
  workspace: { target: registry, reference: references.workspace },
653
749
  projectionCache: { target: cache, reference: references.cache },
654
750
  sessions: { target: sessions, reference: references.sessions },
655
751
  persistence: { target: unwrap(get('sessionPersistence')), reference: undefined },
752
+ settings: { target: settings, reference: references.settings },
753
+ presetRoster: { target: roster, reference: references.roster },
656
754
  };
657
755
  const findings = CAPABILITY_SPECS.map((spec) => {
658
756
  const slot = targets[spec.owner];
@@ -736,7 +834,7 @@ export function assessHost(ctx) {
736
834
  */
737
835
  function hostPackageRoot() {
738
836
  // 与 doctor 的 `findHost` **同一套策略**(先看 `$DSH_HOME/profiles/node_modules/@deepseek-ai`,
739
- // 再从插件自身位置逐级上溯,并确认那一层里真有 `dsh/package.json`)。此前运行时只按"插件
837
+ // 再从插件自身位置逐级上溯,最后扫 npx 缓存,并确认那一层里真有 `dsh/package.json`)。此前运行时只按"插件
740
838
  // 自己解析到的包"上溯,dev 布局下会把仓库里的副本当成宿主锚点、比出假的 `true` —— 于是
741
839
  // 界面说 ok、doctor 说 SEPARATE COPY(V8)。两处口径分裂本身就是缺陷。
742
840
  const home = process.env.DSH_HOME || join(process.env.USERPROFILE || process.env.HOME || '', '.dsh');
@@ -759,12 +857,56 @@ function hostPackageRoot() {
759
857
  dir = parent;
760
858
  }
761
859
  }
860
+ // 0.1.7 起宿主不再维护 `profiles/node_modules` 那棵 junction 树(link-backend 已移除),
861
+ // `dsh web` 经 npx 跑在 `<npm 缓存>/_npx/<hash>/node_modules` 里 —— 缓存扫描是 dev 场景
862
+ // (上溯只找到 checkout 自己的副本)下最后的宿主发现手段。多命中时取最新(npx 升级会
863
+ // 换 hash 目录、删旧目录)。
864
+ candidates.push(...npxCacheHostRoots());
762
865
  for (const candidate of candidates) {
763
866
  if (existsSync(join(candidate, 'dsh', 'package.json')))
764
867
  return candidate;
765
868
  }
766
869
  return null;
767
870
  }
871
+ /**
872
+ * npx 缓存里的宿主 `@deepseek-ai` 目录,按目录 mtime 新到旧排。npm 缓存位置依次看
873
+ * `npm_config_cache`、`~/.npmrc` 的 `cache=`、`%LOCALAPPDATA%\npm-cache` —— probe 全程同步,
874
+ * 不起子进程,读不到就当没有这批候选。
875
+ */
876
+ function npxCacheHostRoots() {
877
+ const home = process.env.USERPROFILE || process.env.HOME || '';
878
+ let cache = process.env.npm_config_cache || '';
879
+ if (!cache && home) {
880
+ try {
881
+ const rc = readFileSync(join(home, '.npmrc'), 'utf8');
882
+ cache = rc.match(/^\s*cache\s*=\s*(.+?)\s*$/m)?.[1] ?? '';
883
+ }
884
+ catch { /* no .npmrc — defaults below */ }
885
+ }
886
+ if (!cache && process.env.LOCALAPPDATA)
887
+ cache = join(process.env.LOCALAPPDATA, 'npm-cache');
888
+ if (!cache)
889
+ return [];
890
+ const roots = [];
891
+ const npxRoot = join(cache, '_npx');
892
+ let entries = [];
893
+ try {
894
+ entries = readdirSync(npxRoot);
895
+ }
896
+ catch {
897
+ return [];
898
+ }
899
+ for (const entry of entries) {
900
+ const dir = join(npxRoot, entry, 'node_modules', '@deepseek-ai');
901
+ if (!existsSync(join(dir, 'dsh', 'package.json')))
902
+ continue;
903
+ try {
904
+ roots.push({ dir, mtime: statSync(dir).mtimeMs });
905
+ }
906
+ catch { /* raced — skip */ }
907
+ }
908
+ return roots.sort((left, right) => right.mtime - left.mtime).map((root) => root.dir);
909
+ }
768
910
  /** Human-readable summary line for logs and the settings page header. */
769
911
  export function summarize(assessment) {
770
912
  const total = assessment.findings.length;
@@ -15,7 +15,7 @@
15
15
  // 形态(2026-09-16 第二版,用户裁定):**每个域一条自己的消息**,不再是一条大快照 ——
16
16
  // 与官方 skill-catalog 同款:各自的来源 kind(轨迹里各自一行、各显各的名字)、各自的
17
17
  // form、各自的去重。好处是"只改了一个域就只重发那一条";代价是进场景这类多域同时变的
18
- // 时刻会一次发几条(每条带一句自己的引导语)。五个域与轨迹行名:
18
+ // 时刻会一次发几条(每条带一句自己的引导语)。各域与轨迹行名(清单见下 INJECT_DOMAIN_KEYS):
19
19
  // scene → scene-manager-catalog(场景:启用的场景 + 场景说明,约定)
20
20
  // memory → memory-manager-catalog(记忆:各场景下的条目,记录)
21
21
  // mcp → mcp-manager-catalog
@@ -35,7 +35,7 @@
35
35
  // 免得旧目录继续被当成现状。
36
36
  //
37
37
  // 2026-09-17 第二版加的两件事:
38
- // - **按深度抑制人设目录**:宿主平面注册意味着子代理派生的会话也收到五域。而人设目录
38
+ // - **按深度抑制人设目录**:宿主平面注册意味着子代理派生的会话也收到全部域。而人设目录
39
39
  // 要不要出现在某个深度的会话里,由人设的 `catalogDepth`(默认 1 = 只在顶层注入)决定;
40
40
  // 判定放在域声明的 `applicableTo` 上,通道只负责问一句 —— "哪个域对哪类会话不成立"
41
41
  // 是域的语义,不是通道的机制。
@@ -388,7 +388,7 @@ export function escapeFrameBody(body) {
388
388
  }
389
389
  /**
390
390
  * 一条注入消息的正文(纯函数):`<system-reminder>` 里 = 框架(标题 + 动作 + 补充 + 权威
391
- * 声明)+ 空行 + 域正文。**五个域一律带框架**,没有例外。
391
+ * 声明)+ 空行 + 域正文。**所有域一律带框架**,没有例外。
392
392
  *
393
393
  * 历史(每一版都是被具体毛病逼出来的,别把结论当套话读):
394
394
  * - 第一版(2026-09-17 前):五域共用「以下是本机插件的X(取代…)。」——「本机插件」是实现
@@ -509,6 +509,8 @@ function suppressionVerdict(active, dropped, counter) {
509
509
  kind: 'read',
510
510
  fallback: 'inform-only',
511
511
  detail: `关掉的注入域已连续 ${counter.turns} 轮没有拦到任何官方消息(自检):可能是瀑布注册顺序变了导致拦截失效,也可能是官方那两条注入行这几轮本来就没有内容。可到「注入实况」对照模型实际收到的内容。`,
512
+ detailKey: 'official-suppression',
513
+ params: { turns: counter.turns },
512
514
  });
513
515
  }
514
516
  /** 实况展示用的 kind 表:本插件的五条 + 官方两条。 */