






















@@ -337,6 +337,70 @@ describe("installPluginFromClawHub", () => {
337337});
338338});
339339340+it("does not persist package-level StorePack metadata for version records without StorePack facts", async () => {
341+parseClawHubPluginSpecMock.mockReturnValueOnce({ name: "demo", version: "2026.3.21" });
342+fetchClawHubPackageDetailMock.mockResolvedValueOnce({
343+package: {
344+name: "demo",
345+displayName: "Demo",
346+family: "code-plugin",
347+channel: "official",
348+isOfficial: true,
349+createdAt: 0,
350+updatedAt: 0,
351+compatibility: {
352+pluginApiRange: ">=2026.3.22",
353+minGatewayVersion: "2026.3.0",
354+},
355+storepack: {
356+available: true,
357+specVersion: 1,
358+format: "storepack.zip",
359+sha256: DEMO_STOREPACK_SHA256,
360+size: 4096,
361+fileCount: 7,
362+manifestSha256: DEMO_STOREPACK_MANIFEST_SHA256,
363+builtAt: 1774200000000,
364+buildVersion: "2026.3.22",
365+hostTargets: [],
366+environment: null,
367+runtimeBundles: [],
368+},
369+},
370+});
371+fetchClawHubPackageVersionMock.mockResolvedValueOnce({
372+version: {
373+version: "2026.3.21",
374+createdAt: 0,
375+changelog: "",
376+sha256hash: "a9eac48c6129bc44b6f93c9a9f48f6c700d191b7279a1e1915f28df6f59bb1af",
377+compatibility: {
378+pluginApiRange: ">=2026.3.22",
379+minGatewayVersion: "2026.3.0",
380+},
381+},
382+});
383+384+const result = await installPluginFromClawHub({
385+spec: "clawhub:demo@2026.3.21",
386+baseUrl: "https://clawhub.ai",
387+});
388+389+expect(result).toMatchObject({
390+ok: true,
391+clawhub: {
392+source: "clawhub",
393+},
394+});
395+if (!result.ok) {
396+throw new Error(result.error);
397+}
398+expect(result.clawhub.storepackSha256).toBeUndefined();
399+expect(result.clawhub.storepackSpecVersion).toBeUndefined();
400+expect(result.clawhub.storepackManifestSha256).toBeUndefined();
401+expect(result.clawhub.storepackSize).toBeUndefined();
402+});
403+340404it("installs when ClawHub advertises a wildcard plugin API range", async () => {
341405fetchClawHubPackageVersionMock.mockResolvedValueOnce({
342406version: {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。