@morphllm/morphsdk 0.2.68 → 0.2.70
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-6RFT7K7F.js → chunk-26QXQFLZ.js} +88 -23
- package/dist/chunk-26QXQFLZ.js.map +1 -0
- package/dist/{chunk-RTDKF6NS.js → chunk-5QIWYEHJ.js} +2 -2
- package/dist/{chunk-BYNVJ4ON.js → chunk-7CJPKJEE.js} +2 -2
- package/dist/{chunk-SXE54MIC.js → chunk-AB27WETH.js} +8 -8
- package/dist/chunk-B5A4XLSQ.js +10 -0
- package/dist/chunk-B5A4XLSQ.js.map +1 -0
- package/dist/{chunk-VDJGZIQ5.js → chunk-BGSHC2UK.js} +2 -2
- package/dist/{chunk-VLZEBK7S.js → chunk-E4434A4Y.js} +3 -3
- package/dist/{chunk-QEGH3CWQ.js → chunk-GZP6HY5W.js} +4 -20
- package/dist/{chunk-QEGH3CWQ.js.map → chunk-GZP6HY5W.js.map} +1 -1
- package/dist/{chunk-JPGX6WEV.js → chunk-I2GXV3BQ.js} +3 -16
- package/dist/{chunk-JPGX6WEV.js.map → chunk-I2GXV3BQ.js.map} +1 -1
- package/dist/{chunk-W76ICQKY.js → chunk-IUG2FHNN.js} +2 -2
- package/dist/{chunk-K3EHH3C4.js → chunk-PT3DGIUF.js} +3 -15
- package/dist/{chunk-K3EHH3C4.js.map → chunk-PT3DGIUF.js.map} +1 -1
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/{chunk-223ZMZP6.js → chunk-QIG7YPFW.js} +89 -30
- package/dist/chunk-QIG7YPFW.js.map +1 -0
- package/dist/{chunk-HBWJLKNM.js → chunk-QZNGKOCZ.js} +2 -2
- package/dist/{chunk-AAIUUX4Y.js → chunk-X4WPMVCM.js} +2 -2
- package/dist/client.cjs +174 -434
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +11 -12
- package/dist/git/client.js +1 -1
- package/dist/git/config.js +1 -1
- package/dist/git/index.js +1 -1
- package/dist/index.cjs +179 -446
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -14
- package/dist/modelrouter/core.js +1 -1
- package/dist/modelrouter/index.js +1 -1
- package/dist/tools/browser/anthropic.js +2 -2
- package/dist/tools/browser/core.js +1 -1
- package/dist/tools/browser/index.js +4 -4
- package/dist/tools/browser/live.js +1 -1
- package/dist/tools/browser/openai.js +2 -2
- package/dist/tools/browser/prompts.js +1 -1
- package/dist/tools/browser/vercel.js +2 -2
- package/dist/tools/codebase_search/anthropic.js +1 -1
- package/dist/tools/codebase_search/core.js +1 -1
- package/dist/tools/codebase_search/index.js +1 -1
- package/dist/tools/codebase_search/openai.js +1 -1
- package/dist/tools/codebase_search/prompts.js +1 -1
- package/dist/tools/codebase_search/vercel.js +1 -1
- package/dist/tools/fastapply/anthropic.js +2 -2
- package/dist/tools/fastapply/core.js +1 -1
- package/dist/tools/fastapply/index.js +4 -4
- package/dist/tools/fastapply/openai.js +2 -2
- package/dist/tools/fastapply/prompts.js +1 -1
- package/dist/tools/fastapply/vercel.js +2 -2
- package/dist/tools/index.js +4 -4
- package/dist/tools/utils/resilience.js +1 -1
- package/dist/tools/warp_grep/agent/config.js +1 -1
- package/dist/tools/warp_grep/agent/formatter.js +1 -1
- package/dist/tools/warp_grep/agent/parser.js +1 -1
- package/dist/tools/warp_grep/agent/prompt.js +1 -1
- package/dist/tools/warp_grep/agent/runner.js +1 -1
- package/dist/tools/warp_grep/anthropic.cjs +174 -434
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.d.ts +78 -3
- package/dist/tools/warp_grep/anthropic.js +5 -6
- package/dist/tools/warp_grep/client.cjs +174 -434
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +4 -5
- package/dist/tools/warp_grep/gemini.cjs +176 -437
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.d.ts +109 -3
- package/dist/tools/warp_grep/gemini.js +48 -12
- package/dist/tools/warp_grep/gemini.js.map +1 -1
- package/dist/tools/warp_grep/harness.cjs +88 -417
- package/dist/tools/warp_grep/harness.cjs.map +1 -1
- package/dist/tools/warp_grep/harness.js +2 -3
- package/dist/tools/warp_grep/harness.js.map +1 -1
- package/dist/tools/warp_grep/index.cjs +180 -621
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.d.ts +89 -9
- package/dist/tools/warp_grep/index.js +7 -21
- package/dist/tools/warp_grep/openai.cjs +174 -434
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.d.ts +78 -3
- package/dist/tools/warp_grep/openai.js +5 -6
- package/dist/tools/warp_grep/providers/local.cjs +88 -417
- package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/local.d.ts +0 -6
- package/dist/tools/warp_grep/providers/local.js +2 -3
- package/dist/tools/warp_grep/providers/remote.cjs +86 -408
- package/dist/tools/warp_grep/providers/remote.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/remote.d.ts +0 -7
- package/dist/tools/warp_grep/providers/remote.js +2 -3
- package/dist/tools/warp_grep/utils/files.js +1 -1
- package/dist/tools/warp_grep/utils/paths.js +1 -1
- package/dist/tools/warp_grep/utils/ripgrep.js +1 -1
- package/dist/tools/warp_grep/vercel.cjs +174 -434
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.d.ts +56 -3
- package/dist/tools/warp_grep/vercel.js +5 -6
- package/package.json +1 -1
- package/dist/anthropic-BC-AMEIN.d.ts +0 -89
- package/dist/chunk-223ZMZP6.js.map +0 -1
- package/dist/chunk-6RFT7K7F.js.map +0 -1
- package/dist/chunk-FURFQDXF.js +0 -75
- package/dist/chunk-FURFQDXF.js.map +0 -1
- package/dist/chunk-HKJ2B2AA.js +0 -15
- package/dist/chunk-ISWL67SF.js +0 -1
- package/dist/chunk-ISWL67SF.js.map +0 -1
- package/dist/chunk-S6KU22MU.js +0 -396
- package/dist/chunk-S6KU22MU.js.map +0 -1
- package/dist/gemini-BIFBiIjY.d.ts +0 -119
- package/dist/openai-Beb9escY.d.ts +0 -89
- package/dist/vercel-Bo84tpBe.d.ts +0 -66
- /package/dist/{chunk-RTDKF6NS.js.map → chunk-5QIWYEHJ.js.map} +0 -0
- /package/dist/{chunk-BYNVJ4ON.js.map → chunk-7CJPKJEE.js.map} +0 -0
- /package/dist/{chunk-SXE54MIC.js.map → chunk-AB27WETH.js.map} +0 -0
- /package/dist/{chunk-VDJGZIQ5.js.map → chunk-BGSHC2UK.js.map} +0 -0
- /package/dist/{chunk-VLZEBK7S.js.map → chunk-E4434A4Y.js.map} +0 -0
- /package/dist/{chunk-W76ICQKY.js.map → chunk-IUG2FHNN.js.map} +0 -0
- /package/dist/{chunk-HKJ2B2AA.js.map → chunk-PZ5AY32C.js.map} +0 -0
- /package/dist/{chunk-HBWJLKNM.js.map → chunk-QZNGKOCZ.js.map} +0 -0
- /package/dist/{chunk-AAIUUX4Y.js.map → chunk-X4WPMVCM.js.map} +0 -0
|
@@ -3,9 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
7
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
8
|
-
};
|
|
9
6
|
var __export = (target, all) => {
|
|
10
7
|
for (var name in all)
|
|
11
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -20,394 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
20
17
|
};
|
|
21
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
19
|
|
|
23
|
-
// node_modules/ignore/index.js
|
|
24
|
-
var require_ignore = __commonJS({
|
|
25
|
-
"node_modules/ignore/index.js"(exports2, module2) {
|
|
26
|
-
"use strict";
|
|
27
|
-
function makeArray(subject) {
|
|
28
|
-
return Array.isArray(subject) ? subject : [subject];
|
|
29
|
-
}
|
|
30
|
-
var EMPTY = "";
|
|
31
|
-
var SPACE = " ";
|
|
32
|
-
var ESCAPE = "\\";
|
|
33
|
-
var REGEX_TEST_BLANK_LINE = /^\s+$/;
|
|
34
|
-
var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
|
|
35
|
-
var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
|
|
36
|
-
var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
|
|
37
|
-
var REGEX_SPLITALL_CRLF = /\r?\n/g;
|
|
38
|
-
var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
|
|
39
|
-
var SLASH = "/";
|
|
40
|
-
var TMP_KEY_IGNORE = "node-ignore";
|
|
41
|
-
if (typeof Symbol !== "undefined") {
|
|
42
|
-
TMP_KEY_IGNORE = Symbol.for("node-ignore");
|
|
43
|
-
}
|
|
44
|
-
var KEY_IGNORE = TMP_KEY_IGNORE;
|
|
45
|
-
var define = (object, key, value) => Object.defineProperty(object, key, { value });
|
|
46
|
-
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
|
|
47
|
-
var RETURN_FALSE = () => false;
|
|
48
|
-
var sanitizeRange = (range) => range.replace(
|
|
49
|
-
REGEX_REGEXP_RANGE,
|
|
50
|
-
(match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY
|
|
51
|
-
);
|
|
52
|
-
var cleanRangeBackSlash = (slashes) => {
|
|
53
|
-
const { length } = slashes;
|
|
54
|
-
return slashes.slice(0, length - length % 2);
|
|
55
|
-
};
|
|
56
|
-
var REPLACERS = [
|
|
57
|
-
[
|
|
58
|
-
// remove BOM
|
|
59
|
-
// TODO:
|
|
60
|
-
// Other similar zero-width characters?
|
|
61
|
-
/^\uFEFF/,
|
|
62
|
-
() => EMPTY
|
|
63
|
-
],
|
|
64
|
-
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
|
|
65
|
-
[
|
|
66
|
-
// (a\ ) -> (a )
|
|
67
|
-
// (a ) -> (a)
|
|
68
|
-
// (a ) -> (a)
|
|
69
|
-
// (a \ ) -> (a )
|
|
70
|
-
/((?:\\\\)*?)(\\?\s+)$/,
|
|
71
|
-
(_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY)
|
|
72
|
-
],
|
|
73
|
-
// replace (\ ) with ' '
|
|
74
|
-
// (\ ) -> ' '
|
|
75
|
-
// (\\ ) -> '\\ '
|
|
76
|
-
// (\\\ ) -> '\\ '
|
|
77
|
-
[
|
|
78
|
-
/(\\+?)\s/g,
|
|
79
|
-
(_, m1) => {
|
|
80
|
-
const { length } = m1;
|
|
81
|
-
return m1.slice(0, length - length % 2) + SPACE;
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
|
-
// Escape metacharacters
|
|
85
|
-
// which is written down by users but means special for regular expressions.
|
|
86
|
-
// > There are 12 characters with special meanings:
|
|
87
|
-
// > - the backslash \,
|
|
88
|
-
// > - the caret ^,
|
|
89
|
-
// > - the dollar sign $,
|
|
90
|
-
// > - the period or dot .,
|
|
91
|
-
// > - the vertical bar or pipe symbol |,
|
|
92
|
-
// > - the question mark ?,
|
|
93
|
-
// > - the asterisk or star *,
|
|
94
|
-
// > - the plus sign +,
|
|
95
|
-
// > - the opening parenthesis (,
|
|
96
|
-
// > - the closing parenthesis ),
|
|
97
|
-
// > - and the opening square bracket [,
|
|
98
|
-
// > - the opening curly brace {,
|
|
99
|
-
// > These special characters are often called "metacharacters".
|
|
100
|
-
[
|
|
101
|
-
/[\\$.|*+(){^]/g,
|
|
102
|
-
(match) => `\\${match}`
|
|
103
|
-
],
|
|
104
|
-
[
|
|
105
|
-
// > a question mark (?) matches a single character
|
|
106
|
-
/(?!\\)\?/g,
|
|
107
|
-
() => "[^/]"
|
|
108
|
-
],
|
|
109
|
-
// leading slash
|
|
110
|
-
[
|
|
111
|
-
// > A leading slash matches the beginning of the pathname.
|
|
112
|
-
// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
|
|
113
|
-
// A leading slash matches the beginning of the pathname
|
|
114
|
-
/^\//,
|
|
115
|
-
() => "^"
|
|
116
|
-
],
|
|
117
|
-
// replace special metacharacter slash after the leading slash
|
|
118
|
-
[
|
|
119
|
-
/\//g,
|
|
120
|
-
() => "\\/"
|
|
121
|
-
],
|
|
122
|
-
[
|
|
123
|
-
// > A leading "**" followed by a slash means match in all directories.
|
|
124
|
-
// > For example, "**/foo" matches file or directory "foo" anywhere,
|
|
125
|
-
// > the same as pattern "foo".
|
|
126
|
-
// > "**/foo/bar" matches file or directory "bar" anywhere that is directly
|
|
127
|
-
// > under directory "foo".
|
|
128
|
-
// Notice that the '*'s have been replaced as '\\*'
|
|
129
|
-
/^\^*\\\*\\\*\\\//,
|
|
130
|
-
// '**/foo' <-> 'foo'
|
|
131
|
-
() => "^(?:.*\\/)?"
|
|
132
|
-
],
|
|
133
|
-
// starting
|
|
134
|
-
[
|
|
135
|
-
// there will be no leading '/'
|
|
136
|
-
// (which has been replaced by section "leading slash")
|
|
137
|
-
// If starts with '**', adding a '^' to the regular expression also works
|
|
138
|
-
/^(?=[^^])/,
|
|
139
|
-
function startingReplacer() {
|
|
140
|
-
return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
|
|
141
|
-
}
|
|
142
|
-
],
|
|
143
|
-
// two globstars
|
|
144
|
-
[
|
|
145
|
-
// Use lookahead assertions so that we could match more than one `'/**'`
|
|
146
|
-
/\\\/\\\*\\\*(?=\\\/|$)/g,
|
|
147
|
-
// Zero, one or several directories
|
|
148
|
-
// should not use '*', or it will be replaced by the next replacer
|
|
149
|
-
// Check if it is not the last `'/**'`
|
|
150
|
-
(_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
|
|
151
|
-
],
|
|
152
|
-
// normal intermediate wildcards
|
|
153
|
-
[
|
|
154
|
-
// Never replace escaped '*'
|
|
155
|
-
// ignore rule '\*' will match the path '*'
|
|
156
|
-
// 'abc.*/' -> go
|
|
157
|
-
// 'abc.*' -> skip this rule,
|
|
158
|
-
// coz trailing single wildcard will be handed by [trailing wildcard]
|
|
159
|
-
/(^|[^\\]+)(\\\*)+(?=.+)/g,
|
|
160
|
-
// '*.js' matches '.js'
|
|
161
|
-
// '*.js' doesn't match 'abc'
|
|
162
|
-
(_, p1, p2) => {
|
|
163
|
-
const unescaped = p2.replace(/\\\*/g, "[^\\/]*");
|
|
164
|
-
return p1 + unescaped;
|
|
165
|
-
}
|
|
166
|
-
],
|
|
167
|
-
[
|
|
168
|
-
// unescape, revert step 3 except for back slash
|
|
169
|
-
// For example, if a user escape a '\\*',
|
|
170
|
-
// after step 3, the result will be '\\\\\\*'
|
|
171
|
-
/\\\\\\(?=[$.|*+(){^])/g,
|
|
172
|
-
() => ESCAPE
|
|
173
|
-
],
|
|
174
|
-
[
|
|
175
|
-
// '\\\\' -> '\\'
|
|
176
|
-
/\\\\/g,
|
|
177
|
-
() => ESCAPE
|
|
178
|
-
],
|
|
179
|
-
[
|
|
180
|
-
// > The range notation, e.g. [a-zA-Z],
|
|
181
|
-
// > can be used to match one of the characters in a range.
|
|
182
|
-
// `\` is escaped by step 3
|
|
183
|
-
/(\\)?\[([^\]/]*?)(\\*)($|\])/g,
|
|
184
|
-
(match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"
|
|
185
|
-
],
|
|
186
|
-
// ending
|
|
187
|
-
[
|
|
188
|
-
// 'js' will not match 'js.'
|
|
189
|
-
// 'ab' will not match 'abc'
|
|
190
|
-
/(?:[^*])$/,
|
|
191
|
-
// WTF!
|
|
192
|
-
// https://git-scm.com/docs/gitignore
|
|
193
|
-
// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
|
|
194
|
-
// which re-fixes #24, #38
|
|
195
|
-
// > If there is a separator at the end of the pattern then the pattern
|
|
196
|
-
// > will only match directories, otherwise the pattern can match both
|
|
197
|
-
// > files and directories.
|
|
198
|
-
// 'js*' will not match 'a.js'
|
|
199
|
-
// 'js/' will not match 'a.js'
|
|
200
|
-
// 'js' will match 'a.js' and 'a.js/'
|
|
201
|
-
(match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
|
|
202
|
-
],
|
|
203
|
-
// trailing wildcard
|
|
204
|
-
[
|
|
205
|
-
/(\^|\\\/)?\\\*$/,
|
|
206
|
-
(_, p1) => {
|
|
207
|
-
const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
|
|
208
|
-
return `${prefix}(?=$|\\/$)`;
|
|
209
|
-
}
|
|
210
|
-
]
|
|
211
|
-
];
|
|
212
|
-
var regexCache = /* @__PURE__ */ Object.create(null);
|
|
213
|
-
var makeRegex = (pattern, ignoreCase) => {
|
|
214
|
-
let source = regexCache[pattern];
|
|
215
|
-
if (!source) {
|
|
216
|
-
source = REPLACERS.reduce(
|
|
217
|
-
(prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)),
|
|
218
|
-
pattern
|
|
219
|
-
);
|
|
220
|
-
regexCache[pattern] = source;
|
|
221
|
-
}
|
|
222
|
-
return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
|
|
223
|
-
};
|
|
224
|
-
var isString = (subject) => typeof subject === "string";
|
|
225
|
-
var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
|
|
226
|
-
var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
|
|
227
|
-
var IgnoreRule = class {
|
|
228
|
-
constructor(origin, pattern, negative, regex) {
|
|
229
|
-
this.origin = origin;
|
|
230
|
-
this.pattern = pattern;
|
|
231
|
-
this.negative = negative;
|
|
232
|
-
this.regex = regex;
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
var createRule = (pattern, ignoreCase) => {
|
|
236
|
-
const origin = pattern;
|
|
237
|
-
let negative = false;
|
|
238
|
-
if (pattern.indexOf("!") === 0) {
|
|
239
|
-
negative = true;
|
|
240
|
-
pattern = pattern.substr(1);
|
|
241
|
-
}
|
|
242
|
-
pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
|
|
243
|
-
const regex = makeRegex(pattern, ignoreCase);
|
|
244
|
-
return new IgnoreRule(
|
|
245
|
-
origin,
|
|
246
|
-
pattern,
|
|
247
|
-
negative,
|
|
248
|
-
regex
|
|
249
|
-
);
|
|
250
|
-
};
|
|
251
|
-
var throwError = (message, Ctor) => {
|
|
252
|
-
throw new Ctor(message);
|
|
253
|
-
};
|
|
254
|
-
var checkPath = (path, originalPath, doThrow) => {
|
|
255
|
-
if (!isString(path)) {
|
|
256
|
-
return doThrow(
|
|
257
|
-
`path must be a string, but got \`${originalPath}\``,
|
|
258
|
-
TypeError
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
if (!path) {
|
|
262
|
-
return doThrow(`path must not be empty`, TypeError);
|
|
263
|
-
}
|
|
264
|
-
if (checkPath.isNotRelative(path)) {
|
|
265
|
-
const r = "`path.relative()`d";
|
|
266
|
-
return doThrow(
|
|
267
|
-
`path should be a ${r} string, but got "${originalPath}"`,
|
|
268
|
-
RangeError
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
return true;
|
|
272
|
-
};
|
|
273
|
-
var isNotRelative = (path) => REGEX_TEST_INVALID_PATH.test(path);
|
|
274
|
-
checkPath.isNotRelative = isNotRelative;
|
|
275
|
-
checkPath.convert = (p) => p;
|
|
276
|
-
var Ignore = class {
|
|
277
|
-
constructor({
|
|
278
|
-
ignorecase = true,
|
|
279
|
-
ignoreCase = ignorecase,
|
|
280
|
-
allowRelativePaths = false
|
|
281
|
-
} = {}) {
|
|
282
|
-
define(this, KEY_IGNORE, true);
|
|
283
|
-
this._rules = [];
|
|
284
|
-
this._ignoreCase = ignoreCase;
|
|
285
|
-
this._allowRelativePaths = allowRelativePaths;
|
|
286
|
-
this._initCache();
|
|
287
|
-
}
|
|
288
|
-
_initCache() {
|
|
289
|
-
this._ignoreCache = /* @__PURE__ */ Object.create(null);
|
|
290
|
-
this._testCache = /* @__PURE__ */ Object.create(null);
|
|
291
|
-
}
|
|
292
|
-
_addPattern(pattern) {
|
|
293
|
-
if (pattern && pattern[KEY_IGNORE]) {
|
|
294
|
-
this._rules = this._rules.concat(pattern._rules);
|
|
295
|
-
this._added = true;
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
if (checkPattern(pattern)) {
|
|
299
|
-
const rule = createRule(pattern, this._ignoreCase);
|
|
300
|
-
this._added = true;
|
|
301
|
-
this._rules.push(rule);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
// @param {Array<string> | string | Ignore} pattern
|
|
305
|
-
add(pattern) {
|
|
306
|
-
this._added = false;
|
|
307
|
-
makeArray(
|
|
308
|
-
isString(pattern) ? splitPattern(pattern) : pattern
|
|
309
|
-
).forEach(this._addPattern, this);
|
|
310
|
-
if (this._added) {
|
|
311
|
-
this._initCache();
|
|
312
|
-
}
|
|
313
|
-
return this;
|
|
314
|
-
}
|
|
315
|
-
// legacy
|
|
316
|
-
addPattern(pattern) {
|
|
317
|
-
return this.add(pattern);
|
|
318
|
-
}
|
|
319
|
-
// | ignored : unignored
|
|
320
|
-
// negative | 0:0 | 0:1 | 1:0 | 1:1
|
|
321
|
-
// -------- | ------- | ------- | ------- | --------
|
|
322
|
-
// 0 | TEST | TEST | SKIP | X
|
|
323
|
-
// 1 | TESTIF | SKIP | TEST | X
|
|
324
|
-
// - SKIP: always skip
|
|
325
|
-
// - TEST: always test
|
|
326
|
-
// - TESTIF: only test if checkUnignored
|
|
327
|
-
// - X: that never happen
|
|
328
|
-
// @param {boolean} whether should check if the path is unignored,
|
|
329
|
-
// setting `checkUnignored` to `false` could reduce additional
|
|
330
|
-
// path matching.
|
|
331
|
-
// @returns {TestResult} true if a file is ignored
|
|
332
|
-
_testOne(path, checkUnignored) {
|
|
333
|
-
let ignored = false;
|
|
334
|
-
let unignored = false;
|
|
335
|
-
this._rules.forEach((rule) => {
|
|
336
|
-
const { negative } = rule;
|
|
337
|
-
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
const matched = rule.regex.test(path);
|
|
341
|
-
if (matched) {
|
|
342
|
-
ignored = !negative;
|
|
343
|
-
unignored = negative;
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
return {
|
|
347
|
-
ignored,
|
|
348
|
-
unignored
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
// @returns {TestResult}
|
|
352
|
-
_test(originalPath, cache, checkUnignored, slices) {
|
|
353
|
-
const path = originalPath && checkPath.convert(originalPath);
|
|
354
|
-
checkPath(
|
|
355
|
-
path,
|
|
356
|
-
originalPath,
|
|
357
|
-
this._allowRelativePaths ? RETURN_FALSE : throwError
|
|
358
|
-
);
|
|
359
|
-
return this._t(path, cache, checkUnignored, slices);
|
|
360
|
-
}
|
|
361
|
-
_t(path, cache, checkUnignored, slices) {
|
|
362
|
-
if (path in cache) {
|
|
363
|
-
return cache[path];
|
|
364
|
-
}
|
|
365
|
-
if (!slices) {
|
|
366
|
-
slices = path.split(SLASH);
|
|
367
|
-
}
|
|
368
|
-
slices.pop();
|
|
369
|
-
if (!slices.length) {
|
|
370
|
-
return cache[path] = this._testOne(path, checkUnignored);
|
|
371
|
-
}
|
|
372
|
-
const parent = this._t(
|
|
373
|
-
slices.join(SLASH) + SLASH,
|
|
374
|
-
cache,
|
|
375
|
-
checkUnignored,
|
|
376
|
-
slices
|
|
377
|
-
);
|
|
378
|
-
return cache[path] = parent.ignored ? parent : this._testOne(path, checkUnignored);
|
|
379
|
-
}
|
|
380
|
-
ignores(path) {
|
|
381
|
-
return this._test(path, this._ignoreCache, false).ignored;
|
|
382
|
-
}
|
|
383
|
-
createFilter() {
|
|
384
|
-
return (path) => !this.ignores(path);
|
|
385
|
-
}
|
|
386
|
-
filter(paths) {
|
|
387
|
-
return makeArray(paths).filter(this.createFilter());
|
|
388
|
-
}
|
|
389
|
-
// @returns {TestResult}
|
|
390
|
-
test(path) {
|
|
391
|
-
return this._test(path, this._testCache, true);
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
var factory = (options) => new Ignore(options);
|
|
395
|
-
var isPathValid = (path) => checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
|
|
396
|
-
factory.isPathValid = isPathValid;
|
|
397
|
-
factory.default = factory;
|
|
398
|
-
module2.exports = factory;
|
|
399
|
-
if (
|
|
400
|
-
// Detect `process` so that it can run in browsers.
|
|
401
|
-
typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
|
|
402
|
-
) {
|
|
403
|
-
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
404
|
-
checkPath.convert = makePosix;
|
|
405
|
-
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
406
|
-
checkPath.isNotRelative = (path) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
|
-
|
|
411
20
|
// tools/warp_grep/providers/remote.ts
|
|
412
21
|
var remote_exports = {};
|
|
413
22
|
__export(remote_exports, {
|
|
@@ -507,25 +116,95 @@ var BUILTIN_EXCLUDES = [
|
|
|
507
116
|
var DEFAULT_EXCLUDES = (process.env.MORPH_WARP_GREP_EXCLUDE || "").split(",").map((s) => s.trim()).filter(Boolean).concat(BUILTIN_EXCLUDES);
|
|
508
117
|
|
|
509
118
|
// tools/warp_grep/providers/remote.ts
|
|
510
|
-
var
|
|
119
|
+
var SKIP_NAMES = /* @__PURE__ */ new Set([
|
|
120
|
+
// Version control
|
|
121
|
+
".git",
|
|
122
|
+
".svn",
|
|
123
|
+
".hg",
|
|
124
|
+
".bzr",
|
|
125
|
+
// Dependencies
|
|
126
|
+
"node_modules",
|
|
127
|
+
"bower_components",
|
|
128
|
+
".pnpm",
|
|
129
|
+
".yarn",
|
|
130
|
+
"vendor",
|
|
131
|
+
"Pods",
|
|
132
|
+
".bundle",
|
|
133
|
+
// Python
|
|
134
|
+
"__pycache__",
|
|
135
|
+
".pytest_cache",
|
|
136
|
+
".mypy_cache",
|
|
137
|
+
".ruff_cache",
|
|
138
|
+
".venv",
|
|
139
|
+
"venv",
|
|
140
|
+
".tox",
|
|
141
|
+
".nox",
|
|
142
|
+
".eggs",
|
|
143
|
+
// Build outputs
|
|
144
|
+
"dist",
|
|
145
|
+
"build",
|
|
146
|
+
"out",
|
|
147
|
+
"output",
|
|
148
|
+
"target",
|
|
149
|
+
"_build",
|
|
150
|
+
".next",
|
|
151
|
+
".nuxt",
|
|
152
|
+
".output",
|
|
153
|
+
".vercel",
|
|
154
|
+
".netlify",
|
|
155
|
+
// Cache
|
|
156
|
+
".cache",
|
|
157
|
+
".parcel-cache",
|
|
158
|
+
".turbo",
|
|
159
|
+
".nx",
|
|
160
|
+
".gradle",
|
|
161
|
+
// IDE
|
|
162
|
+
".idea",
|
|
163
|
+
".vscode",
|
|
164
|
+
".vs",
|
|
165
|
+
// Coverage
|
|
166
|
+
"coverage",
|
|
167
|
+
".coverage",
|
|
168
|
+
"htmlcov",
|
|
169
|
+
".nyc_output",
|
|
170
|
+
// Temp
|
|
171
|
+
"tmp",
|
|
172
|
+
"temp",
|
|
173
|
+
".tmp",
|
|
174
|
+
".temp",
|
|
175
|
+
// Lock files
|
|
176
|
+
"package-lock.json",
|
|
177
|
+
"yarn.lock",
|
|
178
|
+
"pnpm-lock.yaml",
|
|
179
|
+
"bun.lockb",
|
|
180
|
+
"Cargo.lock",
|
|
181
|
+
"Gemfile.lock",
|
|
182
|
+
"poetry.lock"
|
|
183
|
+
]);
|
|
184
|
+
var SKIP_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
185
|
+
".min.js",
|
|
186
|
+
".min.css",
|
|
187
|
+
".bundle.js",
|
|
188
|
+
".wasm",
|
|
189
|
+
".so",
|
|
190
|
+
".dll",
|
|
191
|
+
".pyc",
|
|
192
|
+
".map",
|
|
193
|
+
".js.map"
|
|
194
|
+
]);
|
|
195
|
+
function shouldSkip(name) {
|
|
196
|
+
if (SKIP_NAMES.has(name)) return true;
|
|
197
|
+
if (name.startsWith(".")) return true;
|
|
198
|
+
for (const ext of SKIP_EXTENSIONS) {
|
|
199
|
+
if (name.endsWith(ext)) return true;
|
|
200
|
+
}
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
511
203
|
var RemoteCommandsProvider = class {
|
|
512
204
|
constructor(repoRoot, commands) {
|
|
513
205
|
this.repoRoot = repoRoot;
|
|
514
206
|
this.commands = commands;
|
|
515
207
|
}
|
|
516
|
-
ignoreFilter = null;
|
|
517
|
-
/**
|
|
518
|
-
* Build an ignore filter from DEFAULT_EXCLUDES.
|
|
519
|
-
* Note: For remote providers, we can't read .gitignore from the remote sandbox,
|
|
520
|
-
* so we only use the built-in excludes.
|
|
521
|
-
*/
|
|
522
|
-
getIgnoreFilter() {
|
|
523
|
-
if (this.ignoreFilter) return this.ignoreFilter;
|
|
524
|
-
const ig = ignore();
|
|
525
|
-
ig.add(DEFAULT_EXCLUDES);
|
|
526
|
-
this.ignoreFilter = ig;
|
|
527
|
-
return ig;
|
|
528
|
-
}
|
|
529
208
|
/**
|
|
530
209
|
* Run grep command and parse ripgrep output
|
|
531
210
|
*/
|
|
@@ -579,7 +258,6 @@ var RemoteCommandsProvider = class {
|
|
|
579
258
|
async listDirectory(params) {
|
|
580
259
|
const maxDepth = params.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;
|
|
581
260
|
const maxResults = params.maxResults ?? AGENT_CONFIG.MAX_OUTPUT_LINES;
|
|
582
|
-
const ig = this.getIgnoreFilter();
|
|
583
261
|
try {
|
|
584
262
|
const stdout = await this.commands.listDir(params.path, maxDepth);
|
|
585
263
|
const paths = (stdout || "").trim().split(/\r?\n/).filter((p) => p.length > 0);
|
|
@@ -588,12 +266,12 @@ var RemoteCommandsProvider = class {
|
|
|
588
266
|
for (const fullPath of paths) {
|
|
589
267
|
if (fullPath === params.path || fullPath === this.repoRoot) continue;
|
|
590
268
|
const name = fullPath.split("/").pop() || "";
|
|
269
|
+
if (shouldSkip(name)) continue;
|
|
270
|
+
if (regex && !regex.test(name)) continue;
|
|
591
271
|
let relativePath = fullPath;
|
|
592
272
|
if (fullPath.startsWith(this.repoRoot)) {
|
|
593
273
|
relativePath = fullPath.slice(this.repoRoot.length).replace(/^\//, "");
|
|
594
274
|
}
|
|
595
|
-
if (ig.ignores(relativePath)) continue;
|
|
596
|
-
if (regex && !regex.test(name)) continue;
|
|
597
275
|
const depth = relativePath.split("/").filter(Boolean).length - 1;
|
|
598
276
|
const hasExtension = name.includes(".") && !name.startsWith(".");
|
|
599
277
|
const type = hasExtension ? "file" : "dir";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/ignore/index.js","../../../../tools/warp_grep/providers/remote.ts","../../../../tools/warp_grep/agent/config.ts"],"sourcesContent":["// A simple implementation of make-array\nfunction makeArray (subject) {\n return Array.isArray(subject)\n ? subject\n : [subject]\n}\n\nconst EMPTY = ''\nconst SPACE = ' '\nconst ESCAPE = '\\\\'\nconst REGEX_TEST_BLANK_LINE = /^\\s+$/\nconst REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\\\]|^)\\\\$/\nconst REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\\\!/\nconst REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\\\#/\nconst REGEX_SPLITALL_CRLF = /\\r?\\n/g\n// /foo,\n// ./foo,\n// ../foo,\n// .\n// ..\nconst REGEX_TEST_INVALID_PATH = /^\\.*\\/|^\\.+$/\n\nconst SLASH = '/'\n\n// Do not use ternary expression here, since \"istanbul ignore next\" is buggy\nlet TMP_KEY_IGNORE = 'node-ignore'\n/* istanbul ignore else */\nif (typeof Symbol !== 'undefined') {\n TMP_KEY_IGNORE = Symbol.for('node-ignore')\n}\nconst KEY_IGNORE = TMP_KEY_IGNORE\n\nconst define = (object, key, value) =>\n Object.defineProperty(object, key, {value})\n\nconst REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g\n\nconst RETURN_FALSE = () => false\n\n// Sanitize the range of a regular expression\n// The cases are complicated, see test cases for details\nconst sanitizeRange = range => range.replace(\n REGEX_REGEXP_RANGE,\n (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0)\n ? match\n // Invalid range (out of order) which is ok for gitignore rules but\n // fatal for JavaScript regular expression, so eliminate it.\n : EMPTY\n)\n\n// See fixtures #59\nconst cleanRangeBackSlash = slashes => {\n const {length} = slashes\n return slashes.slice(0, length - length % 2)\n}\n\n// > If the pattern ends with a slash,\n// > it is removed for the purpose of the following description,\n// > but it would only find a match with a directory.\n// > In other words, foo/ will match a directory foo and paths underneath it,\n// > but will not match a regular file or a symbolic link foo\n// > (this is consistent with the way how pathspec works in general in Git).\n// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'\n// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call\n// you could use option `mark: true` with `glob`\n\n// '`foo/`' should not continue with the '`..`'\nconst REPLACERS = [\n\n [\n // remove BOM\n // TODO:\n // Other similar zero-width characters?\n /^\\uFEFF/,\n () => EMPTY\n ],\n\n // > Trailing spaces are ignored unless they are quoted with backslash (\"\\\")\n [\n // (a\\ ) -> (a )\n // (a ) -> (a)\n // (a ) -> (a)\n // (a \\ ) -> (a )\n /((?:\\\\\\\\)*?)(\\\\?\\s+)$/,\n (_, m1, m2) => m1 + (\n m2.indexOf('\\\\') === 0\n ? SPACE\n : EMPTY\n )\n ],\n\n // replace (\\ ) with ' '\n // (\\ ) -> ' '\n // (\\\\ ) -> '\\\\ '\n // (\\\\\\ ) -> '\\\\ '\n [\n /(\\\\+?)\\s/g,\n (_, m1) => {\n const {length} = m1\n return m1.slice(0, length - length % 2) + SPACE\n }\n ],\n\n // Escape metacharacters\n // which is written down by users but means special for regular expressions.\n\n // > There are 12 characters with special meanings:\n // > - the backslash \\,\n // > - the caret ^,\n // > - the dollar sign $,\n // > - the period or dot .,\n // > - the vertical bar or pipe symbol |,\n // > - the question mark ?,\n // > - the asterisk or star *,\n // > - the plus sign +,\n // > - the opening parenthesis (,\n // > - the closing parenthesis ),\n // > - and the opening square bracket [,\n // > - the opening curly brace {,\n // > These special characters are often called \"metacharacters\".\n [\n /[\\\\$.|*+(){^]/g,\n match => `\\\\${match}`\n ],\n\n [\n // > a question mark (?) matches a single character\n /(?!\\\\)\\?/g,\n () => '[^/]'\n ],\n\n // leading slash\n [\n\n // > A leading slash matches the beginning of the pathname.\n // > For example, \"/*.c\" matches \"cat-file.c\" but not \"mozilla-sha1/sha1.c\".\n // A leading slash matches the beginning of the pathname\n /^\\//,\n () => '^'\n ],\n\n // replace special metacharacter slash after the leading slash\n [\n /\\//g,\n () => '\\\\/'\n ],\n\n [\n // > A leading \"**\" followed by a slash means match in all directories.\n // > For example, \"**/foo\" matches file or directory \"foo\" anywhere,\n // > the same as pattern \"foo\".\n // > \"**/foo/bar\" matches file or directory \"bar\" anywhere that is directly\n // > under directory \"foo\".\n // Notice that the '*'s have been replaced as '\\\\*'\n /^\\^*\\\\\\*\\\\\\*\\\\\\//,\n\n // '**/foo' <-> 'foo'\n () => '^(?:.*\\\\/)?'\n ],\n\n // starting\n [\n // there will be no leading '/'\n // (which has been replaced by section \"leading slash\")\n // If starts with '**', adding a '^' to the regular expression also works\n /^(?=[^^])/,\n function startingReplacer () {\n // If has a slash `/` at the beginning or middle\n return !/\\/(?!$)/.test(this)\n // > Prior to 2.22.1\n // > If the pattern does not contain a slash /,\n // > Git treats it as a shell glob pattern\n // Actually, if there is only a trailing slash,\n // git also treats it as a shell glob pattern\n\n // After 2.22.1 (compatible but clearer)\n // > If there is a separator at the beginning or middle (or both)\n // > of the pattern, then the pattern is relative to the directory\n // > level of the particular .gitignore file itself.\n // > Otherwise the pattern may also match at any level below\n // > the .gitignore level.\n ? '(?:^|\\\\/)'\n\n // > Otherwise, Git treats the pattern as a shell glob suitable for\n // > consumption by fnmatch(3)\n : '^'\n }\n ],\n\n // two globstars\n [\n // Use lookahead assertions so that we could match more than one `'/**'`\n /\\\\\\/\\\\\\*\\\\\\*(?=\\\\\\/|$)/g,\n\n // Zero, one or several directories\n // should not use '*', or it will be replaced by the next replacer\n\n // Check if it is not the last `'/**'`\n (_, index, str) => index + 6 < str.length\n\n // case: /**/\n // > A slash followed by two consecutive asterisks then a slash matches\n // > zero or more directories.\n // > For example, \"a/**/b\" matches \"a/b\", \"a/x/b\", \"a/x/y/b\" and so on.\n // '/**/'\n ? '(?:\\\\/[^\\\\/]+)*'\n\n // case: /**\n // > A trailing `\"/**\"` matches everything inside.\n\n // #21: everything inside but it should not include the current folder\n : '\\\\/.+'\n ],\n\n // normal intermediate wildcards\n [\n // Never replace escaped '*'\n // ignore rule '\\*' will match the path '*'\n\n // 'abc.*/' -> go\n // 'abc.*' -> skip this rule,\n // coz trailing single wildcard will be handed by [trailing wildcard]\n /(^|[^\\\\]+)(\\\\\\*)+(?=.+)/g,\n\n // '*.js' matches '.js'\n // '*.js' doesn't match 'abc'\n (_, p1, p2) => {\n // 1.\n // > An asterisk \"*\" matches anything except a slash.\n // 2.\n // > Other consecutive asterisks are considered regular asterisks\n // > and will match according to the previous rules.\n const unescaped = p2.replace(/\\\\\\*/g, '[^\\\\/]*')\n return p1 + unescaped\n }\n ],\n\n [\n // unescape, revert step 3 except for back slash\n // For example, if a user escape a '\\\\*',\n // after step 3, the result will be '\\\\\\\\\\\\*'\n /\\\\\\\\\\\\(?=[$.|*+(){^])/g,\n () => ESCAPE\n ],\n\n [\n // '\\\\\\\\' -> '\\\\'\n /\\\\\\\\/g,\n () => ESCAPE\n ],\n\n [\n // > The range notation, e.g. [a-zA-Z],\n // > can be used to match one of the characters in a range.\n\n // `\\` is escaped by step 3\n /(\\\\)?\\[([^\\]/]*?)(\\\\*)($|\\])/g,\n (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE\n // '\\\\[bar]' -> '\\\\\\\\[bar\\\\]'\n ? `\\\\[${range}${cleanRangeBackSlash(endEscape)}${close}`\n : close === ']'\n ? endEscape.length % 2 === 0\n // A normal case, and it is a range notation\n // '[bar]'\n // '[bar\\\\\\\\]'\n ? `[${sanitizeRange(range)}${endEscape}]`\n // Invalid range notaton\n // '[bar\\\\]' -> '[bar\\\\\\\\]'\n : '[]'\n : '[]'\n ],\n\n // ending\n [\n // 'js' will not match 'js.'\n // 'ab' will not match 'abc'\n /(?:[^*])$/,\n\n // WTF!\n // https://git-scm.com/docs/gitignore\n // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)\n // which re-fixes #24, #38\n\n // > If there is a separator at the end of the pattern then the pattern\n // > will only match directories, otherwise the pattern can match both\n // > files and directories.\n\n // 'js*' will not match 'a.js'\n // 'js/' will not match 'a.js'\n // 'js' will match 'a.js' and 'a.js/'\n match => /\\/$/.test(match)\n // foo/ will not match 'foo'\n ? `${match}$`\n // foo matches 'foo' and 'foo/'\n : `${match}(?=$|\\\\/$)`\n ],\n\n // trailing wildcard\n [\n /(\\^|\\\\\\/)?\\\\\\*$/,\n (_, p1) => {\n const prefix = p1\n // '\\^':\n // '/*' does not match EMPTY\n // '/*' does not match everything\n\n // '\\\\\\/':\n // 'abc/*' does not match 'abc/'\n ? `${p1}[^/]+`\n\n // 'a*' matches 'a'\n // 'a*' matches 'aa'\n : '[^/]*'\n\n return `${prefix}(?=$|\\\\/$)`\n }\n ],\n]\n\n// A simple cache, because an ignore rule only has only one certain meaning\nconst regexCache = Object.create(null)\n\n// @param {pattern}\nconst makeRegex = (pattern, ignoreCase) => {\n let source = regexCache[pattern]\n\n if (!source) {\n source = REPLACERS.reduce(\n (prev, [matcher, replacer]) =>\n prev.replace(matcher, replacer.bind(pattern)),\n pattern\n )\n regexCache[pattern] = source\n }\n\n return ignoreCase\n ? new RegExp(source, 'i')\n : new RegExp(source)\n}\n\nconst isString = subject => typeof subject === 'string'\n\n// > A blank line matches no files, so it can serve as a separator for readability.\nconst checkPattern = pattern => pattern\n && isString(pattern)\n && !REGEX_TEST_BLANK_LINE.test(pattern)\n && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)\n\n // > A line starting with # serves as a comment.\n && pattern.indexOf('#') !== 0\n\nconst splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF)\n\nclass IgnoreRule {\n constructor (\n origin,\n pattern,\n negative,\n regex\n ) {\n this.origin = origin\n this.pattern = pattern\n this.negative = negative\n this.regex = regex\n }\n}\n\nconst createRule = (pattern, ignoreCase) => {\n const origin = pattern\n let negative = false\n\n // > An optional prefix \"!\" which negates the pattern;\n if (pattern.indexOf('!') === 0) {\n negative = true\n pattern = pattern.substr(1)\n }\n\n pattern = pattern\n // > Put a backslash (\"\\\") in front of the first \"!\" for patterns that\n // > begin with a literal \"!\", for example, `\"\\!important!.txt\"`.\n .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')\n // > Put a backslash (\"\\\") in front of the first hash for patterns that\n // > begin with a hash.\n .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#')\n\n const regex = makeRegex(pattern, ignoreCase)\n\n return new IgnoreRule(\n origin,\n pattern,\n negative,\n regex\n )\n}\n\nconst throwError = (message, Ctor) => {\n throw new Ctor(message)\n}\n\nconst checkPath = (path, originalPath, doThrow) => {\n if (!isString(path)) {\n return doThrow(\n `path must be a string, but got \\`${originalPath}\\``,\n TypeError\n )\n }\n\n // We don't know if we should ignore EMPTY, so throw\n if (!path) {\n return doThrow(`path must not be empty`, TypeError)\n }\n\n // Check if it is a relative path\n if (checkPath.isNotRelative(path)) {\n const r = '`path.relative()`d'\n return doThrow(\n `path should be a ${r} string, but got \"${originalPath}\"`,\n RangeError\n )\n }\n\n return true\n}\n\nconst isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path)\n\ncheckPath.isNotRelative = isNotRelative\ncheckPath.convert = p => p\n\nclass Ignore {\n constructor ({\n ignorecase = true,\n ignoreCase = ignorecase,\n allowRelativePaths = false\n } = {}) {\n define(this, KEY_IGNORE, true)\n\n this._rules = []\n this._ignoreCase = ignoreCase\n this._allowRelativePaths = allowRelativePaths\n this._initCache()\n }\n\n _initCache () {\n this._ignoreCache = Object.create(null)\n this._testCache = Object.create(null)\n }\n\n _addPattern (pattern) {\n // #32\n if (pattern && pattern[KEY_IGNORE]) {\n this._rules = this._rules.concat(pattern._rules)\n this._added = true\n return\n }\n\n if (checkPattern(pattern)) {\n const rule = createRule(pattern, this._ignoreCase)\n this._added = true\n this._rules.push(rule)\n }\n }\n\n // @param {Array<string> | string | Ignore} pattern\n add (pattern) {\n this._added = false\n\n makeArray(\n isString(pattern)\n ? splitPattern(pattern)\n : pattern\n ).forEach(this._addPattern, this)\n\n // Some rules have just added to the ignore,\n // making the behavior changed.\n if (this._added) {\n this._initCache()\n }\n\n return this\n }\n\n // legacy\n addPattern (pattern) {\n return this.add(pattern)\n }\n\n // | ignored : unignored\n // negative | 0:0 | 0:1 | 1:0 | 1:1\n // -------- | ------- | ------- | ------- | --------\n // 0 | TEST | TEST | SKIP | X\n // 1 | TESTIF | SKIP | TEST | X\n\n // - SKIP: always skip\n // - TEST: always test\n // - TESTIF: only test if checkUnignored\n // - X: that never happen\n\n // @param {boolean} whether should check if the path is unignored,\n // setting `checkUnignored` to `false` could reduce additional\n // path matching.\n\n // @returns {TestResult} true if a file is ignored\n _testOne (path, checkUnignored) {\n let ignored = false\n let unignored = false\n\n this._rules.forEach(rule => {\n const {negative} = rule\n if (\n unignored === negative && ignored !== unignored\n || negative && !ignored && !unignored && !checkUnignored\n ) {\n return\n }\n\n const matched = rule.regex.test(path)\n\n if (matched) {\n ignored = !negative\n unignored = negative\n }\n })\n\n return {\n ignored,\n unignored\n }\n }\n\n // @returns {TestResult}\n _test (originalPath, cache, checkUnignored, slices) {\n const path = originalPath\n // Supports nullable path\n && checkPath.convert(originalPath)\n\n checkPath(\n path,\n originalPath,\n this._allowRelativePaths\n ? RETURN_FALSE\n : throwError\n )\n\n return this._t(path, cache, checkUnignored, slices)\n }\n\n _t (path, cache, checkUnignored, slices) {\n if (path in cache) {\n return cache[path]\n }\n\n if (!slices) {\n // path/to/a.js\n // ['path', 'to', 'a.js']\n slices = path.split(SLASH)\n }\n\n slices.pop()\n\n // If the path has no parent directory, just test it\n if (!slices.length) {\n return cache[path] = this._testOne(path, checkUnignored)\n }\n\n const parent = this._t(\n slices.join(SLASH) + SLASH,\n cache,\n checkUnignored,\n slices\n )\n\n // If the path contains a parent directory, check the parent first\n return cache[path] = parent.ignored\n // > It is not possible to re-include a file if a parent directory of\n // > that file is excluded.\n ? parent\n : this._testOne(path, checkUnignored)\n }\n\n ignores (path) {\n return this._test(path, this._ignoreCache, false).ignored\n }\n\n createFilter () {\n return path => !this.ignores(path)\n }\n\n filter (paths) {\n return makeArray(paths).filter(this.createFilter())\n }\n\n // @returns {TestResult}\n test (path) {\n return this._test(path, this._testCache, true)\n }\n}\n\nconst factory = options => new Ignore(options)\n\nconst isPathValid = path =>\n checkPath(path && checkPath.convert(path), path, RETURN_FALSE)\n\nfactory.isPathValid = isPathValid\n\n// Fixes typescript\nfactory.default = factory\n\nmodule.exports = factory\n\n// Windows\n// --------------------------------------------------------------\n/* istanbul ignore if */\nif (\n // Detect `process` so that it can run in browsers.\n typeof process !== 'undefined'\n && (\n process.env && process.env.IGNORE_TEST_WIN32\n || process.platform === 'win32'\n )\n) {\n /* eslint no-control-regex: \"off\" */\n const makePosix = str => /^\\\\\\\\\\?\\\\/.test(str)\n || /[\"<>|\\u0000-\\u001F]+/u.test(str)\n ? str\n : str.replace(/\\\\/g, '/')\n\n checkPath.convert = makePosix\n\n // 'C:\\\\foo' <- 'C:\\\\foo' has been converted to 'C:/'\n // 'd:\\\\foo'\n const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\\//i\n checkPath.isNotRelative = path =>\n REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path)\n || isNotRelative(path)\n}\n","/**\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, DEFAULT_EXCLUDES } from '../agent/config.js';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst ignore = require('ignore').default || require('ignore');\ntype Ignore = ReturnType<typeof ignore>;\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 private ignoreFilter: Ignore | null = null;\n\n constructor(\n private readonly repoRoot: string,\n private readonly commands: RemoteCommands\n ) {}\n\n /**\n * Build an ignore filter from DEFAULT_EXCLUDES.\n * Note: For remote providers, we can't read .gitignore from the remote sandbox,\n * so we only use the built-in excludes.\n */\n private getIgnoreFilter(): Ignore {\n if (this.ignoreFilter) return this.ignoreFilter;\n const ig = ignore();\n ig.add(DEFAULT_EXCLUDES);\n this.ignoreFilter = ig;\n return ig;\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 // Get the ignore filter (DEFAULT_EXCLUDES)\n const ig = this.getIgnoreFilter();\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 // Determine relative path\n let relativePath = fullPath;\n if (fullPath.startsWith(this.repoRoot)) {\n relativePath = fullPath.slice(this.repoRoot.length).replace(/^\\//, '');\n }\n \n // Filter using ignore rules (DEFAULT_EXCLUDES)\n if (ig.ignores(relativePath)) continue;\n \n // Apply pattern filter if provided\n if (regex && !regex.test(name)) continue;\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","export const AGENT_CONFIG = {\n MAX_TURNS: 4,\n TIMEOUT_MS: 30_000,\n MAX_CONTEXT_CHARS: 540_000,\n MAX_OUTPUT_LINES: 200,\n MAX_READ_LINES: 800,\n MAX_LIST_DEPTH: 3,\n LIST_TIMEOUT_MS: 2_000,\n};\n\n/**\n * Comprehensive exclusion list for directories and files\n * These patterns are used with ripgrep's -g flag\n */\nconst BUILTIN_EXCLUDES = [\n // Version control\n '.git', '.svn', '.hg', '.bzr',\n \n // Dependencies\n 'node_modules', 'bower_components', '.pnpm', '.yarn',\n 'vendor', 'packages', 'Pods', '.bundle',\n \n // Python\n '__pycache__', '.pytest_cache', '.mypy_cache', '.ruff_cache',\n '.venv', 'venv', '.tox', '.nox', '.eggs', '*.egg-info',\n \n // Build outputs\n 'dist', 'build', 'out', 'output', 'target', '_build',\n '.next', '.nuxt', '.output', '.vercel', '.netlify',\n \n // Cache directories\n '.cache', '.parcel-cache', '.turbo', '.nx', '.gradle',\n \n // IDE/Editor\n '.idea', '.vscode', '.vs',\n \n // Coverage\n 'coverage', '.coverage', 'htmlcov', '.nyc_output',\n \n // Temporary\n 'tmp', 'temp', '.tmp', '.temp',\n \n // Lock files\n 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb',\n 'Cargo.lock', 'Gemfile.lock', 'poetry.lock',\n \n // Binary/minified\n '*.min.js', '*.min.css', '*.bundle.js',\n '*.wasm', '*.so', '*.dll', '*.pyc',\n '*.map', '*.js.map',\n \n // Hidden directories catch-all\n '.*',\n];\n\nexport const DEFAULT_EXCLUDES = (process.env.MORPH_WARP_GREP_EXCLUDE || '')\n .split(',')\n .map(s => s.trim())\n .filter(Boolean)\n .concat(BUILTIN_EXCLUDES);\n\nexport const DEFAULT_MODEL = 'morph-warp-grep-v1';\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,iCAAAA,UAAAC,SAAA;AAAA;AACA,aAAS,UAAW,SAAS;AAC3B,aAAO,MAAM,QAAQ,OAAO,IACxB,UACA,CAAC,OAAO;AAAA,IACd;AAEA,QAAM,QAAQ;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AG;AAG9B,YAAI,SAAS,CAAC,MAAM,KAAK,IAAI,EAAG;AAGhC,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":["exports","module"]}
|
|
1
|
+
{"version":3,"sources":["../../../../tools/warp_grep/providers/remote.ts","../../../../tools/warp_grep/agent/config.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","export const AGENT_CONFIG = {\n MAX_TURNS: 4,\n TIMEOUT_MS: 30_000,\n MAX_CONTEXT_CHARS: 540_000,\n MAX_OUTPUT_LINES: 200,\n MAX_READ_LINES: 800,\n MAX_LIST_DEPTH: 3,\n LIST_TIMEOUT_MS: 2_000,\n};\n\n/**\n * Comprehensive exclusion list for directories and files\n * These patterns are used with ripgrep's -g flag\n */\nconst BUILTIN_EXCLUDES = [\n // Version control\n '.git', '.svn', '.hg', '.bzr',\n \n // Dependencies\n 'node_modules', 'bower_components', '.pnpm', '.yarn',\n 'vendor', 'packages', 'Pods', '.bundle',\n \n // Python\n '__pycache__', '.pytest_cache', '.mypy_cache', '.ruff_cache',\n '.venv', 'venv', '.tox', '.nox', '.eggs', '*.egg-info',\n \n // Build outputs\n 'dist', 'build', 'out', 'output', 'target', '_build',\n '.next', '.nuxt', '.output', '.vercel', '.netlify',\n \n // Cache directories\n '.cache', '.parcel-cache', '.turbo', '.nx', '.gradle',\n \n // IDE/Editor\n '.idea', '.vscode', '.vs',\n \n // Coverage\n 'coverage', '.coverage', 'htmlcov', '.nyc_output',\n \n // Temporary\n 'tmp', 'temp', '.tmp', '.temp',\n \n // Lock files\n 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb',\n 'Cargo.lock', 'Gemfile.lock', 'poetry.lock',\n \n // Binary/minified\n '*.min.js', '*.min.css', '*.bundle.js',\n '*.wasm', '*.so', '*.dll', '*.pyc',\n '*.map', '*.js.map',\n \n // Hidden directories catch-all\n '.*',\n];\n\nexport const DEFAULT_EXCLUDES = (process.env.MORPH_WARP_GREP_EXCLUDE || '')\n .split(',')\n .map(s => s.trim())\n .filter(Boolean)\n .concat(BUILTIN_EXCLUDES);\n\nexport const DEFAULT_MODEL = 'morph-warp-grep-v1';\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,eAAe;AAAA,EAC1B,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,iBAAiB;AACnB;AAMA,IAAM,mBAAmB;AAAA;AAAA,EAEvB;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAO;AAAA;AAAA,EAGvB;AAAA,EAAgB;AAAA,EAAoB;AAAA,EAAS;AAAA,EAC7C;AAAA,EAAU;AAAA,EAAY;AAAA,EAAQ;AAAA;AAAA,EAG9B;AAAA,EAAe;AAAA,EAAiB;AAAA,EAAe;AAAA,EAC/C;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA;AAAA,EAG1C;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAO;AAAA,EAAU;AAAA,EAAU;AAAA,EAC5C;AAAA,EAAS;AAAA,EAAS;AAAA,EAAW;AAAA,EAAW;AAAA;AAAA,EAGxC;AAAA,EAAU;AAAA,EAAiB;AAAA,EAAU;AAAA,EAAO;AAAA;AAAA,EAG5C;AAAA,EAAS;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