import { highlightText } from '../../browser/browserWindow' import type { SkillDefinition } from '../types' import { asString } from '../argUtils' export const highlightBrowserText: SkillDefinition = { name: 'highlight_browser_text', description: 'Surligne en jaune (et fait defiler jusqu a) un passage de texte exact dans la page actuellement affichee dans le navigateur integre.', parameters: { type: 'object', properties: { text: { type: 'string', description: 'Texte exact a surligner (doit correspondre mot pour mot au texte de la page)' } }, required: ['text'] }, execute: async (args) => { const text = asString(args.text).trim() if (!text) throw new Error('text manquant') const found = await highlightText(text) return found ? `Passage surligne : "${text}".` : `Echec : le texte "${text}" n'a pas ete trouve exactement sur la page.` } }