@probelabs/probe 0.6.0-rc207 → 0.6.0-rc208
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-rc208-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc208-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc208-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc208-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc208-x86_64-unknown-linux-musl.tar.gz +0 -0
- package/build/agent/bashPermissions.js +88 -7
- package/build/agent/index.js +334 -16
- package/build/agent/mcp/client.js +234 -4
- package/build/agent/mcp/config.js +87 -0
- package/build/agent/mcp/xmlBridge.js +15 -5
- package/build/agent/simpleTelemetry.js +26 -0
- package/build/tools/bash.js +5 -3
- package/cjs/agent/ProbeAgent.cjs +312 -16
- package/cjs/agent/simpleTelemetry.cjs +22 -0
- package/cjs/index.cjs +334 -16
- package/package.json +1 -1
- package/src/agent/bashPermissions.js +88 -7
- package/src/agent/mcp/client.js +234 -4
- package/src/agent/mcp/config.js +87 -0
- package/src/agent/mcp/xmlBridge.js +15 -5
- package/src/agent/simpleTelemetry.js +26 -0
- package/src/tools/bash.js +5 -3
- package/bin/binaries/probe-v0.6.0-rc207-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc207-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc207-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc207-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc207-x86_64-unknown-linux-musl.tar.gz +0 -0
|
@@ -127,6 +127,7 @@ export function parseXmlMcpToolCall(xmlString, mcpToolNames = []) {
|
|
|
127
127
|
export class MCPXmlBridge {
|
|
128
128
|
constructor(options = {}) {
|
|
129
129
|
this.debug = options.debug || false;
|
|
130
|
+
this.tracer = options.tracer || null;
|
|
130
131
|
this.mcpTools = {};
|
|
131
132
|
this.mcpManager = null;
|
|
132
133
|
this.xmlDefinitions = {};
|
|
@@ -179,8 +180,8 @@ export class MCPXmlBridge {
|
|
|
179
180
|
console.error('[MCP DEBUG] Initializing MCP client manager...');
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
// Initialize the MCP client manager
|
|
183
|
-
this.mcpManager = new MCPClientManager({ debug: this.debug });
|
|
183
|
+
// Initialize the MCP client manager with tracer support
|
|
184
|
+
this.mcpManager = new MCPClientManager({ debug: this.debug, tracer: this.tracer });
|
|
184
185
|
const result = await this.mcpManager.initialize(mcpConfigs);
|
|
185
186
|
|
|
186
187
|
// Get tools from the manager
|
|
@@ -211,11 +212,20 @@ export class MCPXmlBridge {
|
|
|
211
212
|
}
|
|
212
213
|
|
|
213
214
|
/**
|
|
214
|
-
* Get
|
|
215
|
+
* Get XML tool definitions for inclusion in system prompt
|
|
216
|
+
* @param {Array<string>|null} filterToolNames - Optional list of tool names to include (if null, include all)
|
|
215
217
|
* @returns {string} Combined XML tool definitions
|
|
216
218
|
*/
|
|
217
|
-
getXmlToolDefinitions() {
|
|
218
|
-
|
|
219
|
+
getXmlToolDefinitions(filterToolNames = null) {
|
|
220
|
+
if (filterToolNames === null) {
|
|
221
|
+
return Object.values(this.xmlDefinitions).join('\n\n');
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Filter definitions based on provided tool names
|
|
225
|
+
return Object.entries(this.xmlDefinitions)
|
|
226
|
+
.filter(([name]) => filterToolNames.includes(name))
|
|
227
|
+
.map(([, def]) => def)
|
|
228
|
+
.join('\n\n');
|
|
219
229
|
}
|
|
220
230
|
|
|
221
231
|
/**
|
|
@@ -231,6 +231,32 @@ export class SimpleAppTracer {
|
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
/**
|
|
235
|
+
* Record MCP (Model Context Protocol) events
|
|
236
|
+
* Tracks server connections, tool discovery, method filtering, and tool execution
|
|
237
|
+
*/
|
|
238
|
+
recordMcpEvent(eventType, data = {}) {
|
|
239
|
+
if (!this.isEnabled()) return;
|
|
240
|
+
|
|
241
|
+
this.addEvent(`mcp.${eventType}`, {
|
|
242
|
+
'session.id': this.sessionId,
|
|
243
|
+
...data
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Record bash tool events
|
|
249
|
+
* Tracks command permission checks, allowed/denied commands, and execution
|
|
250
|
+
*/
|
|
251
|
+
recordBashEvent(eventType, data = {}) {
|
|
252
|
+
if (!this.isEnabled()) return;
|
|
253
|
+
|
|
254
|
+
this.addEvent(`bash.${eventType}`, {
|
|
255
|
+
'session.id': this.sessionId,
|
|
256
|
+
...data
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
234
260
|
setAttributes(attributes) {
|
|
235
261
|
// For simplicity, just log attributes when no active span
|
|
236
262
|
if (this.telemetry && this.telemetry.enableConsole) {
|
package/src/tools/bash.js
CHANGED
|
@@ -31,16 +31,18 @@ export const bashTool = (options = {}) => {
|
|
|
31
31
|
bashConfig = {},
|
|
32
32
|
debug = false,
|
|
33
33
|
cwd,
|
|
34
|
-
allowedFolders = []
|
|
34
|
+
allowedFolders = [],
|
|
35
|
+
tracer = null
|
|
35
36
|
} = options;
|
|
36
37
|
|
|
37
|
-
// Create permission checker
|
|
38
|
+
// Create permission checker with tracer for telemetry
|
|
38
39
|
const permissionChecker = new BashPermissionChecker({
|
|
39
40
|
allow: bashConfig.allow,
|
|
40
41
|
deny: bashConfig.deny,
|
|
41
42
|
disableDefaultAllow: bashConfig.disableDefaultAllow,
|
|
42
43
|
disableDefaultDeny: bashConfig.disableDefaultDeny,
|
|
43
|
-
debug
|
|
44
|
+
debug,
|
|
45
|
+
tracer
|
|
44
46
|
});
|
|
45
47
|
|
|
46
48
|
// Determine default working directory
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|