@yu_robotics/remote-cli 1.6.26 → 1.6.32

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 (85) hide show
  1. package/README.md +8 -8
  2. package/dist/client/MessageHandler.d.ts +5 -3
  3. package/dist/client/MessageHandler.d.ts.map +1 -1
  4. package/dist/client/MessageHandler.js +57 -26
  5. package/dist/client/MessageHandler.js.map +1 -1
  6. package/dist/commands/start.d.ts +7 -0
  7. package/dist/commands/start.d.ts.map +1 -1
  8. package/dist/commands/start.js +29 -8
  9. package/dist/commands/start.js.map +1 -1
  10. package/dist/config/ConfigManager.d.ts +2 -0
  11. package/dist/config/ConfigManager.d.ts.map +1 -1
  12. package/dist/config/ConfigManager.js +34 -2
  13. package/dist/config/ConfigManager.js.map +1 -1
  14. package/dist/executor/AcpExecutor.d.ts +79 -0
  15. package/dist/executor/AcpExecutor.d.ts.map +1 -0
  16. package/dist/executor/AcpExecutor.js +532 -0
  17. package/dist/executor/AcpExecutor.js.map +1 -0
  18. package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
  19. package/dist/executor/ClaudePersistentExecutor.js +2 -1
  20. package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
  21. package/dist/executor/KimiExecutor.d.ts +18 -0
  22. package/dist/executor/KimiExecutor.d.ts.map +1 -0
  23. package/dist/executor/KimiExecutor.js +28 -0
  24. package/dist/executor/KimiExecutor.js.map +1 -0
  25. package/dist/executor/OpenCodeExecutor.d.ts +19 -0
  26. package/dist/executor/OpenCodeExecutor.d.ts.map +1 -0
  27. package/dist/executor/OpenCodeExecutor.js +28 -0
  28. package/dist/executor/OpenCodeExecutor.js.map +1 -0
  29. package/dist/executor/ZCodeExecutor.d.ts +20 -0
  30. package/dist/executor/ZCodeExecutor.d.ts.map +1 -0
  31. package/dist/executor/ZCodeExecutor.js +37 -0
  32. package/dist/executor/ZCodeExecutor.js.map +1 -0
  33. package/dist/executor/acp/AcpClient.d.ts +50 -40
  34. package/dist/executor/acp/AcpClient.d.ts.map +1 -1
  35. package/dist/executor/acp/AcpClient.js +113 -189
  36. package/dist/executor/acp/AcpClient.js.map +1 -1
  37. package/dist/executor/acp/AcpTypes.d.ts +27 -68
  38. package/dist/executor/acp/AcpTypes.d.ts.map +1 -1
  39. package/dist/executor/acp/AcpTypes.js +0 -9
  40. package/dist/executor/acp/AcpTypes.js.map +1 -1
  41. package/dist/executor/index.d.ts +8 -13
  42. package/dist/executor/index.d.ts.map +1 -1
  43. package/dist/executor/index.js +55 -78
  44. package/dist/executor/index.js.map +1 -1
  45. package/dist/executor/zcode/ZCodeClient.d.ts +73 -0
  46. package/dist/executor/zcode/ZCodeClient.d.ts.map +1 -0
  47. package/dist/executor/zcode/ZCodeClient.js +681 -0
  48. package/dist/executor/zcode/ZCodeClient.js.map +1 -0
  49. package/dist/executor/zcode/ZCodeCommand.d.ts +9 -0
  50. package/dist/executor/zcode/ZCodeCommand.d.ts.map +1 -0
  51. package/dist/executor/zcode/ZCodeCommand.js +122 -0
  52. package/dist/executor/zcode/ZCodeCommand.js.map +1 -0
  53. package/dist/thread/ThreadExecutorPool.js +2 -2
  54. package/dist/thread/ThreadExecutorPool.js.map +1 -1
  55. package/dist/thread/types.d.ts +1 -1
  56. package/dist/thread/types.d.ts.map +1 -1
  57. package/dist/types/config.d.ts +30 -16
  58. package/dist/types/config.d.ts.map +1 -1
  59. package/dist/types/config.js +8 -2
  60. package/dist/types/config.js.map +1 -1
  61. package/package.json +2 -2
  62. package/dist/executor/ClaudeExecutor.d.ts +0 -93
  63. package/dist/executor/ClaudeExecutor.d.ts.map +0 -1
  64. package/dist/executor/ClaudeExecutor.js +0 -380
  65. package/dist/executor/ClaudeExecutor.js.map +0 -1
  66. package/dist/executor/CodexExecutor.d.ts +0 -140
  67. package/dist/executor/CodexExecutor.d.ts.map +0 -1
  68. package/dist/executor/CodexExecutor.js +0 -789
  69. package/dist/executor/CodexExecutor.js.map +0 -1
  70. package/dist/executor/GeminiExecutor.d.ts +0 -93
  71. package/dist/executor/GeminiExecutor.d.ts.map +0 -1
  72. package/dist/executor/GeminiExecutor.js +0 -415
  73. package/dist/executor/GeminiExecutor.js.map +0 -1
  74. package/dist/executor/acp/SessionManager.d.ts +0 -41
  75. package/dist/executor/acp/SessionManager.d.ts.map +0 -1
  76. package/dist/executor/acp/SessionManager.js +0 -152
  77. package/dist/executor/acp/SessionManager.js.map +0 -1
  78. package/dist/utils/processUtils.d.ts +0 -16
  79. package/dist/utils/processUtils.d.ts.map +0 -1
  80. package/dist/utils/processUtils.js +0 -37
  81. package/dist/utils/processUtils.js.map +0 -1
  82. package/dist/worktree/WorktreeManager.d.ts +0 -119
  83. package/dist/worktree/WorktreeManager.d.ts.map +0 -1
  84. package/dist/worktree/WorktreeManager.js +0 -451
  85. package/dist/worktree/WorktreeManager.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @yu_robotics/remote-cli
