agentix-cli 0.143.0 → 0.145.0

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 (156) hide show
  1. package/dist/{App-UTDCBFZI.js → App-MYHUCIKZ.js} +2 -2
  2. package/dist/{ChatApp-7P22XAL2.js → ChatApp-D6QN6HJP.js} +2 -2
  3. package/dist/{absorb-eval-EGO6JJOV.js → absorb-eval-UAGD42BG.js} +2 -2
  4. package/dist/{agent-AI6LNZV2.js → agent-HEGEDDUE.js} +2 -2
  5. package/dist/{board-dashboard-ZKN5Y3GJ.js → board-dashboard-4KIFLAFO.js} +4 -4
  6. package/dist/{chunk-5BXAKMYK.js → chunk-42BEORFZ.js} +2 -2
  7. package/dist/chunk-4NKPVTVP.js +62 -0
  8. package/dist/chunk-4NKPVTVP.js.map +1 -0
  9. package/dist/{chunk-YYPTXXCJ.js → chunk-5E37FADJ.js} +2 -2
  10. package/dist/{chunk-QSKG754X.js → chunk-5TTHN7DP.js} +12 -8
  11. package/dist/chunk-5TTHN7DP.js.map +1 -0
  12. package/dist/{chunk-XWHD2Z3Z.js → chunk-BPOMIEEE.js} +2 -2
  13. package/dist/chunk-DG2DC43E.js +11 -0
  14. package/dist/chunk-DG2DC43E.js.map +1 -0
  15. package/dist/{chunk-AJUWIBLV.js → chunk-EV76NT3E.js} +2 -2
  16. package/dist/{chunk-O2CYERSX.js → chunk-GMVWDQFF.js} +2 -2
  17. package/dist/{chunk-GB4YT5IG.js → chunk-HCSIM2QW.js} +294 -287
  18. package/dist/chunk-HCSIM2QW.js.map +1 -0
  19. package/dist/{chunk-6CTQPGBR.js → chunk-HP2NWDCS.js} +2 -2
  20. package/dist/{chunk-IABJLTZN.js → chunk-HSRNH4NR.js} +2 -2
  21. package/dist/{chunk-PYI7ZAU3.js → chunk-JTDQO4LI.js} +2 -2
  22. package/dist/{chunk-RB5W3FVO.js → chunk-KAGLCJA3.js} +2 -2
  23. package/dist/{chunk-NYWIN4BW.js → chunk-LJ62ABOZ.js} +2 -2
  24. package/dist/{chunk-YXFTUOZR.js → chunk-LLJZMS23.js} +2 -2
  25. package/dist/{chunk-UNIXYV3U.js → chunk-MMBFAVBR.js} +2 -2
  26. package/dist/{chunk-7H6HDN3K.js → chunk-OFJKTKRM.js} +2 -2
  27. package/dist/{chunk-THWDSPX4.js → chunk-P42M6CYF.js} +2 -2
  28. package/dist/{chunk-N2HLL25P.js → chunk-QXPMWP4R.js} +2 -2
  29. package/dist/{chunk-WY5ZOEOE.js → chunk-SANYTBHX.js} +2 -2
  30. package/dist/{chunk-HPQ3AAG3.js → chunk-SH5TNMS5.js} +2 -2
  31. package/dist/chunk-TJZGAKIB.js +4 -0
  32. package/dist/chunk-TJZGAKIB.js.map +1 -0
  33. package/dist/{chunk-OMO7UTWW.js → chunk-TM3I6C4V.js} +2 -2
  34. package/dist/{chunk-L4RCA3OC.js → chunk-VDJZ2Q3M.js} +2 -2
  35. package/dist/{chunk-QVPBSV5Z.js → chunk-VMMCT27Z.js} +2 -2
  36. package/dist/{chunk-ERG5OUKH.js → chunk-VTVEJ3RA.js} +2 -2
  37. package/dist/{chunk-YVNGPYXN.js → chunk-VXBL2DET.js} +58 -55
  38. package/dist/chunk-VXBL2DET.js.map +1 -0
  39. package/dist/{chunk-Y4CYQV7G.js → chunk-VY7TBMJU.js} +2 -2
  40. package/dist/chunk-VY7TBMJU.js.map +1 -0
  41. package/dist/{chunk-SHEUCITK.js → chunk-WBG6NA7R.js} +2 -2
  42. package/dist/{chunk-SHEUCITK.js.map → chunk-WBG6NA7R.js.map} +1 -1
  43. package/dist/{chunk-MFUN3ZS3.js → chunk-WUBSX6S5.js} +2 -2
  44. package/dist/{chunk-3WBOWXAN.js → chunk-YEFEUSB2.js} +2 -2
  45. package/dist/{chunk-SDSSRNSU.js → chunk-YUY35PY7.js} +3 -3
  46. package/dist/{chunk-DKLVB5L6.js → chunk-YWDXRGVC.js} +6 -6
  47. package/dist/chunk-YWDXRGVC.js.map +1 -0
  48. package/dist/cli.js +1 -1
  49. package/dist/{client-E66ELJK7.js → client-ZU5AWBXQ.js} +2 -2
  50. package/dist/config-Q4MNOHRI.js +2 -0
  51. package/dist/{config-mutate-QBDKJNHA.js → config-mutate-DVARJ4KM.js} +2 -2
  52. package/dist/config-mutator-5NYGSUJD.js +2 -0
  53. package/dist/{contributions-L5XZJ3DP.js → contributions-HKWDGIQV.js} +2 -2
  54. package/dist/{doctor-3ZUFSE6R.js → doctor-RTVGZP3X.js} +2 -2
  55. package/dist/{failure-candidates-XZSZP4HT.js → failure-candidates-NQX2JMMS.js} +2 -2
  56. package/dist/{follow-up-tool-6OCQUSC3.js → follow-up-tool-2T4SIFY2.js} +2 -2
  57. package/dist/{grants-CEUGZBQ4.js → grants-O7SJ2J4B.js} +2 -2
  58. package/dist/{hub-MOQRSVCQ.js → hub-3LDKRLTH.js} +2 -2
  59. package/dist/index.d.ts +295 -76
  60. package/dist/index.js +1 -1
  61. package/dist/{program-AR6F763U.js → program-MAM4NX5P.js} +289 -254
  62. package/dist/program-MAM4NX5P.js.map +1 -0
  63. package/dist/{promote-ZGJEPCBE.js → promote-YOV5ELNF.js} +2 -2
  64. package/dist/{query-JLTHESIZ.js → query-LTKK3M2Y.js} +2 -2
  65. package/dist/{query-settings-GMEL3EKR.js → query-settings-ACXSGMDU.js} +2 -2
  66. package/dist/{registry-MFD3XJBR.js → registry-NIAPKDQF.js} +2 -2
  67. package/dist/{request-planner-4ORFYSAT.js → request-planner-433C7M3L.js} +2 -2
  68. package/dist/{review-candidates-77NDFTGM.js → review-candidates-SI3QBYNH.js} +2 -2
  69. package/dist/{routing-3FL3KYPJ.js → routing-CXT77HBF.js} +2 -2
  70. package/dist/schedule-tool-3R4ISM5R.js +2 -0
  71. package/dist/{scheduler-QLL7ZHYW.js → scheduler-SFHWPWCA.js} +2 -2
  72. package/dist/{seat-RBKONP63.js → seat-CJVTUIM2.js} +2 -2
  73. package/dist/{select-MOUDR6PQ.js → select-JHGDG4H2.js} +2 -2
  74. package/dist/{set-enabled-JKYF3QIA.js → set-enabled-NOJGCJAL.js} +2 -2
  75. package/dist/{tool-Y3ZTSZGE.js → tool-ERK543LL.js} +3 -3
  76. package/dist/{tool-Y3ZTSZGE.js.map → tool-ERK543LL.js.map} +1 -1
  77. package/dist/tool-YOSMTSJM.js +6 -0
  78. package/dist/tool-YOSMTSJM.js.map +1 -0
  79. package/dist/traces-GVEQZX24.js +2 -0
  80. package/dist/{wiki-3FSSLQAE.js → wiki-2LLXQUEP.js} +2 -2
  81. package/dist/wiki-enrich-6C2O2MNV.js +2 -0
  82. package/dist/wiki-enrich-6C2O2MNV.js.map +1 -0
  83. package/dist/workflow-pilot-HCPSMGIC.js +2 -0
  84. package/dist/workflow-pilot-HCPSMGIC.js.map +1 -0
  85. package/package.json +1 -1
  86. package/dist/chunk-3W2BHUGM.js +0 -11
  87. package/dist/chunk-3W2BHUGM.js.map +0 -1
  88. package/dist/chunk-AKWBDCMU.js +0 -4
  89. package/dist/chunk-AKWBDCMU.js.map +0 -1
  90. package/dist/chunk-DKLVB5L6.js.map +0 -1
  91. package/dist/chunk-GB4YT5IG.js.map +0 -1
  92. package/dist/chunk-K22XMF6M.js +0 -62
  93. package/dist/chunk-K22XMF6M.js.map +0 -1
  94. package/dist/chunk-QSKG754X.js.map +0 -1
  95. package/dist/chunk-Y4CYQV7G.js.map +0 -1
  96. package/dist/chunk-YVNGPYXN.js.map +0 -1
  97. package/dist/config-3C3Z7VKG.js +0 -2
  98. package/dist/config-mutator-ZI3SQIUN.js +0 -2
  99. package/dist/program-AR6F763U.js.map +0 -1
  100. package/dist/schedule-tool-5KJMXBRZ.js +0 -2
  101. package/dist/tool-C4JNMTEF.js +0 -6
  102. package/dist/tool-C4JNMTEF.js.map +0 -1
  103. package/dist/wiki-enrich-HQWXZRID.js +0 -2
  104. /package/dist/{App-UTDCBFZI.js.map → App-MYHUCIKZ.js.map} +0 -0
  105. /package/dist/{ChatApp-7P22XAL2.js.map → ChatApp-D6QN6HJP.js.map} +0 -0
  106. /package/dist/{absorb-eval-EGO6JJOV.js.map → absorb-eval-UAGD42BG.js.map} +0 -0
  107. /package/dist/{agent-AI6LNZV2.js.map → agent-HEGEDDUE.js.map} +0 -0
  108. /package/dist/{board-dashboard-ZKN5Y3GJ.js.map → board-dashboard-4KIFLAFO.js.map} +0 -0
  109. /package/dist/{chunk-5BXAKMYK.js.map → chunk-42BEORFZ.js.map} +0 -0
  110. /package/dist/{chunk-YYPTXXCJ.js.map → chunk-5E37FADJ.js.map} +0 -0
  111. /package/dist/{chunk-XWHD2Z3Z.js.map → chunk-BPOMIEEE.js.map} +0 -0
  112. /package/dist/{chunk-AJUWIBLV.js.map → chunk-EV76NT3E.js.map} +0 -0
  113. /package/dist/{chunk-O2CYERSX.js.map → chunk-GMVWDQFF.js.map} +0 -0
  114. /package/dist/{chunk-6CTQPGBR.js.map → chunk-HP2NWDCS.js.map} +0 -0
  115. /package/dist/{chunk-IABJLTZN.js.map → chunk-HSRNH4NR.js.map} +0 -0
  116. /package/dist/{chunk-PYI7ZAU3.js.map → chunk-JTDQO4LI.js.map} +0 -0
  117. /package/dist/{chunk-RB5W3FVO.js.map → chunk-KAGLCJA3.js.map} +0 -0
  118. /package/dist/{chunk-NYWIN4BW.js.map → chunk-LJ62ABOZ.js.map} +0 -0
  119. /package/dist/{chunk-YXFTUOZR.js.map → chunk-LLJZMS23.js.map} +0 -0
  120. /package/dist/{chunk-UNIXYV3U.js.map → chunk-MMBFAVBR.js.map} +0 -0
  121. /package/dist/{chunk-7H6HDN3K.js.map → chunk-OFJKTKRM.js.map} +0 -0
  122. /package/dist/{chunk-THWDSPX4.js.map → chunk-P42M6CYF.js.map} +0 -0
  123. /package/dist/{chunk-N2HLL25P.js.map → chunk-QXPMWP4R.js.map} +0 -0
  124. /package/dist/{chunk-WY5ZOEOE.js.map → chunk-SANYTBHX.js.map} +0 -0
  125. /package/dist/{chunk-HPQ3AAG3.js.map → chunk-SH5TNMS5.js.map} +0 -0
  126. /package/dist/{chunk-OMO7UTWW.js.map → chunk-TM3I6C4V.js.map} +0 -0
  127. /package/dist/{chunk-L4RCA3OC.js.map → chunk-VDJZ2Q3M.js.map} +0 -0
  128. /package/dist/{chunk-QVPBSV5Z.js.map → chunk-VMMCT27Z.js.map} +0 -0
  129. /package/dist/{chunk-ERG5OUKH.js.map → chunk-VTVEJ3RA.js.map} +0 -0
  130. /package/dist/{chunk-MFUN3ZS3.js.map → chunk-WUBSX6S5.js.map} +0 -0
  131. /package/dist/{chunk-3WBOWXAN.js.map → chunk-YEFEUSB2.js.map} +0 -0
  132. /package/dist/{chunk-SDSSRNSU.js.map → chunk-YUY35PY7.js.map} +0 -0
  133. /package/dist/{client-E66ELJK7.js.map → client-ZU5AWBXQ.js.map} +0 -0
  134. /package/dist/{config-3C3Z7VKG.js.map → config-Q4MNOHRI.js.map} +0 -0
  135. /package/dist/{config-mutate-QBDKJNHA.js.map → config-mutate-DVARJ4KM.js.map} +0 -0
  136. /package/dist/{config-mutator-ZI3SQIUN.js.map → config-mutator-5NYGSUJD.js.map} +0 -0
  137. /package/dist/{contributions-L5XZJ3DP.js.map → contributions-HKWDGIQV.js.map} +0 -0
  138. /package/dist/{doctor-3ZUFSE6R.js.map → doctor-RTVGZP3X.js.map} +0 -0
  139. /package/dist/{failure-candidates-XZSZP4HT.js.map → failure-candidates-NQX2JMMS.js.map} +0 -0
  140. /package/dist/{follow-up-tool-6OCQUSC3.js.map → follow-up-tool-2T4SIFY2.js.map} +0 -0
  141. /package/dist/{grants-CEUGZBQ4.js.map → grants-O7SJ2J4B.js.map} +0 -0
  142. /package/dist/{hub-MOQRSVCQ.js.map → hub-3LDKRLTH.js.map} +0 -0
  143. /package/dist/{promote-ZGJEPCBE.js.map → promote-YOV5ELNF.js.map} +0 -0
  144. /package/dist/{query-JLTHESIZ.js.map → query-LTKK3M2Y.js.map} +0 -0
  145. /package/dist/{query-settings-GMEL3EKR.js.map → query-settings-ACXSGMDU.js.map} +0 -0
  146. /package/dist/{registry-MFD3XJBR.js.map → registry-NIAPKDQF.js.map} +0 -0
  147. /package/dist/{request-planner-4ORFYSAT.js.map → request-planner-433C7M3L.js.map} +0 -0
  148. /package/dist/{review-candidates-77NDFTGM.js.map → review-candidates-SI3QBYNH.js.map} +0 -0
  149. /package/dist/{routing-3FL3KYPJ.js.map → routing-CXT77HBF.js.map} +0 -0
  150. /package/dist/{schedule-tool-5KJMXBRZ.js.map → schedule-tool-3R4ISM5R.js.map} +0 -0
  151. /package/dist/{scheduler-QLL7ZHYW.js.map → scheduler-SFHWPWCA.js.map} +0 -0
  152. /package/dist/{seat-RBKONP63.js.map → seat-CJVTUIM2.js.map} +0 -0
  153. /package/dist/{select-MOUDR6PQ.js.map → select-JHGDG4H2.js.map} +0 -0
  154. /package/dist/{set-enabled-JKYF3QIA.js.map → set-enabled-NOJGCJAL.js.map} +0 -0
  155. /package/dist/{wiki-3FSSLQAE.js.map → traces-GVEQZX24.js.map} +0 -0
  156. /package/dist/{wiki-enrich-HQWXZRID.js.map → wiki-2LLXQUEP.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{c as w}from"./chunk-OMO7UTWW.js";function T(t){let r=1779033703^t.length;for(let s=0;s<t.length;s++)r=Math.imul(r^t.charCodeAt(s),3432918353),r=r<<13|r>>>19;let o=r>>>0;return()=>{o=o+1831565813>>>0;let s=o;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}function _(t,r,o){let s=T(o),i=[...t].sort((e,u)=>e.path.localeCompare(u.path));for(let e=i.length-1;e>0;e--){let u=Math.floor(s()*(e+1));[i[e],i[u]]=[i[u],i[e]]}return i.slice(0,Math.max(0,r)).sort((e,u)=>e.path.localeCompare(u.path))}var R=new Set("about after again also because been before being between could does doing during each from have having here into just more most only other over same should some such than that their them then there these they this those through under until very were what when where which while will with would your yours user assistant agent message entry please thanks".split(" "));function k(t){let r=new Set;for(let o of t.toLowerCase().matchAll(/[\p{L}\p{N}][\p{L}\p{N}_-]{3,}/gu))R.has(o[0])||r.add(o[0]);return r}function E(t,r){let o=k(t);if(o.size===0)return 1;let s=k(r),i=0;for(let e of o)s.has(e)&&i++;return i/o.size}var W=.15;function $(t){let r=w(t);return{commits:r.commits,urls:r.urls,numbers:r.numbers}}function j(t,r,o){return t.includes(r)||o.some(s=>s.startsWith(r)||r.startsWith(s))}var y=t=>t.toLowerCase().replace(/\/+$/,"");function N(t,r,o){let s=t.sources.map(a=>r.get(a)).filter(a=>!!a),i=t.sources.filter(a=>!r.has(a)),e=s.filter(a=>k(a.content).size>=5&&E(a.content,t.content)<W).map(a=>a.id),u=[...s.map(a=>`${a.date??""}
1
+ import{c as w}from"./chunk-TM3I6C4V.js";function T(t){let r=1779033703^t.length;for(let s=0;s<t.length;s++)r=Math.imul(r^t.charCodeAt(s),3432918353),r=r<<13|r>>>19;let o=r>>>0;return()=>{o=o+1831565813>>>0;let s=o;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}function _(t,r,o){let s=T(o),i=[...t].sort((e,u)=>e.path.localeCompare(u.path));for(let e=i.length-1;e>0;e--){let u=Math.floor(s()*(e+1));[i[e],i[u]]=[i[u],i[e]]}return i.slice(0,Math.max(0,r)).sort((e,u)=>e.path.localeCompare(u.path))}var R=new Set("about after again also because been before being between could does doing during each from have having here into just more most only other over same should some such than that their them then there these they this those through under until very were what when where which while will with would your yours user assistant agent message entry please thanks".split(" "));function k(t){let r=new Set;for(let o of t.toLowerCase().matchAll(/[\p{L}\p{N}][\p{L}\p{N}_-]{3,}/gu))R.has(o[0])||r.add(o[0]);return r}function E(t,r){let o=k(t);if(o.size===0)return 1;let s=k(r),i=0;for(let e of o)s.has(e)&&i++;return i/o.size}var W=.15;function $(t){let r=w(t);return{commits:r.commits,urls:r.urls,numbers:r.numbers}}function j(t,r,o){return t.includes(r)||o.some(s=>s.startsWith(r)||r.startsWith(s))}var y=t=>t.toLowerCase().replace(/\/+$/,"");function N(t,r,o){let s=t.sources.map(a=>r.get(a)).filter(a=>!!a),i=t.sources.filter(a=>!r.has(a)),e=s.filter(a=>k(a.content).size>=5&&E(a.content,t.content)<W).map(a=>a.id),u=[...s.map(a=>`${a.date??""}
2
2
  ${a.content}`),t.previous??""].join(`
3
3
  `),l=u.toLowerCase(),d=$(u),p=new Set(d.urls.map(y)),g=new Set(d.numbers),n=$(t.content),c=[];for(let a of n.commits)j(l,a,d.commits)||c.push(`commit ${a}`);for(let a of n.urls)!p.has(y(a))&&!l.includes(y(a))&&c.push(`link ${a}`);for(let a of n.numbers)/^\d{1,2}$/.test(a)||!g.has(a)&&!l.includes(a)&&c.push(`number ${a}`);let h=[];for(let a of s){let m=$(a.content);if(m.commits.length===0&&m.urls.length===0)continue;let v=o(a.id),S=(v.length>0?v:[t.content]).join(`
4
4
  `).toLowerCase(),x=$(S);for(let b of m.commits)j(S,b,x.commits)||h.push({entry:a.id,fact:`commit ${b}`});for(let b of m.urls)S.includes(y(b))||h.push({entry:a.id,fact:`link ${b}`})}return{path:t.path,title:t.title,type:t.type,sources:t.sources.length,missingSources:i,weakSources:e,ungrounded:c,lost:h}}function U(t,r){let o=r.toLowerCase(),s=w(r).commits,i=[];for(let e of t){let u=w(e.content),l=[...u.commits.filter(d=>!j(o,d,s)).map(d=>`commit ${d}`),...u.urls.filter(d=>!o.includes(y(d))).map(d=>`link ${d}`)];l.length>0&&i.push({entry:e.id,facts:l})}return i}var P=new Set("the and for with from into of on in at to by an a".split(" "));function L(t){return new Set((t||"").toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(r=>(r.length>1||/\d/.test(r))&&!P.has(r)&&!R.has(r)))}function M(t,r){if(t.size===0||r.size===0)return 0;let o=0;for(let s of t)r.has(s)&&o++;return o/(t.size+r.size-o)}function D(t,r,o={}){let s=o.titleMin??.75,i=o.sourcesMin??.5,e=t.map(l=>({...l,tt:L(l.title),ss:new Set(l.sources??[])})),u=[];for(let l=0;l<e.length;l++)for(let d=l+1;d<e.length;d++){let p=e[l],g=e[d];if(r&&!r.has(p.path)&&!r.has(g.path))continue;let n=(p.type??"")===(g.type??"")?M(p.tt,g.tt):0;if(n>=s){u.push({a:p.path,b:g.path,reason:"title",score:n});continue}if(p.ss.size>=2&&g.ss.size>=2){let c=M(p.ss,g.ss);c>=i&&u.push({a:p.path,b:g.path,reason:"sources",score:c})}}return u.sort((l,d)=>d.score-l.score||l.a.localeCompare(d.a))}var A=4e3;function J(t,r){let o=r.map(i=>{let e=i.content.length>A?`${i.content.slice(0,A)}
@@ -33,4 +33,4 @@ Reply with JSON only, no fencing:
33
33
  {"claims": 0, "supported": 0, "unsupported": [], "contradicted": [], "off_subject": [], "missing": [], "verdict": "good"}`}function z(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let r=t,o=l=>Array.isArray(l)?l.map(d=>String(d)):[],s=l=>typeof l=="number"&&Number.isFinite(l)&&l>=0?Math.round(l):NaN,i=s(r.claims);if(Number.isNaN(i))return null;let e=Math.min(i,Number.isNaN(s(r.supported))?i-o(r.unsupported).length:s(r.supported)),u=r.verdict==="good"||r.verdict==="minor"||r.verdict==="major"?r.verdict:null;return u?{claims:i,supported:Math.max(0,e),unsupported:o(r.unsupported),contradicted:o(r.contradicted),offSubject:o(r.off_subject??r.offSubject),missing:o(r.missing),verdict:u}:null}function I(t,r,o,s=[],i=5,e){let u={};for(let n of t)u[n.type??"untyped"]=(u[n.type??"untyped"]??0)+1;let l=new Set,d=new Set;for(let n of t)for(let c of n.lost)l.add(c.entry),d.add(`${c.entry}|${c.fact}`);let p=new Set(r.flatMap(n=>[n.a,n.b]).filter(n=>t.some(c=>c.path===n))),g={sample:{articles:t.length,seed:o.seed,since:o.since,byType:u},citations:{withSources:t.filter(n=>n.sources>0).length,missingSources:t.reduce((n,c)=>n+c.missingSources.length,0),weakSources:t.reduce((n,c)=>n+c.weakSources.length,0),articlesWithWeak:t.filter(n=>n.weakSources.length>0).length},grounding:{articlesWithUngrounded:t.filter(n=>n.ungrounded.length>0).length,ungroundedFacts:t.reduce((n,c)=>n+c.ungrounded.length,0)},lost:{entriesWithLostFacts:l.size,lostFacts:d.size},duplicates:{pairs:r.length,articlesInPair:p.size},...e?{uncited:{entries:e.entries,withLostFacts:e.lost.length}}:{},examples:{ungrounded:t.filter(n=>n.ungrounded.length>0).slice(0,i).map(n=>({path:n.path,facts:n.ungrounded.slice(0,6)})),lost:t.flatMap(n=>n.lost.map(c=>({path:n.path,...c}))).slice(0,i),weak:t.filter(n=>n.weakSources.length>0).slice(0,i).map(n=>({path:n.path,entries:n.weakSources})),duplicates:r.slice(0,i),uncited:(e?.lost??[]).slice(0,i).map(n=>({entry:n.entry,facts:n.facts.slice(0,4)})),judged:s.filter(n=>n.verdict.verdict!=="good").slice(0,i).map(n=>({path:n.path,verdict:n.verdict.verdict,unsupported:n.verdict.unsupported.slice(0,4),contradicted:n.verdict.contradicted.slice(0,4),offSubject:n.verdict.offSubject,missing:n.verdict.missing.slice(0,4)}))}};if(s.length>0){let n=s.map(a=>a.verdict),c=n.reduce((a,m)=>a+m.claims,0),h=n.reduce((a,m)=>a+m.supported,0);g.judge={judged:n.length,claims:c,supported:h,supportRate:c>0?h/c:1,unsupported:n.reduce((a,m)=>a+m.unsupported.length,0),contradicted:n.reduce((a,m)=>a+m.contradicted.length,0),articlesWithWrongMerge:n.filter(a=>a.offSubject.length>0).length,missingFacts:n.reduce((a,m)=>a+m.missing.length,0),verdicts:{good:n.filter(a=>a.verdict==="good").length,minor:n.filter(a=>a.verdict==="minor").length,major:n.filter(a=>a.verdict==="major").length}}}return g}var f=(t,r)=>r>0?`${Math.round(t/r*100)}%`:"\u2013";function O(t){let r=t.sample.articles,o=["# Wiki absorb scorecard","",`Sample: ${r} articles (seed \`${t.sample.seed}\`${t.sample.since?`, changed since ${t.sample.since}`:""}). Types: ${Object.entries(t.sample.byType).map(([e,u])=>`${e} ${u}`).join(", ")||"\u2013"}.`,"","| Check | Result | Lower is better? |","|---|---|---|",`| Articles citing at least one entry | ${t.citations.withSources}/${r} (${f(t.citations.withSources,r)}) | no |`,`| Cited ids with no entry | ${t.citations.missingSources} | yes |`,`| Articles with a weak citation (entry shares <${Math.round(W*100)}% of its words) | ${t.citations.articlesWithWeak}/${r} (${f(t.citations.articlesWithWeak,r)}) | yes |`,`| Articles with an ungrounded commit, link or number | ${t.grounding.articlesWithUngrounded}/${r} (${f(t.grounding.articlesWithUngrounded,r)}) | yes |`,`| Ungrounded facts | ${t.grounding.ungroundedFacts} | yes |`,`| Commits or links lost from cited entries | ${t.lost.lostFacts} across ${t.lost.entriesWithLostFacts} entries | yes |`,`| Sampled articles in a likely duplicate pair | ${t.duplicates.articlesInPair}/${r} (${f(t.duplicates.articlesInPair,r)}) | yes |`];if(t.uncited&&o.push(`| Entries read in the window but cited by no article | ${t.uncited.entries} | \u2013 |`,`| \u2026of which carry a commit or link no article has | ${t.uncited.withLostFacts} | yes |`),t.judge){let e=t.judge;o.push(`| Judge: claims supported by the cited entries | ${e.supported}/${e.claims} (${f(e.supported,e.claims)}) | no |`,`| Judge: unsupported / contradicted claims | ${e.unsupported} / ${e.contradicted} | yes |`,`| Judge: articles with an off-subject source (wrong merge) | ${e.articlesWithWrongMerge}/${e.judged} (${f(e.articlesWithWrongMerge,e.judged)}) | yes |`,`| Judge: facts missing from the article | ${e.missingFacts} | yes |`,`| Judge verdicts good / minor / major | ${e.verdicts.good} / ${e.verdicts.minor} / ${e.verdicts.major} | \u2013 |`)}let s=t.examples,i=(e,u)=>{u.length!==0&&o.push("",`## ${e}`,"",...u)};return i("Examples: ungrounded facts",s.ungrounded.map(e=>`- \`${e.path}\`: ${e.facts.join("; ")}`)),i("Examples: lost facts",s.lost.map(e=>`- \`${e.path}\` \u2190 entry \`${e.entry}\`: ${e.fact}`)),i("Examples: weak citations",s.weak.map(e=>`- \`${e.path}\`: ${e.entries.map(u=>`\`${u}\``).join(", ")}`)),i("Examples: uncited entries with facts no article has",s.uncited.map(e=>`- \`${e.entry}\`: ${e.facts.join("; ")}`)),i("Examples: likely duplicates",s.duplicates.map(e=>`- \`${e.a}\` \u2194 \`${e.b}\` (${e.reason}, ${e.score.toFixed(2)})`)),i("Examples: judge findings",s.judged.map(e=>{let u=[e.unsupported.length?`unsupported: ${e.unsupported.join(" | ")}`:"",e.contradicted.length?`contradicted: ${e.contradicted.join(" | ")}`:"",e.offSubject.length?`off-subject: ${e.offSubject.join(", ")}`:"",e.missing.length?`missing: ${e.missing.join(" | ")}`:""].filter(Boolean);return`- \`${e.path}\` (${e.verdict}): ${u.join("; ")}`})),o.push("","## Method","","- The sample is drawn with a seeded shuffle from the articles changed in the window, so the same seed and window give the same articles.","- Ungrounded: a commit hash, link or number (three digits or more, or a date) in the article that no cited entry and no earlier version of the article contains.","- Lost: a commit hash or link in a cited entry that no article citing that entry contains.","- Uncited: entries the absorb ledger marks as read in the window that no article cites; those carrying a commit or link that no article on the node has are counted as lost, since absorb will not offer them again.","- Weak citation: a cited entry sharing fewer than 15% of its distinctive words with the article.","- Duplicate: two articles of the same type whose titles share at least 75% of their words, or which share at least half their sources.","- Judge (optional): one model call per article reads the article and its cited entries and lists unsupported, contradicted, off-subject and missing items."),o.join(`
34
34
  `)+`
35
35
  `}function V(t){if(!t||typeof t!="object")return{};let r=t,o=r.usage??{},s=i=>typeof i=="number"&&Number.isFinite(i)?i:void 0;return{costUsd:s(r.total_cost_usd)??s(r.cost_usd),apiMs:s(r.duration_api_ms),inputTokens:s(o.input_tokens),outputTokens:s(o.output_tokens),cacheReadTokens:s(o.cache_read_input_tokens),cacheWriteTokens:s(o.cache_creation_input_tokens)}}function C(t,r){return t.length===0?0:t[Math.min(t.length-1,Math.floor(r*t.length))]}function Y(t){let r=new Map,o=i=>{let e=i||"(none)",u=r.get(e);return u||r.set(e,u={calls:[],runs:[]}),u};for(let i of t)i.kind==="call"?o(i.label).calls.push(i):i.kind==="run"&&o(i.label).runs.push(i);let s=[];for(let[i,{calls:e,runs:u}]of r){if(e.length===0)continue;let l=e.map(n=>n.wallMs).sort((n,c)=>n-c),d;if(u.length>0)d=u.reduce((n,c)=>n+(Date.parse(c.endedAt)-Date.parse(c.startedAt)),0);else{let n=e.map(h=>Date.parse(h.at)-h.wallMs),c=e.map(h=>Date.parse(h.at));d=Math.max(...c)-Math.min(...n)}let p=e.reduce((n,c)=>n+c.entries,0),g=e.reduce((n,c)=>n+(c.costUsd??0),0);s.push({label:i,calls:e.length,failed:e.filter(n=>n.failed).length,entries:p,articles:e.reduce((n,c)=>n+c.articles,0),refused:e.reduce((n,c)=>n+c.refused,0),heldCited:e.reduce((n,c)=>n+(c.heldCited??0),0),wallMs:d,callMsP50:C(l,.5),callMsP95:C(l,.95),prepMs:e.reduce((n,c)=>n+(c.prepMs??0),0),costUsd:g,costPerEntry:p>0?g/p:0,entriesPerMinute:d>0?p/d*6e4:0,promptChars:e.reduce((n,c)=>n+c.promptChars,0)})}return s.sort((i,e)=>i.label.localeCompare(e.label))}export{T as a,_ as b,k as c,E as d,W as e,N as f,U as g,D as h,A as i,J as j,z as k,I as l,O as m,V as n,Y as o};
36
- //# sourceMappingURL=chunk-L4RCA3OC.js.map
36
+ //# sourceMappingURL=chunk-VDJZ2Q3M.js.map
@@ -1,5 +1,5 @@
1
- import{Ha as m,Ia as $,Ra as x}from"./chunk-K22XMF6M.js";x();import{readFileSync as S,writeFileSync as P,existsSync as b}from"fs";import{resolve as f}from"path";function w(r){if(r)return f(r);let e=[f(process.cwd(),"agentx.json"),f(process.cwd(),".agentx/config.json")];for(let n of e)if(b(n))return n;return e[0]}function v(r){return JSON.parse(JSON.stringify(r))}async function O(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/reload`,{method:"POST",signal:AbortSignal.timeout(3e3)});return e.ok?{ok:!0}:{ok:!1,reason:`HTTP ${e.status}`}}catch(e){return{ok:!1,reason:e?.cause?.code||e?.message||"unreachable"}}}async function J(r,e={}){let{validate:n=!0,dryRun:t=!1,reload:s=!0,configPath:u,daemonUrl:c}=e,o=w(u);if(!b(o))return{success:!1,path:o,error:`Config not found at ${o}. Run \`agentx init\` first.`};let d;try{d=S(o,"utf-8")}catch(a){return{success:!1,path:o,error:`Cannot read ${o}: ${a.message}`}}let g;try{g=JSON.parse(d)}catch(a){return{success:!1,path:o,error:`Invalid JSON in ${o}: ${a.message}`}}let i=v(g);try{await r(i)}catch(a){return{success:!1,path:o,error:`Mutator threw: ${a.message}`}}if(n){let a=$(i),l=m.safeParse(a);if(!l.success){let k=l.error.issues.map(y=>` ${y.path.join(".")||"<root>"}: ${y.message}`).join(`
1
+ import{Ja as m,Ka as $,Ta as x}from"./chunk-4NKPVTVP.js";x();import{readFileSync as S,writeFileSync as P,existsSync as b}from"fs";import{resolve as f}from"path";function w(r){if(r)return f(r);let e=[f(process.cwd(),"agentx.json"),f(process.cwd(),".agentx/config.json")];for(let n of e)if(b(n))return n;return e[0]}function v(r){return JSON.parse(JSON.stringify(r))}async function O(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/reload`,{method:"POST",signal:AbortSignal.timeout(3e3)});return e.ok?{ok:!0}:{ok:!1,reason:`HTTP ${e.status}`}}catch(e){return{ok:!1,reason:e?.cause?.code||e?.message||"unreachable"}}}async function J(r,e={}){let{validate:n=!0,dryRun:t=!1,reload:s=!0,configPath:u,daemonUrl:c}=e,o=w(u);if(!b(o))return{success:!1,path:o,error:`Config not found at ${o}. Run \`agentx init\` first.`};let d;try{d=S(o,"utf-8")}catch(a){return{success:!1,path:o,error:`Cannot read ${o}: ${a.message}`}}let g;try{g=JSON.parse(d)}catch(a){return{success:!1,path:o,error:`Invalid JSON in ${o}: ${a.message}`}}let i=v(g);try{await r(i)}catch(a){return{success:!1,path:o,error:`Mutator threw: ${a.message}`}}if(n){let a=$(i),l=m.safeParse(a);if(!l.success){let k=l.error.issues.map(y=>` ${y.path.join(".")||"<root>"}: ${y.message}`).join(`
2
2
  `);return{success:!1,path:o,error:`Validation failed:
3
3
  ${k}`,after:i}}}if(t)return{success:!0,path:o,after:i,dryRun:!0};try{P(o,JSON.stringify(i,null,2)+`
4
4
  `)}catch(a){return{success:!1,path:o,error:`Write failed: ${a.message}`,after:i}}let p=!1,h;if(s){let a=c||R(i),l=await O(a);l.ok?p=!0:h=l.reason}return{success:!0,path:o,after:i,reloaded:p,reloadSkipped:h}}function R(r){let e=r?.node?.bind;if(!e)return"http://127.0.0.1:18800";let[n,t]=e.split(":");return`http://${n==="0.0.0.0"||n==="::"?"127.0.0.1":n}:${t}`}function N(r,e,n){let t=e.split("."),s=r;for(let u=0;u<t.length-1;u++){let c=t[u];(s[c]===void 0||s[c]===null)&&(s[c]={}),s=s[c]}s[t[t.length-1]]=n}function j(r,e){let n=e.split("."),t=r;for(let s of n){if(t==null)return;t=t[s]}return t}function A(r,e){let n=e.split("."),t=r;for(let s=0;s<n.length-1;s++){if(t==null)return;t=t[n[s]]}t!=null&&delete t[n[n.length-1]]}export{w as a,J as b,N as c,j as d,A as e};
5
- //# sourceMappingURL=chunk-QVPBSV5Z.js.map
5
+ //# sourceMappingURL=chunk-VMMCT27Z.js.map
@@ -1,4 +1,4 @@
1
- import{a as h}from"./chunk-6CTQPGBR.js";import{resolve as n}from"path";import{existsSync as c,readdirSync as u,mkdirSync as l,readFileSync as p,writeFileSync as f,renameSync as S}from"fs";var m=class{baseDir;agentsDir;mode;sharedStore;agentStores=new Map;log;constructor(e=n(process.cwd(),".agentx/wiki"),r=console.error.bind(console,"[wiki-hub]"),t="graph"){this.baseDir=e,this.agentsDir=n(e,"agents"),this.mode=t,this.log=r,l(this.agentsDir,{recursive:!0}),this.sharedStore=new h(e,r)}getMode(){return this.mode}getAgentWiki(e){let r=`${e}:${this.mode}`;if(this.agentStores.has(r))return this.agentStores.get(r);let t=n(this.agentsDir,e,this.mode),s=new h(t,this.log);return this.agentStores.set(r,s),s}getBaseDir(){return this.baseDir}getSharedStore(){return this.sharedStore}sharedScope(e){return[...this.listAgentDirs().filter(t=>t!==e).map(t=>({id:t,store:this.getAgentWiki(t)})),{id:"shared",store:this.sharedStore,skip:t=>t.startsWith("agents/")}]}listAgentDirs(){return c(this.agentsDir)?u(this.agentsDir).filter(e=>!e.startsWith("_")&&!e.startsWith(".")&&c(n(this.agentsDir,e,this.mode))).sort():[]}listAgents(e=this.sharedStore.listEntries()){let r=new Set;for(let t of e)r.add(t.agentId);if(c(this.agentsDir))for(let t of u(this.agentsDir))!t.startsWith("_")&&!t.startsWith(".")&&r.add(t);return[...r].sort()}getAgentEntries(e){return this.sharedStore.listEntries({agentId:e})}getUnabsorbedEntries(e){return this.classifyEntries(e).pending}markProcessed(e,r,t){let s=new Set(t),g=this.readLedger(e),d=new Date().toISOString();for(let i of r)g.entries[i]={at:d,cited:s.has(i)};let o=this.ledgerPath(e);l(n(o,".."),{recursive:!0});let a=`${o}.tmp`;f(a,`${JSON.stringify(g,null,2)}
1
+ import{a as h}from"./chunk-HP2NWDCS.js";import{resolve as n}from"path";import{existsSync as c,readdirSync as u,mkdirSync as l,readFileSync as p,writeFileSync as f,renameSync as S}from"fs";var m=class{baseDir;agentsDir;mode;sharedStore;agentStores=new Map;log;constructor(e=n(process.cwd(),".agentx/wiki"),r=console.error.bind(console,"[wiki-hub]"),t="graph"){this.baseDir=e,this.agentsDir=n(e,"agents"),this.mode=t,this.log=r,l(this.agentsDir,{recursive:!0}),this.sharedStore=new h(e,r)}getMode(){return this.mode}getAgentWiki(e){let r=`${e}:${this.mode}`;if(this.agentStores.has(r))return this.agentStores.get(r);let t=n(this.agentsDir,e,this.mode),s=new h(t,this.log);return this.agentStores.set(r,s),s}getBaseDir(){return this.baseDir}getSharedStore(){return this.sharedStore}sharedScope(e){return[...this.listAgentDirs().filter(t=>t!==e).map(t=>({id:t,store:this.getAgentWiki(t)})),{id:"shared",store:this.sharedStore,skip:t=>t.startsWith("agents/")}]}listAgentDirs(){return c(this.agentsDir)?u(this.agentsDir).filter(e=>!e.startsWith("_")&&!e.startsWith(".")&&c(n(this.agentsDir,e,this.mode))).sort():[]}listAgents(e=this.sharedStore.listEntries()){let r=new Set;for(let t of e)r.add(t.agentId);if(c(this.agentsDir))for(let t of u(this.agentsDir))!t.startsWith("_")&&!t.startsWith(".")&&r.add(t);return[...r].sort()}getAgentEntries(e){return this.sharedStore.listEntries({agentId:e})}getUnabsorbedEntries(e){return this.classifyEntries(e).pending}markProcessed(e,r,t){let s=new Set(t),g=this.readLedger(e),d=new Date().toISOString();for(let i of r)g.entries[i]={at:d,cited:s.has(i)};let o=this.ledgerPath(e);l(n(o,".."),{recursive:!0});let a=`${o}.tmp`;f(a,`${JSON.stringify(g,null,2)}
2
2
  `),S(a,o)}summary(){let e=this.sharedStore.listEntries(),r=new Map;for(let t of e){let s=r.get(t.agentId);s?s.push(t):r.set(t.agentId,[t])}return this.listAgents(e).map(t=>{let{all:s,cited:g,read:d,pending:o,articles:a}=this.classifyEntries(t,r.get(t)??[]);return{agentId:t,totalEntries:s.length,totalArticles:a.length,cited:g.length,readNotCited:d.length,unabsorbed:o.length,articles:a}})}classifyEntries(e,r=this.getAgentEntries(e)){let t=this.getAgentWiki(e).rebuildIndex().articles,s=new Set;for(let i of t)if(i.sources)for(let y of i.sources)s.add(y);let g=this.readLedger(e).entries,d=[],o=[],a=[];for(let i of r)s.has(i.id)?d.push(i):g[i.id]?o.push(i):a.push(i);return{all:r,cited:d,read:o,pending:a,articles:t}}syncedFrom(e){let r=n(this.agentsDir,e,"_synced.json");if(!c(r))return null;try{return JSON.parse(p(r,"utf-8"))}catch(t){return this.log(`synced marker ${r} is not valid JSON: ${t.message}`),{node:"unknown",peerUrl:"",at:""}}}markSynced(e,r){let t=n(this.agentsDir,e,"_synced.json");l(n(t,".."),{recursive:!0});let s=`${t}.tmp`;f(s,`${JSON.stringify(r,null,2)}
3
3
  `),S(s,t)}ledgerPath(e){return n(this.agentsDir,e,"_absorbed.json")}readLedger(e){let r=this.ledgerPath(e);if(!c(r))return{entries:{}};try{return{entries:JSON.parse(p(r,"utf-8")).entries??{}}}catch(t){throw new Error(`absorb ledger ${r} is not valid JSON: ${t.message}`)}}};export{m as a};
4
- //# sourceMappingURL=chunk-ERG5OUKH.js.map
4
+ //# sourceMappingURL=chunk-VTVEJ3RA.js.map