Documentation
¶
Overview ¶
Package clipboard provides helpers for resolving pasted images and dropped local image paths from kite clipboard events in the TaskSmith terminal UI.
Index ¶
Constants ¶
const MaxImageBytes = 20 << 20
MaxImageBytes is the maximum byte size accepted for pasted or dropped images.
Variables ¶
This section is empty.
Functions ¶
func ExtForImageMIME ¶
ExtForImageMIME returns the conventional file extension for a supported image MIME type.
Types ¶
type ImageCandidate ¶
ImageCandidate describes an image resolved from a paste or file drop event.
func ResolvePastedImages ¶
func ResolvePastedImages(items map[string][]byte, text string) []ImageCandidate
ResolvePastedImages extracts image candidates from a clipboard event's MIME items and text payload using strict source precedence:
- Dropped local file paths in text (so stale clipboard data cannot hijack drops).
- OS file-manager copies in items["text/uri-list"] (ignoring Finder icon thumbnails).
- Raw image payloads in items (screenshots, Preview copies, browser images).