@intlayer/mcp 8.1.6 → 8.1.8

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/README.md CHANGED
@@ -46,25 +46,26 @@ With **per-locale content files**, **TypeScript autocompletion**, **tree-shakabl
46
46
 
47
47
  ## Keys benefits of Intlayer:
48
48
 
49
- | Feature | Description |
50
- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
51
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.png?raw=true" alt="Feature" width="700"> | **Cross-Frameworks Support**<br><br>Intlayer is compatible with all major frameworks and libraries, including Next.js, React, Vite, Vue.js, Nuxt, Preact, Express, and more. |
52
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.jpg?raw=true" alt="Feature" width="700"> | **JavaScript-Powered Content Management**<br><br>Harness the flexibility of JavaScript to define and manage your content efficiently. <br><br> - [Content declaration](https://intlayer.org/doc/concept/content) |
53
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/per_locale_content_declaration_file.png?raw=true" alt="Feature" width="700"> | **Per-Locale Content Declaration File**<br><br>Speed up your development by declaring your content once, before auto generation.<br><br> - [Per-Locale Content Declaration File](https://intlayer.org/doc/concept/per-locale-file) |
54
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true" alt="Feature" width="700"> | **Type-Safe Environment**<br><br>Leverage TypeScript to ensure your content definitions and code are error-free, while also benefiting from IDE autocompletion.<br><br> - [TypeScript configuration](https://intlayer.org/doc/environment/vite-and-react#configure-typescript) |
55
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/config_file.png?raw=true" alt="Feature" width="700"> | **Simplified Setup**<br><br>Get up and running quickly with minimal configuration. Adjust settings for internationalization, routing, AI, build, and content handling with ease. <br><br> - [Explore Next.js integration](https://intlayer.org/doc/environment/nextjs) |
56
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/content_retrieval.png?raw=true" alt="Feature" width="700"> | **Simplified Content Retrieval**<br><br>No need to call your `t` function for each piece of content. Retrieve all your content directly using a single hook.<br><br> - [React integration](https://intlayer.org/doc/environment/create-react-app) |
57
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/server_component.png?raw=true" alt="Feature" width="700"> | **Consistent Server Component Implementation**<br><br>Perfectly suited for Next.js server components, use the same implementation for both client and server components, no need to pass your `t` function across each server component. <br><br> - [Server Components](https://intlayer.org/doc/environment/nextjs#step-7-utilize-content-in-your-code) |
58
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/file_tree.png?raw=true" alt="Feature" width="700"> | **Organized Codebase**<br><br>Keep your codebase more organized: 1 component = 1 dictionary in the same folder. Translations close to their respective components, enhance maintainability and clarity. <br><br> - [How Intlayer works](https://intlayer.org/doc/concept/how-works-intlayer) |
59
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/url_routing.png?raw=true" alt="Feature" width="700"> | **Enhanced Routing**<br><br>Full support of app routing, adapting seamlessly to complex application structures, for Next.js, React, Vite, Vue.js, etc.<br><br> - [Explore Next.js integration](https://intlayer.org/doc/environment/nextjs) |
60
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/markdown.png?raw=true" alt="Feature" width="700"> | **Markdown Support**<br><br>Import and interpret, locale files and remote Markdown for multilingual content like privacy policies, documentation, etc. Interpret and make Markdown metadata accessible in your code.<br><br> - [Content files](https://intlayer.org/doc/concept/content/file) |
61
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/visual_editor.png?raw=true" alt="Feature" width="700"> | **Free Visual Editor & CMS**<br><br>A free visual editor and CMS are available for content writers, removing the need for a localization platform. Keep your content synchronized using Git, or externalize it totally or partially with the CMS.<br><br> - [Intlayer Editor](https://intlayer.org/doc/concept/editor) <br> - [Intlayer CMS](https://intlayer.org/doc/concept/cms) |
62
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/bundle.png?raw=true" alt="Feature" width="700"> | **Tree-shakable Content**<br><br>Tree-shakable content, reducing the size of the final bundle. Loads content per component, excluding any unused content from your bundle. Supports lazy loading to enhance app loading efficiency. <br><br> - [App build optimization](https://intlayer.org/doc/concept/how-works-intlayer#app-build-optimization) |
63
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/static_rendering.png?raw=true" alt="Feature" width="700"> | **Static Rendering**<br><br>Doesn't block Static Rendering. <br><br> - [Next.js integration](https://intlayer.org/doc/environment/nextjs) |
64
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/AI_translation.png?raw=true" alt="Feature" width="700"> | **AI-Powered Translation**<br><br>Transform your website into 231 languages with just one click using Intlayer's advanced AI-powered translation tools using your own AI provider / API key. <br><br> - [CI/CD integration](https://intlayer.org/doc/concept/ci-cd) <br> - [Intlayer CLI](https://intlayer.org/doc/concept/cli) <br> - [Auto fill](https://intlayer.org/doc/concept/auto-fill) |
65
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/mcp.png?raw=true" alt="Feature" width="700"> | **MCP Server Integration**<br><br>Provides an MCP (Model Context Protocol) server for IDE automation, enabling seamless content management and i18n workflows directly within your development environment. <br><br> - [MCP Server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md) |
66
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.png?raw=true" alt="Feature" width="700"> | **VSCode Extension**<br><br>Intlayer provides a VSCode extension to help you manage your content and translations, building your dictionaries, translating your content, and more. <br><br> - [VSCode Extension](https://intlayer.org/doc/vs-code-extension) |
67
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true" alt="Feature" width="700"> | **Interoperability**<br><br>Allow interoperability with react-i18next, next-i18next, next-intl, and react-intl. <br><br> - [Intlayer and react-intl](https://intlayer.org/blog/intlayer-with-react-intl) <br> - [Intlayer and next-intl](https://intlayer.org/blog/intlayer-with-next-intl) <br> - [Intlayer and next-i18next](https://intlayer.org/blog/intlayer-with-next-i18next) |
49
+ | Feature | Description |
50
+ | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
51
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.png?raw=true" alt="Feature" width="700"> | **Cross-Frameworks Support**<br><br>Intlayer is compatible with all major frameworks and libraries, including Next.js, React, Vite, Vue.js, Nuxt, Preact, Express, and more. |
52
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.jpg?raw=true" alt="Feature" width="700"> | **JavaScript-Powered Content Management**<br><br>Harness the flexibility of JavaScript to define and manage your content efficiently. <br><br> - [Content declaration](https://intlayer.org/doc/concept/content) |
53
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/per_locale_content_declaration_file.png?raw=true" alt="Feature" width="700"> | **Per-Locale Content Declaration File**<br><br>Speed up your development by declaring your content once, before auto generation.<br><br> - [Per-Locale Content Declaration File](https://intlayer.org/doc/concept/per-locale-file) |
54
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/compiler.jpg?raw=true" alt="Feature" width="700"> | **Compiler**<br><br>The Intlayer Compiler extract automatically the content from the components and generate the dictionary files.<br><br> - [Compiler](https://intlayer.org/doc/compiler) |
55
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true" alt="Feature" width="700"> | **Type-Safe Environment**<br><br>Leverage TypeScript to ensure your content definitions and code are error-free, while also benefiting from IDE autocompletion.<br><br> - [TypeScript configuration](https://intlayer.org/doc/environment/vite-and-react#configure-typescript) |
56
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/config_file.png?raw=true" alt="Feature" width="700"> | **Simplified Setup**<br><br>Get up and running quickly with minimal configuration. Adjust settings for internationalization, routing, AI, build, and content handling with ease. <br><br> - [Explore Next.js integration](https://intlayer.org/doc/environment/nextjs) |
57
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/content_retrieval.png?raw=true" alt="Feature" width="700"> | **Simplified Content Retrieval**<br><br>No need to call your `t` function for each piece of content. Retrieve all your content directly using a single hook.<br><br> - [React integration](https://intlayer.org/doc/environment/create-react-app) |
58
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/server_component.png?raw=true" alt="Feature" width="700"> | **Consistent Server Component Implementation**<br><br>Perfectly suited for Next.js server components, use the same implementation for both client and server components, no need to pass your `t` function across each server component. <br><br> - [Server Components](https://intlayer.org/doc/environment/nextjs#step-7-utilize-content-in-your-code) |
59
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/file_tree.png?raw=true" alt="Feature" width="700"> | **Organized Codebase**<br><br>Keep your codebase more organized: 1 component = 1 dictionary in the same folder. Translations close to their respective components, enhance maintainability and clarity. <br><br> - [How Intlayer works](https://intlayer.org/doc/concept/how-works-intlayer) |
60
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/url_routing.png?raw=true" alt="Feature" width="700"> | **Enhanced Routing**<br><br>Full support of app routing, adapting seamlessly to complex application structures, for Next.js, React, Vite, Vue.js, etc.<br><br> - [Explore Next.js integration](https://intlayer.org/doc/environment/nextjs) |
61
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/markdown.png?raw=true" alt="Feature" width="700"> | **Markdown Support**<br><br>Import and interpret, locale files and remote Markdown for multilingual content like privacy policies, documentation, etc. Interpret and make Markdown metadata accessible in your code.<br><br> - [Content files](https://intlayer.org/doc/concept/content/file) |
62
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/visual_editor.png?raw=true" alt="Feature" width="700"> | **Free Visual Editor & CMS**<br><br>A free visual editor and CMS are available for content writers, removing the need for a localization platform. Keep your content synchronized using Git, or externalize it totally or partially with the CMS.<br><br> - [Intlayer Editor](https://intlayer.org/doc/concept/editor) <br> - [Intlayer CMS](https://intlayer.org/doc/concept/cms) |
63
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/bundle.png?raw=true" alt="Feature" width="700"> | **Tree-shakable Content**<br><br>Tree-shakable content, reducing the size of the final bundle. Loads content per component, excluding any unused content from your bundle. Supports lazy loading to enhance app loading efficiency. <br><br> - [App build optimization](https://intlayer.org/doc/concept/how-works-intlayer#app-build-optimization) |
64
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/static_rendering.png?raw=true" alt="Feature" width="700"> | **Static Rendering**<br><br>Doesn't block Static Rendering. <br><br> - [Next.js integration](https://intlayer.org/doc/environment/nextjs) |
65
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/AI_translation.png?raw=true" alt="Feature" width="700"> | **AI-Powered Translation**<br><br>Transform your website into 231 languages with just one click using Intlayer's advanced AI-powered translation tools using your own AI provider / API key. <br><br> - [CI/CD integration](https://intlayer.org/doc/concept/ci-cd) <br> - [Intlayer CLI](https://intlayer.org/doc/concept/cli) <br> - [Auto fill](https://intlayer.org/doc/concept/auto-fill) |
66
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/mcp.png?raw=true" alt="Feature" width="700"> | **MCP Server Integration**<br><br>Provides an MCP (Model Context Protocol) server for IDE automation, enabling seamless content management and i18n workflows directly within your development environment. <br><br> - [MCP Server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md) |
67
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.png?raw=true" alt="Feature" width="700"> | **VSCode Extension**<br><br>Intlayer provides a VSCode extension to help you manage your content and translations, building your dictionaries, translating your content, and more. <br><br> - [VSCode Extension](https://intlayer.org/doc/vs-code-extension) |
68
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true" alt="Feature" width="700"> | **Interoperability**<br><br>Allow interoperability with react-i18next, next-i18next, next-intl, react-intl, vue-i18n. <br><br> - [Intlayer and react-intl](https://intlayer.org/blog/intlayer-with-react-intl) <br> - [Intlayer and next-intl](https://intlayer.org/blog/intlayer-with-next-intl) <br> - [Intlayer and next-i18next](https://intlayer.org/blog/intlayer-with-next-i18next) <br> - [Intlayer and vue-i18n](https://intlayer.org/blog/intlayer-with-vue-i18n) |
68
69
 
69
70
  ---
70
71
 
@@ -153,6 +154,8 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
153
154
  <li><a href="https://intlayer.org/doc/concept/how-works-intlayer" rel=''>How Intlayer Works</a></li>
154
155
  <li><a href="https://intlayer.org/doc/concept/configuration" rel=''>Configuration</a></li>
155
156
  <li><a href="https://intlayer.org/doc/concept/cli" rel=''>Intlayer CLI</a></li>
157
+ <li><a href="https://intlayer.org/doc/compiler" rel=''>Compiler</a></li>
158
+
156
159
  <li><a href="https://intlayer.org/doc/concept/editor" rel=''>Intlayer Editor</a></li>
157
160
  <li><a href="https://intlayer.org/doc/concept/cms" rel=''>Intlayer CMS</a></li>
158
161
  <li><a href="https://intlayer.org/doc/concept/content" rel=''>Dictionary</a>
@@ -179,17 +182,15 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
179
182
  <li><a href="https://intlayer.org/doc/environment/nextjs/15" rel=''>Next.js 15</a></li>
180
183
  <li><a href="https://intlayer.org/doc/environment/nextjs/14" rel=''>Next.js 14 (App Router)</a></li>
181
184
  <li><a href="https://intlayer.org/doc/environment/nextjs/next-with-Page-Router" rel=''>Next.js Page Router</a></li>
185
+ <li><a href="https://intlayer.org/doc/environment/nextjs/compiler" rel=''>Next.js using Compiler</a></li>
182
186
  </ul>
183
187
  </li>
184
188
  <li><a href="https://intlayer.org/doc/environment/create-react-app" rel=''>React CRA</a></li>
185
- <li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React</a>
186
- <ul>
187
- <li><a href="https://intlayer.org/doc/environment/vite-and-react/react-router-v7" rel=''>React-router-v7</a></li>
188
- <li><a href="https://intlayer.org/doc/environment/vite-and-react/tanstack-start" rel=''>Tanstack start</a></li>
189
- </ul>
190
- </li>
189
+ <li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React</a></li>
190
+ <li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React using Compiler</a></li>
191
+ <li><a href="https://intlayer.org/doc/environment/vite-and-react/compiler" rel=''>React-router-v7</a></li>
192
+ <li><a href="https://intlayer.org/doc/environment/vite-and-react/tanstack-start" rel=''>Tanstack start</a></li>
191
193
  <li><a href="https://intlayer.org/doc/environment/react-native-and-expo" rel=''>React Native</a></li>
192
- <li><a href="https://intlayer.org/doc/environment/lynx-and-react" rel=''>Lynx + React</a></li>
193
194
  <li><a href="https://intlayer.org/doc/environment/vite-and-svelte" rel=''>Vite + Svelte</a></li>
194
195
  <li><a href="https://intlayer.org/doc/environment/sveltekit" rel=''>SvelteKit</a></li>
195
196
  <li><a href="https://intlayer.org/doc/environment/vite-and-preact" rel=''>Vite + Preact</a></li>
@@ -197,8 +198,16 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
197
198
  <li><a href="https://intlayer.org/doc/environment/vite-and-nuxt" rel=''>Vite + Nuxt</a></li>
