feat: add image utilities and improve web crawl token handling (#2892)
## Summary
- Add `image_utils.ts` for extracting MIME type and extension from image
data (base64 or binary)
- Add `image_dimension_utils.ts` for reading dimensions from
PNG/JPEG/GIF/WebP images
- Update `web_crawl` to use `maxTokens` (9000) from
`GEMINI_CRAWL_LONG_CONTEXT` config
- Update `prepare_step_utils` to handle `GEMINI_CRAWL_LONG_CONTEXT`
model config
- Add comprehensive tests for all new utilities
## Test plan
- [x] All existing tests pass
- [x] New tests added for image utilities covering:
- Image type detection from various formats (PNG, JPEG, GIF, WebP, BMP,
TIFF)
- Base64 and binary data handling
- Invalid/corrupted data handling
- Dimension extraction from PNG, JPEG, GIF, WebP
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2892"
target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<!-- devin-review-badge-end -->
---------
Co-authored-by:
Will Chen <willchen90@gmail.com>
Co-authored-by:
Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by:
claude[bot] <41898282+claude[bot]@users.noreply.github.com>
正在显示
src/__tests__/image_utils.test.ts
0 → 100644
请
注册
或者
登录
后发表评论