filens-ocr-linux-arm64 0.1.0 → 0.3.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FiLens contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,21 +1,52 @@
1
1
  # filens Agent CLI
2
2
 
3
+ <!-- agent-cli-size:npm:start -->
4
+ **v0.3.0 · MIT · CLI 2.10 MiB · Lite 7.85 MiB · Full 31.05 MiB** (macOS arm64, installed; Full includes OCR models).
5
+
6
+ | Platform | CLI executable | Lite installed / download | Full installed / download |
7
+ | --- | ---: | ---: | ---: |
8
+ | darwin-arm64 | 2.10 MiB | 7.85 / 6.02 MiB | 31.05 / 20.22 MiB |
9
+ | linux-x64 | 1.88 MiB | 7.62 / 6.74 MiB | 36.57 / 22.72 MiB |
10
+ | linux-arm64 | 1.77 MiB | 7.51 / 6.63 MiB | 30.94 / 20.42 MiB |
11
+ | win32-x64 | 1.80 MiB | 7.54 / 6.66 MiB | 36.32 / 22.89 MiB |
12
+
13
+ Totals add the launcher and selected platform packages from npm pack. Node.js, npm caches and filesystem overhead are excluded. Bundled dependencies retain their own licenses; see THIRD-PARTY-NOTICES.md in the platform packages.
14
+ <!-- agent-cli-size:npm:end -->
15
+
3
16
  Read local documents and provide text and cited evidence for agents. Supports
4
- Chinese/English reading intents, plain text and JSON. Semantic reasoning is
5
- performed by the calling agent. All document parsing uses the shared WASM core.
17
+ Chinese/English reading intents, text, JSON, Markdown, HTML, YAML, XML, CSV and
18
+ TSV. Source layouts include PDF/OCR coordinates and logical document structure.
19
+ Version 0.3.0 also provides model-free extractive summaries through
20
+ `summarize` / `prune`, with optional lexical focus and original-text provenance.
21
+ Check `capacity.operations` when using an older installation.
22
+ Paraphrasing, translation and question
23
+ answering belong to the calling agent. Parsing and pruning use the shared WASM core.
6
24
 
7
25
  ```sh
8
26
  # Full: native RapidOCR NCNN and models included; no Python
9
- npm install -g filens
27
+ npm install -g filens-cli
10
28
  filens '读取 "report.pdf",以 JSON 输出'
11
29
  filens 'what can you do as json'
12
30
 
13
31
  # Lite: CLI + WASM; add native OCR when needed
14
- npm install -g filens-lite
32
+ npm install -g filens-cli-lite
15
33
  filens setup-ocr
16
34
  filens 'read "scan.pdf" as json'
35
+ filens convert report.doc report.docx
36
+ filens convert data.csv --to xlsx
37
+
38
+ # Temporary invocation; no global installation
39
+ npx --yes filens-cli-lite read report.pdf --json
17
40
  ```
18
41
 
42
+ The CLI is Rust, built with stripped symbols, LTO and size optimization.
43
+ Windows/Linux executables use UPX `--best --lzma`, followed by `--test`.
44
+ Mach-O arm64 is unsupported by UPX and remains uncompressed.
45
+ WASM resources use fast gzip compression and are decoded locally as needed.
46
+ The package includes `skills/filens/SKILL.md`, with standard YAML front matter
47
+ and agent guidance for evidence, partial results, OCR and coordinate units.
48
+ Copy `skills/filens/` to your agent's skills directory to enable discovery.
49
+
19
50
  ## More examples
20
51
 
21
52
  ```sh
@@ -25,25 +56,123 @@ filens '帮我理解“会议纪要.docx”,用 JSON 返回'
25
56
  filens 'Please extract all text from "report.pdf" in JSON'
26
57
  filens '识别 "invoice.png" 中的文字,以 JSON 输出'
27
58
  filens '理解 "embedded-images.docx",以 JSON 输出'
59
+ filens 'read "report.docx" as markdown'
60
+ filens '获取 "scan.pdf" 的布局,以 YAML 输出'
61
+ filens layout invoice.png --format json
62
+ filens read data.xlsx --format csv
28
63
  echo '{"operation":"understand","input":"report.pdf"}' | filens
29
64
  ```
30
65
 
31
- Natural language recognizes a bounded set of reading intents. `understand`
66
+ Natural language recognizes a bounded set of document intents. `understand`
32
67
  returns source text and evidence for the calling agent; it does not generate
