Versions in this module Expand all Collapse all v0 v0.0.4 Nov 26, 2026 Changes in this version + const DefaultGlobLimit + const DefaultGrepLimit + const DefaultListLimit + const DefaultMaxDownloadBytes + const DefaultMaxFetchBytes + const DefaultSearchEndpoint + const DefaultSearchLimit + const DefaultSearchTimeout + const DefaultViewLimit + const MaxGlobBytes + const MaxGlobLimit + const MaxGrepBytes + const MaxGrepLimit + const MaxGrepLineBytes + const MaxListBytes + const MaxListLimit + const MaxSearchLimit + const MaxSearchResponseBytes + const MaxSearchSnippetBytes + const MaxViewBytes + const MaxViewLimit + const MaxViewLineBytes + var DefaultWatchIgnoreDirs = []string + var ErrAmbiguousEdit = errors.New("std: edit target matches multiple locations") + var ErrBinaryFile = errors.New("std: binary file not supported for text operation") + var ErrFileModified = errors.New("std: file was modified since last read") + var ErrFileNotRead = errors.New("std: file must be read before modification") + var ErrInvalidArgument = errors.New("std: invalid argument") + var ErrInvalidConfig = errors.New("std: invalid configuration") + var ErrSearchResponseTooLarge = errors.New("std: search response exceeds size limit") + var ErrTargetNotFound = errors.New("std: edit target not found in file") + type BashRequest struct + Command string + Dir string + Env map[string]string + Output io.Writer + ReadOnly bool + Stdin string + StdinReader io.Reader + Timeout time.Duration + Unsandboxed bool + type BashResult struct + Duration time.Duration + ExitCode int + ExternalChanges []FileChange + Stderr string + Stdout string + type Config struct + Logger log.Interface + Sandbox sandbox.Sandbox + SearchEndpoint string + Tracker FileTracker + func (c *Config) Validate() error + type DownloadRequest struct + DryRun bool + ExpectedHash string + Force bool + Headers map[string]string + MaxBytes int64 + Mode fs.FileMode + Path string + Timeout time.Duration + URL string + type DownloadResult struct + AfterHash string + BeforeHash string + BytesWritten int + ContentType string + Created bool + DryRun bool + Duration time.Duration + IsBinary bool + Path string + StatusCode int + URL string + type EditRequest struct + DryRun bool + ExpectedHash string + Force bool + NewText string + OldText string + Path string + ReplaceAll bool + type EditResult struct + Additions int + AfterHash string + BeforeHash string + Deletions int + Diff string + DryRun bool + Path string + Replacements int + type ExecRequest struct + Args []string + Dir string + Env map[string]string + Name string + Output io.Writer + ReadOnly bool + Stdin io.Reader + Timeout time.Duration + type ExecResult struct + Duration time.Duration + ExitCode int + ExternalChanges []FileChange + Stderr string + Stdout string + type FetchRequest struct + Body []byte + DryRun bool + Format string + Headers map[string]string + MaxBytes int64 + Method string + Timeout time.Duration + URL string + type FetchResult struct + Body []byte + ContentType string + DryRun bool + Duration time.Duration + Headers map[string]string + Status string + StatusCode int + Text string + Truncated bool + URL string + type FileChange struct + AfterContent []byte + BeforeContent []byte + IsBinary bool + type FileIndex struct + func NewFileIndex(opts FileIndexOptions) (*FileIndex, error) + func (idx *FileIndex) Close() error + func (idx *FileIndex) Invalidate() + func (idx *FileIndex) Refresh(ctx context.Context) error + func (idx *FileIndex) Search(ctx context.Context, opts SearchOptions) ([]api.WorkspaceFile, error) + func (idx *FileIndex) SetAllowExec(allow bool) + type FileIndexOptions struct + AllowExec bool + Lifecycle context.Context + Std *Std + type FileTracker interface + LastContent func(path string) (content []byte, ok bool) + LastHash func(path string) (hash string, ok bool) + RecentPaths func() []string + RecordChange func(ctx context.Context, change *FileChange) error + RecordRead func(ctx context.Context, path, hash string) error + TrackedPaths func() []string + type GlobRequest struct + Ignore []string + IncludeHidden bool + Limit int + Path string + Pattern string + type GlobResult struct + Matches []string + Path string + Pattern string + Truncated bool + type GrepMatch struct + After []string + Before []string + Column int + Line int + Path string + Text string + type GrepRequest struct + CaseInsensitive bool + ContextLines int + Include string + IncludeHidden bool + Limit int + Path string + Pattern string + type GrepResult struct + Matches []GrepMatch + Pattern string + Truncated bool + type ListEntry struct + IsDir bool + ModTime time.Time + Mode fs.FileMode + Name string + Path string + Size int64 + type ListRequest struct + Ignore []string + IncludeHidden bool + Limit int + MaxDepth int + Path string + Recursive bool + type ListResult struct + Entries []ListEntry + Path string + Truncated bool + type MemoryTracker struct + func NewMemoryTracker() *MemoryTracker + func (t *MemoryTracker) Changes() []FileChange + func (t *MemoryTracker) ChangesForPath(path string) []FileChange + func (t *MemoryTracker) LastContent(path string) ([]byte, bool) + func (t *MemoryTracker) LastHash(path string) (string, bool) + func (t *MemoryTracker) RecentPaths() []string + func (t *MemoryTracker) RecordChange(ctx context.Context, change *FileChange) error + func (t *MemoryTracker) RecordRead(ctx context.Context, path, hash string) error + func (t *MemoryTracker) TrackedPaths() []string + type RemoveRequest struct + DryRun bool + ExpectedHash string + Force bool + Path string + type RemoveResult struct + BeforeHash string + Deletions int + Diff string + DryRun bool + Path string + type SearchHit = web.Hit + type SearchOptions struct + IncludeHidden *bool + Limit int + Query string + RecentPaths []string + type SearchRequest struct + AllowedDomains []string + BlockedDomains []string + DryRun bool + Endpoint string + Limit int + Query string + type SearchResult struct + DryRun bool + Duration time.Duration + Endpoint string + Hits []SearchHit + Query string + Truncated bool + type Std struct + func New(cfg Config) (*Std, error) + func (s *Std) Bash(ctx context.Context, req BashRequest) (*BashResult, error) + func (s *Std) Download(ctx context.Context, req DownloadRequest) (*DownloadResult, error) + func (s *Std) Edit(ctx context.Context, req EditRequest) (*EditResult, error) + func (s *Std) Exec(ctx context.Context, req ExecRequest) (*ExecResult, error) + func (s *Std) Fetch(ctx context.Context, req FetchRequest) (*FetchResult, error) + func (s *Std) Glob(ctx context.Context, req GlobRequest) (*GlobResult, error) + func (s *Std) Grep(ctx context.Context, req GrepRequest) (*GrepResult, error) + func (s *Std) List(ctx context.Context, req ListRequest) (*ListResult, error) + func (s *Std) Remove(ctx context.Context, req RemoveRequest) (*RemoveResult, error) + func (s *Std) Sandbox() sandbox.Sandbox + func (s *Std) Search(ctx context.Context, req SearchRequest) (*SearchResult, error) + func (s *Std) SyncExternalChanges(ctx context.Context) ([]FileChange, error) + func (s *Std) Tracker() FileTracker + func (s *Std) View(ctx context.Context, req ViewRequest) (*ViewResult, error) + func (s *Std) Watch(ctx context.Context, req WatchRequest) (sandbox.Watcher, error) + func (s *Std) Write(ctx context.Context, req WriteRequest) (*WriteResult, error) + type ViewMedia struct + ByteSize int64 + Data []byte + MIMEType string + Modality media.Modality + Pages string + type ViewRequest struct + Limit int + Offset int + Pages string + Path string + type ViewResult struct + Content string + EndLine int + Hash string + Media *ViewMedia + Numbered string + Path string + StartLine int + TotalLines int + Truncated bool + type WatchRequest struct + Ignore []string + MaxDirs int + Path string + Recursive bool + type WriteRequest struct + Content string + DryRun bool + ExpectedHash string + Force bool + Mode fs.FileMode + Path string + type WriteResult struct + Additions int + AfterHash string + BeforeHash string + BytesWritten int + Created bool + Deletions int + Diff string + DryRun bool + Path string