Fred Schott, creator of the Astro framework, whose company was acquired by Cloudflare in January, has just released Flue 2, the first stable version of Flue, based on React-style 'Agent Hooks.' In Flue, an agent is represented by a JavaScript function that 're-renders' before each model call.
Schott initially wanted to port web framework concepts to agent frameworks but found patterns like file-based routing didn't apply, as large clients often treat their entire company as a single agent. He instead drew inspiration from React's componentization, thinking, 'Maybe no one has built React for agents yet.'
Hooks are written in TypeScript, allowing developers to build dynamic agents that manage their own state, listen to lifecycle events, and dynamically attach resources and capabilities at runtime. Flue 2 includes 16 built-in hooks, including useSkill(), useTool(), and useSubagent(), and supports custom hooks.