@linxin666/dsh-liangshen 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -399,22 +399,27 @@ function readPresetDefinition(id, dir) {
399
399
  }
400
400
  /** The overlay table: settings field to composition row and config key. */
401
401
  function overrideTargets(overrides) {
402
- return [["tool-catalog", { ...overrides.presentation === void 0 ? {} : { presentation: overrides.presentation } }], ["guard", {
403
- ...overrides.guardEnabled === void 0 ? {} : { enabled: overrides.guardEnabled },
404
- ...overrides.guardSensitivity === void 0 ? {} : { sensitivity: overrides.guardSensitivity },
405
- ...overrides.guardStallReasoningChars === void 0 ? {} : { stallReasoningChars: overrides.guardStallReasoningChars },
406
- ...overrides.guardGlobalStallCap === void 0 ? {} : { globalStallCap: overrides.guardGlobalStallCap },
407
- ...overrides.guardEchoFailures === void 0 ? {} : { echoFailures: overrides.guardEchoFailures }
408
- }]];
402
+ return [
403
+ ["tool-catalog", { ...overrides.presentation === void 0 ? {} : { presentation: overrides.presentation } }],
404
+ ["minimal-prompt", { ...overrides.dispatcher === void 0 ? {} : { dispatcher: overrides.dispatcher } }],
405
+ ["guard", {
406
+ ...overrides.guardEnabled === void 0 ? {} : { enabled: overrides.guardEnabled },
407
+ ...overrides.guardSensitivity === void 0 ? {} : { sensitivity: overrides.guardSensitivity },
408
+ ...overrides.guardStallReasoningChars === void 0 ? {} : { stallReasoningChars: overrides.guardStallReasoningChars },
409
+ ...overrides.guardGlobalStallCap === void 0 ? {} : { globalStallCap: overrides.guardGlobalStallCap },
410
+ ...overrides.guardEchoFailures === void 0 ? {} : { echoFailures: overrides.guardEchoFailures }
411
+ }]
412
+ ];
409
413
  }
410
414
  /**
411
415
  * Apply the settings overlay to one parsed row list.
412
416
  *
413
417
  * Rows are addressed by their `id`, and only a row the composition actually
414
418
  * carries is touched: the overlay narrows the shipped configuration, it never
415
- * invents a mount the preset did not have. The shipped composition declares
416
- * every key the overlay writes, so leaving a key absent only matters for a
417
- * composition that dropped it.
419
+ * invents a mount the preset did not have. A field the settings surface left
420
+ * unset is written as no key at all rather than as a value, which is what keeps
421
+ * the guard's effort-adaptive thresholds the shipped behavior: the overlay only
422
+ * ever adds an override on top of them.
418
423
  * @param rows - the parsed composition rows.
419
424
  * @param overrides - the operator's settings-surface choices.
420
425
  * @returns a new row list with the overlay applied.
@@ -633,28 +638,36 @@ const Config = z.object({
633
638
  enabled: z.boolean().default(true).volatile(),
634
639
  announceToAgent: z.boolean().default(false).volatile(),
635
640
  presentation: z.union([...PRESENTATION_OPTIONS]).default("both").volatile(),
641
+ dispatcher: z.boolean().default(true).volatile(),
636
642
  guardEnabled: z.boolean().default(true).volatile(),
637
643
  guardSensitivity: z.union([...SENSITIVITY_OPTIONS]).default("balanced").volatile(),
638
- guardStallReasoningChars: z.number().default(8e3).volatile(),
639
- guardGlobalStallCap: z.number().default(4).volatile(),
640
- guardEchoFailures: z.number().default(3).volatile()
644
+ guardStallReasoningChars: z.number().volatile(),
645
+ guardGlobalStallCap: z.number().volatile(),
646
+ guardEchoFailures: z.number().volatile()
641
647
  });
642
- /** Schema defaults, re-read for hand-built test contexts. */
648
+ /**
649
+ * Schema defaults, re-read for hand-built test contexts. The three guard
650
+ * fine-tuning fields default to undefined — "unset" IS the shipped default,
651
+ * and the guard resolves the effective thresholds per request from the
652
+ * session's reasoning effort and the sensitivity preset.
653
+ */
643
654
  const DEFAULT_CONFIG = {
644
655
  enabled: true,
645
656
  announceToAgent: false,
646
657
  presentation: "both",
658
+ dispatcher: true,
647
659
  guardEnabled: true,
648
660
  guardSensitivity: "balanced",
649
- guardStallReasoningChars: 8e3,
650
- guardGlobalStallCap: 4,
651
- guardEchoFailures: 3
661
+ guardStallReasoningChars: void 0,
662
+ guardGlobalStallCap: void 0,
663
+ guardEchoFailures: void 0
652
664
  };
