@intlayer/chokidar 8.4.3 → 8.4.5

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.
Files changed (497) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/cjs/_virtual/_utils_asset.cjs +98 -0
  3. package/dist/cjs/build.cjs +58 -1
  4. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +62 -1
  5. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
  6. package/dist/cjs/buildIntlayerDictionary/index.cjs +6 -1
  7. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +26 -1
  8. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
  9. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +107 -4
  10. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
  11. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +81 -5
  12. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
  13. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +46 -1
  14. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
  15. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +50 -1
  16. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
  17. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +59 -1
  18. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
  19. package/dist/cjs/cleanOutputDir.cjs +30 -1
  20. package/dist/cjs/cleanOutputDir.cjs.map +1 -1
  21. package/dist/cjs/cleanRemovedContentDeclaration.cjs +97 -1
  22. package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -1
  23. package/dist/cjs/cli.cjs +35 -1
  24. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +70 -1
  25. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
  26. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +42 -7
  27. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
  28. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +23 -1
  29. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
  30. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +24 -1
  31. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
  32. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +24 -1
  33. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
  34. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +23 -1
  35. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
  36. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +23 -1
  37. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
  38. package/dist/cjs/createDictionaryEntryPoint/index.cjs +16 -1
  39. package/dist/cjs/createType/createModuleAugmentation.cjs +112 -9
  40. package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
  41. package/dist/cjs/createType/createType.cjs +29 -1
  42. package/dist/cjs/createType/createType.cjs.map +1 -1
  43. package/dist/cjs/createType/index.cjs +8 -1
  44. package/dist/cjs/detectFormatCommand.cjs +32 -1
  45. package/dist/cjs/detectFormatCommand.cjs.map +1 -1
  46. package/dist/cjs/fetchDistantDictionaries.cjs +51 -1
  47. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
  48. package/dist/cjs/filterInvalidDictionaries.cjs +52 -1
  49. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
  50. package/dist/cjs/formatDictionary.cjs +49 -1
  51. package/dist/cjs/formatDictionary.cjs.map +1 -1
  52. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +61 -7
  53. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
  54. package/dist/cjs/getContentDeclarationFileTemplate/index.cjs +4 -1
  55. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +34 -1
  56. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
  57. package/dist/cjs/handleContentDeclarationFileChange.cjs +49 -1
  58. package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
  59. package/dist/cjs/handleContentDeclarationFileMoved.cjs +24 -1
  60. package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -1
  61. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +37 -1
  62. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -1
  63. package/dist/cjs/init/index.cjs +284 -1
  64. package/dist/cjs/init/index.cjs.map +1 -1
  65. package/dist/cjs/init/utils/configManipulation.cjs +111 -1
  66. package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
  67. package/dist/cjs/init/utils/fileSystem.cjs +39 -1
  68. package/dist/cjs/init/utils/fileSystem.cjs.map +1 -1
  69. package/dist/cjs/init/utils/index.cjs +14 -1
  70. package/dist/cjs/init/utils/jsonParser.cjs +42 -3
  71. package/dist/cjs/init/utils/jsonParser.cjs.map +1 -1
  72. package/dist/cjs/init/utils/tsConfig.cjs +18 -1
  73. package/dist/cjs/init/utils/tsConfig.cjs.map +1 -1
  74. package/dist/cjs/initConfig/index.cjs +39 -1
  75. package/dist/cjs/initConfig/index.cjs.map +1 -1
  76. package/dist/cjs/installMCP/installMCP.cjs +50 -1
  77. package/dist/cjs/installMCP/installMCP.cjs.map +1 -1
  78. package/dist/cjs/installSkills/index.cjs +303 -1
  79. package/dist/cjs/installSkills/index.cjs.map +1 -1
  80. package/dist/cjs/listDictionariesPath.cjs +42 -1
  81. package/dist/cjs/listDictionariesPath.cjs.map +1 -1
  82. package/dist/cjs/listGitFiles.cjs +105 -5
  83. package/dist/cjs/listGitFiles.cjs.map +1 -1
  84. package/dist/cjs/listProjects.cjs +47 -1
  85. package/dist/cjs/listProjects.cjs.map +1 -1
  86. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +68 -1
  87. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
  88. package/dist/cjs/loadDictionaries/index.cjs +14 -1
  89. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +93 -2
  90. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  91. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +127 -1
  92. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  93. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +27 -1
  94. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
  95. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +61 -1
  96. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
  97. package/dist/cjs/loadDictionaries/log.cjs +138 -3
  98. package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
  99. package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs +63 -2
  100. package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs.map +1 -1
  101. package/dist/cjs/logConfigDetails.cjs +39 -2
  102. package/dist/cjs/logConfigDetails.cjs.map +1 -1
  103. package/dist/cjs/prepareIntlayer.cjs +103 -1
  104. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  105. package/dist/cjs/reduceDictionaryContent/applyMask.cjs +30 -1
  106. package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
  107. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +12 -1
  108. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
  109. package/dist/cjs/utils/autoDecorateContent.cjs +89 -1
  110. package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -1
  111. package/dist/cjs/utils/buildComponentFilesList.cjs +67 -1
  112. package/dist/cjs/utils/buildComponentFilesList.cjs.map +1 -1
  113. package/dist/cjs/utils/buildFilesList.cjs +83 -1
  114. package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
  115. package/dist/cjs/utils/chunkJSON.cjs +336 -1
  116. package/dist/cjs/utils/chunkJSON.cjs.map +1 -1
  117. package/dist/cjs/utils/formatter.cjs +18 -1
  118. package/dist/cjs/utils/formatter.cjs.map +1 -1
  119. package/dist/cjs/utils/getChunk.cjs +34 -1
  120. package/dist/cjs/utils/getChunk.cjs.map +1 -1
  121. package/dist/cjs/utils/getContentExtension.cjs +29 -1
  122. package/dist/cjs/utils/getContentExtension.cjs.map +1 -1
  123. package/dist/cjs/utils/getFormatFromExtension.cjs +34 -1
  124. package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
  125. package/dist/cjs/utils/getPathHash.cjs +10 -1
  126. package/dist/cjs/utils/getPathHash.cjs.map +1 -1
  127. package/dist/cjs/utils/index.cjs +49 -1
  128. package/dist/cjs/utils/mergeChunks.cjs +28 -1
  129. package/dist/cjs/utils/mergeChunks.cjs.map +1 -1
  130. package/dist/cjs/utils/pLimit.cjs +128 -1
  131. package/dist/cjs/utils/pLimit.cjs.map +1 -1
  132. package/dist/cjs/utils/parallelize.cjs +11 -1
  133. package/dist/cjs/utils/parallelize.cjs.map +1 -1
  134. package/dist/cjs/utils/parallelizeGlobal.cjs +29 -1
  135. package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -1
  136. package/dist/cjs/utils/reduceObjectFormat.cjs +31 -1
  137. package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -1
  138. package/dist/cjs/utils/resolveObjectPromises.cjs +21 -1
  139. package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
  140. package/dist/cjs/utils/resolveRelativePath.cjs +21 -1
  141. package/dist/cjs/utils/resolveRelativePath.cjs.map +1 -1
  142. package/dist/cjs/utils/runOnce.cjs +95 -1
  143. package/dist/cjs/utils/runOnce.cjs.map +1 -1
  144. package/dist/cjs/utils/runParallel/bin.cjs +54 -1
  145. package/dist/cjs/utils/runParallel/bin.cjs.map +1 -1
  146. package/dist/cjs/utils/runParallel/bootstrap.cjs +24 -1
  147. package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -1
  148. package/dist/cjs/utils/runParallel/index.cjs +115 -1
  149. package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
  150. package/dist/cjs/utils/runParallel/pidTree.cjs +145 -1
  151. package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
  152. package/dist/cjs/utils/runParallel/ps.cjs +49 -1
  153. package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
  154. package/dist/cjs/utils/runParallel/runTask.cjs +154 -1
  155. package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
  156. package/dist/cjs/utils/runParallel/spawnPosix.cjs +59 -1
  157. package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -1
  158. package/dist/cjs/utils/runParallel/spawnWin32.cjs +43 -1
  159. package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -1
  160. package/dist/cjs/utils/runParallel/wmic.cjs +52 -1
  161. package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
  162. package/dist/cjs/utils/sortAlphabetically.cjs +7 -1
  163. package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
  164. package/dist/cjs/utils/splitTextByLine.cjs +11 -1
  165. package/dist/cjs/utils/splitTextByLine.cjs.map +1 -1
  166. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +60 -1
  167. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -1
  168. package/dist/cjs/watcher.cjs +120 -1
  169. package/dist/cjs/watcher.cjs.map +1 -1
  170. package/dist/cjs/writeConfiguration/index.cjs +42 -1
  171. package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
  172. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +28 -1
  173. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
  174. package/dist/cjs/writeContentDeclaration/index.cjs +10 -1
  175. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +94 -1
  176. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -1
  177. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +412 -3
  178. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
  179. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +127 -2
  180. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -1
  181. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +148 -1
  182. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  183. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +92 -1
  184. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
  185. package/dist/cjs/writeFileIfChanged.cjs +50 -1
  186. package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
  187. package/dist/cjs/writeJsonIfChanged.cjs +17 -1
  188. package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
  189. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  190. package/dist/esm/_virtual/_utils_asset.mjs +97 -0
  191. package/dist/esm/build.mjs +25 -1
  192. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +60 -1
  193. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
  194. package/dist/esm/buildIntlayerDictionary/index.mjs +4 -1
  195. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +24 -1
  196. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
  197. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +102 -4
  198. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
  199. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +77 -5
  200. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -1
  201. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +44 -1
  202. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
  203. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +48 -1
  204. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
  205. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +56 -1
  206. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
  207. package/dist/esm/cleanOutputDir.mjs +28 -1
  208. package/dist/esm/cleanOutputDir.mjs.map +1 -1
  209. package/dist/esm/cleanRemovedContentDeclaration.mjs +94 -1
  210. package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -1
  211. package/dist/esm/cli.mjs +15 -1
  212. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +68 -1
  213. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
  214. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +40 -7
  215. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
  216. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +20 -1
  217. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
  218. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +21 -1
  219. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
  220. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +21 -1
  221. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
  222. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +20 -1
  223. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
  224. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +20 -1
  225. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
  226. package/dist/esm/createDictionaryEntryPoint/index.mjs +9 -1
  227. package/dist/esm/createType/createModuleAugmentation.mjs +108 -9
  228. package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
  229. package/dist/esm/createType/createType.mjs +26 -1
  230. package/dist/esm/createType/createType.mjs.map +1 -1
  231. package/dist/esm/createType/index.mjs +4 -1
  232. package/dist/esm/detectFormatCommand.mjs +30 -1
  233. package/dist/esm/detectFormatCommand.mjs.map +1 -1
  234. package/dist/esm/fetchDistantDictionaries.mjs +49 -1
  235. package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
  236. package/dist/esm/filterInvalidDictionaries.mjs +48 -1
  237. package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
  238. package/dist/esm/formatDictionary.mjs +44 -1
  239. package/dist/esm/formatDictionary.mjs.map +1 -1
  240. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +59 -7
  241. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
  242. package/dist/esm/getContentDeclarationFileTemplate/index.mjs +3 -1
  243. package/dist/esm/handleAdditionalContentDeclarationFile.mjs +32 -1
  244. package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
  245. package/dist/esm/handleContentDeclarationFileChange.mjs +47 -1
  246. package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
  247. package/dist/esm/handleContentDeclarationFileMoved.mjs +22 -1
  248. package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -1
  249. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +35 -1
  250. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -1
  251. package/dist/esm/init/index.mjs +281 -1
  252. package/dist/esm/init/index.mjs.map +1 -1
  253. package/dist/esm/init/utils/configManipulation.mjs +108 -1
  254. package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
  255. package/dist/esm/init/utils/fileSystem.mjs +34 -1
  256. package/dist/esm/init/utils/fileSystem.mjs.map +1 -1
  257. package/dist/esm/init/utils/index.mjs +6 -1
  258. package/dist/esm/init/utils/jsonParser.mjs +40 -3
  259. package/dist/esm/init/utils/jsonParser.mjs.map +1 -1
  260. package/dist/esm/init/utils/tsConfig.mjs +16 -1
  261. package/dist/esm/init/utils/tsConfig.mjs.map +1 -1
  262. package/dist/esm/initConfig/index.mjs +37 -1
  263. package/dist/esm/initConfig/index.mjs.map +1 -1
  264. package/dist/esm/installMCP/installMCP.mjs +46 -1
  265. package/dist/esm/installMCP/installMCP.mjs.map +1 -1
  266. package/dist/esm/installSkills/index.mjs +295 -1
  267. package/dist/esm/installSkills/index.mjs.map +1 -1
  268. package/dist/esm/listDictionariesPath.mjs +38 -1
  269. package/dist/esm/listDictionariesPath.mjs.map +1 -1
  270. package/dist/esm/listGitFiles.mjs +100 -5
  271. package/dist/esm/listGitFiles.mjs.map +1 -1
  272. package/dist/esm/listProjects.mjs +43 -1
  273. package/dist/esm/listProjects.mjs.map +1 -1
  274. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +67 -1
  275. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -1
  276. package/dist/esm/loadDictionaries/index.mjs +6 -1
  277. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +88 -2
  278. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  279. package/dist/esm/loadDictionaries/loadDictionaries.mjs +124 -1
  280. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  281. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +25 -1
  282. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
  283. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +58 -1
  284. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
  285. package/dist/esm/loadDictionaries/log.mjs +134 -3
  286. package/dist/esm/loadDictionaries/log.mjs.map +1 -1
  287. package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs +61 -2
  288. package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs.map +1 -1
  289. package/dist/esm/logConfigDetails.mjs +36 -2
  290. package/dist/esm/logConfigDetails.mjs.map +1 -1
  291. package/dist/esm/prepareIntlayer.mjs +99 -1
  292. package/dist/esm/prepareIntlayer.mjs.map +1 -1
  293. package/dist/esm/reduceDictionaryContent/applyMask.mjs +28 -1
  294. package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
  295. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +10 -1
  296. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
  297. package/dist/esm/utils/autoDecorateContent.mjs +86 -1
  298. package/dist/esm/utils/autoDecorateContent.mjs.map +1 -1
  299. package/dist/esm/utils/buildComponentFilesList.mjs +64 -1
  300. package/dist/esm/utils/buildComponentFilesList.mjs.map +1 -1
  301. package/dist/esm/utils/buildFilesList.mjs +79 -1
  302. package/dist/esm/utils/buildFilesList.mjs.map +1 -1
  303. package/dist/esm/utils/chunkJSON.mjs +333 -1
  304. package/dist/esm/utils/chunkJSON.mjs.map +1 -1
  305. package/dist/esm/utils/formatter.mjs +13 -1
  306. package/dist/esm/utils/formatter.mjs.map +1 -1
  307. package/dist/esm/utils/getChunk.mjs +33 -1
  308. package/dist/esm/utils/getChunk.mjs.map +1 -1
  309. package/dist/esm/utils/getContentExtension.mjs +27 -1
  310. package/dist/esm/utils/getContentExtension.mjs.map +1 -1
  311. package/dist/esm/utils/getFormatFromExtension.mjs +31 -1
  312. package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
  313. package/dist/esm/utils/getPathHash.mjs +7 -1
  314. package/dist/esm/utils/getPathHash.mjs.map +1 -1
  315. package/dist/esm/utils/index.mjs +22 -1
  316. package/dist/esm/utils/mergeChunks.mjs +26 -1
  317. package/dist/esm/utils/mergeChunks.mjs.map +1 -1
  318. package/dist/esm/utils/pLimit.mjs +125 -1
  319. package/dist/esm/utils/pLimit.mjs.map +1 -1
  320. package/dist/esm/utils/parallelize.mjs +10 -1
  321. package/dist/esm/utils/parallelize.mjs.map +1 -1
  322. package/dist/esm/utils/parallelizeGlobal.mjs +26 -1
  323. package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -1
  324. package/dist/esm/utils/reduceObjectFormat.mjs +29 -1
  325. package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -1
  326. package/dist/esm/utils/resolveObjectPromises.mjs +19 -1
  327. package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -1
  328. package/dist/esm/utils/resolveRelativePath.mjs +19 -1
  329. package/dist/esm/utils/resolveRelativePath.mjs.map +1 -1
  330. package/dist/esm/utils/runOnce.mjs +92 -1
  331. package/dist/esm/utils/runOnce.mjs.map +1 -1
  332. package/dist/esm/utils/runParallel/bin.mjs +52 -1
  333. package/dist/esm/utils/runParallel/bin.mjs.map +1 -1
  334. package/dist/esm/utils/runParallel/bootstrap.mjs +22 -1
  335. package/dist/esm/utils/runParallel/bootstrap.mjs.map +1 -1
  336. package/dist/esm/utils/runParallel/index.mjs +113 -1
  337. package/dist/esm/utils/runParallel/index.mjs.map +1 -1
  338. package/dist/esm/utils/runParallel/pidTree.mjs +142 -1
  339. package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -1
  340. package/dist/esm/utils/runParallel/ps.mjs +46 -1
  341. package/dist/esm/utils/runParallel/ps.mjs.map +1 -1
  342. package/dist/esm/utils/runParallel/runTask.mjs +152 -1
  343. package/dist/esm/utils/runParallel/runTask.mjs.map +1 -1
  344. package/dist/esm/utils/runParallel/spawnPosix.mjs +57 -1
  345. package/dist/esm/utils/runParallel/spawnPosix.mjs.map +1 -1
  346. package/dist/esm/utils/runParallel/spawnWin32.mjs +41 -1
  347. package/dist/esm/utils/runParallel/spawnWin32.mjs.map +1 -1
  348. package/dist/esm/utils/runParallel/wmic.mjs +49 -1
  349. package/dist/esm/utils/runParallel/wmic.mjs.map +1 -1
  350. package/dist/esm/utils/sortAlphabetically.mjs +5 -1
  351. package/dist/esm/utils/sortAlphabetically.mjs.map +1 -1
  352. package/dist/esm/utils/splitTextByLine.mjs +9 -1
  353. package/dist/esm/utils/splitTextByLine.mjs.map +1 -1
  354. package/dist/esm/utils/verifyIdenticObjectFormat.mjs +58 -1
  355. package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -1
  356. package/dist/esm/watcher.mjs +117 -1
  357. package/dist/esm/watcher.mjs.map +1 -1
  358. package/dist/esm/writeConfiguration/index.mjs +39 -1
  359. package/dist/esm/writeConfiguration/index.mjs.map +1 -1
  360. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +26 -1
  361. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
  362. package/dist/esm/writeContentDeclaration/index.mjs +6 -1
  363. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +91 -1
  364. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
  365. package/dist/esm/writeContentDeclaration/transformJSFile.mjs +407 -3
  366. package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
  367. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +124 -2
  368. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -1
  369. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +146 -1
  370. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
  371. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +90 -1
  372. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
  373. package/dist/esm/writeFileIfChanged.mjs +48 -1
  374. package/dist/esm/writeFileIfChanged.mjs.map +1 -1
  375. package/dist/esm/writeJsonIfChanged.mjs +16 -1
  376. package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
  377. package/dist/types/build.d.ts +20 -20
  378. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +25 -2
  379. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -0
  380. package/dist/types/buildIntlayerDictionary/index.d.ts +2 -2
  381. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +11 -2
  382. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -0
  383. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +49 -2
  384. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -0
  385. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +7 -7
  386. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
  387. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +30 -2
  388. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -0
  389. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +34 -2
  390. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -0
  391. package/dist/types/cli.d.ts +6 -6
  392. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +14 -2
  393. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -0
  394. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +10 -2
  395. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -0
  396. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +10 -2
  397. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +1 -0
  398. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +10 -2
  399. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +1 -0
  400. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +10 -2
  401. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +1 -0
  402. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +10 -2
  403. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +1 -0
  404. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +10 -2
  405. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +1 -0
  406. package/dist/types/createDictionaryEntryPoint/index.d.ts +7 -7
  407. package/dist/types/createType/createModuleAugmentation.d.ts +9 -2
  408. package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -0
  409. package/dist/types/createType/createType.d.ts +12 -2
  410. package/dist/types/createType/createType.d.ts.map +1 -0
  411. package/dist/types/createType/index.d.ts +2 -2
  412. package/dist/types/fetchDistantDictionaries.d.ts +1 -1
  413. package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
  414. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +7 -2
  415. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -0
  416. package/dist/types/getContentDeclarationFileTemplate/index.d.ts +1 -1
  417. package/dist/types/loadDictionaries/index.d.ts +4 -4
  418. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +12 -2
  419. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -0
  420. package/dist/types/loadDictionaries/loadDictionaries.d.ts +23 -2
  421. package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -0
  422. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +8 -2
  423. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -0
  424. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +15 -2
  425. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -0
  426. package/dist/types/loadDictionaries/log.d.ts +1 -1
  427. package/dist/types/utils/getFormatFromExtension.d.ts +8 -2
  428. package/dist/types/utils/getFormatFromExtension.d.ts.map +1 -0
  429. package/dist/types/utils/index.d.ts +1 -1
  430. package/dist/types/writeConfiguration/index.d.ts.map +1 -1
  431. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts +12 -2
  432. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts.map +1 -0
  433. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +5 -2
  434. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +1 -0
  435. package/dist/types/writeContentDeclaration/index.d.ts +5 -5
  436. package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -1
  437. package/dist/types/writeContentDeclaration/transformJSFile.d.ts +11 -2
  438. package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -0
  439. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +19 -2
  440. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -0
  441. package/dist/types/writeContentDeclaration/writeJSFile.d.ts +14 -2
  442. package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -0
  443. package/package.json +8 -8
  444. package/dist/cjs/_utils_asset-SJVy1xMD.cjs +0 -2
  445. package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
  446. package/dist/esm/_utils_asset-4w8dPH9r.mjs +0 -2
  447. package/dist/esm/chunk-DDgYwkfe.mjs +0 -1
  448. package/dist/types/buildIntlayerDictionary-_xrGjSmw.d.ts +0 -25
  449. package/dist/types/buildIntlayerDictionary-_xrGjSmw.d.ts.map +0 -1
  450. package/dist/types/createDictionaryEntryPoint-Bc5lHSiY.d.ts +0 -14
  451. package/dist/types/createDictionaryEntryPoint-Bc5lHSiY.d.ts.map +0 -1
  452. package/dist/types/createModuleAugmentation-D1eIVnjg.d.ts +0 -9
  453. package/dist/types/createModuleAugmentation-D1eIVnjg.d.ts.map +0 -1
  454. package/dist/types/createType--rDwdg2t.d.ts +0 -12
  455. package/dist/types/createType--rDwdg2t.d.ts.map +0 -1
  456. package/dist/types/detectExportedComponentName-DVXsp_FG.d.ts +0 -12
  457. package/dist/types/detectExportedComponentName-DVXsp_FG.d.ts.map +0 -1
  458. package/dist/types/dictionaryStatus-DPVO37qe.d.ts +0 -5
  459. package/dist/types/dictionaryStatus-DPVO37qe.d.ts.map +0 -1
  460. package/dist/types/generateDictionaryListContent-DAtHG6SR.d.ts +0 -10
  461. package/dist/types/generateDictionaryListContent-DAtHG6SR.d.ts.map +0 -1
  462. package/dist/types/getBuiltDictionariesPath-C4it65a1.d.ts +0 -10
  463. package/dist/types/getBuiltDictionariesPath-C4it65a1.d.ts.map +0 -1
  464. package/dist/types/getBuiltDynamicDictionariesPath-Cj9EWnjT.d.ts +0 -10
  465. package/dist/types/getBuiltDynamicDictionariesPath-Cj9EWnjT.d.ts.map +0 -1
  466. package/dist/types/getBuiltFetchDictionariesPath-1JleRhT3.d.ts +0 -10
  467. package/dist/types/getBuiltFetchDictionariesPath-1JleRhT3.d.ts.map +0 -1
  468. package/dist/types/getBuiltRemoteDictionariesPath-DHOmqNCr.d.ts +0 -10
  469. package/dist/types/getBuiltRemoteDictionariesPath-DHOmqNCr.d.ts.map +0 -1
  470. package/dist/types/getBuiltUnmergedDictionariesPath-GUmmLxTB.d.ts +0 -10
  471. package/dist/types/getBuiltUnmergedDictionariesPath-GUmmLxTB.d.ts.map +0 -1
  472. package/dist/types/getContentDeclarationFileTemplate-Dz3rnFy9.d.ts +0 -7
  473. package/dist/types/getContentDeclarationFileTemplate-Dz3rnFy9.d.ts.map +0 -1
  474. package/dist/types/getFormatFromExtension-SdXYWfPx.d.ts +0 -8
  475. package/dist/types/getFormatFromExtension-SdXYWfPx.d.ts.map +0 -1
  476. package/dist/types/loadContentDeclaration-CBMS4vkA.d.ts +0 -12
  477. package/dist/types/loadContentDeclaration-CBMS4vkA.d.ts.map +0 -1
  478. package/dist/types/loadDictionaries-BIqHwtYE.d.ts +0 -23
  479. package/dist/types/loadDictionaries-BIqHwtYE.d.ts.map +0 -1
  480. package/dist/types/loadLocalDictionaries-CNmVaw0c.d.ts +0 -8
  481. package/dist/types/loadLocalDictionaries-CNmVaw0c.d.ts.map +0 -1
  482. package/dist/types/loadRemoteDictionaries-MoITTb7W.d.ts +0 -15
  483. package/dist/types/loadRemoteDictionaries-MoITTb7W.d.ts.map +0 -1
  484. package/dist/types/processContentDeclaration-CAvrHaIT.d.ts +0 -11
  485. package/dist/types/processContentDeclaration-CAvrHaIT.d.ts.map +0 -1
  486. package/dist/types/transformJSFile-Cg0LkeLb.d.ts +0 -11
  487. package/dist/types/transformJSFile-Cg0LkeLb.d.ts.map +0 -1
  488. package/dist/types/writeContentDeclaration-XdGxj0KP.d.ts +0 -19
  489. package/dist/types/writeContentDeclaration-XdGxj0KP.d.ts.map +0 -1
  490. package/dist/types/writeDynamicDictionary-DO8f3FYl.d.ts +0 -48
  491. package/dist/types/writeDynamicDictionary-DO8f3FYl.d.ts.map +0 -1
  492. package/dist/types/writeJSFile-kK95jzg_.d.ts +0 -14
  493. package/dist/types/writeJSFile-kK95jzg_.d.ts.map +0 -1
  494. package/dist/types/writeMergedDictionary-CMeghcRI.d.ts +0 -30
  495. package/dist/types/writeMergedDictionary-CMeghcRI.d.ts.map +0 -1
  496. package/dist/types/writeUnmergedDictionary-Cxx51isz.d.ts +0 -34
  497. package/dist/types/writeUnmergedDictionary-Cxx51isz.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"fileSystem.mjs","names":[],"sources":["../../../../src/init/utils/fileSystem.ts"],"sourcesContent":["import { access, mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\n/**\n * Helper to check if a file exists\n */\nexport const exists = async (rootDir: string, filePath: string) => {\n try {\n await access(join(rootDir, filePath));\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Helper to read a file\n */\nexport const readFileFromRoot = async (rootDir: string, filePath: string) =>\n await readFile(join(rootDir, filePath), 'utf8');\n\n/**\n * Helper to write a file\n */\nexport const writeFileToRoot = async (\n rootDir: string,\n filePath: string,\n content: string\n) => await writeFile(join(rootDir, filePath), content, 'utf8');\n\n/**\n * Helper to ensure a directory exists\n */\nexport const ensureDirectory = async (rootDir: string, dirPath: string) => {\n try {\n await mkdir(join(rootDir, dirPath), { recursive: true });\n } catch {\n // Directory already exists or could not be created\n }\n};\n"],"mappings":"mHAMA,MAAa,EAAS,MAAO,EAAiB,IAAqB,CACjE,GAAI,CAEF,OADA,MAAM,EAAO,EAAK,EAAS,EAAS,CAAC,CAC9B,QACD,CACN,MAAO,KAOE,EAAmB,MAAO,EAAiB,IACtD,MAAM,EAAS,EAAK,EAAS,EAAS,CAAE,OAAO,CAKpC,EAAkB,MAC7B,EACA,EACA,IACG,MAAM,EAAU,EAAK,EAAS,EAAS,CAAE,EAAS,OAAO,CAKjD,EAAkB,MAAO,EAAiB,IAAoB,CACzE,GAAI,CACF,MAAM,EAAM,EAAK,EAAS,EAAQ,CAAE,CAAE,UAAW,GAAM,CAAC,MAClD"}
