Plugins extend Yandu with new capabilities: translation engines, feed sources, document converters, search backends, instant messaging bots, and more.
Everything is a plugin. There is no special "translation provider" or "feed adapter" -- a plugin registers one or more capabilities via a single unified interface.
npm init -y
npm install @yandu/types// src/index.ts
import type { Plugin } from '@yandu/types';
export default {
name: 'yandu-plugin-hello',
version: '1.0.0',
register(system) {
system.registry.register({
name: 'hello',
description: 'Say hello',
inputSchema: { type: 'object', properties: { name: { type: 'string' } } },
execute: async (args) => ({ content: `Hello, ${args.name}!` }),
});
},
} satisfies Plugin;Package naming: @yandu/plugin-* (official / built-in) or yandu-plugin-* (third-party). Yandu auto-discovers both from node_modules at startup. Official plugins must use the @yandu/ scope to prevent namespace collisions.
| Type | Description | Interface |
|---|---|---|
translation |
Translate text between languages | TranslationAdapter |
feed |
Fetch papers from academic sources | FeedAdapter |
converter |
Convert documents (e.g. PDF to Markdown) | ContentConverter |
search |
Search papers across backends | SearchAdapter |
im |
Instant messaging bot integration | IMAdapter |
embedding |
Text embedding models | EmbeddingAdapter |
import |
Import papers from external libraries | ImportAdapter |
tool |
Agent-accessible tool | Tool |
config |
Settings schema only (no runtime code) | ConfigSchema |
Read SPEC.md for the complete specification.
Plugins can provide their own translations. See I18N.md for locale file conventions, namespace rules, and programmatic API.
Plugin developers do not need the Yandu source code. See DEV.md for:
@yandu/devtest harness- Mock
KernelSystemfor unit testing npx yandu-plugin-devCLI for interactive debugging- Hot reload during development
See examples/ for working plugin samples.
MIT