Plugins: cover Firecrawl tool ownership
This commit is contained in:
parent
6644783052
commit
947b548870
@ -1,5 +1,9 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { providerContractRegistry, webSearchProviderContractRegistry } from "./registry.js";
|
||||
import {
|
||||
pluginRegistrationContractRegistry,
|
||||
providerContractRegistry,
|
||||
webSearchProviderContractRegistry,
|
||||
} from "./registry.js";
|
||||
|
||||
function findProviderIdsForPlugin(pluginId: string) {
|
||||
return providerContractRegistry
|
||||
@ -15,6 +19,16 @@ function findWebSearchIdsForPlugin(pluginId: string) {
|
||||
.toSorted((left, right) => left.localeCompare(right));
|
||||
}
|
||||
|
||||
function findRegistrationForPlugin(pluginId: string) {
|
||||
const entry = pluginRegistrationContractRegistry.find(
|
||||
(candidate) => candidate.pluginId === pluginId,
|
||||
);
|
||||
if (!entry) {
|
||||
throw new Error(`plugin registration contract missing for ${pluginId}`);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
describe("plugin contract registry", () => {
|
||||
it("does not duplicate bundled provider ids", () => {
|
||||
const ids = providerContractRegistry.map((entry) => entry.provider.id);
|
||||
@ -40,4 +54,12 @@ describe("plugin contract registry", () => {
|
||||
expect(findWebSearchIdsForPlugin("perplexity")).toEqual(["perplexity"]);
|
||||
expect(findWebSearchIdsForPlugin("xai")).toEqual(["grok"]);
|
||||
});
|
||||
|
||||
it("keeps bundled provider and web search tool ownership explicit", () => {
|
||||
expect(findRegistrationForPlugin("firecrawl")).toMatchObject({
|
||||
providerIds: [],
|
||||
webSearchProviderIds: ["firecrawl"],
|
||||
toolNames: ["firecrawl_search", "firecrawl_scrape"],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user