mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
The serverless agent path hand-rolled multi-relay subscribe/reconnect/ resubscribe/dedup in relay.rs — reimplementing what nostr-relay-pool (rust-nostr) already does, with gaps that caused the agent to miss messages when a single relay 502'd mid-session. Replace the serverless backend with nostr-relay-pool's RelayPool, which provides the standard Nostr client model used by damus/0xchat/nostr-tools: - persistent REQ per relay, fanned out across all relays - auto-reconnect (default) with jittered backoff - auto-resubscribe on reconnect (relays replay stored events on REQ) - merge + dedup across relays (Event notification = first-seen only) HarnessRelay now dispatches to ServerlessRelay when serverless; server mode (NIP-42 AUTH + HTTP bridge) is unchanged. RestClient and the typing/ presence publisher share the pool. Subscription IDs match the server-mode scheme so event routing is identical. Proven: e2e_agent_responds passes 3x consecutively (~3s each) against live public relays, surviving damus 503s via nos.lol. - 272 unit tests pass, clippy clean
146 lines
4.5 KiB
TOML
146 lines
4.5 KiB
TOML
[workspace]
|
|
members = [
|
|
"crates/sprout-relay",
|
|
"crates/sprout-core",
|
|
"crates/sprout-db",
|
|
"crates/sprout-pubsub",
|
|
"crates/sprout-auth",
|
|
"crates/sprout-search",
|
|
"crates/sprout-audit",
|
|
"crates/sprout-mcp",
|
|
"crates/sprout-acp",
|
|
"crates/sprout-agent",
|
|
"crates/sprig",
|
|
"crates/sprout-proxy",
|
|
"crates/sprout-test-client",
|
|
"crates/sprout-admin",
|
|
"crates/sprout-workflow",
|
|
"crates/sprout-media",
|
|
"crates/sprout-cli",
|
|
"crates/sprout-pairing-cli",
|
|
"crates/sprout-sdk",
|
|
"crates/sprout-persona",
|
|
"crates/git-credential-nostr",
|
|
"crates/git-sign-nostr",
|
|
"crates/sprout-pair-relay",
|
|
"crates/sprout-dev-mcp",
|
|
"examples/countdown-bot",
|
|
]
|
|
exclude = ["desktop/src-tauri"]
|
|
resolver = "2"
|
|
|
|
[workspace.package]
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
rust-version = "1.88.0"
|
|
license = "Apache-2.0"
|
|
repository = "https://github.com/block/sprout"
|
|
|
|
[workspace.dependencies]
|
|
# Runtime
|
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "time", "sync", "io-util", "signal", "process"] }
|
|
tokio-util = { version = "0.7", features = ["rt", "codec"] }
|
|
|
|
# HTTP + WebSocket
|
|
axum = { version = "0.8", features = ["ws", "macros"] }
|
|
tower = { version = "0.5", features = ["timeout", "util"] }
|
|
tower-http = { version = "0.6", features = ["trace", "cors", "compression-gzip", "limit", "fs"] }
|
|
|
|
# Database
|
|
sqlx = { version = "0.9", features = [
|
|
"runtime-tokio", "tls-rustls", "postgres", "uuid", "chrono", "json"
|
|
] }
|
|
|
|
# Redis
|
|
redis = { version = "1.0", features = ["tokio-comp", "connection-manager"] }
|
|
deadpool-redis = { version = "0.23", features = ["rt_tokio_1"] }
|
|
|
|
# Nostr
|
|
nostr = { version = "0.44", features = ["nip44", "nip59", "nip98"] }
|
|
# High-level relay pool: persistent multi-relay subscriptions with built-in
|
|
# auto-reconnect + auto-resubscribe (relays replay stored events on REQ). Used
|
|
# for the serverless agent path instead of hand-rolling reconnect/resubscribe.
|
|
nostr-relay-pool = { version = "0.44", default-features = false }
|
|
|
|
# Serialization
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
serde_yaml = "0.9"
|
|
evalexpr = "11"
|
|
cron = "0.16"
|
|
# Observability
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
|
|
metrics = "0.24"
|
|
metrics-exporter-prometheus = "0.18"
|
|
|
|
# Error handling
|
|
thiserror = "2"
|
|
anyhow = "1"
|
|
|
|
# Utilities
|
|
uuid = { version = "1", features = ["v4", "serde"] }
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
|
|
# HTTP client (webhook delivery, Typesense indexing)
|
|
reqwest = { version = "0.13", features = ["json", "rustls"], default-features = false }
|
|
|
|
# Cryptography
|
|
sha2 = "0.11"
|
|
hex = "0.4"
|
|
hmac = "0.13"
|
|
|
|
# Randomness
|
|
rand = "0.10"
|
|
subtle = "2.6"
|
|
zeroize = "1.8"
|
|
|
|
# Concurrent data structures
|
|
dashmap = "6"
|
|
moka = { version = "0.12", features = ["sync"] }
|
|
|
|
# Async stream utilities
|
|
futures-util = "0.3"
|
|
|
|
# WebSocket client (test client)
|
|
tokio-tungstenite = { version = "0.29", features = ["rustls-tls-webpki-roots"] }
|
|
url = "2"
|
|
|
|
# MCP SDK
|
|
rmcp = { version = "1.1.0", features = ["server", "transport-io", "macros"] }
|
|
schemars = { version = "1", default-features = false }
|
|
|
|
# Internal crates
|
|
sprout-core = { path = "crates/sprout-core" }
|
|
sprout-db = { path = "crates/sprout-db" }
|
|
sprout-auth = { path = "crates/sprout-auth" }
|
|
sprout-pubsub = { path = "crates/sprout-pubsub" }
|
|
sprout-search = { path = "crates/sprout-search" }
|
|
sprout-audit = { path = "crates/sprout-audit" }
|
|
sprout-mcp = { path = "crates/sprout-mcp" }
|
|
sprout-proxy = { path = "crates/sprout-proxy" }
|
|
sprout-workflow = { path = "crates/sprout-workflow" }
|
|
sprout-media = { path = "crates/sprout-media" }
|
|
sprout-sdk = { path = "crates/sprout-sdk" }
|
|
|
|
# CI profile — release-grade codegen for the relay so e2e tests hit a
|
|
# realistic binary, not an unoptimised debug build. Inherits `release`
|
|
# defaults (opt-level 3, no debug-assertions) but keeps incremental
|
|
# compilation enabled and avoids LTO so the build stays fast.
|
|
[profile.ci]
|
|
inherits = "release"
|
|
lto = false
|
|
|
|
# Sprig profile — optimized for deploy-anywhere Sprig release artifacts.
|
|
# Sprig is distributed over the network and installed on fresh hosts, so binary
|
|
# size matters more than compile speed here. Keep this separate from the normal
|
|
# `release` profile so desktop/dev release builds do not inherit the slower
|
|
# size-focused settings unless they opt in explicitly.
|
|
[profile.sprig]
|
|
inherits = "release"
|
|
opt-level = "z"
|
|
lto = "fat"
|
|
codegen-units = 1
|
|
panic = "abort"
|
|
strip = true
|