Skip to content

DemoMacro/agentor

Repository files navigation

Agentor

GitHub Contributor Covenant

A toolkit for building AI agents, with full TypeScript support.

Packages

Quick Start

Server

# Install with pnpm
$ pnpm add @agentor/server
import { createServer, openaiHandler, anthropicHandler } from "@agentor/server";
import { createDashScope } from "@agentor/dashscope";
import { createProviderRegistry } from "ai";

const dashscope = createDashScope({ apiKey: process.env.DASHSCOPE_API_KEY });

const server = createServer({
  registry: createProviderRegistry({ dashscope }),
  handlers: [openaiHandler(), anthropicHandler()],
});

server.listen(3000);
// POST /v1/chat/completions  → OpenAI compatible
// POST /v1/messages          → Anthropic compatible
// GET  /v1/models            → Model list

DashScope

# Install with npm
$ npm install @agentor/dashscope

# Install with yarn
$ yarn add @agentor/dashscope

# Install with pnpm
$ pnpm add @agentor/dashscope
import { dashscope } from "@agentor/dashscope";
import { generateText } from "ai";

// Basic chat
const result = await generateText({
  model: dashscope("qwen3.5-flash"),
  prompt: "Hello, world!",
});

console.log(result.text);

Chat WeCom

# Install with npm
$ npm install @agentor/chat-wecom

# Install with yarn
$ yarn add @agentor/chat-wecom

# Install with pnpm
$ pnpm add @agentor/chat-wecom
import { createWeComWebhookAdapter } from "@agentor/chat-wecom";

// Send message to group via webhook
const adapter = createWeComWebhookAdapter({
  key: process.env.WECOM_WEBHOOK_KEY!,
});

const threadId = adapter.encodeThreadId({ key: process.env.WECOM_WEBHOOK_KEY! });
const result = await adapter.postMessage(threadId, "Hello from Agentor!");

Chat QQ

# Install with pnpm
$ pnpm add @agentor/chat-qq
import { createQQBotAdapter } from "@agentor/chat-qq";

const adapter = createQQBotAdapter({
  mode: "websocket",
  appId: process.env.QQ_BOT_APP_ID!,
  clientSecret: process.env.QQ_BOT_CLIENT_SECRET!,
});

await adapter.initialize({
  processMessage: async (_adapter, threadId, factory) => {
    const message = await factory();
    await adapter.postMessage(threadId, message.text);
  },
});

Development

Prerequisites

  • Node.js 18.x or higher
  • pnpm 9.x or higher (recommended package manager)
  • Git for version control

Getting Started

  1. Clone the repository:

    git clone https://github.com/DemoMacro/agentor.git
    cd agentor
  2. Install dependencies:

    pnpm install
  3. Development mode:

    pnpm dev
  4. Build all packages:

    pnpm build

Development Commands

pnpm dev            # Development mode with watch
pnpm build          # Build all packages
pnpm check          # Run code formatting and linting

Contributing

We welcome contributions! Here's how to get started:

Quick Setup

  1. Fork the repository on GitHub

  2. Clone your fork:

    git clone https://github.com/YOUR_USERNAME/agentor.git
    cd agentor
  3. Add upstream remote:

    git remote add upstream https://github.com/DemoMacro/agentor.git
  4. Install dependencies:

    pnpm install
  5. Development mode:

    pnpm dev

Development Workflow

  1. Code: Follow our project standards
  2. Test: pnpm build && <test your changes>
  3. Commit: Use conventional commits (feat:, fix:, etc.)
  4. Push: Push to your fork
  5. Submit: Create a Pull Request to upstream repository

Support & Community

License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❤️ by Demo Macro

About

A toolkit for building AI agents, with full TypeScript support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors