From a1df2d3e0998e99176a4bfe3cffb83b9e6a2377e Mon Sep 17 00:00:00 2001 From: amankumarsingh77 Date: Sat, 2 May 2026 21:59:30 +0530 Subject: release: v0.3.1 — audit fixes for list_tabs IDs, switch_tab prefix matching, download auto-mkdir, session recovery, docs updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug fixes: - list_tabs: show full 32-char targetIds (was truncated to 8 chars) - switch_tab: prefix matching fallback for hex prefixes >= 8 chars - download: auto-create directory with mkdir -p - ensureAlive: Runtime.evaluate probe to recover from crashed page targets Docs: - dispatch_key: clarify DOM-only event behavior - navigate: warn about Google anti-bot limitation - network_log: update deprecated promptSnippet - SKILL.md: document actual daemon API (evaluateJs, pageInfo, session.call) - SKILL.md: add troubleshooting for sharp/maxDim and Google navigation - sharp: add to optionalDependencies for screenshot maxDim auto-resize --- src/domains/files.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/domains/files.ts') diff --git a/src/domains/files.ts b/src/domains/files.ts index f0cb6b0..91f8761 100644 --- a/src/domains/files.ts +++ b/src/domains/files.ts @@ -1,4 +1,4 @@ -import { access, constants, stat, readFile, writeFile } from "node:fs/promises"; +import { mkdir, access, constants, stat, readFile, writeFile } from "node:fs/promises"; import { basename } from "node:path"; import { Type } from "typebox"; import type { BrowserClient } from "../client"; @@ -135,6 +135,14 @@ export const downloadTool = defineBrowserTool({ ], parameters: DownloadArgs, async handler(args, { client }): Promise> { + try { + await mkdir(args.downloadPath, { recursive: true }); + } catch (e) { + return err({ + kind: "io_error", + message: `Cannot create download directory: ${args.downloadPath} (${e instanceof Error ? e.message : String(e)})`, + }); + } try { const s = await stat(args.downloadPath); if (!s.isDirectory()) { -- cgit v1.2.3