@evolutese/react
v0.1.2
Published
React components and hooks for EvoluteSe framework
Readme
@evolutese/react
React components and hooks for building frontends powered by the Evolutese runtime.
Installation
npm install @evolutese/reactSetup
Wrap your app with EvoluteseProvider:
import { EvoluteseProvider } from '@evolutese/react';
function App() {
return (
<EvoluteseProvider apiUrl="http://localhost:3000">
<YourApp />
</EvoluteseProvider>
);
}Hooks
useAgent
Execute an agent intent and get back the result:
import { useAgent } from '@evolutese/react';
function MyComponent() {
const { execute, result, loading } = useAgent('my-agent');
return (
<button onClick={() => execute('greet', { name: 'Alice' })}>
{loading ? 'Running...' : 'Run'}
</button>
);
}useEvoluteseAction
Lower-level hook for streaming SSE responses from any API endpoint:
import { useEvoluteseAction } from '@evolutese/react';
const { trigger, data, streaming } = useEvoluteseAction('/api/agent/run');Components
| Component | Description |
|-----------|-------------|
| CommandPanel | Input panel for sending commands to an agent |
| AgentBar | Status bar showing the active agent |
| DynamicViewSlot | Renders dynamic views returned by the runtime |
License
MIT
