@intlayer/mcp 5.8.1 → 6.0.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/tools/cli.cjs
CHANGED
|
@@ -100,7 +100,7 @@ const loadCLITools = async (server) => {
|
|
|
100
100
|
);
|
|
101
101
|
server.tool(
|
|
102
102
|
"intlayer-push",
|
|
103
|
-
"Push
|
|
103
|
+
"Push local dictionaries to the server",
|
|
104
104
|
{
|
|
105
105
|
deleteLocaleDictionary: import_zod.default.boolean().optional().describe("Delete local dictionary after push"),
|
|
106
106
|
keepLocaleDictionary: import_zod.default.boolean().optional().describe("Keep local dictionary after push"),
|
|
@@ -180,6 +180,86 @@ const loadCLITools = async (server) => {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
);
|
|
183
|
+
server.tool(
|
|
184
|
+
"intlayer-content-list",
|
|
185
|
+
"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.",
|
|
186
|
+
{
|
|
187
|
+
configOptions: import_zod.default.object({
|
|
188
|
+
baseDir: import_zod.default.string().optional(),
|
|
189
|
+
env: import_zod.default.string().optional(),
|
|
190
|
+
envFile: import_zod.default.string().optional(),
|
|
191
|
+
override: import_zod.default.object({
|
|
192
|
+
log: import_zod.default.object({
|
|
193
|
+
prefix: import_zod.default.string().optional(),
|
|
194
|
+
verbose: import_zod.default.boolean().optional()
|
|
195
|
+
}).optional()
|
|
196
|
+
}).optional()
|
|
197
|
+
}).optional().describe("Configuration options")
|
|
198
|
+
},
|
|
199
|
+
async (props) => {
|
|
200
|
+
try {
|
|
201
|
+
const rows = (0, import_cli.listContentDeclarationRows)(props);
|
|
202
|
+
return {
|
|
203
|
+
content: [
|
|
204
|
+
{
|
|
205
|
+
type: "text",
|
|
206
|
+
text: JSON.stringify(rows, null, 2)
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
};
|
|
210
|
+
} catch (error) {
|
|
211
|
+
const errorMessage = error instanceof Error ? error.message : "An unknown error occurred";
|
|
212
|
+
return {
|
|
213
|
+
content: [
|
|
214
|
+
{
|
|
215
|
+
type: "text",
|
|
216
|
+
text: `Content list failed: ${errorMessage}`
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
server.tool(
|
|
224
|
+
"intlayer-content-test",
|
|
225
|
+
"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.",
|
|
226
|
+
{
|
|
227
|
+
configOptions: import_zod.default.object({
|
|
228
|
+
baseDir: import_zod.default.string().optional(),
|
|
229
|
+
env: import_zod.default.string().optional(),
|
|
230
|
+
envFile: import_zod.default.string().optional(),
|
|
231
|
+
override: import_zod.default.object({
|
|
232
|
+
log: import_zod.default.object({
|
|
233
|
+
prefix: import_zod.default.string().optional(),
|
|
234
|
+
verbose: import_zod.default.boolean().optional()
|
|
235
|
+
}).optional()
|
|
236
|
+
}).optional()
|
|
237
|
+
}).optional().describe("Configuration options")
|
|
238
|
+
},
|
|
239
|
+
async (props) => {
|
|
240
|
+
try {
|
|
241
|
+
const missingTranslations = (0, import_cli.listMissingTranslations)(props);
|
|
242
|
+
return {
|
|
243
|
+
content: [
|
|
244
|
+
{
|
|
245
|
+
type: "text",
|
|
246
|
+
text: JSON.stringify(missingTranslations, null, 2)
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
};
|
|
250
|
+
} catch (error) {
|
|
251
|
+
const errorMessage = error instanceof Error ? error.message : "An unknown error occurred";
|
|
252
|
+
return {
|
|
253
|
+
content: [
|
|
254
|
+
{
|
|
255
|
+
type: "text",
|
|
256
|
+
text: `Content test failed: ${errorMessage}`
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
);
|
|
183
263
|
};
|
|
184
264
|
// Annotate the CommonJS export names for ESM import in node:
|
|
185
265
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import { fill, pull, push } from '@intlayer/cli';\nimport { Locales } from '@intlayer/config';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\n\nexport const loadCLITools = async (server: McpServer) => {\n server.tool(\n 'intlayer-fill',\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n {\n sourceLocale: z.nativeEnum(Locales).optional().describe('Source locale'),\n outputLocales: z\n .union([z.nativeEnum(Locales), z.array(z.nativeEnum(Locales))])\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 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.tool(\n 'intlayer-push',\n 'Push locale dictionaries to the server',\n {\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 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.tool(\n 'intlayer-pull',\n 'Pull dictionaries from the CMS',\n {\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 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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAiC;AACjC,oBAAwB;AAExB,iBAAc;AAEP,MAAM,eAAe,OAAO,WAAsB;AACvD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,MACE,cAAc,WAAAA,QAAE,WAAW,qBAAO,EAAE,SAAS,EAAE,SAAS,eAAe;AAAA,MACvE,eAAe,WAAAA,QACZ,MAAM,CAAC,WAAAA,QAAE,WAAW,qBAAO,GAAG,WAAAA,QAAE,MAAM,WAAAA,QAAE,WAAW,qBAAO,CAAC,CAAC,CAAC,EAC7D,SAAS,EACT,SAAS,gBAAgB;AAAA,MAC5B,MAAM,WAAAA,QACH,MAAM,CAAC,WAAAA,QAAE,OAAO,GAAG,WAAAA,QAAE,MAAM,WAAAA,QAAE,OAAO,CAAC,CAAC,CAAC,EACvC,SAAS,EACT,SAAS,WAAW;AAAA,MACvB,MAAM,WAAAA,QAAE,KAAK,CAAC,YAAY,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,WAAW;AAAA,MACpE,MAAM,WAAAA,QACH,MAAM,CAAC,WAAAA,QAAE,OAAO,GAAG,WAAAA,QAAE,MAAM,WAAAA,QAAE,OAAO,CAAC,CAAC,CAAC,EACvC,SAAS,EACT,SAAS,iBAAiB;AAAA,MAC7B,cAAc,WAAAA,QACX,MAAM,CAAC,WAAAA,QAAE,OAAO,GAAG,WAAAA,QAAE,MAAM,WAAAA,QAAE,OAAO,CAAC,CAAC,CAAC,EACvC,SAAS,EACT,SAAS,iBAAiB;AAAA,MAC7B,YAAY,WA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M,gBAAgB,YAAY;AAAA,YACpC;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["z"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import {\n fill,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n} from '@intlayer/cli';\nimport { Locales } from '@intlayer/config';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\n\nexport const loadCLITools = async (server: McpServer) => {\n server.tool(\n 'intlayer-fill',\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n {\n sourceLocale: z.nativeEnum(Locales).optional().describe('Source locale'),\n outputLocales: z\n .union([z.nativeEnum(Locales), z.array(z.nativeEnum(Locales))])\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 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.tool(\n 'intlayer-push',\n 'Push local dictionaries to the server',\n {\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 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.tool(\n 'intlayer-pull',\n 'Pull dictionaries from the CMS',\n {\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 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.tool(\n 'intlayer-content-list',\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 {\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 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.tool(\n 'intlayer-content-test',\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 {\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 async (props) => {\n try {\n const missingTranslations = listMissingTranslations(props);\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: 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AS,WAAAA,QAAE,QAAQ,EAAE,SAAS;AAAA,UAChC,CAAC,EACA,SAAS;AAAA,QACd,CAAC,EACA,SAAS;AAAA,MACd,CAAC,EACA,SAAS,EACT,SAAS,uBAAuB;AAAA,IACrC;AAAA,IACA,OAAO,UAAU;AACf,UAAI;AACF,cAAM,0BAAsB,oCAAwB,KAAK;AACzD,eAAO;AAAA,UACL,SAAS;AAAA,YACP;AAAA,cACE,MAAM;AAAA,cACN,MAAM,KAAK,UAAU,qBAAqB,MAAM,CAAC;AAAA,YACnD;AAAA,UACF;AAAA,QACF;AAAA,MACF,SAAS,OAAO;AACd,cAAM,eACJ,iBAAiB,QAAQ,MAAM,UAAU;AAC3C,eAAO;AAAA,UACL,SAAS;AAAA,YACP;AAAA,cACE,MAAM;AAAA,cACN,MAAM,wBAAwB,YAAY;AAAA,YAC5C;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["z"]}
|
package/dist/esm/tools/cli.mjs
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
fill,
|
|
3
|
+
listContentDeclarationRows,
|
|
4
|
+
listMissingTranslations,
|
|
5
|
+
pull,
|
|
6
|
+
push
|
|
7
|
+
} from "@intlayer/cli";
|
|
2
8
|
import { Locales } from "@intlayer/config";
|
|
3
9
|
import z from "zod";
|
|
4
10
|
const loadCLITools = async (server) => {
|
|
@@ -67,7 +73,7 @@ const loadCLITools = async (server) => {
|
|
|
67
73
|
);
|
|
68
74
|
server.tool(
|
|
69
75
|
"intlayer-push",
|
|
70
|
-
"Push
|
|
76
|
+
"Push local dictionaries to the server",
|
|
71
77
|
{
|
|
72
78
|
deleteLocaleDictionary: z.boolean().optional().describe("Delete local dictionary after push"),
|
|
73
79
|
keepLocaleDictionary: z.boolean().optional().describe("Keep local dictionary after push"),
|
|
@@ -147,6 +153,86 @@ const loadCLITools = async (server) => {
|
|
|
147
153
|
}
|
|
148
154
|
}
|
|
149
155
|
);
|
|
156
|
+
server.tool(
|
|
157
|
+
"intlayer-content-list",
|
|
158
|
+
"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.",
|
|
159
|
+
{
|
|
160
|
+
configOptions: z.object({
|
|
161
|
+
baseDir: z.string().optional(),
|
|
162
|
+
env: z.string().optional(),
|
|
163
|
+
envFile: z.string().optional(),
|
|
164
|
+
override: z.object({
|
|
165
|
+
log: z.object({
|
|
166
|
+
prefix: z.string().optional(),
|
|
167
|
+
verbose: z.boolean().optional()
|
|
168
|
+
}).optional()
|
|
169
|
+
}).optional()
|
|
170
|
+
}).optional().describe("Configuration options")
|
|
171
|
+
},
|
|
172
|
+
async (props) => {
|
|
173
|
+
try {
|
|
174
|
+
const rows = listContentDeclarationRows(props);
|
|
175
|
+
return {
|
|
176
|
+
content: [
|
|
177
|
+
{
|
|
178
|
+
type: "text",
|
|
179
|
+
text: JSON.stringify(rows, null, 2)
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
} catch (error) {
|
|
184
|
+
const errorMessage = error instanceof Error ? error.message : "An unknown error occurred";
|
|
185
|
+
return {
|
|
186
|
+
content: [
|
|
187
|
+
{
|
|
188
|
+
type: "text",
|
|
189
|
+
text: `Content list failed: ${errorMessage}`
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
server.tool(
|
|
197
|
+
"intlayer-content-test",
|
|
198
|
+
"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.",
|
|
199
|
+
{
|
|
200
|
+
configOptions: z.object({
|
|
201
|
+
baseDir: z.string().optional(),
|
|
202
|
+
env: z.string().optional(),
|
|
203
|
+
envFile: z.string().optional(),
|
|
204
|
+
override: z.object({
|
|
205
|
+
log: z.object({
|
|
206
|
+
prefix: z.string().optional(),
|
|
207
|
+
verbose: z.boolean().optional()
|
|
208
|
+
}).optional()
|
|
209
|
+
}).optional()
|
|
210
|
+
}).optional().describe("Configuration options")
|
|
211
|
+
},
|
|
212
|
+
async (props) => {
|
|
213
|
+
try {
|
|
214
|
+
const missingTranslations = listMissingTranslations(props);
|
|
215
|
+
return {
|
|
216
|
+
content: [
|
|
217
|
+
{
|
|
218
|
+
type: "text",
|
|
219
|
+
text: JSON.stringify(missingTranslations, null, 2)
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
};
|
|
223
|
+
} catch (error) {
|
|
224
|
+
const errorMessage = error instanceof Error ? error.message : "An unknown error occurred";
|
|
225
|
+
return {
|
|
226
|
+
content: [
|
|
227
|
+
{
|
|
228
|
+
type: "text",
|
|
229
|
+
text: `Content test failed: ${errorMessage}`
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
);
|
|
150
236
|
};
|
|
151
237
|
export {
|
|
152
238
|
loadCLITools
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import { fill, pull, push } from '@intlayer/cli';\nimport { Locales } from '@intlayer/config';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\n\nexport const loadCLITools = async (server: McpServer) => {\n server.tool(\n 'intlayer-fill',\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n {\n sourceLocale: z.nativeEnum(Locales).optional().describe('Source locale'),\n outputLocales: z\n .union([z.nativeEnum(Locales), z.array(z.nativeEnum(Locales))])\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 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.tool(\n 'intlayer-push',\n 'Push locale dictionaries to the server',\n {\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 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.tool(\n 'intlayer-pull',\n 'Pull dictionaries from the CMS',\n {\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 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"],"mappings":"AAAA,SAAS,MAAM,MAAM,YAAY;AACjC,SAAS,eAAe;AAExB,OAAO,OAAO;AAEP,MAAM,eAAe,OAAO,WAAsB;AACvD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,MACE,cAAc,EAAE,WAAW,OAAO,EAAE,SAAS,EAAE,SAAS,eAAe;AAAA,MACvE,eAAe,EACZ,MAAM,CAAC,EAAE,WAAW,OAAO,GAAG,EAAE,MAAM,EAAE,WAAW,OAAO,CAAC,CAAC,CAAC,EAC7D,SAAS,EACT,SAAS,gBAAgB;AAAA,MAC5B,MAAM,EACH,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,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ACN,MAAM;AAAA,YACR;AAAA,UACF;AAAA,QACF;AAAA,MACF,SAAS,OAAO;AACd,cAAM,eACJ,iBAAiB,QAAQ,MAAM,UAAU;AAC3C,eAAO;AAAA,UACL,SAAS;AAAA,YACP;AAAA,cACE,MAAM;AAAA,cACN,MAAM,gBAAgB,YAAY;AAAA,YACpC;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import {\n fill,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n} from '@intlayer/cli';\nimport { Locales } from '@intlayer/config';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\n\nexport const loadCLITools = async (server: McpServer) => {\n server.tool(\n 'intlayer-fill',\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n {\n sourceLocale: z.nativeEnum(Locales).optional().describe('Source locale'),\n outputLocales: z\n .union([z.nativeEnum(Locales), z.array(z.nativeEnum(Locales))])\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 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.tool(\n 'intlayer-push',\n 'Push local dictionaries to the server',\n {\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 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.tool(\n 'intlayer-pull',\n 'Pull dictionaries from the CMS',\n {\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 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.tool(\n 'intlayer-content-list',\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 {\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 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.tool(\n 'intlayer-content-test',\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 {\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 async (props) => {\n try {\n const missingTranslations = listMissingTranslations(props);\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"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AAExB,OAAO,OAAO;AAEP,MAAM,eAAe,OAAO,WAAsB;AACvD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,MACE,cAAc,EAAE,WAAW,OAAO,EAAE,SAAS,EAAE,SAAS,eAAe;AAAA,MACvE,eAAe,EACZ,MAAM,CAAC,EAAE,WAAW,OAAO,GAAG,EAAE,MAAM,EAAE,WAAW,OAAO,CAAC,CAAC,CAAC,EAC7D,SAAS,EACT,SAAS,gBAAgB;AAAA,MAC5B,MAAM,EACH,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EACvC,SAAS,EACT,SAAS,WAAW;AAAA,MACvB,MAAM,EAAE,KAAK,CAAC,YAAY,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,WAAW;AAAA,MACpE,MAAM,EACH,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EACvC,SAAS,EACT,SAAS,iBAAiB;AAAA,MAC7B,cAAc,EACX,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EACvC,SAAS,EACT,SAAS,iBAAiB;AAAA,MAC7B,YAAY,EACT,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EACvC,SAAS,EACT,SAAS,aAAa;AAAA,MAC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qBAAqB,MAAM,CAAC;AAAA,YACnD;AAAA,UACF;AAAA,QACF;AAAA,MACF,SAAS,OAAO;AACd,cAAM,eACJ,iBAAiB,QAAQ,MAAM,UAAU;AAC3C,eAAO;AAAA,UACL,SAAS;AAAA,YACP;AAAA,cACE,MAAM;AAAA,cACN,MAAM,wBAAwB,YAAY;AAAA,YAC5C;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/tools/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/tools/cli.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,eAAO,MAAM,YAAY,GAAU,QAAQ,SAAS,kBA2SnD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-canary.1",
|
|
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": [
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"dotenv": "^16.6.1",
|
|
66
66
|
"express": "^5.1.0",
|
|
67
67
|
"zod": "^3.25.56",
|
|
68
|
-
"@intlayer/config": "
|
|
69
|
-
"@intlayer/
|
|
70
|
-
"@intlayer/
|
|
68
|
+
"@intlayer/config": "6.0.0-canary.1",
|
|
69
|
+
"@intlayer/cli": "6.0.0-canary.1",
|
|
70
|
+
"@intlayer/docs": "6.0.0-canary.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@modelcontextprotocol/inspector": "^0.16.0",
|
|
@@ -75,22 +75,22 @@
|
|
|
75
75
|
"@types/node": "^24.2.1",
|
|
76
76
|
"@typescript-eslint/parser": "^8.33.1",
|
|
77
77
|
"concurrently": "^9.1.2",
|
|
78
|
-
"eslint": "^9.
|
|
79
|
-
"prettier": "^3.
|
|
78
|
+
"eslint": "^9.34.0",
|
|
79
|
+
"prettier": "^3.6.2",
|
|
80
80
|
"rimraf": "^6.0.1",
|
|
81
81
|
"tsc-alias": "^1.8.16",
|
|
82
82
|
"tsup": "^8.5.0",
|
|
83
83
|
"typescript": "^5.9.2",
|
|
84
|
-
"vitest": "^3.2.
|
|
84
|
+
"vitest": "^3.2.4",
|
|
85
85
|
"@utils/eslint-config": "1.0.4",
|
|
86
|
-
"@utils/tsup-config": "1.0.4",
|
|
87
86
|
"@utils/ts-config": "1.0.4",
|
|
88
|
-
"@utils/ts-config-types": "1.0.4"
|
|
87
|
+
"@utils/ts-config-types": "1.0.4",
|
|
88
|
+
"@utils/tsup-config": "1.0.4"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
|
-
"@intlayer/
|
|
92
|
-
"@intlayer/docs": "
|
|
93
|
-
"@intlayer/
|
|
91
|
+
"@intlayer/cli": "6.0.0-canary.1",
|
|
92
|
+
"@intlayer/docs": "6.0.0-canary.1",
|
|
93
|
+
"@intlayer/config": "6.0.0-canary.1"
|
|
94
94
|
},
|
|
95
95
|
"engines": {
|
|
96
96
|
"node": ">=14.18"
|