@tenux/cli 0.0.8 → 0.0.10
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/dist/{chunk-W724HH4O.js → chunk-V2C4ESKK.js} +10 -5
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -207,22 +207,23 @@ async function handleClaudeQuery(command, supabase) {
|
|
|
207
207
|
const args = [
|
|
208
208
|
"--print",
|
|
209
209
|
// non-interactive
|
|
210
|
+
"--verbose",
|
|
211
|
+
// required for stream-json with --print
|
|
210
212
|
"--output-format",
|
|
211
213
|
"stream-json"
|
|
212
214
|
// structured streaming output
|
|
213
215
|
];
|
|
214
216
|
if (model) args.push("--model", model);
|
|
215
217
|
if (session_id) args.push("--resume", session_id);
|
|
216
|
-
args.push("-p", prompt);
|
|
217
218
|
const isWindows = process.platform === "win32";
|
|
218
219
|
const claudeBin = isWindows ? "claude.cmd" : "claude";
|
|
219
220
|
const proc = spawn(claudeBin, args, {
|
|
220
221
|
cwd,
|
|
221
222
|
shell: isWindows,
|
|
222
223
|
stdio: ["pipe", "pipe", "pipe"]
|
|
223
|
-
// env is omitted — Node inherits parent process.env automatically.
|
|
224
|
-
// Spreading env on Windows can lose system variables and cause ENOENT.
|
|
225
224
|
});
|
|
225
|
+
proc.stdin.write(prompt);
|
|
226
|
+
proc.stdin.end();
|
|
226
227
|
let seq = 0;
|
|
227
228
|
let capturedSessionId = null;
|
|
228
229
|
let batch = [];
|
|
@@ -265,12 +266,15 @@ async function handleClaudeQuery(command, supabase) {
|
|
|
265
266
|
}
|
|
266
267
|
}
|
|
267
268
|
});
|
|
269
|
+
let stderrText = "";
|
|
268
270
|
proc.stderr.on("data", (chunk) => {
|
|
271
|
+
const text = chunk.toString();
|
|
272
|
+
stderrText += text;
|
|
269
273
|
batch.push({
|
|
270
274
|
command_id: command.id,
|
|
271
275
|
seq: seq++,
|
|
272
276
|
type: "stderr",
|
|
273
|
-
data: { text
|
|
277
|
+
data: { text }
|
|
274
278
|
});
|
|
275
279
|
});
|
|
276
280
|
return new Promise((promiseResolve, reject) => {
|
|
@@ -295,7 +299,8 @@ async function handleClaudeQuery(command, supabase) {
|
|
|
295
299
|
status: exitCode === 0 ? "done" : "error",
|
|
296
300
|
result: {
|
|
297
301
|
exit_code: exitCode,
|
|
298
|
-
...capturedSessionId ? { session_id: capturedSessionId } : {}
|
|
302
|
+
...capturedSessionId ? { session_id: capturedSessionId } : {},
|
|
303
|
+
...exitCode !== 0 && stderrText ? { error: stderrText.trim().slice(0, 500) } : {}
|
|
299
304
|
},
|
|
300
305
|
completed_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
301
306
|
}).eq("id", command.id);
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED