@deepseek-harness-tui/dsh-tui 0.7.1 → 0.7.3

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 (127) hide show
  1. package/README.md +7 -5
  2. package/bin/dsh-tui.js +42 -1
  3. package/cordis.patch.yml +10 -0
  4. package/lib/types/commands.js +1 -1
  5. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  6. package/lib/types/components/GoalTodoPanel.js +6 -1
  7. package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
  8. package/lib/types/components/HistorySearchDialog.js +5 -1
  9. package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
  10. package/lib/types/components/LoadedContextPanel.js +1 -1
  11. package/lib/types/components/MessageList.d.ts.map +1 -1
  12. package/lib/types/components/MessageList.js +5 -1
  13. package/lib/types/components/PromptInput.d.ts.map +1 -1
  14. package/lib/types/components/PromptInput.js +52 -74
  15. package/lib/types/components/SearchBox.d.ts +4 -0
  16. package/lib/types/components/SearchBox.d.ts.map +1 -1
  17. package/lib/types/components/SearchBox.js +101 -2
  18. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +4 -1
  19. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts.map +1 -1
  20. package/lib/types/components/Spinner/SpinnerAnimationRow.js +10 -5
  21. package/lib/types/components/WorkingSpinner.d.ts +3 -1
  22. package/lib/types/components/WorkingSpinner.d.ts.map +1 -1
  23. package/lib/types/components/WorkingSpinner.js +2 -2
  24. package/lib/types/components/design-system/ThemedText.d.ts +9 -3
  25. package/lib/types/components/design-system/ThemedText.d.ts.map +1 -1
  26. package/lib/types/components/design-system/ThemedText.js +3 -5
  27. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  28. package/lib/types/components/questions/AskUserQuestionPanel.js +52 -8
  29. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  30. package/lib/types/components/questions/PlanReviewPanel.js +12 -3
  31. package/lib/types/components/sessions/SessionListRow.d.ts +26 -0
  32. package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -0
  33. package/lib/types/components/sessions/SessionListRow.js +35 -0
  34. package/lib/types/components/sessions/SessionPreview.d.ts +25 -0
  35. package/lib/types/components/sessions/SessionPreview.d.ts.map +1 -0
  36. package/lib/types/components/sessions/SessionPreview.js +60 -0
  37. package/lib/types/dsh-adapter/channel.d.ts +19 -4
  38. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  39. package/lib/types/dsh-adapter/channel.js +76 -82
  40. package/lib/types/dsh-adapter/compat/index.d.ts +1 -1
  41. package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -1
  42. package/lib/types/dsh-adapter/compat/index.js +1 -1
  43. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +8 -0
  44. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
  45. package/lib/types/dsh-adapter/compat/sessionLog.js +1 -1
  46. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  47. package/lib/types/dsh-adapter/index.js +10 -1
  48. package/lib/types/dsh-adapter/packaged-presets.d.ts +22 -0
  49. package/lib/types/dsh-adapter/packaged-presets.d.ts.map +1 -0
  50. package/lib/types/dsh-adapter/packaged-presets.js +93 -0
  51. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  52. package/lib/types/dsh-adapter/plugin.js +53 -7
  53. package/lib/types/dsh-adapter/presets.d.ts +16 -0
  54. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  55. package/lib/types/dsh-adapter/presets.js +23 -0
  56. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
  57. package/lib/types/dsh-adapter/providerWizard.js +3 -1
  58. package/lib/types/dsh-adapter/sessions/digest.d.ts +29 -0
  59. package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -0
  60. package/lib/types/dsh-adapter/sessions/digest.js +224 -0
  61. package/lib/types/dsh-adapter/sessions/frames.d.ts +100 -0
  62. package/lib/types/dsh-adapter/sessions/frames.d.ts.map +1 -0
  63. package/lib/types/dsh-adapter/sessions/frames.js +246 -0
  64. package/lib/types/dsh-adapter/sessions/header.d.ts +50 -0
  65. package/lib/types/dsh-adapter/sessions/header.d.ts.map +1 -0
  66. package/lib/types/dsh-adapter/sessions/header.js +62 -0
  67. package/lib/types/dsh-adapter/sessions/index.d.ts +17 -0
  68. package/lib/types/dsh-adapter/sessions/index.d.ts.map +1 -0
  69. package/lib/types/dsh-adapter/sessions/index.js +15 -0
  70. package/lib/types/dsh-adapter/sessions/list.d.ts +41 -0
  71. package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -0
  72. package/lib/types/dsh-adapter/sessions/list.js +213 -0
  73. package/lib/types/dsh-adapter/sessions/store.d.ts +48 -0
  74. package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -0
  75. package/lib/types/dsh-adapter/sessions/store.js +164 -0
  76. package/lib/types/dsh-adapter/sessions/types.d.ts +142 -0
  77. package/lib/types/dsh-adapter/sessions/types.d.ts.map +1 -0
  78. package/lib/types/dsh-adapter/sessions/types.js +14 -0
  79. package/lib/types/i18n.d.ts +150 -22
  80. package/lib/types/i18n.d.ts.map +1 -1
  81. package/lib/types/i18n.js +45 -9
  82. package/lib/types/ink/components/Text.d.ts +9 -1
  83. package/lib/types/ink/components/Text.d.ts.map +1 -1
  84. package/lib/types/ink/components/Text.js +7 -6
  85. package/lib/types/ink/ink.d.ts.map +1 -1
  86. package/lib/types/ink/ink.js +4 -2
  87. package/lib/types/ink/log-update.d.ts.map +1 -1
  88. package/lib/types/ink/log-update.js +76 -9
  89. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  90. package/lib/types/ink/parse-keypress.js +4 -1
  91. package/lib/types/ink/terminal.d.ts +40 -4
  92. package/lib/types/ink/terminal.d.ts.map +1 -1
  93. package/lib/types/ink/terminal.js +57 -5
  94. package/lib/types/ink/termio/tokenize.d.ts +6 -0
  95. package/lib/types/ink/termio/tokenize.d.ts.map +1 -1
  96. package/lib/types/ink/termio/tokenize.js +18 -4
  97. package/lib/types/screens/Chat.d.ts +3 -2
  98. package/lib/types/screens/Chat.d.ts.map +1 -1
  99. package/lib/types/screens/Chat.js +104 -160
  100. package/lib/types/screens/SessionBrowser.d.ts +37 -0
  101. package/lib/types/screens/SessionBrowser.d.ts.map +1 -0
  102. package/lib/types/screens/SessionBrowser.js +452 -0
  103. package/lib/types/sessionHistory.d.ts +0 -8
  104. package/lib/types/sessionHistory.d.ts.map +1 -1
  105. package/lib/types/sessions/format.d.ts +117 -0
  106. package/lib/types/sessions/format.d.ts.map +1 -0
  107. package/lib/types/sessions/format.js +244 -0
  108. package/lib/types/sessions/view.d.ts +125 -0
  109. package/lib/types/sessions/view.d.ts.map +1 -0
  110. package/lib/types/sessions/view.js +234 -0
  111. package/lib/types/update.d.ts +21 -7
  112. package/lib/types/update.d.ts.map +1 -1
  113. package/lib/types/update.js +66 -16
  114. package/lib/types/utils/paths.d.ts.map +1 -1
  115. package/lib/types/utils/paths.js +4 -1
  116. package/package.json +37 -9
  117. package/presets/liangshen/.dsh-tui-managed.json +5 -0
  118. package/presets/liangshen/agent.cordis.yml +389 -0
  119. package/presets/liangshen/compaction-epoch.mjs +81 -0
  120. package/presets/liangshen/custom-bash.mjs +126 -0
  121. package/presets/liangshen/instruction-hint.mjs +181 -0
  122. package/presets/liangshen/preset.yml +3 -0
  123. package/presets/liangshen/skill-search.mjs +142 -0
  124. package/presets/liangshen/tool-bootstrap.mjs +300 -0
  125. package/lib/types/components/ResumePicker.d.ts +0 -26
  126. package/lib/types/components/ResumePicker.d.ts.map +0 -1
  127. package/lib/types/components/ResumePicker.js +0 -50
