@intlayer/mcp 9.5.0 → 9.5.2

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.
@@ -1,5 +1,5 @@
1
- import { dirname as dirname$1 } from "node:path";
2
1
  import { createMCPClient } from "@ai-sdk/mcp";
2
+ import { dirname as dirname$1 } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { isESModule } from "@intlayer/config/utils";
5
5
 
@@ -1,13 +1,13 @@
1
- import { loadInstallLSPTool } from "../tools/installLSP.mjs";
2
- import { loadCLITools } from "../tools/cli.mjs";
3
1
  import { loadAPITools } from "../tools/api.mjs";
4
- import { loadInstallSkillsTool } from "../tools/installSkills.mjs";
2
+ import { loadCLITools } from "../tools/cli.mjs";
5
3
  import { loadDocsTools } from "../tools/docs.mjs";
6
- import z from "zod";
4
+ import { loadInstallLSPTool } from "../tools/installLSP.mjs";
5
+ import { loadInstallSkillsTool } from "../tools/installSkills.mjs";
7
6
  import { dirname as dirname$1, resolve } from "node:path";
8
7
  import { fileURLToPath } from "node:url";
9
8
  import { isESModule } from "@intlayer/config/utils";
10
9
  import { readFileSync } from "node:fs";
10
+ import z from "zod";
11
11
 
12
12
  //#region src/server/server.ts
13
13
  const dirname = isESModule ? dirname$1(fileURLToPath(import.meta.url)) : __dirname;
