-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathCargo.toml
More file actions
128 lines (118 loc) · 6.04 KB
/
Copy pathCargo.toml
File metadata and controls
128 lines (118 loc) · 6.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
[package]
name = "donsetch"
version = "3.6.7"
edition = "2024"
license = "AGPL-3.0-only"
description = "Web fetch, search and crawl for AI agents. Custom stealthy HTTP fetch tier on BoringSSL."
[dependencies]
boring = { version = "5", features = ["mlkem"] }
boring-sys = "5"
foreign-types = "0.5"
tokio-boring = "5"
# QUIC + HTTP/3 (phase 5.1). Donsetch fork of quiche 0.29.3 with the boring
# dep raised to ^5 so the QUIC handshake forges share one boringssl build
# (boring/boring-sys 5.2) with tier-1 h1/h2. Upstream tag: 0.29.3; fork tag
# donsetch-v0.29.3-1 = "quiche + boring 5" only.
quiche = { git = "https://github.com/dondai44423/quiche", tag = "donsetch-v0.29.3-1", default-features = false, features = ["boringssl-boring-crate"] }
tokio = { version = "1", features = ["full"] }
url = "2"
brotli = "8"
memchr = "2"
flate2 = "1"
zstd = "0.13"
rustls-native-certs = "0.8"
scraper = "0.27.0"
encoding_rs = "0.8.35"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio-tungstenite = "0.30"
futures-util = "0.3"
# HTTP server for MCP HTTP transport (axum, SSE). Optional: gates
# the --http flag. Adds significant compile time (axum + tower-http).
axum = { version = "0.8", default-features = false, features = ["http1", "tokio", "json"], optional = true }
tower-http = { version = "0.6", features = ["cors", "trace"], optional = true }
libc = "0.2"
dirs = "6"
unicode-bidi = "0.3"
# OCR tier (Tier B) — PP-OCR via ONNX Runtime, lazy model cache.
oar-ocr = { version = "0.9", default-features = false, features = ["download-binaries", "simd"], optional = true }
image = { version = "0.25", default-features = false, features = ["jpeg", "png"], optional = true }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "json", "blocking"] }
sha2 = "0.11"
base64 = "0.23"
ed25519-dalek = { version = "2", default-features = false, features = ["std"] }
zip = { version = "2", default-features = false, features = ["deflate"] }
# Probe mode (must_contain): pattern verification against fetched
# content. Pure Rust, no unsafe.
regex = "1"
# CLI subcommands: self-update, doctor.
tar = "0.4"
semver = "1"
# Agent CLI: spec-driven command generation (builder API, no derive).
clap = { version = "4", default-features = false, features = ["std", "help", "usage", "error-context", "suggestions"] }
psl = { version = "=2.1.226" }
# OCR/rerank support deps. `ort` itself goes ONLY in the per-target sections
# below, never here: Cargo unions features across matching target sections, so
# a shared entry leaks `load-dynamic` onto Windows/macOS and silently strips
# ONNX from those builds (the 3.3.0 bug — full story in src/onnx.rs).
tokenizers = { version = "0.23", default-features = false, features = ["onig"], optional = true }
ndarray = { version = "0.17", optional = true }
num_cpus = { version = "1.17", optional = true }
# Linux: dlopen'd at runtime behind an AVX gate — the prebuilt static archive
# runs unguarded AVX in global constructors and SIGILLs pre-`main` on non-AVX
# CPUs (#57). The .so is built at compile time and shipped beside the binary.
[target.'cfg(target_os = "linux")'.dependencies]
ort = { version = "=2.0.0-rc.12", default-features = false, features = ["load-dynamic", "ndarray", "api-24"], optional = true }
# macOS / Windows: statically linked. No AVX hazard worth the dlopen dance,
# and the MSVC linker cannot build a DLL from the archive (duplicate protobuf
# symbols), so dynamic loading is not an option here anyway.
[target.'cfg(not(target_os = "linux"))'.dependencies]
ort = { version = "=2.0.0-rc.12", default-features = false, features = ["std", "ndarray", "download-binaries", "tls-native", "copy-dylibs", "api-24"], optional = true }
[features]
# No default features — the core tool (fetch, search, crawl, PDF)
# works standalone. OCR and semantic reranking pull in ONNX Runtime,
# a heavy C++ dependency whose static global constructors can deadlock
# on some platforms (notably aarch64 Linux, see issue #9). CI and release
# builds explicitly enable both with `--features ocr,rerank`.
default = []
ocr = ["dep:oar-ocr", "dep:image", "reqwest/blocking"]
rerank = ["dep:ort", "dep:tokenizers", "dep:ndarray", "dep:num_cpus", "reqwest/blocking"]
http = ["dep:axum", "dep:tower-http"]
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_System_JobObjects", "Win32_System_Threading", "Win32_Security", "Win32_Foundation", "Win32_System_Console", "Win32_System_Registry"] }
[dev-dependencies]
rcgen = "0.14"
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "gzip", "brotli"] }
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
rustls-pki-types = { version = "1", default-features = false }
tokio-rustls = { version = "0.26", default-features = false, features = ["ring", "tls12"] }
[build-dependencies]
sha2 = "0.11"
flate2 = "1"
# cfg() on build-dependencies resolves against the HOST, not the target, so this
# only applies when building *on* Windows -- matching the #[cfg(windows)] gate on
# the version-resource code in build.rs. Cross-compiling to Windows from another
# host therefore yields an exe with no version resource; if that is ever needed,
# move this to the plain [build-dependencies] above and drop the #[cfg(windows)]
# in build.rs.
[target.'cfg(windows)'.build-dependencies]
# default-features = false drops the "toml" feature, which only exists to parse
# [package.metadata.winresource]; build.rs sets every field programmatically.
winresource = { version = "0.1", default-features = false }
[profile.release]
lto = "fat"
codegen-units = 1
strip = true
panic = "abort"
# Test/workflow profile: release optimizations minus fat LTO.
#
# Fat LTO makes every test-binary link minutes long (111 binaries
# in this repo). Tests don't need cross-crate inlining; the shipped
# binary still gets full fat LTO via the `release` profile built
# only at release time. `panic = "abort"` is inherited so the
# daemon-abort behavior stays faithful in tests, and opt-level 3
# keeps runtime-sensitive tests honest.
[profile.ci]
inherits = "release"
lto = false
codegen-units = 256