@@ -155,9 +155,17 @@ function runProcess(command, args, options = {}) {
155
155
  : [command, args];
156
156
  const child = spawn(runCommand, runArgs, {
157
157
  env: options.env,
158
- stdio: 'inherit',
158
+ stdio: options.onStderr === undefined ? 'inherit' : ['inherit', 'inherit', 'pipe'],
159
159
  shell: useShell,
160
160
  });
161
+ if (options.onStderr !== undefined && child.stderr !== null) {
162
+ const onStderr = options.onStderr;
163
+ child.stderr.on('data', (chunk) => {
164
+ const text = chunk.toString('utf8');
165
+ process.stderr.write(text);
166
+ onStderr(text);
167
+ });
168
+ }
161
169
  const finish = (code) => {
162
170
  if (settled)
163
171
  return;
@@ -171,35 +179,77 @@ function runProcess(command, args, options = {}) {
171
179
  child.once('close', code => finish(code ?? 1));
172
180
  });
173
181
  }
182
+ /** Build the profile-manager command, preferring a preflight-pinned version. */
183
+ export function tuiUpdatePluginArgs(profile, targetVersion) {
184
+ return targetVersion === undefined
185
+ ? ['plugin', '--profile', profile, 'update', '--latest', PACKAGE_NAME]
186
+ : ['plugin', '--profile', profile, 'update', `${PACKAGE_NAME}@${targetVersion}`];
187
+ }
188
+ /**
189
+ * The pnpm Windows tmp-rename race signature (issue #225): pnpm swaps a
190
+ * package directory via a `<name>_tmp_<pid>` staging dir, and a file lock or
191
+ * AV scan makes the scandir/rename fail with ENOENT/EPERM/EBUSY. The failure
192
+ * is transient — the identical command succeeds on retry — but the crashed
193
+ * run leaves a half-updated profile (manifest pins the old version while the
194
+ * lockfile already carries the new snapshot), which presents as "update did
195
+ * nothing" (#209). Genuine resolution errors never carry the `_tmp_<pid>`
196
+ * token, so matching both keeps the retry from masking real failures.
197
+ */
198
+ export function isTransientUpdateFailure(stderr) {
199
+ return /ENOENT|EPERM|EBUSY/i.test(stderr) && /_tmp_\d+/i.test(stderr);
200
+ }
174
201
  /**
175
202
  * Update the installed dsh-tui package and restart the same launcher while
176
203
  * preserving the active session. The TUI must already be unmounted before
177
204
  * this is called so pnpm output cannot corrupt the rendered terminal frame.
178
205
  *
179
- * `--latest` is required: `pnpm add` writes a caret range into the profile
180
- * manifest, and a plain `pnpm update` stays inside that range — with this
181
- * project's minor-per-release cadence the TUI would restart unchanged while
182
- * reporting success. The restart carries `DSH_TUI_UPDATED_FROM` so the new
183
- * process can warn when the version did not actually move (e.g. a mirror
184
- * registry still serving the old `latest`).
206
+ * When the preflight registry check resolved an exact target, pass that
207
+ * version to pnpm instead of resolving `latest` a second time. This avoids a
208
+ * stale mirror/dist-tag response between the check and install. If preflight
209
+ * failed, retain the `--latest` fallback: a plain `pnpm update` stays inside
210
+ * the manifest range and can restart unchanged across minor releases.
185
211
  *
186
212
  * @param sessionId - Session to resume in the replacement process.
187
213
  * @param profile - The dsh profile this TUI was launched with; updating any
188
214
  * other profile would leave the running install untouched.
215
+ * @param targetVersion - Exact version returned by the preflight registry
216
+ * check, or undefined when that check failed and pnpm should resolve latest.
189
217
  * @returns Exit codes for the update run and the replacement process.
190
218
  */
