ceulen-dsh 0.2.11 → 0.2.12

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.
Files changed (35) hide show
  1. package/README.md +49 -10
  2. package/cordis.patch.yml +20 -1
  3. package/lib/modules/codemode/script.d.ts +30 -1
  4. package/lib/modules/codemode/script.d.ts.map +1 -1
  5. package/lib/modules/codemode/script.js +80 -8
  6. package/lib/modules/codemode/script.js.map +1 -1
  7. package/lib/modules/serena/index.d.ts +25 -0
  8. package/lib/modules/serena/index.d.ts.map +1 -1
  9. package/lib/modules/serena/index.js +113 -9
  10. package/lib/modules/serena/index.js.map +1 -1
  11. package/lib/modules/skills/index.js +1 -1
  12. package/lib/modules/steering/bash-search.d.ts +7 -0
  13. package/lib/modules/steering/bash-search.d.ts.map +1 -1
  14. package/lib/modules/steering/bash-search.js +13 -0
  15. package/lib/modules/steering/bash-search.js.map +1 -1
  16. package/lib/modules/steering/index.d.ts.map +1 -1
  17. package/lib/modules/steering/index.js +20 -3
  18. package/lib/modules/steering/index.js.map +1 -1
  19. package/package.json +3 -1
  20. package/parity.json +15 -7
  21. package/scripts/ceulen-sync.mjs +4 -1
  22. package/scripts/check-bundle.mjs +23 -1
  23. package/scripts/check-pack.mjs +8 -21
  24. package/scripts/pack-contract.mjs +37 -0
  25. package/scripts/smoke-install.mjs +146 -0
  26. package/scripts/spill-page.mjs +64 -0
  27. package/scripts/steer-fixtures/fixtures.mjs +148 -0
  28. package/scripts/steer-fixtures/ws/fixtures/runbook.txt +7 -0
  29. package/scripts/steer-fixtures/ws/package.json +5 -0
  30. package/scripts/steer-fixtures/ws/src/cart.js +18 -0
  31. package/scripts/steer-fixtures/ws/src/format.js +6 -0
  32. package/scripts/steer-fixtures/ws/sum.js +4 -0
  33. package/scripts/steer-fixtures/ws/tools/stamp.js +4 -0
  34. package/scripts/steer-fixtures.mjs +180 -0
  35. package/upstream.lock.json +4 -4
package/README.md CHANGED
@@ -74,7 +74,7 @@ DSH has no `tui` template, so the second command installs two things into the
74
74
  `dsh plugin`, which runs the package manager inside the profile and mounts
75
75
  the bundle there; a plain `npm install ceulen-dsh` only downloads it.
76
76
 
77
- To pin a release, name it: `ceulen-dsh@0.2.11`.
77
+ To pin a release, name it: `ceulen-dsh@0.2.12`.
78
78
 
79
79
  ### Install a release tarball
80
80
 
@@ -84,7 +84,7 @@ then:
84
84
 
85
85
  ```sh
86
86
  npm install -g @deepseek-ai/dsh@0.2.2-rc.1
87
- dsh plugin --profile tui add @deepseek-harness-tui/dsh-tui@0.20.2 file:/absolute/path/to/ceulen-dsh-0.2.11.tgz
87
+ dsh plugin --profile tui add @deepseek-harness-tui/dsh-tui@0.20.2 file:/absolute/path/to/ceulen-dsh-0.2.12.tgz
88
88
  dsh --profile tui
89
89
  ```
90
90
 
@@ -101,13 +101,13 @@ npm ci --include=dev
101
101
  ./release/build.sh
102
102
 
103
103
  # Install BOTH the TUI app and this bundle into a new profile.
104
- ./release/install.sh --profile tui --with-tui --tarball "$PWD/release/ceulen-dsh-0.2.11.tgz"
104
+ ./release/install.sh --profile tui --with-tui --tarball "$PWD/release/ceulen-dsh-0.2.12.tgz"
105
105
  dsh --profile tui
106
106
  ```
107
107
 
108
108
  The installer creates the profile under `${DSH_HOME:-$HOME/.dsh}/profiles/tui`
109
109
  and does not replace an existing profile's settings. To share the build, send
110
- `release/ceulen-dsh-0.2.11.tgz`; the other machine needs no clone and no build.
110
+ `release/ceulen-dsh-0.2.12.tgz`; the other machine needs no clone and no build.
111
111
 
112
112
  ### Develop from a checkout
113
113
 
@@ -134,7 +134,7 @@ not hot-reload.
134
134
  /ceulen doctor # compatibility and optional-backend diagnostics
135
135
  ```
136
136
 
137
- `/ceulen` shows the release line (`ceulen-dsh 0.2.11 (stable)`), the pinned
137
+ `/ceulen` shows the release line (`ceulen-dsh 0.2.12 (stable)`), the pinned
138
138
  Ceulen version, and which modules are mounted. The bundle composes 34 rows.
