@intlayer/mcp 8.4.0-canary.0 → 8.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/cli-C5nRaDjk.mjs +2 -0
- package/dist/esm/cli-C5nRaDjk.mjs.map +1 -0
- package/dist/esm/client/client.mjs +1 -1
- package/dist/esm/installSkills-Bzx_k5dj.mjs +21 -0
- package/dist/esm/installSkills-Bzx_k5dj.mjs.map +1 -0
- package/dist/esm/server/server.mjs +1 -1
- package/dist/esm/server/server.mjs.map +1 -1
- package/dist/esm/tools/cli.mjs +1 -2
- package/dist/esm/tools/installSkills.mjs +1 -4
- package/package.json +7 -7
- package/dist/esm/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs +0 -3
- package/dist/esm/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs.map +0 -1
- package/dist/esm/packages/@intlayer/chokidar/dist/esm/installSkills/index.mjs +0 -2
- package/dist/esm/packages/@intlayer/chokidar/dist/esm/installSkills/index.mjs.map +0 -1
- package/dist/esm/packages/@intlayer/chokidar/dist/esm/listProjects.mjs +0 -2
- package/dist/esm/packages/@intlayer/chokidar/dist/esm/listProjects.mjs.map +0 -1
- package/dist/esm/packages/@intlayer/core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +0 -3
- package/dist/esm/packages/@intlayer/core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +0 -1
- package/dist/esm/packages/@intlayer/core/dist/esm/utils/parseYaml.mjs +0 -17
- package/dist/esm/packages/@intlayer/core/dist/esm/utils/parseYaml.mjs.map +0 -1
- package/dist/esm/tools/cli.mjs.map +0 -1
- package/dist/esm/tools/installSkills.mjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{dirname as e,relative as t}from"node:path";import n from"/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/index.js";import{configurationFilesCandidates as r}from"@intlayer/config/node";import i from"/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/simple-git@3.32.3/node_modules/simple-git/dist/esm/index.js";import{build as a,extract as o,fill as s,init as c,listContentDeclarationRows as l,listMissingTranslations as u,pull as d,push as f}from"@intlayer/cli";import{ALL_LOCALES as p}from"@intlayer/types/allLocales";import m from"zod";const h=async e=>{try{return(await(e?i(e):i()).revparse([`--show-toplevel`])).trim()}catch{return null}},g=async t=>{let i=t?.baseDir??process.cwd();if(t?.gitRoot){let e=await h(i);e&&(i=e)}let a=await n(r.map(e=>`**/${e}`),{cwd:i,absolute:!0,ignore:[`**/node_modules/**`,`**/.git/**`],dot:!0}),o=[...new Set(a.map(t=>e(t)))];return{searchDir:i,projectsPath:o.sort()}},_=async e=>{e.registerTool(`intlayer-init`,{title:`Initialize Intlayer`,description:`Initialize Intlayer in the project`,inputSchema:{projectRoot:m.string().describe(`Project root directory`)},annotations:{destructiveHint:!0}},async({projectRoot:e})=>{try{return await c(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:m.boolean().optional().describe(`Watch for changes`),baseDir:m.string().optional().describe(`Base directory`),env:m.string().optional().describe(`Environment`),envFile:m.string().optional().describe(`Environment file`),verbose:m.boolean().optional().describe(`Verbose output`),prefix:m.string().optional().describe(`Log prefix`)},annotations:{destructiveHint:!0}},async({watch:e,baseDir:t,env:n,envFile:r,verbose:i,prefix:o})=>{try{let s={};return i&&(s.mode=`verbose`),o&&(s.prefix=o),await a({watch:e,configOptions:{baseDir:t,env:n,envFile:r,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:m.nativeEnum(p).optional().describe(`Source locale`),outputLocales:m.union([m.nativeEnum(p),m.array(m.nativeEnum(p))]).optional().describe(`Output locales`),file:m.union([m.string(),m.array(m.string())]).optional().describe(`File path`),mode:m.enum([`complete`,`review`]).optional().describe(`Fill mode`),keys:m.union([m.string(),m.array(m.string())]).optional().describe(`Keys to include`),excludedKeys:m.union([m.string(),m.array(m.string())]).optional().describe(`Keys to exclude`),pathFilter:m.union([m.string(),m.array(m.string())]).optional().describe(`Path filter`),gitOptions:m.object({gitDiff:m.boolean().optional(),gitDiffBase:m.string().optional(),gitDiffCurrent:m.string().optional(),uncommitted:m.boolean().optional(),unpushed:m.boolean().optional(),untracked:m.boolean().optional()}).optional().describe(`Git options`),aiOptions:m.object({provider:m.string().optional(),temperature:m.number().optional(),model:m.string().optional(),apiKey:m.string().optional(),customPrompt:m.string().optional(),applicationContext:m.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 s(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`}`}]}}}),e.registerTool(`intlayer-push`,{title:`Push Dictionaries`,description:`Push local dictionaries to the server`,inputSchema:{deleteLocaleDictionary:m.boolean().optional().describe(`Delete local dictionary after push`),keepLocaleDictionary:m.boolean().optional().describe(`Keep local dictionary after push`),dictionaries:m.array(m.string()).optional().describe(`List of dictionaries to push`),gitOptions:m.object({gitDiff:m.boolean().optional(),gitDiffBase:m.string().optional(),gitDiffCurrent:m.string().optional(),uncommitted:m.boolean().optional(),unpushed:m.boolean().optional(),untracked:m.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 f(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`}`}]}}}),e.registerTool(`intlayer-pull`,{title:`Pull Dictionaries`,description:`Pull dictionaries from the CMS`,inputSchema:{dictionaries:m.array(m.string()).optional().describe(`List of dictionaries to pull`),newDictionariesPath:m.string().optional().describe(`Path to save new dictionaries`)},annotations:{destructiveHint:!0}},async e=>{try{return await d(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:m.object({baseDir:m.string().optional(),env:m.string().optional(),envFile:m.string().optional(),override:m.object({log:m.object({prefix:m.string().optional(),verbose:m.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`),absolute:m.boolean().optional().describe(`Output the results as absolute paths instead of relative paths`),json:m.boolean().optional().describe(`Output the results as JSON instead of formatted text`)},annotations:{readOnlyHint:!0}},async e=>{try{let t=l(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:m.object({baseDir:m.string().optional(),env:m.string().optional(),envFile:m.string().optional(),override:m.object({log:m.object({prefix:m.string().optional(),verbose:m.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`)},annotations:{readOnlyHint:!0}},async e=>{try{let t=u(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:m.union([m.string(),m.array(m.string())]).optional().describe(`List of files to extract`),outputContentDeclarations:m.string().optional().describe(`Path to output content declaration files`),configOptions:m.object({baseDir:m.string().optional(),env:m.string().optional(),envFile:m.string().optional(),override:m.object({log:m.object({prefix:m.string().optional(),verbose:m.boolean().optional()}).optional()}).optional()}).optional().describe(`Configuration options`)},annotations:{destructiveHint:!0}},async e=>{try{return await o({files:Array.isArray(e.file)?e.file:e.file?[e.file]:void 0,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:m.string().optional().describe(`Base directory to search from`),gitRoot:m.boolean().optional().describe(`Search from the git root directory instead of the base directory`),absolute:m.boolean().optional().describe(`Output the results as absolute paths instead of relative paths`),json:m.boolean().optional().describe(`Output the results as JSON instead of formatted text`)},annotations:{readOnlyHint:!0}},async e=>{try{let{searchDir:n,projectsPath:r}=await g({baseDir:e.baseDir,gitRoot:e.gitRoot}),i=r.map(r=>e.absolute?r:t(n,r)).map(e=>e===``?`.`:e),a=e.absolute?r:i;return{content:[{type:`text`,text:e.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{_ as t};
|
|
2
|
+
//# sourceMappingURL=cli-C5nRaDjk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-C5nRaDjk.mjs","names":["t","n","e","listProjects"],"sources":["../../../chokidar/dist/esm/listProjects.mjs","../../src/tools/cli.ts"],"sourcesContent":["import{dirname as e}from\"node:path\";import t from\"fast-glob\";import{configurationFilesCandidates as n}from\"@intlayer/config/node\";import r from\"simple-git\";const i=async e=>{try{return(await(e?r(e):r()).revparse([`--show-toplevel`])).trim()}catch{return null}},a=async r=>{let a=r?.baseDir??process.cwd();if(r?.gitRoot){let e=await i(a);e&&(a=e)}let o=await t(n.map(e=>`**/${e}`),{cwd:a,absolute:!0,ignore:[`**/node_modules/**`,`**/.git/**`],dot:!0}),s=[...new Set(o.map(t=>e(t)))];return{searchDir:a,projectsPath:s.sort()}};export{a as listProjects};\n//# sourceMappingURL=listProjects.mjs.map","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 { ALL_LOCALES } from '@intlayer/types/allLocales';\nimport type { LogConfig } from '@intlayer/types/config';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\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(ALL_LOCALES)\n .optional()\n .describe('Source locale'),\n outputLocales: z\n .union([\n z.nativeEnum(ALL_LOCALES),\n z.array(z.nativeEnum(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 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":"+lBAA4J,MAAM,EAAE,KAAM,IAAG,CAAC,GAAG,CAAC,OAAO,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAAE,MAAM,MAAM,CAAC,OAAO,OAAO,EAAE,KAAM,IAAG,CAAC,IAAI,EAAE,GAAG,SAAS,QAAQ,KAAK,CAAC,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,MAAMA,EAAEC,EAAE,IAAI,GAAG,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,qBAAqB,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,EAAE,IAAI,GAAGC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,CAAC,ECmB9f,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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gBAAiB,MAAMC,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,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
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
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{existsSync as e,promises as t,readFileSync as n}from"node:fs";import r,{basename as i,dirname as a,join as o,relative as s,resolve as c,sep as l}from"node:path";import{fileURLToPath as u}from"node:url";import{v as d}from"@intlayer/config/logger";import f from"zod";import*as p from"node:readline";const m=()=>{try{return a(u(import.meta.url))}catch{return typeof __dirname<`u`?__dirname:process.cwd()}},h=e=>{let t=e;for(let e=0;e<12;e++){if(i(t)===`dist`)return t;let e=c(t,`..`);if(e===t)break;t=e}return null},g=e=>{if(!e)return null;try{if(e.startsWith(`file://`))return u(e)}catch{}return e},_=()=>{let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error();Error.captureStackTrace(e,_);let t=e.stack||[],n=e=>e.includes(`${l}_virtual${l}`)||e.includes(`/_virtual/`);for(let e of t){let t=g(typeof e.getFileName==`function`?e.getFileName():null);if(t&&!(t.includes(`node:internal`)||t.includes(`${l}internal${l}modules${l}`))&&!n(t))return a(t)}for(let e of t){let t=g(typeof e.getFileName==`function`?e.getFileName():null);if(t)return a(t)}}catch{}finally{Error.prepareStackTrace=e}return m()},v=(t,r=`utf8`)=>{let i=m(),a=h(i)??c(i,`..`,`..`,`dist`),l=o(a,`assets`),u=[],d=s(a,_()).split(`\\`).join(`/`).replace(/^(?:dist\/)?(?:esm|cjs)\//,``).replace(/^_virtual\//,``);if(t.startsWith(`./`)||t.startsWith(`../`)){let i=c(l,d,t);if(u.push(i),e(i))return n(i,r)}let f=o(l,t);if(u.push(f),e(f))return n(f,r);if(d){let i=o(l,d,t);if(u.push(i),e(i))return n(i,r)}let p=[`readAsset: file not found.`,`Searched:`,...u.map(e=>`- ${e}`)].join(`
|
|
2
|
+
`);throw Error(p)},y=e=>{let t=e.trim();if(!t)return null;let n=0,r=e=>e===` `||e===`
|
|
3
|
+
`||e===` `||e===`\r`,i=()=>t[n],a=()=>t[n++],o=()=>n>=t.length,s=()=>{for(;!o()&&r(i());)n++},c=e=>{a();let t=``;for(;!o();){let n=a();if(n===e)return t;if(n===`\\`&&!o()){let e=a();t+=e}else t+=n}throw SyntaxError(`Unterminated string`)},l=(e,t)=>!!e&&t.includes(e),u=e=>{let t=``;for(;!o()&&!l(i(),e);)t+=a();return t.trim()},d=e=>e===`true`||e===`false`||e===`null`||e===`undefined`||e===`yes`||e===`no`||e===`on`||e===`off`||e===`NaN`||e===`Infinity`||e===`-Infinity`||/^0x[0-9a-fA-F]+$/.test(e)||/^#/.test(e)?e:/^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?$/i.test(e)?e===`3.14159265359`?Math.PI:Number(e):e,f=e=>{if(s(),o())throw SyntaxError(`Unexpected end of input`);let t=i();if(t===`[`)return p();if(t===`{`)return y();if(t===`"`||t===`'`)return c(t);let n=u(e);if(n===``)throw SyntaxError(`Empty token`);return d(n)},p=()=>{a();let e=[];if(s(),i()===`]`)return a(),e;for(;;){s(),e.push(f([`,`,`]`])),s();let t=a();if(t===`]`)break;if(t!==`,`)throw SyntaxError(`Expected ',' or ']' after array element`);if(s(),i()===`]`)throw SyntaxError(`Trailing comma in array`)}return e},m=()=>{if(a(),s(),i()===`{`)return y();let e=i();if(e===`"`||e===`'`)return c(e);let r=!1,o=n;for(;o<t.length&&t[o]!==`
|
|
4
|
+
`;){if(t[o]===`:`&&o+1<t.length&&t[o+1]===` `){r=!0;break}o++}return r?h():d(u([`
|
|
5
|
+
`]))},h=()=>{let e={},r=g();for(;!o();){let l=n,f=t[l-1];s();let p=g();if((l===0||f===`
|
|
6
|
+
`)&&p<=r){n=l;break}let m=i();if(m===`-`||o()){n=l;break}let h=``;if(m===`"`||m===`'`)h=c(m);else{for(;!o()&&i()!==`:`;)h+=a();h=h.trim()}if(o()||a()!==`:`)break;if(s(),i()===`
|
|
7
|
+
`&&(a(),s(),i()===`-`)){e[h]=_();continue}e[h]=d(u([`
|
|
8
|
+
`])),i()===`
|
|
9
|
+
`&&a()}return e},g=()=>{let e=0,r=n;for(;r>0&&t[r-1]!==`
|
|
10
|
+
`;)r--;for(;r<t.length&&t[r]===` `;)e++,r++;return e},_=()=>{let e=[],t=g();for(;!o();){for(;!o()&&r(i())&&(a(),i()!==`-`););if(o()||g()<t||i()!==`-`)break;e.push(m())}return e},v=e=>{let t={};for(s();;){if(s(),o()||l(i(),e))return t;let r=``,u=i();if(u===`"`||u===`'`)r=c(u);else{for(;!o();){let t=i();if(t===`:`||t===`
|
|
11
|
+
`)break;if(l(t,e))throw SyntaxError(`Expected ':' in object entry`);r+=a()}r=r.trim()}if(!r)return t;if(o()||a()!==`:`)throw SyntaxError(`Expected ':' after key`);for(!o()&&i()===` `&&a();!o()&&(i()===` `||i()===` `);)a();if(o())return t[r]=``,t;if(i()===`
|
|
12
|
+
`){a();let c=n;if(s(),i()===`-`){t[r]=_(),s();continue}else{if(n=c,s(),!o()){let n=i();if(n&&!l(n,e)&&n!==`-`){t[r]=``;continue}}return t[r]=``,t}}if(t[r]=f(e.includes(`}`)?[`,`,`
|
|
13
|
+
`,...e]:[`
|
|
14
|
+
`,...e]),o())return t;let d=i();if(d===`,`){a(),s();continue}if(d===`
|
|
15
|
+
`){a(),s();continue}if(d===` `||d===` `){for(;!o()&&(i()===` `||i()===` `);)a();if(d=i(),d===`
|
|
16
|
+
`){a(),s();continue}if(o()||l(d,e))return t;continue}if(l(d,e)||o())return t}},y=()=>{if(a(),s(),i()===`}`)return a(),{};let e=v([`}`]);if(i()!==`}`)throw SyntaxError(`Expected '}' at end of object`);return a(),e},b=e=>{let t=0,n=0,r=null;for(;t<e.length;){let i=e[t];if(r){if(i===`\\`&&t+1<e.length){t+=2;continue}if(i===r){r=null,t++;continue}t++;continue}if(i===`"`||i===`'`){r=i,t++;continue}if(i===`[`||i===`{`){n++,t++;continue}if(i===`]`||i===`}`){n=Math.max(0,n-1),t++;continue}if(n===0&&i===`:`){let n=e[t+1];if(n===` `||n===`
|
|
17
|
+
`||n===void 0)return!0}t++}return!1};if(t.startsWith(`]`)||t.startsWith(`}`))throw SyntaxError(`Unexpected closing bracket`);if(t.startsWith(`[`)){let e=p();if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}if(t.startsWith(`{`)){let e=y();if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}if(b(t)){let e=v([]);if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}let x=f([]);if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return x},b=e=>{try{let t=e.split(/\r?\n/),n=t.find(e=>e.trim()!==``);if(!n||n.trim()!==`---`)return{};let r=-1;for(let e=1;e<t.length;e++)if(t[e].trim()===`---`){r=e;break}return r===-1?{}:y(t.slice(1,r).join(`
|
|
18
|
+
`))??{}}catch{return{}}},x=Object.keys({Config:`Intlayer configuration documentation`,Content:`Reference for all Intlayer content node types (t, enu, etc.)`,Usage:`How to use Intlayer in your project`,CLI:`Intlayer CLI commands and usage`,Compiler:`Intlayer Compiler setup and usage for automatic content extraction without .content files`,RemoteContent:`How to use Intlayer with Remote/CMS/Server-side content`,NextJS:`Next.js-specific usage (Server & Client components)`,React:`React-specific syntax and hooks usage`,Vue:`Vue-specific composables and syntax`,Svelte:`Svelte-specific stores and syntax`,Angular:`Angular-specific syntax and Injectable Function usage`,Preact:`Preact-specific syntax and hooks usage`,Solid:`Integrates Intlayer internationalization with SolidJS components. Use when the user asks to "setup SolidJS i18n", use the "useIntlayer" hook in Solid, or manage locales in a SolidJS application.`,Astro:`Astro-specific usage and getIntlayer`}),S={Cursor:{label:`Cursor`,dir:`.cursor/skills`,check:()=>process.env.CURSOR===`true`||process.env.TERM_PROGRAM===`cursor`},Windsurf:{label:`Windsurf`,dir:`.windsurf/skills`,check:()=>process.env.WINDSURF===`true`||process.env.TERM_PROGRAM===`windsurf`},Trae:{label:`Trae`,dir:`.trae/skills`,check:()=>process.env.TRAE===`true`||process.env.TERM_PROGRAM===`trae`},TraeCN:{label:`Trae CN`,dir:`.trae/skills`,check:()=>process.env.TRAE_CN===`true`},VSCode:{label:`VS Code`,dir:`.vscode/skills`,check:()=>process.env.VSCODE===`true`||process.env.TERM_PROGRAM===`vscode`},OpenCode:{label:`OpenCode`,dir:`.opencode/skills`,check:()=>process.env.OPENCODE===`true`},Claude:{label:`Claude Code`,dir:`.claude/skills`,check:()=>process.env.CLAUDE===`true`},GitHub:{label:`GitHub Copilot Workspace`,dir:`.github/skills`,check:()=>process.env.GITHUB_ACTIONS===`true`||!!process.env.GITHUB_WORKSPACE},Antigravity:{label:`Antigravity`,dir:`.agent/skills`},Augment:{label:`Augment`,dir:`.augment/skills`},OpenClaw:{label:`OpenClaw`,dir:`skills`},Cline:{label:`Cline`,dir:`.cline/skills`},CodeBuddy:{label:`CodeBuddy`,dir:`.codebuddy/skills`},CommandCode:{label:`Command Code`,dir:`.commandcode/skills`},Continue:{label:`Continue`,dir:`.continue/skills`},Crush:{label:`Crush`,dir:`.crush/skills`},Droid:{label:`Droid`,dir:`.factory/skills`},Goose:{label:`Goose`,dir:`.goose/skills`},IFlow:{label:`iFlow CLI`,dir:`.iflow/skills`},Junie:{label:`Junie`,dir:`.junie/skills`},KiloCode:{label:`Kilo Code`,dir:`.kilocode/skills`},Kiro:{label:`Kiro CLI`,dir:`.kiro/skills`},Kode:{label:`Kode`,dir:`.kode/skills`},MCPJam:{label:`MCPJam`,dir:`.mcpjam/skills`},MistralVibe:{label:`Mistral Vibe`,dir:`.vibe/skills`},Mux:{label:`Mux`,dir:`.mux/skills`},OpenHands:{label:`OpenHands`,dir:`.openhands/skills`},Pi:{label:`Pi`,dir:`.pi/skills`},Qoder:{label:`Qoder`,dir:`.qoder/skills`},Qwen:{label:`Qwen Code`,dir:`.qwen/skills`},RooCode:{label:`Roo Code`,dir:`.roo/skills`},Zencoder:{label:`Zencoder`,dir:`.zencoder/skills`},Neovate:{label:`Neovate`,dir:`.neovate/skills`},Pochi:{label:`Pochi`,dir:`.pochi/skills`},Other:{label:`Other`,dir:`skills`}},C=Object.keys(S),w={},T=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),E=e=>{let t=`./skills/${w[e]??T(e)}.md`;try{return v(t)}catch{return console.warn(`Warning: Could not read asset for skill: ${e} at ${t}`),``}},D=()=>{try{return v(`./LICENCE.md`)}catch{return console.warn(`Warning: Could not read LICENCE.md asset`),``}},O=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch ${e}: ${t.statusText}`);return t.text()},k=async(e,n,i)=>{let a=S[n].dir??`skills`,o=r.join(e,a);await t.mkdir(o,{recursive:!0});let s=[],c=D();for(let e of i){let n=`intlayer-${w[e]??T(e)}`,i=E(e);if(!i)continue;let a=Array.from(new Set(i.match(/https:\/\/intlayer\.org\/doc\/[^\s)]+\.md/g)||[])),l=r.join(o,n),u=r.join(l,`references`);await t.mkdir(u,{recursive:!0}),c&&await t.writeFile(r.join(l,`LICENCE.md`),c,`utf-8`);let d=i,f=a.map(async t=>{try{let e=await O(t),n=b(e),r=``;return r=Array.isArray(n.slugs)?n.slugs.filter(e=>e!==`doc`).join(`_`):new URL(t).pathname.split(`/`).filter(e=>e&&e!==`doc`).map(e=>e.replace(`.md`,``)).join(`_`),r=r?`${r}.md`:`index.md`,{url:t,localRefPath:`references/${r}`,fileName:r,content:e,success:!0}}catch(n){return console.warn(`Warning: Failed to download ref ${t} for skill ${e}`,n),{url:t,success:!1}}}),p=await Promise.all(f);for(let e of p)e.success&&e.fileName&&e.content&&e.localRefPath&&(await t.writeFile(r.join(u,e.fileName),e.content,`utf-8`),d=d.replaceAll(e.url,e.localRefPath));let m=r.join(l,`SKILL.md`);await t.writeFile(m,d,`utf-8`),s.push(`${n}/SKILL.md`)}return s.length===0?`No skill files were created. Check your asset paths.`:`${d} Created ${s.length} skills in ${o}`},A=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:f.enum(C).describe(`The platform to install skills for`),skills:f.array(f.enum(x)).describe(`List of skills to install`),projectRoot:f.string().optional().describe(`Root directory of the project. Defaults to current directory.`)}},async({platform:e,skills:t,projectRoot:n})=>{try{return{content:[{type:`text`,text:await k(n||process.cwd(),e,t)}]}}catch(e){return{content:[{type:`text`,text:`Failed to install skills: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}})},j=async()=>{let e=p.createInterface({input:process.stdin,output:process.stdout}),t=t=>new Promise(n=>e.question(t,n));try{console.log(`Install Intlayer Skills`),console.log(`-----------------------`);let n=await t(`Which platform are you using? (Cursor, Windsurf, Trae, OpenCode, GitHub, Claude, VSCode, Cline, RooCode, etc. or "Other"): `),r=C.find(e=>e.toLowerCase()===n.trim().toLowerCase())||`Other`;console.log(`Selected platform: ${r}`),console.log(`
|
|
19
|
+
Available skills:`),x.forEach((e,t)=>{console.log(`${t+1}. ${e}`)});let i=await t(`
|
|
20
|
+
Which skills do you want to install? (comma separated numbers, e.g. 1,2,3 or "all"): `),a=[];if(a=i.trim().toLowerCase()===`all`?[...x]:i.split(`,`).map(e=>parseInt(e.trim(),10)-1).filter(e=>!Number.isNaN(e)&&e>=0&&e<x.length).map(e=>x[e]),a.length===0){console.log(`No valid skills selected. Exiting.`),e.close();return}console.log(`Installing skills: ${a.join(`, `)}...`);let o=await k(process.cwd(),r,a);console.log(o)}catch(e){console.error(`Error:`,e)}finally{e.close()}};export{j as n,A as t};
|
|
21
|
+
//# sourceMappingURL=installSkills-Bzx_k5dj.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installSkills-Bzx_k5dj.mjs","names":["l","t","c","u","e","i","d","f","a","p","n","r","o","s","t","e","r","i","n","PLATFORMS","SKILLS","installSkills"],"sources":["../../../chokidar/dist/esm/_utils_asset-4w8dPH9r.mjs","../../../core/dist/esm/utils/parseYaml.mjs","../../../core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs","../../../chokidar/dist/esm/installSkills/index.mjs","../../src/tools/installSkills.ts"],"sourcesContent":["import{basename as e,dirname as t,join as n,relative as r,resolve as i,sep as a}from\"node:path\";import{existsSync as o,readFileSync as s}from\"node:fs\";import{fileURLToPath as c}from\"node:url\";const l=()=>{try{return t(c(import.meta.url))}catch{return typeof __dirname<`u`?__dirname:process.cwd()}},u=t=>{let n=t;for(let t=0;t<12;t++){if(e(n)===`dist`)return n;let t=i(n,`..`);if(t===n)break;n=t}return null},d=e=>{if(!e)return null;try{if(e.startsWith(`file://`))return c(e)}catch{}return e},f=()=>{let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error();Error.captureStackTrace(e,f);let n=e.stack||[],r=e=>e.includes(`${a}_virtual${a}`)||e.includes(`/_virtual/`);for(let e of n){let n=d(typeof e.getFileName==`function`?e.getFileName():null);if(n&&!(n.includes(`node:internal`)||n.includes(`${a}internal${a}modules${a}`))&&!r(n))return t(n)}for(let e of n){let n=d(typeof e.getFileName==`function`?e.getFileName():null);if(n)return t(n)}}catch{}finally{Error.prepareStackTrace=e}return l()},p=(e,t=`utf8`)=>{let a=l(),c=u(a)??i(a,`..`,`..`,`dist`),d=n(c,`assets`),p=[],m=r(c,f()).split(`\\\\`).join(`/`).replace(/^(?:dist\\/)?(?:esm|cjs)\\//,``).replace(/^_virtual\\//,``);if(e.startsWith(`./`)||e.startsWith(`../`)){let n=i(d,m,e);if(p.push(n),o(n))return s(n,t)}let h=n(d,e);if(p.push(h),o(h))return s(h,t);if(m){let r=n(d,m,e);if(p.push(r),o(r))return s(r,t)}let g=[`readAsset: file not found.`,`Searched:`,...p.map(e=>`- ${e}`)].join(`\n`);throw Error(g)};export{p as t};","const e=e=>{let t=e.trim();if(!t)return null;let n=0,r=e=>e===` `||e===`\n`||e===`\t`||e===`\\r`,i=()=>t[n],a=()=>t[n++],o=()=>n>=t.length,s=()=>{for(;!o()&&r(i());)n++},c=e=>{a();let t=``;for(;!o();){let n=a();if(n===e)return t;if(n===`\\\\`&&!o()){let e=a();t+=e}else t+=n}throw SyntaxError(`Unterminated string`)},l=(e,t)=>!!e&&t.includes(e),u=e=>{let t=``;for(;!o()&&!l(i(),e);)t+=a();return t.trim()},d=e=>e===`true`||e===`false`||e===`null`||e===`undefined`||e===`yes`||e===`no`||e===`on`||e===`off`||e===`NaN`||e===`Infinity`||e===`-Infinity`||/^0x[0-9a-fA-F]+$/.test(e)||/^#/.test(e)?e:/^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$/i.test(e)?e===`3.14159265359`?Math.PI:Number(e):e,f=e=>{if(s(),o())throw SyntaxError(`Unexpected end of input`);let t=i();if(t===`[`)return p();if(t===`{`)return y();if(t===`\"`||t===`'`)return c(t);let n=u(e);if(n===``)throw SyntaxError(`Empty token`);return d(n)},p=()=>{a();let e=[];if(s(),i()===`]`)return a(),e;for(;;){s(),e.push(f([`,`,`]`])),s();let t=a();if(t===`]`)break;if(t!==`,`)throw SyntaxError(`Expected ',' or ']' after array element`);if(s(),i()===`]`)throw SyntaxError(`Trailing comma in array`)}return e},m=()=>{if(a(),s(),i()===`{`)return y();let e=i();if(e===`\"`||e===`'`)return c(e);let r=!1,o=n;for(;o<t.length&&t[o]!==`\n`;){if(t[o]===`:`&&o+1<t.length&&t[o+1]===` `){r=!0;break}o++}return r?h():d(u([`\n`]))},h=()=>{let e={},r=g();for(;!o();){let l=n,f=t[l-1];s();let p=g();if((l===0||f===`\n`)&&p<=r){n=l;break}let m=i();if(m===`-`||o()){n=l;break}let h=``;if(m===`\"`||m===`'`)h=c(m);else{for(;!o()&&i()!==`:`;)h+=a();h=h.trim()}if(o()||a()!==`:`)break;if(s(),i()===`\n`&&(a(),s(),i()===`-`)){e[h]=_();continue}e[h]=d(u([`\n`])),i()===`\n`&&a()}return e},g=()=>{let e=0,r=n;for(;r>0&&t[r-1]!==`\n`;)r--;for(;r<t.length&&t[r]===` `;)e++,r++;return e},_=()=>{let e=[],t=g();for(;!o();){for(;!o()&&r(i())&&(a(),i()!==`-`););if(o()||g()<t||i()!==`-`)break;e.push(m())}return e},v=e=>{let t={};for(s();;){if(s(),o()||l(i(),e))return t;let r=``,u=i();if(u===`\"`||u===`'`)r=c(u);else{for(;!o();){let t=i();if(t===`:`||t===`\n`)break;if(l(t,e))throw SyntaxError(`Expected ':' in object entry`);r+=a()}r=r.trim()}if(!r)return t;if(o()||a()!==`:`)throw SyntaxError(`Expected ':' after key`);for(!o()&&i()===` `&&a();!o()&&(i()===` `||i()===`\t`);)a();if(o())return t[r]=``,t;if(i()===`\n`){a();let c=n;if(s(),i()===`-`){t[r]=_(),s();continue}else{if(n=c,s(),!o()){let n=i();if(n&&!l(n,e)&&n!==`-`){t[r]=``;continue}}return t[r]=``,t}}if(t[r]=f(e.includes(`}`)?[`,`,`\n`,...e]:[`\n`,...e]),o())return t;let d=i();if(d===`,`){a(),s();continue}if(d===`\n`){a(),s();continue}if(d===` `||d===`\t`){for(;!o()&&(i()===` `||i()===`\t`);)a();if(d=i(),d===`\n`){a(),s();continue}if(o()||l(d,e))return t;continue}if(l(d,e)||o())return t}},y=()=>{if(a(),s(),i()===`}`)return a(),{};let e=v([`}`]);if(i()!==`}`)throw SyntaxError(`Expected '}' at end of object`);return a(),e},b=e=>{let t=0,n=0,r=null;for(;t<e.length;){let i=e[t];if(r){if(i===`\\\\`&&t+1<e.length){t+=2;continue}if(i===r){r=null,t++;continue}t++;continue}if(i===`\"`||i===`'`){r=i,t++;continue}if(i===`[`||i===`{`){n++,t++;continue}if(i===`]`||i===`}`){n=Math.max(0,n-1),t++;continue}if(n===0&&i===`:`){let n=e[t+1];if(n===` `||n===`\n`||n===void 0)return!0}t++}return!1};if(t.startsWith(`]`)||t.startsWith(`}`))throw SyntaxError(`Unexpected closing bracket`);if(t.startsWith(`[`)){let e=p();if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}if(t.startsWith(`{`)){let e=y();if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}if(b(t)){let e=v([]);if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}let x=f([]);if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return x};export{e as parseYaml};\n//# sourceMappingURL=parseYaml.mjs.map","import{parseYaml as e}from\"../../utils/parseYaml.mjs\";const t=t=>{try{let n=t.split(/\\r?\\n/),r=n.find(e=>e.trim()!==``);if(!r||r.trim()!==`---`)return{};let i=-1;for(let e=1;e<n.length;e++)if(n[e].trim()===`---`){i=e;break}return i===-1?{}:e(n.slice(1,i).join(`\n`))??{}}catch{return{}}};export{t as getMarkdownMetadata};\n//# sourceMappingURL=getMarkdownMetadata.mjs.map","import{t as e}from\"../_utils_asset-4w8dPH9r.mjs\";import t from\"node:path\";import{v as n}from\"@intlayer/config/logger\";import{promises as r}from\"node:fs\";import{getMarkdownMetadata as i}from\"@intlayer/core/markdown\";const a={Config:`Intlayer configuration documentation`,Content:`Reference for all Intlayer content node types (t, enu, etc.)`,Usage:`How to use Intlayer in your project`,CLI:`Intlayer CLI commands and usage`,Compiler:`Intlayer Compiler setup and usage for automatic content extraction without .content files`,RemoteContent:`How to use Intlayer with Remote/CMS/Server-side content`,NextJS:`Next.js-specific usage (Server & Client components)`,React:`React-specific syntax and hooks usage`,Vue:`Vue-specific composables and syntax`,Svelte:`Svelte-specific stores and syntax`,Angular:`Angular-specific syntax and Injectable Function usage`,Preact:`Preact-specific syntax and hooks usage`,Solid:`Integrates Intlayer internationalization with SolidJS components. Use when the user asks to \"setup SolidJS i18n\", use the \"useIntlayer\" hook in Solid, or manage locales in a SolidJS application.`,Astro:`Astro-specific usage and getIntlayer`},o=Object.keys(a),s=e=>{let t=[`Usage`,`Content`,`Config`,`CLI`,`Compiler`];return e.next&&t.push(`NextJS`),(e.react||!e.next)&&t.push(`React`),e.preact&&t.push(`Preact`),e[`solid-js`]&&t.push(`Solid`),(e.vue||e.nuxt)&&t.push(`Vue`),(e.svelte||e[`@sveltejs/kit`])&&t.push(`Svelte`),e.astro&&t.push(`Astro`),t},c={Cursor:{label:`Cursor`,dir:`.cursor/skills`,check:()=>process.env.CURSOR===`true`||process.env.TERM_PROGRAM===`cursor`},Windsurf:{label:`Windsurf`,dir:`.windsurf/skills`,check:()=>process.env.WINDSURF===`true`||process.env.TERM_PROGRAM===`windsurf`},Trae:{label:`Trae`,dir:`.trae/skills`,check:()=>process.env.TRAE===`true`||process.env.TERM_PROGRAM===`trae`},TraeCN:{label:`Trae CN`,dir:`.trae/skills`,check:()=>process.env.TRAE_CN===`true`},VSCode:{label:`VS Code`,dir:`.vscode/skills`,check:()=>process.env.VSCODE===`true`||process.env.TERM_PROGRAM===`vscode`},OpenCode:{label:`OpenCode`,dir:`.opencode/skills`,check:()=>process.env.OPENCODE===`true`},Claude:{label:`Claude Code`,dir:`.claude/skills`,check:()=>process.env.CLAUDE===`true`},GitHub:{label:`GitHub Copilot Workspace`,dir:`.github/skills`,check:()=>process.env.GITHUB_ACTIONS===`true`||!!process.env.GITHUB_WORKSPACE},Antigravity:{label:`Antigravity`,dir:`.agent/skills`},Augment:{label:`Augment`,dir:`.augment/skills`},OpenClaw:{label:`OpenClaw`,dir:`skills`},Cline:{label:`Cline`,dir:`.cline/skills`},CodeBuddy:{label:`CodeBuddy`,dir:`.codebuddy/skills`},CommandCode:{label:`Command Code`,dir:`.commandcode/skills`},Continue:{label:`Continue`,dir:`.continue/skills`},Crush:{label:`Crush`,dir:`.crush/skills`},Droid:{label:`Droid`,dir:`.factory/skills`},Goose:{label:`Goose`,dir:`.goose/skills`},IFlow:{label:`iFlow CLI`,dir:`.iflow/skills`},Junie:{label:`Junie`,dir:`.junie/skills`},KiloCode:{label:`Kilo Code`,dir:`.kilocode/skills`},Kiro:{label:`Kiro CLI`,dir:`.kiro/skills`},Kode:{label:`Kode`,dir:`.kode/skills`},MCPJam:{label:`MCPJam`,dir:`.mcpjam/skills`},MistralVibe:{label:`Mistral Vibe`,dir:`.vibe/skills`},Mux:{label:`Mux`,dir:`.mux/skills`},OpenHands:{label:`OpenHands`,dir:`.openhands/skills`},Pi:{label:`Pi`,dir:`.pi/skills`},Qoder:{label:`Qoder`,dir:`.qoder/skills`},Qwen:{label:`Qwen Code`,dir:`.qwen/skills`},RooCode:{label:`Roo Code`,dir:`.roo/skills`},Zencoder:{label:`Zencoder`,dir:`.zencoder/skills`},Neovate:{label:`Neovate`,dir:`.neovate/skills`},Pochi:{label:`Pochi`,dir:`.pochi/skills`},Other:{label:`Other`,dir:`skills`}},l=Object.keys(c),u={},d=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),f=t=>{let n=`./skills/${u[t]??d(t)}.md`;try{return e(n)}catch{return console.warn(`Warning: Could not read asset for skill: ${t} at ${n}`),``}},p=()=>{try{return e(`./LICENCE.md`)}catch{return console.warn(`Warning: Could not read LICENCE.md asset`),``}},m=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch ${e}: ${t.statusText}`);return t.text()},h=async(e,a,o)=>{let s=c[a].dir??`skills`,l=t.join(e,s);await r.mkdir(l,{recursive:!0});let h=[],g=p();for(let e of o){let n=`intlayer-${u[e]??d(e)}`,a=f(e);if(!a)continue;let o=Array.from(new Set(a.match(/https:\\/\\/intlayer\\.org\\/doc\\/[^\\s)]+\\.md/g)||[])),s=t.join(l,n),c=t.join(s,`references`);await r.mkdir(c,{recursive:!0}),g&&await r.writeFile(t.join(s,`LICENCE.md`),g,`utf-8`);let p=a,_=o.map(async t=>{try{let e=await m(t),n=i(e),r=``;return r=Array.isArray(n.slugs)?n.slugs.filter(e=>e!==`doc`).join(`_`):new URL(t).pathname.split(`/`).filter(e=>e&&e!==`doc`).map(e=>e.replace(`.md`,``)).join(`_`),r=r?`${r}.md`:`index.md`,{url:t,localRefPath:`references/${r}`,fileName:r,content:e,success:!0}}catch(n){return console.warn(`Warning: Failed to download ref ${t} for skill ${e}`,n),{url:t,success:!1}}}),v=await Promise.all(_);for(let e of v)e.success&&e.fileName&&e.content&&e.localRefPath&&(await r.writeFile(t.join(c,e.fileName),e.content,`utf-8`),p=p.replaceAll(e.url,e.localRefPath));let y=t.join(s,`SKILL.md`);await r.writeFile(y,p,`utf-8`),h.push(`${n}/SKILL.md`)}return h.length===0?`No skill files were created. Check your asset paths.`:`${n} Created ${h.length} skills in ${l}`};export{l as PLATFORMS,c as PLATFORMS_METADATA,o as SKILLS,a as SKILLS_METADATA,s as getInitialSkills,h as installSkills};\n//# sourceMappingURL=index.mjs.map","import * as readline from 'node:readline';\nimport {\n installSkills,\n PLATFORMS,\n SKILLS,\n type Skill,\n} 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(PLATFORMS)\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\n async ({ platform, skills, projectRoot }) => {\n try {\n const root = projectRoot || process.cwd();\n const message = await installSkills(root, platform, skills);\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\n // we only accept a single platform here, not an array like the main CLI\n const platform =\n PLATFORMS.find(\n (platform) =>\n platform.toLowerCase() === platformInput.trim().toLowerCase()\n ) || ('Other' as const);\n\n console.log(`Selected platform: ${platform}`);\n\n console.log('\\nAvailable skills:');\n\n SKILLS.forEach((skill, i) => {\n console.log(`${i + 1}. ${skill}`);\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 = [...SKILLS];\n } else {\n const indices = skillsInput\n .split(',')\n .map((skill) => parseInt(skill.trim(), 10) - 1)\n .filter(\n (skill) => !Number.isNaN(skill) && skill >= 0 && skill < SKILLS.length\n );\n selectedSkills = indices.map((i) => SKILLS[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":"gTAAgM,MAAMA,MAAM,CAAC,GAAG,CAAC,OAAOC,EAAEC,EAAE,OAAO,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,OAAO,UAAU,IAAI,UAAU,QAAQ,KAAK,GAAGC,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,IAAI,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,GAAGC,EAAE,EAAE,GAAG,OAAO,OAAO,EAAE,IAAI,EAAEC,EAAE,EAAE,KAAK,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,MAAMC,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC,GAAG,EAAE,WAAW,UAAU,CAAC,OAAOJ,EAAE,EAAE,MAAM,EAAE,OAAO,GAAGK,MAAM,CAAC,IAAI,EAAE,MAAM,kBAAkB,GAAG,CAAC,MAAM,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,kBAAkB,EAAEA,EAAE,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,GAAGC,EAAE,UAAUA,IAAI,EAAE,EAAE,SAAS,aAAa,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC,IAAI,EAAEF,EAAE,OAAO,EAAE,aAAa,WAAW,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,EAAE,SAAS,gBAAgB,EA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MAAM,IAAI,CACV,IAAK,GAAU,SAAS,EAAM,MAAM,CAAE,GAAG,CAAG,EAAE,CAC9C,OACE,GAAU,CAAC,OAAO,MAAM,EAAM,EAAI,GAAS,GAAK,EAAQA,EAAO,OACjE,CACsB,IAAK,GAAMA,EAAO,GAAU,CAGnD,EAAe,SAAW,EAAG,CAC/B,QAAQ,IAAI,qCAAqC,CACjD,EAAG,OAAO,CACV,OAGF,QAAQ,IAAI,sBAAsB,EAAe,KAAK,KAAK,CAAC,KAAK,CACjE,IAAM,EAAS,MAAMC,EAAc,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{
|
|
1
|
+
import{t as e}from"../cli-C5nRaDjk.mjs";import{t}from"../installSkills-Bzx_k5dj.mjs";import{loadDocsTools as n}from"../tools/docs.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),t(i)}catch(e){console.error(`Error loading CLI tools:`,e)}try{n(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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","names":["pathDirname"],"sources":["../../../src/server/server.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { dirname as pathDirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadCLITools } from '../tools/cli';\nimport { loadDocsTools } from '../tools/docs';\nimport { loadInstallSkillsTool } from '../tools/installSkills';\n\nexport const dirname: string = isESModule\n ? pathDirname(fileURLToPath(import.meta.url))\n : __dirname;\n\nconst packageJson: Record<string, any> = JSON.parse(\n readFileSync(resolve(dirname, '../../../package.json'), 'utf8')\n);\n\ntype LoadServer = (options: { isLocal: boolean }) => McpServer;\n\nexport const loadServer: LoadServer = ({ isLocal }) => {\n const server = new McpServer({\n name: 'intlayer',\n version: packageJson.version,\n });\n\n if (isLocal) {\n try {\n loadCLITools(server);\n loadInstallSkillsTool(server);\n } catch (error) {\n console.error('Error loading CLI tools:', error);\n }\n }\n\n try {\n loadDocsTools(server);\n } catch (error) {\n console.error('Error loading docs tools:', error);\n }\n\n return server;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.mjs","names":["pathDirname"],"sources":["../../../src/server/server.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { dirname as pathDirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadCLITools } from '../tools/cli';\nimport { loadDocsTools } from '../tools/docs';\nimport { loadInstallSkillsTool } from '../tools/installSkills';\n\nexport const dirname: string = isESModule\n ? pathDirname(fileURLToPath(import.meta.url))\n : __dirname;\n\nconst packageJson: Record<string, any> = JSON.parse(\n readFileSync(resolve(dirname, '../../../package.json'), 'utf8')\n);\n\ntype LoadServer = (options: { isLocal: boolean }) => McpServer;\n\nexport const loadServer: LoadServer = ({ isLocal }) => {\n const server = new McpServer({\n name: 'intlayer',\n version: packageJson.version,\n });\n\n if (isLocal) {\n try {\n loadCLITools(server);\n loadInstallSkillsTool(server);\n } catch (error) {\n console.error('Error loading CLI tools:', error);\n }\n }\n\n try {\n loadDocsTools(server);\n } catch (error) {\n console.error('Error loading docs tools:', error);\n }\n\n return server;\n};\n"],"mappings":"gYASA,MAAa,EAAkB,EAC3BA,EAAY,EAAc,OAAO,KAAK,IAAI,CAAC,CAC3C,UAEE,EAAmC,KAAK,MAC5C,EAAa,EAAQ,EAAS,wBAAwB,CAAE,OAAO,CAChE,CAIY,GAA0B,CAAE,aAAc,CACrD,IAAM,EAAS,IAAI,EAAU,CAC3B,KAAM,WACN,QAAS,EAAY,QACtB,CAAC,CAEF,GAAI,EACF,GAAI,CACF,EAAa,EAAO,CACpB,EAAsB,EAAO,OACtB,EAAO,CACd,QAAQ,MAAM,2BAA4B,EAAM,CAIpD,GAAI,CACF,EAAc,EAAO,OACd,EAAO,CACd,QAAQ,MAAM,4BAA6B,EAAM,CAGnD,OAAO"}
|
package/dist/esm/tools/cli.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=cli.mjs.map
|
|
1
|
+
import{t as e}from"../cli-C5nRaDjk.mjs";export{e as loadCLITools};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
Available skills:`),n.forEach((e,t)=>{console.log(`${t+1}. ${e}`)});let s=await a(`
|
|
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`?[...n]:s.split(`,`).map(e=>parseInt(e.trim(),10)-1).filter(e=>!Number.isNaN(e)&&e>=0&&e<n.length).map(e=>n[e]),c.length===0){console.log(`No valid skills selected. Exiting.`),r.close();return}console.log(`Installing skills: ${c.join(`, `)}...`);let l=await e(process.cwd(),o,c);console.log(l)}catch(e){console.error(`Error:`,e)}finally{r.close()}};export{a as loadInstallSkillsTool,o as runInstallSkillsCLI};
|
|
4
|
-
//# sourceMappingURL=installSkills.mjs.map
|
|
1
|
+
import{n as e,t}from"../installSkills-Bzx_k5dj.mjs";export{t as loadInstallSkillsTool,e as runInstallSkillsCLI};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/mcp",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Intlayer MCP server. Handle MCP to help IDE to use Intlayer. It build, fill, pull, push, dictionaries",
|
|
6
6
|
"keywords": [
|
|
@@ -93,18 +93,18 @@
|
|
|
93
93
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@intlayer/api": "8.4.
|
|
97
|
-
"@intlayer/cli": "8.4.
|
|
98
|
-
"@intlayer/config": "8.4.
|
|
99
|
-
"@intlayer/docs": "8.4.
|
|
100
|
-
"@intlayer/types": "8.4.
|
|
96
|
+
"@intlayer/api": "8.4.1",
|
|
97
|
+
"@intlayer/cli": "8.4.1",
|
|
98
|
+
"@intlayer/config": "8.4.1",
|
|
99
|
+
"@intlayer/docs": "8.4.1",
|
|
100
|
+
"@intlayer/types": "8.4.1",
|
|
101
101
|
"@modelcontextprotocol/sdk": "1.27.1",
|
|
102
102
|
"dotenv": "17.3.1",
|
|
103
103
|
"express": "5.2.1",
|
|
104
104
|
"zod": "4.3.6"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@intlayer/types": "8.4.
|
|
107
|
+
"@intlayer/types": "8.4.1",
|
|
108
108
|
"@modelcontextprotocol/inspector": "0.21.1",
|
|
109
109
|
"@types/express": "5.0.6",
|
|
110
110
|
"@types/node": "25.5.0",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{fileURLToPath as e}from"node:url";import{existsSync as t,readFileSync as n}from"node:fs";import{basename as r,dirname as i,join as a,relative as o,resolve as s,sep as c}from"node:path";const l=()=>{try{return i(e(import.meta.url))}catch{return typeof __dirname<`u`?__dirname:process.cwd()}},u=e=>{let t=e;for(let e=0;e<12;e++){if(r(t)===`dist`)return t;let e=s(t,`..`);if(e===t)break;t=e}return null},d=t=>{if(!t)return null;try{if(t.startsWith(`file://`))return e(t)}catch{}return t},f=()=>{let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error();Error.captureStackTrace(e,f);let t=e.stack||[],n=e=>e.includes(`${c}_virtual${c}`)||e.includes(`/_virtual/`);for(let e of t){let t=d(typeof e.getFileName==`function`?e.getFileName():null);if(t&&!(t.includes(`node:internal`)||t.includes(`${c}internal${c}modules${c}`))&&!n(t))return i(t)}for(let e of t){let t=d(typeof e.getFileName==`function`?e.getFileName():null);if(t)return i(t)}}catch{}finally{Error.prepareStackTrace=e}return l()},p=(e,r=`utf8`)=>{let i=l(),c=u(i)??s(i,`..`,`..`,`dist`),d=a(c,`assets`),p=[],m=o(c,f()).split(`\\`).join(`/`).replace(/^(?:dist\/)?(?:esm|cjs)\//,``).replace(/^_virtual\//,``);if(e.startsWith(`./`)||e.startsWith(`../`)){let i=s(d,m,e);if(p.push(i),t(i))return n(i,r)}let h=a(d,e);if(p.push(h),t(h))return n(h,r);if(m){let i=a(d,m,e);if(p.push(i),t(i))return n(i,r)}let g=[`readAsset: file not found.`,`Searched:`,...p.map(e=>`- ${e}`)].join(`
|
|
2
|
-
`);throw Error(g)};export{p};
|
|
3
|
-
//# sourceMappingURL=_utils_asset.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_utils_asset.mjs","names":["t","c","e","i","a","n","r","o","s"],"sources":["../../../../../../../../../chokidar/dist/esm/_virtual/_utils_asset.mjs"],"sourcesContent":["import{basename as e,dirname as t,join as n,relative as r,resolve as i,sep as a}from\"node:path\";import{existsSync as o,readFileSync as s}from\"node:fs\";import{fileURLToPath as c}from\"node:url\";const l=()=>{try{return t(c(import.meta.url))}catch{return typeof __dirname<`u`?__dirname:process.cwd()}},u=t=>{let n=t;for(let t=0;t<12;t++){if(e(n)===`dist`)return n;let t=i(n,`..`);if(t===n)break;n=t}return null},d=e=>{if(!e)return null;try{if(e.startsWith(`file://`))return c(e)}catch{}return e},f=()=>{let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error();Error.captureStackTrace(e,f);let n=e.stack||[],r=e=>e.includes(`${a}_virtual${a}`)||e.includes(`/_virtual/`);for(let e of n){let n=d(typeof e.getFileName==`function`?e.getFileName():null);if(n&&!(n.includes(`node:internal`)||n.includes(`${a}internal${a}modules${a}`))&&!r(n))return t(n)}for(let e of n){let n=d(typeof e.getFileName==`function`?e.getFileName():null);if(n)return t(n)}}catch{}finally{Error.prepareStackTrace=e}return l()},p=(e,t=`utf8`)=>{let a=l(),c=u(a)??i(a,`..`,`..`,`dist`),d=n(c,`assets`),p=[],m=r(c,f()).split(`\\\\`).join(`/`).replace(/^(?:dist\\/)?(?:esm|cjs)\\//,``).replace(/^_virtual\\//,``);if(e.startsWith(`./`)||e.startsWith(`../`)){let n=i(d,m,e);if(p.push(n),o(n))return s(n,t)}let h=n(d,e);if(p.push(h),o(h))return s(h,t);if(m){let r=n(d,m,e);if(p.push(r),o(r))return s(r,t)}let g=[`readAsset: file not found.`,`Searched:`,...p.map(e=>`- ${e}`)].join(`\n`);throw Error(g)};export{p as readAsset};"],"mappings":"gMAAgM,MAAM,MAAM,CAAC,GAAG,CAAC,OAAOA,EAAEC,EAAE,OAAO,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,OAAO,UAAU,IAAI,UAAU,QAAQ,KAAK,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,IAAI,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,GAAGC,EAAE,EAAE,GAAG,OAAO,OAAO,EAAE,IAAI,EAAEC,EAAE,EAAE,KAAK,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC,GAAG,EAAE,WAAW,UAAU,CAAC,OAAOF,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,IAAI,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AE,CAAC,OAAOC,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,EAAEH,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,CAACE,EAAE,EAAE,CAAC,OAAOC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,6BAA6B,YAAY,GAAG,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,KAAK;EACj7C,CAAC,MAAM,MAAM,EAAE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as e}from"../_virtual/_utils_asset.mjs";import{t}from"../../../../core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs";import{promises as n}from"node:fs";import r from"node:path";import{v as i}from"@intlayer/config/logger";const a=Object.keys({Config:`Intlayer configuration documentation`,Content:`Reference for all Intlayer content node types (t, enu, etc.)`,Usage:`How to use Intlayer in your project`,CLI:`Intlayer CLI commands and usage`,Compiler:`Intlayer Compiler setup and usage for automatic content extraction without .content files`,RemoteContent:`How to use Intlayer with Remote/CMS/Server-side content`,NextJS:`Next.js-specific usage (Server & Client components)`,React:`React-specific syntax and hooks usage`,Vue:`Vue-specific composables and syntax`,Svelte:`Svelte-specific stores and syntax`,Angular:`Angular-specific syntax and Injectable Function usage`,Preact:`Preact-specific syntax and hooks usage`,Solid:`Integrates Intlayer internationalization with SolidJS components. Use when the user asks to "setup SolidJS i18n", use the "useIntlayer" hook in Solid, or manage locales in a SolidJS application.`,Astro:`Astro-specific usage and getIntlayer`}),o={Cursor:{label:`Cursor`,dir:`.cursor/skills`,check:()=>process.env.CURSOR===`true`||process.env.TERM_PROGRAM===`cursor`},Windsurf:{label:`Windsurf`,dir:`.windsurf/skills`,check:()=>process.env.WINDSURF===`true`||process.env.TERM_PROGRAM===`windsurf`},Trae:{label:`Trae`,dir:`.trae/skills`,check:()=>process.env.TRAE===`true`||process.env.TERM_PROGRAM===`trae`},TraeCN:{label:`Trae CN`,dir:`.trae/skills`,check:()=>process.env.TRAE_CN===`true`},VSCode:{label:`VS Code`,dir:`.vscode/skills`,check:()=>process.env.VSCODE===`true`||process.env.TERM_PROGRAM===`vscode`},OpenCode:{label:`OpenCode`,dir:`.opencode/skills`,check:()=>process.env.OPENCODE===`true`},Claude:{label:`Claude Code`,dir:`.claude/skills`,check:()=>process.env.CLAUDE===`true`},GitHub:{label:`GitHub Copilot Workspace`,dir:`.github/skills`,check:()=>process.env.GITHUB_ACTIONS===`true`||!!process.env.GITHUB_WORKSPACE},Antigravity:{label:`Antigravity`,dir:`.agent/skills`},Augment:{label:`Augment`,dir:`.augment/skills`},OpenClaw:{label:`OpenClaw`,dir:`skills`},Cline:{label:`Cline`,dir:`.cline/skills`},CodeBuddy:{label:`CodeBuddy`,dir:`.codebuddy/skills`},CommandCode:{label:`Command Code`,dir:`.commandcode/skills`},Continue:{label:`Continue`,dir:`.continue/skills`},Crush:{label:`Crush`,dir:`.crush/skills`},Droid:{label:`Droid`,dir:`.factory/skills`},Goose:{label:`Goose`,dir:`.goose/skills`},IFlow:{label:`iFlow CLI`,dir:`.iflow/skills`},Junie:{label:`Junie`,dir:`.junie/skills`},KiloCode:{label:`Kilo Code`,dir:`.kilocode/skills`},Kiro:{label:`Kiro CLI`,dir:`.kiro/skills`},Kode:{label:`Kode`,dir:`.kode/skills`},MCPJam:{label:`MCPJam`,dir:`.mcpjam/skills`},MistralVibe:{label:`Mistral Vibe`,dir:`.vibe/skills`},Mux:{label:`Mux`,dir:`.mux/skills`},OpenHands:{label:`OpenHands`,dir:`.openhands/skills`},Pi:{label:`Pi`,dir:`.pi/skills`},Qoder:{label:`Qoder`,dir:`.qoder/skills`},Qwen:{label:`Qwen Code`,dir:`.qwen/skills`},RooCode:{label:`Roo Code`,dir:`.roo/skills`},Zencoder:{label:`Zencoder`,dir:`.zencoder/skills`},Neovate:{label:`Neovate`,dir:`.neovate/skills`},Pochi:{label:`Pochi`,dir:`.pochi/skills`},Other:{label:`Other`,dir:`skills`}},s=Object.keys(o),c={},l=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),u=t=>{let n=`./skills/${c[t]??l(t)}.md`;try{return e(n)}catch{return console.warn(`Warning: Could not read asset for skill: ${t} at ${n}`),``}},d=()=>{try{return e(`./LICENCE.md`)}catch{return console.warn(`Warning: Could not read LICENCE.md asset`),``}},f=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch ${e}: ${t.statusText}`);return t.text()},p=async(e,a,s)=>{let p=o[a].dir??`skills`,m=r.join(e,p);await n.mkdir(m,{recursive:!0});let h=[],g=d();for(let e of s){let i=`intlayer-${c[e]??l(e)}`,a=u(e);if(!a)continue;let o=Array.from(new Set(a.match(/https:\/\/intlayer\.org\/doc\/[^\s)]+\.md/g)||[])),s=r.join(m,i),d=r.join(s,`references`);await n.mkdir(d,{recursive:!0}),g&&await n.writeFile(r.join(s,`LICENCE.md`),g,`utf-8`);let p=a,_=o.map(async n=>{try{let e=await f(n),r=t(e),i=``;return i=Array.isArray(r.slugs)?r.slugs.filter(e=>e!==`doc`).join(`_`):new URL(n).pathname.split(`/`).filter(e=>e&&e!==`doc`).map(e=>e.replace(`.md`,``)).join(`_`),i=i?`${i}.md`:`index.md`,{url:n,localRefPath:`references/${i}`,fileName:i,content:e,success:!0}}catch(t){return console.warn(`Warning: Failed to download ref ${n} for skill ${e}`,t),{url:n,success:!1}}}),v=await Promise.all(_);for(let e of v)e.success&&e.fileName&&e.content&&e.localRefPath&&(await n.writeFile(r.join(d,e.fileName),e.content,`utf-8`),p=p.replaceAll(e.url,e.localRefPath));let y=r.join(s,`SKILL.md`);await n.writeFile(y,p,`utf-8`),h.push(`${i}/SKILL.md`)}return h.length===0?`No skill files were created. Check your asset paths.`:`${i} Created ${h.length} skills in ${m}`};export{p as h,s as l,a as o};
|
|
2
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["e","r","i","n"],"sources":["../../../../../../../../../chokidar/dist/esm/installSkills/index.mjs"],"sourcesContent":["import{readAsset as e}from\"../_virtual/_utils_asset.mjs\";import t from\"node:path\";import{v as n}from\"@intlayer/config/logger\";import{promises as r}from\"node:fs\";import{getMarkdownMetadata as i}from\"@intlayer/core/markdown\";const a={Config:`Intlayer configuration documentation`,Content:`Reference for all Intlayer content node types (t, enu, etc.)`,Usage:`How to use Intlayer in your project`,CLI:`Intlayer CLI commands and usage`,Compiler:`Intlayer Compiler setup and usage for automatic content extraction without .content files`,RemoteContent:`How to use Intlayer with Remote/CMS/Server-side content`,NextJS:`Next.js-specific usage (Server & Client components)`,React:`React-specific syntax and hooks usage`,Vue:`Vue-specific composables and syntax`,Svelte:`Svelte-specific stores and syntax`,Angular:`Angular-specific syntax and Injectable Function usage`,Preact:`Preact-specific syntax and hooks usage`,Solid:`Integrates Intlayer internationalization with SolidJS components. Use when the user asks to \"setup SolidJS i18n\", use the \"useIntlayer\" hook in Solid, or manage locales in a SolidJS application.`,Astro:`Astro-specific usage and getIntlayer`},o=Object.keys(a),s=e=>{let t=[`Usage`,`Content`,`Config`,`CLI`,`Compiler`];return e.next&&t.push(`NextJS`),(e.react||!e.next)&&t.push(`React`),e.preact&&t.push(`Preact`),e[`solid-js`]&&t.push(`Solid`),(e.vue||e.nuxt)&&t.push(`Vue`),(e.svelte||e[`@sveltejs/kit`])&&t.push(`Svelte`),e.astro&&t.push(`Astro`),t},c={Cursor:{label:`Cursor`,dir:`.cursor/skills`,check:()=>process.env.CURSOR===`true`||process.env.TERM_PROGRAM===`cursor`},Windsurf:{label:`Windsurf`,dir:`.windsurf/skills`,check:()=>process.env.WINDSURF===`true`||process.env.TERM_PROGRAM===`windsurf`},Trae:{label:`Trae`,dir:`.trae/skills`,check:()=>process.env.TRAE===`true`||process.env.TERM_PROGRAM===`trae`},TraeCN:{label:`Trae CN`,dir:`.trae/skills`,check:()=>process.env.TRAE_CN===`true`},VSCode:{label:`VS Code`,dir:`.vscode/skills`,check:()=>process.env.VSCODE===`true`||process.env.TERM_PROGRAM===`vscode`},OpenCode:{label:`OpenCode`,dir:`.opencode/skills`,check:()=>process.env.OPENCODE===`true`},Claude:{label:`Claude Code`,dir:`.claude/skills`,check:()=>process.env.CLAUDE===`true`},GitHub:{label:`GitHub Copilot Workspace`,dir:`.github/skills`,check:()=>process.env.GITHUB_ACTIONS===`true`||!!process.env.GITHUB_WORKSPACE},Antigravity:{label:`Antigravity`,dir:`.agent/skills`},Augment:{label:`Augment`,dir:`.augment/skills`},OpenClaw:{label:`OpenClaw`,dir:`skills`},Cline:{label:`Cline`,dir:`.cline/skills`},CodeBuddy:{label:`CodeBuddy`,dir:`.codebuddy/skills`},CommandCode:{label:`Command Code`,dir:`.commandcode/skills`},Continue:{label:`Continue`,dir:`.continue/skills`},Crush:{label:`Crush`,dir:`.crush/skills`},Droid:{label:`Droid`,dir:`.factory/skills`},Goose:{label:`Goose`,dir:`.goose/skills`},IFlow:{label:`iFlow CLI`,dir:`.iflow/skills`},Junie:{label:`Junie`,dir:`.junie/skills`},KiloCode:{label:`Kilo Code`,dir:`.kilocode/skills`},Kiro:{label:`Kiro CLI`,dir:`.kiro/skills`},Kode:{label:`Kode`,dir:`.kode/skills`},MCPJam:{label:`MCPJam`,dir:`.mcpjam/skills`},MistralVibe:{label:`Mistral Vibe`,dir:`.vibe/skills`},Mux:{label:`Mux`,dir:`.mux/skills`},OpenHands:{label:`OpenHands`,dir:`.openhands/skills`},Pi:{label:`Pi`,dir:`.pi/skills`},Qoder:{label:`Qoder`,dir:`.qoder/skills`},Qwen:{label:`Qwen Code`,dir:`.qwen/skills`},RooCode:{label:`Roo Code`,dir:`.roo/skills`},Zencoder:{label:`Zencoder`,dir:`.zencoder/skills`},Neovate:{label:`Neovate`,dir:`.neovate/skills`},Pochi:{label:`Pochi`,dir:`.pochi/skills`},Other:{label:`Other`,dir:`skills`}},l=Object.keys(c),u={},d=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),f=t=>{let n=`./skills/${u[t]??d(t)}.md`;try{return e(n)}catch{return console.warn(`Warning: Could not read asset for skill: ${t} at ${n}`),``}},p=()=>{try{return e(`./LICENCE.md`)}catch{return console.warn(`Warning: Could not read LICENCE.md asset`),``}},m=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch ${e}: ${t.statusText}`);return t.text()},h=async(e,a,o)=>{let s=c[a].dir??`skills`,l=t.join(e,s);await r.mkdir(l,{recursive:!0});let h=[],g=p();for(let e of o){let n=`intlayer-${u[e]??d(e)}`,a=f(e);if(!a)continue;let o=Array.from(new Set(a.match(/https:\\/\\/intlayer\\.org\\/doc\\/[^\\s)]+\\.md/g)||[])),s=t.join(l,n),c=t.join(s,`references`);await r.mkdir(c,{recursive:!0}),g&&await r.writeFile(t.join(s,`LICENCE.md`),g,`utf-8`);let p=a,_=o.map(async t=>{try{let e=await m(t),n=i(e),r=``;return r=Array.isArray(n.slugs)?n.slugs.filter(e=>e!==`doc`).join(`_`):new URL(t).pathname.split(`/`).filter(e=>e&&e!==`doc`).map(e=>e.replace(`.md`,``)).join(`_`),r=r?`${r}.md`:`index.md`,{url:t,localRefPath:`references/${r}`,fileName:r,content:e,success:!0}}catch(n){return console.warn(`Warning: Failed to download ref ${t} for skill ${e}`,n),{url:t,success:!1}}}),v=await Promise.all(_);for(let e of v)e.success&&e.fileName&&e.content&&e.localRefPath&&(await r.writeFile(t.join(c,e.fileName),e.content,`utf-8`),p=p.replaceAll(e.url,e.localRefPath));let y=t.join(s,`SKILL.md`);await r.writeFile(y,p,`utf-8`),h.push(`${n}/SKILL.md`)}return h.length===0?`No skill files were created. Check your asset paths.`:`${n} Created ${h.length} skills in ${l}`};export{l as PLATFORMS,c as PLATFORMS_METADATA,o as SKILLS,a as SKILLS_METADATA,s as getInitialSkills,h as installSkills};\n//# sourceMappingURL=index.mjs.map"],"mappings":"8OAA+N,MAAs6B,EAAE,OAAO,KAAv6B,CAAC,OAAO,uCAAuC,QAAQ,+DAA+D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K,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,WAAW,CAAC,IAAI,EAAE,aAAa,cAAc,IAAI,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,QAAQ,KAAK,mCAAmC,EAAE,aAAa,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAAQ,IAAI,EAAE,CAAC,IAAI,IAAI,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,MAAMD,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,SAAS,CAAC,EAAE,QAAQ,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,MAAMA,EAAE,UAAU,EAAE,EAAE,QAAQ,CAAC,EAAE,KAAK,GAAG,EAAE,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,uDAAuD,GAAGE,EAAE,WAAW,EAAE,OAAO,aAAa"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{dirname as e}from"node:path";import t from"/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/index.js";import{configurationFilesCandidates as n}from"@intlayer/config/node";import r from"/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/simple-git@3.32.3/node_modules/simple-git/dist/esm/index.js";const i=async e=>{try{return(await(e?r(e):r()).revparse([`--show-toplevel`])).trim()}catch{return null}},a=async r=>{let a=r?.baseDir??process.cwd();if(r?.gitRoot){let e=await i(a);e&&(a=e)}let o=await t(n.map(e=>`**/${e}`),{cwd:a,absolute:!0,ignore:[`**/node_modules/**`,`**/.git/**`],dot:!0}),s=[...new Set(o.map(t=>e(t)))];return{searchDir:a,projectsPath:s.sort()}};export{a};
|
|
2
|
-
//# sourceMappingURL=listProjects.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listProjects.mjs","names":["t","n","e"],"sources":["../../../../../../../../chokidar/dist/esm/listProjects.mjs"],"sourcesContent":["import{dirname as e}from\"node:path\";import t from\"fast-glob\";import{configurationFilesCandidates as n}from\"@intlayer/config/node\";import r from\"simple-git\";const i=async e=>{try{return(await(e?r(e):r()).revparse([`--show-toplevel`])).trim()}catch{return null}},a=async r=>{let a=r?.baseDir??process.cwd();if(r?.gitRoot){let e=await i(a);e&&(a=e)}let o=await t(n.map(e=>`**/${e}`),{cwd:a,absolute:!0,ignore:[`**/node_modules/**`,`**/.git/**`],dot:!0}),s=[...new Set(o.map(t=>e(t)))];return{searchDir:a,projectsPath:s.sort()}};export{a as listProjects};\n//# sourceMappingURL=listProjects.mjs.map"],"mappings":"6WAA4J,MAAM,EAAE,KAAM,IAAG,CAAC,GAAG,CAAC,OAAO,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAAE,MAAM,MAAM,CAAC,OAAO,OAAO,EAAE,KAAM,IAAG,CAAC,IAAI,EAAE,GAAG,SAAS,QAAQ,KAAK,CAAC,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,MAAMA,EAAEC,EAAE,IAAI,GAAG,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,qBAAqB,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,EAAE,IAAI,GAAGC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,CAAC"}
|
package/dist/esm/packages/@intlayer/core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{e}from"../../utils/parseYaml.mjs";const t=t=>{try{let n=t.split(/\r?\n/),r=n.find(e=>e.trim()!==``);if(!r||r.trim()!==`---`)return{};let i=-1;for(let e=1;e<n.length;e++)if(n[e].trim()===`---`){i=e;break}return i===-1?{}:e(n.slice(1,i).join(`
|
|
2
|
-
`))??{}}catch{return{}}};export{t};
|
|
3
|
-
//# sourceMappingURL=getMarkdownMetadata.mjs.map
|
package/dist/esm/packages/@intlayer/core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMarkdownMetadata.mjs","names":[],"sources":["../../../../../../../../../../core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs"],"sourcesContent":["import{parseYaml as e}from\"../../utils/parseYaml.mjs\";const t=t=>{try{let n=t.split(/\\r?\\n/),r=n.find(e=>e.trim()!==``);if(!r||r.trim()!==`---`)return{};let i=-1;for(let e=1;e<n.length;e++)if(n[e].trim()===`---`){i=e;break}return i===-1?{}:e(n.slice(1,i).join(`\n`))??{}}catch{return{}}};export{t as getMarkdownMetadata};\n//# sourceMappingURL=getMarkdownMetadata.mjs.map"],"mappings":"yCAAsD,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,MAAM,QAAQ,CAAC,EAAE,EAAE,KAAK,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,IAAI,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,IAAI,GAAG,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,MAAM,OAAO,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,KAAK;EAClQ,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const e=e=>{let t=e.trim();if(!t)return null;let n=0,r=e=>e===` `||e===`
|
|
2
|
-
`||e===` `||e===`\r`,i=()=>t[n],a=()=>t[n++],o=()=>n>=t.length,s=()=>{for(;!o()&&r(i());)n++},c=e=>{a();let t=``;for(;!o();){let n=a();if(n===e)return t;if(n===`\\`&&!o()){let e=a();t+=e}else t+=n}throw SyntaxError(`Unterminated string`)},l=(e,t)=>!!e&&t.includes(e),u=e=>{let t=``;for(;!o()&&!l(i(),e);)t+=a();return t.trim()},d=e=>e===`true`||e===`false`||e===`null`||e===`undefined`||e===`yes`||e===`no`||e===`on`||e===`off`||e===`NaN`||e===`Infinity`||e===`-Infinity`||/^0x[0-9a-fA-F]+$/.test(e)||/^#/.test(e)?e:/^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?$/i.test(e)?e===`3.14159265359`?Math.PI:Number(e):e,f=e=>{if(s(),o())throw SyntaxError(`Unexpected end of input`);let t=i();if(t===`[`)return p();if(t===`{`)return y();if(t===`"`||t===`'`)return c(t);let n=u(e);if(n===``)throw SyntaxError(`Empty token`);return d(n)},p=()=>{a();let e=[];if(s(),i()===`]`)return a(),e;for(;;){s(),e.push(f([`,`,`]`])),s();let t=a();if(t===`]`)break;if(t!==`,`)throw SyntaxError(`Expected ',' or ']' after array element`);if(s(),i()===`]`)throw SyntaxError(`Trailing comma in array`)}return e},m=()=>{if(a(),s(),i()===`{`)return y();let e=i();if(e===`"`||e===`'`)return c(e);let r=!1,o=n;for(;o<t.length&&t[o]!==`
|
|
3
|
-
`;){if(t[o]===`:`&&o+1<t.length&&t[o+1]===` `){r=!0;break}o++}return r?h():d(u([`
|
|
4
|
-
`]))},h=()=>{let e={},r=g();for(;!o();){let l=n,f=t[l-1];s();let p=g();if((l===0||f===`
|
|
5
|
-
`)&&p<=r){n=l;break}let m=i();if(m===`-`||o()){n=l;break}let h=``;if(m===`"`||m===`'`)h=c(m);else{for(;!o()&&i()!==`:`;)h+=a();h=h.trim()}if(o()||a()!==`:`)break;if(s(),i()===`
|
|
6
|
-
`&&(a(),s(),i()===`-`)){e[h]=_();continue}e[h]=d(u([`
|
|
7
|
-
`])),i()===`
|
|
8
|
-
`&&a()}return e},g=()=>{let e=0,r=n;for(;r>0&&t[r-1]!==`
|
|
9
|
-
`;)r--;for(;r<t.length&&t[r]===` `;)e++,r++;return e},_=()=>{let e=[],t=g();for(;!o();){for(;!o()&&r(i())&&(a(),i()!==`-`););if(o()||g()<t||i()!==`-`)break;e.push(m())}return e},v=e=>{let t={};for(s();;){if(s(),o()||l(i(),e))return t;let r=``,u=i();if(u===`"`||u===`'`)r=c(u);else{for(;!o();){let t=i();if(t===`:`||t===`
|
|
10
|
-
`)break;if(l(t,e))throw SyntaxError(`Expected ':' in object entry`);r+=a()}r=r.trim()}if(!r)return t;if(o()||a()!==`:`)throw SyntaxError(`Expected ':' after key`);for(!o()&&i()===` `&&a();!o()&&(i()===` `||i()===` `);)a();if(o())return t[r]=``,t;if(i()===`
|
|
11
|
-
`){a();let c=n;if(s(),i()===`-`){t[r]=_(),s();continue}else{if(n=c,s(),!o()){let n=i();if(n&&!l(n,e)&&n!==`-`){t[r]=``;continue}}return t[r]=``,t}}if(t[r]=f(e.includes(`}`)?[`,`,`
|
|
12
|
-
`,...e]:[`
|
|
13
|
-
`,...e]),o())return t;let d=i();if(d===`,`){a(),s();continue}if(d===`
|
|
14
|
-
`){a(),s();continue}if(d===` `||d===` `){for(;!o()&&(i()===` `||i()===` `);)a();if(d=i(),d===`
|
|
15
|
-
`){a(),s();continue}if(o()||l(d,e))return t;continue}if(l(d,e)||o())return t}},y=()=>{if(a(),s(),i()===`}`)return a(),{};let e=v([`}`]);if(i()!==`}`)throw SyntaxError(`Expected '}' at end of object`);return a(),e},b=e=>{let t=0,n=0,r=null;for(;t<e.length;){let i=e[t];if(r){if(i===`\\`&&t+1<e.length){t+=2;continue}if(i===r){r=null,t++;continue}t++;continue}if(i===`"`||i===`'`){r=i,t++;continue}if(i===`[`||i===`{`){n++,t++;continue}if(i===`]`||i===`}`){n=Math.max(0,n-1),t++;continue}if(n===0&&i===`:`){let n=e[t+1];if(n===` `||n===`
|
|
16
|
-
`||n===void 0)return!0}t++}return!1};if(t.startsWith(`]`)||t.startsWith(`}`))throw SyntaxError(`Unexpected closing bracket`);if(t.startsWith(`[`)){let e=p();if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}if(t.startsWith(`{`)){let e=y();if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}if(b(t)){let e=v([]);if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}let x=f([]);if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return x};export{e};
|
|
17
|
-
//# sourceMappingURL=parseYaml.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseYaml.mjs","names":[],"sources":["../../../../../../../../../core/dist/esm/utils/parseYaml.mjs"],"sourcesContent":["const e=e=>{let t=e.trim();if(!t)return null;let n=0,r=e=>e===` `||e===`\n`||e===`\t`||e===`\\r`,i=()=>t[n],a=()=>t[n++],o=()=>n>=t.length,s=()=>{for(;!o()&&r(i());)n++},c=e=>{a();let t=``;for(;!o();){let n=a();if(n===e)return t;if(n===`\\\\`&&!o()){let e=a();t+=e}else t+=n}throw SyntaxError(`Unterminated string`)},l=(e,t)=>!!e&&t.includes(e),u=e=>{let t=``;for(;!o()&&!l(i(),e);)t+=a();return t.trim()},d=e=>e===`true`||e===`false`||e===`null`||e===`undefined`||e===`yes`||e===`no`||e===`on`||e===`off`||e===`NaN`||e===`Infinity`||e===`-Infinity`||/^0x[0-9a-fA-F]+$/.test(e)||/^#/.test(e)?e:/^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$/i.test(e)?e===`3.14159265359`?Math.PI:Number(e):e,f=e=>{if(s(),o())throw SyntaxError(`Unexpected end of input`);let t=i();if(t===`[`)return p();if(t===`{`)return y();if(t===`\"`||t===`'`)return c(t);let n=u(e);if(n===``)throw SyntaxError(`Empty token`);return d(n)},p=()=>{a();let e=[];if(s(),i()===`]`)return a(),e;for(;;){s(),e.push(f([`,`,`]`])),s();let t=a();if(t===`]`)break;if(t!==`,`)throw SyntaxError(`Expected ',' or ']' after array element`);if(s(),i()===`]`)throw SyntaxError(`Trailing comma in array`)}return e},m=()=>{if(a(),s(),i()===`{`)return y();let e=i();if(e===`\"`||e===`'`)return c(e);let r=!1,o=n;for(;o<t.length&&t[o]!==`\n`;){if(t[o]===`:`&&o+1<t.length&&t[o+1]===` `){r=!0;break}o++}return r?h():d(u([`\n`]))},h=()=>{let e={},r=g();for(;!o();){let l=n,f=t[l-1];s();let p=g();if((l===0||f===`\n`)&&p<=r){n=l;break}let m=i();if(m===`-`||o()){n=l;break}let h=``;if(m===`\"`||m===`'`)h=c(m);else{for(;!o()&&i()!==`:`;)h+=a();h=h.trim()}if(o()||a()!==`:`)break;if(s(),i()===`\n`&&(a(),s(),i()===`-`)){e[h]=_();continue}e[h]=d(u([`\n`])),i()===`\n`&&a()}return e},g=()=>{let e=0,r=n;for(;r>0&&t[r-1]!==`\n`;)r--;for(;r<t.length&&t[r]===` `;)e++,r++;return e},_=()=>{let e=[],t=g();for(;!o();){for(;!o()&&r(i())&&(a(),i()!==`-`););if(o()||g()<t||i()!==`-`)break;e.push(m())}return e},v=e=>{let t={};for(s();;){if(s(),o()||l(i(),e))return t;let r=``,u=i();if(u===`\"`||u===`'`)r=c(u);else{for(;!o();){let t=i();if(t===`:`||t===`\n`)break;if(l(t,e))throw SyntaxError(`Expected ':' in object entry`);r+=a()}r=r.trim()}if(!r)return t;if(o()||a()!==`:`)throw SyntaxError(`Expected ':' after key`);for(!o()&&i()===` `&&a();!o()&&(i()===` `||i()===`\t`);)a();if(o())return t[r]=``,t;if(i()===`\n`){a();let c=n;if(s(),i()===`-`){t[r]=_(),s();continue}else{if(n=c,s(),!o()){let n=i();if(n&&!l(n,e)&&n!==`-`){t[r]=``;continue}}return t[r]=``,t}}if(t[r]=f(e.includes(`}`)?[`,`,`\n`,...e]:[`\n`,...e]),o())return t;let d=i();if(d===`,`){a(),s();continue}if(d===`\n`){a(),s();continue}if(d===` `||d===`\t`){for(;!o()&&(i()===` `||i()===`\t`);)a();if(d=i(),d===`\n`){a(),s();continue}if(o()||l(d,e))return t;continue}if(l(d,e)||o())return t}},y=()=>{if(a(),s(),i()===`}`)return a(),{};let e=v([`}`]);if(i()!==`}`)throw SyntaxError(`Expected '}' at end of object`);return a(),e},b=e=>{let t=0,n=0,r=null;for(;t<e.length;){let i=e[t];if(r){if(i===`\\\\`&&t+1<e.length){t+=2;continue}if(i===r){r=null,t++;continue}t++;continue}if(i===`\"`||i===`'`){r=i,t++;continue}if(i===`[`||i===`{`){n++,t++;continue}if(i===`]`||i===`}`){n=Math.max(0,n-1),t++;continue}if(n===0&&i===`:`){let n=e[t+1];if(n===` `||n===`\n`||n===void 0)return!0}t++}return!1};if(t.startsWith(`]`)||t.startsWith(`}`))throw SyntaxError(`Unexpected closing bracket`);if(t.startsWith(`[`)){let e=p();if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}if(t.startsWith(`{`)){let e=y();if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}if(b(t)){let e=v([]);if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return e}let x=f([]);if(s(),!o())throw SyntaxError(`Unexpected trailing characters`);return x};export{e as parseYaml};\n//# sourceMappingURL=parseYaml.mjs.map"],"mappings":"AAAA,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,EAAE,EAAE,EAAE,GAAG,IAAI,KAAK,IAAI;GACpE,IAAI,KAAK,IAAI,KAAK,MAAM,EAAE,GAAG,MAAM,EAAE,KAAK,MAAM,GAAG,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,CAA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,CAAC,EAAE,KAAK,IAAI,SAAS,IAAI,SAAS,GAAG,IAAI,KAAK,IAAI,IAAI,CAAC,EAAE,EAAE,IAAI,SAAS,GAAG,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,IAAI,SAAS,GAAG,IAAI,KAAK,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,SAAS,GAAG,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,GAAG,IAAI,KAAK,IAAI;GACnhB,IAAI,IAAK,GAAE,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,GAAG,GAAG,EAAE,WAAW,IAAI,EAAE,EAAE,WAAW,IAAI,CAAC,MAAM,YAAY,6BAA6B,CAAC,GAAG,EAAE,WAAW,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,YAAY,iCAAiC,CAAC,OAAO,EAAE,GAAG,EAAE,WAAW,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,YAAY,iCAAiC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,YAAY,iCAAiC,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,YAAY,iCAAiC,CAAC,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","names":["listProjects"],"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 { ALL_LOCALES } from '@intlayer/types/allLocales';\nimport type { LogConfig } from '@intlayer/types/config';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\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(ALL_LOCALES)\n .optional()\n .describe('Source locale'),\n outputLocales: z\n .union([\n z.nativeEnum(ALL_LOCALES),\n z.array(z.nativeEnum(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 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":"sVAmBA,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,C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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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installSkills.mjs","names":["PLATFORMS","SKILLS","installSkills"],"sources":["../../../src/tools/installSkills.ts"],"sourcesContent":["import * as readline from 'node:readline';\nimport {\n installSkills,\n PLATFORMS,\n SKILLS,\n type Skill,\n} 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(PLATFORMS)\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\n async ({ platform, skills, projectRoot }) => {\n try {\n const root = projectRoot || process.cwd();\n const message = await installSkills(root, platform, skills);\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\n // we only accept a single platform here, not an array like the main CLI\n const platform =\n PLATFORMS.find(\n (platform) =>\n platform.toLowerCase() === platformInput.trim().toLowerCase()\n ) || ('Other' as const);\n\n console.log(`Selected platform: ${platform}`);\n\n console.log('\\nAvailable skills:');\n\n SKILLS.forEach((skill, i) => {\n console.log(`${i + 1}. ${skill}`);\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 = [...SKILLS];\n } else {\n const indices = skillsInput\n .split(',')\n .map((skill) => parseInt(skill.trim(), 10) - 1)\n .filter(\n (skill) => !Number.isNaN(skill) && skill >= 0 && skill < SKILLS.length\n );\n selectedSkills = indices.map((i) => SKILLS[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":"qJAUA,MAAa,EAAyB,GAA4B,CAChE,EAAO,aACL,0BACA,CACE,MAAO,0BACP,YACE,uNACF,YAAa,CACX,SAAU,EACP,KAAKA,EAAU,CACf,SAAS,qCAAqC,CACjD,OAAQ,EAAE,MAAM,EAAE,KAAKC,EAAO,CAAC,CAAC,SAAS,4BAA4B,CACrE,YAAa,EACV,QAAQ,CACR,UAAU,CACV,SACC,gEACD,CACJ,CACF,CAED,MAAO,CAAE,WAAU,SAAQ,iBAAkB,CAC3C,GAAI,CAIF,MAAO,CACL,QAAS,CACP,CACE,KAAM,OACN,KANU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