src/index.ts

Trail-Code · src/index.ts · typescript · MIT
ai, AI / Agents

Public API for the Graft graph engine, exposing builders, checkers, and AI model integrations.

// Source: https://github.com/trailhq/Trail-Code | License: MIT | Copyright 2026 Context Graph Engine contributors
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Graft — public API.
 *
 * The graph is a folder of linked markdown files (`.context/`) committed to the
 * repo. Build it from code, then check it stays in sync.
 *
 * @example
 * ```ts
 * import { Graft } from "@nanonets/graft";
 *
 * const engine = new Graft();
 * await engine.init(".");             // writes .context/*.md + manifest.json
 *
 * const result = engine.check(".");   // { ok: boolean, ...drift }
 * if (!result.ok) process.exitCode = 1;
 * ```
 */
export { Graft, CODE_EXTENSIONS } from "./engine.js";
export type { InitOptions, CheckRunOptions, BuildResult, BuildProgress, CheckResult } from ".

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key