@yu_robotics/remote-cli 1.6.115 → 1.6.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -9
- package/dist/client/MessageHandler.d.ts.map +1 -1
- package/dist/client/MessageHandler.js +42 -30
- package/dist/client/MessageHandler.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +28 -11
- package/dist/commands/start.js.map +1 -1
- package/dist/delegation/BackendRegistry.d.ts.map +1 -1
- package/dist/delegation/BackendRegistry.js +15 -8
- package/dist/delegation/BackendRegistry.js.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.js +18 -4
- package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
- package/dist/executor/DshExecutor.d.ts +4 -0
- package/dist/executor/DshExecutor.d.ts.map +1 -1
- package/dist/executor/DshExecutor.js +37 -2
- package/dist/executor/DshExecutor.js.map +1 -1
- package/dist/executor/claude/ClaudeStderrFilter.d.ts +11 -0
- package/dist/executor/claude/ClaudeStderrFilter.d.ts.map +1 -0
- package/dist/executor/claude/ClaudeStderrFilter.js +68 -0
- package/dist/executor/claude/ClaudeStderrFilter.js.map +1 -0
- package/dist/executor/dsh/DshAccountUsage.d.ts +12 -0
- package/dist/executor/dsh/DshAccountUsage.d.ts.map +1 -0
- package/dist/executor/dsh/DshAccountUsage.js +134 -0
- package/dist/executor/dsh/DshAccountUsage.js.map +1 -0
- package/dist/executor/dsh/DshAccountUsagePlugin.d.ts +16 -0
- package/dist/executor/dsh/DshAccountUsagePlugin.d.ts.map +1 -0
- package/dist/executor/dsh/DshAccountUsagePlugin.js +19 -0
- package/dist/executor/dsh/DshAccountUsagePlugin.js.map +1 -0
- package/dist/service/ServiceManager.d.ts.map +1 -1
- package/dist/service/ServiceManager.js +4 -2
- package/dist/service/ServiceManager.js.map +1 -1
- package/dist/thread/DelegationSettings.d.ts +4 -0
- package/dist/thread/DelegationSettings.d.ts.map +1 -0
- package/dist/thread/DelegationSettings.js +8 -0
- package/dist/thread/DelegationSettings.js.map +1 -0
- package/dist/thread/types.d.ts +1 -1
- package/dist/thread/types.d.ts.map +1 -1
- package/dist/utils/BackendCommand.d.ts +8 -0
- package/dist/utils/BackendCommand.d.ts.map +1 -0
- package/dist/utils/BackendCommand.js +26 -0
- package/dist/utils/BackendCommand.js.map +1 -0
- package/dist/utils/BackendEnvironment.d.ts +16 -0
- package/dist/utils/BackendEnvironment.d.ts.map +1 -0
- package/dist/utils/BackendEnvironment.js +70 -0
- package/dist/utils/BackendEnvironment.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,8 @@ Remote control Claude Code, AGY CLI, Codex CLI, OpenCode CLI, Kimi Code CLI, ZCo
|
|
|
16
16
|
- **Automatic Updates**: Install the newer Router's exact version when idle. Manual clients keep running and use the update on their next start; supervised non-interactive clients exit for an immediate restart.
|
|
17
17
|
- **Task Recovery**: With a compatible Router, running tasks resume output on a usable surviving card or a new card with an output-gap notice. Recovery retries use bounded backoff; disconnected output is not buffered or replayed, even after recovery is paused.
|
|
18
18
|
|
|
19
|
+
Router 1.6.117 and newer explicitly label standalone background-task notifications **Background task**. The status, originating thread name (or thread ID when no name is provided), and abbreviated task ID remain visible, while **View details** is collapsed by default and contains the rich Markdown result and optional output path. Failed tasks also show a short, literal failure summary outside the panel. This changes only the Router presentation: the CLI protocol, foreground replies, delegated-worker cards, and reply-to-thread routing remain unchanged.
|
|
20
|
+
|
|
19
21
|
## Prerequisites
|
|
20
22
|
|
|
21
23
|
- **Node.js** >= 18.0.0
|
|
@@ -89,6 +91,8 @@ Help me fix TypeScript errors in ~/projects/my-app
|
|
|
89
91
|
|
|
90
92
|
Manual starts automatically install updates when tasks and queues are idle, without exiting the running client. Updates take effect on the next start. Use `remote-cli service install` for automatic startup and supervised restarts after updates. If the Router rejects the running protocol, restart the manual client after installation to reconnect. See [Automatic Client Startup](../../README.md#automatic-client-startup) for update behavior and recovery.
|
|
91
93
|
|
|
94
|
+
From CLI 1.6.119, Linux and macOS startup append deterministic backend installation directories to the inherited `PATH`, preserving existing executable and Node precedence. Valid old systemd units and LaunchAgents need only a restarted upgraded client, not reinstallation; broken Node or CLI startup paths still require repair. Later installs into covered directories are visible to a fresh `/backend`, with up to 30 seconds of delegation discovery caching. Custom locations use `executor.<backend>.command`, preferably an absolute real executable; ZCode preserves native unset/empty-command discovery. No shell profiles, runtime-version scans, or new version-manager shim directories are used. See [Backend Executable Discovery](../../README.md#backend-executable-discovery).
|
|
95
|
+
|
|
92
96
|
## Commands
|
|
93
97
|
|
|
94
98
|
| Command | Description |
|
|
@@ -137,23 +141,33 @@ Linux users upgrading from version 1.6.23 or earlier should run `remote-cli serv
|
|
|
137
141
|
|
|
138
142
|
### Threads & Machines
|
|
139
143
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
From CLI 1.6.121, new and existing threads without a saved preference enable
|
|
145
|
+
delegation by default. Their selected backend can assign bounded tasks to other
|
|
146
|
+
installed, authenticated backends. Claude Code, Codex, Pi, AGY, OpenCode, Kimi
|
|
147
|
+
Code, ZCode, and DSH can coordinate or work. From CLI 1.6.95,
|
|
143
148
|
same-backend delegation is rejected before launching a worker; discovery marks
|
|
144
149
|
the current backend unavailable as a worker. Use the current backend directly
|
|
145
150
|
or its native subagents, if supported. Workers return results to the original conversation and use
|
|
146
151
|
its working directory; they do not create extra thread buttons. `/delegation`
|
|
147
|
-
shows discovery and restrictions; `/delegation off` disables the
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
shows discovery and restrictions; `/delegation off` explicitly disables the
|
|
153
|
+
feature and `/delegation on` enables it again. Saved opt-outs remain off across
|
|
154
|
+
upgrades, context resets, backend switches, and CLI restarts. No historical
|
|
155
|
+
thread migration or conversation reset is required. Default-on makes tools
|
|
156
|
+
available without automatically starting workers. Explicitly disabled threads
|
|
157
|
+
skip managed tools, prompt changes, and delegation admission checks. Turning it
|
|
158
|
+
off cleans only backends used for delegation, including when resumed after a
|
|
159
|
+
CLI restart or backend switch, while preserving conversations. An implicit
|
|
160
|
+
default alone does not reconfigure unused native sessions during opt-out.
|
|
161
|
+
Upgrade and restart the local CLI to obtain the new default; existing Routers
|
|
162
|
+
remain compatible, and older CLIs retain their own default.
|
|
153
163
|
|
|
154
164
|
`/status` shows `Delegation: on/off (current thread)` for the thread receiving
|
|
155
165
|
the command. Reading this setting does not initialize delegation or start workers.
|
|
156
166
|
|
|
167
|
+
From CLI 1.6.118, `/status` shows DSH's official recharge and bonus wallet balances when available. Native official-account sign-in is required; API-key-only or custom-provider setup does not supply these wallets. Amounts retain their native decimal precision and currency; balances are not token usage or plan quota. The query does not create or change an ACP conversation. Its owned process uses the same log-upload and telemetry suppression as the DSH executor, is stopped after the query, and omits the balance section on failure or timeout. No other backend or Router protocol changes are required.
|
|
168
|
+
|
|
169
|
+
From CLI 1.6.120, Claude SDK `[claude-code:unrecognized_model]` records with a valid `{model, query_source: "sdk"}` payload are omitted from Feishu streaming/results and Claude slash-command error details. Model names are not hard-coded. Other diagnostics, malformed or unexpected records, actual errors, exit status, and assistant reply text are retained. The persistent Claude process's raw stderr remains in local CLI logs; this presentation filter does not disable Claude Code telemetry or change the configured model, other backends, or the Router protocol.
|
|
170
|
+
|
|
157
171
|
CLI 1.6.94 and newer show each finished worker as a result block in the existing
|
|
158
172
|
reply card, with a colored status label, backend name, short task description,
|
|
159
173
|
and elapsed time. Failed, timed-out, cancelled, and interrupted tasks include a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageHandler.d.ts","sourceRoot":"","sources":["../../src/client/MessageHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAg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AkCzB;;OAEG;YACW,mBAAmB;IA0GjC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAS1B;;;OAGG;YACW,oBAAoB;IA6MlC;;OAEG;YACW,qBAAqB;IAiBnC;;OAEG;IACH,OAAO,CAAC,UAAU;IAuBlB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAG7C;YAEW,eAAe;IAgC7B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;;;;;;;;;;;;OAaG;YACW,mBAAmB;IAgEjC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IA0E/B;;OAEG;YACW,cAAc;YAuPd,sBAAsB;IAoBpC,OAAO,CAAC,4BAA4B;IAOpC,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,sBAAsB;IAuB9B,iFAAiF;IACjF,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,sBAAsB;IAsB9B,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,SAAS;IAgBjB,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,YAAY;IA8CpB,OAAO,CAAC,YAAY;YAUN,cAAc;YAuBd,oBAAoB;IAkHlC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAc/B"}
|
|
@@ -9,6 +9,7 @@ const DeviceIdentity_1 = require("../files/DeviceIdentity");
|
|
|
9
9
|
const crypto_1 = require("crypto");
|
|
10
10
|
const DocumentExtractor_1 = require("../files/DocumentExtractor");
|
|
11
11
|
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const DelegationSettings_1 = require("../thread/DelegationSettings");
|
|
12
13
|
const hooks_1 = require("../hooks");
|
|
13
14
|
const FileReadDetector_1 = require("../utils/FileReadDetector");
|
|
14
15
|
const LocalImageDetector_1 = require("../utils/LocalImageDetector");
|
|
@@ -26,6 +27,8 @@ const DelegationManager_1 = require("../delegation/DelegationManager");
|
|
|
26
27
|
const DelegationBridge_1 = require("../delegation/DelegationBridge");
|
|
27
28
|
const contract_1 = require("../delegation/contract");
|
|
28
29
|
const DelegationStatusFormatter_1 = require("../delegation/DelegationStatusFormatter");
|
|
30
|
+
const BackendCommand_1 = require("../utils/BackendCommand");
|
|
31
|
+
const ClaudeStderrFilter_1 = require("../executor/claude/ClaudeStderrFilter");
|
|
29
32
|
const EFFORT_BACKENDS = new Set(['codex', 'agy', 'opencode', 'kimi', 'zcode', 'pi', 'dsh']);
|
|
30
33
|
const NATIVE_MODEL_LIST_BACKENDS = new Set(['codex', 'opencode', 'kimi', 'zcode', 'pi', 'dsh']);
|
|
31
34
|
const SLASH_SESSION_BACKENDS = new Set(['opencode', 'kimi', 'zcode', 'pi']);
|
|
@@ -477,7 +480,7 @@ class MessageHandler {
|
|
|
477
480
|
const activeOperation = this.activeThreadOperations.get(threadId);
|
|
478
481
|
let aborted = false;
|
|
479
482
|
const operation = (async () => {
|
|
480
|
-
if (this.threadManager.getThread(threadId)
|
|
483
|
+
if ((0, DelegationSettings_1.isDelegationEnabled)(this.threadManager.getThread(threadId)))
|
|
481
484
|
await this.delegation.cancelThread(threadId);
|
|
482
485
|
aborted = await executor.abort();
|
|
483
486
|
if (activeOperation)
|
|
@@ -605,7 +608,8 @@ class MessageHandler {
|
|
|
605
608
|
if (action === 'off') {
|
|
606
609
|
const thread = this.threadManager.getThread(threadId);
|
|
607
610
|
const backend = this.threadPool.getBackendKey(threadId);
|
|
608
|
-
|
|
611
|
+
// An implicit default does not imply that native tools were ever registered.
|
|
612
|
+
if (thread.delegationBackends?.includes(backend) || (thread.delegation === true && !thread.delegationBackends)) {
|
|
609
613
|
await executor.configureDelegation?.(undefined);
|
|
610
614
|
// Preserve cleanup ownership across process recreation and backend switches.
|
|
611
615
|
if (!thread.delegationBackends)
|
|
@@ -622,7 +626,7 @@ class MessageHandler {
|
|
|
622
626
|
this.sendResponse(messageId, threadId, {
|
|
623
627
|
success: true,
|
|
624
628
|
output: (0, DelegationStatusFormatter_1.formatDelegationStatus)({
|
|
625
|
-
enabled:
|
|
629
|
+
enabled: (0, DelegationSettings_1.isDelegationEnabled)(this.threadManager.getThread(threadId)),
|
|
626
630
|
coordinatorBackend,
|
|
627
631
|
coordinatorSupported: Boolean(executor.configureDelegation),
|
|
628
632
|
backends,
|
|
@@ -632,7 +636,7 @@ class MessageHandler {
|
|
|
632
636
|
}
|
|
633
637
|
if (trimmed.startsWith('/')) {
|
|
634
638
|
const thread = this.threadManager.getThread(threadId);
|
|
635
|
-
if (!thread
|
|
639
|
+
if (!(0, DelegationSettings_1.isDelegationEnabled)(thread) && thread?.delegationBackends?.includes(this.threadPool.getBackendKey(threadId))) {
|
|
636
640
|
// Native slash commands can resume a session before the next ordinary turn.
|
|
637
641
|
await executor.configureDelegation?.(undefined);
|
|
638
642
|
}
|
|
@@ -681,7 +685,7 @@ class MessageHandler {
|
|
|
681
685
|
output: `📊 Status:
|
|
682
686
|
- Thread: ${thread?.name ?? threadId}
|
|
683
687
|
- Backend: ${backend}
|
|
684
|
-
- Delegation: ${thread
|
|
688
|
+
- Delegation: ${(0, DelegationSettings_1.isDelegationEnabled)(thread) ? 'on' : 'off'} (current thread)
|
|
685
689
|
- Model: ${model ?? 'backend default'}
|
|
686
690
|
- Reasoning effort: ${effort}
|
|
687
691
|
- Working Directory: ${cwd}
|
|
@@ -750,7 +754,7 @@ Use /compact to reduce conversation context or /clear to start a fresh context.`
|
|
|
750
754
|
- /compact - Compress conversation history to reduce context size
|
|
751
755
|
- /cd <directory> - Change working directory for this thread
|
|
752
756
|
- /model [name] - Show models for the active backend, or set this thread's model
|
|
753
|
-
- /effort [auto|level] - Show or set effort for Codex/AGY/OpenCode/Kimi/ZCode/Pi (Claude Code is unsupported)
|
|
757
|
+
- /effort [auto|level] - Show or set effort for Codex/AGY/OpenCode/Kimi/ZCode/Pi/DSH (Claude Code is unsupported)
|
|
754
758
|
- /sandbox [on|off|read-only|default|allow <directory>|remove <directory>|network on|off] - Configure this thread's sandbox (Codex, Claude Code)
|
|
755
759
|
- /delegation [on|off|reset [backend]] - Delegate tasks between installed agent backends; reset saved worker context when needed
|
|
756
760
|
- /backend - List backends and show the current thread's effective backend
|
|
@@ -1230,7 +1234,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
1230
1234
|
}
|
|
1231
1235
|
}
|
|
1232
1236
|
else {
|
|
1233
|
-
const bin = key === 'agy' ?
|
|
1237
|
+
const bin = (0, BackendCommand_1.getBackendCommand)(key === 'agy' ? 'agy' : 'claude', executorConfig);
|
|
1234
1238
|
const args = key === 'agy' ? ['models'] : ['/model', '--print'];
|
|
1235
1239
|
const listing = await this.runListingCommand(bin, args);
|
|
1236
1240
|
if (listing) {
|
|
@@ -1719,17 +1723,19 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
1719
1723
|
return;
|
|
1720
1724
|
}
|
|
1721
1725
|
const executorConfig = this.config.get('executor') ?? { type: 'auto' };
|
|
1722
|
-
const agyCommand =
|
|
1723
|
-
return this.spawnPassthroughCommand(messageId, threadId, agyCommand, ['-p', command], executor, '
|
|
1726
|
+
const agyCommand = (0, BackendCommand_1.getBackendCommand)('agy', executorConfig);
|
|
1727
|
+
return this.spawnPassthroughCommand(messageId, threadId, agyCommand, ['-p', command], executor, 'agy');
|
|
1724
1728
|
}
|
|
1725
|
-
|
|
1729
|
+
const executorConfig = this.config.get('executor') ?? { type: 'auto' };
|
|
1730
|
+
return this.spawnPassthroughCommand(messageId, threadId, (0, BackendCommand_1.getBackendCommand)('claude', executorConfig), [command, '--print'], executor, 'claude', { CLAUDECODE: '' });
|
|
1726
1731
|
}
|
|
1727
1732
|
/**
|
|
1728
1733
|
* Spawn a one-shot CLI process for a passthrough slash command and relay
|
|
1729
1734
|
* its output back to the user.
|
|
1730
1735
|
*/
|
|
1731
|
-
spawnPassthroughCommand(messageId, threadId, bin, args, executor,
|
|
1736
|
+
spawnPassthroughCommand(messageId, threadId, bin, args, executor, backend, extraEnv = {}) {
|
|
1732
1737
|
return new Promise((resolve) => {
|
|
1738
|
+
const label = backend === 'agy' ? 'AGY CLI' : 'Claude CLI';
|
|
1733
1739
|
const chunks = [];
|
|
1734
1740
|
const errorChunks = [];
|
|
1735
1741
|
// spawn() reports a missing cwd as an ENOENT naming this binary, so check
|
|
@@ -1768,7 +1774,8 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
1768
1774
|
});
|
|
1769
1775
|
}
|
|
1770
1776
|
else {
|
|
1771
|
-
const
|
|
1777
|
+
const stderr = errorChunks.join('');
|
|
1778
|
+
const errorOutput = (backend === 'claude' ? (0, ClaudeStderrFilter_1.filterClaudeStderr)(stderr) : stderr) || chunks.join('');
|
|
1772
1779
|
this.sendResponse(messageId, threadId, {
|
|
1773
1780
|
success: false,
|
|
1774
1781
|
error: errorOutput.trim() || `Command failed with exit code ${code}`,
|
|
@@ -1830,7 +1837,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
1830
1837
|
}
|
|
1831
1838
|
const openId = this.getMessageOpenId(messageId);
|
|
1832
1839
|
const thread = this.threadManager.getThread(threadId);
|
|
1833
|
-
if (thread
|
|
1840
|
+
if (thread && (0, DelegationSettings_1.isDelegationEnabled)(thread) && executor.configureDelegation) {
|
|
1834
1841
|
if (this.delegation.blocksWorkspace(executor.getCurrentWorkingDirectory(), threadId)) {
|
|
1835
1842
|
throw new Error('A delegated worker holds this workspace. Wait for it to finish; if worker cleanup failed, stop the worker and restart the CLI.');
|
|
1836
1843
|
}
|
|
@@ -2332,29 +2339,34 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2332
2339
|
// ── Backend switching ─────────────────────────────────────────────────────
|
|
2333
2340
|
checkCommand(cmd, args) {
|
|
2334
2341
|
return new Promise((resolve) => {
|
|
2335
|
-
|
|
2342
|
+
try {
|
|
2343
|
+
(0, child_process_1.execFile)(cmd, args, { timeout: 5000 }, (err) => resolve({ installed: !err, ...(err ? { reason: (0, BackendCommand_1.backendProbeFailure)(err) } : {}) }));
|
|
2344
|
+
}
|
|
2345
|
+
catch (error) {
|
|
2346
|
+
resolve({ installed: false, reason: (0, BackendCommand_1.backendProbeFailure)(error) });
|
|
2347
|
+
}
|
|
2336
2348
|
});
|
|
2337
2349
|
}
|
|
2338
2350
|
async detectBackends() {
|
|
2339
2351
|
const executorConfig = this.config.get('executor') ?? { type: 'auto' };
|
|
2340
2352
|
const [claudeInstalled, codexInstalled, openCodeInstalled, kimiInstalled, piInstalled, agyInstalled, dshInstalled] = await Promise.all([
|
|
2341
|
-
this.checkCommand('claude', ['--version']),
|
|
2342
|
-
this.checkCommand('codex', ['--version']),
|
|
2343
|
-
this.checkCommand('opencode', ['--version']),
|
|
2344
|
-
this.checkCommand('kimi', ['--version']),
|
|
2345
|
-
this.checkCommand(
|
|
2346
|
-
this.checkCommand('agy', ['--version']),
|
|
2347
|
-
this.checkCommand(
|
|
2353
|
+
this.checkCommand((0, BackendCommand_1.getBackendCommand)('claude', executorConfig), ['--version']),
|
|
2354
|
+
this.checkCommand((0, BackendCommand_1.getBackendCommand)('codex', executorConfig), ['--version']),
|
|
2355
|
+
this.checkCommand((0, BackendCommand_1.getBackendCommand)('opencode', executorConfig), ['--version']),
|
|
2356
|
+
this.checkCommand((0, BackendCommand_1.getBackendCommand)('kimi', executorConfig), ['--version']),
|
|
2357
|
+
this.checkCommand((0, BackendCommand_1.getBackendCommand)('pi', executorConfig), ['--version']),
|
|
2358
|
+
this.checkCommand((0, BackendCommand_1.getBackendCommand)('agy', executorConfig), ['--version']),
|
|
2359
|
+
this.checkCommand((0, BackendCommand_1.getBackendCommand)('dsh', executorConfig), ['--version']),
|
|
2348
2360
|
]);
|
|
2349
2361
|
return [
|
|
2350
|
-
{ id: 'auto', label: 'Claude Code',
|
|
2351
|
-
{ id: 'codex', label: 'Codex CLI (OpenAI)',
|
|
2352
|
-
{ id: 'opencode', label: 'OpenCode CLI',
|
|
2353
|
-
{ id: 'kimi', label: 'Kimi Code CLI',
|
|
2354
|
-
{ id: 'zcode', label: 'ZCode', installed: (0, ZCodeCommand_1.isZCodeAvailable)(
|
|
2355
|
-
{ id: 'pi', label: 'Pi',
|
|
2356
|
-
{ id: 'agy', label: 'AGY CLI (Antigravity)',
|
|
2357
|
-
{ id: 'dsh', label: 'DeepSeek Harness (DSH)',
|
|
2362
|
+
{ id: 'auto', label: 'Claude Code', ...claudeInstalled },
|
|
2363
|
+
{ id: 'codex', label: 'Codex CLI (OpenAI)', ...codexInstalled },
|
|
2364
|
+
{ id: 'opencode', label: 'OpenCode CLI', ...openCodeInstalled },
|
|
2365
|
+
{ id: 'kimi', label: 'Kimi Code CLI', ...kimiInstalled },
|
|
2366
|
+
{ id: 'zcode', label: 'ZCode', installed: (0, ZCodeCommand_1.isZCodeAvailable)((0, BackendCommand_1.getBackendCommand)('zcode', executorConfig)) },
|
|
2367
|
+
{ id: 'pi', label: 'Pi', ...piInstalled },
|
|
2368
|
+
{ id: 'agy', label: 'AGY CLI (Antigravity)', ...agyInstalled },
|
|
2369
|
+
{ id: 'dsh', label: 'DeepSeek Harness (DSH)', ...dshInstalled },
|
|
2358
2370
|
];
|
|
2359
2371
|
}
|
|
2360
2372
|
async handleBackendCommand(messageId, threadId, trimmed) {
|
|
@@ -2369,7 +2381,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
2369
2381
|
if (installed.length === 0) {
|
|
2370
2382
|
this.sendResponse(messageId, threadId, {
|
|
2371
2383
|
success: false,
|
|
2372
|
-
error:
|
|
2384
|
+
error: `No supported AI backends passed their executable checks.\n\n${backends.map(b => `${b.label}: ${b.reason ?? 'Executable could not be located.'}`).join('\n')}\n\nCheck executor.<backend>.command; an absolute executable path is recommended.`,
|
|
2373
2385
|
});
|
|
2374
2386
|
return;
|
|
2375
2387
|
}
|