Skip to main content

Module kind

Module kind 

Source
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§

FileKind

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 is name.
classify_bytes
classify on 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 mimetype entry. None for an ordinary archive.
read_head 🔒