@dalmia/calibrate-mcp 0.0.34 → 0.0.36

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