forked from kent/consciousness
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:
parent
7dd9daa2b9
commit
a596e007b2
9 changed files with 246 additions and 22 deletions
|
|
@ -469,6 +469,7 @@ impl Agent {
|
|||
) {
|
||||
let mut nodes = Vec::new();
|
||||
for (call, output) in &results {
|
||||
if call.name == "yield_to_user" { continue; }
|
||||
ds.had_tool_calls = true;
|
||||
if output.starts_with("Error:") { ds.tool_errors += 1; }
|
||||
nodes.push(Self::make_tool_result_node(call, output));
|
||||
|
|
|
|||
|
|
@ -33,14 +33,12 @@ pub(super) fn tools() -> [super::Tool; 3] {
|
|||
})) },
|
||||
Tool { name: "yield_to_user",
|
||||
description: "Wait for user input before continuing. The only way to enter a waiting state.",
|
||||
parameters_json: r#"{"type":"object","properties":{"message":{"type":"string","description":"Optional status message"}}}"#,
|
||||
handler: Arc::new(|agent, v| Box::pin(async move {
|
||||
let msg = v.get("message").and_then(|v| v.as_str()).unwrap_or("Waiting for input.");
|
||||
parameters_json: r#"{"type":"object","properties":{}}"#,
|
||||
handler: Arc::new(|agent, _| Box::pin(async move {
|
||||
if let Some(agent) = agent {
|
||||
let mut a = agent.state.lock().await;
|
||||
a.pending_yield = true;
|
||||
agent.state.lock().await.pending_yield = true;
|
||||
}
|
||||
Ok(format!("Yielding. {}", msg))
|
||||
Ok(String::new())
|
||||
})) },
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,10 +246,7 @@ pub fn summarize_args(tool_name: &str, args: &serde_json::Value) -> String {
|
|||
entry.to_string()
|
||||
}
|
||||
}
|
||||
"yield_to_user" => args["message"]
|
||||
.as_str()
|
||||
.unwrap_or("")
|
||||
.to_string(),
|
||||
"yield_to_user" => String::new(),
|
||||
"switch_model" => args["model"]
|
||||
.as_str()
|
||||
.unwrap_or("")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue