Land release blocker fixes and workspace cleanup
This commit is contained in:
@@ -226,7 +226,9 @@ async fn list_transcripts_tool(pool: &SqlitePool, args: Value) -> Result<Value,
|
||||
})
|
||||
.collect();
|
||||
|
||||
Ok(text_content(serde_json::to_string_pretty(&summaries).unwrap()))
|
||||
Ok(text_content(
|
||||
serde_json::to_string_pretty(&summaries).unwrap(),
|
||||
))
|
||||
}
|
||||
|
||||
async fn get_transcript_tool(pool: &SqlitePool, args: Value) -> Result<Value, JsonRpcError> {
|
||||
@@ -288,7 +290,9 @@ async fn search_transcripts_tool(pool: &SqlitePool, args: Value) -> Result<Value
|
||||
})
|
||||
.collect();
|
||||
|
||||
Ok(text_content(serde_json::to_string_pretty(&summaries).unwrap()))
|
||||
Ok(text_content(
|
||||
serde_json::to_string_pretty(&summaries).unwrap(),
|
||||
))
|
||||
}
|
||||
|
||||
async fn list_tasks_tool(pool: &SqlitePool) -> Result<Value, JsonRpcError> {
|
||||
@@ -311,7 +315,9 @@ async fn list_tasks_tool(pool: &SqlitePool) -> Result<Value, JsonRpcError> {
|
||||
})
|
||||
.collect();
|
||||
|
||||
Ok(text_content(serde_json::to_string_pretty(&summaries).unwrap()))
|
||||
Ok(text_content(
|
||||
serde_json::to_string_pretty(&summaries).unwrap(),
|
||||
))
|
||||
}
|
||||
|
||||
fn text_content(text: String) -> Value {
|
||||
@@ -404,7 +410,10 @@ mod tests {
|
||||
let pool = sqlx::SqlitePool::connect("sqlite::memory:").await.unwrap();
|
||||
let response = handle_message(&pool, request).await.expect("has response");
|
||||
|
||||
let tools = response.result.expect("ok")["tools"].as_array().unwrap().clone();
|
||||
let tools = response.result.expect("ok")["tools"]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
.clone();
|
||||
let names: Vec<String> = tools
|
||||
.iter()
|
||||
.map(|tool| tool["name"].as_str().unwrap().to_string())
|
||||
@@ -426,7 +435,9 @@ mod tests {
|
||||
assert_eq!(resp.jsonrpc, "2.0");
|
||||
assert_eq!(resp.id, Value::Null);
|
||||
assert!(resp.result.is_none());
|
||||
let err = resp.error.expect("parse_error_response must carry an error");
|
||||
let err = resp
|
||||
.error
|
||||
.expect("parse_error_response must carry an error");
|
||||
assert_eq!(err.code, -32700);
|
||||
assert!(err.message.contains("Parse error"));
|
||||
assert!(err.message.contains("expected value"));
|
||||
@@ -449,7 +460,9 @@ mod tests {
|
||||
});
|
||||
|
||||
let pool = sqlx::SqlitePool::connect("sqlite::memory:").await.unwrap();
|
||||
kon_storage::migrations::run_migrations(&pool).await.unwrap();
|
||||
kon_storage::migrations::run_migrations(&pool)
|
||||
.await
|
||||
.unwrap();
|
||||
let response = handle_message(&pool, request).await.expect("has response");
|
||||
|
||||
assert!(
|
||||
|
||||
@@ -7,10 +7,7 @@ use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
let db_path = kon_storage::database_path();
|
||||
eprintln!(
|
||||
"[kon-mcp] opening Kon database at {}",
|
||||
db_path.display()
|
||||
);
|
||||
eprintln!("[kon-mcp] opening Kon database at {}", db_path.display());
|
||||
let pool = kon_storage::init(&db_path).await?;
|
||||
eprintln!("[kon-mcp] ready, waiting for JSON-RPC on stdin");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user