@intlayer/cli 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 (301) hide show
  1. package/dist/cjs/IntlayerEventListener.cjs +186 -1
  2. package/dist/cjs/IntlayerEventListener.cjs.map +1 -1
  3. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  4. package/dist/cjs/_virtual/_utils_asset.cjs +98 -0
  5. package/dist/cjs/auth/login.cjs +90 -2
  6. package/dist/cjs/auth/login.cjs.map +1 -1
  7. package/dist/cjs/build.cjs +30 -1
  8. package/dist/cjs/build.cjs.map +1 -1
  9. package/dist/cjs/ci.cjs +76 -1
  10. package/dist/cjs/ci.cjs.map +1 -1
  11. package/dist/cjs/cli.cjs +485 -1
  12. package/dist/cjs/cli.cjs.map +1 -1
  13. package/dist/cjs/config.cjs +15 -1
  14. package/dist/cjs/config.cjs.map +1 -1
  15. package/dist/cjs/editor.cjs +50 -1
  16. package/dist/cjs/editor.cjs.map +1 -1
  17. package/dist/cjs/extract.cjs +108 -1
  18. package/dist/cjs/extract.cjs.map +1 -1
  19. package/dist/cjs/fill/deepMergeContent.cjs +27 -1
  20. package/dist/cjs/fill/deepMergeContent.cjs.map +1 -1
  21. package/dist/cjs/fill/fill.cjs +84 -1
  22. package/dist/cjs/fill/fill.cjs.map +1 -1
  23. package/dist/cjs/fill/formatAutoFilledFilePath.cjs +32 -1
  24. package/dist/cjs/fill/formatAutoFilledFilePath.cjs.map +1 -1
  25. package/dist/cjs/fill/formatFillData.cjs +87 -1
  26. package/dist/cjs/fill/formatFillData.cjs.map +1 -1
  27. package/dist/cjs/fill/getAvailableLocalesInDictionary.cjs +26 -1
  28. package/dist/cjs/fill/getAvailableLocalesInDictionary.cjs.map +1 -1
  29. package/dist/cjs/fill/getFilterMissingContentPerLocale.cjs +51 -1
  30. package/dist/cjs/fill/getFilterMissingContentPerLocale.cjs.map +1 -1
  31. package/dist/cjs/fill/index.cjs +6 -1
  32. package/dist/cjs/fill/listTranslationsTasks.cjs +72 -1
  33. package/dist/cjs/fill/listTranslationsTasks.cjs.map +1 -1
  34. package/dist/cjs/fill/translateDictionary.cjs +240 -1
  35. package/dist/cjs/fill/translateDictionary.cjs.map +1 -1
  36. package/dist/cjs/fill/writeFill.cjs +55 -1
  37. package/dist/cjs/fill/writeFill.cjs.map +1 -1
  38. package/dist/cjs/getTargetDictionary.cjs +36 -1
  39. package/dist/cjs/getTargetDictionary.cjs.map +1 -1
  40. package/dist/cjs/index.cjs +44 -1
  41. package/dist/cjs/init.cjs +22 -1
  42. package/dist/cjs/init.cjs.map +1 -1
  43. package/dist/cjs/initMCP.cjs +69 -1
  44. package/dist/cjs/initMCP.cjs.map +1 -1
  45. package/dist/cjs/initSkills.cjs +93 -1
  46. package/dist/cjs/initSkills.cjs.map +1 -1
  47. package/dist/cjs/listContentDeclaration.cjs +42 -1
  48. package/dist/cjs/listContentDeclaration.cjs.map +1 -1
  49. package/dist/cjs/listProjects.cjs +28 -1
  50. package/dist/cjs/listProjects.cjs.map +1 -1
  51. package/dist/cjs/liveSync.cjs +153 -8
  52. package/dist/cjs/liveSync.cjs.map +1 -1
  53. package/dist/cjs/pull.cjs +153 -1
  54. package/dist/cjs/pull.cjs.map +1 -1
  55. package/dist/cjs/push/pullLog.cjs +105 -3
  56. package/dist/cjs/push/pullLog.cjs.map +1 -1
  57. package/dist/cjs/push/push.cjs +212 -1
  58. package/dist/cjs/push/push.cjs.map +1 -1
  59. package/dist/cjs/pushConfig.cjs +22 -1
  60. package/dist/cjs/pushConfig.cjs.map +1 -1
  61. package/dist/cjs/pushLog.cjs +86 -3
  62. package/dist/cjs/pushLog.cjs.map +1 -1
  63. package/dist/cjs/reviewDoc/reviewDoc.cjs +73 -1
  64. package/dist/cjs/reviewDoc/reviewDoc.cjs.map +1 -1
  65. package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs +98 -1
  66. package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs.map +1 -1
  67. package/dist/cjs/searchDoc.cjs +41 -1
  68. package/dist/cjs/searchDoc.cjs.map +1 -1
  69. package/dist/cjs/test/index.cjs +7 -1
  70. package/dist/cjs/test/listMissingTranslations.cjs +52 -1
  71. package/dist/cjs/test/listMissingTranslations.cjs.map +1 -1
  72. package/dist/cjs/test/test.cjs +56 -1
  73. package/dist/cjs/test/test.cjs.map +1 -1
  74. package/dist/cjs/translateDoc/index.cjs +9 -1
  75. package/dist/cjs/translateDoc/translateDoc.cjs +79 -1
  76. package/dist/cjs/translateDoc/translateDoc.cjs.map +1 -1
  77. package/dist/cjs/translateDoc/translateFile.cjs +106 -2
  78. package/dist/cjs/translateDoc/translateFile.cjs.map +1 -1
  79. package/dist/cjs/translateDoc/validation.cjs +49 -5
  80. package/dist/cjs/translateDoc/validation.cjs.map +1 -1
  81. package/dist/cjs/translation-alignment/alignBlocks.cjs +67 -1
  82. package/dist/cjs/translation-alignment/alignBlocks.cjs.map +1 -1
  83. package/dist/cjs/translation-alignment/computeSimilarity.cjs +25 -1
  84. package/dist/cjs/translation-alignment/computeSimilarity.cjs.map +1 -1
  85. package/dist/cjs/translation-alignment/fingerprintBlock.cjs +23 -1
  86. package/dist/cjs/translation-alignment/fingerprintBlock.cjs.map +1 -1
  87. package/dist/cjs/translation-alignment/index.cjs +22 -1
  88. package/dist/cjs/translation-alignment/mapChangedLinesToBlocks.cjs +18 -1
  89. package/dist/cjs/translation-alignment/mapChangedLinesToBlocks.cjs.map +1 -1
  90. package/dist/cjs/translation-alignment/normalizeBlock.cjs +22 -1
  91. package/dist/cjs/translation-alignment/normalizeBlock.cjs.map +1 -1
  92. package/dist/cjs/translation-alignment/pipeline.cjs +37 -1
  93. package/dist/cjs/translation-alignment/pipeline.cjs.map +1 -1
  94. package/dist/cjs/translation-alignment/planActions.cjs +46 -1
  95. package/dist/cjs/translation-alignment/planActions.cjs.map +1 -1
  96. package/dist/cjs/translation-alignment/rebuildDocument.cjs +49 -2
  97. package/dist/cjs/translation-alignment/rebuildDocument.cjs.map +1 -1
  98. package/dist/cjs/translation-alignment/segmentDocument.cjs +66 -5
  99. package/dist/cjs/translation-alignment/segmentDocument.cjs.map +1 -1
  100. package/dist/cjs/utils/calculateChunks.cjs +89 -2
  101. package/dist/cjs/utils/calculateChunks.cjs.map +1 -1
  102. package/dist/cjs/utils/checkAccess.cjs +83 -1
  103. package/dist/cjs/utils/checkAccess.cjs.map +1 -1
  104. package/dist/cjs/utils/checkConfigConsistency.cjs +16 -1
  105. package/dist/cjs/utils/checkConfigConsistency.cjs.map +1 -1
  106. package/dist/cjs/utils/checkFileModifiedRange.cjs +81 -1
  107. package/dist/cjs/utils/checkFileModifiedRange.cjs.map +1 -1
  108. package/dist/cjs/utils/checkLastUpdateTime.cjs +19 -1
  109. package/dist/cjs/utils/checkLastUpdateTime.cjs.map +1 -1
  110. package/dist/cjs/utils/chunkInference.cjs +45 -1
  111. package/dist/cjs/utils/chunkInference.cjs.map +1 -1
  112. package/dist/cjs/utils/fixChunkStartEndChars.cjs +27 -3
  113. package/dist/cjs/utils/fixChunkStartEndChars.cjs.map +1 -1
  114. package/dist/cjs/utils/formatTimeDiff.cjs +20 -1
  115. package/dist/cjs/utils/formatTimeDiff.cjs.map +1 -1
  116. package/dist/cjs/utils/getIsFileUpdatedRecently.cjs +16 -1
  117. package/dist/cjs/utils/getIsFileUpdatedRecently.cjs.map +1 -1
  118. package/dist/cjs/utils/getOutputFilePath.cjs +74 -1
  119. package/dist/cjs/utils/getOutputFilePath.cjs.map +1 -1
  120. package/dist/cjs/utils/getParentPackageJSON.cjs +20 -1
  121. package/dist/cjs/utils/getParentPackageJSON.cjs.map +1 -1
  122. package/dist/cjs/utils/listSpecialChars.cjs +54 -2
  123. package/dist/cjs/utils/listSpecialChars.cjs.map +1 -1
  124. package/dist/cjs/utils/mapChunksBetweenFiles.cjs +102 -1
  125. package/dist/cjs/utils/mapChunksBetweenFiles.cjs.map +1 -1
  126. package/dist/cjs/utils/openBrowser.cjs +19 -1
  127. package/dist/cjs/utils/openBrowser.cjs.map +1 -1
  128. package/dist/cjs/utils/reorderParagraphs.cjs +91 -3
  129. package/dist/cjs/utils/reorderParagraphs.cjs.map +1 -1
  130. package/dist/cjs/utils/setupAI.cjs +66 -1
  131. package/dist/cjs/utils/setupAI.cjs.map +1 -1
  132. package/dist/cjs/watch.cjs +47 -1
  133. package/dist/cjs/watch.cjs.map +1 -1
  134. package/dist/esm/IntlayerEventListener.mjs +183 -1
  135. package/dist/esm/IntlayerEventListener.mjs.map +1 -1
  136. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  137. package/dist/esm/_virtual/_utils_asset.mjs +97 -0
  138. package/dist/esm/auth/login.mjs +86 -2
  139. package/dist/esm/auth/login.mjs.map +1 -1
  140. package/dist/esm/build.mjs +28 -1
  141. package/dist/esm/build.mjs.map +1 -1
  142. package/dist/esm/ci.mjs +74 -1
  143. package/dist/esm/ci.mjs.map +1 -1
  144. package/dist/esm/cli.mjs +482 -1
  145. package/dist/esm/cli.mjs.map +1 -1
  146. package/dist/esm/config.mjs +13 -1
  147. package/dist/esm/config.mjs.map +1 -1
  148. package/dist/esm/editor.mjs +50 -1
  149. package/dist/esm/editor.mjs.map +1 -0
  150. package/dist/esm/extract.mjs +104 -1
  151. package/dist/esm/extract.mjs.map +1 -1
  152. package/dist/esm/fill/deepMergeContent.mjs +25 -1
  153. package/dist/esm/fill/deepMergeContent.mjs.map +1 -1
  154. package/dist/esm/fill/fill.mjs +81 -1
  155. package/dist/esm/fill/fill.mjs.map +1 -1
  156. package/dist/esm/fill/formatAutoFilledFilePath.mjs +30 -1
  157. package/dist/esm/fill/formatAutoFilledFilePath.mjs.map +1 -1
  158. package/dist/esm/fill/formatFillData.mjs +85 -1
  159. package/dist/esm/fill/formatFillData.mjs.map +1 -1
  160. package/dist/esm/fill/getAvailableLocalesInDictionary.mjs +24 -1
  161. package/dist/esm/fill/getAvailableLocalesInDictionary.mjs.map +1 -1
  162. package/dist/esm/fill/getFilterMissingContentPerLocale.mjs +49 -1
  163. package/dist/esm/fill/getFilterMissingContentPerLocale.mjs.map +1 -1
  164. package/dist/esm/fill/index.mjs +4 -1
  165. package/dist/esm/fill/listTranslationsTasks.mjs +69 -1
  166. package/dist/esm/fill/listTranslationsTasks.mjs.map +1 -1
  167. package/dist/esm/fill/translateDictionary.mjs +237 -1
  168. package/dist/esm/fill/translateDictionary.mjs.map +1 -1
  169. package/dist/esm/fill/writeFill.mjs +53 -1
  170. package/dist/esm/fill/writeFill.mjs.map +1 -1
  171. package/dist/esm/getTargetDictionary.mjs +33 -1
  172. package/dist/esm/getTargetDictionary.mjs.map +1 -1
  173. package/dist/esm/index.mjs +20 -1
  174. package/dist/esm/init.mjs +19 -1
  175. package/dist/esm/init.mjs.map +1 -1
  176. package/dist/esm/initMCP.mjs +65 -1
  177. package/dist/esm/initMCP.mjs.map +1 -1
  178. package/dist/esm/initSkills.mjs +87 -1
  179. package/dist/esm/initSkills.mjs.map +1 -1
  180. package/dist/esm/listContentDeclaration.mjs +39 -1
  181. package/dist/esm/listContentDeclaration.mjs.map +1 -1
  182. package/dist/esm/listProjects.mjs +26 -1
  183. package/dist/esm/listProjects.mjs.map +1 -1
  184. package/dist/esm/liveSync.mjs +150 -8
  185. package/dist/esm/liveSync.mjs.map +1 -1
  186. package/dist/esm/pull.mjs +150 -1
  187. package/dist/esm/pull.mjs.map +1 -1
  188. package/dist/esm/push/pullLog.mjs +102 -3
  189. package/dist/esm/push/pullLog.mjs.map +1 -1
  190. package/dist/esm/push/push.mjs +208 -1
  191. package/dist/esm/push/push.mjs.map +1 -1
  192. package/dist/esm/pushConfig.mjs +20 -1
  193. package/dist/esm/pushConfig.mjs.map +1 -1
  194. package/dist/esm/pushLog.mjs +83 -3
  195. package/dist/esm/pushLog.mjs.map +1 -1
  196. package/dist/esm/reviewDoc/reviewDoc.mjs +69 -1
  197. package/dist/esm/reviewDoc/reviewDoc.mjs.map +1 -1
  198. package/dist/esm/reviewDoc/reviewDocBlockAware.mjs +95 -1
  199. package/dist/esm/reviewDoc/reviewDocBlockAware.mjs.map +1 -1
  200. package/dist/esm/searchDoc.mjs +39 -1
  201. package/dist/esm/searchDoc.mjs.map +1 -1
  202. package/dist/esm/test/index.mjs +4 -1
  203. package/dist/esm/test/listMissingTranslations.mjs +49 -1
  204. package/dist/esm/test/listMissingTranslations.mjs.map +1 -1
  205. package/dist/esm/test/test.mjs +53 -1
  206. package/dist/esm/test/test.mjs.map +1 -1
  207. package/dist/esm/translateDoc/index.mjs +5 -1
  208. package/dist/esm/translateDoc/translateDoc.mjs +75 -1
  209. package/dist/esm/translateDoc/translateDoc.mjs.map +1 -1
  210. package/dist/esm/translateDoc/translateFile.mjs +103 -2
  211. package/dist/esm/translateDoc/translateFile.mjs.map +1 -1
  212. package/dist/esm/translateDoc/validation.mjs +46 -5
  213. package/dist/esm/translateDoc/validation.mjs.map +1 -1
  214. package/dist/esm/translation-alignment/alignBlocks.mjs +66 -1
  215. package/dist/esm/translation-alignment/alignBlocks.mjs.map +1 -1
  216. package/dist/esm/translation-alignment/computeSimilarity.mjs +22 -1
  217. package/dist/esm/translation-alignment/computeSimilarity.mjs.map +1 -1
  218. package/dist/esm/translation-alignment/fingerprintBlock.mjs +20 -1
  219. package/dist/esm/translation-alignment/fingerprintBlock.mjs.map +1 -1
  220. package/dist/esm/translation-alignment/index.mjs +11 -1
  221. package/dist/esm/translation-alignment/mapChangedLinesToBlocks.mjs +16 -1
  222. package/dist/esm/translation-alignment/mapChangedLinesToBlocks.mjs.map +1 -1
  223. package/dist/esm/translation-alignment/normalizeBlock.mjs +20 -1
  224. package/dist/esm/translation-alignment/normalizeBlock.mjs.map +1 -1
  225. package/dist/esm/translation-alignment/pipeline.mjs +35 -1
  226. package/dist/esm/translation-alignment/pipeline.mjs.map +1 -1
  227. package/dist/esm/translation-alignment/planActions.mjs +44 -1
  228. package/dist/esm/translation-alignment/planActions.mjs.map +1 -1
  229. package/dist/esm/translation-alignment/rebuildDocument.mjs +46 -2
  230. package/dist/esm/translation-alignment/rebuildDocument.mjs.map +1 -1
  231. package/dist/esm/translation-alignment/segmentDocument.mjs +64 -5
  232. package/dist/esm/translation-alignment/segmentDocument.mjs.map +1 -1
  233. package/dist/esm/utils/calculateChunks.mjs +87 -2
  234. package/dist/esm/utils/calculateChunks.mjs.map +1 -1
  235. package/dist/esm/utils/checkAccess.mjs +79 -1
  236. package/dist/esm/utils/checkAccess.mjs.map +1 -1
  237. package/dist/esm/utils/checkConfigConsistency.mjs +14 -1
  238. package/dist/esm/utils/checkConfigConsistency.mjs.map +1 -1
  239. package/dist/esm/utils/checkFileModifiedRange.mjs +80 -1
  240. package/dist/esm/utils/checkFileModifiedRange.mjs.map +1 -1
  241. package/dist/esm/utils/checkLastUpdateTime.mjs +17 -1
  242. package/dist/esm/utils/checkLastUpdateTime.mjs.map +1 -1
  243. package/dist/esm/utils/chunkInference.mjs +43 -1
  244. package/dist/esm/utils/chunkInference.mjs.map +1 -1
  245. package/dist/esm/utils/fixChunkStartEndChars.mjs +25 -3
  246. package/dist/esm/utils/fixChunkStartEndChars.mjs.map +1 -1
  247. package/dist/esm/utils/formatTimeDiff.mjs +18 -1
  248. package/dist/esm/utils/formatTimeDiff.mjs.map +1 -1
  249. package/dist/esm/utils/getIsFileUpdatedRecently.mjs +14 -1
  250. package/dist/esm/utils/getIsFileUpdatedRecently.mjs.map +1 -1
  251. package/dist/esm/utils/getOutputFilePath.mjs +72 -1
  252. package/dist/esm/utils/getOutputFilePath.mjs.map +1 -1
  253. package/dist/esm/utils/getParentPackageJSON.mjs +18 -1
  254. package/dist/esm/utils/getParentPackageJSON.mjs.map +1 -1
  255. package/dist/esm/utils/listSpecialChars.mjs +52 -2
  256. package/dist/esm/utils/listSpecialChars.mjs.map +1 -1
  257. package/dist/esm/utils/mapChunksBetweenFiles.mjs +100 -1
  258. package/dist/esm/utils/mapChunksBetweenFiles.mjs.map +1 -1
  259. package/dist/esm/utils/openBrowser.mjs +17 -1
  260. package/dist/esm/utils/openBrowser.mjs.map +1 -1
  261. package/dist/esm/utils/reorderParagraphs.mjs +90 -3
  262. package/dist/esm/utils/reorderParagraphs.mjs.map +1 -1
  263. package/dist/esm/utils/setupAI.mjs +63 -1
  264. package/dist/esm/utils/setupAI.mjs.map +1 -1
  265. package/dist/esm/watch.mjs +45 -1
  266. package/dist/esm/watch.mjs.map +1 -1
  267. package/dist/types/fill/fill.d.ts +1 -1
  268. package/dist/types/fill/translateDictionary.d.ts +1 -1
  269. package/dist/types/getTargetDictionary.d.ts +19 -2
  270. package/dist/types/getTargetDictionary.d.ts.map +1 -0
  271. package/dist/types/index.d.ts +2 -2
  272. package/dist/types/reviewDoc/reviewDocBlockAware.d.ts +1 -1
  273. package/dist/types/test/index.d.ts +2 -2
  274. package/dist/types/test/listMissingTranslations.d.ts +28 -2
  275. package/dist/types/test/listMissingTranslations.d.ts.map +1 -0
  276. package/dist/types/test/test.d.ts +11 -2
  277. package/dist/types/test/test.d.ts.map +1 -0
  278. package/dist/types/translateDoc/index.d.ts +1 -1
  279. package/dist/types/translateDoc/translateDoc.d.ts +1 -1
  280. package/dist/types/translateDoc/translateFile.d.ts +1 -1
  281. package/dist/types/translateDoc/types.d.ts +48 -2
  282. package/dist/types/translateDoc/types.d.ts.map +1 -0
  283. package/dist/types/utils/chunkInference.d.ts +1 -1
  284. package/dist/types/utils/setupAI.d.ts +21 -2
  285. package/dist/types/utils/setupAI.d.ts.map +1 -0
  286. package/package.json +12 -12
  287. package/dist/cjs/_utils_asset-ghp_Cjwk.cjs +0 -2
  288. package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
  289. package/dist/esm/_utils_asset-B187VPMw.mjs +0 -2
  290. package/dist/esm/editor-D8BGlLzF.mjs +0 -2
  291. package/dist/esm/editor-D8BGlLzF.mjs.map +0 -1
  292. package/dist/types/getTargetDictionary-RBSRtaQj.d.ts +0 -19
  293. package/dist/types/getTargetDictionary-RBSRtaQj.d.ts.map +0 -1
  294. package/dist/types/listMissingTranslations-DxKw7nqI.d.ts +0 -28
  295. package/dist/types/listMissingTranslations-DxKw7nqI.d.ts.map +0 -1
  296. package/dist/types/setupAI-Bosjx7ah.d.ts +0 -21
  297. package/dist/types/setupAI-Bosjx7ah.d.ts.map +0 -1
  298. package/dist/types/test-DUTiJR5_.d.ts +0 -11
  299. package/dist/types/test-DUTiJR5_.d.ts.map +0 -1
  300. package/dist/types/types-BKvc3FmV.d.ts +0 -48
  301. package/dist/types/types-BKvc3FmV.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"setupAI.mjs","names":[],"sources":["../../../src/utils/setupAI.ts"],"sourcesContent":["import type { AIConfig, AIOptions } from '@intlayer/ai';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, getAppLogger, type logger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { checkAIAccess } from './checkAccess';\n\nexport type AIClient = typeof import('@intlayer/ai');\n\ntype SetupAIResult = {\n aiClient?: AIClient;\n aiConfig?: AIConfig;\n isCustomAI: boolean;\n hasAIAccess: boolean;\n};\n\n// Disable warnings from the AI SDK\nglobalThis.AI_SDK_LOG_WARNINGS = false;\n\nconst logAIConfig = (aiOptions: AIOptions, appLogger: typeof logger) => {\n appLogger([\n colorize('Provider:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.provider ?? '(default)', ANSIColors.BLUE),\n colorize('- Model:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.model ?? '(default)', ANSIColors.BLUE),\n colorize('- API Key:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.apiKey ? '✓' : '(not set)', ANSIColors.BLUE),\n ]);\n};\n\n/**\n * Checks if the @intlayer/ai package is available and configured when an API key is provided.\n * If API key is present but package is missing, logs a warning.\n * Also checks if the user has access to AI (either via local key or CMS auth).\n */\nexport const setupAI = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n): Promise<SetupAIResult | undefined> => {\n const appLogger = getAppLogger(configuration);\n\n const isLocalAI =\n aiOptions?.apiKey ||\n aiOptions?.provider === 'ollama' ||\n configuration.ai?.apiKey ||\n configuration.ai?.provider === 'ollama';\n\n if (isLocalAI) {\n // Try to import the AI package for local AI usage\n let aiClient: AIClient | undefined;\n\n try {\n aiClient = await import('@intlayer/ai');\n } catch {\n // Package not installed - log warning and fall back to backend\n appLogger(\n [\n colorize('Using your API key, you can install the', ANSIColors.GREY),\n colorize('@intlayer/ai', ANSIColors.GREY_LIGHT),\n colorize(\n 'package to run the process locally, with no dependency on the Intlayer server',\n ANSIColors.GREY\n ),\n ],\n {\n level: 'warn',\n }\n );\n\n // Fall back to backend API check\n const hasAIAccess = await checkAIAccess(configuration, aiOptions);\n logAIConfig(aiOptions ?? {}, appLogger);\n return {\n isCustomAI: false,\n hasAIAccess,\n };\n }\n\n // Package found - now configure it (errors here should propagate, not fall back)\n appLogger([\n colorize('@intlayer/ai', ANSIColors.GREY_LIGHT),\n colorize('found - Run process locally', ANSIColors.GREY_DARK),\n ]);\n\n const aiConfig = await aiClient.getAIConfig({\n userOptions: aiOptions,\n accessType: ['public'],\n });\n\n logAIConfig(aiOptions ?? {}, appLogger);\n\n return {\n aiClient,\n aiConfig,\n isCustomAI: true,\n hasAIAccess: true, // Local AI always has access\n };\n }\n\n // No local AI configured - use backend API\n const hasAIAccess = await checkAIAccess(configuration, aiOptions);\n logAIConfig(aiOptions ?? {}, appLogger);\n\n return {\n isCustomAI: false,\n hasAIAccess,\n };\n};\n"],"mappings":"iKAgBA,WAAW,oBAAsB,GAEjC,MAAM,GAAe,EAAsB,IAA6B,CACtE,EAAU,CACR,EAAS,YAAa,EAAW,UAAU,CAC3C,EAAS,GAAW,UAAY,YAAa,EAAW,KAAK,CAC7D,EAAS,WAAY,EAAW,UAAU,CAC1C,EAAS,GAAW,OAAS,YAAa,EAAW,KAAK,CAC1D,EAAS,aAAc,EAAW,UAAU,CAC5C,EAAS,GAAW,OAAS,IAAM,YAAa,EAAW,KAAK,CACjE,CAAC,EAQS,EAAU,MACrB,EACA,IACuC,CACvC,IAAM,EAAY,EAAa,EAAc,CAQ7C,GALE,GAAW,QACX,GAAW,WAAa,UACxB,EAAc,IAAI,QAClB,EAAc,IAAI,WAAa,SAElB,CAEb,IAAI,EAEJ,GAAI,CACF,EAAW,MAAM,OAAO,qBAClB,CAEN,EACE,CACE,EAAS,0CAA2C,EAAW,KAAK,CACpE,EAAS,eAAgB,EAAW,WAAW,CAC/C,EACE,gFACA,EAAW,KACZ,CACF,CACD,CACE,MAAO,OACR,CACF,CAGD,IAAM,EAAc,MAAM,EAAc,EAAe,EAAU,CAEjE,OADA,EAAY,GAAa,EAAE,CAAE,EAAU,CAChC,CACL,WAAY,GACZ,cACD,CAIH,EAAU,CACR,EAAS,eAAgB,EAAW,WAAW,CAC/C,EAAS,8BAA+B,EAAW,UAAU,CAC9D,CAAC,CAEF,IAAM,EAAW,MAAM,EAAS,YAAY,CAC1C,YAAa,EACb,WAAY,CAAC,SAAS,CACvB,CAAC,CAIF,OAFA,EAAY,GAAa,EAAE,CAAE,EAAU,CAEhC,CACL,WACA,WACA,WAAY,GACZ,YAAa,GACd,CAIH,IAAM,EAAc,MAAM,EAAc,EAAe,EAAU,CAGjE,OAFA,EAAY,GAAa,EAAE,CAAE,EAAU,CAEhC,CACL,WAAY,GACZ,cACD"}
