Versions in this module Expand all Collapse all v0 v0.2.0 Nov 29, 2026 Changes in this version + var ErrClosed = errors.New("workspace: handle is closed") + var ErrDiscoveryLimit = errors.New("workspace: result limit must be between 1 and 200, or zero for default") + var ErrExists = errors.New("workspace: target already exists") + var ErrIO = errors.New("workspace: filesystem operation failed") + var ErrLineEnding = errors.New("workspace: edit would change the existing line-ending convention") + var ErrMatch = errors.New("workspace: edit requires a unique exact match with correct indentation") + var ErrMissing = errors.New("workspace: file or parent directory not found") + var ErrNotRegular = errors.New("workspace: expected a regular file or directory") + var ErrPath = errors.New("workspace: invalid or excluded relative path") + var ErrPattern = errors.New("workspace: invalid or excessive glob pattern") + var ErrQuery = errors.New("workspace: invalid or excessive search query") + var ErrReadOnly = errors.New("workspace: writes are not enabled") + var ErrRevision = errors.New("workspace: invalid or stale content revision; read the file again") + var ErrText = errors.New("workspace: expected UTF-8 text without NUL bytes") + var ErrTooLarge = errors.New("workspace: file exceeds configured byte limit") + type Config struct + MaxFileBytes int + Writable bool + type DiscoveryStats struct + EntriesRead int + FilesExamined int + ReadBudgetBytes int + SkippedExcluded int + SkippedNonText int + SkippedOversized int + SkippedSpecial int + SkippedUnreadable int + StopReason string + Truncated bool + type Entry struct + Bytes int64 + Kind string + Path string + type ListOptions struct + Glob string + Limit int + Path string + Recursive bool + type ListResult struct + Entries []Entry + Stats DiscoveryStats + type Mutation struct + Bytes int + CleanupPending bool + Path string + Revision string + type SearchMatch struct + ByteColumn int + Excerpt string + ExcerptTruncated bool + Line int + Path string + type SearchOptions struct + Glob string + Limit int + Path string + Query string + Regex bool + type SearchResult struct + Matches []SearchMatch + Stats DiscoveryStats + type Snapshot struct + Content string + Path string + Revision string + type Workspace struct + func Open(directory string, cfg Config) (*Workspace, error) + func (w *Workspace) Close() error + func (w *Workspace) Create(ctx context.Context, name, content string) (Mutation, error) + func (w *Workspace) Edit(ctx context.Context, name, revision, oldText, newText string) (Mutation, error) + func (w *Workspace) List(ctx context.Context, opts ListOptions) (ListResult, error) + func (w *Workspace) Read(ctx context.Context, name string) (Snapshot, error) + func (w *Workspace) Replace(ctx context.Context, name, revision, content string) (Mutation, error) + func (w *Workspace) Search(ctx context.Context, opts SearchOptions) (SearchResult, error) + func (w *Workspace) Tools() ([]agent.Tool, error)