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.
- package/core.js +20 -4
- 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
|
-
|
|
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
|
-
|
|
202
|
-
|
|
215
|
+
if (useStdin) {
|
|
216
|
+
child.stdin.write(prompt);
|
|
217
|
+
child.stdin.end();
|
|
218
|
+
}
|
|
203
219
|
});
|
|
204
220
|
}
|
|
205
221
|
|