agentix-cli 0.214.0 → 0.216.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 (179) hide show
  1. package/dist/{App-OUWMH6QG.js → App-YGVVIKZD.js} +2 -2
  2. package/dist/{ChatApp-EZ5A47FV.js → ChatApp-6TEK2WMU.js} +2 -2
  3. package/dist/{absorb-eval-WM6JQGYG.js → absorb-eval-MJ475CNV.js} +2 -2
  4. package/dist/{adapter-W26OC6ET.js → adapter-C6YORAE6.js} +2 -2
  5. package/dist/{agent-KUCECPSZ.js → agent-44SGRWX2.js} +2 -2
  6. package/dist/{board-dashboard-SHU4BWRO.js → board-dashboard-TZKV4DFV.js} +13 -13
  7. package/dist/{board-dashboard-SHU4BWRO.js.map → board-dashboard-TZKV4DFV.js.map} +1 -1
  8. package/dist/chunk-2KQECT4H.js +42 -0
  9. package/dist/chunk-2KQECT4H.js.map +1 -0
  10. package/dist/{chunk-ACPGDZOV.js → chunk-2ZNYIHRB.js} +2 -2
  11. package/dist/{chunk-CSC45PA7.js → chunk-3UATFGSB.js} +2 -2
  12. package/dist/chunk-4A6UVU2X.js +134 -0
  13. package/dist/chunk-4A6UVU2X.js.map +1 -0
  14. package/dist/{chunk-XHON5WB5.js → chunk-5SQRJUAK.js} +3 -3
  15. package/dist/{chunk-QR3P5RG7.js → chunk-7OJUZ3L5.js} +2 -2
  16. package/dist/chunk-7YOLZGB5.js +2 -0
  17. package/dist/chunk-7YOLZGB5.js.map +1 -0
  18. package/dist/{chunk-CAH6TNC6.js → chunk-AU7SN4G3.js} +2 -2
  19. package/dist/{chunk-MIUITI47.js → chunk-BLKXK27S.js} +2 -2
  20. package/dist/chunk-F2XNWKIL.js +1428 -0
  21. package/dist/chunk-F2XNWKIL.js.map +1 -0
  22. package/dist/{chunk-H4DWZIU7.js → chunk-F32VADB7.js} +2 -2
  23. package/dist/{chunk-SPXXLPAS.js → chunk-GEKJQ7VV.js} +2 -2
  24. package/dist/chunk-HVMUYEQP.js +4 -0
  25. package/dist/chunk-HVMUYEQP.js.map +1 -0
  26. package/dist/chunk-I4E6BH27.js +20 -0
  27. package/dist/chunk-I4E6BH27.js.map +1 -0
  28. package/dist/{chunk-PSYHAO57.js → chunk-IKXDCPXS.js} +2 -2
  29. package/dist/{chunk-ZRBTLW2B.js → chunk-JMWPBZLU.js} +2 -2
  30. package/dist/{chunk-UNVZUWOY.js → chunk-JNBUJKNG.js} +3 -3
  31. package/dist/{chunk-UNVZUWOY.js.map → chunk-JNBUJKNG.js.map} +1 -1
  32. package/dist/{chunk-HY4PE6R3.js → chunk-JTS563OC.js} +2 -2
  33. package/dist/{chunk-N476XZD3.js → chunk-LDSBFDYB.js} +2 -2
  34. package/dist/{chunk-B7HDWFKR.js → chunk-LJUBWMPB.js} +2 -2
  35. package/dist/{chunk-C3O2ER6D.js → chunk-MH7KJQ4N.js} +2 -2
  36. package/dist/{chunk-UUOCCLIL.js → chunk-MOEXP6U3.js} +2 -2
  37. package/dist/{chunk-JKMFKNGS.js → chunk-PA7CP74O.js} +2 -2
  38. package/dist/{chunk-JEBU5JUM.js → chunk-SZXFWCKA.js} +2 -2
  39. package/dist/{chunk-J2R47R56.js → chunk-T3B7OUDC.js} +2 -2
  40. package/dist/{chunk-Z7632XS3.js → chunk-T7SD5EVH.js} +2 -2
  41. package/dist/chunk-TFHJT2AZ.js +4 -0
  42. package/dist/chunk-TFHJT2AZ.js.map +1 -0
  43. package/dist/{chunk-IHFOW4JF.js → chunk-TO6T6AQY.js} +2 -2
  44. package/dist/{chunk-OQNJIIR2.js → chunk-U5DSMDCJ.js} +2 -2
  45. package/dist/{chunk-SBFMNAJG.js → chunk-WLDRIJQX.js} +88 -88
  46. package/dist/chunk-WLDRIJQX.js.map +1 -0
  47. package/dist/{chunk-2KNI7ZRN.js → chunk-XXFVK5D7.js} +2 -2
  48. package/dist/{chunk-2KNI7ZRN.js.map → chunk-XXFVK5D7.js.map} +1 -1
  49. package/dist/{chunk-4ZD2C76P.js → chunk-YTWRIIAT.js} +2 -2
  50. package/dist/chunk-Z5CMA4JN.js +6 -0
  51. package/dist/chunk-Z5CMA4JN.js.map +1 -0
  52. package/dist/cli.js +1 -1
  53. package/dist/client-SJLHZDIC.js +2 -0
  54. package/dist/config-Q3ENZQYL.js +2 -0
  55. package/dist/config-mutate-NNAUMQ2Y.js +2 -0
  56. package/dist/config-mutator-2F2BJNMA.js +2 -0
  57. package/dist/{contributions-FXUTKU6R.js → contributions-SOUGZCAH.js} +2 -2
  58. package/dist/decision-approvals-SWZ4RWFI.js +2 -0
  59. package/dist/{doctor-GP2KVKWE.js → doctor-H6I433KY.js} +2 -2
  60. package/dist/{follow-up-tool-C4PLLZIT.js → follow-up-tool-4FX455DL.js} +2 -2
  61. package/dist/hub-XFZFHLJK.js +2 -0
  62. package/dist/index.d.ts +438 -294
  63. package/dist/index.js +1 -1
  64. package/dist/{org-tool-6PPIGWH2.js → org-tool-OE5QP6W7.js} +2 -2
  65. package/dist/{program-L3BX5FJ3.js → program-7QFRDJUY.js} +288 -288
  66. package/dist/program-7QFRDJUY.js.map +1 -0
  67. package/dist/{promote-CXXMZWWH.js → promote-FQY3HNL6.js} +2 -2
  68. package/dist/push-bridge-T5HZZRA2.js +1 -1
  69. package/dist/{query-RPZIRN3X.js → query-LIII4CGT.js} +2 -2
  70. package/dist/{query-runs-AENEZOM6.js → query-runs-2F6KHFBZ.js} +2 -2
  71. package/dist/{query-settings-EBOBWOAL.js → query-settings-6LHW2NCF.js} +2 -2
  72. package/dist/{registry-D727ZQUP.js → registry-WQNBXOUL.js} +2 -2
  73. package/dist/{request-planner-LNNKTY7K.js → request-planner-HYYT3W7X.js} +2 -2
  74. package/dist/{review-candidates-HQBKXAJA.js → review-candidates-JOCZEZ2L.js} +2 -2
  75. package/dist/routing-D7W4BDER.js +2 -0
  76. package/dist/schedule-tool-B4RDOKCN.js +2 -0
  77. package/dist/scheduler-JHY767T4.js +2 -0
  78. package/dist/{seat-BSWBTNCP.js → seat-44NEMWB5.js} +2 -2
  79. package/dist/{select-T4F42G6W.js → select-5FMPLCCG.js} +2 -2
  80. package/dist/{set-enabled-UK4TPVC7.js → set-enabled-GVQFNLOS.js} +2 -2
  81. package/dist/{sprint-tool-DN3BKLUY.js → sprint-tool-X3A5VPJP.js} +2 -2
  82. package/dist/timers-LAT4ZVXJ.js +2 -0
  83. package/dist/{tool-ZCSGJ2ZF.js → tool-H7RMHTXM.js} +2 -2
  84. package/dist/{tool-JJGEGQF3.js → tool-ILYSRPZ5.js} +2 -2
  85. package/dist/{tool-L3CQUOAZ.js → tool-KCOCIAFM.js} +2 -2
  86. package/dist/{tool-ZVYUWVJQ.js → tool-QIS3CLU2.js} +2 -2
  87. package/dist/tool-Z7TIGVEW.js +7 -0
  88. package/dist/tool-Z7TIGVEW.js.map +1 -0
  89. package/dist/wiki-UMPPYYFR.js +2 -0
  90. package/dist/wiki-enrich-UVCZ7GTW.js +2 -0
  91. package/package.json +1 -1
  92. package/dist/chunk-35UGFFHA.js +0 -20
  93. package/dist/chunk-35UGFFHA.js.map +0 -1
  94. package/dist/chunk-AFRHKA7B.js +0 -2
  95. package/dist/chunk-AFRHKA7B.js.map +0 -1
  96. package/dist/chunk-FR4DTMCA.js +0 -42
  97. package/dist/chunk-FR4DTMCA.js.map +0 -1
  98. package/dist/chunk-HPRLRD4P.js +0 -6
  99. package/dist/chunk-HPRLRD4P.js.map +0 -1
  100. package/dist/chunk-KAM4ZWRE.js +0 -133
  101. package/dist/chunk-KAM4ZWRE.js.map +0 -1
  102. package/dist/chunk-LIY5CHUV.js +0 -4
  103. package/dist/chunk-LIY5CHUV.js.map +0 -1
  104. package/dist/chunk-RMXG5GNW.js +0 -4
  105. package/dist/chunk-RMXG5GNW.js.map +0 -1
  106. package/dist/chunk-SBFMNAJG.js.map +0 -1
  107. package/dist/chunk-Z4WM7MKP.js +0 -1385
  108. package/dist/chunk-Z4WM7MKP.js.map +0 -1
  109. package/dist/client-U3OFNJ5W.js +0 -2
  110. package/dist/config-S522VXLI.js +0 -2
  111. package/dist/config-mutate-KBZV2T4X.js +0 -2
  112. package/dist/config-mutator-YNNEGRV3.js +0 -2
  113. package/dist/decision-approvals-NJS2ARAF.js +0 -2
  114. package/dist/hub-PPQGFC35.js +0 -2
  115. package/dist/program-L3BX5FJ3.js.map +0 -1
  116. package/dist/routing-XXA7GIBA.js +0 -2
  117. package/dist/schedule-tool-65TFOUWK.js +0 -2
  118. package/dist/scheduler-DIPOBJBF.js +0 -2
  119. package/dist/timers-KK7GF77Y.js +0 -2
  120. package/dist/wiki-FP4JMCYP.js +0 -2
  121. package/dist/wiki-enrich-3SPIVYSG.js +0 -2
  122. /package/dist/{App-OUWMH6QG.js.map → App-YGVVIKZD.js.map} +0 -0
  123. /package/dist/{ChatApp-EZ5A47FV.js.map → ChatApp-6TEK2WMU.js.map} +0 -0
  124. /package/dist/{absorb-eval-WM6JQGYG.js.map → absorb-eval-MJ475CNV.js.map} +0 -0
  125. /package/dist/{adapter-W26OC6ET.js.map → adapter-C6YORAE6.js.map} +0 -0
  126. /package/dist/{agent-KUCECPSZ.js.map → agent-44SGRWX2.js.map} +0 -0
  127. /package/dist/{chunk-ACPGDZOV.js.map → chunk-2ZNYIHRB.js.map} +0 -0
  128. /package/dist/{chunk-CSC45PA7.js.map → chunk-3UATFGSB.js.map} +0 -0
  129. /package/dist/{chunk-XHON5WB5.js.map → chunk-5SQRJUAK.js.map} +0 -0
  130. /package/dist/{chunk-QR3P5RG7.js.map → chunk-7OJUZ3L5.js.map} +0 -0
  131. /package/dist/{chunk-CAH6TNC6.js.map → chunk-AU7SN4G3.js.map} +0 -0
  132. /package/dist/{chunk-MIUITI47.js.map → chunk-BLKXK27S.js.map} +0 -0
  133. /package/dist/{chunk-H4DWZIU7.js.map → chunk-F32VADB7.js.map} +0 -0
  134. /package/dist/{chunk-SPXXLPAS.js.map → chunk-GEKJQ7VV.js.map} +0 -0
  135. /package/dist/{chunk-PSYHAO57.js.map → chunk-IKXDCPXS.js.map} +0 -0
  136. /package/dist/{chunk-ZRBTLW2B.js.map → chunk-JMWPBZLU.js.map} +0 -0
  137. /package/dist/{chunk-HY4PE6R3.js.map → chunk-JTS563OC.js.map} +0 -0
  138. /package/dist/{chunk-N476XZD3.js.map → chunk-LDSBFDYB.js.map} +0 -0
  139. /package/dist/{chunk-B7HDWFKR.js.map → chunk-LJUBWMPB.js.map} +0 -0
  140. /package/dist/{chunk-C3O2ER6D.js.map → chunk-MH7KJQ4N.js.map} +0 -0
  141. /package/dist/{chunk-UUOCCLIL.js.map → chunk-MOEXP6U3.js.map} +0 -0
  142. /package/dist/{chunk-JKMFKNGS.js.map → chunk-PA7CP74O.js.map} +0 -0
  143. /package/dist/{chunk-JEBU5JUM.js.map → chunk-SZXFWCKA.js.map} +0 -0
  144. /package/dist/{chunk-J2R47R56.js.map → chunk-T3B7OUDC.js.map} +0 -0
  145. /package/dist/{chunk-Z7632XS3.js.map → chunk-T7SD5EVH.js.map} +0 -0
  146. /package/dist/{chunk-IHFOW4JF.js.map → chunk-TO6T6AQY.js.map} +0 -0
  147. /package/dist/{chunk-OQNJIIR2.js.map → chunk-U5DSMDCJ.js.map} +0 -0
  148. /package/dist/{chunk-4ZD2C76P.js.map → chunk-YTWRIIAT.js.map} +0 -0
  149. /package/dist/{client-U3OFNJ5W.js.map → client-SJLHZDIC.js.map} +0 -0
  150. /package/dist/{config-S522VXLI.js.map → config-Q3ENZQYL.js.map} +0 -0
  151. /package/dist/{config-mutate-KBZV2T4X.js.map → config-mutate-NNAUMQ2Y.js.map} +0 -0
  152. /package/dist/{config-mutator-YNNEGRV3.js.map → config-mutator-2F2BJNMA.js.map} +0 -0
  153. /package/dist/{contributions-FXUTKU6R.js.map → contributions-SOUGZCAH.js.map} +0 -0
  154. /package/dist/{decision-approvals-NJS2ARAF.js.map → decision-approvals-SWZ4RWFI.js.map} +0 -0
  155. /package/dist/{doctor-GP2KVKWE.js.map → doctor-H6I433KY.js.map} +0 -0
  156. /package/dist/{follow-up-tool-C4PLLZIT.js.map → follow-up-tool-4FX455DL.js.map} +0 -0
  157. /package/dist/{hub-PPQGFC35.js.map → hub-XFZFHLJK.js.map} +0 -0
  158. /package/dist/{org-tool-6PPIGWH2.js.map → org-tool-OE5QP6W7.js.map} +0 -0
  159. /package/dist/{promote-CXXMZWWH.js.map → promote-FQY3HNL6.js.map} +0 -0
  160. /package/dist/{query-RPZIRN3X.js.map → query-LIII4CGT.js.map} +0 -0
  161. /package/dist/{query-runs-AENEZOM6.js.map → query-runs-2F6KHFBZ.js.map} +0 -0
  162. /package/dist/{query-settings-EBOBWOAL.js.map → query-settings-6LHW2NCF.js.map} +0 -0
  163. /package/dist/{registry-D727ZQUP.js.map → registry-WQNBXOUL.js.map} +0 -0
  164. /package/dist/{request-planner-LNNKTY7K.js.map → request-planner-HYYT3W7X.js.map} +0 -0
  165. /package/dist/{review-candidates-HQBKXAJA.js.map → review-candidates-JOCZEZ2L.js.map} +0 -0
  166. /package/dist/{routing-XXA7GIBA.js.map → routing-D7W4BDER.js.map} +0 -0
  167. /package/dist/{schedule-tool-65TFOUWK.js.map → schedule-tool-B4RDOKCN.js.map} +0 -0
  168. /package/dist/{scheduler-DIPOBJBF.js.map → scheduler-JHY767T4.js.map} +0 -0
  169. /package/dist/{seat-BSWBTNCP.js.map → seat-44NEMWB5.js.map} +0 -0
  170. /package/dist/{select-T4F42G6W.js.map → select-5FMPLCCG.js.map} +0 -0
  171. /package/dist/{set-enabled-UK4TPVC7.js.map → set-enabled-GVQFNLOS.js.map} +0 -0
  172. /package/dist/{sprint-tool-DN3BKLUY.js.map → sprint-tool-X3A5VPJP.js.map} +0 -0
  173. /package/dist/{timers-KK7GF77Y.js.map → timers-LAT4ZVXJ.js.map} +0 -0
  174. /package/dist/{tool-ZCSGJ2ZF.js.map → tool-H7RMHTXM.js.map} +0 -0
  175. /package/dist/{tool-JJGEGQF3.js.map → tool-ILYSRPZ5.js.map} +0 -0
  176. /package/dist/{tool-L3CQUOAZ.js.map → tool-KCOCIAFM.js.map} +0 -0
  177. /package/dist/{tool-ZVYUWVJQ.js.map → tool-QIS3CLU2.js.map} +0 -0
  178. /package/dist/{wiki-FP4JMCYP.js.map → wiki-UMPPYYFR.js.map} +0 -0
  179. /package/dist/{wiki-enrich-3SPIVYSG.js.map → wiki-enrich-UVCZ7GTW.js.map} +0 -0