2
2
 
3
- Remote control your [Claude Code](https://claude.ai/code) CLI from anywhere using your mobile phone through Feishu (Lark) messaging.
3
+ Remote control Claude Code, AGY CLI, Codex CLI, OpenCode CLI, or Kimi Code CLI from anywhere using your mobile phone through Feishu (Lark) messaging.
4
4
 
5
5
  ## Features
6
6
 
@@ -8,8 +8,8 @@ Remote control your [Claude Code](https://claude.ai/code) CLI from anywhere usin
8
8
  - **Secure**: Directory whitelisting, command filtering, and device authentication
9
9
  - **Mobile-Optimized**: Simplified commands and rich text formatting for Feishu
10
10
  - **Readable Code Changes**: Edit operations show collapsible, line-aware diff previews inside the existing progress card
11
- - **Multi-Backend Support**: Supports Claude Code and Gemini CLI
12
- - **Image Input and Output**: Forward standalone images and mixed text-image Feishu posts to Claude Persistent and Codex App Server backends, and forward Codex App Server generated images back through Router
11
+ - **Multi-Backend Support**: Supports Claude Code, AGY CLI (Antigravity), Codex CLI (OpenAI), OpenCode CLI, and Kimi Code CLI
12
+ - **Image Input and Output**: Forward standalone images and mixed text-image Feishu posts to Claude Persistent, Codex App Server, OpenCode ACP, and Kimi Code ACP backends, and forward Codex App Server generated images back through Router
13
13
  - **Multi-session (Threads)**: Create independent chat threads to parallelize tasks
14
14
  - **Remote Machine Management**: Control remote servers or Docker via SSH
15
15
  - **Persistent Process**: Long-running AI process with bidirectional streaming
@@ -18,7 +18,7 @@ Remote control your [Claude Code](https://claude.ai/code) CLI from anywhere usin
18
18
  ## Prerequisites
19
19
 
20
20
  - **Node.js** >= 18.0.0
21
- - **Claude Code CLI** installed and configured
21
+ - **Claude Code CLI**, **AGY CLI**, **Codex CLI**, **OpenCode CLI**, or **Kimi Code CLI** installed and configured
22
22
  - Access to a Feishu (Lark) bot connected to a [remote-cli-router](https://www.npmjs.com/package/@yu_robotics/remote-cli-router) server
23
23
 
24
24
  The client is normally installed and run directly on the developer's machine rather than in Docker, so it can access local project directories and the installed AI CLI binaries. Docker is recommended for the shared Router server instead.
@@ -97,7 +97,7 @@ Linux users upgrading from version 1.6.23 or earlier should run `remote-cli serv
97
97
  | `/compact` | Compress history to save tokens |
98
98
  | `/cd <dir>` | Change working directory for this thread |
99
99
  | `/model [name]` | List models for the active backend or set this thread's model |
100
- | `/effort [auto|low|medium|high]` | Show or set Codex/AGY reasoning effort |
100
+ | `/effort [auto|level]` | Show or set Codex/AGY/OpenCode/Kimi reasoning effort |
101
101
  | `/backend` | List backends and show the current thread's effective backend |
102
102
  | `/backend <index>` | Switch all threads and clear per-thread backend overrides |
103
103
  | `/backend <index> @` | Switch only the current thread |
@@ -119,7 +119,7 @@ Linux users upgrading from version 1.6.23 or earlier should run `remote-cli serv
119
119
 
120
120
  ### AI CLI Commands Passthrough
121
121
 
122
- All commands/skills supported by local Claude Code or Gemini CLI are passed through directly where the backend protocol supports them. The built-in `/status`, `/context`, and `/skills` commands provide a consistent remote view across backends.
122
+ Backend-specific commands are forwarded only where the active backend supports them. The built-in `/status`, `/context`, and `/skills` commands provide a consistent remote view across backends.
123
123
  - `/commit` - Commit code changes
124
124
  - `/review` - Code review
125
125
  - `/test` - Run tests
@@ -129,11 +129,11 @@ All commands/skills supported by local Claude Code or Gemini CLI are passed thro
129
129
 
130
130
  Use one thread per project or task so each thread keeps its own working directory, backend session, model, and queue. Use `/backend <index>` for a global switch, or `/backend <index> @` to override only the current thread. `/backend default @` removes that override.
131
131
 
132
- When a thread is busy, ordinary messages require confirmation before they enter its queue. Use `/queue` to inspect pending work, `/queue clear` to discard queued messages, and `/abort` to stop the active task and clear that thread's queue. A message received during abort cleanup waits and starts after the backend is safe to reuse. Context-changing commands such as `/model`, `/effort`, `/cd`, `/compact`, and `/clear` are handled separately rather than queued as ordinary messages.
132
+ When a thread is busy, ordinary messages require confirmation before they enter its queue. Use `/queue` to inspect pending work, `/queue clear` to discard queued messages, and `/abort` to stop the active task and clear that thread's queue. A message received during abort cleanup waits and starts after the backend is safe to reuse. A backend failure in the active task still advances to the first confirmed queued message; a failure in a task taken from the queue pauses the remaining queue. Context-changing commands such as `/model`, `/effort`, `/cd`, `/compact`, and `/clear` are handled separately rather than queued as ordinary messages.
133
133
 
134
134
  ## Expert Usage
135
135
 
136
- For a shared deployment, run the Router with Docker Compose on an internal server and run one CLI client on each developer machine. Keep project directories and Claude Code, AGY, or Codex credentials on the client machine; the Router persists its configuration and bindings in `./router-data`. On Linux, create that directory as the deployment user and set `ROUTER_UID` and `ROUTER_GID` in `.env` to `id -u` and `id -g` so the container can write to the bind mount.
136
+ For a shared deployment, run the Router with Docker Compose on an internal server and run one CLI client on each developer machine. Keep project directories and Claude Code, AGY, Codex, OpenCode, or Kimi Code credentials on the client machine; the Router persists its configuration and bindings in `./router-data`. On Linux, create that directory as the deployment user and set `ROUTER_UID` and `ROUTER_GID` in `.env` to `id -u` and `id -g` so the container can write to the bind mount.
137
137
 
138
138
  To update a Router deployment without losing bindings:
139
139
 
@@ -75,8 +75,9 @@ export declare class MessageHandler {
75
75
  * the available models. Listing source per backend (all verified live):
76
76
  * - claude: `claude --print /model` prints current + available aliases
77
77
  * - agy: `agy models` prints "slug<TAB>Display Name" lines
78
- * - codex app-server: `model/list` returns the authenticated catalog
79
- * - codex exec fallback: listing is unavailable
78
+ * - codex: app-server `model/list` returns the authenticated catalog
79
+ * - opencode/kimi ACP: session config options expose enabled models
80
+ * - zcode: official app-server session settings expose enabled models
80
81
  */
81
82
  private handleModelList;
82
83
  /**
@@ -120,7 +121,6 @@ export declare class MessageHandler {
120
121
  private listLocalSkills;
121
122
  /**
122
123
  * Which backend slash commands should be forwarded to for a thread.
123
- * 'auto'/claude-* always resolve to Claude; legacy 'gemini' means AGY.
124
124
  */
125
125
  private resolveSlashBackend;
126
126
  /**
@@ -133,6 +133,8 @@ export declare class MessageHandler {
133
133
  * plain text and the model only pretends to compact (verified live).
134
134
  * - Codex: no interactive-TUI slash passthrough. Remote CLI built-ins are
135
135
  * implemented through app-server methods instead.
136
+ * - OpenCode/Kimi/ZCode: send native commands through the persistent
137
+ * backend session; ZCode maps the shared /skills name to /skill.
136
138
  */
137
139
  private executeSlashCommand;
138
140
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MessageHandler.d.ts","sourceRoot":"","sources":["../../src/client/MessageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAkH,MAAM,UAAU,CAAC;AAC3J,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA4CxD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH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;YAmBd,oBAAoB;IAkHlC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAS/B"}
@@ -10,6 +10,7 @@ const os_1 = require("os");
10
10
  const path_1 = require("path");
11
11
  const config_1 = require("../types/config");
12
12
  const uuid_1 = require("uuid");
13
+ const ZCodeCommand_1 = require("../executor/zcode/ZCodeCommand");
13
14
  const QUEUE_CONFIRMATION_TTL_MS = 5 * 60 * 1000;
14
15
  const MAX_THREAD_QUEUE_LENGTH = 10;
15
16
  /**
@@ -255,10 +256,7 @@ class MessageHandler {
255
256
  }
256
257
  const expandedContent = this.expandCommandShortcuts(content);
257
258
  const processedContent = (0, FileReadDetector_1.processFileReadContent)(expandedContent);
258
- const success = await this.executeCommand(messageId, resolvedThreadId, processedContent, executor, attachments);
259
- if (!success && this.threadQueues.has(resolvedThreadId)) {
260
- this.pausedQueues.add(resolvedThreadId);
261
- }
259
+ await this.executeCommand(messageId, resolvedThreadId, processedContent, executor, attachments);
262
260
  }
263
261
  catch (error) {
264
262
  this.threadPool.setThreadError(resolvedThreadId, true);
@@ -416,7 +414,7 @@ Use /compact to reduce conversation context or /clear to start a fresh context.`
416
414
  }
417
415
  if (trimmed === '/skills') {
418
416
  const backend = this.threadPool.getBackendKey(threadId);
419
- if (backend === 'claude' || backend === 'agy') {
417
+ if (backend === 'claude' || backend === 'agy' || backend === 'opencode' || backend === 'kimi' || backend === 'zcode') {
420
418
  await this.executeSlashCommand(messageId, threadId, trimmed, executor);
421
419
  }
422
420
  else {
@@ -444,7 +442,7 @@ Use /compact to reduce conversation context or /clear to start a fresh context.`
444
442
  - /compact - Compress conversation history to reduce context size
445
443
  - /cd <directory> - Change working directory for this thread
446
444
  - /model [name] - Show models for the active backend, or set this thread's model
447
- - /effort [auto|low|medium|high] - Show or set effort for Codex/AGY (Claude Code is unsupported)
445
+ - /effort [auto|level] - Show or set effort for Codex/AGY/OpenCode/Kimi/ZCode (Claude Code is unsupported)
448
446
  - /backend - List backends and show the current thread's effective backend
449
447
  - /backend <index> - Switch all threads and clear per-thread backend overrides
450
448
  - /backend <index> @ - Switch only the current thread
@@ -533,7 +531,7 @@ You can also use natural language commands to control Claude Code CLI.`,
533
531
  if (trimmed === '/effort' || trimmed.startsWith('/effort ')) {
534
532
  const executorConfig = this.config.get('executor') ?? { type: 'auto' };
535
533
  const key = this.threadPool.getBackendKey(threadId);
536
- if (key !== 'codex' && key !== 'agy') {
534
+ if (key !== 'codex' && key !== 'agy' && key !== 'opencode' && key !== 'kimi' && key !== 'zcode') {
537
535
  this.sendResponse(messageId, threadId, {
538
536
  success: false,
539
537
  error: '/effort is not supported yet for Claude Code.',
@@ -549,13 +547,19 @@ You can also use natural language commands to control Claude Code CLI.`,
549
547
  output: [
550
548
  `Current reasoning effort: ${thread?.efforts?.agy ?? 'auto'}`,
551
549
  'Supported levels: low, medium, high',
552
- 'Set with: /effort <auto|low|medium|high>',
550
+ 'Set with: /effort <auto|level>',
553
551
  ].join('\n'),
554
552
  });
555
553
  return true;
556
554
  }
557
- const configuredModel = thread?.models?.codex ?? executorConfig.codex?.model;
558
- const lines = [`Current reasoning effort: ${thread?.efforts?.codex ?? 'auto'}`];
555
+ const configuredModel = key === 'codex'
556
+ ? thread?.models?.codex ?? executorConfig.codex?.model
557
+ : key === 'opencode'
558
+ ? thread?.models?.opencode ?? executorConfig.opencode?.model
559
+ : key === 'kimi'
560
+ ? thread?.models?.kimi ?? executorConfig.kimi?.model
561
+ : thread?.models?.zcode ?? executorConfig.zcode?.model;
562
+ const lines = [`Current reasoning effort: ${thread?.efforts?.[key] ?? 'auto'}`];
559
563
  if ('listModels' in executor && typeof executor.listModels === 'function') {
560
564
  try {
561
565
  const models = await executor.listModels();
@@ -569,7 +573,8 @@ You can also use natural language commands to control Claude Code CLI.`,
569
573
  }
570
574
  }
571
575
  catch (error) {
572
- lines.push(`Could not fetch Codex effort metadata: ${error instanceof Error ? error.message : String(error)}`);
576
+ const label = key === 'opencode' ? 'OpenCode' : key === 'kimi' ? 'Kimi Code' : key === 'zcode' ? 'ZCode' : 'Codex';
577
+ lines.push(`Could not fetch ${label} effort metadata: ${error instanceof Error ? error.message : String(error)}`);
573
578
  }
574
579
  }
575
580
  lines.push('Set with: /effort <auto|level>');
@@ -579,7 +584,7 @@ You can also use natural language commands to control Claude Code CLI.`,
579
584
  if (!('setEffort' in executor && typeof executor.setEffort === 'function')) {
580
585
  this.sendResponse(messageId, threadId, {
581
586
  success: false,
582
- error: `/effort is not supported by this ${key === 'agy' ? 'AGY' : 'Codex'} executor version.`,
587
+ error: `/effort is not supported by this ${key === 'agy' ? 'AGY' : key === 'opencode' ? 'OpenCode' : key === 'kimi' ? 'Kimi Code' : key === 'zcode' ? 'ZCode' : 'Codex'} executor version.`,
583
588
  });
584
589
  return true;
585
590
  }
@@ -827,20 +832,26 @@ You can also use natural language commands to control Claude Code CLI.`,
827
832
  * the available models. Listing source per backend (all verified live):
828
833
  * - claude: `claude --print /model` prints current + available aliases
829
834
  * - agy: `agy models` prints "slug<TAB>Display Name" lines
830
- * - codex app-server: `model/list` returns the authenticated catalog
831
- * - codex exec fallback: listing is unavailable
835
+ * - codex: app-server `model/list` returns the authenticated catalog
836
+ * - opencode/kimi ACP: session config options expose enabled models
837
+ * - zcode: official app-server session settings expose enabled models
832
838
  */
833
839
  async handleModelList(messageId, threadId) {
834
840
  const executorConfig = this.config.get('executor') ?? { type: 'auto' };
835
841
  const key = this.threadPool.getBackendKey(threadId);
836
842
  const thread = this.threadManager.getThread(threadId);
837
843
  const current = thread?.models?.[key] ?? (key === 'claude' ? thread?.model : undefined);
838
- const backendLabel = key === 'claude' ? 'Claude Code' : key === 'agy' ? 'AGY CLI' : 'Codex CLI';
844
+ const backendLabel = key === 'claude' ? 'Claude Code'
845
+ : key === 'agy' ? 'AGY CLI'
846
+ : key === 'opencode' ? 'OpenCode CLI'
847
+ : key === 'kimi' ? 'Kimi Code CLI'
848
+ : key === 'zcode' ? 'ZCode'
849
+ : 'Codex CLI';
839
850
  const lines = [
840
851
  `🎯 Backend: ${backendLabel}`,
841
852
  `Current model: ${current ?? 'backend default'}`,
842
853
  ];
843
- if (key === 'codex') {
854
+ if (key === 'codex' || key === 'opencode' || key === 'kimi' || key === 'zcode') {
844
855
  const executor = this.threadPool.getExecutor(threadId);
845
856
  if ('listModels' in executor && typeof executor.listModels === 'function') {
846
857
  try {
@@ -853,15 +864,15 @@ You can also use natural language commands to control Claude Code CLI.`,
853
864
  }
854
865
  }
855
866
  else {
856
- lines.push('', '⚠️ Codex returned an empty model list.');
867
+ lines.push('', `⚠️ ${backendLabel} returned an empty model list.`);
857
868
  }
858
869
  }
859
870
  catch (error) {
860
- lines.push('', `⚠️ Could not fetch the model list from Codex: ${error instanceof Error ? error.message : String(error)}`);
871
+ lines.push('', `⚠️ Could not fetch the model list from ${backendLabel}: ${error instanceof Error ? error.message : String(error)}`);
861
872
  }
862
873
  }
863
874
  else {
864
- lines.push('', 'Model listing is unavailable in the Codex exec fallback transport.');
875
+ lines.push('', `Model listing is unavailable in this ${backendLabel} transport.`);
865
876
  }
866
877
  }
867
878
  else {
@@ -1283,7 +1294,6 @@ You can also use natural language commands to control Claude Code CLI.`,
1283
1294
  }
1284
1295
  /**
1285
1296
  * Which backend slash commands should be forwarded to for a thread.
1286
- * 'auto'/claude-* always resolve to Claude; legacy 'gemini' means AGY.
1287
1297
  */
1288
1298
  resolveSlashBackend(threadId) {
1289
1299
  return this.threadPool.getBackendKey(threadId);
@@ -1298,9 +1308,27 @@ You can also use natural language commands to control Claude Code CLI.`,
1298
1308
  * plain text and the model only pretends to compact (verified live).
1299
1309
  * - Codex: no interactive-TUI slash passthrough. Remote CLI built-ins are
1300
1310
  * implemented through app-server methods instead.
1311
+ * - OpenCode/Kimi/ZCode: send native commands through the persistent
1312
+ * backend session; ZCode maps the shared /skills name to /skill.
1301
1313
  */
1302
1314
  async executeSlashCommand(messageId, threadId, command, executor) {
1303
1315
  const backend = this.resolveSlashBackend(threadId);
1316
+ if (backend === 'opencode' || backend === 'kimi' || backend === 'zcode') {
1317
+ // ZCode names its native skill-list command /skill, while remote-cli
1318
+ // exposes the cross-backend command as /skills.
1319
+ const backendCommand = backend === 'zcode' && command.trim() === '/skills' ? '/skill' : command;
1320
+ const result = await executor.execute(backendCommand, {
1321
+ onStream: (chunk) => this.sendStreamChunk(messageId, threadId, chunk),
1322
+ onToolUse: (toolUse) => this.sendToolUse(messageId, threadId, toolUse),
1323
+ onToolResult: (toolResult) => this.sendToolResult(messageId, threadId, toolResult),
1324
+ onPlanMode: (plan) => this.sendPlanMode(messageId, threadId, plan),
1325
+ onImage: (image) => this.sendImage(messageId, threadId, image),
1326
+ });
1327
+ this.sendResponse(messageId, threadId, result.success
1328
+ ? { success: true, output: result.output || '✅ Command executed successfully' }
1329
+ : { success: false, error: result.error || `${backend === 'kimi' ? 'Kimi Code' : backend === 'zcode' ? 'ZCode' : 'OpenCode'} command failed` });
1330
+ return;
1331
+ }
1304
1332
  if (backend === 'codex') {
1305
1333
  this.sendResponse(messageId, threadId, {
1306
1334
  success: false,
@@ -1613,14 +1641,20 @@ You can also use natural language commands to control Claude Code CLI.`,
1613
1641
  });
1614
1642
  }
1615
1643
  async detectBackends() {
1616
- const [claudeInstalled, codexInstalled, agyInstalled] = await Promise.all([
1644
+ const executorConfig = this.config.get('executor') ?? { type: 'auto' };
1645
+ const [claudeInstalled, codexInstalled, openCodeInstalled, kimiInstalled, agyInstalled] = await Promise.all([
1617
1646
  this.checkCommand('claude', ['--version']),
1618
1647
  this.checkCommand('codex', ['--version']),
1648
+ this.checkCommand('opencode', ['--version']),
1649
+ this.checkCommand('kimi', ['--version']),
1619
1650
  this.checkCommand('agy', ['--version']),
1620
1651
  ]);
1621
1652
  return [
1622
1653
  { id: 'auto', label: 'Claude Code', installed: claudeInstalled },
1623
1654
  { id: 'codex', label: 'Codex CLI (OpenAI)', installed: codexInstalled },
1655
+ { id: 'opencode', label: 'OpenCode CLI', installed: openCodeInstalled },
1656
+ { id: 'kimi', label: 'Kimi Code CLI', installed: kimiInstalled },
1657
+ { id: 'zcode', label: 'ZCode', installed: (0, ZCodeCommand_1.isZCodeAvailable)(executorConfig.zcode?.command) },
1624
1658
  { id: 'agy', label: 'AGY CLI (Antigravity)', installed: agyInstalled },
1625
1659
  ];
1626
1660
  }
@@ -1641,11 +1675,8 @@ You can also use natural language commands to control Claude Code CLI.`,
1641
1675
  return;
1642
1676
  }
1643
1677
  const lines = installed.map((b, i) => {
1644
- const isClaudeActive = b.id === 'auto' &&
1645
- (currentType === 'auto' || currentType === 'claude-persistent' || currentType === 'claude-spawn');
1646
- // Legacy configs may still say 'gemini' — that slot now means AGY.
1647
- const isAgyActive = b.id === 'agy' &&
1648
- (currentType === 'agy' || currentType === 'gemini');
1678
+ const isClaudeActive = b.id === 'auto' && (0, config_1.backendKeyOf)(currentType) === 'claude';
1679
+ const isAgyActive = b.id === 'agy' && currentType === 'agy';
1649
1680
  const active = b.id === currentType || isClaudeActive || isAgyActive ? ' ★ (active)' : '';
1650
1681
  return `${i + 1}. ${b.label}${active}`;
1651
1682
  });