[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-openai-agents-sdk":3,"mdc-cl1rc6-key":39,"related-org-openai-agents-sdk":2594,"related-repo-openai-agents-sdk":2799},{"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. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"openai","OpenAI","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fopenai.png",[12,16,19,22,25],{"name":13,"slug":14,"type":15},"Cloudflare Workers","cloudflare-workers","tag",{"name":17,"slug":18,"type":15},"WebSockets","websockets",{"name":20,"slug":21,"type":15},"Agents","agents",{"name":23,"slug":24,"type":15},"Serverless","serverless",{"name":26,"slug":27,"type":15},"SDK","sdk",3992,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fplugins","2026-04-06T18:39:51.717063",null,465,[],{"repoUrl":29,"stars":28,"forks":32,"topics":35,"description":36},[],"OpenAI Plugins","https:\u002F\u002Fgithub.com\u002Fopenai\u002Fplugins\u002Ftree\u002FHEAD\u002Fplugins\u002Fcloudflare\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. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.\n---\n\n# Cloudflare Agents SDK\n\nYour knowledge of the Agents SDK may be outdated. **Prefer retrieval over pre-training** for any Agents SDK task.\n\n## Retrieval Sources\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```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 (\n    \u003Cbutton onClick={() => agent.setState({ count: state.count + 1 })}>\n      Count: {state.count}\n    \u003C\u002Fbutton>\n  );\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,67,74,88,478,491,497,502,630,636,676,681,705,711,773,779,1644,1649,1661,1725,1736,1742,1917,1923,2488,2494,2588],{"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,59,65],{"type":51,"value":58},"Your knowledge of the Agents SDK may be outdated. ",{"type":45,"tag":60,"props":61,"children":62},"strong",{},[63],{"type":51,"value":64},"Prefer retrieval over pre-training",{"type":51,"value":66}," for any Agents SDK task.",{"type":45,"tag":68,"props":69,"children":71},"h2",{"id":70},"retrieval-sources",[72],{"type":51,"value":73},"Retrieval Sources",{"type":45,"tag":54,"props":75,"children":76},{},[77,79,86],{"type":51,"value":78},"Fetch current docs from ",{"type":45,"tag":80,"props":81,"children":83},"code",{"className":82},[],[84],{"type":51,"value":85},"https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Ftree\u002Fmain\u002Fdocs",{"type":51,"value":87}," before implementing.",{"type":45,"tag":89,"props":90,"children":91},"table",{},[92,116],{"type":45,"tag":93,"props":94,"children":95},"thead",{},[96],{"type":45,"tag":97,"props":98,"children":99},"tr",{},[100,106,111],{"type":45,"tag":101,"props":102,"children":103},"th",{},[104],{"type":51,"value":105},"Topic",{"type":45,"tag":101,"props":107,"children":108},{},[109],{"type":51,"value":110},"Doc",{"type":45,"tag":101,"props":112,"children":113},{},[114],{"type":51,"value":115},"Use for",{"type":45,"tag":117,"props":118,"children":119},"tbody",{},[120,143,179,214,242,277,305,327,349,371,399,434,456],{"type":45,"tag":97,"props":121,"children":122},{},[123,129,138],{"type":45,"tag":124,"props":125,"children":126},"td",{},[127],{"type":51,"value":128},"Getting started",{"type":45,"tag":124,"props":130,"children":131},{},[132],{"type":45,"tag":80,"props":133,"children":135},{"className":134},[],[136],{"type":51,"value":137},"docs\u002Fgetting-started.md",{"type":45,"tag":124,"props":139,"children":140},{},[141],{"type":51,"value":142},"First agent, project setup",{"type":45,"tag":97,"props":144,"children":145},{},[146,151,160],{"type":45,"tag":124,"props":147,"children":148},{},[149],{"type":51,"value":150},"State",{"type":45,"tag":124,"props":152,"children":153},{},[154],{"type":45,"tag":80,"props":155,"children":157},{"className":156},[],[158],{"type":51,"value":159},"docs\u002Fstate.md",{"type":45,"tag":124,"props":161,"children":162},{},[163,169,171,177],{"type":45,"tag":80,"props":164,"children":166},{"className":165},[],[167],{"type":51,"value":168},"setState",{"type":51,"value":170},", ",{"type":45,"tag":80,"props":172,"children":174},{"className":173},[],[175],{"type":51,"value":176},"validateStateChange",{"type":51,"value":178},", persistence",{"type":45,"tag":97,"props":180,"children":181},{},[182,187,196],{"type":45,"tag":124,"props":183,"children":184},{},[185],{"type":51,"value":186},"Routing",{"type":45,"tag":124,"props":188,"children":189},{},[190],{"type":45,"tag":80,"props":191,"children":193},{"className":192},[],[194],{"type":51,"value":195},"docs\u002Frouting.md",{"type":45,"tag":124,"props":197,"children":198},{},[199,201,207,208],{"type":51,"value":200},"URL patterns, ",{"type":45,"tag":80,"props":202,"children":204},{"className":203},[],[205],{"type":51,"value":206},"routeAgentRequest",{"type":51,"value":170},{"type":45,"tag":80,"props":209,"children":211},{"className":210},[],[212],{"type":51,"value":213},"basePath",{"type":45,"tag":97,"props":215,"children":216},{},[217,222,231],{"type":45,"tag":124,"props":218,"children":219},{},[220],{"type":51,"value":221},"Callable methods",{"type":45,"tag":124,"props":223,"children":224},{},[225],{"type":45,"tag":80,"props":226,"children":228},{"className":227},[],[229],{"type":51,"value":230},"docs\u002Fcallable-methods.md",{"type":45,"tag":124,"props":232,"children":233},{},[234,240],{"type":45,"tag":80,"props":235,"children":237},{"className":236},[],[238],{"type":51,"value":239},"@callable",{"type":51,"value":241},", RPC, streaming, timeouts",{"type":45,"tag":97,"props":243,"children":244},{},[245,250,259],{"type":45,"tag":124,"props":246,"children":247},{},[248],{"type":51,"value":249},"Scheduling",{"type":45,"tag":124,"props":251,"children":252},{},[253],{"type":45,"tag":80,"props":254,"children":256},{"className":255},[],[257],{"type":51,"value":258},"docs\u002Fscheduling.md",{"type":45,"tag":124,"props":260,"children":261},{},[262,268,269,275],{"type":45,"tag":80,"props":263,"children":265},{"className":264},[],[266],{"type":51,"value":267},"schedule()",{"type":51,"value":170},{"type":45,"tag":80,"props":270,"children":272},{"className":271},[],[273],{"type":51,"value":274},"scheduleEvery()",{"type":51,"value":276},", cron",{"type":45,"tag":97,"props":278,"children":279},{},[280,285,294],{"type":45,"tag":124,"props":281,"children":282},{},[283],{"type":51,"value":284},"Workflows",{"type":45,"tag":124,"props":286,"children":287},{},[288],{"type":45,"tag":80,"props":289,"children":291},{"className":290},[],[292],{"type":51,"value":293},"docs\u002Fworkflows.md",{"type":45,"tag":124,"props":295,"children":296},{},[297,303],{"type":45,"tag":80,"props":298,"children":300},{"className":299},[],[301],{"type":51,"value":302},"AgentWorkflow",{"type":51,"value":304},", durable multi-step tasks",{"type":45,"tag":97,"props":306,"children":307},{},[308,313,322],{"type":45,"tag":124,"props":309,"children":310},{},[311],{"type":51,"value":312},"HTTP\u002FWebSockets",{"type":45,"tag":124,"props":314,"children":315},{},[316],{"type":45,"tag":80,"props":317,"children":319},{"className":318},[],[320],{"type":51,"value":321},"docs\u002Fhttp-websockets.md",{"type":45,"tag":124,"props":323,"children":324},{},[325],{"type":51,"value":326},"Lifecycle hooks, hibernation",{"type":45,"tag":97,"props":328,"children":329},{},[330,335,344],{"type":45,"tag":124,"props":331,"children":332},{},[333],{"type":51,"value":334},"Email",{"type":45,"tag":124,"props":336,"children":337},{},[338],{"type":45,"tag":80,"props":339,"children":341},{"className":340},[],[342],{"type":51,"value":343},"docs\u002Femail.md",{"type":45,"tag":124,"props":345,"children":346},{},[347],{"type":51,"value":348},"Email routing, secure reply resolver",{"type":45,"tag":97,"props":350,"children":351},{},[352,357,366],{"type":45,"tag":124,"props":353,"children":354},{},[355],{"type":51,"value":356},"MCP client",{"type":45,"tag":124,"props":358,"children":359},{},[360],{"type":45,"tag":80,"props":361,"children":363},{"className":362},[],[364],{"type":51,"value":365},"docs\u002Fmcp-client.md",{"type":45,"tag":124,"props":367,"children":368},{},[369],{"type":51,"value":370},"Connecting to MCP servers",{"type":45,"tag":97,"props":372,"children":373},{},[374,379,388],{"type":45,"tag":124,"props":375,"children":376},{},[377],{"type":51,"value":378},"MCP server",{"type":45,"tag":124,"props":380,"children":381},{},[382],{"type":45,"tag":80,"props":383,"children":385},{"className":384},[],[386],{"type":51,"value":387},"docs\u002Fmcp-servers.md",{"type":45,"tag":124,"props":389,"children":390},{},[391,393],{"type":51,"value":392},"Building MCP servers with ",{"type":45,"tag":80,"props":394,"children":396},{"className":395},[],[397],{"type":51,"value":398},"McpAgent",{"type":45,"tag":97,"props":400,"children":401},{},[402,407,416],{"type":45,"tag":124,"props":403,"children":404},{},[405],{"type":51,"value":406},"Client SDK",{"type":45,"tag":124,"props":408,"children":409},{},[410],{"type":45,"tag":80,"props":411,"children":413},{"className":412},[],[414],{"type":51,"value":415},"docs\u002Fclient-sdk.md",{"type":45,"tag":124,"props":417,"children":418},{},[419,425,426,432],{"type":45,"tag":80,"props":420,"children":422},{"className":421},[],[423],{"type":51,"value":424},"useAgent",{"type":51,"value":170},{"type":45,"tag":80,"props":427,"children":429},{"className":428},[],[430],{"type":51,"value":431},"useAgentChat",{"type":51,"value":433},", React hooks",{"type":45,"tag":97,"props":435,"children":436},{},[437,442,451],{"type":45,"tag":124,"props":438,"children":439},{},[440],{"type":51,"value":441},"Human-in-the-loop",{"type":45,"tag":124,"props":443,"children":444},{},[445],{"type":45,"tag":80,"props":446,"children":448},{"className":447},[],[449],{"type":51,"value":450},"docs\u002Fhuman-in-the-loop.md",{"type":45,"tag":124,"props":452,"children":453},{},[454],{"type":51,"value":455},"Approval flows, pausing workflows",{"type":45,"tag":97,"props":457,"children":458},{},[459,464,473],{"type":45,"tag":124,"props":460,"children":461},{},[462],{"type":51,"value":463},"Resumable streaming",{"type":45,"tag":124,"props":465,"children":466},{},[467],{"type":45,"tag":80,"props":468,"children":470},{"className":469},[],[471],{"type":51,"value":472},"docs\u002Fresumable-streaming.md",{"type":45,"tag":124,"props":474,"children":475},{},[476],{"type":51,"value":477},"Stream recovery on disconnect",{"type":45,"tag":54,"props":479,"children":480},{},[481,483],{"type":51,"value":482},"Cloudflare docs: ",{"type":45,"tag":484,"props":485,"children":489},"a",{"href":486,"rel":487},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F",[488],"nofollow",[490],{"type":51,"value":486},{"type":45,"tag":68,"props":492,"children":494},{"id":493},"capabilities",[495],{"type":51,"value":496},"Capabilities",{"type":45,"tag":54,"props":498,"children":499},{},[500],{"type":51,"value":501},"The Agents SDK provides:",{"type":45,"tag":503,"props":504,"children":505},"ul",{},[506,517,535,552,566,581,591,608],{"type":45,"tag":507,"props":508,"children":509},"li",{},[510,515],{"type":45,"tag":60,"props":511,"children":512},{},[513],{"type":51,"value":514},"Persistent state",{"type":51,"value":516}," - SQLite-backed, auto-synced to clients",{"type":45,"tag":507,"props":518,"children":519},{},[520,525,527,533],{"type":45,"tag":60,"props":521,"children":522},{},[523],{"type":51,"value":524},"Callable RPC",{"type":51,"value":526}," - ",{"type":45,"tag":80,"props":528,"children":530},{"className":529},[],[531],{"type":51,"value":532},"@callable()",{"type":51,"value":534}," methods invoked over WebSocket",{"type":45,"tag":507,"props":536,"children":537},{},[538,542,544,550],{"type":45,"tag":60,"props":539,"children":540},{},[541],{"type":51,"value":249},{"type":51,"value":543}," - One-time, recurring (",{"type":45,"tag":80,"props":545,"children":547},{"className":546},[],[548],{"type":51,"value":549},"scheduleEvery",{"type":51,"value":551},"), and cron tasks",{"type":45,"tag":507,"props":553,"children":554},{},[555,559,561],{"type":45,"tag":60,"props":556,"children":557},{},[558],{"type":51,"value":284},{"type":51,"value":560}," - Durable multi-step background processing via ",{"type":45,"tag":80,"props":562,"children":564},{"className":563},[],[565],{"type":51,"value":302},{"type":45,"tag":507,"props":567,"children":568},{},[569,574,576],{"type":45,"tag":60,"props":570,"children":571},{},[572],{"type":51,"value":573},"MCP integration",{"type":51,"value":575}," - Connect to MCP servers or build your own with ",{"type":45,"tag":80,"props":577,"children":579},{"className":578},[],[580],{"type":51,"value":398},{"type":45,"tag":507,"props":582,"children":583},{},[584,589],{"type":45,"tag":60,"props":585,"children":586},{},[587],{"type":51,"value":588},"Email handling",{"type":51,"value":590}," - Receive and reply to emails with secure routing",{"type":45,"tag":507,"props":592,"children":593},{},[594,599,600,606],{"type":45,"tag":60,"props":595,"children":596},{},[597],{"type":51,"value":598},"Streaming chat",{"type":51,"value":526},{"type":45,"tag":80,"props":601,"children":603},{"className":602},[],[604],{"type":51,"value":605},"AIChatAgent",{"type":51,"value":607}," with resumable streams",{"type":45,"tag":507,"props":609,"children":610},{},[611,616,617,622,623,628],{"type":45,"tag":60,"props":612,"children":613},{},[614],{"type":51,"value":615},"React hooks",{"type":51,"value":526},{"type":45,"tag":80,"props":618,"children":620},{"className":619},[],[621],{"type":51,"value":424},{"type":51,"value":170},{"type":45,"tag":80,"props":624,"children":626},{"className":625},[],[627],{"type":51,"value":431},{"type":51,"value":629}," for client apps",{"type":45,"tag":68,"props":631,"children":633},{"id":632},"first-verify-installation",[634],{"type":51,"value":635},"FIRST: Verify Installation",{"type":45,"tag":637,"props":638,"children":643},"pre",{"className":639,"code":640,"language":641,"meta":642,"style":642},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm ls agents  # Should show agents package\n","bash","",[644],{"type":45,"tag":80,"props":645,"children":646},{"__ignoreMap":642},[647],{"type":45,"tag":648,"props":649,"children":652},"span",{"class":650,"line":651},"line",1,[653,659,665,670],{"type":45,"tag":648,"props":654,"children":656},{"style":655},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[657],{"type":51,"value":658},"npm",{"type":45,"tag":648,"props":660,"children":662},{"style":661},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[663],{"type":51,"value":664}," ls",{"type":45,"tag":648,"props":666,"children":667},{"style":661},[668],{"type":51,"value":669}," agents",{"type":45,"tag":648,"props":671,"children":673},{"style":672},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[674],{"type":51,"value":675},"  # Should show agents package\n",{"type":45,"tag":54,"props":677,"children":678},{},[679],{"type":51,"value":680},"If not installed:",{"type":45,"tag":637,"props":682,"children":684},{"className":639,"code":683,"language":641,"meta":642,"style":642},"npm install agents\n",[685],{"type":45,"tag":80,"props":686,"children":687},{"__ignoreMap":642},[688],{"type":45,"tag":648,"props":689,"children":690},{"class":650,"line":651},[691,695,700],{"type":45,"tag":648,"props":692,"children":693},{"style":655},[694],{"type":51,"value":658},{"type":45,"tag":648,"props":696,"children":697},{"style":661},[698],{"type":51,"value":699}," install",{"type":45,"tag":648,"props":701,"children":702},{"style":661},[703],{"type":51,"value":704}," agents\n",{"type":45,"tag":68,"props":706,"children":708},{"id":707},"wrangler-configuration",[709],{"type":51,"value":710},"Wrangler Configuration",{"type":45,"tag":637,"props":712,"children":716},{"className":713,"code":714,"language":715,"meta":642,"style":642},"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",[717],{"type":45,"tag":80,"props":718,"children":719},{"__ignoreMap":642},[720,728,737,746,755,764],{"type":45,"tag":648,"props":721,"children":722},{"class":650,"line":651},[723],{"type":45,"tag":648,"props":724,"children":725},{},[726],{"type":51,"value":727},"{\n",{"type":45,"tag":648,"props":729,"children":731},{"class":650,"line":730},2,[732],{"type":45,"tag":648,"props":733,"children":734},{},[735],{"type":51,"value":736},"  \"durable_objects\": {\n",{"type":45,"tag":648,"props":738,"children":740},{"class":650,"line":739},3,[741],{"type":45,"tag":648,"props":742,"children":743},{},[744],{"type":51,"value":745},"    \"bindings\": [{ \"name\": \"MyAgent\", \"class_name\": \"MyAgent\" }]\n",{"type":45,"tag":648,"props":747,"children":749},{"class":650,"line":748},4,[750],{"type":45,"tag":648,"props":751,"children":752},{},[753],{"type":51,"value":754},"  },\n",{"type":45,"tag":648,"props":756,"children":758},{"class":650,"line":757},5,[759],{"type":45,"tag":648,"props":760,"children":761},{},[762],{"type":51,"value":763},"  \"migrations\": [{ \"tag\": \"v1\", \"new_sqlite_classes\": [\"MyAgent\"] }]\n",{"type":45,"tag":648,"props":765,"children":767},{"class":650,"line":766},6,[768],{"type":45,"tag":648,"props":769,"children":770},{},[771],{"type":51,"value":772},"}\n",{"type":45,"tag":68,"props":774,"children":776},{"id":775},"agent-class",[777],{"type":51,"value":778},"Agent Class",{"type":45,"tag":637,"props":780,"children":784},{"className":781,"code":782,"language":783,"meta":642,"style":642},"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",[785],{"type":45,"tag":80,"props":786,"children":787},{"__ignoreMap":642},[788,857,866,910,917,972,1006,1014,1023,1096,1179,1188,1196,1205,1271,1323,1331,1339,1358,1376,1445,1474,1482,1490,1498,1515,1635],{"type":45,"tag":648,"props":789,"children":790},{"class":650,"line":651},[791,797,803,809,814,819,823,828,833,838,843,847,852],{"type":45,"tag":648,"props":792,"children":794},{"style":793},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[795],{"type":51,"value":796},"import",{"type":45,"tag":648,"props":798,"children":800},{"style":799},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[801],{"type":51,"value":802}," {",{"type":45,"tag":648,"props":804,"children":806},{"style":805},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[807],{"type":51,"value":808}," Agent",{"type":45,"tag":648,"props":810,"children":811},{"style":799},[812],{"type":51,"value":813},",",{"type":45,"tag":648,"props":815,"children":816},{"style":805},[817],{"type":51,"value":818}," routeAgentRequest",{"type":45,"tag":648,"props":820,"children":821},{"style":799},[822],{"type":51,"value":813},{"type":45,"tag":648,"props":824,"children":825},{"style":805},[826],{"type":51,"value":827}," callable",{"type":45,"tag":648,"props":829,"children":830},{"style":799},[831],{"type":51,"value":832}," }",{"type":45,"tag":648,"props":834,"children":835},{"style":793},[836],{"type":51,"value":837}," from",{"type":45,"tag":648,"props":839,"children":840},{"style":799},[841],{"type":51,"value":842}," \"",{"type":45,"tag":648,"props":844,"children":845},{"style":661},[846],{"type":51,"value":21},{"type":45,"tag":648,"props":848,"children":849},{"style":799},[850],{"type":51,"value":851},"\"",{"type":45,"tag":648,"props":853,"children":854},{"style":799},[855],{"type":51,"value":856},";\n",{"type":45,"tag":648,"props":858,"children":859},{"class":650,"line":730},[860],{"type":45,"tag":648,"props":861,"children":863},{"emptyLinePlaceholder":862},true,[864],{"type":51,"value":865},"\n",{"type":45,"tag":648,"props":867,"children":868},{"class":650,"line":739},[869,875,880,885,889,895,900,905],{"type":45,"tag":648,"props":870,"children":872},{"style":871},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[873],{"type":51,"value":874},"type",{"type":45,"tag":648,"props":876,"children":877},{"style":655},[878],{"type":51,"value":879}," State",{"type":45,"tag":648,"props":881,"children":882},{"style":799},[883],{"type":51,"value":884}," =",{"type":45,"tag":648,"props":886,"children":887},{"style":799},[888],{"type":51,"value":802},{"type":45,"tag":648,"props":890,"children":892},{"style":891},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[893],{"type":51,"value":894}," count",{"type":45,"tag":648,"props":896,"children":897},{"style":799},[898],{"type":51,"value":899},":",{"type":45,"tag":648,"props":901,"children":902},{"style":655},[903],{"type":51,"value":904}," number",{"type":45,"tag":648,"props":906,"children":907},{"style":799},[908],{"type":51,"value":909}," };\n",{"type":45,"tag":648,"props":911,"children":912},{"class":650,"line":748},[913],{"type":45,"tag":648,"props":914,"children":915},{"emptyLinePlaceholder":862},[916],{"type":51,"value":865},{"type":45,"tag":648,"props":918,"children":919},{"class":650,"line":757},[920,925,930,935,940,944,949,954,958,962,967],{"type":45,"tag":648,"props":921,"children":922},{"style":793},[923],{"type":51,"value":924},"export",{"type":45,"tag":648,"props":926,"children":927},{"style":871},[928],{"type":51,"value":929}," class",{"type":45,"tag":648,"props":931,"children":932},{"style":655},[933],{"type":51,"value":934}," Counter",{"type":45,"tag":648,"props":936,"children":937},{"style":871},[938],{"type":51,"value":939}," extends",{"type":45,"tag":648,"props":941,"children":942},{"style":655},[943],{"type":51,"value":808},{"type":45,"tag":648,"props":945,"children":946},{"style":799},[947],{"type":51,"value":948},"\u003C",{"type":45,"tag":648,"props":950,"children":951},{"style":655},[952],{"type":51,"value":953},"Env",{"type":45,"tag":648,"props":955,"children":956},{"style":799},[957],{"type":51,"value":813},{"type":45,"tag":648,"props":959,"children":960},{"style":655},[961],{"type":51,"value":879},{"type":45,"tag":648,"props":963,"children":964},{"style":799},[965],{"type":51,"value":966},">",{"type":45,"tag":648,"props":968,"children":969},{"style":799},[970],{"type":51,"value":971}," {\n",{"type":45,"tag":648,"props":973,"children":974},{"class":650,"line":766},[975,980,984,988,992,996,1002],{"type":45,"tag":648,"props":976,"children":977},{"style":891},[978],{"type":51,"value":979},"  initialState",{"type":45,"tag":648,"props":981,"children":982},{"style":799},[983],{"type":51,"value":884},{"type":45,"tag":648,"props":985,"children":986},{"style":799},[987],{"type":51,"value":802},{"type":45,"tag":648,"props":989,"children":990},{"style":891},[991],{"type":51,"value":894},{"type":45,"tag":648,"props":993,"children":994},{"style":799},[995],{"type":51,"value":899},{"type":45,"tag":648,"props":997,"children":999},{"style":998},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1000],{"type":51,"value":1001}," 0",{"type":45,"tag":648,"props":1003,"children":1004},{"style":799},[1005],{"type":51,"value":909},{"type":45,"tag":648,"props":1007,"children":1009},{"class":650,"line":1008},7,[1010],{"type":45,"tag":648,"props":1011,"children":1012},{"emptyLinePlaceholder":862},[1013],{"type":51,"value":865},{"type":45,"tag":648,"props":1015,"children":1017},{"class":650,"line":1016},8,[1018],{"type":45,"tag":648,"props":1019,"children":1020},{"style":672},[1021],{"type":51,"value":1022},"  \u002F\u002F Validation hook - runs before state persists (sync, throwing rejects the update)\n",{"type":45,"tag":648,"props":1024,"children":1026},{"class":650,"line":1025},9,[1027,1032,1037,1043,1047,1051,1055,1060,1064,1069,1074,1078,1083,1087,1092],{"type":45,"tag":648,"props":1028,"children":1029},{"style":891},[1030],{"type":51,"value":1031},"  validateStateChange",{"type":45,"tag":648,"props":1033,"children":1034},{"style":799},[1035],{"type":51,"value":1036},"(",{"type":45,"tag":648,"props":1038,"children":1040},{"style":1039},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[1041],{"type":51,"value":1042},"nextState",{"type":45,"tag":648,"props":1044,"children":1045},{"style":799},[1046],{"type":51,"value":899},{"type":45,"tag":648,"props":1048,"children":1049},{"style":655},[1050],{"type":51,"value":879},{"type":45,"tag":648,"props":1052,"children":1053},{"style":799},[1054],{"type":51,"value":813},{"type":45,"tag":648,"props":1056,"children":1057},{"style":1039},[1058],{"type":51,"value":1059}," source",{"type":45,"tag":648,"props":1061,"children":1062},{"style":799},[1063],{"type":51,"value":899},{"type":45,"tag":648,"props":1065,"children":1066},{"style":655},[1067],{"type":51,"value":1068}," Connection",{"type":45,"tag":648,"props":1070,"children":1071},{"style":799},[1072],{"type":51,"value":1073}," |",{"type":45,"tag":648,"props":1075,"children":1076},{"style":799},[1077],{"type":51,"value":842},{"type":45,"tag":648,"props":1079,"children":1080},{"style":661},[1081],{"type":51,"value":1082},"server",{"type":45,"tag":648,"props":1084,"children":1085},{"style":799},[1086],{"type":51,"value":851},{"type":45,"tag":648,"props":1088,"children":1089},{"style":799},[1090],{"type":51,"value":1091},")",{"type":45,"tag":648,"props":1093,"children":1094},{"style":799},[1095],{"type":51,"value":971},{"type":45,"tag":648,"props":1097,"children":1099},{"class":650,"line":1098},10,[1100,1105,1110,1114,1119,1124,1129,1133,1138,1143,1148,1154,1158,1162,1167,1171,1175],{"type":45,"tag":648,"props":1101,"children":1102},{"style":793},[1103],{"type":51,"value":1104},"    if",{"type":45,"tag":648,"props":1106,"children":1107},{"style":891},[1108],{"type":51,"value":1109}," (",{"type":45,"tag":648,"props":1111,"children":1112},{"style":805},[1113],{"type":51,"value":1042},{"type":45,"tag":648,"props":1115,"children":1116},{"style":799},[1117],{"type":51,"value":1118},".",{"type":45,"tag":648,"props":1120,"children":1121},{"style":805},[1122],{"type":51,"value":1123},"count",{"type":45,"tag":648,"props":1125,"children":1126},{"style":799},[1127],{"type":51,"value":1128}," \u003C",{"type":45,"tag":648,"props":1130,"children":1131},{"style":998},[1132],{"type":51,"value":1001},{"type":45,"tag":648,"props":1134,"children":1135},{"style":891},[1136],{"type":51,"value":1137},") ",{"type":45,"tag":648,"props":1139,"children":1140},{"style":793},[1141],{"type":51,"value":1142},"throw",{"type":45,"tag":648,"props":1144,"children":1145},{"style":799},[1146],{"type":51,"value":1147}," new",{"type":45,"tag":648,"props":1149,"children":1151},{"style":1150},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[1152],{"type":51,"value":1153}," Error",{"type":45,"tag":648,"props":1155,"children":1156},{"style":891},[1157],{"type":51,"value":1036},{"type":45,"tag":648,"props":1159,"children":1160},{"style":799},[1161],{"type":51,"value":851},{"type":45,"tag":648,"props":1163,"children":1164},{"style":661},[1165],{"type":51,"value":1166},"Count cannot be negative",{"type":45,"tag":648,"props":1168,"children":1169},{"style":799},[1170],{"type":51,"value":851},{"type":45,"tag":648,"props":1172,"children":1173},{"style":891},[1174],{"type":51,"value":1091},{"type":45,"tag":648,"props":1176,"children":1177},{"style":799},[1178],{"type":51,"value":856},{"type":45,"tag":648,"props":1180,"children":1182},{"class":650,"line":1181},11,[1183],{"type":45,"tag":648,"props":1184,"children":1185},{"style":799},[1186],{"type":51,"value":1187},"  }\n",{"type":45,"tag":648,"props":1189,"children":1191},{"class":650,"line":1190},12,[1192],{"type":45,"tag":648,"props":1193,"children":1194},{"emptyLinePlaceholder":862},[1195],{"type":51,"value":865},{"type":45,"tag":648,"props":1197,"children":1199},{"class":650,"line":1198},13,[1200],{"type":45,"tag":648,"props":1201,"children":1202},{"style":672},[1203],{"type":51,"value":1204},"  \u002F\u002F Notification hook - runs after state persists (async, non-blocking)\n",{"type":45,"tag":648,"props":1206,"children":1208},{"class":650,"line":1207},14,[1209,1214,1218,1223,1227,1231,1235,1239,1243,1247,1251,1255,1259,1263,1267],{"type":45,"tag":648,"props":1210,"children":1211},{"style":891},[1212],{"type":51,"value":1213},"  onStateUpdate",{"type":45,"tag":648,"props":1215,"children":1216},{"style":799},[1217],{"type":51,"value":1036},{"type":45,"tag":648,"props":1219,"children":1220},{"style":1039},[1221],{"type":51,"value":1222},"state",{"type":45,"tag":648,"props":1224,"children":1225},{"style":799},[1226],{"type":51,"value":899},{"type":45,"tag":648,"props":1228,"children":1229},{"style":655},[1230],{"type":51,"value":879},{"type":45,"tag":648,"props":1232,"children":1233},{"style":799},[1234],{"type":51,"value":813},{"type":45,"tag":648,"props":1236,"children":1237},{"style":1039},[1238],{"type":51,"value":1059},{"type":45,"tag":648,"props":1240,"children":1241},{"style":799},[1242],{"type":51,"value":899},{"type":45,"tag":648,"props":1244,"children":1245},{"style":655},[1246],{"type":51,"value":1068},{"type":45,"tag":648,"props":1248,"children":1249},{"style":799},[1250],{"type":51,"value":1073},{"type":45,"tag":648,"props":1252,"children":1253},{"style":799},[1254],{"type":51,"value":842},{"type":45,"tag":648,"props":1256,"children":1257},{"style":661},[1258],{"type":51,"value":1082},{"type":45,"tag":648,"props":1260,"children":1261},{"style":799},[1262],{"type":51,"value":851},{"type":45,"tag":648,"props":1264,"children":1265},{"style":799},[1266],{"type":51,"value":1091},{"type":45,"tag":648,"props":1268,"children":1269},{"style":799},[1270],{"type":51,"value":971},{"type":45,"tag":648,"props":1272,"children":1274},{"class":650,"line":1273},15,[1275,1280,1284,1289,1293,1297,1302,1306,1310,1315,1319],{"type":45,"tag":648,"props":1276,"children":1277},{"style":805},[1278],{"type":51,"value":1279},"    console",{"type":45,"tag":648,"props":1281,"children":1282},{"style":799},[1283],{"type":51,"value":1118},{"type":45,"tag":648,"props":1285,"children":1286},{"style":1150},[1287],{"type":51,"value":1288},"log",{"type":45,"tag":648,"props":1290,"children":1291},{"style":891},[1292],{"type":51,"value":1036},{"type":45,"tag":648,"props":1294,"children":1295},{"style":799},[1296],{"type":51,"value":851},{"type":45,"tag":648,"props":1298,"children":1299},{"style":661},[1300],{"type":51,"value":1301},"State updated:",{"type":45,"tag":648,"props":1303,"children":1304},{"style":799},[1305],{"type":51,"value":851},{"type":45,"tag":648,"props":1307,"children":1308},{"style":799},[1309],{"type":51,"value":813},{"type":45,"tag":648,"props":1311,"children":1312},{"style":805},[1313],{"type":51,"value":1314}," state",{"type":45,"tag":648,"props":1316,"children":1317},{"style":891},[1318],{"type":51,"value":1091},{"type":45,"tag":648,"props":1320,"children":1321},{"style":799},[1322],{"type":51,"value":856},{"type":45,"tag":648,"props":1324,"children":1326},{"class":650,"line":1325},16,[1327],{"type":45,"tag":648,"props":1328,"children":1329},{"style":799},[1330],{"type":51,"value":1187},{"type":45,"tag":648,"props":1332,"children":1334},{"class":650,"line":1333},17,[1335],{"type":45,"tag":648,"props":1336,"children":1337},{"emptyLinePlaceholder":862},[1338],{"type":51,"value":865},{"type":45,"tag":648,"props":1340,"children":1342},{"class":650,"line":1341},18,[1343,1348,1353],{"type":45,"tag":648,"props":1344,"children":1345},{"style":799},[1346],{"type":51,"value":1347},"  @",{"type":45,"tag":648,"props":1349,"children":1350},{"style":1150},[1351],{"type":51,"value":1352},"callable",{"type":45,"tag":648,"props":1354,"children":1355},{"style":805},[1356],{"type":51,"value":1357},"()\n",{"type":45,"tag":648,"props":1359,"children":1361},{"class":650,"line":1360},19,[1362,1367,1372],{"type":45,"tag":648,"props":1363,"children":1364},{"style":891},[1365],{"type":51,"value":1366},"  increment",{"type":45,"tag":648,"props":1368,"children":1369},{"style":799},[1370],{"type":51,"value":1371},"()",{"type":45,"tag":648,"props":1373,"children":1374},{"style":799},[1375],{"type":51,"value":971},{"type":45,"tag":648,"props":1377,"children":1379},{"class":650,"line":1378},20,[1380,1385,1389,1393,1398,1402,1406,1411,1415,1419,1423,1428,1433,1437,1441],{"type":45,"tag":648,"props":1381,"children":1382},{"style":799},[1383],{"type":51,"value":1384},"    this.",{"type":45,"tag":648,"props":1386,"children":1387},{"style":1150},[1388],{"type":51,"value":168},{"type":45,"tag":648,"props":1390,"children":1391},{"style":891},[1392],{"type":51,"value":1036},{"type":45,"tag":648,"props":1394,"children":1395},{"style":799},[1396],{"type":51,"value":1397},"{",{"type":45,"tag":648,"props":1399,"children":1400},{"style":891},[1401],{"type":51,"value":894},{"type":45,"tag":648,"props":1403,"children":1404},{"style":799},[1405],{"type":51,"value":899},{"type":45,"tag":648,"props":1407,"children":1408},{"style":799},[1409],{"type":51,"value":1410}," this.",{"type":45,"tag":648,"props":1412,"children":1413},{"style":805},[1414],{"type":51,"value":1222},{"type":45,"tag":648,"props":1416,"children":1417},{"style":799},[1418],{"type":51,"value":1118},{"type":45,"tag":648,"props":1420,"children":1421},{"style":805},[1422],{"type":51,"value":1123},{"type":45,"tag":648,"props":1424,"children":1425},{"style":799},[1426],{"type":51,"value":1427}," +",{"type":45,"tag":648,"props":1429,"children":1430},{"style":998},[1431],{"type":51,"value":1432}," 1",{"type":45,"tag":648,"props":1434,"children":1435},{"style":799},[1436],{"type":51,"value":832},{"type":45,"tag":648,"props":1438,"children":1439},{"style":891},[1440],{"type":51,"value":1091},{"type":45,"tag":648,"props":1442,"children":1443},{"style":799},[1444],{"type":51,"value":856},{"type":45,"tag":648,"props":1446,"children":1448},{"class":650,"line":1447},21,[1449,1454,1458,1462,1466,1470],{"type":45,"tag":648,"props":1450,"children":1451},{"style":793},[1452],{"type":51,"value":1453},"    return",{"type":45,"tag":648,"props":1455,"children":1456},{"style":799},[1457],{"type":51,"value":1410},{"type":45,"tag":648,"props":1459,"children":1460},{"style":805},[1461],{"type":51,"value":1222},{"type":45,"tag":648,"props":1463,"children":1464},{"style":799},[1465],{"type":51,"value":1118},{"type":45,"tag":648,"props":1467,"children":1468},{"style":805},[1469],{"type":51,"value":1123},{"type":45,"tag":648,"props":1471,"children":1472},{"style":799},[1473],{"type":51,"value":856},{"type":45,"tag":648,"props":1475,"children":1477},{"class":650,"line":1476},22,[1478],{"type":45,"tag":648,"props":1479,"children":1480},{"style":799},[1481],{"type":51,"value":1187},{"type":45,"tag":648,"props":1483,"children":1485},{"class":650,"line":1484},23,[1486],{"type":45,"tag":648,"props":1487,"children":1488},{"style":799},[1489],{"type":51,"value":772},{"type":45,"tag":648,"props":1491,"children":1493},{"class":650,"line":1492},24,[1494],{"type":45,"tag":648,"props":1495,"children":1496},{"emptyLinePlaceholder":862},[1497],{"type":51,"value":865},{"type":45,"tag":648,"props":1499,"children":1501},{"class":650,"line":1500},25,[1502,1506,1511],{"type":45,"tag":648,"props":1503,"children":1504},{"style":793},[1505],{"type":51,"value":924},{"type":45,"tag":648,"props":1507,"children":1508},{"style":793},[1509],{"type":51,"value":1510}," default",{"type":45,"tag":648,"props":1512,"children":1513},{"style":799},[1514],{"type":51,"value":971},{"type":45,"tag":648,"props":1516,"children":1518},{"class":650,"line":1517},26,[1519,1524,1528,1532,1537,1541,1546,1550,1555,1559,1564,1568,1573,1578,1582,1587,1591,1595,1600,1604,1608,1612,1617,1621,1626,1630],{"type":45,"tag":648,"props":1520,"children":1521},{"style":1150},[1522],{"type":51,"value":1523},"  fetch",{"type":45,"tag":648,"props":1525,"children":1526},{"style":799},[1527],{"type":51,"value":899},{"type":45,"tag":648,"props":1529,"children":1530},{"style":799},[1531],{"type":51,"value":1109},{"type":45,"tag":648,"props":1533,"children":1534},{"style":1039},[1535],{"type":51,"value":1536},"req",{"type":45,"tag":648,"props":1538,"children":1539},{"style":799},[1540],{"type":51,"value":813},{"type":45,"tag":648,"props":1542,"children":1543},{"style":1039},[1544],{"type":51,"value":1545}," env",{"type":45,"tag":648,"props":1547,"children":1548},{"style":799},[1549],{"type":51,"value":1091},{"type":45,"tag":648,"props":1551,"children":1552},{"style":871},[1553],{"type":51,"value":1554}," =>",{"type":45,"tag":648,"props":1556,"children":1557},{"style":1150},[1558],{"type":51,"value":818},{"type":45,"tag":648,"props":1560,"children":1561},{"style":805},[1562],{"type":51,"value":1563},"(req",{"type":45,"tag":648,"props":1565,"children":1566},{"style":799},[1567],{"type":51,"value":813},{"type":45,"tag":648,"props":1569,"children":1570},{"style":805},[1571],{"type":51,"value":1572}," env) ",{"type":45,"tag":648,"props":1574,"children":1575},{"style":799},[1576],{"type":51,"value":1577},"??",{"type":45,"tag":648,"props":1579,"children":1580},{"style":799},[1581],{"type":51,"value":1147},{"type":45,"tag":648,"props":1583,"children":1584},{"style":1150},[1585],{"type":51,"value":1586}," Response",{"type":45,"tag":648,"props":1588,"children":1589},{"style":805},[1590],{"type":51,"value":1036},{"type":45,"tag":648,"props":1592,"children":1593},{"style":799},[1594],{"type":51,"value":851},{"type":45,"tag":648,"props":1596,"children":1597},{"style":661},[1598],{"type":51,"value":1599},"Not found",{"type":45,"tag":648,"props":1601,"children":1602},{"style":799},[1603],{"type":51,"value":851},{"type":45,"tag":648,"props":1605,"children":1606},{"style":799},[1607],{"type":51,"value":813},{"type":45,"tag":648,"props":1609,"children":1610},{"style":799},[1611],{"type":51,"value":802},{"type":45,"tag":648,"props":1613,"children":1614},{"style":891},[1615],{"type":51,"value":1616}," status",{"type":45,"tag":648,"props":1618,"children":1619},{"style":799},[1620],{"type":51,"value":899},{"type":45,"tag":648,"props":1622,"children":1623},{"style":998},[1624],{"type":51,"value":1625}," 404",{"type":45,"tag":648,"props":1627,"children":1628},{"style":799},[1629],{"type":51,"value":832},{"type":45,"tag":648,"props":1631,"children":1632},{"style":805},[1633],{"type":51,"value":1634},")\n",{"type":45,"tag":648,"props":1636,"children":1638},{"class":650,"line":1637},27,[1639],{"type":45,"tag":648,"props":1640,"children":1641},{"style":799},[1642],{"type":51,"value":1643},"};\n",{"type":45,"tag":68,"props":1645,"children":1647},{"id":1646},"routing",[1648],{"type":51,"value":186},{"type":45,"tag":54,"props":1650,"children":1651},{},[1652,1654,1660],{"type":51,"value":1653},"Requests route to ",{"type":45,"tag":80,"props":1655,"children":1657},{"className":1656},[],[1658],{"type":51,"value":1659},"\u002Fagents\u002F{agent-name}\u002F{instance-name}",{"type":51,"value":899},{"type":45,"tag":89,"props":1662,"children":1663},{},[1664,1680],{"type":45,"tag":93,"props":1665,"children":1666},{},[1667],{"type":45,"tag":97,"props":1668,"children":1669},{},[1670,1675],{"type":45,"tag":101,"props":1671,"children":1672},{},[1673],{"type":51,"value":1674},"Class",{"type":45,"tag":101,"props":1676,"children":1677},{},[1678],{"type":51,"value":1679},"URL",{"type":45,"tag":117,"props":1681,"children":1682},{},[1683,1704],{"type":45,"tag":97,"props":1684,"children":1685},{},[1686,1695],{"type":45,"tag":124,"props":1687,"children":1688},{},[1689],{"type":45,"tag":80,"props":1690,"children":1692},{"className":1691},[],[1693],{"type":51,"value":1694},"Counter",{"type":45,"tag":124,"props":1696,"children":1697},{},[1698],{"type":45,"tag":80,"props":1699,"children":1701},{"className":1700},[],[1702],{"type":51,"value":1703},"\u002Fagents\u002Fcounter\u002Fuser-123",{"type":45,"tag":97,"props":1705,"children":1706},{},[1707,1716],{"type":45,"tag":124,"props":1708,"children":1709},{},[1710],{"type":45,"tag":80,"props":1711,"children":1713},{"className":1712},[],[1714],{"type":51,"value":1715},"ChatRoom",{"type":45,"tag":124,"props":1717,"children":1718},{},[1719],{"type":45,"tag":80,"props":1720,"children":1722},{"className":1721},[],[1723],{"type":51,"value":1724},"\u002Fagents\u002Fchat-room\u002Flobby",{"type":45,"tag":54,"props":1726,"children":1727},{},[1728,1730],{"type":51,"value":1729},"Client: ",{"type":45,"tag":80,"props":1731,"children":1733},{"className":1732},[],[1734],{"type":51,"value":1735},"useAgent({ agent: \"Counter\", name: \"user-123\" })",{"type":45,"tag":68,"props":1737,"children":1739},{"id":1738},"core-apis",[1740],{"type":51,"value":1741},"Core APIs",{"type":45,"tag":89,"props":1743,"children":1744},{},[1745,1761],{"type":45,"tag":93,"props":1746,"children":1747},{},[1748],{"type":45,"tag":97,"props":1749,"children":1750},{},[1751,1756],{"type":45,"tag":101,"props":1752,"children":1753},{},[1754],{"type":51,"value":1755},"Task",{"type":45,"tag":101,"props":1757,"children":1758},{},[1759],{"type":51,"value":1760},"API",{"type":45,"tag":117,"props":1762,"children":1763},{},[1764,1781,1798,1815,1832,1849,1866,1883,1900],{"type":45,"tag":97,"props":1765,"children":1766},{},[1767,1772],{"type":45,"tag":124,"props":1768,"children":1769},{},[1770],{"type":51,"value":1771},"Read state",{"type":45,"tag":124,"props":1773,"children":1774},{},[1775],{"type":45,"tag":80,"props":1776,"children":1778},{"className":1777},[],[1779],{"type":51,"value":1780},"this.state.count",{"type":45,"tag":97,"props":1782,"children":1783},{},[1784,1789],{"type":45,"tag":124,"props":1785,"children":1786},{},[1787],{"type":51,"value":1788},"Write state",{"type":45,"tag":124,"props":1790,"children":1791},{},[1792],{"type":45,"tag":80,"props":1793,"children":1795},{"className":1794},[],[1796],{"type":51,"value":1797},"this.setState({ count: 1 })",{"type":45,"tag":97,"props":1799,"children":1800},{},[1801,1806],{"type":45,"tag":124,"props":1802,"children":1803},{},[1804],{"type":51,"value":1805},"SQL query",{"type":45,"tag":124,"props":1807,"children":1808},{},[1809],{"type":45,"tag":80,"props":1810,"children":1812},{"className":1811},[],[1813],{"type":51,"value":1814},"this.sql`SELECT * FROM users WHERE id = ${id}`",{"type":45,"tag":97,"props":1816,"children":1817},{},[1818,1823],{"type":45,"tag":124,"props":1819,"children":1820},{},[1821],{"type":51,"value":1822},"Schedule (delay)",{"type":45,"tag":124,"props":1824,"children":1825},{},[1826],{"type":45,"tag":80,"props":1827,"children":1829},{"className":1828},[],[1830],{"type":51,"value":1831},"await this.schedule(60, \"task\", payload)",{"type":45,"tag":97,"props":1833,"children":1834},{},[1835,1840],{"type":45,"tag":124,"props":1836,"children":1837},{},[1838],{"type":51,"value":1839},"Schedule (cron)",{"type":45,"tag":124,"props":1841,"children":1842},{},[1843],{"type":45,"tag":80,"props":1844,"children":1846},{"className":1845},[],[1847],{"type":51,"value":1848},"await this.schedule(\"0 * * * *\", \"task\", payload)",{"type":45,"tag":97,"props":1850,"children":1851},{},[1852,1857],{"type":45,"tag":124,"props":1853,"children":1854},{},[1855],{"type":51,"value":1856},"Schedule (interval)",{"type":45,"tag":124,"props":1858,"children":1859},{},[1860],{"type":45,"tag":80,"props":1861,"children":1863},{"className":1862},[],[1864],{"type":51,"value":1865},"await this.scheduleEvery(30, \"poll\")",{"type":45,"tag":97,"props":1867,"children":1868},{},[1869,1874],{"type":45,"tag":124,"props":1870,"children":1871},{},[1872],{"type":51,"value":1873},"RPC method",{"type":45,"tag":124,"props":1875,"children":1876},{},[1877],{"type":45,"tag":80,"props":1878,"children":1880},{"className":1879},[],[1881],{"type":51,"value":1882},"@callable() myMethod() { ... }",{"type":45,"tag":97,"props":1884,"children":1885},{},[1886,1891],{"type":45,"tag":124,"props":1887,"children":1888},{},[1889],{"type":51,"value":1890},"Streaming RPC",{"type":45,"tag":124,"props":1892,"children":1893},{},[1894],{"type":45,"tag":80,"props":1895,"children":1897},{"className":1896},[],[1898],{"type":51,"value":1899},"@callable({ streaming: true }) stream(res) { ... }",{"type":45,"tag":97,"props":1901,"children":1902},{},[1903,1908],{"type":45,"tag":124,"props":1904,"children":1905},{},[1906],{"type":51,"value":1907},"Start workflow",{"type":45,"tag":124,"props":1909,"children":1910},{},[1911],{"type":45,"tag":80,"props":1912,"children":1914},{"className":1913},[],[1915],{"type":51,"value":1916},"await this.runWorkflow(\"ProcessingWorkflow\", params)",{"type":45,"tag":68,"props":1918,"children":1920},{"id":1919},"react-client",[1921],{"type":51,"value":1922},"React Client",{"type":45,"tag":637,"props":1924,"children":1928},{"className":1925,"code":1926,"language":1927,"meta":642,"style":642},"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 (\n    \u003Cbutton onClick={() => agent.setState({ count: state.count + 1 })}>\n      Count: {state.count}\n    \u003C\u002Fbutton>\n  );\n}\n","tsx",[1929],{"type":45,"tag":80,"props":1930,"children":1931},{"__ignoreMap":642},[1932,1973,1980,2001,2073,2080,2108,2137,2166,2215,2298,2314,2321,2334,2424,2452,2469,2481],{"type":45,"tag":648,"props":1933,"children":1934},{"class":650,"line":651},[1935,1939,1943,1948,1952,1956,1960,1965,1969],{"type":45,"tag":648,"props":1936,"children":1937},{"style":793},[1938],{"type":51,"value":796},{"type":45,"tag":648,"props":1940,"children":1941},{"style":799},[1942],{"type":51,"value":802},{"type":45,"tag":648,"props":1944,"children":1945},{"style":805},[1946],{"type":51,"value":1947}," useAgent",{"type":45,"tag":648,"props":1949,"children":1950},{"style":799},[1951],{"type":51,"value":832},{"type":45,"tag":648,"props":1953,"children":1954},{"style":793},[1955],{"type":51,"value":837},{"type":45,"tag":648,"props":1957,"children":1958},{"style":799},[1959],{"type":51,"value":842},{"type":45,"tag":648,"props":1961,"children":1962},{"style":661},[1963],{"type":51,"value":1964},"agents\u002Freact",{"type":45,"tag":648,"props":1966,"children":1967},{"style":799},[1968],{"type":51,"value":851},{"type":45,"tag":648,"props":1970,"children":1971},{"style":799},[1972],{"type":51,"value":856},{"type":45,"tag":648,"props":1974,"children":1975},{"class":650,"line":730},[1976],{"type":45,"tag":648,"props":1977,"children":1978},{"emptyLinePlaceholder":862},[1979],{"type":51,"value":865},{"type":45,"tag":648,"props":1981,"children":1982},{"class":650,"line":739},[1983,1988,1993,1997],{"type":45,"tag":648,"props":1984,"children":1985},{"style":871},[1986],{"type":51,"value":1987},"function",{"type":45,"tag":648,"props":1989,"children":1990},{"style":1150},[1991],{"type":51,"value":1992}," App",{"type":45,"tag":648,"props":1994,"children":1995},{"style":799},[1996],{"type":51,"value":1371},{"type":45,"tag":648,"props":1998,"children":1999},{"style":799},[2000],{"type":51,"value":971},{"type":45,"tag":648,"props":2002,"children":2003},{"class":650,"line":748},[2004,2009,2014,2018,2022,2027,2032,2036,2041,2045,2049,2053,2057,2061,2065,2069],{"type":45,"tag":648,"props":2005,"children":2006},{"style":871},[2007],{"type":51,"value":2008},"  const",{"type":45,"tag":648,"props":2010,"children":2011},{"style":799},[2012],{"type":51,"value":2013}," [",{"type":45,"tag":648,"props":2015,"children":2016},{"style":805},[2017],{"type":51,"value":1222},{"type":45,"tag":648,"props":2019,"children":2020},{"style":799},[2021],{"type":51,"value":813},{"type":45,"tag":648,"props":2023,"children":2024},{"style":805},[2025],{"type":51,"value":2026}," setLocalState",{"type":45,"tag":648,"props":2028,"children":2029},{"style":799},[2030],{"type":51,"value":2031},"]",{"type":45,"tag":648,"props":2033,"children":2034},{"style":799},[2035],{"type":51,"value":884},{"type":45,"tag":648,"props":2037,"children":2038},{"style":1150},[2039],{"type":51,"value":2040}," useState",{"type":45,"tag":648,"props":2042,"children":2043},{"style":891},[2044],{"type":51,"value":1036},{"type":45,"tag":648,"props":2046,"children":2047},{"style":799},[2048],{"type":51,"value":1397},{"type":45,"tag":648,"props":2050,"children":2051},{"style":891},[2052],{"type":51,"value":894},{"type":45,"tag":648,"props":2054,"children":2055},{"style":799},[2056],{"type":51,"value":899},{"type":45,"tag":648,"props":2058,"children":2059},{"style":998},[2060],{"type":51,"value":1001},{"type":45,"tag":648,"props":2062,"children":2063},{"style":799},[2064],{"type":51,"value":832},{"type":45,"tag":648,"props":2066,"children":2067},{"style":891},[2068],{"type":51,"value":1091},{"type":45,"tag":648,"props":2070,"children":2071},{"style":799},[2072],{"type":51,"value":856},{"type":45,"tag":648,"props":2074,"children":2075},{"class":650,"line":757},[2076],{"type":45,"tag":648,"props":2077,"children":2078},{"emptyLinePlaceholder":862},[2079],{"type":51,"value":865},{"type":45,"tag":648,"props":2081,"children":2082},{"class":650,"line":766},[2083,2087,2092,2096,2100,2104],{"type":45,"tag":648,"props":2084,"children":2085},{"style":871},[2086],{"type":51,"value":2008},{"type":45,"tag":648,"props":2088,"children":2089},{"style":805},[2090],{"type":51,"value":2091}," agent",{"type":45,"tag":648,"props":2093,"children":2094},{"style":799},[2095],{"type":51,"value":884},{"type":45,"tag":648,"props":2097,"children":2098},{"style":1150},[2099],{"type":51,"value":1947},{"type":45,"tag":648,"props":2101,"children":2102},{"style":891},[2103],{"type":51,"value":1036},{"type":45,"tag":648,"props":2105,"children":2106},{"style":799},[2107],{"type":51,"value":727},{"type":45,"tag":648,"props":2109,"children":2110},{"class":650,"line":1008},[2111,2116,2120,2124,2128,2132],{"type":45,"tag":648,"props":2112,"children":2113},{"style":891},[2114],{"type":51,"value":2115},"    agent",{"type":45,"tag":648,"props":2117,"children":2118},{"style":799},[2119],{"type":51,"value":899},{"type":45,"tag":648,"props":2121,"children":2122},{"style":799},[2123],{"type":51,"value":842},{"type":45,"tag":648,"props":2125,"children":2126},{"style":661},[2127],{"type":51,"value":1694},{"type":45,"tag":648,"props":2129,"children":2130},{"style":799},[2131],{"type":51,"value":851},{"type":45,"tag":648,"props":2133,"children":2134},{"style":799},[2135],{"type":51,"value":2136},",\n",{"type":45,"tag":648,"props":2138,"children":2139},{"class":650,"line":1016},[2140,2145,2149,2153,2158,2162],{"type":45,"tag":648,"props":2141,"children":2142},{"style":891},[2143],{"type":51,"value":2144},"    name",{"type":45,"tag":648,"props":2146,"children":2147},{"style":799},[2148],{"type":51,"value":899},{"type":45,"tag":648,"props":2150,"children":2151},{"style":799},[2152],{"type":51,"value":842},{"type":45,"tag":648,"props":2154,"children":2155},{"style":661},[2156],{"type":51,"value":2157},"my-instance",{"type":45,"tag":648,"props":2159,"children":2160},{"style":799},[2161],{"type":51,"value":851},{"type":45,"tag":648,"props":2163,"children":2164},{"style":799},[2165],{"type":51,"value":2136},{"type":45,"tag":648,"props":2167,"children":2168},{"class":650,"line":1025},[2169,2174,2178,2182,2187,2191,2195,2199,2203,2207,2211],{"type":45,"tag":648,"props":2170,"children":2171},{"style":1150},[2172],{"type":51,"value":2173},"    onStateUpdate",{"type":45,"tag":648,"props":2175,"children":2176},{"style":799},[2177],{"type":51,"value":899},{"type":45,"tag":648,"props":2179,"children":2180},{"style":799},[2181],{"type":51,"value":1109},{"type":45,"tag":648,"props":2183,"children":2184},{"style":1039},[2185],{"type":51,"value":2186},"newState",{"type":45,"tag":648,"props":2188,"children":2189},{"style":799},[2190],{"type":51,"value":1091},{"type":45,"tag":648,"props":2192,"children":2193},{"style":871},[2194],{"type":51,"value":1554},{"type":45,"tag":648,"props":2196,"children":2197},{"style":1150},[2198],{"type":51,"value":2026},{"type":45,"tag":648,"props":2200,"children":2201},{"style":891},[2202],{"type":51,"value":1036},{"type":45,"tag":648,"props":2204,"children":2205},{"style":805},[2206],{"type":51,"value":2186},{"type":45,"tag":648,"props":2208,"children":2209},{"style":891},[2210],{"type":51,"value":1091},{"type":45,"tag":648,"props":2212,"children":2213},{"style":799},[2214],{"type":51,"value":2136},{"type":45,"tag":648,"props":2216,"children":2217},{"class":650,"line":1098},[2218,2223,2227,2231,2236,2240,2245,2249,2253,2258,2262,2266,2270,2275,2280,2285,2289,2294],{"type":45,"tag":648,"props":2219,"children":2220},{"style":1150},[2221],{"type":51,"value":2222},"    onIdentity",{"type":45,"tag":648,"props":2224,"children":2225},{"style":799},[2226],{"type":51,"value":899},{"type":45,"tag":648,"props":2228,"children":2229},{"style":799},[2230],{"type":51,"value":1109},{"type":45,"tag":648,"props":2232,"children":2233},{"style":1039},[2234],{"type":51,"value":2235},"name",{"type":45,"tag":648,"props":2237,"children":2238},{"style":799},[2239],{"type":51,"value":813},{"type":45,"tag":648,"props":2241,"children":2242},{"style":1039},[2243],{"type":51,"value":2244}," agentType",{"type":45,"tag":648,"props":2246,"children":2247},{"style":799},[2248],{"type":51,"value":1091},{"type":45,"tag":648,"props":2250,"children":2251},{"style":871},[2252],{"type":51,"value":1554},{"type":45,"tag":648,"props":2254,"children":2255},{"style":805},[2256],{"type":51,"value":2257}," console",{"type":45,"tag":648,"props":2259,"children":2260},{"style":799},[2261],{"type":51,"value":1118},{"type":45,"tag":648,"props":2263,"children":2264},{"style":1150},[2265],{"type":51,"value":1288},{"type":45,"tag":648,"props":2267,"children":2268},{"style":891},[2269],{"type":51,"value":1036},{"type":45,"tag":648,"props":2271,"children":2272},{"style":799},[2273],{"type":51,"value":2274},"`",{"type":45,"tag":648,"props":2276,"children":2277},{"style":661},[2278],{"type":51,"value":2279},"Connected to ",{"type":45,"tag":648,"props":2281,"children":2282},{"style":799},[2283],{"type":51,"value":2284},"${",{"type":45,"tag":648,"props":2286,"children":2287},{"style":805},[2288],{"type":51,"value":2235},{"type":45,"tag":648,"props":2290,"children":2291},{"style":799},[2292],{"type":51,"value":2293},"}`",{"type":45,"tag":648,"props":2295,"children":2296},{"style":891},[2297],{"type":51,"value":1634},{"type":45,"tag":648,"props":2299,"children":2300},{"class":650,"line":1181},[2301,2306,2310],{"type":45,"tag":648,"props":2302,"children":2303},{"style":799},[2304],{"type":51,"value":2305},"  }",{"type":45,"tag":648,"props":2307,"children":2308},{"style":891},[2309],{"type":51,"value":1091},{"type":45,"tag":648,"props":2311,"children":2312},{"style":799},[2313],{"type":51,"value":856},{"type":45,"tag":648,"props":2315,"children":2316},{"class":650,"line":1190},[2317],{"type":45,"tag":648,"props":2318,"children":2319},{"emptyLinePlaceholder":862},[2320],{"type":51,"value":865},{"type":45,"tag":648,"props":2322,"children":2323},{"class":650,"line":1198},[2324,2329],{"type":45,"tag":648,"props":2325,"children":2326},{"style":793},[2327],{"type":51,"value":2328},"  return",{"type":45,"tag":648,"props":2330,"children":2331},{"style":891},[2332],{"type":51,"value":2333}," (\n",{"type":45,"tag":648,"props":2335,"children":2336},{"class":650,"line":1207},[2337,2342,2347,2352,2357,2361,2365,2369,2373,2377,2381,2385,2389,2393,2397,2402,2407,2411,2415,2419],{"type":45,"tag":648,"props":2338,"children":2339},{"style":799},[2340],{"type":51,"value":2341},"    \u003C",{"type":45,"tag":648,"props":2343,"children":2344},{"style":891},[2345],{"type":51,"value":2346},"button",{"type":45,"tag":648,"props":2348,"children":2349},{"style":871},[2350],{"type":51,"value":2351}," onClick",{"type":45,"tag":648,"props":2353,"children":2354},{"style":799},[2355],{"type":51,"value":2356},"={()",{"type":45,"tag":648,"props":2358,"children":2359},{"style":871},[2360],{"type":51,"value":1554},{"type":45,"tag":648,"props":2362,"children":2363},{"style":805},[2364],{"type":51,"value":2091},{"type":45,"tag":648,"props":2366,"children":2367},{"style":799},[2368],{"type":51,"value":1118},{"type":45,"tag":648,"props":2370,"children":2371},{"style":1150},[2372],{"type":51,"value":168},{"type":45,"tag":648,"props":2374,"children":2375},{"style":805},[2376],{"type":51,"value":1036},{"type":45,"tag":648,"props":2378,"children":2379},{"style":799},[2380],{"type":51,"value":1397},{"type":45,"tag":648,"props":2382,"children":2383},{"style":891},[2384],{"type":51,"value":894},{"type":45,"tag":648,"props":2386,"children":2387},{"style":799},[2388],{"type":51,"value":899},{"type":45,"tag":648,"props":2390,"children":2391},{"style":805},[2392],{"type":51,"value":1314},{"type":45,"tag":648,"props":2394,"children":2395},{"style":799},[2396],{"type":51,"value":1118},{"type":45,"tag":648,"props":2398,"children":2399},{"style":805},[2400],{"type":51,"value":2401},"count ",{"type":45,"tag":648,"props":2403,"children":2404},{"style":799},[2405],{"type":51,"value":2406},"+",{"type":45,"tag":648,"props":2408,"children":2409},{"style":998},[2410],{"type":51,"value":1432},{"type":45,"tag":648,"props":2412,"children":2413},{"style":799},[2414],{"type":51,"value":832},{"type":45,"tag":648,"props":2416,"children":2417},{"style":805},[2418],{"type":51,"value":1091},{"type":45,"tag":648,"props":2420,"children":2421},{"style":799},[2422],{"type":51,"value":2423},"}>\n",{"type":45,"tag":648,"props":2425,"children":2426},{"class":650,"line":1273},[2427,2432,2436,2440,2444,2448],{"type":45,"tag":648,"props":2428,"children":2429},{"style":805},[2430],{"type":51,"value":2431},"      Count: ",{"type":45,"tag":648,"props":2433,"children":2434},{"style":799},[2435],{"type":51,"value":1397},{"type":45,"tag":648,"props":2437,"children":2438},{"style":805},[2439],{"type":51,"value":1222},{"type":45,"tag":648,"props":2441,"children":2442},{"style":799},[2443],{"type":51,"value":1118},{"type":45,"tag":648,"props":2445,"children":2446},{"style":805},[2447],{"type":51,"value":1123},{"type":45,"tag":648,"props":2449,"children":2450},{"style":799},[2451],{"type":51,"value":772},{"type":45,"tag":648,"props":2453,"children":2454},{"class":650,"line":1325},[2455,2460,2464],{"type":45,"tag":648,"props":2456,"children":2457},{"style":799},[2458],{"type":51,"value":2459},"    \u003C\u002F",{"type":45,"tag":648,"props":2461,"children":2462},{"style":891},[2463],{"type":51,"value":2346},{"type":45,"tag":648,"props":2465,"children":2466},{"style":799},[2467],{"type":51,"value":2468},">\n",{"type":45,"tag":648,"props":2470,"children":2471},{"class":650,"line":1333},[2472,2477],{"type":45,"tag":648,"props":2473,"children":2474},{"style":891},[2475],{"type":51,"value":2476},"  )",{"type":45,"tag":648,"props":2478,"children":2479},{"style":799},[2480],{"type":51,"value":856},{"type":45,"tag":648,"props":2482,"children":2483},{"class":650,"line":1341},[2484],{"type":45,"tag":648,"props":2485,"children":2486},{"style":799},[2487],{"type":51,"value":772},{"type":45,"tag":68,"props":2489,"children":2491},{"id":2490},"references",[2492],{"type":51,"value":2493},"References",{"type":45,"tag":503,"props":2495,"children":2496},{},[2497,2510,2523,2536,2549,2562,2575],{"type":45,"tag":507,"props":2498,"children":2499},{},[2500,2508],{"type":45,"tag":60,"props":2501,"children":2502},{},[2503],{"type":45,"tag":484,"props":2504,"children":2506},{"href":2505},"references\u002Fworkflows.md",[2507],{"type":51,"value":2505},{"type":51,"value":2509}," - Durable Workflows integration",{"type":45,"tag":507,"props":2511,"children":2512},{},[2513,2521],{"type":45,"tag":60,"props":2514,"children":2515},{},[2516],{"type":45,"tag":484,"props":2517,"children":2519},{"href":2518},"references\u002Fcallable.md",[2520],{"type":51,"value":2518},{"type":51,"value":2522}," - RPC methods, streaming, timeouts",{"type":45,"tag":507,"props":2524,"children":2525},{},[2526,2534],{"type":45,"tag":60,"props":2527,"children":2528},{},[2529],{"type":45,"tag":484,"props":2530,"children":2532},{"href":2531},"references\u002Fstate-scheduling.md",[2533],{"type":51,"value":2531},{"type":51,"value":2535}," - State persistence, scheduling",{"type":45,"tag":507,"props":2537,"children":2538},{},[2539,2547],{"type":45,"tag":60,"props":2540,"children":2541},{},[2542],{"type":45,"tag":484,"props":2543,"children":2545},{"href":2544},"references\u002Fstreaming-chat.md",[2546],{"type":51,"value":2544},{"type":51,"value":2548}," - AIChatAgent, resumable streams",{"type":45,"tag":507,"props":2550,"children":2551},{},[2552,2560],{"type":45,"tag":60,"props":2553,"children":2554},{},[2555],{"type":45,"tag":484,"props":2556,"children":2558},{"href":2557},"references\u002Fmcp.md",[2559],{"type":51,"value":2557},{"type":51,"value":2561}," - MCP server integration",{"type":45,"tag":507,"props":2563,"children":2564},{},[2565,2573],{"type":45,"tag":60,"props":2566,"children":2567},{},[2568],{"type":45,"tag":484,"props":2569,"children":2571},{"href":2570},"references\u002Femail.md",[2572],{"type":51,"value":2570},{"type":51,"value":2574}," - Email routing and handling",{"type":45,"tag":507,"props":2576,"children":2577},{},[2578,2586],{"type":45,"tag":60,"props":2579,"children":2580},{},[2581],{"type":45,"tag":484,"props":2582,"children":2584},{"href":2583},"references\u002Fcodemode.md",[2585],{"type":51,"value":2583},{"type":51,"value":2587}," - Code Mode (experimental)",{"type":45,"tag":2589,"props":2590,"children":2591},"style",{},[2592],{"type":51,"value":2593},"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":2595,"total":2798},[2596,2617,2640,2657,2673,2690,2709,2725,2741,2755,2767,2782],{"slug":2597,"name":2597,"fn":2598,"description":2599,"org":2600,"tags":2601,"stars":2614,"repoUrl":2615,"updatedAt":2616},"prior-auth-packet-builder","build healthcare prior authorization packets","Build a concise prior authorization packet from local case files and payer policy docs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2602,2605,2608,2611],{"name":2603,"slug":2604,"type":15},"Documents","documents",{"name":2606,"slug":2607,"type":15},"Healthcare","healthcare",{"name":2609,"slug":2610,"type":15},"Insurance","insurance",{"name":2612,"slug":2613,"type":15},"Regulatory Compliance","regulatory-compliance",28169,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fopenai-agents-python","2026-04-16T05:11:39.180399",{"slug":2618,"name":2618,"fn":2619,"description":2620,"org":2621,"tags":2622,"stars":2637,"repoUrl":2638,"updatedAt":2639},"aspnet-core","build ASP.NET Core web applications","Build, review, refactor, or architect ASP.NET Core web applications using current official guidance for .NET web development. Use when working on Blazor Web Apps, Razor Pages, MVC, Minimal APIs, controller-based Web APIs, SignalR, gRPC, middleware, dependency injection, configuration, authentication, authorization, testing, performance, deployment, or ASP.NET Core upgrades.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2623,2626,2628,2631,2634],{"name":2624,"slug":2625,"type":15},".NET","dotnet",{"name":2627,"slug":2618,"type":15},"ASP.NET Core",{"name":2629,"slug":2630,"type":15},"Blazor","blazor",{"name":2632,"slug":2633,"type":15},"C#","csharp",{"name":2635,"slug":2636,"type":15},"Web Development","web-development",23787,"https:\u002F\u002Fgithub.com\u002Fopenai\u002Fskills","2026-04-12T05:07:02.819491",{"slug":2641,"name":2641,"fn":2642,"description":2643,"org":2644,"tags":2645,"stars":2637,"repoUrl":2638,"updatedAt":2656},"chatgpt-apps","build ChatGPT Apps SDK applications","Build, scaffold, refactor, and troubleshoot ChatGPT Apps SDK applications that combine an MCP server and widget UI. Use when Codex needs to design tools, register UI resources, wire the MCP Apps bridge or ChatGPT compatibility APIs, apply Apps SDK metadata or CSP or domain settings, or produce a docs-aligned project scaffold. Prefer a docs-first workflow by invoking the openai-docs skill or OpenAI developer docs MCP tools before generating code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2646,2649,2652,2655],{"name":2647,"slug":2648,"type":15},"Apps SDK","apps-sdk",{"name":2650,"slug":2651,"type":15},"ChatGPT","chatgpt",{"name":2653,"slug":2654,"type":15},"MCP","mcp",{"name":9,"slug":8,"type":15},"2026-04-12T05:07:05.468097",{"slug":2658,"name":2658,"fn":2659,"description":2660,"org":2661,"tags":2662,"stars":2637,"repoUrl":2638,"updatedAt":2672},"cli-creator","build CLIs from API docs","Build a composable CLI for Codex from API docs, an OpenAPI spec, existing curl examples, an SDK, a web app, an admin tool, or a local script. Use when the user wants Codex to create a command-line tool that can run from any repo, expose composable read\u002Fwrite commands, return stable JSON, manage auth, and pair with a companion skill.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2663,2666,2669],{"name":2664,"slug":2665,"type":15},"API Development","api-development",{"name":2667,"slug":2668,"type":15},"CLI","cli",{"name":2670,"slug":2671,"type":15},"Codex","codex","2026-04-12T05:07:04.132762",{"slug":2674,"name":2674,"fn":2675,"description":2676,"org":2677,"tags":2678,"stars":2637,"repoUrl":2638,"updatedAt":2689},"cloudflare-deploy","deploy projects to Cloudflare","Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2679,2682,2685,2686],{"name":2680,"slug":2681,"type":15},"Cloudflare","cloudflare",{"name":2683,"slug":2684,"type":15},"Cloudflare Pages","cloudflare-pages",{"name":13,"slug":14,"type":15},{"name":2687,"slug":2688,"type":15},"Deployment","deployment","2026-04-12T05:07:14.275118",{"slug":2691,"name":2691,"fn":2692,"description":2693,"org":2694,"tags":2695,"stars":2637,"repoUrl":2638,"updatedAt":2708},"define-goal","define and set measurable project goals","Help the user define a concrete, measurable goal before starting work, especially when they ask to use the goal tool, create a goal, set an objective, clarify success criteria, or turn a fuzzy intention into a quantitative outcome. Use this skill for goal creation and goal refinement only; it does not manage durable snapshots, decision logs, or long-running execution artifacts.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2696,2699,2702,2705],{"name":2697,"slug":2698,"type":15},"Productivity","productivity",{"name":2700,"slug":2701,"type":15},"Project Management","project-management",{"name":2703,"slug":2704,"type":15},"Strategy","strategy",{"name":2706,"slug":2707,"type":15},"Task Management","task-management","2026-05-23T06:17:16.870838",{"slug":2710,"name":2710,"fn":2711,"description":2712,"org":2713,"tags":2714,"stars":2637,"repoUrl":2638,"updatedAt":2724},"figma","translate Figma designs into code","Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2715,2718,2720,2723],{"name":2716,"slug":2717,"type":15},"Design","design",{"name":2719,"slug":2710,"type":15},"Figma",{"name":2721,"slug":2722,"type":15},"Frontend","frontend",{"name":2653,"slug":2654,"type":15},"2026-04-12T05:06:47.939943",{"slug":2726,"name":2726,"fn":2727,"description":2728,"org":2729,"tags":2730,"stars":2637,"repoUrl":2638,"updatedAt":2740},"figma-code-connect-components","connect Figma designs to code components","Connects Figma design components to code components using Code Connect mapping tools. Use when user says \"code connect\", \"connect this component to code\", \"map this component\", \"link component to code\", \"create code connect mapping\", or wants to establish mappings between Figma designs and code implementations. For canvas writes via `use_figma`, use `figma-use`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2731,2732,2735,2736,2737],{"name":2716,"slug":2717,"type":15},{"name":2733,"slug":2734,"type":15},"Design System","design-system",{"name":2719,"slug":2710,"type":15},{"name":2721,"slug":2722,"type":15},{"name":2738,"slug":2739,"type":15},"UI Components","ui-components","2026-05-10T05:59:52.971881",{"slug":2742,"name":2742,"fn":2743,"description":2744,"org":2745,"tags":2746,"stars":2637,"repoUrl":2638,"updatedAt":2754},"figma-create-design-system-rules","generate design system rules from Figma","Generates custom design system rules for the user's codebase. Use when user says \"create design system rules\", \"generate rules for my project\", \"set up design rules\", \"customize design system guidelines\", or wants to establish project-specific conventions for Figma-to-code workflows. Requires Figma MCP server connection.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2747,2748,2749,2752,2753],{"name":2716,"slug":2717,"type":15},{"name":2733,"slug":2734,"type":15},{"name":2750,"slug":2751,"type":15},"Documentation","documentation",{"name":2719,"slug":2710,"type":15},{"name":2721,"slug":2722,"type":15},"2026-05-16T06:07:47.821474",{"slug":2756,"name":2756,"fn":2757,"description":2758,"org":2759,"tags":2760,"stars":2637,"repoUrl":2638,"updatedAt":2766},"figma-implement-design","translate Figma designs into application code","Translates Figma designs into production-ready application code with 1:1 visual fidelity. Use when implementing UI code from Figma files, when user mentions \"implement design\", \"generate code\", \"implement component\", provides Figma URLs, or asks to build components matching Figma specs. For Figma canvas writes via `use_figma`, use `figma-use`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2761,2762,2763,2764,2765],{"name":2716,"slug":2717,"type":15},{"name":2719,"slug":2710,"type":15},{"name":2721,"slug":2722,"type":15},{"name":2738,"slug":2739,"type":15},{"name":2635,"slug":2636,"type":15},"2026-05-16T06:07:40.583615",{"slug":2768,"name":2768,"fn":2769,"description":2770,"org":2771,"tags":2772,"stars":2637,"repoUrl":2638,"updatedAt":2781},"hatch-pet","create animated pets for Codex","Create, repair, validate, visually QA, and package Codex-compatible animated pets and pet spritesheets from character art, generated images, company or prospect brand cues, or visual references. Use when a user wants a lightweight-worker Codex pet workflow, a non-pixel custom pet style, a prospect or company mascot pet, or a full 8x9 animated pet atlas with transparent unused cells, QA contact sheets, and pet.json packaging. This skill composes the installed $imagegen system skill for visual generation and uses bundled scripts for deterministic spritesheet assembly.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2773,2776,2777,2780],{"name":2774,"slug":2775,"type":15},"Animation","animation",{"name":2670,"slug":2671,"type":15},{"name":2778,"slug":2779,"type":15},"Creative","creative",{"name":2716,"slug":2717,"type":15},"2026-05-02T05:31:48.48485",{"slug":2783,"name":2783,"fn":2784,"description":2785,"org":2786,"tags":2787,"stars":2637,"repoUrl":2638,"updatedAt":2797},"imagegen","generate and edit raster images","Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG\u002Fvector\u002Fcode-native assets, extending an established icon or logo system, or building the visual directly in HTML\u002FCSS\u002Fcanvas.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2788,2789,2790,2793,2796],{"name":2778,"slug":2779,"type":15},{"name":2716,"slug":2717,"type":15},{"name":2791,"slug":2792,"type":15},"Image Generation","image-generation",{"name":2794,"slug":2795,"type":15},"Images","images",{"name":9,"slug":8,"type":15},"2026-05-15T06:23:24.312127",675,{"items":2800,"total":2902},[2801,2818,2832,2844,2852,2870,2890],{"slug":2802,"name":2802,"fn":2803,"description":2804,"org":2805,"tags":2806,"stars":28,"repoUrl":29,"updatedAt":2817},"accessibility-and-inclusive-visualization","make data visualizations accessible","Make data visualizations accessible and inclusive. Use when the user needs chart or diagram accessibility guidance, text alternatives for complex visuals, color and contrast review, keyboard support, reduced-motion behavior for animation or parallax, or an accessibility QA workflow for exported figures, UML-like diagrams, and dashboards.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2807,2810,2813,2816],{"name":2808,"slug":2809,"type":15},"Accessibility","accessibility",{"name":2811,"slug":2812,"type":15},"Charts","charts",{"name":2814,"slug":2815,"type":15},"Data Visualization","data-visualization",{"name":2716,"slug":2717,"type":15},"2026-06-30T19:00:57.102",{"slug":2819,"name":2819,"fn":2820,"description":2821,"org":2822,"tags":2823,"stars":28,"repoUrl":29,"updatedAt":2831},"agent-browser","automate browser interactions for agents","Browser automation CLI for AI agents. Use when the user needs to interact with websites, verify dev server output, test web apps, navigate pages, fill forms, click buttons, take screenshots, extract data, or automate any browser task. Also triggers when a dev server starts so you can verify it visually.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2824,2825,2828],{"name":20,"slug":21,"type":15},{"name":2826,"slug":2827,"type":15},"Browser Automation","browser-automation",{"name":2829,"slug":2830,"type":15},"Testing","testing","2026-04-06T18:41:03.44016",{"slug":2833,"name":2833,"fn":2834,"description":2835,"org":2836,"tags":2837,"stars":28,"repoUrl":29,"updatedAt":2843},"agent-browser-verify","verify dev server output with automated browser","Automated browser verification for dev servers. Triggers when a dev server starts to run a visual gut-check with agent-browser — verifies the page loads, checks for console errors, validates key UI elements, and reports pass\u002Ffail before continuing.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2838,2839,2842],{"name":2826,"slug":2827,"type":15},{"name":2840,"slug":2841,"type":15},"Local Development","local-development",{"name":2829,"slug":2830,"type":15},"2026-04-06T18:41:17.526867",{"slug":4,"name":4,"fn":5,"description":6,"org":2845,"tags":2846,"stars":28,"repoUrl":29,"updatedAt":30},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2847,2848,2849,2850,2851],{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"name":26,"slug":27,"type":15},{"name":23,"slug":24,"type":15},{"name":17,"slug":18,"type":15},{"slug":2853,"name":2853,"fn":2854,"description":2855,"org":2856,"tags":2857,"stars":28,"repoUrl":29,"updatedAt":2869},"ai-elements","build chat UIs with AI Elements","AI Elements component library guidance — pre-built React components for AI interfaces built on shadcn\u002Fui. Use when building chat UIs, message displays, tool call rendering, streaming responses, reasoning panels, or any AI-native interface with the AI SDK.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2858,2859,2862,2865,2866],{"name":2721,"slug":2722,"type":15},{"name":2860,"slug":2861,"type":15},"React","react",{"name":2863,"slug":2864,"type":15},"shadcn\u002Fui","shadcn-ui",{"name":2738,"slug":2739,"type":15},{"name":2867,"slug":2868,"type":15},"Vercel","vercel","2026-04-06T18:40:59.619419",{"slug":2871,"name":2871,"fn":2872,"description":2873,"org":2874,"tags":2875,"stars":28,"repoUrl":29,"updatedAt":2889},"ai-gateway","configure Vercel AI Gateway","Vercel AI Gateway expert guidance. Use when configuring model routing, provider failover, cost tracking, or managing multiple AI providers through a unified API.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2876,2879,2882,2885,2888],{"name":2877,"slug":2878,"type":15},"AI Infrastructure","ai-infrastructure",{"name":2880,"slug":2881,"type":15},"Cost Optimization","cost-optimization",{"name":2883,"slug":2884,"type":15},"LLM","llm",{"name":2886,"slug":2887,"type":15},"Performance","performance",{"name":2867,"slug":2868,"type":15},"2026-04-06T18:40:44.377464",{"slug":2891,"name":2891,"fn":2892,"description":2893,"org":2894,"tags":2895,"stars":28,"repoUrl":29,"updatedAt":2901},"ai-generation-persistence","implement persistence patterns for AI generations","AI generation persistence patterns — unique IDs, addressable URLs, database storage, and cost tracking for every LLM generation",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2896,2897,2900],{"name":2880,"slug":2881,"type":15},{"name":2898,"slug":2899,"type":15},"Database","database",{"name":2883,"slug":2884,"type":15},"2026-04-06T18:41:08.513425",600]