agentix-cli 0.211.1 → 0.213.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 (147) hide show
  1. package/dist/{App-RIXKQIO7.js → App-5CLRBC3C.js} +2 -2
  2. package/dist/{ChatApp-2TKXDJGQ.js → ChatApp-LDNQVD2C.js} +2 -2
  3. package/dist/{absorb-eval-5YZOYFF4.js → absorb-eval-JWQPGUJS.js} +2 -2
  4. package/dist/{adapter-Q76GO2I7.js → adapter-AOKK2LFM.js} +2 -2
  5. package/dist/{agent-GW6Z6OFF.js → agent-TF6XQQGV.js} +2 -2
  6. package/dist/{board-dashboard-RPZJBHL3.js → board-dashboard-LDMIS7MM.js} +4 -4
  7. package/dist/{chunk-6BINQY52.js → chunk-36RIIHPS.js} +106 -105
  8. package/dist/chunk-36RIIHPS.js.map +1 -0
  9. package/dist/{chunk-Y65DB3PF.js → chunk-4W5KRZTT.js} +2 -2
  10. package/dist/chunk-7JWMLYOA.js +115 -0
  11. package/dist/chunk-7JWMLYOA.js.map +1 -0
  12. package/dist/{chunk-BQIZN5JU.js → chunk-BERSMN6Y.js} +2 -2
  13. package/dist/{chunk-FLNSBODK.js → chunk-BU6V75KD.js} +2 -2
  14. package/dist/{chunk-FLDMRYZD.js → chunk-CUCIMPFI.js} +2 -2
  15. package/dist/{chunk-YZD6EZMU.js → chunk-D3FIIEDR.js} +2 -2
  16. package/dist/{chunk-QQKPZKQT.js → chunk-D6H4DH32.js} +2 -2
  17. package/dist/{chunk-6VHORIGB.js → chunk-DGCYMSXU.js} +2 -2
  18. package/dist/{chunk-XWOXXVVX.js → chunk-DNPPPUDP.js} +2 -2
  19. package/dist/{chunk-323KMXT4.js → chunk-DPA3IOMU.js} +2 -2
  20. package/dist/{chunk-ZWO36TCN.js → chunk-DSUL5L3T.js} +2 -2
  21. package/dist/{chunk-W4K3DFAX.js → chunk-EE5RZDQE.js} +2 -2
  22. package/dist/{chunk-JJC2HBWC.js → chunk-ERKK22QV.js} +2 -2
  23. package/dist/{chunk-MHRVTFLZ.js → chunk-FCF47R4W.js} +3 -3
  24. package/dist/{chunk-Y4BNOZWQ.js → chunk-G3GFE3GK.js} +2 -2
  25. package/dist/{chunk-OAVJMZLF.js → chunk-I722PWJE.js} +2 -2
  26. package/dist/{chunk-LYY7G6LO.js → chunk-IXV3BPUZ.js} +2 -2
  27. package/dist/{chunk-XWMHNDED.js → chunk-KU3ZF3WO.js} +2 -2
  28. package/dist/{chunk-F3HVONL6.js → chunk-MOATCFT5.js} +2 -2
  29. package/dist/{chunk-MKQI5WL2.js → chunk-N7IX77SL.js} +2 -2
  30. package/dist/{chunk-UYG7UOVQ.js → chunk-NWE3B245.js} +8 -8
  31. package/dist/chunk-NWE3B245.js.map +1 -0
  32. package/dist/{chunk-2FXHWT5U.js → chunk-NZFWW2YG.js} +270 -270
  33. package/dist/chunk-NZFWW2YG.js.map +1 -0
  34. package/dist/{chunk-WNE4GRXY.js → chunk-O4WFPH6H.js} +2 -2
  35. package/dist/{chunk-GUID2ZA2.js → chunk-UWDDVDU6.js} +21 -21
  36. package/dist/{chunk-GUID2ZA2.js.map → chunk-UWDDVDU6.js.map} +1 -1
  37. package/dist/{chunk-ISRY3GAD.js → chunk-VKLTCUD7.js} +2 -2
  38. package/dist/{chunk-EPIKS3WL.js → chunk-WKBGQGVL.js} +2 -2
  39. package/dist/{chunk-CUX7BF7B.js → chunk-X7UEV4O2.js} +2 -2
  40. package/dist/{chunk-PYTNMX2D.js → chunk-XBFXSSHA.js} +2 -2
  41. package/dist/{chunk-YRBJ4KB7.js → chunk-Z6N7POAU.js} +2 -2
  42. package/dist/cli.js +1 -1
  43. package/dist/{client-AIQ7D7VU.js → client-2TFSAO3Y.js} +2 -2
  44. package/dist/config-LTXRWDRK.js +2 -0
  45. package/dist/{config-mutate-XUBGMDIU.js → config-mutate-UFVJUJQO.js} +2 -2
  46. package/dist/{config-mutator-G62RKREK.js → config-mutator-RRKU33OL.js} +2 -2
  47. package/dist/{contributions-RQZO4V36.js → contributions-5XUEOSLT.js} +2 -2
  48. package/dist/{doctor-DVMX6632.js → doctor-L675OBBF.js} +2 -2
  49. package/dist/{follow-up-tool-MS4FSM2J.js → follow-up-tool-2OEZMPPQ.js} +2 -2
  50. package/dist/{hub-RKX3L5LU.js → hub-VJZYQXKB.js} +2 -2
  51. package/dist/index.d.ts +307 -208
  52. package/dist/index.js +1 -1
  53. package/dist/{org-tool-NA6U3IJJ.js → org-tool-QBLKCMY3.js} +2 -2
  54. package/dist/program-4WR4ZYXQ.js +928 -0
  55. package/dist/program-4WR4ZYXQ.js.map +1 -0
  56. package/dist/{promote-OV2OD55V.js → promote-Z6KL6GOL.js} +2 -2
  57. package/dist/{query-6FK2A4K2.js → query-SZA6UMHA.js} +2 -2
  58. package/dist/{query-settings-RE2BTERX.js → query-settings-BALRO5J4.js} +2 -2
  59. package/dist/{registry-APVJFCDJ.js → registry-LD2IYY7L.js} +2 -2
  60. package/dist/{request-planner-23FPTJLW.js → request-planner-Y5HG5DQ4.js} +2 -2
  61. package/dist/{review-candidates-FCRNGU2S.js → review-candidates-BZJOFMFO.js} +2 -2
  62. package/dist/{routing-W7AOH7QM.js → routing-3JDN3Z6L.js} +2 -2
  63. package/dist/schedule-tool-VM5OJ7XB.js +2 -0
  64. package/dist/{scheduler-3CJD7UF4.js → scheduler-JJOO2ODF.js} +2 -2
  65. package/dist/{seat-BIVMGYMR.js → seat-5FTOWN5J.js} +2 -2
  66. package/dist/{select-LWTPLTCE.js → select-BRQQP7OP.js} +2 -2
  67. package/dist/{set-enabled-OKG7Q5WY.js → set-enabled-EZLQFASM.js} +2 -2
  68. package/dist/{sprint-tool-YLQADXQH.js → sprint-tool-YJ4WT3AD.js} +2 -2
  69. package/dist/{tool-YCCQX7BT.js → tool-BFKCGAD6.js} +2 -2
  70. package/dist/{tool-ZXIRHFRB.js → tool-CXJHLIHJ.js} +2 -2
  71. package/dist/{tool-XZU2IJUI.js → tool-MT5YQ7F3.js} +2 -2
  72. package/dist/{tool-5T5SSYMB.js → tool-RCEOKPES.js} +2 -2
  73. package/dist/{wiki-2BVHRZX5.js → wiki-F3LZSBN3.js} +2 -2
  74. package/dist/wiki-enrich-KIONW7SB.js +2 -0
  75. package/dist/workspace-setup-VLLF37SJ.js +2 -0
  76. package/package.json +1 -1
  77. package/dist/chunk-2FXHWT5U.js.map +0 -1
  78. package/dist/chunk-3AHYZLGE.js +0 -115
  79. package/dist/chunk-3AHYZLGE.js.map +0 -1
  80. package/dist/chunk-6BINQY52.js.map +0 -1
  81. package/dist/chunk-UYG7UOVQ.js.map +0 -1
  82. package/dist/config-TSSRDRCK.js +0 -2
  83. package/dist/program-YIX4NQZV.js +0 -901
  84. package/dist/program-YIX4NQZV.js.map +0 -1
  85. package/dist/schedule-tool-RXX26TI4.js +0 -2
  86. package/dist/wiki-enrich-BHPD4BOV.js +0 -2
  87. package/dist/workspace-setup-GTSXWYU4.js +0 -2
  88. /package/dist/{App-RIXKQIO7.js.map → App-5CLRBC3C.js.map} +0 -0
  89. /package/dist/{ChatApp-2TKXDJGQ.js.map → ChatApp-LDNQVD2C.js.map} +0 -0
  90. /package/dist/{absorb-eval-5YZOYFF4.js.map → absorb-eval-JWQPGUJS.js.map} +0 -0
  91. /package/dist/{adapter-Q76GO2I7.js.map → adapter-AOKK2LFM.js.map} +0 -0
  92. /package/dist/{agent-GW6Z6OFF.js.map → agent-TF6XQQGV.js.map} +0 -0
  93. /package/dist/{board-dashboard-RPZJBHL3.js.map → board-dashboard-LDMIS7MM.js.map} +0 -0
  94. /package/dist/{chunk-Y65DB3PF.js.map → chunk-4W5KRZTT.js.map} +0 -0
  95. /package/dist/{chunk-BQIZN5JU.js.map → chunk-BERSMN6Y.js.map} +0 -0
  96. /package/dist/{chunk-FLNSBODK.js.map → chunk-BU6V75KD.js.map} +0 -0
  97. /package/dist/{chunk-FLDMRYZD.js.map → chunk-CUCIMPFI.js.map} +0 -0
  98. /package/dist/{chunk-YZD6EZMU.js.map → chunk-D3FIIEDR.js.map} +0 -0
  99. /package/dist/{chunk-QQKPZKQT.js.map → chunk-D6H4DH32.js.map} +0 -0
  100. /package/dist/{chunk-6VHORIGB.js.map → chunk-DGCYMSXU.js.map} +0 -0
  101. /package/dist/{chunk-XWOXXVVX.js.map → chunk-DNPPPUDP.js.map} +0 -0
  102. /package/dist/{chunk-323KMXT4.js.map → chunk-DPA3IOMU.js.map} +0 -0
  103. /package/dist/{chunk-ZWO36TCN.js.map → chunk-DSUL5L3T.js.map} +0 -0
  104. /package/dist/{chunk-W4K3DFAX.js.map → chunk-EE5RZDQE.js.map} +0 -0
  105. /package/dist/{chunk-JJC2HBWC.js.map → chunk-ERKK22QV.js.map} +0 -0
  106. /package/dist/{chunk-MHRVTFLZ.js.map → chunk-FCF47R4W.js.map} +0 -0
  107. /package/dist/{chunk-Y4BNOZWQ.js.map → chunk-G3GFE3GK.js.map} +0 -0
  108. /package/dist/{chunk-OAVJMZLF.js.map → chunk-I722PWJE.js.map} +0 -0
  109. /package/dist/{chunk-LYY7G6LO.js.map → chunk-IXV3BPUZ.js.map} +0 -0
  110. /package/dist/{chunk-XWMHNDED.js.map → chunk-KU3ZF3WO.js.map} +0 -0
  111. /package/dist/{chunk-F3HVONL6.js.map → chunk-MOATCFT5.js.map} +0 -0
  112. /package/dist/{chunk-MKQI5WL2.js.map → chunk-N7IX77SL.js.map} +0 -0
  113. /package/dist/{chunk-WNE4GRXY.js.map → chunk-O4WFPH6H.js.map} +0 -0
  114. /package/dist/{chunk-ISRY3GAD.js.map → chunk-VKLTCUD7.js.map} +0 -0
  115. /package/dist/{chunk-EPIKS3WL.js.map → chunk-WKBGQGVL.js.map} +0 -0
  116. /package/dist/{chunk-CUX7BF7B.js.map → chunk-X7UEV4O2.js.map} +0 -0
  117. /package/dist/{chunk-PYTNMX2D.js.map → chunk-XBFXSSHA.js.map} +0 -0
  118. /package/dist/{chunk-YRBJ4KB7.js.map → chunk-Z6N7POAU.js.map} +0 -0
  119. /package/dist/{client-AIQ7D7VU.js.map → client-2TFSAO3Y.js.map} +0 -0
  120. /package/dist/{config-TSSRDRCK.js.map → config-LTXRWDRK.js.map} +0 -0
  121. /package/dist/{config-mutate-XUBGMDIU.js.map → config-mutate-UFVJUJQO.js.map} +0 -0
  122. /package/dist/{config-mutator-G62RKREK.js.map → config-mutator-RRKU33OL.js.map} +0 -0
  123. /package/dist/{contributions-RQZO4V36.js.map → contributions-5XUEOSLT.js.map} +0 -0
  124. /package/dist/{doctor-DVMX6632.js.map → doctor-L675OBBF.js.map} +0 -0
  125. /package/dist/{follow-up-tool-MS4FSM2J.js.map → follow-up-tool-2OEZMPPQ.js.map} +0 -0
  126. /package/dist/{hub-RKX3L5LU.js.map → hub-VJZYQXKB.js.map} +0 -0
  127. /package/dist/{org-tool-NA6U3IJJ.js.map → org-tool-QBLKCMY3.js.map} +0 -0
  128. /package/dist/{promote-OV2OD55V.js.map → promote-Z6KL6GOL.js.map} +0 -0
  129. /package/dist/{query-6FK2A4K2.js.map → query-SZA6UMHA.js.map} +0 -0
  130. /package/dist/{query-settings-RE2BTERX.js.map → query-settings-BALRO5J4.js.map} +0 -0
  131. /package/dist/{registry-APVJFCDJ.js.map → registry-LD2IYY7L.js.map} +0 -0
  132. /package/dist/{request-planner-23FPTJLW.js.map → request-planner-Y5HG5DQ4.js.map} +0 -0
  133. /package/dist/{review-candidates-FCRNGU2S.js.map → review-candidates-BZJOFMFO.js.map} +0 -0
  134. /package/dist/{routing-W7AOH7QM.js.map → routing-3JDN3Z6L.js.map} +0 -0
  135. /package/dist/{schedule-tool-RXX26TI4.js.map → schedule-tool-VM5OJ7XB.js.map} +0 -0
  136. /package/dist/{scheduler-3CJD7UF4.js.map → scheduler-JJOO2ODF.js.map} +0 -0
  137. /package/dist/{seat-BIVMGYMR.js.map → seat-5FTOWN5J.js.map} +0 -0
  138. /package/dist/{select-LWTPLTCE.js.map → select-BRQQP7OP.js.map} +0 -0
  139. /package/dist/{set-enabled-OKG7Q5WY.js.map → set-enabled-EZLQFASM.js.map} +0 -0
  140. /package/dist/{sprint-tool-YLQADXQH.js.map → sprint-tool-YJ4WT3AD.js.map} +0 -0
  141. /package/dist/{tool-YCCQX7BT.js.map → tool-BFKCGAD6.js.map} +0 -0
  142. /package/dist/{tool-ZXIRHFRB.js.map → tool-CXJHLIHJ.js.map} +0 -0
  143. /package/dist/{tool-XZU2IJUI.js.map → tool-MT5YQ7F3.js.map} +0 -0
  144. /package/dist/{tool-5T5SSYMB.js.map → tool-RCEOKPES.js.map} +0 -0
  145. /package/dist/{wiki-2BVHRZX5.js.map → wiki-F3LZSBN3.js.map} +0 -0
  146. /package/dist/{wiki-enrich-BHPD4BOV.js.map → wiki-enrich-KIONW7SB.js.map} +0 -0
  147. /package/dist/{workspace-setup-GTSXWYU4.js.map → workspace-setup-VLLF37SJ.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{c as w}from"./chunk-Y65DB3PF.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-4W5KRZTT.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-ISRY3GAD.js.map
36
+ //# sourceMappingURL=chunk-VKLTCUD7.js.map
@@ -1,4 +1,4 @@
1
- import{Pb as l,Zb as m}from"./chunk-GUID2ZA2.js";m();import{existsSync as g,readFileSync as u,writeFileSync as a,copyFileSync as y}from"fs";import{resolve as p}from"path";function P(e,n={}){let t=n.configPath||p(process.cwd(),"agentx.json");if(!g(t))throw new Error(`agentx.json not found at ${t}`);let i=JSON.parse(u(t,"utf-8")),o=e(i),s=typeof o=="string"?{summary:o}:o,c=JSON.stringify(i,null,2)+`
1
+ import{Qb as l,_b as m}from"./chunk-UWDDVDU6.js";m();import{existsSync as g,readFileSync as u,writeFileSync as a,copyFileSync as y}from"fs";import{resolve as p}from"path";function P(e,n={}){let t=n.configPath||p(process.cwd(),"agentx.json");if(!g(t))throw new Error(`agentx.json not found at ${t}`);let i=JSON.parse(u(t,"utf-8")),o=e(i),s=typeof o=="string"?{summary:o}:o,c=JSON.stringify(i,null,2)+`
2
2
  `,f=t+".tmp";a(f,c,"utf-8");try{JSON.parse(u(f,"utf-8"))}catch(d){throw new Error(`config did not round-trip cleanly: ${d.message}`)}let r;return n.skipBackup||(r=`${t}.bak.${Date.now()}`,y(t,r)),a(t,c,"utf-8"),n.skipReload||h().catch(()=>{}),{summary:s.summary,payload:s.payload,backupPath:r}}function S(e,n={}){let t=n.configPath||p(process.cwd(),"agentx.json");if(g(t)&&!n.overwrite)throw new Error(`agentx.json already exists at ${t}. Pass overwrite=true to replace it.`);return a(t,JSON.stringify(e,null,2)+`
3
3
  `,"utf-8"),{file:t}}async function h(){try{let n=l().dashboard.daemonUrl?.replace(/\/+$/,"")||"http://127.0.0.1:18800";await fetch(`${n}/reload`,{method:"POST"}).catch(()=>null)}catch{}}export{P as a,S as b};
4
- //# sourceMappingURL=chunk-EPIKS3WL.js.map
4
+ //# sourceMappingURL=chunk-WKBGQGVL.js.map
@@ -48,7 +48,7 @@ The "modified" field is optional and can contain updated values to pass forward.
48
48
  ... (output truncated)`:i;return s.exitCode!==0?{tool_use_id:e.id,content:`Command exited with code ${s.exitCode}:
49
49
  ${l}`,is_error:!0}:{tool_use_id:e.id,content:l||"(no output)"}}async editFile(e){let t=String(e.input.path||""),o=e.input.edits,r=ge.resolve(this.cwd,t);if(!o||o.length===0)return{tool_use_id:e.id,content:"No edits provided.",is_error:!0};let s=await W.checkFileWrite(t);if(s==="deny")return{tool_use_id:e.id,content:`File write blocked by permissions: ${t}`,is_error:!0};if(s==="skip")return{tool_use_id:e.id,content:`File write skipped (plan mode): ${t}`};if(f.has("pre:file-write")){let a=await f.execute("pre:file-write",{event:"pre:file-write",file:r,cwd:this.cwd});if(a.blocked)return{tool_use_id:e.id,content:a.message||`File edit blocked by pre:file-write hook: ${t}`,is_error:!0}}let i=await ne.readFile(r,"utf8"),l=[];for(let a of o)i.includes(a.old_text)?(i=i.replace(a.old_text,a.new_text),l.push(`Replaced: "${a.old_text.slice(0,40)}..."`)):l.push(`Not found: "${a.old_text.slice(0,40)}..."`);return this.options.dryRun||await ne.writeFile(r,i,"utf8"),f.has("post:file-write")&&await f.execute("post:file-write",{event:"post:file-write",file:r,fileContent:i,cwd:this.cwd}),{tool_use_id:e.id,content:`Edited ${t}:
50
50
  ${l.join(`
51
- `)}`}}async createFiles(e){let t=e.input,o=t.files||[];return{tool_use_id:e.id,content:t.summary||`Queued ${o.length} file(s) for creation.`,files:o}}async spawnAgent(e){let t=String(e.input.agent_id||""),o=String(e.input.prompt||""),r=Number(e.input.timeout_seconds)||300;if(!t||!o)return{tool_use_id:e.id,content:"agent_id and prompt are required.",is_error:!0};try{let{SubAgentManager:s}=await import("./subagent-XY5N7TUU.js"),{getGlobalRegistry:i}=await import("./registry-APVJFCDJ.js"),l=i();if(!l)return{tool_use_id:e.id,content:"Sub-agent spawning requires the daemon to be running.",is_error:!0};let p=await new s(l).spawn({targetAgentId:t,prompt:o,parentAgentId:"orchestrator",timeout:r*1e3});return p.success?{tool_use_id:e.id,content:`Sub-agent "${t}" completed (${Math.round(p.duration/1e3)}s):
51
+ `)}`}}async createFiles(e){let t=e.input,o=t.files||[];return{tool_use_id:e.id,content:t.summary||`Queued ${o.length} file(s) for creation.`,files:o}}async spawnAgent(e){let t=String(e.input.agent_id||""),o=String(e.input.prompt||""),r=Number(e.input.timeout_seconds)||300;if(!t||!o)return{tool_use_id:e.id,content:"agent_id and prompt are required.",is_error:!0};try{let{SubAgentManager:s}=await import("./subagent-XY5N7TUU.js"),{getGlobalRegistry:i}=await import("./registry-LD2IYY7L.js"),l=i();if(!l)return{tool_use_id:e.id,content:"Sub-agent spawning requires the daemon to be running.",is_error:!0};let p=await new s(l).spawn({targetAgentId:t,prompt:o,parentAgentId:"orchestrator",timeout:r*1e3});return p.success?{tool_use_id:e.id,content:`Sub-agent "${t}" completed (${Math.round(p.duration/1e3)}s):
52
52
 
53
53
  ${p.content}`}:{tool_use_id:e.id,content:`Sub-agent "${t}" failed: ${p.error}`,is_error:!0}}catch(s){return{tool_use_id:e.id,content:`Failed to spawn sub-agent: ${s.message}`,is_error:!0}}}async askUser(e){let t=String(e.input.question||""),o=e.input.options,r=t;return o?.length&&(r+=`
54
54
  Options: ${o.join(", ")}`),{tool_use_id:e.id,content:"Question sent to user.",followUp:r}}};async function Oe(n){let{provider:e,systemPrompt:t,messages:o,providerOptions:r,cwd:s,maxIterations:i=20,enabledTools:l,interactive:a=!0,overwrite:p=!1,dryRun:c=!1,onProgress:d,abortSignal:u}=n,m=u?{...r,abortSignal:u}:r;if(!e.generateRaw)return mt(n);let I=new se(s,{interactive:a,overwrite:p,dryRun:c,acmeContext:n.acmeContext,abortSignal:u}),D=be(l);if(n.acmeContext)for(let g of ct)D.push({name:g.name,description:g.description,input_schema:g.input_schema});let E=new Set;if(n.mcpTools?.length)for(let g of n.mcpTools)D.push({name:g.name,description:g.description,input_schema:g.input_schema}),E.add(g.name);let C=o.filter(g=>g.role!=="system").map(g=>({role:g.role,content:g.content})),B=[],G=0,F=0,O=0,A="",j,_=0;for(;_<i;){if(_++,u?.aborted)throw new Error("cancelled");d?.({type:"iteration_start",iteration:_}),k.step(_,`Agentic loop iteration (${D.length} tools available)`);let g,M=!!e.generateRawStream&&!!d;try{if(M){let S=null,H=null,v="";for await(let x of e.generateRawStream(C,t,D,m))x.type==="text_delta"?(v+=x.text,d?.({type:"text_delta",text:x.text})):x.type==="thinking_delta"?d?.({type:"thinking_delta",text:x.text}):x.type==="raw_result"?S=x.result:x.type==="error"&&(H=x.error);if(H&&!S)throw new Error(H);if(!S)throw new Error("generateRawStream returned no raw_result event");g=S,g._streamedText=v}else g=await e.generateRaw(C,t,D,m)}catch(S){if(S.message?.includes("not available"))return mt(n);throw S}G+=g.usage.input_tokens+g.usage.output_tokens,F+=g.usage.input_tokens,O+=g.usage.output_tokens;let P=g._streamedText;for(let S of g.content)S.type==="text"&&(A+=S.text,P===void 0&&d?.({type:"text_delta",text:S.text}));if(P!==void 0&&delete g._streamedText,g.stop_reason==="end_turn"||g.stop_reason==="max_tokens")break;if(g.stop_reason==="tool_use"){let S=g.content.filter(v=>v.type==="tool_use");if(S.length===0)break;C.push({role:"assistant",content:g.content});let H=[];for(let v of S){d?.({type:"tool_call",name:v.name,id:v.id,input:v.input}),k.step(_,`Tool call: ${v.name}`);let x;if(E.has(v.name)&&n.mcpDispatch){let h=await n.mcpDispatch(v.name,v.input);x={tool_use_id:v.id,content:h.content,is_error:h.isError}}else x=await I.execute({name:v.name,id:v.id,input:v.input});d?.({type:"tool_result",name:v.name,id:v.id,content:x.content.slice(0,200),is_error:x.is_error}),x.files?.length&&(B.push(...x.files),d?.({type:"files_created",files:x.files})),x.followUp&&(j=x.followUp),H.push({type:"tool_result",tool_use_id:x.tool_use_id,content:x.content,is_error:x.is_error})}if(C.push({role:"user",content:H}),j)break;continue}break}return d?.({type:"complete",iterations:_,totalTokens:G}),{files:B,content:A,followUp:j,tokensUsed:G,inputTokens:F||void 0,outputTokens:O||void 0,iterations:_}}async function mt(n){let{provider:e,systemPrompt:t,messages:o,providerOptions:r,maxIterations:s=5}=n,l=[{role:"system",content:t+`
@@ -123,4 +123,4 @@ ${n.projectInstructions}`),n.memoryContext&&o.push(n.memoryContext),o.push(`# Ou
123
123
  Generate output appropriate for: ${e}. Use the \`create_files\` tool to output all files.`),o.join(`
124
124
 
125
125
  `)}export{We as a,Xt as b,Qt as c,Je as d,Ke as e,Xe as f,Qe as g,Pe as h,ee as i,Re as j,ce as k,te as l,Pt as m,oe as n,Et as o,f as p,ot as q,rt as r,Me as s,de as t,W as u,re as v,lt as w,Ee as x,$e as y,se as z,gt as A,tn as B,on as C};
