storkit: merge 420_story_loc_for_a_specified_file_bot_command_and_web_ui_slash_command

This commit is contained in:
dave
2026-03-28 08:56:06 +00:00
parent f4ce0e017b
commit d6f82393f5
5 changed files with 116 additions and 36 deletions
+11
View File
@@ -265,6 +265,17 @@ pub(super) fn tool_move_story(args: &Value, ctx: &AppContext) -> Result<String,
.map_err(|e| format!("Serialization error: {e}"))
}
/// MCP tool: count lines in a specific file relative to the project root.
pub(super) fn tool_loc_file(args: &Value, ctx: &AppContext) -> Result<String, String> {
let file_path = args
.get("file_path")
.and_then(|v| v.as_str())
.ok_or_else(|| "Missing required argument: file_path".to_string())?;
let project_root = ctx.state.get_project_root()?;
Ok(crate::chat::commands::loc::loc_single_file(&project_root, file_path))
}
#[cfg(test)]
mod tests {
use super::*;