storkit: merge 432_story_complete_setup_wizard_with_mcp_tools_and_agent_driven_file_generation
This commit is contained in:
@@ -14,8 +14,9 @@ pub mod git_tools;
|
||||
pub mod merge_tools;
|
||||
pub mod qa_tools;
|
||||
pub mod shell_tools;
|
||||
pub mod story_tools;
|
||||
pub mod status_tools;
|
||||
pub mod story_tools;
|
||||
pub mod wizard_tools;
|
||||
|
||||
/// Returns true when the Accept header includes text/event-stream.
|
||||
fn wants_sse(req: &Request) -> bool {
|
||||
@@ -1164,6 +1165,51 @@ fn handle_tools_list(id: Option<Value>) -> JsonRpcResponse {
|
||||
},
|
||||
"required": ["file_path"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "wizard_status",
|
||||
"description": "Return the current setup wizard state: which step is active, and which are done/skipped/pending. Use this to inspect progress before calling wizard_generate, wizard_confirm, wizard_skip, or wizard_retry.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "wizard_generate",
|
||||
"description": "Drive content generation for the current wizard step. Call with no arguments to mark the step as 'generating' and receive a hint about what to produce. Call again with a 'content' argument (the full file body you generated) to stage it for review. Content is NOT written to disk until wizard_confirm is called.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"description": "The generated file content to stage for the current step. Omit to receive a generation hint and mark the step as generating."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "wizard_confirm",
|
||||
"description": "Confirm the current wizard step: writes any staged content to disk (only if the target file does not already exist) and advances to the next step. Existing files are never overwritten.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "wizard_skip",
|
||||
"description": "Skip the current wizard step without writing any file. Use when a step does not apply to this project.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "wizard_retry",
|
||||
"description": "Discard any staged content for the current wizard step and reset it to pending so it can be regenerated. Use when the generated content needs improvement.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}),
|
||||
@@ -1258,6 +1304,12 @@ async fn handle_tools_call(
|
||||
"status" => status_tools::tool_status(&args, ctx).await,
|
||||
// File line count
|
||||
"loc_file" => diagnostics::tool_loc_file(&args, ctx),
|
||||
// Setup wizard tools
|
||||
"wizard_status" => wizard_tools::tool_wizard_status(ctx),
|
||||
"wizard_generate" => wizard_tools::tool_wizard_generate(&args, ctx),
|
||||
"wizard_confirm" => wizard_tools::tool_wizard_confirm(ctx),
|
||||
"wizard_skip" => wizard_tools::tool_wizard_skip(ctx),
|
||||
"wizard_retry" => wizard_tools::tool_wizard_retry(ctx),
|
||||
_ => Err(format!("Unknown tool: {tool_name}")),
|
||||
};
|
||||
|
||||
@@ -1376,7 +1428,7 @@ mod tests {
|
||||
assert!(names.contains(&"git_log"));
|
||||
assert!(names.contains(&"status"));
|
||||
assert!(names.contains(&"loc_file"));
|
||||
assert_eq!(tools.len(), 51);
|
||||
assert_eq!(tools.len(), 56);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user