@dalmia/calibrate-mcp 0.0.83 → 0.0.85

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 (38) hide show
  1. package/bin/mcp-server.js +185 -21
  2. package/bin/mcp-server.js.map +16 -12
  3. package/esm/funcs/workspaceCurrent.d.ts +16 -0
  4. package/esm/funcs/workspaceCurrent.d.ts.map +1 -0
  5. package/esm/funcs/workspaceCurrent.js +86 -0
  6. package/esm/funcs/workspaceCurrent.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/workspaceCurrent.d.ts +7 -0
  15. package/esm/mcp-server/tools/workspaceCurrent.d.ts.map +1 -0
  16. package/esm/mcp-server/tools/workspaceCurrent.js +39 -0
  17. package/esm/mcp-server/tools/workspaceCurrent.js.map +1 -0
  18. package/esm/models/currentworkspaceresponse.d.ts +7 -0
  19. package/esm/models/currentworkspaceresponse.d.ts.map +1 -0
  20. package/esm/models/currentworkspaceresponse.js +9 -0
  21. package/esm/models/currentworkspaceresponse.js.map +1 -0
  22. package/esm/models/getcurrentworkspaceorganizationscurrentgetop.d.ts +10 -0
  23. package/esm/models/getcurrentworkspaceorganizationscurrentgetop.d.ts.map +1 -0
  24. package/esm/models/getcurrentworkspaceorganizationscurrentgetop.js +14 -0
  25. package/esm/models/getcurrentworkspaceorganizationscurrentgetop.js.map +1 -0
  26. package/esm/tool-names.d.ts.map +1 -1
  27. package/esm/tool-names.js +4 -0
  28. package/esm/tool-names.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/funcs/workspaceCurrent.ts +149 -0
  31. package/src/landing-page.ts +1 -1
  32. package/src/lib/config.ts +2 -2
  33. package/src/mcp-server/mcp-server.ts +1 -1
  34. package/src/mcp-server/server.ts +3 -1
  35. package/src/mcp-server/tools/workspaceCurrent.ts +47 -0
  36. package/src/models/currentworkspaceresponse.ts +16 -0
  37. package/src/models/getcurrentworkspaceorganizationscurrentgetop.ts +32 -0
  38. package/src/tool-names.ts +4 -0
package/bin/mcp-server.js CHANGED
@@ -25889,7 +25889,8 @@ var require_formats = __commonJS(function(exports, module) {
25889
25889
  var percentTwenties = /%20/g;
25890
25890
  var Format = {
25891
25891
  RFC1738: "RFC1738",
25892
- RFC3986: "RFC3986"
25892
+ RFC3986: "RFC3986",
25893
+ WHATWG: "WHATWG"
25893
25894
  };
25894
25895
  module.exports = {
25895
25896
  default: Format.RFC3986,
@@ -25899,10 +25900,14 @@ var require_formats = __commonJS(function(exports, module) {
25899
25900
  },
25900
25901
  RFC3986: function(value) {
25901
25902
  return String(value);
25903
+ },
25904
+ WHATWG: function(value) {
25905
+ return replace.call(value, percentTwenties, "+");
25902
25906
  }
25903
25907
  },
25904
25908
  RFC1738: Format.RFC1738,
25905
- RFC3986: Format.RFC3986
25909
+ RFC3986: Format.RFC3986,
25910
+ WHATWG: Format.WHATWG
25906
25911
  };
25907
25912
  });
25908
25913
 
