hono
Installation
bun add @regent/hono honoBasic Usage
import { createAgent } from '@regent/core';
import { http } from '@regent/http';
import { createAgentApp } from '@regent/hono';
import { z } from 'zod';
const agent = await createAgent({
name: 'my-agent',
version: '1.0.0',
})
.use(http())
.addEntrypoint({
key: 'echo',
input: z.object({ text: z.string() }),
handler: async ({ input }) => ({
output: { echoed: input.text },
}),
})
.build();
const { app, addEntrypoint } = await createAgentApp(agent);
Bun.serve({ fetch: app.fetch, port: 3000 });API Reference
createAgentApp()
CreateAgentAppOptions
Return Value
Routes
Method
Path
Description
Middleware Hooks
Dynamic Entrypoints
Payment Integration
withPayments()
Response Format
Invoke Response
Stream Response (SSE)
Error Responses
Exports
Last updated