@morphllm/morphsdk 0.2.67 → 0.2.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-GGYMQZXI.js → chunk-26QXQFLZ.js} +86 -1
- package/dist/chunk-26QXQFLZ.js.map +1 -0
- package/dist/{chunk-SQHZPUCS.js → chunk-2LSVUHIE.js} +2 -2
- package/dist/{chunk-IVT6YMFA.js → chunk-B3J2O2NW.js} +5 -5
- package/dist/{chunk-7JEL2VZO.js → chunk-E4434A4Y.js} +3 -3
- package/dist/{chunk-7V2KIZT5.js → chunk-P6OEPI4N.js} +2 -2
- package/dist/{chunk-AQD2JCLI.js → chunk-Q6GHKKS5.js} +2 -2
- package/dist/{chunk-ZO4PPFCZ.js → chunk-QIG7YPFW.js} +92 -8
- package/dist/chunk-QIG7YPFW.js.map +1 -0
- package/dist/{chunk-XLSODV6H.js → chunk-XFCMTW5L.js} +2 -2
- package/dist/client.cjs +176 -7
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +7 -7
- package/dist/index.cjs +176 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -8
- package/dist/tools/warp_grep/anthropic.cjs +176 -7
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.js +4 -4
- package/dist/tools/warp_grep/client.cjs +176 -7
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +3 -3
- package/dist/tools/warp_grep/gemini.cjs +176 -7
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.js +4 -4
- package/dist/tools/warp_grep/harness.cjs +91 -7
- package/dist/tools/warp_grep/harness.cjs.map +1 -1
- package/dist/tools/warp_grep/harness.js +1 -1
- package/dist/tools/warp_grep/index.cjs +176 -7
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.js +7 -7
- package/dist/tools/warp_grep/openai.cjs +176 -7
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.js +4 -4
- package/dist/tools/warp_grep/providers/local.cjs +91 -7
- package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/local.js +1 -1
- package/dist/tools/warp_grep/providers/remote.cjs +85 -0
- package/dist/tools/warp_grep/providers/remote.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/remote.js +1 -1
- package/dist/tools/warp_grep/vercel.cjs +176 -7
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-GGYMQZXI.js.map +0 -1
- package/dist/chunk-ZO4PPFCZ.js.map +0 -1
- /package/dist/{chunk-SQHZPUCS.js.map → chunk-2LSVUHIE.js.map} +0 -0
- /package/dist/{chunk-IVT6YMFA.js.map → chunk-B3J2O2NW.js.map} +0 -0
- /package/dist/{chunk-7JEL2VZO.js.map → chunk-E4434A4Y.js.map} +0 -0
- /package/dist/{chunk-7V2KIZT5.js.map → chunk-P6OEPI4N.js.map} +0 -0
- /package/dist/{chunk-AQD2JCLI.js.map → chunk-Q6GHKKS5.js.map} +0 -0
- /package/dist/{chunk-XLSODV6H.js.map → chunk-XFCMTW5L.js.map} +0 -0
|
@@ -3,6 +3,90 @@ import {
|
|
|
3
3
|
} from "./chunk-XT5ZO6ES.js";
|
|
4
4
|
|
|
5
5
|
// tools/warp_grep/providers/remote.ts
|
|
6
|
+
var SKIP_NAMES = /* @__PURE__ */ new Set([
|
|
7
|
+
// Version control
|
|
8
|
+
".git",
|
|
9
|
+
".svn",
|
|
10
|
+
".hg",
|
|
11
|
+
".bzr",
|
|
12
|
+
// Dependencies
|
|
13
|
+
"node_modules",
|
|
14
|
+
"bower_components",
|
|
15
|
+
".pnpm",
|
|
16
|
+
".yarn",
|
|
17
|
+
"vendor",
|
|
18
|
+
"Pods",
|
|
19
|
+
".bundle",
|
|
20
|
+
// Python
|
|
21
|
+
"__pycache__",
|
|
22
|
+
".pytest_cache",
|
|
23
|
+
".mypy_cache",
|
|
24
|
+
".ruff_cache",
|
|
25
|
+
".venv",
|
|
26
|
+
"venv",
|
|
27
|
+
".tox",
|
|
28
|
+
".nox",
|
|
29
|
+
".eggs",
|
|
30
|
+
// Build outputs
|
|
31
|
+
"dist",
|
|
32
|
+
"build",
|
|
33
|
+
"out",
|
|
34
|
+
"output",
|
|
35
|
+
"target",
|
|
36
|
+
"_build",
|
|
37
|
+
".next",
|
|
38
|
+
".nuxt",
|
|
39
|
+
".output",
|
|
40
|
+
".vercel",
|
|
41
|
+
".netlify",
|
|
42
|
+
// Cache
|
|
43
|
+
".cache",
|
|
44
|
+
".parcel-cache",
|
|
45
|
+
".turbo",
|
|
46
|
+
".nx",
|
|
47
|
+
".gradle",
|
|
48
|
+
// IDE
|
|
49
|
+
".idea",
|
|
50
|
+
".vscode",
|
|
51
|
+
".vs",
|
|
52
|
+
// Coverage
|
|
53
|
+
"coverage",
|
|
54
|
+
".coverage",
|
|
55
|
+
"htmlcov",
|
|
56
|
+
".nyc_output",
|
|
57
|
+
// Temp
|
|
58
|
+
"tmp",
|
|
59
|
+
"temp",
|
|
60
|
+
".tmp",
|
|
61
|
+
".temp",
|
|
62
|
+
// Lock files
|
|
63
|
+
"package-lock.json",
|
|
64
|
+
"yarn.lock",
|
|
65
|
+
"pnpm-lock.yaml",
|
|
66
|
+
"bun.lockb",
|
|
67
|
+
"Cargo.lock",
|
|
68
|
+
"Gemfile.lock",
|
|
69
|
+
"poetry.lock"
|
|
70
|
+
]);
|
|
71
|
+
var SKIP_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
72
|
+
".min.js",
|
|
73
|
+
".min.css",
|
|
74
|
+
".bundle.js",
|
|
75
|
+
".wasm",
|
|
76
|
+
".so",
|
|
77
|
+
".dll",
|
|
78
|
+
".pyc",
|
|
79
|
+
".map",
|
|
80
|
+
".js.map"
|
|
81
|
+
]);
|
|
82
|
+
function shouldSkip(name) {
|
|
83
|
+
if (SKIP_NAMES.has(name)) return true;
|
|
84
|
+
if (name.startsWith(".")) return true;
|
|
85
|
+
for (const ext of SKIP_EXTENSIONS) {
|
|
86
|
+
if (name.endsWith(ext)) return true;
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
6
90
|
var RemoteCommandsProvider = class {
|
|
7
91
|
constructor(repoRoot, commands) {
|
|
8
92
|
this.repoRoot = repoRoot;
|
|
@@ -69,6 +153,7 @@ var RemoteCommandsProvider = class {
|
|
|
69
153
|
for (const fullPath of paths) {
|
|
70
154
|
if (fullPath === params.path || fullPath === this.repoRoot) continue;
|
|
71
155
|
const name = fullPath.split("/").pop() || "";
|
|
156
|
+
if (shouldSkip(name)) continue;
|
|
72
157
|
if (regex && !regex.test(name)) continue;
|
|
73
158
|
let relativePath = fullPath;
|
|
74
159
|
if (fullPath.startsWith(this.repoRoot)) {
|
|
@@ -95,4 +180,4 @@ var RemoteCommandsProvider = class {
|
|
|
95
180
|
export {
|
|
96
181
|
RemoteCommandsProvider
|
|
97
182
|
};
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
183
|
+
//# sourceMappingURL=chunk-26QXQFLZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../tools/warp_grep/providers/remote.ts"],"sourcesContent":["/**\n * RemoteCommandsProvider - wraps simple RemoteCommands into WarpGrepProvider\n * \n * Handles parsing of raw stdout from grep/read/listDir commands.\n * Users just return stdout, SDK handles all format conversion.\n */\n\nimport type { WarpGrepProvider, GrepResult, ReadResult, ListDirectoryEntry } from './types.js';\nimport type { RemoteCommands } from '../types.js';\nimport { AGENT_CONFIG } from '../agent/config.js';\n\n/**\n * Directories/files to always skip (exact name match)\n */\nconst SKIP_NAMES = new Set([\n // Version control\n '.git', '.svn', '.hg', '.bzr',\n // Dependencies\n 'node_modules', 'bower_components', '.pnpm', '.yarn',\n 'vendor', 'Pods', '.bundle',\n // Python\n '__pycache__', '.pytest_cache', '.mypy_cache', '.ruff_cache',\n '.venv', 'venv', '.tox', '.nox', '.eggs',\n // Build outputs\n 'dist', 'build', 'out', 'output', 'target', '_build',\n '.next', '.nuxt', '.output', '.vercel', '.netlify',\n // Cache\n '.cache', '.parcel-cache', '.turbo', '.nx', '.gradle',\n // IDE\n '.idea', '.vscode', '.vs',\n // Coverage\n 'coverage', '.coverage', 'htmlcov', '.nyc_output',\n // Temp\n 'tmp', 'temp', '.tmp', '.temp',\n // Lock files\n 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb',\n 'Cargo.lock', 'Gemfile.lock', 'poetry.lock',\n]);\n\n/**\n * File extensions to skip\n */\nconst SKIP_EXTENSIONS = new Set([\n '.min.js', '.min.css', '.bundle.js',\n '.wasm', '.so', '.dll', '.pyc',\n '.map', '.js.map',\n]);\n\n/**\n * Check if a filename should be skipped\n */\nfunction shouldSkip(name: string): boolean {\n // Skip exact name matches\n if (SKIP_NAMES.has(name)) return true;\n \n // Skip hidden files/directories (start with .)\n if (name.startsWith('.')) return true;\n \n // Skip files with certain extensions\n for (const ext of SKIP_EXTENSIONS) {\n if (name.endsWith(ext)) return true;\n }\n \n return false;\n}\n\n/**\n * Wraps simple RemoteCommands functions into a full WarpGrepProvider.\n * \n * This allows users to provide three simple functions that return raw stdout,\n * and the SDK handles all parsing internally.\n * \n * @example\n * ```typescript\n * const provider = new RemoteCommandsProvider('/home/repo', {\n * grep: async (pattern, path) => {\n * const r = await sandbox.run(`rg '${pattern}' '${path}'`);\n * return r.stdout;\n * },\n * read: async (path, start, end) => {\n * const r = await sandbox.run(`sed -n '${start},${end}p' '${path}'`);\n * return r.stdout;\n * },\n * listDir: async (path, maxDepth) => {\n * const r = await sandbox.run(`find '${path}' -maxdepth ${maxDepth}`);\n * return r.stdout;\n * },\n * });\n * ```\n */\nexport class RemoteCommandsProvider implements WarpGrepProvider {\n constructor(\n private readonly repoRoot: string,\n private readonly commands: RemoteCommands\n ) {}\n\n /**\n * Run grep command and parse ripgrep output\n */\n async grep(params: { pattern: string; path: string; glob?: string }): Promise<GrepResult> {\n try {\n const stdout = await this.commands.grep(params.pattern, params.path, params.glob);\n \n // Parse ripgrep output: each line is \"path:line:content\" or \"path-line-content\" for context\n const lines = (stdout || '')\n .trim()\n .split(/\\r?\\n/)\n .filter((l) => l.length > 0);\n \n // Check if output is too large\n if (lines.length > AGENT_CONFIG.MAX_OUTPUT_LINES) {\n return {\n lines: [],\n error: 'Query not specific enough - too many results returned. Try a more specific pattern.',\n };\n }\n \n return { lines };\n } catch (error) {\n return {\n lines: [],\n error: `[GREP ERROR] ${error instanceof Error ? error.message : String(error)}`,\n };\n }\n }\n\n /**\n * Read file and add line numbers\n */\n async read(params: { path: string; start?: number; end?: number }): Promise<ReadResult> {\n const start = params.start ?? 1;\n const end = params.end ?? 1_000_000;\n \n try {\n const stdout = await this.commands.read(params.path, start, end);\n \n // Split content into lines and add line numbers\n const contentLines = (stdout || '').split('\\n');\n \n // Remove trailing empty line if present (common with sed output)\n if (contentLines.length > 0 && contentLines[contentLines.length - 1] === '') {\n contentLines.pop();\n }\n \n // Format as \"lineNumber|content\"\n const lines = contentLines.map((content, idx) => `${start + idx}|${content}`);\n \n // Check if output is too large\n if (lines.length > AGENT_CONFIG.MAX_READ_LINES) {\n const truncated = lines.slice(0, AGENT_CONFIG.MAX_READ_LINES);\n truncated.push(`... [truncated: showing ${AGENT_CONFIG.MAX_READ_LINES} of ${lines.length} lines]`);\n return { lines: truncated };\n }\n \n return { lines };\n } catch (error) {\n return {\n lines: [],\n error: `[READ ERROR] ${error instanceof Error ? error.message : String(error)}`,\n };\n }\n }\n\n /**\n * List directory and parse find output\n */\n async listDirectory(params: { \n path: string; \n pattern?: string | null; \n maxResults?: number; \n maxDepth?: number;\n }): Promise<ListDirectoryEntry[]> {\n const maxDepth = params.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;\n const maxResults = params.maxResults ?? AGENT_CONFIG.MAX_OUTPUT_LINES;\n \n try {\n const stdout = await this.commands.listDir(params.path, maxDepth);\n \n // Parse find output: one path per line\n const paths = (stdout || '')\n .trim()\n .split(/\\r?\\n/)\n .filter((p) => p.length > 0);\n \n const regex = params.pattern ? new RegExp(params.pattern) : null;\n const entries: ListDirectoryEntry[] = [];\n \n for (const fullPath of paths) {\n // Skip the root path itself\n if (fullPath === params.path || fullPath === this.repoRoot) continue;\n \n const name = fullPath.split('/').pop() || '';\n \n // Simple name-based filtering - skip junk dirs/files\n if (shouldSkip(name)) continue;\n \n // Apply pattern filter if provided\n if (regex && !regex.test(name)) continue;\n \n // Determine relative path\n let relativePath = fullPath;\n if (fullPath.startsWith(this.repoRoot)) {\n relativePath = fullPath.slice(this.repoRoot.length).replace(/^\\//, '');\n }\n \n // Calculate depth based on path separators\n const depth = relativePath.split('/').filter(Boolean).length - 1;\n \n // Determine if it's a directory (ends with / or infer from path structure)\n // Note: Most sandbox find commands don't indicate type, so we guess based on extension\n const hasExtension = name.includes('.') && !name.startsWith('.');\n const type: 'file' | 'dir' = hasExtension ? 'file' : 'dir';\n \n entries.push({\n name,\n path: relativePath,\n type,\n depth: Math.max(0, depth),\n });\n \n if (entries.length >= maxResults) break;\n }\n \n return entries;\n } catch (error) {\n // Return empty array on error (consistent with LocalRipgrepProvider)\n return [];\n }\n }\n}\n\n\n\n\n"],"mappings":";;;;;AAcA,IAAM,aAAa,oBAAI,IAAI;AAAA;AAAA,EAEzB;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAO;AAAA;AAAA,EAEvB;AAAA,EAAgB;AAAA,EAAoB;AAAA,EAAS;AAAA,EAC7C;AAAA,EAAU;AAAA,EAAQ;AAAA;AAAA,EAElB;AAAA,EAAe;AAAA,EAAiB;AAAA,EAAe;AAAA,EAC/C;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAQ;AAAA;AAAA,EAEjC;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAO;AAAA,EAA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AAM,EAAE,SAAS,CAAC;AAE7B,YAAM,QAAQ,OAAO,UAAU,IAAI,OAAO,OAAO,OAAO,IAAI;AAC5D,YAAM,UAAgC,CAAC;AAEvC,iBAAW,YAAY,OAAO;AAE5B,YAAI,aAAa,OAAO,QAAQ,aAAa,KAAK,SAAU;AAE5D,cAAM,OAAO,SAAS,MAAM,GAAG,EAAE,IAAI,KAAK;AAG1C,YAAI,WAAW,IAAI,EAAG;AAGtB,YAAI,SAAS,CAAC,MAAM,KAAK,IAAI,EAAG;AAGhC,YAAI,eAAe;AACnB,YAAI,SAAS,WAAW,KAAK,QAAQ,GAAG;AACtC,yBAAe,SAAS,MAAM,KAAK,SAAS,MAAM,EAAE,QAAQ,OAAO,EAAE;AAAA,QACvE;AAGA,cAAM,QAAQ,aAAa,MAAM,GAAG,EAAE,OAAO,OAAO,EAAE,SAAS;AAI/D,cAAM,eAAe,KAAK,SAAS,GAAG,KAAK,CAAC,KAAK,WAAW,GAAG;AAC/D,cAAM,OAAuB,eAAe,SAAS;AAErD,gBAAQ,KAAK;AAAA,UACX;AAAA,UACA,MAAM;AAAA,UACN;AAAA,UACA,OAAO,KAAK,IAAI,GAAG,KAAK;AAAA,QAC1B,CAAC;AAED,YAAI,QAAQ,UAAU,WAAY;AAAA,MACpC;AAEA,aAAO;AAAA,IACT,SAAS,OAAO;AAEd,aAAO,CAAC;AAAA,IACV;AAAA,EACF;AACF;","names":[]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
executeToolCall,
|
|
7
7
|
formatResult
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-E4434A4Y.js";
|
|
9
9
|
import {
|
|
10
10
|
getSystemPrompt
|
|
11
11
|
} from "./chunk-Q5AHGIQO.js";
|
|
@@ -72,4 +72,4 @@ export {
|
|
|
72
72
|
gemini_default,
|
|
73
73
|
gemini_exports
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=chunk-
|
|
75
|
+
//# sourceMappingURL=chunk-2LSVUHIE.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWarpGrepTool as createWarpGrepTool2
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6GHKKS5.js";
|
|
4
4
|
import {
|
|
5
5
|
createWarpGrepTool
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XFCMTW5L.js";
|
|
7
7
|
import {
|
|
8
8
|
createWarpGrepTool as createWarpGrepTool3
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-P6OEPI4N.js";
|
|
10
10
|
import {
|
|
11
11
|
WarpGrepClient
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-E4434A4Y.js";
|
|
13
13
|
import {
|
|
14
14
|
createCodebaseSearchTool as createCodebaseSearchTool3
|
|
15
15
|
} from "./chunk-UBX7QYBD.js";
|
|
@@ -280,4 +280,4 @@ export {
|
|
|
280
280
|
VercelToolFactory,
|
|
281
281
|
MorphClient
|
|
282
282
|
};
|
|
283
|
-
//# sourceMappingURL=chunk-
|
|
283
|
+
//# sourceMappingURL=chunk-B3J2O2NW.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-SUBBMTMY.js";
|
|
4
4
|
import {
|
|
5
5
|
RemoteCommandsProvider
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-26QXQFLZ.js";
|
|
7
7
|
import {
|
|
8
8
|
LocalRipgrepProvider
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QIG7YPFW.js";
|
|
10
10
|
|
|
11
11
|
// tools/warp_grep/client.ts
|
|
12
12
|
var WarpGrepClient = class {
|
|
@@ -115,4 +115,4 @@ export {
|
|
|
115
115
|
executeToolCall,
|
|
116
116
|
formatResult
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
//# sourceMappingURL=chunk-E4434A4Y.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
executeToolCall,
|
|
6
6
|
formatResult
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-E4434A4Y.js";
|
|
8
8
|
import {
|
|
9
9
|
getSystemPrompt
|
|
10
10
|
} from "./chunk-Q5AHGIQO.js";
|
|
@@ -54,4 +54,4 @@ export {
|
|
|
54
54
|
vercel_default,
|
|
55
55
|
vercel_exports
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-P6OEPI4N.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
executeToolCall,
|
|
7
7
|
formatResult
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-E4434A4Y.js";
|
|
9
9
|
import {
|
|
10
10
|
getSystemPrompt
|
|
11
11
|
} from "./chunk-Q5AHGIQO.js";
|
|
@@ -62,4 +62,4 @@ export {
|
|
|
62
62
|
createWarpGrepTool,
|
|
63
63
|
anthropic_exports
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-Q6GHKKS5.js.map
|
|
@@ -18,6 +18,90 @@ import {
|
|
|
18
18
|
// tools/warp_grep/providers/local.ts
|
|
19
19
|
import fs from "fs/promises";
|
|
20
20
|
import path from "path";
|
|
21
|
+
var SKIP_NAMES = /* @__PURE__ */ new Set([
|
|
22
|
+
// Version control
|
|
23
|
+
".git",
|
|
24
|
+
".svn",
|
|
25
|
+
".hg",
|
|
26
|
+
".bzr",
|
|
27
|
+
// Dependencies
|
|
28
|
+
"node_modules",
|
|
29
|
+
"bower_components",
|
|
30
|
+
".pnpm",
|
|
31
|
+
".yarn",
|
|
32
|
+
"vendor",
|
|
33
|
+
"Pods",
|
|
34
|
+
".bundle",
|
|
35
|
+
// Python
|
|
36
|
+
"__pycache__",
|
|
37
|
+
".pytest_cache",
|
|
38
|
+
".mypy_cache",
|
|
39
|
+
".ruff_cache",
|
|
40
|
+
".venv",
|
|
41
|
+
"venv",
|
|
42
|
+
".tox",
|
|
43
|
+
".nox",
|
|
44
|
+
".eggs",
|
|
45
|
+
// Build outputs
|
|
46
|
+
"dist",
|
|
47
|
+
"build",
|
|
48
|
+
"out",
|
|
49
|
+
"output",
|
|
50
|
+
"target",
|
|
51
|
+
"_build",
|
|
52
|
+
".next",
|
|
53
|
+
".nuxt",
|
|
54
|
+
".output",
|
|
55
|
+
".vercel",
|
|
56
|
+
".netlify",
|
|
57
|
+
// Cache
|
|
58
|
+
".cache",
|
|
59
|
+
".parcel-cache",
|
|
60
|
+
".turbo",
|
|
61
|
+
".nx",
|
|
62
|
+
".gradle",
|
|
63
|
+
// IDE
|
|
64
|
+
".idea",
|
|
65
|
+
".vscode",
|
|
66
|
+
".vs",
|
|
67
|
+
// Coverage
|
|
68
|
+
"coverage",
|
|
69
|
+
".coverage",
|
|
70
|
+
"htmlcov",
|
|
71
|
+
".nyc_output",
|
|
72
|
+
// Temp
|
|
73
|
+
"tmp",
|
|
74
|
+
"temp",
|
|
75
|
+
".tmp",
|
|
76
|
+
".temp",
|
|
77
|
+
// Lock files
|
|
78
|
+
"package-lock.json",
|
|
79
|
+
"yarn.lock",
|
|
80
|
+
"pnpm-lock.yaml",
|
|
81
|
+
"bun.lockb",
|
|
82
|
+
"Cargo.lock",
|
|
83
|
+
"Gemfile.lock",
|
|
84
|
+
"poetry.lock"
|
|
85
|
+
]);
|
|
86
|
+
var SKIP_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
87
|
+
".min.js",
|
|
88
|
+
".min.css",
|
|
89
|
+
".bundle.js",
|
|
90
|
+
".wasm",
|
|
91
|
+
".so",
|
|
92
|
+
".dll",
|
|
93
|
+
".pyc",
|
|
94
|
+
".map",
|
|
95
|
+
".js.map"
|
|
96
|
+
]);
|
|
97
|
+
function shouldSkip(name) {
|
|
98
|
+
if (SKIP_NAMES.has(name)) return true;
|
|
99
|
+
if (name.startsWith(".")) return true;
|
|
100
|
+
for (const ext of SKIP_EXTENSIONS) {
|
|
101
|
+
if (name.endsWith(ext)) return true;
|
|
102
|
+
}
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
21
105
|
var LocalRipgrepProvider = class {
|
|
22
106
|
constructor(repoRoot, excludes = DEFAULT_EXCLUDES) {
|
|
23
107
|
this.repoRoot = repoRoot;
|
|
@@ -150,6 +234,7 @@ Details: ${res.stderr}` : ""}`
|
|
|
150
234
|
const maxResults = params.maxResults ?? AGENT_CONFIG.MAX_OUTPUT_LINES;
|
|
151
235
|
const maxDepth = params.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;
|
|
152
236
|
const regex = params.pattern ? new RegExp(params.pattern) : null;
|
|
237
|
+
const repoRoot = this.repoRoot;
|
|
153
238
|
const results = [];
|
|
154
239
|
let timedOut = false;
|
|
155
240
|
const startTime = Date.now();
|
|
@@ -162,18 +247,17 @@ Details: ${res.stderr}` : ""}`
|
|
|
162
247
|
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
163
248
|
for (const entry of entries) {
|
|
164
249
|
if (timedOut || results.length >= maxResults) break;
|
|
165
|
-
|
|
166
|
-
const rel = toRepoRelative(abs, full).replace(/^[.][/\\]?/, "");
|
|
167
|
-
if (DEFAULT_EXCLUDES.some((ex) => rel.split(path.sep).includes(ex))) continue;
|
|
250
|
+
if (shouldSkip(entry.name)) continue;
|
|
168
251
|
if (regex && !regex.test(entry.name)) continue;
|
|
252
|
+
const full = path.join(dir, entry.name);
|
|
253
|
+
const isDir = entry.isDirectory();
|
|
169
254
|
results.push({
|
|
170
255
|
name: entry.name,
|
|
171
|
-
path: toRepoRelative(
|
|
172
|
-
|
|
173
|
-
type: entry.isDirectory() ? "dir" : "file",
|
|
256
|
+
path: toRepoRelative(repoRoot, full),
|
|
257
|
+
type: isDir ? "dir" : "file",
|
|
174
258
|
depth
|
|
175
259
|
});
|
|
176
|
-
if (
|
|
260
|
+
if (isDir) {
|
|
177
261
|
await walk(full, depth + 1);
|
|
178
262
|
}
|
|
179
263
|
}
|
|
@@ -186,4 +270,4 @@ Details: ${res.stderr}` : ""}`
|
|
|
186
270
|
export {
|
|
187
271
|
LocalRipgrepProvider
|
|
188
272
|
};
|
|
189
|
-
//# sourceMappingURL=chunk-
|
|
273
|
+
//# sourceMappingURL=chunk-QIG7YPFW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../tools/warp_grep/providers/local.ts"],"sourcesContent":["import fs from 'fs/promises';\nimport fssync from 'fs';\nimport path from 'path';\nimport { runRipgrep } from '../utils/ripgrep.js';\nimport { ensureWithinRepo, resolveUnderRepo, toRepoRelative, isSymlink, isTextualFile } from '../utils/paths.js';\nimport type { WarpGrepProvider, GrepResult, ReadResult, ListDirectoryEntry } from './types.js';\nimport { readAllLines } from '../utils/files.js';\nimport { DEFAULT_EXCLUDES, AGENT_CONFIG } from '../agent/config.js';\n\n/**\n * Directories/files to always skip (exact name match)\n */\nconst SKIP_NAMES = new Set([\n // Version control\n '.git', '.svn', '.hg', '.bzr',\n // Dependencies\n 'node_modules', 'bower_components', '.pnpm', '.yarn',\n 'vendor', 'Pods', '.bundle',\n // Python\n '__pycache__', '.pytest_cache', '.mypy_cache', '.ruff_cache',\n '.venv', 'venv', '.tox', '.nox', '.eggs',\n // Build outputs\n 'dist', 'build', 'out', 'output', 'target', '_build',\n '.next', '.nuxt', '.output', '.vercel', '.netlify',\n // Cache\n '.cache', '.parcel-cache', '.turbo', '.nx', '.gradle',\n // IDE\n '.idea', '.vscode', '.vs',\n // Coverage\n 'coverage', '.coverage', 'htmlcov', '.nyc_output',\n // Temp\n 'tmp', 'temp', '.tmp', '.temp',\n // Lock files\n 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb',\n 'Cargo.lock', 'Gemfile.lock', 'poetry.lock',\n]);\n\n/**\n * File extensions to skip\n */\nconst SKIP_EXTENSIONS = new Set([\n '.min.js', '.min.css', '.bundle.js',\n '.wasm', '.so', '.dll', '.pyc',\n '.map', '.js.map',\n]);\n\n/**\n * Check if a filename should be skipped\n */\nfunction shouldSkip(name: string): boolean {\n // Skip exact name matches\n if (SKIP_NAMES.has(name)) return true;\n \n // Skip hidden files/directories (start with .)\n if (name.startsWith('.')) return true;\n \n // Skip files with certain extensions\n for (const ext of SKIP_EXTENSIONS) {\n if (name.endsWith(ext)) return true;\n }\n \n return false;\n}\n\nexport class LocalRipgrepProvider implements WarpGrepProvider {\n constructor(private readonly repoRoot: string, private readonly excludes: string[] = DEFAULT_EXCLUDES) {}\n\n async grep(params: { pattern: string; path: string; glob?: string }): Promise<GrepResult> {\n let abs: string;\n try {\n abs = resolveUnderRepo(this.repoRoot, params.path);\n } catch (err) {\n return {\n lines: [],\n error: `[PATH ERROR] ${err instanceof Error ? err.message : String(err)}`,\n };\n }\n const stat = await fs.stat(abs).catch(() => null);\n if (!stat) return { lines: [] };\n const targetArg = abs === path.resolve(this.repoRoot) ? '.' : toRepoRelative(this.repoRoot, abs);\n const args = [\n '--no-config',\n '--no-heading',\n '--with-filename',\n '--line-number',\n '--color=never',\n '--trim',\n '--max-columns=400',\n '-C', '1',\n ...(params.glob ? ['--glob', params.glob] : []),\n ...this.excludes.flatMap((e) => ['-g', `!${e}`]),\n params.pattern,\n targetArg || '.',\n ];\n const res = await runRipgrep(args, { cwd: this.repoRoot });\n \n // Gracefully handle ripgrep not being available\n if (res.exitCode === -1) {\n return {\n lines: [],\n error: `[RIPGREP NOT AVAILABLE] ripgrep (rg) is required but failed to execute. Please install it:\\n` +\n ` • macOS: brew install ripgrep\\n` +\n ` • Ubuntu/Debian: apt install ripgrep\\n` +\n ` • Windows: choco install ripgrep\\n` +\n ` • Or visit: https://github.com/BurntSushi/ripgrep#installation\\n` +\n `Exit code: ${res.exitCode}${res.stderr ? `\\nDetails: ${res.stderr}` : ''}`,\n };\n }\n \n // Handle other ripgrep errors gracefully\n if (res.exitCode !== 0 && res.exitCode !== 1) {\n return {\n lines: [],\n error: `[RIPGREP ERROR] grep failed with exit code ${res.exitCode}${res.stderr ? `: ${res.stderr}` : ''}`,\n };\n }\n \n const lines = (res.stdout || '')\n .trim()\n .split(/\\r?\\n/)\n .filter((l) => l.length > 0);\n if (lines.length > AGENT_CONFIG.MAX_OUTPUT_LINES) {\n return {\n lines: [],\n error: 'query not specific enough, tool tried to return too much context and failed',\n };\n }\n \n return { lines };\n }\n\n async read(params: { path: string; start?: number; end?: number }): Promise<ReadResult> {\n let abs: string;\n try {\n abs = resolveUnderRepo(this.repoRoot, params.path);\n } catch (err) {\n return {\n lines: [],\n error: `[PATH ERROR] ${err instanceof Error ? err.message : String(err)}`,\n };\n }\n const stat = await fs.stat(abs).catch(() => null);\n \n // Gracefully handle file not found / not a file\n if (!stat || !stat.isFile()) {\n return {\n lines: [],\n error: `[FILE NOT FOUND] You tried to read \"${params.path}\" but there is no file at this path. ` +\n `Double-check the path exists and is spelled correctly.`,\n };\n }\n \n // Gracefully handle symlinks\n if (isSymlink(abs)) {\n return {\n lines: [],\n error: `[SYMLINK] You tried to read \"${params.path}\" but this is a symlink. ` +\n `Try reading the actual file it points to instead.`,\n };\n }\n \n // Gracefully handle non-text or too-large files\n if (!isTextualFile(abs)) {\n return {\n lines: [],\n error: `[UNREADABLE FILE] You tried to read \"${params.path}\" but this file is either too large ` +\n `or not a text file, so it cannot be read. Try a different file.`,\n };\n }\n \n let lines: string[];\n try {\n lines = await readAllLines(abs);\n } catch (err) {\n return {\n lines: [],\n error: `[READ ERROR] Failed to read \"${params.path}\": ${err instanceof Error ? err.message : String(err)}`,\n };\n }\n const total = lines.length;\n let s = params.start ?? 1;\n let e = Math.min(params.end ?? total, total);\n if (s > total && total > 0) {\n // Model hallucinated range - fallback to full file\n s = 1;\n e = total;\n }\n const out: string[] = [];\n for (let i = s; i <= e; i += 1) {\n const content = lines[i - 1] ?? '';\n out.push(`${i}|${content}`);\n }\n if (out.length > AGENT_CONFIG.MAX_READ_LINES) {\n const truncated = out.slice(0, AGENT_CONFIG.MAX_READ_LINES);\n truncated.push(`... [truncated: showing ${AGENT_CONFIG.MAX_READ_LINES} of ${out.length} lines]`);\n return { lines: truncated };\n }\n \n return { lines: out };\n }\n\n async listDirectory(params: { path: string; pattern?: string | null; maxResults?: number; maxDepth?: number }): Promise<ListDirectoryEntry[]> {\n let abs: string;\n try {\n abs = resolveUnderRepo(this.repoRoot, params.path);\n } catch {\n // Path outside repo - return empty (graceful failure)\n return [];\n }\n const stat = await fs.stat(abs).catch(() => null);\n if (!stat || !stat.isDirectory()) {\n return [];\n }\n const maxResults = params.maxResults ?? AGENT_CONFIG.MAX_OUTPUT_LINES;\n const maxDepth = params.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;\n const regex = params.pattern ? new RegExp(params.pattern) : null;\n const repoRoot = this.repoRoot;\n\n const results: ListDirectoryEntry[] = [];\n let timedOut = false;\n const startTime = Date.now();\n \n async function walk(dir: string, depth: number) {\n if (Date.now() - startTime > AGENT_CONFIG.LIST_TIMEOUT_MS) {\n timedOut = true;\n return;\n }\n if (depth > maxDepth || results.length >= maxResults) return;\n const entries = await fs.readdir(dir, { withFileTypes: true });\n for (const entry of entries) {\n if (timedOut || results.length >= maxResults) break;\n \n // Simple name-based filtering - skip junk dirs/files\n if (shouldSkip(entry.name)) continue;\n \n // Apply user-provided pattern filter\n if (regex && !regex.test(entry.name)) continue;\n \n const full = path.join(dir, entry.name);\n const isDir = entry.isDirectory();\n \n results.push({\n name: entry.name,\n path: toRepoRelative(repoRoot, full),\n type: isDir ? 'dir' : 'file',\n depth,\n });\n if (isDir) {\n await walk(full, depth + 1);\n }\n }\n }\n await walk(abs, 0);\n return results;\n }\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AAEf,OAAO,UAAU;AAUjB,IAAM,aAAa,oBAAI,IAAI;AAAA;AAAA,EAEzB;AAAA,EAAQ;AAAA,EAA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AE,eAAe,KAAK,CAAC;AAC7D,iBAAW,SAAS,SAAS;AAC3B,YAAI,YAAY,QAAQ,UAAU,WAAY;AAG9C,YAAI,WAAW,MAAM,IAAI,EAAG;AAG5B,YAAI,SAAS,CAAC,MAAM,KAAK,MAAM,IAAI,EAAG;AAEtC,cAAM,OAAO,KAAK,KAAK,KAAK,MAAM,IAAI;AACtC,cAAM,QAAQ,MAAM,YAAY;AAEhC,gBAAQ,KAAK;AAAA,UACX,MAAM,MAAM;AAAA,UACZ,MAAM,eAAe,UAAU,IAAI;AAAA,UACnC,MAAM,QAAQ,QAAQ;AAAA,UACtB;AAAA,QACF,CAAC;AACD,YAAI,OAAO;AACT,gBAAM,KAAK,MAAM,QAAQ,CAAC;AAAA,QAC5B;AAAA,MACF;AAAA,IACF;AACA,UAAM,KAAK,KAAK,CAAC;AACjB,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
executeToolCall,
|
|
7
7
|
formatResult
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-E4434A4Y.js";
|
|
9
9
|
import {
|
|
10
10
|
getSystemPrompt
|
|
11
11
|
} from "./chunk-Q5AHGIQO.js";
|
|
@@ -71,4 +71,4 @@ export {
|
|
|
71
71
|
openai_default,
|
|
72
72
|
openai_exports
|
|
73
73
|
};
|
|
74
|
-
//# sourceMappingURL=chunk-
|
|
74
|
+
//# sourceMappingURL=chunk-XFCMTW5L.js.map
|
package/dist/client.cjs
CHANGED
|
@@ -2082,6 +2082,90 @@ async function readAllLines(filePath) {
|
|
|
2082
2082
|
}
|
|
2083
2083
|
|
|
2084
2084
|
// tools/warp_grep/providers/local.ts
|
|
2085
|
+
var SKIP_NAMES = /* @__PURE__ */ new Set([
|
|
2086
|
+
// Version control
|
|
2087
|
+
".git",
|
|
2088
|
+
".svn",
|
|
2089
|
+
".hg",
|
|
2090
|
+
".bzr",
|
|
2091
|
+
// Dependencies
|
|
2092
|
+
"node_modules",
|
|
2093
|
+
"bower_components",
|
|
2094
|
+
".pnpm",
|
|
2095
|
+
".yarn",
|
|
2096
|
+
"vendor",
|
|
2097
|
+
"Pods",
|
|
2098
|
+
".bundle",
|
|
2099
|
+
// Python
|
|
2100
|
+
"__pycache__",
|
|
2101
|
+
".pytest_cache",
|
|
2102
|
+
".mypy_cache",
|
|
2103
|
+
".ruff_cache",
|
|
2104
|
+
".venv",
|
|
2105
|
+
"venv",
|
|
2106
|
+
".tox",
|
|
2107
|
+
".nox",
|
|
2108
|
+
".eggs",
|
|
2109
|
+
// Build outputs
|
|
2110
|
+
"dist",
|
|
2111
|
+
"build",
|
|
2112
|
+
"out",
|
|
2113
|
+
"output",
|
|
2114
|
+
"target",
|
|
2115
|
+
"_build",
|
|
2116
|
+
".next",
|
|
2117
|
+
".nuxt",
|
|
2118
|
+
".output",
|
|
2119
|
+
".vercel",
|
|
2120
|
+
".netlify",
|
|
2121
|
+
// Cache
|
|
2122
|
+
".cache",
|
|
2123
|
+
".parcel-cache",
|
|
2124
|
+
".turbo",
|
|
2125
|
+
".nx",
|
|
2126
|
+
".gradle",
|
|
2127
|
+
// IDE
|
|
2128
|
+
".idea",
|
|
2129
|
+
".vscode",
|
|
2130
|
+
".vs",
|
|
2131
|
+
// Coverage
|
|
2132
|
+
"coverage",
|
|
2133
|
+
".coverage",
|
|
2134
|
+
"htmlcov",
|
|
2135
|
+
".nyc_output",
|
|
2136
|
+
// Temp
|
|
2137
|
+
"tmp",
|
|
2138
|
+
"temp",
|
|
2139
|
+
".tmp",
|
|
2140
|
+
".temp",
|
|
2141
|
+
// Lock files
|
|
2142
|
+
"package-lock.json",
|
|
2143
|
+
"yarn.lock",
|
|
2144
|
+
"pnpm-lock.yaml",
|
|
2145
|
+
"bun.lockb",
|
|
2146
|
+
"Cargo.lock",
|
|
2147
|
+
"Gemfile.lock",
|
|
2148
|
+
"poetry.lock"
|
|
2149
|
+
]);
|
|
2150
|
+
var SKIP_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
2151
|
+
".min.js",
|
|
2152
|
+
".min.css",
|
|
2153
|
+
".bundle.js",
|
|
2154
|
+
".wasm",
|
|
2155
|
+
".so",
|
|
2156
|
+
".dll",
|
|
2157
|
+
".pyc",
|
|
2158
|
+
".map",
|
|
2159
|
+
".js.map"
|
|
2160
|
+
]);
|
|
2161
|
+
function shouldSkip(name) {
|
|
2162
|
+
if (SKIP_NAMES.has(name)) return true;
|
|
2163
|
+
if (name.startsWith(".")) return true;
|
|
2164
|
+
for (const ext of SKIP_EXTENSIONS) {
|
|
2165
|
+
if (name.endsWith(ext)) return true;
|
|
2166
|
+
}
|
|
2167
|
+
return false;
|
|
2168
|
+
}
|
|
2085
2169
|
var LocalRipgrepProvider = class {
|
|
2086
2170
|
constructor(repoRoot, excludes = DEFAULT_EXCLUDES) {
|
|
2087
2171
|
this.repoRoot = repoRoot;
|
|
@@ -2214,6 +2298,7 @@ Details: ${res.stderr}` : ""}`
|
|
|
2214
2298
|
const maxResults = params.maxResults ?? AGENT_CONFIG.MAX_OUTPUT_LINES;
|
|
2215
2299
|
const maxDepth = params.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;
|
|
2216
2300
|
const regex = params.pattern ? new RegExp(params.pattern) : null;
|
|
2301
|
+
const repoRoot = this.repoRoot;
|
|
2217
2302
|
const results = [];
|
|
2218
2303
|
let timedOut = false;
|
|
2219
2304
|
const startTime = Date.now();
|
|
@@ -2226,18 +2311,17 @@ Details: ${res.stderr}` : ""}`
|
|
|
2226
2311
|
const entries = await import_promises3.default.readdir(dir, { withFileTypes: true });
|
|
2227
2312
|
for (const entry of entries) {
|
|
2228
2313
|
if (timedOut || results.length >= maxResults) break;
|
|
2229
|
-
|
|
2230
|
-
const rel = toRepoRelative(abs, full).replace(/^[.][/\\]?/, "");
|
|
2231
|
-
if (DEFAULT_EXCLUDES.some((ex) => rel.split(import_path5.default.sep).includes(ex))) continue;
|
|
2314
|
+
if (shouldSkip(entry.name)) continue;
|
|
2232
2315
|
if (regex && !regex.test(entry.name)) continue;
|
|
2316
|
+
const full = import_path5.default.join(dir, entry.name);
|
|
2317
|
+
const isDir = entry.isDirectory();
|
|
2233
2318
|
results.push({
|
|
2234
2319
|
name: entry.name,
|
|
2235
|
-
path: toRepoRelative(
|
|
2236
|
-
|
|
2237
|
-
type: entry.isDirectory() ? "dir" : "file",
|
|
2320
|
+
path: toRepoRelative(repoRoot, full),
|
|
2321
|
+
type: isDir ? "dir" : "file",
|
|
2238
2322
|
depth
|
|
2239
2323
|
});
|
|
2240
|
-
if (
|
|
2324
|
+
if (isDir) {
|
|
2241
2325
|
await walk(full, depth + 1);
|
|
2242
2326
|
}
|
|
2243
2327
|
}
|
|
@@ -2248,6 +2332,90 @@ Details: ${res.stderr}` : ""}`
|
|
|
2248
2332
|
};
|
|
2249
2333
|
|
|
2250
2334
|
// tools/warp_grep/providers/remote.ts
|
|
2335
|
+
var SKIP_NAMES2 = /* @__PURE__ */ new Set([
|
|
2336
|
+
// Version control
|
|
2337
|
+
".git",
|
|
2338
|
+
".svn",
|
|
2339
|
+
".hg",
|
|
2340
|
+
".bzr",
|
|
2341
|
+
// Dependencies
|
|
2342
|
+
"node_modules",
|
|
2343
|
+
"bower_components",
|
|
2344
|
+
".pnpm",
|
|
2345
|
+
".yarn",
|
|
2346
|
+
"vendor",
|
|
2347
|
+
"Pods",
|
|
2348
|
+
".bundle",
|
|
2349
|
+
// Python
|
|
2350
|
+
"__pycache__",
|
|
2351
|
+
".pytest_cache",
|
|
2352
|
+
".mypy_cache",
|
|
2353
|
+
".ruff_cache",
|
|
2354
|
+
".venv",
|
|
2355
|
+
"venv",
|
|
2356
|
+
".tox",
|
|
2357
|
+
".nox",
|
|
2358
|
+
".eggs",
|
|
2359
|
+
// Build outputs
|
|
2360
|
+
"dist",
|
|
2361
|
+
"build",
|
|
2362
|
+
"out",
|
|
2363
|
+
"output",
|
|
2364
|
+
"target",
|
|
2365
|
+
"_build",
|
|
2366
|
+
".next",
|
|
2367
|
+
".nuxt",
|
|
2368
|
+
".output",
|
|
2369
|
+
".vercel",
|
|
2370
|
+
".netlify",
|
|
2371
|
+
// Cache
|
|
2372
|
+
".cache",
|
|
2373
|
+
".parcel-cache",
|
|
2374
|
+
".turbo",
|
|
2375
|
+
".nx",
|
|
2376
|
+
".gradle",
|
|
2377
|
+
// IDE
|
|
2378
|
+
".idea",
|
|
2379
|
+
".vscode",
|
|
2380
|
+
".vs",
|
|
2381
|
+
// Coverage
|
|
2382
|
+
"coverage",
|
|
2383
|
+
".coverage",
|
|
2384
|
+
"htmlcov",
|
|
2385
|
+
".nyc_output",
|
|
2386
|
+
// Temp
|
|
2387
|
+
"tmp",
|
|
2388
|
+
"temp",
|
|
2389
|
+
".tmp",
|
|
2390
|
+
".temp",
|
|
2391
|
+
// Lock files
|
|
2392
|
+
"package-lock.json",
|
|
2393
|
+
"yarn.lock",
|
|
2394
|
+
"pnpm-lock.yaml",
|
|
2395
|
+
"bun.lockb",
|
|
2396
|
+
"Cargo.lock",
|
|
2397
|
+
"Gemfile.lock",
|
|
2398
|
+
"poetry.lock"
|
|
2399
|
+
]);
|
|
2400
|
+
var SKIP_EXTENSIONS2 = /* @__PURE__ */ new Set([
|
|
2401
|
+
".min.js",
|
|
2402
|
+
".min.css",
|
|
2403
|
+
".bundle.js",
|
|
2404
|
+
".wasm",
|
|
2405
|
+
".so",
|
|
2406
|
+
".dll",
|
|
2407
|
+
".pyc",
|
|
2408
|
+
".map",
|
|
2409
|
+
".js.map"
|
|
2410
|
+
]);
|
|
2411
|
+
function shouldSkip2(name) {
|
|
2412
|
+
if (SKIP_NAMES2.has(name)) return true;
|
|
2413
|
+
if (name.startsWith(".")) return true;
|
|
2414
|
+
for (const ext of SKIP_EXTENSIONS2) {
|
|
2415
|
+
if (name.endsWith(ext)) return true;
|
|
2416
|
+
}
|
|
2417
|
+
return false;
|
|
2418
|
+
}
|
|
2251
2419
|
var RemoteCommandsProvider = class {
|
|
2252
2420
|
constructor(repoRoot, commands) {
|
|
2253
2421
|
this.repoRoot = repoRoot;
|
|
@@ -2314,6 +2482,7 @@ var RemoteCommandsProvider = class {
|
|
|
2314
2482
|
for (const fullPath of paths) {
|
|
2315
2483
|
if (fullPath === params.path || fullPath === this.repoRoot) continue;
|
|
2316
2484
|
const name = fullPath.split("/").pop() || "";
|
|
2485
|
+
if (shouldSkip2(name)) continue;
|
|
2317
2486
|
if (regex && !regex.test(name)) continue;
|
|
2318
2487
|
let relativePath = fullPath;
|
|
2319
2488
|
if (fullPath.startsWith(this.repoRoot)) {
|