PrepLayer.ai

v0.2.1
com.maximusmediahouse/preplayer Checked 2 days ago Published 1 month ago

Deterministic text prep for agents.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

normalize normalize

Deterministic text normalization: Unicode NFKC, zero-width/bidi stripping, smart-quote and dash folding, whitespace collapse, case folding. Returns a stable content hash so two texts can be compared for exact equality. $0.002 USDC per successful call (x402, client-paid); failed calls are not charged.

validate validate

Validate and canonicalize one identifier: email, URL, E.164 phone, IBAN (mod-97), payment card (Luhn), UUID, SHA-256, git SHA, EVM address (EIP-55) or domain. Returns {valid, canonical, fingerprint}. $0.002 USDC per successful call (x402, client-paid); failed calls are not charged.

extract extract

Extract structured fields from unstructured text with byte offsets and normalized values: emails, URLs, IPv4, phones, money amounts, ISO dates, UUIDs, EVM addresses, SKUs, semver. $0.005 USDC per successful call (x402, client-paid); failed calls are not charged.

redact redact

Redact PII from text before it is stored or logged. Returns redacted text plus exact byte spans and counts per class: credit_card, iban, email, private_key, evm_address, phone, ipv4, url. $0.005 USDC per successful call (x402, client-paid); failed calls are not charged.

classify classify

Rule-based multi-label text classification over a fixed taxonomy (urgency, financial_promise, credential_request, crypto_mention, cta, legal_offer, medical_claim, seo_spam, url_shortener, press_release, question, has_contact). Deterministic - identical text always yields identical labels. $0.003 USDC per successful call (x402, client-paid); failed calls are not charged.

dedupe dedupe

Near-duplicate detection across a batch of documents. Exact Jaccard similarity over word-3-shingle sets decides duplication; a 64-bit SimHash is returned per document as a compact content fingerprint. Up to 200 documents per call. $0.01 USDC per successful call (x402, client-paid); failed calls are not charged.

diff diff

Line-level LCS diff of two text blobs. Returns a structured edit script with insertions, deletions, unchanged line counts and per-operation metadata; with format='unified' also returns a unified-diff string. $0.005 USDC per successful call (x402, client-paid); failed calls are not charged.

chunk chunk

Split long text into pieces for RAG retrieval. Strategies: 'sentence' packs whole sentences into a size budget and never splits mid-sentence; 'paragraph' prefers \n\n boundaries; 'fixed' is a hard char window with overlap. The highest-value endpoint for agents that build retrieval pipelines. $0.005 USDC per successful call (x402, client-paid); failed calls are not charged.

extract_custom extract_custom

Pull caller-defined structured fields from text using regex patterns with deterministic type coercion. Supported types: string, bool, date, url, email, number. Returns {fields: {name: value|null}, found, missing}. Pure deterministic — no LLM call. $0.005 USDC per successful call (x402, client-paid); failed calls are not charged.

validate_json validate_json

Deterministic JSON-Schema subset validator. Catches malformed JSON before it breaks a pipeline. Supports: type, required, properties, items, minLength, maxLength, pattern, enum, minimum, maximum, additionalProperties. No external dependencies. $0.003 USDC per successful call (x402, client-paid); failed calls are not charged.

slugify slugify

URL-safe slug from arbitrary text. NFKD-decomposes unicode (é -> e), lowercases, replaces every non-[a-z0-9] run with a separator, strips leading/trailing separators, truncates on separator boundaries (never mid-word). $0.002 USDC per successful call (x402, client-paid); failed calls are not charged.

hash hash

Content-addressable hashing for caching and dedup. Three algorithms: sha256 (via node:crypto / Web Crypto), xxhash64 and murmur3 (inline pure-JS, deterministic across runs). Returns hex digest + algorithm + byte count. $0.002 USDC per successful call (x402, client-paid); failed calls are not charged.

batch batch

Run up to 10 primitive calls in one round trip for one x402 payment of $0.02 (= $0.0020 per call, below the priciest single-call route at $0.01). Each request names an `endpoint` (normalize, validate, extract, redact, classify, dedupe, diff, chunk, extract_custom, validate_json, slugify, hash) and its input; results return in request order. Single payment, no streaming. Larger rungs cost less per call: /v1/batch/50 ($0.075, $0.0015/call) and /v1/batch/100 ($0.100, $0.0010/call). $0.02 USDC per successful call (x402, client-paid); failed calls are not charged.

batch50 batch50

Run up to 50 primitive calls in one round trip. One x402 payment of $0.075 (=$0.0015 per call — cheaper per call than the 10-slot batch). Same `{endpoint, input}` request shape as /v1/batch; the response carries up to 50 results in order. Built for a production buyer running a whole corpus in one settle. $0.075 USDC per successful call (x402, client-paid); failed calls are not charged.

batch100 batch100

Run up to 100 primitive calls in one round trip. One x402 payment of $0.100 (=$0.0010 per call — the deepest rung of the batch ladder, cheaper per call than the 10- and 50-slot batches). Same `{endpoint, input}` request shape as /v1/batch. The volume mechanic for a corpus-holding buyer: one settle per 100 calls. $0.100 USDC per successful call (x402, client-paid); failed calls are not charged.

subscription subscription

Recurring tier: a PREPAID CALL BALANCE. One x402 payment of $1.00 credits 1,000 units of prepaid capacity (= $0.0010 per call), drawn down across sessions on the cheap deterministic routes (<= $0.01). The funded balance is the source of truth, queryable at GET /v1/subscription/balance, and remaining_calls is reported on every paid response. Non-auto-renewing: a one-time top-up whose spend stops at zero. No account, no API key, no monthly lock-in. $1.00 USDC per successful call (x402, client-paid); failed calls are not charged.