@linxin666/dsh-liangshen 0.4.18 → 0.4.20

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/index.js CHANGED
@@ -266,7 +266,12 @@ function parseMap(cursor, indent) {
266
266
  if (entry === void 0) throw new CompositionError(`line ${String(cursor.index + 1)}: expected "key: value", got "${line.trim()}"`);
267
267
  if (Object.hasOwn(map, entry.key)) throw new CompositionError(`line ${String(cursor.index + 1)}: duplicate key "${entry.key}"`);
268
268
  cursor.index += 1;
269
- map[entry.key] = parseValue(cursor, indent, entry.rest);
269
+ Object.defineProperty(map, entry.key, {
270
+ value: parseValue(cursor, indent, entry.rest),
271
+ enumerable: true,
272
+ writable: true,
273
+ configurable: true
274
+ });
270
275
  }
271
276
  return map;
272
277
  }
@@ -419,13 +424,21 @@ function parsePagedToolPatterns(text) {
419
424
  function overrideTargets(overrides) {
420
425
  const paged = parsePagedToolPatterns(overrides.pagedToolPatterns);
421
426
  const pagedPatch = () => paged === void 0 ? {} : { pagedToolPatterns: [...paged] };
427
+ const idlePatch = () => overrides.idleReclaimSteps === void 0 ? {} : { idleReclaimSteps: overrides.idleReclaimSteps };
422
428
  return [
423
429
  ["tool-catalog", {
424
430
  ...overrides.presentation === void 0 ? {} : { presentation: overrides.presentation },
425
- ...pagedPatch()
431
+ ...pagedPatch(),
432
+ ...idlePatch()
433
+ }],
434
+ ["tool-activate", {
435
+ ...pagedPatch(),
436
+ ...idlePatch()
437
+ }],
438
+ ["working-context", {
439
+ ...pagedPatch(),
440
+ ...idlePatch()
426
441
  }],
427
- ["tool-activate", pagedPatch()],
428
- ["working-context", pagedPatch()],
429
442
  ["minimal-prompt", { ...overrides.dispatcher === void 0 ? {} : { dispatcher: overrides.dispatcher } }]
430
443
  ];
431
444
  }
@@ -650,7 +663,8 @@ const Config = z.object({
650
663
  announceToAgent: z.boolean().default(false).volatile(),
651
664
  presentation: z.union([...PRESENTATION_OPTIONS, z.transform("both", () => "ptc").deprecated().hidden()]).default("ptc").volatile(),
652
665
  dispatcher: z.boolean().default(true).volatile(),
653
- pagedToolPatterns: z.string().default("").volatile()
666
+ pagedToolPatterns: z.string().default("").volatile(),
667
+ idleReclaimSteps: z.number().min(0).default(0).volatile()
654
668
  });
655
669
  /** Schema defaults, re-read for hand-built test contexts. */
656
670
  const DEFAULT_CONFIG = {
@@ -658,7 +672,8 @@ const DEFAULT_CONFIG = {
658
672
  announceToAgent: false,
659
673
  presentation: "ptc",
660
674
  dispatcher: true,
661
- pagedToolPatterns: ""
675
+ pagedToolPatterns: "",
676
+ idleReclaimSteps: 0
662
677
  };
663
678
  /**
664
679
  * Read one activation field. The Host validates the raw profile config and
@@ -684,11 +699,12 @@ function resolveConfig(config) {
684
699
  announceToAgent: readField(config?.announceToAgent, DEFAULT_CONFIG.announceToAgent),
685
700
  presentation: rawPresentation === "both" ? "ptc" : rawPresentation,
686
701
  dispatcher: readField(config?.dispatcher, DEFAULT_CONFIG.dispatcher),
687
- pagedToolPatterns: readField(config?.pagedToolPatterns, DEFAULT_CONFIG.pagedToolPatterns)
702
+ pagedToolPatterns: readField(config?.pagedToolPatterns, DEFAULT_CONFIG.pagedToolPatterns),
703
+ idleReclaimSteps: readField(config?.idleReclaimSteps, DEFAULT_CONFIG.idleReclaimSteps)
688
704
  };
689
705
  }
690
706
  /** Model-facing announcement: plugin presence, principle, and limits. */
691
- const LIANGSHEN_GUIDANCE = "本机已安装 dsh-liangshen 插件(梁神模式 agent preset):新建会话的预设选择器中可选「梁神模式」。原理:系统提示词保持极简 persona(minimal-prompt 放行该段与 plan 模式的 plan:policy),persona 内置本模式工作纪律(反思熔断——同一假设推演不超过两轮、缺事实立即闭合思考并调用原生检测工具;行动导向——思考只决定下一步具体操作、不在思考中预演代码实现;并发探索——多处独立检查或搜索在单轮内并发发射多个工具调用;YAGNI/PDCA——单步验证单一假设、不写冗余注释;有界收敛——不无限下钻依赖链、前置检查最多2-3轮后立即收敛并作答或编辑),并在组装时追加工作区目录行 Your working directory is <cwd>.。AGENTS.md 工作区指令默认交还宿主自身的 agent-instructions 行,以 user 角色注入,本插件不追加任何系统提示词段、也不改动 pre-step 的消息批次;可选 instructionSource: system-prompt 才由本插件在组装时读取 AGENTS.md 链并追加 workspace-instructions 段(65536 字节预算,每次组装重读)。wire 呈现由 tool-catalog 按会话一次声明,取值 'ptc'(默认:wire 收拢为唯一的 run_code,其余工具经生成的 SDK 调用)或 'native'(组装出的原生清单,无程序化传输),并可在插件设置界面切换(写入所声明预设的 tool-catalog 行);未挂载 code runtime 时不做声明,会话运行原生工具面。按需工具族出厂开启(pagedToolPatterns 默认 ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*'],可在插件设置的「按需工具族」中用逗号分隔的前缀改写):匹配工具在激活前被作用域级工具限制移出可见面(既不在 wire,也不在生成的 SDK 声明中),目录消息列出常驻工具签名与未激活命名空间摘要,调用 tool_activate({ namespace }) 按需激活(LRU 上限 3 个活跃命名空间,驱逐最久未用);激活状态从持久会话事件流重建,resume/压缩后自然恢复。关键事实登记簿(fact_register)让模型把硬约束/已确认决策/失败路径登记为单行事实,随 working-context 行每步投射进局部注意力窗口。working-context 插件在 pre-step 注入单行 [Working Context: ...] 就近状态投射(plan 模式、活跃命名空间、进行中 todo、登记事实,全部从事件流折叠,读不到则省略,全部为空则不注入)。历史工具结果修剪为 4096 字符阈值(head 2048 / tail 1024)。文件操作受宿主沙箱约束;shell 在每个平台都挂上游标准 Stdio 栈(POSIX 为 bash,Windows 为 pwsh),带简短描述标题卡片与确定性退出码。真实推理探针通过不等于模式集成通过,更不等于统计效果提升。预设由插件在激活时向 agent-preset registry 直接注册(不写任何预设目录),插件停用即注销;默认预设由用户自行选择。用户提到「梁神模式 / 锚定模式 / anchored standard」时即指本插件,请据此协作。";
707
+ const LIANGSHEN_GUIDANCE = "本机已安装 dsh-liangshen 插件(梁神模式 agent preset):新建会话的预设选择器中可选「梁神模式」。原理:系统提示词保持极简 persona(minimal-prompt 放行该段与 plan 模式的 plan:policy),persona 内置本模式工作纪律(反思熔断——同一假设推演不超过两轮、缺事实立即闭合思考并调用原生检测工具;行动导向——思考只决定下一步具体操作、不在思考中预演代码实现;并发探索——多处独立检查或搜索在单轮内并发发射多个工具调用;YAGNI/PDCA——单步验证单一假设、不写冗余注释;有界收敛——不无限下钻依赖链、前置检查最多2-3轮后立即收敛并作答或编辑),并在组装时追加工作区目录行 Your working directory is <cwd>.。AGENTS.md 工作区指令默认交还宿主自身的 agent-instructions 行,以 user 角色注入,本插件不追加任何系统提示词段、也不改动 pre-step 的消息批次;可选 instructionSource: system-prompt 才由本插件在组装时读取 AGENTS.md 链并追加 workspace-instructions 段(65536 字节预算,每次组装重读)。wire 呈现由 tool-catalog 按会话一次声明,取值 'ptc'(默认:wire 收拢为唯一的 run_code,其余工具经生成的 SDK 调用)或 'native'(组装出的原生清单,无程序化传输),并可在插件设置界面切换(写入所声明预设的 tool-catalog 行);未挂载 code runtime 时不做声明,会话运行原生工具面。按需工具族出厂开启(pagedToolPatterns 默认 ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*'],可在插件设置的「按需工具族」中用逗号分隔的前缀改写):匹配工具在激活前被作用域级工具限制移出可见面(既不在 wire,也不在生成的 SDK 声明中),目录消息列出常驻工具签名与未激活命名空间摘要,调用 tool_activate({ namespace }) 按需激活(LRU 上限 3 个活跃命名空间,驱逐最久未用);激活状态从持久会话事件流重建,resume/压缩后自然恢复。可选 idleReclaimSteps(设置「空闲收回步数」,默认 0=不收回)让连续 N 步无成功调用的已激活命名空间过期,但只在下次激活或压缩时延迟收回——这些时机前缀缓存本就要重建,因此不新增任何全量重建;应用前命名空间仍常驻可达,再次调用即续命。关键事实登记簿(fact_register)让模型把硬约束/已确认决策/失败路径登记为单行事实,随 working-context 行每步投射进局部注意力窗口。working-context 插件在 pre-step 注入单行 [Working Context: ...] 就近状态投射(plan 模式、活跃命名空间、进行中 todo、登记事实,全部从事件流折叠,读不到则省略,全部为空则不注入)。历史工具结果修剪为 4096 字符阈值(head 2048 / tail 1024)。文件操作受宿主沙箱约束;shell 在每个平台都挂上游标准 Stdio 栈(POSIX 为 bash,Windows 为 pwsh),带简短描述标题卡片与确定性退出码。真实推理探针通过不等于模式集成通过,更不等于统计效果提升。预设由插件在激活时向 agent-preset registry 直接注册(不写任何预设目录),插件停用即注销;默认预设由用户自行选择。用户提到「梁神模式 / 锚定模式 / anchored standard」时即指本插件,请据此协作。";
692
708
  /** Order of the announcement section within the tool-guidance band. */
693
709
  const SECTION_ORDER = 150;
694
710
  /**
@@ -702,14 +718,14 @@ function bundledPresetDir() {
702
718
  /**
703
719
  * Build the registry declaration of the bundled preset with the settings
704
720
  * currently committed applied to the rows they shape.
721
+ * @param base - the bundled preset as parsed for this activation.
705
722
  * @param values - the activation's effective settings.
706
723
  * @returns the definition to submit to `ctx.agentPresets.register`.
707
724
  */
708
- function declaration(values) {
709
- const definition = readPresetDefinition(LIANGSHEN_PRESET_ID, bundledPresetDir());
725
+ function declaration(base, values) {
710
726
  return {
711
- ...definition,
712
- plugins: applyPresetOverrides(definition.plugins, values)
727
+ ...base,
728
+ plugins: applyPresetOverrides(base.plugins, values)
713
729
  };
714
730
  }
715
731
  /**
@@ -743,6 +759,23 @@ function applyImpl(ctx, config) {
743
759
  * already present at activation is never re-declared.
744
760
  */
745
761
  let registryMissing = false;
762
+ /**
763
+ * The bundled preset as parsed by this activation, read on first declaration.
764
+ * Every settings write re-declares, and the two preset files cannot change
765
+ * under a running row, so re-reading and re-parsing them on each write would
766
+ * block the event loop for a result identical to the one already held. A
767
+ * failed read is not remembered: the next declaration tries the disk again.
768
+ */
769
+ let basePreset;
770
+ /**
771
+ * The bundled preset definition for this activation, parsed at most once.
772
+ * The overlay derives a new row list from it, so the cached base keeps the
773
+ * values the composition ships for every declaration that follows.
774
+ */
775
+ const baseDefinition = () => {
776
+ if (basePreset === void 0) basePreset = readPresetDefinition(LIANGSHEN_PRESET_ID, bundledPresetDir());
777
+ return basePreset;
778
+ };
746
779
  const warn = (message) => {
747
780
  ctx.logger?.warn?.(`dsh-liangshen: ${message}`);
748
781
  };
@@ -779,7 +812,7 @@ function applyImpl(ctx, config) {
779
812
  return;
780
813
  }
781
814
  try {
782
- release = await registry.register(declaration(values));
815
+ release = await registry.register(declaration(baseDefinition(), values));
783
816
  registryMissing = false;
784
817
  ctx.logger?.info?.(`liangshen: preset ${LIANGSHEN_PRESET_ID} declared`);
785
818
  } catch (error) {
@@ -33,6 +33,8 @@ export interface LiangShenSettings {
33
33
  dispatcher?: boolean;
34
34
  /** Comma-separated on-demand tool families the Host writes to the tool-catalog row. */
35
35
  pagedToolPatterns?: string;
36
+ /** Deferred idle-reclaim threshold in steps the Host writes to every paging row. */
37
+ idleReclaimSteps?: number;
36
38
  }
37
39
  /** What the LiangShen card renders. */
38
40
  export interface LiangShenSettingsCardState extends CardShell {
@@ -41,6 +43,7 @@ export interface LiangShenSettingsCardState extends CardShell {
41
43
  presentation: CardFieldState;
42
44
  dispatcher: CardFieldState;
43
45
  pagedToolPatterns: CardFieldState;
46
+ idleReclaimSteps: CardFieldState;
44
47
  }
45
48
  /** The registration-side face the card's slot entry injects. */
46
49
  export interface LiangShenSettingsCardFace extends CardActions {
@@ -108,6 +108,14 @@ export declare class LeverController {
108
108
  /** Ceiling on one in-flight switch, so a lost Remote answer cannot hang the row. */
109
109
  private readonly selectTimeoutMs;
110
110
  private readonly disposers;
111
+ /** The one face this controller hands out: the view reads it on every render. */
112
+ private cachedFace;
113
+ /**
114
+ * The translator bound to this plugin's locale namespace, resolved on first
115
+ * use. A lookup that resolved nothing is never cached, so a locale service
116
+ * registered after activation still reaches the same face.
117
+ */
118
+ private cachedTranslate;
111
119
  constructor(ctx: ClientContext, options?: LeverControllerOptions);
112
120
  /** The snapshot store the view subscribes to. */
113
121
  snapshot(): SnapshotStore<LeverSnapshot>;
@@ -115,8 +123,14 @@ export declare class LeverController {
115
123
  start(): void;
116
124
  /** Release every subscription. Idempotent. */
117
125
  dispose(): void;
118
- /** The inject face handed to the slot entry. */
126
+ /** The inject face handed to the slot entry; the same instance on every read. */
119
127
  face(): LeverFace;
128
+ /**
129
+ * The translator bound to this plugin's locale namespace, or undefined while
130
+ * none answers. The binding is resolved once and only on success: a locale
131
+ * service that arrives later than this controller still gets its chance.
132
+ */
133
+ private translate;
120
134
  /** Read the roster; a refusal leaves the lever as it was. */
121
135
  load(): Promise<void>;
122
136
  /**
@@ -125,6 +139,8 @@ export declare class LeverController {
125
139
  * and the burst counter belong to the gesture, not to a session refresh.
126
140
  */
127
141
  refresh(): void;
142
+ /** Display name of the preset a push-up would restore; empty when there is none. */
143
+ private restoreLabelOf;
128
144
  /** The verb behind one gesture direction. */
129
145
  private toggle;
130
146
  /**
@@ -133,7 +149,15 @@ export declare class LeverController {
133
149
  */
134
150
  private detectPreset;
135
151
  private rememberPrevious;
136
- /** The facts one decision reads, from the live session and the roster. */
152
+ /**
153
+ * The facts one decision reads, from the live session and the roster.
154
+ *
155
+ * `previous` is resolved only for a blank session: it exists to name the
156
+ * preset a push-up restores, and only a blank session may switch preset at
157
+ * all. Resolving it costs a DOM chip lookup and a session-storage read
158
+ * ({@link detectPreset}), which a started session -- reported as 'locked' or
159
+ * 'missing' -- would pay for on every roster and session update and never use.
160
+ */
137
161
  private facts;
138
162
  private currentSessionId;
139
163
  private currentSession;
@@ -33,6 +33,9 @@ export declare const zh: {
33
33
  'settings.pagedToolPatterns': string;
34
34
  'settings.pagedToolPatternsHint': string;
35
35
  'settings.pagedToolPatternsInvalid': string;
36
+ 'settings.idleReclaimSteps': string;
37
+ 'settings.idleReclaimStepsHint': string;
38
+ 'settings.idleReclaimStepsInvalid': string;
36
39
  'settings.on': string;
37
40
  'settings.off': string;
38
41
  'settings.inherit': string;
@@ -111,6 +111,8 @@ export interface NumberConstraints {
111
111
  integer?: boolean;
112
112
  /** The accepted value must be at least this. */
113
113
  min?: number;
114
+ /** The accepted value must be at most this. */
115
+ max?: number;
114
116
  }
115
117
  /** A whole- or decimal-number field. An empty draft clears the field; any other draft that is not a finite number within the constraints stays unwritten. */
116
118
  export declare function numberField(field: string, constraints?: NumberConstraints): FieldSpec;
@@ -98,6 +98,12 @@ export interface PresetOverrides {
98
98
  * when blank or malformed.
99
99
  */
100
100
  pagedToolPatterns?: string;
101
+ /**
102
+ * Deferred idle-reclaim threshold in steps; written to every row that pages
103
+ * from the list (tool-catalog, tool-activate, working-context), skipped when
104
+ * absent.
105
+ */
106
+ idleReclaimSteps?: number;
101
107
  }
102
108
  /**
103
109
  * Parse the on-demand tool family text: comma separated, each entry a prefix
@@ -95,6 +95,15 @@ export interface Config {
95
95
  * malformed text is ignored.
96
96
  */
97
97
  pagedToolPatterns?: ConfigField<string>;
98
+ /**
99
+ * Deferred idle-reclaim threshold in steps, written to every row that replays
100
+ * the page (tool-catalog, tool-activate, working-context). 0 (the default)
101
+ * keeps every activation resident until LRU eviction — the shipped behavior.
102
+ * A positive N expires a namespace with no successful call for N steps, but
103
+ * the replay applies the expiry only at the next activation or compaction,
104
+ * so reclaim never adds a prefix-cache rebuild (issue #2066).
105
+ */
106
+ idleReclaimSteps?: ConfigField<number>;
98
107
  }
99
108
  export declare const Config: z<Schemastery.ObjectS<NoInfer<{
100
109
  enabled: z<boolean, boolean, "volatile-defined">;
@@ -102,12 +111,14 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
102
111
  presentation: z<string, "ptc" | "native", "volatile-defined">;
103
112
  dispatcher: z<boolean, boolean, "volatile-defined">;
104
113
  pagedToolPatterns: z<string, string, "volatile-defined">;
114
+ idleReclaimSteps: z<number, number, "volatile-defined">;
105
115
  }>>, Schemastery.ObjectT<NoInfer<{
106
116
  enabled: z<boolean, boolean, "volatile-defined">;
107
117
  announceToAgent: z<boolean, boolean, "volatile-defined">;
108
118
  presentation: z<string, "ptc" | "native", "volatile-defined">;
109
119
  dispatcher: z<boolean, boolean, "volatile-defined">;
110
120
  pagedToolPatterns: z<string, string, "volatile-defined">;
121
+ idleReclaimSteps: z<number, number, "volatile-defined">;
111
122
  }>>, "plain">;
112
123
  /** The settings the runtime acts on, every field read at its use site. */
113
124
  export interface ResolvedConfig {
@@ -121,6 +132,8 @@ export interface ResolvedConfig {
121
132
  dispatcher: boolean;
122
133
  /** On-demand tool family text; empty inherits the preset's shipped list. */
123
134
  pagedToolPatterns: string;
135
+ /** Deferred idle-reclaim threshold in steps; 0 keeps the shipped resident behavior. */
136
+ idleReclaimSteps: number;
124
137
  }
125
138
  /** Schema defaults, re-read for hand-built test contexts. */
126
139
  export declare const DEFAULT_CONFIG: ResolvedConfig;
@@ -131,7 +144,7 @@ export declare const DEFAULT_CONFIG: ResolvedConfig;
131
144
  */
132
145
  export declare function resolveConfig(config?: Config): ResolvedConfig;
133
146
  /** Model-facing announcement: plugin presence, principle, and limits. */
134
- export declare const LIANGSHEN_GUIDANCE = "\u672C\u673A\u5DF2\u5B89\u88C5 dsh-liangshen \u63D2\u4EF6\uFF08\u6881\u795E\u6A21\u5F0F agent preset\uFF09\uFF1A\u65B0\u5EFA\u4F1A\u8BDD\u7684\u9884\u8BBE\u9009\u62E9\u5668\u4E2D\u53EF\u9009\u300C\u6881\u795E\u6A21\u5F0F\u300D\u3002\u539F\u7406\uFF1A\u7CFB\u7EDF\u63D0\u793A\u8BCD\u4FDD\u6301\u6781\u7B80 persona\uFF08minimal-prompt \u653E\u884C\u8BE5\u6BB5\u4E0E plan \u6A21\u5F0F\u7684 plan:policy\uFF09\uFF0Cpersona \u5185\u7F6E\u672C\u6A21\u5F0F\u5DE5\u4F5C\u7EAA\u5F8B\uFF08\u53CD\u601D\u7194\u65AD\u2014\u2014\u540C\u4E00\u5047\u8BBE\u63A8\u6F14\u4E0D\u8D85\u8FC7\u4E24\u8F6E\u3001\u7F3A\u4E8B\u5B9E\u7ACB\u5373\u95ED\u5408\u601D\u8003\u5E76\u8C03\u7528\u539F\u751F\u68C0\u6D4B\u5DE5\u5177\uFF1B\u884C\u52A8\u5BFC\u5411\u2014\u2014\u601D\u8003\u53EA\u51B3\u5B9A\u4E0B\u4E00\u6B65\u5177\u4F53\u64CD\u4F5C\u3001\u4E0D\u5728\u601D\u8003\u4E2D\u9884\u6F14\u4EE3\u7801\u5B9E\u73B0\uFF1B\u5E76\u53D1\u63A2\u7D22\u2014\u2014\u591A\u5904\u72EC\u7ACB\u68C0\u67E5\u6216\u641C\u7D22\u5728\u5355\u8F6E\u5185\u5E76\u53D1\u53D1\u5C04\u591A\u4E2A\u5DE5\u5177\u8C03\u7528\uFF1BYAGNI/PDCA\u2014\u2014\u5355\u6B65\u9A8C\u8BC1\u5355\u4E00\u5047\u8BBE\u3001\u4E0D\u5199\u5197\u4F59\u6CE8\u91CA\uFF1B\u6709\u754C\u6536\u655B\u2014\u2014\u4E0D\u65E0\u9650\u4E0B\u94BB\u4F9D\u8D56\u94FE\u3001\u524D\u7F6E\u68C0\u67E5\u6700\u591A2-3\u8F6E\u540E\u7ACB\u5373\u6536\u655B\u5E76\u4F5C\u7B54\u6216\u7F16\u8F91\uFF09\uFF0C\u5E76\u5728\u7EC4\u88C5\u65F6\u8FFD\u52A0\u5DE5\u4F5C\u533A\u76EE\u5F55\u884C Your working directory is <cwd>.\u3002AGENTS.md \u5DE5\u4F5C\u533A\u6307\u4EE4\u9ED8\u8BA4\u4EA4\u8FD8\u5BBF\u4E3B\u81EA\u8EAB\u7684 agent-instructions \u884C\uFF0C\u4EE5 user \u89D2\u8272\u6CE8\u5165\uFF0C\u672C\u63D2\u4EF6\u4E0D\u8FFD\u52A0\u4EFB\u4F55\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6BB5\u3001\u4E5F\u4E0D\u6539\u52A8 pre-step \u7684\u6D88\u606F\u6279\u6B21\uFF1B\u53EF\u9009 instructionSource: system-prompt \u624D\u7531\u672C\u63D2\u4EF6\u5728\u7EC4\u88C5\u65F6\u8BFB\u53D6 AGENTS.md \u94FE\u5E76\u8FFD\u52A0 workspace-instructions \u6BB5\uFF0865536 \u5B57\u8282\u9884\u7B97\uFF0C\u6BCF\u6B21\u7EC4\u88C5\u91CD\u8BFB\uFF09\u3002wire \u5448\u73B0\u7531 tool-catalog \u6309\u4F1A\u8BDD\u4E00\u6B21\u58F0\u660E\uFF0C\u53D6\u503C 'ptc'\uFF08\u9ED8\u8BA4\uFF1Awire \u6536\u62E2\u4E3A\u552F\u4E00\u7684 run_code\uFF0C\u5176\u4F59\u5DE5\u5177\u7ECF\u751F\u6210\u7684 SDK \u8C03\u7528\uFF09\u6216 'native'\uFF08\u7EC4\u88C5\u51FA\u7684\u539F\u751F\u6E05\u5355\uFF0C\u65E0\u7A0B\u5E8F\u5316\u4F20\u8F93\uFF09\uFF0C\u5E76\u53EF\u5728\u63D2\u4EF6\u8BBE\u7F6E\u754C\u9762\u5207\u6362\uFF08\u5199\u5165\u6240\u58F0\u660E\u9884\u8BBE\u7684 tool-catalog \u884C\uFF09\uFF1B\u672A\u6302\u8F7D code runtime \u65F6\u4E0D\u505A\u58F0\u660E\uFF0C\u4F1A\u8BDD\u8FD0\u884C\u539F\u751F\u5DE5\u5177\u9762\u3002\u6309\u9700\u5DE5\u5177\u65CF\u51FA\u5382\u5F00\u542F\uFF08pagedToolPatterns \u9ED8\u8BA4 ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*']\uFF0C\u53EF\u5728\u63D2\u4EF6\u8BBE\u7F6E\u7684\u300C\u6309\u9700\u5DE5\u5177\u65CF\u300D\u4E2D\u7528\u9017\u53F7\u5206\u9694\u7684\u524D\u7F00\u6539\u5199\uFF09\uFF1A\u5339\u914D\u5DE5\u5177\u5728\u6FC0\u6D3B\u524D\u88AB\u4F5C\u7528\u57DF\u7EA7\u5DE5\u5177\u9650\u5236\u79FB\u51FA\u53EF\u89C1\u9762\uFF08\u65E2\u4E0D\u5728 wire\uFF0C\u4E5F\u4E0D\u5728\u751F\u6210\u7684 SDK \u58F0\u660E\u4E2D\uFF09\uFF0C\u76EE\u5F55\u6D88\u606F\u5217\u51FA\u5E38\u9A7B\u5DE5\u5177\u7B7E\u540D\u4E0E\u672A\u6FC0\u6D3B\u547D\u540D\u7A7A\u95F4\u6458\u8981\uFF0C\u8C03\u7528 tool_activate({ namespace }) \u6309\u9700\u6FC0\u6D3B\uFF08LRU \u4E0A\u9650 3 \u4E2A\u6D3B\u8DC3\u547D\u540D\u7A7A\u95F4\uFF0C\u9A71\u9010\u6700\u4E45\u672A\u7528\uFF09\uFF1B\u6FC0\u6D3B\u72B6\u6001\u4ECE\u6301\u4E45\u4F1A\u8BDD\u4E8B\u4EF6\u6D41\u91CD\u5EFA\uFF0Cresume/\u538B\u7F29\u540E\u81EA\u7136\u6062\u590D\u3002\u5173\u952E\u4E8B\u5B9E\u767B\u8BB0\u7C3F\uFF08fact_register\uFF09\u8BA9\u6A21\u578B\u628A\u786C\u7EA6\u675F/\u5DF2\u786E\u8BA4\u51B3\u7B56/\u5931\u8D25\u8DEF\u5F84\u767B\u8BB0\u4E3A\u5355\u884C\u4E8B\u5B9E\uFF0C\u968F working-context \u884C\u6BCF\u6B65\u6295\u5C04\u8FDB\u5C40\u90E8\u6CE8\u610F\u529B\u7A97\u53E3\u3002working-context \u63D2\u4EF6\u5728 pre-step \u6CE8\u5165\u5355\u884C [Working Context: ...] \u5C31\u8FD1\u72B6\u6001\u6295\u5C04\uFF08plan \u6A21\u5F0F\u3001\u6D3B\u8DC3\u547D\u540D\u7A7A\u95F4\u3001\u8FDB\u884C\u4E2D todo\u3001\u767B\u8BB0\u4E8B\u5B9E\uFF0C\u5168\u90E8\u4ECE\u4E8B\u4EF6\u6D41\u6298\u53E0\uFF0C\u8BFB\u4E0D\u5230\u5219\u7701\u7565\uFF0C\u5168\u90E8\u4E3A\u7A7A\u5219\u4E0D\u6CE8\u5165\uFF09\u3002\u5386\u53F2\u5DE5\u5177\u7ED3\u679C\u4FEE\u526A\u4E3A 4096 \u5B57\u7B26\u9608\u503C\uFF08head 2048 / tail 1024\uFF09\u3002\u6587\u4EF6\u64CD\u4F5C\u53D7\u5BBF\u4E3B\u6C99\u7BB1\u7EA6\u675F\uFF1Bshell \u5728\u6BCF\u4E2A\u5E73\u53F0\u90FD\u6302\u4E0A\u6E38\u6807\u51C6 Stdio \u6808\uFF08POSIX \u4E3A bash\uFF0CWindows \u4E3A pwsh\uFF09\uFF0C\u5E26\u7B80\u77ED\u63CF\u8FF0\u6807\u9898\u5361\u7247\u4E0E\u786E\u5B9A\u6027\u9000\u51FA\u7801\u3002\u771F\u5B9E\u63A8\u7406\u63A2\u9488\u901A\u8FC7\u4E0D\u7B49\u4E8E\u6A21\u5F0F\u96C6\u6210\u901A\u8FC7\uFF0C\u66F4\u4E0D\u7B49\u4E8E\u7EDF\u8BA1\u6548\u679C\u63D0\u5347\u3002\u9884\u8BBE\u7531\u63D2\u4EF6\u5728\u6FC0\u6D3B\u65F6\u5411 agent-preset registry \u76F4\u63A5\u6CE8\u518C\uFF08\u4E0D\u5199\u4EFB\u4F55\u9884\u8BBE\u76EE\u5F55\uFF09\uFF0C\u63D2\u4EF6\u505C\u7528\u5373\u6CE8\u9500\uFF1B\u9ED8\u8BA4\u9884\u8BBE\u7531\u7528\u6237\u81EA\u884C\u9009\u62E9\u3002\u7528\u6237\u63D0\u5230\u300C\u6881\u795E\u6A21\u5F0F / \u951A\u5B9A\u6A21\u5F0F / anchored standard\u300D\u65F6\u5373\u6307\u672C\u63D2\u4EF6\uFF0C\u8BF7\u636E\u6B64\u534F\u4F5C\u3002";
147
+ export declare const LIANGSHEN_GUIDANCE = "\u672C\u673A\u5DF2\u5B89\u88C5 dsh-liangshen \u63D2\u4EF6\uFF08\u6881\u795E\u6A21\u5F0F agent preset\uFF09\uFF1A\u65B0\u5EFA\u4F1A\u8BDD\u7684\u9884\u8BBE\u9009\u62E9\u5668\u4E2D\u53EF\u9009\u300C\u6881\u795E\u6A21\u5F0F\u300D\u3002\u539F\u7406\uFF1A\u7CFB\u7EDF\u63D0\u793A\u8BCD\u4FDD\u6301\u6781\u7B80 persona\uFF08minimal-prompt \u653E\u884C\u8BE5\u6BB5\u4E0E plan \u6A21\u5F0F\u7684 plan:policy\uFF09\uFF0Cpersona \u5185\u7F6E\u672C\u6A21\u5F0F\u5DE5\u4F5C\u7EAA\u5F8B\uFF08\u53CD\u601D\u7194\u65AD\u2014\u2014\u540C\u4E00\u5047\u8BBE\u63A8\u6F14\u4E0D\u8D85\u8FC7\u4E24\u8F6E\u3001\u7F3A\u4E8B\u5B9E\u7ACB\u5373\u95ED\u5408\u601D\u8003\u5E76\u8C03\u7528\u539F\u751F\u68C0\u6D4B\u5DE5\u5177\uFF1B\u884C\u52A8\u5BFC\u5411\u2014\u2014\u601D\u8003\u53EA\u51B3\u5B9A\u4E0B\u4E00\u6B65\u5177\u4F53\u64CD\u4F5C\u3001\u4E0D\u5728\u601D\u8003\u4E2D\u9884\u6F14\u4EE3\u7801\u5B9E\u73B0\uFF1B\u5E76\u53D1\u63A2\u7D22\u2014\u2014\u591A\u5904\u72EC\u7ACB\u68C0\u67E5\u6216\u641C\u7D22\u5728\u5355\u8F6E\u5185\u5E76\u53D1\u53D1\u5C04\u591A\u4E2A\u5DE5\u5177\u8C03\u7528\uFF1BYAGNI/PDCA\u2014\u2014\u5355\u6B65\u9A8C\u8BC1\u5355\u4E00\u5047\u8BBE\u3001\u4E0D\u5199\u5197\u4F59\u6CE8\u91CA\uFF1B\u6709\u754C\u6536\u655B\u2014\u2014\u4E0D\u65E0\u9650\u4E0B\u94BB\u4F9D\u8D56\u94FE\u3001\u524D\u7F6E\u68C0\u67E5\u6700\u591A2-3\u8F6E\u540E\u7ACB\u5373\u6536\u655B\u5E76\u4F5C\u7B54\u6216\u7F16\u8F91\uFF09\uFF0C\u5E76\u5728\u7EC4\u88C5\u65F6\u8FFD\u52A0\u5DE5\u4F5C\u533A\u76EE\u5F55\u884C Your working directory is <cwd>.\u3002AGENTS.md \u5DE5\u4F5C\u533A\u6307\u4EE4\u9ED8\u8BA4\u4EA4\u8FD8\u5BBF\u4E3B\u81EA\u8EAB\u7684 agent-instructions \u884C\uFF0C\u4EE5 user \u89D2\u8272\u6CE8\u5165\uFF0C\u672C\u63D2\u4EF6\u4E0D\u8FFD\u52A0\u4EFB\u4F55\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6BB5\u3001\u4E5F\u4E0D\u6539\u52A8 pre-step \u7684\u6D88\u606F\u6279\u6B21\uFF1B\u53EF\u9009 instructionSource: system-prompt \u624D\u7531\u672C\u63D2\u4EF6\u5728\u7EC4\u88C5\u65F6\u8BFB\u53D6 AGENTS.md \u94FE\u5E76\u8FFD\u52A0 workspace-instructions \u6BB5\uFF0865536 \u5B57\u8282\u9884\u7B97\uFF0C\u6BCF\u6B21\u7EC4\u88C5\u91CD\u8BFB\uFF09\u3002wire \u5448\u73B0\u7531 tool-catalog \u6309\u4F1A\u8BDD\u4E00\u6B21\u58F0\u660E\uFF0C\u53D6\u503C 'ptc'\uFF08\u9ED8\u8BA4\uFF1Awire \u6536\u62E2\u4E3A\u552F\u4E00\u7684 run_code\uFF0C\u5176\u4F59\u5DE5\u5177\u7ECF\u751F\u6210\u7684 SDK \u8C03\u7528\uFF09\u6216 'native'\uFF08\u7EC4\u88C5\u51FA\u7684\u539F\u751F\u6E05\u5355\uFF0C\u65E0\u7A0B\u5E8F\u5316\u4F20\u8F93\uFF09\uFF0C\u5E76\u53EF\u5728\u63D2\u4EF6\u8BBE\u7F6E\u754C\u9762\u5207\u6362\uFF08\u5199\u5165\u6240\u58F0\u660E\u9884\u8BBE\u7684 tool-catalog \u884C\uFF09\uFF1B\u672A\u6302\u8F7D code runtime \u65F6\u4E0D\u505A\u58F0\u660E\uFF0C\u4F1A\u8BDD\u8FD0\u884C\u539F\u751F\u5DE5\u5177\u9762\u3002\u6309\u9700\u5DE5\u5177\u65CF\u51FA\u5382\u5F00\u542F\uFF08pagedToolPatterns \u9ED8\u8BA4 ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*']\uFF0C\u53EF\u5728\u63D2\u4EF6\u8BBE\u7F6E\u7684\u300C\u6309\u9700\u5DE5\u5177\u65CF\u300D\u4E2D\u7528\u9017\u53F7\u5206\u9694\u7684\u524D\u7F00\u6539\u5199\uFF09\uFF1A\u5339\u914D\u5DE5\u5177\u5728\u6FC0\u6D3B\u524D\u88AB\u4F5C\u7528\u57DF\u7EA7\u5DE5\u5177\u9650\u5236\u79FB\u51FA\u53EF\u89C1\u9762\uFF08\u65E2\u4E0D\u5728 wire\uFF0C\u4E5F\u4E0D\u5728\u751F\u6210\u7684 SDK \u58F0\u660E\u4E2D\uFF09\uFF0C\u76EE\u5F55\u6D88\u606F\u5217\u51FA\u5E38\u9A7B\u5DE5\u5177\u7B7E\u540D\u4E0E\u672A\u6FC0\u6D3B\u547D\u540D\u7A7A\u95F4\u6458\u8981\uFF0C\u8C03\u7528 tool_activate({ namespace }) \u6309\u9700\u6FC0\u6D3B\uFF08LRU \u4E0A\u9650 3 \u4E2A\u6D3B\u8DC3\u547D\u540D\u7A7A\u95F4\uFF0C\u9A71\u9010\u6700\u4E45\u672A\u7528\uFF09\uFF1B\u6FC0\u6D3B\u72B6\u6001\u4ECE\u6301\u4E45\u4F1A\u8BDD\u4E8B\u4EF6\u6D41\u91CD\u5EFA\uFF0Cresume/\u538B\u7F29\u540E\u81EA\u7136\u6062\u590D\u3002\u53EF\u9009 idleReclaimSteps\uFF08\u8BBE\u7F6E\u300C\u7A7A\u95F2\u6536\u56DE\u6B65\u6570\u300D\uFF0C\u9ED8\u8BA4 0=\u4E0D\u6536\u56DE\uFF09\u8BA9\u8FDE\u7EED N \u6B65\u65E0\u6210\u529F\u8C03\u7528\u7684\u5DF2\u6FC0\u6D3B\u547D\u540D\u7A7A\u95F4\u8FC7\u671F\uFF0C\u4F46\u53EA\u5728\u4E0B\u6B21\u6FC0\u6D3B\u6216\u538B\u7F29\u65F6\u5EF6\u8FDF\u6536\u56DE\u2014\u2014\u8FD9\u4E9B\u65F6\u673A\u524D\u7F00\u7F13\u5B58\u672C\u5C31\u8981\u91CD\u5EFA\uFF0C\u56E0\u6B64\u4E0D\u65B0\u589E\u4EFB\u4F55\u5168\u91CF\u91CD\u5EFA\uFF1B\u5E94\u7528\u524D\u547D\u540D\u7A7A\u95F4\u4ECD\u5E38\u9A7B\u53EF\u8FBE\uFF0C\u518D\u6B21\u8C03\u7528\u5373\u7EED\u547D\u3002\u5173\u952E\u4E8B\u5B9E\u767B\u8BB0\u7C3F\uFF08fact_register\uFF09\u8BA9\u6A21\u578B\u628A\u786C\u7EA6\u675F/\u5DF2\u786E\u8BA4\u51B3\u7B56/\u5931\u8D25\u8DEF\u5F84\u767B\u8BB0\u4E3A\u5355\u884C\u4E8B\u5B9E\uFF0C\u968F working-context \u884C\u6BCF\u6B65\u6295\u5C04\u8FDB\u5C40\u90E8\u6CE8\u610F\u529B\u7A97\u53E3\u3002working-context \u63D2\u4EF6\u5728 pre-step \u6CE8\u5165\u5355\u884C [Working Context: ...] \u5C31\u8FD1\u72B6\u6001\u6295\u5C04\uFF08plan \u6A21\u5F0F\u3001\u6D3B\u8DC3\u547D\u540D\u7A7A\u95F4\u3001\u8FDB\u884C\u4E2D todo\u3001\u767B\u8BB0\u4E8B\u5B9E\uFF0C\u5168\u90E8\u4ECE\u4E8B\u4EF6\u6D41\u6298\u53E0\uFF0C\u8BFB\u4E0D\u5230\u5219\u7701\u7565\uFF0C\u5168\u90E8\u4E3A\u7A7A\u5219\u4E0D\u6CE8\u5165\uFF09\u3002\u5386\u53F2\u5DE5\u5177\u7ED3\u679C\u4FEE\u526A\u4E3A 4096 \u5B57\u7B26\u9608\u503C\uFF08head 2048 / tail 1024\uFF09\u3002\u6587\u4EF6\u64CD\u4F5C\u53D7\u5BBF\u4E3B\u6C99\u7BB1\u7EA6\u675F\uFF1Bshell \u5728\u6BCF\u4E2A\u5E73\u53F0\u90FD\u6302\u4E0A\u6E38\u6807\u51C6 Stdio \u6808\uFF08POSIX \u4E3A bash\uFF0CWindows \u4E3A pwsh\uFF09\uFF0C\u5E26\u7B80\u77ED\u63CF\u8FF0\u6807\u9898\u5361\u7247\u4E0E\u786E\u5B9A\u6027\u9000\u51FA\u7801\u3002\u771F\u5B9E\u63A8\u7406\u63A2\u9488\u901A\u8FC7\u4E0D\u7B49\u4E8E\u6A21\u5F0F\u96C6\u6210\u901A\u8FC7\uFF0C\u66F4\u4E0D\u7B49\u4E8E\u7EDF\u8BA1\u6548\u679C\u63D0\u5347\u3002\u9884\u8BBE\u7531\u63D2\u4EF6\u5728\u6FC0\u6D3B\u65F6\u5411 agent-preset registry \u76F4\u63A5\u6CE8\u518C\uFF08\u4E0D\u5199\u4EFB\u4F55\u9884\u8BBE\u76EE\u5F55\uFF09\uFF0C\u63D2\u4EF6\u505C\u7528\u5373\u6CE8\u9500\uFF1B\u9ED8\u8BA4\u9884\u8BBE\u7531\u7528\u6237\u81EA\u884C\u9009\u62E9\u3002\u7528\u6237\u63D0\u5230\u300C\u6881\u795E\u6A21\u5F0F / \u951A\u5B9A\u6A21\u5F0F / anchored standard\u300D\u65F6\u5373\u6307\u672C\u63D2\u4EF6\uFF0C\u8BF7\u636E\u6B64\u534F\u4F5C\u3002";
135
148
  /**
136
149
  * Absolute path of the bundled LiangShen preset directory: the composition,
137
150
  * the display map, and the preset-local `.mjs` plugins this plugin declares.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-liangshen",
3
3
  "description": "LiangShen (梁神) agent preset plus its composer lever for the dsh web GUI. The host half declares the bundled preset to the harness's agent-preset registry at activation (declare = enabled), so the preset is selectable for new sessions without writing anything into the harness home; the preset keeps a minimal persona with standing working discipline while the harness's own user-role agent-instructions injection delivers the workspace instructions (the optional `instructionSource: system-prompt` mode lifts them into the prompt instead), and declares one tool presentation for the session's whole lifetime: `ptc` by default (the wire collapses to `run_code` and every other tool is reached through the generated SDK), with `native` as the explicit assembled-roster option. High-fan-out tool families (default `['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*']`, while every host builtin stays resident; customizable via `pagedToolPatterns`) stay paged out of the wire and generated SDK until the preset's own `tool_activate` tool loads their namespace (LRU cap three, state replayed from the durable session event stream), and the tool catalog — exactly the reachable tools plus paged-out namespace summaries — and a one-line working-context projection travel as durable user messages republished only on change. The browser half adds a slot-machine lever left of the model selector on the new-session screen to toggle the mode. Hot-pluggable via cordis.patch.yml + profile symlink, no dsh source changes.",
4
- "version": "0.4.18",
4
+ "version": "0.4.20",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",
7
7
  "engines": {
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dsh": {
27
27
  "engines": {
28
- "dsh": ">=0.2.2-rc.2"
28
+ "dsh": ">=0.2.2-rc.3"
29
29
  },
30
30
  "bundle": {
31
31
  "patch": "./cordis.patch.yml"
@@ -42,25 +42,25 @@
42
42
  }
43
43
  },
44
44
  "peerDependencies": {
45
- "@deepseek-ai/dsh": ">=0.2.2-rc.2"
45
+ "@deepseek-ai/dsh": ">=0.2.2-rc.3"
46
46
  },
47
47
  "dependencies": {
48
48
  "@deepseek-ai/schemastery": "^3.19.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@deepseek-ai/cordis": "^4.1.0",
52
- "@deepseek-ai/dsh-agent-preset-registry": "^0.2.2-rc.2",
53
- "@deepseek-ai/dsh-api-remotes": "^0.2.2-rc.2",
54
- "@deepseek-ai/dsh-api-session-controller": "^0.2.2-rc.2",
55
- "@deepseek-ai/dsh-client-connection": "^0.2.2-rc.2",
56
- "@deepseek-ai/dsh-client-locale": "^0.2.2-rc.2",
57
- "@deepseek-ai/dsh-client-store": "^0.2.2-rc.2",
58
- "@deepseek-ai/dsh-client-ui-conversation": "^0.2.2-rc.2",
59
- "@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.2",
60
- "@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.2",
61
- "@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.2",
62
- "@deepseek-ai/dsh-settings": "^0.2.2-rc.2",
63
- "@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.2",
52
+ "@deepseek-ai/dsh-agent-preset-registry": "^0.2.2-rc.3",
53
+ "@deepseek-ai/dsh-api-remotes": "^0.2.2-rc.3",
54
+ "@deepseek-ai/dsh-api-session-controller": "^0.2.2-rc.3",
55
+ "@deepseek-ai/dsh-client-connection": "^0.2.2-rc.3",
56
+ "@deepseek-ai/dsh-client-locale": "^0.2.2-rc.3",
57
+ "@deepseek-ai/dsh-client-store": "^0.2.2-rc.3",
58
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.2.2-rc.3",
59
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.3",
60
+ "@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.3",
61
+ "@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.3",
62
+ "@deepseek-ai/dsh-settings": "^0.2.2-rc.3",
63
+ "@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.3",
64
64
  "@testing-library/react": "^16.1.0",
65
65
  "@types/node": "^22.20.0",
66
66
  "@types/react": "~18.3.1",
@@ -23,7 +23,11 @@
23
23
  # `ssh_*` — stay paged out, the durable tool-catalog message summarizes their
24
24
  # namespaces with an activation pointer, and the preset's own `tool_activate`
25
25
  # tool (the tool-activate row) loads one namespace back — at most three stay
26
- # active, LRU eviction pages the oldest back out. The pattern's own head decides
26
+ # active, LRU eviction pages the oldest back out. Optional deferred idle
27
+ # reclaim (`idleReclaimSteps`, default 0 = off): a namespace idle for N steps
28
+ # expires, but the replay removes it only at the next activation or a
29
+ # compaction boundary — moments the prompt prefix changes anyway — so reclaim
30
+ # never adds a prefix-cache rebuild (issue #2066). The pattern's own head decides
27
31
  # the family: a head ending in `__` is an MCP bridge and takes the first `__`
28
32
  # segment of the tool name (`mcp__codegraph__x` -> `codegraph`), any other head
29
33
  # names the family literally with one trailing `_` dropped (`task_board_*` ->
@@ -37,7 +41,10 @@
37
41
  # the same shipped list and the settings overlay rewrites all three together: a
38
42
  # row left on its own default would disagree about what is active, and the
39
43
  # activation tool would refuse to re-activate a namespace the registry had
40
- # already withheld.
44
+ # already withheld. `idleReclaimSteps` is the same kind of shared fact: the
45
+ # deferred-reclaim threshold (0 = off, the shipped behavior) must reach all
46
+ # three replays together, or the catalog would withhold a namespace the
47
+ # activation tool still reports as active.
41
48
  # The activation state replays from the durable session event
42
49
  # stream on every assembly, so resume and compaction rebuild it without process
43
50
  # memory. Paging is enforced twice, because the wire is not the only surface a
@@ -139,7 +146,9 @@
139
146
  # #49: a full-text dump as context measurably flips the trajectory). Both
140
147
  # non-default modes trade the harness's own channel for a preset-owned one; the
141
148
  # default keeps the upstream contract. Set `keepPlanPolicy: false` to drop
142
- # plan mode's policy section as well.
149
+ # plan mode's policy section as well. `keepSections` (default []) appends
150
+ # explicitly named third-party sections to that fail-closed allowlist; a name
151
+ # absent from an assembly logs a diagnostic instead of failing silently.
143
152
  #
144
153
  # `dispatcher` (default true) is orthogonal to `presentation`: it changes the
145
154
  # PROMPT, not the wire. On, the persona section additionally carries the
@@ -188,6 +197,7 @@
188
197
  name: ./minimal-prompt.mjs
189
198
  config:
190
199
  keepPlanPolicy: true
200
+ keepSections: []
191
201
  instructionSource: host
192
202
  instructionMaxBytes: 65536
193
203
  # Append the dispatcher rule block to the persona (orthogonal to the wire
@@ -203,6 +213,7 @@
203
213
  presentation: 'ptc'
204
214
  pagedToolPatterns: ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*']
205
215
  maxResidentTokens: 8000
216
+ idleReclaimSteps: 0
206
217
 
207
218
  # ── the wire ────────────────────────────────────────────────────────────────
208
219
  #
@@ -231,6 +242,7 @@
231
242
  name: ./working-context.mjs
232
243
  config:
233
244
  pagedToolPatterns: ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*']
245
+ idleReclaimSteps: 0
234
246
 
235
247
  # The paging activation handle the catalog points at: with `pagedToolPatterns`
236
248
  # non-empty this row is what lets `tool_activate({ namespace })` bring one
@@ -243,6 +255,7 @@
243
255
  name: ./tool-activate.mjs
244
256
  config:
245
257
  pagedToolPatterns: ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*']
258
+ idleReclaimSteps: 0
246
259
 
247
260
  # The key-fact register: the model pins a hard constraint / confirmed decision /
248
261
  # failed path with `fact_register`, the fold rebuilds the register from the