"use strict";const c=require("./token-estimator-7OLZJiZ7.cjs"),m=require("./logger-BN0ZR9CS.cjs"),u=2e5;function d(e,n,o,s=u){const r=new c.TokenEstimator().estimateTokens(n,o),i=r/s*100,a=e+i;return m.logger.debug(`[ContextProjection] Current: ${e}%, New content: ${r} tokens (${i.toFixed(1)}%), Projected: ${a.toFixed(1)}%`),a}function l(e){return e>=95?{type:"truncate",reason:"critical_overflow",projectedUsage:e}:e>=80?{type:"summarize",reason:"high_usage",projectedUsage:e}:{type:"proceed",reason:"usage_ok"}}function f(e){const n=e.indexOf(",");if(n!==-1)return e.slice(n+1)}function g(e){let n="";const o=[],s=[];for(const t of e)if(["text","mention"].includes(t.type)&&t.text&&(n+=t.text),t.type==="imageUrl"&&t.imageUrl&&o.push(t.imageUrl.url),t.type==="documentUrl"&&t.documentUrl){const r=f(t.documentUrl.url);r&&s.push({data:r,name:t.documentUrl.name,mimeType:t.documentUrl.mimeType})}return{entireMessage:n,imageBase64Urls:o,documentAttachments:s}}exports.decideContextAction=l;exports.estimateProjectedUsage=d;exports.parseMessagePartArray=g;
//# sourceMappingURL=message-parts-tGBL83L3.cjs.map
