@probelabs/probe 0.6.0-rc147 → 0.6.0-rc148
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/bin/binaries/probe-v0.6.0-rc148-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc148-aarch64-unknown-linux-gnu.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc148-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc148-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc148-x86_64-unknown-linux-gnu.tar.gz +0 -0
- package/bin/probe +12 -3
- package/build/agent/index.js +18 -404
- package/build/index.js +1 -7
- package/cjs/agent/ProbeAgent.cjs +659 -697
- package/cjs/index.cjs +610 -1274
- package/package.json +1 -12
- package/src/index.js +1 -7
- package/bin/binaries/probe-v0.6.0-rc147-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc147-aarch64-unknown-linux-gnu.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc147-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc147-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc147-x86_64-unknown-linux-gnu.tar.gz +0 -0
- package/build/agent/appTracer.js +0 -360
- package/build/agent/fileSpanExporter.js +0 -167
- package/build/agent/telemetry.js +0 -219
- package/cjs/agent/telemetry.cjs +0 -358
- package/src/agent/appTracer.js +0 -360
- package/src/agent/fileSpanExporter.js +0 -167
- package/src/agent/telemetry.js +0 -219
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/probe
CHANGED
|
@@ -119,10 +119,19 @@ async function main() {
|
|
|
119
119
|
const child = spawn('node', [mcpPath, ...mcpArgs], { stdio: 'inherit' });
|
|
120
120
|
child.on('exit', (code) => process.exit(code || 0));
|
|
121
121
|
} else if (process.argv[2] === 'agent') {
|
|
122
|
-
// Launch Agent server instead of binary
|
|
123
|
-
const agentPath = join(__dirname, '..', '
|
|
122
|
+
// Launch Agent server instead of binary (use bundled version to reduce dependencies)
|
|
123
|
+
const agentPath = join(__dirname, '..', 'build', 'agent', 'index.js');
|
|
124
|
+
|
|
125
|
+
// Verify bundled agent exists
|
|
126
|
+
try {
|
|
127
|
+
await accessAsync(agentPath, constants.F_OK);
|
|
128
|
+
} catch {
|
|
129
|
+
console.error('Error: Bundled agent not found at', agentPath);
|
|
130
|
+
console.error('Please run: npm run build:agent');
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
|
|
124
134
|
const agentArgs = process.argv.slice(3); // Remove 'node', 'probe', and 'agent'
|
|
125
|
-
|
|
126
135
|
const child = spawn('node', [agentPath, ...agentArgs], { stdio: 'inherit' });
|
|
127
136
|
child.on('exit', (code) => process.exit(code || 0));
|
|
128
137
|
} else {
|
package/build/agent/index.js
CHANGED
|
@@ -38,364 +38,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
38
38
|
mod
|
|
39
39
|
));
|
|
40
40
|
|
|
41
|
-
// node_modules/dotenv/package.json
|
|
42
|
-
var require_package = __commonJS({
|
|
43
|
-
"node_modules/dotenv/package.json"(exports2, module2) {
|
|
44
|
-
module2.exports = {
|
|
45
|
-
name: "dotenv",
|
|
46
|
-
version: "16.6.1",
|
|
47
|
-
description: "Loads environment variables from .env file",
|
|
48
|
-
main: "lib/main.js",
|
|
49
|
-
types: "lib/main.d.ts",
|
|
50
|
-
exports: {
|
|
51
|
-
".": {
|
|
52
|
-
types: "./lib/main.d.ts",
|
|
53
|
-
require: "./lib/main.js",
|
|
54
|
-
default: "./lib/main.js"
|
|
55
|
-
},
|
|
56
|
-
"./config": "./config.js",
|
|
57
|
-
"./config.js": "./config.js",
|
|
58
|
-
"./lib/env-options": "./lib/env-options.js",
|
|
59
|
-
"./lib/env-options.js": "./lib/env-options.js",
|
|
60
|
-
"./lib/cli-options": "./lib/cli-options.js",
|
|
61
|
-
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
62
|
-
"./package.json": "./package.json"
|
|
63
|
-
},
|
|
64
|
-
scripts: {
|
|
65
|
-
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
66
|
-
lint: "standard",
|
|
67
|
-
pretest: "npm run lint && npm run dts-check",
|
|
68
|
-
test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
|
|
69
|
-
"test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
|
|
70
|
-
prerelease: "npm test",
|
|
71
|
-
release: "standard-version"
|
|
72
|
-
},
|
|
73
|
-
repository: {
|
|
74
|
-
type: "git",
|
|
75
|
-
url: "git://github.com/motdotla/dotenv.git"
|
|
76
|
-
},
|
|
77
|
-
homepage: "https://github.com/motdotla/dotenv#readme",
|
|
78
|
-
funding: "https://dotenvx.com",
|
|
79
|
-
keywords: [
|
|
80
|
-
"dotenv",
|
|
81
|
-
"env",
|
|
82
|
-
".env",
|
|
83
|
-
"environment",
|
|
84
|
-
"variables",
|
|
85
|
-
"config",
|
|
86
|
-
"settings"
|
|
87
|
-
],
|
|
88
|
-
readmeFilename: "README.md",
|
|
89
|
-
license: "BSD-2-Clause",
|
|
90
|
-
devDependencies: {
|
|
91
|
-
"@types/node": "^18.11.3",
|
|
92
|
-
decache: "^4.6.2",
|
|
93
|
-
sinon: "^14.0.1",
|
|
94
|
-
standard: "^17.0.0",
|
|
95
|
-
"standard-version": "^9.5.0",
|
|
96
|
-
tap: "^19.2.0",
|
|
97
|
-
typescript: "^4.8.4"
|
|
98
|
-
},
|
|
99
|
-
engines: {
|
|
100
|
-
node: ">=12"
|
|
101
|
-
},
|
|
102
|
-
browser: {
|
|
103
|
-
fs: false
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// node_modules/dotenv/lib/main.js
|
|
110
|
-
var require_main = __commonJS({
|
|
111
|
-
"node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
112
|
-
var fs6 = __require("fs");
|
|
113
|
-
var path7 = __require("path");
|
|
114
|
-
var os3 = __require("os");
|
|
115
|
-
var crypto = __require("crypto");
|
|
116
|
-
var packageJson = require_package();
|
|
117
|
-
var version = packageJson.version;
|
|
118
|
-
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
119
|
-
function parse6(src) {
|
|
120
|
-
const obj = {};
|
|
121
|
-
let lines = src.toString();
|
|
122
|
-
lines = lines.replace(/\r\n?/mg, "\n");
|
|
123
|
-
let match2;
|
|
124
|
-
while ((match2 = LINE.exec(lines)) != null) {
|
|
125
|
-
const key = match2[1];
|
|
126
|
-
let value = match2[2] || "";
|
|
127
|
-
value = value.trim();
|
|
128
|
-
const maybeQuote = value[0];
|
|
129
|
-
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
130
|
-
if (maybeQuote === '"') {
|
|
131
|
-
value = value.replace(/\\n/g, "\n");
|
|
132
|
-
value = value.replace(/\\r/g, "\r");
|
|
133
|
-
}
|
|
134
|
-
obj[key] = value;
|
|
135
|
-
}
|
|
136
|
-
return obj;
|
|
137
|
-
}
|
|
138
|
-
function _parseVault(options) {
|
|
139
|
-
options = options || {};
|
|
140
|
-
const vaultPath = _vaultPath(options);
|
|
141
|
-
options.path = vaultPath;
|
|
142
|
-
const result = DotenvModule.configDotenv(options);
|
|
143
|
-
if (!result.parsed) {
|
|
144
|
-
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
145
|
-
err.code = "MISSING_DATA";
|
|
146
|
-
throw err;
|
|
147
|
-
}
|
|
148
|
-
const keys2 = _dotenvKey(options).split(",");
|
|
149
|
-
const length = keys2.length;
|
|
150
|
-
let decrypted;
|
|
151
|
-
for (let i = 0; i < length; i++) {
|
|
152
|
-
try {
|
|
153
|
-
const key = keys2[i].trim();
|
|
154
|
-
const attrs = _instructions(result, key);
|
|
155
|
-
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
156
|
-
break;
|
|
157
|
-
} catch (error) {
|
|
158
|
-
if (i + 1 >= length) {
|
|
159
|
-
throw error;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return DotenvModule.parse(decrypted);
|
|
164
|
-
}
|
|
165
|
-
function _warn(message) {
|
|
166
|
-
console.log(`[dotenv@${version}][WARN] ${message}`);
|
|
167
|
-
}
|
|
168
|
-
function _debug(message) {
|
|
169
|
-
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
170
|
-
}
|
|
171
|
-
function _log(message) {
|
|
172
|
-
console.log(`[dotenv@${version}] ${message}`);
|
|
173
|
-
}
|
|
174
|
-
function _dotenvKey(options) {
|
|
175
|
-
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
176
|
-
return options.DOTENV_KEY;
|
|
177
|
-
}
|
|
178
|
-
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
179
|
-
return process.env.DOTENV_KEY;
|
|
180
|
-
}
|
|
181
|
-
return "";
|
|
182
|
-
}
|
|
183
|
-
function _instructions(result, dotenvKey) {
|
|
184
|
-
let uri;
|
|
185
|
-
try {
|
|
186
|
-
uri = new URL(dotenvKey);
|
|
187
|
-
} catch (error) {
|
|
188
|
-
if (error.code === "ERR_INVALID_URL") {
|
|
189
|
-
const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
|
190
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
191
|
-
throw err;
|
|
192
|
-
}
|
|
193
|
-
throw error;
|
|
194
|
-
}
|
|
195
|
-
const key = uri.password;
|
|
196
|
-
if (!key) {
|
|
197
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
198
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
199
|
-
throw err;
|
|
200
|
-
}
|
|
201
|
-
const environment = uri.searchParams.get("environment");
|
|
202
|
-
if (!environment) {
|
|
203
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
204
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
205
|
-
throw err;
|
|
206
|
-
}
|
|
207
|
-
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
208
|
-
const ciphertext = result.parsed[environmentKey];
|
|
209
|
-
if (!ciphertext) {
|
|
210
|
-
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
211
|
-
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
212
|
-
throw err;
|
|
213
|
-
}
|
|
214
|
-
return { ciphertext, key };
|
|
215
|
-
}
|
|
216
|
-
function _vaultPath(options) {
|
|
217
|
-
let possibleVaultPath = null;
|
|
218
|
-
if (options && options.path && options.path.length > 0) {
|
|
219
|
-
if (Array.isArray(options.path)) {
|
|
220
|
-
for (const filepath of options.path) {
|
|
221
|
-
if (fs6.existsSync(filepath)) {
|
|
222
|
-
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
} else {
|
|
226
|
-
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
227
|
-
}
|
|
228
|
-
} else {
|
|
229
|
-
possibleVaultPath = path7.resolve(process.cwd(), ".env.vault");
|
|
230
|
-
}
|
|
231
|
-
if (fs6.existsSync(possibleVaultPath)) {
|
|
232
|
-
return possibleVaultPath;
|
|
233
|
-
}
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
function _resolveHome(envPath) {
|
|
237
|
-
return envPath[0] === "~" ? path7.join(os3.homedir(), envPath.slice(1)) : envPath;
|
|
238
|
-
}
|
|
239
|
-
function _configVault(options) {
|
|
240
|
-
const debug = Boolean(options && options.debug);
|
|
241
|
-
const quiet = options && "quiet" in options ? options.quiet : true;
|
|
242
|
-
if (debug || !quiet) {
|
|
243
|
-
_log("Loading env from encrypted .env.vault");
|
|
244
|
-
}
|
|
245
|
-
const parsed = DotenvModule._parseVault(options);
|
|
246
|
-
let processEnv = process.env;
|
|
247
|
-
if (options && options.processEnv != null) {
|
|
248
|
-
processEnv = options.processEnv;
|
|
249
|
-
}
|
|
250
|
-
DotenvModule.populate(processEnv, parsed, options);
|
|
251
|
-
return { parsed };
|
|
252
|
-
}
|
|
253
|
-
function configDotenv(options) {
|
|
254
|
-
const dotenvPath = path7.resolve(process.cwd(), ".env");
|
|
255
|
-
let encoding = "utf8";
|
|
256
|
-
const debug = Boolean(options && options.debug);
|
|
257
|
-
const quiet = options && "quiet" in options ? options.quiet : true;
|
|
258
|
-
if (options && options.encoding) {
|
|
259
|
-
encoding = options.encoding;
|
|
260
|
-
} else {
|
|
261
|
-
if (debug) {
|
|
262
|
-
_debug("No encoding is specified. UTF-8 is used by default");
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
let optionPaths = [dotenvPath];
|
|
266
|
-
if (options && options.path) {
|
|
267
|
-
if (!Array.isArray(options.path)) {
|
|
268
|
-
optionPaths = [_resolveHome(options.path)];
|
|
269
|
-
} else {
|
|
270
|
-
optionPaths = [];
|
|
271
|
-
for (const filepath of options.path) {
|
|
272
|
-
optionPaths.push(_resolveHome(filepath));
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
let lastError;
|
|
277
|
-
const parsedAll = {};
|
|
278
|
-
for (const path8 of optionPaths) {
|
|
279
|
-
try {
|
|
280
|
-
const parsed = DotenvModule.parse(fs6.readFileSync(path8, { encoding }));
|
|
281
|
-
DotenvModule.populate(parsedAll, parsed, options);
|
|
282
|
-
} catch (e) {
|
|
283
|
-
if (debug) {
|
|
284
|
-
_debug(`Failed to load ${path8} ${e.message}`);
|
|
285
|
-
}
|
|
286
|
-
lastError = e;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
let processEnv = process.env;
|
|
290
|
-
if (options && options.processEnv != null) {
|
|
291
|
-
processEnv = options.processEnv;
|
|
292
|
-
}
|
|
293
|
-
DotenvModule.populate(processEnv, parsedAll, options);
|
|
294
|
-
if (debug || !quiet) {
|
|
295
|
-
const keysCount = Object.keys(parsedAll).length;
|
|
296
|
-
const shortPaths = [];
|
|
297
|
-
for (const filePath of optionPaths) {
|
|
298
|
-
try {
|
|
299
|
-
const relative = path7.relative(process.cwd(), filePath);
|
|
300
|
-
shortPaths.push(relative);
|
|
301
|
-
} catch (e) {
|
|
302
|
-
if (debug) {
|
|
303
|
-
_debug(`Failed to load ${filePath} ${e.message}`);
|
|
304
|
-
}
|
|
305
|
-
lastError = e;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")}`);
|
|
309
|
-
}
|
|
310
|
-
if (lastError) {
|
|
311
|
-
return { parsed: parsedAll, error: lastError };
|
|
312
|
-
} else {
|
|
313
|
-
return { parsed: parsedAll };
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
function config(options) {
|
|
317
|
-
if (_dotenvKey(options).length === 0) {
|
|
318
|
-
return DotenvModule.configDotenv(options);
|
|
319
|
-
}
|
|
320
|
-
const vaultPath = _vaultPath(options);
|
|
321
|
-
if (!vaultPath) {
|
|
322
|
-
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
323
|
-
return DotenvModule.configDotenv(options);
|
|
324
|
-
}
|
|
325
|
-
return DotenvModule._configVault(options);
|
|
326
|
-
}
|
|
327
|
-
function decrypt(encrypted, keyStr) {
|
|
328
|
-
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
329
|
-
let ciphertext = Buffer.from(encrypted, "base64");
|
|
330
|
-
const nonce = ciphertext.subarray(0, 12);
|
|
331
|
-
const authTag = ciphertext.subarray(-16);
|
|
332
|
-
ciphertext = ciphertext.subarray(12, -16);
|
|
333
|
-
try {
|
|
334
|
-
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
|
335
|
-
aesgcm.setAuthTag(authTag);
|
|
336
|
-
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
337
|
-
} catch (error) {
|
|
338
|
-
const isRange = error instanceof RangeError;
|
|
339
|
-
const invalidKeyLength = error.message === "Invalid key length";
|
|
340
|
-
const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
|
|
341
|
-
if (isRange || invalidKeyLength) {
|
|
342
|
-
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
343
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
344
|
-
throw err;
|
|
345
|
-
} else if (decryptionFailed) {
|
|
346
|
-
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
347
|
-
err.code = "DECRYPTION_FAILED";
|
|
348
|
-
throw err;
|
|
349
|
-
} else {
|
|
350
|
-
throw error;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
function populate(processEnv, parsed, options = {}) {
|
|
355
|
-
const debug = Boolean(options && options.debug);
|
|
356
|
-
const override = Boolean(options && options.override);
|
|
357
|
-
if (typeof parsed !== "object") {
|
|
358
|
-
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
359
|
-
err.code = "OBJECT_REQUIRED";
|
|
360
|
-
throw err;
|
|
361
|
-
}
|
|
362
|
-
for (const key of Object.keys(parsed)) {
|
|
363
|
-
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
364
|
-
if (override === true) {
|
|
365
|
-
processEnv[key] = parsed[key];
|
|
366
|
-
}
|
|
367
|
-
if (debug) {
|
|
368
|
-
if (override === true) {
|
|
369
|
-
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
370
|
-
} else {
|
|
371
|
-
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
} else {
|
|
375
|
-
processEnv[key] = parsed[key];
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
var DotenvModule = {
|
|
380
|
-
configDotenv,
|
|
381
|
-
_configVault,
|
|
382
|
-
_parseVault,
|
|
383
|
-
config,
|
|
384
|
-
decrypt,
|
|
385
|
-
parse: parse6,
|
|
386
|
-
populate
|
|
387
|
-
};
|
|
388
|
-
module2.exports.configDotenv = DotenvModule.configDotenv;
|
|
389
|
-
module2.exports._configVault = DotenvModule._configVault;
|
|
390
|
-
module2.exports._parseVault = DotenvModule._parseVault;
|
|
391
|
-
module2.exports.config = DotenvModule.config;
|
|
392
|
-
module2.exports.decrypt = DotenvModule.decrypt;
|
|
393
|
-
module2.exports.parse = DotenvModule.parse;
|
|
394
|
-
module2.exports.populate = DotenvModule.populate;
|
|
395
|
-
module2.exports = DotenvModule;
|
|
396
|
-
}
|
|
397
|
-
});
|
|
398
|
-
|
|
399
41
|
// node_modules/gpt-tokenizer/esm/bpeRanks/o200k_base.js
|
|
400
42
|
var c0, c1, bpe, o200k_base_default;
|
|
401
43
|
var init_o200k_base = __esm({
|
|
@@ -9993,31 +9635,6 @@ var init_simpleTelemetry = __esm({
|
|
|
9993
9635
|
}
|
|
9994
9636
|
});
|
|
9995
9637
|
|
|
9996
|
-
// src/agent/fileSpanExporter.js
|
|
9997
|
-
import { createWriteStream as createWriteStream2 } from "fs";
|
|
9998
|
-
var init_fileSpanExporter = __esm({
|
|
9999
|
-
"src/agent/fileSpanExporter.js"() {
|
|
10000
|
-
"use strict";
|
|
10001
|
-
}
|
|
10002
|
-
});
|
|
10003
|
-
|
|
10004
|
-
// src/agent/telemetry.js
|
|
10005
|
-
import { existsSync as existsSync3, mkdirSync as mkdirSync2 } from "fs";
|
|
10006
|
-
import { dirname as dirname2 } from "path";
|
|
10007
|
-
var init_telemetry = __esm({
|
|
10008
|
-
"src/agent/telemetry.js"() {
|
|
10009
|
-
"use strict";
|
|
10010
|
-
init_fileSpanExporter();
|
|
10011
|
-
}
|
|
10012
|
-
});
|
|
10013
|
-
|
|
10014
|
-
// src/agent/appTracer.js
|
|
10015
|
-
var init_appTracer = __esm({
|
|
10016
|
-
"src/agent/appTracer.js"() {
|
|
10017
|
-
"use strict";
|
|
10018
|
-
}
|
|
10019
|
-
});
|
|
10020
|
-
|
|
10021
9638
|
// node_modules/balanced-match/index.js
|
|
10022
9639
|
var require_balanced_match = __commonJS({
|
|
10023
9640
|
"node_modules/balanced-match/index.js"(exports2, module2) {
|
|
@@ -16999,11 +16616,10 @@ var init_hooks = __esm({
|
|
|
16999
16616
|
});
|
|
17000
16617
|
|
|
17001
16618
|
// src/index.js
|
|
17002
|
-
|
|
16619
|
+
import dotenv from "dotenv";
|
|
17003
16620
|
var init_index = __esm({
|
|
17004
16621
|
"src/index.js"() {
|
|
17005
16622
|
"use strict";
|
|
17006
|
-
import_dotenv = __toESM(require_main(), 1);
|
|
17007
16623
|
init_search();
|
|
17008
16624
|
init_query();
|
|
17009
16625
|
init_extract();
|
|
@@ -17018,12 +16634,10 @@ var init_index = __esm({
|
|
|
17018
16634
|
init_bash();
|
|
17019
16635
|
init_ProbeAgent();
|
|
17020
16636
|
init_simpleTelemetry();
|
|
17021
|
-
init_telemetry();
|
|
17022
|
-
init_appTracer();
|
|
17023
16637
|
init_probeTool();
|
|
17024
16638
|
init_storage();
|
|
17025
16639
|
init_hooks();
|
|
17026
|
-
|
|
16640
|
+
dotenv.config();
|
|
17027
16641
|
}
|
|
17028
16642
|
});
|
|
17029
16643
|
|
|
@@ -48351,15 +47965,15 @@ Provide only the corrected Mermaid diagram within a mermaid code block. Do not a
|
|
|
48351
47965
|
});
|
|
48352
47966
|
|
|
48353
47967
|
// src/agent/mcp/config.js
|
|
48354
|
-
import { readFileSync, existsSync as
|
|
48355
|
-
import { join as join2, dirname as
|
|
47968
|
+
import { readFileSync, existsSync as existsSync3, mkdirSync as mkdirSync2, writeFileSync } from "fs";
|
|
47969
|
+
import { join as join2, dirname as dirname2 } from "path";
|
|
48356
47970
|
import { homedir } from "os";
|
|
48357
47971
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
48358
47972
|
function loadMCPConfigurationFromPath(configPath) {
|
|
48359
47973
|
if (!configPath) {
|
|
48360
47974
|
throw new Error("Config path is required");
|
|
48361
47975
|
}
|
|
48362
|
-
if (!
|
|
47976
|
+
if (!existsSync3(configPath)) {
|
|
48363
47977
|
throw new Error(`MCP configuration file not found: ${configPath}`);
|
|
48364
47978
|
}
|
|
48365
47979
|
try {
|
|
@@ -48388,7 +48002,7 @@ function loadMCPConfiguration() {
|
|
|
48388
48002
|
].filter(Boolean);
|
|
48389
48003
|
let config = null;
|
|
48390
48004
|
for (const configPath of configPaths) {
|
|
48391
|
-
if (
|
|
48005
|
+
if (existsSync3(configPath)) {
|
|
48392
48006
|
try {
|
|
48393
48007
|
const content = readFileSync(configPath, "utf8");
|
|
48394
48008
|
config = JSON.parse(content);
|
|
@@ -48491,7 +48105,7 @@ var init_config = __esm({
|
|
|
48491
48105
|
"src/agent/mcp/config.js"() {
|
|
48492
48106
|
"use strict";
|
|
48493
48107
|
__filename4 = fileURLToPath6(import.meta.url);
|
|
48494
|
-
__dirname4 =
|
|
48108
|
+
__dirname4 = dirname2(__filename4);
|
|
48495
48109
|
DEFAULT_CONFIG = {
|
|
48496
48110
|
mcpServers: {
|
|
48497
48111
|
// Example probe server configuration
|
|
@@ -49113,6 +48727,7 @@ var ProbeAgent_exports = {};
|
|
|
49113
48727
|
__export(ProbeAgent_exports, {
|
|
49114
48728
|
ProbeAgent: () => ProbeAgent
|
|
49115
48729
|
});
|
|
48730
|
+
import dotenv2 from "dotenv";
|
|
49116
48731
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
49117
48732
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
49118
48733
|
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
|
@@ -49120,14 +48735,13 @@ import { createAmazonBedrock } from "@ai-sdk/amazon-bedrock";
|
|
|
49120
48735
|
import { streamText } from "ai";
|
|
49121
48736
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
49122
48737
|
import { EventEmitter as EventEmitter3 } from "events";
|
|
49123
|
-
import { existsSync as
|
|
48738
|
+
import { existsSync as existsSync4 } from "fs";
|
|
49124
48739
|
import { readFile, stat } from "fs/promises";
|
|
49125
|
-
import { resolve as resolve3, isAbsolute, dirname as
|
|
49126
|
-
var
|
|
48740
|
+
import { resolve as resolve3, isAbsolute, dirname as dirname3 } from "path";
|
|
48741
|
+
var MAX_TOOL_ITERATIONS, MAX_HISTORY_MESSAGES, SUPPORTED_IMAGE_EXTENSIONS, MAX_IMAGE_FILE_SIZE, ProbeAgent;
|
|
49127
48742
|
var init_ProbeAgent = __esm({
|
|
49128
48743
|
"src/agent/ProbeAgent.js"() {
|
|
49129
48744
|
"use strict";
|
|
49130
|
-
import_dotenv2 = __toESM(require_main(), 1);
|
|
49131
48745
|
init_tokenCounter();
|
|
49132
48746
|
init_InMemoryStorageAdapter();
|
|
49133
48747
|
init_HookManager();
|
|
@@ -49139,7 +48753,7 @@ var init_ProbeAgent = __esm({
|
|
|
49139
48753
|
init_schemaUtils();
|
|
49140
48754
|
init_xmlParsingUtils();
|
|
49141
48755
|
init_mcp();
|
|
49142
|
-
|
|
48756
|
+
dotenv2.config();
|
|
49143
48757
|
MAX_TOOL_ITERATIONS = parseInt(process.env.MAX_TOOL_ITERATIONS || "30", 10);
|
|
49144
48758
|
MAX_HISTORY_MESSAGES = 100;
|
|
49145
48759
|
SUPPORTED_IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "webp", "gif", "bmp", "svg"];
|
|
@@ -49509,7 +49123,7 @@ var init_ProbeAgent = __esm({
|
|
|
49509
49123
|
let match2;
|
|
49510
49124
|
while ((match2 = fileHeaderPattern.exec(content)) !== null) {
|
|
49511
49125
|
const filePath = match2[1].trim();
|
|
49512
|
-
const dir =
|
|
49126
|
+
const dir = dirname3(filePath);
|
|
49513
49127
|
if (dir && dir !== ".") {
|
|
49514
49128
|
directories.push(dir);
|
|
49515
49129
|
if (this.debug) {
|
|
@@ -51045,10 +50659,10 @@ Convert your previous response content into actual JSON data that follows this s
|
|
|
51045
50659
|
});
|
|
51046
50660
|
|
|
51047
50661
|
// src/agent/index.js
|
|
51048
|
-
var import_dotenv3 = __toESM(require_main(), 1);
|
|
51049
50662
|
init_ProbeAgent();
|
|
51050
50663
|
init_simpleTelemetry();
|
|
51051
50664
|
init_schemaUtils();
|
|
50665
|
+
import dotenv3 from "dotenv";
|
|
51052
50666
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
51053
50667
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
51054
50668
|
import {
|
|
@@ -51058,7 +50672,7 @@ import {
|
|
|
51058
50672
|
ListToolsRequestSchema,
|
|
51059
50673
|
McpError
|
|
51060
50674
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
51061
|
-
import { readFileSync as readFileSync2, existsSync as
|
|
50675
|
+
import { readFileSync as readFileSync2, existsSync as existsSync5 } from "fs";
|
|
51062
50676
|
import { resolve as resolve4 } from "path";
|
|
51063
50677
|
|
|
51064
50678
|
// src/agent/acp/server.js
|
|
@@ -51728,12 +51342,12 @@ var ACPServer = class {
|
|
|
51728
51342
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
51729
51343
|
|
|
51730
51344
|
// src/agent/index.js
|
|
51731
|
-
|
|
51345
|
+
dotenv3.config();
|
|
51732
51346
|
function readInputContent(input) {
|
|
51733
51347
|
if (!input) return null;
|
|
51734
51348
|
try {
|
|
51735
51349
|
const resolvedPath = resolve4(input);
|
|
51736
|
-
if (
|
|
51350
|
+
if (existsSync5(resolvedPath)) {
|
|
51737
51351
|
return readFileSync2(resolvedPath, "utf-8").trim();
|
|
51738
51352
|
}
|
|
51739
51353
|
} catch (error) {
|
|
@@ -52285,7 +51899,7 @@ async function main() {
|
|
|
52285
51899
|
bashConfig.timeout = timeout;
|
|
52286
51900
|
}
|
|
52287
51901
|
if (config.bashWorkingDir) {
|
|
52288
|
-
if (!
|
|
51902
|
+
if (!existsSync5(config.bashWorkingDir)) {
|
|
52289
51903
|
console.error(`Error: Bash working directory does not exist: ${config.bashWorkingDir}`);
|
|
52290
51904
|
process.exit(1);
|
|
52291
51905
|
}
|
package/build/index.js
CHANGED
|
@@ -39,8 +39,6 @@ import { searchTool, queryTool, extractTool, delegateTool } from './tools/vercel
|
|
|
39
39
|
import { bashTool } from './tools/bash.js';
|
|
40
40
|
import { ProbeAgent } from './agent/ProbeAgent.js';
|
|
41
41
|
import { SimpleTelemetry, SimpleAppTracer, initializeSimpleTelemetryFromOptions } from './agent/simpleTelemetry.js';
|
|
42
|
-
import { TelemetryConfig, initializeTelemetryFromOptions } from './agent/telemetry.js';
|
|
43
|
-
import { AppTracer } from './agent/appTracer.js';
|
|
44
42
|
import { listFilesToolInstance, searchFilesToolInstance } from './agent/probeTool.js';
|
|
45
43
|
import { StorageAdapter, InMemoryStorageAdapter } from './agent/storage/index.js';
|
|
46
44
|
import { HookManager, HOOK_TYPES } from './agent/hooks/index.js';
|
|
@@ -64,14 +62,10 @@ export {
|
|
|
64
62
|
// Export hooks
|
|
65
63
|
HookManager,
|
|
66
64
|
HOOK_TYPES,
|
|
67
|
-
// Export simple telemetry classes (no
|
|
65
|
+
// Export simple telemetry classes (lightweight, no heavy dependencies)
|
|
68
66
|
SimpleTelemetry,
|
|
69
67
|
SimpleAppTracer,
|
|
70
68
|
initializeSimpleTelemetryFromOptions,
|
|
71
|
-
// Export full OpenTelemetry telemetry classes
|
|
72
|
-
TelemetryConfig,
|
|
73
|
-
AppTracer,
|
|
74
|
-
initializeTelemetryFromOptions,
|
|
75
69
|
// Export tool generators directly
|
|
76
70
|
searchTool,
|
|
77
71
|
queryTool,
|