653
665
  /**
654
666
  * Read one activation field. The Host validates the raw profile config and
655
667
  * hands volatile fields over as references, so a read goes through `get()`; a
656
668
  * plain value passes through, and an absent field falls back to the schema
657
- * default.
669
+ * default — which is `undefined` for the three guard fine-tuning overrides,
670
+ * so "unset" survives as a real value instead of collapsing into a constant.
658
671
  */
659
672
  function readField(field, fallback) {
660
673
  if (field === void 0 || field === null) return fallback;
@@ -672,6 +685,7 @@ function resolveConfig(config) {
672
685
  enabled: readField(config?.enabled, DEFAULT_CONFIG.enabled),
673
686
  announceToAgent: readField(config?.announceToAgent, DEFAULT_CONFIG.announceToAgent),
674
687
  presentation: readField(config?.presentation, DEFAULT_CONFIG.presentation),
688
+ dispatcher: readField(config?.dispatcher, DEFAULT_CONFIG.dispatcher),
675
689
  guardEnabled: readField(config?.guardEnabled, DEFAULT_CONFIG.guardEnabled),
676
690
  guardSensitivity: readField(config?.guardSensitivity, DEFAULT_CONFIG.guardSensitivity),
677
691
  guardStallReasoningChars: readField(config?.guardStallReasoningChars, DEFAULT_CONFIG.guardStallReasoningChars),
@@ -680,7 +694,7 @@ function resolveConfig(config) {
680
694
  };
681
695
  }
682
696
  /** Model-facing announcement: plugin presence, principle, and limits. */
683
- 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 按会话一次声明,取值 'both'(默认:原生清单与 run_code 同驻,原生直调优先、run_code 用于程序化批处理与并发扇出)、'native'(组装出的原生清单)或 'ptc'(wire 收拢为唯一的 run_code),并可在插件设置界面切换(写入所声明预设的 tool-catalog 行);未挂载 code runtime 时不做声明,会话运行原生工具面。温和工具分页出厂开启(pagedToolPatterns 默认 ['mcp__*']):匹配工具在激活前被作用域级工具限制移出可见面(既不在 wire,也不在生成的 SDK 声明中),目录消息列出常驻工具签名与未激活命名空间摘要,调用 tool_activate({ namespace }) 按需激活(LRU 上限 3 个活跃命名空间,驱逐最久未用);激活状态从持久会话事件流重建,resume/压缩后自然恢复。运行时退化熔断器(guard)从事件流折叠停摆(连续零产出长思考)与空转(同参重复失败)信号,每 episode 触发一次:注入熔断消息并把推理档位临时下调一档(max→high→low,窗口 3 个请求);无信号时从不改写请求。关键事实登记簿(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」时即指本插件,请据此协作。";
697
+ 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 按会话一次声明,取值 'both'(默认:原生清单与 run_code 同驻,原生直调优先、run_code 用于程序化批处理与并发扇出)、'native'(组装出的原生清单)或 'ptc'(wire 收拢为唯一的 run_code),并可在插件设置界面切换(写入所声明预设的 tool-catalog 行);未挂载 code runtime 时不做声明,会话运行原生工具面。温和工具分页出厂开启(pagedToolPatterns 默认 ['mcp__*']):匹配工具在激活前被作用域级工具限制移出可见面(既不在 wire,也不在生成的 SDK 声明中),目录消息列出常驻工具签名与未激活命名空间摘要,调用 tool_activate({ namespace }) 按需激活(LRU 上限 3 个活跃命名空间,驱逐最久未用);激活状态从持久会话事件流重建,resume/压缩后自然恢复。运行时退化熔断器(guard)从事件流折叠停摆(连续零产出长思考)与空转(同参重复失败)信号,每 episode 触发一次:注入熔断消息;仅停摆信号(成因是推理预算过剩)额外把推理档位临时下调一档(max→high,窗口 3 个请求,high 档本身处于甜区不动),空转信号只注入消息。阈值随会话推理档位自适应(max 8000 / high 12000 / low 20000 字符)并再按灵敏度预设缩放;provider 不持久化推理文本的会话降级为连续零产出步骤计数。无信号时从不改写请求。关键事实登记簿(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」时即指本插件,请据此协作。";
684
698
  /** Order of the announcement section within the tool-guidance band. */
685
699
  const SECTION_ORDER = 150;
686
700
  /**
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Card mark for the LiangShen settings entry: the mode's machine is a
3
+ * slot-machine lever, so the mark is that lever reduced to one knob, one arm
4
+ * and one pivot foot. Three rounded shapes with no interior detail stay
5
+ * legible at 18px, and every shape is painted with `currentColor` so the mark
6
+ * follows the surrounding theme like the lever itself does.
7
+ */
8
+ import type { ReactElement } from 'react';
9
+ /**
10
+ * Render the LiangShen card mark.
11
+ * @returns the 18x18 lever mark, in the current text color.
12
+ */
13
+ export declare function LiangShenMark(): ReactElement;
@@ -1,12 +1,13 @@
1
1
  /**
2
- * LiangShen settings card: availability and the wire presentation. Registers
3
- * into the `web-ui.plugin.item` child slot the Web UI plugin group renders,
4
- * bound to the `liangshen` settings namespace (the Host profile entry id).
2
+ * LiangShen settings card: availability, the wire presentation, and the
3
+ * dispatcher identity. Registers into the `web-ui.plugin.item` child slot the
4
+ * Web UI plugin group renders, bound to the `liangshen` settings namespace
5
+ * (the Host profile entry id).
5
6
  *
6
- * The presentation field does not act on this client half: the Host applies it
7
- * to the preset it declares to the agent-preset registry, so a session reads it
8
- * from its preset. This card is the operator's only handle on it, which is why
9
- * every field the Host schema carries appears here.
7
+ * No field acts on this client half: the Host applies the presentation and the
8
+ * dispatcher switch to the preset it declares to the agent-preset registry, so
9
+ * a session reads both from its preset. The card is the operator's only handle
10
+ * on them, which is why every field the Host schema carries appears here.
10
11
  */
11
12
  import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
12
13
  import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
@@ -24,6 +25,8 @@ export interface LiangShenSettings {
24
25
  announceToAgent?: boolean;
25
26
  /** Wire presentation the Host applies to the preset's tool-catalog row. */
26
27
  presentation?: string;
28
+ /** Whether the preset appends the dispatcher rules section after the persona. */
29
+ dispatcher?: boolean;
27
30
  /** Master switch for the runtime degeneration circuit breaker. */
28
31
  guardEnabled?: boolean;
29
32
  /** Sensitivity preset scaling the breaker's adaptive thresholds. */
@@ -40,6 +43,7 @@ export interface LiangShenSettingsCardState extends CardShell {
40
43
  enabled: CardFieldState;
41
44
  announceToAgent: CardFieldState;
42
45
  presentation: CardFieldState;
46
+ dispatcher: CardFieldState;
43
47
  guardEnabled: CardFieldState;
44
48
  guardSensitivity: CardFieldState;
45
49
  guardStallReasoningChars: CardFieldState;
@@ -24,6 +24,13 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
24
24
  descriptionKey: TKey;
25
25
  /** Optional rich header description rendered instead of the plain t(descriptionKey) text (the plain text stays as the tooltip). */
26
26
  descriptionNode?: ReactNode;
27
+ /**
28
+ * Optional leading mark identifying the plugin. A card without one keeps the
29
+ * plain official header shape, so the chrome stays a readable sibling of the
30
+ * built-in PluginCard wherever a family plugin lands in the official bundle
31
+ * seat.
32
+ */
33
+ icon?: ReactNode;
27
34
  /** The card's form state: availability, writability, and what a save would do. */
28
35
  state: CardShell;
29
36
  /** Write every staged edit. */
@@ -28,6 +28,8 @@ export declare const zh: {
28
28
  'settings.announceToAgentHint': string;
29
29
  'settings.presentation': string;
30
30
  'settings.presentationHint': string;
31
+ 'settings.dispatcher': string;
32
+ 'settings.dispatcherHint': string;
31
33
  'settings.on': string;
32
34
  'settings.off': string;
33
35
  'settings.inherit': string;
@@ -59,6 +61,7 @@ export declare const zh: {
59
61
  'sensitivity.aggressive': string;
60
62
  'settings.guardEchoFailures': string;
61
63
  'settings.guardEchoFailuresHint': string;
64
+ 'settings.guardAdaptive': string;
62
65
  };
63
66
  /** English counterpart; the key set mirrors {@link zh} exactly. */
64
67
  export declare const en: Record<keyof typeof zh, string>;
@@ -78,6 +78,11 @@ export interface PluginCardSeat {
78
78
  label?: () => string;
79
79
  /** Locale namespace the card renders with. */
80
80
  locale: string;
81
+ /**
82
+ * Child slots this card declares and renders. Forwarded to whichever seat
83
+ * the host renders; absent for a card that declares none.
84
+ */
85
+ children?: Record<string, unknown>;
81
86
  /** Business-face factory of the registration. */
82
87
  inject?: () => object;
83
88
  /**
@@ -134,6 +134,8 @@ export declare class CardForm<T> {
134
134
  private readonly disposeForm;
135
135
  private disposed;
136
136
  private saving;
137
+ /** A save asked for while one was in flight; it runs once the first settles (#1754). */
138
+ private saveQueued;
137
139
  private failed;
138
140
  private failedReason;
139
141
  /** @param scope - the bound configuration form for this card's namespace. */
@@ -167,6 +169,20 @@ export declare class CardForm<T> {
167
169
  * the user can correct them instead of retyping.
168
170
  * @returns settlement after the mutation and the read-back.
169
171
  */
172
+ /**
173
+ * Run one save, and re-run it once if another was asked for while this one
174
+ * was still in flight.
175
+ *
176
+ * A save is a Host round trip that also drives the profile reconcile, and
177
+ * the Host runs that write inside one exclusive transaction. Answering a
178
+ * press that arrives mid-flight by returning immediately dropped the edit
179
+ * with no explanation, which is the "the save button stops working after a
180
+ * few rounds" report (#1754). Serializing instead means a save pressed while
181
+ * another is still settling runs against the settled state - which is what
182
+ * the operator meant by pressing it again.
183
+ * @returns settlement after the mutation and the read-back.
184
+ */
185
+ requestSave(): Promise<void>;
170
186
  save(): Promise<void>;
171
187
  /**
172
188
  * Every staged edit a save would write. An entry whose draft is not a value
@@ -84,31 +84,35 @@ export declare function readPresetDefinition(id: string, dir: string): PresetDef
84
84
  *
85
85
  * The settings surface edits the PLUGIN's own Config, while the values that
86
86
  * shape a session live in the declared preset's rows; applying them here is what
87
- * connects the two. Every field is optional — an absent value leaves the shipped
88
- * row exactly as the composition declares it.
87
+ * connects the two. Every field is optional, and an absent OR `undefined` value
88
+ * writes nothing at all — the key stays out of the row and the guard's own
89
+ * adaptive resolution decides the effective threshold.
89
90
  */
90
91
  export interface PresetOverrides {
91
92
  /** The `tool-catalog` row's `presentation` value. */
92
93
  presentation?: string;
94
+ /** The `minimal-prompt` row's `dispatcher` switch. */
95
+ dispatcher?: boolean;
93
96
  /** The `guard` row's `enabled` switch. */
94
97
  guardEnabled?: boolean;
95
98
  /** The `guard` row's sensitivity preset. */
96
99
  guardSensitivity?: string;
97
- /** The `guard` row's per-step reasoning-character floor. */
98
- guardStallReasoningChars?: number;
99
- /** The `guard` row's slow-burn step cap. */
100
- guardGlobalStallCap?: number;
101
- /** The `guard` row's identical-argument failure count. */
102
- guardEchoFailures?: number;
100
+ /** The `guard` row's per-step reasoning-character floor override. */
101
+ guardStallReasoningChars?: number | undefined;
102
+ /** The `guard` row's slow-burn step cap override. */
103
+ guardGlobalStallCap?: number | undefined;
104
+ /** The `guard` row's identical-argument failure count override. */
105
+ guardEchoFailures?: number | undefined;
103
106
  }
104
107
  /**
105
108
  * Apply the settings overlay to one parsed row list.
106
109
  *
107
110
  * Rows are addressed by their `id`, and only a row the composition actually
108
111
  * carries is touched: the overlay narrows the shipped configuration, it never
109
- * invents a mount the preset did not have. The shipped composition declares
110
- * every key the overlay writes, so leaving a key absent only matters for a
111
- * composition that dropped it.
112
+ * invents a mount the preset did not have. A field the settings surface left
113
+ * unset is written as no key at all rather than as a value, which is what keeps
114
+ * the guard's effort-adaptive thresholds the shipped behavior: the overlay only
115
+ * ever adds an override on top of them.
112
116
  * @param rows - the parsed composition rows.
113
117
  * @param overrides - the operator's settings-surface choices.
114
118
  * @returns a new row list with the overlay applied.
@@ -82,6 +82,15 @@ export interface Config {
82
82
  * the transport.
83
83
  */
84
84
  presentation?: ConfigField<Presentation>;
85
+ /**
86
+ * When true, the preset appends the dispatcher rule block to its persona:
87
+ * the session becomes a dispatch agent whose deliverable is the plan, the
88
+ * task book, the review verdict, and the hand-off, on top of the mode's own
89
+ * working discipline. Orthogonal to `presentation` — the tool wire is the
90
+ * same either way. Default true: the shipped preset runs as a dispatcher,
91
+ * and the switch is what returns a session to the bare persona.
92
+ */
93
+ dispatcher?: ConfigField<boolean>;
85
94
  /** Master switch for the runtime degeneration circuit breaker (default true). */
86
95
  guardEnabled?: ConfigField<boolean>;
87
96
  /**
@@ -90,36 +99,42 @@ export interface Config {
90
99
  */
91
100
  guardSensitivity?: ConfigField<GuardSensitivity>;
92
101
  /**
93
- * Reasoning characters one zero-output step must reach for the per-step
94
- * ladder to fire (default 8000, calibrated against V4.1's 384K max output).
102
+ * Override for the per-step runaway-reasoning character floor. Left unset,
103
+ * the floor adapts to the session's reasoning effort and is then scaled by
104
+ * `guardSensitivity`; setting it wins over both for every effort level.
105
+ */
106
+ guardStallReasoningChars?: ConfigField<number | undefined>;
107
+ /**
108
+ * Override for the slow-burn step count. Left unset, the cap scales with
109
+ * `guardSensitivity`.
95
110
  */
96
- guardStallReasoningChars?: ConfigField<number>;
111
+ guardGlobalStallCap?: ConfigField<number | undefined>;
97
112
  /**
98
- * Consecutive output-free reasoning steps that trip the slow-burn ladder
99
- * (default 4).
113
+ * Override for the echo ladder. Left unset, the count scales with
114
+ * `guardSensitivity`.
100
115
  */
101
- guardGlobalStallCap?: ConfigField<number>;
102
- /** Identical-argument tool failures in a row that trip the echo ladder (default 3). */
103
- guardEchoFailures?: ConfigField<number>;
116
+ guardEchoFailures?: ConfigField<number | undefined>;
104
117
  }
105
118
  export declare const Config: z<Schemastery.ObjectS<NoInfer<{
106
119
  enabled: z<boolean, boolean, "volatile-defined">;
107
120
  announceToAgent: z<boolean, boolean, "volatile-defined">;
108
121
  presentation: z<"ptc" | "native" | "both", "ptc" | "native" | "both", "volatile-defined">;
122
+ dispatcher: z<boolean, boolean, "volatile-defined">;
109
123
  guardEnabled: z<boolean, boolean, "volatile-defined">;
110
124
  guardSensitivity: z<"conservative" | "balanced" | "aggressive", "conservative" | "balanced" | "aggressive", "volatile-defined">;
111
- guardStallReasoningChars: z<number, number, "volatile-defined">;
112
- guardGlobalStallCap: z<number, number, "volatile-defined">;
113
- guardEchoFailures: z<number, number, "volatile-defined">;
125
+ guardStallReasoningChars: z<number, number, "volatile">;
126
+ guardGlobalStallCap: z<number, number, "volatile">;
127
+ guardEchoFailures: z<number, number, "volatile">;
114
128
  }>>, Schemastery.ObjectT<NoInfer<{
115
129
  enabled: z<boolean, boolean, "volatile-defined">;
116
130
  announceToAgent: z<boolean, boolean, "volatile-defined">;
117
131
  presentation: z<"ptc" | "native" | "both", "ptc" | "native" | "both", "volatile-defined">;
132
+ dispatcher: z<boolean, boolean, "volatile-defined">;
118
133
  guardEnabled: z<boolean, boolean, "volatile-defined">;
119
134
  guardSensitivity: z<"conservative" | "balanced" | "aggressive", "conservative" | "balanced" | "aggressive", "volatile-defined">;
120
- guardStallReasoningChars: z<number, number, "volatile-defined">;
121
- guardGlobalStallCap: z<number, number, "volatile-defined">;
122
- guardEchoFailures: z<number, number, "volatile-defined">;
135
+ guardStallReasoningChars: z<number, number, "volatile">;
136
+ guardGlobalStallCap: z<number, number, "volatile">;
137
+ guardEchoFailures: z<number, number, "volatile">;
123
138
  }>>, "plain">;
124
139
  /** The settings the runtime acts on, every field read at its use site. */
125
140
  export interface ResolvedConfig {
@@ -129,18 +144,25 @@ export interface ResolvedConfig {
129
144
  announceToAgent: boolean;
130
145
  /** Wire presentation the declared preset's tool-catalog row carries. */
131
146
  presentation: Presentation;
147
+ /** Whether the declared preset's minimal-prompt row appends the dispatcher rule block. */
148
+ dispatcher: boolean;
132
149
  /** Breaker master switch written into the declared preset's guard row. */
133
150
  guardEnabled: boolean;
134
151
  /** Breaker sensitivity written into the declared preset's guard row. */
135
152
  guardSensitivity: GuardSensitivity;
136
- /** Per-step reasoning-character floor written into the guard row. */
137
- guardStallReasoningChars: number;
138
- /** Slow-burn step cap written into the guard row. */
139
- guardGlobalStallCap: number;
140
- /** Echo-ladder failure count written into the guard row. */
141
- guardEchoFailures: number;
153
+ /** Per-step reasoning-character floor written into the guard row, or undefined to leave the adaptive table in charge. */
154
+ guardStallReasoningChars: number | undefined;
155
+ /** Slow-burn step cap written into the guard row, or undefined to leave the sensitivity preset in charge. */
156
+ guardGlobalStallCap: number | undefined;
157
+ /** Echo-ladder failure count written into the guard row, or undefined to leave the sensitivity preset in charge. */
158
+ guardEchoFailures: number | undefined;
142
159
  }
143
- /** Schema defaults, re-read for hand-built test contexts. */
160
+ /**
161
+ * Schema defaults, re-read for hand-built test contexts. The three guard
162
+ * fine-tuning fields default to undefined — "unset" IS the shipped default,
163
+ * and the guard resolves the effective thresholds per request from the
164
+ * session's reasoning effort and the sensitivity preset.
165
+ */
144
166
  export declare const DEFAULT_CONFIG: ResolvedConfig;
145
167
  /**
146
168
  * Read the effective settings of this activation.
@@ -149,7 +171,7 @@ export declare const DEFAULT_CONFIG: ResolvedConfig;
149
171
  */
150
172
  export declare function resolveConfig(config?: Config): ResolvedConfig;
151
173
  /** Model-facing announcement: plugin presence, principle, and limits. */
152
- 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 'both'\uFF08\u9ED8\u8BA4\uFF1A\u539F\u751F\u6E05\u5355\u4E0E run_code \u540C\u9A7B\uFF0C\u539F\u751F\u76F4\u8C03\u4F18\u5148\u3001run_code \u7528\u4E8E\u7A0B\u5E8F\u5316\u6279\u5904\u7406\u4E0E\u5E76\u53D1\u6247\u51FA\uFF09\u3001'native'\uFF08\u7EC4\u88C5\u51FA\u7684\u539F\u751F\u6E05\u5355\uFF09\u6216 'ptc'\uFF08wire \u6536\u62E2\u4E3A\u552F\u4E00\u7684 run_code\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\u6E29\u548C\u5DE5\u5177\u5206\u9875\u51FA\u5382\u5F00\u542F\uFF08pagedToolPatterns \u9ED8\u8BA4 ['mcp__*']\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\u8FD0\u884C\u65F6\u9000\u5316\u7194\u65AD\u5668\uFF08guard\uFF09\u4ECE\u4E8B\u4EF6\u6D41\u6298\u53E0\u505C\u6446\uFF08\u8FDE\u7EED\u96F6\u4EA7\u51FA\u957F\u601D\u8003\uFF09\u4E0E\u7A7A\u8F6C\uFF08\u540C\u53C2\u91CD\u590D\u5931\u8D25\uFF09\u4FE1\u53F7\uFF0C\u6BCF episode \u89E6\u53D1\u4E00\u6B21\uFF1A\u6CE8\u5165\u7194\u65AD\u6D88\u606F\u5E76\u628A\u63A8\u7406\u6863\u4F4D\u4E34\u65F6\u4E0B\u8C03\u4E00\u6863\uFF08max\u2192high\u2192low\uFF0C\u7A97\u53E3 3 \u4E2A\u8BF7\u6C42\uFF09\uFF1B\u65E0\u4FE1\u53F7\u65F6\u4ECE\u4E0D\u6539\u5199\u8BF7\u6C42\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";
174
+ 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 'both'\uFF08\u9ED8\u8BA4\uFF1A\u539F\u751F\u6E05\u5355\u4E0E run_code \u540C\u9A7B\uFF0C\u539F\u751F\u76F4\u8C03\u4F18\u5148\u3001run_code \u7528\u4E8E\u7A0B\u5E8F\u5316\u6279\u5904\u7406\u4E0E\u5E76\u53D1\u6247\u51FA\uFF09\u3001'native'\uFF08\u7EC4\u88C5\u51FA\u7684\u539F\u751F\u6E05\u5355\uFF09\u6216 'ptc'\uFF08wire \u6536\u62E2\u4E3A\u552F\u4E00\u7684 run_code\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\u6E29\u548C\u5DE5\u5177\u5206\u9875\u51FA\u5382\u5F00\u542F\uFF08pagedToolPatterns \u9ED8\u8BA4 ['mcp__*']\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\u8FD0\u884C\u65F6\u9000\u5316\u7194\u65AD\u5668\uFF08guard\uFF09\u4ECE\u4E8B\u4EF6\u6D41\u6298\u53E0\u505C\u6446\uFF08\u8FDE\u7EED\u96F6\u4EA7\u51FA\u957F\u601D\u8003\uFF09\u4E0E\u7A7A\u8F6C\uFF08\u540C\u53C2\u91CD\u590D\u5931\u8D25\uFF09\u4FE1\u53F7\uFF0C\u6BCF episode \u89E6\u53D1\u4E00\u6B21\uFF1A\u6CE8\u5165\u7194\u65AD\u6D88\u606F\uFF1B\u4EC5\u505C\u6446\u4FE1\u53F7\uFF08\u6210\u56E0\u662F\u63A8\u7406\u9884\u7B97\u8FC7\u5269\uFF09\u989D\u5916\u628A\u63A8\u7406\u6863\u4F4D\u4E34\u65F6\u4E0B\u8C03\u4E00\u6863\uFF08max\u2192high\uFF0C\u7A97\u53E3 3 \u4E2A\u8BF7\u6C42\uFF0Chigh \u6863\u672C\u8EAB\u5904\u4E8E\u751C\u533A\u4E0D\u52A8\uFF09\uFF0C\u7A7A\u8F6C\u4FE1\u53F7\u53EA\u6CE8\u5165\u6D88\u606F\u3002\u9608\u503C\u968F\u4F1A\u8BDD\u63A8\u7406\u6863\u4F4D\u81EA\u9002\u5E94\uFF08max 8000 / high 12000 / low 20000 \u5B57\u7B26\uFF09\u5E76\u518D\u6309\u7075\u654F\u5EA6\u9884\u8BBE\u7F29\u653E\uFF1Bprovider \u4E0D\u6301\u4E45\u5316\u63A8\u7406\u6587\u672C\u7684\u4F1A\u8BDD\u964D\u7EA7\u4E3A\u8FDE\u7EED\u96F6\u4EA7\u51FA\u6B65\u9AA4\u8BA1\u6570\u3002\u65E0\u4FE1\u53F7\u65F6\u4ECE\u4E0D\u6539\u5199\u8BF7\u6C42\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";
153
175
  /**
154
176
  * Absolute path of the bundled LiangShen preset directory: the composition,
155
177
  * 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 (default `presentation: 'both'`, where the wire collapses to the `run_code` transport and every other tool is reached through the generated SDK; `native` keeps the assembled roster, `ptc` keeps only the transport). High-fan-out tool families (default `mcp__*`) stay paged out of the wire 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 on-wire 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.4",
4
+ "version": "0.4.6",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",
7
7
  "engines": {
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dsh": {
25
25
  "engines": {
26
- "dsh": ">=0.2.0-rc.1"
26
+ "dsh": ">=0.2.0-rc.2"
27
27
  },
28
28
  "bundle": {
29
29
  "patch": "./cordis.patch.yml"
@@ -40,25 +40,25 @@
40
40
  }
41
41
  },
42
42
  "peerDependencies": {
43
- "@deepseek-ai/dsh": ">=0.2.0-rc.1"
43
+ "@deepseek-ai/dsh": ">=0.2.0-rc.2"
44
44
  },
45
45
  "dependencies": {
46
46
  "@deepseek-ai/schemastery": "^3.18.4"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@deepseek-ai/cordis": "^4.0.4",
50
- "@deepseek-ai/dsh-agent-preset-registry": "^0.2.0-rc.1",
51
- "@deepseek-ai/dsh-api-remotes": "^0.2.0-rc.1",
52
- "@deepseek-ai/dsh-api-session-controller": "^0.2.0-rc.1",
53
- "@deepseek-ai/dsh-client-connection": "^0.2.0-rc.1",
54
- "@deepseek-ai/dsh-client-locale": "^0.2.0-rc.1",
55
- "@deepseek-ai/dsh-client-store": "^0.2.0-rc.1",
56
- "@deepseek-ai/dsh-client-ui-conversation": "^0.2.0-rc.1",
57
- "@deepseek-ai/dsh-client-ui-renderer": "^0.2.0-rc.1",
58
- "@deepseek-ai/dsh-client-ui-settings": "^0.2.0-rc.1",
59
- "@deepseek-ai/dsh-client-ui-slots": "^0.2.0-rc.1",
60
- "@deepseek-ai/dsh-settings": "^0.2.0-rc.1",
61
- "@deepseek-ai/dsh-system-prompt": "^0.2.0-rc.1",
50
+ "@deepseek-ai/dsh-agent-preset-registry": "^0.2.0-rc.2",
51
+ "@deepseek-ai/dsh-api-remotes": "^0.2.0-rc.2",
52
+ "@deepseek-ai/dsh-api-session-controller": "^0.2.0-rc.2",
53
+ "@deepseek-ai/dsh-client-connection": "^0.2.0-rc.2",
54
+ "@deepseek-ai/dsh-client-locale": "^0.2.0-rc.2",
55
+ "@deepseek-ai/dsh-client-store": "^0.2.0-rc.2",
56
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.2.0-rc.2",
57
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.2.0-rc.2",
58
+ "@deepseek-ai/dsh-client-ui-settings": "^0.2.0-rc.2",
59
+ "@deepseek-ai/dsh-client-ui-slots": "^0.2.0-rc.2",
60
+ "@deepseek-ai/dsh-settings": "^0.2.0-rc.2",
61
+ "@deepseek-ai/dsh-system-prompt": "^0.2.0-rc.2",
62
62
  "@testing-library/react": "^16.1.0",
63
63
  "@types/node": "^22.20.0",
64
64
  "@types/react": "~18.3.1",
@@ -91,7 +91,7 @@
91
91
  "url": "https://github.com/zhu1090093659/dsh-web.git"
92
92
  },
93
93
  "scripts": {
94
- "build": "tsc -p tsconfig.build.json && tsdown",
94
+ "build": "tsc -b tsconfig.build.json && tsdown",
95
95
  "bundle": "tsdown",
96
96
  "watch": "tsdown --watch",
97
97
  "typecheck": "tsc --noEmit",
@@ -121,6 +121,14 @@
121
121
  # default keeps the upstream contract. Set `keepPlanPolicy: false` to drop
122
122
  # plan mode's policy section as well.
123
123
  #
124
+ # `dispatcher` (default false) is orthogonal to `presentation`: it changes the
125
+ # PROMPT, not the wire. On, the persona section additionally carries the
126
+ # dispatcher rule block (./dispatcher-rules.mjs) after the workspace line, so
127
+ # the session's deliverable becomes the plan, the task book, the review verdict,
128
+ # and the hand-off, and the mode's own discipline stays in force underneath
129
+ # those rules. Off, the assembled prompt is byte-for-byte what it was before
130
+ # the switch existed.
131
+ #
124
132
  # `tool-catalog` owns the wire presentation and the model-visible catalog.
125
133
  # `presentation` selects the SDK ToolPresentationMode for the session's whole
126
134
  # lifetime: `'ptc'` (default) collapses the wire to the `run_code` transport
@@ -160,6 +168,11 @@
160
168
  keepPlanPolicy: true
161
169
  instructionSource: host
162
170
  instructionMaxBytes: 65536
171
+ # Append the dispatcher rule block to the persona (orthogonal to the wire
172
+ # presentation): the session dispatches, plans, reviews, and hands off
173
+ # instead of writing the code itself. On by default; the switch is what
174
+ # returns a session to the bare persona.
175
+ dispatcher: true
163
176
 
164
177
  - id: tool-catalog
165
178
  name: ./tool-catalog.mjs
@@ -174,21 +187,24 @@
174
187
 
175
188
  # The runtime degeneration circuit breaker: folds a stall (consecutive zero-
176
189
  # output long-reasoning steps) or echo (identical-argument tool failures)
177
- # signal from the durable session event stream and fires once per episode —
178
- # injecting a breaker message at pre-step and stepping the reasoning effort
179
- # one notch down for the next few requests. With no signal it never rewrites
190
+ # signal from the durable session event stream and fires once per episode,
191
+ # injecting a breaker message at pre-step. A STALL also steps the reasoning
192
+ # effort one notch down (max -> high, never below the sweet spot) for the next
193
+ # few requests; an echo only gets the message. With no signal it never rewrites
180
194
  # a request, so the route's explicit effort and the prefix cache stay
181
195
  # untouched. This is the outside force the persona's reflection fuse cannot
182
196
  # be: see DSH discussion #5976 and the Agent Note that constrains dynamic
183
197
  # reasoning effort to this triggered-only form.
198
+ #
199
+ # The character floor and the two caps are deliberately NOT set here: absent,
200
+ # the guard resolves them per request from the session's reasoning effort
201
+ # (8000 at max / 12000 at high / 20000 at low) and scales them by the
202
+ # sensitivity preset. Setting one here would pin it for every effort level.
184
203
  - id: guard
185
204
  name: ./guard.mjs
186
205
  config:
187
206
  enabled: true
188
207
  sensitivity: 'balanced'
189
- stallReasoningChars: 8000
190
- globalStallCap: 4
191
- echoFailures: 3
192
208
 
193
209
  # The paging activation handle the catalog points at: with `pagedToolPatterns`
194
210
  # non-empty this row is what lets `tool_activate({ namespace })` bring one
@@ -377,11 +393,30 @@
377
393
  - id: tool-subagent-list-agents
378
394
  name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
379
395
 
396
+ # `modelSelectionSettings: true` opts this row into the child-model
397
+ # selection the Web settings page owns per Session: the tool then
398
+ # publishes `provider` / `model` / `reasoning_effort` parameters and the
399
+ # `list_subagent_models` discovery tool, and an explicit route is
400
+ # checked against the Session's allowed list. Without it the settings
401
+ # toggle reads as dead under this preset and an explicit selection
402
+ # fails with `child model selection is disabled for this tool instance`.
403
+ #
404
+ # EXACTLY ONE delegation row per composition scope may opt in. The
405
+ # opt-in registers the discovery tool under the FIXED name
406
+ # `list_subagent_models` in the scope the row composes into, and the tool
407
+ # registry refuses a second registration of one name in one scope, so a
408
+ # second opt-in row fails the whole session with `tool
409
+ # 'list_subagent_models' is already registered in this scope`. The fork
410
+ # row below therefore stays without it, exactly as the builtin Standard,
411
+ # PTC, and Cordis presets ship: their `tool-subagent` row opts in and
412
+ # their `tool-subagent-fork` row does not. Do not complete the
413
+ # fork row to match; the opt-in belongs to the spawn row alone.
380
414
  - id: tool-subagent
381
415
  name: '@deepseek-ai/dsh-tool-subagent'
382
416
  config:
383
417
  provider: spawn
384
418
  toolName: subagent
419
+ modelSelectionSettings: true
385
420
  backgroundMode: continuable
386
421
 
387
422
  - id: tool-subagent-fork