storkit: merge 376_story_rename_mcp_whatsup_tool_to_status_for_consistency
This commit is contained in:
@@ -15,7 +15,7 @@ pub mod merge_tools;
|
||||
pub mod qa_tools;
|
||||
pub mod shell_tools;
|
||||
pub mod story_tools;
|
||||
pub mod whatsup_tools;
|
||||
pub mod status_tools;
|
||||
|
||||
/// Returns true when the Accept header includes text/event-stream.
|
||||
fn wants_sse(req: &Request) -> bool {
|
||||
@@ -1124,7 +1124,7 @@ fn handle_tools_list(id: Option<Value>) -> JsonRpcResponse {
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "whatsup",
|
||||
"name": "status",
|
||||
"description": "Get a full triage dump for an in-progress story: front matter, AC checklist, active worktree/branch, git diff --stat since master, last 5 commits, and last 20 lines of the most recent agent log. Returns a clear error if the story is not in work/2_current/.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
@@ -1225,7 +1225,7 @@ async fn handle_tools_call(
|
||||
"git_commit" => git_tools::tool_git_commit(&args, ctx).await,
|
||||
"git_log" => git_tools::tool_git_log(&args, ctx).await,
|
||||
// Story triage
|
||||
"whatsup" => whatsup_tools::tool_whatsup(&args, ctx).await,
|
||||
"status" => status_tools::tool_status(&args, ctx).await,
|
||||
_ => Err(format!("Unknown tool: {tool_name}")),
|
||||
};
|
||||
|
||||
@@ -1341,7 +1341,7 @@ mod tests {
|
||||
assert!(names.contains(&"git_add"));
|
||||
assert!(names.contains(&"git_commit"));
|
||||
assert!(names.contains(&"git_log"));
|
||||
assert!(names.contains(&"whatsup"));
|
||||
assert!(names.contains(&"status"));
|
||||
assert_eq!(tools.len(), 49);
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ async fn git_branch(dir: &Path) -> Option<String> {
|
||||
.flatten()
|
||||
}
|
||||
|
||||
pub(super) async fn tool_whatsup(args: &Value, ctx: &AppContext) -> Result<String, String> {
|
||||
pub(super) async fn tool_status(args: &Value, ctx: &AppContext) -> Result<String, String> {
|
||||
let story_id = args
|
||||
.get("story_id")
|
||||
.and_then(|v| v.as_str())
|
||||
@@ -323,16 +323,16 @@ mod tests {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn tool_whatsup_returns_error_for_missing_story() {
|
||||
async fn tool_status_returns_error_for_missing_story() {
|
||||
let tmp = tempdir().unwrap();
|
||||
let ctx = crate::http::context::AppContext::new_test(tmp.path().to_path_buf());
|
||||
let result = tool_whatsup(&json!({"story_id": "999_story_nonexistent"}), &ctx).await;
|
||||
let result = tool_status(&json!({"story_id": "999_story_nonexistent"}), &ctx).await;
|
||||
assert!(result.is_err());
|
||||
assert!(result.unwrap_err().contains("not found in work/2_current/"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn tool_whatsup_returns_story_data() {
|
||||
async fn tool_status_returns_story_data() {
|
||||
let tmp = tempdir().unwrap();
|
||||
let current_dir = tmp
|
||||
.path()
|
||||
@@ -345,7 +345,7 @@ mod tests {
|
||||
fs::write(current_dir.join("42_story_test.md"), story_content).unwrap();
|
||||
|
||||
let ctx = crate::http::context::AppContext::new_test(tmp.path().to_path_buf());
|
||||
let result = tool_whatsup(&json!({"story_id": "42_story_test"}), &ctx)
|
||||
let result = tool_status(&json!({"story_id": "42_story_test"}), &ctx)
|
||||
.await
|
||||
.unwrap();
|
||||
let parsed: serde_json::Value = serde_json::from_str(&result).unwrap();
|
||||
Reference in New Issue
Block a user