Docs menu

API surface

AGS exposes three complementary surfaces: package exports (TypeScript), MCP tools (agent-callable), and CLI scripts (local / CI).

Package imports

Subpath imports ts
import {
  /* root plugins + TOC */
} from '@tmrxjd/agent-governance-system';

import { validateAgentCommitMessage } from '@tmrxjd/agent-governance-system/commit-msg';
import { /* CAP helpers */ } from '@tmrxjd/agent-governance-system/commit-cap';
import { /* confidence */ } from '@tmrxjd/agent-governance-system/confidence';
import { /* gates */ } from '@tmrxjd/agent-governance-system/gates';
import { /* product keys */ } from '@tmrxjd/agent-governance-system/product-licensing';

High-value entry points:

ImportUse for
@tmrxjd/agent-governance-system/commit-msgvalidateAgentCommitMessage in git hooks and CI
…/commit-capRead / set CAP state (off | on | close-only)
…/confidenceScore whether a change set is safe to checkpoint
…/gatesRun named gates (gate.array, gate.canonical, …)
…/product-licensingVerify license keys and tier capabilities
…/pluginHost plugin API — register engines into an MCP toolkit

Validate a commit message

commit-msg ts
import { validateAgentCommitMessage } from '@tmrxjd/agent-governance-system/commit-msg';

const result = validateAgentCommitMessage(message);
if (!result.ok) {
  console.error(result.errors);
  process.exit(1);
}

Required trailers include Status, Commit-Scope, Not-done, Next, Evidence, Graph-ids, User-approved, and Enforcement. Forbidden phrases include claims like “shipped” or “feature is done” unless you are on an approved close path. Full scope list: Staging scopes.

MCP tools (agent loop)

Ordered pipeline text
enforcement_begin
staging_enforce
confidence_enforce
schema_enforce / pointer_enforce / semantic_enforce
performance_validate
testing_validate
sentinel_status
commit_checkpoint
ToolPurpose
commit_authorizeGet/set CAP
enforcement_beginOpen an enforcement session for this turn
staging_classify / staging_enforcePropose and lock a Commit-Scope
confidence_enforceBlock low-confidence critical commits
schema_enforce · pointer_enforce · semantic_enforceDomain integrity
array_* · canon_*List + SoT enforcement
testing_plan / testing_validateWhich tests must run for touched paths
sentinel_statusAggregate halt / remediate signals
commit_checkpoint / commit_closeWrite the CAP-gated commit
commit_authorize json
// MCP tool: commit_authorize
{ "state": "on", "note": "feature work session" }

// Read current CAP
{}
commit_checkpoint json
// MCP tool: commit_checkpoint
{
  "message": "status/checkpoint(staging): classify auth diff\n\n…trailers…",
  "files": ["src/auth/session.ts", "src/auth/session.test.ts"],
  "dryRun": false
}
testing_plan json
// MCP tool: testing_plan
{
  "paths": ["packages/app/src/auth/session.ts"]
}
// → suiteIds + vitestPaths the agent must run before commit

// MCP tool: testing_validate
{}

CLI

Common local / CI commands (package scripts; names may be aliased in your monorepo):

pnpm testing:plan -- --paths packages/app/src/auth/session.ts
pnpm testing:validate
pnpm semantic:get
pnpm sentinel:status
pnpm performance:get

Next: Tutorials walks through enabling CAP and landing the first governed checkpoint.

AGS documentation