























@@ -1,4 +1,14 @@
11import { beforeEach, describe, expect, it, vi } from "vitest";
2+import { resolveRegistryUpdateChannel } from "../../../infra/update-channels.js";
3+import { resolveNpmInstallSpecsForUpdateChannel } from "../../../plugins/install-channel-specs.js";
4+import { VERSION } from "../../../version.js";
5+6+function expectedNpmInstallSpec(spec: string): string {
7+return resolveNpmInstallSpecsForUpdateChannel({
8+ spec,
9+updateChannel: resolveRegistryUpdateChannel({ currentVersion: VERSION }),
10+}).installSpec;
11+}
212313const mocks = vi.hoisted(() => ({
414installPluginFromClawHub: vi.fn(),
@@ -354,13 +364,13 @@ describe("repairMissingConfiguredPluginInstalls", () => {
354364expect(mocks.installPluginFromClawHub).not.toHaveBeenCalled();
355365expect(mocks.installPluginFromNpmSpec).toHaveBeenCalledWith(
356366expect.objectContaining({
357-spec: "@openclaw/twitch",
367+spec: expectedNpmInstallSpec("@openclaw/twitch"),
358368expectedPluginId: "twitch",
359369trustedSourceLinkedOfficialInstall: true,
360370}),
361371);
362372expect(result.changes).toEqual([
363-'Installed missing configured plugin "twitch" from @openclaw/twitch.',
373+`Installed missing configured plugin "twitch" from ${expectedNpmInstallSpec("@openclaw/twitch")}.`,
364374]);
365375});
366376@@ -406,12 +416,12 @@ describe("repairMissingConfiguredPluginInstalls", () => {
406416expect(mocks.installPluginFromClawHub).not.toHaveBeenCalled();
407417expect(mocks.installPluginFromNpmSpec).toHaveBeenCalledWith(
408418expect.objectContaining({
409-spec: "@openclaw/diagnostics-otel",
419+spec: expectedNpmInstallSpec("@openclaw/diagnostics-otel"),
410420expectedPluginId: "diagnostics-otel",
411421}),
412422);
413423expect(result.changes).toEqual([
414-'Installed missing configured plugin "diagnostics-otel" from @openclaw/diagnostics-otel.',
424+`Installed missing configured plugin "diagnostics-otel" from ${expectedNpmInstallSpec("@openclaw/diagnostics-otel")}.`,
415425]);
416426});
417427@@ -453,13 +463,13 @@ describe("repairMissingConfiguredPluginInstalls", () => {
453463454464expect(mocks.installPluginFromNpmSpec).toHaveBeenCalledWith(
455465expect.objectContaining({
456-spec: "@openclaw/acpx",
466+spec: expectedNpmInstallSpec("@openclaw/acpx"),
457467expectedPluginId: "acpx",
458468trustedSourceLinkedOfficialInstall: true,
459469}),
460470);
461471expect(result.changes).toEqual([
462-'Installed missing configured plugin "acpx" from @openclaw/acpx.',
472+`Installed missing configured plugin "acpx" from ${expectedNpmInstallSpec("@openclaw/acpx")}.`,
463473]);
464474});
465475@@ -1162,7 +1172,7 @@ describe("repairMissingConfiguredPluginInstalls", () => {
11621172expect(mocks.resolveProviderInstallCatalogEntries).toHaveBeenCalled();
11631173expect(mocks.installPluginFromNpmSpec).toHaveBeenCalledWith(
11641174expect.objectContaining({
1165-spec: "@openclaw/codex",
1175+spec: expectedNpmInstallSpec("@openclaw/codex"),
11661176expectedPluginId: "codex",
11671177trustedSourceLinkedOfficialInstall: true,
11681178}),
@@ -1179,7 +1189,7 @@ describe("repairMissingConfiguredPluginInstalls", () => {
11791189{ env: {} },
11801190);
11811191expect(result.changes).toEqual([
1182-'Installed missing configured plugin "codex" from @openclaw/codex.',
1192+`Installed missing configured plugin "codex" from ${expectedNpmInstallSpec("@openclaw/codex")}.`,
11831193]);
11841194expect(result.warnings).toStrictEqual([]);
11851195});
@@ -1262,7 +1272,7 @@ describe("repairMissingConfiguredPluginInstalls", () => {
1262127212631273expect(mocks.installPluginFromNpmSpec).toHaveBeenCalledWith(
12641274expect.objectContaining({
1265-spec: "@openclaw/codex",
1275+spec: expectedNpmInstallSpec("@openclaw/codex"),
12661276expectedPluginId: "codex",
12671277trustedSourceLinkedOfficialInstall: true,
12681278}),
@@ -1279,7 +1289,9 @@ describe("repairMissingConfiguredPluginInstalls", () => {
12791289{ env },
12801290);
12811291expect(result).toEqual({
1282-changes: ['Installed missing configured plugin "codex" from @openclaw/codex.'],
1292+changes: [
1293+`Installed missing configured plugin "codex" from ${expectedNpmInstallSpec("@openclaw/codex")}.`,
1294+],
12831295warnings: [],
12841296});
12851297});
@@ -1484,13 +1496,13 @@ describe("repairMissingConfiguredPluginInstalls", () => {
1484149614851497expect(mocks.installPluginFromNpmSpec).toHaveBeenCalledWith(
14861498expect.objectContaining({
1487-spec: "@openclaw/feishu",
1499+spec: expectedNpmInstallSpec("@openclaw/feishu"),
14881500expectedPluginId: "feishu",
14891501trustedSourceLinkedOfficialInstall: true,
14901502}),
14911503);
14921504expect(result.changes).toEqual([
1493-'Installed missing configured plugin "feishu" from @openclaw/feishu.',
1505+`Installed missing configured plugin "feishu" from ${expectedNpmInstallSpec("@openclaw/feishu")}.`,
14941506]);
14951507});
14961508@@ -1562,13 +1574,13 @@ describe("repairMissingConfiguredPluginInstalls", () => {
1562157415631575expect(mocks.installPluginFromNpmSpec).toHaveBeenCalledWith(
15641576expect.objectContaining({
1565-spec: "@openclaw/feishu",
1577+spec: expectedNpmInstallSpec("@openclaw/feishu"),
15661578expectedPluginId: "feishu",
15671579trustedSourceLinkedOfficialInstall: true,
15681580}),
15691581);
15701582expect(result.changes).toEqual([
1571-'Installed missing configured plugin "feishu" from @openclaw/feishu.',
1583+`Installed missing configured plugin "feishu" from ${expectedNpmInstallSpec("@openclaw/feishu")}.`,
15721584]);
15731585});
15741586@@ -1717,7 +1729,7 @@ describe("repairMissingConfiguredPluginInstalls", () => {
17171729);
17181730expect(mocks.installPluginFromNpmSpec).toHaveBeenCalledWith(
17191731expect.objectContaining({
1720-spec: "@openclaw/discord",
1732+spec: expectedNpmInstallSpec("@openclaw/discord"),
17211733expectedPluginId: "discord",
17221734trustedSourceLinkedOfficialInstall: true,
17231735}),
@@ -1729,7 +1741,7 @@ describe("repairMissingConfiguredPluginInstalls", () => {
17291741{ env: {} },
17301742);
17311743expect(result.changes).toEqual([
1732-'Installed missing configured plugin "discord" from @openclaw/discord.',
1744+`Installed missing configured plugin "discord" from ${expectedNpmInstallSpec("@openclaw/discord")}.`,
17331745]);
17341746});
17351747@@ -2062,13 +2074,13 @@ describe("repairMissingConfiguredPluginInstalls", () => {
2062207420632075expect(mocks.installPluginFromNpmSpec).toHaveBeenCalledWith(
20642076expect.objectContaining({
2065-spec: "@openclaw/brave-plugin",
2077+spec: expectedNpmInstallSpec("@openclaw/brave-plugin"),
20662078expectedPluginId: "brave",
20672079trustedSourceLinkedOfficialInstall: true,
20682080}),
20692081);
20702082expect(result.changes).toEqual([
2071-'Installed missing configured plugin "brave" from @openclaw/brave-plugin.',
2083+`Installed missing configured plugin "brave" from ${expectedNpmInstallSpec("@openclaw/brave-plugin")}.`,
20722084]);
20732085});
20742086此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。