fix: allow plugin package id hints
This commit is contained in:
parent
067215629f
commit
c6950367fb
@ -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" } });
|
||||
|
||||
@ -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: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user