acpreact 1.0.3 → 1.0.4

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 (2) hide show
  1. package/core.js +20 -4
  2. package/package.json +1 -1
package/core.js CHANGED
@@ -150,9 +150,23 @@ Analyze the text and call appropriate tools using the ACP protocol. Respond with
150
150
  let output = '';
151
151
  let errorOutput = '';
152
152
 
153
- const child = spawn(cli, ['--stdin'], {
153
+ // Different CLIs have different invocation styles
154
+ let args;
155
+ let useStdin = false;
156
+
157
+ if (cli === 'kilo') {
158
+ // kilo uses: kilo run <message>
159
+ args = ['run', prompt];
160
+ } else {
161
+ // opencode uses: opencode --stdin (with prompt via stdin)
162
+ args = ['--stdin'];
163
+ useStdin = true;
164
+ }
165
+
166
+ const child = spawn(cli, args, {
154
167
  stdio: ['pipe', 'pipe', 'pipe'],
155
- cwd: process.cwd()
168
+ cwd: process.cwd(),
169
+ timeout: 30000 // 30 second timeout
156
170
  });
157
171
 
158
172
  child.stdout.on('data', (data) => {
@@ -198,8 +212,10 @@ Analyze the text and call appropriate tools using the ACP protocol. Respond with
198
212
  reject(new Error(`Failed to spawn ${cli}: ${error.message}`));
199
213
  });
200
214
 
201
- child.stdin.write(prompt);
202
- child.stdin.end();
215
+ if (useStdin) {
216
+ child.stdin.write(prompt);
217
+ child.stdin.end();
218
+ }
203
219
  });
204
220
  }
205
221
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acpreact",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "description": "ACP SDK for monitoring and reacting to chat conversations",