@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.
Files changed (120) hide show
  1. package/dist/{chunk-6RFT7K7F.js → chunk-26QXQFLZ.js} +88 -23
  2. package/dist/chunk-26QXQFLZ.js.map +1 -0
  3. package/dist/{chunk-RTDKF6NS.js → chunk-5QIWYEHJ.js} +2 -2
  4. package/dist/{chunk-BYNVJ4ON.js → chunk-7CJPKJEE.js} +2 -2
  5. package/dist/{chunk-SXE54MIC.js → chunk-AB27WETH.js} +8 -8
  6. package/dist/chunk-B5A4XLSQ.js +10 -0
  7. package/dist/chunk-B5A4XLSQ.js.map +1 -0
  8. package/dist/{chunk-VDJGZIQ5.js → chunk-BGSHC2UK.js} +2 -2
  9. package/dist/{chunk-VLZEBK7S.js → chunk-E4434A4Y.js} +3 -3
  10. package/dist/{chunk-QEGH3CWQ.js → chunk-GZP6HY5W.js} +4 -20
  11. package/dist/{chunk-QEGH3CWQ.js.map → chunk-GZP6HY5W.js.map} +1 -1
  12. package/dist/{chunk-JPGX6WEV.js → chunk-I2GXV3BQ.js} +3 -16
  13. package/dist/{chunk-JPGX6WEV.js.map → chunk-I2GXV3BQ.js.map} +1 -1
  14. package/dist/{chunk-W76ICQKY.js → chunk-IUG2FHNN.js} +2 -2
  15. package/dist/{chunk-K3EHH3C4.js → chunk-PT3DGIUF.js} +3 -15
  16. package/dist/{chunk-K3EHH3C4.js.map → chunk-PT3DGIUF.js.map} +1 -1
  17. package/dist/chunk-PZ5AY32C.js +10 -0
  18. package/dist/{chunk-223ZMZP6.js → chunk-QIG7YPFW.js} +89 -30
  19. package/dist/chunk-QIG7YPFW.js.map +1 -0
  20. package/dist/{chunk-HBWJLKNM.js → chunk-QZNGKOCZ.js} +2 -2
  21. package/dist/{chunk-AAIUUX4Y.js → chunk-X4WPMVCM.js} +2 -2
  22. package/dist/client.cjs +174 -434
  23. package/dist/client.cjs.map +1 -1
  24. package/dist/client.js +11 -12
  25. package/dist/git/client.js +1 -1
  26. package/dist/git/config.js +1 -1
  27. package/dist/git/index.js +1 -1
  28. package/dist/index.cjs +179 -446
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.js +12 -14
  31. package/dist/modelrouter/core.js +1 -1
  32. package/dist/modelrouter/index.js +1 -1
  33. package/dist/tools/browser/anthropic.js +2 -2
  34. package/dist/tools/browser/core.js +1 -1
  35. package/dist/tools/browser/index.js +4 -4
  36. package/dist/tools/browser/live.js +1 -1
  37. package/dist/tools/browser/openai.js +2 -2
  38. package/dist/tools/browser/prompts.js +1 -1
  39. package/dist/tools/browser/vercel.js +2 -2
  40. package/dist/tools/codebase_search/anthropic.js +1 -1
  41. package/dist/tools/codebase_search/core.js +1 -1
  42. package/dist/tools/codebase_search/index.js +1 -1
  43. package/dist/tools/codebase_search/openai.js +1 -1
  44. package/dist/tools/codebase_search/prompts.js +1 -1
  45. package/dist/tools/codebase_search/vercel.js +1 -1
  46. package/dist/tools/fastapply/anthropic.js +2 -2
  47. package/dist/tools/fastapply/core.js +1 -1
  48. package/dist/tools/fastapply/index.js +4 -4
  49. package/dist/tools/fastapply/openai.js +2 -2
  50. package/dist/tools/fastapply/prompts.js +1 -1
  51. package/dist/tools/fastapply/vercel.js +2 -2
  52. package/dist/tools/index.js +4 -4
  53. package/dist/tools/utils/resilience.js +1 -1
  54. package/dist/tools/warp_grep/agent/config.js +1 -1
  55. package/dist/tools/warp_grep/agent/formatter.js +1 -1
  56. package/dist/tools/warp_grep/agent/parser.js +1 -1
  57. package/dist/tools/warp_grep/agent/prompt.js +1 -1
  58. package/dist/tools/warp_grep/agent/runner.js +1 -1
  59. package/dist/tools/warp_grep/anthropic.cjs +174 -434
  60. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  61. package/dist/tools/warp_grep/anthropic.d.ts +78 -3
  62. package/dist/tools/warp_grep/anthropic.js +5 -6
  63. package/dist/tools/warp_grep/client.cjs +174 -434
  64. package/dist/tools/warp_grep/client.cjs.map +1 -1
  65. package/dist/tools/warp_grep/client.js +4 -5
  66. package/dist/tools/warp_grep/gemini.cjs +176 -437
  67. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  68. package/dist/tools/warp_grep/gemini.d.ts +109 -3
  69. package/dist/tools/warp_grep/gemini.js +48 -12
  70. package/dist/tools/warp_grep/gemini.js.map +1 -1
  71. package/dist/tools/warp_grep/harness.cjs +88 -417
  72. package/dist/tools/warp_grep/harness.cjs.map +1 -1
  73. package/dist/tools/warp_grep/harness.js +2 -3
  74. package/dist/tools/warp_grep/harness.js.map +1 -1
  75. package/dist/tools/warp_grep/index.cjs +180 -621
  76. package/dist/tools/warp_grep/index.cjs.map +1 -1
  77. package/dist/tools/warp_grep/index.d.ts +89 -9
  78. package/dist/tools/warp_grep/index.js +7 -21
  79. package/dist/tools/warp_grep/openai.cjs +174 -434
  80. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  81. package/dist/tools/warp_grep/openai.d.ts +78 -3
  82. package/dist/tools/warp_grep/openai.js +5 -6
  83. package/dist/tools/warp_grep/providers/local.cjs +88 -417
  84. package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
  85. package/dist/tools/warp_grep/providers/local.d.ts +0 -6
  86. package/dist/tools/warp_grep/providers/local.js +2 -3
  87. package/dist/tools/warp_grep/providers/remote.cjs +86 -408
  88. package/dist/tools/warp_grep/providers/remote.cjs.map +1 -1
  89. package/dist/tools/warp_grep/providers/remote.d.ts +0 -7
  90. package/dist/tools/warp_grep/providers/remote.js +2 -3
  91. package/dist/tools/warp_grep/utils/files.js +1 -1
  92. package/dist/tools/warp_grep/utils/paths.js +1 -1
  93. package/dist/tools/warp_grep/utils/ripgrep.js +1 -1
  94. package/dist/tools/warp_grep/vercel.cjs +174 -434
  95. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  96. package/dist/tools/warp_grep/vercel.d.ts +56 -3
  97. package/dist/tools/warp_grep/vercel.js +5 -6
  98. package/package.json +1 -1
  99. package/dist/anthropic-BC-AMEIN.d.ts +0 -89
  100. package/dist/chunk-223ZMZP6.js.map +0 -1
  101. package/dist/chunk-6RFT7K7F.js.map +0 -1
  102. package/dist/chunk-FURFQDXF.js +0 -75
  103. package/dist/chunk-FURFQDXF.js.map +0 -1
  104. package/dist/chunk-HKJ2B2AA.js +0 -15
  105. package/dist/chunk-ISWL67SF.js +0 -1
  106. package/dist/chunk-ISWL67SF.js.map +0 -1
  107. package/dist/chunk-S6KU22MU.js +0 -396
  108. package/dist/chunk-S6KU22MU.js.map +0 -1
  109. package/dist/gemini-BIFBiIjY.d.ts +0 -119
  110. package/dist/openai-Beb9escY.d.ts +0 -89
  111. package/dist/vercel-Bo84tpBe.d.ts +0 -66
  112. /package/dist/{chunk-RTDKF6NS.js.map → chunk-5QIWYEHJ.js.map} +0 -0
  113. /package/dist/{chunk-BYNVJ4ON.js.map → chunk-7CJPKJEE.js.map} +0 -0
  114. /package/dist/{chunk-SXE54MIC.js.map → chunk-AB27WETH.js.map} +0 -0
  115. /package/dist/{chunk-VDJGZIQ5.js.map → chunk-BGSHC2UK.js.map} +0 -0
  116. /package/dist/{chunk-VLZEBK7S.js.map → chunk-E4434A4Y.js.map} +0 -0
  117. /package/dist/{chunk-W76ICQKY.js.map → chunk-IUG2FHNN.js.map} +0 -0
  118. /package/dist/{chunk-HKJ2B2AA.js.map → chunk-PZ5AY32C.js.map} +0 -0
  119. /package/dist/{chunk-HBWJLKNM.js.map → chunk-QZNGKOCZ.js.map} +0 -0
  120. /package/dist/{chunk-AAIUUX4Y.js.map → chunk-X4WPMVCM.js.map} +0 -0
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
8
  var __export = (target, all) => {
12
9
  for (var name in all)
13
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -30,394 +27,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
27
  ));
