filens-ocr-linux-x64 0.2.0 → 0.4.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,10 +1,26 @@
1
1
  # filens Agent CLI
2
2
 
3
+ <!-- agent-cli-size:npm:start -->
4
+ **v0.4.0 · MIT · CLI 2.15 MiB · Lite 8.04 MiB · Full 31.24 MiB** (macOS arm64, installed; Full includes OCR models).
5
+
6
+ | Platform | CLI executable | Lite installed / download | Full installed / download |
7
+ | --- | ---: | ---: | ---: |
8
+ | darwin-arm64 | 2.15 MiB | 8.04 / 6.14 MiB | 31.24 / 20.34 MiB |
9
+ | linux-x64 | 1.89 MiB | 7.78 / 6.86 MiB | 36.74 / 22.84 MiB |
10
+ | linux-arm64 | 1.79 MiB | 7.68 / 6.75 MiB | 31.10 / 20.54 MiB |
11
+ | win32-x64 | 1.81 MiB | 7.71 / 6.78 MiB | 36.48 / 23.01 MiB |
12
+
13
+ Totals add the launcher and selected platform packages from npm pack. Node.js, npm caches, filesystem overhead and the optional frontend preview package 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
17
  Chinese/English reading intents, text, JSON, Markdown, HTML, YAML, XML, CSV and
5
18
  TSV. Source layouts include PDF/OCR coordinates and logical document structure.
6
- Semantic reasoning is
7
- performed by the calling agent. All document parsing uses the shared WASM core.
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.
8
24
 
9
25
  ```sh
10
26
  # Full: native RapidOCR NCNN and models included; no Python
@@ -16,10 +32,29 @@ filens 'what can you do as json'
16
32
  npm install -g filens-cli-lite
17
33
  filens setup-ocr
18
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
19
40
  ```
20
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
+
21
50
  ## More examples
22
51
 
