```typescript import { createAgent } from '@rubriclab/agents' import { actions } from './actions' import { blocks } from './blocks' export const { eventTypes, executeAgent } = createAgent({ model: 'gpt-4o-mini', systemPrompt: 'You are a helpful assistant', blocks, actions }) ``` Should get event types (which could be passed to events pkg for typesafety) and an executor ensure typesafety from events package cleanly integrates: ```typescript 'use server' import { executeAgent } from '~/agents' import { publish } from '~/events' export async function sendMessage(message: string) { await executeAgent( [ { role: 'user', content: message } ], { on: { chatMessage: async ({ event }) => { publish('chatMessage', { event }) } } } ) } ```
Should get event types (which could be passed to events pkg for typesafety) and an executor
ensure typesafety from events package cleanly integrates: