Versions in this module Expand all Collapse all v0 v0.2.0 Jul 14, 2026 v0.1.0 Jun 22, 2026 Changes in this version + const CyberRiskMitigationReminder + const DefaultLimit + const DefaultMaxImageDimension + const DefaultMaxImageTokens + const DefaultThumbnailDimension + const MaxCellOutputLength + const MaxFileSize + const MaxImageSize + const MaxLimit + const MaxLinesToRead + const MaxNotebookCells + const MaxPagesPerRead + const MinLineLength + const PDFATMentionInlineThreshold + const SearchHint + const TokenEstimationFactor + const ToolName + var BlockedDevicePaths = map[string]bool + var Description = fmt.Sprintf(..., MaxLinesToRead) + var DoclingExtensions = map[string]bool + var ImageMimeTypes = map[string]string + var TextExtensions = map[string]bool + func AddCompactLineNumbers(content string, startLine int) string + func AddLineNumbers(content string, startLine int) string + func CacheFileRead(filePath string, content string, fileInfo os.FileInfo, offset, limit int, ...) + func EstimateImageTokens(imageData []byte) int + func FormatNotFoundError(path string, workingDir string) error + func FormatNotebookCell(cell NotebookCell, index int) string + func FormatNotebookResult(result *NotebookResult) string + func FormatTextWithLineNumbers(result *FileReadResult, compact bool) string + func GetAlternateScreenshotPath(filePath string) (string, bool) + func GetCanonicalName(modelName string) string + func GetImageMimeType(filePath string) string + func GetPDFPageCount(filePath string) (int, error) + func InvalidateFileCache(filePath string) + func IsImageByExtension(filePath string) bool + func IsNotebookExtension(ext string) bool + func IsPDFExtension(ext string) bool + func IsTextByExtension(filePath string) bool + func ReadFileInRange(ctx context.Context, filePath string, offset int, limit int, maxBytes int64) (content string, lineCount int, totalLines int, totalBytes int64, readBytes int, ...) + func ReadFileWithCancellation(ctx context.Context, filePath string) ([]byte, error) + func RecordExternalRead(filePath string, modTime time.Time, content string, isFullRead bool) + func ShouldIncludeCyberRiskReminder() bool + func SuggestPathUnderCwd(requestedPath string, workingDir string) (string, error) + type BinaryFileResult struct + FilePath string + Reason string + Suggestion string + type CancellationGroup struct + func NewCancellationGroup(ctx context.Context) *CancellationGroup + func (g *CancellationGroup) Cancel() + func (g *CancellationGroup) Go(fn func(context.Context) error) + func (g *CancellationGroup) Wait() error + type DoclingFileResult struct + FilePath string + Format string + Images []PDFImage + Markdown string + OriginalSize int64 + PageCount int + type FileReadCache struct + MaxAge time.Duration + MaxEntries int + func GetGlobalCache() *FileReadCache + func NewFileReadCache() *FileReadCache + func (c *FileReadCache) Cleanup() + func (c *FileReadCache) Clear() + func (c *FileReadCache) Get(filePath string, offset, limit int) (*FileReadState, bool) + func (c *FileReadCache) GetLatest(filePath string) (*FileReadState, bool) + func (c *FileReadCache) Invalidate(filePath string) + func (c *FileReadCache) Set(filePath string, content string, fileInfo os.FileInfo, offset, limit int, ...) + func (c *FileReadCache) SetState(filePath string, state *FileReadState) + func (c *FileReadCache) Size() int + type FileReadResult struct + Binary *BinaryFileResult + Docling *DoclingFileResult + Error string + Image *ImageFileResult + Notebook *NotebookResult + PDF *PDFFileResult + PDFExtracted *PDFExtractedResult + PDFMarkdown *PDFMarkdownFileResult + Text *TextFileResult + Type FileType + Unchanged *UnchangedFileResult + type FileReadState struct + CachedAt time.Time + Content string + IsPartialView bool + Limit int + Offset int + Timestamp int64 + func CheckFileUnchanged(filePath string, offset, limit int) (*FileReadState, bool) + func GetLastReadState(filePath string) (*FileReadState, bool) + type FileType string + const FileTypeBinary + const FileTypeDocling + const FileTypeImage + const FileTypeNotebook + const FileTypePDF + const FileTypePDFExtracted + const FileTypePDFMarkdown + const FileTypeText + const FileTypeUnchanged + func DetectFileType(filePath string) (FileType, error) + type ImageDimensions struct + Height int + Width int + func GetImageDimensions(imageData []byte) (*ImageDimensions, error) + type ImageFileResult struct + Base64 string + Dimensions *ImageDimensions + FilePath string + MimeType string + OriginalSize int64 + type ImageProcessingResult struct + Base64 string + Dimensions *ImageDimensions + EstimatedTokens int + MimeType string + OriginalSize int64 + ProcessedSize int64 + WasCompressed bool + WasResized bool + func ReadAndProcessImage(filePath string, maxTokens int) (*ImageProcessingResult, error) + type Notebook struct + Cells []NotebookCell + Metadata NotebookMetadata + NBFormat int + NBFormatMinor int + func ReadNotebook(filePath string) (*Notebook, error) + type NotebookCell struct + CellType string + ExecutionCount *int + ID string + Metadata json.RawMessage + Outputs []NotebookOutput + Source []string + type NotebookKernelspec struct + Display string + Language string + Name string + type NotebookLanguageInfo struct + FileExtension string + Name string + Version string + type NotebookMetadata struct + Author string + Description string + Kernelspec *NotebookKernelspec + LanguageInfo *NotebookLanguageInfo + Title string + type NotebookOutput struct + Data map[string]any + Ename string + Evalue string + Metadata json.RawMessage + OutputType string + Text []string + Traceback []string + type NotebookResult struct + CellCount int + Cells []NotebookCell + CodeCells int + FilePath string + Language string + MarkdownCells int + RawCells int + func ParseNotebook(notebook *Notebook, filePath string) (*NotebookResult, error) + type PDFExtractedResult struct + Count int + FilePath string + OriginalSize int64 + OutputDir string + type PDFExtractionResult struct + Count int + FilePath string + OriginalSize int64 + OutputDir string + func ExtractPDFPages(filePath string, pageRange *PDFPageRange) (*PDFExtractionResult, error) + type PDFFileResult struct + Base64 string + FilePath string + OriginalSize int64 + PageCount int + type PDFImage struct + Base64 string + Filename string + MimeType string + type PDFMarkdownFileResult struct + FilePath string + Images []PDFImage + Markdown string + OriginalSize int64 + PageCount int + type PDFPageRange struct + FirstPage int + LastPage int + func ParsePDFPageRange(pages string) (*PDFPageRange, error) + type PDFResult struct + Base64 string + FilePath string + OriginalSize int64 + PageCount int + func ReadPDF(filePath string) (*PDFResult, error) + type TextFileResult struct + Content string + FilePath string + NumLines int + StartLine int + TotalLines int + Truncated bool + type Tool struct + func NewTool(config *ToolConfig) *Tool + func (t *Tool) BackfillInput(ctx context.Context, input map[string]any) map[string]any + func (t *Tool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error) + func (t *Tool) CheckPermissions(ctx context.Context, input map[string]any, toolCtx tool.ToolUseContext) types.PermissionResult + func (t *Tool) Definition() tool.Definition + func (t *Tool) Description(ctx context.Context) (string, error) + func (t *Tool) FormatResult(data any) string + func (t *Tool) IsConcurrencySafe(input map[string]any) bool + func (t *Tool) IsEnabled() bool + func (t *Tool) IsReadOnly(input map[string]any) bool + func (t *Tool) ValidateInput(ctx context.Context, input map[string]any) (map[string]any, error) + type ToolConfig struct + DefaultLimit int + DoclingURL string + MaxFileSize int64 + MaxImageSize int64 + MaxLimit int + func DefaultToolConfig() *ToolConfig + type UnchangedFileResult struct + FilePath string + Message string