@fabric-harness/cloudflare
v0.5.0
Published
Cloudflare Workers and Sandbox adapter for Fabric Harness.
Maintainers
Readme
@fabric-harness/cloudflare
Cloudflare Workers + Sandbox adapter for Fabric Harness.
Install
npm install @fabric-harness/cloudflare @fabric-harness/sdk@cloudflare/sandbox is a peer dependency — install it as well if you want a real Cloudflare-backed sandbox; otherwise the adapter falls back to the in-memory virtual sandbox.
Quick start
import { agent } from '@fabric-harness/sdk';
import { getCloudflareSandbox } from '@fabric-harness/cloudflare';
export default agent({
name: 'edge-assistant', triggers: { webhook: true },
run: async ({ init, payload, env }) => {
const sandbox = await getCloudflareSandbox(env.SANDBOX, 'session-1');
const session = await (await init({
sandbox,
model: 'anthropic/claude-sonnet-4-6',
runtime: 'stateless',
})).session();
return { reply: await session.prompt<string>(String((payload as any)?.message ?? '')) };
},
});Build with fh build --target cloudflare to produce an artifact ready for wrangler deploy.
Documentation
License
Apache-2.0
