RepositoryAdapter class abstract interface

A pluggable backend for the workspace/repository MCP tools.

All path arguments are workspace-relative (POSIX / separators). Concrete adapters resolve and confine them to their root and throw a RepoException (or RepoPermissionException) on any invalid or forbidden access.

Implementers

Properties

capabilities RepoCapabilities
What this adapter can/‌may do, so tools can report unsupported operations cleanly.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(String path) Future<void>
Deletes the file or directory path.
edit(String path, String oldString, String newString, {bool replaceAll = false, int? atLine}) Future<RepoEdit>
Replaces oldString with newString in path. When replaceAll is false exactly one occurrence must match. When atLine is given, the match must occur on that 1-based line or the edit is rejected.
find({String? glob, int? limit}) Future<List<String>>
Finds files whose workspace-relative path matches glob (returns up to limit paths).
gitAdd(List<String> paths) Future<GitResult>
gitBlame(String path) Future<List<GitBlameLine>>
gitCheckout(String rev) Future<GitResult>
gitCommit(String message, {List<String>? paths}) Future<GitResult>
gitDiff({String? rev, bool staged = false, String? path}) Future<String>
gitLog({int? limit, String? path}) Future<List<GitCommit>>
gitRestore(List<String> paths, {bool staged = false}) Future<GitResult>
gitShow({required String rev, String? path}) Future<String>
gitStatus() Future<List<GitStatusEntry>>
list(String path, {bool recursive = false, int? maxDepth, String? glob}) Future<List<RepoEntry>>
Lists the directory at path. When recursive, descends up to maxDepth levels; glob filters entries by name/path pattern.
mkdir(String path) Future<void>
Creates the directory path (and any missing parents).
move(String from, String to) Future<void>
Moves/renames from to to.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String path, {LineRange? range}) Future<RepoFile>
Reads path, optionally only the lines in range.
searchText(String pattern, {String? glob, bool ignoreCase = false, int context = 0, int? limit}) Future<List<TextMatch>>
Searches file contents for pattern (a regular expression). glob limits which files are searched; context lines of surrounding text are attached.
stat(String path) Future<RepoStat>
Metadata for path (never throws for a missing path — returns exists: false).
toString() String
A string representation of this object.
inherited
write(String path, String content) Future<RepoEdit>
Creates or overwrites path with content.

Operators

operator ==(Object other) bool
The equality operator.
inherited