1
+ {"version":3,"file":"setupAI.mjs","names":[],"sources":["../../../src/utils/setupAI.ts"],"sourcesContent":["import type { AIConfig, AIOptions } from '@intlayer/ai';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, getAppLogger, type logger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { checkAIAccess } from './checkAccess';\n\nexport type AIClient = typeof import('@intlayer/ai');\n\ntype SetupAIResult = {\n aiClient?: AIClient;\n aiConfig?: AIConfig;\n isCustomAI: boolean;\n hasAIAccess: boolean;\n};\n\n// Disable warnings from the AI SDK\nglobalThis.AI_SDK_LOG_WARNINGS = false;\n\nconst logAIConfig = (aiOptions: AIOptions, appLogger: typeof logger) => {\n appLogger([\n colorize('Provider:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.provider ?? '(default)', ANSIColors.BLUE),\n colorize('- Model:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.model ?? '(default)', ANSIColors.BLUE),\n colorize('- API Key:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.apiKey ? '✓' : '(not set)', ANSIColors.BLUE),\n ]);\n};\n\n/**\n * Checks if the @intlayer/ai package is available and configured when an API key is provided.\n * If API key is present but package is missing, logs a warning.\n * Also checks if the user has access to AI (either via local key or CMS auth).\n */\nexport const setupAI = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n): Promise<SetupAIResult | undefined> => {\n const appLogger = getAppLogger(configuration);\n\n const isLocalAI =\n aiOptions?.apiKey ||\n aiOptions?.provider === 'ollama' ||\n configuration.ai?.apiKey ||\n configuration.ai?.provider === 'ollama';\n\n if (isLocalAI) {\n // Try to import the AI package for local AI usage\n let aiClient: AIClient | undefined;\n\n try {\n aiClient = await import('@intlayer/ai');\n } catch {\n // Package not installed - log warning and fall back to backend\n appLogger(\n [\n colorize('Using your API key, you can install the', ANSIColors.GREY),\n colorize('@intlayer/ai', ANSIColors.GREY_LIGHT),\n colorize(\n 'package to run the process locally, with no dependency on the Intlayer server',\n ANSIColors.GREY\n ),\n ],\n {\n level: 'warn',\n }\n );\n\n // Fall back to backend API check\n const hasAIAccess = await checkAIAccess(configuration, aiOptions);\n logAIConfig(aiOptions ?? {}, appLogger);\n return {\n isCustomAI: false,\n hasAIAccess,\n };\n }\n\n // Package found - now configure it (errors here should propagate, not fall back)\n appLogger([\n colorize('@intlayer/ai', ANSIColors.GREY_LIGHT),\n colorize('found - Run process locally', ANSIColors.GREY_DARK),\n ]);\n\n const aiConfig = await aiClient.getAIConfig({\n userOptions: aiOptions,\n accessType: ['public'],\n });\n\n logAIConfig(aiOptions ?? {}, appLogger);\n\n return {\n aiClient,\n aiConfig,\n isCustomAI: true,\n hasAIAccess: true, // Local AI always has access\n };\n }\n\n // No local AI configured - use backend API\n const hasAIAccess = await checkAIAccess(configuration, aiOptions);\n logAIConfig(aiOptions ?? {}, appLogger);\n\n return {\n isCustomAI: false,\n hasAIAccess,\n };\n};\n"],"mappings":";;;;;AAgBA,WAAW,sBAAsB;AAEjC,MAAM,eAAe,WAAsB,cAA6B;AACtE,WAAU;EACR,SAAS,aAAa,WAAW,UAAU;EAC3C,SAAS,WAAW,YAAY,aAAa,WAAW,KAAK;EAC7D,SAAS,YAAY,WAAW,UAAU;EAC1C,SAAS,WAAW,SAAS,aAAa,WAAW,KAAK;EAC1D,SAAS,cAAc,WAAW,UAAU;EAC5C,SAAS,WAAW,SAAS,MAAM,aAAa,WAAW,KAAK;EACjE,CAAC;;;;;;;AAQJ,MAAa,UAAU,OACrB,eACA,cACuC;CACvC,MAAM,YAAY,aAAa,cAAc;AAQ7C,KALE,WAAW,UACX,WAAW,aAAa,YACxB,cAAc,IAAI,UAClB,cAAc,IAAI,aAAa,UAElB;EAEb,IAAI;AAEJ,MAAI;AACF,cAAW,MAAM,OAAO;UAClB;AAEN,aACE;IACE,SAAS,2CAA2C,WAAW,KAAK;IACpE,SAAS,gBAAgB,WAAW,WAAW;IAC/C,SACE,iFACA,WAAW,KACZ;IACF,EACD,EACE,OAAO,QACR,CACF;GAGD,MAAM,cAAc,MAAM,cAAc,eAAe,UAAU;AACjE,eAAY,aAAa,EAAE,EAAE,UAAU;AACvC,UAAO;IACL,YAAY;IACZ;IACD;;AAIH,YAAU,CACR,SAAS,gBAAgB,WAAW,WAAW,EAC/C,SAAS,+BAA+B,WAAW,UAAU,CAC9D,CAAC;EAEF,MAAM,WAAW,MAAM,SAAS,YAAY;GAC1C,aAAa;GACb,YAAY,CAAC,SAAS;GACvB,CAAC;AAEF,cAAY,aAAa,EAAE,EAAE,UAAU;AAEvC,SAAO;GACL;GACA;GACA,YAAY;GACZ,aAAa;GACd;;CAIH,MAAM,cAAc,MAAM,cAAc,eAAe,UAAU;AACjE,aAAY,aAAa,EAAE,EAAE,UAAU;AAEvC,QAAO;EACL,YAAY;EACZ;EACD"}
@@ -1,2 +1,46 @@
1
- import{logConfigDetails as e}from"@intlayer/chokidar/cli";import{runParallel as t}from"@intlayer/chokidar/utils";import{getAppLogger as n}from"@intlayer/config/logger";import{getConfiguration as r}from"@intlayer/config/node";import{watch as i}from"@intlayer/chokidar/watcher";const a=async a=>{let o=r(a?.configOptions);e(a?.configOptions);let s=n(o),c;a?.with&&(c=t(a.with),c.result.catch(()=>{process.exit(1)}));let l=i({persistent:!0,skipPrepare:a?.skipPrepare??!1}),u=async()=>{process.off(`SIGINT`,u),process.off(`SIGTERM`,u),s(`Stopping Intlayer watcher...`);try{await l.close(),c&&`child`in c&&c.child?.kill(`SIGTERM`)}catch(e){console.error(`Error during shutdown:`,e)}finally{process.exit(0)}};process.on(`SIGINT`,u),process.on(`SIGTERM`,u)};export{a as watchContentDeclaration};
1
+ import { logConfigDetails } from "@intlayer/chokidar/cli";
2
+ import { runParallel } from "@intlayer/chokidar/utils";
3
+ import { getAppLogger } from "@intlayer/config/logger";
4
+ import { getConfiguration } from "@intlayer/config/node";
5
+ import { watch } from "@intlayer/chokidar/watcher";
6
+
7
+ //#region src/watch.ts
8
+ /**
9
+ * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.
10
+ * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}
11
+ */
12
+ const watchContentDeclaration = async (options) => {
13
+ const config = getConfiguration(options?.configOptions);
14
+ logConfigDetails(options?.configOptions);
15
+ const appLogger = getAppLogger(config);
16
+ let parallelProcess;
17
+ if (options?.with) {
18
+ parallelProcess = runParallel(options.with);
19
+ parallelProcess.result.catch(() => {
20
+ process.exit(1);
21
+ });
22
+ }
23
+ const watcher = watch({
24
+ persistent: true,
25
+ skipPrepare: options?.skipPrepare ?? false
26
+ });
27
+ const handleShutdown = async () => {
28
+ process.off("SIGINT", handleShutdown);
29
+ process.off("SIGTERM", handleShutdown);
30
+ appLogger("Stopping Intlayer watcher...");
31
+ try {
32
+ await watcher.close();
33
+ if (parallelProcess && "child" in parallelProcess) parallelProcess.child?.kill("SIGTERM");
34
+ } catch (error) {
35
+ console.error("Error during shutdown:", error);
36
+ } finally {
37
+ process.exit(0);
38
+ }
39
+ };
40
+ process.on("SIGINT", handleShutdown);
41
+ process.on("SIGTERM", handleShutdown);
42
+ };
43
+
44
+ //#endregion
45
+ export { watchContentDeclaration };
2
46
  //# sourceMappingURL=watch.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { logConfigDetails } from '@intlayer/chokidar/cli';\nimport { runParallel } from '@intlayer/chokidar/utils';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n // Capture the watcher instance\n const watcher = watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n const handleShutdown = async () => {\n // Prevent multiple calls\n process.off('SIGINT', handleShutdown);\n process.off('SIGTERM', handleShutdown);\n\n appLogger('Stopping Intlayer watcher...');\n\n try {\n // Close the file watcher immediately to stop \"esbuild service not running\" errors\n await watcher.close();\n\n // If runParallel exposes the child process, we can try to kill it explicitly.\n // Even if it doesn't, process.exit() below usually cleans up attached children.\n if (parallelProcess && 'child' in parallelProcess) {\n // @ts-ignore - Assuming child exists on the return type if runParallel is based on spawn/exec\n parallelProcess.child?.kill('SIGTERM');\n }\n } catch (error) {\n console.error('Error during shutdown:', error);\n } finally {\n process.exit(0);\n }\n };\n\n // Attach Signal Listeners\n process.on('SIGINT', handleShutdown);\n process.on('SIGTERM', handleShutdown);\n};\n"],"mappings":"oRAmBA,MAAa,EAA0B,KAAO,IAA2B,CACvE,IAAM,EAAS,EAAiB,GAAS,cAAc,CACvD,EAAiB,GAAS,cAAc,CAExC,IAAM,EAAY,EAAa,EAAO,CAGlC,EAEA,GAAS,OACX,EAAkB,EAAY,EAAQ,KAAK,CAE3C,EAAgB,OAAO,UAAY,CAEjC,QAAQ,KAAK,EAAE,EACf,EAIJ,IAAM,EAAU,EAAM,CACpB,WAAY,GACZ,YAAa,GAAS,aAAe,GACtC,CAAC,CAGI,EAAiB,SAAY,CAEjC,QAAQ,IAAI,SAAU,EAAe,CACrC,QAAQ,IAAI,UAAW,EAAe,CAEtC,EAAU,+BAA+B,CAEzC,GAAI,CAEF,MAAM,EAAQ,OAAO,CAIjB,GAAmB,UAAW,GAEhC,EAAgB,OAAO,KAAK,UAAU,OAEjC,EAAO,CACd,QAAQ,MAAM,yBAA0B,EAAM,QACtC,CACR,QAAQ,KAAK,EAAE,GAKnB,QAAQ,GAAG,SAAU,EAAe,CACpC,QAAQ,GAAG,UAAW,EAAe"}
