paper-drift 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  > **Zero-Python, zero-Chromium WebAssembly document parser, HTML renderer, and Markdown engine with GFM tables and math.**
9
9
 
10
- Convert complex academic research papers and enterprise PDFs directly into clean, structured **Markdown** or standalone **HTML** with pixel-perfect visual fidelity—without Puppeteer, Python, Docker, or external servers. Slashes AI Agent token ingestion costs by 90%+.
10
+ Convert complex academic research papers and enterprise PDFs directly into clean, structured **Markdown** or standalone **HTML** with pixel-perfect visual fidelity—without Puppeteer, Python, Docker, or external servers. Drastically reduces LLM token consumption compared to sending raw PDFs or vision images.
11
11
 
12
12
  ---
13
13
 
@@ -18,7 +18,7 @@ Most PDF conversion pipelines in JavaScript suffer from two major flaws:
18
18
  2. **The "Text Soup" Trap**: Spatially naive parsers that dump unordered lines, break multi-column layouts, and butcher tabular grids.
19
19
 
20
20
  **`paper-drift` solves this natively:**
21
- * **Zero-Python & Zero-Chromium**: Runs compiled WebAssembly directly in any V8 runtime (Node.js, Bun, or modern browsers). Under 20 KB package footprint.
21
+ * **Zero-Python & Zero-Chromium**: Runs compiled WebAssembly directly in any V8 runtime (Node.js, Bun, or modern browsers). Zero external microservices or headless browsers required.
22
22
  * **Direct Markdown Engine**: Converts directly into GitHub Flavored Markdown (GFM) with auto-detected `#`, `##` headings, list markers, and clean math.
23
23
  * **Geometric Table Reconstruction**: Discovers column gutters and slices cells into standard pipe tables (`| col1 | col2 |`) with clean universal math exponents (`O(n² · d)`, `10¹⁹`).
24
24
  * **Multi-Column Spatial Ordering**: Resolves 2-column papers via Recursive XY-Cut without column interweaving.
@@ -116,17 +116,15 @@ const { markdown } = await convertPdfToMarkdown(Buffer.from(pdfBuffer));
116
116
 
117
117
  ---
118
118
 
119
- ## 💸 AI Agent Token Savings
119
+ ## 💸 Reduce Token Costs for AI Agents
120
120
 
121
- When feeding 10-page academic papers into LLMs (Claude, GPT-4, Cursor, Antigravity):
121
+ Sending raw PDF documents or full-page screenshots to LLMs wastes massive amounts of context window tokens and introduces vision hallucinations on formulas and tabular data.
122
122
 
123
- | Mode | Tokens Consumed | Cost / Ingestion | Reading Accuracy |
124
- | :--- | :--- | :--- | :--- |
125
- | **Multimodal Vision (Images)** | ~16,000 – 20,000 tokens | ~$0.15 – $0.40 | Heavy hallucinations on dense math |
126
- | **Naive OCR / PDF Text Dump** | ~8,000 tokens | ~$0.08 | Tables destroyed into loose lines |
127
- | **`paper-drift` Markdown** | **~1,200 – 1,800 tokens** | **~$0.01** | **Pixel-accurate reading order, GFM tables, math** |
128
-
129
- > **Net Savings:** Over **90% token reduction** and **12x faster ingestion**.
123
+ **`paper-drift` converts PDFs into clean, structured Markdown before sending them to the model:**
124
+ * **Drastically Reduced Token Footprint**: Markdown transmits only the actual text, pipe tables, and math equations—eliminating the heavy pixel-tiling token overhead of multimodal vision models and unstructured OCR dumps.
125
+ * **100% Reading Order Accuracy**: Recursive XY-Cut sequences multi-column research papers in natural human reading order without column line-mixing.
126
+ * **High-Fidelity Tables & Math**: Tables are converted to clean GFM pipe tables (`| col1 | col2 |`) and math is preserved as clean Unicode/LaTeX without visual distortion.
127
+ * **Fast & Lightweight Ingestion**: Ingests pages locally via WebAssembly in milliseconds, slashing API latency and context costs.
130
128
 
131
129
  ---
