Skip to content
Open
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
5 changes: 4 additions & 1 deletion scripts/check.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
set -e

unset GIT_DIR GIT_INDEX_FILE GIT_WORK_TREE GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL \
GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_PREFIX

echo "→ Ensuring MCP relay sidecar placeholder..."
node src-tauri/scripts/copy-relay-sidecar.mjs

Expand All @@ -19,4 +22,4 @@ pnpm test
echo "→ Clippy..."
cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings

echo "✓ All checks passed"
echo "✓ All checks passed"
4 changes: 3 additions & 1 deletion src-tauri/src/bin/verun_mcp_relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ async fn main() -> ExitCode {
use std::path::PathBuf;
use verun_lib::mcp;

let task_id = std::env::var("VERUN_TASK_ID").ok().filter(|s| !s.is_empty());
let task_id = std::env::var("VERUN_TASK_ID")
.ok()
.filter(|s| !s.is_empty());
let socket = match std::env::var("VERUN_MCP_SOCKET") {
Ok(s) if !s.is_empty() => PathBuf::from(s),
_ => {
Expand Down
24 changes: 18 additions & 6 deletions src-tauri/src/claude_jsonl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,13 @@ fn parse_transcript_user(value: &serde_json::Value) -> Vec<OutputItem> {
}
match classify_envelope(s) {
EnvelopeAction::Drop => return Vec::new(),
EnvelopeAction::Replace(text) => return vec![OutputItem::TranscriptUserMessage { text }],
EnvelopeAction::Replace(text) => {
return vec![OutputItem::TranscriptUserMessage { text }]
}
EnvelopeAction::Keep => {
return vec![OutputItem::TranscriptUserMessage { text: s.to_string() }];
return vec![OutputItem::TranscriptUserMessage {
text: s.to_string(),
}];
}
}
}
Expand All @@ -335,7 +339,9 @@ fn parse_transcript_user(value: &serde_json::Value) -> Vec<OutputItem> {
}
match classify_envelope(text) {
EnvelopeAction::Drop => continue,
EnvelopeAction::Replace(t) => items.push(OutputItem::TranscriptUserMessage { text: t }),
EnvelopeAction::Replace(t) => {
items.push(OutputItem::TranscriptUserMessage { text: t })
}
EnvelopeAction::Keep => items.push(OutputItem::TranscriptUserMessage {
text: text.to_string(),
}),
Expand Down Expand Up @@ -674,7 +680,9 @@ mod tests {
let line = r#"{"type":"user","message":{"role":"user","content":"how do i write <command-name>foo</command-name>?"},"uuid":"u1"}"#;
let items = parse_transcript_line(line);
match items.as_slice() {
[OutputItem::TranscriptUserMessage { text }] => assert!(text.contains("how do i write")),
[OutputItem::TranscriptUserMessage { text }] => {
assert!(text.contains("how do i write"))
}
other => panic!("expected UserMessage, got {other:?}"),
}
}
Expand Down Expand Up @@ -785,7 +793,9 @@ mod tests {
assert!(
matches!(&items[0], OutputItem::UserAttachment { mime, data_b64 } if mime == "image/jpeg" && data_b64 == "AAAA")
);
assert!(matches!(&items[1], OutputItem::TranscriptUserMessage { text } if text == "check this"));
assert!(
matches!(&items[1], OutputItem::TranscriptUserMessage { text } if text == "check this")
);
}

#[test]
Expand Down Expand Up @@ -831,7 +841,9 @@ mod tests {
// remaining 6 lines (queue-operation, 3 attachments, ai-title,
// last-prompt) are all bookkeeping and produce nothing.
assert_eq!(items.len(), 6, "items: {items:#?}");
assert!(matches!(&items[0], OutputItem::TranscriptUserMessage { text } if text == "hello claude"));
assert!(
matches!(&items[0], OutputItem::TranscriptUserMessage { text } if text == "hello claude")
);
assert!(
matches!(&items[1], OutputItem::Thinking { text } if text == "let me think about this")
);
Expand Down
7 changes: 3 additions & 4 deletions src-tauri/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2093,10 +2093,9 @@ pub(crate) mod tests {
.await
.unwrap();

let labels =
task_labels_for_ids(&pool, &["t-001".into(), "t-002".into()])
.await
.unwrap();
let labels = task_labels_for_ids(&pool, &["t-001".into(), "t-002".into()])
.await
.unwrap();

assert_eq!(
labels.get("t-001"),
Expand Down
18 changes: 8 additions & 10 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,14 @@ pub fn run() {
let pty_for_monitor = std::sync::Arc::clone(&*app.state::<crate::pty::ActivePtyMap>());
let pool_for_monitor = app.state::<sqlx::sqlite::SqlitePool>().inner().clone();
let monitor_handle = app.handle().clone();
let sampler = std::sync::Arc::new(
crate::resource_monitor::ResourceSampler::spawn(
monitor_handle,
active_for_monitor,
lsp_for_monitor,
pty_for_monitor,
crate::resource_monitor::SysinfoSource::new(),
pool_for_monitor,
),
);
let sampler = std::sync::Arc::new(crate::resource_monitor::ResourceSampler::spawn(
monitor_handle,
active_for_monitor,
lsp_for_monitor,
pty_for_monitor,
crate::resource_monitor::SysinfoSource::new(),
pool_for_monitor,
));
app.manage(sampler);

// Auto-check for updates after a short delay
Expand Down
Loading