agentix-cli 0.150.0 → 0.152.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 (173) hide show
  1. package/README.md +0 -1
  2. package/dist/{App-2O2UUZGG.js → App-NCB3Y5DS.js} +2 -2
  3. package/dist/{ChatApp-YU4NF63L.js → ChatApp-HOWN5H7Y.js} +2 -2
  4. package/dist/{absorb-eval-WHWOJYDX.js → absorb-eval-JXRNSZII.js} +2 -2
  5. package/dist/agent-DMXUUMEU.js +2 -0
  6. package/dist/{board-dashboard-VPDXHHWC.js → board-dashboard-POWARL34.js} +402 -241
  7. package/dist/board-dashboard-POWARL34.js.map +1 -0
  8. package/dist/chunk-24QMHUU2.js +5 -0
  9. package/dist/chunk-24QMHUU2.js.map +1 -0
  10. package/dist/{chunk-ATCIRFH6.js → chunk-7UH3DXAG.js} +2 -2
  11. package/dist/chunk-ADG6NBZY.js +862 -0
  12. package/dist/chunk-ADG6NBZY.js.map +1 -0
  13. package/dist/{chunk-NW4N67TU.js → chunk-CZEBLLZQ.js} +2 -2
  14. package/dist/{chunk-2MW32M2D.js → chunk-DZUJP6L7.js} +2 -2
  15. package/dist/{chunk-NMYC5RW7.js → chunk-E4V5EADX.js} +6 -6
  16. package/dist/{chunk-6YNRLI6I.js → chunk-GI5CY27P.js} +2 -2
  17. package/dist/{chunk-IGA3T3ZT.js → chunk-HS7ATV4Z.js} +2 -2
  18. package/dist/{chunk-S22IBRY6.js → chunk-ILZRO6SN.js} +2 -2
  19. package/dist/{chunk-UG2OF2EI.js → chunk-IVBCCSDR.js} +2 -2
  20. package/dist/chunk-JDX7AYIB.js +7 -0
  21. package/dist/chunk-JDX7AYIB.js.map +1 -0
  22. package/dist/{chunk-QZ6VBDMX.js → chunk-JHAQE46R.js} +46 -46
  23. package/dist/chunk-JHAQE46R.js.map +1 -0
  24. package/dist/chunk-JJOLZPUY.js +35 -0
  25. package/dist/chunk-JJOLZPUY.js.map +1 -0
  26. package/dist/{chunk-2PJKGZWP.js → chunk-JNG3P5V2.js} +2 -2
  27. package/dist/chunk-JNG3P5V2.js.map +1 -0
  28. package/dist/{chunk-GMMRBTLQ.js → chunk-LDLRDBAD.js} +2 -2
  29. package/dist/{chunk-EIY2HRAS.js → chunk-LOTCKF22.js} +2 -2
  30. package/dist/chunk-MTBY46CL.js +181 -0
  31. package/dist/chunk-MTBY46CL.js.map +1 -0
  32. package/dist/chunk-OSH2PEBH.js +2 -0
  33. package/dist/{chunk-JXF54PT7.js.map → chunk-OSH2PEBH.js.map} +1 -1
  34. package/dist/{chunk-6TJNWUMA.js → chunk-P25TJ4XN.js} +3 -3
  35. package/dist/{chunk-Y5GI35AZ.js → chunk-P4EZJIQ4.js} +308 -297
  36. package/dist/chunk-P4EZJIQ4.js.map +1 -0
  37. package/dist/{chunk-6QFDFYI7.js → chunk-PC24JMEH.js} +2 -2
  38. package/dist/{chunk-5IHUZVPU.js → chunk-PGLTBNGZ.js} +2 -2
  39. package/dist/{chunk-AONY6U45.js → chunk-QSNKF5VD.js} +2 -2
  40. package/dist/{chunk-JOHDOEZ4.js → chunk-R4R7EYY3.js} +2 -2
  41. package/dist/{chunk-OWMKQ4HZ.js → chunk-RNAKP7WY.js} +2 -2
  42. package/dist/chunk-SQUTRMKH.js +67 -0
  43. package/dist/chunk-SQUTRMKH.js.map +1 -0
  44. package/dist/{chunk-GRI5HOPC.js → chunk-TNZBQAUR.js} +2 -2
  45. package/dist/{chunk-Y5MFVVTM.js → chunk-U23LVMMZ.js} +2 -2
  46. package/dist/{chunk-BZ6Y264Z.js → chunk-UFYKUC4E.js} +2 -2
  47. package/dist/{chunk-5QXRPYOY.js → chunk-VIZVF6KH.js} +2 -2
  48. package/dist/{chunk-E7LPZAXP.js → chunk-XE3CGJV4.js} +2 -2
  49. package/dist/{chunk-3HVRWULP.js → chunk-YBUCVI45.js} +2 -2
  50. package/dist/{chunk-DWOERPBG.js → chunk-YJZQRFET.js} +2 -2
  51. package/dist/cli.js +1 -1
  52. package/dist/{client-A2N6ETK2.js → client-6IOWB5AT.js} +2 -2
  53. package/dist/{compaction-FS6XNRLM.js → compaction-PFXWL4H7.js} +3 -3
  54. package/dist/{config-2QM2WTI2.js → config-SHIT5WJE.js} +2 -2
  55. package/dist/{config-mutate-UJS4F7BT.js → config-mutate-6ACI5COM.js} +2 -2
  56. package/dist/config-mutator-LAEX6HOH.js +2 -0
  57. package/dist/{context-planner-3JDA7FNR.js → context-planner-DJB6CKY6.js} +2 -2
  58. package/dist/{contributions-43FWZOGF.js → contributions-N7K6LNL7.js} +2 -2
  59. package/dist/doctor-T7QAQRCJ.js +2 -0
  60. package/dist/{follow-up-tool-VB7K6HCL.js → follow-up-tool-HQ2GWF4K.js} +2 -2
  61. package/dist/{grants-2S33F2LV.js → grants-HSLB62EG.js} +2 -2
  62. package/dist/heal-RGM7X2ZG.js +2 -0
  63. package/dist/hub-53IMEYGX.js +2 -0
  64. package/dist/index.d.ts +167 -6
  65. package/dist/index.js +1 -1
  66. package/dist/memory-extract-GHLBXV4H.js +2 -0
  67. package/dist/{program-ZNTQK36Z.js → program-LSXONKPW.js} +234 -228
  68. package/dist/program-LSXONKPW.js.map +1 -0
  69. package/dist/{promote-VFYVWVTL.js → promote-626PE5VM.js} +2 -2
  70. package/dist/{providers-55NC2SFN.js → providers-BDJXGHEY.js} +2 -2
  71. package/dist/{query-RB2MU2HV.js → query-GR3SOD6A.js} +2 -2
  72. package/dist/{query-settings-5B54WHCS.js → query-settings-6XZHNFXE.js} +2 -2
  73. package/dist/{registry-6OX7U6FV.js → registry-SAY7ROZV.js} +2 -2
  74. package/dist/{request-planner-TUHVEYSF.js → request-planner-DWYXUVF4.js} +2 -2
  75. package/dist/{review-candidates-FDYTGG2N.js → review-candidates-GXWMKZKA.js} +2 -2
  76. package/dist/routing-TB6BBRH4.js +2 -0
  77. package/dist/schedule-tool-EI2SRMZM.js +2 -0
  78. package/dist/{scheduler-H2QHWNQ2.js → scheduler-VOZIMG5F.js} +2 -2
  79. package/dist/{seat-EB3KJMIE.js → seat-H6F6H55Y.js} +2 -2
  80. package/dist/{select-IU4IOVSO.js → select-OUBL6EMZ.js} +2 -2
  81. package/dist/{set-enabled-64BSJ7LR.js → set-enabled-NYJHFXHY.js} +2 -2
  82. package/dist/tool-FWATXW5Q.js +6 -0
  83. package/dist/tool-FWATXW5Q.js.map +1 -0
  84. package/dist/{tool-B23ACEHV.js → tool-HXFGNBLS.js} +2 -2
  85. package/dist/wiki-PG5ZBOMH.js +2 -0
  86. package/dist/wiki-enrich-BIQZWJRB.js +2 -0
  87. package/package.json +1 -1
  88. package/dist/agent-NLCR6VBE.js +0 -2
  89. package/dist/board-dashboard-VPDXHHWC.js.map +0 -1
  90. package/dist/chunk-2PJKGZWP.js.map +0 -1
  91. package/dist/chunk-A76PNG4E.js +0 -4
  92. package/dist/chunk-A76PNG4E.js.map +0 -1
  93. package/dist/chunk-JXF54PT7.js +0 -2
  94. package/dist/chunk-P34VSROA.js +0 -7
  95. package/dist/chunk-P34VSROA.js.map +0 -1
  96. package/dist/chunk-PXKIPU27.js +0 -64
  97. package/dist/chunk-PXKIPU27.js.map +0 -1
  98. package/dist/chunk-QZ6VBDMX.js.map +0 -1
  99. package/dist/chunk-UZWF7PFH.js +0 -861
  100. package/dist/chunk-UZWF7PFH.js.map +0 -1
  101. package/dist/chunk-WGPMUWX7.js +0 -35
  102. package/dist/chunk-WGPMUWX7.js.map +0 -1
  103. package/dist/chunk-Y5GI35AZ.js.map +0 -1
  104. package/dist/chunk-Z7GEW2SR.js +0 -174
  105. package/dist/chunk-Z7GEW2SR.js.map +0 -1
  106. package/dist/config-mutator-VWR3SMD3.js +0 -2
  107. package/dist/doctor-IN6MWP6I.js +0 -2
  108. package/dist/heal-U67X6NIN.js +0 -2
  109. package/dist/hub-JNNNUAZM.js +0 -2
  110. package/dist/memory-extract-ATD6YLRK.js +0 -2
  111. package/dist/program-ZNTQK36Z.js.map +0 -1
  112. package/dist/routing-U35SFPEI.js +0 -2
  113. package/dist/schedule-tool-EPQKUYJX.js +0 -2
  114. package/dist/tool-W3CIQZJ7.js +0 -6
  115. package/dist/tool-W3CIQZJ7.js.map +0 -1
  116. package/dist/wiki-4KMRUD5C.js +0 -2
  117. package/dist/wiki-enrich-N4GLW2JX.js +0 -2
  118. /package/dist/{App-2O2UUZGG.js.map → App-NCB3Y5DS.js.map} +0 -0
  119. /package/dist/{ChatApp-YU4NF63L.js.map → ChatApp-HOWN5H7Y.js.map} +0 -0
  120. /package/dist/{absorb-eval-WHWOJYDX.js.map → absorb-eval-JXRNSZII.js.map} +0 -0
  121. /package/dist/{agent-NLCR6VBE.js.map → agent-DMXUUMEU.js.map} +0 -0
  122. /package/dist/{chunk-ATCIRFH6.js.map → chunk-7UH3DXAG.js.map} +0 -0
  123. /package/dist/{chunk-NW4N67TU.js.map → chunk-CZEBLLZQ.js.map} +0 -0
  124. /package/dist/{chunk-2MW32M2D.js.map → chunk-DZUJP6L7.js.map} +0 -0
  125. /package/dist/{chunk-NMYC5RW7.js.map → chunk-E4V5EADX.js.map} +0 -0
  126. /package/dist/{chunk-6YNRLI6I.js.map → chunk-GI5CY27P.js.map} +0 -0
  127. /package/dist/{chunk-IGA3T3ZT.js.map → chunk-HS7ATV4Z.js.map} +0 -0
  128. /package/dist/{chunk-S22IBRY6.js.map → chunk-ILZRO6SN.js.map} +0 -0
  129. /package/dist/{chunk-UG2OF2EI.js.map → chunk-IVBCCSDR.js.map} +0 -0
  130. /package/dist/{chunk-GMMRBTLQ.js.map → chunk-LDLRDBAD.js.map} +0 -0
  131. /package/dist/{chunk-EIY2HRAS.js.map → chunk-LOTCKF22.js.map} +0 -0
  132. /package/dist/{chunk-6TJNWUMA.js.map → chunk-P25TJ4XN.js.map} +0 -0
  133. /package/dist/{chunk-6QFDFYI7.js.map → chunk-PC24JMEH.js.map} +0 -0
  134. /package/dist/{chunk-5IHUZVPU.js.map → chunk-PGLTBNGZ.js.map} +0 -0
  135. /package/dist/{chunk-AONY6U45.js.map → chunk-QSNKF5VD.js.map} +0 -0
  136. /package/dist/{chunk-JOHDOEZ4.js.map → chunk-R4R7EYY3.js.map} +0 -0
  137. /package/dist/{chunk-OWMKQ4HZ.js.map → chunk-RNAKP7WY.js.map} +0 -0
  138. /package/dist/{chunk-GRI5HOPC.js.map → chunk-TNZBQAUR.js.map} +0 -0
  139. /package/dist/{chunk-Y5MFVVTM.js.map → chunk-U23LVMMZ.js.map} +0 -0
  140. /package/dist/{chunk-BZ6Y264Z.js.map → chunk-UFYKUC4E.js.map} +0 -0
  141. /package/dist/{chunk-5QXRPYOY.js.map → chunk-VIZVF6KH.js.map} +0 -0
  142. /package/dist/{chunk-E7LPZAXP.js.map → chunk-XE3CGJV4.js.map} +0 -0
  143. /package/dist/{chunk-3HVRWULP.js.map → chunk-YBUCVI45.js.map} +0 -0
  144. /package/dist/{chunk-DWOERPBG.js.map → chunk-YJZQRFET.js.map} +0 -0
  145. /package/dist/{client-A2N6ETK2.js.map → client-6IOWB5AT.js.map} +0 -0
  146. /package/dist/{compaction-FS6XNRLM.js.map → compaction-PFXWL4H7.js.map} +0 -0
  147. /package/dist/{config-2QM2WTI2.js.map → config-SHIT5WJE.js.map} +0 -0
  148. /package/dist/{config-mutate-UJS4F7BT.js.map → config-mutate-6ACI5COM.js.map} +0 -0
  149. /package/dist/{config-mutator-VWR3SMD3.js.map → config-mutator-LAEX6HOH.js.map} +0 -0
  150. /package/dist/{context-planner-3JDA7FNR.js.map → context-planner-DJB6CKY6.js.map} +0 -0
  151. /package/dist/{contributions-43FWZOGF.js.map → contributions-N7K6LNL7.js.map} +0 -0
  152. /package/dist/{doctor-IN6MWP6I.js.map → doctor-T7QAQRCJ.js.map} +0 -0
  153. /package/dist/{follow-up-tool-VB7K6HCL.js.map → follow-up-tool-HQ2GWF4K.js.map} +0 -0
  154. /package/dist/{grants-2S33F2LV.js.map → grants-HSLB62EG.js.map} +0 -0
  155. /package/dist/{heal-U67X6NIN.js.map → heal-RGM7X2ZG.js.map} +0 -0
  156. /package/dist/{hub-JNNNUAZM.js.map → hub-53IMEYGX.js.map} +0 -0
  157. /package/dist/{memory-extract-ATD6YLRK.js.map → memory-extract-GHLBXV4H.js.map} +0 -0
  158. /package/dist/{promote-VFYVWVTL.js.map → promote-626PE5VM.js.map} +0 -0
  159. /package/dist/{providers-55NC2SFN.js.map → providers-BDJXGHEY.js.map} +0 -0
  160. /package/dist/{query-RB2MU2HV.js.map → query-GR3SOD6A.js.map} +0 -0
  161. /package/dist/{query-settings-5B54WHCS.js.map → query-settings-6XZHNFXE.js.map} +0 -0
  162. /package/dist/{registry-6OX7U6FV.js.map → registry-SAY7ROZV.js.map} +0 -0
  163. /package/dist/{request-planner-TUHVEYSF.js.map → request-planner-DWYXUVF4.js.map} +0 -0
  164. /package/dist/{review-candidates-FDYTGG2N.js.map → review-candidates-GXWMKZKA.js.map} +0 -0
  165. /package/dist/{routing-U35SFPEI.js.map → routing-TB6BBRH4.js.map} +0 -0
  166. /package/dist/{schedule-tool-EPQKUYJX.js.map → schedule-tool-EI2SRMZM.js.map} +0 -0
  167. /package/dist/{scheduler-H2QHWNQ2.js.map → scheduler-VOZIMG5F.js.map} +0 -0
  168. /package/dist/{seat-EB3KJMIE.js.map → seat-H6F6H55Y.js.map} +0 -0
  169. /package/dist/{select-IU4IOVSO.js.map → select-OUBL6EMZ.js.map} +0 -0
  170. /package/dist/{set-enabled-64BSJ7LR.js.map → set-enabled-NYJHFXHY.js.map} +0 -0
  171. /package/dist/{tool-B23ACEHV.js.map → tool-HXFGNBLS.js.map} +0 -0
  172. /package/dist/{wiki-4KMRUD5C.js.map → wiki-PG5ZBOMH.js.map} +0 -0
  173. /package/dist/{wiki-enrich-N4GLW2JX.js.map → wiki-enrich-BIQZWJRB.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ function o(n){let[e,r]=n.split(".").map(Number);return e===22&&r>=19||e>=23&&e<=26}function t(n){return o(n)?null:`AgentX needs Node.js 22.19 or newer, up to 26. This is Node.js ${n}. Install Node.js 22.19 or newer from https://nodejs.org and run it again.`}export{o as a,t as b};
2
+ //# sourceMappingURL=chunk-OSH2PEBH.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/node-version.ts"],"sourcesContent":["// No imports here: src/cli.ts runs this before it loads anything else.\n\n// Keep in step with package.json \"engines\": undici 8 needs 22.19, and\n// better-sqlite3 ships prebuilt binaries up to Node 26.\nexport function nodeVersionSupported(version: string): boolean {\n const [major, minor] = version.split(\".\").map(Number)\n return (major === 22 && minor >= 19) || (major >= 23 && major <= 26)\n}\n\nexport function unsupportedNodeMessage(version: string): string | null {\n if (nodeVersionSupported(version)) return null\n return `AgentX needs Node.js 22.19 or newer, up to 26. This is Node.js ${version}.`\n}\n"],"mappings":"AAIO,SAASA,EAAqBC,EAA0B,CAC7D,GAAM,CAACC,EAAOC,CAAK,EAAIF,EAAQ,MAAM,GAAG,EAAE,IAAI,MAAM,EACpD,OAAQC,IAAU,IAAMC,GAAS,IAAQD,GAAS,IAAMA,GAAS,EACnE,CAEO,SAASE,EAAuBH,EAAgC,CACrE,OAAID,EAAqBC,CAAO,EAAU,KACnC,kEAAkEA,IAC3E","names":["nodeVersionSupported","version","major","minor","unsupportedNodeMessage"]}
1
+ {"version":3,"sources":["../src/utils/node-version.ts"],"sourcesContent":["// No imports here: src/cli.ts runs this before it loads anything else.\n\n// Keep in step with package.json \"engines\": undici 8 needs 22.19, and\n// better-sqlite3 ships prebuilt binaries up to Node 26.\nexport function nodeVersionSupported(version: string): boolean {\n const [major, minor] = version.split(\".\").map(Number)\n return (major === 22 && minor >= 19) || (major >= 23 && major <= 26)\n}\n\nexport function unsupportedNodeMessage(version: string): string | null {\n if (nodeVersionSupported(version)) return null\n return `AgentX needs Node.js 22.19 or newer, up to 26. This is Node.js ${version}. Install Node.js 22.19 or newer from https://nodejs.org and run it again.`\n}\n"],"mappings":"AAIO,SAASA,EAAqBC,EAA0B,CAC7D,GAAM,CAACC,EAAOC,CAAK,EAAIF,EAAQ,MAAM,GAAG,EAAE,IAAI,MAAM,EACpD,OAAQC,IAAU,IAAMC,GAAS,IAAQD,GAAS,IAAMA,GAAS,EACnE,CAEO,SAASE,EAAuBH,EAAgC,CACrE,OAAID,EAAqBC,CAAO,EAAU,KACnC,kEAAkEA,6EAC3E","names":["nodeVersionSupported","version","major","minor","unsupportedNodeMessage"]}
@@ -1,4 +1,4 @@
1
- import{a as _,b as F,c as K,d as z,e as J}from"./chunk-SKSYII3K.js";import{a as j,b as I,c as Y,d as V,e as B,j as G}from"./chunk-EIY2HRAS.js";import{a as H}from"./chunk-MWNCS57L.js";import{y as N,z as ot}from"./chunk-OWMKQ4HZ.js";import{g as Q}from"./chunk-6TURWSMN.js";import{b as E,c as L}from"./chunk-QOYAX2FT.js";import{readFileSync as lt,existsSync as X}from"fs";ot();import{resolve as R}from"path";import{execSync as ct}from"child_process";var ht="haiku",dt="sonnet",pt=.8;function mt(e,r,o,t){if(t.size===0)return 0;let c=e.listArticles(r||"").map(l=>l.path).filter(l=>!l.includes("/_versions/"));return c.length===0&&(c=o.sharedPool.map(l=>l.path)),c.length===0?0:c.filter(l=>t.has(l)).length/c.length}async function _t(e,r,o,t={}){let c=t.selectorModel??ht,l=t.synthModel??dt,m=t.maxCandidates??3,g=t.maxHops??2,d=t.maxArticles??8,i=t.timeoutMs??6e4,s=t.log??console.error.bind(console,"[wiki-query]"),h=t.messagePath?.length?t.messagePath:void 0,n=t.graphWeight??W,a=R(r.baseDir,"_index.md"),p=tt(r,o,t.shared),b=t.method??"catalog";if(b!=="catalog"){let u=z(r,t.shared);if(b==="summaries"||mt(r,o,p,u)>=pt){let f=t.summaries??K,P=t.notes&&o&&t.notes.owner===o?F(t.notes):void 0,y=await J(e,P?gt(p,P):p,P?new Map([...u,...P.summaries]):u,{...f,navigatorModel:t.selectorModel??f.navigatorModel,answerModel:t.synthModel??f.answerModel},{call:t.call??H,fetch:t.fetch,timeoutMs:i,log:s}),$=y.picked.map(w=>({title:w.meta.title,path:w.path,type:_(w.path)?"note":w.meta.type,hop:w.hop}));return{answer:y.answer,citations:y.status==="ok"?$.map(({hop:w,...v})=>v):[],candidates:$.filter(w=>w.hop===0).map(({title:w,path:v})=>({title:w,path:v})),walked:$,status:y.status,method:"summaries",basis:y.basis,live:y.live,liveAsked:y.liveAsked,trace:y.trace,...y.error?{error:y.error}:{}}}}if(!X(a)&&p.sharedPool.length===0)return M("no-catalog",e,"No _index.md found \u2014 run `agentx wiki status` to rebuild.");let it=(X(a)?lt(a,"utf-8"):"")+yt(e,p.sharedPool,h,n),T=Date.now(),A=[],S="";try{let u=await nt(e,p.pool,o,m,h,n);u?(A=u,S=`[wiki-rerank seat] ${u.map(f=>f.title).join(" | ")}`):(S=await Z(wt(e,it,m,h),c,i),A=bt(S))}catch(u){return s("selector failed:",u?.message),{...M("error",e,`Selector: ${u?.message||"unknown"}`),trace:{selectorMs:Date.now()-T,synthesisMs:0,selectorOutput:S}}}let x=Date.now()-T;if(A.length===0)return{...M("no-candidates",e,"Selector returned no candidates."),trace:{selectorMs:x,synthesisMs:0,selectorOutput:S}};let C=rt(A,p,g,d);if(C.length===0)return{...M("no-candidates",e,"Candidates did not resolve to readable articles."),candidates:A,trace:{selectorMs:x,synthesisMs:0,selectorOutput:S}};let D=Date.now(),U="";try{U=await Z(kt(e,C),l,i*2)}catch(u){return s("synthesis failed:",u?.message),{...M("error",e,`Synthesis: ${u?.message||"unknown"}`),candidates:A,walked:C.map(f=>({title:f.meta.title,path:f.path,type:f.meta.type,hop:f.hop??0})),trace:{selectorMs:x,synthesisMs:Date.now()-D,selectorOutput:S}}}let st=Date.now()-D;return{answer:U.trim(),citations:C.map(u=>({title:u.meta.title,path:u.path,type:u.meta.type})),candidates:A,walked:C.map(u=>({title:u.meta.title,path:u.path,type:u.meta.type,hop:u.hop??0})),status:"ok",trace:{selectorMs:x,synthesisMs:st,selectorOutput:S}}}async function Rt(e,r,o,t={}){let c=t.maxCandidates??3,l=t.graphWeight??W,m=t.messagePath?.length?t.messagePath:void 0,g=t.pool??q(r);if(g.length===0||!e.trim())return[];let d=await nt(e,g,o,c,m,l,t.stage??"retrieve");if(!d){let i=new Set(L(e,E(g.map(at))).map(s=>s.docIndex));d=O(e,g,m,l).filter(s=>i.has(s)).slice(0,c).map(s=>({title:g[s].title,path:g[s].path}))}return d.length===0?[]:rt(d,tt(r,o),t.maxHops??1,t.maxArticles??6)}function q(e){try{return(e.rebuildIndex().articles??[]).filter(r=>r.path&&!r.path.includes("/_versions/"))}catch{return[]}}function M(e,r,o){return{answer:"",citations:[],candidates:[],walked:[],status:e,error:o}}function tt(e,r,o=[]){let t=new Map,c=[];for(let i of e.listArticles(r||""))t.set(i.meta.title.toLowerCase(),i.path),c.push({path:i.path,related:i.meta.related??[],lastUpdated:i.meta.lastUpdated??""});let l=[],m=new Map;for(let i of o)if(i.store.baseDir!==e.baseDir){m.set(i.id,i);for(let s of i.store.listArticles(r||"")){if(s.path.includes("/_versions/")||i.skip?.(s.path))continue;let h=`@${i.id}/${s.path}`;l.push(ut(s,h)),c.push({path:h,related:s.meta.related??[],lastUpdated:s.meta.lastUpdated??""});let n=s.meta.title.toLowerCase();t.has(n)||t.set(n,h)}}let g=new Map;if(m.size>0)for(let i of[...c].sort((s,h)=>h.lastUpdated.localeCompare(s.lastUpdated)))for(let s of i.related){let h=s.toLowerCase(),n=g.get(h)??[];n.includes(i.path)||n.push(i.path),g.set(h,n)}let d;return{backlinks:g,readable:new Set(c.map(i=>i.path)),get pool(){return d??=[...q(e),...l]},sharedPool:l,titleIndex:t,read(i){let s=i.match(/^@([^/]+)\/(.+)$/),h=s?m.get(s[1]):void 0;if(s&&!h)return null;let n=h?.store??e,a=s?s[2]:i,p=r?n.readArticleAs(a,r):n.readArticle(a);return p?{...p,path:i}:null},links(i){let s=(i.meta.related??[]).map(a=>t.get(a.toLowerCase())).filter(a=>!!a),h=[i.meta.title,...i.meta.aliases??[]].map(a=>a.toLowerCase()),n=[...new Set(h.flatMap(a=>g.get(a)??[]))].filter(a=>a!==i.path).slice(0,et);return[...new Set([...s,...n])].filter(a=>a!==i.path)}}}function gt(e,r){return{...e,pool:[...e.pool,...r.pool],readable:new Set([...e.readable,...r.pool.map(o=>o.path)]),read:o=>_(o)?r.read(o):e.read(o)}}function ut(e,r){return{path:r,title:e.meta.title,type:e.meta.type,related:e.meta.related,tags:e.meta.tags||[],owner:e.meta.owner,access:e.meta.access,sharedWith:e.meta.sharedWith,aliases:[e.meta.title.toLowerCase(),...(e.meta.aliases??[]).map(o=>o.toLowerCase())],backlinks:0,sources:e.meta.sources,lastUpdated:e.meta.lastUpdated,graphPath:e.meta.graphPath}}var ft=150;function yt(e,r,o,t){return r.length===0?"":`
1
+ import{a as _,b as F,c as K,d as z,e as J}from"./chunk-SKSYII3K.js";import{a as j,b as I,c as Y,d as V,e as B,j as G}from"./chunk-LOTCKF22.js";import{a as H}from"./chunk-MWNCS57L.js";import{y as N,z as ot}from"./chunk-RNAKP7WY.js";import{g as Q}from"./chunk-6TURWSMN.js";import{b as E,c as L}from"./chunk-QOYAX2FT.js";import{readFileSync as lt,existsSync as X}from"fs";ot();import{resolve as R}from"path";import{execSync as ct}from"child_process";var ht="haiku",dt="sonnet",pt=.8;function mt(e,r,o,t){if(t.size===0)return 0;let c=e.listArticles(r||"").map(l=>l.path).filter(l=>!l.includes("/_versions/"));return c.length===0&&(c=o.sharedPool.map(l=>l.path)),c.length===0?0:c.filter(l=>t.has(l)).length/c.length}async function _t(e,r,o,t={}){let c=t.selectorModel??ht,l=t.synthModel??dt,m=t.maxCandidates??3,g=t.maxHops??2,d=t.maxArticles??8,i=t.timeoutMs??6e4,s=t.log??console.error.bind(console,"[wiki-query]"),h=t.messagePath?.length?t.messagePath:void 0,n=t.graphWeight??W,a=R(r.baseDir,"_index.md"),p=tt(r,o,t.shared),b=t.method??"catalog";if(b!=="catalog"){let u=z(r,t.shared);if(b==="summaries"||mt(r,o,p,u)>=pt){let f=t.summaries??K,P=t.notes&&o&&t.notes.owner===o?F(t.notes):void 0,y=await J(e,P?gt(p,P):p,P?new Map([...u,...P.summaries]):u,{...f,navigatorModel:t.selectorModel??f.navigatorModel,answerModel:t.synthModel??f.answerModel},{call:t.call??H,fetch:t.fetch,timeoutMs:i,log:s}),$=y.picked.map(w=>({title:w.meta.title,path:w.path,type:_(w.path)?"note":w.meta.type,hop:w.hop}));return{answer:y.answer,citations:y.status==="ok"?$.map(({hop:w,...v})=>v):[],candidates:$.filter(w=>w.hop===0).map(({title:w,path:v})=>({title:w,path:v})),walked:$,status:y.status,method:"summaries",basis:y.basis,live:y.live,liveAsked:y.liveAsked,trace:y.trace,...y.error?{error:y.error}:{}}}}if(!X(a)&&p.sharedPool.length===0)return M("no-catalog",e,"No _index.md found \u2014 run `agentx wiki status` to rebuild.");let it=(X(a)?lt(a,"utf-8"):"")+yt(e,p.sharedPool,h,n),T=Date.now(),A=[],S="";try{let u=await nt(e,p.pool,o,m,h,n);u?(A=u,S=`[wiki-rerank seat] ${u.map(f=>f.title).join(" | ")}`):(S=await Z(wt(e,it,m,h),c,i),A=bt(S))}catch(u){return s("selector failed:",u?.message),{...M("error",e,`Selector: ${u?.message||"unknown"}`),trace:{selectorMs:Date.now()-T,synthesisMs:0,selectorOutput:S}}}let x=Date.now()-T;if(A.length===0)return{...M("no-candidates",e,"Selector returned no candidates."),trace:{selectorMs:x,synthesisMs:0,selectorOutput:S}};let C=rt(A,p,g,d);if(C.length===0)return{...M("no-candidates",e,"Candidates did not resolve to readable articles."),candidates:A,trace:{selectorMs:x,synthesisMs:0,selectorOutput:S}};let D=Date.now(),U="";try{U=await Z(kt(e,C),l,i*2)}catch(u){return s("synthesis failed:",u?.message),{...M("error",e,`Synthesis: ${u?.message||"unknown"}`),candidates:A,walked:C.map(f=>({title:f.meta.title,path:f.path,type:f.meta.type,hop:f.hop??0})),trace:{selectorMs:x,synthesisMs:Date.now()-D,selectorOutput:S}}}let st=Date.now()-D;return{answer:U.trim(),citations:C.map(u=>({title:u.meta.title,path:u.path,type:u.meta.type})),candidates:A,walked:C.map(u=>({title:u.meta.title,path:u.path,type:u.meta.type,hop:u.hop??0})),status:"ok",trace:{selectorMs:x,synthesisMs:st,selectorOutput:S}}}async function Rt(e,r,o,t={}){let c=t.maxCandidates??3,l=t.graphWeight??W,m=t.messagePath?.length?t.messagePath:void 0,g=t.pool??q(r);if(g.length===0||!e.trim())return[];let d=await nt(e,g,o,c,m,l,t.stage??"retrieve");if(!d){let i=new Set(L(e,E(g.map(at))).map(s=>s.docIndex));d=O(e,g,m,l).filter(s=>i.has(s)).slice(0,c).map(s=>({title:g[s].title,path:g[s].path}))}return d.length===0?[]:rt(d,tt(r,o),t.maxHops??1,t.maxArticles??6)}function q(e){try{return(e.rebuildIndex().articles??[]).filter(r=>r.path&&!r.path.includes("/_versions/"))}catch{return[]}}function M(e,r,o){return{answer:"",citations:[],candidates:[],walked:[],status:e,error:o}}function tt(e,r,o=[]){let t=new Map,c=[];for(let i of e.listArticles(r||""))t.set(i.meta.title.toLowerCase(),i.path),c.push({path:i.path,related:i.meta.related??[],lastUpdated:i.meta.lastUpdated??""});let l=[],m=new Map;for(let i of o)if(i.store.baseDir!==e.baseDir){m.set(i.id,i);for(let s of i.store.listArticles(r||"")){if(s.path.includes("/_versions/")||i.skip?.(s.path))continue;let h=`@${i.id}/${s.path}`;l.push(ut(s,h)),c.push({path:h,related:s.meta.related??[],lastUpdated:s.meta.lastUpdated??""});let n=s.meta.title.toLowerCase();t.has(n)||t.set(n,h)}}let g=new Map;if(m.size>0)for(let i of[...c].sort((s,h)=>h.lastUpdated.localeCompare(s.lastUpdated)))for(let s of i.related){let h=s.toLowerCase(),n=g.get(h)??[];n.includes(i.path)||n.push(i.path),g.set(h,n)}let d;return{backlinks:g,readable:new Set(c.map(i=>i.path)),get pool(){return d??=[...q(e),...l]},sharedPool:l,titleIndex:t,read(i){let s=i.match(/^@([^/]+)\/(.+)$/),h=s?m.get(s[1]):void 0;if(s&&!h)return null;let n=h?.store??e,a=s?s[2]:i,p=r?n.readArticleAs(a,r):n.readArticle(a);return p?{...p,path:i}:null},links(i){let s=(i.meta.related??[]).map(a=>t.get(a.toLowerCase())).filter(a=>!!a),h=[i.meta.title,...i.meta.aliases??[]].map(a=>a.toLowerCase()),n=[...new Set(h.flatMap(a=>g.get(a)??[]))].filter(a=>a!==i.path).slice(0,et);return[...new Set([...s,...n])].filter(a=>a!==i.path)}}}function gt(e,r){return{...e,pool:[...e.pool,...r.pool],readable:new Set([...e.readable,...r.pool.map(o=>o.path)]),read:o=>_(o)?r.read(o):e.read(o)}}function ut(e,r){return{path:r,title:e.meta.title,type:e.meta.type,related:e.meta.related,tags:e.meta.tags||[],owner:e.meta.owner,access:e.meta.access,sharedWith:e.meta.sharedWith,aliases:[e.meta.title.toLowerCase(),...(e.meta.aliases??[]).map(o=>o.toLowerCase())],backlinks:0,sources:e.meta.sources,lastUpdated:e.meta.lastUpdated,graphPath:e.meta.graphPath}}var ft=150;function yt(e,r,o,t){return r.length===0?"":`
2
2
 
3
3
  ## Shared wiki (other agents' articles)
4
4
 
@@ -51,5 +51,5 @@ ${o}
51
51
 
52
52
  Answer the question in 2\u20136 sentences. Cite articles by their title in square brackets like [Article Title]. When two articles disagree, prefer the one updated more recently, and say which agent's page and date the answer comes from. If the articles do not answer the question, say so plainly (do not invent). Prefer concrete facts over hedging.
53
53
 
54
- Output ONLY the answer \u2014 no preamble, no "here is my answer:", no markdown fencing.`}function bt(e){let r=e.match(/\[[\s\S]*?\]/);if(!r)return[];try{let o=JSON.parse(r[0]);return Array.isArray(o)?o.filter(t=>t&&typeof t.title=="string"&&typeof t.path=="string").map(t=>({title:t.title,path:t.path})):[]}catch{return[]}}async function Z(e,r,o){let{writeFileSync:t,mkdirSync:c,rmSync:l}=await import("fs"),{tmpdir:m}=await import("os"),g=R(m(),`agentx-wiki-query-${process.pid}`);c(g,{recursive:!0});let d=R(g,`prompt-${Date.now()}.txt`);t(d,e);try{let i=`cat '${d}' | claude -p - --output-format json --max-turns 1 --model ${r} --disallowedTools "Bash Read Write Edit Glob Grep Agent WebSearch WebFetch NotebookEdit"`,s=ct(i,{env:Q(),encoding:"utf-8",timeout:o,maxBuffer:4*1024*1024});try{let h=JSON.parse(s);return String(h.result||h.content||"")}catch{return s}}finally{try{l(d,{force:!0})}catch{}}}async function Ot(e){try{let{loadDaemonConfig:r}=await import("./config-2QM2WTI2.js");return r(e).wiki.query.shared}catch{return!0}}export{ht as a,dt as b,pt as c,_t as d,Rt as e,q as f,ft as g,W as h,O as i,Ot as j};
55
- //# sourceMappingURL=chunk-6TJNWUMA.js.map
54
+ Output ONLY the answer \u2014 no preamble, no "here is my answer:", no markdown fencing.`}function bt(e){let r=e.match(/\[[\s\S]*?\]/);if(!r)return[];try{let o=JSON.parse(r[0]);return Array.isArray(o)?o.filter(t=>t&&typeof t.title=="string"&&typeof t.path=="string").map(t=>({title:t.title,path:t.path})):[]}catch{return[]}}async function Z(e,r,o){let{writeFileSync:t,mkdirSync:c,rmSync:l}=await import("fs"),{tmpdir:m}=await import("os"),g=R(m(),`agentx-wiki-query-${process.pid}`);c(g,{recursive:!0});let d=R(g,`prompt-${Date.now()}.txt`);t(d,e);try{let i=`cat '${d}' | claude -p - --output-format json --max-turns 1 --model ${r} --disallowedTools "Bash Read Write Edit Glob Grep Agent WebSearch WebFetch NotebookEdit"`,s=ct(i,{env:Q(),encoding:"utf-8",timeout:o,maxBuffer:4*1024*1024});try{let h=JSON.parse(s);return String(h.result||h.content||"")}catch{return s}}finally{try{l(d,{force:!0})}catch{}}}async function Ot(e){try{let{loadDaemonConfig:r}=await import("./config-SHIT5WJE.js");return r(e).wiki.query.shared}catch{return!0}}export{ht as a,dt as b,pt as c,_t as d,Rt as e,q as f,ft as g,W as h,O as i,Ot as j};
55
+ //# sourceMappingURL=chunk-P25TJ4XN.js.map