Skip to main content

Crate harness_read

Crate harness_read 

Source
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
AttachmentMeta
AttachmentReadResult
DirMeta
DirReadResult
ErrorReadResult
FormatDirArgs
FormatTextArgs
ReadParams
ReadSessionConfig
StreamLinesOptions
StreamLinesResult
TextMeta
TextReadResult

Enums§

ReadParseError
ReadResult

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