fix: default clear=true on kitt_display — replace content by default instead of appending
This commit is contained in:
@@ -116,7 +116,7 @@ class KittWorkbenchServer:
|
|||||||
|
|
||||||
async def kitt_display(self, project: str, widget: str, content: str = "",
|
async def kitt_display(self, project: str, widget: str, content: str = "",
|
||||||
items: str = "", id: str = "", label: str = "",
|
items: str = "", id: str = "", label: str = "",
|
||||||
placeholder: str = "", pane: str = "main", clear: bool = False) -> str:
|
placeholder: str = "", pane: str = "main", clear: bool = True) -> str:
|
||||||
if project not in self._connections:
|
if project not in self._connections:
|
||||||
return json.dumps({"error": f"Project '{project}' not open. Call kitt_open first."})
|
return json.dumps({"error": f"Project '{project}' not open. Call kitt_open first."})
|
||||||
cmd = DisplayCmd(
|
cmd = DisplayCmd(
|
||||||
@@ -216,8 +216,8 @@ def create_mcp_server(workbench_dir: Path = DEFAULT_WORKBENCH_DIR, socket_dir: s
|
|||||||
@mcp.tool()
|
@mcp.tool()
|
||||||
async def kitt_display(project: str, widget: str, content: str = "", items: str = "",
|
async def kitt_display(project: str, widget: str, content: str = "", items: str = "",
|
||||||
id: str = "", label: str = "", placeholder: str = "",
|
id: str = "", label: str = "", placeholder: str = "",
|
||||||
pane: str = "main", clear: bool = False) -> str:
|
pane: str = "main", clear: bool = True) -> str:
|
||||||
"""Push content to the display pane. Widget types: 'markdown' (rendered text), 'table' (columns+rows as JSON in content), 'checklist' (items as JSON array), 'button' (needs id+label), 'input' (text field — needs id+placeholder, user must press Enter to submit). Tell the user to press Enter to submit text inputs. Use kitt_events to read user interactions."""
|
"""Push content to the display pane. Clears the target pane first by default (set clear=false to append instead). Widget types: 'markdown' (rendered text), 'table' (columns+rows as JSON in content), 'checklist' (items as JSON array), 'button' (needs id+label), 'input' (text field — needs id+placeholder, user must press Enter to submit). Tell the user to press Enter to submit text inputs. Use kitt_events to read user interactions."""
|
||||||
return await srv.kitt_display(project, widget, content, items, id, label, placeholder, pane, clear)
|
return await srv.kitt_display(project, widget, content, items, id, label, placeholder, pane, clear)
|
||||||
|
|
||||||
@mcp.tool()
|
@mcp.tool()
|
||||||
|
|||||||
Reference in New Issue
Block a user