@towles/tool 0.0.110 → 0.0.111

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@towles/tool",
3
- "version": "0.0.110",
3
+ "version": "0.0.111",
4
4
  "description": "One off quality of life scripts that I use on a daily basis.",
5
5
  "homepage": "https://github.com/ChrisTowles/towles-tool#readme",
6
6
  "bugs": {
@@ -388,8 +388,9 @@ function App() {
388
388
 
389
389
  if (!startupFocusSynced && sessions.some((session) => session.name === msg.name)) {
390
390
  startupFocusSynced = true;
391
+ const oldFocus = focusedSession();
391
392
  setFocusedSession(msg.name);
392
- if (focusedSession() !== msg.name) {
393
+ if (oldFocus !== msg.name) {
393
394
  startupFocusToPublish = msg.name;
394
395
  }
395
396
  }
@@ -1,7 +1,10 @@
1
1
  import type { AgentStatus, AgentEvent } from "./contracts/agent";
2
2
 
3
- export const SERVER_PORT = 4201;
4
- export const SERVER_HOST = "127.0.0.1";
3
+ export const DEFAULT_SERVER_PORT = 4201;
4
+ export const DEFAULT_SERVER_HOST = "127.0.0.1";
5
+
6
+ export const SERVER_PORT: number = Number(process.env.TT_AGENTBOARD_PORT) || DEFAULT_SERVER_PORT;
7
+ export const SERVER_HOST: string = process.env.TT_AGENTBOARD_HOST || DEFAULT_SERVER_HOST;
5
8
  export const PID_FILE = "/tmp/agentboard.pid";
6
9
  export const SERVER_IDLE_TIMEOUT_MS = 30_000;
7
10
  export const STUCK_RUNNING_TIMEOUT_MS = 3 * 60 * 1000;
@@ -6,8 +6,8 @@ import consola from "consola";
6
6
  import { colors } from "consola/utils";
7
7
  import { debugArg } from "./shared.js";
8
8
 
9
- const SERVER_HOST = "127.0.0.1";
10
- const SERVER_PORT = 4201;
9
+ const SERVER_HOST = process.env.TT_AGENTBOARD_HOST || "127.0.0.1";
10
+ const SERVER_PORT = Number(process.env.TT_AGENTBOARD_PORT) || 4201;
11
11
 
12
12
  // Keybinding defaults
13
13
  const DEFAULT_KEY = "a";
@@ -146,14 +146,14 @@ function uninstall(): void {
146
146
  }
147
147
 
148
148
  const content = readFileSync(editPath, "utf8");
149
- if (!content.includes("agentboard")) {
149
+ if (!content.includes(MARKER) && !content.includes(RUN_SHELL_LINE)) {
150
150
  consola.info("agentboard not found in tmux.conf");
151
151
  return;
152
152
  }
153
153
 
154
154
  const newContent = content
155
155
  .split("\n")
156
- .filter((line) => !line.includes("agentboard"))
156
+ .filter((line) => !line.includes(MARKER) && !line.includes(RUN_SHELL_LINE))
157
157
  .join("\n")
158
158
  .replace(/\n{3,}/g, "\n\n");
159
159
 
@@ -333,12 +333,13 @@ async function runFocus(): Promise<void> {
333
333
  return;
334
334
  }
335
335
 
336
- // Otherwise, ensure server + toggle sidebar on
336
+ // Otherwise, ensure server + open sidebar
337
337
  if (!(await ensureServerUp())) process.exit(0);
338
338
  const ctx = tmuxContext();
339
- await fetch(`http://${SERVER_HOST}:${SERVER_PORT}/toggle`, { method: "POST", body: ctx }).catch(
340
- () => {},
341
- );
339
+ await fetch(`http://${SERVER_HOST}:${SERVER_PORT}/ensure-sidebar`, {
340
+ method: "POST",
341
+ body: ctx,
342
+ }).catch(() => {});
342
343
 
343
344
  // Wait for sidebar pane to appear
344
345
  for (let i = 0; i < 20; i++) {