1
+ {"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { logConfigDetails } from '@intlayer/chokidar/cli';\nimport { runParallel } from '@intlayer/chokidar/utils';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n // Capture the watcher instance\n const watcher = watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n const handleShutdown = async () => {\n // Prevent multiple calls\n process.off('SIGINT', handleShutdown);\n process.off('SIGTERM', handleShutdown);\n\n appLogger('Stopping Intlayer watcher...');\n\n try {\n // Close the file watcher immediately to stop \"esbuild service not running\" errors\n await watcher.close();\n\n // If runParallel exposes the child process, we can try to kill it explicitly.\n // Even if it doesn't, process.exit() below usually cleans up attached children.\n if (parallelProcess && 'child' in parallelProcess) {\n // @ts-ignore - Assuming child exists on the return type if runParallel is based on spawn/exec\n parallelProcess.child?.kill('SIGTERM');\n }\n } catch (error) {\n console.error('Error during shutdown:', error);\n } finally {\n process.exit(0);\n }\n };\n\n // Attach Signal Listeners\n process.on('SIGINT', handleShutdown);\n process.on('SIGTERM', handleShutdown);\n};\n"],"mappings":";;;;;;;;;;;AAmBA,MAAa,0BAA0B,OAAO,YAA2B;CACvE,MAAM,SAAS,iBAAiB,SAAS,cAAc;AACvD,kBAAiB,SAAS,cAAc;CAExC,MAAM,YAAY,aAAa,OAAO;CAGtC,IAAI;AAEJ,KAAI,SAAS,MAAM;AACjB,oBAAkB,YAAY,QAAQ,KAAK;AAE3C,kBAAgB,OAAO,YAAY;AAEjC,WAAQ,KAAK,EAAE;IACf;;CAIJ,MAAM,UAAU,MAAM;EACpB,YAAY;EACZ,aAAa,SAAS,eAAe;EACtC,CAAC;CAGF,MAAM,iBAAiB,YAAY;AAEjC,UAAQ,IAAI,UAAU,eAAe;AACrC,UAAQ,IAAI,WAAW,eAAe;AAEtC,YAAU,+BAA+B;AAEzC,MAAI;AAEF,SAAM,QAAQ,OAAO;AAIrB,OAAI,mBAAmB,WAAW,gBAEhC,iBAAgB,OAAO,KAAK,UAAU;WAEjC,OAAO;AACd,WAAQ,MAAM,0BAA0B,MAAM;YACtC;AACR,WAAQ,KAAK,EAAE;;;AAKnB,SAAQ,GAAG,UAAU,eAAe;AACpC,SAAQ,GAAG,WAAW,eAAe"}
@@ -1,4 +1,4 @@
1
- import { t as GetTargetDictionaryOptions } from "../getTargetDictionary-RBSRtaQj.js";
1
+ import { GetTargetDictionaryOptions } from "../getTargetDictionary.js";
2
2
  import { AIOptions } from "@intlayer/api";
