Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ export function scan(root: string, options?: { allowCanonicalSource?: boolean })

/** True if any finding in the list is an error. */
export function hasDrift(findings: DriftFinding[]): boolean;

/** Return the parsed AgentBOM JSON Schema. Equivalent to getSchema("agentbom"). */
export function loadAgentBOMSchema(): unknown;

/** Return the parsed MCP Posture JSON Schema. Equivalent to getSchema("mcp-posture"). */
export function loadMCPPostureSchema(): unknown;
22 changes: 22 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,28 @@ export function getSchema(id) {

/** All schemas as a plain object keyed by id. */
export const schemas = Object.fromEntries(index.schemas.map((s) => [s.id, getSchema(s.id)]));
// ---------------------------------------------------------------------------
// Named convenience exports for AgentBOM and MCP Posture — the two schemas
// originally owned by agent-trust-infra that consumers most commonly need.
// These wrap getSchema() so callers do not have to remember string ids.
// ---------------------------------------------------------------------------

/**
* Return the parsed AgentBOM JSON Schema (id "agentbom").
* Equivalent to getSchema("agentbom").
*/
export function loadAgentBOMSchema() {
return getSchema('agentbom');
}

/**
* Return the parsed MCP Posture JSON Schema (id "mcp-posture").
* Equivalent to getSchema("mcp-posture").
*/
export function loadMCPPostureSchema() {
return getSchema('mcp-posture');
}


// ---------------------------------------------------------------------------
// Cross-repo schema drift detection.
Expand Down
Loading