@linxin666/dsh-liangshen 0.3.20 → 0.3.21

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.
@@ -1,13 +1,26 @@
1
- # The `liangshen` (梁神模式) agent preset: phase 1 exposes the builtin Minimal
2
- # preset's exact two tools (persistent `bash` plus `str_replace_editor`) and
3
- # the same one-line persona, with no runtime contexts and no injected pre-step
4
- # messages, anchoring the Minimal trajectory; after a stabilized anchor the
5
- # wire switches to PTC Mode and the ordinary injections open. The
6
- # phase-1 surface matches the official "exact RL prompt and schemas" snapshot
7
- # byte-for-byte on the model-visible wire shape, at the cost of keeping the
8
- # persistent shell for the whole session. Unlike the builtin Minimal preset,
9
- # the phase-1 editor inherits the host file sandbox instead of mounting a bare
10
- # local filesystem (see the filesystem section below).
1
+ # The `liangshen` (梁神模式) agent preset: the builtin Minimal preset's
2
+ # one-line persona — extended with the mode's standing working discipline and
3
+ # the session's workspace directory — as the WHOLE system prompt, with the
4
+ # session's tool surface staged behind the anchor turn and PTC presentation
5
+ # taking over after it. The session's first request runs the builtin Minimal
6
+ # surface exactly — the short persona block plus the single `anchorTools`
7
+ # schema (`bash`), natively presented — and from the second turn this session
8
+ # presents its tools in PTC mode: the wire carries the single `run_code`
9
+ # transport, and every other tool is reached from inside the program through
10
+ # the generated SDK. The capability facts the Standard system prompt would
11
+ # carry as tool-guidance prose — and, under PTC, the SDK bindings and the
12
+ # collapse rule that `minimal-prompt` filters out of the prompt along with
13
+ # every other section — arrive instead as a durable `tool-catalog` message
14
+ # appended after the user's own message from the FIRST turn on, the way the
15
+ # skill catalog is injected; it names the PTC surface (each tool's argument
16
+ # signature plus a one-line summary) from the start, so the model knows the
17
+ # promoted surface before the schemas arrive. The one wire transition is the
18
+ # deterministic turn boundary: no reasoning-block gating, no output budget cap.
19
+ #
20
+ # The persistent shell replaces the Standard ephemeral shell for the whole
21
+ # session (both register the name `bash`), and the editor inherits the host
22
+ # file sandbox instead of mounting a bare local filesystem — see the shell and
23
+ # filesystem sections below.
11
24
  #
12
25
  # Adapted from the builtin `minimal` and `standard` presets.
13
26
  #
@@ -30,82 +43,101 @@
30
43
 
31
44
  # ── identity ────────────────────────────────────────────────────────────────
32
45
 
33
- # Phase 1 shows only this one-line persona: `tool-bootstrap` filters the
34
- # assembled sections down to the persona section (`deployment:persona`, the
35
- # name `dsh-persona` registers under, plus the legacy `persona` name) during
36
- # phase 1 and restores every section after promotion, appending the session's
37
- # working directory to the persona — so the agent knows its workspace and
38
- # plan-mode's `plan:policy` takes effect instead of being permanently
39
- # shadowed by a `complete` persona.
46
+ # The persona prefix below is the preset's entire system prompt base:
47
+ # `minimal-prompt` narrows the assembled sections down to it (plus plan mode's
48
+ # `plan:policy`, which no tool restriction backs — see that plugin) and
49
+ # appends the session's workspace directory at assembly time, so identity,
50
+ # harness, web-surface, and tool-guidance sections never reach the model.
51
+ # Besides the one-line persona it carries the standing working discipline the
52
+ # mode ships with (thinking loops, design-first reasoning, YAGNI/PDCA, no
53
+ # code comments). Runtime context snapshots stay enabled: they are durable
54
+ # user-role messages, not system-prompt text.
40
55
  - id: persona
41
56
  name: '@deepseek-ai/dsh-persona'
42
57
  config:
