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:
2026-09-13 01:44:56 +02:00
parent 2d2ca80e3b
commit c80d9d0f7c
2 changed files with 90 additions and 0 deletions
+11
View File
@@ -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: