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:
claude-code-best
2026-04-01 01:07:42 +08:00
parent fac9341e73
commit 7e15974be9
8 changed files with 398 additions and 23 deletions

View File

@@ -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