@digipair/skill-mcp 0.107.4 → 0.107.5

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/index.esm.js CHANGED
@@ -23907,14 +23907,14 @@ function indent(str, spaces) {
23907
23907
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23908
23908
  // match is required
23909
23909
  if (!match) {
23910
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23910
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23911
23911
  v: nextMatch1
23912
23912
  };
23913
23913
  }
23914
23914
  var token = match.token, offset = match.offset;
23915
23915
  i1 += offset;
23916
23916
  if (token === " ") {
23917
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23917
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23918
23918
  }
23919
23919
  tokens1 = _to_consumable_array$j(tokens1).concat([
23920
23920
  token
@@ -23933,7 +23933,7 @@ function indent(str, spaces) {
23933
23933
  if (contextKeys.some(function(el) {
23934
23934
  return el.startsWith(name);
23935
23935
  })) {
23936
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23936
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23937
23937
  }
23938
23938
  if (dateTimeIdentifiers.some(function(el) {
23939
23939
  return el === name;
@@ -23952,9 +23952,9 @@ function indent(str, spaces) {
23952
23952
  if (dateTimeIdentifiers.some(function(el) {
23953
23953
  return el.startsWith(name);
23954
23954
  })) {
23955
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23955
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23956
23956
  }
23957
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23957
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23958
23958
  v: nextMatch1
23959
23959
  };
23960
23960
  };
@@ -62340,6 +62340,35 @@ var MAXIMUM_MESSAGE_SIZE = "4mb";
62340
62340
  ();
62341
62341
 
62342
62342
  let MCPServerService = class MCPServerService {
62343
+ jsonSchemaToZod(schema) {
62344
+ const zodProps = {};
62345
+ switch(schema.type){
62346
+ case 'string':
62347
+ return z.string().optional();
62348
+ case 'number':
62349
+ return z.number().optional();
62350
+ case 'boolean':
62351
+ return z.boolean().optional();
62352
+ case 'object':
62353
+ for(const prop in schema.properties){
62354
+ zodProps[prop] = this.jsonSchemaToZod(schema.properties[prop]);
62355
+ if (schema.properties[prop].description) {
62356
+ zodProps[prop] = zodProps[prop].describe(schema.properties[prop].description);
62357
+ }
62358
+ }
62359
+ var _schema_required;
62360
+ return z.object(zodProps).required(((_schema_required = schema.required) != null ? _schema_required : []).reduce((acc, reqProp)=>_extends({}, acc, {
62361
+ [reqProp]: true
62362
+ }), {})).optional();
62363
+ case 'array':
62364
+ if (schema.items) {
62365
+ return z.array(this.jsonSchemaToZod(schema.items)).optional();
62366
+ }
62367
+ return z.array(z.unknown()).optional();
62368
+ default:
62369
+ throw new Error(`Unsupported JSON Schema type: ${schema.type}`);
62370
+ }
62371
+ }
62343
62372
  async createServer(params, _pinsSettingsList, context) {
62344
62373
  const { name = 'digipair-mcp-server', version = '1.0.0', tools = [] } = params;
62345
62374
  const server = new McpServer({
@@ -62349,11 +62378,25 @@ let MCPServerService = class MCPServerService {
62349
62378
  // Register tools
62350
62379
  for(let i = 0; i < tools.length; i++){
62351
62380
  const tool = tools[i];
62381
+ let inputSchema;
62382
+ if (tool.inputSchema) {
62383
+ inputSchema = {};
62384
+ for(const prop in tool.inputSchema){
62385
+ inputSchema[prop] = this.jsonSchemaToZod(tool.inputSchema[prop]);
62386
+ }
62387
+ }
62388
+ let outputSchema;
62389
+ if (tool.outputSchema) {
62390
+ outputSchema = {};
62391
+ for(const prop in tool.outputSchema){
62392
+ outputSchema[prop] = this.jsonSchemaToZod(tool.outputSchema[prop]);
62393
+ }
62394
+ }
62352
62395
  server.registerTool(tool.name, {
62353
62396
  title: tool.title,
62354
62397
  description: tool.description,
62355
- inputSchema: tool.inputSchema,
62356
- outputSchema: tool.outputSchema
62398
+ inputSchema: inputSchema,
62399
+ outputSchema: outputSchema
62357
62400
  }, async (params)=>{
62358
62401
  return await executePinsList(tool.execute, {
62359
62402
  context,
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@digipair/skill-mcp",
3
- "version": "0.107.4",
3
+ "version": "0.107.5",
4
4
  "keywords": [
5
5
  "digipair",
6
6
  "service",
7
7
  "tool"
8
8
  ],
9
- "dependencies": {},
9
+ "dependencies": {
10
+ "@digipair/engine": "0.107.5",
11
+ "zod": "^3.23.8",
12
+ "@modelcontextprotocol/sdk": "^1.18.2"
13
+ },
10
14
  "main": "./index.cjs.js",
11
15
  "module": "./index.esm.js"
12
16
  }
@@ -1,2 +0,0 @@
1
- export * from './lib/engine';
2
- export * from './lib/pins-settings.interface';
@@ -1,9 +0,0 @@
1
- export interface Alias {
2
- name: string;
3
- library: string;
4
- element: string;
5
- properties: {
6
- library: string;
7
- element: string;
8
- };
9
- }
@@ -1,13 +0,0 @@
1
- import { PinsSettings } from './pins-settings.interface';
2
- type CONFIG_KEY = 'BASE_URL' | 'LIBRARIES' | 'ALIAS' | 'LOGGER';
3
- export declare const config: {
4
- set: (key: CONFIG_KEY, value: any) => void;
5
- log: (level: string, path: string, message: string, context: any, data?: any) => any;
6
- };
7
- export declare const applyTemplate: (value: any, context: any) => any;
8
- export declare const executePinsList: (pinsSettingsList: PinsSettings[], context: any, path?: string) => Promise<any>;
9
- export declare const generateElementFromPins: (pinsSettings: PinsSettings, parent: Element, context: any, document?: Document, options?: {
10
- import: boolean;
11
- }) => Promise<Element | void>;
12
- export declare const preparePinsSettings: (settings: PinsSettings, context: any) => PinsSettings;
13
- export {};
@@ -1,15 +0,0 @@
1
- export interface PinsSettings {
2
- library: string;
3
- element: string;
4
- properties?: {
5
- [key: string]: any;
6
- };
7
- conditions?: {
8
- if?: boolean;
9
- each?: any[];
10
- };
11
- pins?: PinsSettings[];
12
- events?: {
13
- [key: string]: PinsSettings[];
14
- };
15
- }