@@ -26206,7 +26211,7 @@ var require_utils2 = __commonJS(function(exports, module) {
26206
26211
  var arr = [];
26207
26212
  for (var i = 0;i < segment.length; ++i) {
26208
26213
  var c = segment.charCodeAt(i);
26209
- if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) {
26214
+ if (c === 45 || c === 46 || c === 95 || c === 126 && format !== formats.WHATWG || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41) || format === formats.WHATWG && c === 42) {
26210
26215
  arr[arr.length] = segment.charAt(i);
26211
26216
  continue;
26212
26217
  }
@@ -26222,9 +26227,14 @@ var require_utils2 = __commonJS(function(exports, module) {
26222
26227
  arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
26223
26228
  continue;
26224
26229
  }
26225
- i += 1;
26226
- c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
26227
- arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
26230
+ var next = segment.charCodeAt(i + 1);
26231
+ if (c <= 56319 && next >= 56320 && next <= 57343) {
26232
+ i += 1;
26233
+ c = 65536 + ((c & 1023) << 10 | next & 1023);
26234
+ arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
26235
+ } else {
26236
+ arr[arr.length] = "%EF%BF%BD";
26237
+ }
26228
26238
  }
26229
26239
  out += arr.join("");
26230
26240
  }
@@ -26304,6 +26314,7 @@ var require_utils2 = __commonJS(function(exports, module) {
26304
26314
  markOverflow,
26305
26315
  maybeMap,
26306
26316
  merge,
26317
+ setProperty,
26307
26318
  toCoercible
26308
26319
  };
26309
26320
  });
@@ -26428,7 +26439,7 @@ var require_stringify = __commonJS(function(exports, module) {
26428
26439
  var encodedPrefix = String(prefix);
26429
26440
  var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
26430
26441
  if (allowEmptyArrays && isArray(obj) && obj.length === 0 && Object.keys(obj).length === 0) {
26431
- return adjustedPrefix + "[]";
26442
+ return formatter(encoder && !encodeValuesOnly ? encoder(adjustedPrefix, defaults.encoder, charset, "key", format) : adjustedPrefix) + "[]";
26432
26443
  }
26433
26444
  for (var j = 0;j < objKeys.length; ++j) {
26434
26445
  var key = objKeys[j];
@@ -26518,7 +26529,7 @@ var require_stringify = __commonJS(function(exports, module) {
26518
26529
  filter = options.filter;
26519
26530
  obj = filter("", obj);
26520
26531
  } else if (isArray(options.filter)) {
26521
- filter = options.filter;
26532
+ filter = options.filter.slice();
26522
26533
  objKeys = filter;
26523
26534
  }
26524
26535
  var keys = [];
@@ -26544,7 +26555,7 @@ var require_stringify = __commonJS(function(exports, module) {
26544
26555
  continue;
26545
26556
  }
26546
26557
  var encodedKey = options.encodeDotInKeys ? String(key).replace(/\./g, "%2E") : String(key);
26547
- pushToArray(keys, stringify(value, encodedKey, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel, options.depth, 0));
26558
+ pushToArray(keys, stringify(value, encodedKey, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel, options.depth, 0));
26548
26559
  }
26549
26560
  var joined = keys.join(options.delimiter);
26550
26561
  var prefix = options.addQueryPrefix === true ? "?" : "";
@@ -26600,9 +26611,9 @@ var require_parse = __commonJS(function(exports, module) {
26600
26611
  copies.set(value, copy);
26601
26612
  queue[queue.length] = { source: value, target: copy };
26602
26613
  }
26603
- target[keys[j]] = copies.get(value);
26614
+ utils.setProperty(target, keys[j], copies.get(value));
26604
26615
  } else {
26605
- target[keys[j]] = value;
26616
+ utils.setProperty(target, keys[j], value);
26606
26617
  }
26607
26618
  }
26608
26619
  }
@@ -26652,7 +26663,7 @@ var require_parse = __commonJS(function(exports, module) {
26652
26663
  }
26653
26664
  return val.split(",");
26654
26665
  }
26655
- if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
26666
+ if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit && currentArrayLength > 0) {
26656
26667
  throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
26657
26668
  }
26658
26669
  return val;
@@ -26700,13 +26711,15 @@ var require_parse = __commonJS(function(exports, module) {
26700
26711
  } else {
26701
26712
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
26702
26713
  if (key !== null) {
26703
- val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
26714
+ val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) && (options.duplicates === "combine" || isEmptyBracketKey) ? obj[key].length : 0), function(encodedVal) {
26704
26715
  return options.decoder(encodedVal, defaults.decoder, charset, "value");
26705
26716
  });
26706
26717
  }