3
3
  import { ListGitFilesOptions } from "@intlayer/chokidar/cli";
4
4
  import { Locale } from "@intlayer/types/allLocales";
@@ -1,5 +1,5 @@
1
1
  import { TranslationTask } from "./listTranslationsTasks.js";
2
- import { t as AIClient } from "../setupAI-Bosjx7ah.js";
2
+ import { AIClient } from "../utils/setupAI.js";
3
3
  import { IntlayerConfig } from "@intlayer/types/config";
4
4
  import { AIOptions } from "@intlayer/api";
5
5
  import { Dictionary } from "@intlayer/types/dictionary";
@@ -1,2 +1,19 @@
1
- import { n as ensureArray, r as getTargetUnmergedDictionaries, t as GetTargetDictionaryOptions } from "./getTargetDictionary-RBSRtaQj.js";
2
- export { GetTargetDictionaryOptions, ensureArray, getTargetUnmergedDictionaries };
1
+ import { GetConfigurationOptions } from "@intlayer/config/node";
2
+ import { ListGitFilesOptions } from "@intlayer/chokidar/cli";
3
+ import { Dictionary } from "@intlayer/types/dictionary";
4
+
5
+ //#region src/getTargetDictionary.d.ts
6
+ declare const ensureArray: <T>(value: T | T[]) => T[];
7
+ type GetTargetDictionaryOptions = {
8
+ file?: string | string[];
9
+ keys?: string | string[];
10
+ excludedKeys?: string | string[];
11
+ filter?: (entry: Dictionary) => boolean;
12
+ pathFilter?: string | string[];
13
+ gitOptions?: ListGitFilesOptions;
14
+ configOptions?: GetConfigurationOptions;
15
+ };
16
+ declare const getTargetUnmergedDictionaries: (options?: GetTargetDictionaryOptions) => Promise<Dictionary[]>;
17
+ //#endregion
18
+ export { GetTargetDictionaryOptions, ensureArray, getTargetUnmergedDictionaries };
19
+ //# sourceMappingURL=getTargetDictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTargetDictionary.d.ts","names":[],"sources":["../../src/getTargetDictionary.ts"],"mappings":";;;;;cASa,WAAA,MAAkB,KAAA,EAAO,CAAA,GAAI,CAAA,OAAM,CAAA;AAAA,KAGpC,0BAAA;EACV,IAAA;EACA,IAAA;EACA,YAAA;EACA,MAAA,IAAU,KAAA,EAAO,UAAA;EACjB,UAAA;EACA,UAAA,GAAa,mBAAA;EACb,aAAA,GAAgB,uBAAA;AAAA;AAAA,cAGL,6BAAA,GACX,OAAA,GAAU,0BAAA,KACT,OAAA,CAAQ,UAAA"}
@@ -13,8 +13,8 @@ import { push } from "./push/push.js";
13
13
  import { pushConfig } from "./pushConfig.js";
