Repository navigation
Match Cursor Read tool behavior and add PDF-to-Markdown support - #13
Merged
Merged
Conversation
Align ead with Cursor's text Read tool: sparse multiple-of-10 line prefixes, top and bottom omitted-line markers, trailing-newline line counting, raw 100,000-character refusal, two-tier binary detection, and exact error messages. - Keep ead::load and crate::text::split_lines unchanged so eplace and grep keep their existing behavior, while ead_file runs stat, check_read_type, �locked_binary_extension, ead_prefix, sniff_binary, split_read_lines, CHAR_CAP, and ender. - Replace BYTE_CAP auto-truncation and cut_first_line with a raw-character check in aw_window_chars that returns the two-line refusal naming �ytes.len(). - Update schemas/read.json, schemas/EDITS.md, spec.rs, and the ead, pack, and integration test suites.
Convert .pdf files to Markdown in memory through ead/pdf.rs using zero-dependency pdfmd, then run the result through Read's normal line window, CHAR_CAP, and sparse-line render pipeline. - Add pdfmd to Cargo.toml and crates/plugin-std/Cargo.toml so PDF conversion runs single-threaded without spawning a global thread pool inside the dynamic library. - Handle zero-byte PDFs as File is empty., scanned PDFs with no extractable text as an explicit error, and corrupt PDFs with the parser error. - Update schemas/read.json, schemas/EDITS.md, spec-tests.rs, and add ead/tests/pdf.rs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Readwith Cursor's textReadtool: sparse multiple-of-10 line prefixes,... N line(s) not shown ...top/bottom markers, trailing-newline line counting, raw 100,000-character refusal naming file bytes, two-tier binary detection (blocked binary extensions + content sniff), and exact Cursor error messages.pdfmd(read/pdf.rs), routed throughRead's normal window/limit/100k-char pipeline, with clear handling for empty, scanned, and corrupt PDFs.schemas/read.json,schemas/EDITS.md,spec.rs, and unit + integration tests.Verification
cargo test --locked --workspace --all-featuresCARGO_BUILD_WARNINGS=deny cargo clippy --locked --workspace --all-targets --all-featurescargo fmt --all --checkRUSTDOCFLAGS="-D warnings" cargo doc --locked --workspace --no-deps --all-features --document-private-itemscargo build --locked -p plugin-std --releaseSummary by CodeRabbit