fix(channel): refresh wecom onboarding install

This commit is contained in:
brokemac79
2026-05-10 19:53:12 +01:00
committed by Peter Steinberger
parent dfead3198d
commit f2cbe9ecc5
10 changed files with 18 additions and 15 deletions

View File

@@ -35,9 +35,9 @@
} }
}, },
"install": { "install": {
"npmSpec": "@wecom/wecom-openclaw-plugin@2026.4.23", "npmSpec": "@wecom/wecom-openclaw-plugin@2026.5.7",
"defaultChoice": "npm", "defaultChoice": "npm",
"expectedIntegrity": "sha512-bnzfdIEEu1/LFvcdyjaTkyxt27w6c7dqhkPezU62OWaqmcdFsUGR3T55USK/O9pIKsNcnL1Tnu1pqKYCWHFgWQ==" "expectedIntegrity": "sha512-TCkP9as00WfEhgFWG8YL/rcmaWGIshAki2HQh83nTRccGfVBCoGjrEboTTqq3yDmK9koWTV11zi8u8A4dNtvug=="
} }
} }
}, },

View File

@@ -12,7 +12,7 @@ describe("channel plugin catalog", () => {
expect(wecom?.id).toBe("wecom"); expect(wecom?.id).toBe("wecom");
expect(wecom?.pluginId).toBe("wecom-openclaw-plugin"); expect(wecom?.pluginId).toBe("wecom-openclaw-plugin");
expect(wecom?.trustedSourceLinkedOfficialInstall).toBe(true); expect(wecom?.trustedSourceLinkedOfficialInstall).toBe(true);
expect(wecom?.install?.npmSpec).toBe("@wecom/wecom-openclaw-plugin@2026.4.23"); expect(wecom?.install?.npmSpec).toBe("@wecom/wecom-openclaw-plugin@2026.5.7");
const yuanbao = getChannelPluginCatalogEntry("yuanbao", options); const yuanbao = getChannelPluginCatalogEntry("yuanbao", options);
expect(yuanbao?.id).toBe("yuanbao"); expect(yuanbao?.id).toBe("yuanbao");

View File

@@ -39,7 +39,7 @@ describeOfficialFallbackChannelCatalogContract({
describeChannelCatalogEntryContract({ describeChannelCatalogEntryContract({
channelId: "wecom", channelId: "wecom",
npmSpec: "@wecom/wecom-openclaw-plugin@2026.4.23", npmSpec: "@wecom/wecom-openclaw-plugin@2026.5.7",
alias: "wework", alias: "wework",
}); });

View File

@@ -61,7 +61,7 @@ function cliInstallPath(pluginId: string): string {
function useProfileExtensionsDir(): string { function useProfileExtensionsDir(): string {
process.env.OPENCLAW_STATE_DIR = PROFILE_STATE_ROOT; process.env.OPENCLAW_STATE_DIR = PROFILE_STATE_ROOT;
return path.join(PROFILE_STATE_ROOT, "extensions"); return path.resolve(PROFILE_STATE_ROOT, "extensions");
} }
function createEnabledPluginConfig(pluginId: string): OpenClawConfig { function createEnabledPluginConfig(pluginId: string): OpenClawConfig {
@@ -850,10 +850,10 @@ describe("plugins cli install", () => {
await runPluginsCommand(["plugins", "install", "wecom"]); await runPluginsCommand(["plugins", "install", "wecom"]);
expect(npmInstallCall().spec).toBe("@wecom/wecom-openclaw-plugin@2026.4.23"); expect(npmInstallCall().spec).toBe("@wecom/wecom-openclaw-plugin@2026.5.7");
expect(npmInstallCall().expectedPluginId).toBe("wecom-openclaw-plugin"); expect(npmInstallCall().expectedPluginId).toBe("wecom-openclaw-plugin");
expect(npmInstallCall().expectedIntegrity).toBe( expect(npmInstallCall().expectedIntegrity).toBe(
"sha512-bnzfdIEEu1/LFvcdyjaTkyxt27w6c7dqhkPezU62OWaqmcdFsUGR3T55USK/O9pIKsNcnL1Tnu1pqKYCWHFgWQ==", "sha512-TCkP9as00WfEhgFWG8YL/rcmaWGIshAki2HQh83nTRccGfVBCoGjrEboTTqq3yDmK9koWTV11zi8u8A4dNtvug==",
); );
expect(npmInstallCall().trustedSourceLinkedOfficialInstall).toBe(true); expect(npmInstallCall().trustedSourceLinkedOfficialInstall).toBe(true);
}); });
@@ -896,15 +896,15 @@ describe("plugins cli install", () => {
installHooksFromNpmSpec.mockResolvedValue({ installHooksFromNpmSpec.mockResolvedValue({
ok: false, ok: false,
error: error:
"aborted: npm package integrity drift detected for @wecom/wecom-openclaw-plugin@2026.4.23", "aborted: npm package integrity drift detected for @wecom/wecom-openclaw-plugin@2026.5.7",
}); });
await expect(runPluginsCommand(["plugins", "install", "wecom"])).rejects.toThrow("__exit__:1"); await expect(runPluginsCommand(["plugins", "install", "wecom"])).rejects.toThrow("__exit__:1");
expect(npmInstallCall().trustedSourceLinkedOfficialInstall).toBe(true); expect(npmInstallCall().trustedSourceLinkedOfficialInstall).toBe(true);
expect(hookNpmInstallCall().spec).toBe("@wecom/wecom-openclaw-plugin@2026.4.23"); expect(hookNpmInstallCall().spec).toBe("@wecom/wecom-openclaw-plugin@2026.5.7");
expect(hookNpmInstallCall().expectedIntegrity).toBe( expect(hookNpmInstallCall().expectedIntegrity).toBe(
"sha512-bnzfdIEEu1/LFvcdyjaTkyxt27w6c7dqhkPezU62OWaqmcdFsUGR3T55USK/O9pIKsNcnL1Tnu1pqKYCWHFgWQ==", "sha512-TCkP9as00WfEhgFWG8YL/rcmaWGIshAki2HQh83nTRccGfVBCoGjrEboTTqq3yDmK9koWTV11zi8u8A4dNtvug==",
); );
}); });

View File

@@ -417,7 +417,7 @@ describe("ensureChannelSetupPluginInstalled", () => {
}); });
expectRecordFields(requireMockCallArg(installPluginFromNpmSpec, 0), "npm install args", { expectRecordFields(requireMockCallArg(installPluginFromNpmSpec, 0), "npm install args", {
extensionsDir: path.join(profileStateDir, "extensions"), extensionsDir: path.resolve(profileStateDir, "extensions"),
spec: bundledChatNpmSpec, spec: bundledChatNpmSpec,
}); });
}); });

