Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

625 B
Raw Blame
/**
 * OpenAI × Composio — Cloudflare Workers
 *
 * Runs the same Tool Router agent path used by the Node entrypoint with
 * credentials supplied through Worker bindings.
 */
import {
  runToolRouterHackerNewsAgent,
  type ToolRouterHackerNewsAgentEnvironment,
} from './hackernews-agent/tool-router';

export type Env = Required<ToolRouterHackerNewsAgentEnvironment>;

export default {
  async fetch(_request: Request, env: Env): Promise<Response> {
    const text = await runToolRouterHackerNewsAgent(env);

    return new Response(text, {
      headers: { 'content-type': 'text/plain; charset=utf-8' },
    });
  },
};