agentix-cli 0.172.0 → 0.173.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 (155) hide show
  1. package/README.md +2 -2
  2. package/dist/{App-56QIEQGH.js → App-2LXSOVIN.js} +2 -2
  3. package/dist/{ChatApp-JNWIXMDN.js → ChatApp-4TRWF5SI.js} +2 -2
  4. package/dist/{absorb-eval-BYYFZJCC.js → absorb-eval-TF3OMPHG.js} +2 -2
  5. package/dist/{adapter-YQ37MDPV.js → adapter-WSN6XAKV.js} +2 -2
  6. package/dist/{agent-4637FJMD.js → agent-IQUF5TDP.js} +2 -2
  7. package/dist/{board-dashboard-DJKRLABN.js → board-dashboard-6VWNYJZ7.js} +469 -347
  8. package/dist/board-dashboard-6VWNYJZ7.js.map +1 -0
  9. package/dist/{chunk-SP7VFTXO.js → chunk-22SO5H73.js} +2 -2
  10. package/dist/{chunk-NR5IZJYS.js → chunk-5EI44WB7.js} +2 -2
  11. package/dist/{chunk-YLQZFV6Y.js → chunk-6W5262KN.js} +2 -2
  12. package/dist/chunk-AJ5HMDRW.js +11 -0
  13. package/dist/chunk-AJ5HMDRW.js.map +1 -0
  14. package/dist/{chunk-PD5BZYBO.js → chunk-B6JE7TKU.js} +2 -2
  15. package/dist/{chunk-AQGQLVCD.js → chunk-E6BIV3EM.js} +2 -2
  16. package/dist/{chunk-NGGEGY5K.js → chunk-EJQHTD5U.js} +16 -16
  17. package/dist/chunk-EJQHTD5U.js.map +1 -0
  18. package/dist/{chunk-VD2P4GWU.js → chunk-FRR6DRLY.js} +2 -2
  19. package/dist/{chunk-35I76HQS.js → chunk-GIPEXI3C.js} +2 -2
  20. package/dist/{chunk-FOTAGQEL.js → chunk-HXINT6DB.js} +2 -2
  21. package/dist/{chunk-KE3KLMMK.js → chunk-IC5CL2DW.js} +2 -2
  22. package/dist/{chunk-7FGJOVML.js → chunk-KAVZPYK4.js} +2 -2
  23. package/dist/{chunk-XCYGF4RB.js → chunk-KN2IZ6C3.js} +2 -2
  24. package/dist/{chunk-GALI5ANI.js → chunk-KUMCHMGE.js} +3 -3
  25. package/dist/{chunk-5KVTIFRY.js → chunk-NWKTI6AZ.js} +2 -2
  26. package/dist/{chunk-MH55YCUS.js → chunk-O2ZDYZXI.js} +97 -97
  27. package/dist/chunk-O2ZDYZXI.js.map +1 -0
  28. package/dist/{chunk-I7EO2WXC.js → chunk-QJPLPN3G.js} +2 -2
  29. package/dist/{chunk-HZXLZIB4.js → chunk-RY2YN3WA.js} +2 -2
  30. package/dist/{chunk-IPHFWU2F.js → chunk-SP2JS67T.js} +2 -2
  31. package/dist/{chunk-ES236GV6.js → chunk-T3V4CUOO.js} +2 -2
  32. package/dist/{chunk-2BJ7NIGG.js → chunk-TB752ZN4.js} +2 -2
  33. package/dist/{chunk-35R7Y7BT.js → chunk-UG6S2QED.js} +2 -2
  34. package/dist/{chunk-WO4XKOMM.js → chunk-VAH526K6.js} +2 -2
  35. package/dist/{chunk-MY7C6E4Y.js → chunk-VNOTN6N5.js} +2 -2
  36. package/dist/chunk-VQRY4IDI.js +4 -0
  37. package/dist/chunk-VQRY4IDI.js.map +1 -0
  38. package/dist/{chunk-LB55Q3K4.js → chunk-WMQBY45T.js} +2 -2
  39. package/dist/{chunk-TB3ZEMTC.js → chunk-WS2F726P.js} +2 -2
  40. package/dist/{chunk-WVPFWUR2.js → chunk-Z37662LA.js} +2 -2
  41. package/dist/{chunk-7NA5VSQE.js → chunk-Z73KECFS.js} +277 -273
  42. package/dist/chunk-Z73KECFS.js.map +1 -0
  43. package/dist/{chunk-XUT4RBU6.js → chunk-ZRHDAJS5.js} +2 -2
  44. package/dist/{chunk-TAUXWIYB.js → chunk-ZZR34W4V.js} +2 -2
  45. package/dist/cli.js +1 -1
  46. package/dist/client-Y63KZEDJ.js +2 -0
  47. package/dist/{config-IBOY7BGF.js → config-GPCTV4AD.js} +2 -2
  48. package/dist/config-mutate-S56W3EGU.js +2 -0
  49. package/dist/config-mutator-G2MEPNGH.js +2 -0
  50. package/dist/{contributions-NQ3OQ4O4.js → contributions-LK72ZY6S.js} +2 -2
  51. package/dist/{doctor-AMX2GRRN.js → doctor-DL7MBZXQ.js} +2 -2
  52. package/dist/{follow-up-tool-3XSPNZKM.js → follow-up-tool-CTP5XACV.js} +2 -2
  53. package/dist/{grants-4O2VF2YX.js → grants-Z332LOTO.js} +2 -2
  54. package/dist/hub-WRXWDBUZ.js +2 -0
  55. package/dist/index.d.ts +107 -55
  56. package/dist/index.js +1 -1
  57. package/dist/{note-tool-EZWSB3J3.js → note-tool-ANQWBBZE.js} +2 -2
  58. package/dist/{program-XKQTHEQ3.js → program-5CHM6EPW.js} +98 -98
  59. package/dist/program-5CHM6EPW.js.map +1 -0
  60. package/dist/{promote-4F2H3WEB.js → promote-B2QIPGIF.js} +2 -2
  61. package/dist/{query-25FU55U6.js → query-KMRMTYL6.js} +2 -2
  62. package/dist/{query-settings-5BLTPQQQ.js → query-settings-M3HVXUMQ.js} +2 -2
  63. package/dist/{registry-GROEORK6.js → registry-VQCSFMIJ.js} +2 -2
  64. package/dist/{request-planner-7JLFVL6Y.js → request-planner-HGGCC3VR.js} +2 -2
  65. package/dist/{review-candidates-MHIKLDT7.js → review-candidates-OR3GP2SU.js} +2 -2
  66. package/dist/routing-47DKYUQW.js +2 -0
  67. package/dist/schedule-tool-LENFAYB6.js +2 -0
  68. package/dist/scheduler-KL4R5UPC.js +2 -0
  69. package/dist/{seat-WUEQNCSG.js → seat-FFDCUGCG.js} +2 -2
  70. package/dist/{select-ASFYQYDU.js → select-BDZ44G5B.js} +2 -2
  71. package/dist/{set-enabled-6NIDVEZF.js → set-enabled-CX7AOZAU.js} +2 -2
  72. package/dist/{sprint-tool-APMWCQF3.js → sprint-tool-25JPVUH2.js} +2 -2
  73. package/dist/{tool-MKUGBNSW.js → tool-CMFZK2HQ.js} +2 -2
  74. package/dist/{tool-2CKQKDU5.js → tool-CZCY6ZBQ.js} +2 -2
  75. package/dist/{tool-JPSOIPZZ.js → tool-VMTEK3DF.js} +2 -2
  76. package/dist/wiki-LMVIRMSR.js +2 -0
  77. package/dist/wiki-enrich-JS6WC6ER.js +2 -0
  78. package/package.json +1 -1
  79. package/dist/board-dashboard-DJKRLABN.js.map +0 -1
  80. package/dist/chunk-7NA5VSQE.js.map +0 -1
  81. package/dist/chunk-GZIHLADX.js +0 -4
  82. package/dist/chunk-GZIHLADX.js.map +0 -1
  83. package/dist/chunk-MH55YCUS.js.map +0 -1
  84. package/dist/chunk-NGGEGY5K.js.map +0 -1
  85. package/dist/chunk-PYHR4HXO.js +0 -11
  86. package/dist/chunk-PYHR4HXO.js.map +0 -1
  87. package/dist/client-LP4PURY2.js +0 -2
  88. package/dist/config-mutate-PETOQADF.js +0 -2
  89. package/dist/config-mutator-2NLZ37LL.js +0 -2
  90. package/dist/hub-DRCMPJMQ.js +0 -2
  91. package/dist/program-XKQTHEQ3.js.map +0 -1
  92. package/dist/routing-ZSGWR6ID.js +0 -2
  93. package/dist/schedule-tool-2VI5IWZD.js +0 -2
  94. package/dist/scheduler-J6BGTTMH.js +0 -2
  95. package/dist/wiki-JR6U5PSV.js +0 -2
  96. package/dist/wiki-enrich-KFVPA2JG.js +0 -2
  97. /package/dist/{App-56QIEQGH.js.map → App-2LXSOVIN.js.map} +0 -0
  98. /package/dist/{ChatApp-JNWIXMDN.js.map → ChatApp-4TRWF5SI.js.map} +0 -0
  99. /package/dist/{absorb-eval-BYYFZJCC.js.map → absorb-eval-TF3OMPHG.js.map} +0 -0
  100. /package/dist/{adapter-YQ37MDPV.js.map → adapter-WSN6XAKV.js.map} +0 -0
  101. /package/dist/{agent-4637FJMD.js.map → agent-IQUF5TDP.js.map} +0 -0
  102. /package/dist/{chunk-SP7VFTXO.js.map → chunk-22SO5H73.js.map} +0 -0
  103. /package/dist/{chunk-NR5IZJYS.js.map → chunk-5EI44WB7.js.map} +0 -0
  104. /package/dist/{chunk-YLQZFV6Y.js.map → chunk-6W5262KN.js.map} +0 -0
  105. /package/dist/{chunk-PD5BZYBO.js.map → chunk-B6JE7TKU.js.map} +0 -0
  106. /package/dist/{chunk-AQGQLVCD.js.map → chunk-E6BIV3EM.js.map} +0 -0
  107. /package/dist/{chunk-VD2P4GWU.js.map → chunk-FRR6DRLY.js.map} +0 -0
  108. /package/dist/{chunk-35I76HQS.js.map → chunk-GIPEXI3C.js.map} +0 -0
  109. /package/dist/{chunk-FOTAGQEL.js.map → chunk-HXINT6DB.js.map} +0 -0
  110. /package/dist/{chunk-KE3KLMMK.js.map → chunk-IC5CL2DW.js.map} +0 -0
  111. /package/dist/{chunk-7FGJOVML.js.map → chunk-KAVZPYK4.js.map} +0 -0
  112. /package/dist/{chunk-XCYGF4RB.js.map → chunk-KN2IZ6C3.js.map} +0 -0
  113. /package/dist/{chunk-GALI5ANI.js.map → chunk-KUMCHMGE.js.map} +0 -0
  114. /package/dist/{chunk-5KVTIFRY.js.map → chunk-NWKTI6AZ.js.map} +0 -0
  115. /package/dist/{chunk-I7EO2WXC.js.map → chunk-QJPLPN3G.js.map} +0 -0
  116. /package/dist/{chunk-HZXLZIB4.js.map → chunk-RY2YN3WA.js.map} +0 -0
  117. /package/dist/{chunk-IPHFWU2F.js.map → chunk-SP2JS67T.js.map} +0 -0
  118. /package/dist/{chunk-ES236GV6.js.map → chunk-T3V4CUOO.js.map} +0 -0
  119. /package/dist/{chunk-2BJ7NIGG.js.map → chunk-TB752ZN4.js.map} +0 -0
  120. /package/dist/{chunk-35R7Y7BT.js.map → chunk-UG6S2QED.js.map} +0 -0
  121. /package/dist/{chunk-WO4XKOMM.js.map → chunk-VAH526K6.js.map} +0 -0
  122. /package/dist/{chunk-MY7C6E4Y.js.map → chunk-VNOTN6N5.js.map} +0 -0
  123. /package/dist/{chunk-LB55Q3K4.js.map → chunk-WMQBY45T.js.map} +0 -0
  124. /package/dist/{chunk-TB3ZEMTC.js.map → chunk-WS2F726P.js.map} +0 -0
  125. /package/dist/{chunk-WVPFWUR2.js.map → chunk-Z37662LA.js.map} +0 -0
  126. /package/dist/{chunk-XUT4RBU6.js.map → chunk-ZRHDAJS5.js.map} +0 -0
  127. /package/dist/{chunk-TAUXWIYB.js.map → chunk-ZZR34W4V.js.map} +0 -0
  128. /package/dist/{client-LP4PURY2.js.map → client-Y63KZEDJ.js.map} +0 -0
  129. /package/dist/{config-IBOY7BGF.js.map → config-GPCTV4AD.js.map} +0 -0
  130. /package/dist/{config-mutate-PETOQADF.js.map → config-mutate-S56W3EGU.js.map} +0 -0
  131. /package/dist/{config-mutator-2NLZ37LL.js.map → config-mutator-G2MEPNGH.js.map} +0 -0
  132. /package/dist/{contributions-NQ3OQ4O4.js.map → contributions-LK72ZY6S.js.map} +0 -0
  133. /package/dist/{doctor-AMX2GRRN.js.map → doctor-DL7MBZXQ.js.map} +0 -0
  134. /package/dist/{follow-up-tool-3XSPNZKM.js.map → follow-up-tool-CTP5XACV.js.map} +0 -0
  135. /package/dist/{grants-4O2VF2YX.js.map → grants-Z332LOTO.js.map} +0 -0
  136. /package/dist/{hub-DRCMPJMQ.js.map → hub-WRXWDBUZ.js.map} +0 -0
  137. /package/dist/{note-tool-EZWSB3J3.js.map → note-tool-ANQWBBZE.js.map} +0 -0
  138. /package/dist/{promote-4F2H3WEB.js.map → promote-B2QIPGIF.js.map} +0 -0
  139. /package/dist/{query-25FU55U6.js.map → query-KMRMTYL6.js.map} +0 -0
  140. /package/dist/{query-settings-5BLTPQQQ.js.map → query-settings-M3HVXUMQ.js.map} +0 -0
  141. /package/dist/{registry-GROEORK6.js.map → registry-VQCSFMIJ.js.map} +0 -0
  142. /package/dist/{request-planner-7JLFVL6Y.js.map → request-planner-HGGCC3VR.js.map} +0 -0
  143. /package/dist/{review-candidates-MHIKLDT7.js.map → review-candidates-OR3GP2SU.js.map} +0 -0
  144. /package/dist/{routing-ZSGWR6ID.js.map → routing-47DKYUQW.js.map} +0 -0
  145. /package/dist/{schedule-tool-2VI5IWZD.js.map → schedule-tool-LENFAYB6.js.map} +0 -0
  146. /package/dist/{scheduler-J6BGTTMH.js.map → scheduler-KL4R5UPC.js.map} +0 -0
  147. /package/dist/{seat-WUEQNCSG.js.map → seat-FFDCUGCG.js.map} +0 -0
  148. /package/dist/{select-ASFYQYDU.js.map → select-BDZ44G5B.js.map} +0 -0
  149. /package/dist/{set-enabled-6NIDVEZF.js.map → set-enabled-CX7AOZAU.js.map} +0 -0
  150. /package/dist/{sprint-tool-APMWCQF3.js.map → sprint-tool-25JPVUH2.js.map} +0 -0
  151. /package/dist/{tool-MKUGBNSW.js.map → tool-CMFZK2HQ.js.map} +0 -0
  152. /package/dist/{tool-2CKQKDU5.js.map → tool-CZCY6ZBQ.js.map} +0 -0
  153. /package/dist/{tool-JPSOIPZZ.js.map → tool-VMTEK3DF.js.map} +0 -0
  154. /package/dist/{wiki-JR6U5PSV.js.map → wiki-LMVIRMSR.js.map} +0 -0
  155. /package/dist/{wiki-enrich-KFVPA2JG.js.map → wiki-enrich-JS6WC6ER.js.map} +0 -0