1
+ {"version":3,"file":"fileSystem.mjs","names":[],"sources":["../../../../src/init/utils/fileSystem.ts"],"sourcesContent":["import { access, mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\n/**\n * Helper to check if a file exists\n */\nexport const exists = async (rootDir: string, filePath: string) => {\n try {\n await access(join(rootDir, filePath));\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Helper to read a file\n */\nexport const readFileFromRoot = async (rootDir: string, filePath: string) =>\n await readFile(join(rootDir, filePath), 'utf8');\n\n/**\n * Helper to write a file\n */\nexport const writeFileToRoot = async (\n rootDir: string,\n filePath: string,\n content: string\n) => await writeFile(join(rootDir, filePath), content, 'utf8');\n\n/**\n * Helper to ensure a directory exists\n */\nexport const ensureDirectory = async (rootDir: string, dirPath: string) => {\n try {\n await mkdir(join(rootDir, dirPath), { recursive: true });\n } catch {\n // Directory already exists or could not be created\n }\n};\n"],"mappings":";;;;;;;AAMA,MAAa,SAAS,OAAO,SAAiB,aAAqB;AACjE,KAAI;AACF,QAAM,OAAO,KAAK,SAAS,SAAS,CAAC;AACrC,SAAO;SACD;AACN,SAAO;;;;;;AAOX,MAAa,mBAAmB,OAAO,SAAiB,aACtD,MAAM,SAAS,KAAK,SAAS,SAAS,EAAE,OAAO;;;;AAKjD,MAAa,kBAAkB,OAC7B,SACA,UACA,YACG,MAAM,UAAU,KAAK,SAAS,SAAS,EAAE,SAAS,OAAO;;;;AAK9D,MAAa,kBAAkB,OAAO,SAAiB,YAAoB;AACzE,KAAI;AACF,QAAM,MAAM,KAAK,SAAS,QAAQ,EAAE,EAAE,WAAW,MAAM,CAAC;SAClD"}
@@ -1 +1,6 @@
1
- import{updateNextConfig as e,updateViteConfig as t}from"./configManipulation.mjs";import{ensureDirectory as n,exists as r,readFileFromRoot as i,writeFileToRoot as a}from"./fileSystem.mjs";import{parseJSONWithComments as o}from"./jsonParser.mjs";import{findTsConfigFiles as s}from"./tsConfig.mjs";export{n as ensureDirectory,r as exists,s as findTsConfigFiles,o as parseJSONWithComments,i as readFileFromRoot,e as updateNextConfig,t as updateViteConfig,a as writeFileToRoot};
1
+ import { updateNextConfig, updateViteConfig } from "./configManipulation.mjs";
2
+ import { ensureDirectory, exists, readFileFromRoot, writeFileToRoot } from "./fileSystem.mjs";
3
+ import { parseJSONWithComments } from "./jsonParser.mjs";
4
+ import { findTsConfigFiles } from "./tsConfig.mjs";
5
+
6
+ export { ensureDirectory, exists, findTsConfigFiles, parseJSONWithComments, readFileFromRoot, updateNextConfig, updateViteConfig, writeFileToRoot };
@@ -1,4 +1,41 @@
1
- const e=e=>{try{return JSON.parse(e)}catch{}let t=e.split(`
2
- `).map(e=>{let t=!1,n=``;for(let r=0;r<e.length;r++){let i=e[r],a=e[r+1];if(i===`"`&&(r===0||e[r-1]!==`\\`)){t=!t,n+=i;continue}if(t){n+=i;continue}if(i===`/`&&a===`/`)break;if(i===`/`&&a===`*`){let t=e.indexOf(`*/`,r+2);if(t!==-1){r=t+1;continue}}n+=i}return n});return JSON.parse(t.join(`
3
- `))};export{e as parseJSONWithComments};
1
+ //#region src/init/utils/jsonParser.ts
2
+ /**
3
+ * Helper to parse JSON that may contain comments (tsconfig allows comments)
4
+ */
5
+ const parseJSONWithComments = (jsonString) => {
6
+ try {
7
+ return JSON.parse(jsonString);
8
+ } catch {}
9
+ const cleanedLines = jsonString.split("\n").map((line) => {
10
+ let inString = false;
11
+ let result = "";
12
+ for (let i = 0; i < line.length; i++) {
13
+ const char = line[i];
14
+ const nextChar = line[i + 1];
15
+ if (char === "\"" && (i === 0 || line[i - 1] !== "\\")) {
16
+ inString = !inString;
17
+ result += char;
18
+ continue;
19
+ }
20
+ if (inString) {
21
+ result += char;
22
+ continue;
23
+ }
24
+ if (char === "/" && nextChar === "/") break;
25
+ if (char === "/" && nextChar === "*") {
26
+ const endIndex = line.indexOf("*/", i + 2);
27
+ if (endIndex !== -1) {
28
+ i = endIndex + 1;
29
+ continue;
30
+ }
31
+ }
32
+ result += char;
33
+ }
34
+ return result;
35
+ });
36
+ return JSON.parse(cleanedLines.join("\n"));
37
+ };
38
+
39
+ //#endregion
40
+ export { parseJSONWithComments };
4
41
  //# sourceMappingURL=jsonParser.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsonParser.mjs","names":[],"sources":["../../../../src/init/utils/jsonParser.ts"],"sourcesContent":["/**\n * Helper to parse JSON that may contain comments (tsconfig allows comments)\n */\nexport const parseJSONWithComments = (jsonString: string) => {\n // First, try parsing as-is (most tsconfig files don't have comments)\n try {\n return JSON.parse(jsonString);\n } catch {\n // If that fails, try stripping comments\n // Note: This simple approach removes comments line by line to avoid\n // matching glob patterns like /* and */ that appear in paths\n }\n\n // Process line by line to safely remove comments\n const lines = jsonString.split('\\n');\n const cleanedLines = lines.map((line) => {\n // Track if we're inside a string\n let inString = false;\n let result = '';\n\n for (let i = 0; i < line.length; i++) {\n const char = line[i];\n const nextChar = line[i + 1];\n\n // Handle string boundaries (accounting for escaped quotes)\n if (char === '\"' && (i === 0 || line[i - 1] !== '\\\\')) {\n inString = !inString;\n result += char;\n continue;\n }\n\n // If we're inside a string, keep the character\n if (inString) {\n result += char;\n continue;\n }\n\n // Check for single-line comment outside of strings\n if (char === '/' && nextChar === '/') {\n // Rest of line is a comment, stop here\n break;\n }\n\n // Check for multi-line comment start (/* ... */)\n // For simplicity, we only handle single-line /* */ comments here\n if (char === '/' && nextChar === '*') {\n const endIndex = line.indexOf('*/', i + 2);\n if (endIndex !== -1) {\n // Skip the comment\n i = endIndex + 1;\n continue;\n }\n }\n\n result += char;\n }\n\n return result;\n });\n\n return JSON.parse(cleanedLines.join('\\n'));\n};\n"],"mappings":"AAGA,MAAa,EAAyB,GAAuB,CAE3D,GAAI,CACF,OAAO,KAAK,MAAM,EAAW,MACvB,EAQR,IAAM,EADQ,EAAW,MAAM;EAAK,CACT,IAAK,GAAS,CAEvC,IAAI,EAAW,GACX,EAAS,GAEb,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,OAAQ,IAAK,CACpC,IAAM,EAAO,EAAK,GACZ,EAAW,EAAK,EAAI,GAG1B,GAAI,IAAS,MAAQ,IAAM,GAAK,EAAK,EAAI,KAAO,MAAO,CACrD,EAAW,CAAC,EACZ,GAAU,EACV,SAIF,GAAI,EAAU,CACZ,GAAU,EACV,SAIF,GAAI,IAAS,KAAO,IAAa,IAE/B,MAKF,GAAI,IAAS,KAAO,IAAa,IAAK,CACpC,IAAM,EAAW,EAAK,QAAQ,KAAM,EAAI,EAAE,CAC1C,GAAI,IAAa,GAAI,CAEnB,EAAI,EAAW,EACf,UAIJ,GAAU,EAGZ,OAAO,GACP,CAEF,OAAO,KAAK,MAAM,EAAa,KAAK;EAAK,CAAC"}
