--- name: cdp_list_tabs kind: function lang: go domain: browser version: 0.1.0 purity: impure signature: "func CdpListTabs(host string, port int) ([]CdpTab, error)" description: "Lista las pestañas/targets de una instancia Chrome via GET /json. Sin websocket — solo HTTP. Util para apps que muestran el inventario de pestañas (dashboards, debuggers) o agentes que iteran tabs sin tener que abrir conexion CDP a cada una." tags: [browser, cdp, tabs, listing, http, pendiente-usar] uses_functions: [] uses_types: [] returns: [] returns_optional: false error_type: "error_go_core" imports: [encoding/json, fmt, net/http, net/url] example: | tabs, err := browser.CdpListTabs("localhost", 9222) if err == nil { for _, t := range tabs { if t.Type == "page" { fmt.Println(t.ID, t.Title, t.URL) } } } tested: true tests: ["TestCdpListTabs_emptyHost"] test_file_path: "functions/browser/cdp_list_tabs_test.go" file_path: "functions/browser/cdp_list_tabs.go" notes: | - Endpoint CDP es read-only HTTP, no requiere CdpConnect. - Retorna TODOS los targets (page + iframe + service_worker + ...). Filtrar por type segun caso de uso. - Tipo `CdpTab` es publico — apps externas pueden consumirlo. - Mismo archivo expone CdpNewTab, CdpCloseTab, CdpActivateTab — operaciones HTTP /json/* relacionadas. documentation: | Wraps el endpoint clasico de Chrome DevTools Protocol /json. Misma estructura que devuelve `chrome://inspect/#devices` o que consumen Puppeteer/Playwright cuando se conectan a un Chrome existente. params: - name: host desc: "Host CDP (vacio = localhost)." - name: port desc: "Puerto remote-debugging." output: "Slice de CdpTab (id, type, title, url, webSocketDebuggerUrl). Error si HTTP falla o status != 200." ---