@morphllm/morphsdk 0.2.202 → 0.2.203
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-2PPYWRMZ.js +3 -4
- package/dist/{chunk-SIFDK4AA.js → chunk-2UIOCSVJ.js} +3 -24
- package/dist/chunk-44OIEPIO.js +4 -23
- package/dist/chunk-4EQQGUZ7.cjs +104 -0
- package/dist/chunk-4OUGA3KS.js +1 -5
- package/dist/chunk-4R5MDGL6.cjs +280 -0
- package/dist/chunk-65W4I66Q.cjs +103 -0
- package/dist/{chunk-3CPI6ZIC.js → chunk-66THRMD7.js} +10 -35
- package/dist/chunk-6TZCVTW5.js +3 -4
- package/dist/chunk-6WP7EA4F.js +2 -4
- package/dist/chunk-74A4HLIO.cjs +42 -0
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/chunk-7NA7X7W2.cjs +77 -0
- package/dist/chunk-7PJYY46L.cjs +2 -0
- package/dist/chunk-AFF6XYKL.cjs +71 -0
- package/dist/{chunk-2XU3XXUE.js → chunk-AJBZA23L.js} +3 -25
- package/dist/chunk-AWFZKS27.cjs +11 -0
- package/dist/{chunk-LVKKICOB.js → chunk-AXEKIRRY.js} +22 -62
- package/dist/chunk-B3FD67F2.cjs +256 -0
- package/dist/chunk-BJBWWIZV.cjs +2 -0
- package/dist/{chunk-UAZKHSEU.js → chunk-E3XNKAMI.js} +5 -15
- package/dist/{chunk-VQDDL3UH.js → chunk-E7FLETFO.js} +2 -8
- package/dist/{chunk-YAM6P5OQ.js → chunk-EI2M567U.js} +2 -6
- package/dist/chunk-EJTL2BOZ.cjs +42 -0
- package/dist/chunk-ETBRAKVV.js +1 -5
- package/dist/{chunk-6OYJC4TZ.js → chunk-EZ2OFDBJ.js} +5 -19
- package/dist/chunk-FBOZIVVQ.js +1 -0
- package/dist/{chunk-CAWQEHKP.js → chunk-GDFPZ3NJ.js} +4 -19
- package/dist/{chunk-UKXCGQPS.js → chunk-GIQAIHUI.js} +8 -33
- package/dist/chunk-GSUQGDCL.cjs +235 -0
- package/dist/{chunk-D6YJ5X3C.js → chunk-H3HRSRR5.js} +4 -12
- package/dist/chunk-HDP4QAZL.js +1 -4
- package/dist/chunk-HMLYJVZM.cjs +410 -0
- package/dist/chunk-IPJA3ZS6.cjs +10 -0
- package/dist/{chunk-XPHNS7NW.js → chunk-IUM6CQYX.js} +3 -12
- package/dist/{chunk-26K5EJD3.js → chunk-J56Q6C4Y.js} +4 -18
- package/dist/chunk-JBTR3FQD.cjs +135 -0
- package/dist/chunk-JNQKQKHS.cjs +81 -0
- package/dist/chunk-JOZC4T6C.cjs +168 -0
- package/dist/{chunk-JEVLCA5C.js → chunk-JUGNTIVU.js} +6 -19
- package/dist/{chunk-NFPRKZQ5.js → chunk-JY6COF3X.js} +5 -22
- package/dist/{chunk-ICCGLO6V.js → chunk-KLVJIC2O.js} +5 -17
- package/dist/chunk-KSZYOX6S.cjs +91 -0
- package/dist/chunk-KVGZ2TSG.cjs +274 -0
- package/dist/chunk-LDM7RNNN.js +1 -0
- package/dist/{chunk-65TUD7JV.js → chunk-LLQH6CCB.js} +10 -28
- package/dist/chunk-M34E2AMK.js +1 -5
- package/dist/chunk-MF56KEI4.js +1 -4
- package/dist/chunk-MLKGABMK.js +1 -3
- package/dist/chunk-MLPZKUCO.js +4 -5
- package/dist/chunk-MWXJ6DZ2.cjs +21 -0
- package/dist/{chunk-IBRBSDLT.js → chunk-N7UKZ5X7.js} +2 -6
- package/dist/chunk-NDUC7OV6.cjs +74 -0
- package/dist/{chunk-PDSIWL7I.js → chunk-NLACTMZT.js} +6 -19
- package/dist/chunk-NNKBKENK.cjs +15 -0
- package/dist/chunk-NRG6QX3L.js +1 -3
- package/dist/chunk-OCCGJ4S6.js +8 -0
- package/dist/chunk-ODY2NKQU.cjs +50 -0
- package/dist/chunk-OM5ZSXQW.cjs +91 -0
- package/dist/chunk-OOEORM7H.cjs +334 -0
- package/dist/chunk-OPDWMD4Q.js +1 -3
- package/dist/chunk-OSL4CNSO.js +7 -23
- package/dist/chunk-OXXMTDOY.cjs +86 -0
- package/dist/chunk-PA3UTI4A.js +1 -4
- package/dist/chunk-QEEAIXL5.cjs +74 -0
- package/dist/chunk-RYVW7RUM.js +2 -6
- package/dist/chunk-S6QBPXBI.cjs +107 -0
- package/dist/chunk-TL34BLQD.cjs +10 -0
- package/dist/chunk-TPZHMD7J.cjs +72 -0
- package/dist/chunk-UAPK3AIJ.js +1 -10
- package/dist/chunk-UF5IKELS.cjs +26 -0
- package/dist/chunk-UNX7V6P6.cjs +60 -0
- package/dist/chunk-UUCRWJJR.cjs +313 -0
- package/dist/chunk-VDFLPO7B.cjs +396 -0
- package/dist/chunk-VHD7CW5O.cjs +43 -0
- package/dist/chunk-VL4QNALG.cjs +50 -0
- package/dist/chunk-WR7LSUIR.cjs +213 -0
- package/dist/chunk-XE6D4J63.cjs +72 -0
- package/dist/chunk-ZLG2M2I4.cjs +21 -0
- package/dist/chunk-ZSHVXDA2.js +4 -10
- package/dist/client.cjs +40 -4360
- package/dist/client.js +32 -37
- package/dist/core/client.cjs +10 -476
- package/dist/core/client.js +6 -11
- package/dist/core/error.cjs +8 -251
- package/dist/core/error.js +4 -9
- package/dist/core/index.cjs +20 -488
- package/dist/core/index.js +8 -19
- package/dist/core/resource.cjs +9 -33
- package/dist/core/resource.js +2 -7
- package/dist/edge.cjs +62 -1111
- package/dist/edge.js +10 -42
- package/dist/index.cjs +115 -4431
- package/dist/index.js +39 -87
- package/dist/modelrouter/core.cjs +28 -648
- package/dist/modelrouter/core.js +8 -21
- package/dist/modelrouter/index.cjs +28 -648
- package/dist/modelrouter/index.js +8 -21
- package/dist/modelrouter/types.cjs +1 -17
- package/dist/modelrouter/types.js +1 -0
- package/dist/subagents/anthropic.cjs +27 -2784
- package/dist/subagents/anthropic.js +19 -24
- package/dist/subagents/index.cjs +14 -95
- package/dist/subagents/index.js +2 -11
- package/dist/subagents/prompts.cjs +14 -93
- package/dist/subagents/prompts.js +2 -11
- package/dist/subagents/types.cjs +1 -17
- package/dist/subagents/types.js +1 -0
- package/dist/subagents/vercel.cjs +27 -2761
- package/dist/subagents/vercel.js +19 -24
- package/dist/tools/compact/core.cjs +12 -548
- package/dist/tools/compact/core.js +8 -13
- package/dist/tools/compact/index.cjs +17 -595
- package/dist/tools/compact/index.js +9 -17
- package/dist/tools/compact/types.cjs +1 -17
- package/dist/tools/compact/types.js +1 -0
- package/dist/tools/fastapply/anthropic.cjs +27 -891
- package/dist/tools/fastapply/anthropic.js +11 -24
- package/dist/tools/fastapply/apply.cjs +28 -672
- package/dist/tools/fastapply/apply.js +4 -19
- package/dist/tools/fastapply/core.cjs +37 -1061
- package/dist/tools/fastapply/core.js +9 -29
- package/dist/tools/fastapply/index.cjs +62 -1062
- package/dist/tools/fastapply/index.js +14 -44
- package/dist/tools/fastapply/openai.cjs +32 -901
- package/dist/tools/fastapply/openai.js +11 -26
- package/dist/tools/fastapply/prompts.cjs +10 -62
- package/dist/tools/fastapply/prompts.js +2 -9
- package/dist/tools/fastapply/types.cjs +1 -17
- package/dist/tools/fastapply/types.js +1 -0
- package/dist/tools/fastapply/vercel.cjs +25 -897
- package/dist/tools/fastapply/vercel.js +11 -22
- package/dist/tools/index.cjs +62 -1062
- package/dist/tools/index.js +14 -44
- package/dist/tools/utils/resilience.cjs +15 -312
- package/dist/tools/utils/resilience.js +3 -12
- package/dist/tools/warp_grep/agent/config.cjs +16 -127
- package/dist/tools/warp_grep/agent/config.js +2 -11
- package/dist/tools/warp_grep/agent/formatter.cjs +12 -48
- package/dist/tools/warp_grep/agent/formatter.js +2 -9
- package/dist/tools/warp_grep/agent/parser.cjs +16 -83
- package/dist/tools/warp_grep/agent/parser.js +2 -11
- package/dist/tools/warp_grep/agent/runner.cjs +15 -1081
- package/dist/tools/warp_grep/agent/runner.js +7 -14
- package/dist/tools/warp_grep/agent/types.cjs +1 -17
- package/dist/tools/warp_grep/agent/types.js +1 -0
- package/dist/tools/warp_grep/anthropic.cjs +47 -2561
- package/dist/tools/warp_grep/anthropic.js +19 -35
- package/dist/tools/warp_grep/client.cjs +49 -2471
- package/dist/tools/warp_grep/client.js +17 -34
- package/dist/tools/warp_grep/gemini.cjs +48 -2490
- package/dist/tools/warp_grep/gemini.js +21 -41
- package/dist/tools/warp_grep/harness.cjs +81 -936
- package/dist/tools/warp_grep/harness.js +12 -51
- package/dist/tools/warp_grep/index.cjs +124 -2575
- package/dist/tools/warp_grep/index.js +24 -87
- package/dist/tools/warp_grep/openai.cjs +53 -2575
- package/dist/tools/warp_grep/openai.js +19 -37
- package/dist/tools/warp_grep/providers/code_storage_http.cjs +12 -65
- package/dist/tools/warp_grep/providers/code_storage_http.js +2 -9
- package/dist/tools/warp_grep/providers/local.cjs +10 -589
- package/dist/tools/warp_grep/providers/local.js +6 -11
- package/dist/tools/warp_grep/providers/remote.cjs +8 -331
- package/dist/tools/warp_grep/providers/remote.js +3 -8
- package/dist/tools/warp_grep/providers/types.cjs +1 -17
- package/dist/tools/warp_grep/providers/types.js +1 -0
- package/dist/tools/warp_grep/utils/files.cjs +9 -42
- package/dist/tools/warp_grep/utils/files.js +2 -7
- package/dist/tools/warp_grep/utils/github.cjs +9 -43
- package/dist/tools/warp_grep/utils/github.js +2 -7
- package/dist/tools/warp_grep/utils/paths.cjs +28 -104
- package/dist/tools/warp_grep/utils/paths.js +2 -17
- package/dist/tools/warp_grep/utils/ripgrep.cjs +9 -103
- package/dist/tools/warp_grep/utils/ripgrep.js +2 -7
- package/dist/tools/warp_grep/vercel.cjs +53 -2557
- package/dist/tools/warp_grep/vercel.js +19 -37
- package/dist/version.cjs +7 -225
- package/dist/version.js +2 -7
- package/package.json +2 -2
- package/dist/chunk-E6TL6MIH.js +0 -203
|
@@ -1,335 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkWR7LSUIR_cjs = require('../../../chunk-WR7LSUIR.cjs');
|
|
4
|
+
require('../../../chunk-4EQQGUZ7.cjs');
|
|
5
|
+
require('../../../chunk-75ZPJI57.cjs');
|
|
19
6
|
|
|
20
|
-
// tools/warp_grep/providers/remote.ts
|
|
21
|
-
var remote_exports = {};
|
|
22
|
-
__export(remote_exports, {
|
|
23
|
-
RemoteCommandsProvider: () => RemoteCommandsProvider
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(remote_exports);
|
|
26
7
|
|
|
27
|
-
// tools/warp_grep/agent/config.ts
|
|
28
|
-
var parseEnvTimeout = (envValue, defaultMs) => {
|
|
29
|
-
if (!envValue) return defaultMs;
|
|
30
|
-
const parsed = parseInt(envValue, 10);
|
|
31
|
-
return isNaN(parsed) || parsed <= 0 ? defaultMs : parsed;
|
|
32
|
-
};
|
|
33
|
-
var AGENT_CONFIG = {
|
|
34
|
-
MAX_TURNS: 6,
|
|
35
|
-
/** Default timeout for model calls. Can be overridden via MORPH_WARP_GREP_TIMEOUT env var (in ms) */
|
|
36
|
-
TIMEOUT_MS: parseEnvTimeout(process.env.MORPH_WARP_GREP_TIMEOUT, 6e4),
|
|
37
|
-
MAX_CONTEXT_CHARS: 321600,
|
|
38
|
-
MAX_OUTPUT_LINES: 200,
|
|
39
|
-
MAX_LIST_RESULTS: 500,
|
|
40
|
-
MAX_READ_LINES: 800,
|
|
41
|
-
MAX_LIST_DEPTH: 3,
|
|
42
|
-
LIST_TIMEOUT_MS: 2e3
|
|
43
|
-
};
|
|
44
|
-
var BUILTIN_EXCLUDES = [
|
|
45
|
-
// Version control
|
|
46
|
-
".git",
|
|
47
|
-
".svn",
|
|
48
|
-
".hg",
|
|
49
|
-
".bzr",
|
|
50
|
-
// Dependencies
|
|
51
|
-
"node_modules",
|
|
52
|
-
"bower_components",
|
|
53
|
-
".pnpm",
|
|
54
|
-
".yarn",
|
|
55
|
-
"vendor",
|
|
56
|
-
"packages",
|
|
57
|
-
"Pods",
|
|
58
|
-
".bundle",
|
|
59
|
-
// Python
|
|
60
|
-
"__pycache__",
|
|
61
|
-
".pytest_cache",
|
|
62
|
-
".mypy_cache",
|
|
63
|
-
".ruff_cache",
|
|
64
|
-
".venv",
|
|
65
|
-
"venv",
|
|
66
|
-
".tox",
|
|
67
|
-
".nox",
|
|
68
|
-
".eggs",
|
|
69
|
-
"*.egg-info",
|
|
70
|
-
// Build outputs
|
|
71
|
-
"dist",
|
|
72
|
-
"build",
|
|
73
|
-
"out",
|
|
74
|
-
"output",
|
|
75
|
-
"target",
|
|
76
|
-
"_build",
|
|
77
|
-
".next",
|
|
78
|
-
".nuxt",
|
|
79
|
-
".output",
|
|
80
|
-
".vercel",
|
|
81
|
-
".netlify",
|
|
82
|
-
// Cache directories
|
|
83
|
-
".cache",
|
|
84
|
-
".parcel-cache",
|
|
85
|
-
".turbo",
|
|
86
|
-
".nx",
|
|
87
|
-
".gradle",
|
|
88
|
-
// IDE/Editor
|
|
89
|
-
".idea",
|
|
90
|
-
".vscode",
|
|
91
|
-
".vs",
|
|
92
|
-
// Coverage
|
|
93
|
-
"coverage",
|
|
94
|
-
".coverage",
|
|
95
|
-
"htmlcov",
|
|
96
|
-
".nyc_output",
|
|
97
|
-
// Temporary
|
|
98
|
-
"tmp",
|
|
99
|
-
"temp",
|
|
100
|
-
".tmp",
|
|
101
|
-
".temp",
|
|
102
|
-
// Lock files
|
|
103
|
-
"package-lock.json",
|
|
104
|
-
"yarn.lock",
|
|
105
|
-
"pnpm-lock.yaml",
|
|
106
|
-
"bun.lockb",
|
|
107
|
-
"Cargo.lock",
|
|
108
|
-
"Gemfile.lock",
|
|
109
|
-
"poetry.lock",
|
|
110
|
-
// Binary/minified
|
|
111
|
-
"*.min.js",
|
|
112
|
-
"*.min.css",
|
|
113
|
-
"*.bundle.js",
|
|
114
|
-
"*.wasm",
|
|
115
|
-
"*.so",
|
|
116
|
-
"*.dll",
|
|
117
|
-
"*.pyc",
|
|
118
|
-
"*.map",
|
|
119
|
-
"*.js.map",
|
|
120
|
-
// Hidden directories catch-all
|
|
121
|
-
".*"
|
|
122
|
-
];
|
|
123
|
-
var DEFAULT_EXCLUDES = (process.env.MORPH_WARP_GREP_EXCLUDE || "").split(",").map((s) => s.trim()).filter(Boolean).concat(BUILTIN_EXCLUDES);
|
|
124
8
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
".git",
|
|
129
|
-
".svn",
|
|
130
|
-
".hg",
|
|
131
|
-
".bzr",
|
|
132
|
-
// Dependencies
|
|
133
|
-
"node_modules",
|
|
134
|
-
"bower_components",
|
|
135
|
-
".pnpm",
|
|
136
|
-
".yarn",
|
|
137
|
-
"vendor",
|
|
138
|
-
"Pods",
|
|
139
|
-
".bundle",
|
|
140
|
-
// Python
|
|
141
|
-
"__pycache__",
|
|
142
|
-
".pytest_cache",
|
|
143
|
-
".mypy_cache",
|
|
144
|
-
".ruff_cache",
|
|
145
|
-
".venv",
|
|
146
|
-
"venv",
|
|
147
|
-
".tox",
|
|
148
|
-
".nox",
|
|
149
|
-
".eggs",
|
|
150
|
-
// Build outputs
|
|
151
|
-
"dist",
|
|
152
|
-
"build",
|
|
153
|
-
"out",
|
|
154
|
-
"output",
|
|
155
|
-
"target",
|
|
156
|
-
"_build",
|
|
157
|
-
".next",
|
|
158
|
-
".nuxt",
|
|
159
|
-
".output",
|
|
160
|
-
".vercel",
|
|
161
|
-
".netlify",
|
|
162
|
-
// Cache
|
|
163
|
-
".cache",
|
|
164
|
-
".parcel-cache",
|
|
165
|
-
".turbo",
|
|
166
|
-
".nx",
|
|
167
|
-
".gradle",
|
|
168
|
-
// IDE
|
|
169
|
-
".idea",
|
|
170
|
-
".vscode",
|
|
171
|
-
".vs",
|
|
172
|
-
// Coverage
|
|
173
|
-
"coverage",
|
|
174
|
-
".coverage",
|
|
175
|
-
"htmlcov",
|
|
176
|
-
".nyc_output",
|
|
177
|
-
// Temp
|
|
178
|
-
"tmp",
|
|
179
|
-
"temp",
|
|
180
|
-
".tmp",
|
|
181
|
-
".temp",
|
|
182
|
-
// Lock files
|
|
183
|
-
"package-lock.json",
|
|
184
|
-
"yarn.lock",
|
|
185
|
-
"pnpm-lock.yaml",
|
|
186
|
-
"bun.lockb",
|
|
187
|
-
"Cargo.lock",
|
|
188
|
-
"Gemfile.lock",
|
|
189
|
-
"poetry.lock"
|
|
190
|
-
]);
|
|
191
|
-
var SKIP_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
192
|
-
".min.js",
|
|
193
|
-
".min.css",
|
|
194
|
-
".bundle.js",
|
|
195
|
-
".wasm",
|
|
196
|
-
".so",
|
|
197
|
-
".dll",
|
|
198
|
-
".pyc",
|
|
199
|
-
".map",
|
|
200
|
-
".js.map"
|
|
201
|
-
]);
|
|
202
|
-
function shouldSkip(name) {
|
|
203
|
-
if (SKIP_NAMES.has(name)) return true;
|
|
204
|
-
if (name.startsWith(".")) return true;
|
|
205
|
-
for (const ext of SKIP_EXTENSIONS) {
|
|
206
|
-
if (name.endsWith(ext)) return true;
|
|
207
|
-
}
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
|
-
var RemoteCommandsProvider = class {
|
|
211
|
-
constructor(repoRoot, commands) {
|
|
212
|
-
this.repoRoot = repoRoot;
|
|
213
|
-
this.commands = commands;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Run grep command and parse ripgrep output
|
|
217
|
-
*/
|
|
218
|
-
async grep(params) {
|
|
219
|
-
try {
|
|
220
|
-
const stdout = await this.commands.grep(params.pattern, params.path, params.glob);
|
|
221
|
-
const lines = (stdout || "").trim().split(/\r?\n/).filter((l) => l.length > 0);
|
|
222
|
-
if (lines.length > AGENT_CONFIG.MAX_OUTPUT_LINES) {
|
|
223
|
-
const truncated = lines.slice(0, AGENT_CONFIG.MAX_OUTPUT_LINES);
|
|
224
|
-
truncated.push(`... (output truncated at ${AGENT_CONFIG.MAX_OUTPUT_LINES} of ${lines.length} lines)`);
|
|
225
|
-
return { lines: truncated };
|
|
226
|
-
}
|
|
227
|
-
return { lines };
|
|
228
|
-
} catch (error) {
|
|
229
|
-
return {
|
|
230
|
-
lines: [],
|
|
231
|
-
error: `[GREP ERROR] ${error instanceof Error ? error.message : String(error)}`
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Read file and add line numbers
|
|
237
|
-
*/
|
|
238
|
-
async read(params) {
|
|
239
|
-
const rawStart = params.start;
|
|
240
|
-
const rawEnd = params.end;
|
|
241
|
-
const startValid = rawStart === void 0 || Number.isFinite(rawStart) && rawStart > 0;
|
|
242
|
-
const endValid = rawEnd === void 0 || Number.isFinite(rawEnd) && rawEnd > 0;
|
|
243
|
-
const rangeValid = startValid && endValid && (rawStart === void 0 || rawEnd === void 0 || rawStart <= rawEnd);
|
|
244
|
-
const start = rangeValid && rawStart !== void 0 ? rawStart : 1;
|
|
245
|
-
const end = rangeValid && rawEnd !== void 0 ? rawEnd : 1e6;
|
|
246
|
-
try {
|
|
247
|
-
const stdout = await this.commands.read(params.path, start, end);
|
|
248
|
-
const contentLines = (stdout || "").split("\n");
|
|
249
|
-
if (contentLines.length > 0 && contentLines[contentLines.length - 1] === "") {
|
|
250
|
-
contentLines.pop();
|
|
251
|
-
}
|
|
252
|
-
const lines = contentLines.map((content, idx) => `${start + idx}|${content}`);
|
|
253
|
-
if (lines.length > AGENT_CONFIG.MAX_READ_LINES) {
|
|
254
|
-
const truncated = lines.slice(0, AGENT_CONFIG.MAX_READ_LINES);
|
|
255
|
-
truncated.push(`... (output truncated at ${AGENT_CONFIG.MAX_READ_LINES} of ${lines.length} lines)`);
|
|
256
|
-
return { lines: truncated };
|
|
257
|
-
}
|
|
258
|
-
return { lines };
|
|
259
|
-
} catch (error) {
|
|
260
|
-
return {
|
|
261
|
-
lines: [],
|
|
262
|
-
error: `[READ ERROR] ${error instanceof Error ? error.message : String(error)}`
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* List directory and parse find output
|
|
268
|
-
*/
|
|
269
|
-
async listDirectory(params) {
|
|
270
|
-
const maxDepth = params.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;
|
|
271
|
-
const maxResults = params.maxResults ?? AGENT_CONFIG.MAX_OUTPUT_LINES;
|
|
272
|
-
try {
|
|
273
|
-
const stdout = await this.commands.listDir(params.path, maxDepth);
|
|
274
|
-
const paths = (stdout || "").trim().split(/\r?\n/).filter((p) => p.length > 0);
|
|
275
|
-
const regex = params.pattern ? new RegExp(params.pattern) : null;
|
|
276
|
-
const entries = [];
|
|
277
|
-
for (const fullPath of paths) {
|
|
278
|
-
if (fullPath === params.path || fullPath === this.repoRoot) continue;
|
|
279
|
-
const name = fullPath.split("/").pop() || "";
|
|
280
|
-
if (shouldSkip(name)) continue;
|
|
281
|
-
if (regex && !regex.test(name)) continue;
|
|
282
|
-
let relativePath = fullPath;
|
|
283
|
-
if (fullPath.startsWith(this.repoRoot)) {
|
|
284
|
-
relativePath = fullPath.slice(this.repoRoot.length).replace(/^\//, "");
|
|
285
|
-
}
|
|
286
|
-
const depth = relativePath.split("/").filter(Boolean).length - 1;
|
|
287
|
-
const hasExtension = name.includes(".") && !name.startsWith(".");
|
|
288
|
-
const type = hasExtension ? "file" : "dir";
|
|
289
|
-
entries.push({
|
|
290
|
-
name,
|
|
291
|
-
path: relativePath,
|
|
292
|
-
type,
|
|
293
|
-
depth: Math.max(0, depth)
|
|
294
|
-
});
|
|
295
|
-
if (entries.length >= maxResults) break;
|
|
296
|
-
}
|
|
297
|
-
return entries;
|
|
298
|
-
} catch (error) {
|
|
299
|
-
return [];
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Glob search - finds files matching a pattern.
|
|
304
|
-
* Falls back to a grep --files approach via the listDir command.
|
|
305
|
-
*/
|
|
306
|
-
async glob(params) {
|
|
307
|
-
const searchPath = params.path || this.repoRoot;
|
|
308
|
-
try {
|
|
309
|
-
const stdout = await this.commands.listDir(searchPath, 10);
|
|
310
|
-
const allPaths = (stdout || "").trim().split(/\r?\n/).filter((p) => p.length > 0);
|
|
311
|
-
const globToRegex = (glob) => {
|
|
312
|
-
const escaped = glob.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
313
|
-
return new RegExp(escaped);
|
|
314
|
-
};
|
|
315
|
-
const regex = globToRegex(params.pattern);
|
|
316
|
-
const matched = allPaths.filter((p) => {
|
|
317
|
-
const name = p.split("/").pop() || "";
|
|
318
|
-
return regex.test(name) && !shouldSkip(name);
|
|
319
|
-
});
|
|
320
|
-
const totalFound = matched.length;
|
|
321
|
-
return { files: matched.slice(0, 100), searchDir: searchPath, totalFound };
|
|
322
|
-
} catch (error) {
|
|
323
|
-
return {
|
|
324
|
-
files: [],
|
|
325
|
-
searchDir: searchPath,
|
|
326
|
-
totalFound: 0,
|
|
327
|
-
error: `[GLOB ERROR] ${error instanceof Error ? error.message : String(error)}`
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
333
|
-
0 && (module.exports = {
|
|
334
|
-
RemoteCommandsProvider
|
|
9
|
+
Object.defineProperty(exports, "RemoteCommandsProvider", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkWR7LSUIR_cjs.RemoteCommandsProvider; }
|
|
335
12
|
});
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "../../../chunk-M34E2AMK.js";
|
|
5
|
-
import "../../../chunk-MLKGABMK.js";
|
|
6
|
-
export {
|
|
7
|
-
RemoteCommandsProvider
|
|
8
|
-
};
|
|
1
|
+
export { RemoteCommandsProvider } from '../../../chunk-RYVW7RUM.js';
|
|
2
|
+
import '../../../chunk-M34E2AMK.js';
|
|
3
|
+
import '../../../chunk-MLKGABMK.js';
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
15
2
|
|
|
16
|
-
// tools/warp_grep/providers/types.ts
|
|
17
|
-
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,44 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const content = await import_promises.default.readFile(filePath, "utf8");
|
|
39
|
-
return content.split(/\r?\n/);
|
|
40
|
-
}
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
readAllLines
|
|
3
|
+
var chunkNNKBKENK_cjs = require('../../../chunk-NNKBKENK.cjs');
|
|
4
|
+
require('../../../chunk-75ZPJI57.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "readAllLines", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkNNKBKENK_cjs.readAllLines; }
|
|
44
11
|
});
|
|
@@ -1,45 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const urlPattern = /^(?:https?:\/\/)?github\.com\/([^\/]+)\/([^\/\?\#]+)/;
|
|
29
|
-
const match = input.match(urlPattern);
|
|
30
|
-
if (match) {
|
|
31
|
-
return { owner: match[1], repo: match[2].replace(/\.git$/, "") };
|
|
32
|
-
}
|
|
33
|
-
const shortPattern = /^([^\/]+)\/([^\/]+)$/;
|
|
34
|
-
const shortMatch = input.match(shortPattern);
|
|
35
|
-
if (shortMatch && !shortMatch[1].includes(".")) {
|
|
36
|
-
return { owner: shortMatch[1], repo: shortMatch[2].replace(/\.git$/, "") };
|
|
37
|
-
}
|
|
38
|
-
throw new Error(
|
|
39
|
-
`Invalid GitHub URL or shorthand: "${input}". Expected "owner/repo" or "https://github.com/owner/repo"`
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
parseGitHubUrl
|
|
3
|
+
var chunkMWXJ6DZ2_cjs = require('../../../chunk-MWXJ6DZ2.cjs');
|
|
4
|
+
require('../../../chunk-75ZPJI57.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "parseGitHubUrl", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkMWXJ6DZ2_cjs.parseGitHubUrl; }
|
|
45
11
|
});
|
|
@@ -1,107 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
3
|
+
var chunkQEEAIXL5_cjs = require('../../../chunk-QEEAIXL5.cjs');
|
|
4
|
+
require('../../../chunk-75ZPJI57.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "ensureWithinRepo", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkQEEAIXL5_cjs.ensureWithinRepo; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "fixPathRepetition", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkQEEAIXL5_cjs.fixPathRepetition; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "isSymlink", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunkQEEAIXL5_cjs.isSymlink; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "isTextualFile", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunkQEEAIXL5_cjs.isTextualFile; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "resolveUnderRepo", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunkQEEAIXL5_cjs.resolveUnderRepo; }
|
|
39
27
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function resolveUnderRepo(repoRoot, targetPath) {
|
|
44
|
-
const absRoot = import_path.default.resolve(repoRoot);
|
|
45
|
-
const resolved = import_path.default.resolve(absRoot, targetPath);
|
|
46
|
-
ensureWithinRepo(absRoot, resolved);
|
|
47
|
-
return resolved;
|
|
48
|
-
}
|
|
49
|
-
function ensureWithinRepo(repoRoot, absTarget) {
|
|
50
|
-
const rel = import_path.default.relative(import_path.default.resolve(repoRoot), import_path.default.resolve(absTarget));
|
|
51
|
-
if (rel.startsWith("..") || import_path.default.isAbsolute(rel)) {
|
|
52
|
-
throw new Error(`Path outside repository root: ${absTarget}`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function toRepoRelative(repoRoot, absPath) {
|
|
56
|
-
return import_path.default.relative(import_path.default.resolve(repoRoot), import_path.default.resolve(absPath));
|
|
57
|
-
}
|
|
58
|
-
function isSymlink(p) {
|
|
59
|
-
try {
|
|
60
|
-
const st = import_fs.default.lstatSync(p);
|
|
61
|
-
return st.isSymbolicLink();
|
|
62
|
-
} catch {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function fixPathRepetition(fullPath) {
|
|
67
|
-
const segments = fullPath.split(import_path.default.sep).filter(Boolean);
|
|
68
|
-
if (segments.length < 2) return null;
|
|
69
|
-
for (let len = Math.floor(segments.length / 2); len >= 1; len--) {
|
|
70
|
-
for (let i = 0; i <= segments.length - 2 * len; i++) {
|
|
71
|
-
const first = segments.slice(i, i + len);
|
|
72
|
-
const second = segments.slice(i + len, i + 2 * len);
|
|
73
|
-
if (first.every((seg, idx) => seg === second[idx])) {
|
|
74
|
-
const fixed = [...segments.slice(0, i), ...segments.slice(i + len)];
|
|
75
|
-
return import_path.default.sep + fixed.join(import_path.default.sep);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
function isTextualFile(filePath, maxBytes = 2e6) {
|
|
82
|
-
try {
|
|
83
|
-
const st = import_fs.default.statSync(filePath);
|
|
84
|
-
if (!st.isFile()) return false;
|
|
85
|
-
if (st.size > maxBytes) return false;
|
|
86
|
-
const fd = import_fs.default.openSync(filePath, "r");
|
|
87
|
-
const buf = Buffer.alloc(512);
|
|
88
|
-
const read = import_fs.default.readSync(fd, buf, 0, buf.length, 0);
|
|
89
|
-
import_fs.default.closeSync(fd);
|
|
90
|
-
for (let i = 0; i < read; i++) {
|
|
91
|
-
const c = buf[i];
|
|
92
|
-
if (c === 0) return false;
|
|
93
|
-
}
|
|
94
|
-
return true;
|
|
95
|
-
} catch {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
100
|
-
0 && (module.exports = {
|
|
101
|
-
ensureWithinRepo,
|
|
102
|
-
fixPathRepetition,
|
|
103
|
-
isSymlink,
|
|
104
|
-
isTextualFile,
|
|
105
|
-
resolveUnderRepo,
|
|
106
|
-
toRepoRelative
|
|
28
|
+
Object.defineProperty(exports, "toRepoRelative", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return chunkQEEAIXL5_cjs.toRepoRelative; }
|
|
107
31
|
});
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
fixPathRepetition,
|
|
4
|
-
isSymlink,
|
|
5
|
-
isTextualFile,
|
|
6
|
-
resolveUnderRepo,
|
|
7
|
-
toRepoRelative
|
|
8
|
-
} from "../../../chunk-ZSHVXDA2.js";
|
|
9
|
-
import "../../../chunk-MLKGABMK.js";
|
|
10
|
-
export {
|
|
11
|
-
ensureWithinRepo,
|
|
12
|
-
fixPathRepetition,
|
|
13
|
-
isSymlink,
|
|
14
|
-
isTextualFile,
|
|
15
|
-
resolveUnderRepo,
|
|
16
|
-
toRepoRelative
|
|
17
|
-
};
|
|
1
|
+
export { ensureWithinRepo, fixPathRepetition, isSymlink, isTextualFile, resolveUnderRepo, toRepoRelative } from '../../../chunk-ZSHVXDA2.js';
|
|
2
|
+
import '../../../chunk-MLKGABMK.js';
|