1
+ {"version":3,"file":"jsonParser.mjs","names":[],"sources":["../../../../src/init/utils/jsonParser.ts"],"sourcesContent":["/**\n * Helper to parse JSON that may contain comments (tsconfig allows comments)\n */\nexport const parseJSONWithComments = (jsonString: string) => {\n // First, try parsing as-is (most tsconfig files don't have comments)\n try {\n return JSON.parse(jsonString);\n } catch {\n // If that fails, try stripping comments\n // Note: This simple approach removes comments line by line to avoid\n // matching glob patterns like /* and */ that appear in paths\n }\n\n // Process line by line to safely remove comments\n const lines = jsonString.split('\\n');\n const cleanedLines = lines.map((line) => {\n // Track if we're inside a string\n let inString = false;\n let result = '';\n\n for (let i = 0; i < line.length; i++) {\n const char = line[i];\n const nextChar = line[i + 1];\n\n // Handle string boundaries (accounting for escaped quotes)\n if (char === '\"' && (i === 0 || line[i - 1] !== '\\\\')) {\n inString = !inString;\n result += char;\n continue;\n }\n\n // If we're inside a string, keep the character\n if (inString) {\n result += char;\n continue;\n }\n\n // Check for single-line comment outside of strings\n if (char === '/' && nextChar === '/') {\n // Rest of line is a comment, stop here\n break;\n }\n\n // Check for multi-line comment start (/* ... */)\n // For simplicity, we only handle single-line /* */ comments here\n if (char === '/' && nextChar === '*') {\n const endIndex = line.indexOf('*/', i + 2);\n if (endIndex !== -1) {\n // Skip the comment\n i = endIndex + 1;\n continue;\n }\n }\n\n result += char;\n }\n\n return result;\n });\n\n return JSON.parse(cleanedLines.join('\\n'));\n};\n"],"mappings":";;;;AAGA,MAAa,yBAAyB,eAAuB;AAE3D,KAAI;AACF,SAAO,KAAK,MAAM,WAAW;SACvB;CAQR,MAAM,eADQ,WAAW,MAAM,KAAK,CACT,KAAK,SAAS;EAEvC,IAAI,WAAW;EACf,IAAI,SAAS;AAEb,OAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;GACpC,MAAM,OAAO,KAAK;GAClB,MAAM,WAAW,KAAK,IAAI;AAG1B,OAAI,SAAS,SAAQ,MAAM,KAAK,KAAK,IAAI,OAAO,OAAO;AACrD,eAAW,CAAC;AACZ,cAAU;AACV;;AAIF,OAAI,UAAU;AACZ,cAAU;AACV;;AAIF,OAAI,SAAS,OAAO,aAAa,IAE/B;AAKF,OAAI,SAAS,OAAO,aAAa,KAAK;IACpC,MAAM,WAAW,KAAK,QAAQ,MAAM,IAAI,EAAE;AAC1C,QAAI,aAAa,IAAI;AAEnB,SAAI,WAAW;AACf;;;AAIJ,aAAU;;AAGZ,SAAO;GACP;AAEF,QAAO,KAAK,MAAM,aAAa,KAAK,KAAK,CAAC"}
@@ -1,2 +1,17 @@
1
- import{readdir as e}from"node:fs/promises";const t=async t=>{try{return(await e(t)).filter(e=>e===`tsconfig.json`||/^tsconfig\..+\.json$/.test(e))}catch{return[]}};export{t as findTsConfigFiles};
1
+ import { readdir } from "node:fs/promises";
2
+
3
+ //#region src/init/utils/tsConfig.ts
4
+ /**
5
+ * Helper to find all tsconfig files (tsconfig.json, tsconfig.*.json)
6
+ */
7
+ const findTsConfigFiles = async (rootDir) => {
8
+ try {
9
+ return (await readdir(rootDir)).filter((file) => file === "tsconfig.json" || /^tsconfig\..+\.json$/.test(file));
10
+ } catch {
11
+ return [];
12
+ }
13
+ };
14
+
15
+ //#endregion
16
+ export { findTsConfigFiles };
2
17
  //# sourceMappingURL=tsConfig.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsConfig.mjs","names":[],"sources":["../../../../src/init/utils/tsConfig.ts"],"sourcesContent":["import { readdir } from 'node:fs/promises';\n\n/**\n * Helper to find all tsconfig files (tsconfig.json, tsconfig.*.json)\n */\nexport const findTsConfigFiles = async (rootDir: string): Promise<string[]> => {\n try {\n const files = await readdir(rootDir);\n\n return files.filter(\n (file) => file === 'tsconfig.json' || /^tsconfig\\..+\\.json$/.test(file)\n );\n } catch {\n return [];\n }\n};\n"],"mappings":"2CAKA,MAAa,EAAoB,KAAO,IAAuC,CAC7E,GAAI,CAGF,OAFc,MAAM,EAAQ,EAAQ,EAEvB,OACV,GAAS,IAAS,iBAAmB,uBAAuB,KAAK,EAAK,CACxE,MACK,CACN,MAAO,EAAE"}
