chore: include pre-built dist for github install
This commit is contained in:
Vendored
+3
@@ -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[]>;
|
||||
Vendored
+18
@@ -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 {};
|
||||
Vendored
+3
@@ -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;
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
export { createGrepTools } from "./tools";
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import type { GrepResult, CountResult } from "./types";
|
||||
export declare function formatGrepResult(result: GrepResult): string;
|
||||
export declare function formatCountResult(results: CountResult[]): string;
|
||||
Vendored
+3
@@ -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>;
|
||||
Vendored
+39
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user