add send_reply and get_room_history mcp tools, show reply targets in prompt
This commit is contained in:
parent
41da93a71f
commit
3f5208cab1
5 changed files with 190 additions and 3 deletions
|
|
@ -95,11 +95,15 @@ pub fn render_timeline_item(
|
|||
body,
|
||||
is_self,
|
||||
ts,
|
||||
..
|
||||
in_reply_to,
|
||||
} => {
|
||||
let ts_str = format_ts(*ts);
|
||||
let id = short_event_id(event_id);
|
||||
let prefix = if *is_self { "(you) " } else { "" };
|
||||
let reply_str = match in_reply_to {
|
||||
Some(target) => format!(" [reply to {}]", short_event_id(target)),
|
||||
None => String::new(),
|
||||
};
|
||||
let readers_str = match read_markers.get(event_id) {
|
||||
Some(rs) if !rs.is_empty() => {
|
||||
let mut sorted = rs.clone();
|
||||
|
|
@ -111,7 +115,7 @@ pub fn render_timeline_item(
|
|||
};
|
||||
writeln!(
|
||||
prompt,
|
||||
"[{ts_str}] {id} {prefix}{sender}: {body}{readers_str}"
|
||||
"[{ts_str}] {id} {prefix}{sender}:{reply_str} {body}{readers_str}"
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue