@dalmia/calibrate-mcp 0.0.34 → 0.0.35

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.
Files changed (63) hide show
  1. package/bin/mcp-server.js +235 -9
  2. package/bin/mcp-server.js.map +17 -8
  3. package/esm/funcs/tracesCreate.d.ts +16 -0
  4. package/esm/funcs/tracesCreate.d.ts.map +1 -0
  5. package/esm/funcs/tracesCreate.js +86 -0
  6. package/esm/funcs/tracesCreate.js.map +1 -0
  7. package/esm/landing-page.js +1 -1
  8. package/esm/lib/config.d.ts +2 -2
  9. package/esm/lib/config.js +2 -2
  10. package/esm/mcp-server/mcp-server.js +1 -1
  11. package/esm/mcp-server/server.d.ts.map +1 -1
  12. package/esm/mcp-server/server.js +3 -1
  13. package/esm/mcp-server/server.js.map +1 -1
  14. package/esm/mcp-server/tools/tracesCreate.d.ts +7 -0
  15. package/esm/mcp-server/tools/tracesCreate.d.ts.map +1 -0
  16. package/esm/mcp-server/tools/tracesCreate.js +38 -0
  17. package/esm/mcp-server/tools/tracesCreate.js.map +1 -0
  18. package/esm/models/ingesttracetracespostop.d.ts +12 -0
  19. package/esm/models/ingesttracetracespostop.d.ts.map +1 -0
  20. package/esm/models/ingesttracetracespostop.js +16 -0
  21. package/esm/models/ingesttracetracespostop.js.map +1 -0
  22. package/esm/models/traceingest.d.ts +14 -0
  23. package/esm/models/traceingest.d.ts.map +1 -0
  24. package/esm/models/traceingest.js +17 -0
  25. package/esm/models/traceingest.js.map +1 -0
  26. package/esm/models/traceingestresponse.d.ts +9 -0
  27. package/esm/models/traceingestresponse.d.ts.map +1 -0
  28. package/esm/models/traceingestresponse.js +12 -0
  29. package/esm/models/traceingestresponse.js.map +1 -0
  30. package/esm/models/tracemetadataentry.d.ts +7 -0
  31. package/esm/models/tracemetadataentry.d.ts.map +1 -0
  32. package/esm/models/tracemetadataentry.js +10 -0
  33. package/esm/models/tracemetadataentry.js.map +1 -0
  34. package/esm/models/traceoutput.d.ts +8 -0
  35. package/esm/models/traceoutput.d.ts.map +1 -0
  36. package/esm/models/traceoutput.js +10 -0
  37. package/esm/models/traceoutput.js.map +1 -0
  38. package/esm/models/tracetoolcall.d.ts +9 -0
  39. package/esm/models/tracetoolcall.d.ts.map +1 -0
  40. package/esm/models/tracetoolcall.js +9 -0
  41. package/esm/models/tracetoolcall.js.map +1 -0
  42. package/esm/models/traceturn.d.ts +11 -0
  43. package/esm/models/traceturn.d.ts.map +1 -0
  44. package/esm/models/traceturn.js +21 -0
  45. package/esm/models/traceturn.js.map +1 -0
  46. package/esm/tool-names.d.ts.map +1 -1
  47. package/esm/tool-names.js +4 -0
  48. package/esm/tool-names.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/funcs/tracesCreate.ts +148 -0
  51. package/src/landing-page.ts +1 -1
  52. package/src/lib/config.ts +2 -2
  53. package/src/mcp-server/mcp-server.ts +1 -1
  54. package/src/mcp-server/server.ts +3 -1
  55. package/src/mcp-server/tools/tracesCreate.ts +47 -0
  56. package/src/models/ingesttracetracespostop.ts +37 -0
  57. package/src/models/traceingest.ts +40 -0
  58. package/src/models/traceingestresponse.ts +26 -0
  59. package/src/models/tracemetadataentry.ts +13 -0
  60. package/src/models/traceoutput.ts +20 -0
  61. package/src/models/tracetoolcall.ts +17 -0
  62. package/src/models/traceturn.ts +37 -0
  63. package/src/tool-names.ts +4 -0
package/bin/mcp-server.js CHANGED
@@ -51428,9 +51428,9 @@ var init_config = __esm(() => {
51428
51428
  SDK_METADATA = {
51429
51429
  language: "typescript",
51430
51430
  openapiDocVersion: "0.1.0",
51431
- sdkVersion: "0.0.34",
51431
+ sdkVersion: "0.0.35",
51432
51432
  genVersion: "2.915.1",
51433
- userAgent: "speakeasy-sdk/mcp-typescript 0.0.34 2.915.1 0.1.0 @dalmia/calibrate-mcp"
51433
+ userAgent: "speakeasy-sdk/mcp-typescript 0.0.35 2.915.1 0.1.0 @dalmia/calibrate-mcp"
51434
51434
  };
51435
51435
  });
