Project Files
PORTING.md
Reference tree: reference/exif-sniffer/ (copy of exif-sniffer, without .git / .venv / caches). Do not place a .gitignore under reference/—lms push forbids nested ignore files; when re-syncing, use e.g. rsync ... --exclude='.gitignore'.
Python MCP tool (server.py) | TS plugin (src/toolsProvider.ts) | Notes |
|---|---|---|
list_files | list_files | Base = plugin folderName (replaces LOCAL_MEDIA_BASE). |
read_file | read_file | Same relative path rules (^[\w./-]+$, no ..). |
write_file | write_file | UTF-8 text. |
create_directory | create_directory | mkdir -p under base. |
extract_metadata | extract_metadata | Image: exifr + image-size + PNG chunk parser; video: no ffprobe — returns ffprobe.unsupported stub (see below). |
write_metadata | write_metadata | JPEG/WebP via piexifjs (behavior should track Python/piexif; tag typing may differ slightly). |
fetch_remote_media | fetch_remote_media | Destination root = ctl.getWorkingDirectory() (replaces DATA_DIR). SSRF policy from plugin settings. |
extract_metadata_to_json | extract_metadata_to_json | Source/output under working directory. |
validate_local_media_root | validate_local_media_root | Absolute path validation unchanged. |
list_local_media_images | list_local_media_images | Same suffix set and caps. |
extract_local_media_metadata_to_json | extract_local_media_metadata_to_json | Output JSON under working directory. |
update_local_media_exif | update_local_media_exif | In-place EXIF merge/remove. |
Per LM Studio dependencies: no postinstall scripts. Dependencies used here (exifr, image-size, piexifjs, zod, @lmstudio/sdk) are plain JS or ship prebuilt assets without install hooks—re-verify after upgrades.
Edit manifest.json: set owner to your Hub username/org and bump revision when publishing. Plugin name must stay kebab-case (lmexif-sniffer).
extract_metadata / extract_metadata_document attach ffprobe: { unsupported: true, reason: ... } for video-like inputs.exif_pillow naming: Pillow EXIF tag names differ from exifr translated keys; structure is still a string-keyed object of primitive/JSON-like values.image.mode: Not derived without a full decoder; emitted as null in the image block.LOCAL_MEDIA_BASE, DATA_DIR, and fetch env vars are replaced by plugin config schematics (src/config.ts) plus LM Studio working directory for DATA_DIR-scoped tools.