Skip to content

Commit 454781c

Browse files
Sprout speaks Nostr. Nothing else. (#475)
1 parent 4d0cd58 commit 454781c

146 files changed

Lines changed: 10818 additions & 14565 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,16 @@ jobs:
160160
RELAY_URL=ws://localhost:3000 \
161161
SPROUT_BIND_ADDR=0.0.0.0:3000 \
162162
SPROUT_REQUIRE_AUTH_TOKEN=false \
163+
SPROUT_RECONCILE_CHANNELS=true \
163164
./target/ci/sprout-relay > /tmp/sprout-relay.log 2>&1 &
164165
echo $! > /tmp/sprout-relay.pid
165166
for attempt in $(seq 1 60); do
166167
if ! kill -0 "$(cat /tmp/sprout-relay.pid)" 2>/dev/null; then
167168
cat /tmp/sprout-relay.log
168169
exit 1
169170
fi
170-
status_code=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:3000/api/channels || true)
171-
if [ "${status_code}" != "000" ]; then
171+
status_code=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:3000/_readiness || true)
172+
if [ "${status_code}" = "200" ]; then
172173
exit 0
173174
fi
174175
sleep 1

Cargo.lock

Lines changed: 4 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PLANS/HUDDLES_IMPLEMENTATION.md

Lines changed: 712 additions & 0 deletions
Large diffs are not rendered by default.

crates/sprout-acp/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ chrono = { workspace = true }
4545
# URL parsing
4646
url = { workspace = true }
4747

48+
# NIP-98 HTTP auth signing
49+
sha2 = { workspace = true }
50+
base64 = "0.22"
51+
hex = { workspace = true }
52+
4853
# Logging
4954
tracing = { workspace = true }
5055
tracing-subscriber = { workspace = true }

crates/sprout-acp/src/config.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ pub struct CliArgs {
183183
#[arg(long, env = "SPROUT_PRIVATE_KEY")]
184184
pub private_key: String,
185185

186-
#[arg(long, env = "SPROUT_API_TOKEN")]
187-
pub api_token: Option<String>,
186+
/// Agent owner pubkey (64-char hex). Used for --respond-to=owner-only gate.
187+
#[arg(long, env = "SPROUT_ACP_AGENT_OWNER")]
188+
pub agent_owner: Option<String>,
188189

189190
#[arg(long, env = "SPROUT_ACP_AGENT_COMMAND", default_value = "goose")]
190191
pub agent_command: String,
@@ -380,7 +381,6 @@ pub struct ChannelFilter {
380381
#[derive(Debug)]
381382
pub struct Config {
382383
pub keys: Keys,
383-
pub api_token: Option<String>,
384384
pub relay_url: String,
385385
pub agent_command: String,
386386
pub agent_args: Vec<String>,
@@ -418,6 +418,9 @@ pub struct Config {
418418
pub persona_env_vars: Vec<(String, String)>,
419419
/// Whether to publish encrypted observer frames through the relay.
420420
pub relay_observer: bool,
421+
/// Agent owner pubkey (hex). Used for `--respond-to=owner-only` gate.
422+
/// Replaces the old REST-based owner lookup.
423+
pub agent_owner: Option<String>,
421424
}
422425

423426
/// Validate and deduplicate allowlist entries: each must be exactly 64 hex chars.
@@ -724,7 +727,6 @@ impl Config {
724727

725728
let config = Config {
726729
keys,
727-
api_token: args.api_token,
728730
relay_url: args.relay_url,
729731
agent_command,
730732
agent_args,
@@ -754,6 +756,7 @@ impl Config {
754756
respond_to_allowlist,
755757
persona_env_vars,
756758
relay_observer: args.relay_observer,
759+
agent_owner: args.agent_owner.map(|s| s.trim().to_ascii_lowercase()),
757760
};
758761

759762
Ok(config)
@@ -1085,7 +1088,6 @@ mod tests {
10851088
fn test_config(mode: SubscribeMode) -> Config {
10861089
Config {
10871090
keys: nostr::Keys::generate(),
1088-
api_token: None,
10891091
relay_url: "ws://localhost:3000".into(),
10901092
agent_command: "goose".into(),
10911093
agent_args: vec!["acp".into()],
@@ -1115,6 +1117,7 @@ mod tests {
11151117
respond_to_allowlist: HashSet::new(),
11161118
persona_env_vars: vec![],
11171119
relay_observer: false,
1120+
agent_owner: None,
11181121
}
11191122
}
11201123

0 commit comments

Comments
 (0)