51436
51436
 
@@ -59445,20 +59445,235 @@ fields to change (name, config). Returns the updated test. Fails with
59445
59445
  };
59446
59446
  });
59447
59447
 
59448
+ // src/models/tracemetadataentry.ts
59449
+ var TraceMetadataEntry$zodSchema;
59450
+ var init_tracemetadataentry = __esm(() => {
59451
+ init_zod();
59452
+ TraceMetadataEntry$zodSchema = object({
59453
+ key: string2().describe("Name of the metadata entry"),
59454
+ value: string2().describe("Value of the metadata entry")
59455
+ });
59456
+ });
59457
+
59458
+ // src/models/tracetoolcall.ts
59459
+ var TraceToolCall$zodSchema;
59460
+ var init_tracetoolcall = __esm(() => {
59461
+ init_zod();
59462
+ TraceToolCall$zodSchema = object({
59463
+ arguments: record(string2(), any()).nullable().optional().describe("Argument values the agent passed to the tool. Omit when the call had none"),
59464
+ tool: string2().describe("Name of the tool the agent called")
59465
+ });
59466
+ });
59467
+
59468
+ // src/models/traceoutput.ts
59469
+ var TraceOutput$zodSchema;
59470
+ var init_traceoutput = __esm(() => {
59471
+ init_zod();
59472
+ init_tracetoolcall();
59473
+ TraceOutput$zodSchema = object({
59474
+ response: string2().nullable().optional().describe("The assistant reply text for this turn. Omit for turns that only issued tool calls"),
59475
+ tool_calls: array(TraceToolCall$zodSchema).nullable().optional().describe("Tool calls the agent issued for this turn. Omit for plain text replies")
59476
+ });
59477
+ });
59478
+
59479
+ // src/models/traceturn.ts
59480
+ var TraceTurn$zodSchema, TraceTurn$zodSchemaOutbound;
59481
+ var init_traceturn = __esm(() => {
59482
+ init_zod();
59483
+ init_schemas4();
59484
+ TraceTurn$zodSchema = collectExtraKeys(object({
59485
+ content: string2().nullable().optional().describe("Message text. Omit for turns that only carry tool calls"),
59486
+ role: string2().describe("Message author role in the conversation history")
59487
+ }).catchall(any()), "AdditionalProperties", true);
59488
+ TraceTurn$zodSchemaOutbound = object({
59489
+ AdditionalProperties: record(string2(), any()).optional(),
59490
+ content: nullable(string2()).optional(),
59491
+ role: string2()
59492
+ }).transform((v) => {
59493
+ const { AdditionalProperties, ...rest } = v;
59494
+ return {
59495
+ ...rest,
59496
+ ...AdditionalProperties
59497
+ };
59498
+ });
59499
+ });
59500
+
59501
+ // src/models/traceingest.ts
59502
+ var TraceIngest$zodSchema;
59503
+ var init_traceingest = __esm(() => {
59504
+ init_zod();
59505
+ init_tracemetadataentry();
59506
+ init_traceoutput();
59507
+ init_traceturn();
59508
+ TraceIngest$zodSchema = object({
59509
+ agent_id: string2().describe("ID of the agent that produced the turn. Must be an agent in your workspace"),
59510
+ conversation_id: string2().nullable().optional().describe("Your own ID for the conversation this turn belongs to, stored for reference only. Omit if you have none"),
59511
+ input: array(TraceTurn$zodSchema).describe("Conversation history up to the reported output, oldest turn first, in OpenAI chat format"),
59512
+ message_id: string2().nullable().optional().describe("Your own ID for the last user message in `input`, stored for reference only. Omit if you have none"),
59513
+ metadata: array(TraceMetadataEntry$zodSchema).nullable().optional().describe("Key-value pairs stored with the trace. Prefer OTel `gen_ai.*` key names where they fit. Omit if you have none"),
59514
+ output: TraceOutput$zodSchema
59515
+ });
59516
+ });
59517
+
59518
+ // src/models/traceingestresponse.ts
59519
+ var TraceIngestResponse$zodSchema;
59520
+ var init_traceingestresponse = __esm(() => {
59521
+ init_zod();
59522
+ TraceIngestResponse$zodSchema = object({
59523
+ conversation_id: string2().nullable().optional().describe("The conversation ID you sent, if any"),
59524
+ created_at: string2().describe("When the trace was created (ISO 8601 UTC)"),
59525
+ message_id: string2().nullable().optional().describe("The message ID you sent, if any"),
59526
+ uuid: string2().describe("Unique ID for the trace")
59527
+ });
59528
+ });
59529
+
59530
+ // src/models/ingesttracetracespostop.ts
59531
+ var IngestTraceTracesPostRequest$zodSchema, IngestTraceTracesPostResponse$zodSchema;
59532
+ var init_ingesttracetracespostop = __esm(() => {
59533
+ init_zod();
59534
+ init_httpvalidationerror();
59535
+ init_traceingest();
59536
+ init_traceingestresponse();
59537
+ IngestTraceTracesPostRequest$zodSchema = object({
59538
+ body: TraceIngest$zodSchema,
59539
+ xAPIKey: string2().nullable().optional()
59540
+ });
59541
+ IngestTraceTracesPostResponse$zodSchema = union([
59542
+ TraceIngestResponse$zodSchema,
59543
+ HTTPValidationError$zodSchema
59544
+ ]);
59545
+ });
59546
+
59547
+ // src/funcs/tracesCreate.ts
59548
+ function tracesCreate(client$, request, options) {
59549
+ return new APIPromise($do39(client$, request, options));
59550
+ }
59551
+ async function $do39(client$, request, options) {
59552
+ const parsed$ = safeParse4(request, (value$) => IngestTraceTracesPostRequest$zodSchema.parse(value$), "Input validation failed");
59553
+ if (!parsed$.ok) {
59554
+ return [parsed$, { status: "invalid" }];
59555
+ }
59556
+ const payload$ = parsed$.value;
59557
+ const body$ = encodeJSON("body", payload$.body, { explode: true });
59558
+ const path$ = pathToFunc("/traces")();
59559
+ const headers$ = new Headers(compactMap({
59560
+ "Content-Type": "application/json",
59561
+ Accept: "application/json",
59562
+ "X-API-Key": encodeSimple("X-API-Key", payload$.xAPIKey, {
59563
+ explode: false,
59564
+ charEncoding: "none"
59565
+ })
59566
+ }));
59567
+ const securityInput = await extractSecurity(client$._options.security);
59568
+ const requestSecurity = resolveGlobalSecurity(securityInput);
59569
+ const context = {
59570
+ options: client$._options,
59571
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
59572
+ operationID: "ingest_trace_traces_post",
59573
+ oAuth2Scopes: null,
59574
+ resolvedSecurity: requestSecurity,
59575
+ securitySource: client$._options.security,
59576
+ retryConfig: options?.retries || client$._options.retryConfig || { strategy: "none" },
59577
+ retryCodes: options?.retryCodes || [
59578
+ "429",
59579
+ "500",
59580
+ "502",
59581
+ "503",
59582
+ "504"
59583
+ ]
59584
+ };
59585
+ const requestRes = client$._createRequest(context, {
59586
+ security: requestSecurity,
59587
+ method: "POST",
59588
+ baseURL: options?.serverURL,
59589
+ path: path$,
59590
+ headers: headers$,
59591
+ body: body$,
59592
+ userAgent: client$._options.userAgent,
59593
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
59594
+ }, options);
59595
+ if (!requestRes.ok) {
59596
+ return [requestRes, { status: "invalid" }];
59597
+ }
59598
+ const req$ = requestRes.value;
59599
+ const doResult = await client$._do(req$, {
59600
+ context,
59601
+ errorCodes: [],
59602
+ retryConfig: context.retryConfig,
59603
+ retryCodes: context.retryCodes
59604
+ });
59605
+ if (!doResult.ok) {
59606
+ return [doResult, { status: "request-error", request: req$ }];
59607
+ }
59608
+ return [doResult, {
59609
+ status: "complete",
59610
+ request: req$,
59611
+ response: doResult.value
59612
+ }];
59613
+ }
59614
+ var init_tracesCreate = __esm(() => {
59615
+ init_encodings();
59616
+ init_primitives();
59617
+ init_schemas4();
59618
+ init_security();
59619
+ init_url();
59620
+ init_ingesttracetracespostop();
59621
+ init_async();
59622
+ });
59623
+
59624
+ // src/mcp-server/tools/tracesCreate.ts
59625
+ var args39, tool$tracesCreate;
59626
+ var init_tracesCreate2 = __esm(() => {
59627
+ init_tracesCreate();
59628
+ init_ingesttracetracespostop();
59629
+ init_tools();
59630
+ args39 = {
59631
+ request: IngestTraceTracesPostRequest$zodSchema
59632
+ };
59633
+ tool$tracesCreate = {
59634
+ name: "create-trace",
59635
+ description: `Store one production agent turn against an agent in the caller's org:
59636
+ the conversation history as input, what the agent produced as output,
59637
+ and optional metadata. Use this to capture live traffic for later
59638
+ review and conversion into tests. Fails with 429 once the workspace
59639
+ hits its trace limit.
59640
+ `,
59641
+ scopes: ["write"],
59642
+ annotations: {
59643
+ title: "Create trace",
59644
+ destructiveHint: false,
59645
+ idempotentHint: false,
59646
+ openWorldHint: true,
59647
+ readOnlyHint: false
59648
+ },
59649
+ args: args39,
59650
+ tool: async (client, args40, ctx) => {
59651
+ const [result] = await tracesCreate(client, args40.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59652
+ if (!result.ok) {
59653
+ return {
59654
+ content: [{ type: "text", text: result.error.message }],
59655
+ isError: true
59656
+ };
59657
+ }
59658
+ return formatResult(result.value);
59659
+ }
59660
+ };
59661
+ });
59662
+
59448
59663
  // src/mcp-server/server.ts
59449
59664
  function createMCPServer(deps) {
59450
59665
  const server = new McpServer({
59451
59666
  name: "CalibrateMcp",
59452
- version: "0.0.34"
59667
+ version: "0.0.35"
59453
59668
  });
59454
59669
  const getClient = deps.getSDK || (() => new CalibrateMcpCore({
59455
59670
  security: deps.security,
59456
59671
  serverURL: deps.serverURL,
59457
59672
  serverIdx: deps.serverIdx,
59458
59673
  debugLogger: deps.logger.level === "debug" ? {
59459
- log: (...args39) => console.log(...args39),
59460
- group: (...args39) => console.group(...args39),
59461
- groupEnd: (...args39) => console.groupEnd(...args39)
59674
+ log: (...args40) => console.log(...args40),
59675
+ group: (...args40) => console.group(...args40),
59676
+ groupEnd: (...args40) => console.groupEnd(...args40)
59462
59677
  } : undefined
59463
59678
  }));
59464
59679
  const scopes = new Set(deps.scopes);
@@ -59506,6 +59721,7 @@ function createMCPServer(deps) {
59506
59721
  tool(tool$annotatorsCreate);
59507
59722
  tool(tool$annotatorsList);
59508
59723
  tool(tool$annotatorsUpdate);
59724
+ tool(tool$tracesCreate);
59509
59725
  if (deps.dynamic) {
59510
59726
  registerDynamicTools(deps.logger, server, getClient, toolMap, scopes);
59511
59727
  }
@@ -59554,6 +59770,7 @@ var init_server2 = __esm(() => {
59554
59770
  init_testsGet2();
59555
59771
  init_testsList2();
59556
59772
  init_testsUpdate2();
59773
+ init_tracesCreate2();
59557
59774
  });
59558
59775
 
59559
59776
  // src/tool-names.ts
@@ -59789,6 +60006,15 @@ must be in your workspace.
59789
60006
  {
59790
60007
  name: "update-annotator",
59791
60008
  description: `Rename an annotator in your workspace.
60009
+ `
60010
+ },
60011
+ {
60012
+ name: "create-trace",
60013
+ description: `Store one production agent turn against an agent in the caller's org:
60014
+ the conversation history as input, what the agent produced as output,
60015
+ and optional metadata. Use this to capture live traffic for later
60016
+ review and conversion into tests. Fails with 429 once the workspace
60017
+ hits its trace limit.
59792
60018
  `
59793
60019
  }
59794
60020
  ];
@@ -60697,7 +60923,7 @@ http_headers = { "api-key-auth" = "YOUR_API_KEY_AUTH" }`;
60697
60923
  <h1>Instructions</h1>
60698
60924
  <p>One-click installation for Claude Desktop users</p>
60699
60925
  <div class="instruction-item">
60700
- <a href="https://github.com/dalmia/calibrate-mcp/releases/download/v0.0.34/mcp-server.mcpb" download="mcp-server.mcpb" class="action-button header-action" style="display: inline-flex; margin-bottom: 16px;">
60926
+ <a href="https://github.com/dalmia/calibrate-mcp/releases/download/v0.0.35/mcp-server.mcpb" download="mcp-server.mcpb" class="action-button header-action" style="display: inline-flex; margin-bottom: 16px;">
60701
60927
  \uD83D\uDCE5 Download MCP Bundle
60702
60928
  </a>
60703
60929
  </div>
@@ -63584,7 +63810,7 @@ var routes = buildRouteMap({
63584
63810
  var app = buildApplication(routes, {
63585
63811
  name: "mcp",
63586
63812
  versionInfo: {
63587
- currentVersion: "0.0.34"
63813
+ currentVersion: "0.0.35"
63588
63814
  }
63589
63815
  });
63590
63816
  run(app, process4.argv.slice(2), buildContext(process4));
@@ -63592,5 +63818,5 @@ export {
63592
63818
  app
63593
63819
  };
63594
63820
 
63595
- //# debugId=66D9BA849227688064756E2164756E21
63821
+ //# debugId=514428CBF7C544CD64756E2164756E21
63596
63822
  //# sourceMappingURL=mcp-server.js.map