198
199
  <li><a href="https://intlayer.org/doc/environment/vite-and-solid" rel=''>Vite + Solid</a></li>
199
200
  <li><a href="https://intlayer.org/doc/environment/angular" rel=''>Angular</a></li>
200
- <li><a href="https://intlayer.org/doc/environment/express" rel=''>Express</a></li>
201
- <li><a href="https://intlayer.org/doc/environment/nest" rel=''>NestJS</a></li>
201
+ <li>
202
+ <a href="https://intlayer.org/doc/environment/express" rel=''>Backend</a>
203
+ <ul>
204
+ <li><a href="https://intlayer.org/doc/environment/express" rel=''>Express</a></li>
205
+ <li><a href="https://intlayer.org/doc/environment/nest" rel=''>NestJS</a></li>
206
+ <li><a href="https://intlayer.org/doc/environment/fastify" rel=''>Fastify</a></li>
207
+ <li><a href="https://intlayer.org/doc/environment/adonisjs" rel=''>AdonisJS</a></li>
208
+ <li><a href="https://intlayer.org/doc/environment/hono" rel=''>Hono</a></li>
209
+ </ul>
210
+ </li>
202
211
  </ul>
203
212
  </details>
204
213
 
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`@intlayer/chokidar/cli`),r=require(`@intlayer/cli`),i=require(`@intlayer/types`),a=require(`zod/v3`);a=e.__toESM(a);const o=async e=>{e.registerTool(`intlayer-init`,{title:`Initialize Intlayer`,description:`Initialize Intlayer in the project`,inputSchema:{projectRoot:a.default.string().describe(`Project root directory`)},annotations:{destructiveHint:!0}},async({projectRoot:e})=>{try{return await(0,r.init)(e),{content:[{type:`text`,text:`Initialization successful.`}]}}catch(e){return{content:[{type:`text`,text:`Initialization failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-build`,{title:`Build Dictionaries`,description:"Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.",inputSchema:{watch:a.default.boolean().optional().describe(`Watch for changes`),baseDir:a.default.string().optional().describe(`Base directory`),env:a.default.string().optional().describe(`Environment`),envFile:a.default.string().optional().describe(`Environment file`),verbose:a.default.boolean().optional().describe(`Verbose output`),prefix:a.default.string().optional().describe(`Log prefix`)},annotations:{destructiveHint:!0}},async({watch:e,baseDir:t,env:n,envFile:i,verbose:a,prefix:o})=>{try{let s={};return a&&(s.mode=`verbose`),o&&(s.prefix=o),await(0,r.build)({watch:e,configOptions:{baseDir:t,env:n,envFile:i,override:{log:s}}}),{content:[{type:`text`,text:`Build successful.`}]}}catch(e){return{content:[{type:`text`,text:`Build failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-fill`,{title:`Fill Translations`,description:`Fill the dictionaries with missing translations / review translations using Intlayer servers`,inputSchema:{sourceLocale:a.default.nativeEnum(i.Locales.ALL_LOCALES).optional().describe(`Source locale`),outputLocales:a.default.union([a.default.nativeEnum(i.Locales.ALL_LOCALES),a.default.array(a.default.nativeEnum(i.Locales.ALL_LOCALES))]).optional().describe(`Output locales`),file:a.default.union([a.default.string(),a.default.array(a.default.string())]).optional().describe(`File path`),mode:a.default.enum([`complete`,`review`]).optional().describe(`Fill mode`),keys:a.default.union([a.default.string(),a.default.array(a.default.string())]).optional().describe(`Keys to include`),excludedKeys:a.default.union([a.default.string(),a.default.array(a.default.string())]).optional().describe(`Keys to exclude`),pathFilter:a.default.union([a.default.string(),a.default.array(a.default.string())]).optional().describe(`Path filter`),gitOptions:a.default.object({gitDiff:a.default.boolean().optional(),gitDiffBase:a.default.string().optional(),gitDiffCurrent:a.default.string().optional(),uncommitted:a.default.boolean().optional(),unpushed:a.default.boolean().optional(),untracked:a.default.boolean().optional()}).optional().describe(`Git options`),aiOptions:a.default.object({provider:a.default.string().optional(),temperature:a.default.number().optional(),model:a.default.string().optional(),apiKey:a.default.string().optional(),customPrompt:a.default.string().optional(),applicationContext:a.default.string().optional()}).optional().describe(`AI options`)},annotations:{destructiveHint:!0}},async e=>{try{let{gitOptions:t,...n}=e,i={...n,gitOptions:void 0};if(t){let{gitDiff:e,uncommitted:n,unpushed:r,untracked:a,...o}=t,s=[];e&&s.push(`gitDiff`),n&&s.push(`uncommitted`),r&&s.push(`unpushed`),a&&s.push(`untracked`),i.gitOptions={...o,mode:s}}return await(0,r.fill)(i),{content:[{type:`text`,text:`Fill successful.`}]}}catch(e){return{content:[{type:`text`,text:`Fill failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-push`,{title:`Push Dictionaries`,description:`Push local dictionaries to the server`,inputSchema:{deleteLocaleDictionary:a.default.boolean().optional().describe(`Delete local dictionary after push`),keepLocaleDictionary:a.default.boolean().optional().describe(`Keep local dictionary after push`),dictionaries:a.default.array(a.default.string()).optional().describe(`List of dictionaries to push`),gitOptions:a.default.object({gitDiff:a.default.boolean().optional(),gitDiffBase:a.default.string().optional(),gitDiffCurrent:a.default.string().optional(),uncommitted:a.default.boolean().optional(),unpushed:a.default.boolean().optional(),untracked:a.default.boolean().optional()}).optional().describe(`Git options`)},annotations:{destructiveHint:!0}},async e=>{try{let{gitOptions:t,...n}=e,i={...n,gitOptions:void 0};if(t){let{gitDiff:e,uncommitted:n,unpushed:r,untracked:a,...o}=t,s=[];e&&s.push(`gitDiff`),n&&s.push(`uncommitted`),r&&s.push(`unpushed`),a&&s.push(`untracked`),i.gitOptions={...o,mode:s}}return await(0,r.push)(i),{content:[{type:`text`,text:`Push successful.`}]}}catch(e){return{content:[{type:`text`,text:`Push failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-pull`,{title:`Pull Dictionaries`,description:`Pull dictionaries from the CMS`,inputSchema:{dictionaries:a.default.array(a.default.string()).optional().describe(`List of dictionaries to pull`),newDictionariesPath:a.default.string().optional().describe(`Path to save new dictionaries`)},annotations:{destructiveHint:!0}},async e=>{try{return await(0,r.pull)(e),{content:[{type:`text`,text:`Pull successful.`}]}}catch(e){return{content:[{type:`text`,text:`Pull failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-content-list`,{title:`List Content Declarations`,description:`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.`,inputSchema:{configOptions:a.default.object({baseDir:a.default.string().optional(),env:a.default.string().optional(),envFile:a.default.string().optional(),override:a.default.object({log:a.default.object({prefix:a.default.string().optional(),verbose:a.default.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`),absolute:a.default.boolean().optional().describe(`Output the results as absolute paths instead of relative paths`),json:a.default.boolean().optional().describe(`Output the results as JSON instead of formatted text`)},annotations:{readOnlyHint:!0}},async e=>{try{let t=(0,r.listContentDeclarationRows)(e);return{content:[{type:`text`,text:e.json?JSON.stringify(t):JSON.stringify(t,null,2)}]}}catch(e){return{content:[{type:`text`,text:`Content list failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-content-test`,{title:`Test Translations`,description:`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.`,inputSchema:{configOptions:a.default.object({baseDir:a.default.string().optional(),env:a.default.string().optional(),envFile:a.default.string().optional(),override:a.default.object({log:a.default.object({prefix:a.default.string().optional(),verbose:a.default.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`)},annotations:{readOnlyHint:!0}},async e=>{try{let t=(0,r.listMissingTranslations)(e?.configOptions);return{content:[{type:`text`,text:JSON.stringify(t,null,2)}]}}catch(e){return{content:[{type:`text`,text:`Content test failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-extract`,{title:`Extract strings from Component`,description:`Extract strings from an existing component to be placed in a .content file close to the component. Trigger this action to make an existing component multilingual. If the component does not exist, create a normal component including text in JSX, and then trigger this tool to extract it.`,inputSchema:{file:a.default.union([a.default.string(),a.default.array(a.default.string())]).optional().describe(`List of files to extract`),outputContentDeclarations:a.default.string().optional().describe(`Path to output content declaration files`),configOptions:a.default.object({baseDir:a.default.string().optional(),env:a.default.string().optional(),envFile:a.default.string().optional(),override:a.default.object({log:a.default.object({prefix:a.default.string().optional(),verbose:a.default.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`)},annotations:{destructiveHint:!0}},async e=>{try{return await(0,r.extract)({files:Array.isArray(e.file)?e.file:e.file?[e.file]:void 0,outputContentDeclarations:e.outputContentDeclarations,configOptions:e.configOptions}),{content:[{type:`text`,text:`Extract successful.`}]}}catch(e){return{content:[{type:`text`,text:`Extract failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-projects-list`,{title:`List Projects`,description:`List all Intlayer projects in the directory. Search for configuration files to find all Intlayer projects.`,inputSchema:{baseDir:a.default.string().optional().describe(`Base directory to search from`),gitRoot:a.default.boolean().optional().describe(`Search from the git root directory instead of the base directory`),absolute:a.default.boolean().optional().describe(`Output the results as absolute paths instead of relative paths`),json:a.default.boolean().optional().describe(`Output the results as JSON instead of formatted text`)},annotations:{readOnlyHint:!0}},async e=>{try{let{searchDir:r,projectsPath:i}=await(0,n.listProjects)({baseDir:e.baseDir,gitRoot:e.gitRoot}),a=i.map(n=>e.absolute?n:(0,t.relative)(r,n)).map(e=>e===``?`.`:e),o=e.absolute?i:a;return{content:[{type:`text`,text:e.json?JSON.stringify(o):JSON.stringify({searchDir:r,projectsPath:o},null,2)}]}}catch(e){return{content:[{type:`text`,text:`Projects list failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}})};exports.loadCLITools=o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`@intlayer/cli`),r=require(`@intlayer/types`),i=require(`zod/v3`);i=e.__toESM(i);const a=async e=>{e.registerTool(`intlayer-init`,{title:`Initialize Intlayer`,description:`Initialize Intlayer in the project`,inputSchema:{projectRoot:i.default.string().describe(`Project root directory`)},annotations:{destructiveHint:!0}},async({projectRoot:e})=>{try{return await(0,n.init)(e),{content:[{type:`text`,text:`Initialization successful.`}]}}catch(e){return{content:[{type:`text`,text:`Initialization failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-build`,{title:`Build Dictionaries`,description:"Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.",inputSchema:{watch:i.default.boolean().optional().describe(`Watch for changes`),baseDir:i.default.string().optional().describe(`Base directory`),env:i.default.string().optional().describe(`Environment`),envFile:i.default.string().optional().describe(`Environment file`),verbose:i.default.boolean().optional().describe(`Verbose output`),prefix:i.default.string().optional().describe(`Log prefix`)},annotations:{destructiveHint:!0}},async({watch:e,baseDir:t,env:r,envFile:i,verbose:a,prefix:o})=>{try{let s={};return a&&(s.mode=`verbose`),o&&(s.prefix=o),await(0,n.build)({watch:e,configOptions:{baseDir:t,env:r,envFile:i,override:{log:s}}}),{content:[{type:`text`,text:`Build successful.`}]}}catch(e){return{content:[{type:`text`,text:`Build failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-fill`,{title:`Fill Translations`,description:`Fill the dictionaries with missing translations / review translations using Intlayer servers`,inputSchema:{sourceLocale:i.default.nativeEnum(r.Locales.ALL_LOCALES).optional().describe(`Source locale`),outputLocales:i.default.union([i.default.nativeEnum(r.Locales.ALL_LOCALES),i.default.array(i.default.nativeEnum(r.Locales.ALL_LOCALES))]).optional().describe(`Output locales`),file:i.default.union([i.default.string(),i.default.array(i.default.string())]).optional().describe(`File path`),mode:i.default.enum([`complete`,`review`]).optional().describe(`Fill mode`),keys:i.default.union([i.default.string(),i.default.array(i.default.string())]).optional().describe(`Keys to include`),excludedKeys:i.default.union([i.default.string(),i.default.array(i.default.string())]).optional().describe(`Keys to exclude`),pathFilter:i.default.union([i.default.string(),i.default.array(i.default.string())]).optional().describe(`Path filter`),gitOptions:i.default.object({gitDiff:i.default.boolean().optional(),gitDiffBase:i.default.string().optional(),gitDiffCurrent:i.default.string().optional(),uncommitted:i.default.boolean().optional(),unpushed:i.default.boolean().optional(),untracked:i.default.boolean().optional()}).optional().describe(`Git options`),aiOptions:i.default.object({provider:i.default.string().optional(),temperature:i.default.number().optional(),model:i.default.string().optional(),apiKey:i.default.string().optional(),customPrompt:i.default.string().optional(),applicationContext:i.default.string().optional()}).optional().describe(`AI options`)},annotations:{destructiveHint:!0}},async e=>{try{let{gitOptions:t,...r}=e,i={...r,gitOptions:void 0};if(t){let{gitDiff:e,uncommitted:n,unpushed:r,untracked:a,...o}=t,s=[];e&&s.push(`gitDiff`),n&&s.push(`uncommitted`),r&&s.push(`unpushed`),a&&s.push(`untracked`),i.gitOptions={...o,mode:s}}return await(0,n.fill)(i),{content:[{type:`text`,text:`Fill successful.`}]}}catch(e){return{content:[{type:`text`,text:`Fill failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-push`,{title:`Push Dictionaries`,description:`Push local dictionaries to the server`,inputSchema:{deleteLocaleDictionary:i.default.boolean().optional().describe(`Delete local dictionary after push`),keepLocaleDictionary:i.default.boolean().optional().describe(`Keep local dictionary after push`),dictionaries:i.default.array(i.default.string()).optional().describe(`List of dictionaries to push`),gitOptions:i.default.object({gitDiff:i.default.boolean().optional(),gitDiffBase:i.default.string().optional(),gitDiffCurrent:i.default.string().optional(),uncommitted:i.default.boolean().optional(),unpushed:i.default.boolean().optional(),untracked:i.default.boolean().optional()}).optional().describe(`Git options`)},annotations:{destructiveHint:!0}},async e=>{try{let{gitOptions:t,...r}=e,i={...r,gitOptions:void 0};if(t){let{gitDiff:e,uncommitted:n,unpushed:r,untracked:a,...o}=t,s=[];e&&s.push(`gitDiff`),n&&s.push(`uncommitted`),r&&s.push(`unpushed`),a&&s.push(`untracked`),i.gitOptions={...o,mode:s}}return await(0,n.push)(i),{content:[{type:`text`,text:`Push successful.`}]}}catch(e){return{content:[{type:`text`,text:`Push failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-pull`,{title:`Pull Dictionaries`,description:`Pull dictionaries from the CMS`,inputSchema:{dictionaries:i.default.array(i.default.string()).optional().describe(`List of dictionaries to pull`),newDictionariesPath:i.default.string().optional().describe(`Path to save new dictionaries`)},annotations:{destructiveHint:!0}},async e=>{try{return await(0,n.pull)(e),{content:[{type:`text`,text:`Pull successful.`}]}}catch(e){return{content:[{type:`text`,text:`Pull failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-content-list`,{title:`List Content Declarations`,description:`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.`,inputSchema:{configOptions:i.default.object({baseDir:i.default.string().optional(),env:i.default.string().optional(),envFile:i.default.string().optional(),override:i.default.object({log:i.default.object({prefix:i.default.string().optional(),verbose:i.default.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`),absolute:i.default.boolean().optional().describe(`Output the results as absolute paths instead of relative paths`),json:i.default.boolean().optional().describe(`Output the results as JSON instead of formatted text`)},annotations:{readOnlyHint:!0}},async e=>{try{let t=(0,n.listContentDeclarationRows)(e);return{content:[{type:`text`,text:e.json?JSON.stringify(t):JSON.stringify(t,null,2)}]}}catch(e){return{content:[{type:`text`,text:`Content list failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-content-test`,{title:`Test Translations`,description:`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.`,inputSchema:{configOptions:i.default.object({baseDir:i.default.string().optional(),env:i.default.string().optional(),envFile:i.default.string().optional(),override:i.default.object({log:i.default.object({prefix:i.default.string().optional(),verbose:i.default.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`)},annotations:{readOnlyHint:!0}},async e=>{try{let t=(0,n.listMissingTranslations)(e?.configOptions);return{content:[{type:`text`,text:JSON.stringify(t,null,2)}]}}catch(e){return{content:[{type:`text`,text:`Content test failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-extract`,{title:`Extract strings from Component`,description:`Extract strings from an existing component to be placed in a .content file close to the component. Trigger this action to make an existing component multilingual. If the component does not exist, create a normal component including text in JSX, and then trigger this tool to extract it.`,inputSchema:{file:i.default.union([i.default.string(),i.default.array(i.default.string())]).optional().describe(`List of files to extract`),outputContentDeclarations:i.default.string().optional().describe(`Path to output content declaration files`),configOptions:i.default.object({baseDir:i.default.string().optional(),env:i.default.string().optional(),envFile:i.default.string().optional(),override:i.default.object({log:i.default.object({prefix:i.default.string().optional(),verbose:i.default.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`)},annotations:{destructiveHint:!0}},async e=>{try{return await(0,n.extract)({files:Array.isArray(e.file)?e.file:e.file?[e.file]:void 0,outputContentDeclarations:e.outputContentDeclarations,configOptions:e.configOptions}),{content:[{type:`text`,text:`Extract successful.`}]}}catch(e){return{content:[{type:`text`,text:`Extract failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),e.registerTool(`intlayer-projects-list`,{title:`List Projects`,description:`List all Intlayer projects in the directory. Search for configuration files to find all Intlayer projects.`,inputSchema:{baseDir:i.default.string().optional().describe(`Base directory to search from`),gitRoot:i.default.boolean().optional().describe(`Search from the git root directory instead of the base directory`),absolute:i.default.boolean().optional().describe(`Output the results as absolute paths instead of relative paths`),json:i.default.boolean().optional().describe(`Output the results as JSON instead of formatted text`)},annotations:{readOnlyHint:!0}},async e=>{try{let{searchDir:r,projectsPath:i}=await(0,n.listProjects)({baseDir:e.baseDir,gitRoot:e.gitRoot}),a=i.map(n=>e.absolute?n:(0,t.relative)(r,n)).map(e=>e===``?`.`:e),o=e.absolute?i:a;return{content:[{type:`text`,text:e.json?JSON.stringify(o):JSON.stringify({searchDir:r,projectsPath:o},null,2)}]}}catch(e){return{content:[{type:`text`,text:`Projects list failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}})};exports.loadCLITools=a;
2
2
  //# sourceMappingURL=cli.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.cjs","names":["z","Locales"],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import { relative } from 'node:path';\nimport { listProjects } from '@intlayer/chokidar/cli';\nimport {\n build,\n extract,\n fill,\n init,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\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 absolute: z\n .boolean()\n .optional()\n .describe(\n 'Output the results as absolute paths instead of relative paths'\n ),\n json: z\n .boolean()\n .optional()\n .describe('Output the results as JSON instead of formatted text'),\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: props.json\n ? JSON.stringify(rows)\n : 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-extract',\n {\n title: 'Extract strings from Component',\n description:\n 'Extract strings from an existing component to be placed in a .content file close to the component. Trigger this action to make an existing component multilingual. If the component does not exist, create a normal component including text in JSX, and then trigger this tool to extract it.',\n inputSchema: {\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('List of files to extract'),\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 extract({\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: 'Extract 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: `Extract failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-projects-list',\n {\n title: 'List Projects',\n description:\n 'List all Intlayer projects in the directory. Search for configuration files to find all Intlayer projects.',\n inputSchema: {\n baseDir: z\n .string()\n .optional()\n .describe('Base directory to search from'),\n gitRoot: z\n .boolean()\n .optional()\n .describe(\n 'Search from the git root directory instead of the base directory'\n ),\n absolute: z\n .boolean()\n .optional()\n .describe(\n 'Output the results as absolute paths instead of relative paths'\n ),\n json: z\n .boolean()\n .optional()\n .describe('Output the results as JSON instead of formatted text'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const { searchDir, projectsPath } = await listProjects({\n baseDir: props.baseDir,\n gitRoot: props.gitRoot,\n });\n\n // Handle absolute option similar to CLI command\n const projectsRelativePath = projectsPath\n .map((projectPath) =>\n props.absolute ? projectPath : relative(searchDir, projectPath)\n )\n .map((projectPath) => (projectPath === '' ? '.' : projectPath));\n\n const outputPaths = props.absolute\n ? projectsPath\n : projectsRelativePath;\n\n return {\n content: [\n {\n type: 'text',\n text: props.json\n ? JSON.stringify(outputPaths)\n : JSON.stringify(\n { searchDir, projectsPath: outputPaths },\n null,\n 2\n ),\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: `Projects list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n};\n"],"mappings":"kRAkBA,MAAa,EAA6B,KAAO,IAAW,CAC1D,EAAO,aACL,gBACA,CACE,MAAO,sBACP,YAAa,qCACb,YAAa,CACX,YAAaA,EAAAA,QAAE,QAAQ,CAAC,SAAS,yBAAyB,CAC3D,CACD,YAAa,CACX,gBAAiB,GAClB,CACF,CACD,MAAO,CAAE,iBAAkB,CACzB,GAAI,CAGF,OAFA,MAAA,EAAA,EAAA,MAAW,EAAY,CAEhB,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,6BACP,CACF,CACF,OACM,EAAO,CAGd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,0BALV,aAAiB,MAAQ,EAAM,QAAU,8BAMtC,CACF,CACF,GAGN,CAED,EAAO,aACL,iBACA,CACE,MAAO,qBACP,YACE,2JACF,YAAa,CACX,MAAOA,EAAAA,QAAE,SAAS,CAAC,UAAU,CAAC,SAAS,oBAAoB,CAC3D,QAASA,EAAAA,QAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iBAAiB,CACzD,IAAKA,EAAAA,QAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,cAAc,CAClD,QAASA,EAAAA,QAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,mBAAmB,CAC3D,QAASA,EAAAA,QAAE,SAAS,CAAC,UAAU,CAAC,SAAS,iBAAiB,CAC1D,OAAQA,EAAAA,QAAE,QAAQ,CAAC,UAAU,CAAC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C,CACF,CACF,GAGN,CAED,EAAO,aACL,yBACA,CACE,MAAO,gBACP,YACE,6GACF,YAAa,CACX,QAASA,EAAAA,QACN,QAAQ,CACR,UAAU,CACV,SAAS,gCAAgC,CAC5C,QAASA,EAAAA,QACN,SAAS,CACT,UAAU,CACV,SACC,mEACD,CACH,SAAUA,EAAAA,QACP,SAAS,CACT,UAAU,CACV,SACC,iEACD,CACH,KAAMA,EAAAA,QACH,SAAS,CACT,UAAU,CACV,SAAS,uDAAuD,CACpE,CACD,YAAa,CACX,aAAc,GACf,CACF,CACD,KAAO,IAAU,CACf,GAAI,CACF,GAAM,CAAE,YAAW,gBAAiB,MAAA,EAAA,EAAA,cAAmB,CACrD,QAAS,EAAM,QACf,QAAS,EAAM,QAChB,CAAC,CAGI,EAAuB,EAC1B,IAAK,GACJ,EAAM,SAAW,GAAA,EAAA,EAAA,UAAuB,EAAW,EAAY,CAChE,CACA,IAAK,GAAiB,IAAgB,GAAK,IAAM,EAAa,CAE3D,EAAc,EAAM,SACtB,EACA,EAEJ,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,EAAM,KACR,KAAK,UAAU,EAAY,CAC3B,KAAK,UACH,CAAE,YAAW,aAAc,EAAa,CACxC,KACA,EACD,CACN,CACF,CACF,OACM,EAAO,CAGd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,yBALV,aAAiB,MAAQ,EAAM,QAAU,8BAMtC,CACF,CACF,GAGN"}
1
+ {"version":3,"file":"cli.cjs","names":["z","Locales"],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import { relative } from 'node:path';\nimport {\n build,\n extract,\n fill,\n init,\n listContentDeclarationRows,\n listMissingTranslations,\n listProjects,\n pull,\n push,\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 absolute: z\n .boolean()\n .optional()\n .describe(\n 'Output the results as absolute paths instead of relative paths'\n ),\n json: z\n .boolean()\n .optional()\n .describe('Output the results as JSON instead of formatted text'),\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: props.json\n ? JSON.stringify(rows)\n : 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-extract',\n {\n title: 'Extract strings from Component',\n description:\n 'Extract strings from an existing component to be placed in a .content file close to the component. Trigger this action to make an existing component multilingual. If the component does not exist, create a normal component including text in JSX, and then trigger this tool to extract it.',\n inputSchema: {\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('List of files to extract'),\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 extract({\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: 'Extract 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: `Extract failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-projects-list',\n {\n title: 'List Projects',\n description:\n 'List all Intlayer projects in the directory. Search for configuration files to find all Intlayer projects.',\n inputSchema: {\n baseDir: z\n .string()\n .optional()\n .describe('Base directory to search from'),\n gitRoot: z\n .boolean()\n .optional()\n .describe(\n 'Search from the git root directory instead of the base directory'\n ),\n absolute: z\n .boolean()\n .optional()\n .describe(\n 'Output the results as absolute paths instead of relative paths'\n ),\n json: z\n .boolean()\n .optional()\n .describe('Output the results as JSON instead of formatted text'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const { searchDir, projectsPath } = await listProjects({\n baseDir: props.baseDir,\n gitRoot: props.gitRoot,\n });\n\n // Handle absolute option similar to CLI command\n const projectsRelativePath = projectsPath\n .map((projectPath) =>\n props.absolute ? projectPath : relative(searchDir, projectPath)\n )\n .map((projectPath) => (projectPath === '' ? '.' : projectPath));\n\n const outputPaths = props.absolute\n ? projectsPath\n : projectsRelativePath;\n\n return {\n content: [\n {\n type: 'text',\n text: props.json\n ? JSON.stringify(outputPaths)\n : JSON.stringify(\n { searchDir, projectsPath: outputPaths },\n null,\n 2\n ),\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: `Projects list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n};\n"],"mappings":"8OAkBA,MAAa,EAA6B,KAAO,IAAW,CAC1D,EAAO,aACL,gBACA,CACE,MAAO,sBACP,YAAa,qCACb,YAAa,CACX,YAAaA,EAAAA,QAAE,QAAQ,CAAC,SAAS,yBAAyB,CAC3D,CACD,YAAa,CACX,gBAAiB,GAClB,CACF,CACD,MAAO,CAAE,iBAAkB,CACzB,GAAI,CAGF,OAFA,MAAA,EAAA,EAAA,MAAW,EAAY,CAEhB,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,6BACP,CACF,CACF,OACM,EAAO,CAGd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,0BALV,aAAiB,MAAQ,EAAM,QAAU,8BAMtC,CACF,CACF,GAGN,CAED,EAAO,aACL,iBACA,CACE,MAAO,qBACP,YACE,2JACF,YAAa,CACX,MAAOA,EAAAA,QAAE,SAAS,CAAC,UAAU,CAAC,SAAS,oBAAoB,CAC3D,QAASA,EAAAA,QAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iBAAiB,CACzD,IAAKA,EAAAA,QAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,cAAc,CAClD,QAASA,EAAAA,QAAE,QAAQ,CAA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AAS,CACP,CACE,KAAM,OACN,KAAM,sBACP,CACF,CACF,OACM,EAAO,CAGd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,mBALV,aAAiB,MAAQ,EAAM,QAAU,8BAMtC,CACF,CACF,GAGN,CAED,EAAO,aACL,yBACA,CACE,MAAO,gBACP,YACE,6GACF,YAAa,CACX,QAASA,EAAAA,QACN,QAAQ,CACR,UAAU,CACV,SAAS,gCAAgC,CAC5C,QAASA,EAAAA,QACN,SAAS,CACT,UAAU,CACV,SACC,mEACD,CACH,SAAUA,EAAAA,QACP,SAAS,CACT,UAAU,CACV,SACC,iEACD,CACH,KAAMA,EAAAA,QACH,SAAS,CACT,UAAU,CACV,SAAS,uDAAuD,CACpE,CACD,YAAa,CACX,aAAc,GACf,CACF,CACD,KAAO,IAAU,CACf,GAAI,CACF,GAAM,CAAE,YAAW,gBAAiB,MAAA,EAAA,EAAA,cAAmB,CACrD,QAAS,EAAM,QACf,QAAS,EAAM,QAChB,CAAC,CAGI,EAAuB,EAC1B,IAAK,GACJ,EAAM,SAAW,GAAA,EAAA,EAAA,UAAuB,EAAW,EAAY,CAChE,CACA,IAAK,GAAiB,IAAgB,GAAK,IAAM,EAAa,CAE3D,EAAc,EAAM,SACtB,EACA,EAEJ,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,EAAM,KACR,KAAK,UAAU,EAAY,CAC3B,KAAK,UACH,CAAE,YAAW,aAAc,EAAa,CACxC,KACA,EACD,CACN,CACF,CACF,OACM,EAAO,CAGd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,yBALV,aAAiB,MAAQ,EAAM,QAAU,8BAMtC,CACF,CACF,GAGN"}
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`@intlayer/chokidar/cli`),n=require(`node:readline`);n=e.__toESM(n);let r=require(`zod`);r=e.__toESM(r);const i=e=>{e.registerTool(`intlayer-install-skills`,{title:`Install Intlayer Skills`,description:`Install Intlayer documentation and skills to the project to assist AI agents. Ask the user for the platform (Cursor, VSCode, OpenCode, Claude, etc.) and which skills they want to install before calling this tool.`,inputSchema:{platform:r.default.enum(`Cursor.Windsurf.Trae.OpenCode.GitHub.Claude.VSCode.Antigravity.Augment.OpenClaw.Cline.CodeBuddy.CommandCode.Continue.Crush.Droid.Goose.Junie.IFlow.KiloCode.Kiro.Kode.MCPJam.MistralVibe.Mux.OpenHands.Pi.Qoder.Qwen.RooCode.TraeCN.Zencoder.Neovate.Pochi.Other`.split(`.`)).describe(`The platform to install skills for`),skills:r.default.array(r.default.enum(t.SKILLS)).describe(`List of skills to install`),projectRoot:r.default.string().optional().describe(`Root directory of the project. Defaults to current directory.`)}},async({platform:e,skills:n,projectRoot:r})=>{try{return{content:[{type:`text`,text:await(0,t.installSkills)(r||process.cwd(),e,n)}]}}catch(e){return{content:[{type:`text`,text:`Failed to install skills: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}})},a=async()=>{let e=n.createInterface({input:process.stdin,output:process.stdout}),r=t=>new Promise(n=>e.question(t,n));try{console.log(`Install Intlayer Skills`),console.log(`-----------------------`);let n=await r(`Which platform are you using? (Cursor, Windsurf, Trae, OpenCode, GitHub, Claude, VSCode, Cline, RooCode, etc. or "Other"): `),i=`Cursor.Windsurf.Trae.OpenCode.GitHub.Claude.VSCode.Antigravity.Augment.OpenClaw.Cline.CodeBuddy.CommandCode.Continue.Crush.Droid.Goose.Junie.IFlow.KiloCode.Kiro.Kode.MCPJam.MistralVibe.Mux.OpenHands.Pi.Qoder.Qwen.RooCode.TraeCN.Zencoder.Neovate.Pochi.Other`.split(`.`).find(e=>e.toLowerCase()===n.trim().toLowerCase())||`Other`;console.log(`Selected platform: ${i}`);let a=t.SKILLS;console.log(`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`@intlayer/cli`),n=require(`node:readline`);n=e.__toESM(n);let r=require(`zod`);r=e.__toESM(r);const i=e=>{e.registerTool(`intlayer-install-skills`,{title:`Install Intlayer Skills`,description:`Install Intlayer documentation and skills to the project to assist AI agents. Ask the user for the platform (Cursor, VSCode, OpenCode, Claude, etc.) and which skills they want to install before calling this tool.`,inputSchema:{platform:r.default.enum(`Cursor.Windsurf.Trae.OpenCode.GitHub.Claude.VSCode.Antigravity.Augment.OpenClaw.Cline.CodeBuddy.CommandCode.Continue.Crush.Droid.Goose.Junie.IFlow.KiloCode.Kiro.Kode.MCPJam.MistralVibe.Mux.OpenHands.Pi.Qoder.Qwen.RooCode.TraeCN.Zencoder.Neovate.Pochi.Other`.split(`.`)).describe(`The platform to install skills for`),skills:r.default.array(r.default.enum(t.SKILLS)).describe(`List of skills to install`),projectRoot:r.default.string().optional().describe(`Root directory of the project. Defaults to current directory.`)}},async({platform:e,skills:n,projectRoot:r})=>{try{return{content:[{type:`text`,text:await(0,t.installSkills)(r||process.cwd(),e,n)}]}}catch(e){return{content:[{type:`text`,text:`Failed to install skills: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}})},a=async()=>{let e=n.createInterface({input:process.stdin,output:process.stdout}),r=t=>new Promise(n=>e.question(t,n));try{console.log(`Install Intlayer Skills`),console.log(`-----------------------`);let n=await r(`Which platform are you using? (Cursor, Windsurf, Trae, OpenCode, GitHub, Claude, VSCode, Cline, RooCode, etc. or "Other"): `),i=`Cursor.Windsurf.Trae.OpenCode.GitHub.Claude.VSCode.Antigravity.Augment.OpenClaw.Cline.CodeBuddy.CommandCode.Continue.Crush.Droid.Goose.Junie.IFlow.KiloCode.Kiro.Kode.MCPJam.MistralVibe.Mux.OpenHands.Pi.Qoder.Qwen.RooCode.TraeCN.Zencoder.Neovate.Pochi.Other`.split(`.`).find(e=>e.toLowerCase()===n.trim().toLowerCase())||`Other`;console.log(`Selected platform: ${i}`);let a=t.SKILLS;console.log(`
2
2
  Available skills:`),a.forEach((e,t)=>{console.log(`${t+1}. ${e}`)});let o=await r(`
3
- Which skills do you want to install? (comma separated numbers, e.g. 1,2,3 or "all"): `),s=[];if(s=o.trim().toLowerCase()===`all`?[...a]:o.split(`,`).map(e=>parseInt(e.trim())-1).filter(e=>!isNaN(e)&&e>=0&&e<a.length).map(e=>a[e]),s.length===0){console.log(`No valid skills selected. Exiting.`),e.close();return}console.log(`Installing skills: ${s.join(`, `)}...`);let c=await(0,t.installSkills)(process.cwd(),i,s);console.log(c)}catch(e){console.error(`Error:`,e)}finally{e.close()}};exports.loadInstallSkillsTool=i,exports.runInstallSkillsCLI=a;
3
+ Which skills do you want to install? (comma separated numbers, e.g. 1,2,3 or "all"): `),s=[];if(s=o.trim().toLowerCase()===`all`?[...a]:o.split(`,`).map(e=>parseInt(e.trim(),10)-1).filter(e=>!Number.isNaN(e)&&e>=0&&e<a.length).map(e=>a[e]),s.length===0){console.log(`No valid skills selected. Exiting.`),e.close();return}console.log(`Installing skills: ${s.join(`, `)}...`);let c=await(0,t.installSkills)(process.cwd(),i,s);console.log(c)}catch(e){console.error(`Error:`,e)}finally{e.close()}};exports.loadInstallSkillsTool=i,exports.runInstallSkillsCLI=a;
4
4
  //# sourceMappingURL=installSkills.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"installSkills.cjs","names":["z","SKILLS","readline"],"sources":["../../../src/tools/installSkills.ts"],"sourcesContent":["import * as readline from 'node:readline';\nimport { installSkills, SKILLS, type Skill } from '@intlayer/chokidar/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\n\nexport const loadInstallSkillsTool = (server: McpServer): void => {\n server.registerTool(\n 'intlayer-install-skills',\n {\n title: 'Install Intlayer Skills',\n description:\n 'Install Intlayer documentation and skills to the project to assist AI agents. Ask the user for the platform (Cursor, VSCode, OpenCode, Claude, etc.) and which skills they want to install before calling this tool.',\n inputSchema: {\n platform: z\n .enum([\n 'Cursor',\n 'Windsurf',\n 'Trae',\n 'OpenCode',\n 'GitHub',\n 'Claude',\n 'VSCode',\n 'Antigravity',\n 'Augment',\n 'OpenClaw',\n 'Cline',\n 'CodeBuddy',\n 'CommandCode',\n 'Continue',\n 'Crush',\n 'Droid',\n 'Goose',\n 'Junie',\n 'IFlow',\n 'KiloCode',\n 'Kiro',\n 'Kode',\n 'MCPJam',\n 'MistralVibe',\n 'Mux',\n 'OpenHands',\n 'Pi',\n 'Qoder',\n 'Qwen',\n 'RooCode',\n 'TraeCN',\n 'Zencoder',\n 'Neovate',\n 'Pochi',\n 'Other',\n ])\n .describe('The platform to install skills for'),\n skills: z.array(z.enum(SKILLS)).describe('List of skills to install'),\n projectRoot: z\n .string()\n .optional()\n .describe(\n 'Root directory of the project. Defaults to current directory.'\n ),\n },\n },\n async ({ platform, skills, projectRoot }) => {\n try {\n const root = projectRoot || process.cwd();\n const message = await installSkills(\n root,\n platform as any,\n skills as any\n );\n\n return {\n content: [\n {\n type: 'text',\n text: message,\n },\n ],\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text',\n text: `Failed to install skills: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n }\n );\n};\n\nexport const runInstallSkillsCLI = async (): Promise<void> => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n const question = (query: string): Promise<string> =>\n new Promise((resolve) => rl.question(query, resolve));\n\n try {\n console.log('Install Intlayer Skills');\n console.log('-----------------------');\n\n const platformInput = await question(\n 'Which platform are you using? (Cursor, Windsurf, Trae, OpenCode, GitHub, Claude, VSCode, Cline, RooCode, etc. or \"Other\"): '\n );\n const platform = ([\n 'Cursor',\n 'Windsurf',\n 'Trae',\n 'OpenCode',\n 'GitHub',\n 'Claude',\n 'VSCode',\n 'Antigravity',\n 'Augment',\n 'OpenClaw',\n 'Cline',\n 'CodeBuddy',\n 'CommandCode',\n 'Continue',\n 'Crush',\n 'Droid',\n 'Goose',\n 'Junie',\n 'IFlow',\n 'KiloCode',\n 'Kiro',\n 'Kode',\n 'MCPJam',\n 'MistralVibe',\n 'Mux',\n 'OpenHands',\n 'Pi',\n 'Qoder',\n 'Qwen',\n 'RooCode',\n 'TraeCN',\n 'Zencoder',\n 'Neovate',\n 'Pochi',\n 'Other',\n ].find((p) => p.toLowerCase() === platformInput.trim().toLowerCase()) ||\n 'Other') as\n | 'Cursor'\n | 'Windsurf'\n | 'Trae'\n | 'OpenCode'\n | 'GitHub'\n | 'Claude'\n | 'VSCode'\n | 'Antigravity'\n | 'Augment'\n | 'OpenClaw'\n | 'Cline'\n | 'CodeBuddy'\n | 'CommandCode'\n | 'Continue'\n | 'Crush'\n | 'Droid'\n | 'Goose'\n | 'Junie'\n | 'IFlow'\n | 'KiloCode'\n | 'Kiro'\n | 'Kode'\n | 'MCPJam'\n | 'MistralVibe'\n | 'Mux'\n | 'OpenHands'\n | 'Pi'\n | 'Qoder'\n | 'Qwen'\n | 'RooCode'\n | 'TraeCN'\n | 'Zencoder'\n | 'Neovate'\n | 'Pochi'\n | 'Other';\n\n console.log(`Selected platform: ${platform}`);\n\n const availableSkills = SKILLS;\n console.log('\\nAvailable skills:');\n availableSkills.forEach((s, i) => {\n console.log(`${i + 1}. ${s}`);\n });\n\n const skillsInput = await question(\n '\\nWhich skills do you want to install? (comma separated numbers, e.g. 1,2,3 or \"all\"): '\n );\n\n let selectedSkills: Skill[] = [];\n if (skillsInput.trim().toLowerCase() === 'all') {\n selectedSkills = [...availableSkills];\n } else {\n const indices = skillsInput\n .split(',')\n .map((s) => parseInt(s.trim()) - 1)\n .filter((i) => !isNaN(i) && i >= 0 && i < availableSkills.length);\n selectedSkills = indices.map((i) => availableSkills[i] as any);\n }\n\n if (selectedSkills.length === 0) {\n console.log('No valid skills selected. Exiting.');\n rl.close();\n return;\n }\n\n console.log(`Installing skills: ${selectedSkills.join(', ')}...`);\n const result = await installSkills(process.cwd(), platform, selectedSkills);\n console.log(result);\n } catch (error) {\n console.error('Error:', error);\n } finally {\n rl.close();\n }\n};\n"],"mappings":"8OA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AWhC,GAVA,AAOE,EAPE,EAAY,MAAM,CAAC,aAAa,GAAK,MACtB,CAAC,GAAG,EAAgB,CAErB,EACb,MAAM,IAAI,CACV,IAAK,GAAM,SAAS,EAAE,MAAM,CAAC,CAAG,EAAE,CAClC,OAAQ,GAAM,CAAC,MAAM,EAAE,EAAI,GAAK,GAAK,EAAI,EAAgB,OAAO,CAC1C,IAAK,GAAM,EAAgB,GAAU,CAG5D,EAAe,SAAW,EAAG,CAC/B,QAAQ,IAAI,qCAAqC,CACjD,EAAG,OAAO,CACV,OAGF,QAAQ,IAAI,sBAAsB,EAAe,KAAK,KAAK,CAAC,KAAK,CACjE,IAAM,EAAS,MAAA,EAAA,EAAA,eAAoB,QAAQ,KAAK,CAAE,EAAU,EAAe,CAC3E,QAAQ,IAAI,EAAO,OACZ,EAAO,CACd,QAAQ,MAAM,SAAU,EAAM,QACtB,CACR,EAAG,OAAO"}
1
+ {"version":3,"file":"installSkills.cjs","names":["z","SKILLS","readline"],"sources":["../../../src/tools/installSkills.ts"],"sourcesContent":["import * as readline from 'node:readline';\nimport { installSkills, SKILLS, type Skill } from '@intlayer/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\n\nexport const loadInstallSkillsTool = (server: McpServer): void => {\n server.registerTool(\n 'intlayer-install-skills',\n {\n title: 'Install Intlayer Skills',\n description:\n 'Install Intlayer documentation and skills to the project to assist AI agents. Ask the user for the platform (Cursor, VSCode, OpenCode, Claude, etc.) and which skills they want to install before calling this tool.',\n inputSchema: {\n platform: z\n .enum([\n 'Cursor',\n 'Windsurf',\n 'Trae',\n 'OpenCode',\n 'GitHub',\n 'Claude',\n 'VSCode',\n 'Antigravity',\n 'Augment',\n 'OpenClaw',\n 'Cline',\n 'CodeBuddy',\n 'CommandCode',\n 'Continue',\n 'Crush',\n 'Droid',\n 'Goose',\n 'Junie',\n 'IFlow',\n 'KiloCode',\n 'Kiro',\n 'Kode',\n 'MCPJam',\n 'MistralVibe',\n 'Mux',\n 'OpenHands',\n 'Pi',\n 'Qoder',\n 'Qwen',\n 'RooCode',\n 'TraeCN',\n 'Zencoder',\n 'Neovate',\n 'Pochi',\n 'Other',\n ])\n .describe('The platform to install skills for'),\n skills: z.array(z.enum(SKILLS)).describe('List of skills to install'),\n projectRoot: z\n .string()\n .optional()\n .describe(\n 'Root directory of the project. Defaults to current directory.'\n ),\n },\n },\n async ({ platform, skills, projectRoot }) => {\n try {\n const root = projectRoot || process.cwd();\n const message = await installSkills(\n root,\n platform as any,\n skills as any\n );\n\n return {\n content: [\n {\n type: 'text',\n text: message,\n },\n ],\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text',\n text: `Failed to install skills: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n }\n );\n};\n\nexport const runInstallSkillsCLI = async (): Promise<void> => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n const question = (query: string): Promise<string> =>\n new Promise((resolve) => rl.question(query, resolve));\n\n try {\n console.log('Install Intlayer Skills');\n console.log('-----------------------');\n\n const platformInput = await question(\n 'Which platform are you using? (Cursor, Windsurf, Trae, OpenCode, GitHub, Claude, VSCode, Cline, RooCode, etc. or \"Other\"): '\n );\n const platform = ([\n 'Cursor',\n 'Windsurf',\n 'Trae',\n 'OpenCode',\n 'GitHub',\n 'Claude',\n 'VSCode',\n 'Antigravity',\n 'Augment',\n 'OpenClaw',\n 'Cline',\n 'CodeBuddy',\n 'CommandCode',\n 'Continue',\n 'Crush',\n 'Droid',\n 'Goose',\n 'Junie',\n 'IFlow',\n 'KiloCode',\n 'Kiro',\n 'Kode',\n 'MCPJam',\n 'MistralVibe',\n 'Mux',\n 'OpenHands',\n 'Pi',\n 'Qoder',\n 'Qwen',\n 'RooCode',\n 'TraeCN',\n 'Zencoder',\n 'Neovate',\n 'Pochi',\n 'Other',\n ].find((p) => p.toLowerCase() === platformInput.trim().toLowerCase()) ||\n 'Other') as\n | 'Cursor'\n | 'Windsurf'\n | 'Trae'\n | 'OpenCode'\n | 'GitHub'\n | 'Claude'\n | 'VSCode'\n | 'Antigravity'\n | 'Augment'\n | 'OpenClaw'\n | 'Cline'\n | 'CodeBuddy'\n | 'CommandCode'\n | 'Continue'\n | 'Crush'\n | 'Droid'\n | 'Goose'\n | 'Junie'\n | 'IFlow'\n | 'KiloCode'\n | 'Kiro'\n | 'Kode'\n | 'MCPJam'\n | 'MistralVibe'\n | 'Mux'\n | 'OpenHands'\n | 'Pi'\n | 'Qoder'\n | 'Qwen'\n | 'RooCode'\n | 'TraeCN'\n | 'Zencoder'\n | 'Neovate'\n | 'Pochi'\n | 'Other';\n\n console.log(`Selected platform: ${platform}`);\n\n const availableSkills = SKILLS;\n console.log('\\nAvailable skills:');\n availableSkills.forEach((s, i) => {\n console.log(`${i + 1}. ${s}`);\n });\n\n const skillsInput = await question(\n '\\nWhich skills do you want to install? (comma separated numbers, e.g. 1,2,3 or \"all\"): '\n );\n\n let selectedSkills: Skill[] = [];\n if (skillsInput.trim().toLowerCase() === 'all') {\n selectedSkills = [...availableSkills];\n } else {\n const indices = skillsInput\n .split(',')\n .map((s) => parseInt(s.trim(), 10) - 1)\n .filter(\n (s) => !Number.isNaN(s) && s >= 0 && s < availableSkills.length\n );\n selectedSkills = indices.map((i) => availableSkills[i] as any);\n }\n\n if (selectedSkills.length === 0) {\n console.log('No valid skills selected. Exiting.');\n rl.close();\n return;\n }\n\n console.log(`Installing skills: ${selectedSkills.join(', ')}...`);\n const result = await installSkills(process.cwd(), platform, selectedSkills);\n console.log(result);\n } catch (error) {\n console.error('Error:', error);\n } finally {\n rl.close();\n }\n};\n"],"mappings":"qOAKA,MAAa,EAAyB,GAA4B,CAChE,EAAO,aACL,0BACA,CACE,MAAO,0BACP,YACE,uNACF,YAAa,CACX,SAAUA,EAAAA,QACP,KAAK,6QAoCL,CAAC,CACD,SAAS,qCAAqC,CACjD,OAAQA,EAAAA,QAAE,MAAMA,EAAAA,QAAE,KAA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AE,EAAI,GAAK,GAAK,EAAI,EAAgB,OAC1D,CACsB,IAAK,GAAM,EAAgB,GAAU,CAG5D,EAAe,SAAW,EAAG,CAC/B,QAAQ,IAAI,qCAAqC,CACjD,EAAG,OAAO,CACV,OAGF,QAAQ,IAAI,sBAAsB,EAAe,KAAK,KAAK,CAAC,KAAK,CACjE,IAAM,EAAS,MAAA,EAAA,EAAA,eAAoB,QAAQ,KAAK,CAAE,EAAU,EAAe,CAC3E,QAAQ,IAAI,EAAO,OACZ,EAAO,CACd,QAAQ,MAAM,SAAU,EAAM,QACtB,CACR,EAAG,OAAO"}
@@ -1,2 +1,2 @@
1
- import{dirname as e,resolve as t}from"node:path";import{readFileSync as n}from"node:fs";import{fileURLToPath as r}from"node:url";import{isESModule as i}from"@intlayer/config/utils";import{Client as a}from"@modelcontextprotocol/sdk/client/index.js";const o=i?e(r(import.meta.url)):__dirname,s=JSON.parse(n(t(o,`../../../package.json`),`utf8`)),c=()=>new a({name:`mcp-client-for-intlayer-mcp-server`,version:s.version});export{o as dirname,c as loadClient};
1
+ import{readFileSync as e}from"node:fs";import{dirname as t,resolve as n}from"node:path";import{fileURLToPath as r}from"node:url";import{isESModule as i}from"@intlayer/config/utils";import{Client as a}from"@modelcontextprotocol/sdk/client/index.js";const o=i?t(r(import.meta.url)):__dirname,s=JSON.parse(e(n(o,`../../../package.json`),`utf8`)),c=()=>new a({name:`mcp-client-for-intlayer-mcp-server`,version:s.version});export{o as dirname,c as loadClient};
2
2
  //# sourceMappingURL=client.mjs.map
@@ -1,2 +1,2 @@
1
- import{loadCLITools as e}from"../tools/cli.mjs";import{loadDocsTools as t}from"../tools/docs.mjs";import{loadInstallSkillsTool as n}from"../tools/installSkills.mjs";import{dirname as r,resolve as i}from"node:path";import{readFileSync as a}from"node:fs";import{fileURLToPath as o}from"node:url";import{isESModule as s}from"@intlayer/config/utils";import{McpServer as c}from"@modelcontextprotocol/sdk/server/mcp.js";const l=s?r(o(import.meta.url)):__dirname,u=JSON.parse(a(i(l,`../../../package.json`),`utf8`)),d=({isLocal:r})=>{let i=new c({name:`intlayer`,version:u.version});if(r)try{e(i),n(i)}catch(e){console.error(`Error loading CLI tools:`,e)}try{t(i)}catch(e){console.error(`Error loading docs tools:`,e)}return i};export{l as dirname,d as loadServer};
1
+ import{loadCLITools as e}from"../tools/cli.mjs";import{loadDocsTools as t}from"../tools/docs.mjs";import{loadInstallSkillsTool as n}from"../tools/installSkills.mjs";import{readFileSync as r}from"node:fs";import{dirname as i,resolve as a}from"node:path";import{fileURLToPath as o}from"node:url";import{isESModule as s}from"@intlayer/config/utils";import{McpServer as c}from"@modelcontextprotocol/sdk/server/mcp.js";const l=s?i(o(import.meta.url)):__dirname,u=JSON.parse(r(a(l,`../../../package.json`),`utf8`)),d=({isLocal:r})=>{let i=new c({name:`intlayer`,version:u.version});if(r)try{e(i),n(i)}catch(e){console.error(`Error loading CLI tools:`,e)}try{t(i)}catch(e){console.error(`Error loading docs tools:`,e)}return i};export{l as dirname,d as loadServer};
2
2
  //# sourceMappingURL=server.mjs.map
@@ -1,2 +1,2 @@
1
- import{relative as e}from"node:path";import{listProjects as t}from"@intlayer/chokidar/cli";import{build as n,extract as r,fill as i,init as a,listContentDeclarationRows as o,listMissingTranslations as s,pull as c,push as l}from"@intlayer/cli";import{Locales as u}from"@intlayer/types";import d from"zod/v3";const f=async f=>{f.registerTool(`intlayer-init`,{title:`Initialize Intlayer`,description:`Initialize Intlayer in the project`,inputSchema:{projectRoot:d.string().describe(`Project root directory`)},annotations:{destructiveHint:!0}},async({projectRoot:e})=>{try{return await a(e),{content:[{type:`text`,text:`Initialization successful.`}]}}catch(e){return{content:[{type:`text`,text:`Initialization failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-build`,{title:`Build Dictionaries`,description:"Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.",inputSchema:{watch:d.boolean().optional().describe(`Watch for changes`),baseDir:d.string().optional().describe(`Base directory`),env:d.string().optional().describe(`Environment`),envFile:d.string().optional().describe(`Environment file`),verbose:d.boolean().optional().describe(`Verbose output`),prefix:d.string().optional().describe(`Log prefix`)},annotations:{destructiveHint:!0}},async({watch:e,baseDir:t,env:r,envFile:i,verbose:a,prefix:o})=>{try{let s={};return a&&(s.mode=`verbose`),o&&(s.prefix=o),await n({watch:e,configOptions:{baseDir:t,env:r,envFile:i,override:{log:s}}}),{content:[{type:`text`,text:`Build successful.`}]}}catch(e){return{content:[{type:`text`,text:`Build failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-fill`,{title:`Fill Translations`,description:`Fill the dictionaries with missing translations / review translations using Intlayer servers`,inputSchema:{sourceLocale:d.nativeEnum(u.ALL_LOCALES).optional().describe(`Source locale`),outputLocales:d.union([d.nativeEnum(u.ALL_LOCALES),d.array(d.nativeEnum(u.ALL_LOCALES))]).optional().describe(`Output locales`),file:d.union([d.string(),d.array(d.string())]).optional().describe(`File path`),mode:d.enum([`complete`,`review`]).optional().describe(`Fill mode`),keys:d.union([d.string(),d.array(d.string())]).optional().describe(`Keys to include`),excludedKeys:d.union([d.string(),d.array(d.string())]).optional().describe(`Keys to exclude`),pathFilter:d.union([d.string(),d.array(d.string())]).optional().describe(`Path filter`),gitOptions:d.object({gitDiff:d.boolean().optional(),gitDiffBase:d.string().optional(),gitDiffCurrent:d.string().optional(),uncommitted:d.boolean().optional(),unpushed:d.boolean().optional(),untracked:d.boolean().optional()}).optional().describe(`Git options`),aiOptions:d.object({provider:d.string().optional(),temperature:d.number().optional(),model:d.string().optional(),apiKey:d.string().optional(),customPrompt:d.string().optional(),applicationContext:d.string().optional()}).optional().describe(`AI options`)},annotations:{destructiveHint:!0}},async e=>{try{let{gitOptions:t,...n}=e,r={...n,gitOptions:void 0};if(t){let{gitDiff:e,uncommitted:n,unpushed:i,untracked:a,...o}=t,s=[];e&&s.push(`gitDiff`),n&&s.push(`uncommitted`),i&&s.push(`unpushed`),a&&s.push(`untracked`),r.gitOptions={...o,mode:s}}return await i(r),{content:[{type:`text`,text:`Fill successful.`}]}}catch(e){return{content:[{type:`text`,text:`Fill failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-push`,{title:`Push Dictionaries`,description:`Push local dictionaries to the server`,inputSchema:{deleteLocaleDictionary:d.boolean().optional().describe(`Delete local dictionary after push`),keepLocaleDictionary:d.boolean().optional().describe(`Keep local dictionary after push`),dictionaries:d.array(d.string()).optional().describe(`List of dictionaries to push`),gitOptions:d.object({gitDiff:d.boolean().optional(),gitDiffBase:d.string().optional(),gitDiffCurrent:d.string().optional(),uncommitted:d.boolean().optional(),unpushed:d.boolean().optional(),untracked:d.boolean().optional()}).optional().describe(`Git options`)},annotations:{destructiveHint:!0}},async e=>{try{let{gitOptions:t,...n}=e,r={...n,gitOptions:void 0};if(t){let{gitDiff:e,uncommitted:n,unpushed:i,untracked:a,...o}=t,s=[];e&&s.push(`gitDiff`),n&&s.push(`uncommitted`),i&&s.push(`unpushed`),a&&s.push(`untracked`),r.gitOptions={...o,mode:s}}return await l(r),{content:[{type:`text`,text:`Push successful.`}]}}catch(e){return{content:[{type:`text`,text:`Push failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-pull`,{title:`Pull Dictionaries`,description:`Pull dictionaries from the CMS`,inputSchema:{dictionaries:d.array(d.string()).optional().describe(`List of dictionaries to pull`),newDictionariesPath:d.string().optional().describe(`Path to save new dictionaries`)},annotations:{destructiveHint:!0}},async e=>{try{return await c(e),{content:[{type:`text`,text:`Pull successful.`}]}}catch(e){return{content:[{type:`text`,text:`Pull failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-content-list`,{title:`List Content Declarations`,description:`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.`,inputSchema:{configOptions:d.object({baseDir:d.string().optional(),env:d.string().optional(),envFile:d.string().optional(),override:d.object({log:d.object({prefix:d.string().optional(),verbose:d.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`),absolute:d.boolean().optional().describe(`Output the results as absolute paths instead of relative paths`),json:d.boolean().optional().describe(`Output the results as JSON instead of formatted text`)},annotations:{readOnlyHint:!0}},async e=>{try{let t=o(e);return{content:[{type:`text`,text:e.json?JSON.stringify(t):JSON.stringify(t,null,2)}]}}catch(e){return{content:[{type:`text`,text:`Content list failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-content-test`,{title:`Test Translations`,description:`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.`,inputSchema:{configOptions:d.object({baseDir:d.string().optional(),env:d.string().optional(),envFile:d.string().optional(),override:d.object({log:d.object({prefix:d.string().optional(),verbose:d.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`)},annotations:{readOnlyHint:!0}},async e=>{try{let t=s(e?.configOptions);return{content:[{type:`text`,text:JSON.stringify(t,null,2)}]}}catch(e){return{content:[{type:`text`,text:`Content test failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-extract`,{title:`Extract strings from Component`,description:`Extract strings from an existing component to be placed in a .content file close to the component. Trigger this action to make an existing component multilingual. If the component does not exist, create a normal component including text in JSX, and then trigger this tool to extract it.`,inputSchema:{file:d.union([d.string(),d.array(d.string())]).optional().describe(`List of files to extract`),outputContentDeclarations:d.string().optional().describe(`Path to output content declaration files`),configOptions:d.object({baseDir:d.string().optional(),env:d.string().optional(),envFile:d.string().optional(),override:d.object({log:d.object({prefix:d.string().optional(),verbose:d.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`)},annotations:{destructiveHint:!0}},async e=>{try{return await r({files:Array.isArray(e.file)?e.file:e.file?[e.file]:void 0,outputContentDeclarations:e.outputContentDeclarations,configOptions:e.configOptions}),{content:[{type:`text`,text:`Extract successful.`}]}}catch(e){return{content:[{type:`text`,text:`Extract failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-projects-list`,{title:`List Projects`,description:`List all Intlayer projects in the directory. Search for configuration files to find all Intlayer projects.`,inputSchema:{baseDir:d.string().optional().describe(`Base directory to search from`),gitRoot:d.boolean().optional().describe(`Search from the git root directory instead of the base directory`),absolute:d.boolean().optional().describe(`Output the results as absolute paths instead of relative paths`),json:d.boolean().optional().describe(`Output the results as JSON instead of formatted text`)},annotations:{readOnlyHint:!0}},async n=>{try{let{searchDir:r,projectsPath:i}=await t({baseDir:n.baseDir,gitRoot:n.gitRoot}),a=i.map(t=>n.absolute?t:e(r,t)).map(e=>e===``?`.`:e),o=n.absolute?i:a;return{content:[{type:`text`,text:n.json?JSON.stringify(o):JSON.stringify({searchDir:r,projectsPath:o},null,2)}]}}catch(e){return{content:[{type:`text`,text:`Projects list failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}})};export{f as loadCLITools};
1
+ import{relative as e}from"node:path";import{build as t,extract as n,fill as r,init as i,listContentDeclarationRows as a,listMissingTranslations as o,listProjects as s,pull as c,push as l}from"@intlayer/cli";import{Locales as u}from"@intlayer/types";import d from"zod/v3";const f=async f=>{f.registerTool(`intlayer-init`,{title:`Initialize Intlayer`,description:`Initialize Intlayer in the project`,inputSchema:{projectRoot:d.string().describe(`Project root directory`)},annotations:{destructiveHint:!0}},async({projectRoot:e})=>{try{return await i(e),{content:[{type:`text`,text:`Initialization successful.`}]}}catch(e){return{content:[{type:`text`,text:`Initialization failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-build`,{title:`Build Dictionaries`,description:"Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.",inputSchema:{watch:d.boolean().optional().describe(`Watch for changes`),baseDir:d.string().optional().describe(`Base directory`),env:d.string().optional().describe(`Environment`),envFile:d.string().optional().describe(`Environment file`),verbose:d.boolean().optional().describe(`Verbose output`),prefix:d.string().optional().describe(`Log prefix`)},annotations:{destructiveHint:!0}},async({watch:e,baseDir:n,env:r,envFile:i,verbose:a,prefix:o})=>{try{let s={};return a&&(s.mode=`verbose`),o&&(s.prefix=o),await t({watch:e,configOptions:{baseDir:n,env:r,envFile:i,override:{log:s}}}),{content:[{type:`text`,text:`Build successful.`}]}}catch(e){return{content:[{type:`text`,text:`Build failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-fill`,{title:`Fill Translations`,description:`Fill the dictionaries with missing translations / review translations using Intlayer servers`,inputSchema:{sourceLocale:d.nativeEnum(u.ALL_LOCALES).optional().describe(`Source locale`),outputLocales:d.union([d.nativeEnum(u.ALL_LOCALES),d.array(d.nativeEnum(u.ALL_LOCALES))]).optional().describe(`Output locales`),file:d.union([d.string(),d.array(d.string())]).optional().describe(`File path`),mode:d.enum([`complete`,`review`]).optional().describe(`Fill mode`),keys:d.union([d.string(),d.array(d.string())]).optional().describe(`Keys to include`),excludedKeys:d.union([d.string(),d.array(d.string())]).optional().describe(`Keys to exclude`),pathFilter:d.union([d.string(),d.array(d.string())]).optional().describe(`Path filter`),gitOptions:d.object({gitDiff:d.boolean().optional(),gitDiffBase:d.string().optional(),gitDiffCurrent:d.string().optional(),uncommitted:d.boolean().optional(),unpushed:d.boolean().optional(),untracked:d.boolean().optional()}).optional().describe(`Git options`),aiOptions:d.object({provider:d.string().optional(),temperature:d.number().optional(),model:d.string().optional(),apiKey:d.string().optional(),customPrompt:d.string().optional(),applicationContext:d.string().optional()}).optional().describe(`AI options`)},annotations:{destructiveHint:!0}},async e=>{try{let{gitOptions:t,...n}=e,i={...n,gitOptions:void 0};if(t){let{gitDiff:e,uncommitted:n,unpushed:r,untracked:a,...o}=t,s=[];e&&s.push(`gitDiff`),n&&s.push(`uncommitted`),r&&s.push(`unpushed`),a&&s.push(`untracked`),i.gitOptions={...o,mode:s}}return await r(i),{content:[{type:`text`,text:`Fill successful.`}]}}catch(e){return{content:[{type:`text`,text:`Fill failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-push`,{title:`Push Dictionaries`,description:`Push local dictionaries to the server`,inputSchema:{deleteLocaleDictionary:d.boolean().optional().describe(`Delete local dictionary after push`),keepLocaleDictionary:d.boolean().optional().describe(`Keep local dictionary after push`),dictionaries:d.array(d.string()).optional().describe(`List of dictionaries to push`),gitOptions:d.object({gitDiff:d.boolean().optional(),gitDiffBase:d.string().optional(),gitDiffCurrent:d.string().optional(),uncommitted:d.boolean().optional(),unpushed:d.boolean().optional(),untracked:d.boolean().optional()}).optional().describe(`Git options`)},annotations:{destructiveHint:!0}},async e=>{try{let{gitOptions:t,...n}=e,r={...n,gitOptions:void 0};if(t){let{gitDiff:e,uncommitted:n,unpushed:i,untracked:a,...o}=t,s=[];e&&s.push(`gitDiff`),n&&s.push(`uncommitted`),i&&s.push(`unpushed`),a&&s.push(`untracked`),r.gitOptions={...o,mode:s}}return await l(r),{content:[{type:`text`,text:`Push successful.`}]}}catch(e){return{content:[{type:`text`,text:`Push failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-pull`,{title:`Pull Dictionaries`,description:`Pull dictionaries from the CMS`,inputSchema:{dictionaries:d.array(d.string()).optional().describe(`List of dictionaries to pull`),newDictionariesPath:d.string().optional().describe(`Path to save new dictionaries`)},annotations:{destructiveHint:!0}},async e=>{try{return await c(e),{content:[{type:`text`,text:`Pull successful.`}]}}catch(e){return{content:[{type:`text`,text:`Pull failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-content-list`,{title:`List Content Declarations`,description:`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.`,inputSchema:{configOptions:d.object({baseDir:d.string().optional(),env:d.string().optional(),envFile:d.string().optional(),override:d.object({log:d.object({prefix:d.string().optional(),verbose:d.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`),absolute:d.boolean().optional().describe(`Output the results as absolute paths instead of relative paths`),json:d.boolean().optional().describe(`Output the results as JSON instead of formatted text`)},annotations:{readOnlyHint:!0}},async e=>{try{let t=a(e);return{content:[{type:`text`,text:e.json?JSON.stringify(t):JSON.stringify(t,null,2)}]}}catch(e){return{content:[{type:`text`,text:`Content list failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-content-test`,{title:`Test Translations`,description:`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.`,inputSchema:{configOptions:d.object({baseDir:d.string().optional(),env:d.string().optional(),envFile:d.string().optional(),override:d.object({log:d.object({prefix:d.string().optional(),verbose:d.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`)},annotations:{readOnlyHint:!0}},async e=>{try{let t=o(e?.configOptions);return{content:[{type:`text`,text:JSON.stringify(t,null,2)}]}}catch(e){return{content:[{type:`text`,text:`Content test failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-extract`,{title:`Extract strings from Component`,description:`Extract strings from an existing component to be placed in a .content file close to the component. Trigger this action to make an existing component multilingual. If the component does not exist, create a normal component including text in JSX, and then trigger this tool to extract it.`,inputSchema:{file:d.union([d.string(),d.array(d.string())]).optional().describe(`List of files to extract`),outputContentDeclarations:d.string().optional().describe(`Path to output content declaration files`),configOptions:d.object({baseDir:d.string().optional(),env:d.string().optional(),envFile:d.string().optional(),override:d.object({log:d.object({prefix:d.string().optional(),verbose:d.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`)},annotations:{destructiveHint:!0}},async e=>{try{return await n({files:Array.isArray(e.file)?e.file:e.file?[e.file]:void 0,outputContentDeclarations:e.outputContentDeclarations,configOptions:e.configOptions}),{content:[{type:`text`,text:`Extract successful.`}]}}catch(e){return{content:[{type:`text`,text:`Extract failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}}),f.registerTool(`intlayer-projects-list`,{title:`List Projects`,description:`List all Intlayer projects in the directory. Search for configuration files to find all Intlayer projects.`,inputSchema:{baseDir:d.string().optional().describe(`Base directory to search from`),gitRoot:d.boolean().optional().describe(`Search from the git root directory instead of the base directory`),absolute:d.boolean().optional().describe(`Output the results as absolute paths instead of relative paths`),json:d.boolean().optional().describe(`Output the results as JSON instead of formatted text`)},annotations:{readOnlyHint:!0}},async t=>{try{let{searchDir:n,projectsPath:r}=await s({baseDir:t.baseDir,gitRoot:t.gitRoot}),i=r.map(r=>t.absolute?r:e(n,r)).map(e=>e===``?`.`:e),a=t.absolute?r:i;return{content:[{type:`text`,text:t.json?JSON.stringify(a):JSON.stringify({searchDir:n,projectsPath:a},null,2)}]}}catch(e){return{content:[{type:`text`,text:`Projects list failed: ${e instanceof Error?e.message:`An unknown error occurred`}`}]}}})};export{f as loadCLITools};
2
2
  //# sourceMappingURL=cli.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":[],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import { relative } from 'node:path';\nimport { listProjects } from '@intlayer/chokidar/cli';\nimport {\n build,\n extract,\n fill,\n init,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\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 absolute: z\n .boolean()\n .optional()\n .describe(\n 'Output the results as absolute paths instead of relative paths'\n ),\n json: z\n .boolean()\n .optional()\n .describe('Output the results as JSON instead of formatted text'),\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: props.json\n ? JSON.stringify(rows)\n : 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-extract',\n {\n title: 'Extract strings from Component',\n description:\n 'Extract strings from an existing component to be placed in a .content file close to the component. Trigger this action to make an existing component multilingual. If the component does not exist, create a normal component including text in JSX, and then trigger this tool to extract it.',\n inputSchema: {\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('List of files to extract'),\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 extract({\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: 'Extract 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: `Extract failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-projects-list',\n {\n title: 'List Projects',\n description:\n 'List all Intlayer projects in the directory. Search for configuration files to find all Intlayer projects.',\n inputSchema: {\n baseDir: z\n .string()\n .optional()\n .describe('Base directory to search from'),\n gitRoot: z\n .boolean()\n .optional()\n .describe(\n 'Search from the git root directory instead of the base directory'\n ),\n absolute: z\n .boolean()\n .optional()\n .describe(\n 'Output the results as absolute paths instead of relative paths'\n ),\n json: z\n .boolean()\n .optional()\n .describe('Output the results as JSON instead of formatted text'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const { searchDir, projectsPath } = await listProjects({\n baseDir: props.baseDir,\n gitRoot: props.gitRoot,\n });\n\n // Handle absolute option similar to CLI command\n const projectsRelativePath = projectsPath\n .map((projectPath) =>\n props.absolute ? projectPath : relative(searchDir, projectPath)\n )\n .map((projectPath) => (projectPath === '' ? '.' : projectPath));\n\n const outputPaths = props.absolute\n ? projectsPath\n : projectsRelativePath;\n\n return {\n content: [\n {\n type: 'text',\n text: props.json\n ? JSON.stringify(outputPaths)\n : JSON.stringify(\n { searchDir, projectsPath: outputPaths },\n null,\n 2\n ),\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: `Projects list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n};\n"],"mappings":"mTAkBA,MAAa,EAA6B,KAAO,IAAW,CAC1D,EAAO,aACL,gBACA,CACE,MAAO,sBACP,YAAa,qCACb,YAAa,CACX,YAAa,EAAE,QAAQ,CAAC,SAAS,yBAAyB,CAC3D,CACD,YAAa,CACX,gBAAiB,GAClB,CACF,CACD,MAAO,CAAE,iBAAkB,CACzB,GAAI,CAGF,OAFA,MAAM,EAAK,EAAY,CAEhB,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,6BACP,CACF,CACF,OACM,EAAO,CAGd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,0BALV,aAAiB,MAAQ,EAAM,QAAU,8BAMtC,CACF,CACF,GAGN,CAED,EAAO,aACL,iBACA,CACE,MAAO,qBACP,YACE,2JACF,YAAa,CACX,MAAO,EAAE,SAAS,CAAC,UAAU,CAAC,SAAS,oBAAoB,CAC3D,QAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iBAAiB,CACzD,IAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,cAAc,CAClD,QAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,mBAAmB,CAC3D,QAAS,EAAE,SAAS,CAAC,UAAU,CAAC,SAAS,iBAAiB,CAC1D,OAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,aAAa,CACrD,CACD,YAAa,CACX,gBAAiB,GAClB,CACF,CACD,MAAO,CAAE,QAAO,UAAS,MAAK,UAAS,UAAS,YAAa,CAC3D,GAAI,CACF,IAAM,EAA0B,EAAE,CAoBlC,OAnBI,IACF,EAAI,KAAO,WAET,IACF,EAAI,OAAS,GAGf,MAAM,EAAM,CACV,QACA,cAAe,CACb,UACA,M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K,CACZ,IAAA,GACN,0BAA2B,EAAM,0BACjC,cAAe,EAAM,cACtB,CAAC,CAEK,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,sBACP,CACF,CACF,OACM,EAAO,CAGd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,mBALV,aAAiB,MAAQ,EAAM,QAAU,8BAMtC,CACF,CACF,GAGN,CAED,EAAO,aACL,yBACA,CACE,MAAO,gBACP,YACE,6GACF,YAAa,CACX,QAAS,EACN,QAAQ,CACR,UAAU,CACV,SAAS,gCAAgC,CAC5C,QAAS,EACN,SAAS,CACT,UAAU,CACV,SACC,mEACD,CACH,SAAU,EACP,SAAS,CACT,UAAU,CACV,SACC,iEACD,CACH,KAAM,EACH,SAAS,CACT,UAAU,CACV,SAAS,uDAAuD,CACpE,CACD,YAAa,CACX,aAAc,GACf,CACF,CACD,KAAO,IAAU,CACf,GAAI,CACF,GAAM,CAAE,YAAW,gBAAiB,MAAM,EAAa,CACrD,QAAS,EAAM,QACf,QAAS,EAAM,QAChB,CAAC,CAGI,EAAuB,EAC1B,IAAK,GACJ,EAAM,SAAW,EAAc,EAAS,EAAW,EAAY,CAChE,CACA,IAAK,GAAiB,IAAgB,GAAK,IAAM,EAAa,CAE3D,EAAc,EAAM,SACtB,EACA,EAEJ,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,EAAM,KACR,KAAK,UAAU,EAAY,CAC3B,KAAK,UACH,CAAE,YAAW,aAAc,EAAa,CACxC,KACA,EACD,CACN,CACF,CACF,OACM,EAAO,CAGd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,yBALV,aAAiB,MAAQ,EAAM,QAAU,8BAMtC,CACF,CACF,GAGN"}
1
+ {"version":3,"file":"cli.mjs","names":[],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import { relative } from 'node:path';\nimport {\n build,\n extract,\n fill,\n init,\n listContentDeclarationRows,\n listMissingTranslations,\n listProjects,\n pull,\n push,\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 absolute: z\n .boolean()\n .optional()\n .describe(\n 'Output the results as absolute paths instead of relative paths'\n ),\n json: z\n .boolean()\n .optional()\n .describe('Output the results as JSON instead of formatted text'),\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: props.json\n ? JSON.stringify(rows)\n : 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-extract',\n {\n title: 'Extract strings from Component',\n description:\n 'Extract strings from an existing component to be placed in a .content file close to the component. Trigger this action to make an existing component multilingual. If the component does not exist, create a normal component including text in JSX, and then trigger this tool to extract it.',\n inputSchema: {\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('List of files to extract'),\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 extract({\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: 'Extract 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: `Extract failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-projects-list',\n {\n title: 'List Projects',\n description:\n 'List all Intlayer projects in the directory. Search for configuration files to find all Intlayer projects.',\n inputSchema: {\n baseDir: z\n .string()\n .optional()\n .describe('Base directory to search from'),\n gitRoot: z\n .boolean()\n .optional()\n .describe(\n 'Search from the git root directory instead of the base directory'\n ),\n absolute: z\n .boolean()\n .optional()\n .describe(\n 'Output the results as absolute paths instead of relative paths'\n ),\n json: z\n .boolean()\n .optional()\n .describe('Output the results as JSON instead of formatted text'),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const { searchDir, projectsPath } = await listProjects({\n baseDir: props.baseDir,\n gitRoot: props.gitRoot,\n });\n\n // Handle absolute option similar to CLI command\n const projectsRelativePath = projectsPath\n .map((projectPath) =>\n props.absolute ? projectPath : relative(searchDir, projectPath)\n )\n .map((projectPath) => (projectPath === '' ? '.' : projectPath));\n\n const outputPaths = props.absolute\n ? projectsPath\n : projectsRelativePath;\n\n return {\n content: [\n {\n type: 'text',\n text: props.json\n ? JSON.stringify(outputPaths)\n : JSON.stringify(\n { searchDir, projectsPath: outputPaths },\n null,\n 2\n ),\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: `Projects list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n};\n"],"mappings":"+QAkBA,MAAa,EAA6B,KAAO,IAAW,CAC1D,EAAO,aACL,gBACA,CACE,MAAO,sBACP,YAAa,qCACb,YAAa,CACX,YAAa,EAAE,QAAQ,CAAC,SAAS,yBAAyB,CAC3D,CACD,YAAa,CACX,gBAAiB,GAClB,CACF,CACD,MAAO,CAAE,iBAAkB,CACzB,GAAI,CAGF,OAFA,MAAM,EAAK,EAAY,CAEhB,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,6BACP,CACF,CACF,OACM,EAAO,CAGd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,0BALV,aAAiB,MAAQ,EAAM,QAAU,8BAMtC,CACF,CACF,GAGN,CAED,EAAO,aACL,iBACA,CACE,MAAO,qBACP,YACE,2JACF,YAAa,CACX,MAAO,EAAE,SAAS,CAAC,UAAU,CAAC,SAAS,oBAAoB,CAC3D,QAAS,EAAE,QAAQ,CAAC,UAAU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B,GAAK,IAAM,EAAa,CAE3D,EAAc,EAAM,SACtB,EACA,EAEJ,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,EAAM,KACR,KAAK,UAAU,EAAY,CAC3B,KAAK,UACH,CAAE,YAAW,aAAc,EAAa,CACxC,KACA,EACD,CACN,CACF,CACF,OACM,EAAO,CAGd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,yBALV,aAAiB,MAAQ,EAAM,QAAU,8BAMtC,CACF,CACF,GAGN"}
@@ -1,4 +1,4 @@
1
- import{SKILLS as e,installSkills as t}from"@intlayer/chokidar/cli";import*as n from"node:readline";import r from"zod";const i=n=>{n.registerTool(`intlayer-install-skills`,{title:`Install Intlayer Skills`,description:`Install Intlayer documentation and skills to the project to assist AI agents. Ask the user for the platform (Cursor, VSCode, OpenCode, Claude, etc.) and which skills they want to install before calling this tool.`,inputSchema:{platform:r.enum(`Cursor.Windsurf.Trae.OpenCode.GitHub.Claude.VSCode.Antigravity.Augment.OpenClaw.Cline.CodeBuddy.CommandCode.Continue.Crush.Droid.Goose.Junie.IFlow.KiloCode.Kiro.Kode.MCPJam.MistralVibe.Mux.OpenHands.Pi.Qoder.Qwen.RooCode.TraeCN.Zencoder.Neovate.Pochi.Other`.split(`.`)).describe(`The platform to install skills for`),skills:r.array(r.enum(e)).describe(`List of skills to install`),projectRoot:r.string().optional().describe(`Root directory of the project. Defaults to current directory.`)}},async({platform:e,skills:n,projectRoot:r})=>{try{return{content:[{type:`text`,text:await t(r||process.cwd(),e,n)}]}}catch(e){return{content:[{type:`text`,text:`Failed to install skills: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}})},a=async()=>{let r=n.createInterface({input:process.stdin,output:process.stdout}),i=e=>new Promise(t=>r.question(e,t));try{console.log(`Install Intlayer Skills`),console.log(`-----------------------`);let n=await i(`Which platform are you using? (Cursor, Windsurf, Trae, OpenCode, GitHub, Claude, VSCode, Cline, RooCode, etc. or "Other"): `),a=`Cursor.Windsurf.Trae.OpenCode.GitHub.Claude.VSCode.Antigravity.Augment.OpenClaw.Cline.CodeBuddy.CommandCode.Continue.Crush.Droid.Goose.Junie.IFlow.KiloCode.Kiro.Kode.MCPJam.MistralVibe.Mux.OpenHands.Pi.Qoder.Qwen.RooCode.TraeCN.Zencoder.Neovate.Pochi.Other`.split(`.`).find(e=>e.toLowerCase()===n.trim().toLowerCase())||`Other`;console.log(`Selected platform: ${a}`);let o=e;console.log(`
1
+ import{SKILLS as e,installSkills as t}from"@intlayer/cli";import*as n from"node:readline";import r from"zod";const i=n=>{n.registerTool(`intlayer-install-skills`,{title:`Install Intlayer Skills`,description:`Install Intlayer documentation and skills to the project to assist AI agents. Ask the user for the platform (Cursor, VSCode, OpenCode, Claude, etc.) and which skills they want to install before calling this tool.`,inputSchema:{platform:r.enum(`Cursor.Windsurf.Trae.OpenCode.GitHub.Claude.VSCode.Antigravity.Augment.OpenClaw.Cline.CodeBuddy.CommandCode.Continue.Crush.Droid.Goose.Junie.IFlow.KiloCode.Kiro.Kode.MCPJam.MistralVibe.Mux.OpenHands.Pi.Qoder.Qwen.RooCode.TraeCN.Zencoder.Neovate.Pochi.Other`.split(`.`)).describe(`The platform to install skills for`),skills:r.array(r.enum(e)).describe(`List of skills to install`),projectRoot:r.string().optional().describe(`Root directory of the project. Defaults to current directory.`)}},async({platform:e,skills:n,projectRoot:r})=>{try{return{content:[{type:`text`,text:await t(r||process.cwd(),e,n)}]}}catch(e){return{content:[{type:`text`,text:`Failed to install skills: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}})},a=async()=>{let r=n.createInterface({input:process.stdin,output:process.stdout}),i=e=>new Promise(t=>r.question(e,t));try{console.log(`Install Intlayer Skills`),console.log(`-----------------------`);let n=await i(`Which platform are you using? (Cursor, Windsurf, Trae, OpenCode, GitHub, Claude, VSCode, Cline, RooCode, etc. or "Other"): `),a=`Cursor.Windsurf.Trae.OpenCode.GitHub.Claude.VSCode.Antigravity.Augment.OpenClaw.Cline.CodeBuddy.CommandCode.Continue.Crush.Droid.Goose.Junie.IFlow.KiloCode.Kiro.Kode.MCPJam.MistralVibe.Mux.OpenHands.Pi.Qoder.Qwen.RooCode.TraeCN.Zencoder.Neovate.Pochi.Other`.split(`.`).find(e=>e.toLowerCase()===n.trim().toLowerCase())||`Other`;console.log(`Selected platform: ${a}`);let o=e;console.log(`
2
2
  Available skills:`),o.forEach((e,t)=>{console.log(`${t+1}. ${e}`)});let s=await i(`
3
- Which skills do you want to install? (comma separated numbers, e.g. 1,2,3 or "all"): `),c=[];if(c=s.trim().toLowerCase()===`all`?[...o]:s.split(`,`).map(e=>parseInt(e.trim())-1).filter(e=>!isNaN(e)&&e>=0&&e<o.length).map(e=>o[e]),c.length===0){console.log(`No valid skills selected. Exiting.`),r.close();return}console.log(`Installing skills: ${c.join(`, `)}...`);let l=await t(process.cwd(),a,c);console.log(l)}catch(e){console.error(`Error:`,e)}finally{r.close()}};export{i as loadInstallSkillsTool,a as runInstallSkillsCLI};
3
+ Which skills do you want to install? (comma separated numbers, e.g. 1,2,3 or "all"): `),c=[];if(c=s.trim().toLowerCase()===`all`?[...o]:s.split(`,`).map(e=>parseInt(e.trim(),10)-1).filter(e=>!Number.isNaN(e)&&e>=0&&e<o.length).map(e=>o[e]),c.length===0){console.log(`No valid skills selected. Exiting.`),r.close();return}console.log(`Installing skills: ${c.join(`, `)}...`);let l=await t(process.cwd(),a,c);console.log(l)}catch(e){console.error(`Error:`,e)}finally{r.close()}};export{i as loadInstallSkillsTool,a as runInstallSkillsCLI};
4
4
  //# sourceMappingURL=installSkills.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"installSkills.mjs","names":[],"sources":["../../../src/tools/installSkills.ts"],"sourcesContent":["import * as readline from 'node:readline';\nimport { installSkills, SKILLS, type Skill } from '@intlayer/chokidar/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\n\nexport const loadInstallSkillsTool = (server: McpServer): void => {\n server.registerTool(\n 'intlayer-install-skills',\n {\n title: 'Install Intlayer Skills',\n description:\n 'Install Intlayer documentation and skills to the project to assist AI agents. Ask the user for the platform (Cursor, VSCode, OpenCode, Claude, etc.) and which skills they want to install before calling this tool.',\n inputSchema: {\n platform: z\n .enum([\n 'Cursor',\n 'Windsurf',\n 'Trae',\n 'OpenCode',\n 'GitHub',\n 'Claude',\n 'VSCode',\n 'Antigravity',\n 'Augment',\n 'OpenClaw',\n 'Cline',\n 'CodeBuddy',\n 'CommandCode',\n 'Continue',\n 'Crush',\n 'Droid',\n 'Goose',\n 'Junie',\n 'IFlow',\n 'KiloCode',\n 'Kiro',\n 'Kode',\n 'MCPJam',\n 'MistralVibe',\n 'Mux',\n 'OpenHands',\n 'Pi',\n 'Qoder',\n 'Qwen',\n 'RooCode',\n 'TraeCN',\n 'Zencoder',\n 'Neovate',\n 'Pochi',\n 'Other',\n ])\n .describe('The platform to install skills for'),\n skills: z.array(z.enum(SKILLS)).describe('List of skills to install'),\n projectRoot: z\n .string()\n .optional()\n .describe(\n 'Root directory of the project. Defaults to current directory.'\n ),\n },\n },\n async ({ platform, skills, projectRoot }) => {\n try {\n const root = projectRoot || process.cwd();\n const message = await installSkills(\n root,\n platform as any,\n skills as any\n );\n\n return {\n content: [\n {\n type: 'text',\n text: message,\n },\n ],\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text',\n text: `Failed to install skills: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n }\n );\n};\n\nexport const runInstallSkillsCLI = async (): Promise<void> => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n const question = (query: string): Promise<string> =>\n new Promise((resolve) => rl.question(query, resolve));\n\n try {\n console.log('Install Intlayer Skills');\n console.log('-----------------------');\n\n const platformInput = await question(\n 'Which platform are you using? (Cursor, Windsurf, Trae, OpenCode, GitHub, Claude, VSCode, Cline, RooCode, etc. or \"Other\"): '\n );\n const platform = ([\n 'Cursor',\n 'Windsurf',\n 'Trae',\n 'OpenCode',\n 'GitHub',\n 'Claude',\n 'VSCode',\n 'Antigravity',\n 'Augment',\n 'OpenClaw',\n 'Cline',\n 'CodeBuddy',\n 'CommandCode',\n 'Continue',\n 'Crush',\n 'Droid',\n 'Goose',\n 'Junie',\n 'IFlow',\n 'KiloCode',\n 'Kiro',\n 'Kode',\n 'MCPJam',\n 'MistralVibe',\n 'Mux',\n 'OpenHands',\n 'Pi',\n 'Qoder',\n 'Qwen',\n 'RooCode',\n 'TraeCN',\n 'Zencoder',\n 'Neovate',\n 'Pochi',\n 'Other',\n ].find((p) => p.toLowerCase() === platformInput.trim().toLowerCase()) ||\n 'Other') as\n | 'Cursor'\n | 'Windsurf'\n | 'Trae'\n | 'OpenCode'\n | 'GitHub'\n | 'Claude'\n | 'VSCode'\n | 'Antigravity'\n | 'Augment'\n | 'OpenClaw'\n | 'Cline'\n | 'CodeBuddy'\n | 'CommandCode'\n | 'Continue'\n | 'Crush'\n | 'Droid'\n | 'Goose'\n | 'Junie'\n | 'IFlow'\n | 'KiloCode'\n | 'Kiro'\n | 'Kode'\n | 'MCPJam'\n | 'MistralVibe'\n | 'Mux'\n | 'OpenHands'\n | 'Pi'\n | 'Qoder'\n | 'Qwen'\n | 'RooCode'\n | 'TraeCN'\n | 'Zencoder'\n | 'Neovate'\n | 'Pochi'\n | 'Other';\n\n console.log(`Selected platform: ${platform}`);\n\n const availableSkills = SKILLS;\n console.log('\\nAvailable skills:');\n availableSkills.forEach((s, i) => {\n console.log(`${i + 1}. ${s}`);\n });\n\n const skillsInput = await question(\n '\\nWhich skills do you want to install? (comma separated numbers, e.g. 1,2,3 or \"all\"): '\n );\n\n let selectedSkills: Skill[] = [];\n if (skillsInput.trim().toLowerCase() === 'all') {\n selectedSkills = [...availableSkills];\n } else {\n const indices = skillsInput\n .split(',')\n .map((s) => parseInt(s.trim()) - 1)\n .filter((i) => !isNaN(i) && i >= 0 && i < availableSkills.length);\n selectedSkills = indices.map((i) => availableSkills[i] as any);\n }\n\n if (selectedSkills.length === 0) {\n console.log('No valid skills selected. Exiting.');\n rl.close();\n return;\n }\n\n console.log(`Installing skills: ${selectedSkills.join(', ')}...`);\n const result = await installSkills(process.cwd(), platform, selectedSkills);\n console.log(result);\n } catch (error) {\n console.error('Error:', error);\n } finally {\n rl.close();\n }\n};\n"],"mappings":"sHAKA,MAAa,EAAyB,GAA4B,CAChE,EAAO,aACL,0BACA,CACE,MAAO,0BACP,YACE,uNACF,YAAa,CACX,SAAU,EACP,KAAK,6QAoCL,CAAC,CACD,SAAS,qCAAqC,CACjD,OAAQ,EAAE,MAAM,EAAE,KAAK,EAAO,CAAC,CAAC,SAAS,4BAA4B,CACrE,YAAa,EACV,QAAQ,CACR,UAAU,CACV,SACC,gEACD,CACJ,CACF,CACD,MAAO,CAAE,WAAU,SAAQ,iBAAkB,CAC3C,GAAI,CAQF,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAVU,MAAM,EADT,GAAe,QAAQ,KAAK,CAGvC,EACA,EACD,CAOI,CACF,CACF,OACM,EAAO,CACd,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KAAM,6BAA6B,aAAiB,MAAQ,EAAM,QAAU,OAAO,EAAM,GAC1F,CACF,CACD,QAAS,GACV,GAGN,EAGU,EAAsB,SAA2B,CAC5D,IAAM,EAAK,EAAS,gBAAgB,CAClC,MAAO,QAAQ,MACf,OAAQ,QAAQ,OACjB,CAAC,CAEI,EAAY,GAChB,IAAI,QAAS,GAAY,EAAG,SAAS,EAAO,EAAQ,CAAC,CAEvD,GAAI,CACF,QAAQ,IAAI,0BAA0B,CACtC,QAAQ,IAAI,0BAA0B,CAEtC,IAAM,EAAgB,MAAM,EAC1B,8HACD,CACK,EAAY,6QAoCjB,CAAC,KAAM,GAAM,EAAE,aAAa,GAAK,EAAc,MAAM,CAAC,aAAa,CAAC,EACnE,QAqCF,QAAQ,IAAI,sBAAsB,IAAW,CAE7C,IAAM,EAAkB,EACxB,QAAQ,IAAI;mBAAsB,CAClC,EAAgB,SAAS,EAAG,IAAM,CAChC,QAAQ,IAAI,GAAG,EAAI,EAAE,IAAI,IAAI,EAC7B,CAEF,IAAM,EAAc,MAAM,EACxB;uFACD,CAEG,EAA0B,EAAE,CAWhC,GAVA,AAOE,EAPE,EAAY,MAAM,CAAC,aAAa,GAAK,MACtB,CAAC,GAAG,EAAgB,CAErB,EACb,MAAM,IAAI,CACV,IAAK,GAAM,SAAS,EAAE,MAAM,CAAC,CAAG,EAAE,CAClC,OAAQ,GAAM,CAAC,MAAM,EAAE,EAAI,GAAK,GAAK,EAAI,EAAgB,OAAO,CAC1C,IAAK,GAAM,EAAgB,GAAU,CAG5D,EAAe,SAAW,EAAG,CAC/B,QAAQ,IAAI,qCAAqC,CACjD,EAAG,OAAO,CACV,OAGF,QAAQ,IAAI,sBAAsB,EAAe,KAAK,KAAK,CAAC,KAAK,CACjE,IAAM,EAAS,MAAM,EAAc,QAAQ,KAAK,CAAE,EAAU,EAAe,CAC3E,QAAQ,IAAI,EAAO,OACZ,EAAO,CACd,QAAQ,MAAM,SAAU,EAAM,QACtB,CACR,EAAG,OAAO"}
1
+ {"version":3,"file":"installSkills.mjs","names":[],"sources":["../../../src/tools/installSkills.ts"],"sourcesContent":["import * as readline from 'node:readline';\nimport { installSkills, SKILLS, type Skill } from '@intlayer/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\n\nexport const loadInstallSkillsTool = (server: McpServer): void => {\n server.registerTool(\n 'intlayer-install-skills',\n {\n title: 'Install Intlayer Skills',\n description:\n 'Install Intlayer documentation and skills to the project to assist AI agents. Ask the user for the platform (Cursor, VSCode, OpenCode, Claude, etc.) and which skills they want to install before calling this tool.',\n inputSchema: {\n platform: z\n .enum([\n 'Cursor',\n 'Windsurf',\n 'Trae',\n 'OpenCode',\n 'GitHub',\n 'Claude',\n 'VSCode',\n 'Antigravity',\n 'Augment',\n 'OpenClaw',\n 'Cline',\n 'CodeBuddy',\n 'CommandCode',\n 'Continue',\n 'Crush',\n 'Droid',\n 'Goose',\n 'Junie',\n 'IFlow',\n 'KiloCode',\n 'Kiro',\n 'Kode',\n 'MCPJam',\n 'MistralVibe',\n 'Mux',\n 'OpenHands',\n 'Pi',\n 'Qoder',\n 'Qwen',\n 'RooCode',\n 'TraeCN',\n 'Zencoder',\n 'Neovate',\n 'Pochi',\n 'Other',\n ])\n .describe('The platform to install skills for'),\n skills: z.array(z.enum(SKILLS)).describe('List of skills to install'),\n projectRoot: z\n .string()\n .optional()\n .describe(\n 'Root directory of the project. Defaults to current directory.'\n ),\n },\n },\n async ({ platform, skills, projectRoot }) => {\n try {\n const root = projectRoot || process.cwd();\n const message = await installSkills(\n root,\n platform as any,\n skills as any\n );\n\n return {\n content: [\n {\n type: 'text',\n text: message,\n },\n ],\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text',\n text: `Failed to install skills: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n }\n );\n};\n\nexport const runInstallSkillsCLI = async (): Promise<void> => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n const question = (query: string): Promise<string> =>\n new Promise((resolve) => rl.question(query, resolve));\n\n try {\n console.log('Install Intlayer Skills');\n console.log('-----------------------');\n\n const platformInput = await question(\n 'Which platform are you using? (Cursor, Windsurf, Trae, OpenCode, GitHub, Claude, VSCode, Cline, RooCode, etc. or \"Other\"): '\n );\n const platform = ([\n 'Cursor',\n 'Windsurf',\n 'Trae',\n 'OpenCode',\n 'GitHub',\n 'Claude',\n 'VSCode',\n 'Antigravity',\n 'Augment',\n 'OpenClaw',\n 'Cline',\n 'CodeBuddy',\n 'CommandCode',\n 'Continue',\n 'Crush',\n 'Droid',\n 'Goose',\n 'Junie',\n 'IFlow',\n 'KiloCode',\n 'Kiro',\n 'Kode',\n 'MCPJam',\n 'MistralVibe',\n 'Mux',\n 'OpenHands',\n 'Pi',\n 'Qoder',\n 'Qwen',\n 'RooCode',\n 'TraeCN',\n 'Zencoder',\n 'Neovate',\n 'Pochi',\n 'Other',\n ].find((p) => p.toLowerCase() === platformInput.trim().toLowerCase()) ||\n 'Other') as\n | 'Cursor'\n | 'Windsurf'\n | 'Trae'\n | 'OpenCode'\n | 'GitHub'\n | 'Claude'\n | 'VSCode'\n | 'Antigravity'\n | 'Augment'\n | 'OpenClaw'\n | 'Cline'\n | 'CodeBuddy'\n | 'CommandCode'\n | 'Continue'\n | 'Crush'\n | 'Droid'\n | 'Goose'\n | 'Junie'\n | 'IFlow'\n | 'KiloCode'\n | 'Kiro'\n | 'Kode'\n | 'MCPJam'\n | 'MistralVibe'\n | 'Mux'\n | 'OpenHands'\n | 'Pi'\n | 'Qoder'\n | 'Qwen'\n | 'RooCode'\n | 'TraeCN'\n | 'Zencoder'\n | 'Neovate'\n | 'Pochi'\n | 'Other';\n\n console.log(`Selected platform: ${platform}`);\n\n const availableSkills = SKILLS;\n console.log('\\nAvailable skills:');\n availableSkills.forEach((s, i) => {\n console.log(`${i + 1}. ${s}`);\n });\n\n const skillsInput = await question(\n '\\nWhich skills do you want to install? (comma separated numbers, e.g. 1,2,3 or \"all\"): '\n );\n\n let selectedSkills: Skill[] = [];\n if (skillsInput.trim().toLowerCase() === 'all') {\n selectedSkills = [...availableSkills];\n } else {\n const indices = skillsInput\n .split(',')\n .map((s) => parseInt(s.trim(), 10) - 1)\n .filter(\n (s) => !Number.isNaN(s) && s >= 0 && s < availableSkills.length\n );\n selectedSkills = indices.map((i) => availableSkills[i] as any);\n }\n\n if (selectedSkills.length === 0) {\n console.log('No valid skills selected. Exiting.');\n rl.close();\n return;\n }\n\n console.log(`Installing skills: ${selectedSkills.join(', ')}...`);\n const result = await installSkills(process.cwd(), platform, selectedSkills);\n console.log(result);\n } catch (error) {\n console.error('Error:', error);\n } finally {\n rl.close();\n }\n};\n"],"mappings":"6GAKA,MAAa,EAAyB,GAA4B,CAChE,EAAO,aACL,0BACA,CACE,MAAO,0BACP,YACE,u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,CAAE,GAAG,CAAG,EAAE,CACtC,OACE,GAAM,CAAC,OAAO,MAAM,EAAE,EAAI,GAAK,GAAK,EAAI,EAAgB,OAC1D,CACsB,IAAK,GAAM,EAAgB,GAAU,CAG5D,EAAe,SAAW,EAAG,CAC/B,QAAQ,IAAI,qCAAqC,CACjD,EAAG,OAAO,CACV,OAGF,QAAQ,IAAI,sBAAsB,EAAe,KAAK,KAAK,CAAC,KAAK,CACjE,IAAM,EAAS,MAAM,EAAc,QAAQ,KAAK,CAAE,EAAU,EAAe,CAC3E,QAAQ,IAAI,EAAO,OACZ,EAAO,CACd,QAAQ,MAAM,SAAU,EAAM,QACtB,CACR,EAAG,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/mcp",
3
- "version": "8.1.6",
3
+ "version": "8.1.8",
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": [
@@ -67,7 +67,6 @@
67
67
  "./package.json"
68
68
  ],
69
69
  "scripts": {
70
- "_prepublish": "cp -f ../../../README.md ./README.md",
71
70
  "build": "tsdown --config tsdown.config.ts",
72
71
  "build:ci": "tsdown --config tsdown.config.ts",
73
72
  "clean": "rimraf ./dist .turbo",
@@ -80,7 +79,7 @@
80
79
  "manange:permissions:cjs": "node -e \"require('fs').chmodSync('dist/cjs/server/stdio.cjs', 0o755); require('fs').chmodSync('dist/cjs/server/sse.cjs', 0o755)\"",
81
80
  "manange:permissions:mjs": "node -e \"require('fs').chmodSync('dist/esm/server/stdio.mjs', 0o755); require('fs').chmodSync('dist/esm/server/sse.mjs', 0o755)\"",
82
81
  "process-files": "ts-node src/transpiler/processFilesCLI.ts --dir $npm_config_dir --extension $npm_config_extension --no-node-snapshot",
83
- "prepublish": "echo prepublish temporally disabled to avoid rewrite readme",
82
+ "prepublish": "cp -f ../../../README.md ./README.md",
84
83
  "publish": "bun publish || true",
85
84
  "publish:canary": "bun publish --access public --tag canary || true",
86
85
  "publish:latest": "bun publish --access public --tag latest || true",
@@ -96,19 +95,18 @@
96
95
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
97
96
  },
98
97
  "dependencies": {
99
- "@intlayer/api": "8.1.6",
100
- "@intlayer/chokidar": "8.1.6",
101
- "@intlayer/cli": "8.1.6",
102
- "@intlayer/config": "8.1.6",
103
- "@intlayer/docs": "8.1.6",
104
- "@intlayer/types": "8.1.6",
98
+ "@intlayer/api": "8.1.8",
99
+ "@intlayer/cli": "8.1.8",
100
+ "@intlayer/config": "8.1.8",
101
+ "@intlayer/docs": "8.1.8",
102
+ "@intlayer/types": "8.1.8",
105
103
  "@modelcontextprotocol/sdk": "1.25.3",
106
104
  "dotenv": "17.3.1",
107
105
  "express": "5.2.1",
108
106
  "zod": "4.3.6"
109
107
  },
110
108
  "devDependencies": {
111
- "@intlayer/types": "8.1.6",
109
+ "@intlayer/types": "8.1.8",
112
110
  "@modelcontextprotocol/inspector": "0.19.0",
113
111
  "@types/express": "5.0.6",
114
112
  "@types/node": "25.3.0",