Mouse selection, copy/paste, yield_to_user fixes

- Mouse text selection with highlight rendering in panes
- OSC 52 clipboard copy on selection, middle-click paste via tmux buffer
- Bracketed paste support (Event::Paste)
- yield_to_user: no tool result appended, ends turn immediately
- yield_to_user: no parameters, just a control signal
- Drop arboard dependency, use crossterm OSC 52 + tmux for clipboard

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
ProofOfConcept 2026-04-09 18:08:07 -04:00 committed by Kent Overstreet
parent 7dd9daa2b9
commit a596e007b2
9 changed files with 246 additions and 22 deletions

View file

@ -494,6 +494,7 @@ impl Mind {
};
let mut cmds = Vec::new();
let mut dmn_expired = false;
tokio::select! {
biased;
@ -526,17 +527,15 @@ impl Mind {
}
cmds.push(MindCommand::Compact);
/*
* Broken since the AST context window conversion:
if !self.config.no_agents {
cmds.push(MindCommand::Score);
}
*/
}
_ = tokio::time::sleep(timeout), if !has_input => {
let tick = self.shared.lock().unwrap().dmn_tick();
if let Some((prompt, target)) = tick {
self.start_turn(&prompt, target).await;
}
}
_ = tokio::time::sleep(timeout), if !has_input => dmn_expired = true,
}
if !self.config.no_agents {
@ -562,6 +561,14 @@ impl Mind {
if let Some(text) = pending {
self.start_turn(&text, StreamTarget::Conversation).await;
}
/*
else if dmn_expired {
let tick = self.shared.lock().unwrap().dmn_tick();
if let Some((prompt, target)) = tick {
self.start_turn(&prompt, target).await;
}
}
*/
self.run_commands(cmds).await;
}

View file

@ -68,8 +68,8 @@ impl State {
/// How long to wait before the next DMN prompt in this state.
pub fn interval(&self) -> Duration {
match self {
State::Engaged => Duration::from_secs(5),
State::Working => Duration::from_secs(3),
State::Engaged => Duration::from_secs(5),
State::Foraging => Duration::from_secs(30),
State::Resting { .. } => Duration::from_secs(300),
State::Paused | State::Off => Duration::from_secs(86400), // effectively never