@xmoon76/dsh-pi-tui 0.3.5 → 0.4.0-alpha.1

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.
@@ -26,11 +26,15 @@ interface HarnessCompatEntry {
26
26
  max?: string;
27
27
  /** The bundle release line that first required this constraint. */
28
28
  since: string;
29
- /** Human-readable requirement, e.g. `DeepSeek Harness 0.1.1-rc.1 or later`. */
29
+ /** Human-readable requirement, e.g. `DeepSeek Harness 0.1.2-alpha.2 or later`. */
30
30
  requires: string;
31
- /** What the user must do; placeholders are NOT needed — the message
32
- * builder fills in the requirement and the installed version. */
33
- guidance: string;
31
+ /** The target DSH version to install when the current runtime is too old. */
32
+ upgradeDsh?: string;
33
+ /** The compatible TUI line to install when keeping an old DSH runtime. */
34
+ fallbackTui?: string;
35
+ /** Special guidance for a range that is not covered by the normal recovery
36
+ * commands, such as an unvalidated future DSH line. */
37
+ guidance?: string;
34
38
  }
35
39
  /** The compatibility table. */
36
40
  declare const HARNESS_COMPAT: readonly HarnessCompatEntry[];
@@ -41,9 +45,11 @@ declare function harnessCompatEntryFor(installed: string): HarnessCompatEntry |
41
45
  * package.json at runtime (never hardcoded). Falls back to the release
42
46
  * line that first imposed the requirement when unreadable. */
43
47
  declare function bundleVersionLabel(since: string): string;
44
- /** The actionable message printed before the loader's raw failure when the
45
- * installed harness falls in an incompatible range. `entry` MUST be the
46
- * entry {@link harnessCompatEntryFor} matched for `installed`. */
48
+ /** The actionable compatibility notice printed when the installed harness
49
+ * falls in an incompatible range. `entry` MUST be the entry
50
+ * {@link harnessCompatEntryFor} matched for `installed`. The notice is
51
+ * advisory: DSH Loader mounts profile entries concurrently, so this row cannot
52
+ * guarantee that its output precedes another row's import failure. */
47
53
  declare function incompatibleHarnessMessage(installed: string, entry: HarnessCompatEntry): string;
48
54
  /** Service provided by this plugin and injected by the TUI runner row. */
49
55
  declare const TUI_STARTUP_SERVICE = "tuiStartup";
@@ -53,13 +59,6 @@ interface TuiStartupValues {
53
59
  sessionId?: string;
54
60
  /** `--preset`, the agent preset a fresh session starts on. */
55
61
  presetId?: string;
56
- /**
57
- * The shipped agent-preset root bundled with this package. Absolute path of
58
- * `config/agent-presets/` beside the built `lib/`; rows configured from the
59
- * service (the `agent-presets` roster row) resolve it only after this
60
- * service exists, mirroring the web bundle's `webStartup` pattern.
61
- */
62
- shippedPresetRoot: string;
63
62
  }
64
63
  /**
65
64
  * Parse and provide the TUI invocation as an ordinary Cordis service. The
package/dist/startup.mjs CHANGED
@@ -68,10 +68,11 @@ const name = "tui-startup";
68
68
  const inject = ["cmdlineArgs"];
69
69
  /** The compatibility table. */
70
70
  const HARNESS_COMPAT = [{
71
- max: "0.1.1-rc.1",
72
- since: "0.3.0",
73
- requires: "DeepSeek Harness 0.1.1-rc.1 or later",
74
- guidance: "Upgrade dsh first, e.g.: npm install -g @deepseek-ai/dsh@0.1.1-rc.1"
71
+ max: "0.1.2-alpha.2",
72
+ since: "0.4.0-alpha.1",
73
+ requires: "DeepSeek Harness 0.1.2-alpha.2 or later",
74
+ upgradeDsh: "0.1.2-alpha.2",
75
+ fallbackTui: "0.3"
75
76
  }];
76
77
  /** The compat entry covering the installed dsh version, or undefined when
77
78
  * the harness is supported. */
@@ -89,15 +90,25 @@ function bundleVersionLabel(since) {
89
90
  return `>= ${since}`;
90
91
  }
91
92
  }
92
- /** The actionable message printed before the loader's raw failure when the
93
- * installed harness falls in an incompatible range. `entry` MUST be the
94
- * entry {@link harnessCompatEntryFor} matched for `installed`. */
93
+ /** The actionable compatibility notice printed when the installed harness
94
+ * falls in an incompatible range. `entry` MUST be the entry
95
+ * {@link harnessCompatEntryFor} matched for `installed`. The notice is
96
+ * advisory: DSH Loader mounts profile entries concurrently, so this row cannot
97
+ * guarantee that its output precedes another row's import failure. */
95
98
  function incompatibleHarnessMessage(installed, entry) {
99
+ const recovery = [];
100
+ if (entry.upgradeDsh !== void 0) recovery.push("Upgrade DeepSeek Harness:", ` npm install -g @deepseek-ai/dsh@${entry.upgradeDsh}`);
101
+ if (entry.fallbackTui !== void 0) recovery.push("Or keep your current Harness and use the compatible TUI line:", ` npm install -g @xmoon76/dsh-pi-tui@${entry.fallbackTui}`);
102
+ if (entry.guidance !== void 0) recovery.push(entry.guidance);
96
103
  return [
97
104
  `dsh-pi-tui ${bundleVersionLabel(entry.since)} requires ${entry.requires},`,
98
105
  `but this installation is running dsh ${installed}.`,
99
106
  "",
100
- `${entry.guidance}`,
107
+ ...recovery.length === 0 ? [] : [
108
+ "Choose one:",
109
+ "",
110
+ ...recovery
111
+ ],
101
112
  "Then re-run: dsh --profile pi-tui"
102
113
  ].join("\n");
103
114
  }
@@ -127,14 +138,12 @@ function apply(ctx) {
127
138
  if (entry !== void 0) {
128
139
  const message = incompatibleHarnessMessage(installed, entry);
129
140
  process.stderr.write(`\n${message}\n\n`);
130
- throw new Error(message);
131
141
  }
132
142
  }
133
143
  const options = program.opts();
134
144
  ctx.provide(TUI_STARTUP_SERVICE, {
135
145
  ...options.session !== void 0 ? { sessionId: options.session } : {},
136
- ...options.preset !== void 0 ? { presetId: options.preset } : {},
137
- shippedPresetRoot: join(import.meta.dirname, "..", "config", "agent-presets")
146
+ ...options.preset !== void 0 ? { presetId: options.preset } : {}
138
147
  });
139
148
  });
140
149
  parseCmdline(ctx, program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmoon76/dsh-pi-tui",
3
- "version": "0.3.5",
3
+ "version": "0.4.0-alpha.1",
4
4
  "description": "The dsh-pi-tui bundle: a TUI surface for DeepSeek Harness profiles (dsh --profile pi-tui)",
5
5
  "license": "MIT",
6
6
  "author": "XMoon <xmoonox@gmail.com>",
@@ -53,7 +53,6 @@
53
53
  },
54
54
  "files": [
55
55
  "dist",
56
- "config",
57
56
  "scripts/repair-session.mjs",
58
57
  "scripts/repair-core.mjs",
59
58
  "cordis.patch.yml",
@@ -76,77 +75,104 @@
76
75
  "marked": "18.0.5"
77
76
  },