26707
26718
  }
26708
26719
  if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
26709
- val = interpretNumericEntities(String(val));
26720
+ val = utils.maybeMap(val, function(value) {
26721
+ return value ? interpretNumericEntities(String(value)) : value;
26722
+ });
26710
26723
  }
26711
26724
  if (isEmptyBracketKey) {
26712
26725
  val = isArray(val) ? [val] : val;
@@ -26744,7 +26757,7 @@ var require_parse = __commonJS(function(exports, module) {
26744
26757
  } else {
26745
26758
  obj = options.plainObjects ? { __proto__: null } : {};
26746
26759
  var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
26747
- var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
26760
+ var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/gi, ".") : cleanRoot;
26748
26761
  var index = parseInt(decodedRoot, 10);
26749
26762
  var isValidArrayIndex = !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays;
26750
26763
  if (!options.parseArrays && decodedRoot === "") {
@@ -53266,9 +53279,9 @@ var init_config = __esm(() => {
53266
53279
  SDK_METADATA = {
53267
53280
  language: "typescript",
53268
53281
  openapiDocVersion: "0.1.0",
53269
- sdkVersion: "0.0.83",
53282
+ sdkVersion: "0.0.85",
53270
53283
  genVersion: "2.915.1",
53271
- userAgent: "speakeasy-sdk/mcp-typescript 0.0.83 2.915.1 0.1.0 @dalmia/calibrate-mcp"
53284
+ userAgent: "speakeasy-sdk/mcp-typescript 0.0.85 2.915.1 0.1.0 @dalmia/calibrate-mcp"
53272
53285
  };
53273
53286
  });
53274
53287
 
@@ -62797,11 +62810,151 @@ hits its trace limit.
62797
62810
  };
62798
62811
  });
62799
62812
 
