var e=.3,t={owner:1,"task-outcome":.9,agent:.7,speculative:.4},n={short:0,medium:.05,long:.1};function r(e,r=`agent`,i=`short`){return l(e*t[r]+n[i])}function i(e){let t=.4;if(e.type===`workflow`&&(t+=.1),e.type===`success`&&(t+=.05),e.pattern.length>100&&(t+=.1),e.context&&e.context.length>50&&(t+=.1),e.examples_json)try{let n=JSON.parse(e.examples_json);Array.isArray(n)&&n.length>3&&(t+=.1)}catch{}return r(t,e.sourceConfidence,e.memoryTier)}function a(e){let t=e.confidence??.5;return e.actionable&&(t+=.1),e.insight.length>100&&(t+=.1),e.application&&e.application.length>20&&(t+=.1),r(t,e.sourceConfidence,e.memoryTier)}var o={high:.9,medium:.7,low:.5};function s(e){let t=o[e.confidence]??.5;return e.rationale&&e.rationale.length>50&&(t+=.1),e.contextTaskId&&(t+=.05),r(t,e.sourceConfidence,e.memoryTier)}function c(e){let t=.6;return e.text&&e.text.length>200&&(t+=.1),e.title&&e.title.length>10&&(t+=.05),r(t,e.sourceConfidence,e.memoryTier)}function l(e){return Math.min(1,Math.max(0,e))}export{i as a,c as i,s as n,a as r,e as t};