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/form-batch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/domains/form-batch.ts') diff --git a/src/domains/form-batch.ts b/src/domains/form-batch.ts index 1d49cf6..567108b 100644 --- a/src/domains/form-batch.ts +++ b/src/domains/form-batch.ts @@ -2,7 +2,7 @@ import { Type } from "typebox"; import { type Result, err, ok } from "../util/result"; import { defineBrowserTool, type ToolErr, type ToolOk } from "../util/tool"; import { fillDeclaration } from "./fill-engine"; -import { detailsOf, resolveAndCall } from "./form"; +import { detailsOf, resolveAndCall } from "./element-call"; const FILL_FN = fillDeclaration({ rejectSelect: false, focusFirst: true }); -- cgit v1.2.3