The graph holds what a module declares, not only what it was built on
Build edges are discovered by building; requires and provides are stated by the module about itself. Both belong in the graph and answer different questions — and "what provides postgres-database" needed a sweep over every manifest, which only something holding all of them can do.
This commit is contained in:
@@ -31,6 +31,17 @@ export function getCatalogueTools(graph: Graph): ToolDefinition[] {
|
||||
return found ? { module: found } : { error: `the catalogue holds no ${module}` };
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "catalog_provides",
|
||||
description:
|
||||
"What provides a provision, and what needs it. Answered from what modules declare about themselves, so it does not require holding every manifest at once.",
|
||||
input: { provision: { type: "string", description: "the provision, e.g. postgres-database" } },
|
||||
run: async (args) => {
|
||||
const provision = String(args.provision ?? "");
|
||||
if (!provision) return { error: "name a provision" };
|
||||
return await graph.whoProvides(provision);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "catalog_dependents",
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user