qwen-code/packages/channels/base/src/index.ts
tanzhenxin 8a6ed128ea feat(channels): add ChannelPlugin interface and registry-based factory
Refactor channel system to use a formal plugin interface:

- Add ChannelPlugin interface to @qwen-code/channel-base (channelType,
  displayName, requiredConfigFields, createChannel factory)
- Each built-in adapter (Telegram, WeChat, DingTalk) exports a plugin object
- Replace hardcoded if/else factory with a Map-based channel registry
- Config validation now uses plugin's requiredConfigFields dynamically
- ChannelType changed from fixed union to string for extensibility
- Multi-channel mode now picks model from first channel config

This is the foundation for external plugin support — built-in channels
go through the exact same code path that third-party plugins will use.
2026-03-26 12:34:31 +00:00

26 lines
786 B
TypeScript

export { AcpBridge } from './AcpBridge.js';
export type {
AcpBridgeOptions,
AvailableCommand,
ToolCallEvent,
} from './AcpBridge.js';
export { ChannelBase } from './ChannelBase.js';
export type { ChannelBaseOptions } from './ChannelBase.js';
export { PairingStore } from './PairingStore.js';
export type { PairingRequest } from './PairingStore.js';
export { GroupGate } from './GroupGate.js';
export type { GroupCheckResult } from './GroupGate.js';
export { SenderGate } from './SenderGate.js';
export type { SenderCheckResult } from './SenderGate.js';
export { SessionRouter } from './SessionRouter.js';
export type {
ChannelConfig,
ChannelPlugin,
ChannelType,
Envelope,
GroupConfig,
GroupPolicy,
SenderPolicy,
SessionScope,
SessionTarget,
} from './types.js';