cli library

Local 127.0.0.1 review sync HTTP server, multi-framework source-line locator, and embeddable CLI commands for coding-agent feedback workflows.

Classes

ReviewClearCommand
Removes resolved (or --all) review comments from the store without creating a review directory in a clean workspace.
ReviewCommand
Reusable review command (Command<int>) that can be mounted inside any host CommandRunner (for example, dart run dash_site review ...).
ReviewComment
A single visual review comment anchored to a rendered page and source file.
ReviewCommentsCliRunner
Standalone review_comments CLI CommandRunner exposing serve, list, prompt, resolve, and clear.
ReviewCommentStore
Manages atomic persistence of <reviewDirectoryName>/comments.json and <reviewDirectoryName>/feedback.md inside a repository root.
ReviewExecutionContext
Shared execution context for review CLI commands, supporting both top-level review_comments <cmd> execution and embedded <host> review <cmd> subcommands.
ReviewListCommand
Lists open, resolved, or all local visual review comments.
ReviewLocalServer
Local HTTP server bound strictly to 127.0.0.1 that syncs browser visual review highlights and comments with <reviewDirectoryName>/comments.json and <reviewDirectoryName>/feedback.md.
ReviewProjectConfig
Project-level configuration for review_comments_cli storage, prompts, and source file resolution.
ReviewPromptCommand
Prints a structured coding-agent prompt containing open visual review comments.
ReviewResolveCommand
Marks one or more review comments (or --all) resolved and updates feedback.md.
ReviewServeCommand
CLI subcommand that starts ReviewLocalServer standalone or wraps a child dev server command (review_comments serve -- flutter run -d chrome).
ReviewSiteConfig
Site-specific directory configuration for multi-site workspaces.

Constants

defaultAutoSourceRoots → const List<String>
Candidate source directories auto-discovered when ReviewProjectConfig.sourceRoots is not explicitly set.
defaultCliResolveCommand → const String
Default CLI resolve command shown in generated feedback.md instructions.
defaultReviewConfigFileName → const String
Default configuration file name checked in a repository root.
defaultReviewDirectoryName → const String
Default repository-relative directory storing local visual review files.
defaultReviewServerPort → const int
Default loopback port tried first by ReviewLocalServer.

Functions

buildWrappedDevCommandArgs(List<String> rawCommand, {required int serverPort, String? site}) → ({List<String> arguments, String executable})
Builds child process executable and argument list for review_comments serve -- <cmd...>, automatically injecting --dart-define=REVIEW_COMMENTS_MODE=local and --dart-define=REVIEW_COMMENTS_SERVER_PORT=<port> when wrapping flutter or jaspr dev/build commands.
computeCommentCounts(Iterable<ReviewComment> comments) → Map<String, int>
Computes open, resolved, and total counts for comments.
extractCodeSnippet(List<String> rawLines, int startLine, int endLine) → String
Extracts up to a 3-line (or capped multi-line) snippet surrounding 1-based startLine..endLine.
locateHighlightInRepo({required String repoRoot, String site = '', String? sourceFile, int? startLine, int? endLine, String? selectedText, String? elementText, String? headingAnchor, String? selector, String? pageUrl, ReviewProjectConfig? config}) → SourceLocationResult
Resolves a highlighted text quote, Flutter widget inspector location, element text, heading anchor, or flutter:<WidgetClass> selector back to its repository-relative source file and 1-based line range.
normalizeReviewPageUrl(String rawUrl) → String
Normalizes a page URL path so /ui/layout/, /ui/layout, and /ui/layout/index.html compare equal when filtering comments.
normalizeSourcePathInput(String repoRoot, String? rawPath, {String? canonicalRoot}) → String?
Normalizes a raw sourceFile path—including file:// URIs inside repoRoot, package:<pkg>/<path> URIs, org-dartlang-app:/// URIs, or repository-relative paths—into a clean POSIX path strictly confined within repoRoot.
runReviewCommentsCli(List<String> arguments) → Future<Never>
Runs the review_comments command-line interface and exits with the resulting status code.
sanitizeRepoRelativePath(String repoRoot, String? rawPath, {String? canonicalRoot}) → String?
Canonicalizes rawPath relative to repoRoot and verifies it stays strictly inside repoRoot (including resolving symlinks along its path).

Typedefs

ReviewStore = ReviewCommentStore
Alias for ReviewCommentStore for compatibility with callers such as dash_site.
SourceLocationResult = ({String? codeSnippet, int? endLine, String resolvedFile, int? startLine})
Resolved repository file path, 1-based line range, and surrounding snippet for a highlighted selection, widget, or element on a rendered page.