@probelabs/probe 0.6.0-rc154 → 0.6.0-rc161
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/README.md +80 -1
- package/build/agent/FallbackManager.d.ts +176 -0
- package/build/agent/FallbackManager.js +545 -0
- package/build/agent/ProbeAgent.d.ts +9 -1
- package/build/agent/ProbeAgent.js +218 -10
- package/build/agent/RetryManager.d.ts +157 -0
- package/build/agent/RetryManager.js +334 -0
- package/build/agent/acp/server.js +1 -0
- package/build/agent/acp/tools.js +6 -2
- package/build/agent/index.js +1814 -355
- package/build/agent/probeTool.js +20 -2
- package/build/agent/tools.js +16 -0
- package/build/delegate.js +326 -201
- package/build/downloader.js +46 -17
- package/build/extractor.js +12 -12
- package/build/index.js +13 -0
- package/build/tools/common.js +5 -3
- package/build/tools/edit.js +409 -0
- package/build/tools/index.js +11 -0
- package/build/tools/vercel.js +55 -14
- package/build/utils.js +18 -9
- package/cjs/agent/ProbeAgent.cjs +2268 -699
- package/cjs/index.cjs +75902 -74348
- package/package.json +2 -2
- package/src/agent/FallbackManager.d.ts +176 -0
- package/src/agent/FallbackManager.js +545 -0
- package/src/agent/ProbeAgent.d.ts +9 -1
- package/src/agent/ProbeAgent.js +218 -10
- package/src/agent/RetryManager.d.ts +157 -0
- package/src/agent/RetryManager.js +334 -0
- package/src/agent/acp/server.js +1 -0
- package/src/agent/acp/tools.js +6 -2
- package/src/agent/index.js +8 -0
- package/src/agent/probeTool.js +20 -2
- package/src/agent/tools.js +16 -0
- package/src/delegate.js +326 -201
- package/src/downloader.js +46 -17
- package/src/extractor.js +12 -12
- package/src/index.js +13 -0
- package/src/tools/common.js +5 -3
- package/src/tools/edit.js +409 -0
- package/src/tools/index.js +11 -0
- package/src/tools/vercel.js +55 -14
- package/src/utils.js +18 -9
- package/bin/binaries/probe-v0.6.0-rc154-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc154-aarch64-unknown-linux-gnu.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc154-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc154-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc154-x86_64-unknown-linux-gnu.tar.gz +0 -0
package/build/tools/vercel.js
CHANGED
|
@@ -250,23 +250,64 @@ export const delegateTool = (options = {}) => {
|
|
|
250
250
|
name: 'delegate',
|
|
251
251
|
description: delegateDescription,
|
|
252
252
|
inputSchema: delegateSchema,
|
|
253
|
-
execute: async ({ task }) => {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
253
|
+
execute: async ({ task, currentIteration, maxIterations, parentSessionId, path, provider, model, tracer }) => {
|
|
254
|
+
// Validate required parameters - throw errors for consistency
|
|
255
|
+
if (!task || typeof task !== 'string') {
|
|
256
|
+
throw new Error('Task parameter is required and must be a non-empty string');
|
|
257
|
+
}
|
|
258
258
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
debug
|
|
263
|
-
});
|
|
259
|
+
if (task.trim().length === 0) {
|
|
260
|
+
throw new Error('Task parameter cannot be empty or whitespace only');
|
|
261
|
+
}
|
|
264
262
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
263
|
+
// Validate optional numeric parameters
|
|
264
|
+
if (currentIteration !== undefined && (typeof currentIteration !== 'number' || currentIteration < 0)) {
|
|
265
|
+
throw new Error('currentIteration must be a non-negative number');
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (maxIterations !== undefined && (typeof maxIterations !== 'number' || maxIterations < 1)) {
|
|
269
|
+
throw new Error('maxIterations must be a positive number');
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Validate optional string parameters for type consistency
|
|
273
|
+
if (parentSessionId !== undefined && parentSessionId !== null && typeof parentSessionId !== 'string') {
|
|
274
|
+
throw new TypeError('parentSessionId must be a string, null, or undefined');
|
|
269
275
|
}
|
|
276
|
+
|
|
277
|
+
if (path !== undefined && path !== null && typeof path !== 'string') {
|
|
278
|
+
throw new TypeError('path must be a string, null, or undefined');
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (provider !== undefined && provider !== null && typeof provider !== 'string') {
|
|
282
|
+
throw new TypeError('provider must be a string, null, or undefined');
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (model !== undefined && model !== null && typeof model !== 'string') {
|
|
286
|
+
throw new TypeError('model must be a string, null, or undefined');
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (debug) {
|
|
290
|
+
console.error(`Executing delegate with task: "${task.substring(0, 100)}${task.length > 100 ? '...' : ''}"`);
|
|
291
|
+
if (parentSessionId) {
|
|
292
|
+
console.error(`Parent session: ${parentSessionId}`);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Execute delegation - let errors propagate naturally
|
|
297
|
+
const result = await delegate({
|
|
298
|
+
task,
|
|
299
|
+
timeout,
|
|
300
|
+
debug,
|
|
301
|
+
currentIteration: currentIteration || 0,
|
|
302
|
+
maxIterations: maxIterations || 30,
|
|
303
|
+
parentSessionId,
|
|
304
|
+
path,
|
|
305
|
+
provider,
|
|
306
|
+
model,
|
|
307
|
+
tracer
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
return result;
|
|
270
311
|
}
|
|
271
312
|
});
|
|
272
313
|
};
|
package/build/utils.js
CHANGED
|
@@ -25,9 +25,9 @@ let probeBinaryPath = '';
|
|
|
25
25
|
* @returns {Promise<string>} - Path to the binary
|
|
26
26
|
*/
|
|
27
27
|
export async function getBinaryPath(options = {}) {
|
|
28
|
-
|
|
28
|
+
const { forceDownload = false, version } = options;
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
// Check environment variable first (user override)
|
|
31
31
|
if (process.env.PROBE_PATH && fs.existsSync(process.env.PROBE_PATH) && !forceDownload) {
|
|
32
32
|
probeBinaryPath = process.env.PROBE_PATH;
|
|
33
33
|
return probeBinaryPath;
|
|
@@ -40,13 +40,22 @@ export async function getBinaryPath(options = {}) {
|
|
|
40
40
|
return probeBinaryPath;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
// Prefer local package bin if available (avoids network during tests/monorepo)
|
|
44
|
+
const isWindows = process.platform === 'win32';
|
|
45
|
+
const binaryName = isWindows ? 'probe.exe' : 'probe-binary';
|
|
46
|
+
const localPackageBin = path.resolve(__dirname, '..', 'bin');
|
|
47
|
+
const localBinaryPath = path.join(localPackageBin, binaryName);
|
|
48
|
+
if (fs.existsSync(localBinaryPath) && !forceDownload) {
|
|
49
|
+
// Use committed binary bundled with the repo/package
|
|
50
|
+
probeBinaryPath = localBinaryPath;
|
|
51
|
+
return probeBinaryPath;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Get dynamic bin directory (handles CI, npx, Docker scenarios)
|
|
55
|
+
const binDir = await getPackageBinDir();
|
|
56
|
+
|
|
57
|
+
// Check postinstall binary in resolved directory
|
|
58
|
+
const binaryPath = path.join(binDir, binaryName);
|
|
50
59
|
|
|
51
60
|
if (fs.existsSync(binaryPath) && !forceDownload) {
|
|
52
61
|
probeBinaryPath = binaryPath;
|