)]}'
{
  "commit": "542bda3968c6dd5b79392dd63e2955e04520401a",
  "tree": "ea1a0743849495ca2489c6363d2dc689dd0a56a7",
  "parents": [
    "225e9668aeebc0cae667872dd45222d69ac3cbd8"
  ],
  "author": {
    "name": "Philip Zeyliger",
    "email": "philip@bold.dev",
    "time": "Wed Jun 11 18:31:03 2025 -0700"
  },
  "committer": {
    "name": "Autoformatter",
    "email": "bot@sketch.dev",
    "time": "Thu Jun 12 01:31:34 2025 +0000"
  },
  "message": "browser: rename browser_read_image to read_image and auto-send screenshots to LLM\n\nRename browser_read_image tool to read_image and modify browser_take_screenshot\nto automatically send image content to the LLM instead of requiring a separate\nread_image tool call, streamlining the screenshot workflow.\n\nProblem Analysis:\nThe current browser screenshot workflow required two separate tool calls:\n1. browser_take_screenshot - saves screenshot and returns file path\n2. browser_read_image - reads saved screenshot and sends to LLM\n\nThis two-step process was inefficient and created unnecessary round trips.\nAdditionally, browser_read_image was specific to browser automation but\nthe functionality of reading and encoding images is more general purpose.\n\nImplementation Changes:\n\n1. Screenshot Tool Behavior (claudetool/browse/browse.go):\n   - Modified browser_take_screenshot to automatically return image content\n   - Removed screenshotOutput struct as ID-only response no longer needed\n   - Added base64 encoding of screenshot data directly in screenshotRun\n   - Returns []llm.Content with both text description and image data\n   - Still saves screenshot file for potential future reference\n   - Uses same image encoding format as existing read_image tool\n\n2. Tool Rename (claudetool/browse/browse.go):\n   - Renamed browser_read_image tool to read_image\n   - Updated tool name in NewReadImageTool from \u0027browser_read_image\u0027 to \u0027read_image\u0027\n   - Maintained all existing functionality and input/output format\n   - Tool description and schema remain unchanged\n\n3. UI Updates (termui/termui.go):\n   - Updated template condition from \u0027browser_read_image\u0027 to \u0027read_image\u0027\n   - Maintains existing emoji and display format for read_image tool calls\n\n4. WebUI Updates (webui/src/web-components/):\n   - Updated sketch-tool-calls.ts to reference \u0027read_image\u0027 instead of \u0027browser_read_image\u0027\n   - Renamed sketch-tool-card-browser-read-image.ts to sketch-tool-card-read-image.ts\n   - Updated component class name from SketchToolCardBrowserReadImage to SketchToolCardReadImage\n   - Updated custom element name from \u0027sketch-tool-card-browser-read-image\u0027 to \u0027sketch-tool-card-read-image\u0027\n   - Updated import statement to reference new component file name\n   - Removed old component file and updated TypeScript declarations\n\n5. Test Updates (claudetool/browse/browse_test.go):\n   - Modified TestGetTools to allow read_image tool without \u0027browser_\u0027 prefix\n   - Added special case handling for read_image in tool naming convention check\n   - All existing tests continue to pass with updated tool name\n\nTechnical Details:\n- Screenshot auto-send uses same base64 encoding as existing read_image tool\n- Content structure matches browser_read_image output format for consistency\n- File saving still occurs for potential debugging or future reference\n- Error handling preserves existing behavior with proper fallbacks\n- Tool count remains the same (12 tools with screenshots, 10 without)\n\nBenefits:\n- Eliminates need for two-step screenshot workflow\n- Reduces round trips and simplifies user experience\n- More intuitive tool naming (read_image is general purpose)\n- Maintains full backward compatibility for read_image functionality\n- Consistent image encoding across all browser tools\n- Automatic screenshot viewing improves debugging and validation workflows\n\nTesting:\n- All existing browser tool tests pass with updated expectations\n- TestReadImageTool verifies renamed tool functionality\n- Tool naming convention test updated to handle read_image exception\n- TypeScript compilation successful with no type errors\n- Web component functionality preserved across rename\n\nThis enhancement streamlines screenshot workflows while maintaining the\ngeneral-purpose read_image tool for reading arbitrary image files, creating\na more efficient and intuitive browser automation experience.\n\nCo-Authored-By: sketch \u003chello@sketch.dev\u003e\nChange-ID: se3e81f997f30f01ek\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "dfb963ea8a1ca8e5233d8a20185b835e9ef70e0c",
      "old_mode": 33188,
      "old_path": "claudetool/browse/browse.go",
      "new_id": "5cd28cd5a0e7aa22c4bb2bd56df9e262e24973b3",
      "new_mode": 33188,
      "new_path": "claudetool/browse/browse.go"
    },
    {
      "type": "modify",
      "old_id": "35d79113f7b17142e1f1b6afb04caea1ac079aba",
      "old_mode": 33188,
      "old_path": "claudetool/browse/browse_test.go",
      "new_id": "6a0a31d9782985355fb5a27967caddfcd199183a",
      "new_mode": 33188,
      "new_path": "claudetool/browse/browse_test.go"
    },
    {
      "type": "modify",
      "old_id": "552bd3f1bea11fc863f2f768465ba317f78a4908",
      "old_mode": 33188,
      "old_path": "loop/testdata/agent_loop.httprr",
      "new_id": "68cb57a32a1a61a981f3480bb7c0cd76ddeabc03",
      "new_mode": 33188,
      "new_path": "loop/testdata/agent_loop.httprr"
    },
    {
      "type": "modify",
      "old_id": "48c5f537641987fba361ff374d12e5ea1c451085",
      "old_mode": 33188,
      "old_path": "termui/termui.go",
      "new_id": "af6376d30b0772870a003528415deee3a44f15cb",
      "new_mode": 33188,
      "new_path": "termui/termui.go"
    },
    {
      "type": "modify",
      "old_id": "270213e1a0c1ab2e818fe31cfbd7988b760e99f7",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/sketch-tool-calls.ts",
      "new_id": "508c6687ca8d7976ad74063e806fe755f5645283",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/sketch-tool-calls.ts"
    },
    {
      "type": "rename",
      "old_id": "cdb96ccb541d204d9c7c0071a05e253aaf1dafde",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/sketch-tool-card-browser-read-image.ts",
      "new_id": "ba9a5afbad5d4a0c0f83faa5861ac6f4a212cf6d",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/sketch-tool-card-read-image.ts",
      "score": 88
    },
    {
      "type": "modify",
      "old_id": "33bfae368684ceaa859ceb00611c303145409bc7",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/sketch-tool-card-take-screenshot.ts",
      "new_id": "b21686bf53e770f3e0ef9e2e314d7dacc34ceb74",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/sketch-tool-card-take-screenshot.ts"
    }
  ]
}
