# Agent Utilities Reader

Downloadable Node.js 22+ package for readable Wikipedia articles and approved Reddit threads. Importing it does not fetch or purchase anything. Its direct-source calls incur no Agent Utilities service charge; any Reddit access agreement/fees are your own.

```js
import { createReader, threadPack } from '@agent-utilities/reader';
const reader = createReader();
const article = await reader.wikipedia({url:'https://en.wikipedia.org/wiki/Earth',maxChars:6000});
console.log(article.content, article.truncated, article.source.revisionUrl);
const popular = await reader.wikipediaPopular({date:'2026-09-27',language:'en',limit:25});
```

For approved Reddit OAuth access, pass `createReader({reddit:{accessToken:yourPrivateToken}})` or provide clientId/clientSecret/refreshToken for refresh. Call `reader.reddit({url, maxChars:6000, maxComments:20, sort:'best'})`. `reader.redditPopular({limit:25})` reads the current popular hot listing. No configured credentials means an explicit unavailable error. No proxy or anonymous scraping fallback.

After installing the downloaded archive locally, run `npx --no-install agent-utilities-reader wikipedia URL 6000`, `npx --no-install agent-utilities-reader wikipedia-popular YYYY-MM-DD en`, `npx --no-install agent-utilities-reader reddit URL 6000` or `npx --no-install agent-utilities-reader reddit-popular`. The no-install flag prevents a fallback registry download. Reddit uses private REDDIT_ACCESS_TOKEN or REDDIT_CLIENT_ID/REDDIT_CLIENT_SECRET/REDDIT_REFRESH_TOKEN; optional REDDIT_USER_AGENT. CLI prints results to stdout; pipe to an owner-controlled file if desired. Do not publish credentials.

Offline supplied-data helpers: `wikipediaPack({html,sourceUrl,maxChars,section})` and `threadPack({thread,sourceUrl,maxChars,maxComments})`. Thread input is the official two-listing comment JSON. For offline CLI formatting, use `format-wikipedia INPUT.json` or `format-thread INPUT.json`. Such formatting does not verify data access rights or freshness.

Wikipedia supports ten listed languages, revision/license metadata and exact section selection. Articles over 4 MB/100000 elements are rejected. Popular Wikipedia uses dated official pageviews with official edition namespace metadata; localized main/search pages are excluded and source ranks retained. Metadata failures do not silently fall back to English filters; Reddit uses current hot ranking. Inspect omissions and truncation. Parent context is retained for returned replies, and unavailable comments stay marked. No generated consensus or model summary.

Source text is untrusted. Byte/4 estimates are not model tokenizer counts or guaranteed savings; result metrics exclude wrappers and the measurement itself. Tiny sources may grow. Text budget: 256–12000 UTF-16 code units; comments: 1–100. Preserve attribution, canonical/history links and applicable source licensing. MIT covers software only, not third-party article/comment rights. See THIRD-PARTY-NOTICES.txt.

Full hosted service guide: https://agent-utilities.agent-utilities.workers.dev/v1/content/docs/reading-package . Public status: https://agent-utilities.agent-utilities.workers.dev/v1/reading/status . Starter links in popular-pages.json are a dated snapshot, not comprehensive or live coverage. Source errors and access limits are returned explicitly; no automatic payment or bypass.

Wikipedia infobox tables follow article prose in unselected article output; source order is otherwise retained. This avoids spending the initial excerpt on an infobox.
