fix: allow plugin package id hints

This commit is contained in:
Peter Steinberger 2026-03-16 02:18:55 +00:00
parent 067215629f
commit c6950367fb
2 changed files with 18 additions and 1 deletions

View File

@ -331,6 +331,23 @@ describe("loadPluginManifestRegistry", () => {
);
});
it("accepts plugin-style id hints without warning", () => {
const dir = makeTempDir();
writeManifest(dir, { id: "brave", configSchema: { type: "object" } });
const registry = loadRegistry([
createPluginCandidate({
idHint: "brave-plugin",
rootDir: dir,
origin: "bundled",
}),
]);
expect(registry.diagnostics.some((diag) => diag.message.includes("plugin id mismatch"))).toBe(
false,
);
});
it("still warns for unrelated id hint mismatches", () => {
const dir = makeTempDir();
writeManifest(dir, { id: "openai", configSchema: { type: "object" } });

View File

@ -131,7 +131,7 @@ function isCompatiblePluginIdHint(idHint: string | undefined, manifestId: string
if (normalizedHint === manifestId) {
return true;
}
return normalizedHint === `${manifestId}-provider`;
return normalizedHint === `${manifestId}-provider` || normalizedHint === `${manifestId}-plugin`;
}
function buildRecord(params: {