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