@intlayer/mcp 7.5.8 → 7.5.9

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.
@@ -9,11 +9,11 @@ const loadCLITools = async (server) => {
9
9
  server.registerTool("intlayer-init", {
10
10
  title: "Initialize Intlayer",
11
11
  description: "Initialize Intlayer in the project",
12
- inputSchema: {},
12
+ inputSchema: { projectRoot: zod_v3.default.string().describe("Project root directory") },
13
13
  annotations: { destructiveHint: true }
14
- }, async () => {
14
+ }, async ({ projectRoot }) => {
15
15
  try {
16
- await (0, _intlayer_cli.init)();
16
+ await (0, _intlayer_cli.init)(projectRoot);
17
17
  return { content: [{
18
18
  type: "text",
19
19
  text: "Initialization successful."
@@ -1 +1 @@
1
- {"version":3,"file":"cli.cjs","names":["loadCLITools: LoadCLITools","z","log: Partial<LogConfig>","Locales","fillOptions: any","pushOptions: any"],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import {\n build,\n fill,\n init,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n transform,\n} from '@intlayer/cli';\nimport { Locales, type LogConfig } from '@intlayer/types';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadCLITools = (server: McpServer) => Promise<void>;\n\nexport const loadCLITools: LoadCLITools = async (server) => {\n server.registerTool(\n 'intlayer-init',\n {\n title: 'Initialize Intlayer',\n description: 'Initialize Intlayer in the project',\n inputSchema: {},\n annotations: {\n destructiveHint: true,\n },\n },\n async () => {\n try {\n await init();\n\n return {\n content: [\n {\n type: 'text',\n text: 'Initialization successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Initialization failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-build',\n {\n title: 'Build Dictionaries',\n description:\n 'Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.',\n inputSchema: {\n watch: z.boolean().optional().describe('Watch for changes'),\n baseDir: z.string().optional().describe('Base directory'),\n env: z.string().optional().describe('Environment'),\n envFile: z.string().optional().describe('Environment file'),\n verbose: z.boolean().optional().describe('Verbose output'),\n prefix: z.string().optional().describe('Log prefix'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async ({ watch, baseDir, env, envFile, verbose, prefix }) => {\n try {\n const log: Partial<LogConfig> = {};\n if (verbose) {\n log.mode = 'verbose';\n }\n if (prefix) {\n log.prefix = prefix;\n }\n\n await build({\n watch,\n configOptions: {\n baseDir,\n env,\n envFile,\n override: {\n log,\n },\n },\n });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Build successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Build failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-fill',\n {\n title: 'Fill Translations',\n description:\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n inputSchema: {\n sourceLocale: z\n .nativeEnum(Locales.ALL_LOCALES)\n .optional()\n .describe('Source locale'),\n outputLocales: z\n .union([\n z.nativeEnum(Locales.ALL_LOCALES),\n z.array(z.nativeEnum(Locales.ALL_LOCALES)),\n ])\n .optional()\n .describe('Output locales'),\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('File path'),\n mode: z.enum(['complete', 'review']).optional().describe('Fill mode'),\n keys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to include'),\n excludedKeys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to exclude'),\n pathFilter: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Path filter'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n aiOptions: z\n .object({\n provider: z.string().optional(),\n temperature: z.number().optional(),\n model: z.string().optional(),\n apiKey: z.string().optional(),\n customPrompt: z.string().optional(),\n applicationContext: z.string().optional(),\n })\n .optional()\n .describe('AI options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const fillOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n fillOptions.gitOptions = { ...restGit, mode };\n }\n\n await fill(fillOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Fill successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Fill failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-push',\n {\n title: 'Push Dictionaries',\n description: 'Push local dictionaries to the server',\n inputSchema: {\n deleteLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Delete local dictionary after push'),\n keepLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Keep local dictionary after push'),\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to push'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const pushOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n pushOptions.gitOptions = { ...restGit, mode };\n }\n\n await push(pushOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Push successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Push failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-pull',\n {\n title: 'Pull Dictionaries',\n description: 'Pull dictionaries from the CMS',\n inputSchema: {\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to pull'),\n newDictionariesPath: z\n .string()\n .optional()\n .describe('Path to save new dictionaries'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await pull(props);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Pull successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Pull failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-list',\n {\n title: 'List Content Declarations',\n description:\n 'List the content declaration (.content.{ts,tsx,js,json,...}) files present in the project. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const rows = listContentDeclarationRows(props);\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(rows, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-test',\n {\n title: 'Test Translations',\n description:\n 'Test if there are missing translations in the content declaration files. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const missingTranslations = listMissingTranslations(\n props?.configOptions\n );\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(missingTranslations, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content test failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-transform',\n {\n title: 'Transform Component',\n description:\n 'Transform an existing component to use Intlayer. Trigger this action to transform an existing component to be multilingual. If the component does not exist, create a normal React component including text in JSX, and then trigger this tool to transform it.',\n inputSchema: {\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('List of files to transform'),\n outputContentDeclarations: z\n .string()\n .optional()\n .describe('Path to output content declaration files'),\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await transform({\n files: Array.isArray(props.file)\n ? props.file\n : props.file\n ? [props.file]\n : undefined,\n outputContentDeclarations: props.outputContentDeclarations,\n configOptions: props.configOptions,\n });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Transform successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Transform failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n};\n"],"mappings":";;;;;;;AAgBA,MAAaA,eAA6B,OAAO,WAAW;AAC1D,QAAO,aACL,iBACA;EACE,OAAO;EACP,aAAa;EACb,aAAa,EAAE;EACf,aAAa,EACX,iBAAiB,MAClB;EACF,EACD,YAAY;AACV,MAAI;AACF,kCAAY;AAEZ,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM;IACP,CACF,EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,0BALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN;AAED,QAAO,aACL,kBACA;EACE,OAAO;EACP,aACE;EACF,aAAa;GACX,OAAOC,eAAE,SAAS,CAAC,UAAU,CAAC,SAAS,oBAAoB;GAC3D,SAASA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iBAAiB;GACzD,KAAKA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,cAAc;GAClD,SAASA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,mBAAmB;GAC3D,SAASA,eAAE,SAAS,CAAC,UAAU,CAAC,SAAS,iBAAiB;GAC1D,QAAQA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,aAAa;GACrD;EACD,aAAa,EACX,iBAAiB,MAClB;EACF,EACD,OAAO,EAAE,OAAO,SAAS,KAAK,SAAS,SAAS,aAAa;AAC3D,MAAI;GACF,MAAMC,MAA0B,EAAE;AAClC,OAAI,QACF,KAAI,OAAO;AAEb,OAAI,OACF,KAAI,SAAS;AAGf,kCAAY;IACV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AA2B,MAAM;IACjC,eAAe,MAAM;IACtB,CAAC;AAEF,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM;IACP,CACF,EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,qBALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN"}
1
+ {"version":3,"file":"cli.cjs","names":["loadCLITools: LoadCLITools","z","log: Partial<LogConfig>","Locales","fillOptions: any","pushOptions: any"],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import {\n build,\n fill,\n init,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n transform,\n} from '@intlayer/cli';\nimport { Locales, type LogConfig } from '@intlayer/types';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadCLITools = (server: McpServer) => Promise<void>;\n\nexport const loadCLITools: LoadCLITools = async (server) => {\n server.registerTool(\n 'intlayer-init',\n {\n title: 'Initialize Intlayer',\n description: 'Initialize Intlayer in the project',\n inputSchema: {\n projectRoot: z.string().describe('Project root directory'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async ({ projectRoot }) => {\n try {\n await init(projectRoot);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Initialization successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Initialization failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-build',\n {\n title: 'Build Dictionaries',\n description:\n 'Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.',\n inputSchema: {\n watch: z.boolean().optional().describe('Watch for changes'),\n baseDir: z.string().optional().describe('Base directory'),\n env: z.string().optional().describe('Environment'),\n envFile: z.string().optional().describe('Environment file'),\n verbose: z.boolean().optional().describe('Verbose output'),\n prefix: z.string().optional().describe('Log prefix'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async ({ watch, baseDir, env, envFile, verbose, prefix }) => {\n try {\n const log: Partial<LogConfig> = {};\n if (verbose) {\n log.mode = 'verbose';\n }\n if (prefix) {\n log.prefix = prefix;\n }\n\n await build({\n watch,\n configOptions: {\n baseDir,\n env,\n envFile,\n override: {\n log,\n },\n },\n });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Build successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Build failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-fill',\n {\n title: 'Fill Translations',\n description:\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n inputSchema: {\n sourceLocale: z\n .nativeEnum(Locales.ALL_LOCALES)\n .optional()\n .describe('Source locale'),\n outputLocales: z\n .union([\n z.nativeEnum(Locales.ALL_LOCALES),\n z.array(z.nativeEnum(Locales.ALL_LOCALES)),\n ])\n .optional()\n .describe('Output locales'),\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('File path'),\n mode: z.enum(['complete', 'review']).optional().describe('Fill mode'),\n keys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to include'),\n excludedKeys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to exclude'),\n pathFilter: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Path filter'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n aiOptions: z\n .object({\n provider: z.string().optional(),\n temperature: z.number().optional(),\n model: z.string().optional(),\n apiKey: z.string().optional(),\n customPrompt: z.string().optional(),\n applicationContext: z.string().optional(),\n })\n .optional()\n .describe('AI options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const fillOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n fillOptions.gitOptions = { ...restGit, mode };\n }\n\n await fill(fillOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Fill successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Fill failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-push',\n {\n title: 'Push Dictionaries',\n description: 'Push local dictionaries to the server',\n inputSchema: {\n deleteLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Delete local dictionary after push'),\n keepLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Keep local dictionary after push'),\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to push'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const pushOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n pushOptions.gitOptions = { ...restGit, mode };\n }\n\n await push(pushOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Push successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Push failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-pull',\n {\n title: 'Pull Dictionaries',\n description: 'Pull dictionaries from the CMS',\n inputSchema: {\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to pull'),\n newDictionariesPath: z\n .string()\n .optional()\n .describe('Path to save new dictionaries'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await pull(props);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Pull successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Pull failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-list',\n {\n title: 'List Content Declarations',\n description:\n 'List the content declaration (.content.{ts,tsx,js,json,...}) files present in the project. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const rows = listContentDeclarationRows(props);\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(rows, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-test',\n {\n title: 'Test Translations',\n description:\n 'Test if there are missing translations in the content declaration files. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const missingTranslations = listMissingTranslations(\n props?.configOptions\n );\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(missingTranslations, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content test failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-transform',\n {\n title: 'Transform Component',\n description:\n 'Transform an existing component to use Intlayer. Trigger this action to transform an existing component to be multilingual. If the component does not exist, create a normal React component including text in JSX, and then trigger this tool to transform it.',\n inputSchema: {\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('List of files to transform'),\n outputContentDeclarations: z\n .string()\n .optional()\n .describe('Path to output content declaration files'),\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await transform({\n files: Array.isArray(props.file)\n ? props.file\n : props.file\n ? [props.file]\n : undefined,\n outputContentDeclarations: props.outputContentDeclarations,\n configOptions: props.configOptions,\n });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Transform successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Transform failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n};\n"],"mappings":";;;;;;;AAgBA,MAAaA,eAA6B,OAAO,WAAW;AAC1D,QAAO,aACL,iBACA;EACE,OAAO;EACP,aAAa;EACb,aAAa,EACX,aAAaC,eAAE,QAAQ,CAAC,SAAS,yBAAyB,EAC3D;EACD,aAAa,EACX,iBAAiB,MAClB;EACF,EACD,OAAO,EAAE,kBAAkB;AACzB,MAAI;AACF,iCAAW,YAAY;AAEvB,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM;IACP,CACF,EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,0BALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN;AAED,QAAO,aACL,kBACA;EACE,OAAO;EACP,aACE;EACF,aAAa;GACX,OAAOA,eAAE,SAAS,CAAC,UAAU,CAAC,SAAS,oBAAoB;GAC3D,SAASA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iBAAiB;GACzD,KAAKA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,cAAc;GAClD,SAASA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,mBAAmB;GAC3D,SAASA,eAAE,SAAS,CAAC,UAAU,CAAC,SAAS,iBAAiB;GAC1D,QAAQA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,aAAa;GACrD;EACD,aAAa,EACX,iBAAiB,MAClB;EACF,EACD,OAAO,EAAE,OAAO,SAAS,KAAK,SAAS,SAAS,aAAa;AAC3D,MAAI;GACF,MAAMC,MAA0B,EAAE;AAClC,OAAI,QACF,KAAI,OAAO;AAEb,OAAI,OACF,KAAI,SAAS;AAGf,kCAAY;IACV;IACA,eAAe;KACb;KACA;KACA;KACA,UAAU,EACR,KACD;KACF;IACF,CAAC;AAEF,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM;IACP,CACF,EACF;WAC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EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,qBALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN"}
@@ -7,11 +7,11 @@ const loadCLITools = async (server) => {
7
7
  server.registerTool("intlayer-init", {
8
8
  title: "Initialize Intlayer",
9
9
  description: "Initialize Intlayer in the project",
10
- inputSchema: {},
10
+ inputSchema: { projectRoot: z.string().describe("Project root directory") },
11
11
  annotations: { destructiveHint: true }
12
- }, async () => {
12
+ }, async ({ projectRoot }) => {
13
13
  try {
14
- await init();
14
+ await init(projectRoot);
15
15
  return { content: [{
16
16
  type: "text",
17
17
  text: "Initialization successful."
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":["loadCLITools: LoadCLITools","log: Partial<LogConfig>","fillOptions: any","pushOptions: any"],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import {\n build,\n fill,\n init,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n transform,\n} from '@intlayer/cli';\nimport { Locales, type LogConfig } from '@intlayer/types';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadCLITools = (server: McpServer) => Promise<void>;\n\nexport const loadCLITools: LoadCLITools = async (server) => {\n server.registerTool(\n 'intlayer-init',\n {\n title: 'Initialize Intlayer',\n description: 'Initialize Intlayer in the project',\n inputSchema: {},\n annotations: {\n destructiveHint: true,\n },\n },\n async () => {\n try {\n await init();\n\n return {\n content: [\n {\n type: 'text',\n text: 'Initialization successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Initialization failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-build',\n {\n title: 'Build Dictionaries',\n description:\n 'Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.',\n inputSchema: {\n watch: z.boolean().optional().describe('Watch for changes'),\n baseDir: z.string().optional().describe('Base directory'),\n env: z.string().optional().describe('Environment'),\n envFile: z.string().optional().describe('Environment file'),\n verbose: z.boolean().optional().describe('Verbose output'),\n prefix: z.string().optional().describe('Log prefix'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async ({ watch, baseDir, env, envFile, verbose, prefix }) => {\n try {\n const log: Partial<LogConfig> = {};\n if (verbose) {\n log.mode = 'verbose';\n }\n if (prefix) {\n log.prefix = prefix;\n }\n\n await build({\n watch,\n configOptions: {\n baseDir,\n env,\n envFile,\n override: {\n log,\n },\n },\n });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Build successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Build failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-fill',\n {\n title: 'Fill Translations',\n description:\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n inputSchema: {\n sourceLocale: z\n .nativeEnum(Locales.ALL_LOCALES)\n .optional()\n .describe('Source locale'),\n outputLocales: z\n .union([\n z.nativeEnum(Locales.ALL_LOCALES),\n z.array(z.nativeEnum(Locales.ALL_LOCALES)),\n ])\n .optional()\n .describe('Output locales'),\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('File path'),\n mode: z.enum(['complete', 'review']).optional().describe('Fill mode'),\n keys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to include'),\n excludedKeys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to exclude'),\n pathFilter: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Path filter'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n aiOptions: z\n .object({\n provider: z.string().optional(),\n temperature: z.number().optional(),\n model: z.string().optional(),\n apiKey: z.string().optional(),\n customPrompt: z.string().optional(),\n applicationContext: z.string().optional(),\n })\n .optional()\n .describe('AI options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const fillOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n fillOptions.gitOptions = { ...restGit, mode };\n }\n\n await fill(fillOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Fill successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Fill failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-push',\n {\n title: 'Push Dictionaries',\n description: 'Push local dictionaries to the server',\n inputSchema: {\n deleteLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Delete local dictionary after push'),\n keepLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Keep local dictionary after push'),\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to push'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const pushOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n pushOptions.gitOptions = { ...restGit, mode };\n }\n\n await push(pushOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Push successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Push failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-pull',\n {\n title: 'Pull Dictionaries',\n description: 'Pull dictionaries from the CMS',\n inputSchema: {\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to pull'),\n newDictionariesPath: z\n .string()\n .optional()\n .describe('Path to save new dictionaries'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await pull(props);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Pull successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Pull failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-list',\n {\n title: 'List Content Declarations',\n description:\n 'List the content declaration (.content.{ts,tsx,js,json,...}) files present in the project. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const rows = listContentDeclarationRows(props);\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(rows, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-test',\n {\n title: 'Test Translations',\n description:\n 'Test if there are missing translations in the content declaration files. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const missingTranslations = listMissingTranslations(\n props?.configOptions\n );\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(missingTranslations, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content test failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-transform',\n {\n title: 'Transform Component',\n description:\n 'Transform an existing component to use Intlayer. Trigger this action to transform an existing component to be multilingual. If the component does not exist, create a normal React component including text in JSX, and then trigger this tool to transform it.',\n inputSchema: {\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('List of files to transform'),\n outputContentDeclarations: z\n .string()\n .optional()\n .describe('Path to output content declaration files'),\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await transform({\n files: Array.isArray(props.file)\n ? props.file\n : props.file\n ? [props.file]\n : undefined,\n outputContentDeclarations: props.outputContentDeclarations,\n configOptions: props.configOptions,\n });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Transform successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Transform failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n};\n"],"mappings":";;;;;AAgBA,MAAaA,eAA6B,OAAO,WAAW;AAC1D,QAAO,aACL,iBACA;EACE,OAAO;EACP,aAAa;EACb,aAAa,EAAE;EACf,aAAa,EACX,iBAAiB,MAClB;EACF,EACD,YAAY;AACV,MAAI;AACF,SAAM,MAAM;AAEZ,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM;IACP,CACF,EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,0BALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN;AAED,QAAO,aACL,kBACA;EACE,OAAO;EACP,aACE;EACF,aAAa;GACX,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,SAAS,oBAAoB;GAC3D,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iBAAiB;GACzD,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,cAAc;GAClD,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,mBAAmB;GAC3D,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,SAAS,iBAAiB;GAC1D,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,aAAa;GACrD;EACD,aAAa,EACX,iBAAiB,MAClB;EACF,EACD,OAAO,EAAE,OAAO,SAAS,KAAK,SAAS,SAAS,aAAa;AAC3D,MAAI;GACF,MAAMC,MAA0B,EAAE;AAClC,OAAI,QACF,KAAI,OAAO;AAEb,OAAI,OACF,KAAI,SAAS;AAGf,SAAM,MAAM;IACV;IACA,eAAe;KACb;KACA;KACA;KACA,UAAU,EACR,KACD;KACF;IACF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EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,qBALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN"}
1
+ {"version":3,"file":"cli.mjs","names":["loadCLITools: LoadCLITools","log: Partial<LogConfig>","fillOptions: any","pushOptions: any"],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import {\n build,\n fill,\n init,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n transform,\n} from '@intlayer/cli';\nimport { Locales, type LogConfig } from '@intlayer/types';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadCLITools = (server: McpServer) => Promise<void>;\n\nexport const loadCLITools: LoadCLITools = async (server) => {\n server.registerTool(\n 'intlayer-init',\n {\n title: 'Initialize Intlayer',\n description: 'Initialize Intlayer in the project',\n inputSchema: {\n projectRoot: z.string().describe('Project root directory'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async ({ projectRoot }) => {\n try {\n await init(projectRoot);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Initialization successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Initialization failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-build',\n {\n title: 'Build Dictionaries',\n description:\n 'Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.',\n inputSchema: {\n watch: z.boolean().optional().describe('Watch for changes'),\n baseDir: z.string().optional().describe('Base directory'),\n env: z.string().optional().describe('Environment'),\n envFile: z.string().optional().describe('Environment file'),\n verbose: z.boolean().optional().describe('Verbose output'),\n prefix: z.string().optional().describe('Log prefix'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async ({ watch, baseDir, env, envFile, verbose, prefix }) => {\n try {\n const log: Partial<LogConfig> = {};\n if (verbose) {\n log.mode = 'verbose';\n }\n if (prefix) {\n log.prefix = prefix;\n }\n\n await build({\n watch,\n configOptions: {\n baseDir,\n env,\n envFile,\n override: {\n log,\n },\n },\n });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Build successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Build failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-fill',\n {\n title: 'Fill Translations',\n description:\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n inputSchema: {\n sourceLocale: z\n .nativeEnum(Locales.ALL_LOCALES)\n .optional()\n .describe('Source locale'),\n outputLocales: z\n .union([\n z.nativeEnum(Locales.ALL_LOCALES),\n z.array(z.nativeEnum(Locales.ALL_LOCALES)),\n ])\n .optional()\n .describe('Output locales'),\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('File path'),\n mode: z.enum(['complete', 'review']).optional().describe('Fill mode'),\n keys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to include'),\n excludedKeys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to exclude'),\n pathFilter: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Path filter'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n aiOptions: z\n .object({\n provider: z.string().optional(),\n temperature: z.number().optional(),\n model: z.string().optional(),\n apiKey: z.string().optional(),\n customPrompt: z.string().optional(),\n applicationContext: z.string().optional(),\n })\n .optional()\n .describe('AI options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const fillOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n fillOptions.gitOptions = { ...restGit, mode };\n }\n\n await fill(fillOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Fill successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Fill failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-push',\n {\n title: 'Push Dictionaries',\n description: 'Push local dictionaries to the server',\n inputSchema: {\n deleteLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Delete local dictionary after push'),\n keepLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Keep local dictionary after push'),\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to push'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const pushOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n pushOptions.gitOptions = { ...restGit, mode };\n }\n\n await push(pushOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Push successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Push failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-pull',\n {\n title: 'Pull Dictionaries',\n description: 'Pull dictionaries from the CMS',\n inputSchema: {\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to pull'),\n newDictionariesPath: z\n .string()\n .optional()\n .describe('Path to save new dictionaries'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await pull(props);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Pull successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Pull failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-list',\n {\n title: 'List Content Declarations',\n description:\n 'List the content declaration (.content.{ts,tsx,js,json,...}) files present in the project. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const rows = listContentDeclarationRows(props);\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(rows, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-test',\n {\n title: 'Test Translations',\n description:\n 'Test if there are missing translations in the content declaration files. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const missingTranslations = listMissingTranslations(\n props?.configOptions\n );\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(missingTranslations, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content test failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-transform',\n {\n title: 'Transform Component',\n description:\n 'Transform an existing component to use Intlayer. Trigger this action to transform an existing component to be multilingual. If the component does not exist, create a normal React component including text in JSX, and then trigger this tool to transform it.',\n inputSchema: {\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('List of files to transform'),\n outputContentDeclarations: z\n .string()\n .optional()\n .describe('Path to output content declaration files'),\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await transform({\n files: Array.isArray(props.file)\n ? props.file\n : props.file\n ? [props.file]\n : undefined,\n outputContentDeclarations: props.outputContentDeclarations,\n configOptions: props.configOptions,\n });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Transform successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Transform failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n};\n"],"mappings":";;;;;AAgBA,MAAaA,eAA6B,OAAO,W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intlayer/mcp",
3
- "version": "7.5.8",
3
+ "version": "7.5.9",
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": [
@@ -96,17 +96,17 @@
96
96
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
97
97
  },
98
98
  "dependencies": {
99
- "@intlayer/cli": "7.5.8",
100
- "@intlayer/config": "7.5.8",
101
- "@intlayer/docs": "7.5.8",
102
- "@intlayer/types": "7.5.8",
99
+ "@intlayer/cli": "7.5.9",
100
+ "@intlayer/config": "7.5.9",
101
+ "@intlayer/docs": "7.5.9",
102
+ "@intlayer/types": "7.5.9",
103
103
  "@modelcontextprotocol/sdk": "1.25.1",
104
104
  "dotenv": "16.6.1",
105
105
  "express": "5.2.1",
106
106
  "zod": "3.25.76"
107
107
  },
108
108
  "devDependencies": {
109
- "@intlayer/types": "7.5.8",
109
+ "@intlayer/types": "7.5.9",
110
110
  "@modelcontextprotocol/inspector": "0.18.0",
111
111
  "@types/express": "5.0.6",
112
112
  "@types/node": "25.0.3",