@@ -1,7 +1,7 @@
1
- import{a as q}from"./chunk-WMZ4TGMR.js";import{a as D,b as F}from"./chunk-2YDG5CSS.js";import{A as S,G as H,I as b,K as _,N as M,q as A,x as W}from"./chunk-OQNJIIR2.js";import{c as P}from"./chunk-LY4G7PCW.js";import{a as L}from"./chunk-OSH2PEBH.js";import{Tb as T,bc as K,xb as E}from"./chunk-KAM4ZWRE.js";K();import{Command as V}from"commander";import f from"chalk";import{execFileSync as m}from"child_process";import{accessSync as z,constants as G,existsSync as k,readFileSync as $,readdirSync as N,statSync as Q}from"fs";import{join as B,resolve as w}from"path";import{homedir as Y}from"os";import{createRequire as ee}from"module";var C='run agentx notify "Hello" --title "Test"';function U(t,n){return t==="windows"?{fallback:"Windows PowerShell, and show its name",settings:"Open Settings \u203A System \u203A Notifications, turn notifications on, then turn on AgentX Helper and its banners.",missingFix:`${A(n)} Then ${C}.`,updateFix:`${A(n).replace(/^Put /,"Put a newer ")}`,osName:"Windows"}:{fallback:"Script Editor and show its icon",settings:"Open System Settings \u203A Notifications \u203A AgentX Helper, turn on Allow notifications and choose Banners.",missingFix:`Run agentx desktop install, then ${C} and click Allow.`,updateFix:"Run agentx desktop install to update it.",osName:"macOS"}}async function X(t={}){let n=t.platform??process.platform,e=t.helper===void 0?H():t.helper,i=b({},{platform:n,io:{capture:t.run,helper:e}}),s=i.banner;if(!s)return{state:"unsupported",message:"Desktop banners are only shown on macOS and Windows."};let o=U(i.os,n),a=await s.status();return a==="missing"?{state:"missing",message:`AgentX Helper is not installed, so banners come from ${o.fallback}.`,fix:o.missingFix}:a==="outdated"?{state:"outdated",path:e,message:"AgentX Helper is too old to report whether it may notify.",fix:o.updateFix}:a==="not-asked"?{state:"not-asked",path:e,message:`${o.osName} has not asked yet whether AgentX Helper may notify; banners come from ${o.fallback} until it does.`,fix:`${C[0].toUpperCase()}${C.slice(1)} and click Allow when ${o.osName} asks.`}:a==="not-allowed"?{state:"not-allowed",path:e,message:`${o.osName} does not allow AgentX Helper to notify, so banners come from ${o.fallback}.`,fix:o.settings}:a==="hidden"?{state:"hidden",path:e,message:"AgentX Helper may notify, but its banner style is None, so nothing appears on screen.",fix:o.settings}:{state:"ready",path:e,message:"AgentX Helper posts banners with the AgentX icon."}}async function te(t={}){let n=[];await re(n),ae(n);let e=le(n);return e&&ce(n,e),e&&fe(n,e),e&&he(n,e),e&&me(n,e),e&&ue(n,e),e&&n.push(...ge(e)),e&&we(n,e),e&&await ne(n,e),e&&oe(n,e),e&&await ie(n,e),e&&se(n,e),t.running!==!1&&e&&await ve(n,e),{checks:n,summary:J(n)}}var qe=new V().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 te({running:t.running!==!1});t.json?process.stdout.write(JSON.stringify({checks:n,summary:e},null,2)+`
1
+ import{a as q}from"./chunk-WMZ4TGMR.js";import{a as D,b as F}from"./chunk-2YDG5CSS.js";import{A as S,G as H,I as b,K as _,N as M,q as A,x as W}from"./chunk-U5DSMDCJ.js";import{c as P}from"./chunk-LY4G7PCW.js";import{a as L}from"./chunk-OSH2PEBH.js";import{Ob as E,jc as T,tc as K}from"./chunk-4A6UVU2X.js";K();import{Command as V}from"commander";import f from"chalk";import{execFileSync as m}from"child_process";import{accessSync as z,constants as G,existsSync as k,readFileSync as $,readdirSync as N,statSync as Q}from"fs";import{join as B,resolve as w}from"path";import{homedir as Y}from"os";import{createRequire as ee}from"module";var C='run agentx notify "Hello" --title "Test"';function U(t,n){return t==="windows"?{fallback:"Windows PowerShell, and show its name",settings:"Open Settings \u203A System \u203A Notifications, turn notifications on, then turn on AgentX Helper and its banners.",missingFix:`${A(n)} Then ${C}.`,updateFix:`${A(n).replace(/^Put /,"Put a newer ")}`,osName:"Windows"}:{fallback:"Script Editor and show its icon",settings:"Open System Settings \u203A Notifications \u203A AgentX Helper, turn on Allow notifications and choose Banners.",missingFix:`Run agentx desktop install, then ${C} and click Allow.`,updateFix:"Run agentx desktop install to update it.",osName:"macOS"}}async function X(t={}){let n=t.platform??process.platform,e=t.helper===void 0?H():t.helper,i=b({},{platform:n,io:{capture:t.run,helper:e}}),s=i.banner;if(!s)return{state:"unsupported",message:"Desktop banners are only shown on macOS and Windows."};let o=U(i.os,n),a=await s.status();return a==="missing"?{state:"missing",message:`AgentX Helper is not installed, so banners come from ${o.fallback}.`,fix:o.missingFix}:a==="outdated"?{state:"outdated",path:e,message:"AgentX Helper is too old to report whether it may notify.",fix:o.updateFix}:a==="not-asked"?{state:"not-asked",path:e,message:`${o.osName} has not asked yet whether AgentX Helper may notify; banners come from ${o.fallback} until it does.`,fix:`${C[0].toUpperCase()}${C.slice(1)} and click Allow when ${o.osName} asks.`}:a==="not-allowed"?{state:"not-allowed",path:e,message:`${o.osName} does not allow AgentX Helper to notify, so banners come from ${o.fallback}.`,fix:o.settings}:a==="hidden"?{state:"hidden",path:e,message:"AgentX Helper may notify, but its banner style is None, so nothing appears on screen.",fix:o.settings}:{state:"ready",path:e,message:"AgentX Helper posts banners with the AgentX icon."}}async function te(t={}){let n=[];await re(n),ae(n);let e=le(n);return e&&ce(n,e),e&&fe(n,e),e&&he(n,e),e&&me(n,e),e&&ue(n,e),e&&n.push(...ge(e)),e&&we(n,e),e&&await ne(n,e),e&&oe(n,e),e&&await ie(n,e),e&&se(n,e),t.running!==!1&&e&&await ve(n,e),{checks:n,summary:J(n)}}var qe=new V().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 te({running:t.running!==!1});t.json?process.stdout.write(JSON.stringify({checks:n,summary:e},null,2)+`
2
2
  `):ke(n),process.exit(e.errors>0?1:0)});async function ne(t,n,e=X){if(!_(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 ie(t,n,e){let i;try{i=await(e??b(n)).describe()}catch(o){t.push({severity:"warn",group:"Native",title:"Native apps: could not be read",detail:o?.message??String(o)});return}let s=["tasks","notes","banner","sound","focus"].filter(o=>i[o]);t.push({severity:"ok",group:"Native",title:i.os==="none"?"Native apps: none on this machine":`Native apps (${i.os}): ${s.join(", ")||"nothing available"}`,detail:i.problems.join(" ")||void 0})}function se(t,n,e=process.cwd(),i=b(n)){let s=n.native?.mirror;if(!s?.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 o=M(e),a=Object.values(o.items),l=a.filter(g=>g.state==="open").length,p=a.filter(g=>g.state==="failed").length;t.push({severity:o.lastError||p?"warn":"ok",group:"Native",title:`Reminders mirror: ${l} open in "${s.list}"${p?`, ${p} could not be added`:""}`,detail:o.lastError?`Last error ${o.lastError.at}: ${o.lastError.message}`:void 0,fix:o.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 oe(t,n,e=process.platform,i=s=>{try{return z(s,G.X_OK),!0}catch{return!1}}){let s=n.reminders;if(!s?.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 o=s.command||"remindctl",a=o.includes("/")?i(o)?o:null:S(o,process.env.PATH||"",i);t.push(a?{severity:"ok",group:"Reminders",title:`Watching ${(s.lists||[]).join(", ")} for due reminders`,detail:a}:{severity:"fail",group:"Reminders",title:`${o} 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 re(t){let n=L(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 s=e("claude");if(s){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:s})}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 o=e("codex");if(o){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:o})}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{ee(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 ae(t){if(process.platform!=="darwin")return;let n=B(Y(),"Library/LaunchAgents"),e=[];try{e=N(n).filter(s=>/agentx\.voice.*\.plist$/.test(s))}catch{return}let i=s=>{try{return z(s,G.X_OK),!0}catch{return!1}};for(let s of e){let o=W($(B(n,s),"utf-8")),a=S("ffmpeg",o,i);t.push(a?{severity:"ok",group:"Desktop",title:"ffmpeg reachable by the desktop app",detail:`${a} (${s})`}:{severity:"warn",group:"Desktop",title:"ffmpeg not reachable by the desktop app",detail:`Local Whisper transcription fails without it. ${s} sets PATH to ${o}.`,fix:"Install ffmpeg (brew install ffmpeg), then rerun agentx desktop install."})}}function le(t){let n=w(process.cwd(),"agentx.json");if(!k(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($(n,"utf-8"))}catch(a){return t.push({severity:"fail",group:"Config",title:"agentx.json is not valid JSON",detail:a.message}),null}try{T(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 s=Object.entries(e.agents||{}).filter(([,a])=>a.tier==="codex-cli");s.length>0&&((()=>{try{return m(process.platform==="win32"?"where":"which",["codex"],{stdio:"ignore"}),!0}catch{return!1}})()||t.push({severity:"fail",group:"Config",title:`${s.length} agent(s) use codex-cli tier but codex CLI is missing`,detail:s.map(([l])=>l).join(", "),fix:"Install Codex CLI with `npm i -g @openai/codex` or switch these agents to tier=claude-code."}));let o=Object.entries(e.agents||{}).filter(([,a])=>a.tier==="opencode");return o.length>0&&((()=>{try{return m(process.platform==="win32"?"where":"which",["opencode"],{stdio:"ignore"}),!0}catch{return!1}})()||t.push({severity:"fail",group:"Config",title:`${o.length} agent(s) use opencode tier but OpenCode CLI is missing`,detail:o.map(([l])=>l).join(", "),fix:"Install OpenCode from https://opencode.ai/docs/ or switch these agents to another tier."})),e}function ce(t,n){let e=new Set;if(j(n,e),e.size===0){t.push({severity:"ok",group:"Secrets",title:"No ${VAR} references in agentx.json"});return}let i=R(),s=[],o=[];for(let a of e){let l=process.env[a]??i[a];l===void 0?s.push(a):(!l.trim()||/^["']?\s*["']?$/.test(l))&&o.push(a)}s.length===0&&o.length===0?t.push({severity:"ok",group:"Secrets",title:`${e.size} env reference(s) resolved`}):(s.length>0&&t.push({severity:"fail",group:"Secrets",title:`${s.length} env var(s) referenced in agentx.json but missing`,detail:s.join(", "),fix:`Add to .env \u2014 e.g. ${s[0]}=<value>`}),o.length>0&&t.push({severity:"warn",group:"Secrets",title:`${o.length} env var(s) set but empty`,detail:o.join(", ")}))}function R(){let t=w(process.cwd(),".env"),n={};if(k(t))for(let e of $(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 de(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.",s=[];for(let o of t){let a=(o.token??"").trim();a?n&&a===n&&s.push({severity:"warn",group:"Mesh",title:`mesh peer "${o.name}" uses this node's own MESH_TOKEN`,detail:e,fix:i}):s.push({severity:"warn",group:"Mesh",title:`mesh peer "${o.name}" has no token; calls to it use the shared MESH_TOKEN`,detail:e,fix:i})}return t.length>0&&s.length===0&&s.push({severity:"ok",group:"Mesh",title:`${t.length} mesh peer(s), each with a token of its own`}),s}function ue(t,n){t.push(...pe(n))}function pe(t,n=process.env,e=R()){let i=a=>(n[a]||e[a]||"").trim(),s=a=>typeof a=="string"?a.replace(/\$\{([A-Z_][A-Z0-9_]*)\}/gi,(l,p)=>i(p)):void 0,o=(t.mesh?.peers??[]).filter(a=>typeof a?.name=="string").map(a=>({name:a.name,token:s(a.token)}));return de(o,i("MESH_TOKEN")||void 0)}function ge(t,n=process.env,e=R()){let i=[],s=0;for(let[o,a]of Object.entries(t.agents||{}))for(let[l,p]of Object.entries(a?.mcp||{})){let g=P(p??{});if(g.length===0)continue;s++;let y=g.filter(r=>!(n[r]||e[r]||"").trim());y.length>0&&i.push({severity:"fail",group:"Secrets",title:`MCP server "${l}" of ${o}: header variable(s) not set`,detail:y.join(", "),fix:`Add to .env \u2014 e.g. ${y[0]}=<value>, then restart the daemon`})}return s>0&&i.length===0&&i.push({severity:"ok",group:"Secrets",title:`${s} MCP server(s) with header variables, all set`}),i}function j(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)j(e,n);else if(t&&typeof t=="object")for(let e of Object.values(t))j(e,n)}function fe(t,n){let e=[];for(let[i,s]of Object.entries(n.agents||{})){if(!s.workspace)continue;let o=s.workspace.startsWith("/")?s.workspace:w(process.cwd(),s.workspace);try{Q(o).isDirectory()||e.push(`${i}: ${o} (exists but not a directory)`)}catch{e.push(`${i}: ${o}`)}}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 he(t,n){let e=/\$\{[A-Za-z_][A-Za-z0-9_]*\}/g,i=[];for(let[s,o]of Object.entries(n.agents||{})){if(!o.workspace)continue;let a=o.workspace.startsWith("/")?o.workspace:w(process.cwd(),o.workspace);for(let l of["settings.json","settings.local.json"]){let p=w(a,".claude",l);if(!k(p))continue;let g;try{g=JSON.parse($(p,"utf-8"))}catch(u){i.push({severity:"fail",agent:s,msg:`${l}: JSON parse error \u2014 ${u.message}`});continue}let y=g.env||{};for(let[u,h]of Object.entries(y)){if(typeof h!="string")continue;let c=h.match(e);c&&i.push({severity:"fail",agent:s,msg:`${l} env.${u} contains unexpanded ${[...new Set(c)].join(",")} \u2014 Claude Code does NOT expand \${VAR} in settings.json (use a fully-literal value)`})}let r=y.PATH;if(typeof r=="string"){let u=r.split(":").filter(Boolean);u.includes("/usr/bin")||i.push({severity:"fail",agent:s,msg:`${l} env.PATH missing /usr/bin \u2014 cat/head/sh/which will fail`}),u.includes("/bin")||i.push({severity:"fail",agent:s,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 u=d.allow,h=d.deny;Array.isArray(u)&&u.length===0&&Array.isArray(h)&&h.length>0&&i.push({severity:"warn",agent:s,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 s of i)t.push({severity:s.severity,group:"Workspace settings",title:`${s.agent}: ${s.msg}`,fix:s.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 me(t,n){let e=n.webhooks??[],i=[],s=w(process.cwd(),n.workflows?.dir||".agentx/workflows"),o=new Set;try{if(k(s))for(let r of N(s))r.endsWith(".json")&&!r.startsWith("_")&&!r.endsWith(".disabled.json")&&o.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,u]of Object.entries(r.triggers))o.size>0&&!o.has(u)&&i.push({severity:"fail",title:`webhook "${r.id}".triggers["${d}"] -> "${u}" \u2014 no such workflow under ${n.workflows?.dir||".agentx/workflows"}`,fix:"Create the workflow file or fix the id in agentx.json"});r.defaultWorkflow&&o.size>0&&!o.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(k(s)){for(let r of N(s))if(!(!r.endsWith(".json")||r.startsWith("_")||r.endsWith(".disabled.json")))try{let d=JSON.parse($(w(s,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 p=new Map;for(let r of e){if(!r.enabled)continue;let d=`${r.source}:${r.agentId}`,u=p.get(d);u?i.push({severity:"warn",title:`webhook entries "${u}" 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."}):p.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 y=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",...E,...Object.keys(D)]);for(let[r,d]of Object.entries(n.agents??{})){let u=d.integrations??[];if(!u.length)continue;let h=new Set;for(let c of u){let O=`${c.kind}::${c.label}`;h.has(O)&&i.push({severity:"warn",title:`agents.${r}.integrations: duplicate (${c.kind}, ${c.label})`,fix:"Remove the duplicate or rename one. (kind, label) must be unique per agent."}),h.add(O),y.has(c.kind)||i.push({severity:"warn",title:`agents.${r}.integrations: unknown kind "${c.kind}" on integration "${c.label}"`,fix:'Use a canonical kind from INTEGRATION_KINDS, or "custom" for ad-hoc services.'});let Z=c.credentials||{};for(let[x,v]of Object.entries(Z))typeof v=="string"&&/^[A-Z][A-Z0-9_]*$/.test(v)&&!process.env[v]&&i.push({severity:"warn",title:`agents.${r}.integrations[${c.kind}/${c.label}].${x} -> $${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.`});let I=c.enabled===!1?null:F(c.kind);if(I){let x=q(r,c,I);for(let v of x.problems)/env var .* is unset/.test(v)||i.push({severity:"warn",title:`agents.${r}.integrations[${c.kind}/${c.label}]: ${v}`,fix:x.connected?`Run agentx agent integrations status ${r} for details.`:`Run agentx agent integrations connect ${r} ${c.kind}${c.label!==c.kind?` --label "${c.label}"`:""}.`})}}}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 ye(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 ve(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 s=new AbortController,o=setTimeout(()=>s.abort(),2e3),a=await fetch(e+"/health",{headers:i,signal:s.signal});if(clearTimeout(o),!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 p=ye(l.voice);p&&t.push(p)}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 we(t,n){let e=Object.entries(n.agents||{}).filter(([,s])=>s?.codegraph===!0&&(s.tier==="claude-code"||s.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 s;try{s=m("codegraph",["--version"],{encoding:"utf-8",timeout:3e3}).trim()}catch{}t.push({severity:"ok",group:"CodeGraph",title:`codegraph CLI ${s||"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[s,o]of e){if(!o.workspace||!k(o.workspace)){t.push({severity:"warn",group:"CodeGraph",title:`${s}: workspace missing`,detail:`Workspace path ${o.workspace} does not exist \u2014 codegraph will skip this agent.`});continue}let a=w(o.workspace,".codegraph","codegraph.db");k(a)?t.push({severity:"ok",group:"CodeGraph",title:`${s}: index present`,detail:a}):t.push({severity:"warn",group:"CodeGraph",title:`${s}: index not built yet`,detail:".codegraph/ missing \u2014 daemon will background-index this workspace on next boot.",fix:`Run \`codegraph init --index ${o.workspace}\` to build it now.`})}}function J(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 ke(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,s]of n){console.log(f.bold(" "+i));for(let o of s){let a=o.severity==="ok"?f.green("\u2713"):o.severity==="warn"?f.yellow("!"):f.red("\u2717");console.log(` ${a} ${o.title}`),o.detail&&console.log(f.dim(" "+o.detail.replace(/\n/g,`
6
6
  `))),o.fix&&console.log(f.dim(" \u2192 "+o.fix))}console.log()}let e=J(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{X as a,te as b,qe as c,ne as d,ie as e,se as f,oe as g,de as h,pe as i,ge as j,ye as k};
7
- //# sourceMappingURL=chunk-4ZD2C76P.js.map
7
+ //# sourceMappingURL=chunk-YTWRIIAT.js.map
@@ -0,0 +1,6 @@
1
+ import{appendFileSync as p,readFileSync as f,renameSync as b,statSync as S,writeFileSync as R}from"fs";var _="_query-runs.jsonl",Q=1e6;function y(r){return r==="error"||r==="no-catalog"}function h(r,s,n){p(r,`${JSON.stringify(s)}
2
+ `),S(r).size>n&&M(r,Math.floor(n/2))}function w(r,s,n=Q){try{h(r,s,n)}catch{}}function M(r,s){let n=f(r,"utf-8").split(`
3
+ `).filter(Boolean),u=[],a=0;for(let e=n.length-1;e>=0&&(a+=Buffer.byteLength(n[e])+1,!(a>s));e--)u.push(n[e]);let i=`${r}.${process.pid}.tmp`;R(i,u.reverse().map(e=>`${e}
4
+ `).join("")),b(i,r)}async function N(r,s,n,u){let a=Date.now(),i=(e,c)=>w(r,{at:new Date().toISOString(),agent:s,status:e,method:c,source:n,wallMs:Date.now()-a});try{let e=await u();return i(e.status,e.method),e}catch(e){throw i("error"),e}}function P(r,s){let n=r.split(`
5
+ `).filter(Boolean).flatMap(t=>{try{let o=JSON.parse(t);return o&&typeof o.status=="string"&&typeof o.at=="string"?[o]:[]}catch{return[]}}).filter(t=>!s||t.at>=s),u={},a={},i={},e={},c=(t,o,d)=>{let g=t[o]??={total:0,failed:0};g.total++,d&&g.failed++};for(let t of n){c(i,typeof t.agent=="string"?t.agent:"",y(t.status)),c(e,t.at.slice(0,10),y(t.status)),u[t.status]=(u[t.status]??0)+1;let o=t.source??"cli";a[o]=(a[o]??0)+1}let l=n.filter(t=>t.status!=="no-catalog").map(t=>Number(t.wallMs)||0).sort((t,o)=>t-o),m=t=>l.length?l[Math.min(l.length-1,Math.floor(t*l.length))]:0;return{total:n.length,failed:n.filter(t=>y(t.status)).length,byStatus:u,bySource:a,byAgent:i,byDay:e,wallMsP50:m(.5),wallMsP95:m(.95)}}export{_ as a,Q as b,y as c,h as d,w as e,N as f,P as g};
6
+ //# sourceMappingURL=chunk-Z5CMA4JN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/wiki/query-runs.ts"],"sourcesContent":["/**\n * `wiki query` outcomes, one line per query in `_query-runs.jsonl` (#603).\n *\n * A failed query used to print plain text and exit 0, so nothing counted\n * it. Each query now appends its status and timing here, and\n * `wiki query-runs` counts them. No question, answer or error text goes\n * in the file.\n */\nimport { appendFileSync, readFileSync, renameSync, statSync, writeFileSync } from \"fs\"\nimport type { AgenticQueryResult } from \"./query\"\n\nexport const QUERY_RUNS_FILE = \"_query-runs.jsonl\"\n\n/** Past this size the file is cut to its newest half, so it never grows without a limit. */\nexport const QUERY_RUNS_MAX_BYTES = 1_000_000\n\nexport type QueryStatus = AgenticQueryResult[\"status\"]\n\n/** Where the query came from: the `wiki query` command or the `agentx_wiki_query` tool. */\nexport type QuerySource = \"cli\" | \"tool\"\n\nexport interface QueryRunRecord {\n at: string\n agent: string\n status: QueryStatus\n method?: string\n /** Missing on lines written before the tool was counted; those came from the CLI. */\n source?: QuerySource\n wallMs: number\n}\n\n/** Statuses that mean the query could not run, not that the wiki had no answer. */\nexport function queryFailed(status: QueryStatus): boolean {\n return status === \"error\" || status === \"no-catalog\"\n}\n\n/** Append one JSON line; past `maxBytes` the file is cut to its newest half. Throws on a write error. */\nexport function appendCappedLine(file: string, record: unknown, maxBytes: number): void {\n appendFileSync(file, `${JSON.stringify(record)}\\n`)\n if (statSync(file).size > maxBytes) trimToNewest(file, Math.floor(maxBytes / 2))\n}\n\n/** Append one record. Never throws: logging must not fail a query. */\nexport function recordQueryRun(file: string, record: QueryRunRecord, maxBytes = QUERY_RUNS_MAX_BYTES): void {\n try {\n appendCappedLine(file, record, maxBytes)\n } catch {\n // best-effort\n }\n}\n\n/** Keep the newest whole lines that fit in `bytes`. Written to a temp file and renamed, so a reader never sees half a file. */\nfunction trimToNewest(file: string, bytes: number): void {\n const lines = readFileSync(file, \"utf-8\").split(\"\\n\").filter(Boolean)\n const kept: string[] = []\n let size = 0\n for (let i = lines.length - 1; i >= 0; i--) {\n size += Buffer.byteLength(lines[i]) + 1\n if (size > bytes) break\n kept.push(lines[i])\n }\n const tmp = `${file}.${process.pid}.tmp`\n writeFileSync(tmp, kept.reverse().map((l) => `${l}\\n`).join(\"\"))\n renameSync(tmp, file)\n}\n\n/**\n * Run one query and record how it ended. A query that throws is recorded\n * as `error` and the error is thrown on, so no query goes uncounted.\n */\nexport async function timedQuery<T extends { status: QueryStatus; method?: string }>(\n file: string,\n agent: string,\n source: QuerySource,\n run: () => Promise<T>,\n): Promise<T> {\n const start = Date.now()\n const record = (status: QueryStatus, method?: string) =>\n recordQueryRun(file, { at: new Date().toISOString(), agent, status, method, source, wallMs: Date.now() - start })\n try {\n const result = await run()\n record(result.status, result.method)\n return result\n } catch (e) {\n record(\"error\")\n throw e\n }\n}\n\nexport interface QueryRunSummary {\n total: number\n failed: number\n byStatus: Record<string, number>\n bySource: Record<string, number>\n /** Queries and failures per asking agent (\"\" when none was known). */\n byAgent: Record<string, { total: number; failed: number }>\n /** Queries and failures per UTC day (YYYY-MM-DD). */\n byDay: Record<string, { total: number; failed: number }>\n /** Over queries that ran: `no-catalog` lines are left out. */\n wallMsP50: number\n wallMsP95: number\n}\n\n/** Count queries by status, on or after `since` (an ISO date or time) when given. */\nexport function summariseQueryRuns(text: string, since?: string): QueryRunSummary {\n const records: QueryRunRecord[] = text.split(\"\\n\").filter(Boolean).flatMap((l) => {\n try {\n const r = JSON.parse(l)\n return r && typeof r.status === \"string\" && typeof r.at === \"string\" ? [r] : []\n } catch { return [] }\n }).filter((r) => !since || r.at >= since)\n const byStatus: Record<string, number> = {}\n const bySource: Record<string, number> = {}\n const byAgent: Record<string, { total: number; failed: number }> = {}\n const byDay: Record<string, { total: number; failed: number }> = {}\n const tally = (map: Record<string, { total: number; failed: number }>, key: string, failed: boolean) => {\n const row = (map[key] ??= { total: 0, failed: 0 })\n row.total++\n if (failed) row.failed++\n }\n for (const r of records) {\n tally(byAgent, typeof r.agent === \"string\" ? r.agent : \"\", queryFailed(r.status))\n tally(byDay, r.at.slice(0, 10), queryFailed(r.status))\n byStatus[r.status] = (byStatus[r.status] ?? 0) + 1\n const source = r.source ?? \"cli\"\n bySource[source] = (bySource[source] ?? 0) + 1\n }\n // A `no-catalog` line never ran a query (the tool writes it with wallMs 0), so it would only pull the times down.\n const ms = records.filter((r) => r.status !== \"no-catalog\").map((r) => Number(r.wallMs) || 0).sort((a, b) => a - b)\n const pick = (q: number) => (ms.length ? ms[Math.min(ms.length - 1, Math.floor(q * ms.length))] : 0)\n return {\n total: records.length,\n failed: records.filter((r) => queryFailed(r.status)).length,\n byStatus,\n bySource,\n byAgent,\n byDay,\n wallMsP50: pick(0.5),\n wallMsP95: pick(0.95),\n }\n}\n"],"mappings":"AAQA,OAAS,kBAAAA,EAAgB,gBAAAC,EAAc,cAAAC,EAAY,YAAAC,EAAU,iBAAAC,MAAqB,KAG3E,IAAMC,EAAkB,oBAGlBC,EAAuB,IAkB7B,SAASC,EAAYC,EAA8B,CACxD,OAAOA,IAAW,SAAWA,IAAW,YAC1C,CAGO,SAASC,EAAiBC,EAAcC,EAAiBC,EAAwB,CACtFZ,EAAeU,EAAM,GAAG,KAAK,UAAUC,CAAM;AAAA,CAAK,EAC9CR,EAASO,CAAI,EAAE,KAAOE,GAAUC,EAAaH,EAAM,KAAK,MAAME,EAAW,CAAC,CAAC,CACjF,CAGO,SAASE,EAAeJ,EAAcC,EAAwBC,EAAWN,EAA4B,CAC1G,GAAI,CACFG,EAAiBC,EAAMC,EAAQC,CAAQ,CACzC,MAAE,CAEF,CACF,CAGA,SAASC,EAAaH,EAAcK,EAAqB,CACvD,IAAMC,EAAQf,EAAaS,EAAM,OAAO,EAAE,MAAM;AAAA,CAAI,EAAE,OAAO,OAAO,EAC9DO,EAAiB,CAAC,EACpBC,EAAO,EACX,QAASC,EAAIH,EAAM,OAAS,EAAGG,GAAK,IAClCD,GAAQ,OAAO,WAAWF,EAAMG,CAAC,CAAC,EAAI,EAClC,EAAAD,EAAOH,IAF0BI,IAGrCF,EAAK,KAAKD,EAAMG,CAAC,CAAC,EAEpB,IAAMC,EAAM,GAAGV,KAAQ,QAAQ,UAC/BN,EAAcgB,EAAKH,EAAK,QAAQ,EAAE,IAAKI,GAAM,GAAGA;AAAA,CAAK,EAAE,KAAK,EAAE,CAAC,EAC/DnB,EAAWkB,EAAKV,CAAI,CACtB,CAMA,eAAsBY,EACpBZ,EACAa,EACAC,EACAC,EACY,CACZ,IAAMC,EAAQ,KAAK,IAAI,EACjBf,EAAS,CAACH,EAAqBmB,IACnCb,EAAeJ,EAAM,CAAE,GAAI,IAAI,KAAK,EAAE,YAAY,EAAG,MAAAa,EAAO,OAAAf,EAAQ,OAAAmB,EAAQ,OAAAH,EAAQ,OAAQ,KAAK,IAAI,EAAIE,CAAM,CAAC,EAClH,GAAI,CACF,IAAME,EAAS,MAAMH,EAAI,EACzB,OAAAd,EAAOiB,EAAO,OAAQA,EAAO,MAAM,EAC5BA,CACT,OAAS,EAAP,CACA,MAAAjB,EAAO,OAAO,EACR,CACR,CACF,CAiBO,SAASkB,EAAmBC,EAAcC,EAAiC,CAChF,IAAMC,EAA4BF,EAAK,MAAM;AAAA,CAAI,EAAE,OAAO,OAAO,EAAE,QAAST,GAAM,CAChF,GAAI,CACF,IAAMY,EAAI,KAAK,MAAMZ,CAAC,EACtB,OAAOY,GAAK,OAAOA,EAAE,QAAW,UAAY,OAAOA,EAAE,IAAO,SAAW,CAACA,CAAC,EAAI,CAAC,CAChF,MAAE,CAAQ,MAAO,CAAC,CAAE,CACtB,CAAC,EAAE,OAAQA,GAAM,CAACF,GAASE,EAAE,IAAMF,CAAK,EAClCG,EAAmC,CAAC,EACpCC,EAAmC,CAAC,EACpCC,EAA6D,CAAC,EAC9DC,EAA2D,CAAC,EAC5DC,EAAQ,CAACC,EAAwDC,EAAaC,IAAoB,CACtG,IAAMC,EAAOH,EAAIC,CAAG,IAAM,CAAE,MAAO,EAAG,OAAQ,CAAE,EAChDE,EAAI,QACAD,GAAQC,EAAI,QAClB,EACA,QAAWT,KAAKD,EAAS,CACvBM,EAAMF,EAAS,OAAOH,EAAE,OAAU,SAAWA,EAAE,MAAQ,GAAI1B,EAAY0B,EAAE,MAAM,CAAC,EAChFK,EAAMD,EAAOJ,EAAE,GAAG,MAAM,EAAG,EAAE,EAAG1B,EAAY0B,EAAE,MAAM,CAAC,EACrDC,EAASD,EAAE,MAAM,GAAKC,EAASD,EAAE,MAAM,GAAK,GAAK,EACjD,IAAMT,EAASS,EAAE,QAAU,MAC3BE,EAASX,CAAM,GAAKW,EAASX,CAAM,GAAK,GAAK,EAG/C,IAAMmB,EAAKX,EAAQ,OAAQC,GAAMA,EAAE,SAAW,YAAY,EAAE,IAAKA,GAAM,OAAOA,EAAE,MAAM,GAAK,CAAC,EAAE,KAAK,CAACW,EAAGC,IAAMD,EAAIC,CAAC,EAC5GC,EAAQC,GAAeJ,EAAG,OAASA,EAAG,KAAK,IAAIA,EAAG,OAAS,EAAG,KAAK,MAAMI,EAAIJ,EAAG,MAAM,CAAC,CAAC,EAAI,EAClG,MAAO,CACL,MAAOX,EAAQ,OACf,OAAQA,EAAQ,OAAQC,GAAM1B,EAAY0B,EAAE,MAAM,CAAC,EAAE,OACrD,SAAAC,EACA,SAAAC,EACA,QAAAC,EACA,MAAAC,EACA,UAAWS,EAAK,EAAG,EACnB,UAAWA,EAAK,GAAI,CACtB,CACF","names":["appendFileSync","readFileSync","renameSync","statSync","writeFileSync","QUERY_RUNS_FILE","QUERY_RUNS_MAX_BYTES","queryFailed","status","appendCappedLine","file","record","maxBytes","trimToNewest","recordQueryRun","bytes","lines","kept","size","i","tmp","l","timedQuery","agent","source","run","start","method","result","summariseQueryRuns","text","since","records","r","byStatus","bySource","byAgent","byDay","tally","map","key","failed","row","ms","a","b","pick","q"]}
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-L3BX5FJ3.js"),{installCliSignalExit:r}=await import("./signal-exit-C5EUGHKI.js"),{applyConnectAttemptTimeout:i,configPathFromArgv:a,readConnectAttemptTimeout:n}=await import("./net-family-X2P3OVDP.js");r();i(n(process.cwd(),a(process.argv.slice(2))));var t=await s();process.argv.slice(2).length===0?t.outputHelp():t.parse();
2
+ import{b as o}from"./chunk-OSH2PEBH.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-7QFRDJUY.js"),{installCliSignalExit:r}=await import("./signal-exit-C5EUGHKI.js"),{applyConnectAttemptTimeout:i,configPathFromArgv:a,readConnectAttemptTimeout:n}=await import("./net-family-X2P3OVDP.js");r();i(n(process.cwd(),a(process.argv.slice(2))));var t=await s();process.argv.slice(2).length===0?t.outputHelp():t.parse();
3
3
  //# sourceMappingURL=cli.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f,g}from"./chunk-7OJUZ3L5.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-SJLHZDIC.js.map
@@ -0,0 +1,2 @@
1
+ import{$b as n,Ob as a,Pb as b,Qb as c,Rb as d,Sb as e,Tb as f,Ub as g,Vb as h,Wb as i,Xb as j,Yb as k,Zb as l,_b as m,ac as o,bc as p,cc as q,dc as r,ec as s,fc as t,gc as u,hc as v,ic as w,jc as x,kc as y,lc as z,mc as A,nc as B,oc as C,pc as D,qc as E,rc as F,tc as G}from"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.js";import"./chunk-QIJLFPWE.js";G();export{a as INTEGRATION_KINDS,B as WIKI_CONTRIBUTE_JOB,C as WIKI_CONTRIBUTE_MERGE_JOB,E as WIKI_SUMMARIZE_JOB,s as approvalsConfigSchema,g as callsSchema,e as cameraBotSchema,z as crossFieldProblems,v as daemonConfigSchema,c as emailAccountSchema,b as eventSubscriptionSchema,w as expandEnvVars,r as improveConfigSchema,f as isCronExpression,y as literalSecretProblems,x as loadDaemonConfig,d as mailSenderSchema,o as membersConfigSchema,j as mergePolicyConfigSchema,t as numbersConfigSchema,n as peopleConfigSchema,m as personSchema,q as qualityReportConfigSchema,p as requestStatusConfigSchema,l as requestsConfigSchema,h as reviewGateConfigSchema,i as trackersConfigSchema,A as validateWorkspaces,u as wallConfigSchema,k as watchersConfigSchema,D as withContributionJobs,F as withSummariesJob};
2
+ //# sourceMappingURL=config-Q3ENZQYL.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-2ZNYIHRB.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
2
+ //# sourceMappingURL=config-mutate-NNAUMQ2Y.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"./chunk-LDSBFDYB.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-2F2BJNMA.js.map
@@ -1,4 +1,4 @@
1
- import{a as ee}from"./chunk-HY4PE6R3.js";import"./chunk-IHFOW4JF.js";import{f as Q,k as V}from"./chunk-IH65GDJR.js";import"./chunk-XHON5WB5.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import{b as O}from"./chunk-5ONH4ITT.js";import"./chunk-JRAG37V5.js";import"./chunk-ILEC3IAV.js";import"./chunk-BERWTVG2.js";import"./chunk-A7JSRDJL.js";import"./chunk-Z7632XS3.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import{b as N,c as H}from"./chunk-AHWWJ7AF.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-MIUITI47.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-KAM4ZWRE.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as le}from"crypto";import{existsSync as z,mkdirSync as ne,readdirSync as re,readFileSync as ge,renameSync as se,writeFileSync as pe}from"fs";import{resolve as w}from"path";var _={maxPatches:30,maxCostUsd:.5,maxItems:60},he=12,fe=2e3,me=1500,M=8,U=300,be=12,B="## Checked facts";function S(n){return w(n,"_contributions")}function E(n,r){if(!z(n))return r;try{return JSON.parse(ge(n,"utf-8"))}catch(t){throw new Error(`${n} is not valid JSON: ${t.message}`)}}function L(n,r){ne(w(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;pe(t,`${JSON.stringify(r,null,2)}
1
+ import{a as ee}from"./chunk-JTS563OC.js";import"./chunk-TO6T6AQY.js";import{f as Q,k as V}from"./chunk-IH65GDJR.js";import"./chunk-5SQRJUAK.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import{b as O}from"./chunk-5ONH4ITT.js";import"./chunk-JRAG37V5.js";import"./chunk-ILEC3IAV.js";import"./chunk-BERWTVG2.js";import"./chunk-A7JSRDJL.js";import"./chunk-T7SD5EVH.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import{b as N,c as H}from"./chunk-AHWWJ7AF.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-BLKXK27S.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-FXUTKU6R.js.map
57
+ //# sourceMappingURL=contributions-SOUGZCAH.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-HVMUYEQP.js";import"./chunk-QIJLFPWE.js";export{h as approvalRefusal,a as approvalsFile,i as approveDecision,e as approvedDecisionsOnly,b as decisionHash,g as decisionPagesFor,d as decisionState,f as decisionsForBlock,c as readApprovals,j as revokeDecision};
2
+ //# sourceMappingURL=decision-approvals-SWZ4RWFI.js.map
@@ -1,2 +1,2 @@
1
- import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j}from"./chunk-4ZD2C76P.js";import"./chunk-WMZ4TGMR.js";import"./chunk-2YDG5CSS.js";import"./chunk-OQNJIIR2.js";import"./chunk-IMLAPB7G.js";import"./chunk-QPABR72X.js";import"./chunk-KP7KDLZ2.js";import"./chunk-OQQTV3OF.js";import"./chunk-4NZ4T3TQ.js";import"./chunk-LY4G7PCW.js";import"./chunk-7IW25T4K.js";import"./chunk-Q3A5P373.js";import"./chunk-JLBRNYKY.js";import"./chunk-BYEL7KKR.js";import"./chunk-QUFIUXMQ.js";import"./chunk-OSH2PEBH.js";import"./chunk-7I7IEX4S.js";import"./chunk-KAM4ZWRE.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";export{j as daemonVoiceCheck,b as doctor,i as mcpHeaderEnvChecks,g as meshPeerTokenChecks,h as meshTokenChecksFromConfig,a as runDoctorChecks,e as runMirrorChecks,d as runNativeChecks,c as runNotificationChecks,f as runReminderChecks};
2
- //# sourceMappingURL=doctor-GP2KVKWE.js.map
1
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j}from"./chunk-YTWRIIAT.js";import"./chunk-WMZ4TGMR.js";import"./chunk-2YDG5CSS.js";import"./chunk-U5DSMDCJ.js";import"./chunk-IMLAPB7G.js";import"./chunk-QPABR72X.js";import"./chunk-KP7KDLZ2.js";import"./chunk-OQQTV3OF.js";import"./chunk-4NZ4T3TQ.js";import"./chunk-LY4G7PCW.js";import"./chunk-7IW25T4K.js";import"./chunk-Q3A5P373.js";import"./chunk-JLBRNYKY.js";import"./chunk-BYEL7KKR.js";import"./chunk-QUFIUXMQ.js";import"./chunk-OSH2PEBH.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.js";import"./chunk-QIJLFPWE.js";export{j as daemonVoiceCheck,b as doctor,i as mcpHeaderEnvChecks,g as meshPeerTokenChecks,h as meshTokenChecksFromConfig,a as runDoctorChecks,e as runMirrorChecks,d as runNativeChecks,c as runNotificationChecks,f as runReminderChecks};
2
+ //# sourceMappingURL=doctor-H6I433KY.js.map
@@ -1,7 +1,7 @@
1
- import{b as h}from"./chunk-UUOCCLIL.js";import"./chunk-RKPAVWXF.js";import{b as I}from"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import"./chunk-H4DWZIU7.js";import"./chunk-CAH6TNC6.js";import"./chunk-N476XZD3.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-KAM4ZWRE.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-YSCT6DPR.js";import"./chunk-VQRY4IDI.js";import"./chunk-QIJLFPWE.js";var p=t=>typeof t=="string"?t.trim():"";function $(t){return[`Run ${t.runId} "${t.title}" [${t.status}] on step ${t.step}: waiting on ${t.waitingOn}.`,t.tags?.length?`Tags: ${t.tags.join(", ")}`:"",...(t.steps??[]).slice(-8).map(s=>`- ${String(s.at).slice(0,16).replace("T"," ")} ${s.step} ${s.status}${s.note?`: ${s.note}`:""}`)].filter(Boolean).join(`
1
+ import{b as h}from"./chunk-MOEXP6U3.js";import"./chunk-RKPAVWXF.js";import{b as I}from"./chunk-IFUAP7UD.js";import"./chunk-KP7KDLZ2.js";import"./chunk-F32VADB7.js";import"./chunk-AU7SN4G3.js";import"./chunk-LDSBFDYB.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-C4PLLZIT.js.map
7
+ //# sourceMappingURL=follow-up-tool-4FX455DL.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-TFHJT2AZ.js";import"./chunk-JMWPBZLU.js";import"./chunk-T7SD5EVH.js";import"./chunk-WPNRDEHW.js";import"./chunk-OWNQ2FD4.js";import"./chunk-AHWWJ7AF.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-BLKXK27S.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4A6UVU2X.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as WikiHub,a as existingWikiDir};
2
+ //# sourceMappingURL=hub-XFZFHLJK.js.map