diff --git a/src/index.ts b/src/index.ts index 57f0b59..2516fee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -202,7 +202,7 @@ Tips: server.tool( "shell_screenshot", - "Capture terminal screenshot as PNG. Returns a download_url - use curl to save the file locally (e.g., curl -o screenshot.png )", + "Capture terminal screenshot as PNG and SVG. Returns png_url and svg_url - use curl to save (e.g., curl -o screenshot.png )", shellScreenshotSchema, async (params) => shellScreenshot(params, toolContext) ); diff --git a/src/lib/buffer-to-svg.ts b/src/lib/buffer-to-svg.ts index 1891dcb..4d72c4a 100644 --- a/src/lib/buffer-to-svg.ts +++ b/src/lib/buffer-to-svg.ts @@ -159,7 +159,7 @@ export function bufferToSvg( } // Render cursor if visible - if (terminal.modes.showCursor) { + if ((terminal.modes as { showCursor?: boolean }).showCursor) { const cursorX = buffer.cursorX; const cursorY = buffer.cursorY; diff --git a/src/tools/shell-screenshot.ts b/src/tools/shell-screenshot.ts index 7c658fa..ca924ef 100644 --- a/src/tools/shell-screenshot.ts +++ b/src/tools/shell-screenshot.ts @@ -53,8 +53,16 @@ export async function shellScreenshot( context.log(`[shellwright] Screenshot saved: ${screenshotDir}/${baseName}.{png,svg,ansi,txt}`); - const downloadUrl = context.getDownloadUrl(context.getMcpSessionId(), session_id, "screenshots", filename); - const output = { filename, download_url: downloadUrl, hint: "Use curl -o to save the file" }; + const mcpSessionId = context.getMcpSessionId(); + const pngUrl = context.getDownloadUrl(mcpSessionId, session_id, "screenshots", `${baseName}.png`); + const svgUrl = context.getDownloadUrl(mcpSessionId, session_id, "screenshots", `${baseName}.svg`); + const output = { + filename, + download_url: pngUrl, + png_url: pngUrl, + svg_url: svgUrl, + hint: "Use curl -o to save the file", + }; context.logToolCall("shell_screenshot", { session_id, name }, output); return {