31
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
29
 
33
- // node_modules/ignore/index.js
34
- var require_ignore = __commonJS({
35
- "node_modules/ignore/index.js"(exports2, module2) {
36
- "use strict";
37
- function makeArray(subject) {
38
- return Array.isArray(subject) ? subject : [subject];
39
- }
40
- var EMPTY = "";
41
- var SPACE = " ";
42
- var ESCAPE = "\\";
43
- var REGEX_TEST_BLANK_LINE = /^\s+$/;
44
- var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
45
- var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
46
- var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
47
- var REGEX_SPLITALL_CRLF = /\r?\n/g;
48
- var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
49
- var SLASH = "/";
50
- var TMP_KEY_IGNORE = "node-ignore";
51
- if (typeof Symbol !== "undefined") {
52
- TMP_KEY_IGNORE = Symbol.for("node-ignore");
53
- }
54
- var KEY_IGNORE = TMP_KEY_IGNORE;
55
- var define = (object, key, value) => Object.defineProperty(object, key, { value });
56
- var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
57
- var RETURN_FALSE = () => false;
58
- var sanitizeRange = (range) => range.replace(
59
- REGEX_REGEXP_RANGE,
60
- (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY
61
- );
62
- var cleanRangeBackSlash = (slashes) => {
63
- const { length } = slashes;
64
- return slashes.slice(0, length - length % 2);
65
- };
66
- var REPLACERS = [
67
- [
68
- // remove BOM
69
- // TODO:
70
- // Other similar zero-width characters?
71
- /^\uFEFF/,
72
- () => EMPTY
73
- ],
74
- // > Trailing spaces are ignored unless they are quoted with backslash ("\")
75
- [
76
- // (a\ ) -> (a )
77
- // (a ) -> (a)
78
- // (a ) -> (a)
79
- // (a \ ) -> (a )
80
- /((?:\\\\)*?)(\\?\s+)$/,
81
- (_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY)
82
- ],
83
- // replace (\ ) with ' '
84
- // (\ ) -> ' '
85
- // (\\ ) -> '\\ '
86
- // (\\\ ) -> '\\ '
87
- [
88
- /(\\+?)\s/g,
89
- (_, m1) => {
90
- const { length } = m1;
91
- return m1.slice(0, length - length % 2) + SPACE;
92
- }
93
- ],
94
- // Escape metacharacters
95
- // which is written down by users but means special for regular expressions.
96
- // > There are 12 characters with special meanings:
97
- // > - the backslash \,
98
- // > - the caret ^,
99
- // > - the dollar sign $,
100
- // > - the period or dot .,
101
- // > - the vertical bar or pipe symbol |,
102
- // > - the question mark ?,
103
- // > - the asterisk or star *,
104
- // > - the plus sign +,
105
- // > - the opening parenthesis (,
106
- // > - the closing parenthesis ),
107
- // > - and the opening square bracket [,
108
- // > - the opening curly brace {,
109
- // > These special characters are often called "metacharacters".
110
- [
111
- /[\\$.|*+(){^]/g,
112
- (match) => `\\${match}`
113
- ],
114
- [
115
- // > a question mark (?) matches a single character
116
- /(?!\\)\?/g,
117
- () => "[^/]"
118
- ],
119
- // leading slash
120
- [
121
- // > A leading slash matches the beginning of the pathname.
122
- // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
123
- // A leading slash matches the beginning of the pathname
124
- /^\//,
125
- () => "^"
126
- ],
127
- // replace special metacharacter slash after the leading slash
128
- [
129
- /\//g,
130
- () => "\\/"
131
- ],
132
- [
133
- // > A leading "**" followed by a slash means match in all directories.
134
- // > For example, "**/foo" matches file or directory "foo" anywhere,
135
- // > the same as pattern "foo".
136
- // > "**/foo/bar" matches file or directory "bar" anywhere that is directly
137
- // > under directory "foo".
138
- // Notice that the '*'s have been replaced as '\\*'
139
- /^\^*\\\*\\\*\\\//,
140
- // '**/foo' <-> 'foo'
141
- () => "^(?:.*\\/)?"
142
- ],
143
- // starting
144
- [
145
- // there will be no leading '/'
146
- // (which has been replaced by section "leading slash")
147
- // If starts with '**', adding a '^' to the regular expression also works
148
- /^(?=[^^])/,
149
- function startingReplacer() {
150
- return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
151
- }
152
- ],
153
- // two globstars
154
- [
155
- // Use lookahead assertions so that we could match more than one `'/**'`
156
- /\\\/\\\*\\\*(?=\\\/|$)/g,
157
- // Zero, one or several directories
158
- // should not use '*', or it will be replaced by the next replacer
159
- // Check if it is not the last `'/**'`
160
- (_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
161
- ],
162
- // normal intermediate wildcards
163
- [
164
- // Never replace escaped '*'
165
- // ignore rule '\*' will match the path '*'
166
- // 'abc.*/' -> go
167
- // 'abc.*' -> skip this rule,
168
- // coz trailing single wildcard will be handed by [trailing wildcard]
169
- /(^|[^\\]+)(\\\*)+(?=.+)/g,
170
- // '*.js' matches '.js'
171
- // '*.js' doesn't match 'abc'
172
- (_, p1, p2) => {
173
- const unescaped = p2.replace(/\\\*/g, "[^\\/]*");
174
- return p1 + unescaped;
175
- }
176
- ],
177
- [
178
- // unescape, revert step 3 except for back slash
179
- // For example, if a user escape a '\\*',
180
- // after step 3, the result will be '\\\\\\*'
181
- /\\\\\\(?=[$.|*+(){^])/g,
182
- () => ESCAPE
183
- ],
184
- [
185
- // '\\\\' -> '\\'
186
- /\\\\/g,
187
- () => ESCAPE
188
- ],
189
- [
190
- // > The range notation, e.g. [a-zA-Z],
191
- // > can be used to match one of the characters in a range.
192
- // `\` is escaped by step 3
193
- /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
194
- (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"
195
- ],
196
- // ending
197
- [
198
- // 'js' will not match 'js.'
199
- // 'ab' will not match 'abc'
200
- /(?:[^*])$/,
201
- // WTF!
202
- // https://git-scm.com/docs/gitignore
203
- // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
204
- // which re-fixes #24, #38
205
- // > If there is a separator at the end of the pattern then the pattern
206
- // > will only match directories, otherwise the pattern can match both
207
- // > files and directories.
208
- // 'js*' will not match 'a.js'
209
- // 'js/' will not match 'a.js'
210
- // 'js' will match 'a.js' and 'a.js/'
211
- (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
212
- ],
213
- // trailing wildcard
214
- [
215
- /(\^|\\\/)?\\\*$/,
216
- (_, p1) => {
217
- const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
218
- return `${prefix}(?=$|\\/$)`;
219
- }
220
- ]
221
- ];
222
- var regexCache = /* @__PURE__ */ Object.create(null);
223
- var makeRegex = (pattern, ignoreCase) => {
224
- let source = regexCache[pattern];
225
- if (!source) {
226
- source = REPLACERS.reduce(
227
- (prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)),
228
- pattern
229
- );
230
- regexCache[pattern] = source;
231
- }
232
- return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
233
- };
234
- var isString = (subject) => typeof subject === "string";
235
- var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
236
- var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
237
- var IgnoreRule = class {
238
- constructor(origin, pattern, negative, regex) {
239
- this.origin = origin;
240
- this.pattern = pattern;
241
- this.negative = negative;
242
- this.regex = regex;
243
- }
244
- };
245
- var createRule = (pattern, ignoreCase) => {
246
- const origin = pattern;
247
- let negative = false;
248
- if (pattern.indexOf("!") === 0) {
249
- negative = true;
250
- pattern = pattern.substr(1);
251
- }
252
- pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
253
- const regex = makeRegex(pattern, ignoreCase);
254
- return new IgnoreRule(
255
- origin,
256
- pattern,
257
- negative,
258
- regex
259
- );
260
- };
261
- var throwError = (message, Ctor) => {
262
- throw new Ctor(message);
263
- };
264
- var checkPath = (path5, originalPath, doThrow) => {
265
- if (!isString(path5)) {
266
- return doThrow(
267
- `path must be a string, but got \`${originalPath}\``,
268
- TypeError
269
- );
270
- }
271
- if (!path5) {
272
- return doThrow(`path must not be empty`, TypeError);
273
- }
274
- if (checkPath.isNotRelative(path5)) {
275
- const r = "`path.relative()`d";
276
- return doThrow(
277
- `path should be a ${r} string, but got "${originalPath}"`,
278
- RangeError
279
- );
280
- }
281
- return true;
282
- };
283
- var isNotRelative = (path5) => REGEX_TEST_INVALID_PATH.test(path5);
284
- checkPath.isNotRelative = isNotRelative;
285
- checkPath.convert = (p) => p;
286
- var Ignore = class {
287
- constructor({
288
- ignorecase = true,
289
- ignoreCase = ignorecase,
290
- allowRelativePaths = false
291
- } = {}) {
292
- define(this, KEY_IGNORE, true);
293
- this._rules = [];
294
- this._ignoreCase = ignoreCase;
295
- this._allowRelativePaths = allowRelativePaths;
296
- this._initCache();
297
- }
298
- _initCache() {
299
- this._ignoreCache = /* @__PURE__ */ Object.create(null);
300
- this._testCache = /* @__PURE__ */ Object.create(null);
301
- }
302
- _addPattern(pattern) {
303
- if (pattern && pattern[KEY_IGNORE]) {
304
- this._rules = this._rules.concat(pattern._rules);
305
- this._added = true;
306
- return;
307
- }
308
- if (checkPattern(pattern)) {
309
- const rule = createRule(pattern, this._ignoreCase);
310
- this._added = true;
311
- this._rules.push(rule);
312
- }
313
- }
314
- // @param {Array<string> | string | Ignore} pattern
315
- add(pattern) {
316
- this._added = false;
317
- makeArray(
318
- isString(pattern) ? splitPattern(pattern) : pattern
319
- ).forEach(this._addPattern, this);
320
- if (this._added) {
321
- this._initCache();
322
- }
323
- return this;
324
- }
325
- // legacy
326
- addPattern(pattern) {
327
- return this.add(pattern);
328
- }
329
- // | ignored : unignored
330
- // negative | 0:0 | 0:1 | 1:0 | 1:1
331
- // -------- | ------- | ------- | ------- | --------
332
- // 0 | TEST | TEST | SKIP | X
333
- // 1 | TESTIF | SKIP | TEST | X
334
- // - SKIP: always skip
335
- // - TEST: always test
336
- // - TESTIF: only test if checkUnignored
337
- // - X: that never happen
338
- // @param {boolean} whether should check if the path is unignored,
339
- // setting `checkUnignored` to `false` could reduce additional
340
- // path matching.
341
- // @returns {TestResult} true if a file is ignored
342
- _testOne(path5, checkUnignored) {
343
- let ignored = false;
344
- let unignored = false;
345
- this._rules.forEach((rule) => {
346
- const { negative } = rule;
347
- if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
348
- return;
349
- }
350
- const matched = rule.regex.test(path5);
351
- if (matched) {
352
- ignored = !negative;
353
- unignored = negative;
354
- }
355
- });
356
- return {
357
- ignored,
358
- unignored
359
- };
360
- }
361
- // @returns {TestResult}
362
- _test(originalPath, cache, checkUnignored, slices) {
363
- const path5 = originalPath && checkPath.convert(originalPath);
364
- checkPath(
365
- path5,
366
- originalPath,
367
- this._allowRelativePaths ? RETURN_FALSE : throwError
368
- );
369
- return this._t(path5, cache, checkUnignored, slices);
370
- }
371
- _t(path5, cache, checkUnignored, slices) {
372
- if (path5 in cache) {
373
- return cache[path5];
374
- }
375
- if (!slices) {
376
- slices = path5.split(SLASH);
377
- }
378
- slices.pop();
379
- if (!slices.length) {
380
- return cache[path5] = this._testOne(path5, checkUnignored);
381
- }
382
- const parent = this._t(
383
- slices.join(SLASH) + SLASH,
384
- cache,
385
- checkUnignored,
386
- slices
387
- );
388
- return cache[path5] = parent.ignored ? parent : this._testOne(path5, checkUnignored);
389
- }
390
- ignores(path5) {
391
- return this._test(path5, this._ignoreCache, false).ignored;
392
- }
393
- createFilter() {
394
- return (path5) => !this.ignores(path5);
395
- }
396
- filter(paths) {
397
- return makeArray(paths).filter(this.createFilter());
398
- }
399
- // @returns {TestResult}
400
- test(path5) {
401
- return this._test(path5, this._testCache, true);
402
- }
403
- };
404
- var factory = (options) => new Ignore(options);
405
- var isPathValid = (path5) => checkPath(path5 && checkPath.convert(path5), path5, RETURN_FALSE);
406
- factory.isPathValid = isPathValid;
407
- factory.default = factory;
408
- module2.exports = factory;
409
- if (
410
- // Detect `process` so that it can run in browsers.
411
- typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
412
- ) {
413
- const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
414
- checkPath.convert = makePosix;
415
- const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
416
- checkPath.isNotRelative = (path5) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path5) || isNotRelative(path5);
417
- }
418
- }
419
- });
420
-
421
30
  // tools/warp_grep/index.ts
422
31
  var warp_grep_exports = {};
423
32
  __export(warp_grep_exports, {
@@ -427,22 +36,20 @@ __export(warp_grep_exports, {
427
36
  WARP_GREP_SYSTEM_PROMPT: () => SYSTEM_PROMPT,
428
37
  WARP_GREP_TOOL_NAME: () => WARP_GREP_TOOL_NAME,
429
38
  WarpGrepClient: () => WarpGrepClient,
430
- anthropic: () => anthropic_exports,
431
39
  executeToolCall: () => executeToolCall,
432
40
  executeWarpGrep: () => executeWarpGrep,
433
41
  formatResult: () => formatResult,
434
- gemini: () => gemini_exports,
435
42
  getSystemPrompt: () => getSystemPrompt,
436
43
  normalizeFinishFiles: () => normalizeFinishFiles,
437
- openai: () => openai_exports,
438
44
  readFinishFiles: () => readFinishFiles,
439
45
  runWarpGrep: () => runWarpGrep,
440
46
  toolGrep: () => toolGrep,
441
47
  toolListDirectory: () => toolListDirectory,
442
48
  toolRead: () => toolRead,
443
- vercel: () => vercel_exports
49
+ warpGrepInputSchema: () => warpGrepInputSchema
444
50
  });
445
51
  module.exports = __toCommonJS(warp_grep_exports);
52
+ var import_zod = require("zod");
446
53
 
447
54
  // tools/warp_grep/agent/config.ts
448
55
  var AGENT_CONFIG = {
@@ -1625,30 +1232,95 @@ async function readAllLines(filePath) {
1625
1232
  }
1626
1233
 
1627
1234
  // tools/warp_grep/providers/local.ts
1628
- var ignore = require_ignore().default || require_ignore();
1235
+ var SKIP_NAMES = /* @__PURE__ */ new Set([
1236
+ // Version control
1237
+ ".git",
1238
+ ".svn",
1239
+ ".hg",
1240
+ ".bzr",
1241
+ // Dependencies
1242
+ "node_modules",
1243
+ "bower_components",
1244
+ ".pnpm",
1245
+ ".yarn",
1246
+ "vendor",
1247
+ "Pods",
1248
+ ".bundle",
1249
+ // Python
1250
+ "__pycache__",
1251
+ ".pytest_cache",
1252
+ ".mypy_cache",
1253
+ ".ruff_cache",
1254
+ ".venv",
1255
+ "venv",
1256
+ ".tox",
1257
+ ".nox",
1258
+ ".eggs",
1259
+ // Build outputs
1260
+ "dist",
1261
+ "build",
1262
+ "out",
1263
+ "output",
1264
+ "target",
1265
+ "_build",
1266
+ ".next",
1267
+ ".nuxt",
1268
+ ".output",
1269
+ ".vercel",
1270
+ ".netlify",
1271
+ // Cache
1272
+ ".cache",
1273
+ ".parcel-cache",
1274
+ ".turbo",
1275
+ ".nx",
1276
+ ".gradle",
1277
+ // IDE
1278
+ ".idea",
1279
+ ".vscode",
1280
+ ".vs",
1281
+ // Coverage
1282
+ "coverage",
1283
+ ".coverage",
1284
+ "htmlcov",
1285
+ ".nyc_output",
1286
+ // Temp
1287
+ "tmp",
1288
+ "temp",
1289
+ ".tmp",
1290
+ ".temp",
1291
+ // Lock files
1292
+ "package-lock.json",
1293
+ "yarn.lock",
1294
+ "pnpm-lock.yaml",
1295
+ "bun.lockb",
1296
+ "Cargo.lock",
1297
+ "Gemfile.lock",
1298
+ "poetry.lock"
1299
+ ]);
1300
+ var SKIP_EXTENSIONS = /* @__PURE__ */ new Set([
1301
+ ".min.js",
1302
+ ".min.css",
1303
+ ".bundle.js",
1304
+ ".wasm",
1305
+ ".so",
1306
+ ".dll",
1307
+ ".pyc",
1308
+ ".map",
1309
+ ".js.map"
1310
+ ]);
1311
+ function shouldSkip(name) {
1312
+ if (SKIP_NAMES.has(name)) return true;
1313
+ if (name.startsWith(".")) return true;
1314
+ for (const ext of SKIP_EXTENSIONS) {
1315
+ if (name.endsWith(ext)) return true;
1316
+ }
1317
+ return false;
1318
+ }
1629
1319
  var LocalRipgrepProvider = class {
1630
1320
  constructor(repoRoot, excludes = DEFAULT_EXCLUDES) {
1631
1321
  this.repoRoot = repoRoot;
1632
1322
  this.excludes = excludes;
1633
1323
  }
1634
- ignoreFilter = null;
1635
- /**
1636
- * Build an ignore filter that combines DEFAULT_EXCLUDES and .gitignore patterns.
1637
- * Cached after first call.
1638
- */
1639
- async getIgnoreFilter() {
1640
- if (this.ignoreFilter) return this.ignoreFilter;
1641
- const ig = ignore();
1642
- ig.add(this.excludes);
1643
- try {
1644
- const gitignorePath = import_path4.default.join(this.repoRoot, ".gitignore");
1645
- const gitignoreContent = await import_promises2.default.readFile(gitignorePath, "utf-8");
1646
- ig.add(gitignoreContent);
1647
- } catch {
1648
- }
1649
- this.ignoreFilter = ig;
1650
- return ig;
1651
- }
1652
1324
  async grep(params) {
1653
1325
  let abs;
1654
1326
  try {
@@ -1776,11 +1448,10 @@ Details: ${res.stderr}` : ""}`
1776
1448
  const maxResults = params.maxResults ?? AGENT_CONFIG.MAX_OUTPUT_LINES;
1777
1449
  const maxDepth = params.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;
1778
1450
  const regex = params.pattern ? new RegExp(params.pattern) : null;
1779
- const ig = await this.getIgnoreFilter();
1451
+ const repoRoot = this.repoRoot;
1780
1452
  const results = [];
1781
1453
  let timedOut = false;
1782
1454
  const startTime = Date.now();
1783
- const repoRoot = this.repoRoot;
1784
1455
  async function walk(dir, depth) {
1785
1456
  if (Date.now() - startTime > AGENT_CONFIG.LIST_TIMEOUT_MS) {
1786
1457
  timedOut = true;
@@ -1790,15 +1461,13 @@ Details: ${res.stderr}` : ""}`
1790
1461
  const entries = await import_promises2.default.readdir(dir, { withFileTypes: true });
1791
1462
  for (const entry of entries) {
1792
1463
  if (timedOut || results.length >= maxResults) break;
1464
+ if (shouldSkip(entry.name)) continue;
1465
+ if (regex && !regex.test(entry.name)) continue;
1793
1466
  const full = import_path4.default.join(dir, entry.name);
1794
- const relToRepo = toRepoRelative(repoRoot, full).replace(/^[.][/\\]?/, "");
1795
1467
  const isDir = entry.isDirectory();
1796
- if (ig.ignores(relToRepo) || isDir && ig.ignores(relToRepo + "/")) continue;
1797
- if (regex && !regex.test(entry.name)) continue;
1798
1468
  results.push({
1799
1469
  name: entry.name,
1800
- path: toRepoRelative(import_path4.default.resolve(""), full),
1801
- // relative display
1470
+ path: toRepoRelative(repoRoot, full),
1802
1471
  type: isDir ? "dir" : "file",
1803
1472
  depth
1804
1473
  });
@@ -1813,25 +1482,95 @@ Details: ${res.stderr}` : ""}`
1813
1482
  };
1814
1483
 
1815
1484
  // tools/warp_grep/providers/remote.ts
1816
- var ignore2 = require_ignore().default || require_ignore();
1485
+ var SKIP_NAMES2 = /* @__PURE__ */ new Set([
1486
+ // Version control
1487
+ ".git",
1488
+ ".svn",
1489
+ ".hg",
1490
+ ".bzr",
1491
+ // Dependencies
1492
+ "node_modules",
1493
+ "bower_components",
1494
+ ".pnpm",
1495
+ ".yarn",
1496
+ "vendor",
1497
+ "Pods",
1498
+ ".bundle",
1499
+ // Python
1500
+ "__pycache__",
1501
+ ".pytest_cache",
1502
+ ".mypy_cache",
1503
+ ".ruff_cache",
1504
+ ".venv",
1505
+ "venv",
1506
+ ".tox",
1507
+ ".nox",
1508
+ ".eggs",
1509
+ // Build outputs
1510
+ "dist",
1511
+ "build",
1512
+ "out",
1513
+ "output",
1514
+ "target",
1515
+ "_build",
1516
+ ".next",
1517
+ ".nuxt",
1518
+ ".output",
1519
+ ".vercel",
1520
+ ".netlify",
1521
+ // Cache
1522
+ ".cache",
1523
+ ".parcel-cache",
1524
+ ".turbo",
1525
+ ".nx",
1526
+ ".gradle",
1527
+ // IDE
1528
+ ".idea",
1529
+ ".vscode",
1530
+ ".vs",
1531
+ // Coverage
1532
+ "coverage",
1533
+ ".coverage",
1534
+ "htmlcov",
1535
+ ".nyc_output",
1536
+ // Temp
1537
+ "tmp",
1538
+ "temp",
1539
+ ".tmp",
1540
+ ".temp",
1541
+ // Lock files
1542
+ "package-lock.json",
1543
+ "yarn.lock",
1544
+ "pnpm-lock.yaml",
1545
+ "bun.lockb",
1546
+ "Cargo.lock",
1547
+ "Gemfile.lock",
1548
+ "poetry.lock"
1549
+ ]);
1550
+ var SKIP_EXTENSIONS2 = /* @__PURE__ */ new Set([
1551
+ ".min.js",
1552
+ ".min.css",
1553
+ ".bundle.js",
1554
+ ".wasm",
1555
+ ".so",
1556
+ ".dll",
1557
+ ".pyc",
1558
+ ".map",
1559
+ ".js.map"
1560
+ ]);
1561
+ function shouldSkip2(name) {
1562
+ if (SKIP_NAMES2.has(name)) return true;
1563
+ if (name.startsWith(".")) return true;
1564
+ for (const ext of SKIP_EXTENSIONS2) {
1565
+ if (name.endsWith(ext)) return true;
1566
+ }
1567
+ return false;
1568
+ }
1817
1569
  var RemoteCommandsProvider = class {
1818
1570
  constructor(repoRoot, commands) {
1819
1571
  this.repoRoot = repoRoot;
1820
1572
  this.commands = commands;
1821
1573
  }
1822
- ignoreFilter = null;
1823
- /**
1824
- * Build an ignore filter from DEFAULT_EXCLUDES.
1825
- * Note: For remote providers, we can't read .gitignore from the remote sandbox,
1826
- * so we only use the built-in excludes.
1827
- */
1828
- getIgnoreFilter() {
1829
- if (this.ignoreFilter) return this.ignoreFilter;
1830
- const ig = ignore2();
1831
- ig.add(DEFAULT_EXCLUDES);
1832
- this.ignoreFilter = ig;
1833
- return ig;
1834
- }
1835
1574
  /**
1836
1575
  * Run grep command and parse ripgrep output
1837
1576
  */
@@ -1885,7 +1624,6 @@ var RemoteCommandsProvider = class {
1885
1624
  async listDirectory(params) {
1886
1625
  const maxDepth = params.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;
1887
1626
  const maxResults = params.maxResults ?? AGENT_CONFIG.MAX_OUTPUT_LINES;
1888
- const ig = this.getIgnoreFilter();
1889
1627
  try {
1890
1628
  const stdout = await this.commands.listDir(params.path, maxDepth);
1891
1629
  const paths = (stdout || "").trim().split(/\r?\n/).filter((p) => p.length > 0);
@@ -1894,12 +1632,12 @@ var RemoteCommandsProvider = class {
1894
1632
  for (const fullPath of paths) {
1895
1633
  if (fullPath === params.path || fullPath === this.repoRoot) continue;
1896
1634
  const name = fullPath.split("/").pop() || "";
1635
+ if (shouldSkip2(name)) continue;
1636
+ if (regex && !regex.test(name)) continue;
1897
1637
  let relativePath = fullPath;
1898
1638
  if (fullPath.startsWith(this.repoRoot)) {
1899
1639
  relativePath = fullPath.slice(this.repoRoot.length).replace(/^\//, "");
1900
1640
  }
1901
- if (ig.ignores(relativePath)) continue;
1902
- if (regex && !regex.test(name)) continue;
1903
1641
  const depth = relativePath.split("/").filter(Boolean).length - 1;
1904
1642
  const hasExtension = name.includes(".") && !name.startsWith(".");
1905
1643
  const type = hasExtension ? "file" : "dir";
@@ -2023,186 +1761,10 @@ function formatResult(result) {
2023
1761
  var WARP_GREP_TOOL_NAME = "warpgrep_codebase_search";
2024
1762
  var WARP_GREP_DESCRIPTION = 'IMPORTANT: If you need to explore the codebase to gather context, and the task does not involve a single file or function which is provided by name, you should ALWAYS use the warpgrep codebase search tool first instead of running search commands. When the task requires exploration beyond a single known file, invoke warpgrep first with a natural-language query describing the target functionality, bug, or architectural concern. Warp Grep is a fast and accurate tool that can search for all relevant context in a codebase. Keep queries action-oriented (e.g., "Find where billing invoices are generated and emailed"), and after reviewing the summarized results, you may verify important findings with other search tools or direct file reads to ensure completeness. Warp Grep can be used for query types like: find function responsible for <small feature>; find code that does <description>; find code path for <big feature>; Where does <minimal error message> come from?; or any query of that type. When a task requires exploration beyond a single known file, ALWAYS default to warpgrep codebase search before other search mechanisms.';
2025
1763
 
2026
- // tools/warp_grep/anthropic.ts
2027
- var anthropic_exports = {};
2028
- __export(anthropic_exports, {
2029
- createWarpGrepTool: () => createWarpGrepTool,
2030
- execute: () => execute,
2031
- formatResult: () => formatResult,
2032
- getSystemPrompt: () => getSystemPrompt,
2033
- warpGrepTool: () => warpGrepTool
2034
- });
2035
- var INPUT_SCHEMA = {
2036
- type: "object",
2037
- properties: {
2038
- query: { type: "string", description: "Free-form repository question" }
2039
- },
2040
- required: ["query"]
2041
- };
2042
- var warpGrepTool = {
2043
- name: WARP_GREP_TOOL_NAME,
2044
- description: WARP_GREP_DESCRIPTION,
2045
- input_schema: INPUT_SCHEMA
2046
- };
2047
- async function execute(input, config) {
2048
- return executeToolCall(input, config);
2049
- }
2050
- function createWarpGrepTool(config) {
2051
- const tool2 = {
2052
- name: config.name ?? WARP_GREP_TOOL_NAME,
2053
- description: config.description ?? WARP_GREP_DESCRIPTION,
2054
- input_schema: INPUT_SCHEMA
2055
- };
2056
- return Object.assign(tool2, {
2057
- execute: async (input) => {
2058
- return executeToolCall(input, config);
2059
- },
2060
- formatResult: (result) => {
2061
- return formatResult(result);
2062
- },
2063
- getSystemPrompt: () => {
2064
- return getSystemPrompt();
2065
- }
2066
- });
2067
- }
2068
-
2069
- // tools/warp_grep/openai.ts
2070
- var openai_exports = {};
2071
- __export(openai_exports, {
2072
- createWarpGrepTool: () => createWarpGrepTool2,
2073
- default: () => openai_default,
2074
- execute: () => execute2,
2075
- formatResult: () => formatResult,
2076
- getSystemPrompt: () => getSystemPrompt,
2077
- warpGrepTool: () => warpGrepTool2
2078
- });
2079
- var TOOL_PARAMETERS = {
2080
- type: "object",
2081
- properties: {
2082
- query: { type: "string", description: "Free-form repository question" }
2083
- },
2084
- required: ["query"]
2085
- };
2086
- var warpGrepTool2 = {
2087
- type: "function",
2088
- function: {
2089
- name: WARP_GREP_TOOL_NAME,
2090
- description: WARP_GREP_DESCRIPTION,
2091
- parameters: TOOL_PARAMETERS
2092
- }
2093
- };
2094
- async function execute2(input, config) {
2095
- return executeToolCall(input, config);
2096
- }
2097
- function createWarpGrepTool2(config) {
2098
- const tool2 = {
2099
- type: "function",
2100
- function: {
2101
- name: config.name ?? WARP_GREP_TOOL_NAME,
2102
- description: config.description ?? WARP_GREP_DESCRIPTION,
2103
- parameters: TOOL_PARAMETERS
2104
- }
2105
- };
2106
- return Object.assign(tool2, {
2107
- execute: async (input) => {
2108
- return executeToolCall(input, config);
2109
- },
2110
- formatResult: (result) => {
2111
- return formatResult(result);
2112
- },
2113
- getSystemPrompt: () => {
2114
- return getSystemPrompt();
2115
- }
2116
- });
2117
- }
2118
- var openai_default = warpGrepTool2;
2119
-
2120
- // tools/warp_grep/vercel.ts
2121
- var vercel_exports = {};
2122
- __export(vercel_exports, {
2123
- createWarpGrepTool: () => createWarpGrepTool3,
2124
- default: () => vercel_default,
2125
- execute: () => execute3,
2126
- formatResult: () => formatResult,
2127
- getSystemPrompt: () => getSystemPrompt
2128
- });
2129
- var import_ai = require("ai");
2130
- var import_zod = require("zod");
2131
- async function execute3(input, config) {
2132
- return executeToolCall(input, config);
2133
- }
2134
- function createWarpGrepTool3(config) {
2135
- const schema = import_zod.z.object({
2136
- query: import_zod.z.string().describe("Free-form repository question")
2137
- });
2138
- return (0, import_ai.tool)({
2139
- description: config.description ?? WARP_GREP_DESCRIPTION,
2140
- inputSchema: schema,
2141
- execute: async (params) => {
2142
- const result = await executeToolCall(params, config);
2143
- if (!result.success) {
2144
- throw new Error(`Failed to search codebase: ${result.error}`);
2145
- }
2146
- return {
2147
- success: true,
2148
- contexts: result.contexts,
2149
- summary: result.summary
2150
- };
2151
- }
2152
- });
2153
- }
2154
- var vercel_default = createWarpGrepTool3;
2155
-
2156
- // tools/warp_grep/gemini.ts
2157
- var gemini_exports = {};
2158
- __export(gemini_exports, {
2159
- createMorphWarpGrepTool: () => createMorphWarpGrepTool,
2160
- createWarpGrepTool: () => createWarpGrepTool4,
2161
- default: () => gemini_default,
2162
- execute: () => execute4,
2163
- formatResult: () => formatResult,
2164
- getSystemPrompt: () => getSystemPrompt,
2165
- warpGrepFunctionDeclaration: () => warpGrepFunctionDeclaration
1764
+ // tools/warp_grep/index.ts
1765
+ var warpGrepInputSchema = import_zod.z.object({
1766
+ query: import_zod.z.string().describe("Free-form repository question")
2166
1767
  });
2167
- var import_generative_ai = require("@google/generative-ai");
2168
- var TOOL_PARAMETERS2 = {
2169
- type: import_generative_ai.SchemaType.OBJECT,
2170
- properties: {
2171
- query: {
2172
- type: import_generative_ai.SchemaType.STRING,
2173
- description: "Free-form repository question"
2174
- }
2175
- },
2176
- required: ["query"]
2177
- };
2178
- var warpGrepFunctionDeclaration = {
2179
- name: WARP_GREP_TOOL_NAME,
2180
- description: WARP_GREP_DESCRIPTION,
2181
- parameters: TOOL_PARAMETERS2
2182
- };
2183
- async function execute4(input, config) {
2184
- return executeToolCall(input, config);
2185
- }
2186
- function createWarpGrepTool4(config) {
2187
- const declaration = {
2188
- name: config.name ?? WARP_GREP_TOOL_NAME,
2189
- description: config.description ?? WARP_GREP_DESCRIPTION,
2190
- parameters: TOOL_PARAMETERS2
2191
- };
2192
- return Object.assign(declaration, {
2193
- execute: async (input) => {
2194
- return executeToolCall(input, config);
2195
- },
2196
- formatResult: (result) => {
2197
- return formatResult(result);
2198
- },
2199
- getSystemPrompt: () => {
2200
- return getSystemPrompt();
2201
- }
2202
- });
2203
- }
2204
- var createMorphWarpGrepTool = createWarpGrepTool4;
2205
- var gemini_default = warpGrepFunctionDeclaration;
2206
1768
  // Annotate the CommonJS export names for ESM import in node:
2207
1769
  0 && (module.exports = {
2208
1770
  LocalRipgrepProvider,
@@ -2211,19 +1773,16 @@ var gemini_default = warpGrepFunctionDeclaration;
2211
1773
  WARP_GREP_SYSTEM_PROMPT,
2212
1774
  WARP_GREP_TOOL_NAME,
2213
1775
  WarpGrepClient,
2214
- anthropic,
2215
1776
  executeToolCall,
2216
1777
  executeWarpGrep,
2217
1778
  formatResult,
2218
- gemini,
2219
1779
  getSystemPrompt,
2220
1780
  normalizeFinishFiles,
2221
- openai,
2222
1781
  readFinishFiles,
2223
1782
  runWarpGrep,
2224
1783
  toolGrep,
2225
1784
  toolListDirectory,
2226
1785
  toolRead,
2227
- vercel
1786
+ warpGrepInputSchema
2228
1787
  });
2229
1788
  //# sourceMappingURL=index.cjs.map