1
+ {"version":3,"file":"tsConfig.mjs","names":[],"sources":["../../../../src/init/utils/tsConfig.ts"],"sourcesContent":["import { readdir } from 'node:fs/promises';\n\n/**\n * Helper to find all tsconfig files (tsconfig.json, tsconfig.*.json)\n */\nexport const findTsConfigFiles = async (rootDir: string): Promise<string[]> => {\n try {\n const files = await readdir(rootDir);\n\n return files.filter(\n (file) => file === 'tsconfig.json' || /^tsconfig\\..+\\.json$/.test(file)\n );\n } catch {\n return [];\n }\n};\n"],"mappings":";;;;;;AAKA,MAAa,oBAAoB,OAAO,YAAuC;AAC7E,KAAI;AAGF,UAFc,MAAM,QAAQ,QAAQ,EAEvB,QACV,SAAS,SAAS,mBAAmB,uBAAuB,KAAK,KAAK,CACxE;SACK;AACN,SAAO,EAAE"}
@@ -1,2 +1,38 @@
1
- import{t as e}from"../_utils_asset-4w8dPH9r.mjs";import{writeFile as t}from"node:fs/promises";import{join as n,relative as r}from"node:path";import{colorizePath as i,logger as a,v as o}from"@intlayer/config/logger";import{searchConfigurationFile as s}from"@intlayer/config/node";const c=process.cwd(),l=async(e,r)=>await t(n(c,e),r,`utf8`),u=e=>{switch(e){case`ts`:return`./templates/ts.txt`;case`cjs`:return`./templates/cjs.txt`;case`mjs`:return`./templates/mjs.txt`;case`js`:return`./templates/mjs.txt`;case`json`:return`./templates/json.txt`;default:return`./templates/ts.txt`}},d=async(t,n)=>{let{configurationFilePath:c}=s(n);if(c){a(`${o} ${i(r(n,c))} already exists`);return}await l(t,e(u(t.split(`.`).pop()))),a(`${o} Created ${i(t)}`)};export{d as initConfig};
1
+ import { readAsset } from "../_virtual/_utils_asset.mjs";
2
+ import { writeFile } from "node:fs/promises";
3
+ import { join, relative } from "node:path";
4
+ import { colorizePath, logger, v } from "@intlayer/config/logger";
5
+ import { searchConfigurationFile } from "@intlayer/config/node";
6
+
7
+ //#region src/initConfig/index.ts
8
+ /**
9
+ * UTILITIES
10
+ */
11
+ const rootDir = process.cwd();
12
+ const writeFileToRoot = async (filePath, content) => await writeFile(join(rootDir, filePath), content, "utf8");
13
+ const getTemplatePath = (format) => {
14
+ switch (format) {
15
+ case "ts": return "./templates/ts.txt";
16
+ case "cjs": return "./templates/cjs.txt";
17
+ case "mjs": return "./templates/mjs.txt";
18
+ case "js": return "./templates/mjs.txt";
19
+ case "json": return "./templates/json.txt";
20
+ default: return "./templates/ts.txt";
21
+ }
22
+ };
23
+ /**
24
+ * Initialize the Intlayer configuration file
25
+ */
26
+ const initConfig = async (format, baseDir) => {
27
+ const { configurationFilePath } = searchConfigurationFile(baseDir);
28
+ if (configurationFilePath) {
29
+ logger(`${v} ${colorizePath(relative(baseDir, configurationFilePath))} already exists`);
30
+ return;
31
+ }
32
+ await writeFileToRoot(format, readAsset(getTemplatePath(format.split(".").pop())));
33
+ logger(`${v} Created ${colorizePath(format)}`);
34
+ };
35
+
36
+ //#endregion
37
+ export { initConfig };
2
38
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/initConfig/index.ts"],"sourcesContent":["import { writeFile } from 'node:fs/promises';\nimport { join, relative } from 'node:path';\nimport { readAsset } from 'utils:asset';\nimport { colorizePath, logger, v } from '@intlayer/config/logger';\nimport {\n type configurationFilesCandidates,\n searchConfigurationFile,\n} from '@intlayer/config/node';\n\n/**\n * UTILITIES\n */\nconst rootDir = process.cwd();\n\n// Helper to write a file\nconst writeFileToRoot = async (filePath: string, content: string) =>\n await writeFile(join(rootDir, filePath), content, 'utf8');\n\ntype ConfigFormat = 'ts' | 'cjs' | 'mjs' | 'js' | 'json';\n\nconst getTemplatePath = (format: ConfigFormat) => {\n switch (format) {\n case 'ts':\n return './templates/ts.txt';\n case 'cjs':\n return './templates/cjs.txt';\n case 'mjs':\n return './templates/mjs.txt';\n case 'js':\n return './templates/mjs.txt';\n case 'json':\n return './templates/json.txt';\n default:\n return './templates/ts.txt';\n }\n};\n\n/**\n * Initialize the Intlayer configuration file\n */\nexport const initConfig = async (\n format: (typeof configurationFilesCandidates)[number],\n baseDir: string\n) => {\n // Search for configuration file\n const { configurationFilePath } = searchConfigurationFile(baseDir);\n\n // return if the configuration file is found\n if (configurationFilePath) {\n const relativePath = relative(baseDir, configurationFilePath);\n logger(`${v} ${colorizePath(relativePath)} already exists`);\n return;\n }\n\n // Extract the format from the filename (e.g. 'intlayer.config.ts' -> 'ts')\n const extension = format.split('.').pop() as ConfigFormat;\n\n const templatePath = getTemplatePath(extension);\n const configContent = readAsset(templatePath);\n\n await writeFileToRoot(format, configContent);\n logger(`${v} Created ${colorizePath(format)}`);\n};\n"],"mappings":"uRAYA,MAAM,EAAU,QAAQ,KAAK,CAGvB,EAAkB,MAAO,EAAkB,IAC/C,MAAM,EAAU,EAAK,EAAS,EAAS,CAAE,EAAS,OAAO,CAIrD,EAAmB,GAAyB,CAChD,OAAQ,EAAR,CACE,IAAK,KACH,MAAO,qBACT,IAAK,MACH,MAAO,sBACT,IAAK,MACH,MAAO,sBACT,IAAK,KACH,MAAO,sBACT,IAAK,OACH,MAAO,uBACT,QACE,MAAO,uBAOA,EAAa,MACxB,EACA,IACG,CAEH,GAAM,CAAE,yBAA0B,EAAwB,EAAQ,CAGlE,GAAI,EAAuB,CAEzB,EAAO,GAAG,EAAE,GAAG,EADM,EAAS,EAAS,EAAsB,CACpB,CAAC,iBAAiB,CAC3D,OASF,MAAM,EAAgB,EAFA,EADD,EAFH,EAAO,MAAM,IAAI,CAAC,KAAK,CAEM,CACF,CAED,CAC5C,EAAO,GAAG,EAAE,WAAW,EAAa,EAAO,GAAG"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/initConfig/index.ts"],"sourcesContent":["import { writeFile } from 'node:fs/promises';\nimport { join, relative } from 'node:path';\nimport { readAsset } from 'utils:asset';\nimport { colorizePath, logger, v } from '@intlayer/config/logger';\nimport {\n type configurationFilesCandidates,\n searchConfigurationFile,\n} from '@intlayer/config/node';\n\n/**\n * UTILITIES\n */\nconst rootDir = process.cwd();\n\n// Helper to write a file\nconst writeFileToRoot = async (filePath: string, content: string) =>\n await writeFile(join(rootDir, filePath), content, 'utf8');\n\ntype ConfigFormat = 'ts' | 'cjs' | 'mjs' | 'js' | 'json';\n\nconst getTemplatePath = (format: ConfigFormat) => {\n switch (format) {\n case 'ts':\n return './templates/ts.txt';\n case 'cjs':\n return './templates/cjs.txt';\n case 'mjs':\n return './templates/mjs.txt';\n case 'js':\n return './templates/mjs.txt';\n case 'json':\n return './templates/json.txt';\n default:\n return './templates/ts.txt';\n }\n};\n\n/**\n * Initialize the Intlayer configuration file\n */\nexport const initConfig = async (\n format: (typeof configurationFilesCandidates)[number],\n baseDir: string\n) => {\n // Search for configuration file\n const { configurationFilePath } = searchConfigurationFile(baseDir);\n\n // return if the configuration file is found\n if (configurationFilePath) {\n const relativePath = relative(baseDir, configurationFilePath);\n logger(`${v} ${colorizePath(relativePath)} already exists`);\n return;\n }\n\n // Extract the format from the filename (e.g. 'intlayer.config.ts' -> 'ts')\n const extension = format.split('.').pop() as ConfigFormat;\n\n const templatePath = getTemplatePath(extension);\n const configContent = readAsset(templatePath);\n\n await writeFileToRoot(format, configContent);\n logger(`${v} Created ${colorizePath(format)}`);\n};\n"],"mappings":";;;;;;;;;;AAYA,MAAM,UAAU,QAAQ,KAAK;AAG7B,MAAM,kBAAkB,OAAO,UAAkB,YAC/C,MAAM,UAAU,KAAK,SAAS,SAAS,EAAE,SAAS,OAAO;AAI3D,MAAM,mBAAmB,WAAyB;AAChD,SAAQ,QAAR;EACE,KAAK,KACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,QACE,QAAO;;;;;;AAOb,MAAa,aAAa,OACxB,QACA,YACG;CAEH,MAAM,EAAE,0BAA0B,wBAAwB,QAAQ;AAGlE,KAAI,uBAAuB;AAEzB,SAAO,GAAG,EAAE,GAAG,aADM,SAAS,SAAS,sBAAsB,CACpB,CAAC,iBAAiB;AAC3D;;AASF,OAAM,gBAAgB,QAFA,UADD,gBAFH,OAAO,MAAM,IAAI,CAAC,KAAK,CAEM,CACF,CAED;AAC5C,QAAO,GAAG,EAAE,WAAW,aAAa,OAAO,GAAG"}
@@ -1,2 +1,47 @@
1
- import"../_utils_asset-4w8dPH9r.mjs";import{PLATFORMS_METADATA as e}from"../installSkills/index.mjs";import t from"node:path";import{promises as n}from"node:fs";import r from"node:os";const i=process.platform===`win32`?t.join(process.env.APPDATA||``,`Claude`,`claude_desktop_config.json`):t.join(r.homedir(),`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`),a=async(r,a,o)=>{let s,c=`mcpServers`;if(a===`Claude`)s=i;else{let n=t.dirname(e[a].dir);s=t.join(r,n,`mcp.json`),a===`VSCode`&&(c=`servers`)}await n.mkdir(t.dirname(s),{recursive:!0});let l={};try{let e=await n.readFile(s,`utf-8`);l=JSON.parse(e)}catch{}if(l[c]||(l[c]={}),o===`stdio`){let e={command:`npx`,args:[`-y`,`@intlayer/mcp`]};a===`VSCode`&&(e.type=`stdio`),l[c].intlayer=e}else{let e={url:`https://mcp.intlayer.org`};a===`VSCode`?e.type=`sse`:e.transport=`sse`,l[c].intlayer=e}return await n.writeFile(s,JSON.stringify(l,null,2),`utf-8`),`MCP server configuration updated in ${s}`};export{a as installMCP};
1
+ import { PLATFORMS_METADATA } from "../installSkills/index.mjs";
2
+ import path from "node:path";
3
+ import { promises } from "node:fs";
4
+ import os from "node:os";
5
+
6
+ //#region src/installMCP/installMCP.ts
7
+ const MCP_CONFIG_FILENAME = "mcp.json";
8
+ const CLAUDE_DESKTOP_CONFIG_PATH = process.platform === "win32" ? path.join(process.env.APPDATA || "", "Claude", "claude_desktop_config.json") : path.join(os.homedir(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
9
+ /**
10
+ * Installs the Intlayer MCP server configuration for a specific platform.
11
+ */
12
+ const installMCP = async (projectRoot, platform, transport) => {
13
+ let configPath;
14
+ let configKey = "mcpServers";
15
+ if (platform === "Claude") configPath = CLAUDE_DESKTOP_CONFIG_PATH;
16
+ else {
17
+ const relativeDir = path.dirname(PLATFORMS_METADATA[platform].dir);
18
+ configPath = path.join(projectRoot, relativeDir, MCP_CONFIG_FILENAME);
19
+ if (platform === "VSCode") configKey = "servers";
20
+ }
21
+ await promises.mkdir(path.dirname(configPath), { recursive: true });
22
+ let config = {};
23
+ try {
24
+ const content = await promises.readFile(configPath, "utf-8");
25
+ config = JSON.parse(content);
26
+ } catch {}
27
+ if (!config[configKey]) config[configKey] = {};
28
+ if (transport === "stdio") {
29
+ const mcpConfig = {
30
+ command: "npx",
31
+ args: ["-y", "@intlayer/mcp"]
32
+ };
33
+ if (platform === "VSCode") mcpConfig.type = "stdio";
34
+ config[configKey].intlayer = mcpConfig;
35
+ } else {
36
+ const mcpConfig = { url: "https://mcp.intlayer.org" };
37
+ if (platform === "VSCode") mcpConfig.type = "sse";
38
+ else mcpConfig.transport = "sse";
39
+ config[configKey].intlayer = mcpConfig;
40
+ }
41
+ await promises.writeFile(configPath, JSON.stringify(config, null, 2), "utf-8");
42
+ return `MCP server configuration updated in ${configPath}`;
43
+ };
44
+
45
+ //#endregion
46
+ export { installMCP };
2
47
  //# sourceMappingURL=installMCP.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"installMCP.mjs","names":["fs"],"sources":["../../../src/installMCP/installMCP.ts"],"sourcesContent":["import { promises as fs } from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { PLATFORMS_METADATA, type Platform } from '../installSkills';\n\nexport type MCPTransport = 'stdio' | 'sse';\n\nconst MCP_CONFIG_FILENAME = 'mcp.json';\n\nconst CLAUDE_DESKTOP_CONFIG_PATH =\n process.platform === 'win32'\n ? path.join(\n process.env.APPDATA || '',\n 'Claude',\n 'claude_desktop_config.json'\n )\n : path.join(\n os.homedir(),\n 'Library',\n 'Application Support',\n 'Claude',\n 'claude_desktop_config.json'\n );\n\n/**\n * Installs the Intlayer MCP server configuration for a specific platform.\n */\nexport const installMCP = async (\n projectRoot: string,\n platform: Platform,\n transport: MCPTransport\n): Promise<string> => {\n let configPath: string;\n let configKey = 'mcpServers';\n\n if (platform === 'Claude') {\n configPath = CLAUDE_DESKTOP_CONFIG_PATH;\n } else {\n const relativeDir = path.dirname(PLATFORMS_METADATA[platform].dir); // e.g. .cursor or .vscode\n configPath = path.join(projectRoot, relativeDir, MCP_CONFIG_FILENAME);\n\n if (platform === 'VSCode') {\n configKey = 'servers';\n }\n }\n\n // Ensure the configuration directory exists\n await fs.mkdir(path.dirname(configPath), { recursive: true });\n\n let config: any = {};\n try {\n const content = await fs.readFile(configPath, 'utf-8');\n config = JSON.parse(content);\n } catch {\n // File doesn't exist or is invalid JSON, start fresh\n }\n\n if (!config[configKey]) {\n config[configKey] = {};\n }\n\n if (transport === 'stdio') {\n const mcpConfig: any = {\n command: 'npx',\n args: ['-y', '@intlayer/mcp'],\n };\n\n if (platform === 'VSCode') {\n mcpConfig.type = 'stdio';\n }\n\n config[configKey].intlayer = mcpConfig;\n } else {\n const mcpConfig: any = {\n url: 'https://mcp.intlayer.org',\n };\n\n if (platform === 'VSCode') {\n mcpConfig.type = 'sse';\n } else {\n mcpConfig.transport = 'sse';\n }\n\n config[configKey].intlayer = mcpConfig;\n }\n\n await fs.writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');\n\n return `MCP server configuration updated in ${configPath}`;\n};\n"],"mappings":"wLAOA,MAEM,EACJ,QAAQ,WAAa,QACjB,EAAK,KACH,QAAQ,IAAI,SAAW,GACvB,SACA,6BACD,CACD,EAAK,KACH,EAAG,SAAS,CACZ,UACA,sBACA,SACA,6BACD,CAKM,EAAa,MACxB,EACA,EACA,IACoB,CACpB,IAAI,EACA,EAAY,aAEhB,GAAI,IAAa,SACf,EAAa,MACR,CACL,IAAM,EAAc,EAAK,QAAQ,EAAmB,GAAU,IAAI,CAClE,EAAa,EAAK,KAAK,EAAa,EAAa,WAAoB,CAEjE,IAAa,WACf,EAAY,WAKhB,MAAMA,EAAG,MAAM,EAAK,QAAQ,EAAW,CAAE,CAAE,UAAW,GAAM,CAAC,CAE7D,IAAI,EAAc,EAAE,CACpB,GAAI,CACF,IAAM,EAAU,MAAMA,EAAG,SAAS,EAAY,QAAQ,CACtD,EAAS,KAAK,MAAM,EAAQ,MACtB,EAQR,GAJK,EAAO,KACV,EAAO,GAAa,EAAE,EAGpB,IAAc,QAAS,CACzB,IAAM,EAAiB,CACrB,QAAS,MACT,KAAM,CAAC,KAAM,gBAAgB,CAC9B,CAEG,IAAa,WACf,EAAU,KAAO,SAGnB,EAAO,GAAW,SAAW,MACxB,CACL,IAAM,EAAiB,CACrB,IAAK,2BACN,CAEG,IAAa,SACf,EAAU,KAAO,MAEjB,EAAU,UAAY,MAGxB,EAAO,GAAW,SAAW,EAK/B,OAFA,MAAMA,EAAG,UAAU,EAAY,KAAK,UAAU,EAAQ,KAAM,EAAE,CAAE,QAAQ,CAEjE,uCAAuC"}
1
+ {"version":3,"file":"installMCP.mjs","names":["fs"],"sources":["../../../src/installMCP/installMCP.ts"],"sourcesContent":["import { promises as fs } from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { PLATFORMS_METADATA, type Platform } from '../installSkills';\n\nexport type MCPTransport = 'stdio' | 'sse';\n\nconst MCP_CONFIG_FILENAME = 'mcp.json';\n\nconst CLAUDE_DESKTOP_CONFIG_PATH =\n process.platform === 'win32'\n ? path.join(\n process.env.APPDATA || '',\n 'Claude',\n 'claude_desktop_config.json'\n )\n : path.join(\n os.homedir(),\n 'Library',\n 'Application Support',\n 'Claude',\n 'claude_desktop_config.json'\n );\n\n/**\n * Installs the Intlayer MCP server configuration for a specific platform.\n */\nexport const installMCP = async (\n projectRoot: string,\n platform: Platform,\n transport: MCPTransport\n): Promise<string> => {\n let configPath: string;\n let configKey = 'mcpServers';\n\n if (platform === 'Claude') {\n configPath = CLAUDE_DESKTOP_CONFIG_PATH;\n } else {\n const relativeDir = path.dirname(PLATFORMS_METADATA[platform].dir); // e.g. .cursor or .vscode\n configPath = path.join(projectRoot, relativeDir, MCP_CONFIG_FILENAME);\n\n if (platform === 'VSCode') {\n configKey = 'servers';\n }\n }\n\n // Ensure the configuration directory exists\n await fs.mkdir(path.dirname(configPath), { recursive: true });\n\n let config: any = {};\n try {\n const content = await fs.readFile(configPath, 'utf-8');\n config = JSON.parse(content);\n } catch {\n // File doesn't exist or is invalid JSON, start fresh\n }\n\n if (!config[configKey]) {\n config[configKey] = {};\n }\n\n if (transport === 'stdio') {\n const mcpConfig: any = {\n command: 'npx',\n args: ['-y', '@intlayer/mcp'],\n };\n\n if (platform === 'VSCode') {\n mcpConfig.type = 'stdio';\n }\n\n config[configKey].intlayer = mcpConfig;\n } else {\n const mcpConfig: any = {\n url: 'https://mcp.intlayer.org',\n };\n\n if (platform === 'VSCode') {\n mcpConfig.type = 'sse';\n } else {\n mcpConfig.transport = 'sse';\n }\n\n config[configKey].intlayer = mcpConfig;\n }\n\n await fs.writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');\n\n return `MCP server configuration updated in ${configPath}`;\n};\n"],"mappings":";;;;;;AAOA,MAAM,sBAAsB;AAE5B,MAAM,6BACJ,QAAQ,aAAa,UACjB,KAAK,KACH,QAAQ,IAAI,WAAW,IACvB,UACA,6BACD,GACD,KAAK,KACH,GAAG,SAAS,EACZ,WACA,uBACA,UACA,6BACD;;;;AAKP,MAAa,aAAa,OACxB,aACA,UACA,cACoB;CACpB,IAAI;CACJ,IAAI,YAAY;AAEhB,KAAI,aAAa,SACf,cAAa;MACR;EACL,MAAM,cAAc,KAAK,QAAQ,mBAAmB,UAAU,IAAI;AAClE,eAAa,KAAK,KAAK,aAAa,aAAa,oBAAoB;AAErE,MAAI,aAAa,SACf,aAAY;;AAKhB,OAAMA,SAAG,MAAM,KAAK,QAAQ,WAAW,EAAE,EAAE,WAAW,MAAM,CAAC;CAE7D,IAAI,SAAc,EAAE;AACpB,KAAI;EACF,MAAM,UAAU,MAAMA,SAAG,SAAS,YAAY,QAAQ;AACtD,WAAS,KAAK,MAAM,QAAQ;SACtB;AAIR,KAAI,CAAC,OAAO,WACV,QAAO,aAAa,EAAE;AAGxB,KAAI,cAAc,SAAS;EACzB,MAAM,YAAiB;GACrB,SAAS;GACT,MAAM,CAAC,MAAM,gBAAgB;GAC9B;AAED,MAAI,aAAa,SACf,WAAU,OAAO;AAGnB,SAAO,WAAW,WAAW;QACxB;EACL,MAAM,YAAiB,EACrB,KAAK,4BACN;AAED,MAAI,aAAa,SACf,WAAU,OAAO;MAEjB,WAAU,YAAY;AAGxB,SAAO,WAAW,WAAW;;AAG/B,OAAMA,SAAG,UAAU,YAAY,KAAK,UAAU,QAAQ,MAAM,EAAE,EAAE,QAAQ;AAExE,QAAO,uCAAuC"}
@@ -1,2 +1,296 @@
1
- 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};
1
+ import { readAsset } from "../_virtual/_utils_asset.mjs";
2
+ import path from "node:path";
3
+ import { v } from "@intlayer/config/logger";
4
+ import { promises } from "node:fs";
5
+ import { getMarkdownMetadata } from "@intlayer/core/markdown";
6
+
7
+ //#region src/installSkills/index.ts
8
+ /**
9
+ * Metadata for each available documentation skill.
10
+ */
11
+ const SKILLS_METADATA = {
12
+ Config: "Intlayer configuration documentation",
13
+ Content: "Reference for all Intlayer content node types (t, enu, etc.)",
14
+ Usage: "How to use Intlayer in your project",
15
+ CLI: "Intlayer CLI commands and usage",
16
+ Compiler: "Intlayer Compiler setup and usage for automatic content extraction without .content files",
17
+ RemoteContent: "How to use Intlayer with Remote/CMS/Server-side content",
18
+ NextJS: "Next.js-specific usage (Server & Client components)",
19
+ React: "React-specific syntax and hooks usage",
20
+ Vue: "Vue-specific composables and syntax",
21
+ Svelte: "Svelte-specific stores and syntax",
22
+ Angular: "Angular-specific syntax and Injectable Function usage",
23
+ Preact: "Preact-specific syntax and hooks usage",
24
+ 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.",
25
+ Astro: "Astro-specific usage and getIntlayer"
26
+ };
27
+ const SKILLS = Object.keys(SKILLS_METADATA);
28
+ const getInitialSkills = (deps) => {
29
+ const skills = [
30
+ "Usage",
31
+ "Content",
32
+ "Config",
33
+ "CLI",
34
+ "Compiler"
35
+ ];
36
+ if (deps.next) skills.push("NextJS");
37
+ if (deps.react || !deps.next) skills.push("React");
38
+ if (deps.preact) skills.push("Preact");
39
+ if (deps["solid-js"]) skills.push("Solid");
40
+ if (deps.vue || deps.nuxt) skills.push("Vue");
41
+ if (deps.svelte || deps["@sveltejs/kit"]) skills.push("Svelte");
42
+ if (deps.astro) skills.push("Astro");
43
+ return skills;
44
+ };
45
+ /**
46
+ * Metadata and configuration for each supported platform.
47
+ */
48
+ const PLATFORMS_METADATA = {
49
+ Cursor: {
50
+ label: "Cursor",
51
+ dir: ".cursor/skills",
52
+ check: () => process.env.CURSOR === "true" || process.env.TERM_PROGRAM === "cursor"
53
+ },
54
+ Windsurf: {
55
+ label: "Windsurf",
56
+ dir: ".windsurf/skills",
57
+ check: () => process.env.WINDSURF === "true" || process.env.TERM_PROGRAM === "windsurf"
58
+ },
59
+ Trae: {
60
+ label: "Trae",
61
+ dir: ".trae/skills",
62
+ check: () => process.env.TRAE === "true" || process.env.TERM_PROGRAM === "trae"
63
+ },
64
+ TraeCN: {
65
+ label: "Trae CN",
66
+ dir: ".trae/skills",
67
+ check: () => process.env.TRAE_CN === "true"
68
+ },
69
+ VSCode: {
70
+ label: "VS Code",
71
+ dir: ".vscode/skills",
72
+ check: () => process.env.VSCODE === "true" || process.env.TERM_PROGRAM === "vscode"
73
+ },
74
+ OpenCode: {
75
+ label: "OpenCode",
76
+ dir: ".opencode/skills",
77
+ check: () => process.env.OPENCODE === "true"
78
+ },
79
+ Claude: {
80
+ label: "Claude Code",
81
+ dir: ".claude/skills",
82
+ check: () => process.env.CLAUDE === "true"
83
+ },
84
+ GitHub: {
85
+ label: "GitHub Copilot Workspace",
86
+ dir: ".github/skills",
87
+ check: () => process.env.GITHUB_ACTIONS === "true" || !!process.env.GITHUB_WORKSPACE
88
+ },
89
+ Antigravity: {
90
+ label: "Antigravity",
91
+ dir: ".agent/skills"
92
+ },
93
+ Augment: {
94
+ label: "Augment",
95
+ dir: ".augment/skills"
96
+ },
97
+ OpenClaw: {
98
+ label: "OpenClaw",
99
+ dir: "skills"
100
+ },
101
+ Cline: {
102
+ label: "Cline",
103
+ dir: ".cline/skills"
104
+ },
105
+ CodeBuddy: {
106
+ label: "CodeBuddy",
107
+ dir: ".codebuddy/skills"
108
+ },
109
+ CommandCode: {
110
+ label: "Command Code",
111
+ dir: ".commandcode/skills"
112
+ },
113
+ Continue: {
114
+ label: "Continue",
115
+ dir: ".continue/skills"
116
+ },
117
+ Crush: {
118
+ label: "Crush",
119
+ dir: ".crush/skills"
120
+ },
121
+ Droid: {
122
+ label: "Droid",
123
+ dir: ".factory/skills"
124
+ },
125
+ Goose: {
126
+ label: "Goose",
127
+ dir: ".goose/skills"
128
+ },
129
+ IFlow: {
130
+ label: "iFlow CLI",
131
+ dir: ".iflow/skills"
132
+ },
133
+ Junie: {
134
+ label: "Junie",
135
+ dir: ".junie/skills"
136
+ },
137
+ KiloCode: {
138
+ label: "Kilo Code",
139
+ dir: ".kilocode/skills"
140
+ },
141
+ Kiro: {
142
+ label: "Kiro CLI",
143
+ dir: ".kiro/skills"
144
+ },
145
+ Kode: {
146
+ label: "Kode",
147
+ dir: ".kode/skills"
148
+ },
149
+ MCPJam: {
150
+ label: "MCPJam",
151
+ dir: ".mcpjam/skills"
152
+ },
153
+ MistralVibe: {
154
+ label: "Mistral Vibe",
155
+ dir: ".vibe/skills"
156
+ },
157
+ Mux: {
158
+ label: "Mux",
159
+ dir: ".mux/skills"
160
+ },
161
+ OpenHands: {
162
+ label: "OpenHands",
163
+ dir: ".openhands/skills"
164
+ },
165
+ Pi: {
166
+ label: "Pi",
167
+ dir: ".pi/skills"
168
+ },
169
+ Qoder: {
170
+ label: "Qoder",
171
+ dir: ".qoder/skills"
172
+ },
173
+ Qwen: {
174
+ label: "Qwen Code",
175
+ dir: ".qwen/skills"
176
+ },
177
+ RooCode: {
178
+ label: "Roo Code",
179
+ dir: ".roo/skills"
180
+ },
181
+ Zencoder: {
182
+ label: "Zencoder",
183
+ dir: ".zencoder/skills"
184
+ },
185
+ Neovate: {
186
+ label: "Neovate",
187
+ dir: ".neovate/skills"
188
+ },
189
+ Pochi: {
190
+ label: "Pochi",
191
+ dir: ".pochi/skills"
192
+ },
193
+ Other: {
194
+ label: "Other",
195
+ dir: "skills"
196
+ }
197
+ };
198
+ const PLATFORMS = Object.keys(PLATFORMS_METADATA);
199
+ /**
200
+ * Maps specific skill keys to special filenames if they differ from standard snake_case.
201
+ */
202
+ const SKILL_FILENAME_MAP = {};
203
+ /**
204
+ * Helper to convert CamelCase to kebab-case for directory naming
205
+ */
206
+ const camelToKebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
207
+ /**
208
+ * Reads the raw markdown content for a specific skill from the assets folder.
209
+ */
210
+ const getSkillContent = (skill) => {
211
+ const fileName = `./skills/${SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill)}.md`;
212
+ try {
213
+ return readAsset(fileName);
214
+ } catch {
215
+ console.warn(`Warning: Could not read asset for skill: ${skill} at ${fileName}`);
216
+ return "";
217
+ }
218
+ };
219
+ /**
220
+ * Reads the licence content from the assets folder.
221
+ */
222
+ const getLicenceContent = () => {
223
+ try {
224
+ return readAsset("./LICENCE.md");
225
+ } catch {
226
+ console.warn("Warning: Could not read LICENCE.md asset");
227
+ return "";
228
+ }
229
+ };
230
+ /**
231
+ * Fetches the content of a URL using native fetch.
232
+ */
233
+ const fetchUrlContent = async (url) => {
234
+ const response = await fetch(url);
235
+ if (!response.ok) throw new Error(`Failed to fetch ${url}: ${response.statusText}`);
236
+ return response.text();
237
+ };
238
+ /**
239
+ * Installs skills using the "Agent Skills" directory standard.
240
+ * Standard: <PROJECT_ROOT>/<CONFIG_DIR>/skills/<SKILL_NAME>/SKILL.md
241
+ */
242
+ const installSkills = async (projectRoot, platform, skills) => {
243
+ const relativeDir = PLATFORMS_METADATA[platform].dir ?? "skills";
244
+ const skillsBaseDir = path.join(projectRoot, relativeDir);
245
+ await promises.mkdir(skillsBaseDir, { recursive: true });
246
+ const createdSkills = [];
247
+ const licenceContent = getLicenceContent();
248
+ for (const skill of skills) {
249
+ const skillName = `intlayer-${SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill)}`;
250
+ const skillContent = getSkillContent(skill);
251
+ if (!skillContent) continue;
252
+ const urls = Array.from(new Set(skillContent.match(/https:\/\/intlayer\.org\/doc\/[^\s)]+\.md/g) || []));
253
+ const skillDir = path.join(skillsBaseDir, skillName);
254
+ const referenceDir = path.join(skillDir, "references");
255
+ await promises.mkdir(referenceDir, { recursive: true });
256
+ if (licenceContent) await promises.writeFile(path.join(skillDir, "LICENCE.md"), licenceContent, "utf-8");
257
+ let updatedSkillContent = skillContent;
258
+ const downloadPromises = urls.map(async (url) => {
259
+ try {
260
+ const content = await fetchUrlContent(url);
261
+ const metadata = getMarkdownMetadata(content);
262
+ let fileName = "";
263
+ if (Array.isArray(metadata.slugs)) fileName = metadata.slugs.filter((slug) => slug !== "doc").join("_");
264
+ else fileName = new URL(url).pathname.split("/").filter((part) => part && part !== "doc").map((part) => part.replace(".md", "")).join("_");
265
+ fileName = fileName ? `${fileName}.md` : "index.md";
266
+ return {
267
+ url,
268
+ localRefPath: `references/${fileName}`,
269
+ fileName,
270
+ content,
271
+ success: true
272
+ };
273
+ } catch (error) {
274
+ console.warn(`Warning: Failed to download ref ${url} for skill ${skill}`, error);
275
+ return {
276
+ url,
277
+ success: false
278
+ };
279
+ }
280
+ });
281
+ const results = await Promise.all(downloadPromises);
282
+ for (const res of results) if (res.success && res.fileName && res.content && res.localRefPath) {
283
+ await promises.writeFile(path.join(referenceDir, res.fileName), res.content, "utf-8");
284
+ updatedSkillContent = updatedSkillContent.replaceAll(res.url, res.localRefPath);
285
+ }
286
+ const filePath = path.join(skillDir, "SKILL.md");
287
+ await promises.writeFile(filePath, updatedSkillContent, "utf-8");
288
+ createdSkills.push(`${skillName}/SKILL.md`);
289
+ }
290
+ if (createdSkills.length === 0) return `No skill files were created. Check your asset paths.`;
291
+ return `${v} Created ${createdSkills.length} skills in ${skillsBaseDir}`;
292
+ };
293
+
294
+ //#endregion
295
+ export { PLATFORMS, PLATFORMS_METADATA, SKILLS, SKILLS_METADATA, getInitialSkills, installSkills };
2
296
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["fs"],"sources":["../../../src/installSkills/index.ts"],"sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { readAsset } from 'utils:asset';\nimport { v } from '@intlayer/config/logger';\nimport { getMarkdownMetadata } from '@intlayer/core/markdown';\n\n/**\n * Metadata for each available documentation skill.\n */\nexport const SKILLS_METADATA = {\n Config: 'Intlayer configuration documentation',\n Content: 'Reference for all Intlayer content node types (t, enu, etc.)',\n Usage: 'How to use Intlayer in your project',\n CLI: 'Intlayer CLI commands and usage',\n Compiler:\n 'Intlayer Compiler setup and usage for automatic content extraction without .content files',\n RemoteContent: 'How to use Intlayer with Remote/CMS/Server-side content',\n NextJS: 'Next.js-specific usage (Server & Client components)',\n React: 'React-specific syntax and hooks usage',\n Vue: 'Vue-specific composables and syntax',\n Svelte: 'Svelte-specific stores and syntax',\n Angular: 'Angular-specific syntax and Injectable Function usage',\n Preact: 'Preact-specific syntax and hooks usage',\n Solid:\n '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.',\n Astro: 'Astro-specific usage and getIntlayer',\n} as const;\n\nexport type Skill = keyof typeof SKILLS_METADATA;\n\nexport const SKILLS = Object.keys(SKILLS_METADATA) as Skill[];\n\nexport const getInitialSkills = (\n deps: Record<string, string>\n): (keyof typeof SKILLS_METADATA)[] => {\n const skills: (keyof typeof SKILLS_METADATA)[] = [\n 'Usage',\n 'Content',\n 'Config',\n 'CLI',\n 'Compiler',\n ];\n\n if (deps.next) skills.push('NextJS');\n if (deps.react || !deps.next) skills.push('React');\n if (deps.preact) skills.push('Preact');\n if (deps['solid-js']) skills.push('Solid');\n if (deps.vue || deps.nuxt) skills.push('Vue');\n if (deps.svelte || deps['@sveltejs/kit']) skills.push('Svelte');\n if (deps.astro) skills.push('Astro');\n\n return skills;\n};\n\nexport interface PlatformMetadata {\n label: string;\n dir: string;\n check?: () => boolean;\n}\n\n/**\n * Metadata and configuration for each supported platform.\n */\nexport const PLATFORMS_METADATA: Record<string, PlatformMetadata> = {\n Cursor: {\n label: 'Cursor',\n dir: '.cursor/skills',\n check: () =>\n process.env.CURSOR === 'true' || process.env.TERM_PROGRAM === 'cursor',\n },\n Windsurf: {\n label: 'Windsurf',\n dir: '.windsurf/skills',\n check: () =>\n process.env.WINDSURF === 'true' ||\n process.env.TERM_PROGRAM === 'windsurf',\n },\n Trae: {\n label: 'Trae',\n dir: '.trae/skills',\n check: () =>\n process.env.TRAE === 'true' || process.env.TERM_PROGRAM === 'trae',\n },\n TraeCN: {\n label: 'Trae CN',\n dir: '.trae/skills',\n check: () => process.env.TRAE_CN === 'true',\n },\n VSCode: {\n label: 'VS Code',\n dir: '.vscode/skills',\n check: () =>\n process.env.VSCODE === 'true' || process.env.TERM_PROGRAM === 'vscode',\n },\n OpenCode: {\n label: 'OpenCode',\n dir: '.opencode/skills',\n check: () => process.env.OPENCODE === 'true',\n },\n Claude: {\n label: 'Claude Code',\n dir: '.claude/skills',\n check: () => process.env.CLAUDE === 'true',\n },\n GitHub: {\n label: 'GitHub Copilot Workspace',\n dir: '.github/skills',\n check: () =>\n process.env.GITHUB_ACTIONS === 'true' || !!process.env.GITHUB_WORKSPACE,\n },\n Antigravity: {\n label: 'Antigravity',\n dir: '.agent/skills',\n },\n Augment: {\n label: 'Augment',\n dir: '.augment/skills',\n },\n OpenClaw: {\n label: 'OpenClaw',\n dir: 'skills',\n },\n Cline: {\n label: 'Cline',\n dir: '.cline/skills',\n },\n CodeBuddy: {\n label: 'CodeBuddy',\n dir: '.codebuddy/skills',\n },\n CommandCode: {\n label: 'Command Code',\n dir: '.commandcode/skills',\n },\n Continue: {\n label: 'Continue',\n dir: '.continue/skills',\n },\n Crush: {\n label: 'Crush',\n dir: '.crush/skills',\n },\n Droid: {\n label: 'Droid',\n dir: '.factory/skills',\n },\n Goose: {\n label: 'Goose',\n dir: '.goose/skills',\n },\n IFlow: {\n label: 'iFlow CLI',\n dir: '.iflow/skills',\n },\n Junie: {\n label: 'Junie',\n dir: '.junie/skills',\n },\n KiloCode: {\n label: 'Kilo Code',\n dir: '.kilocode/skills',\n },\n Kiro: {\n label: 'Kiro CLI',\n dir: '.kiro/skills',\n },\n Kode: {\n label: 'Kode',\n dir: '.kode/skills',\n },\n MCPJam: {\n label: 'MCPJam',\n dir: '.mcpjam/skills',\n },\n MistralVibe: {\n label: 'Mistral Vibe',\n dir: '.vibe/skills',\n },\n Mux: {\n label: 'Mux',\n dir: '.mux/skills',\n },\n OpenHands: {\n label: 'OpenHands',\n dir: '.openhands/skills',\n },\n Pi: {\n label: 'Pi',\n dir: '.pi/skills',\n },\n Qoder: {\n label: 'Qoder',\n dir: '.qoder/skills',\n },\n Qwen: {\n label: 'Qwen Code',\n dir: '.qwen/skills',\n },\n RooCode: {\n label: 'Roo Code',\n dir: '.roo/skills',\n },\n Zencoder: {\n label: 'Zencoder',\n dir: '.zencoder/skills',\n },\n Neovate: {\n label: 'Neovate',\n dir: '.neovate/skills',\n },\n Pochi: {\n label: 'Pochi',\n dir: '.pochi/skills',\n },\n Other: {\n label: 'Other',\n dir: 'skills',\n },\n} as const;\n\nexport type Platform = keyof typeof PLATFORMS_METADATA;\n\nexport const PLATFORMS = Object.keys(PLATFORMS_METADATA) as Platform[];\n\n/**\n * Maps specific skill keys to special filenames if they differ from standard snake_case.\n */\nconst SKILL_FILENAME_MAP: Partial<Record<Skill, string>> = {};\n\n/**\n * Helper to convert CamelCase to kebab-case for directory naming\n */\nconst camelToKebabCase = (str: string) =>\n str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Reads the raw markdown content for a specific skill from the assets folder.\n */\nconst getSkillContent = (skill: Skill): string => {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const fileName = `./skills/${baseName}.md`;\n\n try {\n return readAsset(fileName);\n } catch {\n console.warn(\n `Warning: Could not read asset for skill: ${skill} at ${fileName}`\n );\n return '';\n }\n};\n\n/**\n * Reads the licence content from the assets folder.\n */\nconst getLicenceContent = (): string => {\n try {\n return readAsset('./LICENCE.md');\n } catch {\n console.warn('Warning: Could not read LICENCE.md asset');\n return '';\n }\n};\n\n/**\n * Fetches the content of a URL using native fetch.\n */\nconst fetchUrlContent = async (url: string): Promise<string> => {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}: ${response.statusText}`);\n }\n return response.text();\n};\n\n/**\n * Installs skills using the \"Agent Skills\" directory standard.\n * Standard: <PROJECT_ROOT>/<CONFIG_DIR>/skills/<SKILL_NAME>/SKILL.md\n */\nexport const installSkills = async (\n projectRoot: string,\n platform: Platform,\n skills: Skill[]\n): Promise<string> => {\n // Determine destination directory\n const relativeDir = PLATFORMS_METADATA[platform].dir ?? 'skills';\n const skillsBaseDir = path.join(projectRoot, relativeDir);\n\n // Ensure the base directory exists\n await fs.mkdir(skillsBaseDir, { recursive: true });\n\n const createdSkills: string[] = [];\n const licenceContent = getLicenceContent();\n\n for (const skill of skills) {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const skillName = `intlayer-${baseName}`;\n const skillContent = getSkillContent(skill);\n\n if (!skillContent) continue;\n\n // Extract unique URLs\n const urls = Array.from(\n new Set(\n skillContent.match(/https:\\/\\/intlayer\\.org\\/doc\\/[^\\s)]+\\.md/g) || []\n )\n );\n\n // Agent Standard: .../skills/<skill-name>/SKILL.md\n const skillDir = path.join(skillsBaseDir, skillName);\n const referenceDir = path.join(skillDir, 'references');\n\n // Ensure directories exist\n await fs.mkdir(referenceDir, { recursive: true });\n\n // Write License\n if (licenceContent) {\n await fs.writeFile(\n path.join(skillDir, 'LICENCE.md'),\n licenceContent,\n 'utf-8'\n );\n }\n\n let updatedSkillContent = skillContent;\n\n // Parallel download of references\n const downloadPromises = urls.map(async (url) => {\n try {\n const content = await fetchUrlContent(url);\n const metadata = getMarkdownMetadata<{ slugs?: string[] }>(content);\n\n let fileName = '';\n\n // Determine filename from slugs or URL path\n if (Array.isArray(metadata.slugs)) {\n fileName = metadata.slugs.filter((slug) => slug !== 'doc').join('_');\n } else {\n const urlPath = new URL(url).pathname;\n fileName = urlPath\n .split('/')\n .filter((part) => part && part !== 'doc')\n .map((part) => part.replace('.md', '')) // Clean extension for joining\n .join('_');\n }\n\n // Ensure it ends with .md\n fileName = fileName ? `${fileName}.md` : 'index.md';\n const localRefPath = `references/${fileName}`;\n\n return {\n url,\n localRefPath,\n fileName,\n content,\n success: true,\n };\n } catch (error) {\n console.warn(\n `Warning: Failed to download ref ${url} for skill ${skill}`,\n error\n );\n return { url, success: false };\n }\n });\n\n const results = await Promise.all(downloadPromises);\n\n // Process results: Write files and update content string\n for (const res of results) {\n if (res.success && res.fileName && res.content && res.localRefPath) {\n // Write the reference file\n await fs.writeFile(\n path.join(referenceDir, res.fileName),\n res.content,\n 'utf-8'\n );\n\n // Update the main content to point to local file\n updatedSkillContent = updatedSkillContent.replaceAll(\n res.url,\n res.localRefPath\n );\n }\n }\n\n // Write the main SKILL.md\n const filePath = path.join(skillDir, 'SKILL.md');\n await fs.writeFile(filePath, updatedSkillContent, 'utf-8');\n createdSkills.push(`${skillName}/SKILL.md`);\n }\n\n if (createdSkills.length === 0) {\n return `No skill files were created. Check your asset paths.`;\n }\n\n return `${v} Created ${createdSkills.length} skills in ${skillsBaseDir}`;\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.mjs","names":["fs"],"sources":["../../../src/installSkills/index.ts"],"sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { readAsset } from 'utils:asset';\nimport { v } from '@intlayer/config/logger';\nimport { getMarkdownMetadata } from '@intlayer/core/markdown';\n\n/**\n * Metadata for each available documentation skill.\n */\nexport const SKILLS_METADATA = {\n Config: 'Intlayer configuration documentation',\n Content: 'Reference for all Intlayer content node types (t, enu, etc.)',\n Usage: 'How to use Intlayer in your project',\n CLI: 'Intlayer CLI commands and usage',\n Compiler:\n 'Intlayer Compiler setup and usage for automatic content extraction without .content files',\n RemoteContent: 'How to use Intlayer with Remote/CMS/Server-side content',\n NextJS: 'Next.js-specific usage (Server & Client components)',\n React: 'React-specific syntax and hooks usage',\n Vue: 'Vue-specific composables and syntax',\n Svelte: 'Svelte-specific stores and syntax',\n Angular: 'Angular-specific syntax and Injectable Function usage',\n Preact: 'Preact-specific syntax and hooks usage',\n Solid:\n '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.',\n Astro: 'Astro-specific usage and getIntlayer',\n} as const;\n\nexport type Skill = keyof typeof SKILLS_METADATA;\n\nexport const SKILLS = Object.keys(SKILLS_METADATA) as Skill[];\n\nexport const getInitialSkills = (\n deps: Record<string, string>\n): (keyof typeof SKILLS_METADATA)[] => {\n const skills: (keyof typeof SKILLS_METADATA)[] = [\n 'Usage',\n 'Content',\n 'Config',\n 'CLI',\n 'Compiler',\n ];\n\n if (deps.next) skills.push('NextJS');\n if (deps.react || !deps.next) skills.push('React');\n if (deps.preact) skills.push('Preact');\n if (deps['solid-js']) skills.push('Solid');\n if (deps.vue || deps.nuxt) skills.push('Vue');\n if (deps.svelte || deps['@sveltejs/kit']) skills.push('Svelte');\n if (deps.astro) skills.push('Astro');\n\n return skills;\n};\n\nexport interface PlatformMetadata {\n label: string;\n dir: string;\n check?: () => boolean;\n}\n\n/**\n * Metadata and configuration for each supported platform.\n */\nexport const PLATFORMS_METADATA: Record<string, PlatformMetadata> = {\n Cursor: {\n label: 'Cursor',\n dir: '.cursor/skills',\n check: () =>\n process.env.CURSOR === 'true' || process.env.TERM_PROGRAM === 'cursor',\n },\n Windsurf: {\n label: 'Windsurf',\n dir: '.windsurf/skills',\n check: () =>\n process.env.WINDSURF === 'true' ||\n process.env.TERM_PROGRAM === 'windsurf',\n },\n Trae: {\n label: 'Trae',\n dir: '.trae/skills',\n check: () =>\n process.env.TRAE === 'true' || process.env.TERM_PROGRAM === 'trae',\n },\n TraeCN: {\n label: 'Trae CN',\n dir: '.trae/skills',\n check: () => process.env.TRAE_CN === 'true',\n },\n VSCode: {\n label: 'VS Code',\n dir: '.vscode/skills',\n check: () =>\n process.env.VSCODE === 'true' || process.env.TERM_PROGRAM === 'vscode',\n },\n OpenCode: {\n label: 'OpenCode',\n dir: '.opencode/skills',\n check: () => process.env.OPENCODE === 'true',\n },\n Claude: {\n label: 'Claude Code',\n dir: '.claude/skills',\n check: () => process.env.CLAUDE === 'true',\n },\n GitHub: {\n label: 'GitHub Copilot Workspace',\n dir: '.github/skills',\n check: () =>\n process.env.GITHUB_ACTIONS === 'true' || !!process.env.GITHUB_WORKSPACE,\n },\n Antigravity: {\n label: 'Antigravity',\n dir: '.agent/skills',\n },\n Augment: {\n label: 'Augment',\n dir: '.augment/skills',\n },\n OpenClaw: {\n label: 'OpenClaw',\n dir: 'skills',\n },\n Cline: {\n label: 'Cline',\n dir: '.cline/skills',\n },\n CodeBuddy: {\n label: 'CodeBuddy',\n dir: '.codebuddy/skills',\n },\n CommandCode: {\n label: 'Command Code',\n dir: '.commandcode/skills',\n },\n Continue: {\n label: 'Continue',\n dir: '.continue/skills',\n },\n Crush: {\n label: 'Crush',\n dir: '.crush/skills',\n },\n Droid: {\n label: 'Droid',\n dir: '.factory/skills',\n },\n Goose: {\n label: 'Goose',\n dir: '.goose/skills',\n },\n IFlow: {\n label: 'iFlow CLI',\n dir: '.iflow/skills',\n },\n Junie: {\n label: 'Junie',\n dir: '.junie/skills',\n },\n KiloCode: {\n label: 'Kilo Code',\n dir: '.kilocode/skills',\n },\n Kiro: {\n label: 'Kiro CLI',\n dir: '.kiro/skills',\n },\n Kode: {\n label: 'Kode',\n dir: '.kode/skills',\n },\n MCPJam: {\n label: 'MCPJam',\n dir: '.mcpjam/skills',\n },\n MistralVibe: {\n label: 'Mistral Vibe',\n dir: '.vibe/skills',\n },\n Mux: {\n label: 'Mux',\n dir: '.mux/skills',\n },\n OpenHands: {\n label: 'OpenHands',\n dir: '.openhands/skills',\n },\n Pi: {\n label: 'Pi',\n dir: '.pi/skills',\n },\n Qoder: {\n label: 'Qoder',\n dir: '.qoder/skills',\n },\n Qwen: {\n label: 'Qwen Code',\n dir: '.qwen/skills',\n },\n RooCode: {\n label: 'Roo Code',\n dir: '.roo/skills',\n },\n Zencoder: {\n label: 'Zencoder',\n dir: '.zencoder/skills',\n },\n Neovate: {\n label: 'Neovate',\n dir: '.neovate/skills',\n },\n Pochi: {\n label: 'Pochi',\n dir: '.pochi/skills',\n },\n Other: {\n label: 'Other',\n dir: 'skills',\n },\n} as const;\n\nexport type Platform = keyof typeof PLATFORMS_METADATA;\n\nexport const PLATFORMS = Object.keys(PLATFORMS_METADATA) as Platform[];\n\n/**\n * Maps specific skill keys to special filenames if they differ from standard snake_case.\n */\nconst SKILL_FILENAME_MAP: Partial<Record<Skill, string>> = {};\n\n/**\n * Helper to convert CamelCase to kebab-case for directory naming\n */\nconst camelToKebabCase = (str: string) =>\n str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Reads the raw markdown content for a specific skill from the assets folder.\n */\nconst getSkillContent = (skill: Skill): string => {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const fileName = `./skills/${baseName}.md`;\n\n try {\n return readAsset(fileName);\n } catch {\n console.warn(\n `Warning: Could not read asset for skill: ${skill} at ${fileName}`\n );\n return '';\n }\n};\n\n/**\n * Reads the licence content from the assets folder.\n */\nconst getLicenceContent = (): string => {\n try {\n return readAsset('./LICENCE.md');\n } catch {\n console.warn('Warning: Could not read LICENCE.md asset');\n return '';\n }\n};\n\n/**\n * Fetches the content of a URL using native fetch.\n */\nconst fetchUrlContent = async (url: string): Promise<string> => {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}: ${response.statusText}`);\n }\n return response.text();\n};\n\n/**\n * Installs skills using the \"Agent Skills\" directory standard.\n * Standard: <PROJECT_ROOT>/<CONFIG_DIR>/skills/<SKILL_NAME>/SKILL.md\n */\nexport const installSkills = async (\n projectRoot: string,\n platform: Platform,\n skills: Skill[]\n): Promise<string> => {\n // Determine destination directory\n const relativeDir = PLATFORMS_METADATA[platform].dir ?? 'skills';\n const skillsBaseDir = path.join(projectRoot, relativeDir);\n\n // Ensure the base directory exists\n await fs.mkdir(skillsBaseDir, { recursive: true });\n\n const createdSkills: string[] = [];\n const licenceContent = getLicenceContent();\n\n for (const skill of skills) {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const skillName = `intlayer-${baseName}`;\n const skillContent = getSkillContent(skill);\n\n if (!skillContent) continue;\n\n // Extract unique URLs\n const urls = Array.from(\n new Set(\n skillContent.match(/https:\\/\\/intlayer\\.org\\/doc\\/[^\\s)]+\\.md/g) || []\n )\n );\n\n // Agent Standard: .../skills/<skill-name>/SKILL.md\n const skillDir = path.join(skillsBaseDir, skillName);\n const referenceDir = path.join(skillDir, 'references');\n\n // Ensure directories exist\n await fs.mkdir(referenceDir, { recursive: true });\n\n // Write License\n if (licenceContent) {\n await fs.writeFile(\n path.join(skillDir, 'LICENCE.md'),\n licenceContent,\n 'utf-8'\n );\n }\n\n let updatedSkillContent = skillContent;\n\n // Parallel download of references\n const downloadPromises = urls.map(async (url) => {\n try {\n const content = await fetchUrlContent(url);\n const metadata = getMarkdownMetadata<{ slugs?: string[] }>(content);\n\n let fileName = '';\n\n // Determine filename from slugs or URL path\n if (Array.isArray(metadata.slugs)) {\n fileName = metadata.slugs.filter((slug) => slug !== 'doc').join('_');\n } else {\n const urlPath = new URL(url).pathname;\n fileName = urlPath\n .split('/')\n .filter((part) => part && part !== 'doc')\n .map((part) => part.replace('.md', '')) // Clean extension for joining\n .join('_');\n }\n\n // Ensure it ends with .md\n fileName = fileName ? `${fileName}.md` : 'index.md';\n const localRefPath = `references/${fileName}`;\n\n return {\n url,\n localRefPath,\n fileName,\n content,\n success: true,\n };\n } catch (error) {\n console.warn(\n `Warning: Failed to download ref ${url} for skill ${skill}`,\n error\n );\n return { url, success: false };\n }\n });\n\n const results = await Promise.all(downloadPromises);\n\n // Process results: Write files and update content string\n for (const res of results) {\n if (res.success && res.fileName && res.content && res.localRefPath) {\n // Write the reference file\n await fs.writeFile(\n path.join(referenceDir, res.fileName),\n res.content,\n 'utf-8'\n );\n\n // Update the main content to point to local file\n updatedSkillContent = updatedSkillContent.replaceAll(\n res.url,\n res.localRefPath\n );\n }\n }\n\n // Write the main SKILL.md\n const filePath = path.join(skillDir, 'SKILL.md');\n await fs.writeFile(filePath, updatedSkillContent, 'utf-8');\n createdSkills.push(`${skillName}/SKILL.md`);\n }\n\n if (createdSkills.length === 0) {\n return `No skill files were created. Check your asset paths.`;\n }\n\n return `${v} Created ${createdSkills.length} skills in ${skillsBaseDir}`;\n};\n"],"mappings":"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"}