OpenClaw 完整备份 - 2026-03-21

This commit is contained in:
huan
2026-03-21 15:31:06 +08:00
commit 8dd73a1d62
569 changed files with 76792 additions and 0 deletions
+137
View File
@@ -0,0 +1,137 @@
export { DEFAULT_ACCOUNT_ID as DINGTALK_DEFAULT_ACCOUNT_ID, DingtalkConfig, DingtalkSendResult, ResolvedDingtalkAccount, dingtalkPlugin, getDingtalkRuntime, sendMessageDingtalk, setDingtalkRuntime } from '@openclaw-china/dingtalk';
export { DEFAULT_ACCOUNT_ID as FEISHU_DEFAULT_ACCOUNT_ID, FeishuConfig, FeishuSendResult, ResolvedFeishuAccount, feishuPlugin, getFeishuRuntime, sendMessageFeishu, setFeishuRuntime } from '@openclaw-china/feishu-china';
export { ResolvedWecomAccount, DEFAULT_ACCOUNT_ID as WECOM_DEFAULT_ACCOUNT_ID, WecomConfig, WecomInboundMessage, getWecomRuntime, setWecomRuntime, wecomPlugin } from '@openclaw-china/wecom';
export { AccessTokenCacheEntry, ResolvedWecomAppAccount, DEFAULT_ACCOUNT_ID as WECOM_APP_DEFAULT_ACCOUNT_ID, WecomAppConfig, WecomAppDmPolicy, WecomAppInboundMessage, WecomAppSendTarget, clearAccessTokenCache, clearAllAccessTokenCache, downloadAndSendImage, getAccessToken, getWecomAppRuntime, sendWecomAppImageMessage, sendWecomAppMarkdownMessage, sendWecomAppMessage, setWecomAppRuntime, stripMarkdown, wecomAppPlugin } from '@openclaw-china/wecom-app';
export { ResolvedWecomKfAccount, DEFAULT_ACCOUNT_ID as WECOM_KF_DEFAULT_ACCOUNT_ID, WecomKfAccountConfig, WecomKfConfig, WecomKfDmPolicy, SyncMsgItem as WecomKfSyncMsgItem, SyncMsgResponse as WecomKfSyncMsgResponse, getWecomKfRuntime, setWecomKfRuntime, wecomKfPlugin } from '@openclaw-china/wecom-kf';
export { DEFAULT_ACCOUNT_ID as QQBOT_DEFAULT_ACCOUNT_ID, QQBotConfig, QQBotSendResult, ResolvedQQBotAccount, getQQBotRuntime, qqbotPlugin, setQQBotRuntime } from '@openclaw-china/qqbot';
/**
* @openclaw-china/channels
* 统一渠道包入口
*
* 导出所有渠道插件,提供统一注册函数
*
* Requirements: Unified Package Entry, Unified Distribution
*/
/**
* 渠道配置接口
*/
interface ChannelConfig {
/** 是否启用该渠道 */
enabled?: boolean;
[key: string]: unknown;
}
interface WecomRouteConfig extends ChannelConfig {
webhookPath?: string;
accounts?: Record<string, {
webhookPath?: string;
}>;
}
interface WecomAppRouteConfig extends ChannelConfig {
webhookPath?: string;
accounts?: Record<string, {
webhookPath?: string;
}>;
}
interface WecomKfRouteConfig extends ChannelConfig {
webhookPath?: string;
accounts?: Record<string, {
webhookPath?: string;
}>;
}
/**
* Moltbot 配置接口(符合官方约定)
* 配置路径: channels.<id>.enabled
*/
interface MoltbotConfig {
channels?: {
dingtalk?: ChannelConfig;
"feishu-china"?: ChannelConfig;
wecom?: WecomRouteConfig;
"wecom-app"?: WecomAppRouteConfig;
"wecom-kf"?: WecomKfRouteConfig;
qqbot?: ChannelConfig;
qq?: ChannelConfig;
[key: string]: ChannelConfig | undefined;
};
[key: string]: unknown;
}
/**
* Moltbot 插件 API 接口
*/
interface MoltbotPluginApi {
registerChannel: (opts: {
plugin: unknown;
}) => void;
registerCli?: (registrar: (ctx: {
program: unknown;
config?: MoltbotConfig;
}) => void | Promise<void>, opts?: {
commands?: string[];
}) => void;
logger?: {
info?: (message: string) => void;
warn?: (message: string) => void;
error?: (message: string) => void;
};
runtime?: {
config?: {
writeConfigFile?: (cfg: unknown) => Promise<void>;
};
};
config?: MoltbotConfig;
[key: string]: unknown;
}
/**
* 支持的渠道列表
*/
declare const SUPPORTED_CHANNELS: readonly ["dingtalk", "feishu-china", "wecom", "wecom-app", "wecom-kf", "qqbot"];
type SupportedChannel = (typeof SUPPORTED_CHANNELS)[number];
/**
* 根据 Moltbot 配置注册启用的渠道
*
* 符合 Moltbot 官方约定:从 cfg.channels.<id>.enabled 读取配置
*
* @param api Moltbot 鎻掍欢 API
* @param cfg Moltbot 配置(可选,默认从 api.config 读取)
*
* @example
* ```ts
* // moltbot.json 配置
* {
* "channels": {
* "dingtalk": {
* "enabled": true,
* "clientId": "...",
* "clientSecret": "..."
* }
* }
* }
* ```
*/
declare function registerChannelsByConfig(api: MoltbotPluginApi, cfg?: MoltbotConfig): void;
/**
* 统一渠道插件定义
*
* 包含所有支持的渠道,通过配置启用
* 配置路径符合 Moltbot 官方约定: channels.<id>
*/
declare const channelsPlugin: {
id: string;
name: string;
description: string;
configSchema: {
type: string;
additionalProperties: boolean;
properties: {};
};
/**
* 注册所有启用的渠道
*
* 从 api.config.channels.<id>.enabled 读取配置
*/
register(api: MoltbotPluginApi): void;
};
export { type ChannelConfig, type MoltbotConfig, type MoltbotPluginApi, SUPPORTED_CHANNELS, type SupportedChannel, type WecomAppRouteConfig, type WecomKfRouteConfig, type WecomRouteConfig, channelsPlugin as default, registerChannelsByConfig };
+88
View File
@@ -0,0 +1,88 @@
import dingtalkEntry from '@openclaw-china/dingtalk';
export { DEFAULT_ACCOUNT_ID as DINGTALK_DEFAULT_ACCOUNT_ID, dingtalkPlugin, getDingtalkRuntime, sendMessageDingtalk, setDingtalkRuntime } from '@openclaw-china/dingtalk';
import feishuEntry from '@openclaw-china/feishu-china';
export { DEFAULT_ACCOUNT_ID as FEISHU_DEFAULT_ACCOUNT_ID, feishuPlugin, getFeishuRuntime, sendMessageFeishu, setFeishuRuntime } from '@openclaw-china/feishu-china';
import wecomEntry from '@openclaw-china/wecom';
export { DEFAULT_ACCOUNT_ID as WECOM_DEFAULT_ACCOUNT_ID, getWecomRuntime, setWecomRuntime, wecomPlugin } from '@openclaw-china/wecom';
import wecomAppEntry from '@openclaw-china/wecom-app';
export { DEFAULT_ACCOUNT_ID as WECOM_APP_DEFAULT_ACCOUNT_ID, clearAccessTokenCache, clearAllAccessTokenCache, downloadAndSendImage, getAccessToken, getWecomAppRuntime, sendWecomAppImageMessage, sendWecomAppMarkdownMessage, sendWecomAppMessage, setWecomAppRuntime, stripMarkdown, wecomAppPlugin } from '@openclaw-china/wecom-app';
import wecomKfEntry from '@openclaw-china/wecom-kf';
export { DEFAULT_ACCOUNT_ID as WECOM_KF_DEFAULT_ACCOUNT_ID, getWecomKfRuntime, setWecomKfRuntime, wecomKfPlugin } from '@openclaw-china/wecom-kf';
import qqbotEntry from '@openclaw-china/qqbot';
export { DEFAULT_ACCOUNT_ID as QQBOT_DEFAULT_ACCOUNT_ID, getQQBotRuntime, qqbotPlugin, setQQBotRuntime } from '@openclaw-china/qqbot';
import { registerChinaSetupCli, showChinaInstallHint } from '@openclaw-china/shared';
// src/index.ts
var SUPPORTED_CHANNELS = ["dingtalk", "feishu-china", "wecom", "wecom-app", "wecom-kf", "qqbot"];
var channelPlugins = {
dingtalk: {
register: (api) => {
dingtalkEntry.register(api);
}
},
"feishu-china": {
register: (api) => {
feishuEntry.register(api);
}
},
wecom: {
register: (api) => {
wecomEntry.register(api);
}
},
"wecom-app": {
register: (api) => {
wecomAppEntry.register(api);
}
},
"wecom-kf": {
register: (api) => {
wecomKfEntry.register(api);
}
},
qqbot: {
register: (api) => {
qqbotEntry.register(api);
}
}
};
function registerChannelsByConfig(api, cfg) {
const config = cfg ?? api.config;
const channelsConfig = config?.channels;
if (!channelsConfig) {
return;
}
for (const channelId of SUPPORTED_CHANNELS) {
const channelConfig = channelsConfig[channelId];
if (!channelConfig?.enabled) {
continue;
}
const plugin = channelPlugins[channelId];
plugin.register(api);
}
}
var channelsPlugin = {
id: "channels",
name: "Moltbot China Channels",
description: "\u7EDF\u4E00\u6E20\u9053\u5305\uFF0C\u652F\u6301\u9489\u9489\u3001\u98DE\u4E66\u3001\u4F01\u4E1A\u5FAE\u4FE1\u3001QQ Bot",
configSchema: {
type: "object",
additionalProperties: false,
properties: {}
},
/**
* 注册所有启用的渠道
*
* 从 api.config.channels.<id>.enabled 读取配置
*/
register(api) {
registerChinaSetupCli(api, { channels: SUPPORTED_CHANNELS });
showChinaInstallHint(api);
registerChannelsByConfig(api);
}
};
var index_default = channelsPlugin;
export { SUPPORTED_CHANNELS, index_default as default, registerChannelsByConfig };
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,12 @@
{
"id": "channels",
"name": "Moltbot China Channels",
"description": "统一渠道包,支持钉钉、飞书、企业微信智能机器人、企业微信自建应用、微信客服、QQ Bot",
"version": "0.1.0",
"channels": ["dingtalk", "feishu-china", "wecom", "wecom-app", "wecom-kf", "qqbot"],
"configSchema": {
"type": "object",
"additionalProperties": false,
"properties": {}
}
}
File diff suppressed because it is too large Load Diff
+79
View File
@@ -0,0 +1,79 @@
{
"name": "@openclaw-china/channels",
"version": "2026.3.18",
"type": "module",
"description": "Unified package for all Moltbot China channel plugins",
"license": "MIT",
"files": [
"dist",
"openclaw.plugin.json",
"moltbot.plugin.json",
"clawdbot.plugin.json"
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"openclaw": {
"extensions": [
"./dist/index.js"
],
"install": {
"npmSpec": "@openclaw-china/channels",
"localPath": ".",
"defaultChoice": "npm"
}
},
"moltbot": {
"extensions": [
"./dist/index.js"
],
"install": {
"npmSpec": "@openclaw-china/channels",
"localPath": ".",
"defaultChoice": "npm"
}
},
"clawdbot": {
"extensions": [
"./dist/index.js"
],
"install": {
"npmSpec": "@openclaw-china/channels",
"localPath": ".",
"defaultChoice": "npm"
}
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"clean": "rimraf dist"
},
"dependencies": {
"@clack/prompts": "^1.0.0",
"@openclaw-china/dingtalk": "2026.3.18",
"@openclaw-china/feishu-china": "2026.3.18",
"@openclaw-china/qqbot": "2026.3.18",
"@openclaw-china/shared": "2026.3.18",
"@openclaw-china/wecom": "2026.3.18",
"@openclaw-china/wecom-app": "2026.3.18",
"@openclaw-china/wecom-kf": "2026.3.18"
},
"devDependencies": {
"@types/node": "^22.0.0",
"tsup": "^8.2.0",
"typescript": "^5.7.0"
},
"peerDependencies": {
"moltbot": ">=0.1.0"
},
"peerDependenciesMeta": {
"moltbot": {
"optional": true
}
}
}