126
- //# sourceMappingURL=chunk-CUX7BF7B.js.map
126
+ //# sourceMappingURL=chunk-X7UEV4O2.js.map
@@ -1,4 +1,4 @@
1
- import{a as h}from"./chunk-6VHORIGB.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-DGCYMSXU.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-PYTNMX2D.js.map
4
+ //# sourceMappingURL=chunk-XBFXSSHA.js.map
@@ -1,4 +1,4 @@
1
- import{a as ft}from"./chunk-GTJIKXDB.js";import{H as Er,O as Ir,k as K}from"./chunk-W4K3DFAX.js";import{f as $r,g as Tr,h as Ar,l as Rr}from"./chunk-FLNSBODK.js";import{b as _r}from"./chunk-2VDO2HEK.js";import{t as vr,u as Sr}from"./chunk-ZWO36TCN.js";import{d as xr,e as kr}from"./chunk-AQASR6KR.js";import{h as pe,j as dr,l as ur,m as pr,n as gr}from"./chunk-RX5O5637.js";import{a as mr,c as fr,e as hr,f as ut,h as br,j as yr,k as wr,l as pt,m as gt,n as mt}from"./chunk-5ELIX7BQ.js";import{a as rr,c as or}from"./chunk-KP7KDLZ2.js";import{Aa as ue,Ca as dt,b as at,f as Gn,s as lt,u as ct,xa as Ae,ya as er,za as W}from"./chunk-MKQI5WL2.js";import{a as $e,b as de,e as Yn}from"./chunk-7AB3QUGH.js";import{h as sr,i as ir,j as ar,l as lr,m as cr}from"./chunk-FLDMRYZD.js";import{s as Zn}from"./chunk-JJC2HBWC.js";import{a as Jn,b as Te,e as Qn}from"./chunk-Y4BNOZWQ.js";import{c as Re,d as tr,e as nr}from"./chunk-XVV7ZZ77.js";import{b as ee}from"./chunk-5ONH4ITT.js";import{a as Kn,c as it}from"./chunk-ILEC3IAV.js";import{a as Wn,i as Vn,l as Xn,n as ot,o as st,r as ce,s as Z,u as zn}from"./chunk-XL7UWG36.js";import{a as jn,b as Bn,d as qn,e as Hn}from"./chunk-MNG2AMKZ.js";import{a as Un}from"./chunk-7IW25T4K.js";import{a as Fn}from"./chunk-QUFIUXMQ.js";import{Ba as Dn,Ca as Cn,E as _e,Ea as Nn,F as $n,Fa as On,Fb as rt,G as Tn,H as vi,Ob as Ln,Pb as Pn,Zb as Mn,f as Ze,g as C,i as Ee,j as E,k as le,l as En,o as _n,p as et,va as In}from"./chunk-GUID2ZA2.js";import{a as tt,h as Si}from"./chunk-KEUW6YLL.js";import{j as nt,q as An,r as Rn}from"./chunk-N47Y5ADQ.js";import{existsSync as Ei,readdirSync as _i,readFileSync as $i,statSync as Ti}from"fs";import{resolve as Ai}from"path";function Dr(t,e,n=Date.now(),r=7){let o=r*864e5,s=new Map;for(let i of e){let a=s.get(i.workflowId);a?a.push(i):s.set(i.workflowId,[i])}return t.map(i=>{let a=s.get(i.id)??[],d=a.filter(m=>n-m.at<=o),l=a.filter(m=>n-m.at>o&&n-m.at<=o*2),c=d.filter(m=>m.status==="failed").length,p=a.filter(m=>m.status==="paused").length,u=a.length?Math.max(...a.map(m=>m.at)):null,g=a.length?l.length>0&&d.length===0?"dormant":d.length>0&&c*2>=d.length?"failing":d.length>0?"active":"quiet":"never";return{id:i.id,name:i.name||i.id,state:g,lastRunAt:u,recent:d.length,prior:l.length,failed:c,paused:p}}).sort((i,a)=>{let d={dormant:0,failing:1,active:2,quiet:3,never:4};return d[i.state]-d[a.state]||(a.lastRunAt??0)-(i.lastRunAt??0)})}var Ie=new Map;function Cu(t,e=1e3){if(!Ei(t))return[];let n=_i(t).filter(s=>s.endsWith(".jsonl")).map(s=>{let i=Ai(t,s);return{path:i,mtime:Ti(i).mtimeMs}}).sort((s,i)=>i.mtime-s.mtime).slice(0,e),r=new Set(n.map(s=>s.path));for(let s of Ie.keys())r.has(s)||Ie.delete(s);let o=[];for(let{path:s,mtime:i}of n){let a=Ie.get(s);if(a&&a.mtime===i){a.summary&&o.push(a.summary);continue}let d=Ri(s,i);Ie.set(s,{mtime:i,summary:d}),d&&o.push(d)}return o}function Ri(t,e){try{let n=$i(t,"utf-8").split(`
1
+ import{a as ft}from"./chunk-GTJIKXDB.js";import{H as Er,O as Ir,k as K}from"./chunk-EE5RZDQE.js";import{f as $r,g as Tr,h as Ar,l as Rr}from"./chunk-BU6V75KD.js";import{b as _r}from"./chunk-2VDO2HEK.js";import{t as vr,u as Sr}from"./chunk-DSUL5L3T.js";import{d as xr,e as kr}from"./chunk-AQASR6KR.js";import{h as pe,j as dr,l as ur,m as pr,n as gr}from"./chunk-RX5O5637.js";import{a as mr,c as fr,e as hr,f as ut,h as br,j as yr,k as wr,l as pt,m as gt,n as mt}from"./chunk-5ELIX7BQ.js";import{a as rr,c as or}from"./chunk-KP7KDLZ2.js";import{Aa as ue,Ca as dt,b as at,f as Gn,s as lt,u as ct,xa as Ae,ya as er,za as W}from"./chunk-N7IX77SL.js";import{a as $e,b as de,e as Yn}from"./chunk-7AB3QUGH.js";import{h as sr,i as ir,j as ar,l as lr,m as cr}from"./chunk-CUCIMPFI.js";import{s as Zn}from"./chunk-ERKK22QV.js";import{a as Jn,b as Te,e as Qn}from"./chunk-G3GFE3GK.js";import{c as Re,d as tr,e as nr}from"./chunk-XVV7ZZ77.js";import{b as ee}from"./chunk-5ONH4ITT.js";import{a as Kn,c as it}from"./chunk-ILEC3IAV.js";import{a as Wn,i as Vn,l as Xn,n as ot,o as st,r as ce,s as Z,u as zn}from"./chunk-XL7UWG36.js";import{a as jn,b as Bn,d as qn,e as Hn}from"./chunk-MNG2AMKZ.js";import{a as Un}from"./chunk-7IW25T4K.js";import{a as Fn}from"./chunk-QUFIUXMQ.js";import{Ba as Dn,Ca as Cn,E as _e,Ea as Nn,F as $n,Fa as On,Fb as rt,G as Tn,H as vi,Pb as Ln,Qb as Pn,_b as Mn,f as Ze,g as C,i as Ee,j as E,k as le,l as En,o as _n,p as et,va as In}from"./chunk-UWDDVDU6.js";import{a as tt,h as Si}from"./chunk-KEUW6YLL.js";import{j as nt,q as An,r as Rn}from"./chunk-N47Y5ADQ.js";import{existsSync as Ei,readdirSync as _i,readFileSync as $i,statSync as Ti}from"fs";import{resolve as Ai}from"path";function Dr(t,e,n=Date.now(),r=7){let o=r*864e5,s=new Map;for(let i of e){let a=s.get(i.workflowId);a?a.push(i):s.set(i.workflowId,[i])}return t.map(i=>{let a=s.get(i.id)??[],d=a.filter(m=>n-m.at<=o),l=a.filter(m=>n-m.at>o&&n-m.at<=o*2),c=d.filter(m=>m.status==="failed").length,p=a.filter(m=>m.status==="paused").length,u=a.length?Math.max(...a.map(m=>m.at)):null,g=a.length?l.length>0&&d.length===0?"dormant":d.length>0&&c*2>=d.length?"failing":d.length>0?"active":"quiet":"never";return{id:i.id,name:i.name||i.id,state:g,lastRunAt:u,recent:d.length,prior:l.length,failed:c,paused:p}}).sort((i,a)=>{let d={dormant:0,failing:1,active:2,quiet:3,never:4};return d[i.state]-d[a.state]||(a.lastRunAt??0)-(i.lastRunAt??0)})}var Ie=new Map;function Cu(t,e=1e3){if(!Ei(t))return[];let n=_i(t).filter(s=>s.endsWith(".jsonl")).map(s=>{let i=Ai(t,s);return{path:i,mtime:Ti(i).mtimeMs}}).sort((s,i)=>i.mtime-s.mtime).slice(0,e),r=new Set(n.map(s=>s.path));for(let s of Ie.keys())r.has(s)||Ie.delete(s);let o=[];for(let{path:s,mtime:i}of n){let a=Ie.get(s);if(a&&a.mtime===i){a.summary&&o.push(a.summary);continue}let d=Ri(s,i);Ie.set(s,{mtime:i,summary:d}),d&&o.push(d)}return o}function Ri(t,e){try{let n=$i(t,"utf-8").split(`
2
2
  `).filter(Boolean);if(!n.length)return null;let r=JSON.parse(n[0]),o=r.run?.workflowId;if(!o)return null;let s=r.run?.status??"unknown";for(let i=n.length-1;i>=0;i--){let a=JSON.parse(n[i]),d=a.status??a.run?.status;if(d){s=d;break}}return{workflowId:o,status:s,at:e}}catch{return null}}var Cr=7,Ii={failStreak:3,disabledDays:30,missedFires:2,graceMs:15*6e4},A={routines:200,summary:160,filters:6,filterValue:60,text:120},Di=(t,e,n)=>{try{return Zn(t,e,n)}catch{return null}},Nr=864e5;function Pu(t){let e=t.now??Date.now(),n={...Ii,...t.thresholds},r=t.nextFire??Di,o=[];for(let a of t.crons){let d=t.cronRuns.get(a.id)??[],l=a.timezone||"UTC",c=d.map(g=>({at:Date.parse(g.startedAt),status:g.status})),p=d[0],u={id:`cron:${a.id}`,source:"cron",kind:"schedule",name:F(a.id,A.text),trigger:{schedule:F(a.schedule,A.text),timezone:l},agent:a.agent||null,enabled:a.enabled,state:a.enabled?"enabled":"disabled",nextRunAt:a.enabled?ht(a.nextRun)??ht(r(a.schedule,new Date(e),l)):null,lastRun:p?{at:p.startedAt,status:p.status,summary:Mi(p.status==="success"?void 0:p.errorSummary,A.summary)}:null,lastSuccessAt:d.find(g=>g.status==="success")?.startedAt??null,consecutiveFailures:Or(c),sampledRuns:d.length,flags:[],attention:null,recent:d.slice(0,Cr).map(g=>({at:g.startedAt,status:g.status}))};u.flags=Lr(u,c,a.schedule,l,null,e,n,r),o.push(Pr(u))}let s=new Map(Dr(t.workflows.map(a=>({id:a.id,name:a.title})),t.workflowRuns,e).map(a=>[a.id,a])),i=new Map;for(let a of t.workflowRuns){let d=i.get(a.workflowId);d?d.push(a):i.set(a.workflowId,[a])}for(let a of t.workflows){let d=a.nodes.find(k=>k.type.startsWith("trigger."));if(!d||d.type!=="trigger.cron"&&d.type!=="trigger.hook")continue;let l=d.config??{},c=a.state||"active",p=c==="active",u=(i.get(a.id)??[]).slice().sort((k,D)=>D.at-k.at),g=u.map(k=>({at:k.at,status:Oi(k.status)})),m=g[0],f=d.type==="trigger.cron",w=typeof l.spec=="string"?l.spec:"",x=typeof l.timezone=="string"?l.timezone:"UTC",b={id:`workflow:${a.id}`,source:"workflow",kind:f?"schedule":"event",name:F(a.title||a.id,A.text),trigger:f?{schedule:F(w,A.text),timezone:x}:{event:F(typeof l.event=="string"?l.event:"",A.text),filters:Pi(l.filter,a)},agent:Li(a),enabled:p,state:c,nextRunAt:f&&p&&w?ht(r(w,new Date(e),x)):null,lastRun:m?{at:new Date(m.at).toISOString(),status:m.status}:null,lastSuccessAt:(()=>{let k=g.find(D=>D.status==="success");return k?new Date(k.at).toISOString():null})(),consecutiveFailures:Or(g),sampledRuns:u.length,flags:[],attention:null,recent:g.slice(0,Cr).map(k=>({at:new Date(k.at).toISOString(),status:k.status}))},y=Date.parse(a.updated||a.created||"");b.flags=f?Lr(b,g,w,x,Number.isFinite(y)?y:null,e,n,r):Ci(b,s.get(a.id)?.state==="dormant",Number.isFinite(y)?y:null,e,n),o.push(Pr(b))}return o.sort(Ni).slice(0,A.routines)}function Or(t){let e=0;for(let n of t)if(!(n.status==="running"||n.status==="paused"||n.status==="unknown"))if(n.status==="failed"||n.status==="timeout")e++;else break;return e}function Lr(t,e,n,r,o,s,i,a){let d=[],l=e.length?e[0].at:null;if(!t.enabled){let u=Fr(l,o,s,i);return u&&d.push(u),d}if(t.consecutiveFailures>=i.failStreak&&d.push({reason:"failing",detail:`${t.consecutiveFailures} failed attempts in a row`}),l===null)return d.push({reason:"never-ran",detail:"No persisted attempt"}),d;let c=new Date(l),p=null;for(let u=0;u<i.missedFires&&(p=a(n,c,r),!!p);u++)c=p;return p&&s>p.getTime()+i.graceMs&&d.push({reason:"overdue",detail:`No attempt since ${new Date(l).toISOString()}; ${i.missedFires} scheduled fires missed`}),d}function Ci(t,e,n,r,o){let s=[],i=t.lastRun?Date.parse(t.lastRun.at):null;if(!t.enabled){let a=Fr(i,n,r,o);return a&&s.push(a),s}return t.consecutiveFailures>=o.failStreak&&s.push({reason:"failing",detail:`${t.consecutiveFailures} failed runs in a row`}),i===null?s.push({reason:"never-ran",detail:"No run recorded for this trigger"}):e&&s.push({reason:"dormant",detail:"Fired in the prior week, silent in the last one"}),s}function Fr(t,e,n,r){let o=Math.max(t??0,e??0);return o&&n-o<r.disabledDays*Nr?null:{reason:"disabled-long",detail:o?`Disabled; no activity for ${Math.floor((n-o)/Nr)} days`:"Disabled and never ran"}}function Pr(t){let e=new Set(t.flags.map(n=>n.reason));return t.attention=e.has("failing")?"critical":e.has("overdue")||e.has("dormant")||e.has("never-ran")?"warning":e.has("disabled-long")?"info":null,t}var Mr={critical:0,warning:1,info:2};function Ni(t,e){let n=t.attention?Mr[t.attention]:3,r=e.attention?Mr[e.attention]:3;return n-r||Number(e.enabled)-Number(t.enabled)||t.name.localeCompare(e.name)}function Oi(t){switch(t){case"completed":case"ok":return"success";case"failed":return"failed";case"timeout":return"timeout";case"canceled":return"canceled";case"running":return"running";case"paused":return"paused";default:return"unknown"}}function Li(t){if(t.ownerAgent)return F(t.ownerAgent,A.text);let e=t.nodes.find(n=>n.type==="agent"&&typeof n.config?.agentId=="string"&&n.config.agentId);return e?F(String(e.config.agentId),A.text):null}function Pi(t,e){let n=[],r=e?.project;if(r&&n.push(F(`project=${r}`,A.filterValue)),t&&typeof t=="object"&&!Array.isArray(t))for(let[o,s]of Object.entries(t)){let i=Array.isArray(s)?s.map(String):s==null?[]:[String(s)];i.length&&n.push(F(`${o}=${i.join(",")}`,A.filterValue))}return n.slice(0,A.filters)}function ht(t){if(!t)return null;let e=t instanceof Date?t:new Date(t);return Number.isFinite(e.getTime())?e.toISOString():null}function F(t,e){return t.length<=e?t:t.slice(0,e-3)+"..."}function Mi(t,e){return t===void 0?void 0:F(t,e)}import{mkdirSync as Fi,readFileSync as Ui,renameSync as Wi,writeFileSync as ji}from"fs";import{resolve as Bi}from"path";function Ur(t){return Bi(st(t),"_state.json")}function N(t){try{let e=JSON.parse(Ui(Ur(t),"utf-8"));return{snoozed:e&&typeof e.snoozed=="object"&&e.snoozed?e.snoozed:{},...typeof e?.lastDigest=="string"?{lastDigest:e.lastDigest}:{},...e?.popped&&typeof e.popped=="object"?{popped:e.popped}:{},...typeof e?.passAt=="string"?{passAt:e.passAt}:{},...Array.isArray(e?.wanted)?{wanted:e.wanted.filter(n=>typeof n=="string")}:{}}}catch{return{snoozed:{}}}}function ge(t,e){Fi(st(t),{recursive:!0});let n=Ur(t),r=`${n}.${process.pid}.tmp`;ji(r,JSON.stringify(e,null,2)+`
3
3
  `),Wi(r,n)}function Wr(t,e,n,r=Date.now()){let o=N(t),s={};for(let[i,a]of Object.entries(o.snoozed))Date.parse(a)>r&&(s[i]=a);s[e]=n.toISOString(),ge(t,{...o,snoozed:s})}function ju(t,e){ge(t,{...N(t),lastDigest:e})}function bt(t,e,n,r=Date.now()){let o=N(t),s=new Set(n),i={};for(let[d,l]of Object.entries(o.popped??{}))s.has(d)&&(i[d]=l);i[e]=new Date(r).toISOString();let a=(o.wanted??[]).filter(d=>d!==e&&s.has(d));ge(t,{...o,popped:i,wanted:a})}function jr(t,e){let n=N(t);ge(t,{...n,wanted:[...(n.wanted??[]).filter(r=>r!==e),e]})}function Bu(t,e=Date.now()){ge(t,{...N(t),popped:{},passAt:new Date(e).toISOString()})}import{existsSync as qi,readFileSync as Hi}from"fs";Mn();Si();function Br(t){let e=Jn(t),n={};if(qi(e))try{n=Ln(JSON.parse(Hi(e,"utf-8")))}catch{n={}}let r=rt.safeParse(n?.requests);return r.success?r.data:rt.parse(void 0)}async function Ku(t,e={}){let n=(t.channels??[]).filter(r=>!tt.has(r.toLowerCase().split("@")[0]));return n.length?{success:!1,error:`unknown channel ${n.map(r=>`"${r}"`).join(", ")}: use ${[...tt].join(", ")}`}:Te(r=>{let o=r.requests??={};for(let s of["enabled","channels","from","staleAfterHours","retentionDays","settleHandedBack","homeCloses","releaseOnOwnerTurn"])t[s]!==void 0&&(o[s]=t[s]);if(t.plans){let s=o.plans??={};for(let i of["enabled","stallMinutes","maxNudges","approveKinds","disabledAgents","requireForWork","requireOverMinutes"])t.plans[i]!==void 0&&(s[i]=t.plans[i])}if(t.headlines?.enabled!==void 0&&((o.headlines??={}).enabled=t.headlines.enabled),t.catchPromises){let s=o.catchPromises??={};for(let i of["enabled","dailyCap"])t.catchPromises[i]!==void 0&&(s[i]=t.catchPromises[i])}if(t.autoResend){let s=o.autoResend??={};for(let i of["enabled","afterMinutes","holdMaxHours"])t.autoResend[i]!==void 0&&(s[i]=t.autoResend[i])}if(t.flow){let s=o.flow??={};for(let i of["timeZone","days"])t.flow[i]!==void 0&&(s[i]=t.flow[i])}if(t.checkers){let s=o.checkers??={};for(let i of["enabled","checkEveryMinutes"])t.checkers[i]!==void 0&&(s[i]=t.checkers[i])}},{configPath:e.configPath,reload:e.reload})}import{existsSync as H,readdirSync as ua,readFileSync as kt,statSync as pa}from"fs";import{dirname as lo,resolve as T}from"path";import{randomBytes as Vr}from"crypto";import{existsSync as Xi,mkdirSync as zi,readdirSync as Ki,readFileSync as Gi,renameSync as Xr,unlinkSync as Yi,writeFileSync as Ji}from"fs";import{resolve as zr}from"path";function qr(t){return[...t.account?["--account",t.account]:[],...t.store?["--store",t.store]:[]]}var Vi=t=>t.trim().split(`
4
4
  `).pop()?.slice(0,300)||"no output";async function Hr(t,e,n,r=ft){let o=await r(t.bin,[...qr(t),"send","text","--to",e,"--message",n,"--no-preview"],{timeoutMs:6e4});return o.code===0?{ok:!0}:{ok:!1,error:`wacli send failed: ${Vi(o.stderr||o.stdout)}`}}async function Ju(t,e,n,r,o=ft){return(await o(t.bin,[...qr(t),"--read-only","media","download","--chat",e,"--id",n,"--output",r],{timeoutMs:12e4})).code===0}var Qi=2e3,Zi=t=>Hr(t.wacli,t.to,t.text);function yt(t){return zr(t,".agentx","whatsapp-triage","drafts")}var ea=t=>/^[a-z0-9-]{8,64}$/.test(t),De=(t,e)=>zr(yt(t),`${e}.json`);function Kr(t,e){zi(yt(t),{recursive:!0});let n=De(t,e.id),r=`${n}.${process.pid}.tmp`;Ji(r,JSON.stringify(e,null,2)+`
@@ -966,4 +966,4 @@ Document the arguments, commands, or files the skill expects. Example:
966
966
  claude-code ${Sn(t)} --arg value
967
967
  \`\`\`
968
968
  `}Mn();var yi={maxPixels:12e5,timeoutMs:5e3,intervalMs:100,changeThreshold:.015,stableMs:400,regions:{},buffer:{enabled:!1,seconds:10,fps:2,region:"screen",maxPixels:3e5}};function wi(t){return{...yi,...t??{},regions:{...t?.regions??{}},buffer:{...yi.buffer,...t?.buffer??{}}}}function zh(t){try{return wi(Pn(t).screen)}catch{return wi(void 0)}}var Ru=/^[a-z][\w-]*$/,xi=["window","screen","menubar","notifications"];function ke(t,e,n,r){let o=Number(t);if(t===""||t===null||!Number.isFinite(o)||!n(o))throw new Error(`${e} must be ${r}`);return o}var Je=(t,e)=>ke(t,e,n=>Number.isInteger(n)&&n>0,"a whole number above 0");function ki(t){let e=typeof t=="string"?t.split(",").map(Number):[t?.x,t?.y,t?.width,t?.height].map(Number);if(e.length!==4||!e.every(Number.isFinite)||e[2]<=0||e[3]<=0)throw new Error("a region is x,y,width,height in screen points, with width and height above 0");return{x:e[0],y:e[1],width:e[2],height:e[3]}}function Kh(t,e){let n={...t??{}};if("maxPixels"in e&&(n.maxPixels=Je(e.maxPixels,"maxPixels")),"timeoutMs"in e&&(n.timeoutMs=Je(e.timeoutMs,"timeoutMs")),"intervalMs"in e&&(n.intervalMs=Je(e.intervalMs,"intervalMs")),"stableMs"in e&&(n.stableMs=ke(e.stableMs,"stableMs",o=>Number.isInteger(o)&&o>=0,"a whole number, 0 or more")),"changeThreshold"in e&&(n.changeThreshold=ke(e.changeThreshold,"changeThreshold",o=>o>=0&&o<=1,"between 0 and 1")),e.regions&&typeof e.regions=="object"){let o={...n.regions??{}};for(let[s,i]of Object.entries(e.regions)){if(!Ru.test(s))throw new Error(`region name "${s}" must be lowercase letters, digits, - or _`);i===null?delete o[s]:o[s]=ki(i)}n.regions=o}if(e.buffer&&typeof e.buffer=="object"){let o=e.buffer,s={...n.buffer??{}};"enabled"in o&&(s.enabled=!!o.enabled),"seconds"in o&&(s.seconds=ke(o.seconds,"buffer.seconds",i=>i>0&&i<=120,"above 0 and at most 120")),"fps"in o&&(s.fps=ke(o.fps,"buffer.fps",i=>i>0&&i<=10,"above 0 and at most 10")),"maxPixels"in o&&(s.maxPixels=Je(o.maxPixels,"buffer.maxPixels")),"region"in o&&(s.region=String(o.region).trim()),n.buffer=s}let r=n.buffer?.region;if(r!==void 0&&!xi.includes(r)&&!n.regions?.[r])try{ki(r)}catch{throw new Error(`buffer.region "${r}" is not a region \u2014 use ${[...xi,...Object.keys(n.regions??{})].join(", ")}, or x,y,w,h`)}return n}export{Dr as a,Cu as b,Yt as c,sc as d,ic as e,mm as f,fm as g,hm as h,wm as i,xm as j,km as k,ls as l,cs as m,vm as n,Xe as o,Em as p,$m as q,X as r,ds as s,A as t,Pu as u,gs as v,Cm as w,Lm as x,fs as y,Pm as z,hs as A,Mm as B,he as C,Nc as D,Fm as E,Um as F,ys as G,Ju as H,Zi as I,rp as J,Yr as K,N as L,ju as M,Bu as N,pp as O,Ne as P,gp as Q,Br as R,Ku as S,G as T,jp as U,fo as V,yo as W,Mc as X,jm as Y,Fc as Z,Bm as _,qm as $,Qt as aa,xs as ba,Xm as ca,en as da,jc as ea,Bc as fa,Ym as ga,Pa as ha,Ma as ia,Hp as ja,Vp as ka,Ha as la,Gp as ma,As as na,Zm as oa,Qp as pa,Zp as qa,os as ra,jt as sa,Ql as ta,R as ua,js as va,Cf as wa,Nf as xa,$d as ya,Mf as za,zs as Aa,Ff as Ba,Uf as Ca,Vf as Da,Ld as Ea,Md as Fa,Xf as Ga,tg as Ha,ng as Ia,rg as Ja,og as Ka,sg as La,ig as Ma,ag as Na,lg as Oa,dg as Pa,ug as Qa,mg as Ra,fg as Sa,hg as Ta,wg as Ua,xg as Va,kg as Wa,vg as Xa,Sg as Ya,Eg as Za,_g as _a,Og as $a,Dt as ab,Lg as bb,Pg as cb,me as db,fe as eb,qd as fb,th as gb,nh as hb,rh as ib,oh as jb,un as kb,sh as lb,Ot as mb,Lt as nb,Be as ob,xl as pb,vl as qb,jg as rb,Mt as sb,Ft as tb,Sl as ub,El as vb,qo as wb,zo as xb,Bg as yb,Tl as zb,qg as Ab,Ll as Bb,Fl as Cb,Ut as Db,Wl as Eb,Ko as Fb,z as Gb,oi as Hb,si as Ib,ii as Jb,gn as Kb,uh as Lb,Qd as Mb,li as Nb,ci as Ob,vh as Pb,Sh as Qb,mu as Rb,Eh as Sb,ui as Tb,Qo as Ub,Rh as Vb,xu as Wb,Dh as Xb,Ch as Yb,qe as Zb,om as _b,Kt as $b,um as ac,Ph as bc,Mh as cc,Fh as dc,Uh as ec,Wh as fc,jh as gc,Bh as hc,qh as ic,Hh as jc,yi as kc,wi as lc,zh as mc,xi as nc,Kh as oc};
969
- //# sourceMappingURL=chunk-YRBJ4KB7.js.map
969
+ //# sourceMappingURL=chunk-Z6N7POAU.js.map
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{b as o}from"./chunk-OSH2PEBH.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-YIX4NQZV.js"),{installCliSignalExit:r}=await import("./signal-exit-C5EUGHKI.js"),{applyConnectAttemptTimeout:i,configPathFromArgv:a,readConnectAttemptTimeout:n}=await import("./net-family-X2P3OVDP.js");r();i(n(process.cwd(),a(process.argv.slice(2))));var t=await s();process.argv.slice(2).length===0?t.outputHelp():t.parse();
2
+ import{b as o}from"./chunk-OSH2PEBH.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-4WR4ZYXQ.js"),{installCliSignalExit:r}=await import("./signal-exit-C5EUGHKI.js"),{applyConnectAttemptTimeout:i,configPathFromArgv:a,readConnectAttemptTimeout:n}=await import("./net-family-X2P3OVDP.js");r();i(n(process.cwd(),a(process.argv.slice(2))));var t=await s();process.argv.slice(2).length===0?t.outputHelp():t.parse();
3
3
  //# sourceMappingURL=cli.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g}from"./chunk-WNE4GRXY.js";import"./chunk-GUID2ZA2.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{b as fetchAgents,d as fetchCrons,c as fetchProcesses,e as killProcess,a as resolveConn,f as sendTask,g as streamTask};
2
- //# sourceMappingURL=client-AIQ7D7VU.js.map
1
+ import{a,b,c,d,e,f,g}from"./chunk-O4WFPH6H.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{b as fetchAgents,d as fetchCrons,c as fetchProcesses,e as killProcess,a as resolveConn,f as sendTask,g as streamTask};
2
+ //# sourceMappingURL=client-2TFSAO3Y.js.map
@@ -0,0 +1,2 @@
1
+ import{Ab as g,Bb as h,Cb as i,Db as j,Eb as k,Fb as l,Gb as m,Hb as n,Ib as o,Jb as p,Kb as q,Lb as r,Mb as s,Nb as t,Ob as u,Pb as v,Qb as w,Rb as x,Sb as y,Tb as z,Ub as A,Vb as B,Wb as C,Xb as D,Yb as E,_b as F,ub as a,vb as b,wb as c,xb as d,yb as e,zb as f}from"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";F();export{a as INTEGRATION_KINDS,A as WIKI_CONTRIBUTE_JOB,B as WIKI_CONTRIBUTE_MERGE_JOB,D as WIKI_SUMMARIZE_JOB,s as approvalsConfigSchema,g as callsSchema,e as cameraBotSchema,y as crossFieldProblems,u as daemonConfigSchema,c as emailAccountSchema,b as eventSubscriptionSchema,v as expandEnvVars,r as improveConfigSchema,f as isCronExpression,x as literalSecretProblems,w as loadDaemonConfig,d as mailSenderSchema,o as membersConfigSchema,j as mergePolicyConfigSchema,n as peopleConfigSchema,m as personSchema,q as qualityReportConfigSchema,p as requestStatusConfigSchema,l as requestsConfigSchema,h as reviewGateConfigSchema,i as trackersConfigSchema,z as validateWorkspaces,t as wallConfigSchema,k as watchersConfigSchema,C as withContributionJobs,E as withSummariesJob};
2
+ //# sourceMappingURL=config-LTXRWDRK.js.map
@@ -1,2 +1,2 @@
1
- import{a,b}from"./chunk-EPIKS3WL.js";import"./chunk-GUID2ZA2.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
2
- //# sourceMappingURL=config-mutate-XUBGMDIU.js.map
1
+ import{a,b}from"./chunk-WKBGQGVL.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
2
+ //# sourceMappingURL=config-mutate-UFVJUJQO.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e}from"./chunk-Y4BNOZWQ.js";import"./chunk-GUID2ZA2.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{b as applyConfigMutation,a as findConfigPath,d as getAtPath,c as setAtPath,e as unsetAtPath};
2
- //# sourceMappingURL=config-mutator-G62RKREK.js.map
1
+ import{a,b,c,d,e}from"./chunk-G3GFE3GK.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{b as applyConfigMutation,a as findConfigPath,d as getAtPath,c as setAtPath,e as unsetAtPath};
2
+ //# sourceMappingURL=config-mutator-RRKU33OL.js.map
@@ -1,4 +1,4 @@
1
- import{a as ee}from"./chunk-XWOXXVVX.js";import"./chunk-Y65DB3PF.js";import{f as Q,k as V}from"./chunk-IH65GDJR.js";import"./chunk-MHRVTFLZ.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import{b as O}from"./chunk-5ONH4ITT.js";import"./chunk-JRAG37V5.js";import"./chunk-ILEC3IAV.js";import"./chunk-BERWTVG2.js";import"./chunk-A7JSRDJL.js";import"./chunk-OAVJMZLF.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import{b as N,c as H}from"./chunk-AHWWJ7AF.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-LYY7G6LO.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-GUID2ZA2.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as le}from"crypto";import{existsSync as z,mkdirSync as ne,readdirSync as re,readFileSync as ge,renameSync as se,writeFileSync as pe}from"fs";import{resolve as w}from"path";var _={maxPatches:30,maxCostUsd:.5,maxItems:60},he=12,fe=2e3,me=1500,M=8,U=300,be=12,B="## Checked facts";function S(n){return w(n,"_contributions")}function E(n,r){if(!z(n))return r;try{return JSON.parse(ge(n,"utf-8"))}catch(t){throw new Error(`${n} is not valid JSON: ${t.message}`)}}function L(n,r){ne(w(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;pe(t,`${JSON.stringify(r,null,2)}
1
+ import{a as ee}from"./chunk-DNPPPUDP.js";import"./chunk-4W5KRZTT.js";import{f as Q,k as V}from"./chunk-IH65GDJR.js";import"./chunk-FCF47R4W.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import{b as O}from"./chunk-5ONH4ITT.js";import"./chunk-JRAG37V5.js";import"./chunk-ILEC3IAV.js";import"./chunk-BERWTVG2.js";import"./chunk-A7JSRDJL.js";import"./chunk-I722PWJE.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import{b as N,c as H}from"./chunk-AHWWJ7AF.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-IXV3BPUZ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as le}from"crypto";import{existsSync as z,mkdirSync as ne,readdirSync as re,readFileSync as ge,renameSync as se,writeFileSync as pe}from"fs";import{resolve as w}from"path";var _={maxPatches:30,maxCostUsd:.5,maxItems:60},he=12,fe=2e3,me=1500,M=8,U=300,be=12,B="## Checked facts";function S(n){return w(n,"_contributions")}function E(n,r){if(!z(n))return r;try{return JSON.parse(ge(n,"utf-8"))}catch(t){throw new Error(`${n} is not valid JSON: ${t.message}`)}}function L(n,r){ne(w(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;pe(t,`${JSON.stringify(r,null,2)}
2
2
  `),se(t,n)}function ie(n){return{agents:E(w(S(n),"state.json"),{agents:{}}).agents??{}}}function ye(n){let r=w(S(n),"pending");return z(r)?re(r).filter(t=>t.endsWith(".json")).sort().map(t=>E(w(r,t),null)).filter(t=>!!t):[]}function G(n){return w(S(n),"held.json")}function K(n,r={}){let t=E(G(n),[]);return r.all?t:t.filter(a=>a.status==="held")}function _e(n){let r=w(S(n),"reports");if(!z(r))return null;let t=re(r).filter(a=>a.endsWith(".json")).sort().pop();return t?E(w(r,t),null):null}function ke(n,r,t,a={}){let o=ie(r).agents[t],c=a.now??Date.now(),e=a.since??o?.lastRunAt??new Date(c-864e5).toISOString(),d=e.slice(0,10),u=new Set(o?.processed??[]),s=[];for(let g of n.getAgentEntries(t))g.date<d||u.has(g.id)||s.push({id:g.id,at:g.date,kind:"chat",title:[g.source,g.sourceContext].filter(Boolean).join(" \xB7 "),text:g.content});if(a.db){let g=Date.parse(e);for(let l of V(a.db,{agentId:t,since:Number.isFinite(g)?g:void 0,limit:500})){if(l.status==="in-flight"||u.has(l.taskId))continue;let k=(Q(a.db,l.taskId)?.steps??[]).filter(b=>b.name==="tool_use"||b.action).slice(0,be).map(b=>`- ${b.action??b.name}${b.inputSummary?` ${x(b.inputSummary,160)}`:""}${b.outputSummary?` \u2192 ${x(b.outputSummary,240)}`:""}${b.error?` \u2717 ${x(b.error,120)}`:""}`),y=[`Request: ${x(l.originalMessage??l.messagePreview??"",600)}`,k.length?`Tool calls:
3
3
  ${k.join(`
4
4
  `)}`:"",l.finalResponse?`Reply: ${x(l.finalResponse,800)}`:""].filter(Boolean).join(`
@@ -54,4 +54,4 @@ _Sources: ${t.sources.join("; ")}._`,a);return n.writeArticle(r,{title:t.title,.
54
54
  `).replace(/\n{3,}/g,`
55
55
 
56
56
  `).trim(),superseded:d}}function Ce(n){let r=n.previous?` (previously: ${n.previous})`:"";return`- **${n.attribute}:** ${n.value} \u2014 ${n.source}; checked ${n.checkedAt.slice(0,10)} by ${n.by}${r}`}function Re(n){let r=n.match(/^- \*\*.+?:\*\* (.*?) — .*?; checked (\S+) by \S+(?: \(previously: (.*)\))?$/);return r?{value:r[1],checkedAt:r[2],...r[3]?{previous:r[3]}:{}}:void 0}function J(n,r){return`contribution:${n}@${r.slice(0,10)}`}var Te={person:"people",project:"projects",place:"places",concept:"concepts",event:"events",decision:"decisions",pattern:"patterns"};function de(n,r,t){let a=r.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"page",o=t?Te[t]:"contributions",c=`${o}/${a}.md`;for(let e=2;n.readArticle(c);e++)c=`${o}/${a}-${e}.md`;return c}export{_ as DEFAULT_CONTRIBUTION_LIMITS,B as FACTS_HEADING,ue as applyFactLines,De as approveHeld,xe as buildContributionPrompt,S as contributionsDir,_e as latestReport,K as listHeld,ye as listPendingBatches,Be as mergeContributions,W as pageKey,Ae as parseContributionPatches,ke as pendingWork,Se as possibleDuplicate,Fe as rejectHeld,ce as replaceOnce,Me as runContribution};
57
- //# sourceMappingURL=contributions-RQZO4V36.js.map
57
+ //# sourceMappingURL=contributions-5XUEOSLT.js.map
@@ -1,2 +1,2 @@
1
- import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j}from"./chunk-BQIZN5JU.js";import"./chunk-WMZ4TGMR.js";import"./chunk-2YDG5CSS.js";import"./chunk-W4K3DFAX.js";import"./chunk-IMLAPB7G.js";import"./chunk-QPABR72X.js";import"./chunk-KP7KDLZ2.js";import"./chunk-XL7UWG36.js";import"./chunk-MNG2AMKZ.js";import"./chunk-LY4G7PCW.js";import"./chunk-7IW25T4K.js";import"./chunk-Q3A5P373.js";import"./chunk-JLBRNYKY.js";import"./chunk-BYEL7KKR.js";import"./chunk-QUFIUXMQ.js";import"./chunk-OSH2PEBH.js";import"./chunk-7I7IEX4S.js";import"./chunk-GUID2ZA2.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{j as daemonVoiceCheck,b as doctor,i as mcpHeaderEnvChecks,g as meshPeerTokenChecks,h as meshTokenChecksFromConfig,a as runDoctorChecks,e as runMirrorChecks,d as runNativeChecks,c as runNotificationChecks,f as runReminderChecks};
2
- //# sourceMappingURL=doctor-DVMX6632.js.map
1
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j}from"./chunk-BERSMN6Y.js";import"./chunk-WMZ4TGMR.js";import"./chunk-2YDG5CSS.js";import"./chunk-EE5RZDQE.js";import"./chunk-IMLAPB7G.js";import"./chunk-QPABR72X.js";import"./chunk-KP7KDLZ2.js";import"./chunk-XL7UWG36.js";import"./chunk-MNG2AMKZ.js";import"./chunk-LY4G7PCW.js";import"./chunk-7IW25T4K.js";import"./chunk-Q3A5P373.js";import"./chunk-JLBRNYKY.js";import"./chunk-BYEL7KKR.js";import"./chunk-QUFIUXMQ.js";import"./chunk-OSH2PEBH.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{j as daemonVoiceCheck,b as doctor,i as mcpHeaderEnvChecks,g as meshPeerTokenChecks,h as meshTokenChecksFromConfig,a as runDoctorChecks,e as runMirrorChecks,d as runNativeChecks,c as runNotificationChecks,f as runReminderChecks};
2
+ //# sourceMappingURL=doctor-L675OBBF.js.map
@@ -1,7 +1,7 @@
1
- import{b as h}from"./chunk-XWMHNDED.js";import"./chunk-RKPAVWXF.js";import{b as I}from"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import"./chunk-FLDMRYZD.js";import"./chunk-JJC2HBWC.js";import"./chunk-Y4BNOZWQ.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-GUID2ZA2.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";var p=t=>typeof t=="string"?t.trim():"";function $(t){return[`Run ${t.runId} "${t.title}" [${t.status}] on step ${t.step}: waiting on ${t.waitingOn}.`,t.tags?.length?`Tags: ${t.tags.join(", ")}`:"",...(t.steps??[]).slice(-8).map(s=>`- ${String(s.at).slice(0,16).replace("T"," ")} ${s.step} ${s.status}${s.note?`: ${s.note}`:""}`)].filter(Boolean).join(`
1
+ import{b as h}from"./chunk-KU3ZF3WO.js";import"./chunk-RKPAVWXF.js";import{b as I}from"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import"./chunk-CUCIMPFI.js";import"./chunk-ERKK22QV.js";import"./chunk-G3GFE3GK.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";var p=t=>typeof t=="string"?t.trim():"";function $(t){return[`Run ${t.runId} "${t.title}" [${t.status}] on step ${t.step}: waiting on ${t.waitingOn}.`,t.tags?.length?`Tags: ${t.tags.join(", ")}`:"",...(t.steps??[]).slice(-8).map(s=>`- ${String(s.at).slice(0,16).replace("T"," ")} ${s.step} ${s.status}${s.note?`: ${s.note}`:""}`)].filter(Boolean).join(`
2
2
  `)}async function T(t,c){let s=c.fetch??fetch,m=c.daemonUrl.replace(/\/$/,""),r=(p(t.action)||"list").toLowerCase(),f=c.env??process.env,w=async i=>{let l=await s(`${m}${i}`,{signal:AbortSignal.timeout(1e4)}),n=await l.json().catch(()=>({}));return{ok:l.ok,status:l.status,data:n}};try{if(r==="list"){let e=await w("/follow-up");if(!e.ok)return`Error: ${e.data?.error||`HTTP ${e.status}`}`;let o=e.data.groups??[];return o.length?o.map(d=>[`${d.tag}:`,...d.rows.map(a=>`- ${a.runId} "${a.title}" on ${a.step}: waiting on ${a.waitingOn} (since ${String(a.since).slice(0,16).replace("T"," ")} UTC)`)].join(`
3
3
  `)).join(`
4
4
  `):"No follow-up workflows are running."}if(r==="match"){let e=p(t.request)||p(t.title);if(!e)return"Error: match needs `request`: the owner's request in their words.";let o=h(t,f),d=await w(`/follow-up/match?q=${encodeURIComponent(e)}${o?`&agentId=${encodeURIComponent(o.agentId)}`:""}`);if(!d.ok)return`Error: ${d.data?.error||`HTTP ${d.status}`}`;let a=d.data.matches??[];return a.length?["Saved workflows, best fit first (confidence 0-1):",...a.map(u=>`- ${u.workflowId} "${u.title}" (${u.confidence}${u.autoStart?", starts without asking":""}): ${u.steps.map(k=>k.id).join(" \u2192 ")}`),'Start one with {action:"start", workflowId:"<id>", title:"\u2026", tags:["client:<name>"]}. Run its steps through the workflow, not by hand.'].join(`
5
5
  `):"No saved workflow fits. If the request has several steps, build one: start with title and steps."}if(r==="status"){let e=p(t.runId);if(!e)return"Error: status needs runId.";let o=await w(`/follow-up/${encodeURIComponent(e)}`);return o.ok?$(o.data.run):`Error: ${o.data?.error||`HTTP ${o.status}`}`}let i=h(t,f);if(!i)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let l=await s(`${m}/follow-up`,{method:"POST",headers:{"Content-Type":"application/json",...I(f)},body:JSON.stringify({action:r,agentId:i.agentId,workflowId:t.workflowId,title:t.title,description:t.description,tags:t.tags,inputs:t.inputs,steps:t.steps,edges:t.edges,approval:t.approval,autoStart:t.autoStart,requestId:t.requestId,runId:t.runId,step:t.step,evidence:t.evidence,note:t.note,reason:t.reason,fromRun:t.fromRun,status:t.status}),signal:AbortSignal.timeout(2e4)}),n=await l.json().catch(()=>({}));if(!l.ok)return`Error: ${n?.error||`HTTP ${l.status}`}`;if(r==="start"){let e=n.run;return[`Started run ${e.runId} "${e.title}"${n.built?" (built from the steps you gave; propose it with fromRun to keep it)":""}.`,n.awaitingApproval?"It waits for the owner's approval before the first step.":`It is on step ${e.step}: ${e.waitingOn}.`,"AgentX follows it from here: it starts each step, reminds whoever is slow, and tells the owner when it ends. Do not run its steps by hand.",...n.warning?[`Note: ${n.warning}`]:[]].join(" ")}return r==="plan"?[`Plan recorded on run ${n.run?.runId??t.runId}:`,...(n.plan??[]).map(e=>`- ${e.id} ${e.title}`),'Report each step with {action:"step", runId, step:"<id>", status:"started"|"done"|"failed"}.'].join(`
6
6
  `):r==="step"?`Step recorded. ${n.run?$(n.run):""}`.trim():r==="done"?`Step recorded as done. ${n.run?$(n.run):""}`.trim():r==="blocked"?"The step is marked blocked and the owner is told. Nothing more happens on it until it is sorted.":`Saved ${n.workflowId} switched off, and asked the owner (card ${n.cardId}) whether to keep it as a reusable workflow.`}catch(i){return`Error: couldn't reach the daemon (${i?.message??i}).`}}export{T as runWorkflowTool};
7
- //# sourceMappingURL=follow-up-tool-MS4FSM2J.js.map
7
+ //# sourceMappingURL=follow-up-tool-2OEZMPPQ.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-PYTNMX2D.js";import"./chunk-6VHORIGB.js";import"./chunk-OAVJMZLF.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-LYY7G6LO.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-GUID2ZA2.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
2
- //# sourceMappingURL=hub-RKX3L5LU.js.map
1
+ import{a}from"./chunk-XBFXSSHA.js";import"./chunk-DGCYMSXU.js";import"./chunk-I722PWJE.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-IXV3BPUZ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-UWDDVDU6.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
2
+ //# sourceMappingURL=hub-VJZYQXKB.js.map