78
77
  "peerDependencies": {
79
- "@deepseek-ai/cordis": "^4.0.1",
78
+ "@deepseek-ai/cordis": "^4.0.2",
80
79
  "@deepseek-ai/cordis-plugin-loader": "^1.0.2",
81
- "@deepseek-ai/dsh-agent": "^0.1.1-rc.1",
82
- "@deepseek-ai/dsh-agent-default-model": "^0.1.1-rc.1",
83
- "@deepseek-ai/dsh-agent-presets": "^0.1.1-rc.1",
84
- "@deepseek-ai/dsh-authorization": "^0.1.1-rc.1",
85
- "@deepseek-ai/dsh-cmdline": "^0.1.1-rc.1",
86
- "@deepseek-ai/dsh-commands": "^0.1.1-rc.1",
87
- "@deepseek-ai/dsh-credentials": "^0.1.1-rc.1",
88
- "@deepseek-ai/dsh-goal": "^0.1.1-rc.1",
89
- "@deepseek-ai/dsh-jobs": "^0.1.1-rc.1",
90
- "@deepseek-ai/dsh-llm": "^0.1.1-rc.1",
91
- "@deepseek-ai/dsh-llm-retry": "^0.1.1-rc.1",
92
- "@deepseek-ai/dsh-permission-presets": "^0.1.1-rc.1",
93
- "@deepseek-ai/dsh-plan-mode": "^0.1.1-rc.1",
94
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.1-rc.1",
95
- "@deepseek-ai/dsh-session": "^0.1.1-rc.1",
96
- "@deepseek-ai/dsh-session-persistence": "^0.1.1-rc.1",
97
- "@deepseek-ai/dsh-session-title": "^0.1.1-rc.1",
98
- "@deepseek-ai/dsh-settings": "^0.1.1-rc.1",
99
- "@deepseek-ai/dsh-shell": "^0.1.1-rc.1",
100
- "@deepseek-ai/dsh-skill": "^0.1.1-rc.1",
101
- "@deepseek-ai/dsh-subagent": "^0.1.1-rc.1",
102
- "@deepseek-ai/dsh-token-meter": "^0.1.1-rc.1",
103
- "@deepseek-ai/dsh-tool-workflow": "^0.1.1-rc.1",
104
- "@deepseek-ai/dsh-tools": "^0.1.1-rc.1",
105
- "@deepseek-ai/dsh-user-approval": "^0.1.1-rc.1",
106
- "@deepseek-ai/dsh-user-questions": "^0.1.1-rc.1",
80
+ "@deepseek-ai/dsh-agent": ">=0.1.2-alpha.2",
81
+ "@deepseek-ai/dsh-agent-default-model": ">=0.1.2-alpha.2",
82
+ "@deepseek-ai/dsh-agent-presets": ">=0.1.2-alpha.2",
83
+ "@deepseek-ai/dsh-authorization": ">=0.1.2-alpha.2",
84
+ "@deepseek-ai/dsh-cmdline": ">=0.1.2-alpha.2",
85
+ "@deepseek-ai/dsh-commands": ">=0.1.2-alpha.2",
86
+ "@deepseek-ai/dsh-credentials": ">=0.1.2-alpha.2",
87
+ "@deepseek-ai/dsh-goal": ">=0.1.2-alpha.2",
88
+ "@deepseek-ai/dsh-jobs": ">=0.1.2-alpha.2",
89
+ "@deepseek-ai/dsh-llm": ">=0.1.2-alpha.2",
90
+ "@deepseek-ai/dsh-llm-retry": ">=0.1.2-alpha.2",
91
+ "@deepseek-ai/dsh-permission-presets": ">=0.1.2-alpha.2",
92
+ "@deepseek-ai/dsh-plan-mode": ">=0.1.2-alpha.2",
93
+ "@deepseek-ai/dsh-sandbox-policy": ">=0.1.2-alpha.2",
94
+ "@deepseek-ai/dsh-session": ">=0.1.2-alpha.2",
95
+ "@deepseek-ai/dsh-session-persistence": ">=0.1.2-alpha.2",
96
+ "@deepseek-ai/dsh-session-title": ">=0.1.2-alpha.2",
97
+ "@deepseek-ai/dsh-settings": ">=0.1.2-alpha.2",
98
+ "@deepseek-ai/dsh-shell": ">=0.1.2-alpha.2",
99
+ "@deepseek-ai/dsh-skill": ">=0.1.2-alpha.2",
100
+ "@deepseek-ai/dsh-subagent": ">=0.1.2-alpha.2",
101
+ "@deepseek-ai/dsh-token-meter": ">=0.1.2-alpha.2",
102
+ "@deepseek-ai/dsh-tool-todo": ">=0.1.2-alpha.2",
103
+ "@deepseek-ai/dsh-tool-workflow": ">=0.1.2-alpha.2",
104
+ "@deepseek-ai/dsh-tools": ">=0.1.2-alpha.2",
105
+ "@deepseek-ai/dsh-user-approval": ">=0.1.2-alpha.2",
106
+ "@deepseek-ai/dsh-user-questions": ">=0.1.2-alpha.2",
107
107
  "@deepseek-ai/schemastery": "^3.18.1"
108
108
  },
