chore: include pre-built dist for github install

This commit is contained in:
Robin Mordasiewicz
2026-03-14 04:56:50 +00:00
parent a7f0a4cf46
commit bce8ff3a75
1011 changed files with 150081 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
import type { GrepOptions, GrepResult, CountResult } from "./types";
export declare function runRg(options: GrepOptions): Promise<GrepResult>;
export declare function runRgCount(options: Omit<GrepOptions, "context">): Promise<CountResult[]>;
+18
View File
@@ -0,0 +1,18 @@
export type GrepBackend = "rg" | "grep";
interface ResolvedCli {
path: string;
backend: GrepBackend;
}
export declare function resolveGrepCli(): ResolvedCli;
export declare function resolveGrepCliWithAutoInstall(): Promise<ResolvedCli>;
export declare const DEFAULT_MAX_DEPTH = 20;
export declare const DEFAULT_MAX_FILESIZE = "10M";
export declare const DEFAULT_MAX_COUNT = 500;
export declare const DEFAULT_MAX_COLUMNS = 1000;
export declare const DEFAULT_CONTEXT = 2;
export declare const DEFAULT_TIMEOUT_MS = 60000;
export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
export declare const DEFAULT_RG_THREADS = 4;
export declare const RG_SAFETY_FLAGS: readonly ["--no-follow", "--color=never", "--no-heading", "--line-number", "--with-filename"];
export declare const GREP_SAFETY_FLAGS: readonly ["-n", "-H", "--color=never"];
export {};
+3
View File
@@ -0,0 +1,3 @@
export declare function findFileRecursive(dir: string, filename: string): string | null;
export declare function downloadAndInstallRipgrep(): Promise<string>;
export declare function getInstalledRipgrepPath(): string | null;
+1
View File
@@ -0,0 +1 @@
export { createGrepTools } from "./tools";
+3
View File
@@ -0,0 +1,3 @@
import type { GrepResult, CountResult } from "./types";
export declare function formatGrepResult(result: GrepResult): string;
export declare function formatCountResult(results: CountResult[]): string;
+3
View File
@@ -0,0 +1,3 @@
import type { PluginInput } from "@opencode-ai/plugin";
import { type ToolDefinition } from "@opencode-ai/plugin/tool";
export declare function createGrepTools(ctx: PluginInput): Record<string, ToolDefinition>;
+39
View File
@@ -0,0 +1,39 @@
export interface GrepMatch {
file: string;
line: number;
column?: number;
text: string;
}
export interface GrepResult {
matches: GrepMatch[];
totalMatches: number;
filesSearched: number;
truncated: boolean;
error?: string;
}
export interface GrepOptions {
pattern: string;
paths?: string[];
globs?: string[];
excludeGlobs?: string[];
context?: number;
maxDepth?: number;
maxFilesize?: string;
maxCount?: number;
maxColumns?: number;
caseSensitive?: boolean;
wholeWord?: boolean;
fixedStrings?: boolean;
multiline?: boolean;
hidden?: boolean;
noIgnore?: boolean;
fileType?: string[];
timeout?: number;
threads?: number;
outputMode?: "content" | "files_with_matches" | "count";
headLimit?: number;
}
export interface CountResult {
file: string;
count: number;
}