Skip to content

Commit

Permalink
Cleanup Cargo.toml, refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
hatchan committed Feb 28, 2025
1 parent 9f02179 commit d030698
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
20 changes: 9 additions & 11 deletions otel-worker-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ axum = { workspace = true, default-features = false, features = [
"tracing",
"ws",
] }
axum-jrpc = "0.7"
bytes = { version = "1.6" }
clap = { workspace = true, features = ["derive", "env"] }
otel-worker-core = { version = "0.1.0", path = "../otel-worker-core", features = [
"libsql",
"client",
] }
otel-worker-macros = { version = "0.1.0", path = "../otel-worker-macros" }
futures = "0.3"
futures-util = { version = "0.3" }
hex = { version = "0.4" }
http = { version = "1.1" }
Expand All @@ -49,8 +46,14 @@ opentelemetry-proto = { version = "0.27", features = [
"with-serde",
"with-schemars",
] }
otel-worker-core = { version = "0.1.0", path = "../otel-worker-core", features = [
"libsql",
"client",
] }
otel-worker-macros = { version = "0.1.0", path = "../otel-worker-macros" }
prost = { version = "0.13" }
rand = { version = "0.8.5" }
rust-mcp-schema = { version = "0.1.0", features = ["2024_11_05"] }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
Expand All @@ -59,6 +62,7 @@ strum = { version = "0.26", features = ["derive"] }
thiserror = { version = "2.0" }
time = { version = "0.3.17", features = ["serde-human-readable"] }
tokio = { version = "1.40", features = ["rt-multi-thread", "signal", "fs"] }
tokio-stream = { version = "0.1", features = ["sync"] }
tokio-tungstenite = { version = "0.24", features = [
"rustls-tls-webpki-roots",
] } # This should be kept the same as whatever Axum has
Expand All @@ -70,11 +74,5 @@ tracing-opentelemetry = { version = "0.28" }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
url = { version = "2.5" }


futures = "0.3"
tokio-stream = { version = "0.1", features = ["sync"] }
axum-jrpc = "0.7"
rust-mcp-schema = { version = "0.1.0", features = ["2024_11_05"] }

[dev-dependencies]
test-log = { version = "0.2", default-features = false, features = ["trace"] }
3 changes: 2 additions & 1 deletion otel-worker-cli/src/commands/mcp/http_sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use std::time::{Duration, Instant};
use tokio::net::TcpListener;
use tokio::sync::broadcast::{self, Sender};
use tokio_stream::wrappers::errors::BroadcastStreamRecvError;
use tokio_stream::wrappers::BroadcastStream;
use tracing::{debug, error, info, info_span, warn, Instrument};

pub(crate) async fn serve(
Expand Down Expand Up @@ -132,7 +133,7 @@ async fn sse_handler(
let initial_event =
futures::stream::once(async { Ok(Event::default().event("endpoint").data("/messages")) });

let events = tokio_stream::wrappers::BroadcastStream::new(receiver).map(|message| {
let events = BroadcastStream::new(receiver).map(|message| {
message.map(|message| {
Event::default()
.event("message")
Expand Down

0 comments on commit d030698

Please sign in to comment.