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
11 changes: 11 additions & 0 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
# lexical-core: unmaintained, pulled by tauri dep chain
# serde_cbor: unmaintained, pulled by tao (tauri)
# cocoa/cocoa-foundation: unmaintained, pulled by tauri/tao
#
# quick-xml 0.37/0.38: both advisories want >=0.41.0, a semver-major move that
# cargo update will not make, and the version is not ours to pick:
# quick-xml 0.38.4 <- plist 1.8.0 (Apple targets)
# quick-xml 0.37.5 <- tauri-winrt-notification 0.7.2 (Windows)
# Both are denial-of-service shaped and require feeding attacker-controlled
# XML to the parser. The only paths that reach it are plist parsing of our
# own bundle metadata and Windows toast notifications — no daemon path parses
# untrusted XML. Revisit when plist and tauri-winrt-notification bump.

[advisories]
ignore = [
Expand All @@ -31,4 +40,6 @@ ignore = [
"RUSTSEC-2025-0100", # gio-sys unmaintained
"RUSTSEC-2026-0002", # serde_cbor unmaintained
"RUSTSEC-2023-0086", # lexopt unmaintained (if present)
"RUSTSEC-2026-0194", # quick-xml quadratic attribute scan — via plist / tauri-winrt-notification
"RUSTSEC-2026-0195", # quick-xml unbounded namespace alloc — via plist / tauri-winrt-notification
]
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/openfang-api/src/channel_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ impl ChannelBridgeHandle for KernelBridgeAdapter {
let job = openfang_types::scheduler::CronJob {
id: openfang_types::scheduler::CronJobId::new(),
agent_id: agent.id,
name: format!("chat-{}", &agent.name),
name: format!("chat-{}", agent.name),
enabled: true,
schedule: openfang_types::scheduler::CronSchedule::Cron {
expr: cron_expr.clone(),
Expand Down
2 changes: 1 addition & 1 deletion crates/openfang-api/src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ pub async fn get_agent_session(
}
let msg_idx = built_messages.len();
// Fix up the msg_idx for tool_use entries registered with sentinel
for (_, (mi, _)) in tool_use_index.iter_mut() {
for (mi, _) in tool_use_index.values_mut() {
if *mi == usize::MAX {
*mi = msg_idx;
}
Expand Down
5 changes: 1 addition & 4 deletions crates/openfang-channels/src/feishu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1049,10 +1049,7 @@ fn combine_payload(
*entry = vec![Vec::new(); sum];
}

match entry.get_mut(seq) {
Some(slot) => *slot = payload,
None => return None,
}
*entry.get_mut(seq)? = payload;

if entry.iter().any(|part| part.is_empty()) {
return None;
Expand Down
14 changes: 7 additions & 7 deletions crates/openfang-cli/src/tui/screens/comms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ fn draw_topology(f: &mut Frame, area: Rect, state: &CommsState) {
let state_style = state_color(&root.state);
let mut spans = vec![
Span::styled(" ", Style::default()),
Span::styled(format!("[{}]", &root.state), state_style),
Span::styled(format!("[{}]", root.state), state_style),
Span::styled(
format!(" {} ", root.name),
Style::default()
Expand Down Expand Up @@ -580,7 +580,7 @@ fn draw_send_modal(f: &mut Frame, area: Rect, state: &CommsState) {
);
f.render_widget(
Paragraph::new(Span::styled(
format!(" {}\u{2588}", &state.send_from),
format!(" {}\u{2588}", state.send_from),
Style::default().fg(theme::TEXT),
)),
rows[1],
Expand All @@ -591,7 +591,7 @@ fn draw_send_modal(f: &mut Frame, area: Rect, state: &CommsState) {
);
f.render_widget(
Paragraph::new(Span::styled(
format!(" {}\u{2588}", &state.send_to),
format!(" {}\u{2588}", state.send_to),
Style::default().fg(theme::TEXT),
)),
rows[3],
Expand All @@ -602,7 +602,7 @@ fn draw_send_modal(f: &mut Frame, area: Rect, state: &CommsState) {
);
f.render_widget(
Paragraph::new(Span::styled(
format!(" {}\u{2588}", &state.send_msg),
format!(" {}\u{2588}", state.send_msg),
Style::default().fg(theme::TEXT),
)),
rows[5],
Expand Down Expand Up @@ -655,7 +655,7 @@ fn draw_task_modal(f: &mut Frame, area: Rect, state: &CommsState) {
);
f.render_widget(
Paragraph::new(Span::styled(
format!(" {}\u{2588}", &state.task_title),
format!(" {}\u{2588}", state.task_title),
Style::default().fg(theme::TEXT),
)),
rows[1],
Expand All @@ -666,7 +666,7 @@ fn draw_task_modal(f: &mut Frame, area: Rect, state: &CommsState) {
);
f.render_widget(
Paragraph::new(Span::styled(
format!(" {}\u{2588}", &state.task_desc),
format!(" {}\u{2588}", state.task_desc),
Style::default().fg(theme::TEXT),
)),
rows[3],
Expand All @@ -680,7 +680,7 @@ fn draw_task_modal(f: &mut Frame, area: Rect, state: &CommsState) {
);
f.render_widget(
Paragraph::new(Span::styled(
format!(" {}\u{2588}", &state.task_assign),
format!(" {}\u{2588}", state.task_assign),
Style::default().fg(theme::TEXT),
)),
rows[5],
Expand Down
4 changes: 2 additions & 2 deletions crates/openfang-cli/src/tui/screens/hands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ fn draw_marketplace(f: &mut Frame, area: Rect, state: &mut HandsState) {
_ => Style::default().fg(theme::CYAN),
};
ListItem::new(Line::from(vec![
Span::raw(format!(" {:<4}", &h.icon)),
Span::raw(format!(" {:<4}", h.icon)),
Span::styled(
format!("{:<16}", truncate(&h.name, 15)),
Style::default().fg(theme::CYAN),
Expand Down Expand Up @@ -382,7 +382,7 @@ fn draw_active(f: &mut Frame, area: Rect, state: &mut HandsState) {
format!(" {:<16}", truncate(&i.agent_name, 15)),
Style::default().fg(theme::CYAN),
),
Span::styled(format!("{:<10}", &i.status), status_style),
Span::styled(format!("{:<10}", i.status), status_style),
Span::styled(
format!("{:<20}", truncate(&i.hand_id, 19)),
theme::dim_style(),
Expand Down
2 changes: 1 addition & 1 deletion crates/openfang-cli/src/tui/screens/peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ pub fn draw(f: &mut Frame, area: Rect, state: &mut PeersState) {
format!(" {:<8}", p.agent_count),
Style::default().fg(theme::GREEN),
),
Span::styled(format!(" {}", &p.protocol_version), theme::dim_style()),
Span::styled(format!(" {}", p.protocol_version), theme::dim_style()),
]))
})
.collect();
Expand Down
6 changes: 3 additions & 3 deletions crates/openfang-cli/src/tui/screens/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,11 @@ fn draw_providers(f: &mut Frame, area: Rect, state: &mut SettingsState) {
};
ListItem::new(Line::from(vec![
Span::styled(
format!(" {:<20}", &p.name),
format!(" {:<20}", p.name),
Style::default().fg(theme::CYAN),
),
Span::styled(format!(" {:<20}", badge), badge_style),
Span::styled(format!(" {}", &p.env_var), theme::dim_style()),
Span::styled(format!(" {}", p.env_var), theme::dim_style()),
]))
})
.collect();
Expand Down Expand Up @@ -529,7 +529,7 @@ fn draw_models(f: &mut Frame, area: Rect, state: &mut SettingsState) {
format!(" {:<14}", truncate(&m.provider, 13)),
theme::dim_style(),
),
Span::styled(format!(" {:<10}", &m.tier), tier_style),
Span::styled(format!(" {:<10}", m.tier), tier_style),
Span::styled(format!(" {:<10}", ctx), Style::default().fg(theme::YELLOW)),
Span::styled(format!(" {cost}"), theme::dim_style()),
]))
Expand Down
4 changes: 2 additions & 2 deletions crates/openfang-cli/src/tui/screens/skills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ fn draw_installed(f: &mut Frame, area: Rect, state: &mut SkillsState) {
Style::default().fg(theme::CYAN),
),
Span::styled(format!(" {:<7}", runtime_badge), runtime_style),
Span::styled(format!(" {:<10}", &s.source), source_style),
Span::styled(format!(" {:<10}", s.source), source_style),
Span::styled(format!(" {:<11}", config_text), config_style),
Span::styled(
format!(" {}", truncate(&s.description, 24)),
Expand Down Expand Up @@ -639,7 +639,7 @@ fn draw_clawhub(f: &mut Frame, area: Rect, state: &mut SkillsState) {
),
Span::styled(format!(" {:<10}", dl), Style::default().fg(theme::GREEN)),
Span::styled(
format!(" {:<10}", &r.runtime),
format!(" {:<10}", r.runtime),
Style::default().fg(theme::BLUE),
),
Span::styled(
Expand Down
2 changes: 1 addition & 1 deletion crates/openfang-cli/src/tui/screens/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ pub fn draw(f: &mut Frame, area: Rect, state: &mut TemplatesState) {
Style::default().fg(theme::CYAN),
),
Span::styled(
format!(" {:<14}", &t.category),
format!(" {:<14}", t.category),
Style::default().fg(theme::YELLOW),
),
Span::styled(
Expand Down
15 changes: 12 additions & 3 deletions crates/openfang-memory/src/knowledge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,18 @@ mod tests {
#[test]
fn test_entity_type_from_db_str_reads_all_forms() {
// Flat (new), quoted scalar (legacy), and object (legacy custom).
assert_eq!(EntityType::from_db_str("organization"), EntityType::Organization);
assert_eq!(EntityType::from_db_str("\"organization\""), EntityType::Organization);
assert_eq!(EntityType::from_db_str("product"), EntityType::Custom("product".to_string()));
assert_eq!(
EntityType::from_db_str("organization"),
EntityType::Organization
);
assert_eq!(
EntityType::from_db_str("\"organization\""),
EntityType::Organization
);
assert_eq!(
EntityType::from_db_str("product"),
EntityType::Custom("product".to_string())
);
assert_eq!(
EntityType::from_db_str("{\"custom\":\"product\"}"),
EntityType::Custom("product".to_string())
Expand Down
Loading