taskwindow 0.2.8 → 0.2.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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # TaskWindow
2
2
 
3
+ [![Add to Chrome](https://img.shields.io/badge/Chrome_Web_Store-Add_to_Chrome-4285F4?logo=googlechrome&logoColor=white)](https://chromewebstore.google.com/detail/adbfpkbjndcpjihceobeegkokblgifpe)
4
+
3
5
  Let any coding agent drive your real, logged-in Chrome — the tabs you're
4
6
  already signed into — without touching the windows you're working in.
5
7
 
@@ -51,10 +53,15 @@ taskwindow doctor # diagnose daemon, extension, versions, and agent
51
53
  taskwindow pair # create a manual one-time pairing code
52
54
  taskwindow install # re-run first-time setup; reopens the store listing if the extension is missing
53
55
  taskwindow install --claude # add Claude Code without repeating setup
56
+ taskwindow install --codex # add Codex without repeating setup
54
57
  taskwindow install --cursor # add Cursor without repeating setup
55
58
  taskwindow install --opencode # add OpenCode without repeating setup
56
59
  ```
57
60
 
61
+ The Codex option requires the `codex` CLI on PATH. It configures the shared
62
+ user-level MCP connection; restart Codex after registration to load the tools.
63
+ If you use `CODEX_HOME`, that directory is respected.
64
+
58
65
  When a newer release exists, agents are told once per session (in the
59
66
  `tabs_create` result and in `taskwindow_status`) to ask you before running
60
67
  `taskwindow update`. The daemon learns this by asking the npm registry for the
@@ -77,11 +84,37 @@ taking the daemon connection from each other. For another MCP client, connect to
77
84
  |---|---|
78
85
  | Status | `taskwindow_status` (daemon/extension readiness and recovery guidance) |
79
86
  | Tabs | `tabs_list`, `tabs_create`, `tabs_close`, `navigate`, `reload` |
80
- | See | `computer` (screenshot + click/type/key/scroll), `read_page`, `find`, `get_page_text` |
87
+ | See | `computer` (screenshot + click/type/key/scroll/idle, plus `human` mode), `read_page`, `find`, `get_page_text` |
81
88
  | Act | `form_input`, `file_upload`, `upload_image`, `javascript_execute` |
82
89
  | Debug | `read_console_messages`, `read_network_requests` |
83
90
  | Efficiency | `browser_batch` (multi-step in one call), `gif_record`, `set_viewport` (responsive view), `shortcuts_*` |
84
91
 
92
+ ## Wonder: when synthetic input is not enough
93
+
94
+ Some pages ignore a perfect click. A single wheel event carrying 1600px gives
95
+ the page two `scroll` events instead of the ninety-nine a real wheel produces,
96
+ so infinite scroll never loads the next batch and lazy images stay blank. A
97
+ cursor that teleports onto a button never fires the `mouseenter` a hover menu
98
+ opens on. `Input.insertText` fires no key events at all, so a type-ahead search
99
+ box stays empty however right the text looks.
100
+
101
+ By default every `computer` click, scroll, type and `mouse_move` is performed
102
+ the way a hand does it: the pointer travels a curved, decelerating path with an overshoot and
103
+ a dwell before the press, a scroll becomes several uneven wheel gestures, and
104
+ text is typed as real per-character key events. The coordinates and deltas you
105
+ asked for are exact — the variation is in the journey, never the destination.
106
+
107
+ It costs a few hundred milliseconds per action. Pass `human: false` for one
108
+ instant synthetic event when speed matters more than realism.
109
+
110
+ There is also `action: "idle"`, which drifts the cursor around for a moment
111
+ without clicking anything; give it a `dy` and it also rocks the wheel by that
112
+ many pixels and puts it back.
113
+
114
+ The resemblance to a person is a side effect of fixing the events, not a
115
+ promise about bot detection — Bézier-curve cursors are the *labelled bot class*
116
+ in the mouse-dynamics literature, so do not build on it as camouflage.
117
+
85
118
  ## How the isolation works
86
119
 
87
120
  - **Task groups & sessions**: every tab the agent creates goes into a blue tab
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskwindow",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "TaskWindow local daemon: bridges the TaskWindow Chrome extension to any MCP client over Streamable HTTP",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "scripts": {
11
11
  "start": "node src/index.js",
12
- "test": "node --test test/pairing.test.mjs test/extension-bootstrap.test.mjs test/extension-tabs.test.mjs test/bridge.test.mjs test/tool-contract.test.mjs test/updates.test.mjs && node test/run.mjs"
12
+ "test": "node --test test/agents.test.mjs test/pairing.test.mjs test/extension-bootstrap.test.mjs test/extension-tabs.test.mjs test/extension-responsive.test.mjs test/extension-human.test.mjs test/bridge.test.mjs test/tool-contract.test.mjs test/updates.test.mjs && node test/run.mjs"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=18"
package/src/agents.js CHANGED
@@ -1,12 +1,13 @@
1
1
  /**
2
2
  * Optional per-agent MCP registration, always explicit:
3
3
  * taskwindow install --claude → Claude Code
4
+ * taskwindow install --codex → Codex
4
5
  * taskwindow install --cursor → Cursor
5
- * Nothing is registered unless the matching flag is given.
6
+ * Registered only when selected in the installer or explicitly requested.
6
7
  */
7
8
  import { homedir } from "node:os";
8
9
  import { join, dirname } from "node:path";
9
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
10
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync, chmodSync, statSync } from "node:fs";
10
11
  import { execFileSync } from "node:child_process";
11
12
 
12
13
  function commandExists(command) {
@@ -26,30 +27,62 @@ function readJson(path) {
26
27
  }
27
28
  }
28
29
 
29
- export function inspectAgents() {
30
- const claudePath = join(homedir(), ".claude.json");
31
- const cursorPath = join(homedir(), ".cursor", "mcp.json");
32
- const openCodePath = join(homedir(), ".config", "opencode", "opencode.json");
30
+ const CODEX_TASKWINDOW_SECTION = /^\[mcp_servers\.(?:taskwindow|"taskwindow")\][ \t]*(?:#[^\r\n]*)?\r?$/m;
31
+
32
+ export function codexConfigHasTaskWindow(contents) {
33
+ return CODEX_TASKWINDOW_SECTION.test(contents);
34
+ }
35
+
36
+ export function addCodexAuthorization(contents, token) {
37
+ const match = CODEX_TASKWINDOW_SECTION.exec(contents);
38
+ if (!match) throw new Error("Codex did not create the taskwindow MCP server entry");
39
+ const newline = contents.includes("\r\n") ? "\r\n" : "\n";
40
+ const lineEnd = contents.indexOf("\n", match.index + match[0].length);
41
+ const insertAt = lineEnd === -1 ? contents.length : lineEnd + 1;
42
+ const prefix = lineEnd === -1 ? newline : "";
43
+ const header = `http_headers = { Authorization = ${JSON.stringify(`Bearer ${token}`)} }${newline}`;
44
+ return contents.slice(0, insertAt) + prefix + header + contents.slice(insertAt);
45
+ }
46
+
47
+ function codexConfigPath(homeDir, codexHome = process.env.CODEX_HOME) {
48
+ return join(codexHome || join(homeDir, ".codex"), "config.toml");
49
+ }
50
+
51
+ export function inspectAgents({ homeDir = homedir(), codexHome, hasCommand = commandExists } = {}) {
52
+ const claudePath = join(homeDir, ".claude.json");
53
+ const codexPath = codexConfigPath(homeDir, codexHome);
54
+ const cursorPath = join(homeDir, ".cursor", "mcp.json");
55
+ const openCodePath = join(homeDir, ".config", "opencode", "opencode.json");
33
56
  const claude = readJson(claudePath);
34
57
  const cursor = readJson(cursorPath);
35
58
  const openCode = readJson(openCodePath);
59
+ let codex = "";
60
+ try {
61
+ codex = readFileSync(codexPath, "utf8");
62
+ } catch {}
36
63
  return [
37
64
  {
38
65
  id: "claude",
39
66
  label: "Claude Code",
40
- detected: commandExists("claude") || existsSync(claudePath),
67
+ detected: hasCommand("claude") || existsSync(claudePath),
41
68
  configured: !!claude.mcpServers?.taskwindow,
42
69
  },
70
+ {
71
+ id: "codex",
72
+ label: "Codex",
73
+ detected: hasCommand("codex"),
74
+ configured: codexConfigHasTaskWindow(codex),
75
+ },
43
76
  {
44
77
  id: "cursor",
45
78
  label: "Cursor",
46
- detected: commandExists("cursor") || existsSync(join(homedir(), ".cursor")),
79
+ detected: hasCommand("cursor") || existsSync(join(homeDir, ".cursor")),
47
80
  configured: !!cursor.mcpServers?.taskwindow,
48
81
  },
49
82
  {
50
83
  id: "opencode",
51
84
  label: "OpenCode",
52
- detected: commandExists("opencode") || existsSync(join(homedir(), ".config", "opencode")),
85
+ detected: hasCommand("opencode") || existsSync(join(homeDir, ".config", "opencode")),
53
86
  configured: !!openCode.mcp?.taskwindow,
54
87
  },
55
88
  ];
@@ -75,6 +108,56 @@ export function registerClaude({ port, token }) {
75
108
  console.log("[taskwindow] registered in Claude Code (user scope: available in every repo)");
76
109
  }
77
110
 
111
+ export function registerCodex(
112
+ { port, token },
113
+ { homeDir = homedir(), codexHome, execFile = execFileSync } = {}
114
+ ) {
115
+ const path = codexConfigPath(homeDir, codexHome);
116
+ const existed = existsSync(path);
117
+ const original = existed ? readFileSync(path, "utf8") : null;
118
+ const originalMode = existed ? statSync(path).mode & 0o777 : null;
119
+ const url = `http://127.0.0.1:${port}/mcp`;
120
+ // Use the same config directory for the CLI and the header edit, even when
121
+ // invoked from a project with its own MCP overrides.
122
+ const options = { cwd: dirname(path), timeout: 15_000, stdio: ["ignore", "pipe", "pipe"], encoding: "utf8" };
123
+ mkdirSync(dirname(path), { recursive: true });
124
+ try {
125
+ // Let Codex own its config-table creation/removal, then add the static
126
+ // Authorization header its CLI does not currently expose as a flag.
127
+ if (codexConfigHasTaskWindow(original || "")) {
128
+ execFile("codex", ["mcp", "remove", "taskwindow"], options);
129
+ }
130
+ execFile(
131
+ "codex",
132
+ ["mcp", "add", "taskwindow", "--url", url],
133
+ options
134
+ );
135
+ const configured = readFileSync(path, "utf8");
136
+ // writeFile's mode applies only to newly created files.
137
+ chmodSync(path, 0o600);
138
+ writeFileSync(path, addCodexAuthorization(configured, token), { mode: 0o600 });
139
+ const saved = JSON.parse(execFile("codex", ["mcp", "get", "taskwindow", "--json"], options));
140
+ if (!saved.enabled || saved.transport?.type !== "streamable_http" ||
141
+ saved.transport.url !== url || saved.transport.http_headers?.Authorization !== `Bearer ${token}`) {
142
+ throw new Error("saved server does not match the requested connection");
143
+ }
144
+ } catch (err) {
145
+ try {
146
+ if (existed) {
147
+ writeFileSync(path, original);
148
+ chmodSync(path, originalMode);
149
+ }
150
+ else rmSync(path, { force: true });
151
+ } catch (rollbackErr) {
152
+ throw new Error(`Codex registration failed; restoring ${path} also failed: ${rollbackErr.code || "filesystem error"}`);
153
+ }
154
+ // CLI/config errors can include the complete config and its credentials.
155
+ const reason = err.code === "ENOENT" ? "install the Codex CLI and ensure it is on PATH" : "check the Codex CLI and config.toml";
156
+ throw new Error(`Codex registration failed (${reason}); original configuration restored`);
157
+ }
158
+ console.log(`[taskwindow] registered in Codex (${path}) — restart Codex to load the tools`);
159
+ }
160
+
78
161
  export function registerCursor({ port, token }) {
79
162
  const path = join(homedir(), ".cursor", "mcp.json");
80
163
  let cfg = {};
@@ -114,6 +197,10 @@ export function unregisterAgents({ port }) {
114
197
  execFileSync("claude", ["mcp", "remove", "taskwindow"], { stdio: "ignore" });
115
198
  console.log("[taskwindow] removed from Claude Code");
116
199
  } catch {}
200
+ try {
201
+ execFileSync("codex", ["mcp", "remove", "taskwindow"], { stdio: "ignore" });
202
+ console.log("[taskwindow] removed from Codex");
203
+ } catch {}
117
204
  try {
118
205
  const path = join(homedir(), ".cursor", "mcp.json");
119
206
  const cfg = JSON.parse(readFileSync(path, "utf8"));
package/src/index.js CHANGED
@@ -30,7 +30,7 @@ import { UpdateChecker, fetchLatestVersion, isNewer, readUpdateState, updateChec
30
30
  import { createRequire } from "node:module";
31
31
 
32
32
  const { version: VERSION } = createRequire(import.meta.url)("../package.json");
33
- import { inspectAgents, registerClaude, registerCursor, registerOpenCode, unregisterAgents } from "./agents.js";
33
+ import { inspectAgents, registerClaude, registerCodex, registerCursor, registerOpenCode, unregisterAgents } from "./agents.js";
34
34
  import { clearLine, cursorTo, emitKeypressEvents, moveCursor } from "node:readline";
35
35
 
36
36
  // `taskwindow install` manages the login service and offers to register the
@@ -42,10 +42,13 @@ const flags = args.slice(1);
42
42
 
43
43
  const AGENT_CHOICES = [
44
44
  ["claude", "Claude Code", registerClaude],
45
+ ["codex", "Codex", registerCodex],
45
46
  ["cursor", "Cursor", registerCursor],
46
47
  ["opencode", "OpenCode", registerOpenCode],
47
48
  ];
48
49
 
50
+ const AGENT_FLAGS = AGENT_CHOICES.map(([id]) => `--${id}`).join("|");
51
+
49
52
  function selectCodingAgents() {
50
53
  const agentState = new Map(inspectAgents().map((agent) => [agent.id, agent]));
51
54
  const choices = [
@@ -121,14 +124,14 @@ function selectCodingAgents() {
121
124
 
122
125
  async function pickAndRegisterAgents(config) {
123
126
  if (!process.stdin.isTTY) {
124
- console.log("[taskwindow] non-interactive session — register agents with: taskwindow install --claude|--cursor|--opencode");
127
+ console.log(`[taskwindow] non-interactive session — register agents with: taskwindow install ${AGENT_FLAGS}`);
125
128
  return;
126
129
  }
127
130
  console.log("Which coding agents should use TaskWindow?");
128
131
  console.log("Use ↑/↓ to move, space to select, and enter to confirm.");
129
132
  const picks = await selectCodingAgents();
130
133
  if (picks.length === 0) {
131
- console.log("[taskwindow] skipped coding-agent setup — add one later with taskwindow install --claude|--cursor|--opencode");
134
+ console.log(`[taskwindow] skipped coding-agent setup — add one later with taskwindow install ${AGENT_FLAGS}`);
132
135
  return;
133
136
  }
134
137
  const registered = [];
@@ -322,7 +325,7 @@ async function runDoctor(config) {
322
325
  console.log(`${agent.configured ? "✓" : "○"} ${agent.label}${agent.configured ? " configured" : " not configured"}`);
323
326
  }
324
327
  if (!agents.some((agent) => agent.configured)) {
325
- console.log(" Add an agent with: taskwindow install --claude|--cursor|--opencode");
328
+ console.log(` Add an agent with: taskwindow install ${AGENT_FLAGS}`);
326
329
  }
327
330
  return !!health && health.extensionConnected === true;
328
331
  }
@@ -429,16 +432,16 @@ try {
429
432
  if (verb === "install") {
430
433
  const config = loadConfig();
431
434
  const extFlag = flags.indexOf("--extension");
432
- const hasAgentFlags = flags.includes("--claude") || flags.includes("--cursor") || flags.includes("--opencode");
435
+ const hasAgentFlags = AGENT_CHOICES.some(([id]) => flags.includes(`--${id}`));
433
436
  const fullInstall = extFlag === -1 && !hasAgentFlags;
434
437
  const wantsExtension = extFlag !== -1 || (fullInstall && !flags.includes("--no-extension"));
435
438
 
436
439
  if (fullInstall) {
437
440
  await pickAndRegisterAgents(config);
438
441
  } else if (hasAgentFlags) {
439
- if (flags.includes("--claude")) registerClaude(config);
440
- if (flags.includes("--cursor")) registerCursor(config);
441
- if (flags.includes("--opencode")) registerOpenCode(config);
442
+ for (const [id, , register] of AGENT_CHOICES) {
443
+ if (flags.includes(`--${id}`)) register(config);
444
+ }
442
445
  }
443
446
 
444
447
  if (fullInstall || wantsExtension) {
package/src/tools.js CHANGED
@@ -99,13 +99,18 @@ const rawDefs = [
99
99
  "Actions: screenshot (PNG of the viewport, or full page with fullPage), left_click / right_click / " +
100
100
  "middle_click / double_click / triple_click (at x,y), type (text into the focused element), " +
101
101
  "key (named key press, e.g. Enter, Tab, Escape, ArrowLeft, Backspace), scroll (by dx/dy pixels), " +
102
- "mouse_move, wait. Screenshots are in CSS pixels (1 image pixel = 1 coordinate unit, on any display density), so " +
103
- "read x,y straight off the last screenshot. NOTE: while attached, Chrome shows a " +
102
+ "mouse_move, wait, idle. Screenshots are in CSS pixels (1 image pixel = 1 coordinate unit, on any display density), so " +
103
+ "read x,y straight off the last screenshot. " +
104
+ "Clicks, scrolls, typing and mouse_move are human by default: the pointer moves along a real path, scrolls arrive " +
105
+ "as a real wheel gesture, and text as real per-key events. That is what lazy-loading lists, infinite scroll, " +
106
+ "hover-revealed menus and type-ahead inputs are waiting for — they ignore a single jumbo scroll delta, a teleported " +
107
+ "cursor and insertText. It costs a few hundred ms per action; pass human:false for one instant synthetic event when " +
108
+ "speed matters more than realism. NOTE: while attached, Chrome shows a " +
104
109
  '"TaskWindow started debugging this browser" infobar — this is unavoidable with CDP-based control.',
105
110
  inputSchema: {
106
111
  action: z.enum([
107
112
  "screenshot", "left_click", "right_click", "middle_click", "double_click", "triple_click",
108
- "type", "key", "scroll", "mouse_move", "wait",
113
+ "type", "key", "scroll", "mouse_move", "wait", "idle",
109
114
  ]),
110
115
  tabId: tabId.optional(),
111
116
  x: z.number().int().optional().describe("X coordinate in viewport pixels (clicks, scroll origin, mouse_move)"),
@@ -113,7 +118,27 @@ const rawDefs = [
113
118
  text: z.string().optional().describe('Text for the "type" action'),
114
119
  key: z.string().optional().describe('Key name for the "key" action, e.g. "Enter", "a", "ArrowDown"'),
115
120
  dx: z.number().int().optional().describe("Horizontal scroll delta in pixels"),
116
- dy: z.number().int().optional().describe("Vertical scroll delta in pixels (positive scrolls down)"),
121
+ dy: z
122
+ .number()
123
+ .int()
124
+ .optional()
125
+ .describe(
126
+ 'Vertical scroll delta in pixels (positive scrolls down). For "idle", the amplitude of the scroll jiggle, which is scrolled back so the page ends at the same offset.'
127
+ ),
128
+ human: z
129
+ .boolean()
130
+ .default(true)
131
+ .describe(
132
+ "Perform the action the way a hand would: a curved, decelerating pointer path with overshoot and a dwell before the press; a scroll split into uneven wheel bursts so every intermediate position fires; per-character key events instead of a bulk insert. Default true; false sends one instant synthetic event."
133
+ ),
134
+ targetWidth: z
135
+ .number()
136
+ .int()
137
+ .positive()
138
+ .optional()
139
+ .describe(
140
+ "With human on (the default), the width in pixels of the thing being clicked. Fitts's Law uses it to pick the approach speed — a wide button is caught first time, a small one is approached carefully. Default 24."
141
+ ),
117
142
  ms: z.number().int().min(0).max(10_000).optional().describe('Milliseconds for the "wait" action (max 10000)'),
118
143
  fullPage: z.boolean().optional().describe('For "screenshot": capture the whole scrollable page instead of the viewport'),
119
144
  save_to_disk: z
@@ -128,10 +153,11 @@ const rawDefs = [
128
153
  {
129
154
  name: "set_viewport",
130
155
  description:
131
- "Open a responsive view: a dedicated harness window in the current task's tab group rendering the current page in one fixed-size iframe per viewport (media queries, vw/vh and touch resolve exactly per frame; several breakpoints side by side). " +
132
- "Sites that refuse framing automatically fall back to a dedicated emulated window per viewport. Only these windows are affected — other windows and tab groups are untouched. " +
156
+ "Open a responsive view: a harness tab in the current task's tab group rendering the current page in one fixed-size iframe per viewport (media queries, vw/vh and touch resolve exactly per frame; several breakpoints side by side). " +
157
+ "Sites that refuse framing automatically fall back to a dedicated emulated tab per viewport. Only this session's own tabs are affected — the user's tabs, windows and other sessions' groups are untouched. " +
158
+ "Calling it again reuses the same tabs: it re-points them at the new url or viewports rather than opening more, so iterating on a design costs no extra tabs. " +
133
159
  "Each result reports the page's own innerWidth (trust it over screenshots). Typical flow: set_viewport, computer screenshot / read_page on the returned tabIds, then set_viewport with no arguments to close. " +
134
- "Note: frames may render logged out on cookie-partitioned sites — the emulated-window fallback has full cookies.",
160
+ "Note: frames may render logged out on cookie-partitioned sites — the emulated-tab fallback has full cookies. A file:// page needs \"Allow access to file URLs\" on the extension to frame at all; without it every viewport uses the emulated tab and the result says so.",
135
161
  inputSchema: {
136
162
  viewports: z.array(z.object({
137
163
  width: z.number().int().min(200).max(4000),
@@ -302,9 +328,27 @@ const rawDefs = [
302
328
  * a tab opts out with `noSession`; a tool that declares its own sessionToken
303
329
  * (tabs_create's has different semantics) keeps it.
304
330
  */
305
- const toolDefs = rawDefs.map((def) =>
306
- def.local || def.noSession ? def : { ...def, inputSchema: { sessionToken, ...def.inputSchema } }
307
- );
331
+ const toolDefs = rawDefs.map((def) => {
332
+ const shape = def.local || def.noSession ? def.inputSchema : { sessionToken, ...def.inputSchema };
333
+ return { ...def, inputSchema: Object.fromEntries(Object.entries(shape).map(([key, field]) => [key, acceptStringScalars(field)])) };
334
+ });
335
+
336
+ /**
337
+ * Models sometimes send a scalar as a string (`human: "true"`, `x: "120"`), and
338
+ * a strict schema fails the whole call over it. Every top-level boolean and
339
+ * number param accepts the unambiguous spellings; anything else still fails.
340
+ */
341
+ function acceptStringScalars(field) {
342
+ let base = field;
343
+ while (base instanceof z.ZodOptional || base instanceof z.ZodDefault) base = base._def.innerType;
344
+ if (base instanceof z.ZodBoolean) {
345
+ return z.preprocess((v) => (v === "true" ? true : v === "false" ? false : v), field);
346
+ }
347
+ if (base instanceof z.ZodNumber) {
348
+ return z.preprocess((v) => (typeof v === "string" && v.trim() !== "" && Number.isFinite(Number(v)) ? Number(v) : v), field);
349
+ }
350
+ return field;
351
+ }
308
352
 
309
353
  const toolNames = new Set(toolDefs.filter((tool) => !tool.local).map((tool) => tool.name));
310
354
 
@@ -455,7 +499,13 @@ async function runBatch({ steps, sessionToken }, bridge, logger) {
455
499
  }
456
500
  try {
457
501
  const def = toolDefs.find((d) => d.name === tool);
458
- const result = await bridge.sendTool(tool, { ...params, sessionToken }, def.timeoutMs);
502
+ // The same schema a direct call goes through, so a step gets its
503
+ // defaults and coercion too, and bad params fail here, named.
504
+ const parsed = z.object(def.inputSchema).safeParse({ ...params, sessionToken });
505
+ if (!parsed.success) {
506
+ throw new Error(`invalid params: ${parsed.error.issues.map((e) => `${e.message} at ${e.path.join(".") || "(root)"}`).join("; ")}`);
507
+ }
508
+ const result = await bridge.sendTool(tool, parsed.data, def.timeoutMs);
459
509
  results.push({ step: i + 1, tool, ok: true, result });
460
510
  } catch (err) {
461
511
  logger.error(`[mcp] batch step ${i + 1} (${tool}) failed:`, err.message);
package/src/updates.js CHANGED
@@ -86,6 +86,13 @@ export function updateNotice({ version, latest, extensionVersion, extensionStore
86
86
  "Chrome updates it from the Web Store on its own (usually within a day) — no command fixes this, " +
87
87
  "though the user can click Update on chrome://extensions."
88
88
  );
89
+ } else if (extensionStore && latest && !isNewer(latest, version)) {
90
+ // The store shipped a build whose daemon is not on npm yet: `taskwindow
91
+ // update` would only answer "already up to date".
92
+ notes.push(
93
+ `The TaskWindow Chrome extension is ${extensionVersion} while the daemon is ${version}, ` +
94
+ "and npm had no newer daemon at the last check — nothing to run yet; the matching daemon arrives with the next npm release."
95
+ );
89
96
  } else {
90
97
  problems.push(`The TaskWindow Chrome extension is ${extensionVersion} while the daemon is ${version}.`);
91
98
  }