Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <url>)",
"Capture terminal screenshot as PNG and SVG. Returns png_url and svg_url - use curl to save (e.g., curl -o screenshot.png <png_url>)",
shellScreenshotSchema,
async (params) => shellScreenshot(params, toolContext)
);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/buffer-to-svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 10 additions & 2 deletions src/tools/shell-screenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <filename> <download_url> 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 <filename> <download_url> to save the file",
};
context.logToolCall("shell_screenshot", { session_id, name }, output);

return {
Expand Down
Loading