@@ -1,7 +1,7 @@
1
- import{B as N,D as k,F as O,I,s as R,v as x}from"./chunk-TAUXWIYB.js";import{a as E}from"./chunk-OSH2PEBH.js";import{mb as j,vb as F}from"./chunk-NGGEGY5K.js";F();import{Command as X}from"commander";import f from"chalk";import{execFileSync as m}from"child_process";import{accessSync as W,constants as M,existsSync as w,readFileSync as b,readdirSync as C,statSync as B}from"fs";import{join as H,resolve as y}from"path";import{homedir as z}from"os";import{createRequire as G}from"module";var T="Open System Settings \u203A Notifications \u203A AgentX Helper, turn on Allow notifications and choose Banners.";async function P(t={}){let n=t.helper===void 0?N():t.helper,e=k({},{platform:t.platform,io:{capture:t.run,helper:n}}).banner;if(!e)return{state:"unsupported",message:"Desktop banners are only shown on a Mac."};let i=await e.status();return i==="missing"?{state:"missing",message:"AgentX Helper is not installed, so banners come from Script Editor and show its icon.",fix:'Run agentx desktop install, then run agentx notify "Hello" --title "Test" and click Allow.'}:i==="outdated"?{state:"outdated",path:n,message:"AgentX Helper is too old to report whether it may notify.",fix:"Run agentx desktop install to update it."}:i==="not-asked"?{state:"not-asked",path:n,message:"macOS has not asked yet whether AgentX Helper may notify; banners show the Script Editor icon until it does.",fix:'Run agentx notify "Hello" --title "Test" and click Allow when macOS asks.'}:i==="not-allowed"?{state:"not-allowed",path:n,message:"macOS does not allow AgentX Helper to notify, so banners show the Script Editor icon.",fix:T}:i==="hidden"?{state:"hidden",path:n,message:"AgentX Helper may notify, but its banner style is None, so nothing appears on screen.",fix:T}:{state:"ready",path:n,message:"AgentX Helper posts banners with the AgentX icon."}}async function Z(t={}){let n=[];await Q(n),Y(n);let e=ee(n);return e&&te(n,e),e&&se(n,e),e&&re(n,e),e&&ae(n,e),e&&ie(n,e),e&&ce(n,e),e&&await J(n,e),e&&U(n,e),e&&await K(n,e),e&&V(n,e),t.running!==!1&&e&&await de(n,e),{checks:n,summary:D(n)}}var Ne=new X().name("doctor").description("pre-flight health check: Node, config, credentials, daemon").option("--no-running","skip the live daemon probe").option("--json","emit machine-readable JSON (stable shape for CI)").action(async t=>{let{checks:n,summary:e}=await Z({running:t.running!==!1});t.json?process.stdout.write(JSON.stringify({checks:n,summary:e},null,2)+`
1
+ import{B as N,D as k,F as O,I,s as R,v as x}from"./chunk-ZZR34W4V.js";import{a as E}from"./chunk-OSH2PEBH.js";import{ob as j,xb as F}from"./chunk-EJQHTD5U.js";F();import{Command as X}from"commander";import f from"chalk";import{execFileSync as m}from"child_process";import{accessSync as W,constants as M,existsSync as w,readFileSync as b,readdirSync as C,statSync as B}from"fs";import{join as H,resolve as y}from"path";import{homedir as z}from"os";import{createRequire as G}from"module";var T="Open System Settings \u203A Notifications \u203A AgentX Helper, turn on Allow notifications and choose Banners.";async function P(t={}){let n=t.helper===void 0?N():t.helper,e=k({},{platform:t.platform,io:{capture:t.run,helper:n}}).banner;if(!e)return{state:"unsupported",message:"Desktop banners are only shown on a Mac."};let i=await e.status();return i==="missing"?{state:"missing",message:"AgentX Helper is not installed, so banners come from Script Editor and show its icon.",fix:'Run agentx desktop install, then run agentx notify "Hello" --title "Test" and click Allow.'}:i==="outdated"?{state:"outdated",path:n,message:"AgentX Helper is too old to report whether it may notify.",fix:"Run agentx desktop install to update it."}:i==="not-asked"?{state:"not-asked",path:n,message:"macOS has not asked yet whether AgentX Helper may notify; banners show the Script Editor icon until it does.",fix:'Run agentx notify "Hello" --title "Test" and click Allow when macOS asks.'}:i==="not-allowed"?{state:"not-allowed",path:n,message:"macOS does not allow AgentX Helper to notify, so banners show the Script Editor icon.",fix:T}:i==="hidden"?{state:"hidden",path:n,message:"AgentX Helper may notify, but its banner style is None, so nothing appears on screen.",fix:T}:{state:"ready",path:n,message:"AgentX Helper posts banners with the AgentX icon."}}async function Z(t={}){let n=[];await Q(n),Y(n);let e=ee(n);return e&&te(n,e),e&&se(n,e),e&&re(n,e),e&&ae(n,e),e&&ie(n,e),e&&ce(n,e),e&&await J(n,e),e&&U(n,e),e&&await K(n,e),e&&V(n,e),t.running!==!1&&e&&await de(n,e),{checks:n,summary:D(n)}}var Ne=new X().name("doctor").description("pre-flight health check: Node, config, credentials, daemon").option("--no-running","skip the live daemon probe").option("--json","emit machine-readable JSON (stable shape for CI)").action(async t=>{let{checks:n,summary:e}=await Z({running:t.running!==!1});t.json?process.stdout.write(JSON.stringify({checks:n,summary:e},null,2)+`
2
2
  `):ue(n),process.exit(e.errors>0?1:0)});async function J(t,n,e=P){if(!O(n.notifications?.local).banner)return;let i=await e();i.state!=="unsupported"&&t.push({severity:i.state==="ready"?"ok":"warn",group:"Notifications",title:i.message,detail:i.path,fix:i.fix})}async function K(t,n,e){let i;try{i=await(e??k(n)).describe()}catch(s){t.push({severity:"warn",group:"Native",title:"Native apps: could not be read",detail:s?.message??String(s)});return}let o=["tasks","notes","banner","sound","focus"].filter(s=>i[s]);t.push({severity:"ok",group:"Native",title:i.os==="none"?"Native apps: none on this machine":`Native apps (${i.os}): ${o.join(", ")||"nothing available"}`,detail:i.problems.join(" ")||void 0})}function V(t,n,e=process.cwd(),i=k(n)){let o=n.native?.mirror;if(!o?.enabled)return;if(!i.tasks){t.push({severity:"warn",group:"Native",title:"Reminders mirror is on, but this machine has no task app",detail:"native.mirror.enabled is set; nothing is mirrored here.",fix:"Turn it on on the machine that holds the owner's cards (the Mac), or set native.mirror.enabled to false here."});return}let s=I(e),a=Object.values(s.items),l=a.filter(g=>g.state==="open").length,u=a.filter(g=>g.state==="failed").length;t.push({severity:s.lastError||u?"warn":"ok",group:"Native",title:`Reminders mirror: ${l} open in "${o.list}"${u?`, ${u} could not be added`:""}`,detail:s.lastError?`Last error ${s.lastError.at}: ${s.lastError.message}`:void 0,fix:s.lastError?"Run remindctl status, and allow Reminders for the app that runs the daemon in System Settings \u203A Privacy & Security \u203A Reminders.":void 0})}function U(t,n,e=process.platform,i=o=>{try{return W(o,M.X_OK),!0}catch{return!1}}){let o=n.reminders;if(!o?.enabled)return;if(e!=="darwin"){t.push({severity:"warn",group:"Reminders",title:"Reminders hand-back unavailable on this machine",detail:"reminders.enabled is set, but Apple Reminders exists only on macOS. The daemon starts without it.",fix:"Set reminders.enabled to false here, or enable it on the Mac node instead."});return}let s=o.command||"remindctl",a=s.includes("/")?i(s)?s:null:x(s,process.env.PATH||"",i);t.push(a?{severity:"ok",group:"Reminders",title:`Watching ${(o.lists||[]).join(", ")} for due reminders`,detail:a}:{severity:"fail",group:"Reminders",title:`${s} not found`,detail:"The daemon reads Apple Reminders through remindctl.",fix:"brew install steipete/tap/remindctl, or set reminders.command to its full path."})}async function Q(t){let n=E(process.versions.node);t.push({severity:n?"ok":"fail",group:"Environment",title:`Node.js ${process.versions.node}`,detail:n?void 0:"AgentX requires Node 22.19 or newer, up to Node 26.",fix:n?void 0:"Install Node 22 (nvm install 22 && nvm use 22)"});let e=l=>{try{return m(process.platform==="win32"?"where":"which",[l],{encoding:"utf-8"}).trim().split(`
3
3
  `)[0]}catch{return null}},i=e("npm");t.push({severity:i?"ok":"fail",group:"Environment",title:i?"npm on PATH":"npm not found",detail:i||void 0});let o=e("claude");if(o){let l;try{l=m("claude",["--version"],{encoding:"utf-8",timeout:3e3}).trim()}catch{}t.push({severity:"ok",group:"Environment",title:`claude CLI ${l||"installed"}`,detail:o})}else t.push({severity:"warn",group:"Environment",title:"claude CLI not on PATH",detail:"Only required for agents on the claude-code tier.",fix:"See https://docs.anthropic.com/en/docs/claude-code"});let s=e("codex");if(s){let l;try{l=m("codex",["--version"],{encoding:"utf-8",timeout:3e3}).trim()}catch{}t.push({severity:"ok",group:"Environment",title:`codex CLI ${l||"installed"}`,detail:s})}else t.push({severity:"warn",group:"Environment",title:"codex CLI not on PATH",detail:"Only required for agents on the codex-cli tier.",fix:"Install with `npm i -g @openai/codex`."});let a=e("opencode");if(a){let l;try{l=m("opencode",["--version"],{encoding:"utf-8",timeout:3e3}).trim()}catch{}t.push({severity:"ok",group:"Environment",title:`opencode CLI ${l||"installed"}`,detail:a})}else t.push({severity:"warn",group:"Environment",title:"opencode CLI not on PATH",detail:"Only required for agents on the opencode tier.",fix:"Install from https://opencode.ai/docs/."});try{G(import.meta.url)("better-sqlite3"),t.push({severity:"ok",group:"Environment",title:`better-sqlite3 loads for Node ${process.version}`,detail:`NODE_MODULE_VERSION ${process.versions.modules}`})}catch(l){t.push({severity:"fail",group:"Environment",title:"better-sqlite3 native binding does not load",detail:l?.message??String(l),fix:`Run "pnpm rebuild better-sqlite3" with the same Node used by the daemon (${process.version}, modules ${process.versions.modules}).`})}}function Y(t){if(process.platform!=="darwin")return;let n=H(z(),"Library/LaunchAgents"),e=[];try{e=C(n).filter(o=>/agentx\.voice.*\.plist$/.test(o))}catch{return}let i=o=>{try{return W(o,M.X_OK),!0}catch{return!1}};for(let o of e){let s=R(b(H(n,o),"utf-8")),a=x("ffmpeg",s,i);t.push(a?{severity:"ok",group:"Desktop",title:"ffmpeg reachable by the desktop app",detail:`${a} (${o})`}:{severity:"warn",group:"Desktop",title:"ffmpeg not reachable by the desktop app",detail:`Local Whisper transcription fails without it. ${o} sets PATH to ${s}.`,fix:"Install ffmpeg (brew install ffmpeg), then rerun agentx desktop install."})}}function ee(t){let n=y(process.cwd(),"agentx.json");if(!w(n))return t.push({severity:"fail",group:"Config",title:"agentx.json not found",detail:`Looked in ${n}`,fix:"Run `agentx setup` to create one via the web wizard."}),null;let e;try{e=JSON.parse(b(n,"utf-8"))}catch(a){return t.push({severity:"fail",group:"Config",title:"agentx.json is not valid JSON",detail:a.message}),null}try{j(n),t.push({severity:"ok",group:"Config",title:`agentx.json valid (${Object.keys(e.agents||{}).length} agents, ${Object.keys(e.crons||{}).length} schedules)`})}catch(a){t.push({severity:"fail",group:"Config",title:"agentx.json failed schema validation",detail:a.message,fix:"Open /admin \u2192 Advanced tab to edit and re-save."})}let i=Object.entries(e.agents||{}).filter(([,a])=>a.tier==="claude-code");i.length>0&&((()=>{try{return m(process.platform==="win32"?"where":"which",["claude"],{stdio:"ignore"}),!0}catch{return!1}})()||t.push({severity:"fail",group:"Config",title:`${i.length} agent(s) use claude-code tier but claude CLI is missing`,detail:i.map(([l])=>l).join(", "),fix:"Install Claude Code (https://docs.anthropic.com/en/docs/claude-code) or switch these agents to tier=sdk."}));let o=Object.entries(e.agents||{}).filter(([,a])=>a.tier==="codex-cli");o.length>0&&((()=>{try{return m(process.platform==="win32"?"where":"which",["codex"],{stdio:"ignore"}),!0}catch{return!1}})()||t.push({severity:"fail",group:"Config",title:`${o.length} agent(s) use codex-cli tier but codex CLI is missing`,detail:o.map(([l])=>l).join(", "),fix:"Install Codex CLI with `npm i -g @openai/codex` or switch these agents to tier=claude-code."}));let s=Object.entries(e.agents||{}).filter(([,a])=>a.tier==="opencode");return s.length>0&&((()=>{try{return m(process.platform==="win32"?"where":"which",["opencode"],{stdio:"ignore"}),!0}catch{return!1}})()||t.push({severity:"fail",group:"Config",title:`${s.length} agent(s) use opencode tier but OpenCode CLI is missing`,detail:s.map(([l])=>l).join(", "),fix:"Install OpenCode from https://opencode.ai/docs/ or switch these agents to another tier."})),e}function te(t,n){let e=new Set;if(A(n,e),e.size===0){t.push({severity:"ok",group:"Secrets",title:"No ${VAR} references in agentx.json"});return}let i=_(),o=[],s=[];for(let a of e){let l=process.env[a]??i[a];l===void 0?o.push(a):(!l.trim()||/^["']?\s*["']?$/.test(l))&&s.push(a)}o.length===0&&s.length===0?t.push({severity:"ok",group:"Secrets",title:`${e.size} env reference(s) resolved`}):(o.length>0&&t.push({severity:"fail",group:"Secrets",title:`${o.length} env var(s) referenced in agentx.json but missing`,detail:o.join(", "),fix:`Add to .env \u2014 e.g. ${o[0]}=<value>`}),s.length>0&&t.push({severity:"warn",group:"Secrets",title:`${s.length} env var(s) set but empty`,detail:s.join(", ")}))}function _(){let t=y(process.cwd(),".env"),n={};if(w(t))for(let e of b(t,"utf-8").split(/\r?\n/)){let i=e.match(/^\s*([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/i);i&&(n[i[1]]=i[2])}return n}function ne(t,n){let e="With a shared token this node cannot tell which peer is calling. For example, closing an approval card forwarded from that peer is refused, and its stop/resume signals are judged as the owner's.",i="Give this pair a token of its own: set the same new value as mesh.peers[].token here and on the peer.",o=[];for(let s of t){let a=(s.token??"").trim();a?n&&a===n&&o.push({severity:"warn",group:"Mesh",title:`mesh peer "${s.name}" uses this node's own MESH_TOKEN`,detail:e,fix:i}):o.push({severity:"warn",group:"Mesh",title:`mesh peer "${s.name}" has no token; calls to it use the shared MESH_TOKEN`,detail:e,fix:i})}return t.length>0&&o.length===0&&o.push({severity:"ok",group:"Mesh",title:`${t.length} mesh peer(s), each with a token of its own`}),o}function ie(t,n){t.push(...oe(n))}function oe(t,n=process.env,e=_()){let i=a=>(n[a]||e[a]||"").trim(),o=a=>typeof a=="string"?a.replace(/\$\{([A-Z_][A-Z0-9_]*)\}/gi,(l,u)=>i(u)):void 0,s=(t.mesh?.peers??[]).filter(a=>typeof a?.name=="string").map(a=>({name:a.name,token:o(a.token)}));return ne(s,i("MESH_TOKEN")||void 0)}function A(t,n){if(typeof t=="string")for(let e of t.matchAll(/\$\{([A-Z_][A-Z0-9_]*)\}/g))n.add(e[1]);else if(Array.isArray(t))for(let e of t)A(e,n);else if(t&&typeof t=="object")for(let e of Object.values(t))A(e,n)}function se(t,n){let e=[];for(let[i,o]of Object.entries(n.agents||{})){if(!o.workspace)continue;let s=o.workspace.startsWith("/")?o.workspace:y(process.cwd(),o.workspace);try{B(s).isDirectory()||e.push(`${i}: ${s} (exists but not a directory)`)}catch{e.push(`${i}: ${s}`)}}e.length===0?t.push({severity:"ok",group:"Workspaces",title:"All agent workspace folders exist"}):t.push({severity:"warn",group:"Workspaces",title:`${e.length} agent workspace(s) missing`,detail:e.join(`
4
4
  `),fix:"The daemon will create missing folders on first task, but you won't see CLAUDE.md / skills until you populate them."})}function re(t,n){let e=/\$\{[A-Za-z_][A-Za-z0-9_]*\}/g,i=[];for(let[o,s]of Object.entries(n.agents||{})){if(!s.workspace)continue;let a=s.workspace.startsWith("/")?s.workspace:y(process.cwd(),s.workspace);for(let l of["settings.json","settings.local.json"]){let u=y(a,".claude",l);if(!w(u))continue;let g;try{g=JSON.parse(b(u,"utf-8"))}catch(c){i.push({severity:"fail",agent:o,msg:`${l}: JSON parse error \u2014 ${c.message}`});continue}let $=g.env||{};for(let[c,h]of Object.entries($)){if(typeof h!="string")continue;let p=h.match(e);p&&i.push({severity:"fail",agent:o,msg:`${l} env.${c} contains unexpanded ${[...new Set(p)].join(",")} \u2014 Claude Code does NOT expand \${VAR} in settings.json (use a fully-literal value)`})}let r=$.PATH;if(typeof r=="string"){let c=r.split(":").filter(Boolean);c.includes("/usr/bin")||i.push({severity:"fail",agent:o,msg:`${l} env.PATH missing /usr/bin \u2014 cat/head/sh/which will fail`}),c.includes("/bin")||i.push({severity:"fail",agent:o,msg:`${l} env.PATH missing /bin \u2014 ls/cp/mv will fail`})}let d=g.permissions;if(d&&typeof d=="object"&&"allow"in d){let c=d.allow,h=d.deny;Array.isArray(c)&&c.length===0&&Array.isArray(h)&&h.length>0&&i.push({severity:"warn",agent:o,msg:`${l} permissions.allow is explicitly [] with ${h.length} deny rules \u2014 agent may be locked out (omit the key to use defaults instead)`})}}}if(i.length===0){t.push({severity:"ok",group:"Workspace settings",title:`All ${Object.keys(n.agents||{}).length} agent .claude/settings.json files clean`});return}for(let o of i)t.push({severity:o.severity,group:"Workspace settings",title:`${o.agent}: ${o.msg}`,fix:o.severity==="fail"?"Edit .claude/settings.json \u2014 replace ${VAR} with the literal value or omit the key to inherit.":"Either remove the empty allow list or populate it."})}function ae(t,n){let e=n.webhooks??[],i=[],o=y(process.cwd(),n.workflows?.dir||".agentx/workflows"),s=new Set;try{if(w(o))for(let r of C(o))r.endsWith(".json")&&!r.startsWith("_")&&!r.endsWith(".disabled.json")&&s.add(r.replace(/\.json$/,""))}catch{}let a=new Set(["github","gitlab"]);for(let r of e){if(!r.enabled||!a.has(r.source))continue;!(r.triggers&&Object.keys(r.triggers).length>0)&&!r.defaultWorkflow&&i.push({severity:"warn",title:`webhook "${r.id}" (${r.source} -> ${r.agentId}) has no triggers map; every event-type collapses to the bound agent`,fix:'Add a triggers map: { "issues.opened": "wf-id", "pull_request.synchronize": "wf-id" } \u2014 or set defaultWorkflow.'})}for(let r of e)if(!(!r.enabled||!r.triggers)){for(let[d,c]of Object.entries(r.triggers))s.size>0&&!s.has(c)&&i.push({severity:"fail",title:`webhook "${r.id}".triggers["${d}"] -> "${c}" \u2014 no such workflow under ${n.workflows?.dir||".agentx/workflows"}`,fix:"Create the workflow file or fix the id in agentx.json"});r.defaultWorkflow&&s.size>0&&!s.has(r.defaultWorkflow)&&i.push({severity:"fail",title:`webhook "${r.id}".defaultWorkflow -> "${r.defaultWorkflow}" \u2014 no such workflow`,fix:"Create the workflow file or fix the id in agentx.json"})}try{if(w(o)){for(let r of C(o))if(!(!r.endsWith(".json")||r.startsWith("_")||r.endsWith(".disabled.json")))try{let d=JSON.parse(b(y(o,r),"utf-8"));d?.status==="active"&&d?.state==="quarantined"&&i.push({severity:"warn",title:`workflow "${d.id??r}" is status=active but state=quarantined \u2014 it looks live but will never dispatch`,fix:'Resolve the conflict the detector flagged, then set state back to "active" (or set status to "review" while parked).'})}catch{}}}catch{}let l=new Set((n.mesh?.peers??[]).map(r=>r.name));for(let r of e)!r.enabled||!r.node||l.has(r.node)||i.push({severity:"fail",title:`webhook "${r.id}" routes to mesh peer "${r.node}" which is not in mesh.peers`,fix:"Add the peer to mesh.peers or remove the node field on the webhook."});let u=new Map;for(let r of e){if(!r.enabled)continue;let d=`${r.source}:${r.agentId}`,c=u.get(d);c?i.push({severity:"warn",title:`webhook entries "${c}" and "${r.id}" both enabled for ${r.source} -> ${r.agentId}; only the first is dispatched`,fix:"Disable one entry, or merge their triggers maps into a single entry."}):u.set(d,r.id)}let g=new Set(Object.keys(n.agents??{}));for(let r of n.channels?.gitlab?.agentMappings??[])if(r?.agentId){if(r.node){l.has(r.node)||i.push({severity:"fail",title:`gitlab.agentMappings entry agentId="${r.agentId}" routes to mesh peer "${r.node}" which is not in mesh.peers`,fix:"Add the peer to mesh.peers or drop the node field on the mapping."});continue}g.has(r.agentId)||i.push({severity:"warn",title:`gitlab.agentMappings entry agentId="${r.agentId}" \u2014 no such agent in agents.* (and no node field, so it's not a cross-mesh route)`,fix:'Add the agent to agents.*, set node:"<peer>" if the agent lives remotely, or remove the mapping.'})}for(let[r,d]of Object.entries(n.channels?.telegram?.accounts??{}))d.agentBinding?g.has(d.agentBinding)||i.push({severity:"fail",title:`telegram account "${r}".agentBinding -> "${d.agentBinding}" \u2014 no such agent in agents.*`,fix:"Fix the agentBinding or define the agent in agents.*."}):i.push({severity:"fail",title:`telegram account "${r}" has no agentBinding; every DM to this bot will drop`,fix:"Set agentBinding to a valid agent id."});let $=new Set(["telegram-bot","whatsapp","slack-bot","discord-bot","gitlab-user","github-user","gmail","hotmail","smtp","hubspot","salesforce","pipedrive","odoo","trello","linear","asana","jira","notion","stripe","sentry","vercel","twilio","custom"]);for(let[r,d]of Object.entries(n.agents??{})){let c=d.integrations??[];if(!c.length)continue;let h=new Set;for(let p of c){let S=`${p.kind}::${p.label}`;h.has(S)&&i.push({severity:"warn",title:`agents.${r}.integrations: duplicate (${p.kind}, ${p.label})`,fix:"Remove the duplicate or rename one. (kind, label) must be unique per agent."}),h.add(S),$.has(p.kind)||i.push({severity:"warn",title:`agents.${r}.integrations: unknown kind "${p.kind}" on integration "${p.label}"`,fix:'Use a canonical kind from INTEGRATION_KINDS, or "custom" for ad-hoc services.'});let L=p.credentials||{};for(let[q,v]of Object.entries(L))typeof v=="string"&&/^[A-Z][A-Z0-9_]*$/.test(v)&&!process.env[v]&&i.push({severity:"warn",title:`agents.${r}.integrations[${p.kind}/${p.label}].${q} -> $${v} but env var is unset (in this shell)`,fix:`Set ${v} on the daemon environment. The daemon's process.env is what matters; this warning fires from your local shell.`})}}if(i.length===0){t.push({severity:"ok",group:"Routing",title:`${e.length} webhook(s), ${Object.keys(n.channels?.telegram?.accounts??{}).length} telegram account(s) \u2014 all routing references resolve`});return}for(let r of i)t.push({severity:r.severity,group:"Routing",title:r.title,fix:r.fix})}function le(t){return typeof t?.canMeasure!="boolean"?null:t.canMeasure?{severity:"ok",group:"Runtime",title:"Daemon finds ffmpeg to measure phone recordings"}:{severity:"warn",group:"Runtime",title:t.allowUnmeasured?"Daemon can't find ffmpeg: phone recordings go unmeasured (voice.allowUnmeasured)":"Daemon can't find ffmpeg: phone voice input is refused",fix:"Install ffmpeg (brew install ffmpeg / sudo apt install ffmpeg), or set AGENTX_FFMPEG in the service's environment. The daemon's PATH is shorter than your shell's."}}async function de(t,n){let e=n.dashboard?.daemonUrl?.replace(/\/+$/,"")||"http://127.0.0.1:18800",i={};n.dashboard?.token&&(i.Authorization=`Bearer ${n.dashboard.token}`);try{let o=new AbortController,s=setTimeout(()=>o.abort(),2e3),a=await fetch(e+"/health",{headers:i,signal:o.signal});if(clearTimeout(s),!a.ok){t.push({severity:"warn",group:"Runtime",title:`Daemon responded ${a.status}`,detail:e});return}let l=await a.json();t.push({severity:"ok",group:"Runtime",title:`Daemon healthy \u2014 ${l.agents?.length??0} agents live, uptime ${Math.round((l.uptime??0)/60)}m`,detail:e});let u=le(l.voice);u&&t.push(u)}catch{t.push({severity:"warn",group:"Runtime",title:"Daemon not reachable (not running?)",detail:e,fix:"Run `agentx daemon start`. Skip this check with `agentx doctor --no-running`."})}}function ce(t,n){let e=Object.entries(n.agents||{}).filter(([,o])=>o?.codegraph===!0&&(o.tier==="claude-code"||o.tier==="codex-cli"));if(e.length===0)return;let i=null;try{i=m(process.platform==="win32"?"where":"which",["codegraph"],{encoding:"utf-8"}).trim().split(`
5
5
  `)[0]||null}catch{i=null}if(i){let o;try{o=m("codegraph",["--version"],{encoding:"utf-8",timeout:3e3}).trim()}catch{}t.push({severity:"ok",group:"CodeGraph",title:`codegraph CLI ${o||"installed"}`,detail:i})}else t.push({severity:"fail",group:"CodeGraph",title:"codegraph CLI not on PATH",detail:`${e.length} agent(s) have codegraph:true but the binary isn't available.`,fix:"Install with `npm i -g @colbymchenry/codegraph`."});for(let[o,s]of e){if(!s.workspace||!w(s.workspace)){t.push({severity:"warn",group:"CodeGraph",title:`${o}: workspace missing`,detail:`Workspace path ${s.workspace} does not exist \u2014 codegraph will skip this agent.`});continue}let a=y(s.workspace,".codegraph","codegraph.db");w(a)?t.push({severity:"ok",group:"CodeGraph",title:`${o}: index present`,detail:a}):t.push({severity:"warn",group:"CodeGraph",title:`${o}: index not built yet`,detail:".codegraph/ missing \u2014 daemon will background-index this workspace on next boot.",fix:`Run \`codegraph init --index ${s.workspace}\` to build it now.`})}}function D(t){return{errors:t.filter(n=>n.severity==="fail").length,warnings:t.filter(n=>n.severity==="warn").length,ok:t.filter(n=>n.severity==="ok").length}}function ue(t){console.log(),console.log(f.bold(" agentx doctor")),console.log();let n=new Map;for(let i of t)n.has(i.group)||n.set(i.group,[]),n.get(i.group).push(i);for(let[i,o]of n){console.log(f.bold(" "+i));for(let s of o){let a=s.severity==="ok"?f.green("\u2713"):s.severity==="warn"?f.yellow("!"):f.red("\u2717");console.log(` ${a} ${s.title}`),s.detail&&console.log(f.dim(" "+s.detail.replace(/\n/g,`
6
6
  `))),s.fix&&console.log(f.dim(" \u2192 "+s.fix))}console.log()}let e=D(t);e.errors>0?console.log(f.red.bold(` ${e.errors} error${e.errors===1?"":"s"}`)+(e.warnings?f.yellow(`, ${e.warnings} warning${e.warnings===1?"":"s"}`):"")+`. Fix the error${e.errors===1?"":"s"} and rerun.`):e.warnings>0?console.log(f.yellow.bold(` ${e.warnings} warning${e.warnings===1?"":"s"}.`)+f.dim(" Review but not blocking.")):console.log(f.green.bold(` All checks passed (${e.ok}).`)),console.log()}export{P as a,Z as b,Ne as c,J as d,K as e,V as f,U as g,ne as h,oe as i,le as j};
7
- //# sourceMappingURL=chunk-XUT4RBU6.js.map
7
+ //# sourceMappingURL=chunk-ZRHDAJS5.js.map
@@ -1,4 +1,4 @@
1
- import{a as k}from"./chunk-IMLAPB7G.js";import{k as y}from"./chunk-LQS27HSV.js";import{d as V}from"./chunk-QPABR72X.js";import{b as z}from"./chunk-KP7KDLZ2.js";import{V as B,W as J,X,Y as K,aa as N,fa as Oe}from"./chunk-NGGEGY5K.js";import{existsSync as Q,readFileSync as Ie}from"node:fs";import{dirname as A,join as h}from"node:path";import{fileURLToPath as Ee}from"node:url";import{homedir as Ce}from"node:os";var M="tn.acme.agentx.voice",gt="AgentX Desktop.app",Y="AgentX Helper.app";function yt(e,t,n){return e!=="darwin"||t!=="arm64"||Number(n.split(".")[0])<23?"AgentX Desktop currently requires Apple Silicon and macOS 14 or newer.":null}function ht(e,t){if(t&&!Object.hasOwn(e,t))throw new Error(`Unknown agent: ${t}. Run agentx agent list.`);let n=t||Object.keys(e)[0];if(!n)throw new Error("No agents configured. Run agentx setup first.");return n}function T(e){return`'${e.replace(/'/g,"'\\''")}'`}var Z="/usr/bin:/bin:/usr/sbin:/sbin";function wt(e,t){return t||[...new Set([...e?[A(e)]:[],...Z.split(":")])].join(":")}function R(e){let t={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};return e.replace(/&(amp|lt|gt|quot|apos);/g,(n,r)=>t[r])}function St(e){let t=e.match(/<key>PATH<\/key>\s*<string>([^<]*)<\/string>/);return t?R(t[1]):Z}var xt=e=>/agentx\.voice.*\.plist$/.test(e);function vt(e,t){let n=null,r=[];for(let{file:o,plist:i}of[...t].sort((s,u)=>s.file<u.file?-1:1)){let s=i.match(/<key>Label<\/key>\s*<string>([^<]*)<\/string>/)?.[1],u=i.match(/<key>ProgramArguments<\/key>\s*<array>\s*<string>([^<]*)<\/string>/)?.[1];!s||!u||!R(u).endsWith("/Contents/MacOS/AgentXVoice")||(n?r.push({file:o,label:R(s)}):n={file:o,label:R(s)})}return{keep:n??{file:h(e,`${M}.plist`),label:M},remove:r}}function ee(e,t,n){for(let r of t.split(":"))if(r&&n(h(r,e)))return h(r,e);return null}function bt(e){let t=r=>r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"),n={PATH:e.path,...e.agent?{AGENTX_VOICE_AGENT:e.agent}:{},AGENTX_DAEMON_URL:e.url,AGENTX_MAC_HELPER:e.helper,AGENTX_PASTE_COMMAND:`cd ${T(e.cwd)} && ${T(e.node)} ${T(e.cli)} paste`};return`<?xml version="1.0" encoding="UTF-8"?>
1
+ import{a as k}from"./chunk-IMLAPB7G.js";import{k as y}from"./chunk-LQS27HSV.js";import{d as V}from"./chunk-QPABR72X.js";import{b as z}from"./chunk-KP7KDLZ2.js";import{V as B,W as J,X,Y as K,ba as N,ga as Oe}from"./chunk-EJQHTD5U.js";import{existsSync as Q,readFileSync as Ie}from"node:fs";import{dirname as A,join as h}from"node:path";import{fileURLToPath as Ee}from"node:url";import{homedir as Ce}from"node:os";var M="tn.acme.agentx.voice",gt="AgentX Desktop.app",Y="AgentX Helper.app";function yt(e,t,n){return e!=="darwin"||t!=="arm64"||Number(n.split(".")[0])<23?"AgentX Desktop currently requires Apple Silicon and macOS 14 or newer.":null}function ht(e,t){if(t&&!Object.hasOwn(e,t))throw new Error(`Unknown agent: ${t}. Run agentx agent list.`);let n=t||Object.keys(e)[0];if(!n)throw new Error("No agents configured. Run agentx setup first.");return n}function T(e){return`'${e.replace(/'/g,"'\\''")}'`}var Z="/usr/bin:/bin:/usr/sbin:/sbin";function wt(e,t){return t||[...new Set([...e?[A(e)]:[],...Z.split(":")])].join(":")}function R(e){let t={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};return e.replace(/&(amp|lt|gt|quot|apos);/g,(n,r)=>t[r])}function St(e){let t=e.match(/<key>PATH<\/key>\s*<string>([^<]*)<\/string>/);return t?R(t[1]):Z}var xt=e=>/agentx\.voice.*\.plist$/.test(e);function vt(e,t){let n=null,r=[];for(let{file:o,plist:i}of[...t].sort((s,u)=>s.file<u.file?-1:1)){let s=i.match(/<key>Label<\/key>\s*<string>([^<]*)<\/string>/)?.[1],u=i.match(/<key>ProgramArguments<\/key>\s*<array>\s*<string>([^<]*)<\/string>/)?.[1];!s||!u||!R(u).endsWith("/Contents/MacOS/AgentXVoice")||(n?r.push({file:o,label:R(s)}):n={file:o,label:R(s)})}return{keep:n??{file:h(e,`${M}.plist`),label:M},remove:r}}function ee(e,t,n){for(let r of t.split(":"))if(r&&n(h(r,e)))return h(r,e);return null}function bt(e){let t=r=>r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"),n={PATH:e.path,...e.agent?{AGENTX_VOICE_AGENT:e.agent}:{},AGENTX_DAEMON_URL:e.url,AGENTX_MAC_HELPER:e.helper,AGENTX_PASTE_COMMAND:`cd ${T(e.cwd)} && ${T(e.node)} ${T(e.cli)} paste`};return`<?xml version="1.0" encoding="UTF-8"?>
2
2
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
3
  <plist version="1.0"><dict>
4
4
  <key>Label</key><string>${t(e.label??M)}</string>
@@ -33,4 +33,4 @@ function run(argv) {
33
33
  `),it(r,n)}var ut=5*6e4;function Cn(e,t,n=Date.now()){let r=Ae(e),o=r.checkedAt?Date.parse(r.checkedAt):NaN;return!r.cards||!(n-o<=ut)?!1:r.items[`card:${t}`]?.state!=="failed"}var U=24*36e5;function Re(e,t,n){let r=e+t.dueAfterMinutes*6e4;return new Date(n!==void 0&&Number.isFinite(n)?Math.max(e,Math.min(r,n)):r)}function lt(e,t,n,r){let o=Date.parse(e.expires),i=[f(e.ask,y.ask)];return e.choices?.length&&i.push(...e.choices.map((s,u)=>`${u+1}. ${s}`)),e.recommend&&i.push(`Recommended: ${f(e.recommend,y.recommend)}`),i.push(`Answer: ${n}`,`agentx: card=${e.id}`),{key:`card:${e.id}`,title:f(e.title,y.title),notes:i.join(`
34
34
  `),due:Re(r,t,o),priority:Number.isFinite(o)&&o-r<=U?"high":"none"}}function ct(e,t,n,r){let o=[f(e.question||e.text,y.ask),`Asked of ${e.agentId}.`,`Answer: ${n}`,`agentx: request=${e.id}`],i=e.dueAt??void 0;return{key:`request:${e.id}`,title:W(e,y.title).headline,notes:o.join(`
35
35
  `),due:Re(r,t,i),priority:i!==void 0&&i-r<=U?"high":"none"}}async function Tn(e){let{root:t,settings:n,tasks:r,log:o}=e,i=e.now??Date.now(),s=new Date(i).toISOString(),u={created:0,completed:0,dismissed:0,failed:0},l=Ae(t);delete l.lastError;let p=a=>{l.lastError={at:s,message:a}},S=new Map;try{if(n.include.includes("card"))for(let a of e.cards())a.status==="pending"&&Date.parse(a.expires)>i&&S.set(`card:${a.id}`,lt(a,n,e.answerUrl,i));if(n.include.includes("request"))for(let a of e.requests())a.state==="waiting_owner"&&S.set(`request:${a.id}`,ct(a,n,e.answerUrl,i))}catch(a){return o(`[mirror] could not read what is waiting: ${a?.message??a}`),p(String(a?.message??a)),Ne(t,l),u}let G=!0,v=new Map,Pe=async a=>{if(!v.has(a))try{v.set(a,new Set((await r.listOpen(a)).map(c=>c.id)))}catch(c){o(`[mirror] could not read list "${a}": ${c?.message??c}`),p(String(c?.message??c)),v.set(a,null),G=!1}return v.get(a)};for(let[a,c]of Object.entries(l.items)){if(c.state!=="open"||!c.id)continue;let d=await Pe(c.list);if(d)if(S.has(a))d.has(c.id)||(l.items[a]={...c,state:"dismissed",at:s},u.dismissed++,o(`[mirror] ${a}: its task was ticked off or deleted; it stays on the Desk and is not mirrored again`));else{if(d.has(c.id))try{await r.complete(c.id)}catch(g){o(`[mirror] ${a}: could not complete its task: ${g?.message??g}`),p(String(g?.message??g));continue}l.items[a]={...c,state:"completed",at:s},u.completed++}}let E=null,x=[];for(let[a,c]of S){let d=l.items[a];if(d&&(d.state==="open"||d.state==="dismissed")||d?.state==="failed"&&d.failures>=j)continue;if(E===null)try{await r.ensureList(n.list),E=!0}catch(m){o(`[mirror] could not make list "${n.list}": ${m?.message??m}`),p(String(m?.message??m)),E=!1}let g=d?.state==="failed"?d.failures:0;try{let{id:m}=await r.add({list:n.list,title:c.title,notes:c.notes,due:c.due,priority:c.priority});l.items[a]={id:m,list:n.list,state:"open",at:s,failures:0},u.created++}catch(m){let b=String(m?.message??m),C=g+1;l.items[a]={list:n.list,state:"failed",at:s,failures:C,lastError:b},p(b),u.failed++,o(`[mirror] ${a}: could not add to Reminders (${C}/${j}): ${b}`),C===j&&x.push({title:c.title,message:b})}}let $e=l.failureToldAt?Date.parse(l.failureToldAt):NaN;if(x.length&&!(i-$e<U)){let a=x[0],c=x.length>1?` (and ${x.length-1} more)`:"";try{await e.notify("Could not add to Reminders",`${a.title}${c}: ${f(a.message,200)}. Still on the Desk.`),l.failureToldAt=s}catch(d){o(`[mirror] could not tell the owner: ${d?.message??d}`)}}G&&(l.checkedAt=s,l.cards=n.include.includes("card"));for(let[a,c]of Object.entries(l.items))c.state!=="open"&&!S.has(a)&&i-Date.parse(c.at)>at&&delete l.items[a];return Ne(t,l),u}export{gn as a,he as b,H as c,F as d,yn as e,hn as f,Ze as g,wn as h,Sn as i,xn as j,W as k,f as l,Rn as m,gt as n,Y as o,yt as p,ht as q,wt as r,St as s,xt as t,vt as u,ee as v,bt as w,Nt as x,Te as y,Me as z,_e as A,_ as B,se as C,q as D,ye as E,un as F,ln as G,cn as H,Ae as I,Cn as J,Tn as K};
36
- //# sourceMappingURL=chunk-TAUXWIYB.js.map
36
+ //# sourceMappingURL=chunk-ZZR34W4V.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-XKQTHEQ3.js"),{installCliSignalExit:r}=await import("./signal-exit-WL7G3EEZ.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-5CHM6EPW.js"),{installCliSignalExit:r}=await import("./signal-exit-WL7G3EEZ.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
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f,g}from"./chunk-HXINT6DB.js";import"./chunk-EJQHTD5U.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-Y63KZEDJ.js.map
@@ -1,2 +1,2 @@
1
- import{$a as h,Ua as a,Va as b,Wa as c,Xa as d,Ya as e,Za as f,_a as g,ab as i,bb as j,cb as k,db as l,eb as m,fb as n,gb as o,hb as p,ib as q,jb as r,kb as s,lb as t,mb as u,nb as v,ob as w,pb as x,qb as y,rb as z,sb as A,tb as B,vb as C}from"./chunk-NGGEGY5K.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";C();export{a as INTEGRATION_KINDS,x as WIKI_CONTRIBUTE_JOB,y as WIKI_CONTRIBUTE_MERGE_JOB,A as WIKI_SUMMARIZE_JOB,q as approvalsConfigSchema,f as callsSchema,d as cameraBotSchema,v as crossFieldProblems,s as daemonConfigSchema,c as emailAccountSchema,b as eventSubscriptionSchema,t as expandEnvVars,e as isCronExpression,u as loadDaemonConfig,n as membersConfigSchema,i as mergePolicyConfigSchema,m as peopleConfigSchema,l as personSchema,p as qualityReportConfigSchema,o as requestStatusConfigSchema,k as requestsConfigSchema,g as reviewGateConfigSchema,h as trackersConfigSchema,w as validateWorkspaces,r as wallConfigSchema,j as watchersConfigSchema,z as withContributionJobs,B as withSummariesJob};
2
- //# sourceMappingURL=config-IBOY7BGF.js.map
1
+ import{$a as f,Wa as a,Xa as b,Ya as c,Za as d,_a as e,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,xb as C}from"./chunk-EJQHTD5U.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";C();export{a as INTEGRATION_KINDS,x as WIKI_CONTRIBUTE_JOB,y as WIKI_CONTRIBUTE_MERGE_JOB,A as WIKI_SUMMARIZE_JOB,q as approvalsConfigSchema,f as callsSchema,d as cameraBotSchema,v as crossFieldProblems,s as daemonConfigSchema,c as emailAccountSchema,b as eventSubscriptionSchema,t as expandEnvVars,e as isCronExpression,u as loadDaemonConfig,n as membersConfigSchema,i as mergePolicyConfigSchema,m as peopleConfigSchema,l as personSchema,p as qualityReportConfigSchema,o as requestStatusConfigSchema,k as requestsConfigSchema,g as reviewGateConfigSchema,h as trackersConfigSchema,w as validateWorkspaces,r as wallConfigSchema,j as watchersConfigSchema,z as withContributionJobs,B as withSummariesJob};
2
+ //# sourceMappingURL=config-GPCTV4AD.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-SP2JS67T.js";import"./chunk-EJQHTD5U.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
2
+ //# sourceMappingURL=config-mutate-S56W3EGU.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"./chunk-WS2F726P.js";import"./chunk-EJQHTD5U.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-G2MEPNGH.js.map
@@ -1,4 +1,4 @@
1
- import{a as ee}from"./chunk-2BJ7NIGG.js";import"./chunk-35I76HQS.js";import{f as Q,k as V}from"./chunk-VJVXEVZ7.js";import{b as O}from"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-OWNQ2FD4.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-GALI5ANI.js";import"./chunk-JTFCU5LH.js";import"./chunk-WVPFWUR2.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-ES236GV6.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-BERWTVG2.js";import{b as N,c as H}from"./chunk-QOYAX2FT.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-NGGEGY5K.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.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-TB752ZN4.js";import"./chunk-GIPEXI3C.js";import{f as Q,k as V}from"./chunk-VJVXEVZ7.js";import{b as O}from"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-OWNQ2FD4.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-KUMCHMGE.js";import"./chunk-JTFCU5LH.js";import"./chunk-Z37662LA.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-T3V4CUOO.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-BERWTVG2.js";import{b as N,c as H}from"./chunk-QOYAX2FT.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-EJQHTD5U.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-NQ3OQ4O4.js.map
57
+ //# sourceMappingURL=contributions-LK72ZY6S.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}from"./chunk-XUT4RBU6.js";import"./chunk-TAUXWIYB.js";import"./chunk-IMLAPB7G.js";import"./chunk-LQS27HSV.js";import"./chunk-MNG2AMKZ.js";import"./chunk-QPABR72X.js";import"./chunk-KP7KDLZ2.js";import"./chunk-OSH2PEBH.js";import"./chunk-NGGEGY5K.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";export{i as daemonVoiceCheck,b as doctor,g as meshPeerTokenChecks,h as meshTokenChecksFromConfig,a as runDoctorChecks,e as runMirrorChecks,d as runNativeChecks,c as runNotificationChecks,f as runReminderChecks};
2
- //# sourceMappingURL=doctor-AMX2GRRN.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}from"./chunk-ZRHDAJS5.js";import"./chunk-ZZR34W4V.js";import"./chunk-IMLAPB7G.js";import"./chunk-LQS27HSV.js";import"./chunk-MNG2AMKZ.js";import"./chunk-QPABR72X.js";import"./chunk-KP7KDLZ2.js";import"./chunk-OSH2PEBH.js";import"./chunk-EJQHTD5U.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{i as daemonVoiceCheck,b as doctor,g as meshPeerTokenChecks,h as meshTokenChecksFromConfig,a as runDoctorChecks,e as runMirrorChecks,d as runNativeChecks,c as runNotificationChecks,f as runReminderChecks};
2
+ //# sourceMappingURL=doctor-DL7MBZXQ.js.map
@@ -1,7 +1,7 @@
1
- import{b as h}from"./chunk-NR5IZJYS.js";import"./chunk-RKPAVWXF.js";import"./chunk-35R7Y7BT.js";import{b as I}from"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import"./chunk-LB55Q3K4.js";import"./chunk-TB3ZEMTC.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-NGGEGY5K.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.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-5EI44WB7.js";import"./chunk-RKPAVWXF.js";import"./chunk-UG6S2QED.js";import{b as I}from"./chunk-AJ5HMDRW.js";import"./chunk-KP7KDLZ2.js";import"./chunk-WMQBY45T.js";import"./chunk-WS2F726P.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-EJQHTD5U.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.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-3XSPNZKM.js.map
7
+ //# sourceMappingURL=follow-up-tool-CTP5XACV.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-VD2P4GWU.js";import"./chunk-LQS27HSV.js";import"./chunk-MNG2AMKZ.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";export{c as DEFAULT_GRANT_DAYS,a as GUEST_SCOPE_PREFIX,b as JOIN_CARD_BY,h as JOIN_FAILED,d as MAX_GRANT_DAYS,j as NO_GRANT,l as PAUSED,k as WAITING_HOST,s as endGrant,o as grantBrief,u as grantForGuest,e as grantIdOf,n as guestAccess,p as guestTask,g as inviteGuest,i as joinGuest,f as newGrantId,q as pauseGrant,r as resumeGrant,m as settleGrant,t as updateGrant};
2
- //# sourceMappingURL=grants-4O2VF2YX.js.map
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-FRR6DRLY.js";import"./chunk-LQS27HSV.js";import"./chunk-MNG2AMKZ.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{c as DEFAULT_GRANT_DAYS,a as GUEST_SCOPE_PREFIX,b as JOIN_CARD_BY,h as JOIN_FAILED,d as MAX_GRANT_DAYS,j as NO_GRANT,l as PAUSED,k as WAITING_HOST,s as endGrant,o as grantBrief,u as grantForGuest,e as grantIdOf,n as guestAccess,p as guestTask,g as inviteGuest,i as joinGuest,f as newGrantId,q as pauseGrant,r as resumeGrant,m as settleGrant,t as updateGrant};
2
+ //# sourceMappingURL=grants-Z332LOTO.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-VAH526K6.js";import"./chunk-KN2IZ6C3.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-Z37662LA.js";import"./chunk-WPNRDEHW.js";import"./chunk-T3V4CUOO.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-EJQHTD5U.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
2
+ //# sourceMappingURL=hub-WRXWDBUZ.js.map
package/dist/index.d.ts CHANGED
@@ -6226,8 +6226,8 @@ declare const daemonConfigSchema: z.ZodObject<{
6226
6226
  }, {
6227
6227
  enabled?: boolean | undefined;
6228
6228
  style?: "card" | "dialog" | undefined;
6229
- sound?: string | undefined;
6230
6229
  voice?: string | undefined;
6230
+ sound?: string | undefined;
6231
6231
  timeoutSeconds?: number | undefined;
6232
6232
  volume?: number | undefined;
6233
6233
  theme?: "system" | "light" | "dark" | undefined;
@@ -6332,8 +6332,8 @@ declare const daemonConfigSchema: z.ZodObject<{
6332
6332
  popup?: {
6333
6333
  enabled?: boolean | undefined;
6334
6334
  style?: "card" | "dialog" | undefined;
6335
- sound?: string | undefined;
6336
6335
  voice?: string | undefined;
6336
+ sound?: string | undefined;
6337
6337
  timeoutSeconds?: number | undefined;
6338
6338
  volume?: number | undefined;
6339
6339
  theme?: "system" | "light" | "dark" | undefined;
@@ -6479,6 +6479,28 @@ declare const daemonConfigSchema: z.ZodObject<{
6479
6479
  /** Where the gate reviews: GitHub pull requests, GitLab merge requests
6480
6480
  * (#1292), or both. GitLab needs the GitLab channel and its token. */
6481
6481
  forges: z.ZodDefault<z.ZodArray<z.ZodEnum<["github", "gitlab"]>, "many">>;
6482
+ /** The project's own tests, run before the review (#1285), keyed by
6483
+ * "owner/repo". The PR head is checked out in a throwaway worktree of
6484
+ * `checkout`, `command` runs there, and pass/fail lands on the PR as
6485
+ * the status `agentx/tests` and is handed to the reviewer. Only PRs
6486
+ * opened by an account AgentX posts with are run: a signature in the
6487
+ * description is not enough, since anyone can write one. */
6488
+ tests: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6489
+ /** A local clone of the repository whose `origin` is the PR's repo. */
6490
+ checkout: z.ZodString;
6491
+ /** Shell command run in the worktree, e.g. "npm ci && npm test". */
6492
+ command: z.ZodString;
6493
+ /** A longer run is stopped and counts as a failure. */
6494
+ timeoutMinutes: z.ZodDefault<z.ZodNumber>;
6495
+ }, "strip", z.ZodTypeAny, {
6496
+ command: string;
6497
+ timeoutMinutes: number;
6498
+ checkout: string;
6499
+ }, {
6500
+ command: string;
6501
+ checkout: string;
6502
+ timeoutMinutes?: number | undefined;
6503
+ }>>>;
6482
6504
  }, "strip", z.ZodTypeAny, {
6483
6505
  enabled: boolean;
6484
6506
  mode: "required" | "advisory";
@@ -6493,6 +6515,11 @@ declare const daemonConfigSchema: z.ZodObject<{
6493
6515
  ciWaitMinutes: number;
6494
6516
  maxDiffKb: number;
6495
6517
  forges: ("gitlab" | "github")[];
6518
+ tests: Record<string, {
6519
+ command: string;
6520
+ timeoutMinutes: number;
6521
+ checkout: string;
6522
+ }>;
6496
6523
  }, {
6497
6524
  enabled?: boolean | undefined;
6498
6525
  mode?: "required" | "advisory" | undefined;
@@ -6507,6 +6534,11 @@ declare const daemonConfigSchema: z.ZodObject<{
6507
6534
  ciWaitMinutes?: number | undefined;
6508
6535
  maxDiffKb?: number | undefined;
6509
6536
  forges?: ("gitlab" | "github")[] | undefined;
6537
+ tests?: Record<string, {
6538
+ command: string;
6539
+ checkout: string;
6540
+ timeoutMinutes?: number | undefined;
6541
+ }> | undefined;
6510
6542
  }>>;
6511
6543
  /** Merge policy (#1047): core paths need a person's approval; the
6512
6544
  * commit status `agentx/merge-policy` says which a PR is. */
@@ -6581,6 +6613,11 @@ declare const daemonConfigSchema: z.ZodObject<{
6581
6613
  ciWaitMinutes: number;
6582
6614
  maxDiffKb: number;
6583
6615
  forges: ("gitlab" | "github")[];
6616
+ tests: Record<string, {
6617
+ command: string;
6618
+ timeoutMinutes: number;
6619
+ checkout: string;
6620
+ }>;
6584
6621
  };
6585
6622
  mergePolicy: {
6586
6623
  enabled: boolean;
@@ -6625,6 +6662,11 @@ declare const daemonConfigSchema: z.ZodObject<{
6625
6662
  ciWaitMinutes?: number | undefined;
6626
6663
  maxDiffKb?: number | undefined;
6627
6664
  forges?: ("gitlab" | "github")[] | undefined;
6665
+ tests?: Record<string, {
6666
+ command: string;
6667
+ checkout: string;
6668
+ timeoutMinutes?: number | undefined;
6669
+ }> | undefined;
6628
6670
  } | undefined;
6629
6671
  mergePolicy?: {
6630
6672
  enabled?: boolean | undefined;
@@ -10525,32 +10567,6 @@ declare const daemonConfigSchema: z.ZodObject<{
10525
10567
  titleSignature?: string | undefined;
10526
10568
  } | undefined;
10527
10569
  };
10528
- app: {
10529
- android: {
10530
- packageName: string;
10531
- certFingerprints: string[];
10532
- };
10533
- places: {
10534
- enabled: boolean;
10535
- file: string;
10536
- defaultRadiusMeters: number;
10537
- minRadiusMeters: number;
10538
- maxRadiusMeters: number;
10539
- maxPlaces: number;
10540
- maxRulesPerPlace: number;
10541
- cooldownMinutes: number;
10542
- maxEventAgeMinutes: number;
10543
- syncMinutes: number;
10544
- };
10545
- pins: {
10546
- max: number;
10547
- file: string;
10548
- pages: {
10549
- label: string;
10550
- url: string;
10551
- }[];
10552
- };
10553
- };
10554
10570
  voice: {
10555
10571
  provider: "system" | "elevenlabs";
10556
10572
  fallback: "system" | "none";
@@ -10592,6 +10608,32 @@ declare const daemonConfigSchema: z.ZodObject<{
10592
10608
  system?: string | Record<string, string> | undefined;
10593
10609
  listener?: string | undefined;
10594
10610
  };
10611
+ app: {
10612
+ android: {
10613
+ packageName: string;
10614
+ certFingerprints: string[];
10615
+ };
10616
+ places: {
10617
+ enabled: boolean;
10618
+ file: string;
10619
+ defaultRadiusMeters: number;
10620
+ minRadiusMeters: number;
10621
+ maxRadiusMeters: number;
10622
+ maxPlaces: number;
10623
+ maxRulesPerPlace: number;
10624
+ cooldownMinutes: number;
10625
+ maxEventAgeMinutes: number;
10626
+ syncMinutes: number;
10627
+ };
10628
+ pins: {
10629
+ max: number;
10630
+ file: string;
10631
+ pages: {
10632
+ label: string;
10633
+ url: string;
10634
+ }[];
10635
+ };
10636
+ };
10595
10637
  dashboard: {
10596
10638
  enabled: boolean;
10597
10639
  port: number;
@@ -11062,6 +11104,11 @@ declare const daemonConfigSchema: z.ZodObject<{
11062
11104
  ciWaitMinutes: number;
11063
11105
  maxDiffKb: number;
11064
11106
  forges: ("gitlab" | "github")[];
11107
+ tests: Record<string, {
11108
+ command: string;
11109
+ timeoutMinutes: number;
11110
+ checkout: string;
11111
+ }>;
11065
11112
  };
11066
11113
  mergePolicy: {
11067
11114
  enabled: boolean;
@@ -11807,32 +11854,6 @@ declare const daemonConfigSchema: z.ZodObject<{
11807
11854
  titleSignature?: string | undefined;
11808
11855
  } | undefined;
11809
11856
  } | undefined;
11810
- app?: {
11811
- android?: {
11812
- packageName?: string | undefined;
11813
- certFingerprints?: string[] | undefined;
11814
- } | undefined;
11815
- places?: {
11816
- enabled?: boolean | undefined;
11817
- file?: string | undefined;
11818
- defaultRadiusMeters?: number | undefined;
11819
- minRadiusMeters?: number | undefined;
11820
- maxRadiusMeters?: number | undefined;
11821
- maxPlaces?: number | undefined;
11822
- maxRulesPerPlace?: number | undefined;
11823
- cooldownMinutes?: number | undefined;
11824
- maxEventAgeMinutes?: number | undefined;
11825
- syncMinutes?: number | undefined;
11826
- } | undefined;
11827
- pins?: {
11828
- max?: number | undefined;
11829
- file?: string | undefined;
11830
- pages?: {
11831
- label: string;
11832
- url: string;
11833
- }[] | undefined;
11834
- } | undefined;
11835
- } | undefined;
11836
11857
  voice?: {
11837
11858
  system?: string | Record<string, string> | undefined;
11838
11859
  provider?: "system" | "elevenlabs" | undefined;
@@ -11874,6 +11895,32 @@ declare const daemonConfigSchema: z.ZodObject<{
11874
11895
  maxSeconds?: number | undefined;
11875
11896
  } | undefined;
11876
11897
  } | undefined;
11898
+ app?: {
11899
+ android?: {
11900
+ packageName?: string | undefined;
11901
+ certFingerprints?: string[] | undefined;
11902
+ } | undefined;
11903
+ places?: {
11904
+ enabled?: boolean | undefined;
11905
+ file?: string | undefined;
11906
+ defaultRadiusMeters?: number | undefined;
11907
+ minRadiusMeters?: number | undefined;
11908
+ maxRadiusMeters?: number | undefined;
11909
+ maxPlaces?: number | undefined;
11910
+ maxRulesPerPlace?: number | undefined;
11911
+ cooldownMinutes?: number | undefined;
11912
+ maxEventAgeMinutes?: number | undefined;
11913
+ syncMinutes?: number | undefined;
11914
+ } | undefined;
11915
+ pins?: {
11916
+ max?: number | undefined;
11917
+ file?: string | undefined;
11918
+ pages?: {
11919
+ label: string;
11920
+ url: string;
11921
+ }[] | undefined;
11922
+ } | undefined;
11923
+ } | undefined;
11877
11924
  dashboard?: {
11878
11925
  enabled?: boolean | undefined;
11879
11926
  token?: string | undefined;
@@ -12107,8 +12154,8 @@ declare const daemonConfigSchema: z.ZodObject<{
12107
12154
  popup?: {
12108
12155
  enabled?: boolean | undefined;
12109
12156
  style?: "card" | "dialog" | undefined;
12110
- sound?: string | undefined;
12111
12157
  voice?: string | undefined;
12158
+ sound?: string | undefined;
12112
12159
  timeoutSeconds?: number | undefined;
12113
12160
  volume?: number | undefined;
12114
12161
  theme?: "system" | "light" | "dark" | undefined;
@@ -12405,6 +12452,11 @@ declare const daemonConfigSchema: z.ZodObject<{
12405
12452
  ciWaitMinutes?: number | undefined;
12406
12453
  maxDiffKb?: number | undefined;
12407
12454
  forges?: ("gitlab" | "github")[] | undefined;
12455
+ tests?: Record<string, {
12456
+ command: string;
12457
+ checkout: string;
12458
+ timeoutMinutes?: number | undefined;
12459
+ }> | undefined;
12408
12460
  } | undefined;
12409
12461
  mergePolicy?: {
12410
12462
  enabled?: boolean | undefined;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{Ia as Tt,Ja as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt}from"./chunk-7NA5VSQE.js";import"./chunk-7FGJOVML.js";import"./chunk-GTJIKXDB.js";import"./chunk-YLQZFV6Y.js";import"./chunk-ZVP6GB4G.js";import"./chunk-TAUXWIYB.js";import"./chunk-EKJG63EJ.js";import"./chunk-AQGQLVCD.js";import"./chunk-N6VBEITO.js";import"./chunk-IMLAPB7G.js";import"./chunk-6V5JBHUN.js";import"./chunk-2VDO2HEK.js";import"./chunk-5HLD66CW.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-MRIVENBY.js";import"./chunk-VD2P4GWU.js";import"./chunk-LQS27HSV.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-A5GYG56I.js";import"./chunk-HZXLZIB4.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-UKUH662W.js";import"./chunk-JWDJMFU6.js";import"./chunk-IS2IWRP7.js";import"./chunk-MNG2AMKZ.js";import"./chunk-RX5O5637.js";import"./chunk-X7UQY7CH.js";import"./chunk-QPABR72X.js";import"./chunk-35R7Y7BT.js";import"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import{m as lt,n as ct,o as dt,p as mt,q as pt,ta as yt}from"./chunk-MH55YCUS.js";import"./chunk-PD5BZYBO.js";import"./chunk-MEFPXHQJ.js";import{a as L}from"./chunk-BAXGL6TY.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-I7EO2WXC.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-SZDACK6O.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VJVXEVZ7.js";import{t as ut}from"./chunk-LB55Q3K4.js";import"./chunk-TB3ZEMTC.js";import"./chunk-3UOTLMXD.js";import"./chunk-BE64IJWM.js";import"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-VWTBHLMX.js";import"./chunk-WO4XKOMM.js";import{a as ht}from"./chunk-XCYGF4RB.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-GALI5ANI.js";import"./chunk-JTFCU5LH.js";import{f as gt,g as ft}from"./chunk-WVPFWUR2.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-5KVTIFRY.js";import{j as it,k as rt,l as at}from"./chunk-ES236GV6.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-QUFIUXMQ.js";import"./chunk-AV7T3SYT.js";import"./chunk-LE3BXIUF.js";import"./chunk-BERWTVG2.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-DCIYOPJF.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{kb as tt,mb as st,ob as ot,vb as nt}from"./chunk-NGGEGY5K.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
1
+ import{Ia as Tt,Ja as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt}from"./chunk-Z73KECFS.js";import"./chunk-KAVZPYK4.js";import"./chunk-GTJIKXDB.js";import"./chunk-6W5262KN.js";import"./chunk-ZVP6GB4G.js";import"./chunk-ZZR34W4V.js";import"./chunk-EKJG63EJ.js";import"./chunk-E6BIV3EM.js";import"./chunk-N6VBEITO.js";import"./chunk-IMLAPB7G.js";import"./chunk-6V5JBHUN.js";import"./chunk-2VDO2HEK.js";import"./chunk-5HLD66CW.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-MRIVENBY.js";import"./chunk-FRR6DRLY.js";import"./chunk-LQS27HSV.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-A5GYG56I.js";import"./chunk-RY2YN3WA.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-UKUH662W.js";import"./chunk-JWDJMFU6.js";import"./chunk-IS2IWRP7.js";import"./chunk-MNG2AMKZ.js";import"./chunk-RX5O5637.js";import"./chunk-X7UQY7CH.js";import"./chunk-QPABR72X.js";import"./chunk-UG6S2QED.js";import"./chunk-AJ5HMDRW.js";import"./chunk-KP7KDLZ2.js";import{m as lt,n as ct,o as dt,p as mt,q as pt,va as yt}from"./chunk-O2ZDYZXI.js";import"./chunk-B6JE7TKU.js";import"./chunk-MEFPXHQJ.js";import{a as L}from"./chunk-BAXGL6TY.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-QJPLPN3G.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-SZDACK6O.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VJVXEVZ7.js";import{t as ut}from"./chunk-WMQBY45T.js";import"./chunk-WS2F726P.js";import"./chunk-3UOTLMXD.js";import"./chunk-BE64IJWM.js";import"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-VWTBHLMX.js";import"./chunk-VAH526K6.js";import{a as ht}from"./chunk-KN2IZ6C3.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-KUMCHMGE.js";import"./chunk-JTFCU5LH.js";import{f as gt,g as ft}from"./chunk-Z37662LA.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-NWKTI6AZ.js";import{j as it,k as rt,l as at}from"./chunk-T3V4CUOO.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-QUFIUXMQ.js";import"./chunk-AV7T3SYT.js";import"./chunk-LE3BXIUF.js";import"./chunk-BERWTVG2.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-DCIYOPJF.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{mb as tt,ob as st,qb as ot,xb as nt}from"./chunk-EJQHTD5U.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
2
2
  `)}
3
3
 
4
4
  ${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-YFVSSYSL.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-X7UQY7CH.js";import{b as c}from"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import"./chunk-QIJLFPWE.js";async function y(t,o){let a=o.env??process.env,n=typeof t.title=="string"?t.title.trim():"",i=typeof t.body=="string"?t.body.trim():"";if(!n||!i)return"Error: title and body are required.";if(n.length>r.title)return`Error: title is at most ${r.title} characters.`;if(i.length>r.body)return`Error: body is at most ${r.body} characters.`;let d=a.AGENTX_AGENT_ID||(typeof t.callerAgentId=="string"?t.callerAgentId:"");try{let e=await(o.fetch??fetch)(`${o.daemonUrl.replace(/\/+$/,"")}/native/notes`,{method:"POST",headers:{"Content-Type":"application/json",...c(a)},body:JSON.stringify({title:n,body:i,agentId:d}),signal:AbortSignal.timeout(45e3)}),s=await e.json().catch(()=>({}));return e.status===201?`Added to the owner's notes, folder "${s.folder??"AgentX"}". Don't also send the idea in chat.`:`Error: ${s?.error||`HTTP ${e.status}`}`}catch(e){return`Error: couldn't reach the daemon (${e?.message??e}).`}}export{y as runNoteTool};
2
- //# sourceMappingURL=note-tool-EZWSB3J3.js.map
1
+ import{a as r}from"./chunk-X7UQY7CH.js";import{b as c}from"./chunk-AJ5HMDRW.js";import"./chunk-KP7KDLZ2.js";import"./chunk-QIJLFPWE.js";async function y(t,o){let a=o.env??process.env,n=typeof t.title=="string"?t.title.trim():"",i=typeof t.body=="string"?t.body.trim():"";if(!n||!i)return"Error: title and body are required.";if(n.length>r.title)return`Error: title is at most ${r.title} characters.`;if(i.length>r.body)return`Error: body is at most ${r.body} characters.`;let d=a.AGENTX_AGENT_ID||(typeof t.callerAgentId=="string"?t.callerAgentId:"");try{let e=await(o.fetch??fetch)(`${o.daemonUrl.replace(/\/+$/,"")}/native/notes`,{method:"POST",headers:{"Content-Type":"application/json",...c(a)},body:JSON.stringify({title:n,body:i,agentId:d}),signal:AbortSignal.timeout(45e3)}),s=await e.json().catch(()=>({}));return e.status===201?`Added to the owner's notes, folder "${s.folder??"AgentX"}". Don't also send the idea in chat.`:`Error: ${s?.error||`HTTP ${e.status}`}`}catch(e){return`Error: couldn't reach the daemon (${e?.message??e}).`}}export{y as runNoteTool};
2
+ //# sourceMappingURL=note-tool-ANQWBBZE.js.map