npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@composio/cloudflare

v0.6.3

Published

The Cloudflare AI provider for Composio SDK, providing seamless integration with Cloudflare's AI capabilities and Workers AI.

Readme

@composio/cloudflare

The Cloudflare AI provider for Composio SDK, providing seamless integration with Cloudflare's AI capabilities and Workers AI.

Features

  • Workers AI Integration: Seamless integration with Cloudflare Workers AI
  • Streaming Support: First-class support for streaming responses
  • Model Support: Support for all Cloudflare AI models (@cf/meta/llama-2-7b-chat-int8, etc.)
  • Edge Deployment: Deploy and run AI models at the edge
  • Tool Execution: Execute tools with proper parameter handling
  • Type Safety: Full TypeScript support with proper type definitions

Installation

npm install @composio/cloudflare
# or
yarn add @composio/cloudflare
# or
pnpm add @composio/cloudflare

Quick Start

import { Composio } from '@composio/core';
import { CloudflareProvider } from '@composio/cloudflare';

// Initialize Composio with Cloudflare provider
const composio = new Composio({
  apiKey: 'your-composio-api-key',
  provider: new CloudflareProvider({
    accountId: 'your-cloudflare-account-id',
    apiToken: 'your-cloudflare-api-token',
  }),
});

// Get available tools
const tools = await composio.tools.get('user123', {
  toolkits: ['gmail', 'googlecalendar'],
  limit: 10,
});

Usage Examples

Basic Chat Completion with Streaming

import { Composio } from '@composio/core';
import { CloudflareProvider } from '@composio/cloudflare';
import { Ai } from '@cloudflare/ai';

// Initialize Composio
const composio = new Composio({
  apiKey: process.env.COMPOSIO_API_KEY,
  provider: new CloudflareProvider(),
});

// In your Worker
export default {
  async fetch(request: Request, env: Env, ctx: ExecutionContext) {
    const ai = new Ai(env.AI);
    const tools = await composio.tools.get('user123', {
      toolkits: ['gmail'],
    });

    const messages = [
      { role: 'system', content: 'You are a helpful assistant.' },
      { role: 'user', content: 'What can you do?' },
    ];

    const stream = await ai.run('@cf/meta/llama-2-7b-chat-int8', {
      messages,
      tools,
      stream: true,
    });

    return new Response(stream, {
      headers: {
        'content-type': 'text/event-stream',
      },
    });
  },
};

Multi-Modal Example

import { Composio } from '@composio/core';
import { CloudflareProvider } from '@composio/cloudflare';
import { Ai } from '@cloudflare/ai';

// Initialize Composio
const composio = new Composio({
  apiKey: process.env.COMPOSIO_API_KEY,
  provider: new CloudflareProvider(),
});

// In your Worker
export default {
  async fetch(request: Request, env: Env, ctx: ExecutionContext) {
    const ai = new Ai(env.AI);
    const tools = await composio.tools.get('user123', {
      toolkits: ['gmail'],
    });

    // Image analysis
    const imageResponse = await ai.run('@cf/microsoft/resnet-50', {
      image: await request.arrayBuffer(),
    });

    // Use image analysis in chat
    const messages = [
      { role: 'system', content: 'You are a helpful assistant.' },
      {
        role: 'user',
        content: 'What do you see in this image?',
        context: { image_analysis: imageResponse },
      },
    ];

    const stream = await ai.run('@cf/meta/llama-2-7b-chat-int8', {
      messages,
      tools,
      stream: true,
    });

    return new Response(stream, {
      headers: {
        'content-type': 'text/event-stream',
      },
    });
  },
};

API Reference

CloudflareProvider Class

The CloudflareProvider class extends BaseComposioProvider and provides Cloudflare-specific functionality.

Methods

executeToolCall(tool: ToolCall): Promise<string>

Executes a tool call and returns the result.

const result = await composio.provider.executeToolCall(toolCall);

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

License

ISC License

Support

For support, please visit our Documentation or join our Discord Community.