@@ -74,20 +74,22 @@ const loadAPITools = (server) => {
74
74
  description: "Create a new dictionary in the selected project.",
75
75
  inputSchema: {
76
76
  ...authSchema,
77
+ projectId: z.string().describe("ID of the CMS project owning the dictionary. Must be the currently selected project."),
77
78
  key: z.string().describe("Unique key for the dictionary"),
78
79
  title: z.string().optional().describe("Human-readable title"),
79
80
  description: z.string().optional().describe("Description of the dictionary"),
80
81
  content: z.record(z.string(), z.unknown()).optional().describe("Initial content as JSON object")
81
82
  },
82
83
  annotations: { destructiveHint: false }
83
- }, async ({ clientId, clientSecret, key, title, description, content }) => {
84
+ }, async ({ clientId, clientSecret, projectId, key, title, description, content }) => {
84
85
  try {
85
- const result = await (await getAPI(clientId, clientSecret)).dictionary.addDictionary({
86
+ const result = await (await getAPI(clientId, clientSecret)).dictionary.addDictionary({ dictionary: {
86
87
  key,
87
88
  title,
88
89
  description,
89
- content
90
- });
90
+ content,
91
+ projectIds: [projectId]
92
+ } });
91
93
  return ok(result);
92
94
  } catch (error) {
93
95
  return fail("Create dictionary", error);
@@ -163,17 +165,15 @@ const loadAPITools = (server) => {
163
165
  key: z.string().describe("Unique tag key"),
164
166
  name: z.string().optional().describe("Display name for the tag"),
165
167
  description: z.string().optional().describe("Description of the tag"),
166
- color: z.string().optional().describe("Tag color (hex code)"),
167
168
  instructions: z.string().optional().describe("AI instructions to apply when this tag is used")
168
169
  },
169
170
  annotations: { destructiveHint: false }
170
- }, async ({ clientId, clientSecret, key, name, description, color, instructions }) => {
171
+ }, async ({ clientId, clientSecret, key, name, description, instructions }) => {
171
172
  try {
172
173
  const result = await (await getAPI(clientId, clientSecret)).tag.addTag({
173
174
  key,
174
175
  name,
175
176
  description,
176
- color,
177
177
  instructions
178
178
  });
179
179
  return ok(result);
@@ -190,17 +190,15 @@ const loadAPITools = (server) => {
190
190
  key: z.string().optional().describe("New key"),
191
191
  name: z.string().optional().describe("New display name"),
192
192
  description: z.string().optional().describe("New description"),
193
- color: z.string().optional().describe("New color (hex code)"),
194
193
  instructions: z.string().optional().describe("New AI instructions")
195
194
  },
196
195
  annotations: { destructiveHint: true }
197
- }, async ({ clientId, clientSecret, tagId, key, name, description, color, instructions }) => {
196
+ }, async ({ clientId, clientSecret, tagId, key, name, description, instructions }) => {
198
197
  try {
199
198
  const result = await (await getAPI(clientId, clientSecret)).tag.updateTag(tagId, {
200
199
  key,
201
200
  name,
202
201
  description,
203
- color,
204
202
  instructions
205
203
  });
206
204
  return ok(result);
@@ -265,16 +263,12 @@ const loadAPITools = (server) => {
265
263
  description: "Update the selected organization name or settings.",
266
264
  inputSchema: {
267
265
  ...authSchema,
268
- name: z.string().optional().describe("New organization name"),
269
- customInstructions: z.string().optional().describe("Custom AI instructions for this organization")
266
+ name: z.string().optional().describe("New organization name")
270
267
  },
271
268
  annotations: { destructiveHint: true }
272
- }, async ({ clientId, clientSecret, name, customInstructions }) => {
269
+ }, async ({ clientId, clientSecret, name }) => {
273
270
  try {
274
- const result = await (await getAPI(clientId, clientSecret)).organization.updateOrganization({
275
- name,
276
- customInstructions
277
- });
271
+ const result = await (await getAPI(clientId, clientSecret)).organization.updateOrganization({ name });
278
272
  return ok(result);
279
273
  } catch (error) {
280
274
  return fail("Update organization", error);
@@ -1 +1 @@
1
- {"version":3,"file":"api.mjs","names":[],"sources":["../../../src/tools/api.ts"],"sourcesContent":["import { getIntlayerAPI } from '@intlayer/api';\nimport { editor } from '@intlayer/config/built';\nimport { getEditorClientSecret } from '@intlayer/config/secrets';\nimport z from 'zod';\nimport type { McpServer } from './docs';\n\ntype LoadAPITools = (server: McpServer) => void;\n\nconst authSchema = {\n clientId: z\n .string()\n .optional()\n .describe(\n 'Intlayer OAuth2 client ID (access key). Falls back to INTLAYER_CLIENT_ID env var.'\n ),\n clientSecret: z\n .string()\n .optional()\n .describe(\n 'Intlayer OAuth2 client secret. Falls back to INTLAYER_CLIENT_SECRET env var.'\n ),\n};\n\nconst getAPI = async (clientId?: string, clientSecret?: string) => {\n const resolvedClientId = clientId ?? editor.clientId;\n\n const resolvedClientSecret = clientSecret ?? getEditorClientSecret();\n\n if (!resolvedClientId || !resolvedClientSecret) {\n throw new Error(\n 'Intlayer credentials not found. Provide clientId/clientSecret or set INTLAYER_CLIENT_ID/INTLAYER_CLIENT_SECRET.'\n );\n }\n\n const configWithCreds = {\n editor: {\n ...editor,\n clientId: resolvedClientId,\n clientSecret: resolvedClientSecret,\n },\n };\n\n const tempAPI = getIntlayerAPI({}, configWithCreds);\n const tokenResult = await tempAPI.oAuth.getOAuth2AccessToken();\n const token = (tokenResult as any)?.data?.access_token as string | undefined;\n\n if (!token) {\n throw new Error(\n 'Failed to obtain OAuth2 access token. Check your credentials.'\n );\n }\n\n return getIntlayerAPI(\n { headers: { Authorization: `Bearer ${token}` } },\n { editor }\n );\n};\n\nconst ok = (data: unknown) => ({\n content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],\n});\n\nconst fail = (label: string, error: unknown) => ({\n content: [\n {\n type: 'text' as const,\n text: `${label} failed: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true as const,\n});\n\nexport const loadAPITools: LoadAPITools = (server) => {\n // ── Dictionaries ──────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-dictionaries-list',\n {\n title: 'List Dictionaries',\n description:\n 'List all dictionaries for the selected project. Returns keys, IDs, and metadata.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.getDictionaries({\n page,\n pageSize,\n });\n return ok(result);\n } catch (error) {\n return fail('List dictionaries', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-get',\n {\n title: 'Get Dictionary',\n description: 'Get a dictionary by its key, including its full content.',\n inputSchema: {\n ...authSchema,\n dictionaryKey: z.string().describe('The dictionary key'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, dictionaryKey }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.getDictionary(dictionaryKey);\n return ok(result);\n } catch (error) {\n return fail('Get dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-create',\n {\n title: 'Create Dictionary',\n description: 'Create a new dictionary in the selected project.',\n inputSchema: {\n ...authSchema,\n key: z.string().describe('Unique key for the dictionary'),\n title: z.string().optional().describe('Human-readable title'),\n description: z\n .string()\n .optional()\n .describe('Description of the dictionary'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Initial content as JSON object'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, key, title, description, content }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.addDictionary({\n key,\n title,\n description,\n content,\n });\n return ok(result);\n } catch (error) {\n return fail('Create dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-update',\n {\n title: 'Update Dictionary',\n description: 'Update an existing dictionary content or metadata.',\n inputSchema: {\n ...authSchema,\n id: z.string().describe('Dictionary ID'),\n key: z.string().optional().describe('New key for the dictionary'),\n title: z.string().optional().describe('New title'),\n description: z.string().optional().describe('New description'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Updated content as JSON object'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n id,\n key,\n title,\n description,\n content,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.updateDictionary({\n id,\n key,\n title,\n description,\n content,\n });\n return ok(result);\n } catch (error) {\n return fail('Update dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-delete',\n {\n title: 'Delete Dictionary',\n description:\n 'Delete a dictionary by its ID. This action is irreversible.',\n inputSchema: {\n ...authSchema,\n dictionaryId: z.string().describe('Dictionary ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, dictionaryId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.deleteDictionary(dictionaryId);\n return ok(result);\n } catch (error) {\n return fail('Delete dictionary', error);\n }\n }\n );\n\n // ── Tags ──────────────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-tags-list',\n {\n title: 'List Tags',\n description: 'List all tags for the selected organization.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.getTags({ page, pageSize });\n return ok(result);\n } catch (error) {\n return fail('List tags', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-create',\n {\n title: 'Create Tag',\n description:\n 'Create a new tag in the organization. Tags can be used to group dictionaries and provide AI context.',\n inputSchema: {\n ...authSchema,\n key: z.string().describe('Unique tag key'),\n name: z.string().optional().describe('Display name for the tag'),\n description: z.string().optional().describe('Description of the tag'),\n color: z.string().optional().describe('Tag color (hex code)'),\n instructions: z\n .string()\n .optional()\n .describe('AI instructions to apply when this tag is used'),\n },\n annotations: { destructiveHint: false },\n },\n async ({\n clientId,\n clientSecret,\n key,\n name,\n description,\n color,\n instructions,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.addTag({\n key,\n name,\n description,\n color,\n instructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Create tag', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-update',\n {\n title: 'Update Tag',\n description: 'Update an existing tag.',\n inputSchema: {\n ...authSchema,\n tagId: z.string().describe('Tag ID to update'),\n key: z.string().optional().describe('New key'),\n name: z.string().optional().describe('New display name'),\n description: z.string().optional().describe('New description'),\n color: z.string().optional().describe('New color (hex code)'),\n instructions: z.string().optional().describe('New AI instructions'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n tagId,\n key,\n name,\n description,\n color,\n instructions,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.updateTag(tagId, {\n key,\n name,\n description,\n color,\n instructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Update tag', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-delete',\n {\n title: 'Delete Tag',\n description: 'Delete a tag by its ID.',\n inputSchema: {\n ...authSchema,\n tagId: z.string().describe('Tag ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, tagId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.deleteTag(tagId);\n return ok(result);\n } catch (error) {\n return fail('Delete tag', error);\n }\n }\n );\n\n // ── Organizations ─────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-organizations-list',\n {\n title: 'List Organizations',\n description: 'List all organizations the authenticated user belongs to.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.organization.getOrganizations({\n page,\n pageSize,\n });\n return ok(result);\n } catch (error) {\n return fail('List organizations', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-organization-select',\n {\n title: 'Select Organization',\n description:\n 'Select an organization as the current active organization. Required before accessing organization-specific resources.',\n inputSchema: {\n ...authSchema,\n organizationId: z.string().describe('Organization ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, organizationId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result =\n await api.organization.selectOrganization(organizationId);\n return ok(result);\n } catch (error) {\n return fail('Select organization', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-organization-update',\n {\n title: 'Update Organization',\n description: 'Update the selected organization name or settings.',\n inputSchema: {\n ...authSchema,\n name: z.string().optional().describe('New organization name'),\n customInstructions: z\n .string()\n .optional()\n .describe('Custom AI instructions for this organization'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, name, customInstructions }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.organization.updateOrganization({\n name,\n customInstructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Update organization', error);\n }\n }\n );\n\n // ── Projects ──────────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-cms-projects-list',\n {\n title: 'List CMS Projects',\n description:\n 'List all Intlayer CMS projects for the selected organization. These are server-side projects, not local project directories.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.getProjects({ page, pageSize });\n return ok(result);\n } catch (error) {\n return fail('List CMS projects', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-select',\n {\n title: 'Select CMS Project',\n description:\n 'Select a CMS project as the current active project. Required before accessing project-specific dictionaries.',\n inputSchema: {\n ...authSchema,\n projectId: z.string().describe('Project ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, projectId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.selectProject(projectId);\n return ok(result);\n } catch (error) {\n return fail('Select CMS project', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-create',\n {\n title: 'Create CMS Project',\n description: 'Create a new CMS project in the selected organization.',\n inputSchema: {\n ...authSchema,\n name: z.string().describe('Project name'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.addProject({ name });\n return ok(result);\n } catch (error) {\n return fail('Create CMS project', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-update',\n {\n title: 'Update CMS Project',\n description: 'Update the selected CMS project settings.',\n inputSchema: {\n ...authSchema,\n name: z.string().optional().describe('New project name'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.updateProject({ name });\n return ok(result);\n } catch (error) {\n return fail('Update CMS project', error);\n }\n }\n );\n\n // ── Environments ──────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-cms-environment-select',\n {\n title: 'Select CMS Environment',\n description:\n 'Select a CMS environment as the current active environment. Required before accessing environment-specific dictionaries.',\n inputSchema: {\n ...authSchema,\n environmentId: z.string().describe('Environment ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, environmentId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.selectEnvironment(environmentId);\n return ok(result);\n } catch (error) {\n return fail('Select CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-reset',\n {\n title: 'Reset CMS Environment to Production',\n description:\n 'Reset the current active environment to the default production environment.',\n inputSchema: {\n ...authSchema,\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.resetToProductionEnvironment();\n return ok(result);\n } catch (error) {\n return fail('Reset CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-create',\n {\n title: 'Create CMS Environment',\n description: 'Create a new CMS environment in the selected project.',\n inputSchema: {\n ...authSchema,\n name: z.string().describe('Environment name'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.addEnvironment({ name });\n return ok(result);\n } catch (error) {\n return fail('Create CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-update',\n {\n title: 'Update CMS Environment',\n description: 'Update the selected CMS environment settings.',\n inputSchema: {\n ...authSchema,\n environmentId: z.string().describe('Environment ID to update'),\n name: z.string().optional().describe('New environment name'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, environmentId, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.updateEnvironment(environmentId, {\n name,\n });\n return ok(result);\n } catch (error) {\n return fail('Update CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-delete',\n {\n title: 'Delete CMS Environment',\n description: 'Delete a CMS environment by its ID.',\n inputSchema: {\n ...authSchema,\n environmentId: z.string().describe('Environment ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, environmentId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.deleteEnvironment(environmentId);\n return ok(result);\n } catch (error) {\n return fail('Delete CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-migrate',\n {\n title: 'Migrate CMS Environment',\n description:\n 'Migrate dictionaries and configuration from one environment to another.',\n inputSchema: {\n ...authSchema,\n sourceEnvironmentId: z.string().describe('Source environment ID'),\n targetEnvironmentId: z.string().describe('Target environment ID'),\n strategy: z\n .enum(['overwrite', 'fill-missing'])\n .describe(\n 'Migration strategy: overwrite existing or only fill missing'\n ),\n migrateContent: z\n .boolean()\n .optional()\n .describe('Whether to migrate content (dictionaries)'),\n migrateConfiguration: z\n .boolean()\n .optional()\n .describe('Whether to migrate environment configuration'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n sourceEnvironmentId,\n targetEnvironmentId,\n strategy,\n migrateContent,\n migrateConfiguration,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.migrateEnvironment({\n sourceEnvironmentId,\n targetEnvironmentId,\n strategy,\n migrateContent,\n migrateConfiguration,\n });\n return ok(result);\n } catch (error) {\n return fail('Migrate CMS environment', error);\n }\n }\n );\n};\n"],"mappings":";;;;;;AAQA,MAAM,aAAa;CACjB,UAAU,EACP,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SACC,mFACF;CACF,cAAc,EACX,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SACC,8EACF;AACJ;AAEA,MAAM,SAAS,OAAO,UAAmB,iBAA0B;CACjE,MAAM,mBAAmB,YAAY,OAAO;CAE5C,MAAM,uBAAuB,gBAAgB,sBAAsB;CAEnE,IAAI,CAAC,oBAAoB,CAAC,sBACxB,MAAM,IAAI,MACR,iHACF;CAGF,MAAM,kBAAkB,EACtB,QAAQ;EACN,GAAG;EACH,UAAU;EACV,cAAc;CAChB,EACF;CAIA,MAAM,SAAS,MAFC,eAAe,CAAC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AAe,EACpE,KACF,CAAC;GACD,OAAO,GAAG,MAAM;EAClB,SAAS,OAAO;GACd,OAAO,KAAK,0BAA0B,KAAK;EAC7C;CACF,CACF;CAEA,OAAO,aACL,mCACA;EACE,OAAO;EACP,aAAa;EACb,aAAa;GACX,GAAG;GACH,eAAe,EAAE,OAAO,CAAC,CAAC,SAAS,0BAA0B;EAC/D;EACA,aAAa,EAAE,iBAAiB,KAAK;CACvC,GACA,OAAO,EAAE,UAAU,cAAc,oBAAoB;EACnD,IAAI;GAEF,MAAM,SAAS,OAAM,MADH,OAAO,UAAU,YAAY,EACvB,CAAC,YAAY,kBAAkB,aAAa;GACpE,OAAO,GAAG,MAAM;EAClB,SAAS,OAAO;GACd,OAAO,KAAK,0BAA0B,KAAK;EAC7C;CACF,CACF;CAEA,OAAO,aACL,oCACA;EACE,OAAO;EACP,aACE;EACF,aAAa;GACX,GAAG;GACH,qBAAqB,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;GAChE,qBAAqB,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;GAChE,UAAU,EACP,KAAK,CAAC,aAAa,cAAc,CAAC,CAAC,CACnC,SACC,6DACF;GACF,gBAAgB,EACb,QAAQ,CAAC,CACT,SAAS,CAAC,CACV,SAAS,2CAA2C;GACvD,sBAAsB,EACnB,QAAQ,CAAC,CACT,SAAS,CAAC,CACV,SAAS,8CAA8C;EAC5D;EACA,aAAa,EAAE,iBAAiB,KAAK;CACvC,GACA,OAAO,EACL,UACA,cACA,qBACA,qBACA,UACA,gBACA,2BACI;EACJ,IAAI;GAEF,MAAM,SAAS,OAAM,MADH,OAAO,UAAU,YAAY,EACvB,CAAC,YAAY,mBAAmB;IACtD;IACA;IACA;IACA;IACA;GACF,CAAC;GACD,OAAO,GAAG,MAAM;EAClB,SAAS,OAAO;GACd,OAAO,KAAK,2BAA2B,KAAK;EAC9C;CACF,CACF;AACF"}
1
+ {"version":3,"file":"api.mjs","names":[],"sources":["../../../src/tools/api.ts"],"sourcesContent":["import { getIntlayerAPI } from '@intlayer/api';\nimport { editor } from '@intlayer/config/built';\nimport { getEditorClientSecret } from '@intlayer/config/secrets';\nimport type { ContentNode } from '@intlayer/types/dictionary';\nimport z from 'zod';\nimport type { McpServer } from './docs';\n\ntype LoadAPITools = (server: McpServer) => void;\n\nconst authSchema = {\n clientId: z\n .string()\n .optional()\n .describe(\n 'Intlayer OAuth2 client ID (access key). Falls back to INTLAYER_CLIENT_ID env var.'\n ),\n clientSecret: z\n .string()\n .optional()\n .describe(\n 'Intlayer OAuth2 client secret. Falls back to INTLAYER_CLIENT_SECRET env var.'\n ),\n};\n\nconst getAPI = async (clientId?: string, clientSecret?: string) => {\n const resolvedClientId = clientId ?? editor.clientId;\n\n const resolvedClientSecret = clientSecret ?? getEditorClientSecret();\n\n if (!resolvedClientId || !resolvedClientSecret) {\n throw new Error(\n 'Intlayer credentials not found. Provide clientId/clientSecret or set INTLAYER_CLIENT_ID/INTLAYER_CLIENT_SECRET.'\n );\n }\n\n const configWithCreds = {\n editor: {\n ...editor,\n clientId: resolvedClientId,\n clientSecret: resolvedClientSecret,\n },\n };\n\n const tempAPI = getIntlayerAPI({}, configWithCreds);\n const tokenResult = await tempAPI.oAuth.getOAuth2AccessToken();\n const token = (tokenResult as any)?.data?.access_token as string | undefined;\n\n if (!token) {\n throw new Error(\n 'Failed to obtain OAuth2 access token. Check your credentials.'\n );\n }\n\n return getIntlayerAPI(\n { headers: { Authorization: `Bearer ${token}` } },\n { editor }\n );\n};\n\nconst ok = (data: unknown) => ({\n content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],\n});\n\nconst fail = (label: string, error: unknown) => ({\n content: [\n {\n type: 'text' as const,\n text: `${label} failed: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true as const,\n});\n\nexport const loadAPITools: LoadAPITools = (server) => {\n // ── Dictionaries ──────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-dictionaries-list',\n {\n title: 'List Dictionaries',\n description:\n 'List all dictionaries for the selected project. Returns keys, IDs, and metadata.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.getDictionaries({\n page,\n pageSize,\n });\n return ok(result);\n } catch (error) {\n return fail('List dictionaries', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-get',\n {\n title: 'Get Dictionary',\n description: 'Get a dictionary by its key, including its full content.',\n inputSchema: {\n ...authSchema,\n dictionaryKey: z.string().describe('The dictionary key'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, dictionaryKey }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.getDictionary(dictionaryKey);\n return ok(result);\n } catch (error) {\n return fail('Get dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-create',\n {\n title: 'Create Dictionary',\n description: 'Create a new dictionary in the selected project.',\n inputSchema: {\n ...authSchema,\n projectId: z\n .string()\n .describe(\n 'ID of the CMS project owning the dictionary. Must be the currently selected project.'\n ),\n key: z.string().describe('Unique key for the dictionary'),\n title: z.string().optional().describe('Human-readable title'),\n description: z\n .string()\n .optional()\n .describe('Description of the dictionary'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Initial content as JSON object'),\n },\n annotations: { destructiveHint: false },\n },\n async ({\n clientId,\n clientSecret,\n projectId,\n key,\n title,\n description,\n content,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.addDictionary({\n dictionary: {\n key,\n title,\n description,\n content: content as ContentNode | undefined,\n projectIds: [projectId],\n },\n });\n return ok(result);\n } catch (error) {\n return fail('Create dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-update',\n {\n title: 'Update Dictionary',\n description: 'Update an existing dictionary content or metadata.',\n inputSchema: {\n ...authSchema,\n id: z.string().describe('Dictionary ID'),\n key: z.string().optional().describe('New key for the dictionary'),\n title: z.string().optional().describe('New title'),\n description: z.string().optional().describe('New description'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Updated content as JSON object'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n id,\n key,\n title,\n description,\n content,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.updateDictionary({\n id,\n key,\n title,\n description,\n content,\n });\n return ok(result);\n } catch (error) {\n return fail('Update dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-delete',\n {\n title: 'Delete Dictionary',\n description:\n 'Delete a dictionary by its ID. This action is irreversible.',\n inputSchema: {\n ...authSchema,\n dictionaryId: z.string().describe('Dictionary ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, dictionaryId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.deleteDictionary(dictionaryId);\n return ok(result);\n } catch (error) {\n return fail('Delete dictionary', error);\n }\n }\n );\n\n // ── Tags ──────────────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-tags-list',\n {\n title: 'List Tags',\n description: 'List all tags for the selected organization.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.getTags({ page, pageSize });\n return ok(result);\n } catch (error) {\n return fail('List tags', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-create',\n {\n title: 'Create Tag',\n description:\n 'Create a new tag in the organization. Tags can be used to group dictionaries and provide AI context.',\n inputSchema: {\n ...authSchema,\n key: z.string().describe('Unique tag key'),\n name: z.string().optional().describe('Display name for the tag'),\n description: z.string().optional().describe('Description of the tag'),\n instructions: z\n .string()\n .optional()\n .describe('AI instructions to apply when this tag is used'),\n },\n annotations: { destructiveHint: false },\n },\n async ({\n clientId,\n clientSecret,\n key,\n name,\n description,\n instructions,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.addTag({\n key,\n name,\n description,\n instructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Create tag', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-update',\n {\n title: 'Update Tag',\n description: 'Update an existing tag.',\n inputSchema: {\n ...authSchema,\n tagId: z.string().describe('Tag ID to update'),\n key: z.string().optional().describe('New key'),\n name: z.string().optional().describe('New display name'),\n description: z.string().optional().describe('New description'),\n instructions: z.string().optional().describe('New AI instructions'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n tagId,\n key,\n name,\n description,\n instructions,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.updateTag(tagId, {\n key,\n name,\n description,\n instructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Update tag', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-delete',\n {\n title: 'Delete Tag',\n description: 'Delete a tag by its ID.',\n inputSchema: {\n ...authSchema,\n tagId: z.string().describe('Tag ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, tagId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.deleteTag(tagId);\n return ok(result);\n } catch (error) {\n return fail('Delete tag', error);\n }\n }\n );\n\n // ── Organizations ─────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-organizations-list',\n {\n title: 'List Organizations',\n description: 'List all organizations the authenticated user belongs to.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.organization.getOrganizations({\n page,\n pageSize,\n });\n return ok(result);\n } catch (error) {\n return fail('List organizations', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-organization-select',\n {\n title: 'Select Organization',\n description:\n 'Select an organization as the current active organization. Required before accessing organization-specific resources.',\n inputSchema: {\n ...authSchema,\n organizationId: z.string().describe('Organization ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, organizationId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result =\n await api.organization.selectOrganization(organizationId);\n return ok(result);\n } catch (error) {\n return fail('Select organization', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-organization-update',\n {\n title: 'Update Organization',\n description: 'Update the selected organization name or settings.',\n inputSchema: {\n ...authSchema,\n name: z.string().optional().describe('New organization name'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.organization.updateOrganization({\n name,\n });\n return ok(result);\n } catch (error) {\n return fail('Update organization', error);\n }\n }\n );\n\n // ── Projects ──────────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-cms-projects-list',\n {\n title: 'List CMS Projects',\n description:\n 'List all Intlayer CMS projects for the selected organization. These are server-side projects, not local project directories.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.getProjects({ page, pageSize });\n return ok(result);\n } catch (error) {\n return fail('List CMS projects', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-select',\n {\n title: 'Select CMS Project',\n description:\n 'Select a CMS project as the current active project. Required before accessing project-specific dictionaries.',\n inputSchema: {\n ...authSchema,\n projectId: z.string().describe('Project ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, projectId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.selectProject(projectId);\n return ok(result);\n } catch (error) {\n return fail('Select CMS project', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-create',\n {\n title: 'Create CMS Project',\n description: 'Create a new CMS project in the selected organization.',\n inputSchema: {\n ...authSchema,\n name: z.string().describe('Project name'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.addProject({ name });\n return ok(result);\n } catch (error) {\n return fail('Create CMS project', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-update',\n {\n title: 'Update CMS Project',\n description: 'Update the selected CMS project settings.',\n inputSchema: {\n ...authSchema,\n name: z.string().optional().describe('New project name'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.updateProject({ name });\n return ok(result);\n } catch (error) {\n return fail('Update CMS project', error);\n }\n }\n );\n\n // ── Environments ──────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-cms-environment-select',\n {\n title: 'Select CMS Environment',\n description:\n 'Select a CMS environment as the current active environment. Required before accessing environment-specific dictionaries.',\n inputSchema: {\n ...authSchema,\n environmentId: z.string().describe('Environment ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, environmentId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.selectEnvironment(environmentId);\n return ok(result);\n } catch (error) {\n return fail('Select CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-reset',\n {\n title: 'Reset CMS Environment to Production',\n description:\n 'Reset the current active environment to the default production environment.',\n inputSchema: {\n ...authSchema,\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.resetToProductionEnvironment();\n return ok(result);\n } catch (error) {\n return fail('Reset CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-create',\n {\n title: 'Create CMS Environment',\n description: 'Create a new CMS environment in the selected project.',\n inputSchema: {\n ...authSchema,\n name: z.string().describe('Environment name'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.addEnvironment({ name });\n return ok(result);\n } catch (error) {\n return fail('Create CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-update',\n {\n title: 'Update CMS Environment',\n description: 'Update the selected CMS environment settings.',\n inputSchema: {\n ...authSchema,\n environmentId: z.string().describe('Environment ID to update'),\n name: z.string().optional().describe('New environment name'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, environmentId, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.updateEnvironment(environmentId, {\n name,\n });\n return ok(result);\n } catch (error) {\n return fail('Update CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-delete',\n {\n title: 'Delete CMS Environment',\n description: 'Delete a CMS environment by its ID.',\n inputSchema: {\n ...authSchema,\n environmentId: z.string().describe('Environment ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, environmentId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.deleteEnvironment(environmentId);\n return ok(result);\n } catch (error) {\n return fail('Delete CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-migrate',\n {\n title: 'Migrate CMS Environment',\n description:\n 'Migrate dictionaries and configuration from one environment to another.',\n inputSchema: {\n ...authSchema,\n sourceEnvironmentId: z.string().describe('Source environment ID'),\n targetEnvironmentId: z.string().describe('Target environment ID'),\n strategy: z\n .enum(['overwrite', 'fill-missing'])\n .describe(\n 'Migration strategy: overwrite existing or only fill missing'\n ),\n migrateContent: z\n .boolean()\n .optional()\n .describe('Whether to migrate content (dictionaries)'),\n migrateConfiguration: z\n .boolean()\n .optional()\n .describe('Whether to migrate environment configuration'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n sourceEnvironmentId,\n targetEnvironmentId,\n strategy,\n migrateContent,\n migrateConfiguration,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.migrateEnvironment({\n sourceEnvironmentId,\n targetEnvironmentId,\n strategy,\n migrateContent,\n migrateConfiguration,\n });\n return ok(result);\n } catch (error) {\n return fail('Migrate CMS environment', error);\n }\n }\n );\n};\n"],"mappings":";;;;;;AASA,MAAM,aAAa;CACjB,UAAU,EACP,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SACC,mFACF;CACF,cAAc,EACX,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SACC,8EACF;AACJ;AAEA,MAAM,SAAS,OAAO,UAAmB,iBAA0B;CACjE,MAAM,mBAAmB,YAAY,OAAO;CAE5C,MAAM,uBAAuB,gBAAgB,sBAAsB;CAEnE,IAAI,CAAC,oBAAoB,CAAC,sBACxB,MAAM,IAAI,MACR,iHACF;CAGF,MAAM,kBAAkB,EACtB,QAAQ;EACN,GAAG;EACH,UAAU;EACV,cAAc;CAChB,EACF;CAIA,MAAM,SAAS,MAFC,eAAe,CAAC,GAAG,eACH,CAAC,CAAC,MAAM,qBAAqB,EACnC,EAAU,MAAM;CAE1C,IAAI,CAAC,OACH,MAAM,IAAI,MACR,+DACF;CAGF,OAAO,eACL,EAAE,SAAS,EAAE,eAAe,UAAU,QAAQ,EAAE,GAChD,EAAE,OAAO,CACX;AACF;AAEA,MAAM,MAAM,UAAmB,EAC7B,SAAS,CAAC;CAAE,MAAM;CAAiB,MAAM,KAAK,UAAU,MAAM,MAAM,CAAC;AAAE,CAAC,EAC1E;AAEA,MAAM,QAAQ,OAAe,WAAoB;CAC/C,SAAS,CACP;EACE,MAAM;EACN,MAAM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GACX,GAAG;GACH,qBAAqB,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;GAChE,qBAAqB,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;GAChE,UAAU,EACP,KAAK,CAAC,aAAa,cAAc,CAAC,CAAC,CACnC,SACC,6DACF;GACF,gBAAgB,EACb,QAAQ,CAAC,CACT,SAAS,CAAC,CACV,SAAS,2CAA2C;GACvD,sBAAsB,EACnB,QAAQ,CAAC,CACT,SAAS,CAAC,CACV,SAAS,8CAA8C;EAC5D;EACA,aAAa,EAAE,iBAAiB,KAAK;CACvC,GACA,OAAO,EACL,UACA,cACA,qBACA,qBACA,UACA,gBACA,2BACI;EACJ,IAAI;GAEF,MAAM,SAAS,OAAM,MADH,OAAO,UAAU,YAAY,EACvB,CAAC,YAAY,mBAAmB;IACtD;IACA;IACA;IACA;IACA;GACF,CAAC;GACD,OAAO,GAAG,MAAM;EAClB,SAAS,OAAO;GACd,OAAO,KAAK,2BAA2B,KAAK;EAC9C;CACF,CACF;AACF"}
@@ -1,7 +1,7 @@
1
- import { listProjects } from "@intlayer/engine/cli";
2
- import z from "zod";
3
1
  import { relative } from "node:path";
2
+ import z from "zod";
4
3
  import { build, extract, fill, init, listContentDeclarationRows, listMissingTranslations, pull, push } from "@intlayer/cli";
4
+ import { listProjects } from "@intlayer/engine/cli";
5
5
  import { scanWebsite } from "@intlayer/engine/scan";
6
6
  import { ALL_LOCALES } from "@intlayer/types/allLocales";
7
7
 
@@ -1,7 +1,7 @@
1
- import { loadInstallLSPTool } from "./installLSP.mjs";
2
- import { loadCLITools } from "./cli.mjs";
3
1
  import { loadAPITools } from "./api.mjs";
4
- import { loadInstallSkillsTool } from "./installSkills.mjs";
2
+ import { loadCLITools } from "./cli.mjs";
5
3
  import { loadDocsTools } from "./docs.mjs";
4
+ import { loadInstallLSPTool } from "./installLSP.mjs";
5
+ import { loadInstallSkillsTool } from "./installSkills.mjs";
6
6
 
7
7
  export { loadAPITools, loadCLITools, loadDocsTools, loadInstallLSPTool, loadInstallSkillsTool };
@@ -1,5 +1,5 @@
1
- import { installLSP } from "@intlayer/engine/cli";
2
1
  import z from "zod";
2
+ import { installLSP } from "@intlayer/engine/cli";
3
3
 
4
4
  //#region src/tools/installLSP.ts
5
5
  const loadInstallLSPTool = (server) => {
@@ -1,6 +1,6 @@
1
- import { PLATFORMS, SKILLS, installSkills } from "@intlayer/engine/cli";
2
- import z from "zod";
3
1
  import * as readline from "node:readline";
2
+ import z from "zod";
3
+ import { PLATFORMS, SKILLS, installSkills } from "@intlayer/engine/cli";
4
4
 
5
5
  //#region src/tools/installSkills.ts
6
6
  const loadInstallSkillsTool = (server) => {
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","names":[],"sources":["../../../src/tools/api.ts"],"mappings":";;KAMK,gBAAgB,QAAQ;qBAkEhB,cAAc"}
1
+ {"version":3,"file":"api.d.ts","names":[],"sources":["../../../src/tools/api.ts"],"mappings":";;KAOK,gBAAgB,QAAQ;qBAkEhB,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/mcp",
3
- "version": "9.5.0",
3
+ "version": "9.5.2",
4
4
  "private": false,
5
5
  "description": "Intlayer MCP server. Handle MCP to help IDE to use Intlayer. It build, fill, pull, push, dictionaries",
6
6
  "keywords": [
@@ -111,22 +111,22 @@
111
111
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
112
112
  },
113
113
  "dependencies": {
114
- "@ai-sdk/mcp": "2.0.45",
114
+ "@ai-sdk/mcp": "2.0.48",
115
115
  "@fastify/cors": "11.3.0",
116
116
  "@fastify/helmet": "13.1.1",
117
- "@intlayer/api": "9.5.0",
118
- "@intlayer/cli": "9.5.0",
119
- "@intlayer/config": "9.5.0",
120
- "@intlayer/docs": "9.5.0",
121
- "@intlayer/engine": "9.5.0",
122
- "@intlayer/types": "9.5.0",
117
+ "@intlayer/api": "9.5.2",
118
+ "@intlayer/cli": "9.5.2",
119
+ "@intlayer/config": "9.5.2",
120
+ "@intlayer/docs": "9.5.2",
121
+ "@intlayer/engine": "9.5.2",
122
+ "@intlayer/types": "9.5.2",
123
123
  "dotenv": "17.4.2",
124
- "fastify": "5.12.3",
125
- "zod": "4.5.4"
124
+ "fastify": "5.12.4",
125
+ "zod": "4.6.2"
126
126
  },
127
127
  "devDependencies": {
128
- "@intlayer/types": "9.5.0",
129
- "@types/node": "26.5.0",
128
+ "@intlayer/types": "9.5.2",
129
+ "@types/node": "^22",
130
130
  "@utils/ts-config": "1.0.4",
131
131
  "@utils/ts-config-types": "1.0.4",
132
132
  "@utils/tsdown-config": "1.0.4",