llmtxt-core
Portable Rust primitives for llmtxt content workflows.
llmtxt-core is the single source of truth for compression, hashing, signing,
patch creation/application, and other low-level text utilities used by both:
- native Rust consumers like SignalDock
- the TypeScript package
llmtxtvia WASM bindings
Install
[]
= "0.3"
During active development you can also pin the GitHub repository directly.
[]
= { = "https://github.com/kryptobaseddev/llmtxt.git", = "llmtxt-core" }
What It Provides
- zlib-compatible
compress/decompress - SHA-256 content hashing
- token estimation and compression ratios
- signed URL generation and verification
- unified diff
create_patch/apply_patchfor attachment versioning - base62 encoding helpers
- WASM-exported functions for TypeScript consumers
Example
use ;
let original = "hello\n";
let modified = "hello world\n";
let patch = create_patch;
let rebuilt = apply_patch?;
assert_eq!;
let url = generate_signed_url?;
println!;
# Ok::
Publishing
This crate is designed to be consumable both directly from Rust and indirectly
through the WASM-backed TypeScript package in packages/llmtxt.