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/ref-resolve.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/domains/ref-resolve.ts') diff --git a/src/domains/ref-resolve.ts b/src/domains/ref-resolve.ts index 0f509a0..9eb335e 100644 --- a/src/domains/ref-resolve.ts +++ b/src/domains/ref-resolve.ts @@ -3,7 +3,7 @@ import { type Result, err, ok } from "../util/result"; import type { ToolErr } from "../util/tool"; import { type Box, boxOf } from "./box"; import { cdpCall } from "./cdp-call"; -import { buildTree, collectInteractiveTargets, type SlimNode } from "./snapshot"; +import { buildTree, collectInteractiveTargets, type SlimNode } from "./ax-tree"; const staleErr = (ref: string): ToolErr => ({ kind: "invalid_state", -- cgit v1.2.3