hands test 2

This commit is contained in:
Ian Gulliver
2026-10-17 23:11:31 -07:00
parent ccf8c551ec
commit 39ca42316f
5 changed files with 21 additions and 18 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ func browserTool(_ args: [String: Any]) async throws -> [Content] {
throw ToolError("unknown op \(op.debugDescription)")
}
let present: (String) async throws -> Bool = { needle in
(try? js("String(!!document.body && document.body.innerText.includes(\(jsString(needle))))", target)) == "true"
(try? js("String((document.title + '\\n' + (document.body ? document.body.innerText : '')).toLowerCase().includes(\(jsString(needle.lowercased()))))", target)) == "true"
}
if let note = try await waitFor(args, acted: false, present) {
log.append(note)