

























@@ -220,6 +220,38 @@ function createCurrentIndexWithNpmRecord(params: {
220220};
221221}
222222223+function expectedPluginIndexRecord(params: {
224+rootDir: string;
225+pluginId: string;
226+origin: "bundled" | "global";
227+packageName?: string;
228+packageVersion?: string;
229+}) {
230+return {
231+pluginId: params.pluginId,
232+ ...(params.packageName ? { packageName: params.packageName } : {}),
233+ ...(params.packageVersion ? { packageVersion: params.packageVersion } : {}),
234+manifestPath: path.join(params.rootDir, "openclaw.plugin.json"),
235+manifestHash: expect.any(String),
236+manifestFile: {
237+size: expect.any(Number),
238+mtimeMs: expect.any(Number),
239+ctimeMs: expect.any(Number),
240+},
241+source: path.join(params.rootDir, "index.ts"),
242+rootDir: params.rootDir,
243+origin: params.origin,
244+enabled: true,
245+startup: {
246+sidecar: false,
247+memory: false,
248+deferConfiguredChannelFullLoadUntilAfterListen: false,
249+agentHarnesses: [],
250+},
251+compat: [],
252+};
253+}
254+223255describe("maybeRepairPluginRegistryState", () => {
224256it("refreshes an existing registry during repair", async () => {
225257const stateDir = makeTempDir();
@@ -239,20 +271,10 @@ describe("maybeRepairPluginRegistryState", () => {
239271const persisted = await readRequiredPersistedInstalledPluginIndex(stateDir);
240272expect(persisted.refreshReason).toBe("migration");
241273expect(persisted.plugins).toStrictEqual([
242-expect.objectContaining({
243-compat: [],
244-enabled: true,
245-manifestPath: path.join(pluginDir, "openclaw.plugin.json"),
246-origin: "global",
274+expectedPluginIndexRecord({
247275pluginId: "demo",
248276rootDir: pluginDir,
249-source: path.join(pluginDir, "index.ts"),
250-startup: {
251-agentHarnesses: [],
252-deferConfiguredChannelFullLoadUntilAfterListen: false,
253-memory: false,
254-sidecar: false,
255-},
277+origin: "global",
256278}),
257279]);
258280});
@@ -365,22 +387,12 @@ describe("maybeRepairPluginRegistryState", () => {
365387const persisted = await readRequiredPersistedInstalledPluginIndex(stateDir);
366388expect(persisted.refreshReason).toBe("migration");
367389expect(persisted.plugins).toStrictEqual([
368-expect.objectContaining({
369-compat: [],
370-enabled: true,
371-manifestPath: path.join(bundledDir, "openclaw.plugin.json"),
390+expectedPluginIndexRecord({
391+pluginId: "google-meet",
392+rootDir: bundledDir,
372393origin: "bundled",
373394packageName: "@openclaw/google-meet",
374395packageVersion: "2026.5.3",
375-pluginId: "google-meet",
376-rootDir: bundledDir,
377-source: path.join(bundledDir, "index.ts"),
378-startup: {
379-agentHarnesses: [],
380-deferConfiguredChannelFullLoadUntilAfterListen: false,
381-memory: false,
382-sidecar: false,
383-},
384396}),
385397]);
386398expect(vi.mocked(note).mock.calls.join("\n")).toContain(
@@ -438,22 +450,12 @@ describe("maybeRepairPluginRegistryState", () => {
438450expect(persisted.installRecords).toStrictEqual({});
439451expect(persisted.refreshReason).toBe("migration");
440452expect(persisted.plugins).toStrictEqual([
441-expect.objectContaining({
442-compat: [],
443-enabled: true,
444-manifestPath: path.join(bundledDir, "openclaw.plugin.json"),
453+expectedPluginIndexRecord({
454+pluginId: "google-meet",
455+rootDir: bundledDir,
445456origin: "bundled",
446457packageName: "@openclaw/google-meet",
447458packageVersion: "2026.5.3",
448-pluginId: "google-meet",
449-rootDir: bundledDir,
450-source: path.join(bundledDir, "index.ts"),
451-startup: {
452-agentHarnesses: [],
453-deferConfiguredChannelFullLoadUntilAfterListen: false,
454-memory: false,
455-sidecar: false,
456-},
457459}),
458460]);
459461});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。