@mcpjam/sdk 0.8.1 → 0.8.2
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/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var openai = require('@ai-sdk/openai');
|
|
|
17
17
|
var xai = require('@ai-sdk/xai');
|
|
18
18
|
var aiSdkProvider = require('@openrouter/ai-sdk-provider');
|
|
19
19
|
var ollamaAiProviderV2 = require('ollama-ai-provider-v2');
|
|
20
|
+
var posthogNode = require('posthog-node');
|
|
20
21
|
|
|
21
22
|
// src/mcp-client-manager/MCPClientManager.ts
|
|
22
23
|
var DEFAULT_CLIENT_VERSION = "1.0.0";
|
|
@@ -595,17 +596,17 @@ async function convertMCPToolsToVercelTools(listToolsResult, {
|
|
|
595
596
|
const result = await callTool({ name, args, options });
|
|
596
597
|
return types_js.CallToolResultSchema.parse(result);
|
|
597
598
|
};
|
|
598
|
-
const toModelOutput = isMcpAppTool(toolMeta) ? (
|
|
599
|
+
const toModelOutput = isMcpAppTool(toolMeta) ? (opts) => {
|
|
599
600
|
const scrubbed = scrubMetaAndStructuredContentFromToolResult(
|
|
600
601
|
opts.output
|
|
601
602
|
);
|
|
602
603
|
return { type: "json", value: scrubbed };
|
|
603
|
-
}
|
|
604
|
+
} : isChatGPTAppTool(toolMeta) ? (opts) => {
|
|
604
605
|
const scrubbed = scrubStructuredContentFromToolResult(
|
|
605
606
|
opts.output
|
|
606
607
|
);
|
|
607
608
|
return { type: "json", value: scrubbed };
|
|
608
|
-
}
|
|
609
|
+
} : void 0;
|
|
609
610
|
let vercelTool;
|
|
610
611
|
if (schemas === "automatic") {
|
|
611
612
|
const normalizedInputSchema = ensureJsonSchemaObject(inputSchema);
|
|
@@ -2375,6 +2376,12 @@ function calculateLatencyStats(values) {
|
|
|
2375
2376
|
count: values.length
|
|
2376
2377
|
};
|
|
2377
2378
|
}
|
|
2379
|
+
var posthog = new posthogNode.PostHog(
|
|
2380
|
+
"phc_dTOPniyUNU2kD8Jx8yHMXSqiZHM8I91uWopTMX6EBE9",
|
|
2381
|
+
{
|
|
2382
|
+
host: "https://us.i.posthog.com"
|
|
2383
|
+
}
|
|
2384
|
+
);
|
|
2378
2385
|
|
|
2379
2386
|
// src/EvalTest.ts
|
|
2380
2387
|
var Semaphore = class {
|
|
@@ -2429,6 +2436,13 @@ var EvalTest = class {
|
|
|
2429
2436
|
* Run this test with the given agent and options
|
|
2430
2437
|
*/
|
|
2431
2438
|
async run(agent, options) {
|
|
2439
|
+
posthog.capture({
|
|
2440
|
+
event: "eval_test_run_triggered",
|
|
2441
|
+
properties: {
|
|
2442
|
+
iterations: options.iterations,
|
|
2443
|
+
concurrency: options.concurrency ?? 5
|
|
2444
|
+
}
|
|
2445
|
+
});
|
|
2432
2446
|
const concurrency = options.concurrency ?? 5;
|
|
2433
2447
|
const retries = options.retries ?? 0;
|
|
2434
2448
|
const timeoutMs = options.timeoutMs ?? 3e4;
|