Skip to content

Commit 8b4dc50

Browse files
committed
style: apply cargo fmt + biome formatting from just fix-all
Closes #18 (part 12 fmt) Signed-off-by: Brian Charbonneau <github@briancharbonneau.com>
1 parent a61e3b2 commit 8b4dc50

10 files changed

Lines changed: 111 additions & 84 deletions

File tree

crates/buzz-cli/src/commands/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
pub mod agents;
21
pub mod agent_drafts;
2+
pub mod agents;
33
pub mod channel_templates;
44
pub mod channels;
55
pub mod dms;

crates/buzz-core/src/agent_draft.rs

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -371,26 +371,39 @@ mod tests {
371371
request_id: "9f1c2b3a-4d5e-4f6a-8b7c-1d2e3f4a5b6c".to_string(),
372372
status: AgentDraftResolutionStatus::Accepted,
373373
timestamp: "2026-08-05T12:05:00.000Z".to_string(),
374-
agent_pubkey: Some("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".to_string()),
374+
agent_pubkey: Some(
375+
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".to_string(),
376+
),
375377
reason: Some("Approved".to_string()),
376378
}
377379
}
378380

379-
fn build_request_event(agent_keys: &Keys, owner_pubkey: &PublicKey, ciphertext: String) -> Event {
380-
EventBuilder::new(Kind::Custom(crate::kind::KIND_AGENT_DRAFT_REQUEST as u16), ciphertext)
381-
.tags([
382-
Tag::parse(["p", &owner_pubkey.to_hex()]).unwrap(),
383-
Tag::parse(["p", &agent_keys.public_key().to_hex()]).unwrap(),
384-
Tag::parse(["agent", &agent_keys.public_key().to_hex()]).unwrap(),
385-
])
386-
// The agent's own pubkey is a `p` tag; nostr's EventBuilder discards
387-
// self-`p`-tags unless self-tagging is allowed.
388-
.allow_self_tagging()
389-
.sign_with_keys(agent_keys)
390-
.expect("sign")
381+
fn build_request_event(
382+
agent_keys: &Keys,
383+
owner_pubkey: &PublicKey,
384+
ciphertext: String,
385+
) -> Event {
386+
EventBuilder::new(
387+
Kind::Custom(crate::kind::KIND_AGENT_DRAFT_REQUEST as u16),
388+
ciphertext,
389+
)
390+
.tags([
391+
Tag::parse(["p", &owner_pubkey.to_hex()]).unwrap(),
392+
Tag::parse(["p", &agent_keys.public_key().to_hex()]).unwrap(),
393+
Tag::parse(["agent", &agent_keys.public_key().to_hex()]).unwrap(),
394+
])
395+
// The agent's own pubkey is a `p` tag; nostr's EventBuilder discards
396+
// self-`p`-tags unless self-tagging is allowed.
397+
.allow_self_tagging()
398+
.sign_with_keys(agent_keys)
399+
.expect("sign")
391400
}
392401

393-
fn build_resolution_event(owner_keys: &Keys, agent_pubkey: &PublicKey, ciphertext: String) -> Event {
402+
fn build_resolution_event(
403+
owner_keys: &Keys,
404+
agent_pubkey: &PublicKey,
405+
ciphertext: String,
406+
) -> Event {
394407
EventBuilder::new(
395408
Kind::Custom(crate::kind::KIND_AGENT_DRAFT_RESOLUTION as u16),
396409
ciphertext,
@@ -399,7 +412,11 @@ mod tests {
399412
Tag::parse(["p", &owner_keys.public_key().to_hex()]).unwrap(),
400413
Tag::parse(["p", &agent_pubkey.to_hex()]).unwrap(),
401414
Tag::parse(["agent", &agent_pubkey.to_hex()]).unwrap(),
402-
Tag::parse(["e", "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2"]).unwrap(),
415+
Tag::parse([
416+
"e",
417+
"a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
418+
])
419+
.unwrap(),
403420
])
404421
// The owner's own pubkey is a `p` tag; nostr's EventBuilder discards
405422
// self-`p`-tags unless self-tagging is allowed.

crates/buzz-core/src/filter.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,11 @@ mod tests {
346346
Tag::parse(["p", &owner_keys.public_key().to_hex()]).unwrap(),
347347
Tag::parse(["p", &agent_keys.public_key().to_hex()]).unwrap(),
348348
Tag::parse(["agent", &agent_keys.public_key().to_hex()]).unwrap(),
349-
Tag::parse(["e", "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2"])
350-
.unwrap(),
349+
Tag::parse([
350+
"e",
351+
"a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
352+
])
353+
.unwrap(),
351354
])
352355
// The owner's own pubkey is a `p` tag; nostr's EventBuilder discards
353356
// self-`p`-tags unless self-tagging is allowed.

crates/buzz-core/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
//! Provides [`StoredEvent`], filter matching, kind constants, and event
66
//! verification. All other Buzz crates depend on this one.
77
8-
/// NIP-AM: Agent Turn Metric — payload type and encrypt/decrypt helpers.
9-
pub mod agent_turn_metric;
108
/// NIP-AD: Agent Draft — payload types and encrypt/decrypt helpers.
119
pub mod agent_draft;
10+
/// NIP-AM: Agent Turn Metric — payload type and encrypt/decrypt helpers.
11+
pub mod agent_turn_metric;
1212
/// Channel and membership enums shared across crates.
1313
pub mod channel;
1414
/// NIP-AE Agent Engrams — slug grammar, conversation key, d-tag derivation,

crates/buzz-relay/src/handlers/ingest.rs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ use buzz_core::kind::{
2020
KIND_GIFT_WRAP, KIND_GIT_ISSUE, KIND_GIT_PATCH, KIND_GIT_PR_UPDATE, KIND_GIT_PULL_REQUEST,
2121
KIND_GIT_REPO_ANNOUNCEMENT, KIND_GIT_REPO_STATE, KIND_GIT_STATUS_CLOSED, KIND_GIT_STATUS_DRAFT,
2222
KIND_GIT_STATUS_MERGED, KIND_GIT_STATUS_OPEN, KIND_HUDDLE_ENDED, KIND_HUDDLE_GUIDELINES,
23-
KIND_HUDDLE_PARTICIPANT_JOINED,
24-
KIND_HUDDLE_PARTICIPANT_LEFT, KIND_HUDDLE_STARTED, KIND_IA_ARCHIVE_REQUEST,
25-
KIND_IA_UNARCHIVE_REQUEST, KIND_LONG_FORM, KIND_MANAGED_AGENT, KIND_MEMBER_ADDED_NOTIFICATION,
26-
KIND_MEMBER_REMOVED_NOTIFICATION, KIND_MODERATION_BAN, KIND_MODERATION_RESOLVE_REPORT,
27-
KIND_MODERATION_TIMEOUT, KIND_MODERATION_UNBAN, KIND_MODERATION_UNTIMEOUT, KIND_MUTE_LIST,
28-
KIND_NIP29_CREATE_GROUP, KIND_NIP29_DELETE_EVENT, KIND_NIP29_DELETE_GROUP,
29-
KIND_NIP29_EDIT_METADATA, KIND_NIP29_JOIN_REQUEST, KIND_NIP29_LEAVE_REQUEST,
30-
KIND_NIP29_PUT_USER, KIND_NIP29_REMOVE_USER, KIND_NIP43_LEAVE_REQUEST,
31-
KIND_NIP65_RELAY_LIST_METADATA, KIND_PERSONA, KIND_PIN_LIST, KIND_PRESENCE_UPDATE,
32-
KIND_PRODUCT_FEEDBACK, KIND_PROFILE, KIND_PROJECT, KIND_REACTION, KIND_READ_STATE, KIND_REPORT,
33-
KIND_STREAM_MESSAGE, KIND_STREAM_MESSAGE_BOOKMARKED, KIND_STREAM_MESSAGE_DIFF,
34-
KIND_STREAM_MESSAGE_EDIT, KIND_STREAM_MESSAGE_PINNED, KIND_STREAM_MESSAGE_SCHEDULED,
35-
KIND_STREAM_MESSAGE_V2, KIND_STREAM_REMINDER, KIND_TEAM, KIND_TEAM_CATALOG, KIND_TEXT_NOTE,
36-
KIND_USER_STATUS, KIND_WORKFLOW_DEF, KIND_WORKFLOW_TRIGGER, RELAY_ADMIN_ADD_MEMBER,
37-
RELAY_ADMIN_CHANGE_ROLE, RELAY_ADMIN_REMOVE_MEMBER, RELAY_ADMIN_SET_WORKSPACE_PROFILE,
23+
KIND_HUDDLE_PARTICIPANT_JOINED, KIND_HUDDLE_PARTICIPANT_LEFT, KIND_HUDDLE_STARTED,
24+
KIND_IA_ARCHIVE_REQUEST, KIND_IA_UNARCHIVE_REQUEST, KIND_LONG_FORM, KIND_MANAGED_AGENT,
25+
KIND_MEMBER_ADDED_NOTIFICATION, KIND_MEMBER_REMOVED_NOTIFICATION, KIND_MODERATION_BAN,
26+
KIND_MODERATION_RESOLVE_REPORT, KIND_MODERATION_TIMEOUT, KIND_MODERATION_UNBAN,
27+
KIND_MODERATION_UNTIMEOUT, KIND_MUTE_LIST, KIND_NIP29_CREATE_GROUP, KIND_NIP29_DELETE_EVENT,
28+
KIND_NIP29_DELETE_GROUP, KIND_NIP29_EDIT_METADATA, KIND_NIP29_JOIN_REQUEST,
29+
KIND_NIP29_LEAVE_REQUEST, KIND_NIP29_PUT_USER, KIND_NIP29_REMOVE_USER,
30+
KIND_NIP43_LEAVE_REQUEST, KIND_NIP65_RELAY_LIST_METADATA, KIND_PERSONA, KIND_PIN_LIST,
31+
KIND_PRESENCE_UPDATE, KIND_PRODUCT_FEEDBACK, KIND_PROFILE, KIND_PROJECT, KIND_REACTION,
32+
KIND_READ_STATE, KIND_REPORT, KIND_STREAM_MESSAGE, KIND_STREAM_MESSAGE_BOOKMARKED,
33+
KIND_STREAM_MESSAGE_DIFF, KIND_STREAM_MESSAGE_EDIT, KIND_STREAM_MESSAGE_PINNED,
34+
KIND_STREAM_MESSAGE_SCHEDULED, KIND_STREAM_MESSAGE_V2, KIND_STREAM_REMINDER, KIND_TEAM,
35+
KIND_TEAM_CATALOG, KIND_TEXT_NOTE, KIND_USER_STATUS, KIND_WORKFLOW_DEF, KIND_WORKFLOW_TRIGGER,
36+
RELAY_ADMIN_ADD_MEMBER, RELAY_ADMIN_CHANGE_ROLE, RELAY_ADMIN_REMOVE_MEMBER,
37+
RELAY_ADMIN_SET_WORKSPACE_PROFILE,
3838
};
3939
use buzz_core::tenant::TenantContext;
4040
use buzz_core::verification::verify_event;
@@ -1614,9 +1614,7 @@ fn validate_agent_turn_metric_envelope(event: &nostr::Event) -> Result<(), Strin
16141614
/// and `owner_hex` is the `p` tag that is not the agent. Ownership
16151615
/// (`is_agent_owner`) and the author-direction check are performed by the
16161616
/// per-kind validators and the async DB check in `ingest_event_inner`.
1617-
fn validate_agent_draft_common_envelope(
1618-
event: &nostr::Event,
1619-
) -> Result<(String, String), String> {
1617+
fn validate_agent_draft_common_envelope(event: &nostr::Event) -> Result<(String, String), String> {
16201618
let mut p_tags: Vec<&str> = Vec::new();
16211619
let mut agent_tags: Vec<&str> = Vec::new();
16221620
let mut has_h_tag = false;
@@ -1678,7 +1676,11 @@ fn validate_agent_draft_common_envelope(
16781676
}
16791677

16801678
// The owner is the `p` tag that is not the agent.
1681-
let owner = if p_tags[0] == agent { p_tags[1] } else { p_tags[0] };
1679+
let owner = if p_tags[0] == agent {
1680+
p_tags[1]
1681+
} else {
1682+
p_tags[0]
1683+
};
16821684

16831685
// Content must look like a NIP-44 v2 ciphertext (length, base64, version prefix).
16841686
validate_engram_nip44_content(&event.content)

crates/buzz-sdk/src/builders.rs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ use buzz_core::{
77
kind::{
88
KIND_AGENT_DRAFT_REQUEST, KIND_AGENT_DRAFT_RESOLUTION, KIND_AGENT_OBSERVER_FRAME,
99
KIND_APPROVAL_DENY, KIND_APPROVAL_GRANT, KIND_DELETION, KIND_DM_ADD_MEMBER, KIND_DM_OPEN,
10-
KIND_EMOJI_SET, KIND_GIT_ISSUE, KIND_GIT_PATCH, KIND_GIT_PR_UPDATE,
11-
KIND_GIT_PULL_REQUEST, KIND_GIT_REPO_ANNOUNCEMENT, KIND_GIT_STATUS_CLOSED,
12-
KIND_GIT_STATUS_DRAFT, KIND_GIT_STATUS_MERGED, KIND_GIT_STATUS_OPEN,
13-
KIND_IA_ARCHIVE_REQUEST, KIND_IA_UNARCHIVE_REQUEST, KIND_MODERATION_BAN,
14-
KIND_MODERATION_RESOLVE_REPORT, KIND_MODERATION_TIMEOUT, KIND_MODERATION_UNBAN,
15-
KIND_MODERATION_UNTIMEOUT, KIND_PRESENCE_UPDATE, KIND_PROJECT, KIND_USER_STATUS,
16-
KIND_WORKFLOW_DEF, KIND_WORKFLOW_TRIGGER,
10+
KIND_EMOJI_SET, KIND_GIT_ISSUE, KIND_GIT_PATCH, KIND_GIT_PR_UPDATE, KIND_GIT_PULL_REQUEST,
11+
KIND_GIT_REPO_ANNOUNCEMENT, KIND_GIT_STATUS_CLOSED, KIND_GIT_STATUS_DRAFT,
12+
KIND_GIT_STATUS_MERGED, KIND_GIT_STATUS_OPEN, KIND_IA_ARCHIVE_REQUEST,
13+
KIND_IA_UNARCHIVE_REQUEST, KIND_MODERATION_BAN, KIND_MODERATION_RESOLVE_REPORT,
14+
KIND_MODERATION_TIMEOUT, KIND_MODERATION_UNBAN, KIND_MODERATION_UNTIMEOUT,
15+
KIND_PRESENCE_UPDATE, KIND_PROJECT, KIND_USER_STATUS, KIND_WORKFLOW_DEF,
16+
KIND_WORKFLOW_TRIGGER,
1717
},
1818
observer::{
1919
content_looks_like_nip44, OBSERVER_AGENT_TAG, OBSERVER_FRAME_CONTROL, OBSERVER_FRAME_TAG,
@@ -2405,7 +2405,10 @@ mod tests {
24052405
vec![agent.public_key().to_hex()]
24062406
);
24072407
assert!(!has_tag(&ev, "h", ""));
2408-
assert!(!ev.tags.iter().any(|t| t.as_slice().first().map(|v| v.as_str()) == Some("h")));
2408+
assert!(!ev
2409+
.tags
2410+
.iter()
2411+
.any(|t| t.as_slice().first().map(|v| v.as_str()) == Some("h")));
24092412
}
24102413

24112414
#[test]
@@ -2435,7 +2438,10 @@ mod tests {
24352438
vec![agent.public_key().to_hex()]
24362439
);
24372440
assert_eq!(tag_values(&ev, "e"), vec![request_event_id.to_string()]);
2438-
assert!(!ev.tags.iter().any(|t| t.as_slice().first().map(|v| v.as_str()) == Some("h")));
2441+
assert!(!ev
2442+
.tags
2443+
.iter()
2444+
.any(|t| t.as_slice().first().map(|v| v.as_str()) == Some("h")));
24392445
}
24402446

24412447
#[test]
@@ -2467,8 +2473,8 @@ mod tests {
24672473
#[test]
24682474
fn agent_draft_resolution_rejects_owner_equals_agent() {
24692475
let pk = "a".repeat(64);
2470-
let err = build_agent_draft_resolution(&pk, &pk, &"c".repeat(64), &fake_nip44())
2471-
.unwrap_err();
2476+
let err =
2477+
build_agent_draft_resolution(&pk, &pk, &"c".repeat(64), &fake_nip44()).unwrap_err();
24722478
assert!(matches!(err, SdkError::InvalidInput(_)));
24732479
}
24742480

desktop/src-tauri/src/commands/agent_adoption.rs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ pub async fn adopt_external_agent(
127127
model: Option<String>,
128128
respond_to: Option<String>,
129129
) -> Result<AdoptExternalAgentResult, String> {
130-
let agent_pubkey = nostr::PublicKey::parse(&agent_pubkey)
131-
.map_err(|e| format!("invalid agent pubkey: {e}"))?;
130+
let agent_pubkey =
131+
nostr::PublicKey::parse(&agent_pubkey).map_err(|e| format!("invalid agent pubkey: {e}"))?;
132132
let agent_hex = agent_pubkey.to_hex();
133133
let display_name = display_name.trim().to_string();
134134
if display_name.is_empty() {
@@ -193,15 +193,14 @@ pub async fn import_external_agent_key(
193193
nsec: String,
194194
display_name: String,
195195
) -> Result<AdoptExternalAgentResult, String> {
196-
let agent_pubkey = nostr::PublicKey::parse(&agent_pubkey)
197-
.map_err(|e| format!("invalid agent pubkey: {e}"))?;
196+
let agent_pubkey =
197+
nostr::PublicKey::parse(&agent_pubkey).map_err(|e| format!("invalid agent pubkey: {e}"))?;
198198
let agent_hex = agent_pubkey.to_hex();
199199
let display_name = display_name.trim().to_string();
200200
if display_name.is_empty() {
201201
return Err("display name is required".to_string());
202202
}
203-
let keys = nostr::Keys::parse(nsec.trim())
204-
.map_err(|e| format!("invalid nsec: {e}"))?;
203+
let keys = nostr::Keys::parse(nsec.trim()).map_err(|e| format!("invalid nsec: {e}"))?;
205204
if keys.public_key() != agent_pubkey {
206205
return Err("nsec does not match the agent pubkey".to_string());
207206
}
@@ -271,8 +270,8 @@ mod tests {
271270
// The tag embeds the owner pubkey and is verifiable against the agent.
272271
let parsed: serde_json::Value = serde_json::from_str(&tag).expect("tag json");
273272
assert_eq!(parsed[1], serde_json::json!(owner.public_key().to_hex()));
274-
let verified = buzz_sdk_pkg::nip_oa::verify_auth_tag(&tag, &agent.public_key())
275-
.expect("verify");
273+
let verified =
274+
buzz_sdk_pkg::nip_oa::verify_auth_tag(&tag, &agent.public_key()).expect("verify");
276275
assert_eq!(verified, owner.public_key());
277276
}
278277

@@ -281,12 +280,9 @@ mod tests {
281280
let owner = nostr::Keys::generate();
282281
let compat_owner = nostr::Keys::parse(&owner.secret_key().to_secret_hex()).unwrap();
283282
// Owner == agent must be rejected (self-attestation).
284-
assert!(buzz_sdk_pkg::nip_oa::compute_auth_tag(
285-
&compat_owner,
286-
&owner.public_key(),
287-
""
288-
)
289-
.is_err());
283+
assert!(
284+
buzz_sdk_pkg::nip_oa::compute_auth_tag(&compat_owner, &owner.public_key(), "").is_err()
285+
);
290286
}
291287

292288
/// Mirrors the runtime spawn guard: non-Local backends are rejected, with

desktop/src-tauri/src/commands/agent_drafts.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ pub async fn resolve_agent_draft(
171171
"superseded" => buzz_core_pkg::agent_draft::AgentDraftResolutionStatus::Superseded,
172172
other => return Err(format!("invalid status: {other}")),
173173
};
174-
let agent_pubkey = nostr::PublicKey::parse(&agent_pubkey)
175-
.map_err(|e| format!("invalid agent pubkey: {e}"))?;
174+
let agent_pubkey =
175+
nostr::PublicKey::parse(&agent_pubkey).map_err(|e| format!("invalid agent pubkey: {e}"))?;
176176
let payload = buzz_core_pkg::agent_draft::AgentDraftResolutionPayload {
177177
version: buzz_core_pkg::agent_draft::AGENT_DRAFT_VERSION,
178178
request_id,
@@ -295,7 +295,10 @@ mod tests {
295295
assert_eq!(info.channel_id, payload.channel_id);
296296
assert_eq!(info.agent_pubkey, agent.public_key().to_hex());
297297
assert_eq!(info.display_name.as_deref(), Some("dev-coder"));
298-
assert_eq!(info.system_prompt.as_deref(), Some("You are a coding specialist."));
298+
assert_eq!(
299+
info.system_prompt.as_deref(),
300+
Some("You are a coding specialist.")
301+
);
299302
assert!(info.agent_name.is_none());
300303
}
301304

desktop/src-tauri/src/commands/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
mod agent_auth;
21
mod agent_adoption;
2+
mod agent_auth;
33
mod agent_config;
44
mod agent_discovery;
55
mod agent_drafts;
@@ -63,8 +63,8 @@ mod window_vibrancy;
6363
mod workflows;
6464
mod workspace;
6565

66-
pub use agent_auth::*;
6766
pub use agent_adoption::*;
67+
pub use agent_auth::*;
6868
pub use agent_config::*;
6969
pub use agent_discovery::*;
7070
pub use agent_drafts::*;

desktop/src-tauri/src/lib.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ fn reveal_initial_window<R: tauri::Runtime>(window: &tauri::Window<R>) {
8888

8989
#[cfg(target_os = "macos")]
9090
fn set_initial_window_backing<R: tauri::Runtime>(window: &tauri::Window<R>) {
91-
// The window remains transparent at runtime for vibrancy. Use an opaque
92-
// native backing only across the first visible frames so the previous app
93-
// cannot show through before WebKit has submitted its first surface.
91+
// The window stays transparent at runtime for vibrancy; use an opaque
92+
// native backing only across the first frames so the prior app can't show
93+
// through before WebKit submits its first surface.
9494
if let Err(error) = window.set_background_color(Some(tauri::window::Color(17, 21, 24, 255))) {
9595
eprintln!("buzz-desktop: failed to set initial window backing: {error}");
9696
}
@@ -115,10 +115,8 @@ async fn wait_for_stable_initial_window_geometry<R: tauri::Runtime>(window: &tau
115115
for _ in 0..MAX_POLLS {
116116
// Accept whatever geometry the window-state plugin restores — maximized
117117
// or a normal saved size. macOS applies the restore asynchronously, so
118-
// we only need consecutive identical outer bounds to know it settled.
119-
// Gating on `is_maximized()` here would leave `bounds` permanently
120-
// `None` for restored non-maximized windows and stall the reveal until
121-
// the poll timeout.
118+
// consecutive identical outer bounds mean it settled; gating on
119+
// `is_maximized()` would leave `bounds` None and stall the reveal.
122120
let bounds = match (window.outer_position(), window.outer_size()) {
123121
(Ok(position), Ok(size)) => Some((position.x, position.y, size.width, size.height)),
124122
_ => None,
@@ -142,11 +140,9 @@ async fn wait_for_stable_initial_window_geometry<R: tauri::Runtime>(window: &tau
142140

143141
#[cfg_attr(mobile, tauri::mobile_entry_point)]
144142
pub fn run() {
145-
// mesh-llm's async chains (model download, node start/join) overflow
146-
// tokio's default 2 MiB worker stacks — a stack-guard SIGABRT, not a
147-
// panic. Upstream mesh-llm and mesh-console both run on 8 MiB worker
148-
// stacks for this reason; give Tauri's command runtime the same headroom
149-
// before anything else touches tauri::async_runtime.
143+
// mesh-llm's async chains overflow tokio's default 2 MiB worker stacks
144+
// (a stack-guard SIGABRT). Upstream runs 8 MiB workers; give Tauri's
145+
// command runtime the same headroom before anything else touches it.
150146
#[cfg(feature = "mesh-llm")]
151147
match tokio::runtime::Builder::new_multi_thread()
152148
.enable_all()
@@ -718,7 +714,8 @@ pub fn run() {
718714
auto_connect_default_relay_enabled,
719715
get_legacy_workspace_storage,
720716
is_shared_identity,
721-
get_relay_ws_url, get_relay_http_url,
717+
get_relay_ws_url,
718+
get_relay_http_url,
722719
get_media_proxy_port,
723720
fetch_link_preview_title,
724721
discover_acp_auth_methods,
@@ -797,8 +794,11 @@ pub fn run() {
797794
resolve_oa_owner,
798795
list_relay_agents,
799796
list_managed_agents,
800-
list_pending_agent_drafts, resolve_agent_draft, adopt_external_agent,
801-
import_external_agent_key, list_managed_agent_runtimes,
797+
list_pending_agent_drafts,
798+
resolve_agent_draft,
799+
adopt_external_agent,
800+
import_external_agent_key,
801+
list_managed_agent_runtimes,
802802
start_managed_agent_runtime,
803803
stop_managed_agent_runtime,
804804
restart_managed_agent_runtime,

0 commit comments

Comments
 (0)