View File

@@ -119,6 +119,7 @@ type NpmPackInstallCall = {
type NpmSpecInstallCall = { type NpmSpecInstallCall = {
expectedIntegrity?: string; expectedIntegrity?: string;
expectedPluginId?: string; expectedPluginId?: string;
mode?: string;
spec?: string; spec?: string;
timeoutMs?: number; timeoutMs?: number;
trustedSourceLinkedOfficialInstall?: boolean; trustedSourceLinkedOfficialInstall?: boolean;
@@ -445,6 +446,7 @@ describe("ensureOnboardingPluginInstalled", () => {
NpmSpecInstallCall, NpmSpecInstallCall,
]; ];
expect(npmCall.spec).toBe("@wecom/wecom-openclaw-plugin@1.2.3"); expect(npmCall.spec).toBe("@wecom/wecom-openclaw-plugin@1.2.3");
expect(npmCall.mode).toBe("update");
expect(npmCall.expectedPluginId).toBe("demo-plugin"); expect(npmCall.expectedPluginId).toBe("demo-plugin");
expect(npmCall.expectedIntegrity).toBe("sha512-wecom"); expect(npmCall.expectedIntegrity).toBe("sha512-wecom");
expect(npmCall.trustedSourceLinkedOfficialInstall).toBe(true); expect(npmCall.trustedSourceLinkedOfficialInstall).toBe(true);

View File

@@ -625,6 +625,7 @@ async function installPluginFromNpmSpecWithProgress(params: {
const result = await withTimeout( const result = await withTimeout(
installPluginFromNpmSpec({ installPluginFromNpmSpec({
spec: params.npmSpec, spec: params.npmSpec,
mode: "update",
timeoutMs: ONBOARDING_PLUGIN_INSTALL_TIMEOUT_MS, timeoutMs: ONBOARDING_PLUGIN_INSTALL_TIMEOUT_MS,
expectedPluginId: params.entry.pluginId, expectedPluginId: params.entry.pluginId,
expectedIntegrity: params.entry.install.expectedIntegrity, expectedIntegrity: params.entry.install.expectedIntegrity,

View File

@@ -660,7 +660,7 @@ describe("installPluginFromNpmSpec", () => {
expect(result.ok).toBe(false); expect(result.ok).toBe(false);
if (!result.ok) { if (!result.ok) {
expect(result.error).toContain("plain-crypto-js"); expect(result.error).toContain("plain-crypto-js");
expect(result.error).toContain("node_modules/plain-crypto-js"); expect(result.error).toContain(path.join("node_modules", "plain-crypto-js"));
} }
}); });

View File

@@ -24,7 +24,7 @@ describe("official external plugin catalog", () => {
expect(resolveOfficialExternalPluginId(wecomByChannel)).toBe("wecom-openclaw-plugin"); expect(resolveOfficialExternalPluginId(wecomByChannel)).toBe("wecom-openclaw-plugin");
expect(resolveOfficialExternalPluginId(wecomByPlugin)).toBe("wecom-openclaw-plugin"); expect(resolveOfficialExternalPluginId(wecomByPlugin)).toBe("wecom-openclaw-plugin");
expect(resolveOfficialExternalPluginInstall(wecomByChannel)?.npmSpec).toBe( expect(resolveOfficialExternalPluginInstall(wecomByChannel)?.npmSpec).toBe(
"@wecom/wecom-openclaw-plugin@2026.4.23", "@wecom/wecom-openclaw-plugin@2026.5.7",
); );
expect(resolveOfficialExternalPluginId(yuanbaoByChannel)).toBe("openclaw-plugin-yuanbao"); expect(resolveOfficialExternalPluginId(yuanbaoByChannel)).toBe("openclaw-plugin-yuanbao");
expect(resolveOfficialExternalPluginInstall(yuanbaoByChannel)?.npmSpec).toBe( expect(resolveOfficialExternalPluginInstall(yuanbaoByChannel)?.npmSpec).toBe(

View File

@@ -140,10 +140,10 @@ describe("buildOfficialChannelCatalog", () => {
aliases: ["qywx", "wework", "enterprise-wechat"], aliases: ["qywx", "wework", "enterprise-wechat"],
}, },
install: { install: {
npmSpec: "@wecom/wecom-openclaw-plugin@2026.4.23", npmSpec: "@wecom/wecom-openclaw-plugin@2026.5.7",
defaultChoice: "npm", defaultChoice: "npm",
expectedIntegrity: expectedIntegrity:
"sha512-bnzfdIEEu1/LFvcdyjaTkyxt27w6c7dqhkPezU62OWaqmcdFsUGR3T55USK/O9pIKsNcnL1Tnu1pqKYCWHFgWQ==", "sha512-TCkP9as00WfEhgFWG8YL/rcmaWGIshAki2HQh83nTRccGfVBCoGjrEboTTqq3yDmK9koWTV11zi8u8A4dNtvug==",
}, },
}); });
expect( expect(