Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ encoding_rs = "0.8.35"
url = "2"

# HTTP client
reqwest = { version = "0.13.4", default-features = false, features = ["native-tls", "rustls", "json", "stream", "multipart", "query", "form"] }
reqwest = { version = "0.12", default-features = false, features = ["native-tls", "rustls-tls-native-roots", "json", "stream", "multipart"] }

# Debug Log HTTP Server
axum = { version = "0.8", features = ["json", "ws"] }
Expand All @@ -137,7 +137,7 @@ toml = "0.9"
git2 = { version = "0.21", default-features = false, features = ["https", "vendored-libgit2"] }

# Terminal
portable-pty = "0.8"
portable-pty = "0.9"
vte = "0.15.0"
clap = { version = "4.6.1", features = ["derive"] }
crossterm = "0.28"
Expand Down Expand Up @@ -235,7 +235,6 @@ rmcp = { version = "1.7", default-features = false, features = [
"client",
"elicitation",
"macros",
"reqwest",
"schemars",
"server",
] }
Expand Down
16 changes: 12 additions & 4 deletions src/crates/assembly/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ globset = { workspace = true, optional = true }

eventsource-stream = { workspace = true, optional = true }

# MCP Streamable HTTP client (official rust-sdk)
rmcp = { workspace = true, features = [
"transport-streamable-http-client-reqwest",
], optional = true }
sse-stream = { workspace = true, optional = true }

# Shared AI protocol adapters
Expand Down Expand Up @@ -158,6 +154,18 @@ rustls = { workspace = true }
rustls-native-certs = "0.8"
schannel = "0.1"

# MCP Streamable HTTP client (official rust-sdk)
[target.'cfg(not(target_env = "ohos"))'.dependencies]
rmcp = { workspace = true, features = [
"transport-streamable-http-client-reqwest",
"reqwest",
], optional = true }

[target.'cfg(target_env = "ohos")'.dependencies]
rmcp = { workspace = true, features = [
"transport-streamable-http-client-reqwest",
], optional = true }

[features]
# Full product runtime feature set. Product crates should depend on this
# explicitly before `bitfun-core` default features are made lighter.
Expand Down
3 changes: 2 additions & 1 deletion src/crates/execution/tool-execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ htmd = { version = "0.5.4", optional = true }
ignore = { workspace = true }
legible = { version = "0.4.2", optional = true }
log = { workspace = true }
readability-js = { version = "0.1.5", optional = true }
regex = { workspace = true, optional = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
tokio-util = { workspace = true }
vte = { workspace = true, features = ["ansi"] }
[target.'cfg(not(target_env = "ohos"))'.dependencies]
readability-js = { version = "0.1.5", optional = true }

[lints]
workspace = true
12 changes: 8 additions & 4 deletions src/crates/execution/tool-execution/src/web_readable.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use htmd::HtmlToMarkdown;
use legible::{parse as parse_legible, Error as LegibleError, Options as LegibleOptions};
#[cfg(not(target_env = "ohos"))]
use readability_js::{Readability, ReadabilityOptions};
use regex::{Captures, Regex};

Expand Down Expand Up @@ -73,10 +74,12 @@ pub fn extract_markdown_with_text_fallback(
// Keep the existing extractor order. Local extraction experiments across
// article, documentation, wiki, and forum pages showed `legible` gives the
// best current quality/latency balance, with readability-js as fallback.
for extractor in [
attempt_legible as ExtractorFn,
attempt_readability_js as ExtractorFn,
] {
#[cfg(not(target_env = "ohos"))]
let extractors: &[ExtractorFn] = &[attempt_legible as ExtractorFn, attempt_readability_js as ExtractorFn];
#[cfg(target_env = "ohos")]
let extractors: &[ExtractorFn] = &[attempt_legible as ExtractorFn];

for extractor in extractors {
let Ok(candidate) = extractor(html, base_url) else {
continue;
};
Expand Down Expand Up @@ -145,6 +148,7 @@ fn attempt_legible(html: &str, base_url: &str) -> Result<ExtractedCandidate, Str
})
}

#[cfg(not(target_env = "ohos"))]
fn attempt_readability_js(html: &str, base_url: &str) -> Result<ExtractedCandidate, String> {
let reader = Readability::new()
.map_err(|err| format!("Failed to initialize readability-js: {}", err))?;
Expand Down