import{logger as e}from"../../../logger/index.mjs";import{generateText as t}from"@intlayer/ai";import*as n from"@intlayer/types/locales";import{readFileSync as r}from"node:fs";import{dirname as i,join as a}from"node:path";import{fileURLToPath as o}from"node:url";import{getLocaleName as s}from"@intlayer/core/localization";const c=r(a(i(o(import.meta.url)),`./PROMPT.md`),`utf-8`),l={},u=e=>`${e}: ${s(e,n.ENGLISH)}`,d=e=>!e||e.length===0?``:`Based on the dictionary content, identify specific tags from the list below that would be relevant:
  
${e.map(({key:e,description:t})=>`- ${e}: ${t}`).join(`

`)}`,f=async({fileContent:n,applicationContext:r,locales:i,keyPath:a,tags:o,aiConfig:s})=>{let l=c.replace(`{{otherLocales}}`,`{${i.map(u).join(`, `)}}`).replace(`{{keyPath}}`,JSON.stringify(a)).replace(`{{applicationContext}}`,r??``).replace(`{{tagsInstructions}}`,d(o));if(!s){e.error(`Failed to configure AI model`);return}let{text:f,usage:p}=await t({...s,messages:[{role:`system`,content:l},{role:`user`,content:[`**File to Audit:**`,n].join(`
`)}]});return e.info(`${p?.totalTokens??0} tokens used in the request`),{fileContent:f,tokenUsed:p?.totalTokens??0}};export{l as aiDefaultOptions,f as auditDictionaryField};
//# sourceMappingURL=index.mjs.map