62813
+ // src/models/currentworkspaceresponse.ts
62814
+ var CurrentWorkspaceResponse$zodSchema;
62815
+ var init_currentworkspaceresponse = __esm(() => {
62816
+ init_zod();
62817
+ CurrentWorkspaceResponse$zodSchema = object({
62818
+ name: string2().describe("Workspace display name"),
62819
+ uuid: string2().describe("Workspace ID. Put this at the front of a Calibrate web address to link straight to something in this workspace, as in `/<uuid>/tests`")
62820
+ });
62821
+ });
62822
+
62823
+ // src/models/getcurrentworkspaceorganizationscurrentgetop.ts
62824
+ var GetCurrentWorkspaceOrganizationsCurrentGetRequest$zodSchema, GetCurrentWorkspaceOrganizationsCurrentGetResponse$zodSchema;
62825
+ var init_getcurrentworkspaceorganizationscurrentgetop = __esm(() => {
62826
+ init_zod();
62827
+ init_currentworkspaceresponse();
62828
+ init_httpvalidationerror();
62829
+ GetCurrentWorkspaceOrganizationsCurrentGetRequest$zodSchema = object({
62830
+ xAPIKey: string2().nullable().optional()
62831
+ });
62832
+ GetCurrentWorkspaceOrganizationsCurrentGetResponse$zodSchema = union([
62833
+ CurrentWorkspaceResponse$zodSchema,
62834
+ HTTPValidationError$zodSchema
62835
+ ]);
62836
+ });
62837
+
62838
+ // src/funcs/workspaceCurrent.ts
62839
+ function workspaceCurrent(client$, request, options) {
62840
+ return new APIPromise($do46(client$, request, options));
62841
+ }
62842
+ async function $do46(client$, request, options) {
62843
+ const parsed$ = safeParse4(request, (value$) => GetCurrentWorkspaceOrganizationsCurrentGetRequest$zodSchema.optional().parse(value$), "Input validation failed");
62844
+ if (!parsed$.ok) {
62845
+ return [parsed$, { status: "invalid" }];
62846
+ }
62847
+ const payload$ = parsed$.value;
62848
+ const body$ = null;
62849
+ const path$ = pathToFunc("/organizations/current")();
62850
+ const headers$ = new Headers(compactMap({
62851
+ Accept: "application/json",
62852
+ "X-API-Key": encodeSimple("X-API-Key", payload$?.xAPIKey, {
62853
+ explode: false,
62854
+ charEncoding: "none"
62855
+ })
62856
+ }));
62857
+ const securityInput = await extractSecurity(client$._options.security);
62858
+ const requestSecurity = resolveGlobalSecurity(securityInput);
62859
+ const context = {
62860
+ options: client$._options,
62861
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
62862
+ operationID: "get_current_workspace_organizations_current_get",
62863
+ oAuth2Scopes: null,
62864
+ resolvedSecurity: requestSecurity,
62865
+ securitySource: client$._options.security,
62866
+ retryConfig: options?.retries || client$._options.retryConfig || { strategy: "none" },
62867
+ retryCodes: options?.retryCodes || [
62868
+ "429",
62869
+ "500",
62870
+ "502",
62871
+ "503",
62872
+ "504"
62873
+ ]
62874
+ };
62875
+ const requestRes = client$._createRequest(context, {
62876
+ security: requestSecurity,
62877
+ method: "GET",
62878
+ baseURL: options?.serverURL,
62879
+ path: path$,
62880
+ headers: headers$,
62881
+ body: body$,
62882
+ userAgent: client$._options.userAgent,
62883
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
62884
+ }, options);
62885
+ if (!requestRes.ok) {
62886
+ return [requestRes, { status: "invalid" }];
62887
+ }
62888
+ const req$ = requestRes.value;
62889
+ const doResult = await client$._do(req$, {
62890
+ context,
62891
+ errorCodes: [],
62892
+ retryConfig: context.retryConfig,
62893
+ retryCodes: context.retryCodes
62894
+ });
62895
+ if (!doResult.ok) {
62896
+ return [doResult, { status: "request-error", request: req$ }];
62897
+ }
62898
+ return [doResult, {
62899
+ status: "complete",
62900
+ request: req$,
62901
+ response: doResult.value
62902
+ }];
62903
+ }
62904
+ var init_workspaceCurrent = __esm(() => {
62905
+ init_encodings();
62906
+ init_primitives();
62907
+ init_schemas4();
62908
+ init_security();
62909
+ init_url();
62910
+ init_getcurrentworkspaceorganizationscurrentgetop();
62911
+ init_async();
62912
+ });
62913
+
62914
+ // src/mcp-server/tools/workspaceCurrent.ts
62915
+ var args46, tool$workspaceCurrent;
62916
+ var init_workspaceCurrent2 = __esm(() => {
62917
+ init_workspaceCurrent();
62918
+ init_getcurrentworkspaceorganizationscurrentgetop();
62919
+ init_tools();
62920
+ args46 = {
62921
+ request: GetCurrentWorkspaceOrganizationsCurrentGetRequest$zodSchema.optional()
62922
+ };
62923
+ tool$workspaceCurrent = {
62924
+ name: "get-current-workspace",
62925
+ description: `Get the workspace the caller's API key belongs to, as its ID and
62926
+ name. Put the ID at the front of a Calibrate web address to link
62927
+ straight to something in that workspace, as in \`/<uuid>/tests\`.
62928
+ Without it, a link opens whichever workspace the reader looked at
62929
+ last. Requires a Calibrate API key (CALIBRATE_API_KEY).
62930
+ `,
62931
+ scopes: ["read"],
62932
+ annotations: {
62933
+ title: "Get the current workspace",
62934
+ destructiveHint: false,
62935
+ idempotentHint: true,
62936
+ openWorldHint: true,
62937
+ readOnlyHint: true
62938
+ },
62939
+ args: args46,
62940
+ tool: async (client, args, ctx) => {
62941
+ const [result] = await workspaceCurrent(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62942
+ if (!result.ok) {
62943
+ return {
62944
+ content: [{ type: "text", text: result.error.message }],
62945
+ isError: true
62946
+ };
62947
+ }
62948
+ return formatResult(result.value);
62949
+ }
62950
+ };
62951
+ });
62952
+
62800
62953
  // src/mcp-server/server.ts
62801
62954
  function createMCPServer(deps) {
62802
62955
  const server = new McpServer({
62803
62956
  name: "CalibrateMcp",
62804
- version: "0.0.83"
62957
+ version: "0.0.85"
62805
62958
  });
62806
62959
  const getClient = deps.getSDK || (() => new CalibrateMcpCore({
62807
62960
  security: deps.security,
@@ -62864,6 +63017,7 @@ function createMCPServer(deps) {
62864
63017
  tool(tool$annotatorsCreate);
62865
63018
  tool(tool$annotatorsList);
62866
63019
  tool(tool$annotatorsUpdate);
63020
+ tool(tool$workspaceCurrent);
62867
63021
  tool(tool$tracesCreate);
62868
63022
  if (deps.dynamic) {
62869
63023
  registerDynamicTools(deps.logger, server, getClient, toolMap, scopes);
@@ -62920,6 +63074,7 @@ var init_server2 = __esm(() => {
62920
63074
  init_testsList2();
62921
63075
  init_testsUpdate2();
62922
63076
  init_tracesCreate2();
63077
+ init_workspaceCurrent2();
62923
63078
  });
62924
63079
 
62925
63080
  // src/tool-names.ts
@@ -63198,6 +63353,15 @@ must be in your workspace.
63198
63353
  {
63199
63354
  name: "update-annotator",
63200
63355
  description: `Rename an annotator in your workspace.
63356
+ `
63357
+ },
63358
+ {
63359
+ name: "get-current-workspace",
63360
+ description: `Get the workspace the caller's API key belongs to, as its ID and
63361
+ name. Put the ID at the front of a Calibrate web address to link
63362
+ straight to something in that workspace, as in \`/<uuid>/tests\`.
63363
+ Without it, a link opens whichever workspace the reader looked at
63364
+ last. Requires a Calibrate API key (CALIBRATE_API_KEY).
63201
63365
  `
63202
63366
  },
63203
63367
  {
@@ -64115,7 +64279,7 @@ http_headers = { "api-key-auth" = "YOUR_API_KEY_AUTH" }`;
64115
64279
  <h1>Instructions</h1>
64116
64280
  <p>One-click installation for Claude Desktop users</p>
64117
64281
  <div class="instruction-item">
64118
- <a href="https://github.com/dalmia/calibrate-mcp/releases/download/v0.0.83/mcp-server.mcpb" download="mcp-server.mcpb" class="action-button header-action" style="display: inline-flex; margin-bottom: 16px;">
64282
+ <a href="https://github.com/dalmia/calibrate-mcp/releases/download/v0.0.85/mcp-server.mcpb" download="mcp-server.mcpb" class="action-button header-action" style="display: inline-flex; margin-bottom: 16px;">
64119
64283
  \uD83D\uDCE5 Download MCP Bundle
64120
64284
  </a>
64121
64285
  </div>
@@ -67069,7 +67233,7 @@ var routes = buildRouteMap({
67069
67233
  var app = buildApplication(routes, {
67070
67234
  name: "mcp",
67071
67235
  versionInfo: {
67072
- currentVersion: "0.0.83"
67236
+ currentVersion: "0.0.85"
67073
67237
  }
67074
67238
  });
67075
67239
  run(app, process3.argv.slice(2), buildContext(process3));
@@ -67077,5 +67241,5 @@ export {
67077
67241
  app
67078
67242
  };
67079
67243
 
67080
- //# debugId=4309DEBCCB9C9B0A64756E2164756E21
67244
+ //# debugId=A1741B450B8DD19464756E2164756E21
67081
67245
  //# sourceMappingURL=mcp-server.js.map