opencode-agent-tmux 1.1.8 → 1.1.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.
@@ -97,34 +97,31 @@ function extractLogUpdateFlag(args) {
97
97
  return { args: cleaned, logUpdate };
98
98
  }
99
99
  async function main() {
100
- spawnPluginUpdater();
101
100
  const opencodeBin = findOpencodeBin();
102
101
  if (!opencodeBin) {
103
- console.error("\u274C Error: Could not find 'opencode' binary.");
104
- console.error(" Please ensure OpenCode is installed and in your PATH.");
102
+ console.error('Error: Could not find "opencode" binary in PATH or common locations.');
105
103
  exit(1);
106
104
  }
105
+ spawnPluginUpdater();
107
106
  const port = await findAvailablePort();
108
107
  if (!port) {
109
- console.error("\u274C No ports available in range " + OPENCODE_PORT_START + "-" + OPENCODE_PORT_MAX);
108
+ console.error("Error: No available ports found in range 4096-4106.");
110
109
  exit(1);
111
110
  }
112
- if (port !== OPENCODE_PORT_START) {
113
- console.warn(`\u26A0\uFE0F Port ${OPENCODE_PORT_START} is in use, using port ${port} instead`);
114
- }
115
- env.OPENCODE_PORT = port.toString();
111
+ const env2 = { ...process.env };
112
+ env2.OPENCODE_PORT = port.toString();
116
113
  const rawArgs = argv.slice(2);
117
114
  const { args, logUpdate } = extractLogUpdateFlag(rawArgs);
118
115
  if (logUpdate) {
119
- env.OPENCODE_AUTO_UPDATE_LOG_UPDATE = "true";
120
- env.OPENCODE_AUTO_UPDATE_BYPASS_THROTTLE = "true";
121
- env.OPENCODE_AUTO_UPDATE_DEBUG = "true";
116
+ env2.OPENCODE_AUTO_UPDATE_LOG_UPDATE = "true";
117
+ env2.OPENCODE_AUTO_UPDATE_BYPASS_THROTTLE = "true";
118
+ env2.OPENCODE_AUTO_UPDATE_DEBUG = "true";
122
119
  }
123
120
  const childArgs = ["--port", port.toString(), ...args];
124
- const inTmux = !!env.TMUX;
121
+ const inTmux = !!env2.TMUX;
125
122
  const tmuxAvailable = hasTmux();
126
123
  if (inTmux || !tmuxAvailable) {
127
- const child = spawn(opencodeBin, childArgs, { stdio: "inherit" });
124
+ const child = spawn(opencodeBin, childArgs, { stdio: "inherit", env: env2 });
128
125
  child.on("close", (code) => exit(code ?? 0));
129
126
  process.on("SIGINT", () => child.kill("SIGINT"));
130
127
  process.on("SIGTERM", () => child.kill("SIGTERM"));
@@ -140,7 +137,7 @@ async function main() {
140
137
  "new-session",
141
138
  shellCommand
142
139
  ];
143
- const child = spawn("tmux", tmuxArgs, { stdio: "inherit" });
140
+ const child = spawn("tmux", tmuxArgs, { stdio: "inherit", env: env2 });
144
141
  child.on("close", (code) => exit(code ?? 0));
145
142
  }
146
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-agent-tmux",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
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",