139
139
 
140
140
  To upgrade, run `dsh plugin --profile tui add ceulen-dsh@latest` (or install a
@@ -143,9 +143,9 @@ newer tarball into the same profile) and restart. Your settings are kept.
143
143
 
144
144
  ### Release line
145
145
 
146
- `package.json` carries this bundle's own version (`0.2.11`) plus
146
+ `package.json` carries this bundle's own version (`0.2.12`) plus
147
147
  `release: { line: "stable", distTag: "stable" }`. The upstream Ceulen version it
148
- tracks lives in `upstream.lock.json` (`0.23.0`). The update check follows the
148
+ tracks lives in `upstream.lock.json` (`0.31.0`). The update check follows the
149
149
  `stable` npm dist-tag only, and reports `unknown` when that tag is missing
150
150
  rather than offering another line as an upgrade. `/ceulen doctor` prints the
151
151
  line and dist-tag.
@@ -446,7 +446,7 @@ Every area below is a module. `/ceulen modules` lists them, and
446
446
  | RTK | `rtk` tool and `/rtk`: rewrite a supported command, then run it with bash |
447
447
  | NotebookLM | `notebooklm` CLI bridge with gates for destructive and login actions |
448
448
  | A2A | `a2a_peers`, `a2a_list`, `a2a_call`, `a2a_status`: outbound calls to other agents |
449
- | Serena | `/serena`: status and the exact MCP row to add |
449
+ | Serena | `/serena`: status and the exact MCP row to add (it follows the installed serena-agent version); `/serena cold` keeps the navigation tools in the list and holds the rest |
450
450
  | Tool budget | `/ceulen tools` shows what the tool schemas cost; `tools.cold` holds rarely used tools out of the prompt and `ceulen_tools` finds and calls them on demand |
451
451
 
452
452
  ### Memory, models and interface