132
130
 
@@ -134,7 +132,7 @@ When feeding 10-page academic papers into LLMs (Claude, GPT-4, Cursor, Antigravi
134
132
 
135
133
  `paper-drift` is built from the ground up as a native **AI Agent Skill** to eliminate the **"Multimodal PDF Token Tax"**.
136
134
 
137
- When an AI coding or research agent ingests raw PDFs as images, it burns ~1,500 to 2,000 vision tokens per page (crowding context windows and costing $0.50–$2.00 per query). By equipping your agent with the `paper-drift` skill, the agent pre-processes PDFs locally via WebAssembly into clean Markdown, GFM tables, and LaTeX equations in **< 400ms**—cutting token consumption by **90%+**.
135
+ When an AI coding or research agent ingests raw PDFs as images, it burns thousands of vision tokens per page and quickly crowds context windows. By equipping your agent with the `paper-drift` skill, the agent pre-processes PDFs locally via WebAssembly into clean Markdown, GFM tables, and LaTeX equations in milliseconds—drastically reducing token consumption compared to sending raw PDFs.
138
136
 
139
137
  ### 1-Click Skill Installation
140
138
 
@@ -168,7 +166,7 @@ Agent (Internal):
168
166
  1. Detects paper-drift skill
169
167
  2. Executes: npx -y paper-drift attention-is-all-you-need.pdf --format md --pages 6-8
170
168
  3. Receives clean GFM Table 1 and BLEU score comparisons in < 250ms
171
- 4. Answers your query using 1,200 text tokens instead of 20,000 vision tokens!
169
+ 4. Answers your query directly from clean Markdown text without burning multimodal vision tokens!
172
170
  ```
173
171
 
174
172
  - 📖 **Skill Specification:** [`skills/paper-drift/SKILL.md`](skills/paper-drift/SKILL.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paper-drift",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Zero-Python, zero-Chromium WebAssembly document parser, HTML renderer, and Markdown engine with GFM tables and math",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -11,15 +11,15 @@ Instead, invoke `paper-drift` locally via WebAssembly to convert the document in
11
11
 
12
12
  ---
13
13
 
14
- ## 1. Why Use `paper-drift` (The Token Economics)
14
+ ## 1. Why Use `paper-drift` (Token Savings & Fidelity)
15
15
 
16
- | Approach | Tokens per 10-Page Paper | Cost per Query | Execution Latency |
17
- | :--- | :--- | :--- | :--- |
18
- | **Multimodal Vision (PDF $\rightarrow$ Image)** | ~16,000 – 20,000 vision tokens | ~$0.20 – $0.40 | 10–25s (image rendering & transfer) |
19
- | **`paper-drift` WASM Preprocessing** | **~1,200 – 1,800 text tokens** | **~$0.01 – $0.02** | **< 400ms (100% local WASM)** |
20
- | **Savings** | **~92% Token Reduction** | **15x Cheaper** | **30x–40x Faster** |
16
+ Sending raw PDF documents or full-page screenshots to LLMs burns massive vision tokens and causes severe hallucinations on dense math and tables.
21
17
 
22
- `paper-drift` resolves multi-column reading flow (Recursive XY-Cut) so two-column academic papers are not scrambled, detects display math as `$$...$$` with equation numbers (`\tag{N}`), and reconstructs multi-tier data tables into standard Markdown grids.
18
+ Converting PDFs to Markdown with `paper-drift` provides:
19
+ - **Drastically Reduced Token Costs**: Markdown sends only pure text, pipe tables, and math—eliminating the heavy pixel-tiling token bloat of multimodal vision models and unstructured OCR dumps.
20
+ - **Accurate Reading Order**: Multi-column papers are properly ordered via Recursive XY-Cut without line interleaving.
21
+ - **Intact Tables & Math**: Reconstructs multi-tier data tables into standard Markdown grids (`| col1 | col2 |`) and math into clean LaTeX/Unicode.
22
+ - **Fast Local Execution**: Runs locally in milliseconds via compiled WebAssembly with zero external dependencies (no Python, no Poppler, no Chromium).
23
23
 
24
24
  ---
25
25