43
- text: You are a helpful software engineer assistant.
44
-
45
- # Two-phase input bootstrap with the exact Minimal phase-1 tools. Before the
46
- # first durable tool/call event the model sees only persistent `bash` plus
47
- # `str_replace_editor`, only the `persona` prompt section, no runtime
48
- # contexts, and only whitelisted source kinds (direct user messages plus
49
- # goal auto-rounds — a filtered-out `/goal` round never reaches the model, so
50
- # no promotion branch fires and the resume/pause loop deadlocks, issue #578).
51
- # `anchorGate` holds the promotion
52
- # open until the first reasoning block is minimal-like (four-step fallback);
53
- # `promoteAfterFirstResponse` avoids a permanent two-tool session after a
54
- # tool-less first response, and releases an anchor-gated session once its
55
- # first turn ends (`turn/end`). After promotion the catalog is presented as
56
- # PTC Mode: a single `run_code` tool on the wire, switched at the step
57
- # boundary; workspace instructions and the skill catalog are deferred one
58
- # step after promotion. `bootstrapMaxTokens` caps the phase-1 request output
59
- # budget (community-observed "We need" trigger window, 1024) and is stripped
60
- # again after promotion so the cap never solders into later requests.
61
- # After a compaction the session falls back to the controlled phase — the
62
- # bootstrap pair plus `compactionTools` (a core work set) — until a NEW
63
- # promotion signal exists past the boundary, and PTC Mode is released until
64
- # the session re-promotes.
65
- # `phase1FirstCallInstruction` is an opt-in extra line appended to the
66
- # phase-1 persona for test builds (issue #274): the model is asked to ground
67
- # its first answer with one Minimal-native tool call before responding, so
68
- # first-turn capability questions are answered from the promoted registry
69
- # instead of the cropped two-tool view. It deviates from the byte-exact
70
- # Minimal surface and is therefore left unset (off) by default.
71
- - id: tool-bootstrap
72
- name: ./tool-bootstrap.mjs
58
+ prefix: |-
59
+ You are a helpful software engineer assistant.
60
+
61
+ - Avoid falling into repetitive loops during thinking; exit immediately once a loop is detected.
62
+ - Focus thinking on requirement understanding and solution design (key points, workflow, verification strategy), without pre-rehearsing specific code implementation. Code should be output during the "Do" phase based on the actual state of files, with correctness verified by the "Check" phase.
63
+ - When writing code, follow the YAGNI programming philosophy and the PDCA behavioral standard.
64
+ - No need to write comments for the code.
65
+
66
+ # The two halves of the mode, both preset-local plugins:
67
+ #
68
+ # `minimal-prompt` keeps the system prompt on the persona above, plus the
69
+ # session's workspace directory appended at assembly time (`Your working
70
+ # directory is <cwd>.` — the one orientation fact the persona block carries).
71
+ # It also lifts the AGENTS.md-style instruction files into the system prompt
72
+ # itself: at assembly time it reads the harness's baseline chain
73
+ # ($DSH_HOME/AGENTS.md, then the project root's ancestors down to the cwd) and
74
+ # appends the content as one `workspace-instructions` section after the stable
75
+ # prefix, re-read on every request so file edits propagate, and drops the
76
+ # harness's own agent-instructions injections (they would duplicate the
77
+ # prompt). Set `instructionSource: hint` to restore the one-time non-imperative
78
+ # pointer to the reference files instead (issue #388, upstream
79
+ # dsh-anchored-standard #49: a full-text dump as context measurably flips the
80
+ # anchored trajectory), or `keepPlanPolicy: false` to drop plan mode's policy
81
+ # section as well.
82
+ #
83
+ # `tool-catalog` appends the model-visible tool catalog — each tool's argument
84
+ # signature plus a one-line summary — as a durable user message after the
85
+ # user's own message from the first turn on, the way `dsh-tool-skill` injects
86
+ # the skill catalog. It republishes only when that catalog's content changes or
87
+ # the published copy left the visible surface (compaction, resume), so the
88
+ # catalog is not appended once per step. `descriptionMaxLength` caps each
89
+ # one-line summary; the full description stays in the tool schema.
90
+ #
91
+ # `anchorTools` stages the tool SCHEMAS behind the anchor turn: while the
92
+ # session is in its first turn the assembled wire narrows to these schemas and
93
+ # the session keeps native presentation, while the catalog already names the
94
+ # promoted surface (entries come from the registry, not from the narrowed
95
+ # wire). The shipped anchor is `bash` alone — the builtin Minimal surface — so
96
+ # the first request carries one schema and nothing else; execution resolves by
97
+ # name against the session registry, independent of what the request declares.
98
+ # Set it to an empty list to disable the narrowing entirely.
99
+ #
100
+ # `ptcPresentation` declares this session's tools in PTC mode from the second
101
+ # turn on: the wire collapses to the reserved `run_code` transport and every
102
+ # other tool is reached inside the program through the generated SDK, which the
103
+ # injected catalog names because `minimal-prompt` filters the harness's own
104
+ # `tools:sdk` and `tools:ptc-only` sections out of the prompt. The declaration
105
+ # is per session (`agent.ctx.tools.presentAs`), needs a mounted code runtime,
106
+ # and degrades to the native surface with a one-time warning when either is
107
+ # missing. Set `false` to restore the pre-PTC behavior: the full native roster
108
+ # on the wire from the second turn.
109
+ - id: minimal-prompt
110
+ name: ./minimal-prompt.mjs
111
+ config:
112
+ keepPlanPolicy: true
113
+ instructionSource: system-prompt
114
+ instructionMaxBytes: 65536
115
+
116
+ - id: tool-catalog
117
+ name: ./tool-catalog.mjs
73
118
  config:
