UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

38 lines 1.75 kB
import { z } from 'zod/v4'; import type { ToolCallContext } from '../models/ToolCallContext'; import type { ToolCallResult } from '../models/ToolCallResult'; import { Tool } from './Tool'; export declare const DetectBrokenLinksCoreSchema: z.ZodObject<{ captureScreenshots: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>; export declare const DetectBrokenLinksGptSchema: z.ZodObject<{ captureScreenshots: z.ZodOptional<z.ZodBoolean>; rationale: z.ZodString; }, z.core.$strip>; export declare class DetectBrokenLinksTool extends Tool<typeof DetectBrokenLinksCoreSchema, typeof DetectBrokenLinksGptSchema> { static readonly NAME = "detectBrokenLinks"; constructor(); call(context: ToolCallContext, parameters: z.infer<typeof DetectBrokenLinksCoreSchema>): Promise<ToolCallResult>; callFromGpt(context: ToolCallContext, parameters: z.infer<typeof DetectBrokenLinksGptSchema>): Promise<ToolCallResult>; /** * Returns an array of LinkInfo objects containing a URL and an array of all associated link texts. * Filters out invalid URLs. */ private static getLinksForPage; /** * Checks all links concurrently and returns a map from the original URL to its traversal result. * If a link is a mailto, it is marked as skipped. */ private static traverseLinks; /** * Traverses a single link, following redirects up to maxRedirects. * Returns a LinkTraversalResult that includes the full redirect chain. */ private static traverseSingleLink; /** * Generates a JSON report of the link scan. * The report now includes a "linkTexts" field for each link. */ private static generateJsonReport; } //# sourceMappingURL=DetectBrokenLinksTool.d.ts.map