memoryd: ask_memory, each workspace's chat at once with its own limit

Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
2026-09-29 09:47:08 -07:00
co-authored by ornith-1.5-35b-a3b
parent 18bafbd2a0
commit 132e816322
6 changed files with 558 additions and 6 deletions
+10 -4
View File
@@ -30,10 +30,16 @@ pub struct Local {
pub untrusted: bool,
}
/// A hit's text as an item holds it, from the local index or from Honcho: neutralised, every
/// control character (a line break among them) and every Unicode line or paragraph separator a
/// space, then cut to its first `SNIPPET` characters, with no mark.
/// A hit's text as an item holds it, from the local index or from Honcho: `one_line`, cut to
/// `SNIPPET` characters.
pub fn snippet(text: &str) -> String {
one_line(text, SNIPPET)
}
/// Text from memory as an item holds it: neutralised, every control character (a line break
/// among them) and every Unicode line or paragraph separator a space, then cut to its first
/// `cap` characters, with no mark.
pub fn one_line(text: &str, cap: usize) -> String {
neutralise(text)
.chars()
.map(|c| {
@@ -43,7 +49,7 @@ pub fn snippet(text: &str) -> String {
c
}
})
.take(SNIPPET)
.take(cap)
.collect()
}