mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-08 04:57:36 +00:00
config(git,claude,ssh): templated gitconfig; claude settings/commands/hooks/skills; ssh config
gitconfig: name/email from chezmoi data, gh credential helper by PATH lookup (portable to darwin). claude: no credentials, history, projects, sessions, or plugin caches. ssh config as private_ (0600). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3c691e8dc5
commit
20891f3910
476 files changed
+59086
-7
No files matched your search
@@ -0,0 +1,63 @@
|
||||
# Browse the Web (Experimental)
|
||||
|
||||
Fetch https://developers.cloudflare.com/agents/api-reference/browse-the-web/ for complete documentation.
|
||||
|
||||
CDP-powered browser tools that let agents scrape, screenshot, and interact with web pages.
|
||||
|
||||
## Setup
|
||||
|
||||
```jsonc
|
||||
// wrangler.jsonc
|
||||
{
|
||||
"browser": { "binding": "BROWSER" },
|
||||
"worker_loaders": [{ "binding": "LOADER" }],
|
||||
"compatibility_flags": ["nodejs_compat"]
|
||||
}
|
||||
```
|
||||
|
||||
## Usage with AI SDK
|
||||
|
||||
```typescript
|
||||
import { createBrowserTools } from "agents/browser/ai";
|
||||
|
||||
export class MyAgent extends AIChatAgent<Env> {
|
||||
async onChatMessage(onFinish) {
|
||||
const browserTools = createBrowserTools({
|
||||
browser: this.env.BROWSER,
|
||||
loader: this.env.LOADER
|
||||
});
|
||||
|
||||
const result = streamText({
|
||||
model: openai("gpt-4o"),
|
||||
messages: await convertToModelMessages(this.messages),
|
||||
tools: { ...myTools, ...browserTools },
|
||||
onFinish
|
||||
});
|
||||
return result.toUIMessageStreamResponse();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Available Tools
|
||||
|
||||
| Tool | Purpose |
|
||||
|------|---------|
|
||||
| `browser_search` | Search the web and return results |
|
||||
| `browser_execute` | Navigate to URL, execute JS, return results |
|
||||
|
||||
The LLM writes async JavaScript IIFEs that run in a fresh browser session.
|
||||
|
||||
## When to Use
|
||||
|
||||
- Need a real browser (JS rendering, screenshots, interaction) → browser tools
|
||||
- Just need HTML/API data → use `fetch()` instead (faster, cheaper)
|
||||
|
||||
## Low-Level API
|
||||
|
||||
```typescript
|
||||
import { connectBrowser, CdpSession } from "agents/browser";
|
||||
|
||||
const browser = await connectBrowser(this.env.BROWSER);
|
||||
const cdp = new CdpSession(browser);
|
||||
await cdp.send("Page.navigate", { url: "https://example.com" });
|
||||
```
|
||||
Reference in new issue
Block a user