llmtxt
v2026.4.1
Published
Primitives and SDK for LLM agent content workflows: compression, patching, progressive disclosure, signed URLs, collaborative document lifecycle, and retrieval planning
Maintainers
Readme
llmtxt
Primitives and SDK for LLM agent content workflows.
llmtxt wraps the Rust llmtxt-core crate through WASM so TypeScript
consumers use the same single-source-of-truth logic as native Rust consumers.
Install
npm install llmtxtPrimitives
import {
compress, decompress, generateId, hashContent,
createPatch, applyPatch, generateSignedUrl,
} from 'llmtxt';
const compressed = await compress('Hello world');
const text = await decompress(compressed);
const slug = generateId();
const hash = hashContent(text);
const patch = createPatch('hello\n', 'hello world\n');
const rebuilt = applyPatch('hello\n', patch);SDK (Collaborative Documents)
import {
isValidTransition, evaluateApprovals, planRetrieval,
reconstructVersion, attributeVersion, buildContributorSummary,
} from 'llmtxt/sdk';Subpath Exports
import { generateOverview, getSection } from 'llmtxt/disclosure';
import { textSimilarity, rankBySimilarity } from 'llmtxt/similarity';
import { buildGraph } from 'llmtxt/graph';What Ships
- Compression, hashing, base62, token estimation (Rust WASM)
- Signed URL generation and verification
- Unified diff patch creation, application, version reconstruction
- Progressive disclosure: overview, section extraction, content search
- Collaborative document lifecycle (DRAFT, REVIEW, LOCKED, ARCHIVED)
- Version stack management with attribution tracking
- Consensus/approval evaluation with stale review handling
- Token-budget-aware retrieval planning
- Storage content reference abstractions (inline vs object-store)
- Attachment client helpers for upload, fetch, reshare, versioning
Release Model
The npm package includes prebuilt WASM artifacts generated from the Rust crate in
crates/llmtxt-core, so TypeScript and Rust consumers stay aligned on behavior.
