A toolkit for building AI agents, with full TypeScript support.
- @agentor/server - AI API compatibility layer (OpenAI / Anthropic compatible endpoints)
- @agentor/dashscope - Alibaba Cloud DashScope (Bailian) API provider
- @agentor/chat-wecom - 企业微信 (WeCom) Chat SDK adapter
- @agentor/chat-qq - QQ Bot Chat SDK adapter
# Install with pnpm
$ pnpm add @agentor/serverimport { 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# Install with npm
$ npm install @agentor/dashscope
# Install with yarn
$ yarn add @agentor/dashscope
# Install with pnpm
$ pnpm add @agentor/dashscopeimport { 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);# Install with npm
$ npm install @agentor/chat-wecom
# Install with yarn
$ yarn add @agentor/chat-wecom
# Install with pnpm
$ pnpm add @agentor/chat-wecomimport { 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!");# Install with pnpm
$ pnpm add @agentor/chat-qqimport { 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);
},
});- Node.js 18.x or higher
- pnpm 9.x or higher (recommended package manager)
- Git for version control
-
Clone the repository:
git clone https://github.com/DemoMacro/agentor.git cd agentor -
Install dependencies:
pnpm install
-
Development mode:
pnpm dev
-
Build all packages:
pnpm build
pnpm dev # Development mode with watch
pnpm build # Build all packages
pnpm check # Run code formatting and lintingWe welcome contributions! Here's how to get started:
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/agentor.git cd agentor -
Add upstream remote:
git remote add upstream https://github.com/DemoMacro/agentor.git
-
Install dependencies:
pnpm install
-
Development mode:
pnpm dev
- Code: Follow our project standards
- Test:
pnpm build && <test your changes> - Commit: Use conventional commits (
feat:,fix:, etc.) - Push: Push to your fork
- Submit: Create a Pull Request to upstream repository
- 📫 Report Issues
- 📚 Server Documentation
- 📚 DashScope Documentation
- 📚 Chat WeCom Documentation
- 📚 Chat QQ Documentation
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Demo Macro