@linxin666/dsh-liangshen 0.4.6 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +16 -22
- package/README.zh.md +16 -22
- package/lib/client.js +28 -228
- package/lib/client.js.map +1 -1
- package/lib/index.js +19 -61
- package/lib/types/client/LiangShenSettingsCard.d.ts +1 -18
- package/lib/types/client/PluginSettingsCard.d.ts +39 -0
- package/lib/types/client/locales.d.ts +0 -15
- package/lib/types/composition.d.ts +3 -15
- package/lib/types/index.d.ts +14 -66
- package/package.json +19 -19
- package/presets/liangshen/agent.cordis.yml +17 -40
- package/presets/liangshen/dispatcher-rules.mjs +175 -106
- package/presets/liangshen/minimal-prompt.mjs +17 -10
- package/presets/liangshen/tool-catalog.mjs +159 -82
- package/src/announce.test.ts +7 -14
- package/src/client/LiangShenSettingsCard.tsx +3 -85
- package/src/client/PluginSettingsCard.tsx +63 -3
- package/src/client/locales.ts +2 -32
- package/src/client/settings-card.module.css +70 -1
- package/src/client/settings-entry-form.ts +0 -1
- package/src/composition.test.ts +6 -45
- package/src/composition.ts +3 -22
- package/src/index.test.ts +6 -37
- package/src/index.ts +20 -80
- package/tools/benchmark-live-run.mjs +12 -17
- package/tools/benchmark-report.mjs +4 -6
- package/presets/liangshen/guard.mjs +0 -526
package/lib/index.js
CHANGED
|
@@ -399,17 +399,7 @@ 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 [
|
|
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
|
-
];
|
|
402
|
+
return [["tool-catalog", { ...overrides.presentation === void 0 ? {} : { presentation: overrides.presentation } }], ["minimal-prompt", { ...overrides.dispatcher === void 0 ? {} : { dispatcher: overrides.dispatcher } }]];
|
|
413
403
|
}
|
|
414
404
|
/**
|
|
415
405
|
* Apply the settings overlay to one parsed row list.
|
|
@@ -417,9 +407,8 @@ function overrideTargets(overrides) {
|
|
|
417
407
|
* Rows are addressed by their `id`, and only a row the composition actually
|
|
418
408
|
* carries is touched: the overlay narrows the shipped configuration, it never
|
|
419
409
|
* 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,
|
|
421
|
-
*
|
|
422
|
-
* ever adds an override on top of them.
|
|
410
|
+
* unset is written as no key at all rather than as a value, so the row keeps the
|
|
411
|
+
* value the composition declares.
|
|
423
412
|
* @param rows - the parsed composition rows.
|
|
424
413
|
* @param overrides - the operator's settings-surface choices.
|
|
425
414
|
* @returns a new row list with the overlay applied.
|
|
@@ -597,11 +586,10 @@ function mountOnce(packageName, fn) {
|
|
|
597
586
|
* The preset combines a minimal persona with a lifetime-declared tool
|
|
598
587
|
* presentation: the system prompt keeps a minimal persona with standing
|
|
599
588
|
* working discipline and workspace instructions, and the wire runs the SDK's
|
|
600
|
-
* '
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
* instead of staged across a turn boundary
|
|
604
|
-
* opt-outs). High-fan-out tool families
|
|
589
|
+
* 'ptc' presentation by default — the wire collapses to the `run_code`
|
|
590
|
+
* transport and every other tool is reached from inside the program through
|
|
591
|
+
* the generated SDK ('native' keeps the assembled roster alone), declared once
|
|
592
|
+
* per session instead of staged across a turn boundary. High-fan-out tool families
|
|
605
593
|
* (default `mcp__*`) stay paged out of the executed surface through the
|
|
606
594
|
* host's scoped tool restriction until the preset's own `tool_activate` tool
|
|
607
595
|
* loads their namespace (LRU cap three), with the activation state replayed
|
|
@@ -623,51 +611,25 @@ const LIANGSHEN_SETTINGS_NAMESPACE = "liangshen";
|
|
|
623
611
|
/** Prompt assembly must exist before the announcement section can register. */
|
|
624
612
|
const inject = ["systemPrompt"];
|
|
625
613
|
/** The wire presentations the preset's tool catalog accepts. */
|
|
626
|
-
const PRESENTATION_OPTIONS = [
|
|
627
|
-
"ptc",
|
|
628
|
-
"native",
|
|
629
|
-
"both"
|
|
630
|
-
];
|
|
631
|
-
/** Sensitivity presets for the circuit breaker's adaptive thresholds. */
|
|
632
|
-
const SENSITIVITY_OPTIONS = [
|
|
633
|
-
"conservative",
|
|
634
|
-
"balanced",
|
|
635
|
-
"aggressive"
|
|
636
|
-
];
|
|
614
|
+
const PRESENTATION_OPTIONS = ["ptc", "native"];
|
|
637
615
|
const Config = z.object({
|
|
638
616
|
enabled: z.boolean().default(true).volatile(),
|
|
639
617
|
announceToAgent: z.boolean().default(false).volatile(),
|
|
640
|
-
presentation: z.union([...PRESENTATION_OPTIONS]).default("
|
|
641
|
-
dispatcher: z.boolean().default(true).volatile()
|
|
642
|
-
guardEnabled: z.boolean().default(true).volatile(),
|
|
643
|
-
guardSensitivity: z.union([...SENSITIVITY_OPTIONS]).default("balanced").volatile(),
|
|
644
|
-
guardStallReasoningChars: z.number().volatile(),
|
|
645
|
-
guardGlobalStallCap: z.number().volatile(),
|
|
646
|
-
guardEchoFailures: z.number().volatile()
|
|
618
|
+
presentation: z.union([...PRESENTATION_OPTIONS, z.transform("both", () => "ptc").deprecated().hidden()]).default("ptc").volatile(),
|
|
619
|
+
dispatcher: z.boolean().default(true).volatile()
|
|
647
620
|
});
|
|
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
|
-
*/
|
|
621
|
+
/** Schema defaults, re-read for hand-built test contexts. */
|
|
654
622
|
const DEFAULT_CONFIG = {
|
|
655
623
|
enabled: true,
|
|
656
624
|
announceToAgent: false,
|
|
657
|
-
presentation: "
|
|
658
|
-
dispatcher: true
|
|
659
|
-
guardEnabled: true,
|
|
660
|
-
guardSensitivity: "balanced",
|
|
661
|
-
guardStallReasoningChars: void 0,
|
|
662
|
-
guardGlobalStallCap: void 0,
|
|
663
|
-
guardEchoFailures: void 0
|
|
625
|
+
presentation: "ptc",
|
|
626
|
+
dispatcher: true
|
|
664
627
|
};
|
|
665
628
|
/**
|
|
666
629
|
* Read one activation field. The Host validates the raw profile config and
|
|
667
630
|
* hands volatile fields over as references, so a read goes through `get()`; a
|
|
668
631
|
* plain value passes through, and an absent field falls back to the schema
|
|
669
|
-
* default
|
|
670
|
-
* so "unset" survives as a real value instead of collapsing into a constant.
|
|
632
|
+
* default.
|
|
671
633
|
*/
|
|
672
634
|
function readField(field, fallback) {
|
|
673
635
|
if (field === void 0 || field === null) return fallback;
|
|
@@ -681,20 +643,16 @@ function readField(field, fallback) {
|
|
|
681
643
|
* @returns every field resolved against the schema defaults.
|
|
682
644
|
*/
|
|
683
645
|
function resolveConfig(config) {
|
|
646
|
+
const rawPresentation = readField(config?.presentation, DEFAULT_CONFIG.presentation);
|
|
684
647
|
return {
|
|
685
648
|
enabled: readField(config?.enabled, DEFAULT_CONFIG.enabled),
|
|
686
649
|
announceToAgent: readField(config?.announceToAgent, DEFAULT_CONFIG.announceToAgent),
|
|
687
|
-
presentation:
|
|
688
|
-
dispatcher: readField(config?.dispatcher, DEFAULT_CONFIG.dispatcher)
|
|
689
|
-
guardEnabled: readField(config?.guardEnabled, DEFAULT_CONFIG.guardEnabled),
|
|
690
|
-
guardSensitivity: readField(config?.guardSensitivity, DEFAULT_CONFIG.guardSensitivity),
|
|
691
|
-
guardStallReasoningChars: readField(config?.guardStallReasoningChars, DEFAULT_CONFIG.guardStallReasoningChars),
|
|
692
|
-
guardGlobalStallCap: readField(config?.guardGlobalStallCap, DEFAULT_CONFIG.guardGlobalStallCap),
|
|
693
|
-
guardEchoFailures: readField(config?.guardEchoFailures, DEFAULT_CONFIG.guardEchoFailures)
|
|
650
|
+
presentation: rawPresentation === "both" ? "ptc" : rawPresentation,
|
|
651
|
+
dispatcher: readField(config?.dispatcher, DEFAULT_CONFIG.dispatcher)
|
|
694
652
|
};
|
|
695
653
|
}
|
|
696
654
|
/** Model-facing announcement: plugin presence, principle, and limits. */
|
|
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 按会话一次声明,取值 '
|
|
655
|
+
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__*']):匹配工具在激活前被作用域级工具限制移出可见面(既不在 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」时即指本插件,请据此协作。";
|
|
698
656
|
/** Order of the announcement section within the tool-guidance band. */
|
|
699
657
|
const SECTION_ORDER = 150;
|
|
700
658
|
/**
|
|
@@ -858,4 +816,4 @@ function applyImpl(ctx, config) {
|
|
|
858
816
|
}, "dsh-liangshen: preset declaration and announcement");
|
|
859
817
|
}
|
|
860
818
|
//#endregion
|
|
861
|
-
export { Config, DEFAULT_CONFIG, LIANGSHEN_GUIDANCE, LIANGSHEN_SETTINGS_NAMESPACE, PRESENTATION_OPTIONS,
|
|
819
|
+
export { Config, DEFAULT_CONFIG, LIANGSHEN_GUIDANCE, LIANGSHEN_SETTINGS_NAMESPACE, PRESENTATION_OPTIONS, apply, bundledPresetDir, inject, name, resolveConfig };
|
|
@@ -14,9 +14,7 @@ import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
|
14
14
|
import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
15
15
|
import { type CardActions, type CardShell, type FieldState as CardFieldState } from './settings-form.ts';
|
|
16
16
|
/** Wire presentations the tool catalog accepts (mirrors the Host schema). */
|
|
17
|
-
export declare const PRESENTATION_CHOICES: readonly ["ptc", "native"
|
|
18
|
-
/** Sensitivity presets for the circuit breaker (mirrors the Host schema). */
|
|
19
|
-
export declare const SENSITIVITY_CHOICES: readonly ["conservative", "balanced", "aggressive"];
|
|
17
|
+
export declare const PRESENTATION_CHOICES: readonly ["ptc", "native"];
|
|
20
18
|
/** The LiangShen fields this card edits (the namespace's full schema). */
|
|
21
19
|
export interface LiangShenSettings {
|
|
22
20
|
/** Master switch for the plugin. */
|
|
@@ -27,16 +25,6 @@ export interface LiangShenSettings {
|
|
|
27
25
|
presentation?: string;
|
|
28
26
|
/** Whether the preset appends the dispatcher rules section after the persona. */
|
|
29
27
|
dispatcher?: boolean;
|
|
30
|
-
/** Master switch for the runtime degeneration circuit breaker. */
|
|
31
|
-
guardEnabled?: boolean;
|
|
32
|
-
/** Sensitivity preset scaling the breaker's adaptive thresholds. */
|
|
33
|
-
guardSensitivity?: string;
|
|
34
|
-
/** Per-step reasoning-character floor for the breaker's runaway ladder. */
|
|
35
|
-
guardStallReasoningChars?: number;
|
|
36
|
-
/** Consecutive output-free reasoning steps for the breaker's slow-burn ladder. */
|
|
37
|
-
guardGlobalStallCap?: number;
|
|
38
|
-
/** Identical-argument tool failures for the breaker's echo ladder. */
|
|
39
|
-
guardEchoFailures?: number;
|
|
40
28
|
}
|
|
41
29
|
/** What the LiangShen card renders. */
|
|
42
30
|
export interface LiangShenSettingsCardState extends CardShell {
|
|
@@ -44,11 +32,6 @@ export interface LiangShenSettingsCardState extends CardShell {
|
|
|
44
32
|
announceToAgent: CardFieldState;
|
|
45
33
|
presentation: CardFieldState;
|
|
46
34
|
dispatcher: CardFieldState;
|
|
47
|
-
guardEnabled: CardFieldState;
|
|
48
|
-
guardSensitivity: CardFieldState;
|
|
49
|
-
guardStallReasoningChars: CardFieldState;
|
|
50
|
-
guardGlobalStallCap: CardFieldState;
|
|
51
|
-
guardEchoFailures: CardFieldState;
|
|
52
35
|
}
|
|
53
36
|
/** The registration-side face the card's slot entry injects. */
|
|
54
37
|
export interface LiangShenSettingsCardFace extends CardActions {
|
|
@@ -37,6 +37,19 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
|
|
|
37
37
|
onSave: () => void;
|
|
38
38
|
/** Drop every staged edit. */
|
|
39
39
|
onDiscard: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Id applied to the card's title element, so a header control (an immediate
|
|
42
|
+
* toggle in `headerAction`) can name itself through `aria-labelledby`
|
|
43
|
+
* instead of repeating the title as a string.
|
|
44
|
+
*/
|
|
45
|
+
titleId?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Render the header only, with no body region. A card whose whole setting is
|
|
48
|
+
* the header control (a switch whose explanation is the description) has no
|
|
49
|
+
* controls to lay out below it, and an empty body would draw a divider line
|
|
50
|
+
* with nothing under it.
|
|
51
|
+
*/
|
|
52
|
+
headerOnly?: boolean;
|
|
40
53
|
/**
|
|
41
54
|
* Render the controls expanded on arrival (still collapsible). Defaults to
|
|
42
55
|
* true: promoted first-level sections show their settings immediately.
|
|
@@ -54,6 +67,13 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
|
|
|
54
67
|
* edits, so the footer would sit there permanently disabled.
|
|
55
68
|
*/
|
|
56
69
|
hideFooter?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Optional control rendered at the header's trailing edge, before the pending
|
|
72
|
+
* badge and the chevron. A card whose setting is one immediate flip (it
|
|
73
|
+
* applies outside the staged form) puts its ToggleSwitch here, so the control
|
|
74
|
+
* is reachable without opening the card and matches a plugin card's shape.
|
|
75
|
+
*/
|
|
76
|
+
headerAction?: ReactNode;
|
|
57
77
|
/** Render children even when the settings namespace is not exposed by the host. */
|
|
58
78
|
renderChildrenWhenNotExposed?: boolean;
|
|
59
79
|
/** Hide the 'not exposed' warning banner when the settings namespace is not exposed. */
|
|
@@ -141,4 +161,23 @@ export declare function ChoiceField(props: FieldProps & {
|
|
|
141
161
|
label: string;
|
|
142
162
|
}>;
|
|
143
163
|
}): import("react").JSX.Element;
|
|
164
|
+
/**
|
|
165
|
+
* An immediate boolean toggle drawn as a switch track, for a setting that
|
|
166
|
+
* applies on flip rather than through a staged save. It is a real button with
|
|
167
|
+
* `role="switch"` and `aria-checked`, so keyboard and assistive activation
|
|
168
|
+
* arrive as a click and the state is announced instead of inferred from a
|
|
169
|
+
* checkbox tick.
|
|
170
|
+
*/
|
|
171
|
+
export declare function ToggleSwitch(props: {
|
|
172
|
+
/** Id of the element naming the switch (the card's title). */
|
|
173
|
+
labelledBy?: string;
|
|
174
|
+
/** Accessible name when no element labels it. */
|
|
175
|
+
ariaLabel?: string;
|
|
176
|
+
/** Current state. */
|
|
177
|
+
checked: boolean;
|
|
178
|
+
/** Disables the switch while a write is in flight or the Host refuses writes. */
|
|
179
|
+
disabled?: boolean;
|
|
180
|
+
/** Called with the requested next state. */
|
|
181
|
+
onChange: (next: boolean) => void;
|
|
182
|
+
}): import("react").JSX.Element;
|
|
144
183
|
export {};
|
|
@@ -47,21 +47,6 @@ export declare const zh: {
|
|
|
47
47
|
'settings.invalidValue': string;
|
|
48
48
|
'presentation.ptc': string;
|
|
49
49
|
'presentation.native': string;
|
|
50
|
-
'presentation.both': string;
|
|
51
|
-
'settings.guardEnabled': string;
|
|
52
|
-
'settings.guardEnabledHint': string;
|
|
53
|
-
'settings.guardStallChars': string;
|
|
54
|
-
'settings.guardStallCharsHint': string;
|
|
55
|
-
'settings.guardGlobalCap': string;
|
|
56
|
-
'settings.guardGlobalCapHint': string;
|
|
57
|
-
'settings.guardSensitivity': string;
|
|
58
|
-
'settings.guardSensitivityHint': string;
|
|
59
|
-
'sensitivity.conservative': string;
|
|
60
|
-
'sensitivity.balanced': string;
|
|
61
|
-
'sensitivity.aggressive': string;
|
|
62
|
-
'settings.guardEchoFailures': string;
|
|
63
|
-
'settings.guardEchoFailuresHint': string;
|
|
64
|
-
'settings.guardAdaptive': string;
|
|
65
50
|
};
|
|
66
51
|
/** English counterpart; the key set mirrors {@link zh} exactly. */
|
|
67
52
|
export declare const en: Record<keyof typeof zh, string>;
|
|
@@ -85,24 +85,13 @@ export declare function readPresetDefinition(id: string, dir: string): PresetDef
|
|
|
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
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
|
|
89
|
-
* adaptive resolution decides the effective threshold.
|
|
88
|
+
* writes nothing at all — the key stays out of the row.
|
|
90
89
|
*/
|
|
91
90
|
export interface PresetOverrides {
|
|
92
91
|
/** The `tool-catalog` row's `presentation` value. */
|
|
93
92
|
presentation?: string;
|
|
94
93
|
/** The `minimal-prompt` row's `dispatcher` switch. */
|
|
95
94
|
dispatcher?: boolean;
|
|
96
|
-
/** The `guard` row's `enabled` switch. */
|
|
97
|
-
guardEnabled?: boolean;
|
|
98
|
-
/** The `guard` row's sensitivity preset. */
|
|
99
|
-
guardSensitivity?: string;
|
|
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;
|
|
106
95
|
}
|
|
107
96
|
/**
|
|
108
97
|
* Apply the settings overlay to one parsed row list.
|
|
@@ -110,9 +99,8 @@ export interface PresetOverrides {
|
|
|
110
99
|
* Rows are addressed by their `id`, and only a row the composition actually
|
|
111
100
|
* carries is touched: the overlay narrows the shipped configuration, it never
|
|
112
101
|
* 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,
|
|
114
|
-
*
|
|
115
|
-
* ever adds an override on top of them.
|
|
102
|
+
* unset is written as no key at all rather than as a value, so the row keeps the
|
|
103
|
+
* value the composition declares.
|
|
116
104
|
* @param rows - the parsed composition rows.
|
|
117
105
|
* @param overrides - the operator's settings-surface choices.
|
|
118
106
|
* @returns a new row list with the overlay applied.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -19,11 +19,10 @@
|
|
|
19
19
|
* The preset combines a minimal persona with a lifetime-declared tool
|
|
20
20
|
* presentation: the system prompt keeps a minimal persona with standing
|
|
21
21
|
* working discipline and workspace instructions, and the wire runs the SDK's
|
|
22
|
-
* '
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* instead of staged across a turn boundary
|
|
26
|
-
* opt-outs). High-fan-out tool families
|
|
22
|
+
* 'ptc' presentation by default — the wire collapses to the `run_code`
|
|
23
|
+
* transport and every other tool is reached from inside the program through
|
|
24
|
+
* the generated SDK ('native' keeps the assembled roster alone), declared once
|
|
25
|
+
* per session instead of staged across a turn boundary. High-fan-out tool families
|
|
27
26
|
* (default `mcp__*`) stay paged out of the executed surface through the
|
|
28
27
|
* host's scoped tool restriction until the preset's own `tool_activate` tool
|
|
29
28
|
* loads their namespace (LRU cap three), with the activation state replayed
|
|
@@ -48,13 +47,9 @@ export declare const LIANGSHEN_SETTINGS_NAMESPACE: SettingsNamespace;
|
|
|
48
47
|
/** Prompt assembly must exist before the announcement section can register. */
|
|
49
48
|
export declare const inject: string[];
|
|
50
49
|
/** The wire presentations the preset's tool catalog accepts. */
|
|
51
|
-
export declare const PRESENTATION_OPTIONS: readonly ["ptc", "native"
|
|
52
|
-
/** Sensitivity presets for the circuit breaker's adaptive thresholds. */
|
|
53
|
-
export declare const SENSITIVITY_OPTIONS: readonly ["conservative", "balanced", "aggressive"];
|
|
50
|
+
export declare const PRESENTATION_OPTIONS: readonly ["ptc", "native"];
|
|
54
51
|
/** One wire presentation. */
|
|
55
52
|
export type Presentation = (typeof PRESENTATION_OPTIONS)[number];
|
|
56
|
-
/** One circuit-breaker sensitivity preset. */
|
|
57
|
-
export type GuardSensitivity = (typeof SENSITIVITY_OPTIONS)[number];
|
|
58
53
|
/**
|
|
59
54
|
* One activation field as the Host hands it over: a stable reference whose
|
|
60
55
|
* `get()` reads the value committed for this instance (a settings write updates
|
|
@@ -77,11 +72,12 @@ export interface Config {
|
|
|
77
72
|
announceToAgent?: ConfigField<boolean>;
|
|
78
73
|
/**
|
|
79
74
|
* Wire presentation written into the declared preset's tool-catalog row.
|
|
80
|
-
* `
|
|
81
|
-
*
|
|
82
|
-
* the
|
|
75
|
+
* `ptc` (default) collapses the wire to the single `run_code` transport and
|
|
76
|
+
* reaches every other tool through the generated SDK; `native` keeps the
|
|
77
|
+
* assembled roster alone. Legacy `'both'` (the pre-0.2.1 shipped default) is
|
|
78
|
+
* accepted from older saved profiles and normalized to `'ptc'`.
|
|
83
79
|
*/
|
|
84
|
-
presentation?: ConfigField<Presentation>;
|
|
80
|
+
presentation?: ConfigField<Presentation | 'both'>;
|
|
85
81
|
/**
|
|
86
82
|
* When true, the preset appends the dispatcher rule block to its persona:
|
|
87
83
|
* the session becomes a dispatch agent whose deliverable is the plan, the
|
|
@@ -91,50 +87,17 @@ export interface Config {
|
|
|
91
87
|
* and the switch is what returns a session to the bare persona.
|
|
92
88
|
*/
|
|
93
89
|
dispatcher?: ConfigField<boolean>;
|
|
94
|
-
/** Master switch for the runtime degeneration circuit breaker (default true). */
|
|
95
|
-
guardEnabled?: ConfigField<boolean>;
|
|
96
|
-
/**
|
|
97
|
-
* Sensitivity preset scaling the breaker's adaptive thresholds
|
|
98
|
-
* (default 'balanced'). 'conservative' interrupts less, 'aggressive' fires earlier.
|
|
99
|
-
*/
|
|
100
|
-
guardSensitivity?: ConfigField<GuardSensitivity>;
|
|
101
|
-
/**
|
|
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`.
|
|
110
|
-
*/
|
|
111
|
-
guardGlobalStallCap?: ConfigField<number | undefined>;
|
|
112
|
-
/**
|
|
113
|
-
* Override for the echo ladder. Left unset, the count scales with
|
|
114
|
-
* `guardSensitivity`.
|
|
115
|
-
*/
|
|
116
|
-
guardEchoFailures?: ConfigField<number | undefined>;
|
|
117
90
|
}
|
|
118
91
|
export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
119
92
|
enabled: z<boolean, boolean, "volatile-defined">;
|
|
120
93
|
announceToAgent: z<boolean, boolean, "volatile-defined">;
|
|
121
|
-
presentation: z<
|
|
94
|
+
presentation: z<string, "ptc" | "native", "volatile-defined">;
|
|
122
95
|
dispatcher: z<boolean, boolean, "volatile-defined">;
|
|
123
|
-
guardEnabled: z<boolean, boolean, "volatile-defined">;
|
|
124
|
-
guardSensitivity: z<"conservative" | "balanced" | "aggressive", "conservative" | "balanced" | "aggressive", "volatile-defined">;
|
|
125
|
-
guardStallReasoningChars: z<number, number, "volatile">;
|
|
126
|
-
guardGlobalStallCap: z<number, number, "volatile">;
|
|
127
|
-
guardEchoFailures: z<number, number, "volatile">;
|
|
128
96
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
129
97
|
enabled: z<boolean, boolean, "volatile-defined">;
|
|
130
98
|
announceToAgent: z<boolean, boolean, "volatile-defined">;
|
|
131
|
-
presentation: z<
|
|
99
|
+
presentation: z<string, "ptc" | "native", "volatile-defined">;
|
|
132
100
|
dispatcher: z<boolean, boolean, "volatile-defined">;
|
|
133
|
-
guardEnabled: z<boolean, boolean, "volatile-defined">;
|
|
134
|
-
guardSensitivity: z<"conservative" | "balanced" | "aggressive", "conservative" | "balanced" | "aggressive", "volatile-defined">;
|
|
135
|
-
guardStallReasoningChars: z<number, number, "volatile">;
|
|
136
|
-
guardGlobalStallCap: z<number, number, "volatile">;
|
|
137
|
-
guardEchoFailures: z<number, number, "volatile">;
|
|
138
101
|
}>>, "plain">;
|
|
139
102
|
/** The settings the runtime acts on, every field read at its use site. */
|
|
140
103
|
export interface ResolvedConfig {
|
|
@@ -146,23 +109,8 @@ export interface ResolvedConfig {
|
|
|
146
109
|
presentation: Presentation;
|
|
147
110
|
/** Whether the declared preset's minimal-prompt row appends the dispatcher rule block. */
|
|
148
111
|
dispatcher: boolean;
|
|
149
|
-
/** Breaker master switch written into the declared preset's guard row. */
|
|
150
|
-
guardEnabled: boolean;
|
|
151
|
-
/** Breaker sensitivity written into the declared preset's guard row. */
|
|
152
|
-
guardSensitivity: GuardSensitivity;
|
|
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;
|
|
159
112
|
}
|
|
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
|
-
*/
|
|
113
|
+
/** Schema defaults, re-read for hand-built test contexts. */
|
|
166
114
|
export declare const DEFAULT_CONFIG: ResolvedConfig;
|
|
167
115
|
/**
|
|
168
116
|
* Read the effective settings of this activation.
|
|
@@ -171,7 +119,7 @@ export declare const DEFAULT_CONFIG: ResolvedConfig;
|
|
|
171
119
|
*/
|
|
172
120
|
export declare function resolveConfig(config?: Config): ResolvedConfig;
|
|
173
121
|
/** Model-facing announcement: plugin presence, principle, and limits. */
|
|
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 '
|
|
122
|
+
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\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\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";
|
|
175
123
|
/**
|
|
176
124
|
* Absolute path of the bundled LiangShen preset directory: the composition,
|
|
177
125
|
* 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
|
-
"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
|
|
4
|
-
"version": "0.4.
|
|
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__*`) 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 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.8",
|
|
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.
|
|
26
|
+
"dsh": ">=0.2.1-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.
|
|
43
|
+
"@deepseek-ai/dsh": ">=0.2.1-rc.2"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
46
|
+
"@deepseek-ai/schemastery": "^3.18.5"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
50
|
-
"@deepseek-ai/dsh-agent-preset-registry": "^0.2.
|
|
51
|
-
"@deepseek-ai/dsh-api-remotes": "^0.2.
|
|
52
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.2.
|
|
53
|
-
"@deepseek-ai/dsh-client-connection": "^0.2.
|
|
54
|
-
"@deepseek-ai/dsh-client-locale": "^0.2.
|
|
55
|
-
"@deepseek-ai/dsh-client-store": "^0.2.
|
|
56
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.2.
|
|
57
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.
|
|
58
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.2.
|
|
59
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.2.
|
|
60
|
-
"@deepseek-ai/dsh-settings": "^0.2.
|
|
61
|
-
"@deepseek-ai/dsh-system-prompt": "^0.2.
|
|
49
|
+
"@deepseek-ai/cordis": "^4.0.5",
|
|
50
|
+
"@deepseek-ai/dsh-agent-preset-registry": "^0.2.1-rc.2",
|
|
51
|
+
"@deepseek-ai/dsh-api-remotes": "^0.2.1-rc.2",
|
|
52
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.2.1-rc.2",
|
|
53
|
+
"@deepseek-ai/dsh-client-connection": "^0.2.1-rc.2",
|
|
54
|
+
"@deepseek-ai/dsh-client-locale": "^0.2.1-rc.2",
|
|
55
|
+
"@deepseek-ai/dsh-client-store": "^0.2.1-rc.2",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.2.1-rc.2",
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.1-rc.2",
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.2.1-rc.2",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.2.1-rc.2",
|
|
60
|
+
"@deepseek-ai/dsh-settings": "^0.2.1-rc.2",
|
|
61
|
+
"@deepseek-ai/dsh-system-prompt": "^0.2.1-rc.2",
|
|
62
62
|
"@testing-library/react": "^16.1.0",
|
|
63
63
|
"@types/node": "^22.20.0",
|
|
64
64
|
"@types/react": "~18.3.1",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"build": "tsc -b tsconfig.build.json && tsdown",
|
|
95
95
|
"bundle": "tsdown",
|
|
96
96
|
"watch": "tsdown --watch",
|
|
97
|
-
"typecheck": "
|
|
97
|
+
"typecheck": "tsgo --noEmit",
|
|
98
98
|
"test": "vitest run",
|
|
99
99
|
"test:watch": "vitest"
|
|
100
100
|
}
|