diff --git a/docs/genaisrc/genaiscript.d.ts b/docs/genaisrc/genaiscript.d.ts index 2588d837e6..2fb090f0cf 100644 --- a/docs/genaisrc/genaiscript.d.ts +++ b/docs/genaisrc/genaiscript.d.ts @@ -1053,6 +1053,13 @@ interface Parsers { options?: HTMLToTextOptions ): string + /** + * Convert HTML to markdown + * @param content html string or file + * @param options + */ + HTMLToMarkdown(content: string | WorkspaceFile): string + /** * Extracts the contents of a zip archive file * @param file @@ -1175,6 +1182,19 @@ interface XML { parse(text: string, options?: XMLParseOptions): any } +interface HTML { + /** + * Converts HTML markup to plain text + * @param html + */ + convertToText(html: string): string + /** + * Converts HMTL markup to markdown + * @param html + */ + convertToMarkdown(html: string): string +} + interface MD { /** * Parses front matter from markdown @@ -1449,7 +1469,10 @@ interface ChatGenerationContext extends ChatTurnGenerationContext { schema: JSONSchema, options?: DefSchemaOptions ): string - defImages(files: StringLike, options?: DefImagesOptions): void + defImages( + files: StringLike | Buffer | Blob, + options?: DefImagesOptions + ): void defTool( tool: ToolCallback | AgenticToolCallback | AgenticToolProviderCallback ): void @@ -1641,12 +1664,176 @@ interface ShellOutput { failed: boolean } +interface BrowseSessionOptions { + /** + * Creates a new context for the browser session + */ + incognito?: boolean + + /** + * Base url to use for relative urls + * @link https://playwright.dev/docs/api/class-browser#browser-new-context-option-base-url + */ + baseUrl?: string + + /** + * Toggles bypassing page's Content-Security-Policy. Defaults to false. + * @link https://playwright.dev/docs/api/class-browser#browser-new-context-option-bypass-csp + */ + bypassCSP?: boolean + + /** + * Whether to ignore HTTPS errors when sending network requests. Defaults to false. + * @link https://playwright.dev/docs/api/class-browser#browser-new-context-option-ignore-https-errors + */ + ignoreHTTPSErrors?: boolean + + /** + * Whether or not to enable JavaScript in the context. Defaults to true. + * @link https://playwright.dev/docs/api/class-browser#browser-new-context-option-java-script-enabled + */ + javaScriptEnabled?: boolean +} + +interface TimeoutOptions { + /** + * Maximum time in milliseconds. Default to no timeout + */ + timeout?: number +} + +/** + * A Locator instance + * @link https://playwright.dev/docs/api/class-locator + */ +interface BrowserLocator { + /** + * Set a value to the input field. + * @param value + * @link https://playwright.dev/docs/api/class-locator#locator-fill + */ + fill(value: string, options?: TimeoutOptions): Promise + + /** + * Returns the element.innerText. + * @link https://playwright.dev/docs/api/class-locator#locator-inner-text + */ + innerText(options?: TimeoutOptions): Promise + + /** + * + */ + innerHTML(options?: TimeoutOptions): Promise + + /** + * Returns the value for the matching or