191
- export async function updateTuiAndRestart(sessionId, profile) {
219
+ export async function updateTuiAndRestart(sessionId, profile, targetVersion) {
192
220
  const dsh = process.platform === 'win32' ? 'dsh.cmd' : 'dsh';
193
- const updateCode = await runProcess(dsh, [
194
- 'plugin',
195
- '--profile',
196
- profile,
197
- 'update',
198
- '--latest',
199
- PACKAGE_NAME,
200
- ], { shell: true });
221
+ const updateArgs = tuiUpdatePluginArgs(profile, targetVersion);
222
+ let updateStderr = '';
223
+ const capture = (chunk) => { updateStderr += chunk; };
224
+ let updateCode = await runProcess(dsh, updateArgs, { shell: true, onStderr: capture });
225
+ // Transient Windows tmp-rename race (issue #225): retry the identical
226
+ // command once — it succeeds on a clean second run, and only the
227
+ // `_tmp_<pid>` race signature qualifies, never a real resolution error.
228
+ if (updateCode !== 0 && isTransientUpdateFailure(updateStderr)) {
229
+ process.stderr.write('dsh-tui: transient pnpm failure (Windows tmp-rename race) — retrying once…\n');
230
+ updateStderr = '';
231
+ updateCode = await runProcess(dsh, updateArgs, { shell: true, onStderr: capture });
232
+ }
201
233
  if (updateCode !== 0)
202
234
  return { updateCode, restartCode: updateCode };
235
+ // Post-update verification (issue #225): pnpm can report success yet leave
236
+ // the profile half-updated (manifest old / lockfile new). Verify against
237
+ // the preflight target; a full `install` reconciles lockfile →
238
+ // node_modules, and if the mismatch survives, stop before restarting into
239
+ // a mixed state and hand the user the exact repair command instead.
240
+ if (targetVersion !== undefined) {
241
+ let installed = installedTuiVersion();
242
+ if (installed !== targetVersion) {
243
+ await runProcess(dsh, ['plugin', '--profile', profile, 'install'], { shell: true });
244
+ installed = installedTuiVersion();
245
+ }
246
+ if (installed !== targetVersion) {
247
+ process.stderr.write(`dsh-tui: update completed but the profile still runs ${installed ?? 'an unreadable version'} ` +
248
+ `(expected ${targetVersion}) — the profile is half-updated. Repair manually with:\n` +
249
+ ` dsh plugin --profile ${profile} add ${PACKAGE_NAME}@${targetVersion}\n`);
250
+ return { updateCode: 1, restartCode: 1 };
251
+ }
252
+ }
203
253
  const restartCode = await runProcess(process.execPath, [...process.execArgv, ...process.argv.slice(1)], {
204
254
  env: {
205
255
  ...process.env,
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/utils/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED,qEAAqE;AACrE,eAAO,MAAM,QAAQ,QAA8B,CAAA;AAEnD,wEAAwE;AACxE,eAAO,MAAM,eAAe,QAA6B,CAAA;AAEzD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,GAAE,MAAwB,EAChC,MAAM,GAAE,MAAiB,GACxB,OAAO,CAIT;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxD,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,EAAE,CAEV"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/utils/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED,qEAAqE;AACrE,eAAO,MAAM,QAAQ,QAA8B,CAAA;AAEnD,wEAAwE;AACxE,eAAO,MAAM,eAAe,QAA6B,CAAA;AAEzD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,GAAE,MAAwB,EAChC,MAAM,GAAE,MAAiB,GACxB,OAAO,CAOT;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxD,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,EAAE,CAEV"}
@@ -35,7 +35,10 @@ export const LEGACY_DATA_DIR = join(homeDir(), '.dsh-cc');
35
35
  export function migrateLegacyDataDir(legacy = LEGACY_DATA_DIR, target = DATA_DIR) {
36
36
  if (!existsSync(legacy) || existsSync(target))
37
37
  return false;
38
- cpSync(legacy, target, { recursive: true });
38
+ // `filter` forces the JS copy path: the native cpSync fast path fails with
39
+ // EIO (or crashes) on Windows when the destination lives under a home
40
+ // directory whose name contains non-ASCII characters (e.g. `C:\Users\米`).
41
+ cpSync(legacy, target, { recursive: true, filter: () => true });
39
42
  return true;
40
43
  }
41
44
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepseek-harness-tui/dsh-tui",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Claude Code style interactive TUI front door for DeepSeek Harness agents, built on the ported Ink core.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -49,6 +49,7 @@
49
49
  "lib",
50
50
  "cordis.patch.yml",
51
51
  "cordis.yml",
52
+ "presets",
52
53
  "skills"
53
54
  ],
54
55
  "engines": {
@@ -56,16 +57,12 @@
56
57
  },
57
58
  "peerDependencies": {
58
59
  "@deepseek-ai/cordis": "^4.0.1",
59
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6"
60
- },
61
- "dependencies": {
62
- "@alcalzone/ansi-tokenize": "^0.3.0",
63
60
  "@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
64
61
  "@deepseek-ai/dsh-agent-instructions": "^0.1.0-rc.6",
65
62
  "@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.6",
66
- "@deepseek-ai/dsh-agent-tool-presentation": "^0.1.0-rc.6",
67
63
  "@deepseek-ai/dsh-commands": "^0.1.0-rc.6",
68
64
  "@deepseek-ai/dsh-cordis-host-runner": "^0.1.0-rc.6",
65
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
69
66
  "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
70
67
  "@deepseek-ai/dsh-persona": "^0.1.0-rc.6",
71
68
  "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
@@ -82,14 +79,17 @@
82
79
  "@deepseek-ai/dsh-user-approval": "^0.1.0-rc.6",
83
80
  "@deepseek-ai/dsh-user-questions": "^0.1.0-rc.6",
84
81
  "@deepseek-ai/dsh-workspace": "^0.1.0-rc.6",
85
- "@deepseek-ai/schemastery": "^3.18.1",
82
+ "@deepseek-ai/schemastery": "^3.18.1"
83
+ },
84
+ "dependencies": {
85
+ "@alcalzone/ansi-tokenize": "^0.3.0",
86
86
  "auto-bind": "^4.0.0 || ^5.0.0",
87
87
  "bidi-js": "^1.0.0",
88
88
  "chalk": "^5.0.0",
89
89
  "cli-boxes": "^3.0.0 || ^4.0.0",
90
90
  "cli-highlight": "^2.1.11",
91
91
  "code-excerpt": "^3.0.0 || ^4.0.0",
92
- "dsh-working-activity": "^0.2.4",
92
+ "dsh-working-activity": "^0.2.6",
93
93
  "emoji-regex": "^10.0.0",
94
94
  "figures": "^6.1.0",
95
95
  "get-east-asian-width": "^1.0.0",
@@ -112,26 +112,47 @@
112
112
  "@deepseek-ai/cordis": "^4.0.1",
113
113
  "@deepseek-ai/cordis-plugin-include": "^1.0.6",
114
114
  "@deepseek-ai/cordis-plugin-loader": "^1.0.2",
115
+ "@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
116
+ "@deepseek-ai/dsh-agent-instructions": "^0.1.0-rc.6",
117
+ "@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.6",
115
118
  "@deepseek-ai/dsh-atomic-write": "^0.1.0-rc.6",
116
119
  "@deepseek-ai/dsh-attachment": "^0.1.0-rc.6",
117
120
  "@deepseek-ai/dsh-brand": "^0.1.0-rc.6",
118
121
  "@deepseek-ai/dsh-code-runtime": "^0.1.0-rc.6",
122
+ "@deepseek-ai/dsh-commands": "^0.1.0-rc.6",
123
+ "@deepseek-ai/dsh-cordis-host-runner": "^0.1.0-rc.6",
119
124
  "@deepseek-ai/dsh-fs": "^0.1.0-rc.6",
120
125
  "@deepseek-ai/dsh-home-paths": "^0.1.0-rc.6",
121
126
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
127
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
128
+ "@deepseek-ai/dsh-persona": "^0.1.0-rc.6",
122
129
  "@deepseek-ai/dsh-sandbox": "^0.1.0-rc.6",
123
130
  "@deepseek-ai/dsh-sandbox-policy": "^0.1.0-rc.6",
124
131
  "@deepseek-ai/dsh-scope": "^0.1.0-rc.6",
132
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
125
133
  "@deepseek-ai/dsh-session-persistence": "^0.1.0-rc.6",
126
134
  "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.0-rc.6",
127
135
  "@deepseek-ai/dsh-session-persistence-sqlite": "^0.1.0-rc.6",
128
136
  "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
137
+ "@deepseek-ai/dsh-skill": "^0.1.0-rc.6",
138
+ "@deepseek-ai/dsh-storage": "^0.1.0-rc.6",
139
+ "@deepseek-ai/dsh-storage-domain": "^0.1.0-rc.6",
140
+ "@deepseek-ai/dsh-storage-json": "^0.1.0-rc.6",
129
141
  "@deepseek-ai/dsh-subprocess": "^0.1.0-rc.6",
142
+ "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
143
+ "@deepseek-ai/dsh-terminal": "^0.1.0-rc.6",
144
+ "@deepseek-ai/dsh-terminal-bash": "^0.1.0-rc.6",
130
145
  "@deepseek-ai/dsh-timeout": "^0.1.0-rc.6",
146
+ "@deepseek-ai/dsh-tool-ask-user": "^0.1.0-rc.6",
147
+ "@deepseek-ai/dsh-tool-bash-persistent": "^0.1.0-rc.6",
148
+ "@deepseek-ai/dsh-tool-cordis": "^0.1.0-rc.6",
131
149
  "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
132
150
  "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.6",
133
151
  "@deepseek-ai/dsh-user-approval": "^0.1.0-rc.6",
152
+ "@deepseek-ai/dsh-user-questions": "^0.1.0-rc.6",
134
153
  "@deepseek-ai/dsh-web-app": "0.1.0-rc.6",
154
+ "@deepseek-ai/dsh-workspace": "^0.1.0-rc.6",
155
+ "@deepseek-ai/schemastery": "^3.18.1",
135
156
  "@types/lodash-es": "^4.17.0",
136
157
  "@types/node": "^22.0.0",
137
158
  "@types/react": "^19.0.0",
@@ -151,12 +172,19 @@
151
172
  "clean": "node scripts/clean-lib.mjs",
152
173
  "compile": "npm run clean && tsc -p tsconfig.json",
153
174
  "build": "npm run compile && npm run verify:build",
175
+ "dev": "node scripts/dev-test.mjs",
176
+ "dev:copy-config": "node scripts/dev-copy-config.mjs",
177
+ "dev:test": "node scripts/verify-dev-command.mjs && node scripts/dev-test.mjs --no-launch",
154
178
  "tui": "node --import tsx/esm scripts/run.ts",
155
179
  "smoke": "node --import tsx/esm scripts/smoke.tsx",
156
- "verify:build": "npm run verify:boundary && npm run verify:contract && npm run verify:patch-surface",
180
+ "verify:build": "npm run verify:boundary && npm run verify:contract && npm run verify:manifest-deps && npm run verify:patch-surface && npm run verify:packaged-presets && npm run verify:minimal-preset-tools && npm run verify:liangshen-bootstrap",
157
181
  "verify:boundary": "node --import tsx/esm scripts/verify-adapter-boundary.ts",
158
182
  "verify:contract": "node --import tsx/esm scripts/verify-upstream-contract.ts",
183
+ "verify:manifest-deps": "node --import tsx/esm scripts/verify-manifest-deps.ts",
159
184
  "verify:patch-surface": "node --import tsx/esm scripts/verify-patch-surface.ts",
185
+ "verify:packaged-presets": "node scripts/verify-packaged-presets.mjs",
186
+ "verify:minimal-preset-tools": "node scripts/verify-minimal-preset-tools.mjs",
187
+ "verify:liangshen-bootstrap": "node scripts/verify-liangshen-bootstrap.mjs",
160
188
  "verify:package": "npm pack --dry-run --json --ignore-scripts | node scripts/verify-package.mjs",
161
189
  "verify:clipboard-image": "node --import tsx/esm scripts/verify-clipboard-image.ts"
162
190
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "owner": "@deepseek-harness-tui/dsh-tui",
3
+ "preset": "liangshen",
4
+ "revision": "liangshen-toolcall-full-catalog-subagents-v3"
5
+ }
@@ -0,0 +1,389 @@
1
+ # The `anchored-standard` experimental preset: Standard capabilities with the
2
+ # Minimal mode system-prompt condition used by the V4 trajectory evaluation.
3
+ #
4
+ # This file is an AGENT-PLANE composition. The roster mounts it ONCE under a
5
+ # standing scope; every session naming it joins by scope parentage, so the
6
+ # tools and prompt sections registered here cover each joined agent while a
7
+ # session's own state stays keyed per Session/Agent inside the plugins. The
8
+ # host composition (`base.cordis.yml` + `web.cordis.yml`) keeps everything a
9
+ # preset must not own: the registries themselves, the sandbox and approval
10
+ # stack, persistence, and the model route.
11
+ #
12
+ # A service row here MUST sit inside a group carrying an `isolate` realm.
13
+ # Without one it publishes into the root realm, where it is process-global —
14
+ # another preset publishing the same name collides, and a host reader would
15
+ # resolve one preset's instance for every session; `dsh-agent-presets` rejects
16
+ # that at mount. `true` means an entry-local realm: this standing mount's own
17
+ # private instance, apart from every other preset's. (A shared label does NOT
18
+ # pool instances — `provide()` throws on the second registration under the
19
+ # same realm symbol; labels join REALMS, and are not what this file needs.)
20
+
21
+ # ── bootstrap (must stay FIRST) ─────────────────────────────────────────────
22
+
23
+ # This row deliberately sits before every other row: dsh-agent-instructions and
24
+ # dsh-tool-skill inject workspace instructions and the skill catalog into the
25
+ # first request via the agent/pre-step waterfall, and waterfall after-next
26
+ # transforms apply in reverse registration order. Registering first (plus the
27
+ # plugin empty inject list and the listener's `prepend` flag) makes this filter
28
+ # strip the final transform, so request #1 stays Minimal-exact (see issue #6).
29
+ #
30
+ # V4 Pro conditions strongly on the API tool catalog AND the first request
31
+ # output budget. Bootstrap request #1 with the OFFICIAL Minimal preset's real
32
+ # tool pair — persistent `bash` + `str_replace_editor` — which anchors at the
33
+ # adapter-default maxTokens (256000) with no output cap needed (issue #11:
34
+ # 5/5 anchored vs 11/11 standard-like for every standard-family schema);
35
+ # after the session records its first durable tool call, later steps expose
36
+ # the complete assembled catalog in one promotion. A text-only reply does not
37
+ # consume the anchor. `bootstrapMaxTokens` is
38
+ # opt-in for standard-schema bootstraps; unset, the adapter default flows. See
39
+ # tool-bootstrap.mjs for the other triggers.
40
+ #
41
+ # The same phase gate suppresses AUTO-INJECTED context on request #1:
42
+ # `suppressedContextSources` lists the `agent/pre-step` message sources the
43
+ # bootstrap filter strips while the session is unpromoted. The defaults are the
44
+ # two automatic injections Standard adds over Minimal — the available-skills
45
+ # reminder (`skill-catalog`) and the workspace instruction digest
46
+ # (`agent-instructions`). User-initiated skill gestures are not filtered, and
47
+ # both injections return unchanged after the first tool-call promotion. Set
48
+ # the list to [] to disable the context filter while keeping the tool bootstrap.
49
+ #
50
+ # POST-PROMOTION: the first durable tool call unlocks the complete assembled
51
+ # catalog at once, matching the two-stage harness experiment. There is no
52
+ # intermediate resident/discovery phase.
53
+ #
54
+ # COMPACTION: after `compaction/end` the session falls back to the exact
55
+ # bootstrap pair until a NEW durable tool call exists past the boundary
56
+ # (epoch-aware, see compaction-epoch.mjs).
57
+ - id: tool-bootstrap
58
+ name: ./tool-bootstrap.mjs
59
+ config:
60
+ bootstrapTools: [bash, str_replace_editor]
61
+ promoteOn: tool-call
62
+ includeSubagents: true
63
+ suppressedContextSources: [agent-instructions, skill-catalog]
64
+
65
+ # ── identity ────────────────────────────────────────────────────────────────
66
+
67
+ # Keep this text byte-identical to the Minimal preset. `complete` prevents the
68
+ # Harness identity and per-tool guidance from changing the system prompt, while
69
+ # runtime-context suppression leaves task and repository rules to user messages
70
+ # and explicit file reads. Tool schemas and their runtime enforcement remain.
71
+ - id: persona
72
+ name: '@deepseek-ai/dsh-persona'
73
+ config:
74
+ text: You are a helpful software engineer assistant.
75
+ complete: true
76
+ includeRuntimeContext: false
77
+
78
+ # Instruction FILES are NOT injected (replaces dsh-agent-instructions, local
79
+ # addition): the full AGENTS.md/CLAUDE.md digest is a large injected block
80
+ # that perturbs the trajectory even after promotion. Instead, after promotion
81
+ # ONE short hint is injected once per session — "these instruction files
82
+ # exist; read them before acting" — and the model reads the files itself via
83
+ # the filesystem tools when relevant.
84
+ - id: instruction-hint
85
+ name: ./instruction-hint.mjs
86
+ config:
87
+ promoteOn: tool-call
88
+ includeSubagents: true
89
+
90
+ # ── shell ───────────────────────────────────────────────────────────────────
91
+
92
+ # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
93
+ # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
94
+ # the criterion for host-plane ownership — injection resolves before any session
95
+ # exists, so there is no agent to key by. Behind a preset realm those variables
96
+ # never reached the model's shell at all. Both shell tools consume the host
97
+ # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
98
+ # host-plane too.
99
+ - id: tool-bash
100
+ name: '@deepseek-ai/dsh-tool-bash'
101
+ # Disabled on EVERY platform, not just Windows: `dsh-tool-bash-persistent`
102
+ # below registers the same `bash` tool name into this same preset layer, and
103
+ # the tools registry rejects duplicates within one layer. The persistent
104
+ # shell (the Minimal preset's own shell) is the preset's bash; it consumes
105
+ # the host sandbox policy through the terminals realm.
106
+ disabled: true
107
+
108
+ - id: tool-pwsh
109
+ name: '@deepseek-ai/dsh-tool-pwsh'
110
+ disabled: !!js process.platform !== 'win32'
111
+
112
+ # The Minimal preset's shell: a PTY-backed persistent bash, byte-identical in
113
+ # configuration to the official `minimal` preset's `persistent-shell` group so
114
+ # the first request exposes exactly Minimal's real `bash` schema. The PTY
115
+ # registry is an agent-owned service, so it lives in an entry-local realm; the
116
+ # backend still consumes the host sandbox policy and subprocess implementation,
117
+ # while the tool registers into this agent's scoped catalog.
118
+ #
119
+ # DISABLED ON WINDOWS: DSH's PTY backend is linux/darwin-only, so the
120
+ # persistent shell cannot serve win32. The `custom-bash` row below registers
121
+ # the same `bash` tool name there instead (platform-exclusive).
122
+ - id: persistent-shell
123
+ name: cordis:group
124
+ group: true
125
+ disabled: !!js process.platform === 'win32'
126
+ isolate:
127
+ terminals: true
128
+ config:
129
+ - id: pty
130
+ name: '@deepseek-ai/dsh-terminal'
131
+
132
+ - id: terminal-bash
133
+ name: '@deepseek-ai/dsh-terminal-bash'
134
+ config:
135
+ timeoutMs: 300000
136
+
137
+ - id: persistent-bash
138
+ name: '@deepseek-ai/dsh-tool-bash-persistent'
139
+ config:
140
+ timeoutMs: 300000
141
+ description: |-
142
+ Run commands in a bash shell
143
+ * When invoking this tool, the contents of the "command" parameter does NOT need to be XML-escaped.
144
+ * You don't have access to the internet via this tool.
145
+ * You do have access to a mirror of common linux and python packages via apt and pip.
146
+ * State is persistent across command calls and discussions with the user.
147
+ * To inspect a particular line range of a file, e.g. lines 10-25, try 'sed -n 10,25p /path/to/the/file'.
148
+ * Please avoid commands that may produce a very large amount of output.
149
+ * Please run long lived commands in the background, e.g. 'sleep 10 &' or start a server in the background.
150
+
151
+ # Windows-only `bash` tool (see custom-bash.mjs): registers the SAME
152
+ # tool name as the persistent shell with a Minimal-compatible description, but
153
+ # executes through the ordinary cross-platform subprocess seam (`bash -c`)
154
+ # instead of a PTY. `bashPath` defaults to `bash` on PATH; point it at Git
155
+ # Bash explicitly when the WSL shim would otherwise be picked up. No OS
156
+ # sandbox confinement on Windows (landlock is linux-only); the tool
157
+ # description says so.
158
+ - id: custom-bash
159
+ name: ./custom-bash.mjs
160
+ disabled: !!js process.platform !== 'win32'
161
+ config:
162
+ bashPath: 'C:\Program Files\Git\bin\bash.exe'
163
+
164
+ # ── filesystem ──────────────────────────────────────────────────────────────
165
+
166
+ # Both register into the host `tools` registry and provide nothing, so
167
+ # they need no realm. The `fs` service and its policy stay in the host.
168
+ - id: tool-fs
169
+ name: '@deepseek-ai/dsh-tool-fs'
170
+
171
+ - id: tool-fs-search
172
+ name: '@deepseek-ai/dsh-tool-fs-search'
173
+ config:
174
+ sampleOverCapGlobResults: false
175
+
176
+ # The Minimal preset's second tool: `str_replace_editor` over a bare local
177
+ # filesystem, byte-identical in configuration to the official `minimal`
178
+ # preset's `filesystem` group. The editor's own realm shadows the host's
179
+ # sandboxed `fs` provider only inside this group, so the standard `read`/
180
+ # `write`/`edit` tools keep the sandboxed fs while the bootstrap editor uses
181
+ # the local one.
182
+ - id: bootstrap-filesystem
183
+ name: cordis:group
184
+ group: true
185
+ isolate:
186
+ fs: true
187
+ config:
188
+ - id: fs-local
189
+ name: '@deepseek-ai/dsh-fs-local'
190
+ config:
191
+ cwd: !!js process.env.DSH_CWD ?? process.cwd()
192
+
193
+ - id: str-replace-editor
194
+ name: '@deepseek-ai/dsh-tool-str-replace-editor'
195
+ config:
196
+ maxOutputChars: 16000
197
+
198
+ # ── background jobs ────────────────────────────────────────────────────────
199
+
200
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
201
+ # its producers sit outside any realm this file could put it in — `tool-bash`
202
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
203
+ # to every sibling row, so `run_in_background` would answer "background jobs
204
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
205
+ # owning agent anyway, so one host instance serves every session. What a preset
206
+ # chooses is whether its agent can collect and stop background work at all.
207
+ - id: tool-jobs
208
+ name: '@deepseek-ai/dsh-tool-jobs'
209
+
210
+ # ── skills ──────────────────────────────────────────────────────────────────
211
+
212
+ # The skill REGISTRY lives in the host composition and is layered per scope:
213
+ # these rows register into THIS preset's layer of it, so they need no realm.
214
+ # `skill-filesystem` contributes local-root discovery for agents on this
215
+ # preset. The full skill CATALOG injection (`dsh-tool-skill`, the ~9KB
216
+ # `<available_skills>` reminder) is REMOVED (local addition): it perturbs the
217
+ # trajectory (issue #6: 0/9 anchored with the catalog present vs ~81%
218
+ # without). Instead `skill-search` exposes two small on-demand tools —
219
+ # skill_search (list matching summaries) and skill_load (inject one skill's
220
+ # full instructions) — the tool-search pattern.
221
+ - id: skill-filesystem
222
+ name: '@deepseek-ai/dsh-skill-filesystem'
223
+
224
+ - id: skill-search
225
+ name: ./skill-search.mjs
226
+
227
+ # ── goals ───────────────────────────────────────────────────────────────────
228
+
229
+ # Only the model-facing tool. The goal SERVICE, its session driver, and the
230
+ # `/goal` command stay on the host plane: the Gateway serves the goal domain as
231
+ # Remote endpoints whose receiver comes from a generated descriptor, so it
232
+ # resolves `goals` on the host and an entry-local realm here would hide it. The
233
+ # registry is keyed by session anyway, so one host instance serves every
234
+ # session. What a preset chooses is whether its agent can call the goal tool.
235
+ - id: tool-goal
236
+ name: '@deepseek-ai/dsh-tool-goal'
237
+
238
+ # ── plan mode ───────────────────────────────────────────────────────────────
239
+
240
+ # Plan state is per-agent by nature, so an entry-local realm is not a
241
+ # workaround here — it is the correct lifetime.
242
+ - id: planning
243
+ name: cordis:group
244
+ group: true
245
+ isolate:
246
+ planMode: true
247
+ config:
248
+ - id: plan-mode
249
+ name: '@deepseek-ai/dsh-plan-mode'
250
+ config:
251
+ section: |
252
+ You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
253
+
254
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
255
+
256
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
257
+
258
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
259
+
260
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
261
+
262
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
263
+
264
+ # ── compaction ──────────────────────────────────────────────────────────────
265
+
266
+ # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
267
+ # share this realm rather than sit outside it.
268
+ #
269
+ # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
270
+ # plane, and the rows here resolve that one instance. It takes no configuration,
271
+ # keys every fold by Session, and owns the context-meter projection units the
272
+ # browser reads for every session — behind a realm those units would come and go
273
+ # with whichever presets happen to be mounted. What a preset chooses is whether
274
+ # its agent compacts at all, which is `compaction-basic` below.
275
+ - id: compaction
276
+ name: cordis:group
277
+ group: true
278
+ isolate:
279
+ compaction: true
280
+ toolResultPruner: true
281
+ config:
282
+ - id: compaction-basic
283
+ name: '@deepseek-ai/dsh-compaction-basic'
284
+
285
+ - id: command-compact
286
+ name: '@deepseek-ai/dsh-command-compact'
287
+
288
+ - id: tool-result-pruner
289
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
290
+ config:
291
+ thresholdChars: 8192
292
+ headChars: 4096
293
+ tailChars: 1024
294
+
295
+ # ── delegation and workflows ────────────────────────────────────────────────
296
+
297
+ # The `subagents` registry and its spawn/fork backends live in the HOST
298
+ # composition: the registry is a process singleton whose cross-session queries
299
+ # the api-proxy serves to the browser, and a provider name may only be
300
+ # registered once. This preset contributes the delegation TOOLS, which resolve
301
+ # that host registry.
302
+ #
303
+ # `workflows` is different — nothing outside an agent reads it — so every row
304
+ # that reaches it shares one entry-local realm here, and a consumer left
305
+ # outside would resolve a host registry this preset does not populate.
306
+ #
307
+ # `tool-subagent-report` is host-plane for the same reason as the registry,
308
+ # not because a preset may not want it: it registers a CONTINUABLE SETUP on
309
+ # that singleton rather than a tool this agent calls, and the setup list is
310
+ # not scope-aware — one copy per mounted preset means every child gets
311
+ # `report` registered once per live session, which throws on the second.
312
+ - id: delegation
313
+ name: cordis:group
314
+ group: true
315
+ isolate:
316
+ workflowEngine: true
317
+ config:
318
+ - id: tool-subagent-control
319
+ name: '@deepseek-ai/dsh-tool-subagent-control'
320
+
321
+ - id: tool-subagent-list-agents
322
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
323
+
324
+ - id: tool-subagent
325
+ name: '@deepseek-ai/dsh-tool-subagent'
326
+ config:
327
+ provider: spawn
328
+ toolName: subagent
329
+ backgroundMode: continuable
330
+
331
+ - id: tool-subagent-fork
332
+ name: '@deepseek-ai/dsh-tool-subagent'
333
+ config:
334
+ provider: fork
335
+ toolName: subagent_fork
336
+ backgroundMode: continuable
337
+
338
+ # Product providers are host-plane singletons. Copy this preset, then
339
+ # remove `disabled` from either ordinary tool row to expose that product
340
+ # only to agents composed from the copy.
341
+ - id: tool-subagent-codex
342
+ name: '@deepseek-ai/dsh-tool-subagent'
343
+ disabled: true
344
+ config:
345
+ provider: codex
346
+ toolName: subagent_codex
347
+ enableRunInBackground: false
348
+ maxDepth: provider-managed
349
+
350
+ - id: tool-subagent-claude-code
351
+ name: '@deepseek-ai/dsh-tool-subagent'
352
+ disabled: true
353
+ config:
354
+ provider: claude-code
355
+ toolName: subagent_claude_code
356
+ enableRunInBackground: false
357
+ maxDepth: provider-managed
358
+
359
+ - id: workflow-worker-thread
360
+ name: '@deepseek-ai/dsh-workflow-worker-thread'
361
+ config:
362
+ provider: spawn
363
+
364
+ - id: tool-workflow
365
+ name: '@deepseek-ai/dsh-tool-workflow'
366
+
367
+ - id: tool-ralph
368
+ name: '@deepseek-ai/dsh-tool-ralph'
369
+ config:
370
+ subagentProvider: spawn
371
+ maxRounds: 64
372
+
373
+ # ── remaining model-facing rows ─────────────────────────────────────────────
374
+
375
+ - id: tool-ask-user
376
+ name: '@deepseek-ai/dsh-tool-ask-user'
377
+
378
+ - id: tool-todo
379
+ name: '@deepseek-ai/dsh-tool-todo'
380
+ config:
381
+ allowParallelInProgress: true
382
+
383
+ # The `web` service and its search provider stay in the host composition; only
384
+ # the model-facing tool is per-session.
385
+ - id: tool-web
386
+ name: '@deepseek-ai/dsh-tool-web'
387
+ config:
388
+ fetch: false
389
+ searchTimeoutMs: 60000