
























@@ -734,7 +734,7 @@ describe("plugins cli install", () => {
734734expect(writeConfigFile).toHaveBeenCalledWith(enabledCfg);
735735});
736736737-it("passes official external catalog integrity to npm installs", async () => {
737+it("passes third-party external catalog integrity with catalog install trust", async () => {
738738const cfg = createEmptyPluginConfig();
739739const enabledCfg = createEnabledPluginConfig("wecom-openclaw-plugin");
740740loadConfig.mockReturnValue(cfg);
@@ -796,7 +796,7 @@ describe("plugins cli install", () => {
796796},
797797);
798798799-it("passes official external catalog integrity to hook-pack fallback", async () => {
799+it("passes third-party external catalog integrity to hook-pack fallback", async () => {
800800loadConfig.mockReturnValue(createEmptyPluginConfig());
801801findBundledPluginSourceMock.mockReturnValue(undefined);
802802installPluginFromNpmSpec.mockResolvedValue({
@@ -992,6 +992,38 @@ describe("plugins cli install", () => {
992992expect(installPluginFromClawHub).not.toHaveBeenCalled();
993993});
994994995+it("marks catalog npm package installs with alternate selectors as trusted", async () => {
996+const cfg = createEmptyPluginConfig();
997+const enabledCfg = createEnabledPluginConfig("wecom-openclaw-plugin");
998+999+loadConfig.mockReturnValue(cfg);
1000+installPluginFromNpmSpec.mockResolvedValue(
1001+createNpmPluginInstallResult("wecom-openclaw-plugin"),
1002+);
1003+enablePluginInConfig.mockReturnValue({ config: enabledCfg });
1004+recordPluginInstall.mockReturnValue(enabledCfg);
1005+applyExclusiveSlotSelection.mockReturnValue({
1006+config: enabledCfg,
1007+warnings: [],
1008+});
1009+1010+await runPluginsCommand(["plugins", "install", "@wecom/wecom-openclaw-plugin@latest"]);
1011+1012+expect(installPluginFromNpmSpec).toHaveBeenCalledWith(
1013+expect.objectContaining({
1014+spec: "@wecom/wecom-openclaw-plugin@latest",
1015+expectedPluginId: "wecom-openclaw-plugin",
1016+trustedSourceLinkedOfficialInstall: true,
1017+}),
1018+);
1019+expect(installPluginFromNpmSpec).toHaveBeenCalledWith(
1020+expect.not.objectContaining({
1021+expectedIntegrity: expect.any(String),
1022+}),
1023+);
1024+expect(installPluginFromClawHub).not.toHaveBeenCalled();
1025+});
1026+9951027it("passes the active profile extensions dir to npm installs", async () => {
9961028const extensionsDir = useProfileExtensionsDir();
9971029const cfg = createEmptyPluginConfig();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。