Skip to content
Merged
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: 5 additions & 0 deletions .changeset/tunnel-client-impl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@smooai/smooth': minor
---

th-e82dac (SMOODEV-401): `th tunnel` client is live — dials the th.smoo.ai rendezvous over WebSocket, does the ClientHello/ServerHello handshake, prints the assigned `<slug>.th.smoo.ai` public URL, and multiplexes inbound HTTP requests back to the local Big Smooth using the house `smooai-fetch` client (retries off, per-request timeout + circuit breaker). WebSocket-stream proxying and binary-response fidelity are the remaining follow-ups. `TunnelClient::run` now takes an `on_ready` callback and returns real transport/service errors instead of `NotImplementedYet`.
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,10 @@ smooth-api-client = { version = "0.15.7", path = "crates/smooth-api-client", pac
# Pearls: th-33d57b (scaffolded), th-0398c1 (auth module),
# th-abc4e2 (wires `th admin login`).
smooai-client-shared = { git = "https://github.com/SmooAI/client-shared.git", rev = "7309040afe15e20e7439cb9201cceed826cd2347", features = ["auth"] }

# The house HTTP client — resilient reqwest wrapper (retries, timeout,
# rate-limit, circuit breaker). The tunnel's local-target proxy uses it
# instead of raw reqwest. Rev-pinned like client-shared; the crate lives
# in the `rust/fetch/` subdir of the repo (cargo discovers it). Pearl
# th-e82dac.
smooai-fetch = { git = "https://github.com/SmooAI/fetch.git", rev = "238f63eed71155e92f33eb548ee7e862b41e5aa2" }
15 changes: 7 additions & 8 deletions crates/smooth-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3328,14 +3328,13 @@ async fn cmd_tunnel(cmd: TunnelCommands) -> Result<()> {
println!(" {} {}\n", "slug ".dimmed(), format!("{}", cfg.slug).bold());

let client = TunnelClient::new(cfg);
match client.run().await {
Ok(()) => Ok(()),
// Scaffold-phase: the rendezvous service isn't live
// yet. Surface the structured error with a friendly
// hint instead of crashing.
Err(smooth_tunnel::TunnelError::NotImplementedYet) => {
println!(" {} Scaffold only — the th.smoo.ai rendezvous service is not deployed yet.", "ℹ".cyan());
println!(" {} Track {} (smooai pearl th-8898f2) for the ECS side.\n", "ℹ".cyan(), "SMOODEV-637".bold());
let printed = |hello: &smooth_tunnel::ServerHello| {
println!(" {} {}", "✓ live at".green().bold(), hello.public_url.bold());
println!(" {} {}\n", "session ".dimmed(), hello.session_id.dimmed());
};
match client.run(printed).await {
Ok(()) => {
println!(" {} tunnel closed\n", "•".dimmed());
Ok(())
}
Err(e) => Err(anyhow::anyhow!("tunnel: {e}")),
Expand Down
1 change: 1 addition & 0 deletions crates/smooth-tunnel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ name = "smooth_tunnel"
tokio.workspace = true
tokio-tungstenite.workspace = true
futures-util.workspace = true
smooai-fetch.workspace = true
serde.workspace = true
serde_json.workspace = true
anyhow.workspace = true
Expand Down
Loading
Loading