109
109
  "devDependencies": {
110
110
  "@deepseek-ai/cordis-plugin-loader": "^1.0.2",
111
- "@deepseek-ai/dsh-agent": "^0.1.1-rc.1",
112
- "@deepseek-ai/dsh-agent-default-model": "^0.1.1-rc.1",
113
- "@deepseek-ai/dsh-agent-loop": "^0.1.1-rc.1",
114
- "@deepseek-ai/dsh-agent-presets": "^0.1.1-rc.1",
115
- "@deepseek-ai/dsh-attachment": "^0.1.1-rc.1",
116
- "@deepseek-ai/dsh-authorization": "^0.1.1-rc.1",
117
- "@deepseek-ai/dsh-brand": "^0.1.1-rc.1",
118
- "@deepseek-ai/dsh-commands": "^0.1.1-rc.1",
119
- "@deepseek-ai/dsh-credentials": "^0.1.1-rc.1",
120
- "@deepseek-ai/dsh-goal": "^0.1.1-rc.1",
121
- "@deepseek-ai/dsh-invariants": "^0.1.1-rc.1",
122
- "@deepseek-ai/dsh-jobs": "^0.1.1-rc.1",
123
- "@deepseek-ai/dsh-llm": "^0.1.1-rc.1",
124
- "@deepseek-ai/dsh-llm-retry": "^0.1.1-rc.1",
125
- "@deepseek-ai/dsh-permission-presets": "^0.1.1-rc.1",
126
- "@deepseek-ai/dsh-plan-mode": "^0.1.1-rc.1",
127
- "@deepseek-ai/dsh-scope": "^0.1.1-rc.1",
128
- "@deepseek-ai/dsh-session": "^0.1.1-rc.1",
129
- "@deepseek-ai/dsh-session-persistence": "^0.1.1-rc.1",
130
- "@deepseek-ai/dsh-session-title": "^0.1.1-rc.1",
131
- "@deepseek-ai/dsh-settings": "^0.1.1-rc.1",
132
- "@deepseek-ai/dsh-shell": "^0.1.1-rc.1",
133
- "@deepseek-ai/dsh-skill": "^0.1.1-rc.1",
134
- "@deepseek-ai/dsh-subagent": "^0.1.1-rc.1",
135
- "@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.1",
136
- "@deepseek-ai/dsh-timeout": "^0.1.1-rc.1",
137
- "@deepseek-ai/dsh-token-meter": "^0.1.1-rc.1",
138
- "@deepseek-ai/dsh-tool-workflow": "^0.1.1-rc.1",
139
- "@deepseek-ai/dsh-tools": "^0.1.1-rc.1",
140
- "@deepseek-ai/dsh-user-approval": "^0.1.1-rc.1",
141
- "@deepseek-ai/dsh-user-questions": "^0.1.1-rc.1",
111
+ "@deepseek-ai/dsh-agent": "0.1.2-alpha.3",
112
+ "@deepseek-ai/dsh-agent-default-model": "0.1.2-alpha.3",
113
+ "@deepseek-ai/dsh-agent-loop": "0.1.2-alpha.3",
114
+ "@deepseek-ai/dsh-agent-presets": "0.1.2-alpha.3",
115
+ "@deepseek-ai/dsh-attachment": "0.1.2-alpha.3",
116
+ "@deepseek-ai/dsh-authorization": "0.1.2-alpha.3",
117
+ "@deepseek-ai/dsh-brand": "0.1.2-alpha.3",
118
+ "@deepseek-ai/dsh-commands": "0.1.2-alpha.3",
119
+ "@deepseek-ai/dsh-credentials": "0.1.2-alpha.3",
120
+ "@deepseek-ai/dsh-goal": "0.1.2-alpha.3",
121
+ "@deepseek-ai/dsh-invariants": "0.1.2-alpha.3",
122
+ "@deepseek-ai/dsh-jobs": "0.1.2-alpha.3",
123
+ "@deepseek-ai/dsh-llm": "0.1.2-alpha.3",
124
+ "@deepseek-ai/dsh-llm-retry": "0.1.2-alpha.3",
125
+ "@deepseek-ai/dsh-permission-presets": "0.1.2-alpha.3",
126
+ "@deepseek-ai/dsh-plan-mode": "0.1.2-alpha.3",
127
+ "@deepseek-ai/dsh-scope": "0.1.2-alpha.3",
128
+ "@deepseek-ai/dsh-session": "0.1.2-alpha.3",
129
+ "@deepseek-ai/dsh-session-persistence": "0.1.2-alpha.3",
130
+ "@deepseek-ai/dsh-session-title": "0.1.2-alpha.3",
131
+ "@deepseek-ai/dsh-settings": "0.1.2-alpha.3",
132
+ "@deepseek-ai/dsh-shell": "0.1.2-alpha.3",
133
+ "@deepseek-ai/dsh-skill": "0.1.2-alpha.3",
134
+ "@deepseek-ai/dsh-subagent": "0.1.2-alpha.3",
135
+ "@deepseek-ai/dsh-system-prompt": "0.1.2-alpha.3",
136
+ "@deepseek-ai/dsh-timeout": "0.1.2-alpha.3",
137
+ "@deepseek-ai/dsh-token-meter": "0.1.2-alpha.3",
138
+ "@deepseek-ai/dsh-tool-todo": "0.1.2-alpha.3",
139
+ "@deepseek-ai/dsh-tool-workflow": "0.1.2-alpha.3",
140
+ "@deepseek-ai/dsh-tools": "0.1.2-alpha.3",
141
+ "@deepseek-ai/dsh-user-approval": "0.1.2-alpha.3",
142
+ "@deepseek-ai/dsh-user-questions": "0.1.2-alpha.3",
142
143
  "@deepseek-ai/schemastery": "^3.18.1",
143
144
  "@types/node": "^22.0.0",
144
145
  "@xmoon76/pi-tui": "^0.84.3",
145
146
  "@xterm/headless": "5.5.0",
146
147
  "husky": "^9.1.7",
148
+ "semver": "7.8.5",
147
149
  "tsdown": "0.22.0",
148
150
  "tsx": "^4.23.12",
149
- "typescript": "^5.9.0"
151
+ "typescript": "^5.9.0",
152
+ "@deepseek-ai/dsh-session-projection": "0.1.2-alpha.3",
153
+ "@deepseek-ai/dsh-persona": "0.1.2-alpha.3",
154
+ "@deepseek-ai/dsh-agent-instructions": "0.1.2-alpha.3",
155
+ "@deepseek-ai/dsh-tool-fs": "0.1.2-alpha.3",
156
+ "@deepseek-ai/dsh-tool-fs-search": "0.1.2-alpha.3",
157
+ "@deepseek-ai/dsh-tool-jobs": "0.1.2-alpha.3",
158
+ "@deepseek-ai/dsh-skill-filesystem": "0.1.2-alpha.3",
159
+ "@deepseek-ai/dsh-tool-skill": "0.1.2-alpha.3",
160
+ "@deepseek-ai/dsh-command-goal": "0.1.2-alpha.3",
161
+ "@deepseek-ai/dsh-tool-goal": "0.1.2-alpha.3",
162
+ "@deepseek-ai/dsh-compaction-basic": "0.1.2-alpha.3",
163
+ "@deepseek-ai/dsh-command-compact": "0.1.2-alpha.3",
164
+ "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.1.2-alpha.3",
165
+ "@deepseek-ai/dsh-tool-subagent-control": "0.1.2-alpha.3",
166
+ "@deepseek-ai/dsh-tool-subagent": "0.1.2-alpha.3",
167
+ "@deepseek-ai/dsh-workflow-worker-thread": "0.1.2-alpha.3",
168
+ "@deepseek-ai/dsh-tool-ralph": "0.1.2-alpha.3",
169
+ "@deepseek-ai/dsh-tool-ask-user": "0.1.2-alpha.3",
170
+ "@deepseek-ai/dsh-tool-web": "0.1.2-alpha.3",
171
+ "@deepseek-ai/dsh-agent-tool-presentation": "0.1.2-alpha.3",
172
+ "@deepseek-ai/dsh-terminal": "0.1.2-alpha.3",
173
+ "@deepseek-ai/dsh-fs-local": "0.1.2-alpha.3",
174
+ "@deepseek-ai/dsh-tool-str-replace-editor": "0.1.2-alpha.3",
175
+ "@deepseek-ai/dsh-tool-cordis": "0.1.2-alpha.3"
150
176
  },
