@probelabs/probe 0.6.0-rc296 → 0.6.0-rc298
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-rc296-aarch64-apple-darwin.tar.gz → probe-v0.6.0-rc298-aarch64-apple-darwin.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc296-aarch64-unknown-linux-musl.tar.gz → probe-v0.6.0-rc298-aarch64-unknown-linux-musl.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc296-x86_64-apple-darwin.tar.gz → probe-v0.6.0-rc298-x86_64-apple-darwin.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc296-x86_64-pc-windows-msvc.zip → probe-v0.6.0-rc298-x86_64-pc-windows-msvc.zip} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc296-x86_64-unknown-linux-musl.tar.gz → probe-v0.6.0-rc298-x86_64-unknown-linux-musl.tar.gz} +0 -0
- package/build/agent/ProbeAgent.d.ts +32 -0
- package/build/agent/ProbeAgent.js +20 -1
- package/build/agent/mcp/client.js +34 -0
- package/build/agent/mcp/xmlBridge.js +2 -1
- package/cjs/agent/ProbeAgent.cjs +237 -153
- package/cjs/index.cjs +237 -153
- package/package.json +2 -2
- package/src/agent/ProbeAgent.d.ts +32 -0
- package/src/agent/ProbeAgent.js +20 -1
- package/src/agent/mcp/client.js +34 -0
- package/src/agent/mcp/xmlBridge.js +2 -1
package/src/agent/mcp/client.js
CHANGED
|
@@ -164,6 +164,8 @@ export class MCPClientManager {
|
|
|
164
164
|
this.debug = options.debug || process.env.DEBUG_MCP === '1';
|
|
165
165
|
this.config = null;
|
|
166
166
|
this.tracer = options.tracer || null;
|
|
167
|
+
// Optional event emitter for broadcasting tool call lifecycle to the agent (#522)
|
|
168
|
+
this.agentEvents = options.agentEvents || null;
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
/**
|
|
@@ -452,6 +454,7 @@ export class MCPClientManager {
|
|
|
452
454
|
}
|
|
453
455
|
|
|
454
456
|
const startTime = Date.now();
|
|
457
|
+
const toolCallId = `mcp-${toolName}-${startTime}`;
|
|
455
458
|
|
|
456
459
|
// Record tool call start
|
|
457
460
|
this.recordMcpEvent('tool.call_started', {
|
|
@@ -460,6 +463,17 @@ export class MCPClientManager {
|
|
|
460
463
|
originalToolName: tool.originalName
|
|
461
464
|
});
|
|
462
465
|
|
|
466
|
+
// Emit toolCall event so the agent's activeTools map tracks MCP tool calls (#522)
|
|
467
|
+
if (this.agentEvents) {
|
|
468
|
+
this.agentEvents.emit('toolCall', {
|
|
469
|
+
toolCallId,
|
|
470
|
+
name: toolName,
|
|
471
|
+
args,
|
|
472
|
+
status: 'started',
|
|
473
|
+
timestamp: new Date().toISOString(),
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
|
|
463
477
|
try {
|
|
464
478
|
if (this.debug) {
|
|
465
479
|
console.error(`[MCP DEBUG] Calling ${toolName} with args:`, JSON.stringify(args, null, 2));
|
|
@@ -502,6 +516,16 @@ export class MCPClientManager {
|
|
|
502
516
|
durationMs
|
|
503
517
|
});
|
|
504
518
|
|
|
519
|
+
// Emit toolCall completion so agent's activeTools removes this entry (#522)
|
|
520
|
+
if (this.agentEvents) {
|
|
521
|
+
this.agentEvents.emit('toolCall', {
|
|
522
|
+
toolCallId,
|
|
523
|
+
name: toolName,
|
|
524
|
+
status: 'completed',
|
|
525
|
+
timestamp: new Date().toISOString(),
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
|
|
505
529
|
return result;
|
|
506
530
|
} catch (error) {
|
|
507
531
|
const durationMs = Date.now() - startTime;
|
|
@@ -521,6 +545,16 @@ export class MCPClientManager {
|
|
|
521
545
|
isTimeout: error.message.includes('timeout')
|
|
522
546
|
});
|
|
523
547
|
|
|
548
|
+
// Emit toolCall error so agent's activeTools removes this entry (#522)
|
|
549
|
+
if (this.agentEvents) {
|
|
550
|
+
this.agentEvents.emit('toolCall', {
|
|
551
|
+
toolCallId,
|
|
552
|
+
name: toolName,
|
|
553
|
+
status: 'error',
|
|
554
|
+
timestamp: new Date().toISOString(),
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
|
|
524
558
|
throw error;
|
|
525
559
|
}
|
|
526
560
|
}
|
|
@@ -36,6 +36,7 @@ export class MCPXmlBridge {
|
|
|
36
36
|
constructor(options = {}) {
|
|
37
37
|
this.debug = options.debug || false;
|
|
38
38
|
this.tracer = options.tracer || null;
|
|
39
|
+
this.agentEvents = options.agentEvents || null;
|
|
39
40
|
this.mcpTools = {};
|
|
40
41
|
this.mcpManager = null;
|
|
41
42
|
this.toolDescriptions = {};
|
|
@@ -84,7 +85,7 @@ export class MCPXmlBridge {
|
|
|
84
85
|
console.error('[MCP DEBUG] Initializing MCP client manager...');
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
this.mcpManager = new MCPClientManager({ debug: this.debug, tracer: this.tracer });
|
|
88
|
+
this.mcpManager = new MCPClientManager({ debug: this.debug, tracer: this.tracer, agentEvents: this.agentEvents });
|
|
88
89
|
const result = await this.mcpManager.initialize(mcpConfigs);
|
|
89
90
|
|
|
90
91
|
// Get tools from the manager (already in Vercel format)
|