forked from 1b-agent/fieldcraft-upstream
mcp, cli: list each command's parameters as JSON Schema
CommandSpec::listing gives id, label, the parameter doc and the schema; MCP list_commands, the control channel's engine.commands and the new fieldcraft-cli commands --json use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
217628ead4
commit
188f2d5fc4
7 files changed
+25
-6
No files matched your search
@@ -174,9 +174,7 @@ pub fn handle(app: &mut ModelApp, ctx: &egui::Context, req: &ControlRequest) ->
|
||||
let Some(steps) = p.get("commands") else { return err("missing `commands` (a list of {command, params})") };
|
||||
wrap(app.run_script(steps).map(|()| json!({"journal": app.session.journal.len()})))
|
||||
}
|
||||
"engine.commands" => {
|
||||
ok(Value::Array(fieldcraft_engine::commands().iter().map(|c| json!({"id": c.id, "label": c.label, "params": c.params})).collect()))
|
||||
}
|
||||
"engine.commands" => ok(Value::Array(fieldcraft_engine::commands().iter().map(fieldcraft_engine::CommandSpec::listing).collect())),
|
||||
"ui.inspect" => ok(json!({
|
||||
"ui": app.ui,
|
||||
"camera": app.cam,
|
||||
|
||||
Reference in new issue
Block a user