feat(onebot): implement ocr_image via OIDB 0xE07_0

Server-side image OCR ported from Lagrange.Core ([Service]
"OidbSvcTrpcTcp.0xe07_0") cross-checked with NapCat's Oidb.0xE07 proto
(NapCat's transformer cmd 0xEB7 is a typo; the proto name + Lagrange + the
wire name all say 0xE07_0). New ImageOcr service + proto types, misc.ocrImage
api, and the ocr_image/.ocr_image action. The cmd takes an image URL, so the
action accepts an http(s) url or a cached image file_id (resolved via
getImageInfo); base64/local input is unsupported (NapCat's path is a
Windows-only kernel OCR, not portable). Wire round-trip + response-parse
tests lock the pb tags.
This commit is contained in:
DrSmoothl committed 2026-06-18 00:36:07 +08:00
1 parent f936515a59
commit e07090376a
8 files changed
+271 -3

No files matched your search

+4
View File
@@ -99,6 +99,10 @@
"types": "./src/oidb-services/misc/translate-en-to-zh.ts",
"default": "./src/oidb-services/misc/translate-en-to-zh.ts"
},
"./oidb-services/misc/image-ocr": {
"types": "./src/oidb-services/misc/image-ocr.ts",
"default": "./src/oidb-services/misc/image-ocr.ts"
},
"./oidb-services/misc/click-inline-keyboard-button": {
"types": "./src/oidb-services/misc/click-inline-keyboard-button.ts",
"default": "./src/oidb-services/misc/click-inline-keyboard-button.ts"