storkit: merge 420_story_loc_for_a_specified_file_bot_command_and_web_ui_slash_command
This commit is contained in:
@@ -1136,6 +1136,20 @@ fn handle_tools_list(id: Option<Value>) -> JsonRpcResponse {
|
||||
},
|
||||
"required": ["story_id"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "loc_file",
|
||||
"description": "Return the line count for a specific file. Path is resolved relative to the project root. Returns an error if the file does not exist.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file_path": {
|
||||
"type": "string",
|
||||
"description": "Path to the file, relative to the project root (e.g. 'server/src/main.rs')"
|
||||
}
|
||||
},
|
||||
"required": ["file_path"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}),
|
||||
@@ -1226,6 +1240,8 @@ async fn handle_tools_call(
|
||||
"git_log" => git_tools::tool_git_log(&args, ctx).await,
|
||||
// Story triage
|
||||
"status" => status_tools::tool_status(&args, ctx).await,
|
||||
// File line count
|
||||
"loc_file" => diagnostics::tool_loc_file(&args, ctx),
|
||||
_ => Err(format!("Unknown tool: {tool_name}")),
|
||||
};
|
||||
|
||||
@@ -1342,7 +1358,8 @@ mod tests {
|
||||
assert!(names.contains(&"git_commit"));
|
||||
assert!(names.contains(&"git_log"));
|
||||
assert!(names.contains(&"status"));
|
||||
assert_eq!(tools.len(), 49);
|
||||
assert!(names.contains(&"loc_file"));
|
||||
assert_eq!(tools.len(), 50);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user