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": {
"npmSpec": "@wecom/wecom-openclaw-plugin@2026.4.23",
"npmSpec": "@wecom/wecom-openclaw-plugin@2026.5.7",
"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?.pluginId).toBe("wecom-openclaw-plugin");
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);
expect(yuanbao?.id).toBe("yuanbao");

View File

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

View File

@@ -61,7 +61,7 @@ function cliInstallPath(pluginId: string): string {
function useProfileExtensionsDir(): string {
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 {
@@ -850,10 +850,10 @@ describe("plugins cli install", () => {
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().expectedIntegrity).toBe(
"sha512-bnzfdIEEu1/LFvcdyjaTkyxt27w6c7dqhkPezU62OWaqmcdFsUGR3T55USK/O9pIKsNcnL1Tnu1pqKYCWHFgWQ==",
"sha512-TCkP9as00WfEhgFWG8YL/rcmaWGIshAki2HQh83nTRccGfVBCoGjrEboTTqq3yDmK9koWTV11zi8u8A4dNtvug==",
);
expect(npmInstallCall().trustedSourceLinkedOfficialInstall).toBe(true);
});
@@ -896,15 +896,15 @@ describe("plugins cli install", () => {
installHooksFromNpmSpec.mockResolvedValue({
ok: false,
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");
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(
"sha512-bnzfdIEEu1/LFvcdyjaTkyxt27w6c7dqhkPezU62OWaqmcdFsUGR3T55USK/O9pIKsNcnL1Tnu1pqKYCWHFgWQ==",
"sha512-TCkP9as00WfEhgFWG8YL/rcmaWGIshAki2HQh83nTRccGfVBCoGjrEboTTqq3yDmK9koWTV11zi8u8A4dNtvug==",
);
});

View File

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

View File

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

View File

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

View File

@@ -660,7 +660,7 @@ describe("installPluginFromNpmSpec", () => {
expect(result.ok).toBe(false);
if (!result.ok) {
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(wecomByPlugin)).toBe("wecom-openclaw-plugin");
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(resolveOfficialExternalPluginInstall(yuanbaoByChannel)?.npmSpec).toBe(

View File

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