From 86045450c208bc51670dd9554e581f2a62b181c9 Mon Sep 17 00:00:00 2001 From: amankumarsingh77 Date: Tue, 28 Jul 2026 22:00:33 +0530 Subject: refactor: helpers live in helper modules, not in tool files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit form.ts exported resolveAndCall and detailsOf to form-batch.ts, snapshot.ts exported buildTree and collectInteractiveTargets to ref-resolve.ts, and screenshot.ts exported captureWithCrosshair to click.ts — so importing one tool pulled in another tool's whole module. The shared halves move out: ax-tree.ts (the AX tree model, its construction and the queries over it), element-call.ts (calling a function on a resolved element, and the PageResult it returns), screenshot-capture.ts (capture, resize, crosshair overlay). Each tool file now holds its tools and its own presentation, nothing else. NavOutcome stops being exported; nothing outside navigate.ts read it. target.ts stays a module rather than folding into click.ts as planned: it is already helper-only and has its own test suite, and moving a tested pure function into a tool file is the thing this commit removes. Having one consumer is not the defect. Co-Authored-By: Claude Opus 5 (1M context) --- src/domains/click.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/domains/click.ts') diff --git a/src/domains/click.ts b/src/domains/click.ts index 41c3024..79bb5ee 100644 --- a/src/domains/click.ts +++ b/src/domains/click.ts @@ -6,7 +6,7 @@ import { type Result, ok } from "../util/result"; import { debugClicksEnabled } from "../util/debug"; import { defineBrowserTool, type ToolErr } from "../util/tool"; import { cdpCall } from "./cdp-call"; -import { captureWithCrosshair } from "./screenshot"; +import { captureWithCrosshair } from "./screenshot-capture"; import { interactiveDiff } from "./ref-resolve"; import { resolveTarget } from "./target"; -- cgit v1.2.3