151
177
  "engines": {
152
178
  "node": "^22.19.0 || >=24"
@@ -161,24 +187,37 @@
161
187
  "typecheck:bundle": "tsc -p tsconfig.json --noEmit",
162
188
  "typecheck": "pnpm typecheck:fork && pnpm typecheck:bundle",
163
189
  "test:fork": "pnpm --dir packages/pi-tui test",
164
- "test:bundle": "node --test test/*.test.ts test/*.test.mjs",
190
+ "test:bundle": "pnpm test:product && pnpm test:tooling",
165
191
  "test:docs": "node --test docs/tmux/*.test.mjs",
166
- "test": "pnpm test:fork && pnpm test:bundle && pnpm test:docs",
192
+ "test": "pnpm test:fork && pnpm test:product && pnpm test:tooling && pnpm test:docs",
167
193
  "smoke": "node scripts/tarball-smoke.mjs",
168
194
  "smoke:fixture": "node scripts/extension-fixture-smoke.mjs",
169
195
  "smoke:advanced": "node scripts/advanced-plugin-smoke.mjs",
170
196
  "smoke:phase4": "node scripts/phase4-plugin-smoke.mjs",
171
197
  "smoke:unstable": "node scripts/unstable-plugin-smoke.mjs",
172
198
  "smoke:pi2dsh": "node scripts/pi2dsh-compat-smoke.mjs",
199
+ "smoke:official-presets": "node scripts/official-presets-smoke.mjs",
200
+ "smoke:boundary": "node scripts/dsh-runtime-boundary-smoke.mjs",
201
+ "dsh:source:pack": "node scripts/dsh-source-pack.mjs",
202
+ "compat:dsh:source": "node scripts/dsh-source-verify.mjs",
203
+ "compat:dsh:npm": "node scripts/dsh-npm-verify.mjs",
204
+ "prepare:dsh:test": "node scripts/prepare-dsh-test-environment.mjs",
205
+ "gate:source-leak": "node scripts/dsh-source-leak-gate.mjs",
173
206
  "smoke:vim": "node scripts/vim-plugin-smoke.mjs",
174
207
  "gate:pi-surface-compat": "node --test test/pi-component-compat.test.ts",
175
208
  "smoke:examples": "node scripts/examples-plugin-smoke.mjs",
176
209
  "pack:release": "rm -f xmoon76-dsh-pi-tui-*.tgz && pnpm pack --pack-destination .",
210
+ "release:context": "node scripts/release-context.mjs",
177
211
  "release:notes": "node scripts/release-notes.mjs",
178
212
  "smoke:pack": "node scripts/tarball-smoke.mjs",
179
- "verify:prepush": "pnpm typecheck:fork && pnpm test:fork && pnpm test:docs && node scripts/naming-gate.mjs && pnpm gate:boundary && pnpm gate:keybindings && pnpm audit --prod --audit-level high && pnpm pack:release",
180
- "verify:prepush:nofork": "pnpm test:docs && node scripts/naming-gate.mjs && pnpm gate:boundary && pnpm gate:keybindings && pnpm audit --prod --audit-level high && pnpm pack:release",
213
+ "dev:doctor": "node scripts/dev-doctor.mjs",
214
+ "dev:bootstrap": "node scripts/dev-bootstrap.mjs",
215
+ "dev:shell": "node scripts/dev-shell.mjs",
216
+ "verify:prepush": "pnpm typecheck:fork && pnpm test:fork && pnpm test:docs && pnpm test:tooling && node scripts/naming-gate.mjs && pnpm gate:boundary && pnpm gate:keybindings && pnpm audit --prod --audit-level high && pnpm pack:release",
217
+ "verify:prepush:nofork": "pnpm test:docs && pnpm test:tooling && node scripts/naming-gate.mjs && pnpm gate:boundary && pnpm gate:keybindings && pnpm audit --prod --audit-level high && pnpm pack:release",
181
218
  "gate:boundary": "node scripts/client-boundary-gate.mjs",
182
- "gate:keybindings": "node --import tsx/esm scripts/check-host-keybindings.mts"
219
+ "gate:keybindings": "node --import tsx/esm scripts/check-host-keybindings.mts",
220
+ "test:tooling": "node --test test/dev-environment.test.mjs test/pre-push-hook.test.mjs test/pre-push-stages.test.mjs test/dsh-ci-context.test.mjs test/dsh-distribution.test.mjs test/dsh-npm-verify.test.mjs test/dsh-peer-window.test.mjs test/dsh-process.test.mjs test/dsh-runtime-boundary.test.mjs test/dsh-source-identity.test.mjs test/dsh-source-leak.test.mjs test/release-context.test.mjs test/release-notes.test.mjs test/source-mode-rules.test.mjs test/client-boundary-gate.test.mjs test/tarball-source-install.test.mjs test/pi2dsh-compat-smoke.test.mjs",
221
+ "test:product": "node --test test/*.test.ts test/repair.test.mjs test/tarball-smoke.test.mjs"
183
222
  }
