import{logger as e}from"../../../logger/index.mjs";import{extractJson as t}from"../../extractJSON.mjs";import{generateText as n}from"@intlayer/ai";import{Locales as r}from"@intlayer/types";import{readFileSync as i}from"node:fs";import{dirname as a,join as o}from"node:path";import{fileURLToPath as s}from"node:url";import{getLocaleName as c}from"@intlayer/core/localization";const l=i(o(a(s(import.meta.url)),`./PROMPT.md`),`utf-8`),u={},d=e=>`${e}: ${c(e,r.ENGLISH)}`,f=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(`

`)].join(`

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