Package Exports
- @ariaflowagents/cf-agent
Readme
@ariaflowagents/cf-agent
Cloudflare Agents base class for hosting AriaFlow Runtime on Durable Objects.
Why Cloudflare Agents
- Batteries-included state with automatic client sync and embedded SQLite.
- Real-time WebSockets for streaming agent updates.
- Extensible edge runtime with Durable Objects for global, low-latency sessions.
Usage
import { AriaFlowChatAgent } from '@ariaflowagents/cf-agent';
import { Runtime, type AgentConfig } from '@ariaflowagents/core';
export class SupportAgent extends AriaFlowChatAgent {
async createRuntimeConfig() {
const support: AgentConfig = {
id: 'support',
name: 'Support',
systemPrompt: 'You help users with support questions.',
};
return {
agents: [support],
defaultAgentId: 'support',
};
}
}Notes
createRuntimeConfig()is called once on startup and should return aRuntimeor aHarnessConfigused to build one.- The base class streams AriaFlow parts over WebSockets and syncs
activeAgentIdinto Agent state on handoffs. GET /infois handled inonRequestfor simple metadata.CloudflareSQLiteStoreis exported from this package for custom session wiring.