From e46f080c03a511b626b21455cfd6094554b02733 Mon Sep 17 00:00:00 2001 From: amankumarsingh77 Date: Tue, 28 Jul 2026 00:28:45 +0530 Subject: fix(domains): restore fill_form and set_checked, drop the stale fork MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit domains/forms.ts was a stale fork of form.ts imported only by a manual test. It held two working tools the registry never registered: fill_form and set_checked. Ported both onto the current pattern and deleted the fork; form.ts versions of the shared tools win. The fork's tools took ref as Type.Integer (a raw CDP backendNodeId). browser_snapshot has since moved to string refs ('e7') resolved through the session ref map, so as written the tools were not callable at all. Ported them onto resolveRefToObjectId and Type.String refs; the only user-facing strings that changed are the four that documented the old [ref=N] syntax. All page-side JS is carried byte-for-byte. form.ts exceeded 250 lines, so fillForm moved to form-batch.ts per the single-field/batch split. form.ts is still 425 lines — the pre-existing three tools account for that, so the split does not reach the target. test/manual/forms-test.ts is repointed and adapted to publish an 'eN' ref map, but NOT executed — it needs a live Chrome. Type-checked only. Co-Authored-By: Claude Opus 5 (1M context) --- src/domains/forms.ts | 375 --------------------------------------------------- 1 file changed, 375 deletions(-) delete mode 100644 src/domains/forms.ts (limited to 'src/domains/forms.ts') diff --git a/src/domains/forms.ts b/src/domains/forms.ts deleted file mode 100644 index ed64a74..0000000 --- a/src/domains/forms.ts +++ /dev/null @@ -1,375 +0,0 @@ -import { Type } from "typebox"; -import type { BrowserClient } from "../client"; -import { type Result, err, ok } from "../util/result"; -import { defineBrowserTool, type ToolErr, type ToolOk } from "../util/tool"; - -// ── Page-side functions ────────────────────────────────────────────────────── -// These run inside the page via Runtime.callFunctionOn with `this` bound to the -// resolved element. They are NOT string-interpolated with user data — the value -// is passed as a structured `arguments` entry, so safeJs is unnecessary here. - -/** - * Universal field setter. Auto-detects the element type and applies the right - * strategy, then reads the resulting value back so the caller can confirm. - * - * The /