33
- an answer. One local file per request, text/JSON output. Summarization,
34
- translation, questions, field extraction, page selection, URL fetching and file
35
- conversion are not implemented by this CLI. Some unsupported phrasings fall
68
+ an answer. Reading and pruning accept one local file per request. Builds advertising `summarize` select
69
+ key original excerpts without an LLM, using density/TF-IDF, optional BM25 focus
70
+ and cosine-diversity pruning. For example:
71
+
72
+ ```sh
73
+ filens summarize report.pdf --query 'budget risk' --summary-chars 1000 --json
74
+ filens '提取 "report.pdf" 的关键内容,关注预算和风险,以 JSON 输出'
75
+ ```
76
+
77
+ Inspect `content.summary` for original offsets, `sourceComplete`, `omitted`,
78
+ `sampled` and per-excerpt `clipped` markers. The default budget is 30% of source
79
+ characters, rounded up and capped at 2000 characters. Scores are ranking weights,
80
+ not confidence, and an empty lexical match does not prove the topic is absent.
81
+
82
+ Version 0.3.0 includes directory-wide `search` with BM25, case-sensitive literal
83
+ and filename modes, original excerpts and optional layout. Check
84
+ `capacity.operations` for `search` when using an older version.
85
+
86
+ ```sh
87
+ filens '在 "./documents" 中搜索 "预算 风险",以 JSON 输出'
88
+ filens 'search "./documents" for "budget risk" as markdown'
89
+ filens search ./documents --query FILENS2026 --search-mode exact --json
90
+ filens 'search "documents.zip" for "budget risk" as json'
91
+ filens read 'documents.zip!/attachments.tar.gz!/report.pdf' --layout --json
92
+ ```
93
+
94
+ macOS uses native FTS and does not embed hdrw. Windows/Linux embed compiled
95
+ private hdrw WASI for mounted-directory enumeration; no private source or raw
96
+ device access is needed. Search keeps its catalog and extracted text in request-local
97
+ memory, with no persistent index/body cache or source hashing. Common text decoding and
98
+ ranking reuse the frontend Rust core directly; document extraction uses WASM.
99
+ Embedding-based semantic retrieval is not implemented. See the
100
+ [search guide](https://github.com/IceWhaleTech/filens/blob/main/docs/agent-cli-search.zh-CN.md)
101
+ for scope, limits, provenance and partial results.
102
+
103
+ Builds advertising `capacity.search.archives` automatically traverse ZIP,
104
+ TAR and GZIP containers, including nested archives up to eight layers. Search
105
+ results retain virtual member paths and structured container chains; the same
106
+ paths support reading, layouts and summaries, including OCR. Expansion uses
107
+ bounded request-local temporary files. RAR/7z and archive password decryption
108
+ are not currently supported.
109
+
110
+ ## Duplicate files and similar images
111
+
112
+ Version 0.3.0 provides Czkawka-style directory scans. Check `capacity.operations`
113
+ for `similar` when using an older installation.
114
+
115
+ ```sh
116
+ filens duplicates ./files --json
117
+ filens similar-images ./photos --threshold 8 --json
118
+ filens similar ./photos --similarity-mode images --format csv
119
+ echo '{"operation":"similar","input":"./photos","similarityMode":"images","threshold":8}' | filens
120
+ ```
121
+
122
+ Duplicate scans filter by size and prefix hash, then compare full-file SHA-256.
123
+ Image scans use perceptual hashes for JPEG, PNG, WebP, GIF, BMP and TIFF, including
124
+ resized and recompressed variants. No OCR or model is required. Threshold is a
125
+ Hamming distance from 0 to 24 (default 8), not a confidence percentage.
126
+
127
+ Defaults are 2000 candidate files, depth 32 and 100 returned groups; adjust
128
+ `--max-files`, `--max-depth`, `--max-results` and `--timeout` as needed. Inspect
129
+ `similarity.complete`, `truncated`, `scan` and `processing`; partial scans retain
130
+ groups and return exit 3. Paths are relative to `source.path`. Scans report groups
131
+ for review; perceptual matches can miss altered images or match different images.
132
+ Similarity fingerprints are recomputed each time. The document search cache and
133
+ `--no-cache` flag do not apply. See the
134
+ [similarity guide](https://github.com/IceWhaleTech/filens/blob/main/docs/agent-cli-similarity.md)
135
+ for source builds, limits, grouping semantics and the measured resource-size delta.
136
+
137
+ ## Limits and conversion
138
+
139
+ Paraphrasing, translation, questions, field extraction, page selection and URL fetching
140
+ are not implemented by this CLI. Some unsupported phrasings fall
36
141
  back to reading the whole file: “only the first page” still reads all pages,
37
- “only list amounts” still returns all text, and “as yaml” falls back to text.
142
+ “only list amounts” still returns all text.
38
143
  Use the JSON request schema or explicit `--format` when strict validation is
39
144
  required. Quote file paths inside natural-language sentences.
40
145
 
146
+ `convert` uses the same WASM conversion engines as the frontend. Inspect
147
+ `capacity.conversionPairs` before choosing a target; text extraction support
148
+ does not imply conversion support. Examples include DOC/RTF/ODF/text to
149
+ OpenXML, CSV/JSON to XLSX, camera RAW to JPEG and ICNS to PNG. DOCX to PDF is
150
+ not a supported pair. Target extensions are inferred from the output path or
151
+ selected with `--to`; `--format` selects response serialization. Conversion
152
+ responses default to JSON and include `output.path`, `conversion.fidelity`
153
+ and warnings. Existing outputs require `--force`. Failed and canceled
154
+ conversions leave destinations intact.
155
+
156
+ JSON/YAML/XML preserve the full response protocol. Markdown/HTML export document
157
+ content with headings and tables; `--layout` adds a metadata appendix. CSV/TSV
158
+ export a single table as rows, or layout blocks as records when `--layout` is
159
+ requested. `layout` defaults to JSON. PDF coordinates use points and a top-left
160
+ origin; image OCR uses orientation-corrected pixels. Embedded-image coordinates
161
+ are local to each image. Flow documents expose logical structure, without
162
+ invented page positions. Detection scores do not measure transcription accuracy.
163
+
41
164
  OCR output may contain errors, including stray text detected in landscape
42
165
  photos. `ok=true` means extraction completed; it does not measure OCR accuracy.
166
+
167
+ Supported PDF ToUnicode errors are repaired per font in the shared WASM core;
168
+ unusable text mappings can require OCR even with a nonempty text layer. Missing
169
+ fonts and incorrect rendering may still make numeric tables unreliable.
170
+ JSON responses contain local source paths and document text; redact them before
171
+ sharing. Private evaluation inputs and raw reports are excluded from packages.
43
172
  EXIF orientation is applied, while a physically inverted image may still have
44
173
  its text lines returned in reversed order.
45
174
 
46
- Packages support macOS 12+ arm64 and Linux glibc 2.17+ x64/arm64. Only the current
175
+ Version 0.3.0 provides Windows 10/11 x64, macOS 12+ arm64 and Linux glibc 2.17+ x64/arm64 packages. Windows/Linux native execution remains pending validation. Only the current
47
176
  platform is installed. Node.js 20.11+ is required for the npm launcher; native
48
177
  binaries also work directly. No Python, Homebrew or compiler is needed at runtime.
49
178
  RapidOCR defaults: max side 960, padding 50, orientation classification enabled,
@@ -61,4 +190,4 @@ one profile at a time. Platform packages are implementation components.
61
190
  [Protocol, limitations and source build](https://github.com/IceWhaleTech/filens/blob/main/docs/agent-cli.md)
62
191
 
63
192
  Locally built release tarballs can also be installed with
64
- `npm install -g /path/to/filens-0.1.0.tgz /path/to/filens-cli-PLATFORM-0.1.0.tgz /path/to/filens-ocr-PLATFORM-0.1.0.tgz`.
193
+ `npm install -g /path/to/filens-cli-0.3.0.tgz /path/to/filens-cli-PLATFORM-0.3.0.tgz /path/to/filens-ocr-PLATFORM-0.3.0.tgz`.
@@ -7,7 +7,7 @@
7
7
  invokes it as an isolated optional capability; document parsing stays in WASM.
8
8
  - Tencent NCNN, source d0d50631179e380e587fb188338f5683d2c93275, BSD 3-Clause.
9
9
  License: native/licenses/NCNN.txt. OpenMP uses bundled SimpleOMP.
10
- - Linux companions include Zig, LLVM libc++, libc++abi and libunwind runtime
10
+ - Linux/Windows companions include Zig and LLVM libc++ runtime components; Linux also includes libc++abi and libunwind runtime
11
11
  components. Their notices are in native/licenses/{Zig,libcxx,libcxxabi,libunwind}.txt.
12
12
  The macOS companion uses the operating system C++ library.
13
13
  - RapidAI RapidOcrNcnn 1.2.0 OCR pipeline; PaddleOCR models: PP-OCRv6 small
@@ -18,10 +18,50 @@
18
18
  https://github.com/RapidAI/RapidOcrNcnn
19
19
  https://github.com/PaddlePaddle/PaddleOCR
20
20
 
21
- The Go host and native wrapper also contain Go, purego, wazero, imaging,
21
+ The Rust CLI uses Wasmi / wasmi_wasi 0.46.0 (MIT OR Apache-2.0),
22
+ wasi-common (Apache-2.0 WITH LLVM-exception), libloading, serde / serde_json /
23
+ serde_yaml, regex, flate2, png, tempfile and ctrlc. The locked dependencies'
24
+ license texts and version metadata are collected into licenses/rust-cli.txt.
25
+ PDFium remains the WASM artifact from go-pdfium v1.17.3, verified by SHA-256;
26
+ its upstream license notice is included as go-pdfium@v1.17.3-LICENSE.txt.
27
+ The optional image WASM engine uses jpeg-encoder and the repository's modified
28
+ rawloader 0.37.2 (LGPL-2.1). RAW source and local changes are maintained at
29
+ wasm/converter-image-rust/vendor/rawloader in the filens source repository;
30
+ the package includes its LGPL and X3F notices in licenses/rust-cli.txt.
31
+
32
+ The optional native OCR wrapper also contains Go, purego, imaging,
22
33
  gotokenizers, regexp2, protobuf and Go x/image/x/text components. Their notices
23
- are included in the package license directory. macOS wrapper builds use the
24
- pinned published source snapshot with deployment target 12.0.
34
+ are included in the package license directory. All wrappers are rebuilt from the
35
+ pinned published source snapshot with Go -trimpath. The macOS target is 12.0;
36
+ Linux wrappers use Zig's glibc 2.17 target. wrapper-build.json records the
37
+ source and rebuilt artifact hashes without workstation paths.
38
+ Windows x64 uses Zig's GNU target, system-only DLL dependencies and bundled
39
+ SimpleOMP. The NCNN source snapshot uses std::call_once for its Windows
40
+ initialization; the wrapper uses LoadLibrary and NCNN's UTF-16 model-path APIs.
41
+ These compatibility patches are maintained in scripts/build-agent-ncnn-windows.mjs
42
+ and packaging/ncnn-windows/native_loader_windows.go.
43
+
44
+ UPX 5.1.0 compresses Windows/Linux CLI executables. Its license explicitly
45
+ permits distribution of packed programs without imposing its license on them:
46
+ https://github.com/upx/upx/blob/v5.1.0/LICENSE
47
+ The external UPX tool is needed only for source builds, not at runtime.
48
+
49
+ The shared text WASM core uses lopdf 0.46.0 (MIT), ttf-parser 0.25.1
50
+ (MIT OR Apache-2.0), and unicode-normalization 0.1.26
51
+ ((MIT OR Apache-2.0) AND Unicode-3.0) for PDF font mapping recovery.
52
+ Their notices and those of the added transitive Rust components are included
53
+ in the package license directory as pdf-unicode-rust.txt.
54
+
55
+ Legacy Go library hosts retain their existing dependency notices, including
56
+ wazero and go.yaml.in/yaml/v3; the distributed CLI itself is Rust.
57
+
58
+ FiLens first-party code is licensed under MIT; see the package's LICENSE file.
59
+ Bundled dependencies and the Photos application code retain their original
60
+ licenses. This notice does not relicense those components.
61
+
62
+ ## Private directory discovery component
63
+
64
+ Windows and Linux CLI binaries embed compiled hdrw WASI, a proprietary component used through the FiLens directory adapter. hdrw source is not included or licensed as part of FiLens. macOS release binaries use native system FTS and do not embed this component. Maintainer provenance and artifact hashes are recorded in `cli/assets/hdrw.json`; the adapter exposes mounted-directory enumeration, without raw device access.
25
65
 
26
- This notice describes third-party components and does not grant a new license
27
- for filens or the Photos application code.
66
+ The embedded WASI module also includes Go standard library/runtime components;
67
+ their license is included in the package license directory as Go.txt.
Binary file