14
14
  import { reviewDoc } from "./reviewDoc/reviewDoc.js";
15
15
  import { searchDoc } from "./searchDoc.js";
16
- import { n as listMissingTranslationsWithConfig, t as listMissingTranslations } from "./listMissingTranslations-DxKw7nqI.js";
17
- import { t as testMissingTranslations } from "./test-DUTiJR5_.js";
16
+ import { listMissingTranslations, listMissingTranslationsWithConfig } from "./test/listMissingTranslations.js";
17
+ import { testMissingTranslations } from "./test/test.js";
18
18
  import { translateDoc } from "./translateDoc/translateDoc.js";
19
19
  export * from "@intlayer/chokidar/cli";
20
20
  export * from "@intlayer/chokidar/utils";
@@ -1,4 +1,4 @@
1
- import { t as AIClient } from "../setupAI-Bosjx7ah.js";
1
+ import { AIClient } from "../utils/setupAI.js";
2
2
  import { GetConfigurationOptions } from "@intlayer/config/node";
3
3
  import { AIOptions } from "@intlayer/api";
4
4
  import { Locale } from "@intlayer/types/allLocales";
@@ -1,3 +1,3 @@
1
- import { n as listMissingTranslationsWithConfig, t as listMissingTranslations } from "../listMissingTranslations-DxKw7nqI.js";
2
- import { t as testMissingTranslations } from "../test-DUTiJR5_.js";
1
+ import { listMissingTranslations, listMissingTranslationsWithConfig } from "./listMissingTranslations.js";
2
+ import { testMissingTranslations } from "./test.js";
3
3
  export { listMissingTranslations, listMissingTranslationsWithConfig, testMissingTranslations };
@@ -1,2 +1,28 @@
1
- import { n as listMissingTranslationsWithConfig, t as listMissingTranslations } from "../listMissingTranslations-DxKw7nqI.js";
2
- export { listMissingTranslations, listMissingTranslationsWithConfig };
1
+ import { IntlayerConfig } from "@intlayer/types/config";
2
+ import { GetConfigurationOptions } from "@intlayer/config/node";
3
+ import { Locale } from "@intlayer/types/allLocales";
4
+
5
+ //#region src/test/listMissingTranslations.d.ts
6
+ declare const listMissingTranslationsWithConfig: (configuration: IntlayerConfig) => {
7
+ missingTranslations: {
8
+ key: string;
9
+ filePath?: string;
10
+ id?: string;
11
+ locales: Locale[];
12
+ }[];
13
+ missingLocales: Locale[];
14
+ missingRequiredLocales: Locale[];
15
+ };
16
+ declare const listMissingTranslations: (configurationOptions?: GetConfigurationOptions) => {
17
+ missingTranslations: {
18
+ key: string;
19
+ filePath?: string;
20
+ id?: string;
21
+ locales: Locale[];
22
+ }[];
23
+ missingLocales: Locale[];
24
+ missingRequiredLocales: Locale[];
25
+ };
26
+ //#endregion
27
+ export { listMissingTranslations, listMissingTranslationsWithConfig };
28
+ //# sourceMappingURL=listMissingTranslations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listMissingTranslations.d.ts","names":[],"sources":["../../../src/test/listMissingTranslations.ts"],"mappings":";;;;;cAYa,iCAAA,GACX,aAAA,EAAe,cAAA;;;;;aASJ,MAAA;EAAA;;;;cAmEA,uBAAA,GACX,oBAAA,GAAuB,uBAAA;;;;;aApEZ,MAAA;EAAA"}
@@ -1,2 +1,11 @@
1
- import { t as testMissingTranslations } from "../test-DUTiJR5_.js";
2
- export { testMissingTranslations };
1
+ import { GetConfigurationOptions } from "@intlayer/config/node";
2
+
3
+ //#region src/test/test.d.ts
4
+ type ListMissingTranslationsOptions = {
5
+ configOptions?: GetConfigurationOptions;
6
+ build?: boolean;
7
+ };
8
+ declare const testMissingTranslations: (options?: ListMissingTranslationsOptions) => Promise<void>;
9
+ //#endregion
10
+ export { testMissingTranslations };
11
+ //# sourceMappingURL=test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.d.ts","names":[],"sources":["../../../src/test/test.ts"],"mappings":";;;KAgBK,8BAAA;EACH,aAAA,GAAgB,uBAAA;EAChB,KAAA;AAAA;AAAA,cAGW,uBAAA,GACX,OAAA,GAAU,8BAAA,KAA8B,OAAA"}
@@ -1,4 +1,4 @@
1
- import { a as TranslateFileOptions, i as TranslateDocOptions, n as FlushStrategy, r as LimitFunction, t as ErrorState } from "../types-BKvc3FmV.js";
1
+ import { ErrorState, FlushStrategy, LimitFunction, TranslateDocOptions, TranslateFileOptions } from "./types.js";
2
2
  import { translateDoc } from "./translateDoc.js";
