mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
feat: 实现 4 个 NAPI 包 — modifiers/image-processor/audio-capture/url-handler
- modifiers-napi: 使用 Bun FFI 调用 macOS CGEventSourceFlagsState 检测修饰键 - image-processor-napi: 集成 sharp 库,macOS 剪贴板图像读取 (osascript) - audio-capture-napi: 基于 SoX/arecord 的跨平台音频录制 - url-handler-napi: 完善函数签名(保持 null fallback) - 修复 image-processor 类型兼容性问题 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,9 +44,9 @@ export async function getImageProcessor(): Promise<SharpFunction> {
|
||||
try {
|
||||
// Use the native image processor module
|
||||
const imageProcessor = await import('image-processor-napi')
|
||||
const sharp = (imageProcessor as Record<string, SharpFunction>).sharp || imageProcessor.default
|
||||
imageProcessorModule = { default: sharp }
|
||||
return sharp
|
||||
const sharpFn = (imageProcessor.sharp ?? imageProcessor.default) as SharpFunction
|
||||
imageProcessorModule = { default: sharpFn }
|
||||
return sharpFn
|
||||
} catch {
|
||||
// Fall back to sharp if native module is not available
|
||||
// biome-ignore lint/suspicious/noConsole: intentional warning
|
||||
|
||||
Reference in New Issue
Block a user