feat: prepare Zhinian desktop pilot
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-05-07 21:49:20 +08:00
parent cddaf37016
commit 0abc48189c
103 changed files with 10975 additions and 2049 deletions

View File

@@ -1,9 +1,8 @@
/**
* Shared OpenClaw Plugin Install Utilities
*
* Provides version-aware install/upgrade logic for bundled OpenClaw plugins
* (DingTalk, WeCom, Feishu, WeChat). Used both at app startup (to auto-upgrade
* stale plugins) and when a user configures a channel.
* Provides version-aware install/upgrade logic for bundled OpenClaw plugins.
* 智念助手内测包只主动管理核心插件,避免无用渠道插件被重新拉回。
*
* Note: QQBot was moved to a built-in channel in OpenClaw 3.31 and is no longer
* managed as a plugin.
@@ -115,11 +114,9 @@ function toErrorDiagnostic(error: unknown): { code?: string; name?: string; mess
// ── Known plugin-ID corrections ─────────────────────────────────────────────
// Some npm packages ship with an openclaw.plugin.json whose "id" field
// doesn't match the ID the plugin code actually exports. After copying we
// patch both the manifest AND the compiled JS so the Gateway accepts them.
const MANIFEST_ID_FIXES: Record<string, string> = {
'wecom-openclaw-plugin': 'wecom',
};
// doesn't match the ID the plugin code actually exports. Keep this hook for
// future bundled plugins that may need it.
const MANIFEST_ID_FIXES: Record<string, string> = {};
/**
* After a plugin has been copied to ~/.openclaw/extensions/<dir>, fix any
@@ -231,10 +228,6 @@ function patchPluginEntryIds(targetDir: string): void {
// ── Plugin npm name mapping ──────────────────────────────────────────────────
const PLUGIN_NPM_NAMES: Record<string, string> = {
dingtalk: '@soimy/dingtalk',
wecom: '@wecom/wecom-openclaw-plugin',
'feishu-openclaw-plugin': '@larksuite/openclaw-lark',
'openclaw-weixin': '@tencent-weixin/openclaw-weixin',
};
@@ -498,24 +491,6 @@ export function buildCandidateSources(pluginDirName: string): string[] {
// ── Per-channel plugin helpers ───────────────────────────────────────────────
export function ensureDingTalkPluginInstalled(): { installed: boolean; warning?: string } {
return ensurePluginInstalled('dingtalk', buildCandidateSources('dingtalk'), 'DingTalk');
}
export function ensureWeComPluginInstalled(): { installed: boolean; warning?: string } {
return ensurePluginInstalled('wecom', buildCandidateSources('wecom'), 'WeCom');
}
export function ensureFeishuPluginInstalled(): { installed: boolean; warning?: string } {
return ensurePluginInstalled(
'feishu-openclaw-plugin',
buildCandidateSources('feishu-openclaw-plugin'),
'Feishu',
);
}
export function ensureWeChatPluginInstalled(): { installed: boolean; warning?: string } {
return ensurePluginInstalled('openclaw-weixin', buildCandidateSources('openclaw-weixin'), 'WeChat');
}
@@ -530,10 +505,6 @@ export function ensureCloudSyncPluginInstalled(): { installed: boolean; warning?
* All bundled plugins, in the same order as after-pack.cjs BUNDLED_PLUGINS.
*/
const ALL_BUNDLED_PLUGINS = [
{ fn: ensureDingTalkPluginInstalled, label: 'DingTalk' },
{ fn: ensureWeComPluginInstalled, label: 'WeCom' },
{ fn: ensureFeishuPluginInstalled, label: 'Feishu' },
{ fn: ensureWeChatPluginInstalled, label: 'WeChat' },
{ fn: ensureCloudSyncPluginInstalled, label: 'Cloud Sync' },
] as const;