3
3
  import { translateFile } from "./translateFile.js";
4
4
  import { sanitizeChunk, validateTranslation } from "./validation.js";
@@ -1,4 +1,4 @@
1
- import { i as TranslateDocOptions } from "../types-BKvc3FmV.js";
1
+ import { TranslateDocOptions } from "./types.js";
2
2
 
3
3
  //#region src/translateDoc/translateDoc.d.ts
4
4
  declare const translateDoc: ({
@@ -1,4 +1,4 @@
1
- import { a as TranslateFileOptions } from "../types-BKvc3FmV.js";
1
+ import { TranslateFileOptions } from "./types.js";
2
2
 
3
3
  //#region src/translateDoc/translateFile.d.ts
4
4
  declare const translateFile: ({
@@ -1,2 +1,48 @@
1
- import { a as TranslateFileOptions, i as TranslateDocOptions, n as FlushStrategy, r as LimitFunction, t as ErrorState } from "../types-BKvc3FmV.js";
2
- export { ErrorState, FlushStrategy, LimitFunction, TranslateDocOptions, TranslateFileOptions };
1
+ import { AIClient } from "../utils/setupAI.js";
2
+ import { IntlayerConfig } from "@intlayer/types/config";
3
+ import { GetConfigurationOptions } from "@intlayer/config/node";
4
+ import { ListGitFilesOptions } from "@intlayer/chokidar/cli";
5
+ import { Locale } from "@intlayer/types/allLocales";
6
+ import { AIConfig, AIOptions } from "@intlayer/ai";
7
+
8
+ //#region src/translateDoc/types.d.ts
9
+ type ErrorState = {
10
+ count: number;
11
+ maxErrors: number;
12
+ shouldStop: boolean;
13
+ };
14
+ type FlushStrategy = 'incremental' | 'end' | 'none';
15
+ type LimitFunction = (fn: () => Promise<any>, ...args: any[]) => Promise<any>;
16
+ type TranslateFileOptions = {
17
+ baseFilePath: string;
18
+ outputFilePath: string;
19
+ locale: Locale;
20
+ baseLocale: Locale;
21
+ configuration: IntlayerConfig;
22
+ errorState: ErrorState;
23
+ aiOptions?: AIOptions;
24
+ customInstructions?: string;
25
+ aiClient?: AIClient;
26
+ aiConfig?: AIConfig;
27
+ flushStrategy?: FlushStrategy;
28
+ onChunkReceive?: (chunk: string, index: number, total: number) => void;
29
+ limit?: LimitFunction;
30
+ };
31
+ type TranslateDocOptions = {
32
+ docPattern: string[];
33
+ locales: Locale[];
34
+ excludedGlobPattern: string[];
35
+ baseLocale: Locale;
36
+ aiOptions?: AIOptions;
37
+ nbSimultaneousFileProcessed?: number;
38
+ configOptions?: GetConfigurationOptions;
39
+ customInstructions?: string;
40
+ skipIfModifiedBefore?: number | string | Date;
41
+ skipIfModifiedAfter?: number | string | Date;
42
+ skipIfExists?: boolean;
43
+ gitOptions?: ListGitFilesOptions;
44
+ flushStrategy?: FlushStrategy;
45
+ };
46
+ //#endregion
47
+ export { ErrorState, FlushStrategy, LimitFunction, TranslateDocOptions, TranslateFileOptions };
48
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/translateDoc/types.ts"],"mappings":";;;;;;;;KAOY,UAAA;EACV,KAAA;EACA,SAAA;EACA,UAAA;AAAA;AAAA,KAGU,aAAA;AAAA,KAGA,aAAA,IACV,EAAA,QAAU,OAAA,UACP,IAAA,YACA,OAAA;AAAA,KAEO,oBAAA;EACV,YAAA;EACA,cAAA;EACA,MAAA,EAAQ,MAAA;EACR,UAAA,EAAY,MAAA;EACZ,aAAA,EAAe,cAAA;EACf,UAAA,EAAY,UAAA;EACZ,SAAA,GAAY,SAAA;EACZ,kBAAA;EACA,QAAA,GAAW,QAAA;EACX,QAAA,GAAW,QAAA;EACX,aAAA,GAAgB,aAAA;EAChB,cAAA,IAAkB,KAAA,UAAe,KAAA,UAAe,KAAA;EAChD,KAAA,GAAQ,aAAA;AAAA;AAAA,KAGE,mBAAA;EACV,UAAA;EACA,OAAA,EAAS,MAAA;EACT,mBAAA;EACA,UAAA,EAAY,MAAA;EACZ,SAAA,GAAY,SAAA;EACZ,2BAAA;EACA,aAAA,GAAgB,uBAAA;EAChB,kBAAA;EACA,oBAAA,qBAAyC,IAAA;EACzC,mBAAA,qBAAwC,IAAA;EACxC,YAAA;EACA,UAAA,GAAa,mBAAA;EACb,aAAA,GAAgB,aAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { t as AIClient } from "../setupAI-Bosjx7ah.js";
1
+ import { AIClient } from "./setupAI.js";
2
2
  import { IntlayerConfig } from "@intlayer/types/config";
3
3
  import { Messages } from "@intlayer/api";
4
4
  import { AIConfig, AIOptions as AIOptions$1 } from "@intlayer/ai";
@@ -1,2 +1,21 @@
1
- import { n as setupAI, t as AIClient } from "../setupAI-Bosjx7ah.js";
2
- export { AIClient, setupAI };
1
+ import { IntlayerConfig } from "@intlayer/types/config";
2
+ import * as _intlayer_ai0 from "@intlayer/ai";
3
+ import { AIConfig, AIOptions } from "@intlayer/ai";
4
+
5
+ //#region src/utils/setupAI.d.ts
6
+ type AIClient = typeof _intlayer_ai0;
7
+ type SetupAIResult = {
8
+ aiClient?: AIClient;
9
+ aiConfig?: AIConfig;
10
+ isCustomAI: boolean;
11
+ hasAIAccess: boolean;
12
+ };
13
+ /**
14
+ * Checks if the @intlayer/ai package is available and configured when an API key is provided.
15
+ * If API key is present but package is missing, logs a warning.
16
+ * Also checks if the user has access to AI (either via local key or CMS auth).
17
+ */
18
+ declare const setupAI: (configuration: IntlayerConfig, aiOptions?: AIOptions) => Promise<SetupAIResult | undefined>;
19
+ //#endregion
20
+ export { AIClient, setupAI };
21
+ //# sourceMappingURL=setupAI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupAI.d.ts","names":[],"sources":["../../../src/utils/setupAI.ts"],"mappings":";;;;;KAMY,QAAA,UAAQ,aAAA;AAAA,KAEf,aAAA;EACH,QAAA,GAAW,QAAA;EACX,QAAA,GAAW,QAAA;EACX,UAAA;EACA,WAAA;AAAA;;AANmD;;;;cA4BxC,OAAA,GACX,aAAA,EAAe,cAAA,EACf,SAAA,GAAY,SAAA,KACX,OAAA,CAAQ,aAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/cli",
3
- "version": "8.4.3",
3
+ "version": "8.4.5",
4
4
  "private": false,
5
5
  "description": "Provides uniform command-line interface scripts for Intlayer, used in packages like intlayer-cli and intlayer.",
6
6
  "keywords": [
@@ -67,16 +67,16 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@clack/prompts": "0.11.0",
70
- "@intlayer/ai": "8.4.3",
71
- "@intlayer/api": "8.4.3",
72
- "@intlayer/babel": "8.4.3",
73
- "@intlayer/chokidar": "8.4.3",
74
- "@intlayer/config": "8.4.3",
75
- "@intlayer/core": "8.4.3",
76
- "@intlayer/dictionaries-entry": "8.4.3",
77
- "@intlayer/remote-dictionaries-entry": "8.4.3",
78
- "@intlayer/types": "8.4.3",
79
- "@intlayer/unmerged-dictionaries-entry": "8.4.3",
70
+ "@intlayer/ai": "8.4.5",
71
+ "@intlayer/api": "8.4.5",
72
+ "@intlayer/babel": "8.4.5",
73
+ "@intlayer/chokidar": "8.4.5",
74
+ "@intlayer/config": "8.4.5",
75
+ "@intlayer/core": "8.4.5",
76
+ "@intlayer/dictionaries-entry": "8.4.5",
77
+ "@intlayer/remote-dictionaries-entry": "8.4.5",
78
+ "@intlayer/types": "8.4.5",
79
+ "@intlayer/unmerged-dictionaries-entry": "8.4.5",
80
80
  "commander": "14.0.3",
81
81
  "enquirer": "^2.4.1",
82
82
  "eventsource": "4.1.0",
@@ -93,7 +93,7 @@
93
93
  "vitest": "4.1.0"
94
94
  },
95
95
  "peerDependencies": {
96
- "@intlayer/ai": "8.4.3"
96
+ "@intlayer/ai": "8.4.5"
97
97
  },
98
98
  "peerDependenciesMeta": {
99
99
  "@intlayer/ai": {
@@ -1,2 +0,0 @@
1
- require(`./chunk-Bmb41Sf3.cjs`);let e=require(`node:fs`),t=require(`node:path`),n=require(`node:url`);const r=()=>{try{return(0,t.dirname)((0,n.fileURLToPath)(require(`url`).pathToFileURL(__filename).href))}catch{return typeof __dirname<`u`?__dirname:process.cwd()}},i=e=>{let n=e;for(let e=0;e<12;e++){if((0,t.basename)(n)===`dist`)return n;let e=(0,t.resolve)(n,`..`);if(e===n)break;n=e}return null},a=e=>{if(!e)return null;try{if(e.startsWith(`file://`))return(0,n.fileURLToPath)(e)}catch{}return e},o=()=>{let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error();Error.captureStackTrace(e,o);let n=e.stack||[],r=e=>e.includes(`${t.sep}_virtual${t.sep}`)||e.includes(`/_virtual/`);for(let e of n){let n=a(typeof e.getFileName==`function`?e.getFileName():null);if(n&&!(n.includes(`node:internal`)||n.includes(`${t.sep}internal${t.sep}modules${t.sep}`))&&!r(n))return(0,t.dirname)(n)}for(let e of n){let n=a(typeof e.getFileName==`function`?e.getFileName():null);if(n)return(0,t.dirname)(n)}}catch{}finally{Error.prepareStackTrace=e}return r()},s=(n,a=`utf8`)=>{let s=r(),c=i(s)??(0,t.resolve)(s,`..`,`..`,`dist`),l=(0,t.join)(c,`assets`),u=[],d=(0,t.relative)(c,o()).split(`\\`).join(`/`).replace(/^(?:dist\/)?(?:esm|cjs)\//,``).replace(/^_virtual\//,``);if(n.startsWith(`./`)||n.startsWith(`../`)){let r=(0,t.resolve)(l,d,n);if(u.push(r),(0,e.existsSync)(r))return(0,e.readFileSync)(r,a)}let f=(0,t.join)(l,n);if(u.push(f),(0,e.existsSync)(f))return(0,e.readFileSync)(f,a);if(d){let r=(0,t.join)(l,d,n);if(u.push(r),(0,e.existsSync)(r))return(0,e.readFileSync)(r,a)}let p=[`readAsset: file not found.`,`Searched:`,...u.map(e=>`- ${e}`)].join(`
2
- `);throw Error(p)};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
@@ -1,2 +0,0 @@
1
- import{existsSync as e,readFileSync as t}from"node:fs";import{basename as n,dirname as r,join as i,relative as a,resolve as o,sep as s}from"node:path";import{fileURLToPath as c}from"node:url";const l=()=>{try{return r(c(import.meta.url))}catch{return typeof __dirname<`u`?__dirname:process.cwd()}},u=e=>{let t=e;for(let e=0;e<12;e++){if(n(t)===`dist`)return t;let e=o(t,`..`);if(e===t)break;t=e}return null},d=e=>{if(!e)return null;try{if(e.startsWith(`file://`))return c(e)}catch{}return e},f=()=>{let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error();Error.captureStackTrace(e,f);let t=e.stack||[],n=e=>e.includes(`${s}_virtual${s}`)||e.includes(`/_virtual/`);for(let e of t){let t=d(typeof e.getFileName==`function`?e.getFileName():null);if(t&&!(t.includes(`node:internal`)||t.includes(`${s}internal${s}modules${s}`))&&!n(t))return r(t)}for(let e of t){let t=d(typeof e.getFileName==`function`?e.getFileName():null);if(t)return r(t)}}catch{}finally{Error.prepareStackTrace=e}return l()},p=(n,r=`utf8`)=>{let s=l(),c=u(s)??o(s,`..`,`..`,`dist`),d=i(c,`assets`),p=[],m=a(c,f()).split(`\\`).join(`/`).replace(/^(?:dist\/)?(?:esm|cjs)\//,``).replace(/^_virtual\//,``);if(n.startsWith(`./`)||n.startsWith(`../`)){let i=o(d,m,n);if(p.push(i),e(i))return t(i,r)}let h=i(d,n);if(p.push(h),e(h))return t(h,r);if(m){let a=i(d,m,n);if(p.push(a),e(a))return t(a,r)}let g=[`readAsset: file not found.`,`Searched:`,...p.map(e=>`- ${e}`)].join(`
2
- `);throw Error(g)};export{p as t};
@@ -1,2 +0,0 @@
1
- import{dirname as e,resolve as t}from"node:path";import{spawn as n}from"node:child_process";import{createRequire as r}from"node:module";import{isESModule as i}from"@intlayer/config/utils";var a=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const o=o=>{let s=[`start`];o.env&&s.push(`--env`,o.env),o.envFile&&s.push(`--env-file`,o.envFile);let c=e=>n(process.execPath,[e,...s],{stdio:`inherit`,env:{...process.env}}),l=(e,t)=>n(e,t,{stdio:`inherit`,env:{...process.env}});try{let n=c(t(e((i?r(import.meta.url):a).resolve(`intlayer-editor/package.json`)),`bin`,`intlayer-editor.mjs`));n.on(`error`,()=>u()),n.on(`exit`,e=>{e===255&&process.exit(e??0)})}catch{u()}function u(){l(`bun`,[`dlx`,`intlayer-editor`,...s]).on(`error`,()=>{l(`npx`,[`-y`,`intlayer-editor`,...s]).on(`error`,e=>{console.error(`Unable to execute intlayer-editor via bun or npx.`),console.error(String(e?.message??e)),process.exit(1)})})}};export{o as t};
2
- //# sourceMappingURL=editor-D8BGlLzF.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-D8BGlLzF.mjs","names":["pathResolve","pathDirname"],"sources":["../../src/editor.ts"],"sourcesContent":["import { spawn } from 'node:child_process';\nimport { createRequire } from 'node:module';\nimport { dirname as pathDirname, resolve as pathResolve } from 'node:path';\nimport { isESModule } from '@intlayer/config/utils';\n\ntype StartEditorOptions = {\n env?: string;\n envFile?: string;\n};\n\nexport const startEditor = (options: StartEditorOptions): void => {\n const args: string[] = ['start'];\n\n if (options.env) args.push('--env', options.env);\n if (options.envFile) args.push('--env-file', options.envFile);\n\n const spawnNodeProcess = (binPath: string) =>\n spawn(process.execPath, [binPath, ...args], {\n stdio: 'inherit',\n env: { ...process.env },\n });\n\n const spawnWith = (cmd: string, cmdArgs: string[]) =>\n spawn(cmd, cmdArgs, {\n stdio: 'inherit',\n env: { ...process.env },\n });\n\n try {\n const requireFunction = isESModule\n ? createRequire(import.meta.url)\n : require;\n const pkgJsonPath = requireFunction.resolve('intlayer-editor/package.json');\n const pkgDir = pathDirname(pkgJsonPath);\n const binPath = pathResolve(pkgDir, 'bin', 'intlayer-editor.mjs');\n\n const child = spawnNodeProcess(binPath);\n child.on('error', () => runFallback());\n child.on('exit', (code) => {\n if (code === 255) process.exit(code ?? 0);\n });\n } catch {\n runFallback();\n }\n\n function runFallback() {\n const bun = spawnWith('bun', ['dlx', 'intlayer-editor', ...args]);\n bun.on('error', () => {\n const npx = spawnWith('npx', ['-y', 'intlayer-editor', ...args]);\n npx.on('error', (err) => {\n console.error('Unable to execute intlayer-editor via bun or npx.');\n console.error(String(err?.message ?? err));\n process.exit(1);\n });\n });\n }\n};\n"],"mappings":"+jBAUA,MAAa,EAAe,GAAsC,CAChE,IAAM,EAAiB,CAAC,QAAQ,CAE5B,EAAQ,KAAK,EAAK,KAAK,QAAS,EAAQ,IAAI,CAC5C,EAAQ,SAAS,EAAK,KAAK,aAAc,EAAQ,QAAQ,CAE7D,IAAM,EAAoB,GACxB,EAAM,QAAQ,SAAU,CAAC,EAAS,GAAG,EAAK,CAAE,CAC1C,MAAO,UACP,IAAK,CAAE,GAAG,QAAQ,IAAK,CACxB,CAAC,CAEE,GAAa,EAAa,IAC9B,EAAM,EAAK,EAAS,CAClB,MAAO,UACP,IAAK,CAAE,GAAG,QAAQ,IAAK,CACxB,CAAC,CAEJ,GAAI,CAQF,IAAM,EAAQ,EAFEA,EADDC,GAJS,EACpB,EAAc,OAAO,KAAK,IAAI,CAAA,GAEE,QAAQ,+BAA+B,CACpC,CACH,MAAO,sBAAsB,CAE1B,CACvC,EAAM,GAAG,YAAe,GAAa,CAAC,CACtC,EAAM,GAAG,OAAS,GAAS,CACrB,IAAS,KAAK,QAAQ,KAAK,GAAQ,EAAE,EACzC,MACI,CACN,GAAa,CAGf,SAAS,GAAc,CACT,EAAU,MAAO,CAAC,MAAO,kBAAmB,GAAG,EAAK,CAAC,CAC7D,GAAG,YAAe,CACR,EAAU,MAAO,CAAC,KAAM,kBAAmB,GAAG,EAAK,CAAC,CAC5D,GAAG,QAAU,GAAQ,CACvB,QAAQ,MAAM,oDAAoD,CAClE,QAAQ,MAAM,OAAO,GAAK,SAAW,EAAI,CAAC,CAC1C,QAAQ,KAAK,EAAE,EACf,EACF"}
@@ -1,19 +0,0 @@
1
- import { GetConfigurationOptions } from "@intlayer/config/node";
2
- import { ListGitFilesOptions } from "@intlayer/chokidar/cli";
3
- import { Dictionary } from "@intlayer/types/dictionary";
4
-
5
- //#region src/getTargetDictionary.d.ts
6
- declare const ensureArray: <T>(value: T | T[]) => T[];
7
- type GetTargetDictionaryOptions = {
8
- file?: string | string[];
9
- keys?: string | string[];
10
- excludedKeys?: string | string[];
11
- filter?: (entry: Dictionary) => boolean;
12
- pathFilter?: string | string[];
13
- gitOptions?: ListGitFilesOptions;
14
- configOptions?: GetConfigurationOptions;
15
- };
16
- declare const getTargetUnmergedDictionaries: (options?: GetTargetDictionaryOptions) => Promise<Dictionary[]>;
17
- //#endregion
18
- export { ensureArray as n, getTargetUnmergedDictionaries as r, GetTargetDictionaryOptions as t };
19
- //# sourceMappingURL=getTargetDictionary-RBSRtaQj.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTargetDictionary-RBSRtaQj.d.ts","names":[],"sources":["../../src/getTargetDictionary.ts"],"mappings":";;;;;cASa,WAAA,MAAkB,KAAA,EAAO,CAAA,GAAI,CAAA,OAAM,CAAA;AAAA,KAGpC,0BAAA;EACV,IAAA;EACA,IAAA;EACA,YAAA;EACA,MAAA,IAAU,KAAA,EAAO,UAAA;EACjB,UAAA;EACA,UAAA,GAAa,mBAAA;EACb,aAAA,GAAgB,uBAAA;AAAA;AAAA,cAGL,6BAAA,GACX,OAAA,GAAU,0BAAA,KACT,OAAA,CAAQ,UAAA"}
@@ -1,28 +0,0 @@
1
- import { IntlayerConfig } from "@intlayer/types/config";
2
- import { GetConfigurationOptions } from "@intlayer/config/node";
3
- import { Locale } from "@intlayer/types/allLocales";
4
-
5
- //#region src/test/listMissingTranslations.d.ts
6
- declare const listMissingTranslationsWithConfig: (configuration: IntlayerConfig) => {
7
- missingTranslations: {
8
- key: string;
9
- filePath?: string;
10
- id?: string;
11
- locales: Locale[];
12
- }[];
13
- missingLocales: Locale[];
14
- missingRequiredLocales: Locale[];
15
- };
16
- declare const listMissingTranslations: (configurationOptions?: GetConfigurationOptions) => {
17
- missingTranslations: {
18
- key: string;
19
- filePath?: string;
20
- id?: string;
21
- locales: Locale[];
22
- }[];
23
- missingLocales: Locale[];
24
- missingRequiredLocales: Locale[];
25
- };
26
- //#endregion
27
- export { listMissingTranslationsWithConfig as n, listMissingTranslations as t };
28
- //# sourceMappingURL=listMissingTranslations-DxKw7nqI.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listMissingTranslations-DxKw7nqI.d.ts","names":[],"sources":["../../src/test/listMissingTranslations.ts"],"mappings":";;;;;cAYa,iCAAA,GACX,aAAA,EAAe,cAAA;;;;;aASJ,MAAA;EAAA;;;;cAmEA,uBAAA,GACX,oBAAA,GAAuB,uBAAA;;;;;aApEZ,MAAA;EAAA"}
@@ -1,21 +0,0 @@
1
- import { IntlayerConfig } from "@intlayer/types/config";
2
- import * as _intlayer_ai0 from "@intlayer/ai";
3
- import { AIConfig, AIOptions } from "@intlayer/ai";
4
-
5
- //#region src/utils/setupAI.d.ts
6
- type AIClient = typeof _intlayer_ai0;
7
- type SetupAIResult = {
8
- aiClient?: AIClient;
9
- aiConfig?: AIConfig;
10
- isCustomAI: boolean;
11
- hasAIAccess: boolean;
12
- };
13
- /**
14
- * Checks if the @intlayer/ai package is available and configured when an API key is provided.
15
- * If API key is present but package is missing, logs a warning.
16
- * Also checks if the user has access to AI (either via local key or CMS auth).
17
- */
18
- declare const setupAI: (configuration: IntlayerConfig, aiOptions?: AIOptions) => Promise<SetupAIResult | undefined>;
19
- //#endregion
20
- export { setupAI as n, AIClient as t };
21
- //# sourceMappingURL=setupAI-Bosjx7ah.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setupAI-Bosjx7ah.d.ts","names":[],"sources":["../../src/utils/setupAI.ts"],"mappings":";;;;;KAMY,QAAA,UAAQ,aAAA;AAAA,KAEf,aAAA;EACH,QAAA,GAAW,QAAA;EACX,QAAA,GAAW,QAAA;EACX,UAAA;EACA,WAAA;AAAA;;AANmD;;;;cA4BxC,OAAA,GACX,aAAA,EAAe,cAAA,EACf,SAAA,GAAY,SAAA,KACX,OAAA,CAAQ,aAAA"}
@@ -1,11 +0,0 @@
1
- import { GetConfigurationOptions } from "@intlayer/config/node";
2
-
3
- //#region src/test/test.d.ts
4
- type ListMissingTranslationsOptions = {
5
- configOptions?: GetConfigurationOptions;
6
- build?: boolean;
7
- };
8
- declare const testMissingTranslations: (options?: ListMissingTranslationsOptions) => Promise<void>;
9
- //#endregion
10
- export { testMissingTranslations as t };
11
- //# sourceMappingURL=test-DUTiJR5_.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-DUTiJR5_.d.ts","names":[],"sources":["../../src/test/test.ts"],"mappings":";;;KAgBK,8BAAA;EACH,aAAA,GAAgB,uBAAA;EAChB,KAAA;AAAA;AAAA,cAGW,uBAAA,GACX,OAAA,GAAU,8BAAA,KAA8B,OAAA"}
@@ -1,48 +0,0 @@
1
- import { t as AIClient } from "./setupAI-Bosjx7ah.js";
2
- import { IntlayerConfig } from "@intlayer/types/config";
3
- import { GetConfigurationOptions } from "@intlayer/config/node";
4
- import { ListGitFilesOptions } from "@intlayer/chokidar/cli";
5
- import { Locale } from "@intlayer/types/allLocales";
6
- import { AIConfig, AIOptions } from "@intlayer/ai";
7
-
8
- //#region src/translateDoc/types.d.ts
9
- type ErrorState = {
10
- count: number;
11
- maxErrors: number;
12
- shouldStop: boolean;
13
- };
14
- type FlushStrategy = 'incremental' | 'end' | 'none';
15
- type LimitFunction = (fn: () => Promise<any>, ...args: any[]) => Promise<any>;
16
- type TranslateFileOptions = {
17
- baseFilePath: string;
18
- outputFilePath: string;
19
- locale: Locale;
20
- baseLocale: Locale;
21
- configuration: IntlayerConfig;
22
- errorState: ErrorState;
23
- aiOptions?: AIOptions;
24
- customInstructions?: string;
25
- aiClient?: AIClient;
26
- aiConfig?: AIConfig;
27
- flushStrategy?: FlushStrategy;
28
- onChunkReceive?: (chunk: string, index: number, total: number) => void;
29
- limit?: LimitFunction;
30
- };
31
- type TranslateDocOptions = {
32
- docPattern: string[];
33
- locales: Locale[];
34
- excludedGlobPattern: string[];
35
- baseLocale: Locale;
36
- aiOptions?: AIOptions;
37
- nbSimultaneousFileProcessed?: number;
38
- configOptions?: GetConfigurationOptions;
39
- customInstructions?: string;
40
- skipIfModifiedBefore?: number | string | Date;
41
- skipIfModifiedAfter?: number | string | Date;
42
- skipIfExists?: boolean;
43
- gitOptions?: ListGitFilesOptions;
44
- flushStrategy?: FlushStrategy;
45
- };
46
- //#endregion
47
- export { TranslateFileOptions as a, TranslateDocOptions as i, FlushStrategy as n, LimitFunction as r, ErrorState as t };
48
- //# sourceMappingURL=types-BKvc3FmV.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-BKvc3FmV.d.ts","names":[],"sources":["../../src/translateDoc/types.ts"],"mappings":";;;;;;;;KAOY,UAAA;EACV,KAAA;EACA,SAAA;EACA,UAAA;AAAA;AAAA,KAGU,aAAA;AAAA,KAGA,aAAA,IACV,EAAA,QAAU,OAAA,UACP,IAAA,YACA,OAAA;AAAA,KAEO,oBAAA;EACV,YAAA;EACA,cAAA;EACA,MAAA,EAAQ,MAAA;EACR,UAAA,EAAY,MAAA;EACZ,aAAA,EAAe,cAAA;EACf,UAAA,EAAY,UAAA;EACZ,SAAA,GAAY,SAAA;EACZ,kBAAA;EACA,QAAA,GAAW,QAAA;EACX,QAAA,GAAW,QAAA;EACX,aAAA,GAAgB,aAAA;EAChB,cAAA,IAAkB,KAAA,UAAe,KAAA,UAAe,KAAA;EAChD,KAAA,GAAQ,aAAA;AAAA;AAAA,KAGE,mBAAA;EACV,UAAA;EACA,OAAA,EAAS,MAAA;EACT,mBAAA;EACA,UAAA,EAAY,MAAA;EACZ,SAAA,GAAY,SAAA;EACZ,2BAAA;EACA,aAAA,GAAgB,uBAAA;EAChB,kBAAA;EACA,oBAAA,qBAAyC,IAAA;EACzC,mBAAA,qBAAwC,IAAA;EACxC,YAAA;EACA,UAAA,GAAa,mBAAA;EACb,aAAA,GAAgB,aAAA;AAAA"}