# Diff Tools Compare text and structured data locally in the browser. Diff Tools is a standalone, local-first application in the [add·ideas Toolbox](https://git.add-ideas.de/lotobo/toolbox-portal). Inputs are processed through the shared cancellable disposable-worker protocol, with an algorithm budget and a 15-second hard worker deadline, and are never uploaded by the application. ## Version 0.2 scope - Text diff by line, word, Unicode code point or grapheme cluster, with exact LF, CRLF, CR and final-newline state. - Explicit text comparison rules for case, whitespace, line endings, final newline and Unicode normalization. Normalized differences stay visible. - Semantic JSON comparison with duplicate-key rejection, exact decimal numbers, object-order reporting and RFC 6902 output when representable. - Namespace-aware XML comparison with visible prefix, attribute-order, comment, whitespace and CDATA normalization. DOCTYPE, entity declarations and XInclude are rejected. - CSV and TSV comparison by one or more unique key columns, including duplicate-key diagnostics, string-preserving fields and visible column/row order changes. - Build deterministic relative-path directory manifests with local SHA-256 hashing, bounded two-file concurrency and conservative collision checks; export/import manifests and compare them without retaining file contents. - Perform a bounded, line-preserving three-way text merge from base/ours/theirs, with non-overlapping edits combined and explicit ours/base/theirs markers plus a JSON report for every conflict. - Unified and side-by-side views, an exact unified text patch and a portable, versioned JSON report. - Stable-last-result interaction: invalid or unfinished input does not blank the previous successful result. This version does not interpret images, binary documents or archives. Directory comparison is content-digest based and cannot represent empty directories because browser directory selection exposes files only. Three-way merge is textual rather than a semantic JSON/XML merge. ## Safety limits Each ordinary or merge input is limited to 8 MiB and 4 million characters. Directory manifests are limited to 5,000 files, 512 MiB total, 256 MiB per file, 4,096-character relative paths and two concurrent hashes. Parsing and output also have explicit row, cell, token, node, nesting, edit-count, conflict-count, time and display limits. Imported values are rendered as React text nodes; parser-provided HTML is never inserted. See [privacy and security](docs/PRIVACY-SECURITY.md). ## Development Requires Node.js 22 and npm 11. ```sh npm ci npm run check npm run test:browser ``` The browser suite builds and serves the app below `/deep/nested/diff/`, blocks external requests, checks CSP and immutable worker assets, and runs on Chromium and Firefox. ## Release ```sh npm run release:artifact ``` This creates deterministic `release/diff-tools-0.2.0.zip` and `.sha256` files after all validation gates pass. ## Licence GPL-3.0-or-later. Runtime dependencies retain their own licences; see [third-party notices](THIRD_PARTY_NOTICES.md).