JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 67
  • Score
    100M100P100Q80400F

Cloudflare Agents base class for hosting AriaFlow Runtime on Durable Objects

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 a Runtime or a HarnessConfig used to build one.
  • The base class streams AriaFlow parts over WebSockets and syncs activeAgentId into Agent state on handoffs.
  • GET /info is handled in onRequest for simple metadata.
  • CloudflareSQLiteStore is exported from this package for custom session wiring.