184
223
  }
@@ -37,7 +37,7 @@ import { randomUUID } from 'node:crypto'
37
37
  import { copyFileSync, existsSync, openSync, fsyncSync, closeSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, writeFileSync } from 'node:fs'
38
38
  import { homedir } from 'node:os'
39
39
  import { basename, dirname, join, resolve } from 'node:path'
40
- import { pathToFileURL } from 'node:url'
40
+ import { fileURLToPath, pathToFileURL } from 'node:url'
41
41
  import { createRequire } from 'node:module'
42
42
  import { spawnSync } from 'node:child_process'
43
43
  import { zstdCompressSync, zstdDecompressSync } from 'node:zlib'
@@ -461,8 +461,20 @@ function main(args) {
461
461
  console.log(` verify: valid frame layout, contiguous, ${verifyEvents.events.length} event(s)`)
462
462
  }
463
463
 
464
- const isMain = process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href
465
- if (isMain) {
464
+ function invokedAsMainModule() {
465
+ const entry = process.argv[1]
466
+ if (entry === undefined) return false
467
+ try {
468
+ // pnpm exposes package files through symlinks. Node resolves
469
+ // import.meta.url to the real file while argv[1] retains the symlink, so
470
+ // compare canonical paths instead of treating a symlinked CLI as an import.
471
+ return realpathSync(entry) === fileURLToPath(import.meta.url)
472
+ } catch {
473
+ return import.meta.url === pathToFileURL(entry).href
474
+ }
475
+ }
476
+
477
+ if (invokedAsMainModule()) {
466
478
  try {
467
479
  main(process.argv.slice(2))
468
480
  } catch (error) {
@@ -1,263 +0,0 @@
1
- # The `code` agent preset: the standard coding agent, presented as Code Mode.
2
- #
3
- # Everything in `standard` is here unchanged. What is added is the `tool-presentation`
4
- # row: instead of one tool call per action, the model writes a TypeScript
5
- # program against a generated SDK and `run_code` executes it, so a sequence
6
- # that would be five round trips becomes one.
7
- #
8
- # The registry itself stays on the host plane — the agent loop's scheduler and
9
- # the API proxy's presenters are its consumers — so what this preset owns is
10
- # the PRESENTATION of that registry for this agent alone. Native sessions run
11
- # beside this one in the same process, each seeing its own catalog.
12
- #
13
- # This file is an AGENT-PLANE composition. It is mounted under one agent's
14
- # scope context, so every tool and prompt section it registers belongs to that
15
- # session alone. The host composition (`base.cordis.yml` + `web.cordis.yml`)
16
- # keeps everything a preset must not own: the registries themselves, the
17
- # sandbox and approval stack, persistence, and the model route.
18
- #
19
- # A service row here MUST sit inside a group carrying an `isolate` realm.
20
- # Without one it publishes into the root realm, where it is process-global
21
- # rather than per-session and the second session mounting this preset collides
22
- # with the first; `dsh-agent-presets` rejects that at mount. `true` means an
23
- # entry-local realm — one private instance per mounted session, which is the
24
- # default this deployment wants. A shared label would instead pool one instance
25
- # across every session naming it.
26
-
27
- # ── identity ────────────────────────────────────────────────────────────────
28
-
29
- # The preset's own persona, shadowing the deployment default for this agent.
30
- # `{{model}}` and `{{cwd}}` resolve from the agent's own route and workspace.
31
- - id: persona
32
- name: '@deepseek-ai/dsh-persona'
33
- config:
34
- text: >-
35
- You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
36
-
37
- - id: agent-instructions
38
- name: '@deepseek-ai/dsh-agent-instructions'
39
- config:
40
- maxBytes: 65536
41
-
42
- # ── shell ───────────────────────────────────────────────────────────────────
43
-
44
- # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
45
- # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
46
- # the criterion for host-plane ownership — injection resolves before any session
47
- # exists, so there is no agent to key by. Behind a preset realm those variables
48
- # never reached the model's shell at all. Both shell tools consume the host
49
- # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
50
- # host-plane too.
51
- - id: tool-bash
52
- name: '@deepseek-ai/dsh-tool-bash'
53
- disabled: !!js process.platform === 'win32'
54
-
55
- - id: tool-pwsh
56
- name: '@deepseek-ai/dsh-tool-pwsh'
57
- disabled: !!js process.platform !== 'win32'
58
-
59
- # ── filesystem ──────────────────────────────────────────────────────────────
60
-
61
- # Both register into the host `tools` registry and provide nothing, so
62
- # they need no realm. The `fs` service and its policy stay in the host.
63
- - id: tool-fs
64
- name: '@deepseek-ai/dsh-tool-fs'
65
-
66
- - id: tool-fs-search
67
- name: '@deepseek-ai/dsh-tool-fs-search'
68
- config:
69
- sampleOverCapGlobResults: false
70
-
71
- # ── background jobs ────────────────────────────────────────────────────────
72
-
73
- # Only the model-facing controls. The task REGISTRY stays on the host plane:
74
- # its producers sit outside any realm this file could put it in — `tool-bash`
75
- # above resolves it with `ctx.get`, and an entry-local realm here is invisible
76
- # to every sibling row, so `run_in_background` would answer "background jobs
77
- # unavailable" while these controls sat in the catalog. The registry is keyed by
78
- # owning agent anyway, so one host instance serves every session. What a preset
79
- # chooses is whether its agent can collect and stop background work at all.
80
- - id: tool-jobs
81
- name: '@deepseek-ai/dsh-tool-jobs'
82
-
83
- # ── skills ──────────────────────────────────────────────────────────────────
84
-
85
- # The skill REGISTRY lives in the host composition and is layered per scope:
86
- # these rows register into THIS preset's layer of it, so they need no realm.
87
- # `skill-filesystem` contributes local-root discovery for agents on this preset, and
88
- # `tool-skill` gives them the catalog and loader; the merged catalog also
89
- # carries whatever the deployment registered globally (repository plugins).
90
- - id: skill-filesystem
91
- name: '@deepseek-ai/dsh-skill-filesystem'
92
-
93
- - id: tool-skill
94
- name: '@deepseek-ai/dsh-tool-skill'
95
-
96
- # ── goals ───────────────────────────────────────────────────────────────────
97
-
98
- # Only the model-facing tool. The goal SERVICE, its session driver, and the
99
- # `/goal` command stay on the host plane: the Gateway serves the goal domain as
100
- # Remote endpoints whose receiver comes from a generated descriptor, so it
101
- # resolves `goals` on the host and an entry-local realm here would hide it. The
102
- # registry is keyed by session anyway, so one host instance serves every
103
- # session. What a preset chooses is whether its agent can call the goal tool.
104
- - id: tool-goal
105
- name: '@deepseek-ai/dsh-tool-goal'
106
-
107
- # ── plan mode ───────────────────────────────────────────────────────────────
108
-
109
- # Plan state is per-agent by nature, so an entry-local realm is not a
110
- # workaround here — it is the correct lifetime.
111
- - id: planning
112
- name: cordis:group
113
- group: true
114
- isolate:
115
- planMode: true
116
- config:
117
- - id: plan-mode
118
- name: '@deepseek-ai/dsh-plan-mode'
119
- config:
120
- section: |
121
- 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.
122
-
123
- 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.
124
-
125
- 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.
126
-
127
- 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.
128
-
129
- 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.
130
-
131
- 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.
132
-
133
- # ── compaction ──────────────────────────────────────────────────────────────
134
-
135
- # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
136
- # share this realm rather than sit outside it.
137
- #
138
- # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
139
- # plane, and the rows here resolve that one instance. It takes no configuration,
140
- # keys every fold by Session, and owns the context-meter projection units the
141
- # browser reads for every session — behind a realm those units would come and go
142
- # with whichever presets happen to be mounted. What a preset chooses is whether
143
- # its agent compacts at all, which is `compaction-basic` below.
144
- - id: compaction
145
- name: cordis:group
146
- group: true
147
- isolate:
148
- compaction: true
149
- toolResultPruner: true
150
- config:
151
- - id: compaction-basic
152
- name: '@deepseek-ai/dsh-compaction-basic'
153
-
154
- - id: command-compact
155
- name: '@deepseek-ai/dsh-command-compact'
156
-
157
- - id: tool-result-pruner
158
- name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
159
- config:
160
- thresholdChars: 8192
161
- headChars: 4096
162
- tailChars: 1024
163
-
164
- # ── delegation and workflows ────────────────────────────────────────────────
165
-
166
- # The `subagents` registry and its spawn/fork backends live in the HOST
167
- # composition: the registry is a process singleton whose cross-session queries
168
- # the api-proxy serves to the browser, and a provider name may only be
169
- # registered once. This preset contributes the delegation TOOLS, which resolve
170
- # that host registry.
171
- #
172
- # `workflows` is different — nothing outside an agent reads it — so every row
173
- # that reaches it shares one entry-local realm here, and a consumer left
174
- # outside would resolve a host registry this preset does not populate.
175
- - id: delegation
176
- name: cordis:group
177
- group: true
178
- isolate:
179
- workflowEngine: true
180
- config:
181
- - id: tool-subagent-control
182
- name: '@deepseek-ai/dsh-tool-subagent-control'
183
-
184
- - id: tool-subagent-list-agents
185
- name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
186
-
187
- - id: tool-subagent
188
- name: '@deepseek-ai/dsh-tool-subagent'
189
- config:
190
- provider: spawn
191
- toolName: subagent
192
- backgroundMode: continuable
193
-
194
- - id: tool-subagent-fork
195
- name: '@deepseek-ai/dsh-tool-subagent'
196
- config:
197
- provider: fork
198
- toolName: subagent_fork
199
- backgroundMode: continuable
200
-
201
- # Production dsh does not install these optional providers. Install the
202
- # matching Bundle in this Profile and restart the Host, then copy this
203
- # preset and remove `disabled` from the matching tool row. Host availability
204
- # alone grants no tool.
205
- - id: tool-subagent-codex
206
- name: '@deepseek-ai/dsh-tool-subagent'
207
- disabled: true
208
- config:
209
- provider: codex
210
- toolName: subagent_codex
211
- backgroundMode: one-shot
212
- maxDepth: provider-managed
213
-
214
- - id: tool-subagent-claude-code
215
- name: '@deepseek-ai/dsh-tool-subagent'
216
- disabled: true
217
- config:
218
- provider: claude-code
219
- toolName: subagent_claude_code
220
- backgroundMode: one-shot
221
- maxDepth: provider-managed
222
-
223
- - id: workflow-worker-thread
224
- name: '@deepseek-ai/dsh-workflow-worker-thread'
225
- config:
226
- provider: spawn
227
-
228
- - id: tool-workflow
229
- name: '@deepseek-ai/dsh-tool-workflow'
230
-
231
- - id: tool-ralph
232
- name: '@deepseek-ai/dsh-tool-ralph'
233
- config:
234
- subagentProvider: spawn
235
- maxRounds: 64
236
-
237
- # ── remaining model-facing rows ─────────────────────────────────────────────
238
-
239
- - id: tool-ask-user
240
- name: '@deepseek-ai/dsh-tool-ask-user'
241
-
242
- - id: tool-todo
243
- name: '@deepseek-ai/dsh-tool-todo'
244
- config:
245
- allowParallelInProgress: true
246
-
247
- # The `web` service and its search provider stay in the host composition; only
248
- # the model-facing tool is per-session.
249
- - id: tool-web
250
- name: '@deepseek-ai/dsh-tool-web'
251
- config:
252
- fetch: false
253
- searchTimeoutMs: 60000
254
-
255
- # ── presentation ────────────────────────────────────────────────────────────
256
-
257
- # Code Mode for this agent alone. The row waits for the host's `codeRuntime`
258
- # rather than assuming it: a deployment that composes no TypeScript runtime
259
- # fails this preset at mount, naming this id, instead of at the first request.
260
- - id: tool-presentation
261
- name: '@deepseek-ai/dsh-agent-tool-presentation'
262
- config:
263
- mode: code
@@ -1,3 +0,0 @@
1
- name: Code
2
- description: Everything in Standard, plus the Code Mode SDK: tools presented as a TypeScript program so the model composes multi-step operations in one run.
3
- order: 2