74
- shellTools: [bash]
75
- commonTools: [str_replace_editor]
76
- messageSources: [user, goal]
77
- anchorGate: true
78
- maxBootstrapSteps: 4
79
- promoteAfterFirstResponse: true
80
- bootstrapMaxTokens: 1024
81
- compactionTools: [read, write, edit, glob, grep, todo_write, ask_user_question]
82
- deferredSources: [agent-instructions, skill-catalog]
83
- deferredGraceSteps: 1
84
- promotedPresentation: code
85
- # Issue #388: after promotion, inject one non-imperative hint (reference
86
- # files exist at these paths; read them on demand) instead of the full
87
- # AGENTS.md dump — the full-text injection measurably flips the anchored
88
- # trajectory (upstream dsh-anchored-standard #49, E1/E1.5/E2). Knowledge
89
- # stays reachable through read / skill_load. Set false to restore the
90
- # legacy full-text injection.
91
- instructionHint: true
92
- # phase1FirstCallInstruction: After your first reasoning block, before answering, make one tool call (for example run `pwd` through the shell or view a workspace file) and base your answer on its result.
93
-
94
- # Workspace instructions are quarantined by `tool-bootstrap` during phase 1
95
- # and deferred one step after promotion, then stay current.
119
+ descriptionMaxLength: 200
120
+ anchorTools: [bash]
121
+ ptcPresentation: true
122
+
123
+ # The harness's workspace-instruction loader. Under the default
124
+ # `instructionSource: system-prompt` the content reaches the model through the
125
+ # system prompt instead, and this row's injections are dropped by
126
+ # `minimal-prompt`; the row stays mounted so `instructionSource: hint` keeps
127
+ # its pointer behavior working, and its `maxBytes` remains that mode's budget.
96
128
  - id: agent-instructions
97
129
  name: '@deepseek-ai/dsh-agent-instructions'
98
130
  config:
99
131
  maxBytes: 65536
100
132
 
101
- # ── minimal phase-1 shell ───────────────────────────────────────────────────
133
+ # ── shell ───────────────────────────────────────────────────────────────────
102
134
 
103
135
  # The PTY registry is an agent-owned service, so it lives in an entry-local
104
136
  # realm. The backend still consumes the host sandbox policy and subprocess
105
137
  # implementation, while the tool registers into this agent's scoped catalog.
106
138
  # This persistent `bash` replaces the Standard ephemeral shell for the WHOLE
107
- # session (both tools register the name `bash`), which is the exact-Minimal
108
- # tradeoff this experimental preset evaluates.
139
+ # session (both tools register the name `bash`), so shell state survives across
140
+ # calls.
109
141
  - id: persistent-shell
110
142
  name: cordis:group
111
143
  group: true
@@ -138,23 +170,20 @@
138
170
  # Windows-only `bash` tool (custom-bash.mjs): the PTY backend above is
139
171
  # linux/darwin-only, so win32 disables the persistent-shell group and
140
172
  # registers this `bash` through the ordinary cross-platform subprocess seam
141
- # (Git Bash). Both platforms end up with exactly one tool named `bash`, so the
142
- # phase-1 Minimal anchor (shellTools: [bash] + str_replace_editor) is
143
- # unchanged. Non-zero exit is reported not thrown; state does NOT persist
144
- # across calls on this path; no OS sandbox confinement on Windows. `bashPath`
145
- # is optional (defaults to Git Bash inference); set it explicitly when git is
146
- # not on PATH.
173
+ # (Git Bash). Both platforms end up with exactly one tool named `bash`.
174
+ # Non-zero exit is reported not thrown; state does NOT persist across calls on
175
+ # this path; no OS sandbox confinement on Windows. `bashPath` is optional
176
+ # (defaults to Git Bash inference); set it explicitly when git is not on PATH.
147
177
  - id: custom-bash