@@ -570,7 +570,10 @@ return results.map(result => result.status === 'fulfilled' ? result.value : Stri
570
570
  - Calls resolve to structured values (bash output is `r.stdout.text`; `read`
571
571
  returns `{ lines: [{ number, text }] }`).
572
572
  - Output past about 6k characters is truncated in the middle and the full text
573
- is written to a file named in the result.
573
+ is written to `$DSH_HOME/ceulen/spill/` (kept 48 hours; not `/tmp`, which a
574
+ sandboxed shell cannot see: see "Where large tool results go"). The notice says which parts were cut and prints
575
+ the command that reads one part back (`scripts/spill-page.mjs`), sized to
576
+ fit the same budget.
574
577
  - A first line `// @options: {"timeout_ms": 60000, "max_output_chars": 4000}`
575
578
  changes the deadline (default 120 s, max 600 s) and the output budget.
576
579
  - `state.store({ key, value })` and `state.load({ key })` keep small JSON
@@ -627,7 +630,8 @@ For routes listed in `steering.models` (default `deepseek-v4.1-flash` and
627
630
  when it pays;
628
631
  - a bash call that only greps, cats or finds files is not run. The reply names
629
632
  the equivalent `grep`, `read` or `glob` call. Sending the same command again
630
- runs it. `steering.bashLookups: "off"` disables this;
633
+ runs it, and so does a command you typed out yourself in your message.
634
+ `steering.bashLookups: "off"` disables this;
631
635
  - a bash call that only takes headless-Chrome screenshots is redirected to
632
636
  `web_screenshot` the same way;
633
637
  - `web_interact` gains named browser sessions, a `hover` step, `text=Label`
@@ -904,6 +908,24 @@ node scripts/ceulen-sync.mjs bump --version <new>
904
908
  Files marked `patched` are never overwritten; they become a manual-merge
905
909
  report. Nothing from upstream is executed.
906
910
 
911
+ ## Where large tool results go
912
+
913
+ DSH cuts a tool result that is too large for the prompt and stores the full
914
+ text in a file named in the result (`spill-local`). Its default place is a
915
+ fresh directory under the OS temp directory. In the workspace-write sandbox
916
+ the shell gets a private, empty `/tmp`, so `bash` cannot open that file: the
917
+ `read` and `grep` tools still can, but a model that reaches for `grep -o` or
918
+ `sed` on a one-line JSON result is told the file does not exist.
919
+
920
+ The bundle therefore sets the spill root to `$DSH_HOME/spill`, which every
921
+ sandbox mode can read, and removes files older than seven days at startup.
922
+ For the stock behaviour, add this to your profile's `cordis.patch.yml`:
923
+
924
+ ```yaml
925
+ - id: spill-local
926
+ config: {}
927
+ ```
928
+
907
929
  ## Development
908
930
 
909
931
  ```sh
@@ -921,6 +943,23 @@ runs from the full development checkout.
921
943
  `./scripts/dev-profile.sh` creates a workspace-local `DSH_HOME` and prints the
922
944
  composed profile without touching `~/.dsh`.
923
945
 
946
+ Two checks run by hand, because they need the network or a model:
947
+
948
+ ```sh
949
+ node scripts/smoke-install.mjs <version> # after a publish: install it and check the payload
950
+ node scripts/steer-fixtures.mjs # after a steering change: six cold tasks on the model
951
+ ```
952
+
953
+ `smoke-install` installs the published package into a throwaway directory and
954
+ fails unless the version, the required files and the skill packs are there and
955
+ nothing private is (`docs/`, `test/`, `src/`, the personal agent-mode plugin,
956
+ a path under your home directory). `--tarball <file>` checks a local tarball
957
+ the same way before the publish.
958
+
959
+ `steer-fixtures` runs six one-shot tasks with steering on, off and unloaded,
960
+ each under its own `DSH_HOME`, and exits non-zero when steering on scores below
961
+ the best loadout without it. It spends about 18 short model calls.
962
+
924
963
  `npm run bench:search -- --max 8` compares Brave with DeepSeek's own search on
925
964
  the same queries. Brave needs `BRAVE_API_KEY`; the DeepSeek side needs
926
965
  `DEEPSEEK_API_KEY` or a signed-in account.
package/cordis.patch.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  # ceulen-dsh bundle patch.
2
2
  #
3
- # One insert list applied over the profile root. Every row is its own Cordis
3
+ # An insert list applied over the profile root, then the few harness rows the
4
+ # bundle reconfigures (listed in scripts/check-bundle.mjs). Every inserted row is its own Cordis
4
5
  # plugin entry point (`ceulen-dsh/modules/<name>`), so a broken or unwanted
5
6
  # module can be disabled by row id without touching the others:
6
7
  #
@@ -81,3 +82,21 @@
81
82
  name: 'ceulen-dsh/modules/goal-retry'
82
83
  - id: ceulen-notebooklm
83
84
  name: 'ceulen-dsh/modules/notebooklm'
85
+
86
+ # Where DSH keeps a tool result that was too large for the prompt
87
+ # (spill-local). Its default is a fresh directory under the OS temp directory,
88
+ # and the workspace-write sandbox hides that from the shell: bwrap mounts a
89
+ # private /tmp. The notice then names a path that `bash` cannot open, and a
90
+ # model that reaches for grep or sed there concludes the result is gone
91
+ # (measured 2026-11-24 on a one-line JSON result). Under $DSH_HOME the path is
92
+ # readable in every sandbox mode; files older than a week go at startup. For
93
+ # the stock behaviour, put `- id: spill-local` with `config: {}` in your
94
+ # profile patch.
95
+ - id: spill-local
96
+ config: !!js >-
97
+ (() => {
98
+ const os = process.getBuiltinModule('node:os')
99
+ const path = process.getBuiltinModule('node:path')
100
+ const home = (process.env.DSH_HOME ?? '').trim()
101
+ return { root: path.join(home === '' ? path.join(os.homedir(), '.dsh') : home, 'spill'), cleanupPeriodDays: 7 }
102
+ })()
@@ -14,11 +14,40 @@ export interface ScriptOptions {
14
14
  * or misplaced line fails the call before the program runs.
15
15
  */
16
16
  export declare function parseOptionsLine(code: string): ScriptOptions;
17
+ /**
18
+ * Where a spilled output goes: `$DSH_HOME/ceulen/spill`, not the OS temp
19
+ * directory. The workspace-write sandbox gives the shell a private, empty
20
+ * `/tmp` (bwrap `--tmpfs /tmp`), so a file the harness wrote there does not
21
+ * exist for the bash call that is told to read it back. The home directory is
22
+ * bound read-only into every sandbox mode. Old files are dropped here because
23
+ * nothing else cleans this directory. Falls back to the temp directory when
24
+ * the home cannot be written.
25
+ */
26
+ export declare function spillDirectory(now?: number): string;
27
+ /** Bounds of one part when a spilled output is read back. */
28
+ export declare const MIN_SPILL_PART = 100;
29
+ export declare const MAX_SPILL_PART = 8000;
30
+ /** `index`, moved back by one when it would fall between the two halves of a surrogate pair. */
31
+ export declare function safeCut(text: string, index: number): number;
32
+ /**
33
+ * Characters per part when a spilled output is read back under budget `cap`.
34
+ * 0.4 of the budget: a part that comes back through codemode again, as a JSON
35
+ * string with every character escaped to two, still fits, so reading a spill
36
+ * can never produce the next spill.
37
+ */
38
+ export declare function spillPartChars(cap: number): number;
39
+ /** The command that prints part `part` (1-based) of a spilled output: scripts/spill-page.mjs. */
40
+ export declare function spillPageCommand(path: string, part: number, chars: number): string;
17
41
  /**
18
42
  * Pi's max_output_tokens shape: keep the head and tail of an oversized
19
43
  * return+console block, note how much was cut, and spill the full text to a
20
- * temp file whose path stays in the result. The runtime's hard byte cap
44
+ * file (see spillDirectory) whose path stays in the result. The runtime's hard byte cap
21
45
  * (output-limit) never fires for a model that stays anywhere near the budget.
46
+ *
47
+ * The notice names a command that reads the cut back, because the obvious
48
+ * moves fail: `read` caps long lines and a JSON result is one line, `cat`
49
+ * returns the whole file over the budget again, and a byte cut splits
50
+ * multi-byte characters. Parts are sized from the active budget.
22
51
  */
23
52
  export declare function applyOutputBudget(valueText: string, consoleBlock: string, cap: number): string;
24
53
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../src/modules/codemode/script.ts"],"names":[],"mappings":"AAKA,kEAAkE;AAClE,eAAO,MAAM,qBAAqB,OAAQ,CAAA;AAC1C,eAAO,MAAM,iBAAiB,MAAM,CAAA;AACpC,eAAO,MAAM,iBAAiB,QAAS,CAAA;AAEvC,kFAAkF;AAClF,eAAO,MAAM,cAAc,OAAQ,CAAA;AACnC,eAAO,MAAM,cAAc,SAAU,CAAA;AAErC,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAQD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CA8B5D;AAID;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAU9F;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAY5F;AAOD,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUjF;AAED,wFAAwF;AACxF,eAAO,MAAM,aAAa,4BAA4B,CAAA;AAEtD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAevD;AAiBD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD"}
1
+ {"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../src/modules/codemode/script.ts"],"names":[],"mappings":"AAM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AAG,SAAS,CAUjF;AAED,wFAAwF;AACxF,eAAO,MAAM,aAAa,4BAA4B,CAAA;AAEtD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAevD;AAiBD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD"}
@@ -1,6 +1,7 @@
1
- import { writeFileSync } from 'node:fs';
1
+ import { mkdirSync, readdirSync, rmSync, statSync, writeFileSync } from 'node:fs';
2
2
  import { tmpdir } from 'node:os';
3
3
  import { join } from 'node:path';
4
+ import { ceulenHome, packageFile } from '../../core/paths.js';
4
5
  import { editDistance } from '../../core/tools.js';
5
6
  /** The script's return + console block budget, and its bounds. */
6
7
  export const DEFAULT_OUTPUT_BUDGET = 6_000;
@@ -52,23 +53,94 @@ export function parseOptionsLine(code) {
52
53
  return options;
53
54
  }
54
55
  let spillSequence = 0;
56
+ /** Spilled outputs older than this are removed when the next one is written. */
57
+ const SPILL_MAX_AGE_MS = 48 * 60 * 60 * 1000;
58
+ /**
59
+ * Where a spilled output goes: `$DSH_HOME/ceulen/spill`, not the OS temp
60
+ * directory. The workspace-write sandbox gives the shell a private, empty
61
+ * `/tmp` (bwrap `--tmpfs /tmp`), so a file the harness wrote there does not
62
+ * exist for the bash call that is told to read it back. The home directory is
63
+ * bound read-only into every sandbox mode. Old files are dropped here because
64
+ * nothing else cleans this directory. Falls back to the temp directory when
65
+ * the home cannot be written.
66
+ */
67
+ export function spillDirectory(now = Date.now()) {
68
+ const dir = join(ceulenHome(), 'spill');
69
+ try {
70
+ mkdirSync(dir, { recursive: true, mode: 0o700 });
71
+ for (const name of readdirSync(dir)) {
72
+ if (!name.startsWith('codemode-output-'))
73
+ continue;
74
+ const path = join(dir, name);
75
+ if (now - statSync(path).mtimeMs > SPILL_MAX_AGE_MS)
76
+ rmSync(path, { force: true });
77
+ }
78
+ return dir;
79
+ }
80
+ catch {
81
+ return tmpdir();
82
+ }
83
+ }
84
+ /** Bounds of one part when a spilled output is read back. */
85
+ export const MIN_SPILL_PART = 100;
86
+ export const MAX_SPILL_PART = 8_000;
87
+ /** `index`, moved back by one when it would fall between the two halves of a surrogate pair. */
88
+ export function safeCut(text, index) {
89
+ if (index <= 0)
90
+ return 0;
91
+ if (index >= text.length)
92
+ return text.length;
93
+ const before = text.charCodeAt(index - 1);
94
+ const after = text.charCodeAt(index);
95
+ return before >= 0xd800 && before <= 0xdbff && after >= 0xdc00 && after <= 0xdfff ? index - 1 : index;
96
+ }
97
+ /**
98
+ * Characters per part when a spilled output is read back under budget `cap`.
99
+ * 0.4 of the budget: a part that comes back through codemode again, as a JSON
100
+ * string with every character escaped to two, still fits, so reading a spill
101
+ * can never produce the next spill.
102
+ */
103
+ export function spillPartChars(cap) {
104
+ return clamp(Math.floor(cap * 0.4), MIN_SPILL_PART, MAX_SPILL_PART);
105
+ }
106
+ function shellArg(value) {
107
+ return /^[\w@%+=:,./-]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
108
+ }
109
+ /** The command that prints part `part` (1-based) of a spilled output: scripts/spill-page.mjs. */
110
+ export function spillPageCommand(path, part, chars) {
111
+ return [process.execPath, packageFile('scripts', 'spill-page.mjs'), path, String(part), String(chars)].map(shellArg).join(' ');
112
+ }
55
113
  /**
56
114
  * Pi's max_output_tokens shape: keep the head and tail of an oversized
57
115
  * return+console block, note how much was cut, and spill the full text to a
58
- * temp file whose path stays in the result. The runtime's hard byte cap
116
+ * file (see spillDirectory) whose path stays in the result. The runtime's hard byte cap
59
117
  * (output-limit) never fires for a model that stays anywhere near the budget.
118
+ *
119
+ * The notice names a command that reads the cut back, because the obvious
120
+ * moves fail: `read` caps long lines and a JSON result is one line, `cat`
121
+ * returns the whole file over the budget again, and a byte cut splits
122
+ * multi-byte characters. Parts are sized from the active budget.
60
123
  */
61
124
  export function applyOutputBudget(valueText, consoleBlock, cap) {
62
125
  const full = [valueText, consoleBlock].filter(part => part.length > 0).join('\n');
63
126
  if (full.length <= cap)
64
127
  return full;
65
- const head = Math.floor(cap / 2);
66
- const tail = Math.ceil(cap / 2);
67
- const omitted = full.length - head - tail;
68
- const spillPath = join(tmpdir(), `codemode-output-${Date.now()}-${++spillSequence}.txt`);
128
+ const head = safeCut(full, Math.floor(cap / 2));
129
+ const tailStart = safeCut(full, full.length - Math.ceil(cap / 2));
130
+ const omitted = tailStart - head;
131
+ const spillPath = join(spillDirectory(), `codemode-output-${Date.now()}-${++spillSequence}.txt`);
69
132
  writeFileSync(spillPath, full, { mode: 0o600 });
70
- const marker = `\n… ${omitted} chars omitted; full output: ${spillPath} …\n`;
71
- return full.slice(0, head) + marker + full.slice(full.length - tail);
133
+ const chars = spillPartChars(cap);
134
+ const first = Math.floor(head / chars) + 1;
135
+ const last = Math.floor((tailStart - 1) / chars) + 1;
136
+ const marker = [
137
+ '',
138
+ `… ${omitted} chars omitted; full output: ${spillPath}`,
139
+ `The cut is in ${first === last ? `part ${first}` : `parts ${first}-${last}`} of ${Math.ceil(full.length / chars)} (${chars} chars each). Read one part with a direct bash call, not inside codemode: ${spillPageCommand(spillPath, first, chars)}`,
140
+ 'Or run the script again and return only what you need. …',
141
+ '',
142
+ ].join('\n');
143
+ return full.slice(0, head) + marker + full.slice(tailStart);
72
144
  }
73
145
  /**
74
146
  * Pi ships errors that teach recovery: a `tools.Bash is not a function`
@@ -1 +1 @@
1
- {"version":3,"file":"script.js","sourceRoot":"","sources":["../../../src/modules/codemode/script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,kEAAkE;AAClE,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAA;AAC1C,MAAM,CAAC,MAAM,iBA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,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IAC9C,OAAO,CAAC,GAAG,MAAM,EAAE,sBAAsB,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzE,CAAC;AAED;;;;;;;;;;GAUG;AACH,+LAA+L;AAC/L,MAAM,gBAAgB,GAAG,4TAA4T,CAAA;AACrV,MAAM,aAAa,GAAG,yCAAyC,CAAA;AAE/D;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO,gBAAgB,GAAG,OAAO,GAAG,aAAa,CAAA;AACnD,CAAC"}
@@ -1,5 +1,30 @@
1
1
  import type { PluginContext } from '../../core/types.js';
2
2
  export declare const name = "ceulen-serena";
3
3
  export declare const inject: string[];
4
+ /**
5
+ * The tools a model reaches for instead of read/grep. They stay in the tool
6
+ * list: a navigation tool that has to be discovered first is never the one
7
+ * that triggers the discovery, so held back it goes unused (upstream Ceulen
8
+ * counted one Serena call in 56 sessions before it promoted them).
9
+ */
10
+ export declare const NAVIGATION_TOOLS: readonly string[];
11
+ /**
12
+ * Everything else the `ide-assistant` context declares on serena-agent 1.5.3
13
+ * and 2.1.0 (listed over MCP on 2026-11-24): editing, memories, onboarding.
14
+ * About 12k characters of schema that DSH's own edit tools and Munin already
15
+ * cover, so `/serena cold` holds them behind ceulen_tools. A name the
16
+ * installed version does not declare is skipped.
17
+ */
18
+ export declare const COLD_TOOLS: readonly string[];
19
+ /** Major version out of `serena --version` ("Serena 2.1.0"), or undefined when it cannot be read. */
20
+ export declare function serenaMajor(version: string | null): number | undefined;
21
+ /**
22
+ * The MCP row. serena-agent 2 answers a new config with the REPL interface:
23
+ * one `serena_repl` tool and none of the `mcp__serena__<tool>` names. The
24
+ * `--agent-interface tools` pair brings the separate tools back; version 1
25
+ * rejects that option, so it is only written for 2 and later (and when the
26
+ * version is unknown, since a fresh install gets 2).
27
+ */
28
+ export declare function recipe(cwd: string, major: number | undefined): string;
4
29
  export declare function apply(ctx: PluginContext): void;
5
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/serena/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAIxD,eAAO,MAAM,IAAI,kBAAkB,CAAA;AAEnC,eAAO,MAAM,MAAM,UAAe,CAAA;AA0BlC,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAgC9C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/serena/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAIxD,eAAO,MAAM,IAAI,kBAAkB,CAAA;AAEnC,eAAO,MAAM,MAAM,UAAe,CAAA;AAIlC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAQ7C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAgBvC,CAAA;AAaD,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAGtE;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAarE;AAgBD,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAkE9C"}
@@ -2,11 +2,51 @@ import { execFile } from 'node:child_process';
2
2
  import { existsSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
4
  import { promisify } from 'node:util';
5
- import { isModuleEnabled, loadSettingsSync } from '../../core/settings.js';
5
+ import { isModuleEnabled, loadSettingsSync, updateSettings } from '../../core/settings.js';
6
6
  import { registerCommandSafe } from '../../core/tools.js';
7
7
  export const name = 'ceulen-serena';
8
8
  export const inject = ['commands'];
9
9
  const execFileAsync = promisify(execFile);
10
+ /**
11
+ * The tools a model reaches for instead of read/grep. They stay in the tool
12
+ * list: a navigation tool that has to be discovered first is never the one
13
+ * that triggers the discovery, so held back it goes unused (upstream Ceulen
14
+ * counted one Serena call in 56 sessions before it promoted them).
15
+ */
16
+ export const NAVIGATION_TOOLS = [
17
+ 'get_symbols_overview',
18
+ 'find_symbol',
19
+ 'find_referencing_symbols',
20
+ 'find_declaration',
21
+ 'find_implementations',
22
+ 'get_diagnostics_for_file',
23
+ 'search_for_pattern',
24
+ ];
25
+ /**
26
+ * Everything else the `ide-assistant` context declares on serena-agent 1.5.3
27
+ * and 2.1.0 (listed over MCP on 2026-11-24): editing, memories, onboarding.
28
+ * About 12k characters of schema that DSH's own edit tools and Munin already
29
+ * cover, so `/serena cold` holds them behind ceulen_tools. A name the
30
+ * installed version does not declare is skipped.
31
+ */
32
+ export const COLD_TOOLS = [
33
+ 'replace_content',
34
+ 'replace_in_files',
35
+ 'replace_symbol_body',
36
+ 'insert_after_symbol',
37
+ 'insert_before_symbol',
38
+ 'rename_symbol',
39
+ 'safe_delete_symbol',
40
+ 'write_memory',
41
+ 'read_memory',
42
+ 'list_memories',
43
+ 'delete_memory',
44
+ 'rename_memory',
45
+ 'edit_memory',
46
+ 'onboarding',
47
+ 'initial_instructions',
48
+ ];
49
+ const PREFIX = 'mcp__serena__';
10
50
  async function serenaVersion() {
11
51
  try {
12
52
  const { stdout } = await execFileAsync('serena', ['--version'], { timeout: 3_000 });
@@ -16,7 +56,22 @@ async function serenaVersion() {
16
56
  return null;
17
57
  }
18
58
  }
19
- function recipe(cwd) {
59
+ /** Major version out of `serena --version` ("Serena 2.1.0"), or undefined when it cannot be read. */
60
+ export function serenaMajor(version) {
61
+ const match = version === null ? null : /(\d+)\.\d+/.exec(version);
62
+ return match === null ? undefined : Number(match[1]);
63
+ }
64
+ /**
65
+ * The MCP row. serena-agent 2 answers a new config with the REPL interface:
66
+ * one `serena_repl` tool and none of the `mcp__serena__<tool>` names. The
67
+ * `--agent-interface tools` pair brings the separate tools back; version 1
68
+ * rejects that option, so it is only written for 2 and later (and when the
69
+ * version is unknown, since a fresh install gets 2).
70
+ */
71
+ export function recipe(cwd, major) {
72
+ const args = ['start-mcp-server', '--context', 'ide-assistant', '--project', cwd.replace(/'/g, "''"), '--open-web-dashboard', 'False'];
73
+ if (major === undefined || major >= 2)
74
+ args.push('--agent-interface', 'tools');
20
75
  return [
21
76
  '- id: mcp-serena',
22
77
  " name: '@deepseek-ai/dsh-mcp-client'",
@@ -24,39 +79,88 @@ function recipe(cwd) {
24
79
  ' serverName: serena',
25
80
  ' transport: stdio',
26
81
  ' command: serena',
27
- ` args: ['start-mcp-server', '--context', 'ide-assistant', '--project', '${cwd.replace(/'/g, "''")}']`,
82
+ ` args: [${args.map(arg => `'${arg}'`).join(', ')}]`,
28
83
  ' toolCallTimeoutMs: 120000',
29
84
  ].join('\n');
