[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-browser-use-agents-sdk":3,"mdc--wlq82w-key":39,"related-repo-browser-use-agents-sdk":2537,"related-org-browser-use-agents-sdk":2577},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":28,"repoUrl":29,"updatedAt":30,"license":31,"forks":32,"topics":33,"repo":34,"sourceUrl":37,"mdContent":38},"agents-sdk","build AI agents on Cloudflare Workers","Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"browser-use","Browser-use","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fbrowser-use.png",[12,16,19,22,25],{"name":13,"slug":14,"type":15},"Cloudflare Workers","cloudflare-workers","tag",{"name":17,"slug":18,"type":15},"Agents","agents",{"name":20,"slug":21,"type":15},"AI Infrastructure","ai-infrastructure",{"name":23,"slug":24,"type":15},"Serverless","serverless",{"name":26,"slug":27,"type":15},"SDK","sdk",255,"https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fbrowsercode","2026-04-27T05:34:19.800431",null,35,[],{"repoUrl":29,"stars":28,"forks":32,"topics":35,"description":36},[],"The browser-native agent framework","https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fbrowsercode\u002Ftree\u002FHEAD\u002Fpackages\u002Fopencode\u002Ftest\u002Ffixture\u002Fskills\u002Fagents-sdk","---\nname: agents-sdk\ndescription: Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks.\n---\n\n# Cloudflare Agents SDK\n\n**STOP.** Your knowledge of the Agents SDK may be outdated. Prefer retrieval over pre-training for any Agents SDK task.\n\n## Documentation\n\nFetch current docs from `https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Ftree\u002Fmain\u002Fdocs` before implementing.\n\n| Topic               | Doc                           | Use for                                        |\n| ------------------- | ----------------------------- | ---------------------------------------------- |\n| Getting started     | `docs\u002Fgetting-started.md`     | First agent, project setup                     |\n| State               | `docs\u002Fstate.md`               | `setState`, `validateStateChange`, persistence |\n| Routing             | `docs\u002Frouting.md`             | URL patterns, `routeAgentRequest`, `basePath`  |\n| Callable methods    | `docs\u002Fcallable-methods.md`    | `@callable`, RPC, streaming, timeouts          |\n| Scheduling          | `docs\u002Fscheduling.md`          | `schedule()`, `scheduleEvery()`, cron          |\n| Workflows           | `docs\u002Fworkflows.md`           | `AgentWorkflow`, durable multi-step tasks      |\n| HTTP\u002FWebSockets     | `docs\u002Fhttp-websockets.md`     | Lifecycle hooks, hibernation                   |\n| Email               | `docs\u002Femail.md`               | Email routing, secure reply resolver           |\n| MCP client          | `docs\u002Fmcp-client.md`          | Connecting to MCP servers                      |\n| MCP server          | `docs\u002Fmcp-servers.md`         | Building MCP servers with `McpAgent`           |\n| Client SDK          | `docs\u002Fclient-sdk.md`          | `useAgent`, `useAgentChat`, React hooks        |\n| Human-in-the-loop   | `docs\u002Fhuman-in-the-loop.md`   | Approval flows, pausing workflows              |\n| Resumable streaming | `docs\u002Fresumable-streaming.md` | Stream recovery on disconnect                  |\n\nCloudflare docs: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F\n\n## Capabilities\n\nThe Agents SDK provides:\n\n- **Persistent state** - SQLite-backed, auto-synced to clients\n- **Callable RPC** - `@callable()` methods invoked over WebSocket\n- **Scheduling** - One-time, recurring (`scheduleEvery`), and cron tasks\n- **Workflows** - Durable multi-step background processing via `AgentWorkflow`\n- **MCP integration** - Connect to MCP servers or build your own with `McpAgent`\n- **Email handling** - Receive and reply to emails with secure routing\n- **Streaming chat** - `AIChatAgent` with resumable streams\n- **React hooks** - `useAgent`, `useAgentChat` for client apps\n\n## FIRST: Verify Installation\n\n```bash\nnpm ls agents  # Should show agents package\n```\n\nIf not installed:\n\n```bash\nnpm install agents\n```\n\n## Wrangler Configuration\n\n```jsonc\n{\n  \"durable_objects\": {\n    \"bindings\": [{ \"name\": \"MyAgent\", \"class_name\": \"MyAgent\" }],\n  },\n  \"migrations\": [{ \"tag\": \"v1\", \"new_sqlite_classes\": [\"MyAgent\"] }],\n}\n```\n\n## Agent Class\n\n```typescript\nimport { Agent, routeAgentRequest, callable } from \"agents\"\n\ntype State = { count: number }\n\nexport class Counter extends Agent\u003CEnv, State> {\n  initialState = { count: 0 }\n\n  \u002F\u002F Validation hook - runs before state persists (sync, throwing rejects the update)\n  validateStateChange(nextState: State, source: Connection | \"server\") {\n    if (nextState.count \u003C 0) throw new Error(\"Count cannot be negative\")\n  }\n\n  \u002F\u002F Notification hook - runs after state persists (async, non-blocking)\n  onStateUpdate(state: State, source: Connection | \"server\") {\n    console.log(\"State updated:\", state)\n  }\n\n  @callable()\n  increment() {\n    this.setState({ count: this.state.count + 1 })\n    return this.state.count\n  }\n}\n\nexport default {\n  fetch: (req, env) => routeAgentRequest(req, env) ?? new Response(\"Not found\", { status: 404 }),\n}\n```\n\n## Routing\n\nRequests route to `\u002Fagents\u002F{agent-name}\u002F{instance-name}`:\n\n| Class      | URL                        |\n| ---------- | -------------------------- |\n| `Counter`  | `\u002Fagents\u002Fcounter\u002Fuser-123` |\n| `ChatRoom` | `\u002Fagents\u002Fchat-room\u002Flobby`  |\n\nClient: `useAgent({ agent: \"Counter\", name: \"user-123\" })`\n\n## Core APIs\n\n| Task                | API                                                    |\n| ------------------- | ------------------------------------------------------ |\n| Read state          | `this.state.count`                                     |\n| Write state         | `this.setState({ count: 1 })`                          |\n| SQL query           | `` this.sql`SELECT * FROM users WHERE id = ${id}` ``   |\n| Schedule (delay)    | `await this.schedule(60, \"task\", payload)`             |\n| Schedule (cron)     | `await this.schedule(\"0 * * * *\", \"task\", payload)`    |\n| Schedule (interval) | `await this.scheduleEvery(30, \"poll\")`                 |\n| RPC method          | `@callable() myMethod() { ... }`                       |\n| Streaming RPC       | `@callable({ streaming: true }) stream(res) { ... }`   |\n| Start workflow      | `await this.runWorkflow(\"ProcessingWorkflow\", params)` |\n\n## React Client\n\n```tsx\nimport { useAgent } from \"agents\u002Freact\"\n\nfunction App() {\n  const [state, setLocalState] = useState({ count: 0 })\n\n  const agent = useAgent({\n    agent: \"Counter\",\n    name: \"my-instance\",\n    onStateUpdate: (newState) => setLocalState(newState),\n    onIdentity: (name, agentType) => console.log(`Connected to ${name}`),\n  })\n\n  return \u003Cbutton onClick={() => agent.setState({ count: state.count + 1 })}>Count: {state.count}\u003C\u002Fbutton>\n}\n```\n\n## References\n\n- **[references\u002Fworkflows.md](references\u002Fworkflows.md)** - Durable Workflows integration\n- **[references\u002Fcallable.md](references\u002Fcallable.md)** - RPC methods, streaming, timeouts\n- **[references\u002Fstate-scheduling.md](references\u002Fstate-scheduling.md)** - State persistence, scheduling\n- **[references\u002Fstreaming-chat.md](references\u002Fstreaming-chat.md)** - AIChatAgent, resumable streams\n- **[references\u002Fmcp.md](references\u002Fmcp.md)** - MCP server integration\n- **[references\u002Femail.md](references\u002Femail.md)** - Email routing and handling\n- **[references\u002Fcodemode.md](references\u002Fcodemode.md)** - Code Mode (experimental)\n",{"data":40,"body":41},{"name":4,"description":6},{"type":42,"children":43},"root",[44,53,65,72,86,476,489,495,500,628,634,674,679,703,709,771,777,1627,1632,1644,1708,1719,1725,1900,1906,2431,2437,2531],{"type":45,"tag":46,"props":47,"children":49},"element","h1",{"id":48},"cloudflare-agents-sdk",[50],{"type":51,"value":52},"text","Cloudflare Agents SDK",{"type":45,"tag":54,"props":55,"children":56},"p",{},[57,63],{"type":45,"tag":58,"props":59,"children":60},"strong",{},[61],{"type":51,"value":62},"STOP.",{"type":51,"value":64}," Your knowledge of the Agents SDK may be outdated. Prefer retrieval over pre-training for any Agents SDK task.",{"type":45,"tag":66,"props":67,"children":69},"h2",{"id":68},"documentation",[70],{"type":51,"value":71},"Documentation",{"type":45,"tag":54,"props":73,"children":74},{},[75,77,84],{"type":51,"value":76},"Fetch current docs from ",{"type":45,"tag":78,"props":79,"children":81},"code",{"className":80},[],[82],{"type":51,"value":83},"https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Ftree\u002Fmain\u002Fdocs",{"type":51,"value":85}," before implementing.",{"type":45,"tag":87,"props":88,"children":89},"table",{},[90,114],{"type":45,"tag":91,"props":92,"children":93},"thead",{},[94],{"type":45,"tag":95,"props":96,"children":97},"tr",{},[98,104,109],{"type":45,"tag":99,"props":100,"children":101},"th",{},[102],{"type":51,"value":103},"Topic",{"type":45,"tag":99,"props":105,"children":106},{},[107],{"type":51,"value":108},"Doc",{"type":45,"tag":99,"props":110,"children":111},{},[112],{"type":51,"value":113},"Use for",{"type":45,"tag":115,"props":116,"children":117},"tbody",{},[118,141,177,212,240,275,303,325,347,369,397,432,454],{"type":45,"tag":95,"props":119,"children":120},{},[121,127,136],{"type":45,"tag":122,"props":123,"children":124},"td",{},[125],{"type":51,"value":126},"Getting started",{"type":45,"tag":122,"props":128,"children":129},{},[130],{"type":45,"tag":78,"props":131,"children":133},{"className":132},[],[134],{"type":51,"value":135},"docs\u002Fgetting-started.md",{"type":45,"tag":122,"props":137,"children":138},{},[139],{"type":51,"value":140},"First agent, project setup",{"type":45,"tag":95,"props":142,"children":143},{},[144,149,158],{"type":45,"tag":122,"props":145,"children":146},{},[147],{"type":51,"value":148},"State",{"type":45,"tag":122,"props":150,"children":151},{},[152],{"type":45,"tag":78,"props":153,"children":155},{"className":154},[],[156],{"type":51,"value":157},"docs\u002Fstate.md",{"type":45,"tag":122,"props":159,"children":160},{},[161,167,169,175],{"type":45,"tag":78,"props":162,"children":164},{"className":163},[],[165],{"type":51,"value":166},"setState",{"type":51,"value":168},", ",{"type":45,"tag":78,"props":170,"children":172},{"className":171},[],[173],{"type":51,"value":174},"validateStateChange",{"type":51,"value":176},", persistence",{"type":45,"tag":95,"props":178,"children":179},{},[180,185,194],{"type":45,"tag":122,"props":181,"children":182},{},[183],{"type":51,"value":184},"Routing",{"type":45,"tag":122,"props":186,"children":187},{},[188],{"type":45,"tag":78,"props":189,"children":191},{"className":190},[],[192],{"type":51,"value":193},"docs\u002Frouting.md",{"type":45,"tag":122,"props":195,"children":196},{},[197,199,205,206],{"type":51,"value":198},"URL patterns, ",{"type":45,"tag":78,"props":200,"children":202},{"className":201},[],[203],{"type":51,"value":204},"routeAgentRequest",{"type":51,"value":168},{"type":45,"tag":78,"props":207,"children":209},{"className":208},[],[210],{"type":51,"value":211},"basePath",{"type":45,"tag":95,"props":213,"children":214},{},[215,220,229],{"type":45,"tag":122,"props":216,"children":217},{},[218],{"type":51,"value":219},"Callable methods",{"type":45,"tag":122,"props":221,"children":222},{},[223],{"type":45,"tag":78,"props":224,"children":226},{"className":225},[],[227],{"type":51,"value":228},"docs\u002Fcallable-methods.md",{"type":45,"tag":122,"props":230,"children":231},{},[232,238],{"type":45,"tag":78,"props":233,"children":235},{"className":234},[],[236],{"type":51,"value":237},"@callable",{"type":51,"value":239},", RPC, streaming, timeouts",{"type":45,"tag":95,"props":241,"children":242},{},[243,248,257],{"type":45,"tag":122,"props":244,"children":245},{},[246],{"type":51,"value":247},"Scheduling",{"type":45,"tag":122,"props":249,"children":250},{},[251],{"type":45,"tag":78,"props":252,"children":254},{"className":253},[],[255],{"type":51,"value":256},"docs\u002Fscheduling.md",{"type":45,"tag":122,"props":258,"children":259},{},[260,266,267,273],{"type":45,"tag":78,"props":261,"children":263},{"className":262},[],[264],{"type":51,"value":265},"schedule()",{"type":51,"value":168},{"type":45,"tag":78,"props":268,"children":270},{"className":269},[],[271],{"type":51,"value":272},"scheduleEvery()",{"type":51,"value":274},", cron",{"type":45,"tag":95,"props":276,"children":277},{},[278,283,292],{"type":45,"tag":122,"props":279,"children":280},{},[281],{"type":51,"value":282},"Workflows",{"type":45,"tag":122,"props":284,"children":285},{},[286],{"type":45,"tag":78,"props":287,"children":289},{"className":288},[],[290],{"type":51,"value":291},"docs\u002Fworkflows.md",{"type":45,"tag":122,"props":293,"children":294},{},[295,301],{"type":45,"tag":78,"props":296,"children":298},{"className":297},[],[299],{"type":51,"value":300},"AgentWorkflow",{"type":51,"value":302},", durable multi-step tasks",{"type":45,"tag":95,"props":304,"children":305},{},[306,311,320],{"type":45,"tag":122,"props":307,"children":308},{},[309],{"type":51,"value":310},"HTTP\u002FWebSockets",{"type":45,"tag":122,"props":312,"children":313},{},[314],{"type":45,"tag":78,"props":315,"children":317},{"className":316},[],[318],{"type":51,"value":319},"docs\u002Fhttp-websockets.md",{"type":45,"tag":122,"props":321,"children":322},{},[323],{"type":51,"value":324},"Lifecycle hooks, hibernation",{"type":45,"tag":95,"props":326,"children":327},{},[328,333,342],{"type":45,"tag":122,"props":329,"children":330},{},[331],{"type":51,"value":332},"Email",{"type":45,"tag":122,"props":334,"children":335},{},[336],{"type":45,"tag":78,"props":337,"children":339},{"className":338},[],[340],{"type":51,"value":341},"docs\u002Femail.md",{"type":45,"tag":122,"props":343,"children":344},{},[345],{"type":51,"value":346},"Email routing, secure reply resolver",{"type":45,"tag":95,"props":348,"children":349},{},[350,355,364],{"type":45,"tag":122,"props":351,"children":352},{},[353],{"type":51,"value":354},"MCP client",{"type":45,"tag":122,"props":356,"children":357},{},[358],{"type":45,"tag":78,"props":359,"children":361},{"className":360},[],[362],{"type":51,"value":363},"docs\u002Fmcp-client.md",{"type":45,"tag":122,"props":365,"children":366},{},[367],{"type":51,"value":368},"Connecting to MCP servers",{"type":45,"tag":95,"props":370,"children":371},{},[372,377,386],{"type":45,"tag":122,"props":373,"children":374},{},[375],{"type":51,"value":376},"MCP server",{"type":45,"tag":122,"props":378,"children":379},{},[380],{"type":45,"tag":78,"props":381,"children":383},{"className":382},[],[384],{"type":51,"value":385},"docs\u002Fmcp-servers.md",{"type":45,"tag":122,"props":387,"children":388},{},[389,391],{"type":51,"value":390},"Building MCP servers with ",{"type":45,"tag":78,"props":392,"children":394},{"className":393},[],[395],{"type":51,"value":396},"McpAgent",{"type":45,"tag":95,"props":398,"children":399},{},[400,405,414],{"type":45,"tag":122,"props":401,"children":402},{},[403],{"type":51,"value":404},"Client SDK",{"type":45,"tag":122,"props":406,"children":407},{},[408],{"type":45,"tag":78,"props":409,"children":411},{"className":410},[],[412],{"type":51,"value":413},"docs\u002Fclient-sdk.md",{"type":45,"tag":122,"props":415,"children":416},{},[417,423,424,430],{"type":45,"tag":78,"props":418,"children":420},{"className":419},[],[421],{"type":51,"value":422},"useAgent",{"type":51,"value":168},{"type":45,"tag":78,"props":425,"children":427},{"className":426},[],[428],{"type":51,"value":429},"useAgentChat",{"type":51,"value":431},", React hooks",{"type":45,"tag":95,"props":433,"children":434},{},[435,440,449],{"type":45,"tag":122,"props":436,"children":437},{},[438],{"type":51,"value":439},"Human-in-the-loop",{"type":45,"tag":122,"props":441,"children":442},{},[443],{"type":45,"tag":78,"props":444,"children":446},{"className":445},[],[447],{"type":51,"value":448},"docs\u002Fhuman-in-the-loop.md",{"type":45,"tag":122,"props":450,"children":451},{},[452],{"type":51,"value":453},"Approval flows, pausing workflows",{"type":45,"tag":95,"props":455,"children":456},{},[457,462,471],{"type":45,"tag":122,"props":458,"children":459},{},[460],{"type":51,"value":461},"Resumable streaming",{"type":45,"tag":122,"props":463,"children":464},{},[465],{"type":45,"tag":78,"props":466,"children":468},{"className":467},[],[469],{"type":51,"value":470},"docs\u002Fresumable-streaming.md",{"type":45,"tag":122,"props":472,"children":473},{},[474],{"type":51,"value":475},"Stream recovery on disconnect",{"type":45,"tag":54,"props":477,"children":478},{},[479,481],{"type":51,"value":480},"Cloudflare docs: ",{"type":45,"tag":482,"props":483,"children":487},"a",{"href":484,"rel":485},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F",[486],"nofollow",[488],{"type":51,"value":484},{"type":45,"tag":66,"props":490,"children":492},{"id":491},"capabilities",[493],{"type":51,"value":494},"Capabilities",{"type":45,"tag":54,"props":496,"children":497},{},[498],{"type":51,"value":499},"The Agents SDK provides:",{"type":45,"tag":501,"props":502,"children":503},"ul",{},[504,515,533,550,564,579,589,606],{"type":45,"tag":505,"props":506,"children":507},"li",{},[508,513],{"type":45,"tag":58,"props":509,"children":510},{},[511],{"type":51,"value":512},"Persistent state",{"type":51,"value":514}," - SQLite-backed, auto-synced to clients",{"type":45,"tag":505,"props":516,"children":517},{},[518,523,525,531],{"type":45,"tag":58,"props":519,"children":520},{},[521],{"type":51,"value":522},"Callable RPC",{"type":51,"value":524}," - ",{"type":45,"tag":78,"props":526,"children":528},{"className":527},[],[529],{"type":51,"value":530},"@callable()",{"type":51,"value":532}," methods invoked over WebSocket",{"type":45,"tag":505,"props":534,"children":535},{},[536,540,542,548],{"type":45,"tag":58,"props":537,"children":538},{},[539],{"type":51,"value":247},{"type":51,"value":541}," - One-time, recurring (",{"type":45,"tag":78,"props":543,"children":545},{"className":544},[],[546],{"type":51,"value":547},"scheduleEvery",{"type":51,"value":549},"), and cron tasks",{"type":45,"tag":505,"props":551,"children":552},{},[553,557,559],{"type":45,"tag":58,"props":554,"children":555},{},[556],{"type":51,"value":282},{"type":51,"value":558}," - Durable multi-step background processing via ",{"type":45,"tag":78,"props":560,"children":562},{"className":561},[],[563],{"type":51,"value":300},{"type":45,"tag":505,"props":565,"children":566},{},[567,572,574],{"type":45,"tag":58,"props":568,"children":569},{},[570],{"type":51,"value":571},"MCP integration",{"type":51,"value":573}," - Connect to MCP servers or build your own with ",{"type":45,"tag":78,"props":575,"children":577},{"className":576},[],[578],{"type":51,"value":396},{"type":45,"tag":505,"props":580,"children":581},{},[582,587],{"type":45,"tag":58,"props":583,"children":584},{},[585],{"type":51,"value":586},"Email handling",{"type":51,"value":588}," - Receive and reply to emails with secure routing",{"type":45,"tag":505,"props":590,"children":591},{},[592,597,598,604],{"type":45,"tag":58,"props":593,"children":594},{},[595],{"type":51,"value":596},"Streaming chat",{"type":51,"value":524},{"type":45,"tag":78,"props":599,"children":601},{"className":600},[],[602],{"type":51,"value":603},"AIChatAgent",{"type":51,"value":605}," with resumable streams",{"type":45,"tag":505,"props":607,"children":608},{},[609,614,615,620,621,626],{"type":45,"tag":58,"props":610,"children":611},{},[612],{"type":51,"value":613},"React hooks",{"type":51,"value":524},{"type":45,"tag":78,"props":616,"children":618},{"className":617},[],[619],{"type":51,"value":422},{"type":51,"value":168},{"type":45,"tag":78,"props":622,"children":624},{"className":623},[],[625],{"type":51,"value":429},{"type":51,"value":627}," for client apps",{"type":45,"tag":66,"props":629,"children":631},{"id":630},"first-verify-installation",[632],{"type":51,"value":633},"FIRST: Verify Installation",{"type":45,"tag":635,"props":636,"children":641},"pre",{"className":637,"code":638,"language":639,"meta":640,"style":640},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm ls agents  # Should show agents package\n","bash","",[642],{"type":45,"tag":78,"props":643,"children":644},{"__ignoreMap":640},[645],{"type":45,"tag":646,"props":647,"children":650},"span",{"class":648,"line":649},"line",1,[651,657,663,668],{"type":45,"tag":646,"props":652,"children":654},{"style":653},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[655],{"type":51,"value":656},"npm",{"type":45,"tag":646,"props":658,"children":660},{"style":659},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[661],{"type":51,"value":662}," ls",{"type":45,"tag":646,"props":664,"children":665},{"style":659},[666],{"type":51,"value":667}," agents",{"type":45,"tag":646,"props":669,"children":671},{"style":670},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[672],{"type":51,"value":673},"  # Should show agents package\n",{"type":45,"tag":54,"props":675,"children":676},{},[677],{"type":51,"value":678},"If not installed:",{"type":45,"tag":635,"props":680,"children":682},{"className":637,"code":681,"language":639,"meta":640,"style":640},"npm install agents\n",[683],{"type":45,"tag":78,"props":684,"children":685},{"__ignoreMap":640},[686],{"type":45,"tag":646,"props":687,"children":688},{"class":648,"line":649},[689,693,698],{"type":45,"tag":646,"props":690,"children":691},{"style":653},[692],{"type":51,"value":656},{"type":45,"tag":646,"props":694,"children":695},{"style":659},[696],{"type":51,"value":697}," install",{"type":45,"tag":646,"props":699,"children":700},{"style":659},[701],{"type":51,"value":702}," agents\n",{"type":45,"tag":66,"props":704,"children":706},{"id":705},"wrangler-configuration",[707],{"type":51,"value":708},"Wrangler Configuration",{"type":45,"tag":635,"props":710,"children":714},{"className":711,"code":712,"language":713,"meta":640,"style":640},"language-jsonc shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"durable_objects\": {\n    \"bindings\": [{ \"name\": \"MyAgent\", \"class_name\": \"MyAgent\" }],\n  },\n  \"migrations\": [{ \"tag\": \"v1\", \"new_sqlite_classes\": [\"MyAgent\"] }],\n}\n","jsonc",[715],{"type":45,"tag":78,"props":716,"children":717},{"__ignoreMap":640},[718,726,735,744,753,762],{"type":45,"tag":646,"props":719,"children":720},{"class":648,"line":649},[721],{"type":45,"tag":646,"props":722,"children":723},{},[724],{"type":51,"value":725},"{\n",{"type":45,"tag":646,"props":727,"children":729},{"class":648,"line":728},2,[730],{"type":45,"tag":646,"props":731,"children":732},{},[733],{"type":51,"value":734},"  \"durable_objects\": {\n",{"type":45,"tag":646,"props":736,"children":738},{"class":648,"line":737},3,[739],{"type":45,"tag":646,"props":740,"children":741},{},[742],{"type":51,"value":743},"    \"bindings\": [{ \"name\": \"MyAgent\", \"class_name\": \"MyAgent\" }],\n",{"type":45,"tag":646,"props":745,"children":747},{"class":648,"line":746},4,[748],{"type":45,"tag":646,"props":749,"children":750},{},[751],{"type":51,"value":752},"  },\n",{"type":45,"tag":646,"props":754,"children":756},{"class":648,"line":755},5,[757],{"type":45,"tag":646,"props":758,"children":759},{},[760],{"type":51,"value":761},"  \"migrations\": [{ \"tag\": \"v1\", \"new_sqlite_classes\": [\"MyAgent\"] }],\n",{"type":45,"tag":646,"props":763,"children":765},{"class":648,"line":764},6,[766],{"type":45,"tag":646,"props":767,"children":768},{},[769],{"type":51,"value":770},"}\n",{"type":45,"tag":66,"props":772,"children":774},{"id":773},"agent-class",[775],{"type":51,"value":776},"Agent Class",{"type":45,"tag":635,"props":778,"children":782},{"className":779,"code":780,"language":781,"meta":640,"style":640},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { Agent, routeAgentRequest, callable } from \"agents\"\n\ntype State = { count: number }\n\nexport class Counter extends Agent\u003CEnv, State> {\n  initialState = { count: 0 }\n\n  \u002F\u002F Validation hook - runs before state persists (sync, throwing rejects the update)\n  validateStateChange(nextState: State, source: Connection | \"server\") {\n    if (nextState.count \u003C 0) throw new Error(\"Count cannot be negative\")\n  }\n\n  \u002F\u002F Notification hook - runs after state persists (async, non-blocking)\n  onStateUpdate(state: State, source: Connection | \"server\") {\n    console.log(\"State updated:\", state)\n  }\n\n  @callable()\n  increment() {\n    this.setState({ count: this.state.count + 1 })\n    return this.state.count\n  }\n}\n\nexport default {\n  fetch: (req, env) => routeAgentRequest(req, env) ?? new Response(\"Not found\", { status: 404 }),\n}\n","typescript",[783],{"type":45,"tag":78,"props":784,"children":785},{"__ignoreMap":640},[786,850,859,903,910,965,999,1007,1016,1090,1170,1179,1187,1196,1262,1310,1318,1326,1345,1363,1428,1454,1462,1470,1478,1495,1619],{"type":45,"tag":646,"props":787,"children":788},{"class":648,"line":649},[789,795,801,807,812,817,821,826,831,836,841,845],{"type":45,"tag":646,"props":790,"children":792},{"style":791},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[793],{"type":51,"value":794},"import",{"type":45,"tag":646,"props":796,"children":798},{"style":797},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[799],{"type":51,"value":800}," {",{"type":45,"tag":646,"props":802,"children":804},{"style":803},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[805],{"type":51,"value":806}," Agent",{"type":45,"tag":646,"props":808,"children":809},{"style":797},[810],{"type":51,"value":811},",",{"type":45,"tag":646,"props":813,"children":814},{"style":803},[815],{"type":51,"value":816}," routeAgentRequest",{"type":45,"tag":646,"props":818,"children":819},{"style":797},[820],{"type":51,"value":811},{"type":45,"tag":646,"props":822,"children":823},{"style":803},[824],{"type":51,"value":825}," callable",{"type":45,"tag":646,"props":827,"children":828},{"style":797},[829],{"type":51,"value":830}," }",{"type":45,"tag":646,"props":832,"children":833},{"style":791},[834],{"type":51,"value":835}," from",{"type":45,"tag":646,"props":837,"children":838},{"style":797},[839],{"type":51,"value":840}," \"",{"type":45,"tag":646,"props":842,"children":843},{"style":659},[844],{"type":51,"value":18},{"type":45,"tag":646,"props":846,"children":847},{"style":797},[848],{"type":51,"value":849},"\"\n",{"type":45,"tag":646,"props":851,"children":852},{"class":648,"line":728},[853],{"type":45,"tag":646,"props":854,"children":856},{"emptyLinePlaceholder":855},true,[857],{"type":51,"value":858},"\n",{"type":45,"tag":646,"props":860,"children":861},{"class":648,"line":737},[862,868,873,878,882,888,893,898],{"type":45,"tag":646,"props":863,"children":865},{"style":864},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[866],{"type":51,"value":867},"type",{"type":45,"tag":646,"props":869,"children":870},{"style":653},[871],{"type":51,"value":872}," State",{"type":45,"tag":646,"props":874,"children":875},{"style":797},[876],{"type":51,"value":877}," =",{"type":45,"tag":646,"props":879,"children":880},{"style":797},[881],{"type":51,"value":800},{"type":45,"tag":646,"props":883,"children":885},{"style":884},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[886],{"type":51,"value":887}," count",{"type":45,"tag":646,"props":889,"children":890},{"style":797},[891],{"type":51,"value":892},":",{"type":45,"tag":646,"props":894,"children":895},{"style":653},[896],{"type":51,"value":897}," number",{"type":45,"tag":646,"props":899,"children":900},{"style":797},[901],{"type":51,"value":902}," }\n",{"type":45,"tag":646,"props":904,"children":905},{"class":648,"line":746},[906],{"type":45,"tag":646,"props":907,"children":908},{"emptyLinePlaceholder":855},[909],{"type":51,"value":858},{"type":45,"tag":646,"props":911,"children":912},{"class":648,"line":755},[913,918,923,928,933,937,942,947,951,955,960],{"type":45,"tag":646,"props":914,"children":915},{"style":791},[916],{"type":51,"value":917},"export",{"type":45,"tag":646,"props":919,"children":920},{"style":864},[921],{"type":51,"value":922}," class",{"type":45,"tag":646,"props":924,"children":925},{"style":653},[926],{"type":51,"value":927}," Counter",{"type":45,"tag":646,"props":929,"children":930},{"style":864},[931],{"type":51,"value":932}," extends",{"type":45,"tag":646,"props":934,"children":935},{"style":653},[936],{"type":51,"value":806},{"type":45,"tag":646,"props":938,"children":939},{"style":797},[940],{"type":51,"value":941},"\u003C",{"type":45,"tag":646,"props":943,"children":944},{"style":653},[945],{"type":51,"value":946},"Env",{"type":45,"tag":646,"props":948,"children":949},{"style":797},[950],{"type":51,"value":811},{"type":45,"tag":646,"props":952,"children":953},{"style":653},[954],{"type":51,"value":872},{"type":45,"tag":646,"props":956,"children":957},{"style":797},[958],{"type":51,"value":959},">",{"type":45,"tag":646,"props":961,"children":962},{"style":797},[963],{"type":51,"value":964}," {\n",{"type":45,"tag":646,"props":966,"children":967},{"class":648,"line":764},[968,973,977,981,985,989,995],{"type":45,"tag":646,"props":969,"children":970},{"style":884},[971],{"type":51,"value":972},"  initialState",{"type":45,"tag":646,"props":974,"children":975},{"style":797},[976],{"type":51,"value":877},{"type":45,"tag":646,"props":978,"children":979},{"style":797},[980],{"type":51,"value":800},{"type":45,"tag":646,"props":982,"children":983},{"style":884},[984],{"type":51,"value":887},{"type":45,"tag":646,"props":986,"children":987},{"style":797},[988],{"type":51,"value":892},{"type":45,"tag":646,"props":990,"children":992},{"style":991},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[993],{"type":51,"value":994}," 0",{"type":45,"tag":646,"props":996,"children":997},{"style":797},[998],{"type":51,"value":902},{"type":45,"tag":646,"props":1000,"children":1002},{"class":648,"line":1001},7,[1003],{"type":45,"tag":646,"props":1004,"children":1005},{"emptyLinePlaceholder":855},[1006],{"type":51,"value":858},{"type":45,"tag":646,"props":1008,"children":1010},{"class":648,"line":1009},8,[1011],{"type":45,"tag":646,"props":1012,"children":1013},{"style":670},[1014],{"type":51,"value":1015},"  \u002F\u002F Validation hook - runs before state persists (sync, throwing rejects the update)\n",{"type":45,"tag":646,"props":1017,"children":1019},{"class":648,"line":1018},9,[1020,1025,1030,1036,1040,1044,1048,1053,1057,1062,1067,1071,1076,1081,1086],{"type":45,"tag":646,"props":1021,"children":1022},{"style":884},[1023],{"type":51,"value":1024},"  validateStateChange",{"type":45,"tag":646,"props":1026,"children":1027},{"style":797},[1028],{"type":51,"value":1029},"(",{"type":45,"tag":646,"props":1031,"children":1033},{"style":1032},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[1034],{"type":51,"value":1035},"nextState",{"type":45,"tag":646,"props":1037,"children":1038},{"style":797},[1039],{"type":51,"value":892},{"type":45,"tag":646,"props":1041,"children":1042},{"style":653},[1043],{"type":51,"value":872},{"type":45,"tag":646,"props":1045,"children":1046},{"style":797},[1047],{"type":51,"value":811},{"type":45,"tag":646,"props":1049,"children":1050},{"style":1032},[1051],{"type":51,"value":1052}," source",{"type":45,"tag":646,"props":1054,"children":1055},{"style":797},[1056],{"type":51,"value":892},{"type":45,"tag":646,"props":1058,"children":1059},{"style":653},[1060],{"type":51,"value":1061}," Connection",{"type":45,"tag":646,"props":1063,"children":1064},{"style":797},[1065],{"type":51,"value":1066}," |",{"type":45,"tag":646,"props":1068,"children":1069},{"style":797},[1070],{"type":51,"value":840},{"type":45,"tag":646,"props":1072,"children":1073},{"style":659},[1074],{"type":51,"value":1075},"server",{"type":45,"tag":646,"props":1077,"children":1078},{"style":797},[1079],{"type":51,"value":1080},"\"",{"type":45,"tag":646,"props":1082,"children":1083},{"style":797},[1084],{"type":51,"value":1085},")",{"type":45,"tag":646,"props":1087,"children":1088},{"style":797},[1089],{"type":51,"value":964},{"type":45,"tag":646,"props":1091,"children":1093},{"class":648,"line":1092},10,[1094,1099,1104,1108,1113,1118,1123,1127,1132,1137,1142,1148,1152,1156,1161,1165],{"type":45,"tag":646,"props":1095,"children":1096},{"style":791},[1097],{"type":51,"value":1098},"    if",{"type":45,"tag":646,"props":1100,"children":1101},{"style":884},[1102],{"type":51,"value":1103}," (",{"type":45,"tag":646,"props":1105,"children":1106},{"style":803},[1107],{"type":51,"value":1035},{"type":45,"tag":646,"props":1109,"children":1110},{"style":797},[1111],{"type":51,"value":1112},".",{"type":45,"tag":646,"props":1114,"children":1115},{"style":803},[1116],{"type":51,"value":1117},"count",{"type":45,"tag":646,"props":1119,"children":1120},{"style":797},[1121],{"type":51,"value":1122}," \u003C",{"type":45,"tag":646,"props":1124,"children":1125},{"style":991},[1126],{"type":51,"value":994},{"type":45,"tag":646,"props":1128,"children":1129},{"style":884},[1130],{"type":51,"value":1131},") ",{"type":45,"tag":646,"props":1133,"children":1134},{"style":791},[1135],{"type":51,"value":1136},"throw",{"type":45,"tag":646,"props":1138,"children":1139},{"style":797},[1140],{"type":51,"value":1141}," new",{"type":45,"tag":646,"props":1143,"children":1145},{"style":1144},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[1146],{"type":51,"value":1147}," Error",{"type":45,"tag":646,"props":1149,"children":1150},{"style":884},[1151],{"type":51,"value":1029},{"type":45,"tag":646,"props":1153,"children":1154},{"style":797},[1155],{"type":51,"value":1080},{"type":45,"tag":646,"props":1157,"children":1158},{"style":659},[1159],{"type":51,"value":1160},"Count cannot be negative",{"type":45,"tag":646,"props":1162,"children":1163},{"style":797},[1164],{"type":51,"value":1080},{"type":45,"tag":646,"props":1166,"children":1167},{"style":884},[1168],{"type":51,"value":1169},")\n",{"type":45,"tag":646,"props":1171,"children":1173},{"class":648,"line":1172},11,[1174],{"type":45,"tag":646,"props":1175,"children":1176},{"style":797},[1177],{"type":51,"value":1178},"  }\n",{"type":45,"tag":646,"props":1180,"children":1182},{"class":648,"line":1181},12,[1183],{"type":45,"tag":646,"props":1184,"children":1185},{"emptyLinePlaceholder":855},[1186],{"type":51,"value":858},{"type":45,"tag":646,"props":1188,"children":1190},{"class":648,"line":1189},13,[1191],{"type":45,"tag":646,"props":1192,"children":1193},{"style":670},[1194],{"type":51,"value":1195},"  \u002F\u002F Notification hook - runs after state persists (async, non-blocking)\n",{"type":45,"tag":646,"props":1197,"children":1199},{"class":648,"line":1198},14,[1200,1205,1209,1214,1218,1222,1226,1230,1234,1238,1242,1246,1250,1254,1258],{"type":45,"tag":646,"props":1201,"children":1202},{"style":884},[1203],{"type":51,"value":1204},"  onStateUpdate",{"type":45,"tag":646,"props":1206,"children":1207},{"style":797},[1208],{"type":51,"value":1029},{"type":45,"tag":646,"props":1210,"children":1211},{"style":1032},[1212],{"type":51,"value":1213},"state",{"type":45,"tag":646,"props":1215,"children":1216},{"style":797},[1217],{"type":51,"value":892},{"type":45,"tag":646,"props":1219,"children":1220},{"style":653},[1221],{"type":51,"value":872},{"type":45,"tag":646,"props":1223,"children":1224},{"style":797},[1225],{"type":51,"value":811},{"type":45,"tag":646,"props":1227,"children":1228},{"style":1032},[1229],{"type":51,"value":1052},{"type":45,"tag":646,"props":1231,"children":1232},{"style":797},[1233],{"type":51,"value":892},{"type":45,"tag":646,"props":1235,"children":1236},{"style":653},[1237],{"type":51,"value":1061},{"type":45,"tag":646,"props":1239,"children":1240},{"style":797},[1241],{"type":51,"value":1066},{"type":45,"tag":646,"props":1243,"children":1244},{"style":797},[1245],{"type":51,"value":840},{"type":45,"tag":646,"props":1247,"children":1248},{"style":659},[1249],{"type":51,"value":1075},{"type":45,"tag":646,"props":1251,"children":1252},{"style":797},[1253],{"type":51,"value":1080},{"type":45,"tag":646,"props":1255,"children":1256},{"style":797},[1257],{"type":51,"value":1085},{"type":45,"tag":646,"props":1259,"children":1260},{"style":797},[1261],{"type":51,"value":964},{"type":45,"tag":646,"props":1263,"children":1265},{"class":648,"line":1264},15,[1266,1271,1275,1280,1284,1288,1293,1297,1301,1306],{"type":45,"tag":646,"props":1267,"children":1268},{"style":803},[1269],{"type":51,"value":1270},"    console",{"type":45,"tag":646,"props":1272,"children":1273},{"style":797},[1274],{"type":51,"value":1112},{"type":45,"tag":646,"props":1276,"children":1277},{"style":1144},[1278],{"type":51,"value":1279},"log",{"type":45,"tag":646,"props":1281,"children":1282},{"style":884},[1283],{"type":51,"value":1029},{"type":45,"tag":646,"props":1285,"children":1286},{"style":797},[1287],{"type":51,"value":1080},{"type":45,"tag":646,"props":1289,"children":1290},{"style":659},[1291],{"type":51,"value":1292},"State updated:",{"type":45,"tag":646,"props":1294,"children":1295},{"style":797},[1296],{"type":51,"value":1080},{"type":45,"tag":646,"props":1298,"children":1299},{"style":797},[1300],{"type":51,"value":811},{"type":45,"tag":646,"props":1302,"children":1303},{"style":803},[1304],{"type":51,"value":1305}," state",{"type":45,"tag":646,"props":1307,"children":1308},{"style":884},[1309],{"type":51,"value":1169},{"type":45,"tag":646,"props":1311,"children":1313},{"class":648,"line":1312},16,[1314],{"type":45,"tag":646,"props":1315,"children":1316},{"style":797},[1317],{"type":51,"value":1178},{"type":45,"tag":646,"props":1319,"children":1321},{"class":648,"line":1320},17,[1322],{"type":45,"tag":646,"props":1323,"children":1324},{"emptyLinePlaceholder":855},[1325],{"type":51,"value":858},{"type":45,"tag":646,"props":1327,"children":1329},{"class":648,"line":1328},18,[1330,1335,1340],{"type":45,"tag":646,"props":1331,"children":1332},{"style":797},[1333],{"type":51,"value":1334},"  @",{"type":45,"tag":646,"props":1336,"children":1337},{"style":1144},[1338],{"type":51,"value":1339},"callable",{"type":45,"tag":646,"props":1341,"children":1342},{"style":803},[1343],{"type":51,"value":1344},"()\n",{"type":45,"tag":646,"props":1346,"children":1348},{"class":648,"line":1347},19,[1349,1354,1359],{"type":45,"tag":646,"props":1350,"children":1351},{"style":884},[1352],{"type":51,"value":1353},"  increment",{"type":45,"tag":646,"props":1355,"children":1356},{"style":797},[1357],{"type":51,"value":1358},"()",{"type":45,"tag":646,"props":1360,"children":1361},{"style":797},[1362],{"type":51,"value":964},{"type":45,"tag":646,"props":1364,"children":1366},{"class":648,"line":1365},20,[1367,1372,1376,1380,1385,1389,1393,1398,1402,1406,1410,1415,1420,1424],{"type":45,"tag":646,"props":1368,"children":1369},{"style":797},[1370],{"type":51,"value":1371},"    this.",{"type":45,"tag":646,"props":1373,"children":1374},{"style":1144},[1375],{"type":51,"value":166},{"type":45,"tag":646,"props":1377,"children":1378},{"style":884},[1379],{"type":51,"value":1029},{"type":45,"tag":646,"props":1381,"children":1382},{"style":797},[1383],{"type":51,"value":1384},"{",{"type":45,"tag":646,"props":1386,"children":1387},{"style":884},[1388],{"type":51,"value":887},{"type":45,"tag":646,"props":1390,"children":1391},{"style":797},[1392],{"type":51,"value":892},{"type":45,"tag":646,"props":1394,"children":1395},{"style":797},[1396],{"type":51,"value":1397}," this.",{"type":45,"tag":646,"props":1399,"children":1400},{"style":803},[1401],{"type":51,"value":1213},{"type":45,"tag":646,"props":1403,"children":1404},{"style":797},[1405],{"type":51,"value":1112},{"type":45,"tag":646,"props":1407,"children":1408},{"style":803},[1409],{"type":51,"value":1117},{"type":45,"tag":646,"props":1411,"children":1412},{"style":797},[1413],{"type":51,"value":1414}," +",{"type":45,"tag":646,"props":1416,"children":1417},{"style":991},[1418],{"type":51,"value":1419}," 1",{"type":45,"tag":646,"props":1421,"children":1422},{"style":797},[1423],{"type":51,"value":830},{"type":45,"tag":646,"props":1425,"children":1426},{"style":884},[1427],{"type":51,"value":1169},{"type":45,"tag":646,"props":1429,"children":1431},{"class":648,"line":1430},21,[1432,1437,1441,1445,1449],{"type":45,"tag":646,"props":1433,"children":1434},{"style":791},[1435],{"type":51,"value":1436},"    return",{"type":45,"tag":646,"props":1438,"children":1439},{"style":797},[1440],{"type":51,"value":1397},{"type":45,"tag":646,"props":1442,"children":1443},{"style":803},[1444],{"type":51,"value":1213},{"type":45,"tag":646,"props":1446,"children":1447},{"style":797},[1448],{"type":51,"value":1112},{"type":45,"tag":646,"props":1450,"children":1451},{"style":803},[1452],{"type":51,"value":1453},"count\n",{"type":45,"tag":646,"props":1455,"children":1457},{"class":648,"line":1456},22,[1458],{"type":45,"tag":646,"props":1459,"children":1460},{"style":797},[1461],{"type":51,"value":1178},{"type":45,"tag":646,"props":1463,"children":1465},{"class":648,"line":1464},23,[1466],{"type":45,"tag":646,"props":1467,"children":1468},{"style":797},[1469],{"type":51,"value":770},{"type":45,"tag":646,"props":1471,"children":1473},{"class":648,"line":1472},24,[1474],{"type":45,"tag":646,"props":1475,"children":1476},{"emptyLinePlaceholder":855},[1477],{"type":51,"value":858},{"type":45,"tag":646,"props":1479,"children":1481},{"class":648,"line":1480},25,[1482,1486,1491],{"type":45,"tag":646,"props":1483,"children":1484},{"style":791},[1485],{"type":51,"value":917},{"type":45,"tag":646,"props":1487,"children":1488},{"style":791},[1489],{"type":51,"value":1490}," default",{"type":45,"tag":646,"props":1492,"children":1493},{"style":797},[1494],{"type":51,"value":964},{"type":45,"tag":646,"props":1496,"children":1498},{"class":648,"line":1497},26,[1499,1504,1508,1512,1517,1521,1526,1530,1535,1539,1544,1548,1553,1558,1562,1567,1571,1575,1580,1584,1588,1592,1597,1601,1606,1610,1614],{"type":45,"tag":646,"props":1500,"children":1501},{"style":1144},[1502],{"type":51,"value":1503},"  fetch",{"type":45,"tag":646,"props":1505,"children":1506},{"style":797},[1507],{"type":51,"value":892},{"type":45,"tag":646,"props":1509,"children":1510},{"style":797},[1511],{"type":51,"value":1103},{"type":45,"tag":646,"props":1513,"children":1514},{"style":1032},[1515],{"type":51,"value":1516},"req",{"type":45,"tag":646,"props":1518,"children":1519},{"style":797},[1520],{"type":51,"value":811},{"type":45,"tag":646,"props":1522,"children":1523},{"style":1032},[1524],{"type":51,"value":1525}," env",{"type":45,"tag":646,"props":1527,"children":1528},{"style":797},[1529],{"type":51,"value":1085},{"type":45,"tag":646,"props":1531,"children":1532},{"style":864},[1533],{"type":51,"value":1534}," =>",{"type":45,"tag":646,"props":1536,"children":1537},{"style":1144},[1538],{"type":51,"value":816},{"type":45,"tag":646,"props":1540,"children":1541},{"style":803},[1542],{"type":51,"value":1543},"(req",{"type":45,"tag":646,"props":1545,"children":1546},{"style":797},[1547],{"type":51,"value":811},{"type":45,"tag":646,"props":1549,"children":1550},{"style":803},[1551],{"type":51,"value":1552}," env) ",{"type":45,"tag":646,"props":1554,"children":1555},{"style":797},[1556],{"type":51,"value":1557},"??",{"type":45,"tag":646,"props":1559,"children":1560},{"style":797},[1561],{"type":51,"value":1141},{"type":45,"tag":646,"props":1563,"children":1564},{"style":1144},[1565],{"type":51,"value":1566}," Response",{"type":45,"tag":646,"props":1568,"children":1569},{"style":803},[1570],{"type":51,"value":1029},{"type":45,"tag":646,"props":1572,"children":1573},{"style":797},[1574],{"type":51,"value":1080},{"type":45,"tag":646,"props":1576,"children":1577},{"style":659},[1578],{"type":51,"value":1579},"Not found",{"type":45,"tag":646,"props":1581,"children":1582},{"style":797},[1583],{"type":51,"value":1080},{"type":45,"tag":646,"props":1585,"children":1586},{"style":797},[1587],{"type":51,"value":811},{"type":45,"tag":646,"props":1589,"children":1590},{"style":797},[1591],{"type":51,"value":800},{"type":45,"tag":646,"props":1593,"children":1594},{"style":884},[1595],{"type":51,"value":1596}," status",{"type":45,"tag":646,"props":1598,"children":1599},{"style":797},[1600],{"type":51,"value":892},{"type":45,"tag":646,"props":1602,"children":1603},{"style":991},[1604],{"type":51,"value":1605}," 404",{"type":45,"tag":646,"props":1607,"children":1608},{"style":797},[1609],{"type":51,"value":830},{"type":45,"tag":646,"props":1611,"children":1612},{"style":803},[1613],{"type":51,"value":1085},{"type":45,"tag":646,"props":1615,"children":1616},{"style":797},[1617],{"type":51,"value":1618},",\n",{"type":45,"tag":646,"props":1620,"children":1622},{"class":648,"line":1621},27,[1623],{"type":45,"tag":646,"props":1624,"children":1625},{"style":797},[1626],{"type":51,"value":770},{"type":45,"tag":66,"props":1628,"children":1630},{"id":1629},"routing",[1631],{"type":51,"value":184},{"type":45,"tag":54,"props":1633,"children":1634},{},[1635,1637,1643],{"type":51,"value":1636},"Requests route to ",{"type":45,"tag":78,"props":1638,"children":1640},{"className":1639},[],[1641],{"type":51,"value":1642},"\u002Fagents\u002F{agent-name}\u002F{instance-name}",{"type":51,"value":892},{"type":45,"tag":87,"props":1645,"children":1646},{},[1647,1663],{"type":45,"tag":91,"props":1648,"children":1649},{},[1650],{"type":45,"tag":95,"props":1651,"children":1652},{},[1653,1658],{"type":45,"tag":99,"props":1654,"children":1655},{},[1656],{"type":51,"value":1657},"Class",{"type":45,"tag":99,"props":1659,"children":1660},{},[1661],{"type":51,"value":1662},"URL",{"type":45,"tag":115,"props":1664,"children":1665},{},[1666,1687],{"type":45,"tag":95,"props":1667,"children":1668},{},[1669,1678],{"type":45,"tag":122,"props":1670,"children":1671},{},[1672],{"type":45,"tag":78,"props":1673,"children":1675},{"className":1674},[],[1676],{"type":51,"value":1677},"Counter",{"type":45,"tag":122,"props":1679,"children":1680},{},[1681],{"type":45,"tag":78,"props":1682,"children":1684},{"className":1683},[],[1685],{"type":51,"value":1686},"\u002Fagents\u002Fcounter\u002Fuser-123",{"type":45,"tag":95,"props":1688,"children":1689},{},[1690,1699],{"type":45,"tag":122,"props":1691,"children":1692},{},[1693],{"type":45,"tag":78,"props":1694,"children":1696},{"className":1695},[],[1697],{"type":51,"value":1698},"ChatRoom",{"type":45,"tag":122,"props":1700,"children":1701},{},[1702],{"type":45,"tag":78,"props":1703,"children":1705},{"className":1704},[],[1706],{"type":51,"value":1707},"\u002Fagents\u002Fchat-room\u002Flobby",{"type":45,"tag":54,"props":1709,"children":1710},{},[1711,1713],{"type":51,"value":1712},"Client: ",{"type":45,"tag":78,"props":1714,"children":1716},{"className":1715},[],[1717],{"type":51,"value":1718},"useAgent({ agent: \"Counter\", name: \"user-123\" })",{"type":45,"tag":66,"props":1720,"children":1722},{"id":1721},"core-apis",[1723],{"type":51,"value":1724},"Core APIs",{"type":45,"tag":87,"props":1726,"children":1727},{},[1728,1744],{"type":45,"tag":91,"props":1729,"children":1730},{},[1731],{"type":45,"tag":95,"props":1732,"children":1733},{},[1734,1739],{"type":45,"tag":99,"props":1735,"children":1736},{},[1737],{"type":51,"value":1738},"Task",{"type":45,"tag":99,"props":1740,"children":1741},{},[1742],{"type":51,"value":1743},"API",{"type":45,"tag":115,"props":1745,"children":1746},{},[1747,1764,1781,1798,1815,1832,1849,1866,1883],{"type":45,"tag":95,"props":1748,"children":1749},{},[1750,1755],{"type":45,"tag":122,"props":1751,"children":1752},{},[1753],{"type":51,"value":1754},"Read state",{"type":45,"tag":122,"props":1756,"children":1757},{},[1758],{"type":45,"tag":78,"props":1759,"children":1761},{"className":1760},[],[1762],{"type":51,"value":1763},"this.state.count",{"type":45,"tag":95,"props":1765,"children":1766},{},[1767,1772],{"type":45,"tag":122,"props":1768,"children":1769},{},[1770],{"type":51,"value":1771},"Write state",{"type":45,"tag":122,"props":1773,"children":1774},{},[1775],{"type":45,"tag":78,"props":1776,"children":1778},{"className":1777},[],[1779],{"type":51,"value":1780},"this.setState({ count: 1 })",{"type":45,"tag":95,"props":1782,"children":1783},{},[1784,1789],{"type":45,"tag":122,"props":1785,"children":1786},{},[1787],{"type":51,"value":1788},"SQL query",{"type":45,"tag":122,"props":1790,"children":1791},{},[1792],{"type":45,"tag":78,"props":1793,"children":1795},{"className":1794},[],[1796],{"type":51,"value":1797},"this.sql`SELECT * FROM users WHERE id = ${id}`",{"type":45,"tag":95,"props":1799,"children":1800},{},[1801,1806],{"type":45,"tag":122,"props":1802,"children":1803},{},[1804],{"type":51,"value":1805},"Schedule (delay)",{"type":45,"tag":122,"props":1807,"children":1808},{},[1809],{"type":45,"tag":78,"props":1810,"children":1812},{"className":1811},[],[1813],{"type":51,"value":1814},"await this.schedule(60, \"task\", payload)",{"type":45,"tag":95,"props":1816,"children":1817},{},[1818,1823],{"type":45,"tag":122,"props":1819,"children":1820},{},[1821],{"type":51,"value":1822},"Schedule (cron)",{"type":45,"tag":122,"props":1824,"children":1825},{},[1826],{"type":45,"tag":78,"props":1827,"children":1829},{"className":1828},[],[1830],{"type":51,"value":1831},"await this.schedule(\"0 * * * *\", \"task\", payload)",{"type":45,"tag":95,"props":1833,"children":1834},{},[1835,1840],{"type":45,"tag":122,"props":1836,"children":1837},{},[1838],{"type":51,"value":1839},"Schedule (interval)",{"type":45,"tag":122,"props":1841,"children":1842},{},[1843],{"type":45,"tag":78,"props":1844,"children":1846},{"className":1845},[],[1847],{"type":51,"value":1848},"await this.scheduleEvery(30, \"poll\")",{"type":45,"tag":95,"props":1850,"children":1851},{},[1852,1857],{"type":45,"tag":122,"props":1853,"children":1854},{},[1855],{"type":51,"value":1856},"RPC method",{"type":45,"tag":122,"props":1858,"children":1859},{},[1860],{"type":45,"tag":78,"props":1861,"children":1863},{"className":1862},[],[1864],{"type":51,"value":1865},"@callable() myMethod() { ... }",{"type":45,"tag":95,"props":1867,"children":1868},{},[1869,1874],{"type":45,"tag":122,"props":1870,"children":1871},{},[1872],{"type":51,"value":1873},"Streaming RPC",{"type":45,"tag":122,"props":1875,"children":1876},{},[1877],{"type":45,"tag":78,"props":1878,"children":1880},{"className":1879},[],[1881],{"type":51,"value":1882},"@callable({ streaming: true }) stream(res) { ... }",{"type":45,"tag":95,"props":1884,"children":1885},{},[1886,1891],{"type":45,"tag":122,"props":1887,"children":1888},{},[1889],{"type":51,"value":1890},"Start workflow",{"type":45,"tag":122,"props":1892,"children":1893},{},[1894],{"type":45,"tag":78,"props":1895,"children":1897},{"className":1896},[],[1898],{"type":51,"value":1899},"await this.runWorkflow(\"ProcessingWorkflow\", params)",{"type":45,"tag":66,"props":1901,"children":1903},{"id":1902},"react-client",[1904],{"type":51,"value":1905},"React Client",{"type":45,"tag":635,"props":1907,"children":1911},{"className":1908,"code":1909,"language":1910,"meta":640,"style":640},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { useAgent } from \"agents\u002Freact\"\n\nfunction App() {\n  const [state, setLocalState] = useState({ count: 0 })\n\n  const agent = useAgent({\n    agent: \"Counter\",\n    name: \"my-instance\",\n    onStateUpdate: (newState) => setLocalState(newState),\n    onIdentity: (name, agentType) => console.log(`Connected to ${name}`),\n  })\n\n  return \u003Cbutton onClick={() => agent.setState({ count: state.count + 1 })}>Count: {state.count}\u003C\u002Fbutton>\n}\n","tsx",[1912],{"type":45,"tag":78,"props":1913,"children":1914},{"__ignoreMap":640},[1915,1952,1959,1980,2048,2055,2083,2111,2140,2189,2276,2288,2295,2424],{"type":45,"tag":646,"props":1916,"children":1917},{"class":648,"line":649},[1918,1922,1926,1931,1935,1939,1943,1948],{"type":45,"tag":646,"props":1919,"children":1920},{"style":791},[1921],{"type":51,"value":794},{"type":45,"tag":646,"props":1923,"children":1924},{"style":797},[1925],{"type":51,"value":800},{"type":45,"tag":646,"props":1927,"children":1928},{"style":803},[1929],{"type":51,"value":1930}," useAgent",{"type":45,"tag":646,"props":1932,"children":1933},{"style":797},[1934],{"type":51,"value":830},{"type":45,"tag":646,"props":1936,"children":1937},{"style":791},[1938],{"type":51,"value":835},{"type":45,"tag":646,"props":1940,"children":1941},{"style":797},[1942],{"type":51,"value":840},{"type":45,"tag":646,"props":1944,"children":1945},{"style":659},[1946],{"type":51,"value":1947},"agents\u002Freact",{"type":45,"tag":646,"props":1949,"children":1950},{"style":797},[1951],{"type":51,"value":849},{"type":45,"tag":646,"props":1953,"children":1954},{"class":648,"line":728},[1955],{"type":45,"tag":646,"props":1956,"children":1957},{"emptyLinePlaceholder":855},[1958],{"type":51,"value":858},{"type":45,"tag":646,"props":1960,"children":1961},{"class":648,"line":737},[1962,1967,1972,1976],{"type":45,"tag":646,"props":1963,"children":1964},{"style":864},[1965],{"type":51,"value":1966},"function",{"type":45,"tag":646,"props":1968,"children":1969},{"style":1144},[1970],{"type":51,"value":1971}," App",{"type":45,"tag":646,"props":1973,"children":1974},{"style":797},[1975],{"type":51,"value":1358},{"type":45,"tag":646,"props":1977,"children":1978},{"style":797},[1979],{"type":51,"value":964},{"type":45,"tag":646,"props":1981,"children":1982},{"class":648,"line":746},[1983,1988,1993,1997,2001,2006,2011,2015,2020,2024,2028,2032,2036,2040,2044],{"type":45,"tag":646,"props":1984,"children":1985},{"style":864},[1986],{"type":51,"value":1987},"  const",{"type":45,"tag":646,"props":1989,"children":1990},{"style":797},[1991],{"type":51,"value":1992}," [",{"type":45,"tag":646,"props":1994,"children":1995},{"style":803},[1996],{"type":51,"value":1213},{"type":45,"tag":646,"props":1998,"children":1999},{"style":797},[2000],{"type":51,"value":811},{"type":45,"tag":646,"props":2002,"children":2003},{"style":803},[2004],{"type":51,"value":2005}," setLocalState",{"type":45,"tag":646,"props":2007,"children":2008},{"style":797},[2009],{"type":51,"value":2010},"]",{"type":45,"tag":646,"props":2012,"children":2013},{"style":797},[2014],{"type":51,"value":877},{"type":45,"tag":646,"props":2016,"children":2017},{"style":1144},[2018],{"type":51,"value":2019}," useState",{"type":45,"tag":646,"props":2021,"children":2022},{"style":884},[2023],{"type":51,"value":1029},{"type":45,"tag":646,"props":2025,"children":2026},{"style":797},[2027],{"type":51,"value":1384},{"type":45,"tag":646,"props":2029,"children":2030},{"style":884},[2031],{"type":51,"value":887},{"type":45,"tag":646,"props":2033,"children":2034},{"style":797},[2035],{"type":51,"value":892},{"type":45,"tag":646,"props":2037,"children":2038},{"style":991},[2039],{"type":51,"value":994},{"type":45,"tag":646,"props":2041,"children":2042},{"style":797},[2043],{"type":51,"value":830},{"type":45,"tag":646,"props":2045,"children":2046},{"style":884},[2047],{"type":51,"value":1169},{"type":45,"tag":646,"props":2049,"children":2050},{"class":648,"line":755},[2051],{"type":45,"tag":646,"props":2052,"children":2053},{"emptyLinePlaceholder":855},[2054],{"type":51,"value":858},{"type":45,"tag":646,"props":2056,"children":2057},{"class":648,"line":764},[2058,2062,2067,2071,2075,2079],{"type":45,"tag":646,"props":2059,"children":2060},{"style":864},[2061],{"type":51,"value":1987},{"type":45,"tag":646,"props":2063,"children":2064},{"style":803},[2065],{"type":51,"value":2066}," agent",{"type":45,"tag":646,"props":2068,"children":2069},{"style":797},[2070],{"type":51,"value":877},{"type":45,"tag":646,"props":2072,"children":2073},{"style":1144},[2074],{"type":51,"value":1930},{"type":45,"tag":646,"props":2076,"children":2077},{"style":884},[2078],{"type":51,"value":1029},{"type":45,"tag":646,"props":2080,"children":2081},{"style":797},[2082],{"type":51,"value":725},{"type":45,"tag":646,"props":2084,"children":2085},{"class":648,"line":1001},[2086,2091,2095,2099,2103,2107],{"type":45,"tag":646,"props":2087,"children":2088},{"style":884},[2089],{"type":51,"value":2090},"    agent",{"type":45,"tag":646,"props":2092,"children":2093},{"style":797},[2094],{"type":51,"value":892},{"type":45,"tag":646,"props":2096,"children":2097},{"style":797},[2098],{"type":51,"value":840},{"type":45,"tag":646,"props":2100,"children":2101},{"style":659},[2102],{"type":51,"value":1677},{"type":45,"tag":646,"props":2104,"children":2105},{"style":797},[2106],{"type":51,"value":1080},{"type":45,"tag":646,"props":2108,"children":2109},{"style":797},[2110],{"type":51,"value":1618},{"type":45,"tag":646,"props":2112,"children":2113},{"class":648,"line":1009},[2114,2119,2123,2127,2132,2136],{"type":45,"tag":646,"props":2115,"children":2116},{"style":884},[2117],{"type":51,"value":2118},"    name",{"type":45,"tag":646,"props":2120,"children":2121},{"style":797},[2122],{"type":51,"value":892},{"type":45,"tag":646,"props":2124,"children":2125},{"style":797},[2126],{"type":51,"value":840},{"type":45,"tag":646,"props":2128,"children":2129},{"style":659},[2130],{"type":51,"value":2131},"my-instance",{"type":45,"tag":646,"props":2133,"children":2134},{"style":797},[2135],{"type":51,"value":1080},{"type":45,"tag":646,"props":2137,"children":2138},{"style":797},[2139],{"type":51,"value":1618},{"type":45,"tag":646,"props":2141,"children":2142},{"class":648,"line":1018},[2143,2148,2152,2156,2161,2165,2169,2173,2177,2181,2185],{"type":45,"tag":646,"props":2144,"children":2145},{"style":1144},[2146],{"type":51,"value":2147},"    onStateUpdate",{"type":45,"tag":646,"props":2149,"children":2150},{"style":797},[2151],{"type":51,"value":892},{"type":45,"tag":646,"props":2153,"children":2154},{"style":797},[2155],{"type":51,"value":1103},{"type":45,"tag":646,"props":2157,"children":2158},{"style":1032},[2159],{"type":51,"value":2160},"newState",{"type":45,"tag":646,"props":2162,"children":2163},{"style":797},[2164],{"type":51,"value":1085},{"type":45,"tag":646,"props":2166,"children":2167},{"style":864},[2168],{"type":51,"value":1534},{"type":45,"tag":646,"props":2170,"children":2171},{"style":1144},[2172],{"type":51,"value":2005},{"type":45,"tag":646,"props":2174,"children":2175},{"style":884},[2176],{"type":51,"value":1029},{"type":45,"tag":646,"props":2178,"children":2179},{"style":803},[2180],{"type":51,"value":2160},{"type":45,"tag":646,"props":2182,"children":2183},{"style":884},[2184],{"type":51,"value":1085},{"type":45,"tag":646,"props":2186,"children":2187},{"style":797},[2188],{"type":51,"value":1618},{"type":45,"tag":646,"props":2190,"children":2191},{"class":648,"line":1092},[2192,2197,2201,2205,2210,2214,2219,2223,2227,2232,2236,2240,2244,2249,2254,2259,2263,2268,2272],{"type":45,"tag":646,"props":2193,"children":2194},{"style":1144},[2195],{"type":51,"value":2196},"    onIdentity",{"type":45,"tag":646,"props":2198,"children":2199},{"style":797},[2200],{"type":51,"value":892},{"type":45,"tag":646,"props":2202,"children":2203},{"style":797},[2204],{"type":51,"value":1103},{"type":45,"tag":646,"props":2206,"children":2207},{"style":1032},[2208],{"type":51,"value":2209},"name",{"type":45,"tag":646,"props":2211,"children":2212},{"style":797},[2213],{"type":51,"value":811},{"type":45,"tag":646,"props":2215,"children":2216},{"style":1032},[2217],{"type":51,"value":2218}," agentType",{"type":45,"tag":646,"props":2220,"children":2221},{"style":797},[2222],{"type":51,"value":1085},{"type":45,"tag":646,"props":2224,"children":2225},{"style":864},[2226],{"type":51,"value":1534},{"type":45,"tag":646,"props":2228,"children":2229},{"style":803},[2230],{"type":51,"value":2231}," console",{"type":45,"tag":646,"props":2233,"children":2234},{"style":797},[2235],{"type":51,"value":1112},{"type":45,"tag":646,"props":2237,"children":2238},{"style":1144},[2239],{"type":51,"value":1279},{"type":45,"tag":646,"props":2241,"children":2242},{"style":884},[2243],{"type":51,"value":1029},{"type":45,"tag":646,"props":2245,"children":2246},{"style":797},[2247],{"type":51,"value":2248},"`",{"type":45,"tag":646,"props":2250,"children":2251},{"style":659},[2252],{"type":51,"value":2253},"Connected to ",{"type":45,"tag":646,"props":2255,"children":2256},{"style":797},[2257],{"type":51,"value":2258},"${",{"type":45,"tag":646,"props":2260,"children":2261},{"style":803},[2262],{"type":51,"value":2209},{"type":45,"tag":646,"props":2264,"children":2265},{"style":797},[2266],{"type":51,"value":2267},"}`",{"type":45,"tag":646,"props":2269,"children":2270},{"style":884},[2271],{"type":51,"value":1085},{"type":45,"tag":646,"props":2273,"children":2274},{"style":797},[2275],{"type":51,"value":1618},{"type":45,"tag":646,"props":2277,"children":2278},{"class":648,"line":1172},[2279,2284],{"type":45,"tag":646,"props":2280,"children":2281},{"style":797},[2282],{"type":51,"value":2283},"  }",{"type":45,"tag":646,"props":2285,"children":2286},{"style":884},[2287],{"type":51,"value":1169},{"type":45,"tag":646,"props":2289,"children":2290},{"class":648,"line":1181},[2291],{"type":45,"tag":646,"props":2292,"children":2293},{"emptyLinePlaceholder":855},[2294],{"type":51,"value":858},{"type":45,"tag":646,"props":2296,"children":2297},{"class":648,"line":1189},[2298,2303,2307,2312,2317,2322,2326,2330,2334,2338,2342,2346,2350,2354,2358,2362,2367,2372,2376,2380,2384,2389,2394,2398,2402,2406,2410,2415,2419],{"type":45,"tag":646,"props":2299,"children":2300},{"style":791},[2301],{"type":51,"value":2302},"  return",{"type":45,"tag":646,"props":2304,"children":2305},{"style":797},[2306],{"type":51,"value":1122},{"type":45,"tag":646,"props":2308,"children":2309},{"style":884},[2310],{"type":51,"value":2311},"button",{"type":45,"tag":646,"props":2313,"children":2314},{"style":864},[2315],{"type":51,"value":2316}," onClick",{"type":45,"tag":646,"props":2318,"children":2319},{"style":797},[2320],{"type":51,"value":2321},"={()",{"type":45,"tag":646,"props":2323,"children":2324},{"style":864},[2325],{"type":51,"value":1534},{"type":45,"tag":646,"props":2327,"children":2328},{"style":803},[2329],{"type":51,"value":2066},{"type":45,"tag":646,"props":2331,"children":2332},{"style":797},[2333],{"type":51,"value":1112},{"type":45,"tag":646,"props":2335,"children":2336},{"style":1144},[2337],{"type":51,"value":166},{"type":45,"tag":646,"props":2339,"children":2340},{"style":803},[2341],{"type":51,"value":1029},{"type":45,"tag":646,"props":2343,"children":2344},{"style":797},[2345],{"type":51,"value":1384},{"type":45,"tag":646,"props":2347,"children":2348},{"style":884},[2349],{"type":51,"value":887},{"type":45,"tag":646,"props":2351,"children":2352},{"style":797},[2353],{"type":51,"value":892},{"type":45,"tag":646,"props":2355,"children":2356},{"style":803},[2357],{"type":51,"value":1305},{"type":45,"tag":646,"props":2359,"children":2360},{"style":797},[2361],{"type":51,"value":1112},{"type":45,"tag":646,"props":2363,"children":2364},{"style":803},[2365],{"type":51,"value":2366},"count ",{"type":45,"tag":646,"props":2368,"children":2369},{"style":797},[2370],{"type":51,"value":2371},"+",{"type":45,"tag":646,"props":2373,"children":2374},{"style":991},[2375],{"type":51,"value":1419},{"type":45,"tag":646,"props":2377,"children":2378},{"style":797},[2379],{"type":51,"value":830},{"type":45,"tag":646,"props":2381,"children":2382},{"style":803},[2383],{"type":51,"value":1085},{"type":45,"tag":646,"props":2385,"children":2386},{"style":797},[2387],{"type":51,"value":2388},"}>",{"type":45,"tag":646,"props":2390,"children":2391},{"style":803},[2392],{"type":51,"value":2393},"Count: ",{"type":45,"tag":646,"props":2395,"children":2396},{"style":797},[2397],{"type":51,"value":1384},{"type":45,"tag":646,"props":2399,"children":2400},{"style":803},[2401],{"type":51,"value":1213},{"type":45,"tag":646,"props":2403,"children":2404},{"style":797},[2405],{"type":51,"value":1112},{"type":45,"tag":646,"props":2407,"children":2408},{"style":803},[2409],{"type":51,"value":1117},{"type":45,"tag":646,"props":2411,"children":2412},{"style":797},[2413],{"type":51,"value":2414},"}\u003C\u002F",{"type":45,"tag":646,"props":2416,"children":2417},{"style":884},[2418],{"type":51,"value":2311},{"type":45,"tag":646,"props":2420,"children":2421},{"style":797},[2422],{"type":51,"value":2423},">\n",{"type":45,"tag":646,"props":2425,"children":2426},{"class":648,"line":1198},[2427],{"type":45,"tag":646,"props":2428,"children":2429},{"style":797},[2430],{"type":51,"value":770},{"type":45,"tag":66,"props":2432,"children":2434},{"id":2433},"references",[2435],{"type":51,"value":2436},"References",{"type":45,"tag":501,"props":2438,"children":2439},{},[2440,2453,2466,2479,2492,2505,2518],{"type":45,"tag":505,"props":2441,"children":2442},{},[2443,2451],{"type":45,"tag":58,"props":2444,"children":2445},{},[2446],{"type":45,"tag":482,"props":2447,"children":2449},{"href":2448},"references\u002Fworkflows.md",[2450],{"type":51,"value":2448},{"type":51,"value":2452}," - Durable Workflows integration",{"type":45,"tag":505,"props":2454,"children":2455},{},[2456,2464],{"type":45,"tag":58,"props":2457,"children":2458},{},[2459],{"type":45,"tag":482,"props":2460,"children":2462},{"href":2461},"references\u002Fcallable.md",[2463],{"type":51,"value":2461},{"type":51,"value":2465}," - RPC methods, streaming, timeouts",{"type":45,"tag":505,"props":2467,"children":2468},{},[2469,2477],{"type":45,"tag":58,"props":2470,"children":2471},{},[2472],{"type":45,"tag":482,"props":2473,"children":2475},{"href":2474},"references\u002Fstate-scheduling.md",[2476],{"type":51,"value":2474},{"type":51,"value":2478}," - State persistence, scheduling",{"type":45,"tag":505,"props":2480,"children":2481},{},[2482,2490],{"type":45,"tag":58,"props":2483,"children":2484},{},[2485],{"type":45,"tag":482,"props":2486,"children":2488},{"href":2487},"references\u002Fstreaming-chat.md",[2489],{"type":51,"value":2487},{"type":51,"value":2491}," - AIChatAgent, resumable streams",{"type":45,"tag":505,"props":2493,"children":2494},{},[2495,2503],{"type":45,"tag":58,"props":2496,"children":2497},{},[2498],{"type":45,"tag":482,"props":2499,"children":2501},{"href":2500},"references\u002Fmcp.md",[2502],{"type":51,"value":2500},{"type":51,"value":2504}," - MCP server integration",{"type":45,"tag":505,"props":2506,"children":2507},{},[2508,2516],{"type":45,"tag":58,"props":2509,"children":2510},{},[2511],{"type":45,"tag":482,"props":2512,"children":2514},{"href":2513},"references\u002Femail.md",[2515],{"type":51,"value":2513},{"type":51,"value":2517}," - Email routing and handling",{"type":45,"tag":505,"props":2519,"children":2520},{},[2521,2529],{"type":45,"tag":58,"props":2522,"children":2523},{},[2524],{"type":45,"tag":482,"props":2525,"children":2527},{"href":2526},"references\u002Fcodemode.md",[2528],{"type":51,"value":2526},{"type":51,"value":2530}," - Code Mode (experimental)",{"type":45,"tag":2532,"props":2533,"children":2534},"style",{},[2535],{"type":51,"value":2536},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2538,"total":737},[2539,2547,2560],{"slug":4,"name":4,"fn":5,"description":6,"org":2540,"tags":2541,"stars":28,"repoUrl":29,"updatedAt":30},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2542,2543,2544,2545,2546],{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"name":26,"slug":27,"type":15},{"name":23,"slug":24,"type":15},{"slug":2548,"name":2548,"fn":2549,"description":2550,"org":2551,"tags":2552,"stars":28,"repoUrl":29,"updatedAt":2559},"browser-execute","execute browser automation tasks","Use ONLY when calling the `browser_execute` tool or driving a real browser via the Chrome DevTools Protocol. Required reading before the first `browser_execute` call in a session. Covers the three connection methods (local Chrome with remote debugging, isolated debug-port profile, Browser Use cloud), the in-process `session` \u002F `console` snippet model, attaching to a page target, common CDP commands, the per-project `.bcode\u002Fagent-workspace\u002F` for reusable scripts, and screenshot auto-attachment.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2553,2556],{"name":2554,"slug":2555,"type":15},"Browser Automation","browser-automation",{"name":2557,"slug":2558,"type":15},"Debugging","debugging","2026-07-31T05:55:46.960752",{"slug":2561,"name":2561,"fn":2562,"description":2563,"org":2564,"tags":2565,"stars":28,"repoUrl":29,"updatedAt":2576},"cloudflare","manage Cloudflare platform resources","Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum), security (WAF, DDoS), and infrastructure-as-code (Terraform, Pulumi). Use for any Cloudflare development task.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2566,2567,2569,2572,2575],{"name":20,"slug":21,"type":15},{"name":2568,"slug":2561,"type":15},"Cloudflare",{"name":2570,"slug":2571,"type":15},"Database","database",{"name":2573,"slug":2574,"type":15},"Security","security",{"name":23,"slug":24,"type":15},"2026-04-27T05:34:21.032189",{"items":2578,"total":1189},[2579,2594,2608,2618,2629,2648,2669,2682,2699,2715,2723,2728],{"slug":8,"name":8,"fn":2580,"description":2581,"org":2582,"tags":2583,"stars":2591,"repoUrl":2592,"updatedAt":2593},"automate browser interactions","Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site\u002Fapp work.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2584,2587,2588],{"name":2585,"slug":2586,"type":15},"Automation","automation",{"name":2554,"slug":2555,"type":15},{"name":2589,"slug":2590,"type":15},"Web Scraping","web-scraping",106789,"https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fbrowser-use","2026-07-28T05:35:58.143842",{"slug":2595,"name":2595,"fn":2596,"description":2597,"org":2598,"tags":2599,"stars":2591,"repoUrl":2592,"updatedAt":2607},"cloud","use Browser Use Cloud API","Documentation reference for using Browser Use Cloud — the hosted API and SDK for browser automation. Use this skill whenever the user needs help with the Cloud REST API (v2 or v3), browser-use-sdk (Python or TypeScript), X-Browser-Use-API-Key authentication, cloud sessions, browser profiles, profile sync, CDP WebSocket connections, stealth browsers, residential proxies, CAPTCHA handling, webhooks, workspaces, skills marketplace, liveUrl streaming, pricing, or integration patterns (chat UI, subagent, adding browser tools to existing agents). Also trigger for questions about n8n\u002FMake\u002FZapier integration, Playwright\u002F Puppeteer\u002FSelenium on cloud infrastructure, or 1Password vault integration. Do NOT use this for the open-source Python library (Agent, Browser, Tools config) — use the open-source skill instead.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2600,2601,2604],{"name":2554,"slug":2555,"type":15},{"name":2602,"slug":2603,"type":15},"Python","python",{"name":2605,"slug":2606,"type":15},"REST API","rest-api","2026-04-06T18:06:10.225871",{"slug":2609,"name":2609,"fn":2610,"description":2611,"org":2612,"tags":2613,"stars":2591,"repoUrl":2592,"updatedAt":2617},"open-source","write browser-use Python code","Documentation reference for writing Python code using the browser-use open-source library. Use this skill whenever the user needs help with Agent, Browser, or Tools configuration, is writing code that imports from browser_use, asks about @sandbox deployment, supported LLM models, Actor API, custom tools, lifecycle hooks, MCP server setup, or monitoring\u002Fobservability with Laminar or OpenLIT. Also trigger for questions about browser-use installation, prompting strategies, or sensitive data handling. Do NOT use this for Cloud API\u002FSDK usage or pricing — use the cloud skill instead. Do NOT use this for directly automating a browser via CLI commands — use the browser-use skill instead.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2614,2615,2616],{"name":2585,"slug":2586,"type":15},{"name":2554,"slug":2555,"type":15},{"name":2602,"slug":2603,"type":15},"2026-04-06T18:06:14.102374",{"slug":2619,"name":2619,"fn":2620,"description":2621,"org":2622,"tags":2623,"stars":2591,"repoUrl":2592,"updatedAt":2628},"remote-browser","control a local browser from a sandbox","Controls a local browser from a sandboxed remote machine. Use when the agent is running in a sandbox (no GUI) and needs to navigate websites, interact with web pages, fill forms, take screenshots, or expose local dev servers via tunnels.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2624,2625],{"name":2554,"slug":2555,"type":15},{"name":2626,"slug":2627,"type":15},"Sandboxing","sandboxing","2026-04-06T18:06:12.842351",{"slug":2630,"name":2630,"fn":2631,"description":2632,"org":2633,"tags":2634,"stars":2591,"repoUrl":2592,"updatedAt":2647},"x402","configure x402 payments for Browser Use Cloud","Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — \"just use it\" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing touches your codebase) or \"build it in\" (install the SDK and write the key + code into your project). Walks through wallet setup, funding, .env, and a ~$1 test run. Use when the user asks about x402, pay-per-use, USDC payments, or wants Browser Use Cloud without an API key. For the free-tier signup (reverse-CAPTCHA → API key), use `browser-use cloud signup` or the `cloud` skill instead.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2635,2636,2639,2640,2643,2646],{"name":2585,"slug":2586,"type":15},{"name":2637,"slug":2638,"type":15},"Base","base",{"name":2554,"slug":2555,"type":15},{"name":2641,"slug":2642,"type":15},"Payments","payments",{"name":2644,"slug":2645,"type":15},"Web3","web3",{"name":2630,"slug":2630,"type":15},"2026-06-02T07:51:20.889935",{"slug":2649,"name":2649,"fn":2650,"description":2651,"org":2652,"tags":2653,"stars":2666,"repoUrl":2667,"updatedAt":2668},"manim-video","create technical animations with Manim","Production pipeline for mathematical and technical animations using Manim Community Edition. Creates 3Blue1Brown-style explainer videos, algorithm visualizations, equation derivations, architecture diagrams, and data stories. Use when users request: animated explanations, math animations, concept visualizations, algorithm walkthroughs, technical explainers, 3Blue1Brown style videos, or any programmatic animation with geometric\u002Fmathematical content.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2654,2657,2660,2663],{"name":2655,"slug":2656,"type":15},"Animation","animation",{"name":2658,"slug":2659,"type":15},"Creative","creative",{"name":2661,"slug":2662,"type":15},"Mathematics","mathematics",{"name":2664,"slug":2665,"type":15},"Video","video",17171,"https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fvideo-use","2026-04-16T05:01:44.229054",{"slug":2670,"name":2670,"fn":2671,"description":2672,"org":2673,"tags":2674,"stars":2666,"repoUrl":2667,"updatedAt":2681},"video-use","edit and process videos via conversation","Edit any video by conversation. Transcribe, cut, color grade, generate overlay animations, burn subtitles — for talking heads, montages, tutorials, travel, interviews. No presets, no menus. Ask questions, confirm the plan, execute, iterate, persist. Production-correctness rules are hard; everything else is artistic freedom.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2675,2676,2677,2680],{"name":2655,"slug":2656,"type":15},{"name":2658,"slug":2659,"type":15},{"name":2678,"slug":2679,"type":15},"Transcription","transcription",{"name":2664,"slug":2665,"type":15},"2026-04-16T12:17:10.522375",{"slug":2683,"name":2683,"fn":2684,"description":2685,"org":2686,"tags":2687,"stars":2696,"repoUrl":2697,"updatedAt":2698},"browser-use-terminal","automate web interactions via CLI","Direct browser control via the Browser Use Terminal CLI. Use when the user wants to automate, scrape, test, or interact with web pages — you drive the browser yourself with Python helpers.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2688,2689,2692,2693],{"name":2554,"slug":2555,"type":15},{"name":2690,"slug":2691,"type":15},"CLI","cli",{"name":2602,"slug":2603,"type":15},{"name":2694,"slug":2695,"type":15},"Web Development","web-development",607,"https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fterminal","2026-06-12T08:15:38.34797",{"slug":2700,"name":2700,"fn":2701,"description":2702,"org":2703,"tags":2704,"stars":2712,"repoUrl":2713,"updatedAt":2714},"cdp","drive Chrome via DevTools Protocol","Drive Chrome via the DevTools Protocol from JavaScript. Run JS snippets through the `browser-harness-js` CLI — it auto-spawns a long-lived bun HTTP server holding a fully-typed CDP `Session`, and every call (`browser-harness-js 'await session.Page.navigate(...)'`) executes against the same persistent connection. Session, active target, and globals survive across calls. Use when the user wants to automate, script, or inspect a Chrome browser via CDP — single tab or multi-tab, attach to existing Chrome or to a new one launched with --remote-debugging-port.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2705,2706,2709],{"name":2554,"slug":2555,"type":15},{"name":2707,"slug":2708,"type":15},"JavaScript","javascript",{"name":2710,"slug":2711,"type":15},"Testing","testing",473,"https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fbrowser-harness-js","2026-04-21T04:55:40.331082",{"slug":4,"name":4,"fn":5,"description":6,"org":2716,"tags":2717,"stars":28,"repoUrl":29,"updatedAt":30},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2718,2719,2720,2721,2722],{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"name":26,"slug":27,"type":15},{"name":23,"slug":24,"type":15},{"slug":2548,"name":2548,"fn":2549,"description":2550,"org":2724,"tags":2725,"stars":28,"repoUrl":29,"updatedAt":2559},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2726,2727],{"name":2554,"slug":2555,"type":15},{"name":2557,"slug":2558,"type":15},{"slug":2561,"name":2561,"fn":2562,"description":2563,"org":2729,"tags":2730,"stars":28,"repoUrl":29,"updatedAt":2576},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2731,2732,2733,2734,2735],{"name":20,"slug":21,"type":15},{"name":2568,"slug":2561,"type":15},{"name":2570,"slug":2571,"type":15},{"name":2573,"slug":2574,"type":15},{"name":23,"slug":24,"type":15}]