opencode-agent-tmux 1.2.2 → 1.2.3

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.
@@ -315,6 +315,25 @@ 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"].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 child = spawn(opencodeBin2, args, {
329
+ stdio: "inherit",
330
+ env: process.env
331
+ });
332
+ child.on("close", (code) => {
333
+ exit(code ?? 0);
334
+ });
335
+ return;
336
+ }
318
337
  log("=== OpenCode Tmux Wrapper Started ===");
319
338
  log("Process argv:", JSON.stringify(argv));
320
339
  log("Current directory:", process.cwd());
@@ -335,7 +354,6 @@ async function main() {
335
354
  }
336
355
  const env2 = { ...process.env };
337
356
  env2.OPENCODE_PORT = port.toString();
338
- const args = argv.slice(2);
339
357
  log("User args:", JSON.stringify(args));
340
358
  const childArgs = ["--port", port.toString(), ...args];
341
359
  log("Final childArgs:", JSON.stringify(childArgs));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-agent-tmux",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "OpenCode plugin that provides tmux integration for viewing agent execution in real-time",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",