Expand description
What kind of file an attachment is, decided by content first and the
name’s extension second (a .txt that is really a ZIP is not text).
docs/specs/SPEC_AGENT_PANE_FILE_ATTACHMENTS_2026_09_26.md §5.
Enums§
Constants§
- ARCHIVE_
EXTS 🔒 - AUDIO_
EXTS 🔒 - TEXT_
EXTS 🔒 - Extensions read as text when the content is also text.
- VIDEO_
EXTS 🔒
Functions§
- classify
- Classify the file at
path, whose display name isname. - classify_
bytes classifyon the first bytes, with the ZIP inspection injected (tests).- extension_
of - The file’s own extension, lowercased, if it’s a short plain one.
- looks_
like_ 🔒text - Text if the start is valid UTF-8 (allowing a code point cut at the end) with no NUL bytes.
- office_
kind_ 🔒of_ zip - Which OOXML/ODF document a ZIP holds, from its entry names or the ODF
mimetypeentry.Nonefor an ordinary archive. - read_
head 🔒