opencode-agent-tmux 1.2.2 → 1.2.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/dist/bin/opencode-tmux.js +30 -1
- package/package.json +1 -1
|
@@ -315,6 +315,36 @@ function hasTmux() {
|
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
async function main() {
|
|
318
|
+
const args = argv.slice(2);
|
|
319
|
+
const isCliCommand = args.length > 0 && (["auth", "config", "plugins", "update", "completion", "stats"].includes(args[0]) || ["--version", "-v", "--help", "-h"].includes(args[0]));
|
|
320
|
+
if (isCliCommand) {
|
|
321
|
+
const opencodeBin2 = findOpencodeBin();
|
|
322
|
+
if (!opencodeBin2) {
|
|
323
|
+
console.error(
|
|
324
|
+
'Error: Could not find "opencode" binary in PATH or common locations.'
|
|
325
|
+
);
|
|
326
|
+
exit(1);
|
|
327
|
+
}
|
|
328
|
+
const bypassArgs = [...args];
|
|
329
|
+
if (!args.some((arg) => arg.startsWith("--log-level"))) {
|
|
330
|
+
bypassArgs.push("--log-level", "ERROR");
|
|
331
|
+
}
|
|
332
|
+
const child = spawn(opencodeBin2, bypassArgs, {
|
|
333
|
+
stdio: ["inherit", "inherit", "pipe"],
|
|
334
|
+
env: process.env
|
|
335
|
+
});
|
|
336
|
+
child.stderr?.on("data", (data) => {
|
|
337
|
+
const lines = data.toString().split("\n");
|
|
338
|
+
const filtered = lines.filter(
|
|
339
|
+
(line) => !/^INFO\s+.*service=models\.dev.*refreshing/.test(line)
|
|
340
|
+
);
|
|
341
|
+
process.stderr.write(filtered.join("\n"));
|
|
342
|
+
});
|
|
343
|
+
child.on("close", (code) => {
|
|
344
|
+
exit(code ?? 0);
|
|
345
|
+
});
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
318
348
|
log("=== OpenCode Tmux Wrapper Started ===");
|
|
319
349
|
log("Process argv:", JSON.stringify(argv));
|
|
320
350
|
log("Current directory:", process.cwd());
|
|
@@ -335,7 +365,6 @@ async function main() {
|
|
|
335
365
|
}
|
|
336
366
|
const env2 = { ...process.env };
|
|
337
367
|
env2.OPENCODE_PORT = port.toString();
|
|
338
|
-
const args = argv.slice(2);
|
|
339
368
|
log("User args:", JSON.stringify(args));
|
|
340
369
|
const childArgs = ["--port", port.toString(), ...args];
|
|
341
370
|
log("Final childArgs:", JSON.stringify(childArgs));
|