@linxin666/dsh-liangshen 0.3.23 → 0.3.24
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 +45 -38
- package/README.zh.md +44 -37
- package/lib/client.js +1058 -11
- package/lib/client.js.map +1 -1
- package/lib/index.js +105 -22
- package/lib/types/client/LiangShenSettingsCard.d.ts +61 -0
- package/lib/types/client/PluginSettingsCard.d.ts +133 -0
- package/lib/types/client/index.d.ts +34 -0
- package/lib/types/client/locales.d.ts +27 -1
- package/lib/types/client/plugin-card-seat.d.ts +96 -0
- package/lib/types/client/settings-form.d.ts +197 -0
- package/lib/types/core/lever.d.ts +6 -3
- package/lib/types/index.d.ts +23 -11
- package/lib/types/sync.d.ts +29 -2
- package/package.json +6 -2
- package/presets/liangshen/NOTICE +4 -4
- package/presets/liangshen/agent.cordis.yml +130 -119
- package/presets/liangshen/minimal-prompt.mjs +71 -36
- package/presets/liangshen/paging.mjs +232 -0
- package/presets/liangshen/tool-activate.mjs +176 -0
- package/presets/liangshen/tool-catalog.mjs +610 -218
- package/presets/liangshen/working-context.mjs +214 -0
- package/src/client/LiangShenLever.tsx +4 -1
- package/src/client/LiangShenSettingsCard.tsx +149 -0
- package/src/client/PluginSettingsCard.tsx +550 -0
- package/src/client/index.ts +60 -1
- package/src/client/locales.ts +53 -1
- package/src/client/plugin-card-seat.ts +185 -0
- package/src/client/settings-card.module.css +418 -0
- package/src/client/settings-form.ts +439 -0
- package/src/core/lever.ts +7 -4
- package/src/index.ts +35 -14
- package/src/sync.test.ts +86 -7
- package/src/sync.ts +108 -6
- package/tools/benchmark-live-run.mjs +24 -33
- package/presets/liangshen/custom-bash.mjs +0 -213
package/lib/types/index.d.ts
CHANGED
|
@@ -9,16 +9,20 @@
|
|
|
9
9
|
* surface (plugin config) or the profile patch. No browser half, no routes,
|
|
10
10
|
* no agent tools — the preset itself provides the tools.
|
|
11
11
|
*
|
|
12
|
-
* The preset combines a minimal persona with a
|
|
13
|
-
* the system prompt keeps a minimal persona with standing
|
|
14
|
-
* and workspace instructions, the
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
12
|
+
* The preset combines a minimal persona with a lifetime-declared tool
|
|
13
|
+
* presentation: the system prompt keeps a minimal persona with standing
|
|
14
|
+
* working discipline and workspace instructions, and the wire runs the SDK's
|
|
15
|
+
* 'ptc' presentation by default — the wire collapses to the `run_code`
|
|
16
|
+
* transport and every other tool is reached through the generated SDK,
|
|
17
|
+
* declared once per session instead of staged across a turn boundary
|
|
18
|
+
* ('native' and 'both' are one-line opt-outs). High-fan-out tool families
|
|
19
|
+
* (default `mcp__*`) stay paged out of the executed surface through the
|
|
20
|
+
* host's scoped tool restriction until the preset's own `tool_activate` tool
|
|
21
|
+
* loads their namespace (LRU cap three), with the activation state replayed
|
|
22
|
+
* from the durable session event stream. The tool catalog — listing exactly
|
|
23
|
+
* the tools the request carries plus the paged-out namespace summaries — and a
|
|
24
|
+
* one-line working-context projection travel as durable user messages,
|
|
25
|
+
* republished only on change.
|
|
22
26
|
*/
|
|
23
27
|
import type { Context } from '@deepseek-ai/cordis';
|
|
24
28
|
import type { SettingsNamespace } from '@deepseek-ai/dsh-settings';
|
|
@@ -29,16 +33,24 @@ export declare const name = "liangshen";
|
|
|
29
33
|
export declare const LIANGSHEN_SETTINGS_NAMESPACE: SettingsNamespace;
|
|
30
34
|
/** Prompt assembly must exist before the announcement section can register. */
|
|
31
35
|
export declare const inject: string[];
|
|
36
|
+
/** The wire presentations the preset's tool catalog accepts. */
|
|
37
|
+
export declare const PRESENTATION_OPTIONS: readonly ["ptc", "native", "both"];
|
|
32
38
|
/** Plugin config, validated by the same-named schemastery schema. */
|
|
33
39
|
export interface Config {
|
|
34
40
|
/** Master switch: when false, neither sync nor announcement runs. */
|
|
35
41
|
enabled?: boolean;
|
|
36
42
|
/** When true, a system-prompt section announces the plugin (default false — keep prompts clean unless the user opts in). */
|
|
37
43
|
announceToAgent?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Wire presentation written into the synced preset's tool-catalog row.
|
|
46
|
+
* `ptc` (default) collapses the wire to the `run_code` transport; `native`
|
|
47
|
+
* keeps the assembled roster; `both` keeps the roster and the transport.
|
|
48
|
+
*/
|
|
49
|
+
presentation?: (typeof PRESENTATION_OPTIONS)[number];
|
|
38
50
|
}
|
|
39
51
|
export declare const Config: z<Config>;
|
|
40
52
|
/** Model-facing announcement: plugin presence, principle, and limits. */
|
|
41
|
-
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\u601D\
|
|
53
|
+
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\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 \u89E6\u8FBE\uFF09\u3001'native'\uFF08\u7EC4\u88C5\u51FA\u7684\u539F\u751F\u6E05\u5355\uFF09\u6216 'both'\uFF08\u4E24\u8005\u540C\u9A7B\uFF09\uFF0C\u5E76\u53EF\u5728\u63D2\u4EF6\u8BBE\u7F6E\u754C\u9762\u5207\u6362\uFF08\u540C\u6B65 preset \u65F6\u5199\u5165 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\uFF1A\u5339\u914D pagedToolPatterns\uFF08\u9ED8\u8BA4 mcp__*\uFF09\u7684\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\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 \u6807\u9898\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 1500 / tail 500\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\u3002preset \u6587\u4EF6\u7531\u63D2\u4EF6\u7EF4\u62A4\u4E8E ~/.dsh/.agent-presets\uFF0C\u5347\u7EA7\u63D2\u4EF6\u65F6\u81EA\u52A8\u66F4\u65B0\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";
|
|
42
54
|
export { dshHome } from './dsh-home.ts';
|
|
43
55
|
/** Absolute path of the bundled preset tree inside this package. */
|
|
44
56
|
export declare function bundledPresetsRoot(): string;
|
package/lib/types/sync.d.ts
CHANGED
|
@@ -28,8 +28,35 @@ export interface SyncResult {
|
|
|
28
28
|
/** Previously bundled preset ids removed from the target root this run. */
|
|
29
29
|
retired: string[];
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* The preset-row settings the plugin exposes in the web settings surface, as the
|
|
33
|
+
* overrides to write into the synced `agent.cordis.yml`.
|
|
34
|
+
*
|
|
35
|
+
* The settings surface edits the PLUGIN's namespace, while the values that shape
|
|
36
|
+
* a session live in the preset's rows. Writing the chosen values into the synced
|
|
37
|
+
* tree is what connects the two: the bundled source stays the shipped default,
|
|
38
|
+
* and the operator's choice rides on top of it. Every field is optional — an
|
|
39
|
+
* absent value leaves the shipped row exactly as it is.
|
|
40
|
+
*/
|
|
41
|
+
export interface PresetOverrides {
|
|
42
|
+
/** The `tool-catalog` row's `presentation` value. */
|
|
43
|
+
presentation?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Render `agent.cordis.yml` with the settings overrides applied.
|
|
47
|
+
*
|
|
48
|
+
* Rows are matched by their `- id:` marker, so the transform does not depend on
|
|
49
|
+
* line numbers or on the values the shipped file happens to carry. A row or key
|
|
50
|
+
* the source does not contain is left alone rather than invented: the overlay
|
|
51
|
+
* narrows the shipped configuration, it never adds a mount the preset did not
|
|
52
|
+
* have.
|
|
53
|
+
* @param text - the bundled preset composition.
|
|
54
|
+
* @param overrides - the operator's settings-surface choices.
|
|
55
|
+
* @returns the composition to write into the synced tree.
|
|
56
|
+
*/
|
|
57
|
+
export declare function renderPresetOverrides(text: string, overrides: PresetOverrides): string;
|
|
31
58
|
/** Copy `sourceRoot/<id>` into `targetRoot/<id>`, idempotently. */
|
|
32
|
-
export declare function syncOnePreset(sourceDir: string, targetDir: string): 'synced' | 'current';
|
|
59
|
+
export declare function syncOnePreset(sourceDir: string, targetDir: string, overrides?: PresetOverrides): 'synced' | 'current';
|
|
33
60
|
/**
|
|
34
61
|
* Sync every preset under `sourceRoot` into `targetRoot`, then remove
|
|
35
62
|
* target directories named in `retire` that the bundle no longer ships —
|
|
@@ -44,4 +71,4 @@ export declare function syncOnePreset(sourceDir: string, targetDir: string): 'sy
|
|
|
44
71
|
* @param targetRoot - dsh agent-presets discovery root (e.g. <home>/.dsh/.agent-presets).
|
|
45
72
|
* @param retire - previously bundled preset ids to remove when absent from the source.
|
|
46
73
|
*/
|
|
47
|
-
export declare function syncPresetTrees(sourceRoot: string, targetRoot: string, retire?: string[]): SyncResult;
|
|
74
|
+
export declare function syncPresetTrees(sourceRoot: string, targetRoot: string, retire?: string[], overrides?: PresetOverrides): SyncResult;
|
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 preset keeps a minimal persona with standing working discipline
|
|
4
|
-
"version": "0.3.
|
|
3
|
+
"description": "LiangShen (梁神) agent preset plus its composer lever for the dsh web GUI. 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: 'ptc'`, where the wire collapses to the `run_code` transport and every other tool is reached through the generated SDK; `native` keeps the assembled roster, `both` keeps them co-resident). 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. Preset files sync to ~/.dsh/.agent-presets on startup. Hot-pluggable via cordis.patch.yml + profile symlink, no dsh source changes.",
|
|
4
|
+
"version": "0.3.24",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": "^22.19.0 || >=24.0.0"
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"inject": [
|
|
32
32
|
"@deepseek-ai/dsh-client-connection",
|
|
33
33
|
"@deepseek-ai/dsh-client-ui-renderer",
|
|
34
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
34
35
|
"@deepseek-ai/dsh-api-remotes",
|
|
35
36
|
"@deepseek-ai/dsh-api-session-controller"
|
|
36
37
|
],
|
|
@@ -50,12 +51,15 @@
|
|
|
50
51
|
"@deepseek-ai/dsh-client-store": "^0.1.5-rc.1",
|
|
51
52
|
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.5-rc.1",
|
|
52
53
|
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-rc.1",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.5-rc.1",
|
|
53
55
|
"@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.1",
|
|
54
56
|
"@deepseek-ai/dsh-settings": "^0.1.5-rc.1",
|
|
55
57
|
"@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.1",
|
|
58
|
+
"@testing-library/react": "^16.1.0",
|
|
56
59
|
"@types/node": "^22.20.0",
|
|
57
60
|
"@types/react": "~18.3.1",
|
|
58
61
|
"@types/react-dom": "~18.3.1",
|
|
62
|
+
"@vitest/coverage-v8": "^3.2.7",
|
|
59
63
|
"jsdom": "^25.0.0",
|
|
60
64
|
"react": "^18.3.1",
|
|
61
65
|
"react-dom": "^18.3.1",
|
package/presets/liangshen/NOTICE
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
agent.cordis.yml 改编自 DeepSeek Harness 内置 Minimal、Standard 与 PTC preset(MIT
|
|
1
|
+
agent.cordis.yml 改编自 DeepSeek Harness 内置 Minimal、Standard 与 PTC preset(MIT),
|
|
2
|
+
其 shell 段与内置 Minimal 一致:POSIX 挂上游持久 bash,win32 挂上游持久 pwsh
|
|
3
|
+
(dsh-terminal-bash 的 shellDialect: pwsh + dsh-tool-pwsh-persistent),本 preset
|
|
4
|
+
不提供自研 shell 实现。
|
|
2
5
|
minimal-prompt.mjs 与 tool-catalog.mjs 为 dsh-liangshen 自有实现;其中的
|
|
3
6
|
agent-instructions 引用提示沿用 https://github.com/xiaobright/dsh-anchored-standard
|
|
4
7
|
(MIT)的实验结论,消息注入形状参照 DeepSeek Harness 的 skill catalog。
|
|
5
|
-
custom-bash.mjs 移植自同一上游(xiaobright/dsh-anchored-standard,MIT)的
|
|
6
|
-
combo-anchored/custom-bash.mjs,用于 win32 上以跨平台子进程通道提供同名
|
|
7
|
-
`bash` 工具(Git Bash)。
|
|
8
8
|
原始 DeepSeek 版权和 MIT 许可声明见开源仓库。
|
|
@@ -1,29 +1,52 @@
|
|
|
1
1
|
# The `liangshen` (梁神模式) agent preset: the builtin Minimal preset's
|
|
2
|
-
# one-line persona — extended with the mode's standing working discipline
|
|
3
|
-
#
|
|
4
|
-
# session's
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
2
|
+
# one-line persona — extended with the mode's standing working discipline
|
|
3
|
+
# (thinking-disruption fuses, action-oriented steps, YAGNI/PDCA) and the
|
|
4
|
+
# session's workspace directory — as the WHOLE system prompt, with one tool
|
|
5
|
+
# presentation declared for the session's whole lifetime instead of a staged
|
|
6
|
+
# turn boundary.
|
|
7
|
+
#
|
|
8
|
+
# The presentation is the SDK's ToolPresentationMode, picked by the
|
|
9
|
+
# tool-catalog row's `presentation` key (default `'both'`): `'native'` keeps
|
|
10
|
+
# the assembled roster on the wire, `'ptc'` collapses the wire to the single
|
|
11
|
+
# `run_code` transport, and `'both'` keeps the full native roster AND the
|
|
12
|
+
# `run_code` transport co-resident — native calls carry ordinary work while
|
|
13
|
+
# `run_code` covers programmatic batch computation and wide fan-out. The
|
|
14
|
+
# declaration lands once per agent scope through agent.ctx.tools.presentAs as
|
|
15
|
+
# early as the scope exists, and degrades to the native surface with a
|
|
16
|
+
# one-time warning when the deployment has no code runtime or the host
|
|
17
|
+
# declines. The retired anchor-turn staging is gone: the legacy `anchorTools`
|
|
18
|
+
# and boolean `ptcPresentation` keys are still accepted (the latter mapping
|
|
19
|
+
# true -> 'ptc' and false -> 'native') but only warn once.
|
|
20
|
+
#
|
|
21
|
+
# Gentle tool paging keeps high-fan-out families out of reach until needed:
|
|
22
|
+
# tools matching `pagedToolPatterns` (default `mcp__*`) stay paged out, the
|
|
23
|
+
# durable tool-catalog message summarizes their namespaces with an activation
|
|
24
|
+
# pointer, and the preset's own `tool_activate` tool (the tool-activate row)
|
|
25
|
+
# loads one namespace back — at most three stay active, LRU eviction pages the
|
|
26
|
+
# oldest back out. The activation state replays from the durable session event
|
|
27
|
+
# stream on every assembly, so resume and compaction rebuild it without process
|
|
28
|
+
# memory. Paging is enforced twice, because the wire is not the only surface a
|
|
29
|
+
# tool can be reached through: the assembled tool list loses the paged families,
|
|
30
|
+
# and the agent scope is restricted (agent.ctx.tools.restrict) so the same names
|
|
31
|
+
# vanish from the generated SDK and from every program dispatch. The second half
|
|
32
|
+
# is what makes paging real under the default `ptc` presentation, where the wire
|
|
33
|
+
# has already collapsed to `run_code` and a wire-only filter would withhold
|
|
34
|
+
# nothing the model can observe.
|
|
35
|
+
#
|
|
36
|
+
# The capability facts the Standard system prompt would carry as tool-guidance
|
|
37
|
+
# prose arrive instead as a durable `tool-catalog` message appended after the
|
|
38
|
+
# user's own message, the way the skill catalog is injected: it names exactly
|
|
39
|
+
# the tools the current request's wire carries (each tool's argument signature
|
|
40
|
+
# plus a one-line summary) plus the paged-out namespace summaries, so the
|
|
41
|
+
# declared surface and the request's own wire never disagree. A second durable
|
|
42
|
+
# message, working-context, projects one minimal line of objective session
|
|
43
|
+
# state (plan mode, active namespaces, in-progress todos) folded from the
|
|
44
|
+
# session event stream, republished only when it changes.
|
|
22
45
|
#
|
|
23
46
|
# The persistent shell replaces the Standard ephemeral shell for the whole
|
|
24
|
-
# session
|
|
25
|
-
# file sandbox instead of mounting a bare local
|
|
26
|
-
# filesystem sections below.
|
|
47
|
+
# session — `bash` on POSIX, `pwsh` on win32, exactly one per host — and the
|
|
48
|
+
# editor inherits the host file sandbox instead of mounting a bare local
|
|
49
|
+
# filesystem — see the shell and filesystem sections below.
|
|
27
50
|
#
|
|
28
51
|
# Adapted from the builtin `minimal` and `standard` presets.
|
|
29
52
|
#
|
|
@@ -52,86 +75,110 @@
|
|
|
52
75
|
# appends the session's workspace directory at assembly time, so identity,
|
|
53
76
|
# harness, web-surface, and tool-guidance sections never reach the model.
|
|
54
77
|
# Besides the one-line persona it carries the standing working discipline the
|
|
55
|
-
# mode ships with
|
|
56
|
-
#
|
|
57
|
-
#
|
|
78
|
+
# mode ships with: thinking-disruption fuses (a hypothesis gets at most two
|
|
79
|
+
# reasoning passes before a tool must settle it), action-oriented thinking
|
|
80
|
+
# (decide the next operation, never pre-rehearse implementations in thought),
|
|
81
|
+
# and YAGNI/PDCA with no redundant comments. Runtime context snapshots stay
|
|
82
|
+
# enabled: they are durable user-role messages, not system-prompt text.
|
|
58
83
|
- id: persona
|
|
59
84
|
name: '@deepseek-ai/dsh-persona'
|
|
60
85
|
config:
|
|
61
86
|
prefix: |-
|
|
62
87
|
You are a helpful software engineer assistant.
|
|
63
88
|
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
- When
|
|
67
|
-
-
|
|
89
|
+
- Thinking Disruption: Do not repeat reasoning on the same hypothesis more than twice. If necessary facts are missing, immediately close </think> and call native inspection tools (read, grep, bash/pwsh) instead of speculating in thought.
|
|
90
|
+
- Action-Oriented: Thinking must focus solely on determining the next concrete operation. Do not mentally pre-rehearse full code implementations. All correctness verification must be conducted against actual tool outputs during the execution phase.
|
|
91
|
+
- Parallel Inspection: When multiple independent inspections, searches, or checks are needed, emit multiple tool calls concurrently in a single turn instead of sequential rounds. The harness executes independent read-only tools in parallel.
|
|
92
|
+
- Shell Discipline: Shell processes are ephemeral; directory changes do not persist across tool calls. Use compound commands (e.g. cd <path> && <cmd>) or pass workdir explicitly for operations in subdirectories.
|
|
93
|
+
- Development Standard: Follow YAGNI and the PDCA loop. Each step verifies a single assumption. Do not write redundant comments.
|
|
94
|
+
- Bounded Output: never dump a large or unbounded command output into the conversation. Filter at the source with grep/head/tail/wc and read the narrow range you actually need; the model's long-range attention is a bounded budget and raw logs evict the session's own constraints from it.
|
|
68
95
|
|
|
69
|
-
# The
|
|
96
|
+
# The mode's preset-local plugins:
|
|
70
97
|
#
|
|
71
98
|
# `minimal-prompt` keeps the system prompt on the persona above, plus the
|
|
72
99
|
# session's workspace directory appended at assembly time (`Your working
|
|
73
|
-
# directory is <cwd>.` — the one orientation fact the persona block carries)
|
|
74
|
-
#
|
|
75
|
-
#
|
|
76
|
-
#
|
|
77
|
-
#
|
|
78
|
-
# prefix, re-read on every request so file edits propagate, and drops the
|
|
79
|
-
# harness's own agent-instructions injections (they would duplicate the
|
|
80
|
-
# prompt). Set `instructionSource: hint` to restore the one-time non-imperative
|
|
81
|
-
# pointer to the reference files instead (issue #388, upstream
|
|
82
|
-
# dsh-anchored-standard #49: a full-text dump as context measurably flips the
|
|
83
|
-
# anchored trajectory), or `keepPlanPolicy: false` to drop plan mode's policy
|
|
84
|
-
# section as well.
|
|
100
|
+
# directory is <cwd>.` — the one orientation fact the persona block carries),
|
|
101
|
+
# with no platform-conditional text: both platform shells are persistent, so
|
|
102
|
+
# the persona block is byte-identical on every host. The official `tools:sdk`
|
|
103
|
+
# and `tools:ptc-only` sections are kept exactly when the assembly's wire
|
|
104
|
+
# carries the `run_code` transport.
|
|
85
105
|
#
|
|
86
|
-
# `
|
|
87
|
-
#
|
|
88
|
-
#
|
|
89
|
-
#
|
|
90
|
-
# the
|
|
91
|
-
#
|
|
92
|
-
# the
|
|
93
|
-
#
|
|
94
|
-
#
|
|
106
|
+
# `instructionSource` chooses where the AGENTS.md-style instruction files reach
|
|
107
|
+
# the model. The default, `host`, appends nothing and leaves the pre-step
|
|
108
|
+
# message batch untouched, so the `agent-instructions` row below delivers the
|
|
109
|
+
# baseline and the dynamic subdirectory instructions as the user-role messages
|
|
110
|
+
# the harness itself produces — the prompt stays the bare persona and the
|
|
111
|
+
# preset adds no instruction prose of its own. `system-prompt` instead reads
|
|
112
|
+
# the harness's baseline chain ($DSH_HOME/AGENTS.md, then the project root's
|
|
113
|
+
# ancestors down to the cwd) at assembly time and appends the content as one
|
|
114
|
+
# `workspace-instructions` section after the stable prefix, re-read on every
|
|
115
|
+
# request so file edits propagate, dropping the harness's own injections (they
|
|
116
|
+
# would duplicate the prompt). `hint` restores the one-time non-imperative
|
|
117
|
+
# pointer to the reference files (issue #388, upstream dsh-anchored-standard
|
|
118
|
+
# #49: a full-text dump as context measurably flips the trajectory). Both
|
|
119
|
+
# non-default modes trade the harness's own channel for a preset-owned one; the
|
|
120
|
+
# default keeps the upstream contract. Set `keepPlanPolicy: false` to drop
|
|
121
|
+
# plan mode's policy section as well.
|
|
95
122
|
#
|
|
96
|
-
# `
|
|
97
|
-
#
|
|
98
|
-
#
|
|
99
|
-
#
|
|
100
|
-
#
|
|
101
|
-
# The
|
|
102
|
-
#
|
|
103
|
-
#
|
|
123
|
+
# `tool-catalog` owns the wire presentation and the model-visible catalog.
|
|
124
|
+
# `presentation` selects the SDK ToolPresentationMode for the session's whole
|
|
125
|
+
# lifetime: `'ptc'` (default) collapses the wire to the `run_code` transport
|
|
126
|
+
# and reaches every other tool through the generated SDK, `'native'` keeps the
|
|
127
|
+
# assembled roster alone, and `'both'` keeps the roster and the transport
|
|
128
|
+
# co-resident. The shipped default is a static-context choice, not a measured
|
|
129
|
+
# win: the official scaffold comparison ranks this presentation below the native
|
|
130
|
+
# surface on both code-agent benchmarks, and the bundled benchmark matrix is how
|
|
131
|
+
# that trade would be settled locally. `pagedToolPatterns` (default `['mcp__*']`) names the
|
|
132
|
+
# high-fan-out families that stay paged out of the wire until activated; the
|
|
133
|
+
# active set replays from the session event stream, so resume and compaction
|
|
134
|
+
# rebuild it. `maxResidentTokens` (default 6000, calibrated above the shipped
|
|
135
|
+
# roster so the guard flags real growth rather than the factory configuration)
|
|
136
|
+
# guards the always-on-wire
|
|
137
|
+
# surface: crossing the estimate warns once and points at the patterns, rather
|
|
138
|
+
# than silently dropping a tool the session needs. The catalog itself is a
|
|
139
|
+
# durable user message appended after the
|
|
140
|
+
# user's own message, the way `dsh-tool-skill` injects the skill catalog: it
|
|
141
|
+
# names exactly the tools the current request's wire carries (each tool's
|
|
142
|
+
# argument signature plus a one-line summary capped by
|
|
143
|
+
# `descriptionMaxLength`; the full description stays in the tool schema) and
|
|
144
|
+
# summarizes the paged-out namespaces with their `tool_activate` pointer —
|
|
145
|
+
# including under `ptc`, where those namespaces really are unreachable until
|
|
146
|
+
# activated and the program contract says so. It republishes only when the
|
|
147
|
+
# content changes or the published copy left the visible surface (compaction,
|
|
148
|
+
# resume).
|
|
104
149
|
#
|
|
105
|
-
# `
|
|
106
|
-
#
|
|
107
|
-
#
|
|
108
|
-
# the
|
|
109
|
-
#
|
|
110
|
-
#
|
|
111
|
-
# than a rigid short-summary contract. The declaration is per session
|
|
112
|
-
# (`agent.ctx.tools.presentAs`), needs a mounted code runtime, and degrades to
|
|
113
|
-
# the native surface with a one-time warning when either is missing or fails.
|
|
114
|
-
# Set `false` to restore the pre-PTC behavior: the full native roster on the
|
|
115
|
-
# wire from the second turn.
|
|
150
|
+
# `tool-activate` registers the `tool_activate` tool the catalog points at:
|
|
151
|
+
# it validates the target against the session's paged, inactive namespaces and
|
|
152
|
+
# activates one onto the wire, evicting the least recently used namespace past
|
|
153
|
+
# the cap of three. `working-context` appends the one-line recency projection
|
|
154
|
+
# (`[Working Context: ...]`) folded from the session events, republished only
|
|
155
|
+
# when it changes.
|
|
116
156
|
- id: minimal-prompt
|
|
117
157
|
name: ./minimal-prompt.mjs
|
|
118
158
|
config:
|
|
119
159
|
keepPlanPolicy: true
|
|
120
|
-
instructionSource:
|
|
160
|
+
instructionSource: host
|
|
121
161
|
instructionMaxBytes: 65536
|
|
122
162
|
|
|
123
163
|
- id: tool-catalog
|
|
124
164
|
name: ./tool-catalog.mjs
|
|
125
165
|
config:
|
|
126
166
|
descriptionMaxLength: 200
|
|
127
|
-
|
|
128
|
-
|
|
167
|
+
presentation: 'both'
|
|
168
|
+
pagedToolPatterns: []
|
|
169
|
+
maxResidentTokens: 6000
|
|
170
|
+
|
|
171
|
+
- id: working-context
|
|
172
|
+
name: ./working-context.mjs
|
|
129
173
|
|
|
130
174
|
# The harness's workspace-instruction loader. Under the default
|
|
175
|
+
# `instructionSource: host` this row owns the channel: its baseline and dynamic
|
|
176
|
+
# user-role messages reach the model untouched. Under
|
|
131
177
|
# `instructionSource: system-prompt` the content reaches the model through the
|
|
132
|
-
# system prompt instead
|
|
133
|
-
# `minimal-prompt`; the
|
|
134
|
-
#
|
|
178
|
+
# system prompt instead and these injections are condensed or dropped by
|
|
179
|
+
# `minimal-prompt`; under `hint` the first is replaced by a pointer and the
|
|
180
|
+
# rest dropped. The row stays mounted in every mode: it is the default's whole
|
|
181
|
+
# delivery path, and its `maxBytes` remains the budget the other two consult.
|
|
135
182
|
- id: agent-instructions
|
|
136
183
|
name: '@deepseek-ai/dsh-agent-instructions'
|
|
137
184
|
config:
|
|
@@ -139,50 +186,14 @@
|
|
|
139
186
|
|
|
140
187
|
# ── shell ───────────────────────────────────────────────────────────────────
|
|
141
188
|
|
|
142
|
-
#
|
|
143
|
-
#
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
# session (both tools register the name `bash`), so shell state survives across
|
|
147
|
-
# calls.
|
|
148
|
-
- id: persistent-shell
|
|
149
|
-
name: cordis:group
|
|
150
|
-
group: true
|
|
189
|
+
# Standard Stdio shell tools: fresh subprocess per command with active-voice description
|
|
190
|
+
# cards, structured exit codes, and background job support. Exactly one mounts per host.
|
|
191
|
+
- id: tool-bash
|
|
192
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
151
193
|
disabled: !!js process.platform === 'win32'
|
|
152
|
-
isolate:
|
|
153
|
-
terminals: true
|
|
154
|
-
config:
|
|
155
|
-
- id: pty
|
|
156
|
-
name: '@deepseek-ai/dsh-terminal'
|
|
157
194
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
config:
|
|
161
|
-
timeoutMs: 300000
|
|
162
|
-
|
|
163
|
-
- id: persistent-bash
|
|
164
|
-
name: '@deepseek-ai/dsh-tool-bash-persistent'
|
|
165
|
-
config:
|
|
166
|
-
timeoutMs: 300000
|
|
167
|
-
description: |-
|
|
168
|
-
Run commands in a bash shell
|
|
169
|
-
* When invoking this tool, the contents of the "command" parameter does NOT need to be XML-escaped.
|
|
170
|
-
* You don't have access to the internet via this tool.
|
|
171
|
-
* You do have access to a mirror of common linux and python packages via apt and pip.
|
|
172
|
-
* State is persistent across command calls and discussions with the user.
|
|
173
|
-
* To inspect a particular line range of a file, e.g. lines 10-25, try 'sed -n 10,25p /path/to/the/file'.
|
|
174
|
-
* Please avoid commands that may produce a very large amount of output.
|
|
175
|
-
* Please run long lived commands in the background, e.g. 'sleep 10 &' or start a server in the background.
|
|
176
|
-
|
|
177
|
-
# Windows-only `bash` tool (custom-bash.mjs): the PTY backend above is
|
|
178
|
-
# linux/darwin-only, so win32 disables the persistent-shell group and
|
|
179
|
-
# registers this `bash` through the ordinary cross-platform subprocess seam
|
|
180
|
-
# (Git Bash). Both platforms end up with exactly one tool named `bash`.
|
|
181
|
-
# Non-zero exit is reported not thrown; state does NOT persist across calls on
|
|
182
|
-
# this path; no OS sandbox confinement on Windows. `bashPath` is optional
|
|
183
|
-
# (defaults to Git Bash inference); set it explicitly when git is not on PATH.
|
|
184
|
-
- id: custom-bash
|
|
185
|
-
name: ./custom-bash.mjs
|
|
195
|
+
- id: tool-pwsh
|
|
196
|
+
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
186
197
|
disabled: !!js process.platform !== 'win32'
|
|
187
198
|
|
|
188
199
|
# ── filesystem ──────────────────────────────────────────────────────────────
|