mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-10 14:28:38 +03:00
Adds two opt-in agent tools for controlling a computer: - computer_use: pixel-based (screenshot + mouse/keyboard) via a desktop (pyautogui) or browser (playwright) backend. - browser: DOM/accessibility-based web automation (act by element ref), reliable across ANY tool-calling model, not just vision/CU-trained ones. Core enabler in the runner: a tool may return image content blocks, which are split out and delivered to the model as a follow-up user message (_split_tool_result_media), so screenshots reach any vision provider (e.g. via OpenRouter/openai-compat) without provider-specific code. Both tools are OFF by default (tools.computerUse.enable / tools.browser.enable), are not exposed to subagents, and the browser tool supports an allowed_domains allowlist. Heavy deps (pyautogui/pillow/playwright) are an optional [computer-use] extra. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
24 lines
930 B
HTML
24 lines
930 B
HTML
<!doctype html>
|
|
<html><head><meta charset="utf-8"><title>Shop</title></head>
|
|
<body>
|
|
<h1>Gadget Shop</h1>
|
|
<div id="badge">Cart items: <span id="count">0</span></div>
|
|
<ul>
|
|
<li>Wireless Mouse - $25
|
|
<button aria-label="Add Wireless Mouse to cart" onclick="add('Wireless Mouse',25)">Add to cart</button></li>
|
|
<li>Mechanical Keyboard - $45
|
|
<button aria-label="Add Mechanical Keyboard to cart" onclick="add('Mechanical Keyboard',45)">Add to cart</button></li>
|
|
<li>4K Monitor - $200
|
|
<button aria-label="Add 4K Monitor to cart" onclick="add('4K Monitor',200)">Add to cart</button></li>
|
|
</ul>
|
|
<p><a href="cart.html" id="tocart">View cart</a></p>
|
|
<script>
|
|
function add(name, price){
|
|
var cart = JSON.parse(localStorage.getItem('cart') || '[]');
|
|
cart.push({n: name, p: price});
|
|
localStorage.setItem('cart', JSON.stringify(cart));
|
|
document.getElementById('count').textContent = cart.length;
|
|
}
|
|
</script>
|
|
</body></html>
|