apollovm_repository library

ApolloVM repository features — read, search, navigate, edit and version-control a codebase through a pluggable RepositoryAdapter.

This is a standalone feature, independent of MCP: a web IDE, a desktop editor, an agent or a test can use RepositoryService (a typed façade) and the adapters directly. The MCP apollovm.fs.*/search.*/code.*/git.* tools are just a thin JSON layer over this same surface.

This library is web-safe (no dart:io): pair it with the in-memory adapter in the browser, or import package:apollovm/apollovm_repository_io.dart on the VM for the on-disk LocalRepositoryAdapter.

import 'package:apollovm/apollovm_repository.dart';

final repo = RepositoryService(
  InMemoryRepositoryAdapter({'lib/main.dart': source}),
);
final outline = await repo.outline('lib/main.dart'); // language-aware
await repo.close();

Classes

GitBlameLine
One line of git blame.
GitCommit
One commit from git log.
GitResult
The result of a mutating git command.
GitStatusEntry
One entry of git status (porcelain).
InMemoryRepositoryAdapter
A web-safe, in-memory RepositoryAdapter backing tests and browser demos.
LineRange
A 1-based, inclusive line range for partial file reads.
Op
The op names shared by RepositoryRpc (server) and RemoteRepositoryAdapter (client) — one source of truth for the wire contract.
PermissionGuard
A RepositoryAdapter decorator that enforces a RepoConfig over any inner adapter, so the security policy holds regardless of the backend.
RemoteRepositoryAdapter
A RepositoryAdapter that talks to a remote repository server over HTTP.
RepoCapabilities
What a concrete RepositoryAdapter (as configured) is able and permitted to do. Tools consult this to fail cleanly ("not supported / not permitted") instead of throwing when an operation is unavailable.
RepoConfig
Policy for the repository surface (the RepositoryAdapter operations and the apollovm.fs.*/search.*/code.*/git.* MCP tools built on it).
RepoEdit
The outcome of an RepositoryAdapter.edit (or write).
RepoEntry
A directory entry produced by RepositoryAdapter.list.
RepoFile
The content of a file (or a line slice of it).
RepositoryAdapter
A pluggable backend for the workspace/repository MCP tools.
RepositoryRpc
A tiny, transport-agnostic JSON layer over a RepositoryService.
RepositoryService
A high-level, typed façade over a RepositoryAdapter — the entry point for using ApolloVM's repository features from any Dart host (a web IDE, a desktop editor, an agent, a test), independently of MCP.
RepoStat
File/directory metadata produced by RepositoryAdapter.stat.
TextMatch
A content-search hit produced by RepositoryAdapter.searchText.

Exceptions / Errors

RepoException
Raised by a RepositoryAdapter for an expected, reportable failure — a missing file, a path that escapes the workspace root, a rejected line anchor, or a git error. RepoRuntime turns these into {isError: true} tool results rather than letting them crash the server.
RepoPermissionException
Raised when an operation is not permitted by the adapter's capabilities / RepoConfig (e.g. a write while read-only). A subtype of RepoException so callers can distinguish "forbidden" from "failed".