Expand description
Read tool — Rust port of @agent-sh/harness-read.
Conforms to agent-knowledge/design/read.md. Same contract as the TS
package: discriminated-union result (text | directory | attachment | error), 1-indexed offset/limit pagination, binary sniff, NOT_FOUND
with fuzzy sibling suggestions.
Structs§
- Attachment
- Attachment
Meta - Attachment
Read Result - DirMeta
- DirRead
Result - Error
Read Result - Format
DirArgs - Format
Text Args - Read
Params - Read
Session Config - Stream
Lines Options - Stream
Lines Result - Text
Meta - Text
Read Result
Enums§
Constants§
- BINARY_
EXTENSIONS - BINARY_
SAMPLE_ BYTES - DEFAULT_
LIMIT - FUZZY_
SUGGESTION_ LIMIT - MAX_
BYTES - MAX_
FILE_ SIZE - MAX_
LINE_ LENGTH - READ_
TOOL_ DESCRIPTION - READ_
TOOL_ NAME
Functions§
- format_
attachment - format_
directory - format_
text - is_
binary - is_
binary_ by_ content - is_
binary_ by_ extension - is_
image_ mime - is_
pdf_ mime - max_
bytes_ label - max_
line_ suffix - mime_
for - Minimal MIME-from-extension guesser. We only need to distinguish attachments (images/PDF) from text from binary; the TS version uses mime-type lib but the subset of extensions we care about is tiny.
- read
- safe_
parse_ read_ params - stream_
lines - suggest_
siblings