Cloudflare Workers/Pages deployment adapter for @aihu/app.
cloudflarefunction cloudflare(options?: CloudflareAdapterOptions): AihuAdapterCloudflare Workers / Pages adapter for aihu.
CloudflareAdapterOptionsinterface CloudflareAdapterOptions {
/**
* Cloudflare Worker name. Used in generated wrangler.toml.
* Default: value of "name" in the project's package.json, or 'aihu-app'.
*/
name?: string
/**
* Deployment mode.
* - 'workers': Cloudflare Workers with static assets via env.ASSETS binding
* - 'pages': Cloudflare Pages (_worker.js convention — same output, different deploy target)
* Default: 'workers'
*/
mode?: 'workers' | 'pages'
/**
* Whether to write wrangler.toml in the project root if it does not exist.
* Never overwrites an existing wrangler.toml.
* Default: true
*/
generateWrangler?: boolean
/**
* Enable SSR + static hybrid mode.
*
* When true, the generated `_worker.js` calls your aihu server handler first
* (SSR routes, API routes, agent-readiness endpoints), then falls back to
* Cloudflare's ASSETS binding for pre-rendered static files, and finally
* falls back to `/index.html` for client-side-routed SPA pages.
*
* Route priority: SSR handler → ASSETS (CDN edge) → /index.html (SPA shell)
*
* Default: false (SPA-only mode, all requests served from ASSETS)
*/
ssr?: boolean
}