@usemcpkit/core 0.1.0 → 0.1.1

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.
@@ -397,6 +397,9 @@ export declare interface TokenImportRequest {
397
397
 
398
398
  export declare const toNameMapping: (spec: NameList | NameMapping) => Readonly<Record<string, string>>;
399
399
 
400
+ /** `resource:action`, for example `pull_request:list`; the action part is optional. */
401
+ export declare const TOOL_NAME_PATTERN: RegExp;
402
+
400
403
  export declare type ToolArgs = Readonly<Record<string, unknown>>;
401
404
 
402
405
  /** Replaces the tool's request, and its response mapping when given, for one edition. */
@@ -59,6 +59,8 @@ var isInteractiveAuth = (auth) => auth.type === "oauth";
59
59
  //#endregion
60
60
  //#region src/manifest/const.ts
61
61
  var SERVER_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
62
+ /** `resource:action`, for example `pull_request:list`; the action part is optional. */
63
+ var TOOL_NAME_PATTERN = /^[a-z][a-z0-9_]*(:[a-z][a-z0-9_]*)*$/;
62
64
  var SERVER_CATEGORY_PATTERN = /^[a-z][a-z0-9-]*$/;
63
65
  var HTTP_METHODS = [
64
66
  "GET",
@@ -459,7 +461,7 @@ var validateToolEditions = (tool, declaredArgs, editionNames, location) => {
459
461
  //#region src/manifest/validation/tool/validate-tool-fields.ts
460
462
  var validateToolFields = (tool, location) => {
461
463
  const errors = [];
462
- if (!SERVER_NAME_PATTERN.test(String(tool.name ?? ""))) errors.push(`${location}.name must match ${SERVER_NAME_PATTERN}`);
464
+ if (!TOOL_NAME_PATTERN.test(String(tool.name ?? ""))) errors.push(`${location}.name must match ${TOOL_NAME_PATTERN}`);
463
465
  if (typeof tool.description !== "string") errors.push(`${location}.description is required`);
464
466
  if (tool.response !== void 0 && !isJsonObject(tool.response)) errors.push(`${location}.response must be an object`);
465
467
  return errors;
@@ -1665,4 +1667,4 @@ var compareVersions = (left, right) => {
1665
1667
  return 0;
1666
1668
  };
1667
1669
  //#endregion
1668
- export { AuthError, CREDENTIALS_FORM_API, CREDENTIALS_FORM_SESSION_HEADER, CREDENTIALS_REQUEST_ELEMENT_ID, DEFAULT_UI_TEXTS, SERVER_NAME_PATTERN, ToolError, applyDomain, array, boolean, buildRequest, compareVersions, createFileSecretStore, defineServer, defineTool, defineUI, describeAuth, describeAuthSpec, describeError, executeTool, fillTemplate, getPath, input, isDomainValue, isInteractiveAuth, isJsonObject, isMissingFileError, isValidCredentialResponse, isValidManifest, listAuthEnvNames, mapResponse, number, oneOf, optional, prepareToolArgs, resolveCliCommand, resolveHomeDir, resolveLinkUrl, resolveStaticAuth, signIn, string, toNameMapping, validateCredentialResponse, validateManifest };
1670
+ export { AuthError, CREDENTIALS_FORM_API, CREDENTIALS_FORM_SESSION_HEADER, CREDENTIALS_REQUEST_ELEMENT_ID, DEFAULT_UI_TEXTS, SERVER_NAME_PATTERN, TOOL_NAME_PATTERN, ToolError, applyDomain, array, boolean, buildRequest, compareVersions, createFileSecretStore, defineServer, defineTool, defineUI, describeAuth, describeAuthSpec, describeError, executeTool, fillTemplate, getPath, input, isDomainValue, isInteractiveAuth, isJsonObject, isMissingFileError, isValidCredentialResponse, isValidManifest, listAuthEnvNames, mapResponse, number, oneOf, optional, prepareToolArgs, resolveCliCommand, resolveHomeDir, resolveLinkUrl, resolveStaticAuth, signIn, string, toNameMapping, validateCredentialResponse, validateManifest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usemcpkit/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Manifest-driven MCP tool execution: manifest validation, HTTP execution, response mapping, auth and the server SDK.",
5
5
  "repository": {
6
6
  "type": "git",