Projects /

Project overview

Capability Graph

A local-first catalog for declaring, selecting and resolving application capabilities.

Use cases and boundaries

Providers declare stable IDs, usage guidance and dependency relationships. Callers can resolve known IDs from local provider files without a model. Applicability and declared dependencies form the input to the host's next decision.

Getting started and compatibility

Install the released package

npm install @devcodex/capability-graph@2.2.0

Version 2.2.0 supports Node.js ^20.19.0 || >=22.12.0. Save the provider declaration as provider.json, save this ESM script next to it as static.mjs, and run node static.mjs. The declaration includes acme::route and its required acme::schema. v2.2.0 provider declaration

import { CapabilityGraph } from '@devcodex/capability-graph';
import { fileURLToPath } from 'node:url';
const file = fileURLToPath(new URL('./provider.json', import.meta.url));
const graph = await CapabilityGraph.open({ providers: [{ file }] });
try {
  const result = await graph.resolve({ ids: ['acme::route'] });
  console.dir(result, { depth: null });
}
finally { await graph.close(); }

The documented result contains both capability IDs, meta.completeness: 'complete' and unresolved: []. Static resolution gives the host dependency data. The host decides whether to authorize or execute a capability.