agentix-cli 0.54.0 → 0.55.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 (120) hide show
  1. package/apps/mac-voice/Sources/AgentXVoice/AgentClient.swift +26 -0
  2. package/apps/mac-voice/Sources/AgentXVoice/StatusMenu.swift +55 -3
  3. package/apps/mac-voice/Sources/AgentXVoice/main.swift +136 -13
  4. package/dist/{App-VRTLAPRF.js → App-4EM7IPB3.js} +2 -2
  5. package/dist/{ChatApp-YENWPZT4.js → ChatApp-FYTEEGSU.js} +2 -2
  6. package/dist/{agent-HVUGHYBF.js → agent-RZ46ZB4W.js} +2 -2
  7. package/dist/{board-dashboard-3XJVYDB3.js → board-dashboard-NRRYCDZW.js} +826 -180
  8. package/dist/board-dashboard-NRRYCDZW.js.map +1 -0
  9. package/dist/{chunk-M67AN4J7.js → chunk-4HEVSWO3.js} +2 -2
  10. package/dist/{chunk-KLDGJSR5.js → chunk-6AK6WKE5.js} +2 -2
  11. package/dist/{chunk-ENRJ2QEH.js → chunk-723K4SAW.js} +2 -2
  12. package/dist/{chunk-UYMK3XNB.js → chunk-76AHNHWC.js} +2 -2
  13. package/dist/{chunk-XWU7O3S5.js → chunk-C3VRBEJ7.js} +2 -2
  14. package/dist/{chunk-HQMISQ7L.js → chunk-CELYD5QW.js} +2 -2
  15. package/dist/{chunk-33QV5O6P.js → chunk-D3LSPFHK.js} +2 -2
  16. package/dist/chunk-EJ5ISSWW.js +151 -0
  17. package/dist/chunk-EJ5ISSWW.js.map +1 -0
  18. package/dist/{chunk-4HNHHKJF.js → chunk-EZN2YXRY.js} +2 -2
  19. package/dist/{chunk-BKDUCPZ3.js → chunk-GSOL2LW6.js} +2 -2
  20. package/dist/{chunk-TLFJVLVQ.js → chunk-JC5Q5MPI.js} +152 -151
  21. package/dist/chunk-JC5Q5MPI.js.map +1 -0
  22. package/dist/{chunk-6JHA3ZE6.js → chunk-K4RDE6YU.js} +211 -197
  23. package/dist/chunk-K4RDE6YU.js.map +1 -0
  24. package/dist/{chunk-WLRHL2P7.js → chunk-LKJSPO3S.js} +2 -2
  25. package/dist/{chunk-37EABIOJ.js → chunk-M4AG2YNX.js} +2 -2
  26. package/dist/{chunk-ZOJUHPD5.js → chunk-O3XG2NVR.js} +18 -18
  27. package/dist/{chunk-ZOJUHPD5.js.map → chunk-O3XG2NVR.js.map} +1 -1
  28. package/dist/{chunk-QYHABRLM.js → chunk-SA23V7WX.js} +2 -2
  29. package/dist/chunk-U4H35SJS.js +15 -0
  30. package/dist/chunk-U4H35SJS.js.map +1 -0
  31. package/dist/{chunk-3RCFUIYR.js → chunk-UIVHSYCN.js} +9 -9
  32. package/dist/chunk-UIVHSYCN.js.map +1 -0
  33. package/dist/{chunk-3W2KMI5O.js → chunk-W4YMMWJL.js} +2 -2
  34. package/dist/chunk-WOMQ2VGA.js +5 -0
  35. package/dist/{chunk-QX4R5WY7.js.map → chunk-WOMQ2VGA.js.map} +1 -1
  36. package/dist/chunk-X5C5W3E4.js +3 -0
  37. package/dist/chunk-X5C5W3E4.js.map +1 -0
  38. package/dist/{chunk-2TJYZF4E.js → chunk-XEOAKD5C.js} +2 -2
  39. package/dist/cli.js +1 -1
  40. package/dist/cli.js.map +1 -1
  41. package/dist/client-IA7ZPE56.js +2 -0
  42. package/dist/config-HPN2F7LH.js +2 -0
  43. package/dist/config-mutator-7GPTMTVB.js +2 -0
  44. package/dist/doctor-IBWQVQV4.js +2 -0
  45. package/dist/index.d.ts +185 -19
  46. package/dist/index.js +1 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/program-D5TAPSIH.js +2 -0
  49. package/dist/{promote-H6ZHJXTY.js → promote-T4UJROEH.js} +2 -2
  50. package/dist/query-VUJC4Y5O.js +2 -0
  51. package/dist/registry-DX2RI7I7.js +2 -0
  52. package/dist/{request-planner-ABD4WIGM.js → request-planner-B7DE7VJR.js} +2 -2
  53. package/dist/{review-candidates-B6574GOJ.js → review-candidates-4YJHIBAF.js} +2 -2
  54. package/dist/routing-MZG3UODH.js +2 -0
  55. package/dist/schedule-tool-A4OFQ4YZ.js +2 -0
  56. package/dist/scheduler-RHJW2V4M.js +2 -0
  57. package/dist/seat-2PEI7JRX.js +2 -0
  58. package/dist/{select-Y7SBUCGJ.js → select-4KIUR27O.js} +2 -2
  59. package/dist/{set-enabled-ARKMDLXN.js → set-enabled-SE7HQKPF.js} +2 -2
  60. package/dist/subscriptions-RYVPHVIV.js +2 -0
  61. package/dist/{tool-5EVYUN2G.js → tool-5VMD7IE4.js} +2 -2
  62. package/dist/wiki-2QFLAH4U.js +2 -0
  63. package/dist/wiki-2QFLAH4U.js.map +1 -0
  64. package/package.json +1 -1
  65. package/dist/board-dashboard-3XJVYDB3.js.map +0 -1
  66. package/dist/chunk-3RCFUIYR.js.map +0 -1
  67. package/dist/chunk-4FFWNPFX.js +0 -15
  68. package/dist/chunk-4FFWNPFX.js.map +0 -1
  69. package/dist/chunk-6JHA3ZE6.js.map +0 -1
  70. package/dist/chunk-BMSPRUEJ.js +0 -150
  71. package/dist/chunk-BMSPRUEJ.js.map +0 -1
  72. package/dist/chunk-QX4R5WY7.js +0 -5
  73. package/dist/chunk-TLFJVLVQ.js.map +0 -1
  74. package/dist/client-N4XQEAVL.js +0 -2
  75. package/dist/config-KHKIY6LI.js +0 -2
  76. package/dist/config-mutator-ZZKFQ7HJ.js +0 -2
  77. package/dist/doctor-QICAXIQB.js +0 -2
  78. package/dist/program-ZWNGK3RB.js +0 -2
  79. package/dist/query-FTE4FLYK.js +0 -2
  80. package/dist/registry-HDOFVNRK.js +0 -2
  81. package/dist/routing-BGKZOHOA.js +0 -2
  82. package/dist/schedule-tool-UDHXTKWV.js +0 -2
  83. package/dist/scheduler-NQM3HVUY.js +0 -2
  84. package/dist/seat-VGST5AQB.js +0 -2
  85. package/dist/wiki-GREI2TSP.js +0 -2
  86. /package/dist/{App-VRTLAPRF.js.map → App-4EM7IPB3.js.map} +0 -0
  87. /package/dist/{ChatApp-YENWPZT4.js.map → ChatApp-FYTEEGSU.js.map} +0 -0
  88. /package/dist/{agent-HVUGHYBF.js.map → agent-RZ46ZB4W.js.map} +0 -0
  89. /package/dist/{chunk-M67AN4J7.js.map → chunk-4HEVSWO3.js.map} +0 -0
  90. /package/dist/{chunk-KLDGJSR5.js.map → chunk-6AK6WKE5.js.map} +0 -0
  91. /package/dist/{chunk-ENRJ2QEH.js.map → chunk-723K4SAW.js.map} +0 -0
  92. /package/dist/{chunk-UYMK3XNB.js.map → chunk-76AHNHWC.js.map} +0 -0
  93. /package/dist/{chunk-XWU7O3S5.js.map → chunk-C3VRBEJ7.js.map} +0 -0
  94. /package/dist/{chunk-HQMISQ7L.js.map → chunk-CELYD5QW.js.map} +0 -0
  95. /package/dist/{chunk-33QV5O6P.js.map → chunk-D3LSPFHK.js.map} +0 -0
  96. /package/dist/{chunk-4HNHHKJF.js.map → chunk-EZN2YXRY.js.map} +0 -0
  97. /package/dist/{chunk-BKDUCPZ3.js.map → chunk-GSOL2LW6.js.map} +0 -0
  98. /package/dist/{chunk-WLRHL2P7.js.map → chunk-LKJSPO3S.js.map} +0 -0
  99. /package/dist/{chunk-37EABIOJ.js.map → chunk-M4AG2YNX.js.map} +0 -0
  100. /package/dist/{chunk-QYHABRLM.js.map → chunk-SA23V7WX.js.map} +0 -0
  101. /package/dist/{chunk-3W2KMI5O.js.map → chunk-W4YMMWJL.js.map} +0 -0
  102. /package/dist/{chunk-2TJYZF4E.js.map → chunk-XEOAKD5C.js.map} +0 -0
  103. /package/dist/{client-N4XQEAVL.js.map → client-IA7ZPE56.js.map} +0 -0
  104. /package/dist/{config-KHKIY6LI.js.map → config-HPN2F7LH.js.map} +0 -0
  105. /package/dist/{config-mutator-ZZKFQ7HJ.js.map → config-mutator-7GPTMTVB.js.map} +0 -0
  106. /package/dist/{doctor-QICAXIQB.js.map → doctor-IBWQVQV4.js.map} +0 -0
  107. /package/dist/{program-ZWNGK3RB.js.map → program-D5TAPSIH.js.map} +0 -0
  108. /package/dist/{promote-H6ZHJXTY.js.map → promote-T4UJROEH.js.map} +0 -0
  109. /package/dist/{query-FTE4FLYK.js.map → query-VUJC4Y5O.js.map} +0 -0
  110. /package/dist/{registry-HDOFVNRK.js.map → registry-DX2RI7I7.js.map} +0 -0
  111. /package/dist/{request-planner-ABD4WIGM.js.map → request-planner-B7DE7VJR.js.map} +0 -0
  112. /package/dist/{review-candidates-B6574GOJ.js.map → review-candidates-4YJHIBAF.js.map} +0 -0
  113. /package/dist/{routing-BGKZOHOA.js.map → routing-MZG3UODH.js.map} +0 -0
  114. /package/dist/{schedule-tool-UDHXTKWV.js.map → schedule-tool-A4OFQ4YZ.js.map} +0 -0
  115. /package/dist/{scheduler-NQM3HVUY.js.map → scheduler-RHJW2V4M.js.map} +0 -0
  116. /package/dist/{seat-VGST5AQB.js.map → seat-2PEI7JRX.js.map} +0 -0
  117. /package/dist/{select-Y7SBUCGJ.js.map → select-4KIUR27O.js.map} +0 -0
  118. /package/dist/{set-enabled-ARKMDLXN.js.map → set-enabled-SE7HQKPF.js.map} +0 -0
  119. /package/dist/{wiki-GREI2TSP.js.map → subscriptions-RYVPHVIV.js.map} +0 -0
  120. /package/dist/{tool-5EVYUN2G.js.map → tool-5VMD7IE4.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- import{k as m,l as $,p as x}from"./chunk-4FFWNPFX.js";x();import{readFileSync as S,writeFileSync as P,existsSync as b}from"fs";import{resolve as f}from"path";function w(r){if(r)return f(r);let e=[f(process.cwd(),"agentx.json"),f(process.cwd(),".agentx/config.json")];for(let n of e)if(b(n))return n;return e[0]}function v(r){return JSON.parse(JSON.stringify(r))}async function O(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/reload`,{method:"POST",signal:AbortSignal.timeout(3e3)});return e.ok?{ok:!0}:{ok:!1,reason:`HTTP ${e.status}`}}catch(e){return{ok:!1,reason:e?.cause?.code||e?.message||"unreachable"}}}async function J(r,e={}){let{validate:n=!0,dryRun:t=!1,reload:s=!0,configPath:u,daemonUrl:c}=e,o=w(u);if(!b(o))return{success:!1,path:o,error:`Config not found at ${o}. Run \`agentx init\` first.`};let d;try{d=S(o,"utf-8")}catch(a){return{success:!1,path:o,error:`Cannot read ${o}: ${a.message}`}}let g;try{g=JSON.parse(d)}catch(a){return{success:!1,path:o,error:`Invalid JSON in ${o}: ${a.message}`}}let i=v(g);try{await r(i)}catch(a){return{success:!1,path:o,error:`Mutator threw: ${a.message}`}}if(n){let a=$(i),l=m.safeParse(a);if(!l.success){let k=l.error.issues.map(y=>` ${y.path.join(".")||"<root>"}: ${y.message}`).join(`
1
+ import{l as m,m as $,q as x}from"./chunk-U4H35SJS.js";x();import{readFileSync as S,writeFileSync as P,existsSync as b}from"fs";import{resolve as f}from"path";function w(r){if(r)return f(r);let e=[f(process.cwd(),"agentx.json"),f(process.cwd(),".agentx/config.json")];for(let n of e)if(b(n))return n;return e[0]}function v(r){return JSON.parse(JSON.stringify(r))}async function O(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/reload`,{method:"POST",signal:AbortSignal.timeout(3e3)});return e.ok?{ok:!0}:{ok:!1,reason:`HTTP ${e.status}`}}catch(e){return{ok:!1,reason:e?.cause?.code||e?.message||"unreachable"}}}async function J(r,e={}){let{validate:n=!0,dryRun:t=!1,reload:s=!0,configPath:u,daemonUrl:c}=e,o=w(u);if(!b(o))return{success:!1,path:o,error:`Config not found at ${o}. Run \`agentx init\` first.`};let d;try{d=S(o,"utf-8")}catch(a){return{success:!1,path:o,error:`Cannot read ${o}: ${a.message}`}}let g;try{g=JSON.parse(d)}catch(a){return{success:!1,path:o,error:`Invalid JSON in ${o}: ${a.message}`}}let i=v(g);try{await r(i)}catch(a){return{success:!1,path:o,error:`Mutator threw: ${a.message}`}}if(n){let a=$(i),l=m.safeParse(a);if(!l.success){let k=l.error.issues.map(y=>` ${y.path.join(".")||"<root>"}: ${y.message}`).join(`
2
2
  `);return{success:!1,path:o,error:`Validation failed:
3
3
  ${k}`,after:i}}}if(t)return{success:!0,path:o,after:i,dryRun:!0};try{P(o,JSON.stringify(i,null,2)+`
4
4
  `)}catch(a){return{success:!1,path:o,error:`Write failed: ${a.message}`,after:i}}let p=!1,h;if(s){let a=c||R(i),l=await O(a);l.ok?p=!0:h=l.reason}return{success:!0,path:o,after:i,reloaded:p,reloadSkipped:h}}function R(r){let e=r?.node?.bind;if(!e)return"http://127.0.0.1:18800";let[n,t]=e.split(":");return`http://${n==="0.0.0.0"||n==="::"?"127.0.0.1":n}:${t}`}function N(r,e,n){let t=e.split("."),s=r;for(let u=0;u<t.length-1;u++){let c=t[u];(s[c]===void 0||s[c]===null)&&(s[c]={}),s=s[c]}s[t[t.length-1]]=n}function j(r,e){let n=e.split("."),t=r;for(let s of n){if(t==null)return;t=t[s]}return t}function A(r,e){let n=e.split("."),t=r;for(let s=0;s<n.length-1;s++){if(t==null)return;t=t[n[s]]}t!=null&&delete t[n[n.length-1]]}export{w as a,J as b,N as c,j as d,A as e};
5
- //# sourceMappingURL=chunk-4HNHHKJF.js.map
5
+ //# sourceMappingURL=chunk-EZN2YXRY.js.map
@@ -1,4 +1,4 @@
1
- import{a as R,b as j,c as O,d as W,e as D}from"./chunk-TFVUOC2C.js";import{b as C}from"./chunk-2GIDVZ4H.js";import{v,w as Q}from"./chunk-37EABIOJ.js";import{b as $,c as M}from"./chunk-QOYAX2FT.js";import{readFileSync as T,existsSync as _}from"fs";Q();import{resolve as b}from"path";import{execSync as Y}from"child_process";async function V(n,i,s,e={}){let d=e.selectorModel??"haiku",a=e.synthModel??"sonnet",c=e.maxCandidates??3,l=e.maxHops??2,r=e.maxArticles??8,p=e.timeoutMs??6e4,u=e.log??console.error.bind(console,"[wiki-query]"),h=b(i.baseDir,"_index.md");if(!_(h))return w("no-catalog",n,"No _index.md found \u2014 run `agentx wiki status` to rebuild.");let k=T(h,"utf-8"),t=Date.now(),g=[],m="";try{let o=await B(n,i,s,c);o?(g=o,m=`[wiki-rerank seat] ${o.map(y=>y.title).join(" | ")}`):(m=await N(I(n,k,c),d,p),g=F(m))}catch(o){return u("selector failed:",o?.message),{...w("error",n,`Selector: ${o?.message||"unknown"}`),trace:{selectorMs:Date.now()-t,synthesisMs:0,selectorOutput:m}}}let A=Date.now()-t;if(g.length===0)return{...w("no-candidates",n,"Selector returned no candidates."),trace:{selectorMs:A,synthesisMs:0,selectorOutput:m}};let f=E(g,i,s,l,r);if(f.length===0)return{...w("no-candidates",n,"Candidates did not resolve to readable articles."),candidates:g,trace:{selectorMs:A,synthesisMs:0,selectorOutput:m}};let S=Date.now(),x="";try{x=await N(L(n,f),a,p*2)}catch(o){return u("synthesis failed:",o?.message),{...w("error",n,`Synthesis: ${o?.message||"unknown"}`),candidates:g,walked:f.map(y=>({title:y.meta.title,path:y.path,type:y.meta.type,hop:y.hop??0})),trace:{selectorMs:A,synthesisMs:Date.now()-S,selectorOutput:m}}}let P=Date.now()-S;return{answer:x.trim(),citations:f.map(o=>({title:o.meta.title,path:o.path,type:o.meta.type})),candidates:g,walked:f.map(o=>({title:o.meta.title,path:o.path,type:o.meta.type,hop:o.hop??0})),status:"ok",trace:{selectorMs:A,synthesisMs:P,selectorOutput:m}}}function w(n,i,s){return{answer:"",citations:[],candidates:[],walked:[],status:n,error:s}}function E(n,i,s,e,d){let a=new Map;for(let r of i.listArticles(s||""))a.set(r.meta.title.toLowerCase(),r.path);let c=new Map,l=[];for(let r of n)c.has(r.path)||l.push({path:r.path,hop:0});for(;l.length&&c.size<d;){let r=l.shift();if(c.has(r.path)||r.hop>e)continue;let p=s?i.readArticleAs(r.path,s):i.readArticle(r.path);if(p&&(c.set(r.path,{...p,hop:r.hop}),!(r.hop>=e)))for(let u of p.meta.related||[]){let h=a.get(u.toLowerCase());h&&!c.has(h)&&l.push({path:h,hop:r.hop+1})}}return Array.from(c.values())}async function B(n,i,s,e){try{let a=(i.rebuildIndex().articles??[]).filter(t=>t.path&&!t.path.includes("/_versions/"));if(a.length<2)return null;let c=a.map(t=>[t.title,(t.tags??[]).join(" "),(t.related??[]).join(" ")].join(" ")),l=M(n,$(c)).map(t=>t.docIndex);for(let t=0;t<a.length;t++)l.includes(t)||l.push(t);let p=l.slice(0,j).map(t=>({id:`k${t}`,title:a[t].title||a[t].path,tags:a[t].tags,excerpt:[a[t].type?`type: ${a[t].type}`:"",(a[t].related??[]).length?`related: ${(a[t].related??[]).join(", ")}`:""].filter(Boolean).join(" \xB7 ")})),u=await v(R,O({query:n,candidates:p,excerptChars:300}),W(p),{features:{agent:s??"unknown",stage:"catalog-selector"}});if(!u||u.mode!=="active")return null;let k=D(u.answers,p).ranked.slice(0,e).map(t=>a[Number(t.slice(1))]).filter(Boolean).map(t=>({title:t.title,path:t.path}));return k.length>0?k:null}catch{return null}}function I(n,i,s){return`You are picking candidate articles from a wiki catalog to answer a question. You do NOT answer the question. You pick which articles the answer is likely to come from.
1
+ import{a as R,b as j,c as O,d as W,e as D}from"./chunk-TFVUOC2C.js";import{b as C}from"./chunk-2GIDVZ4H.js";import{v,w as Q}from"./chunk-M4AG2YNX.js";import{b as $,c as M}from"./chunk-QOYAX2FT.js";import{readFileSync as T,existsSync as _}from"fs";Q();import{resolve as b}from"path";import{execSync as Y}from"child_process";async function V(n,i,s,e={}){let d=e.selectorModel??"haiku",a=e.synthModel??"sonnet",c=e.maxCandidates??3,l=e.maxHops??2,r=e.maxArticles??8,p=e.timeoutMs??6e4,u=e.log??console.error.bind(console,"[wiki-query]"),h=b(i.baseDir,"_index.md");if(!_(h))return w("no-catalog",n,"No _index.md found \u2014 run `agentx wiki status` to rebuild.");let k=T(h,"utf-8"),t=Date.now(),g=[],m="";try{let o=await B(n,i,s,c);o?(g=o,m=`[wiki-rerank seat] ${o.map(y=>y.title).join(" | ")}`):(m=await N(I(n,k,c),d,p),g=F(m))}catch(o){return u("selector failed:",o?.message),{...w("error",n,`Selector: ${o?.message||"unknown"}`),trace:{selectorMs:Date.now()-t,synthesisMs:0,selectorOutput:m}}}let A=Date.now()-t;if(g.length===0)return{...w("no-candidates",n,"Selector returned no candidates."),trace:{selectorMs:A,synthesisMs:0,selectorOutput:m}};let f=E(g,i,s,l,r);if(f.length===0)return{...w("no-candidates",n,"Candidates did not resolve to readable articles."),candidates:g,trace:{selectorMs:A,synthesisMs:0,selectorOutput:m}};let S=Date.now(),x="";try{x=await N(L(n,f),a,p*2)}catch(o){return u("synthesis failed:",o?.message),{...w("error",n,`Synthesis: ${o?.message||"unknown"}`),candidates:g,walked:f.map(y=>({title:y.meta.title,path:y.path,type:y.meta.type,hop:y.hop??0})),trace:{selectorMs:A,synthesisMs:Date.now()-S,selectorOutput:m}}}let P=Date.now()-S;return{answer:x.trim(),citations:f.map(o=>({title:o.meta.title,path:o.path,type:o.meta.type})),candidates:g,walked:f.map(o=>({title:o.meta.title,path:o.path,type:o.meta.type,hop:o.hop??0})),status:"ok",trace:{selectorMs:A,synthesisMs:P,selectorOutput:m}}}function w(n,i,s){return{answer:"",citations:[],candidates:[],walked:[],status:n,error:s}}function E(n,i,s,e,d){let a=new Map;for(let r of i.listArticles(s||""))a.set(r.meta.title.toLowerCase(),r.path);let c=new Map,l=[];for(let r of n)c.has(r.path)||l.push({path:r.path,hop:0});for(;l.length&&c.size<d;){let r=l.shift();if(c.has(r.path)||r.hop>e)continue;let p=s?i.readArticleAs(r.path,s):i.readArticle(r.path);if(p&&(c.set(r.path,{...p,hop:r.hop}),!(r.hop>=e)))for(let u of p.meta.related||[]){let h=a.get(u.toLowerCase());h&&!c.has(h)&&l.push({path:h,hop:r.hop+1})}}return Array.from(c.values())}async function B(n,i,s,e){try{let a=(i.rebuildIndex().articles??[]).filter(t=>t.path&&!t.path.includes("/_versions/"));if(a.length<2)return null;let c=a.map(t=>[t.title,(t.tags??[]).join(" "),(t.related??[]).join(" ")].join(" ")),l=M(n,$(c)).map(t=>t.docIndex);for(let t=0;t<a.length;t++)l.includes(t)||l.push(t);let p=l.slice(0,j).map(t=>({id:`k${t}`,title:a[t].title||a[t].path,tags:a[t].tags,excerpt:[a[t].type?`type: ${a[t].type}`:"",(a[t].related??[]).length?`related: ${(a[t].related??[]).join(", ")}`:""].filter(Boolean).join(" \xB7 ")})),u=await v(R,O({query:n,candidates:p,excerptChars:300}),W(p),{features:{agent:s??"unknown",stage:"catalog-selector"}});if(!u||u.mode!=="active")return null;let k=D(u.answers,p).ranked.slice(0,e).map(t=>a[Number(t.slice(1))]).filter(Boolean).map(t=>({title:t.title,path:t.path}));return k.length>0?k:null}catch{return null}}function I(n,i,s){return`You are picking candidate articles from a wiki catalog to answer a question. You do NOT answer the question. You pick which articles the answer is likely to come from.
2
2
 
3
3
  ## Question
4
4
 
@@ -42,4 +42,4 @@ ${s}
42
42
  Answer the question in 2\u20136 sentences. Cite articles by their title in square brackets like [Article Title]. If the articles do not answer the question, say so plainly (do not invent). Prefer concrete facts over hedging.
43
43
 
44
44
  Output ONLY the answer \u2014 no preamble, no "here is my answer:", no markdown fencing.`}function F(n){let i=n.match(/\[[\s\S]*?\]/);if(!i)return[];try{let s=JSON.parse(i[0]);return Array.isArray(s)?s.filter(e=>e&&typeof e.title=="string"&&typeof e.path=="string").map(e=>({title:e.title,path:e.path})):[]}catch{return[]}}async function N(n,i,s){let{writeFileSync:e,mkdirSync:d,rmSync:a}=await import("fs"),{tmpdir:c}=await import("os"),l=b(c(),`agentx-wiki-query-${process.pid}`);d(l,{recursive:!0});let r=b(l,`prompt-${Date.now()}.txt`);e(r,n);try{let p=`cat '${r}' | claude -p - --output-format json --max-turns 1 --model ${i} --disallowedTools "Bash Read Write Edit Glob Grep Agent WebSearch WebFetch NotebookEdit"`,u=Y(p,{env:C({...process.env}),encoding:"utf-8",timeout:s,maxBuffer:4*1024*1024});try{let h=JSON.parse(u);return String(h.result||h.content||"")}catch{return u}}finally{try{a(r,{force:!0})}catch{}}}export{V as a};
45
- //# sourceMappingURL=chunk-BKDUCPZ3.js.map
45
+ //# sourceMappingURL=chunk-GSOL2LW6.js.map