148
178
  name: ./custom-bash.mjs
149
179
  disabled: !!js process.platform !== 'win32'
150
180
 
151
- # ── minimal phase-1 filesystem ──────────────────────────────────────────────
181
+ # ── filesystem ──────────────────────────────────────────────────────────────
152
182
 
153
- # Phase-1 editor as a direct top-level row: it reuses the host's sandboxed
183
+ # The editor is a direct top-level row: it reuses the host's sandboxed
154
184
  # `ctx.fs`, not a bare local filesystem. No `dsh-fs-local` realm is mounted, so
155
- # the phase-1 editor inherits the host file sandbox exactly like every
156
- # Standard file tool, and the model-facing schema stays the builtin Minimal
157
- # `str_replace_editor`.
185
+ # it inherits the host file sandbox exactly like every Standard file tool, and
186
+ # the model-facing schema stays the builtin Minimal `str_replace_editor`.
158
187
  - id: str-replace-editor
159
188
  name: '@deepseek-ai/dsh-tool-str-replace-editor'
160
189
  config:
@@ -189,8 +218,7 @@
189
218
  # `skill-filesystem` contributes local-root discovery for agents on this preset, and
190
219
  # `tool-skill` gives them the catalog and loader; the merged catalog also
191
220
  # carries whatever the deployment registered globally (repository plugins).
192
- # The `skill-catalog` pre-step message is quarantined by `tool-bootstrap`
193
- # during phase 1 and deferred one step after promotion, then stays current.
221
+ # The `skill-catalog` pre-step message stays current like any other injection.
194
222
  - id: skill-filesystem
195
223
  name: '@deepseek-ai/dsh-skill-filesystem'
196
224
 
@@ -211,7 +239,10 @@
211
239
  # ── plan mode ───────────────────────────────────────────────────────────────
212
240
 
213
241
  # Plan state is per-agent by nature, so an entry-local realm is not a
214
- # workaround here — it is the correct lifetime.
242
+ # workaround here — it is the correct lifetime. `minimal-prompt` keeps this
243
+ # row's `plan:policy` section in the otherwise one-line system prompt, because
244
+ # the section is the only thing that enforces plan mode: the exit tool stays
245
+ # registered in every mode and no tool restriction backs the policy.
215
246
  - id: planning
216
247
  name: cordis:group
217
248
  group: true
@@ -334,8 +365,13 @@
334
365
  config:
335
366
  provider: spawn
336
367
 
368
+ # Keep the engine above for `ralph`, but do not publish a second
369
+ # model-authored orchestration surface beside `run_code`: this is the one
370
+ # roster difference the builtin `ptc` preset ships with, and the mode's
371
+ # whole promoted surface is run_code.
337
372
  - id: tool-workflow
338
373
  name: '@deepseek-ai/dsh-tool-workflow'
374
+ disabled: true
339
375
 
340
376
  - id: tool-ralph
341
377
  name: '@deepseek-ai/dsh-tool-ralph'
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * custom-bash — a Windows-capable `bash` tool for the liangshen preset. It
3
- * registers under the SAME name (`bash`) as the persistent shell so the
4
- * phase-1 Minimal anchor (bash + str_replace_editor) holds on every platform,
5
- * but executes through `ctx.subprocess.spawn` instead of a PTY.
3
+ * registers under the SAME name (`bash`) as the persistent shell so every
4
+ * platform exposes one shell tool of that name, but executes through
5
+ * `ctx.subprocess.spawn` instead of a PTY.
6
6
  *
7
7
  * WHY: DSH's PTY backend is linux/darwin-only — subprocess-local throws
8
8
  * "terminal inspection is unsupported on platform win32", so the
9
9
  * persistent-shell group (dsh-terminal + dsh-terminal-bash +
10
10
  * dsh-tool-bash-persistent) cannot spawn on Windows. agent.cordis.yml disables
11
11
  * that group on win32 and enables this tool instead; both platforms end up
12
- * with exactly one `bash` tool and the byte-exact schema anchor is kept.
12
+ * with exactly one `bash` tool.
13
13
  *
14
14
  * Executable resolution (config `bashPath`, no hardcoded install path):
15
15
  * an explicit non-empty `bashPath` wins unconditionally. Unset, the Git Bash