/** * dsh-browser-tool: DSH plugin surface. Registers one `browser` tool that * opens/attaches a Chromium, manages named tabs, and runs code against a tab * with the full omp `tab` helper API (observe / ariaSnapshot / screenshot / * clicks / waits / evaluate …). Ported from oh-my-pi's coding-agent browser * tool plus browser-relay. * * Wire this package into a DSH profile by adding its built bundle to the * profile's `package.json > dsh.profile.bundles` list. */ import z from "@deepseek-ai/schemastery"; import { type BrowserToolConfigInput } from "./config.js"; import { type Context, type ContextFormed, type ImageAttachmentRef } from "./deps.js"; import type { JsonValue } from "@deepseek-ai/dsh-util-values"; declare module "@deepseek-ai/dsh-llm" { interface MessageSourceMap { /** Producer source this plugin stamps on the turn-end "tabs left open" reminder. */ "browser-tool": { kind: "browser-tool"; } & ContextFormed; } } export interface BrowserToolOptions { /** Allow spawning/attaching a browser. False disables the tool. */ enabled?: boolean; config?: Partial; } export declare const name = "dsh-browser-tool"; export declare const inject: string[]; export declare const Config: z; headless: z; relay: z; relayUrl: z; cdpUrl: z; screenshotDir: z; noWebP: z; installChrome: z; remindAgent: z; }>>, Schemastery.ObjectT; headless: z; relay: z; relayUrl: z; cdpUrl: z; screenshotDir: z; noWebP: z; installChrome: z; remindAgent: z; }>>, "plain">; /** Exported so the contract test can validate real result objects against the declared schema. */ export declare const outputSchema: { type: "object"; additionalProperties: false; properties: { ok: { type: "boolean"; required: true; }; name: { type: "string"; required: true; }; created: { type: "boolean"; }; url: { type: "string"; }; message: { type: "string"; }; output: { type: "array"; items: { type: "object"; additionalProperties: false; properties: { kind: { type: "string"; enum: ("text" | "image")[]; required: true; }; text: { type: "string"; }; dest: { type: "string"; }; image: { type: "object"; additionalProperties: false; properties: { attachmentId: { type: "string"; required: true; }; mediaType: { type: "string"; required: true; }; bytes: { type: "integer"; required: true; }; width: { type: "integer"; required: true; }; height: { type: "integer"; required: true; }; name: { type: "string"; }; }; }; }; }; }; returnValue: { type: "json"; }; }; }; /** Runtime argument shape (validated by the schema above). */ export interface BrowserToolArgs { action: "open" | "run" | "close"; name: string; url?: string; waitUntil?: "load" | "domcontentloaded" | "networkidle0" | "networkidle2"; headless?: boolean; timeout?: number; target?: string; viewport?: { width?: number; height?: number; deviceScaleFactor?: number; }; dialogs?: "accept" | "dismiss"; code?: string; kill?: boolean; } export interface BrowserToolOutputEntry { kind: "text" | "image"; text?: string; dest?: string; image?: ImageAttachmentRef; } export interface BrowserToolValue { ok: boolean; name: string; created?: boolean; url?: string; message?: string; output?: BrowserToolOutputEntry[]; returnValue?: JsonValue; } export declare function apply(ctx: Context, options?: BrowserToolOptions): (() => void) | void; declare const _default: { name: string; inject: string[]; Config: z; headless: z; relay: z; relayUrl: z; cdpUrl: z; screenshotDir: z; noWebP: z; installChrome: z; remindAgent: z; }>>, Schemastery.ObjectT; headless: z; relay: z; relayUrl: z; cdpUrl: z; screenshotDir: z; noWebP: z; installChrome: z; remindAgent: z; }>>, "plain">; apply: typeof apply; }; export default _default;