52
+ Version 0.4.0 adds `filens preview FILE` using the same browser-local engines.
53
+ The first preview installs the separate `filens-preview` package; run
54
+ `filens setup-preview` to prepare it in advance. Subsequent previews work offline.
55
+ Frontend assets are measured separately from the CLI installation. See the [preview guide](https://github.com/IceWhaleTech/filens/blob/main/packages/preview/README.md#cli-preview)
56
+ for building the single-file/split runtime and packaging it with `--with-preview`.
57
+
23
58
  ```sh
24
59
  filens '支持哪些格式?用 JSON 返回'
25
60
  filens '请读取 "季度 报告.txt",以纯文本输出'
@@ -34,16 +69,96 @@ filens read data.xlsx --format csv
34
69
  echo '{"operation":"understand","input":"report.pdf"}' | filens
35
70
  ```
36
71
 
37
- Natural language recognizes a bounded set of reading intents. `understand`
72
+ Natural language recognizes a bounded set of document intents. `understand`
38
73
  returns source text and evidence for the calling agent; it does not generate
39
- an answer. One local file per request. Summarization,
40
- translation, questions, field extraction, page selection, URL fetching and file
41
- conversion to Office/PDF are not implemented by this CLI. Some unsupported phrasings fall
74
+ an answer. Reading and pruning accept one local file per request. Builds advertising `summarize` select
75
+ key original excerpts without an LLM, using density/TF-IDF, optional BM25 focus
76
+ and cosine-diversity pruning. For example:
77
+
78
+ ```sh
79
+ filens summarize report.pdf --query 'budget risk' --summary-chars 1000 --json
80
+ filens '提取 "report.pdf" 的关键内容,关注预算和风险,以 JSON 输出'
81
+ ```
82
+
83
+ Inspect `content.summary` for original offsets, `sourceComplete`, `omitted`,
84
+ `sampled` and per-excerpt `clipped` markers. The default budget is 30% of source
85
+ characters, rounded up and capped at 2000 characters. Scores are ranking weights,
86
+ not confidence, and an empty lexical match does not prove the topic is absent.
87
+
88
+ Version 0.3.0 includes directory-wide `search` with BM25, case-sensitive literal
89
+ and filename modes, original excerpts and optional layout. Check
90
+ `capacity.operations` for `search` when using an older version.
91
+
92
+ ```sh
93
+ filens '在 "./documents" 中搜索 "预算 风险",以 JSON 输出'
94
+ filens 'search "./documents" for "budget risk" as markdown'
95
+ filens search ./documents --query FILENS2026 --search-mode exact --json
96
+ filens 'search "documents.zip" for "budget risk" as json'
97
+ filens read 'documents.zip!/attachments.tar.gz!/report.pdf' --layout --json
98
+ ```
99
+
100
+ macOS uses native FTS and does not embed hdrw. Windows/Linux embed compiled
101
+ private hdrw WASI for mounted-directory enumeration; no private source or raw
102
+ device access is needed. Search keeps its catalog and extracted text in request-local
103
+ memory, with no persistent index/body cache or source hashing. Common text decoding and
104
+ ranking reuse the frontend Rust core directly; document extraction uses WASM.
105
+ Embedding-based semantic retrieval is not implemented. See the
106
+ [search guide](https://github.com/IceWhaleTech/filens/blob/main/docs/agent-cli-search.zh-CN.md)
107
+ for scope, limits, provenance and partial results.
108
+
109
+ Builds advertising `capacity.search.archives` automatically traverse ZIP,
110
+ TAR and GZIP containers, including nested archives up to eight layers. Search
111
+ results retain virtual member paths and structured container chains; the same
112
+ paths support reading, layouts and summaries, including OCR. Expansion uses
113
+ bounded request-local temporary files. RAR/7z and archive password decryption
114
+ are not currently supported.
115
+
116
+ ## Duplicate files and similar images
117
+
118
+ Version 0.3.0 provides Czkawka-style directory scans. Check `capacity.operations`
119
+ for `similar` when using an older installation.
120
+
121
+ ```sh
122
+ filens duplicates ./files --json
123
+ filens similar-images ./photos --threshold 8 --json
124
+ filens similar ./photos --similarity-mode images --format csv
125
+ echo '{"operation":"similar","input":"./photos","similarityMode":"images","threshold":8}' | filens
126
+ ```
127
+
128
+ Duplicate scans filter by size and prefix hash, then compare full-file SHA-256.
129
+ Image scans use perceptual hashes for JPEG, PNG, WebP, GIF, BMP and TIFF, including
130
+ resized and recompressed variants. No OCR or model is required. Threshold is a
131
+ Hamming distance from 0 to 24 (default 8), not a confidence percentage.
132
+
133
+ Defaults are 2000 candidate files, depth 32 and 100 returned groups; adjust
134
+ `--max-files`, `--max-depth`, `--max-results` and `--timeout` as needed. Inspect
135
+ `similarity.complete`, `truncated`, `scan` and `processing`; partial scans retain
136
+ groups and return exit 3. Paths are relative to `source.path`. Scans report groups
137
+ for review; perceptual matches can miss altered images or match different images.
138
+ Similarity fingerprints are recomputed each time. The document search cache and
139
+ `--no-cache` flag do not apply. See the
140
+ [similarity guide](https://github.com/IceWhaleTech/filens/blob/main/docs/agent-cli-similarity.md)
141
+ for source builds, limits, grouping semantics and the measured resource-size delta.
142
+
143
+ ## Limits and conversion
144
+
145
+ Paraphrasing, translation, questions, field extraction, page selection and URL fetching
146
+ are not implemented by this CLI. Some unsupported phrasings fall
42
147
  back to reading the whole file: “only the first page” still reads all pages,
43
148
  “only list amounts” still returns all text.
44
149
  Use the JSON request schema or explicit `--format` when strict validation is
45
150
  required. Quote file paths inside natural-language sentences.
46
151
 
152
+ `convert` uses the same WASM conversion engines as the frontend. Inspect
153
+ `capacity.conversionPairs` before choosing a target; text extraction support
154
+ does not imply conversion support. Examples include DOC/RTF/ODF/text to
155
+ OpenXML, CSV/JSON to XLSX, camera RAW to JPEG and ICNS to PNG. DOCX to PDF is
156
+ not a supported pair. Target extensions are inferred from the output path or
157
+ selected with `--to`; `--format` selects response serialization. Conversion
158
+ responses default to JSON and include `output.path`, `conversion.fidelity`
159
+ and warnings. Existing outputs require `--force`. Failed and canceled
160
+ conversions leave destinations intact.
161
+
47
162
  JSON/YAML/XML preserve the full response protocol. Markdown/HTML export document
48
163
  content with headings and tables; `--layout` adds a metadata appendix. CSV/TSV
49
164
  export a single table as rows, or layout blocks as records when `--layout` is
@@ -63,7 +178,7 @@ sharing. Private evaluation inputs and raw reports are excluded from packages.
63
178
  EXIF orientation is applied, while a physically inverted image may still have
64
179
  its text lines returned in reversed order.
65
180
 
66
- Packages support macOS 12+ arm64 and Linux glibc 2.17+ x64/arm64. Only the current
181
+ 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
67
182
  platform is installed. Node.js 20.11+ is required for the npm launcher; native
68
183
  binaries also work directly. No Python, Homebrew or compiler is needed at runtime.
69
184
  RapidOCR defaults: max side 960, padding 50, orientation classification enabled,
@@ -81,4 +196,4 @@ one profile at a time. Platform packages are implementation components.
81
196
  [Protocol, limitations and source build](https://github.com/IceWhaleTech/filens/blob/main/docs/agent-cli.md)
82
197
 
83
198
  Locally built release tarballs can also be installed with
84
- `npm install -g /path/to/filens-cli-0.2.0.tgz /path/to/filens-cli-PLATFORM-0.2.0.tgz /path/to/filens-ocr-PLATFORM-0.2.0.tgz`.
199
+ `npm install -g /path/to/filens-cli-0.4.0.tgz /path/to/filens-cli-PLATFORM-0.4.0.tgz /path/to/filens-ocr-PLATFORM-0.4.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,12 +18,33 @@
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
34
  are included in the package license directory. All wrappers are rebuilt from the
24
35
  pinned published source snapshot with Go -trimpath. The macOS target is 12.0;
25
36
  Linux wrappers use Zig's glibc 2.17 target. wrapper-build.json records the
26
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.
27
48
 
28
49
  The shared text WASM core uses lopdf 0.46.0 (MIT), ttf-parser 0.25.1
29
50
  (MIT OR Apache-2.0), and unicode-normalization 0.1.26
@@ -31,8 +52,16 @@ The shared text WASM core uses lopdf 0.46.0 (MIT), ttf-parser 0.25.1
31
52
  Their notices and those of the added transitive Rust components are included
32
53
  in the package license directory as pdf-unicode-rust.txt.
33
54
 
34
- Agent response YAML serialization uses go.yaml.in/yaml/v3 v3.0.4, with MIT
35
- and Apache-2.0 components. Its notice is included as yaml-v3-LICENSE.txt.
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.
36
65
 
37
- This notice describes third-party components and does not grant a new license
38
- 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.
@@ -5,97 +5,7 @@
5
5
  {
6
6
  "name": "libncnn.so",
7
7
  "cached": false,
8
- "sha256": "15ce510ef179ae04198b182b3ebbef6e50db9419d64d7bfdd8ed76cc5473aa54",
9
- "events": [
10
- {
11
- "type": "probe",
12
- "source": "modelscope",
13
- "url": "https://modelscope.cn/models/orcazhang/ncnn/resolve/31cac59f06413ab474246ad24f9a06ab14090a0f/runtime/releases/ncnn/2026.10.28.2/linux/amd64/libncnn.so",
14
- "bytesPerSecond": 805246.5864934186,
15
- "elapsedMs": 325.5450000000001,
16
- "rangeSupported": true
17
- },
18
- {
19
- "type": "probe",
20
- "source": "huggingface",
21
- "url": "https://huggingface.co/orca-zhang/ncnn/resolve/8ffa14f2024c6fe4fbb2b4a0ea88e8f2ab069f96/runtime/releases/ncnn/2026.10.28.2/linux/amd64/libncnn.so",
22
- "bytesPerSecond": 193199.03319826562,
23
- "elapsedMs": 1356.859792000001,
24
- "rangeSupported": true
25
- },
26
- {
27
- "type": "probe",
28
- "source": "hf-mirror",
29
- "url": "https://hf-mirror.com/orca-zhang/ncnn/resolve/8ffa14f2024c6fe4fbb2b4a0ea88e8f2ab069f96/runtime/releases/ncnn/2026.10.28.2/linux/amd64/libncnn.so",
30
- "bytesPerSecond": 127709.53563623365,
31
- "elapsedMs": 2052.6579999999994,
32
- "rangeSupported": true
33
- },
34
- {
35
- "type": "progress",
36
- "completed": 1048576,
37
- "bytes": 9123192,
38
- "bytesPerSecond": 7541575.902509615
39
- },
40
- {
41
- "type": "progress",
42
- "completed": 2097152,
43
- "bytes": 9123192,
44
- "bytesPerSecond": 7885822.409967148
45
- },
46
- {
47
- "type": "progress",
48
- "completed": 3145728,
49
- "bytes": 9123192,
50
- "bytesPerSecond": 8894745.715445988
51
- },
52
- {
53
- "type": "progress",
54
- "completed": 4194304,
55
- "bytes": 9123192,
56
- "bytesPerSecond": 11009727.838490658
57
- },
58
- {
59
- "type": "progress",
60
- "completed": 5242880,
61
- "bytes": 9123192,
62
- "bytesPerSecond": 10994915.285782833
63
- },
64
- {
65
- "type": "progress",
66
- "completed": 6291456,
67
- "bytes": 9123192,
68
- "bytesPerSecond": 13100656.495011069
69
- },
70
- {
71
- "type": "progress",
72
- "completed": 7026040,
73
- "bytes": 9123192,
74
- "bytesPerSecond": 11956034.680981712
75
- },
76
- {
77
- "type": "progress",
78
- "completed": 8074616,
79
- "bytes": 9123192,
80
- "bytesPerSecond": 8180665.368326398
81
- },
82
- {
83
- "type": "progress",
84
- "completed": 9123192,
85
- "bytes": 9123192,
86
- "bytesPerSecond": 6462780.950923691
87
- },
88
- {
89
- "type": "complete",
90
- "sources": [
91
- "modelscope",
92
- "huggingface"
93
- ],
94
- "bytes": 9123192,
95
- "elapsedMs": 1417.3250420000004,
96
- "bytesPerSecond": 6436908.77508675
97
- }
98
- ]
8
+ "sha256": "15ce510ef179ae04198b182b3ebbef6e50db9419d64d7bfdd8ed76cc5473aa54"
99
9
  }
100
10
  ]
101
11
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "filens-ocr-linux-x64",
3
- "version": "0.2.0",
4
- "license": "UNLICENSED",
3
+ "version": "0.4.0",
4
+ "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/IceWhaleTech/filens.git"
@@ -21,6 +21,7 @@
21
21
  "native",
22
22
  "models",
23
23
  "README.md",
24
- "THIRD-PARTY-NOTICES.md"
24
+ "THIRD-PARTY-NOTICES.md",
25
+ "LICENSE"
25
26
  ]
26
27
  }