30
85
  }
86
+ function recipeNote(major) {
87
+ if (major === undefined)
88
+ return 'Written for serena-agent 2 (what a new install gets). On serena-agent 1.x drop the last two args: it rejects --agent-interface.';
89
+ if (major >= 2)
90
+ return 'serena-agent 2 defaults a new config to one serena_repl tool; "--agent-interface tools" keeps the separate mcp__serena__<tool> tools.';
91
+ return 'serena-agent 1.x has no --agent-interface option. After an upgrade to 2.x run /serena recipe again and replace the row.';
92
+ }
93
+ /** How many of the cold tools `steering.cold` already lists, and the routes that hold them. */
94
+ function coldState() {
95
+ const steering = loadSettingsSync().steering;
96
+ const listed = COLD_TOOLS.filter(tool => steering.cold.includes(PREFIX + tool)).length;
97
+ const routes = [...new Set([...steering.models, ...steering.coldModels])];
98
+ return { listed, routes: routes.length === 0 ? 'no route (steering.models and steering.coldModels are empty)' : routes.join(', ') };
99
+ }
31
100
  export function apply(ctx) {
32
101
  const settings = loadSettingsSync();
33
102
  if (!isModuleEnabled('serena', settings))
34
103
  return;
35
104
  registerCommandSafe(ctx, {
36
105
  name: 'serena',
37
- description: 'Serena MCP recipe and status: binary, project index, and the exact dsh-mcp-client row',
38
- input: { hint: '[status|recipe]' },
106
+ description: 'Serena MCP recipe and status: binary, project index, the exact dsh-mcp-client row, and which Serena tools to hold cold',
107
+ input: { hint: '[status|recipe|cold]' },
39
108
  async handler({ agent, rawInput }) {
40
109
  const action = rawInput.trim().split(/\s+/).filter(Boolean)[0] ?? 'status';
41
110
  const cwd = agent?.session?.header?.cwd ?? process.cwd();
111
+ if (action === 'cold') {
112
+ const added = [];
113
+ const saved = await updateSettings(current => {
114
+ for (const tool of COLD_TOOLS) {
115
+ if (current.steering.cold.includes(PREFIX + tool))
116
+ continue;
117
+ current.steering.cold.push(PREFIX + tool);
118
+ added.push(tool);
119
+ }
120
+ });
121
+ return {
122
+ kind: 'success',
123
+ text: [
124
+ added.length === 0
125
+ ? `steering.cold already lists all ${COLD_TOOLS.length} Serena editing, memory and onboarding tools.`
126
+ : `Added ${added.length} Serena tool(s) to steering.cold (${saved.steering.cold.length} entries now): ${added.join(', ')}.`,
127
+ `Held for: ${coldState().routes}. They stay callable through ceulen_tools; restart the session to apply.`,
128
+ `Kept in the tool list: ${NAVIGATION_TOOLS.join(', ')}.`,
129
+ ].join('\n'),
130
+ };
131
+ }
42
132
  const version = await serenaVersion();
133
+ const major = serenaMajor(version);
43
134
  const project = existsSync(join(cwd, '.serena', 'project.yml'));
44
135
  if (action === 'recipe' || action === 'config') {
45
- return { kind: 'success', text: `Add this row to the profile's cordis.patch.yml, then restart:\n\n${recipe(cwd)}` };
136
+ return {
137
+ kind: 'success',
138
+ text: [
139
+ "Add this row to the profile's cordis.patch.yml, then restart:",
140
+ '',
141
+ recipe(cwd, major),
142
+ '',
143
+ recipeNote(major),
144
+ `Then run /serena cold: it keeps the ${NAVIGATION_TOOLS.length} navigation tools in the tool list and holds the other ${COLD_TOOLS.length} (about 12k characters of schema) behind ceulen_tools.`,
145
+ ].join('\n'),
146
+ };
46
147
  }
47
148
  if (action !== 'status')
48
- return { kind: 'error', text: 'usage: /serena [status|recipe]' };
149
+ return { kind: 'error', text: 'usage: /serena [status|recipe|cold]' };
150
+ const state = coldState();
49
151
  return {
50
152
  kind: 'success',
51
153
  text: [
52
154
  `serena: ${version === null ? 'not found in PATH (install: uv tool install -p 3.11 serena-agent)' : version}`,
53
- `project index: ${project ? `present (${join(cwd, '.serena', 'project.yml')})` : 'not indexed; run `serena project index` in the workspace'}`,
155
+ `project index: ${project ? `present (${join(cwd, '.serena', 'project.yml')})` : 'not indexed; run "serena project index" in the workspace'}`,
156
+ `cold tools: ${state.listed}/${COLD_TOOLS.length} of the editing, memory and onboarding tools are in steering.cold${state.listed === COLD_TOOLS.length ? '' : ' (run /serena cold)'}; held for ${state.routes}`,
54
157
  '',
55
158
  'DSH uses Serena through its native MCP client, not a bundled Python worker.',
56
159
  'After adding the MCP row and restarting, tools appear as mcp__serena__<tool>.',
160
+ recipeNote(major),
57
161
  '',
58
162
  'Recipe:',
59
- recipe(cwd),
163
+ recipe(cwd, major),
60
164
  ].join('\n'),
61
165
  };
62
166
  },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/serena/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAEzD,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAA;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,CAAC,CAAA;AAElC,MAAM,aAAa,G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,EAAE,IAAI,EAAE,qCAAqC,EAAE,CAAA;YAC9F,MAAM,KAAK,GAAG,SAAS,EAAE,CAAA;YACzB,OAAO;gBACL,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE;oBACJ,WAAW,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,mEAAmE,CAAC,CAAC,CAAC,OAAO,EAAE;oBAC7G,kBAAkB,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,0DAA0D,EAAE;oBAC7I,eAAe,KAAK,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,oEAAoE,KAAK,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,cAAc,KAAK,CAAC,MAAM,EAAE;oBAC/M,EAAE;oBACF,6EAA6E;oBAC7E,+EAA+E;oBAC/E,UAAU,CAAC,KAAK,CAAC;oBACjB,EAAE;oBACF,SAAS;oBACT,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC;iBACnB,CAAC,IAAI,CAAC,IAAI,CAAC;aACb,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -100,7 +100,7 @@ export function apply(ctx) {
100
100
  provider: 'ceulen-dsh',
101
101
  path: file,
102
102
  resourceBase: { kind: 'directory', path: dir },
103
- metadata: { upstream: 'ceulen', upstreamVersion: '0.23.0' },
103
+ metadata: { upstream: 'ceulen', upstreamVersion: '0.31.0' },
104
104
  });
105
105
  registered += 1;
106
106
  if (candidate !== skillName)
@@ -29,6 +29,13 @@ export declare function ripgrepPattern(pattern: string, syntax: 'bre' | 'ere' |
29
29
  * is not a plain lookup. A leading `cd <dir> &&` is dropped: tools take paths.
30
30
  */
31
31
  export declare function lookupReplacements(command: string): Replacement[] | undefined;
32
+ /**
33
+ * True when the user's own latest message carries `command` itself, whitespace
34
+ * aside: "run \`grep -rn TODO src\` and paste the output", a runbook step they
35
+ * quoted. They asked for that command's output, so it runs; a redirect here
36
+ * would put the harness's preference above an explicit instruction.
37
+ */
38
+ export declare function askedVerbatim(request: string | undefined, command: string): boolean;
32
39
  /** The deny text: the exact replacement, and why it is better. Never a way to switch the check off. */
33
40
  export declare function redirectText(command: string, calls: readonly Replacement[]): string;
34
41
  //# sourceMappingURL=bash-search.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bash-search.d.ts","sourceRoot":"","sources":["../../../src/modules/steering/bash-search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CA0ChE;AAID,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAsBvE;AAuBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAevF;AAuGD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,SAAS,CAqB7E;AAED,uGAAuG;AACvG,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAYnF"}
1
+ {"version":3,"file":"bash-search.d.ts","sourceRoot":"","sources":["../../../src/modules/steering/bash-search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,kFAAkF;AAClF,wBAAgB,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