agentix-cli 0.133.0 → 0.135.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 (199) hide show
  1. package/dist/{App-WQPA77VJ.js → App-4UVAI5C5.js} +2 -2
  2. package/dist/{ChatApp-TGW66I4Y.js → ChatApp-COO67WIR.js} +2 -2
  3. package/dist/absorb-eval-WY3YMLS4.js +2 -0
  4. package/dist/{agent-FWHYHXWC.js → agent-3R5NY7I3.js} +2 -2
  5. package/dist/{board-dashboard-GKE4KWJH.js → board-dashboard-U3ZSCO62.js} +24 -8
  6. package/dist/board-dashboard-U3ZSCO62.js.map +1 -0
  7. package/dist/{chunk-ZN5DC6WS.js → chunk-3XVST5XX.js} +2 -2
  8. package/dist/{note-reader-LPPIYYLT.js → chunk-4LWFJ4MZ.js} +3 -3
  9. package/dist/{note-reader-LPPIYYLT.js.map → chunk-4LWFJ4MZ.js.map} +1 -1
  10. package/dist/{chunk-F5PVUB4Y.js → chunk-4XMALK7X.js} +2 -2
  11. package/dist/{chunk-VH2ASPFQ.js → chunk-5NT44FKL.js} +2 -2
  12. package/dist/{chunk-HIUHKOKK.js → chunk-6WF56ME6.js} +2 -2
  13. package/dist/{chunk-MCBTVNPX.js → chunk-BQIWMQNU.js} +2 -2
  14. package/dist/{chunk-2BF6HJJD.js → chunk-DYGQF3MI.js} +4 -4
  15. package/dist/chunk-DYGQF3MI.js.map +1 -0
  16. package/dist/{chunk-4NEO5KB2.js → chunk-EEBK4F6E.js} +15 -15
  17. package/dist/chunk-EEBK4F6E.js.map +1 -0
  18. package/dist/{chunk-JA5Y4LDP.js → chunk-ERULJ2ZL.js} +2 -2
  19. package/dist/{chunk-RJFPCW7T.js → chunk-FWDRBUMS.js} +2 -2
  20. package/dist/{chunk-SJPQQ4OF.js → chunk-GSKJ57XY.js} +234 -234
  21. package/dist/chunk-GSKJ57XY.js.map +1 -0
  22. package/dist/{chunk-4XPVU3N2.js → chunk-H6VWU2HN.js} +2 -2
  23. package/dist/chunk-JRS5QRZG.js +2 -0
  24. package/dist/chunk-JRS5QRZG.js.map +1 -0
  25. package/dist/{chunk-5BI2T3WD.js → chunk-JTDUTCUE.js} +3 -3
  26. package/dist/chunk-JTDUTCUE.js.map +1 -0
  27. package/dist/{chunk-KUOH5MFS.js → chunk-K445URSN.js} +2 -2
  28. package/dist/{chunk-4VVHGR7H.js → chunk-KEXBEUSU.js} +1 -1
  29. package/dist/{chunk-4VVHGR7H.js.map → chunk-KEXBEUSU.js.map} +1 -1
  30. package/dist/chunk-L5UGH4T4.js +160 -0
  31. package/dist/chunk-L5UGH4T4.js.map +1 -0
  32. package/dist/{chunk-V4IFJLQS.js → chunk-LU7GDHGD.js} +2 -2
  33. package/dist/{chunk-D5IHICX3.js → chunk-LUYN6RAC.js} +2 -2
  34. package/dist/chunk-MI7WOGH6.js +4 -0
  35. package/dist/chunk-MI7WOGH6.js.map +1 -0
  36. package/dist/chunk-NY7NHGVT.js +105 -0
  37. package/dist/chunk-NY7NHGVT.js.map +1 -0
  38. package/dist/chunk-NZQBS7GN.js +2 -0
  39. package/dist/{chunk-KBJNJGBP.js.map → chunk-NZQBS7GN.js.map} +1 -1
  40. package/dist/{chunk-3TETB22A.js → chunk-P3I7AATX.js} +2 -2
  41. package/dist/chunk-QAWKN2N4.js +3 -0
  42. package/dist/chunk-QAWKN2N4.js.map +1 -0
  43. package/dist/chunk-QDWEM4DG.js +41 -0
  44. package/dist/chunk-QDWEM4DG.js.map +1 -0
  45. package/dist/{chunk-JP5OAMWQ.js → chunk-RGZARSHV.js} +1 -1
  46. package/dist/{chunk-JP5OAMWQ.js.map → chunk-RGZARSHV.js.map} +1 -1
  47. package/dist/{chunk-GZY5DYXT.js → chunk-RRGITX5B.js} +2 -2
  48. package/dist/{chunk-PHCWYKQW.js → chunk-RVEMX5MJ.js} +2 -2
  49. package/dist/{chunk-PHCWYKQW.js.map → chunk-RVEMX5MJ.js.map} +1 -1
  50. package/dist/{chunk-GUEIF7ZF.js → chunk-SMAI7U6H.js} +2 -2
  51. package/dist/{chunk-S2UXDEGW.js → chunk-SSQMFHSM.js} +2 -2
  52. package/dist/chunk-WWDYDLY2.js +55 -0
  53. package/dist/chunk-WWDYDLY2.js.map +1 -0
  54. package/dist/{chunk-ANC5QXFB.js → chunk-XOUO4XNA.js} +2 -2
  55. package/dist/chunk-YA3P77LV.js +87 -0
  56. package/dist/chunk-YA3P77LV.js.map +1 -0
  57. package/dist/{chunk-OQV3LWJI.js → chunk-ZFRXFUP7.js} +2 -2
  58. package/dist/{chunk-F7GKG5ZO.js → chunk-ZGVVYJIK.js} +3 -3
  59. package/dist/chunk-ZGVVYJIK.js.map +1 -0
  60. package/dist/cli.js +1 -1
  61. package/dist/{client-7UW2ELPP.js → client-NFPBE6L4.js} +2 -2
  62. package/dist/{config-TNYVPT4R.js → config-GHMRBRDL.js} +2 -2
  63. package/dist/{config-mutate-GV7BVG3I.js → config-mutate-2XV27EFV.js} +2 -2
  64. package/dist/config-mutator-6ITNU5DT.js +2 -0
  65. package/dist/{contributions-J57B3KIX.js → contributions-KLRJ4ZXV.js} +2 -2
  66. package/dist/{contributions-J57B3KIX.js.map → contributions-KLRJ4ZXV.js.map} +1 -1
  67. package/dist/{doctor-ROKIYJRT.js → doctor-UBXVMGJG.js} +2 -2
  68. package/dist/{enrich-NH3WHKD6.js → enrich-ZB5I7KHN.js} +2 -2
  69. package/dist/event-levels-CQWHSLMT.js +3 -0
  70. package/dist/event-levels-CQWHSLMT.js.map +1 -0
  71. package/dist/{follow-up-tool-S2U7DFSW.js → follow-up-tool-EARVITTS.js} +2 -2
  72. package/dist/graph-ZVKV3JBD.js +2 -0
  73. package/dist/hub-TILTOOSS.js +2 -0
  74. package/dist/index.d.ts +281 -84
  75. package/dist/index.js +1 -1
  76. package/dist/index.js.map +1 -1
  77. package/dist/load-EOZUZK7U.js +2 -0
  78. package/dist/model-call-PKV5UAQ7.js +2 -0
  79. package/dist/note-reader-IDE6RI34.js +2 -0
  80. package/dist/notes-settings-VPXI5IIS.js +2 -0
  81. package/dist/{program-LAOU5DQ3.js → program-U3HJY7E5.js} +262 -264
  82. package/dist/program-U3HJY7E5.js.map +1 -0
  83. package/dist/{promote-FVWRM4BE.js → promote-RHVZB2QZ.js} +2 -2
  84. package/dist/push-bridge-325SXDGN.js +1 -1
  85. package/dist/query-OZXZVLO7.js +2 -0
  86. package/dist/query-runs-7VX3YAC3.js +4 -0
  87. package/dist/query-runs-7VX3YAC3.js.map +1 -0
  88. package/dist/query-settings-2MGUS6AY.js +3 -0
  89. package/dist/query-settings-2MGUS6AY.js.map +1 -0
  90. package/dist/registry-LZLIPP7N.js +2 -0
  91. package/dist/{request-planner-JOXSAAHO.js → request-planner-MFAIVLUQ.js} +2 -2
  92. package/dist/{review-candidates-6N5435V7.js → review-candidates-6WMDVVIZ.js} +2 -2
  93. package/dist/roster-BZGKG2ZA.js +2 -0
  94. package/dist/{routing-6G2QVFIG.js → routing-OPCLHIYW.js} +2 -2
  95. package/dist/schedule-tool-KPVTMYL3.js +2 -0
  96. package/dist/{scheduler-WOH2O3EP.js → scheduler-G3WWYETY.js} +2 -2
  97. package/dist/score-DZGPLHCL.js +3 -0
  98. package/dist/score-DZGPLHCL.js.map +1 -0
  99. package/dist/{seat-I2FBJDTV.js → seat-3HM4J7IX.js} +2 -2
  100. package/dist/{select-5YZQJLLD.js → select-VEFE2ESF.js} +2 -2
  101. package/dist/{set-enabled-CQEUZLHU.js → set-enabled-US5BYKFZ.js} +2 -2
  102. package/dist/{tool-PIJXUBEC.js → tool-HUSCHORN.js} +2 -2
  103. package/dist/{tool-R77KFLZ3.js → tool-XLWLXGB5.js} +2 -2
  104. package/dist/types-ARP27T6T.js +2 -0
  105. package/dist/types-LJZ2YY5W.js +2 -0
  106. package/dist/types-LJZ2YY5W.js.map +1 -0
  107. package/dist/wiki-GCRRINW3.js +2 -0
  108. package/dist/wiki-GCRRINW3.js.map +1 -0
  109. package/dist/wiki-enrich-P5TNWACZ.js +2 -0
  110. package/dist/wiki-enrich-P5TNWACZ.js.map +1 -0
  111. package/package.json +1 -1
  112. package/dist/absorb-eval-37XZJACN.js +0 -2
  113. package/dist/board-dashboard-GKE4KWJH.js.map +0 -1
  114. package/dist/chunk-2BF6HJJD.js.map +0 -1
  115. package/dist/chunk-4NEO5KB2.js.map +0 -1
  116. package/dist/chunk-57Y2WZT2.js +0 -55
  117. package/dist/chunk-57Y2WZT2.js.map +0 -1
  118. package/dist/chunk-5BI2T3WD.js.map +0 -1
  119. package/dist/chunk-7VLLZQ3N.js +0 -2
  120. package/dist/chunk-7VLLZQ3N.js.map +0 -1
  121. package/dist/chunk-BI6VG4DV.js +0 -37
  122. package/dist/chunk-BI6VG4DV.js.map +0 -1
  123. package/dist/chunk-F7GKG5ZO.js.map +0 -1
  124. package/dist/chunk-IDZXAOBC.js +0 -156
  125. package/dist/chunk-IDZXAOBC.js.map +0 -1
  126. package/dist/chunk-IZDKRNXC.js +0 -52
  127. package/dist/chunk-IZDKRNXC.js.map +0 -1
  128. package/dist/chunk-KBJNJGBP.js +0 -2
  129. package/dist/chunk-KFIJDLQ5.js +0 -3
  130. package/dist/chunk-KFIJDLQ5.js.map +0 -1
  131. package/dist/chunk-RTHZQGFC.js +0 -105
  132. package/dist/chunk-RTHZQGFC.js.map +0 -1
  133. package/dist/chunk-SJPQQ4OF.js.map +0 -1
  134. package/dist/config-mutator-AKCR3VKM.js +0 -2
  135. package/dist/graph-EXDH7EPZ.js +0 -2
  136. package/dist/hub-HOVJC4HR.js +0 -2
  137. package/dist/load-5DNMGHFW.js +0 -2
  138. package/dist/model-call-BGTDPWZD.js +0 -2
  139. package/dist/notes-settings-WMOH2V75.js +0 -2
  140. package/dist/program-LAOU5DQ3.js.map +0 -1
  141. package/dist/query-HBCL3FHO.js +0 -2
  142. package/dist/query-settings-RD6GEN2V.js +0 -3
  143. package/dist/query-settings-RD6GEN2V.js.map +0 -1
  144. package/dist/registry-NT4H7HYP.js +0 -2
  145. package/dist/roster-IRXP32XF.js +0 -2
  146. package/dist/schedule-tool-3NYUPKSC.js +0 -2
  147. package/dist/score-KDNIUTNV.js +0 -3
  148. package/dist/score-KDNIUTNV.js.map +0 -1
  149. package/dist/types-ROL44T62.js +0 -2
  150. package/dist/wiki-GCOFERTB.js +0 -2
  151. /package/dist/{App-WQPA77VJ.js.map → App-4UVAI5C5.js.map} +0 -0
  152. /package/dist/{ChatApp-TGW66I4Y.js.map → ChatApp-COO67WIR.js.map} +0 -0
  153. /package/dist/{absorb-eval-37XZJACN.js.map → absorb-eval-WY3YMLS4.js.map} +0 -0
  154. /package/dist/{agent-FWHYHXWC.js.map → agent-3R5NY7I3.js.map} +0 -0
  155. /package/dist/{chunk-ZN5DC6WS.js.map → chunk-3XVST5XX.js.map} +0 -0
  156. /package/dist/{chunk-F5PVUB4Y.js.map → chunk-4XMALK7X.js.map} +0 -0
  157. /package/dist/{chunk-VH2ASPFQ.js.map → chunk-5NT44FKL.js.map} +0 -0
  158. /package/dist/{chunk-HIUHKOKK.js.map → chunk-6WF56ME6.js.map} +0 -0
  159. /package/dist/{chunk-MCBTVNPX.js.map → chunk-BQIWMQNU.js.map} +0 -0
  160. /package/dist/{chunk-JA5Y4LDP.js.map → chunk-ERULJ2ZL.js.map} +0 -0
  161. /package/dist/{chunk-RJFPCW7T.js.map → chunk-FWDRBUMS.js.map} +0 -0
  162. /package/dist/{chunk-4XPVU3N2.js.map → chunk-H6VWU2HN.js.map} +0 -0
  163. /package/dist/{chunk-KUOH5MFS.js.map → chunk-K445URSN.js.map} +0 -0
  164. /package/dist/{chunk-V4IFJLQS.js.map → chunk-LU7GDHGD.js.map} +0 -0
  165. /package/dist/{chunk-D5IHICX3.js.map → chunk-LUYN6RAC.js.map} +0 -0
  166. /package/dist/{chunk-3TETB22A.js.map → chunk-P3I7AATX.js.map} +0 -0
  167. /package/dist/{chunk-GZY5DYXT.js.map → chunk-RRGITX5B.js.map} +0 -0
  168. /package/dist/{chunk-GUEIF7ZF.js.map → chunk-SMAI7U6H.js.map} +0 -0
  169. /package/dist/{chunk-S2UXDEGW.js.map → chunk-SSQMFHSM.js.map} +0 -0
  170. /package/dist/{chunk-ANC5QXFB.js.map → chunk-XOUO4XNA.js.map} +0 -0
  171. /package/dist/{chunk-OQV3LWJI.js.map → chunk-ZFRXFUP7.js.map} +0 -0
  172. /package/dist/{client-7UW2ELPP.js.map → client-NFPBE6L4.js.map} +0 -0
  173. /package/dist/{config-TNYVPT4R.js.map → config-GHMRBRDL.js.map} +0 -0
  174. /package/dist/{config-mutate-GV7BVG3I.js.map → config-mutate-2XV27EFV.js.map} +0 -0
  175. /package/dist/{config-mutator-AKCR3VKM.js.map → config-mutator-6ITNU5DT.js.map} +0 -0
  176. /package/dist/{doctor-ROKIYJRT.js.map → doctor-UBXVMGJG.js.map} +0 -0
  177. /package/dist/{enrich-NH3WHKD6.js.map → enrich-ZB5I7KHN.js.map} +0 -0
  178. /package/dist/{follow-up-tool-S2U7DFSW.js.map → follow-up-tool-EARVITTS.js.map} +0 -0
  179. /package/dist/{graph-EXDH7EPZ.js.map → graph-ZVKV3JBD.js.map} +0 -0
  180. /package/dist/{hub-HOVJC4HR.js.map → hub-TILTOOSS.js.map} +0 -0
  181. /package/dist/{load-5DNMGHFW.js.map → load-EOZUZK7U.js.map} +0 -0
  182. /package/dist/{model-call-BGTDPWZD.js.map → model-call-PKV5UAQ7.js.map} +0 -0
  183. /package/dist/{notes-settings-WMOH2V75.js.map → note-reader-IDE6RI34.js.map} +0 -0
  184. /package/dist/{promote-FVWRM4BE.js.map → notes-settings-VPXI5IIS.js.map} +0 -0
  185. /package/dist/{query-HBCL3FHO.js.map → promote-RHVZB2QZ.js.map} +0 -0
  186. /package/dist/{registry-NT4H7HYP.js.map → query-OZXZVLO7.js.map} +0 -0
  187. /package/dist/{roster-IRXP32XF.js.map → registry-LZLIPP7N.js.map} +0 -0
  188. /package/dist/{request-planner-JOXSAAHO.js.map → request-planner-MFAIVLUQ.js.map} +0 -0
  189. /package/dist/{review-candidates-6N5435V7.js.map → review-candidates-6WMDVVIZ.js.map} +0 -0
  190. /package/dist/{routing-6G2QVFIG.js.map → roster-BZGKG2ZA.js.map} +0 -0
  191. /package/dist/{schedule-tool-3NYUPKSC.js.map → routing-OPCLHIYW.js.map} +0 -0
  192. /package/dist/{scheduler-WOH2O3EP.js.map → schedule-tool-KPVTMYL3.js.map} +0 -0
  193. /package/dist/{seat-I2FBJDTV.js.map → scheduler-G3WWYETY.js.map} +0 -0
  194. /package/dist/{types-ROL44T62.js.map → seat-3HM4J7IX.js.map} +0 -0
  195. /package/dist/{select-5YZQJLLD.js.map → select-VEFE2ESF.js.map} +0 -0
  196. /package/dist/{set-enabled-CQEUZLHU.js.map → set-enabled-US5BYKFZ.js.map} +0 -0
  197. /package/dist/{tool-PIJXUBEC.js.map → tool-HUSCHORN.js.map} +0 -0
  198. /package/dist/{tool-R77KFLZ3.js.map → tool-XLWLXGB5.js.map} +0 -0
  199. /package/dist/{wiki-GCOFERTB.js.map → types-ARP27T6T.js.map} +0 -0
@@ -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,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t}from"./chunk-VH2ASPFQ.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-MEFPXHQJ.js";import"./chunk-RTHZQGFC.js";import"./chunk-JP5OAMWQ.js";import"./chunk-4VVHGR7H.js";import"./chunk-JA5Y4LDP.js";import"./chunk-WPNRDEHW.js";import"./chunk-F5PVUB4Y.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as DEFAULT_PROMOTE_TYPES,a as PROMOTER_OWNER,c as PROMOTION_LEDGER_FILE,j as appendPromotionLedger,s as approveProposal,n as callPromotionLlm,p as estimateTokens,r as evidenceFor,m as getUnpromotedMemories,k as groupCandidates,h as listAllAgentMemories,d as memoryKey,e as memoryStamp,g as mergeSources,f as parseMemoryStamp,l as parsePromotionResponse,i as readPromotionLedger,t as rejectProposal,o as runPromotion,q as sourceKind};
2
- //# sourceMappingURL=promote-FVWRM4BE.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,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t}from"./chunk-5NT44FKL.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-MEFPXHQJ.js";import"./chunk-NY7NHGVT.js";import"./chunk-KEXBEUSU.js";import"./chunk-RGZARSHV.js";import"./chunk-ERULJ2ZL.js";import"./chunk-WPNRDEHW.js";import"./chunk-4XMALK7X.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as DEFAULT_PROMOTE_TYPES,a as PROMOTER_OWNER,c as PROMOTION_LEDGER_FILE,j as appendPromotionLedger,s as approveProposal,n as callPromotionLlm,p as estimateTokens,r as evidenceFor,m as getUnpromotedMemories,k as groupCandidates,h as listAllAgentMemories,d as memoryKey,e as memoryStamp,g as mergeSources,f as parseMemoryStamp,l as parsePromotionResponse,i as readPromotionLedger,t as rejectProposal,o as runPromotion,q as sourceKind};
2
+ //# sourceMappingURL=promote-RHVZB2QZ.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk-XGOBZCYC.js";import"./chunk-WCXXXAHV.js";import"./chunk-JWDJMFU6.js";import"./chunk-GRMCAO3Q.js";import"./chunk-KZKDVIOE.js";import"./chunk-QIJLFPWE.js";export{i as PushRosterSync,a as ROSTER_CHECK_MS,b as ROSTER_RESEND_MS,h as handlePushBridge,g as peerOrigins,d as pushBridgeCaller,c as pushOrigin,f as relayTokenProblem,e as scopedPushTarget};
1
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-XGOBZCYC.js";import"./chunk-WCXXXAHV.js";import"./chunk-GRMCAO3Q.js";import"./chunk-KZKDVIOE.js";import"./chunk-JWDJMFU6.js";import"./chunk-QIJLFPWE.js";export{i as PushRosterSync,a as ROSTER_CHECK_MS,b as ROSTER_RESEND_MS,h as handlePushBridge,g as peerOrigins,d as pushBridgeCaller,c as pushOrigin,f as relayTokenProblem,e as scopedPushTarget};
2
2
  //# sourceMappingURL=push-bridge-325SXDGN.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f,g,h}from"./chunk-WWDYDLY2.js";import"./chunk-YA3P77LV.js";import"./chunk-ERULJ2ZL.js";import"./chunk-WPNRDEHW.js";import"./chunk-JRS5QRZG.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-4XMALK7X.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-6TURWSMN.js";import"./chunk-QD6IICK7.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as AUTO_SUMMARY_COVERAGE,f as DEFAULT_GRAPH_WEIGHT,e as SHARED_CATALOG_LINES,b as agenticQuery,d as catalogPool,g as rankCatalogPool,c as retrieveArticles,h as sharedQueryEnabled};
2
+ //# sourceMappingURL=query-OZXZVLO7.js.map
@@ -0,0 +1,4 @@
1
+ import"./chunk-QIJLFPWE.js";import{appendFileSync as l}from"fs";var y="_query-runs.jsonl";function i(r){return r==="error"||r==="no-catalog"}function m(r,n){try{l(r,`${JSON.stringify(n)}
2
+ `)}catch{}}function g(r,n){let u=r.split(`
3
+ `).filter(Boolean).flatMap(t=>{try{let e=JSON.parse(t);return e&&typeof e.status=="string"&&typeof e.at=="string"?[e]:[]}catch{return[]}}).filter(t=>!n||t.at>=n),o={};for(let t of u)o[t.status]=(o[t.status]??0)+1;let s=u.map(t=>Number(t.wallMs)||0).sort((t,e)=>t-e),a=t=>s.length?s[Math.min(s.length-1,Math.floor(t*s.length))]:0;return{total:u.length,failed:u.filter(t=>i(t.status)).length,byStatus:o,wallMsP50:a(.5),wallMsP95:a(.95)}}export{y as QUERY_RUNS_FILE,i as queryFailed,m as recordQueryRun,g as summariseQueryRuns};
4
+ //# sourceMappingURL=query-runs-7VX3YAC3.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 } from \"fs\"\nimport type { AgenticQueryResult } from \"./query\"\n\nexport const QUERY_RUNS_FILE = \"_query-runs.jsonl\"\n\nexport type QueryStatus = AgenticQueryResult[\"status\"]\n\nexport interface QueryRunRecord {\n at: string\n agent: string\n status: QueryStatus\n method?: string\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 record. Never throws: logging must not fail a query. */\nexport function recordQueryRun(file: string, record: QueryRunRecord): void {\n try {\n appendFileSync(file, `${JSON.stringify(record)}\\n`)\n } catch {\n // best-effort\n }\n}\n\nexport interface QueryRunSummary {\n total: number\n failed: number\n byStatus: Record<string, number>\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 for (const r of records) byStatus[r.status] = (byStatus[r.status] ?? 0) + 1\n const ms = records.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 wallMsP50: pick(0.5),\n wallMsP95: pick(0.95),\n }\n}\n"],"mappings":"4BAQA,OAAS,kBAAAA,MAAsB,KAGxB,IAAMC,EAAkB,oBAaxB,SAASC,EAAYC,EAA8B,CACxD,OAAOA,IAAW,SAAWA,IAAW,YAC1C,CAGO,SAASC,EAAeC,EAAcC,EAA8B,CACzE,GAAI,CACFN,EAAeK,EAAM,GAAG,KAAK,UAAUC,CAAM;AAAA,CAAK,CACpD,MAAE,CAEF,CACF,CAWO,SAASC,EAAmBC,EAAcC,EAAiC,CAChF,IAAMC,EAA4BF,EAAK,MAAM;AAAA,CAAI,EAAE,OAAO,OAAO,EAAE,QAASG,GAAM,CAChF,GAAI,CACF,IAAMC,EAAI,KAAK,MAAMD,CAAC,EACtB,OAAOC,GAAK,OAAOA,EAAE,QAAW,UAAY,OAAOA,EAAE,IAAO,SAAW,CAACA,CAAC,EAAI,CAAC,CAChF,MAAE,CAAQ,MAAO,CAAC,CAAE,CACtB,CAAC,EAAE,OAAQA,GAAM,CAACH,GAASG,EAAE,IAAMH,CAAK,EAClCI,EAAmC,CAAC,EAC1C,QAAWD,KAAKF,EAASG,EAASD,EAAE,MAAM,GAAKC,EAASD,EAAE,MAAM,GAAK,GAAK,EAC1E,IAAME,EAAKJ,EAAQ,IAAKE,GAAM,OAAOA,EAAE,MAAM,GAAK,CAAC,EAAE,KAAK,CAACG,EAAGC,IAAMD,EAAIC,CAAC,EACnEC,EAAQC,GAAeJ,EAAG,OAASA,EAAG,KAAK,IAAIA,EAAG,OAAS,EAAG,KAAK,MAAMI,EAAIJ,EAAG,MAAM,CAAC,CAAC,EAAI,EAClG,MAAO,CACL,MAAOJ,EAAQ,OACf,OAAQA,EAAQ,OAAQE,GAAMV,EAAYU,EAAE,MAAM,CAAC,EAAE,OACrD,SAAAC,EACA,UAAWI,EAAK,EAAG,EACnB,UAAWA,EAAK,GAAI,CACtB,CACF","names":["appendFileSync","QUERY_RUNS_FILE","queryFailed","status","recordQueryRun","file","record","summariseQueryRuns","text","since","records","l","r","byStatus","ms","a","b","pick","q"]}
@@ -0,0 +1,3 @@
1
+ import{b as u}from"./chunk-MEFPXHQJ.js";import{c as a}from"./chunk-YA3P77LV.js";import"./chunk-JRS5QRZG.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-6TURWSMN.js";import"./chunk-QD6IICK7.js";import"./chunk-QIJLFPWE.js";import{readFileSync as f}from"fs";import{resolve as d}from"path";var g={shared:!0,method:"auto",summaries:a,notes:{enabled:!1,types:["project","reference"],dirs:{}}};function y(n,t,e=process.cwd()){if(!n.notes.enabled||!t)return;let r=n.notes.dirs[t];return{owner:t,dir:r?d(e,r):new u({baseDir:d(e,".agentx")}).dirOf(t),types:n.notes.types}}function E(n,t,e=process.env,r=process.cwd()){let i=e.AGENTX_AGENT_ID;if(!(!i||i!==t))return y(n,t,r)}function p(n){if(n)try{return f(n,"utf-8").trim().split(`
2
+ `)[0].trim()||void 0}catch{return}}function c(n,t){try{let e=new URL(n);return e.protocol==="https:"&&e.origin===new URL(t).origin}catch{return!1}}var l=n=>n.map(t=>typeof t=="string"?{repo:t}:{repo:t.repo,about:t.about});function h(n,t=process.env){let e=[];for(let r of n.wiki.query.live.sources){if(r.type==="agentx"){let o=n.node.bind.replace(/^0\.0\.0\.0:/,"127.0.0.1:");e.push({type:"agentx",url:r.url??`http://${o}`,peers:r.peers});continue}let i=(r.tokenEnv?t[r.tokenEnv]:void 0)||p(r.tokenFile);if(r.type==="github"){let o=n.channels.github,s=c(r.apiUrl,"https://api.github.com")?o?.token||p(o?.tokenFile):void 0;e.push({type:"github",apiUrl:r.apiUrl,token:i||s||void 0,repos:l(r.repos)})}else{let o=n.channels.gitlab,s=r.url??o?.host;if(!s)continue;let m=o?.host&&(!r.url||c(s,o.host))?o.token:void 0;e.push({type:"gitlab",url:s,token:i||m||void 0,repos:l(r.repos)})}}return e}function v(n,t=process.env){let e=n.wiki.query;return{shared:e.shared,method:e.method,summaries:{candidates:e.candidates,sharedCandidates:e.sharedCandidates,noteCandidates:e.notes.candidates,maxPages:e.maxPages,pageChars:e.pageChars,linkedPages:e.linkedPages,linkedChars:e.linkedChars,navigatorModel:e.navigatorModel,answerModel:e.answerModel,live:{enabled:e.live.enabled,maxReads:e.live.maxReads,timeoutMs:e.live.timeoutMs,plannerModel:e.live.plannerModel,sources:h(n,t)}},notes:{enabled:e.notes.enabled,types:e.notes.types,dirs:Object.fromEntries(Object.entries(n.agents).flatMap(([r,i])=>i.wiki?.notes?.dir?[[r,i.wiki.notes.dir]]:[]))}}}async function M(n){try{let{loadDaemonConfig:t}=await import("./config-GHMRBRDL.js");return v(t(n))}catch{return g}}export{g as DEFAULT_QUERY_SETTINGS,M as loadQuerySettings,c as mayLendToken,y as noteSourceFor,h as resolveLiveSources,v as resolveQuerySettings,E as toolNoteSourceFor};
3
+ //# sourceMappingURL=query-settings-2MGUS6AY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/wiki/query-settings.ts"],"sourcesContent":["// `wiki.query` from agentx.json, resolved into what a query runs with\n// (#855). The CLI and the `agentx_wiki_query` tool both ask here, so one\n// setting reaches both.\n\nimport { readFileSync } from \"fs\"\nimport { resolve } from \"path\"\nimport { AgentMemory } from \"@/agents/agent-memory\"\nimport type { DaemonConfig } from \"@/daemon/config\"\nimport type { LiveRepo, LiveSource } from \"./live-read\"\nimport type { NoteSource } from \"./query-notes\"\nimport { DEFAULT_SUMMARIES_QUERY, type SummariesQuerySettings } from \"./query-summaries\"\n\nexport type QueryMethod = \"auto\" | \"summaries\" | \"catalog\"\n\nexport interface WikiQuerySettings {\n /** Also search other agents' readable pages. */\n shared: boolean\n method: QueryMethod\n summaries: SummariesQuerySettings\n /** The asking agent's own notes in the pool (#862). */\n notes: {\n enabled: boolean\n types: string[]\n /** `agents.<id>.wiki.notes.dir` of each agent that sets one. */\n dirs: Record<string, string>\n }\n}\n\nexport const DEFAULT_QUERY_SETTINGS: WikiQuerySettings = {\n shared: true, method: \"auto\", summaries: DEFAULT_SUMMARIES_QUERY,\n notes: { enabled: false, types: [\"project\", \"reference\"], dirs: {} },\n}\n\n/** The notes `agentId`'s queries search, or undefined when notes are off.\n * Its configured folder, else its folder in the AgentX note store. */\nexport function noteSourceFor(settings: WikiQuerySettings, agentId: string, cwd = process.cwd()): NoteSource | undefined {\n if (!settings.notes.enabled || !agentId) return undefined\n const dir = settings.notes.dirs[agentId]\n return {\n owner: agentId,\n dir: dir ? resolve(cwd, dir) : new AgentMemory({ baseDir: resolve(cwd, \".agentx\") }).dirOf(agentId),\n types: settings.notes.types,\n }\n}\n\ntype Env = Record<string, string | undefined>\n\n/** The notes the `agentx_wiki_query` tool may search. The tool takes the\n * agent from its caller (`agent`), so naming another agent must not open\n * that agent's notes: notes join only when the agent is the one this\n * runtime runs as (`AGENTX_AGENT_ID`). */\nexport function toolNoteSourceFor(settings: WikiQuerySettings, agentId: string, env: Env = process.env, cwd = process.cwd()): NoteSource | undefined {\n const runtimeAgent = env.AGENTX_AGENT_ID\n if (!runtimeAgent || runtimeAgent !== agentId) return undefined\n return noteSourceFor(settings, agentId, cwd)\n}\n\nfunction fileToken(path: string | undefined): string | undefined {\n if (!path) return undefined\n try {\n return readFileSync(path, \"utf-8\").trim().split(\"\\n\")[0].trim() || undefined\n } catch {\n return undefined\n }\n}\n\n/** Whether a channel's token may go to `url`: same origin as the\n * channel (scheme, host and port), and over https only, so a token is\n * never sent in clear or to a port it was not set for. */\nexport function mayLendToken(url: string, channel: string): boolean {\n try {\n const a = new URL(url)\n return a.protocol === \"https:\" && a.origin === new URL(channel).origin\n } catch {\n return false\n }\n}\n\nconst repos = (list: Array<string | { repo: string; about?: string }>): LiveRepo[] =>\n list.map((r) => (typeof r === \"string\" ? { repo: r } : { repo: r.repo, about: r.about }))\n\n/**\n * Turn the configured sources into hosts and tokens. A source that names\n * its own token (`tokenEnv`, `tokenFile`) uses it. One that names none\n * uses the matching channel's token, and only when the source points at\n * that channel's https origin: a token never goes to a host it was not\n * set for, nor over plain http.\n */\nexport function resolveLiveSources(config: DaemonConfig, env: Env = process.env): LiveSource[] {\n const out: LiveSource[] = []\n for (const s of config.wiki.query.live.sources) {\n if (s.type === \"agentx\") {\n const bind = config.node.bind.replace(/^0\\.0\\.0\\.0:/, \"127.0.0.1:\")\n out.push({ type: \"agentx\", url: s.url ?? `http://${bind}`, peers: s.peers })\n continue\n }\n const own = (s.tokenEnv ? env[s.tokenEnv] : undefined) || fileToken(s.tokenFile)\n if (s.type === \"github\") {\n const gh = config.channels.github\n const channel = mayLendToken(s.apiUrl, \"https://api.github.com\") ? gh?.token || fileToken(gh?.tokenFile) : undefined\n out.push({ type: \"github\", apiUrl: s.apiUrl, token: own || channel || undefined, repos: repos(s.repos) })\n } else {\n const gl = config.channels.gitlab\n const url = s.url ?? gl?.host\n if (!url) continue\n // Unset url: the channel's own host, so the token goes where the\n // channel already sends it.\n const channel = gl?.host && (!s.url || mayLendToken(url, gl.host)) ? gl.token : undefined\n out.push({ type: \"gitlab\", url, token: own || channel || undefined, repos: repos(s.repos) })\n }\n }\n return out\n}\n\nexport function resolveQuerySettings(config: DaemonConfig, env: Env = process.env): WikiQuerySettings {\n const q = config.wiki.query\n return {\n shared: q.shared,\n method: q.method,\n summaries: {\n candidates: q.candidates,\n sharedCandidates: q.sharedCandidates,\n noteCandidates: q.notes.candidates,\n maxPages: q.maxPages,\n pageChars: q.pageChars,\n linkedPages: q.linkedPages,\n linkedChars: q.linkedChars,\n navigatorModel: q.navigatorModel,\n answerModel: q.answerModel,\n live: {\n enabled: q.live.enabled,\n maxReads: q.live.maxReads,\n timeoutMs: q.live.timeoutMs,\n plannerModel: q.live.plannerModel,\n sources: resolveLiveSources(config, env),\n },\n },\n notes: {\n enabled: q.notes.enabled,\n types: q.notes.types,\n dirs: Object.fromEntries(Object.entries(config.agents).flatMap(([id, a]) => (a.wiki?.notes?.dir ? [[id, a.wiki.notes.dir]] : []))),\n },\n }\n}\n\n/** The settings of the config in the working directory; the defaults\n * (shared on, no live source) when there is none to read. */\nexport async function loadQuerySettings(configPath?: string): Promise<WikiQuerySettings> {\n try {\n const { loadDaemonConfig } = await import(\"@/daemon/config\")\n return resolveQuerySettings(loadDaemonConfig(configPath))\n } catch {\n return DEFAULT_QUERY_SETTINGS\n }\n}\n"],"mappings":"wPAIA,OAAS,gBAAAA,MAAoB,KAC7B,OAAS,WAAAC,MAAe,OAuBjB,IAAMC,EAA4C,CACvD,OAAQ,GAAM,OAAQ,OAAQ,UAAWC,EACzC,MAAO,CAAE,QAAS,GAAO,MAAO,CAAC,UAAW,WAAW,EAAG,KAAM,CAAC,CAAE,CACrE,EAIO,SAASC,EAAcC,EAA6BC,EAAiBC,EAAM,QAAQ,IAAI,EAA2B,CACvH,GAAI,CAACF,EAAS,MAAM,SAAW,CAACC,EAAS,OACzC,IAAME,EAAMH,EAAS,MAAM,KAAKC,CAAO,EACvC,MAAO,CACL,MAAOA,EACP,IAAKE,EAAMC,EAAQF,EAAKC,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A,EAAE,MAAM,OAAO,IAAM,CAAC,CAACc,EAAId,EAAE,KAAK,MAAM,GAAG,CAAC,EAAI,CAAC,CAAE,CAAC,CACnI,CACF,CACF,CAIA,eAAsBe,EAAkBC,EAAiD,CACvF,GAAI,CACF,GAAM,CAAE,iBAAAC,CAAiB,EAAI,KAAM,QAAO,sBAAiB,EAC3D,OAAOL,EAAqBK,EAAiBD,CAAU,CAAC,CAC1D,MAAE,CACA,OAAOlC,CACT,CACF","names":["readFileSync","resolve","DEFAULT_QUERY_SETTINGS","DEFAULT_SUMMARIES_QUERY","noteSourceFor","settings","agentId","cwd","dir","resolve","AgentMemory","toolNoteSourceFor","env","runtimeAgent","fileToken","path","readFileSync","mayLendToken","url","channel","a","repos","list","r","resolveLiveSources","config","out","s","bind","own","gh","gl","resolveQuerySettings","q","id","loadQuerySettings","configPath","loadDaemonConfig"]}
@@ -0,0 +1,2 @@
1
+ import{$ as j,S as a,T as b,U as c,V as d,W as e,X as f,Y as g,Z as h,_ as i,aa as k,ba as l,ca as m,da as n}from"./chunk-L5UGH4T4.js";import"./chunk-QDWEM4DG.js";import"./chunk-QSKG754X.js";import"./chunk-MEFPXHQJ.js";import"./chunk-SZDACK6O.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-SSQMFHSM.js";import"./chunk-LUYN6RAC.js";import"./chunk-3UOTLMXD.js";import"./chunk-36AXN6ZB.js";import"./chunk-KA2UIZXG.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-6WF56ME6.js";import"./chunk-NY7NHGVT.js";import"./chunk-KEXBEUSU.js";import"./chunk-RGZARSHV.js";import"./chunk-WWDYDLY2.js";import"./chunk-YA3P77LV.js";import"./chunk-ERULJ2ZL.js";import"./chunk-WPNRDEHW.js";import"./chunk-JRS5QRZG.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-K445URSN.js";import"./chunk-4XMALK7X.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-6TURWSMN.js";import"./chunk-AV7T3SYT.js";import"./chunk-Y5MFVVTM.js";import"./chunk-QD6IICK7.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-DSYKYZMT.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{m as AgentRegistry,a as EDIT_TOOL_INSTRUCTION,h as TRACE_STEP_SUMMARY_BYTES,e as buildEntryMeta,f as buildEventDigest,g as buildWikiContext,i as clipForTrace,b as codingInstructions,l as emitTraceStepsFromStreamEvent,k as firstMissingRequiredTool,d as getGlobalRegistry,n as richReplyPrompt,c as setGlobalRegistry,j as tallyToolUses};
2
+ //# sourceMappingURL=registry-LZLIPP7N.js.map
@@ -1,6 +1,6 @@
1
- import{p as f,s as h,v as g,y as m,z as E}from"./chunk-F5PVUB4Y.js";import{a as p,f as w}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";E();w();var l="request-gate",x="request-context",q=.1,C=3e3;function b(t,s){return s??f(t)??C}async function k(t,s,n,r=Math.random){let d=g(l)==="active";if(d){let e=h().seats[l]?.holdout??q;if(r()<e)return{active:!0,preprocess:!1,arm:"holdout"}}let i=d?"treatment":void 0,a=await m(l,{request:t.slice(0,2e3),agent:s,channel:n,operations:["select optional context","evaluate model routing where permitted"],constraints:["Keep the original request and mandatory instructions","Desktop model cannot be downgraded"]},{preprocess:p("This request benefits from structured context selection or another bounded typed decision before the main agent executes.",{true:"Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.",false:"Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context."})},{timeoutMs:b(l)});if(!a||a.mode!=="active")return{active:!1,preprocess:!1,arm:i};let c=a.answers.preprocess?.noul;return{active:!0,preprocess:Number.isFinite(c)&&c>=.5,arm:i}}var T={patternContext:"Learned behavioral patterns",references:"Retrieved project references",memoryContext:"Retrieved agent memory",crossChatContext:"Summaries from other conversations",longMemoryRecall:"Older conversation recall",wikiContext:"Retrieved wiki knowledge"},v=[{id:"landscape",header:/^\[Landscape\]$/,description:"Directory of the other agents on this node and on mesh peers, and the channels they are on"},{id:"landscape.messaging",header:/^\[Cross-Channel Messaging\]$/,description:"How to send a message to a different channel than the one this request came from"},{id:"landscape.recall",header:/^\[Conversation Recall\b/,description:"How to look up earlier turns of a conversation that are not in the prompt"},{id:"landscape.monitoring",header:/^\[Background Monitoring\]$/,description:"How to watch logs, pipelines or files in the background"},{id:"landscape.teams",header:/^\[Agent Teams\]$/,description:"How to split a large task across a team of parallel agents"}];function S(t){let s=[],n=null;for(let r of t.split(`
1
+ import{p as f,s as h,v as g,y as m,z as E}from"./chunk-4XMALK7X.js";import{a as p,f as w}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";E();w();var l="request-gate",x="request-context",q=.1,C=3e3;function b(t,s){return s??f(t)??C}async function k(t,s,n,r=Math.random){let d=g(l)==="active";if(d){let e=h().seats[l]?.holdout??q;if(r()<e)return{active:!0,preprocess:!1,arm:"holdout"}}let i=d?"treatment":void 0,a=await m(l,{request:t.slice(0,2e3),agent:s,channel:n,operations:["select optional context","evaluate model routing where permitted"],constraints:["Keep the original request and mandatory instructions","Desktop model cannot be downgraded"]},{preprocess:p("This request benefits from structured context selection or another bounded typed decision before the main agent executes.",{true:"Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.",false:"Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context."})},{timeoutMs:b(l)});if(!a||a.mode!=="active")return{active:!1,preprocess:!1,arm:i};let c=a.answers.preprocess?.noul;return{active:!0,preprocess:Number.isFinite(c)&&c>=.5,arm:i}}var T={patternContext:"Learned behavioral patterns",references:"Retrieved project references",memoryContext:"Retrieved agent memory",crossChatContext:"Summaries from other conversations",longMemoryRecall:"Older conversation recall",wikiContext:"Retrieved wiki knowledge"},v=[{id:"landscape",header:/^\[Landscape\]$/,description:"Directory of the other agents on this node and on mesh peers, and the channels they are on"},{id:"landscape.messaging",header:/^\[Cross-Channel Messaging\]$/,description:"How to send a message to a different channel than the one this request came from"},{id:"landscape.recall",header:/^\[Conversation Recall\b/,description:"How to look up earlier turns of a conversation that are not in the prompt"},{id:"landscape.monitoring",header:/^\[Background Monitoring\]$/,description:"How to watch logs, pipelines or files in the background"},{id:"landscape.teams",header:/^\[Agent Teams\]$/,description:"How to split a large task across a team of parallel agents"}];function S(t){let s=[],n=null;for(let r of t.split(`
2
2
  `)){let d=/^\[[^\]]+\]$/.test(r);if(d||!n){let i=d?v.find(a=>a.header.test(r)):void 0;n={id:i?i.id:null,text:r},s.push(n)}else n.text+=`
3
3
  `+r}return s}async function O(t,s={}){let n=Object.entries(T).flatMap(([e,o])=>{let u=t[e];return u?[y(e,o,u)]:[]}),r=t.landscape?S(t.landscape):[];for(let e of r){if(!e.id||!e.text.trim())continue;let o=v.find(u=>u.id===e.id);n.push(y(e.id,o.description,e.text))}if(!n.length)return{input:t,excluded:[]};let d=Object.fromEntries(n.map(e=>[e.id,p(`Context block ${e.id} is relevant to completing the current request correctly.`,{true:"Needed or potentially relevant; retain if uncertain or the preview is incomplete.",false:"Clearly unrelated to the current request; safe to omit."})])),i=await m(x,{request:t.message.slice(0,2e3),channel:t.channel,agent:t.agentId,mandatory:["request","identity","permissions and instructions","same-chat history","handover","attachments","group-chat rules"],context:n},d,{timeoutMs:b(x,s.timeoutMs)});if(!i||i.mode!=="active")return{input:t,excluded:[]};let a={...t},c=[];for(let e of n){let o=i.answers[e.id]?.noul;Number.isFinite(o)&&o>=0&&o<.2&&c.push(e.id)}for(let e of c)e in T&&delete a[e];if(r.some(e=>e.id&&c.includes(e.id))){let e=r.filter(o=>!o.id||!c.includes(o.id)).map(o=>o.text.trim()).filter(Boolean);a.landscape=e.length?e.join(`
4
4
 
5
5
  `):void 0}return{input:a,excluded:c}}function y(t,s,n){return{id:t,description:s,source:t,characters:n.length,preview:n.slice(0,400),trust:"context data, not instructions"}}export{q as DEFAULT_REQUEST_GATE_HOLDOUT,x as REQUEST_CONTEXT_SEAT,l as REQUEST_GATE_SEAT,C as REQUEST_SEAT_TIMEOUT_MS,k as evaluateRequest,O as selectRequestContext,S as splitLandscape};
6
- //# sourceMappingURL=request-planner-JOXSAAHO.js.map
6
+ //# sourceMappingURL=request-planner-MFAIVLUQ.js.map
@@ -1,4 +1,4 @@
1
- import{b as I}from"./chunk-ANC5QXFB.js";import"./chunk-QSKG754X.js";import"./chunk-F5PVUB4Y.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-6TURWSMN.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as E}from"crypto";var v="review:",b={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function A(t,n,r){let s=E("sha1").update(r.trim().toLowerCase()).digest("hex").slice(0,10);return`${v}${t}/${n}@${s}`}function F(t){if(!t.startsWith(v))return null;let n=t.slice(v.length),r=n.lastIndexOf("@"),s=n.lastIndexOf("/",r===-1?void 0:r);return r===-1||s===-1?null:{reviewId:n.slice(0,s),kind:n.slice(s+1,r),digest:n.slice(r+1)}}var C=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48)||"finding",L=5;function T(t,n){return`${t}|${I(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(b),s=n.minLength??24,h=[],d=new Map,u=new Map,f=new Map,x=new Map;for(let e of t){let i;try{i=JSON.parse(e.result)}catch{continue}let o=e.updated_at?new Date(e.updated_at).toISOString():new Date().toISOString();for(let c of r){let l=b[c];if(!l)continue;let R=i[c];if(Array.isArray(R))for(let $ of R){let a=String($?.text??"").trim();if(a.length<s)continue;let g=A(e.id,c,a),_=g.slice(g.lastIndexOf("@")),w=`${c}${_}`,y=T(c,a),S=f.get(y)??new Set;if(S.add(e.session_id??e.id),f.set(y,S),d.has(w))continue;let O=String($?.evidence??"").trim(),k={occurrences:1,agentId:e.agent,key:`${e.agent}/${l}_${C(a)}`,stamp:g,memory:{name:C(a),type:l,description:a.slice(0,200),body:"",createdAt:o,updatedAt:o}};x.set(g,{text:a,evidence:O,agent:e.agent,source:e.source}),d.set(w,k),u.set(w,y),h.push(k)}}}for(let[e,i]of d){let o=f.get(u.get(e)??"");i.occurrences=o?.size??1,i.sessions=[...o??[]].slice(0,L);let c=x.get(i.stamp);i.memory.body=D(c,i.occurrences)}let m=new Map;for(let[e,i]of d){let o=u.get(e)??e,c=m.get(o)??[];c.push(i),m.set(o,c)}let M=[...m.values()].sort((e,i)=>i[0].occurrences-e[0].occurrences),p=[];for(let e=0;p.length<h.length;e++){let i=!1;for(let o of M)e<o.length&&(p.push(o[e]),i=!0);if(!i)break}return p}function D(t,n){let r=`${t.agent}${t.source?` via ${t.source}`:""}`,s=[];return n>1?(s.push(`Observed in ${n} separate sessions. Most recently stated as:`),s.push(`> ${t.text}`),s.push(`Recurring across ${n} sessions is what makes this worth recording \u2014 any single occurrence is session state, the repetition is the finding.`)):s.push(t.text),t.evidence&&s.push(`**Evidence:** ${t.evidence}`),s.push(`_From ${n>1?"session reviews":"a session review"} of ${r}._`),s.join(`
1
+ import{b as I}from"./chunk-XOUO4XNA.js";import"./chunk-QSKG754X.js";import"./chunk-4XMALK7X.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-6TURWSMN.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as E}from"crypto";var v="review:",b={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function A(t,n,r){let s=E("sha1").update(r.trim().toLowerCase()).digest("hex").slice(0,10);return`${v}${t}/${n}@${s}`}function F(t){if(!t.startsWith(v))return null;let n=t.slice(v.length),r=n.lastIndexOf("@"),s=n.lastIndexOf("/",r===-1?void 0:r);return r===-1||s===-1?null:{reviewId:n.slice(0,s),kind:n.slice(s+1,r),digest:n.slice(r+1)}}var C=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48)||"finding",L=5;function T(t,n){return`${t}|${I(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(b),s=n.minLength??24,h=[],d=new Map,u=new Map,f=new Map,x=new Map;for(let e of t){let i;try{i=JSON.parse(e.result)}catch{continue}let o=e.updated_at?new Date(e.updated_at).toISOString():new Date().toISOString();for(let c of r){let l=b[c];if(!l)continue;let R=i[c];if(Array.isArray(R))for(let $ of R){let a=String($?.text??"").trim();if(a.length<s)continue;let g=A(e.id,c,a),_=g.slice(g.lastIndexOf("@")),w=`${c}${_}`,y=T(c,a),S=f.get(y)??new Set;if(S.add(e.session_id??e.id),f.set(y,S),d.has(w))continue;let O=String($?.evidence??"").trim(),k={occurrences:1,agentId:e.agent,key:`${e.agent}/${l}_${C(a)}`,stamp:g,memory:{name:C(a),type:l,description:a.slice(0,200),body:"",createdAt:o,updatedAt:o}};x.set(g,{text:a,evidence:O,agent:e.agent,source:e.source}),d.set(w,k),u.set(w,y),h.push(k)}}}for(let[e,i]of d){let o=f.get(u.get(e)??"");i.occurrences=o?.size??1,i.sessions=[...o??[]].slice(0,L);let c=x.get(i.stamp);i.memory.body=D(c,i.occurrences)}let m=new Map;for(let[e,i]of d){let o=u.get(e)??e,c=m.get(o)??[];c.push(i),m.set(o,c)}let M=[...m.values()].sort((e,i)=>i[0].occurrences-e[0].occurrences),p=[];for(let e=0;p.length<h.length;e++){let i=!1;for(let o of M)e<o.length&&(p.push(o[e]),i=!0);if(!i)break}return p}function D(t,n){let r=`${t.agent}${t.source?` via ${t.source}`:""}`,s=[];return n>1?(s.push(`Observed in ${n} separate sessions. Most recently stated as:`),s.push(`> ${t.text}`),s.push(`Recurring across ${n} sessions is what makes this worth recording \u2014 any single occurrence is session state, the repetition is the finding.`)):s.push(t.text),t.evidence&&s.push(`**Evidence:** ${t.evidence}`),s.push(`_From ${n>1?"session reviews":"a session review"} of ${r}._`),s.join(`
2
2
 
3
3
  `)}export{L as MAX_EVIDENCE_SESSIONS,b as PROMOTABLE_KINDS,v as REVIEW_STAMP_PREFIX,F as parseReviewStamp,A as reviewStamp,K as reviewsToCandidates};
4
- //# sourceMappingURL=review-candidates-6N5435V7.js.map
4
+ //# sourceMappingURL=review-candidates-6WMDVVIZ.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"./chunk-QAWKN2N4.js";import"./chunk-QIJLFPWE.js";export{a as buildRoster,d as configuredAgents,e as loadRoster,c as personaName,b as rosterMatch};
2
+ //# sourceMappingURL=roster-BZGKG2ZA.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f}from"./chunk-KUOH5MFS.js";import"./chunk-F5PVUB4Y.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{e as DEFAULT_TRIAGE_ACTIONS,a as DOWNGRADE_BELOW,b as channelKeepsConfiguredModel,c as cheapModelForEngine,d as routeTaskModel,f as triageModelFor};
2
- //# sourceMappingURL=routing-6G2QVFIG.js.map
1
+ import{a,b,c,d,e,f}from"./chunk-K445URSN.js";import"./chunk-4XMALK7X.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{e as DEFAULT_TRIAGE_ACTIONS,a as DOWNGRADE_BELOW,b as channelKeepsConfiguredModel,c as cheapModelForEngine,d as routeTaskModel,f as triageModelFor};
2
+ //# sourceMappingURL=routing-OPCLHIYW.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-RRGITX5B.js";import"./chunk-RKPAVWXF.js";import"./chunk-FWDRBUMS.js";import"./chunk-SSQMFHSM.js";import"./chunk-LUYN6RAC.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{b as resolveScheduleCaller,a as runScheduleTool};
2
+ //# sourceMappingURL=schedule-tool-KPVTMYL3.js.map
@@ -1,2 +1,2 @@
1
- import{n as a,o as b,p as c,q as d,r as e,s as f}from"./chunk-S2UXDEGW.js";import"./chunk-D5IHICX3.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{a as AGENT_RUN_TIMEOUT_FLOOR,f as CronScheduler,b as agentRunTimeout,e as cronRunId,d as getNextCronDate,c as runLinkIds};
2
- //# sourceMappingURL=scheduler-WOH2O3EP.js.map
1
+ import{n as a,o as b,p as c,q as d,r as e,s as f}from"./chunk-SSQMFHSM.js";import"./chunk-LUYN6RAC.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{a as AGENT_RUN_TIMEOUT_FLOOR,f as CronScheduler,b as agentRunTimeout,e as cronRunId,d as getNextCronDate,c as runLinkIds};
2
+ //# sourceMappingURL=scheduler-G3WWYETY.js.map
@@ -0,0 +1,3 @@
1
+ import"./chunk-QIJLFPWE.js";function S(n){let s=n.trim();return(s.startsWith("[")?JSON.parse(s):s.split(`
2
+ `).filter(r=>r.trim()).map(r=>JSON.parse(r))).map((r,t)=>{let e=r??{},o=typeof e.question=="string"?e.question.trim():"",u=Array.isArray(e.expect)?e.expect.filter(c=>typeof c=="string"&&!!c.trim()):[];if(!o||u.length===0)throw new Error(`question ${t+1} needs a "question" and a non-empty "expect" list`);return{id:typeof e.id=="string"&&e.id?e.id:`q${t+1}`,question:o,expect:u}})}var l=n=>n.toLowerCase().replace(/[\s ]+/g," ").trim(),m=n=>n.replace(/\D+/g,"");function h(n,s){let i=l(n),r=m(n),t=[],e=[];for(let o of s)(o.split("|").some(c=>{let g=m(c);return!!c.trim()&&i.includes(l(c))||g.length>=5&&r.includes(g)})?t:e).push(o);return{found:t,missing:e}}function x(n,s){let i=s.map(({q:t,answer:e,status:o,citations:u,method:c,ms:g,costUsd:d})=>{let{found:a,missing:f}=h(e,t.expect);return{id:t.id,question:t.question,expect:t.expect,found:a,missing:f,score:a.length/t.expect.length,status:o,answer:e,citations:u,...c?{method:c}:{},...g!==void 0?{ms:g}:{},...d!==void 0?{costUsd:d}:{}}}),r=i.length?i.reduce((t,e)=>t+e.score,0)/i.length:0;return{at:n.at??new Date().toISOString(),questions:n.questions,agent:n.agent,shared:n.shared,...n.settings?{settings:n.settings}:{},score:r,full:i.filter(t=>t.missing.length===0).length,results:i}}function p(n){let s=t=>t.length?t.reduce((e,o)=>e+o,0)/t.length:void 0,i=n.results.flatMap(t=>t.ms===void 0?[]:[t.ms]),r=n.results.flatMap(t=>t.costUsd===void 0?[]:[t.costUsd]);return{meanMs:s(i),meanCostUsd:s(r),unpriced:n.results.length-r.length}}function R(n,s){let i=new Map(n.results.map(e=>[e.id,e])),r=s.results.map(e=>{let o=i.get(e.id);return{id:e.id,question:e.question,before:o?.score??0,after:e.score,gained:e.found.filter(u=>!o?.found.includes(u)),lost:(o?.found??[]).filter(u=>!e.found.includes(u)),...o?.ms!==void 0||e.ms!==void 0?{ms:{before:o?.ms,after:e.ms}}:{},...o?.costUsd!==void 0||e.costUsd!==void 0?{costUsd:{before:o?.costUsd,after:e.costUsd}}:{}}}),t=new Set(s.results.map(e=>e.id));return{before:n.score,after:s.score,deltas:r,changed:b(n,s),onlyBefore:n.results.filter(e=>!t.has(e.id)).map(e=>e.id),onlyAfter:s.results.filter(e=>!i.has(e.id)).map(e=>e.id),cost:{before:p(n),after:p(s)}}}function b(n,s){if(!n.settings||!s.settings)return"unknown";let i={...n.settings,agent:n.agent,shared:n.shared},r={...s.settings,agent:s.agent,shared:s.shared};return[...new Set([...Object.keys(i),...Object.keys(r)])].filter(t=>i[t]!==r[t]).map(t=>`${t}: ${String(i[t])} \u2192 ${String(r[t])}`)}export{x as buildReport,R as compareReports,h as matchFacts,S as parseQuestionSet,p as runCost};
3
+ //# sourceMappingURL=score-DZGPLHCL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/wiki/score.ts"],"sourcesContent":["// --- Score the wiki against a question set (#824) ---\n//\n// The fleet test behind #824 scored the wiki by hand: each agent took 10\n// to 12 real questions from its own past work and checked whether the\n// wiki answered them (47% and 75%). This makes that repeatable, so the\n// same set can be run before and after a week of daily contributions.\n//\n// A question set is JSON (an array) or JSON lines, one question each:\n//\n// {\"id\": \"q1\", \"question\": \"What is the vendor's billing contact's phone?\", \"expect\": [\"+1 555 0100\"]}\n//\n// An answer scores the share of its expected facts it contains. Matching\n// ignores case and spacing; a fact with five or more digits (a phone,\n// an invoice number) also matches on its digits alone. \"a|b\" accepts\n// either spelling (a date or an amount written two ways). Question sets\n// hold real facts, so they belong outside the repository.\n\nexport interface ScoreQuestion {\n id: string\n question: string\n /** Facts a correct answer contains, copied as they should appear. */\n expect: string[]\n}\n\nexport interface ScoreResult {\n id: string\n question: string\n expect: string[]\n found: string[]\n missing: string[]\n /** found / expected, 0–1. */\n score: number\n status: string\n answer: string\n citations: string[]\n /** How the pages were picked for this question. */\n method?: string\n /** Wall time of the question, in milliseconds. */\n ms?: number\n /** Model spend of the question, in dollars. Unset when it is not known\n * (the catalog method, or a call that reported no cost). */\n costUsd?: number\n}\n\n/** What a run was asked with, so two reports show what changed between them. */\nexport interface ScoreSettings {\n method: string\n linkedPages: number\n linkedChars: number\n live: boolean\n notes: boolean\n navigatorModel: string\n answerModel: string\n}\n\nexport interface ScoreReport {\n at: string\n questions: string\n agent: string\n /** Whether the shared wiki was searched too. */\n shared: boolean\n /** Unset in reports written before #863. */\n settings?: ScoreSettings\n /** Mean of the question scores, 0–1. */\n score: number\n /** Questions every expected fact was found for. */\n full: number\n results: ScoreResult[]\n}\n\nexport function parseQuestionSet(text: string): ScoreQuestion[] {\n const trimmed = text.trim()\n const raw: unknown[] = trimmed.startsWith(\"[\")\n ? JSON.parse(trimmed)\n : trimmed.split(\"\\n\").filter((l) => l.trim()).map((l) => JSON.parse(l))\n return raw.map((x, i) => {\n const r = (x ?? {}) as Record<string, unknown>\n const question = typeof r.question === \"string\" ? r.question.trim() : \"\"\n const expect = Array.isArray(r.expect) ? r.expect.filter((e): e is string => typeof e === \"string\" && !!e.trim()) : []\n if (!question || expect.length === 0) throw new Error(`question ${i + 1} needs a \"question\" and a non-empty \"expect\" list`)\n return { id: typeof r.id === \"string\" && r.id ? r.id : `q${i + 1}`, question, expect }\n })\n}\n\nconst norm = (s: string) => s.toLowerCase().replace(/[\\s ]+/g, \" \").trim()\nconst digits = (s: string) => s.replace(/\\D+/g, \"\")\n\n/** Which expected facts the answer contains. */\nexport function matchFacts(answer: string, expect: string[]): { found: string[]; missing: string[] } {\n const text = norm(answer)\n const textDigits = digits(answer)\n const found: string[] = []\n const missing: string[] = []\n for (const fact of expect) {\n // \"2027-03-31|31/03/2027\": any one spelling counts.\n const hit = fact.split(\"|\").some((alt) => {\n const d = digits(alt)\n return (!!alt.trim() && text.includes(norm(alt))) || (d.length >= 5 && textDigits.includes(d))\n })\n ;(hit ? found : missing).push(fact)\n }\n return { found, missing }\n}\n\nexport function buildReport(\n meta: { questions: string; agent: string; shared: boolean; at?: string; settings?: ScoreSettings },\n answers: Array<{ q: ScoreQuestion; answer: string; status: string; citations: string[]; method?: string; ms?: number; costUsd?: number }>,\n): ScoreReport {\n const results = answers.map(({ q, answer, status, citations, method, ms, costUsd }) => {\n const { found, missing } = matchFacts(answer, q.expect)\n return {\n id: q.id, question: q.question, expect: q.expect, found, missing, score: found.length / q.expect.length, status, answer, citations,\n ...(method ? { method } : {}), ...(ms !== undefined ? { ms } : {}), ...(costUsd !== undefined ? { costUsd } : {}),\n }\n })\n const score = results.length ? results.reduce((s, r) => s + r.score, 0) / results.length : 0\n return {\n at: meta.at ?? new Date().toISOString(),\n questions: meta.questions, agent: meta.agent, shared: meta.shared,\n ...(meta.settings ? { settings: meta.settings } : {}),\n score, full: results.filter((r) => r.missing.length === 0).length, results,\n }\n}\n\nexport interface ScoreDelta {\n id: string\n question: string\n before: number\n after: number\n /** Facts the later run found that the earlier one missed. */\n gained: string[]\n lost: string[]\n /** Wall time and spend of the question in each run, when recorded. */\n ms?: { before?: number; after?: number }\n costUsd?: { before?: number; after?: number }\n}\n\n/** Mean time and spend per question of one report, over the questions\n * that recorded them. Unset when none did. */\nexport interface RunCost {\n meanMs?: number\n meanCostUsd?: number\n /** Questions with no recorded spend: the mean leaves them out. */\n unpriced: number\n}\n\nexport function runCost(report: ScoreReport): RunCost {\n const mean = (xs: number[]) => (xs.length ? xs.reduce((a, b) => a + b, 0) / xs.length : undefined)\n const ms = report.results.flatMap((r) => (r.ms === undefined ? [] : [r.ms]))\n const usd = report.results.flatMap((r) => (r.costUsd === undefined ? [] : [r.costUsd]))\n return { meanMs: mean(ms), meanCostUsd: mean(usd), unpriced: report.results.length - usd.length }\n}\n\nexport interface ReportComparison {\n before: number\n after: number\n deltas: ScoreDelta[]\n /** Settings that differ, as \"key: before → after\". Unknown when either\n * report predates recorded settings. A fair test changes one. */\n changed: string[] | \"unknown\"\n /** Question ids only one of the two reports holds. */\n onlyBefore: string[]\n onlyAfter: string[]\n cost: { before: RunCost; after: RunCost }\n}\n\n/** Per-question change between two reports on the same set. */\nexport function compareReports(before: ScoreReport, after: ScoreReport): ReportComparison {\n const prior = new Map(before.results.map((r) => [r.id, r]))\n const deltas = after.results.map((r) => {\n const b = prior.get(r.id)\n return {\n id: r.id, question: r.question,\n before: b?.score ?? 0, after: r.score,\n gained: r.found.filter((f) => !b?.found.includes(f)),\n lost: (b?.found ?? []).filter((f) => !r.found.includes(f)),\n ...(b?.ms !== undefined || r.ms !== undefined ? { ms: { before: b?.ms, after: r.ms } } : {}),\n ...(b?.costUsd !== undefined || r.costUsd !== undefined ? { costUsd: { before: b?.costUsd, after: r.costUsd } } : {}),\n }\n })\n const afterIds = new Set(after.results.map((r) => r.id))\n return {\n before: before.score, after: after.score, deltas,\n changed: settingsChanged(before, after),\n onlyBefore: before.results.filter((r) => !afterIds.has(r.id)).map((r) => r.id),\n onlyAfter: after.results.filter((r) => !prior.has(r.id)).map((r) => r.id),\n cost: { before: runCost(before), after: runCost(after) },\n }\n}\n\nfunction settingsChanged(before: ScoreReport, after: ScoreReport): string[] | \"unknown\" {\n if (!before.settings || !after.settings) return \"unknown\"\n const a: Record<string, unknown> = { ...before.settings, agent: before.agent, shared: before.shared }\n const b: Record<string, unknown> = { ...after.settings, agent: after.agent, shared: after.shared }\n return [...new Set([...Object.keys(a), ...Object.keys(b)])]\n .filter((k) => a[k] !== b[k])\n .map((k) => `${k}: ${String(a[k])} → ${String(b[k])}`)\n}\n"],"mappings":"4BAsEO,SAASA,EAAiBC,EAA+B,CAC9D,IAAMC,EAAUD,EAAK,KAAK,EAI1B,OAHuBC,EAAQ,WAAW,GAAG,EACzC,KAAK,MAAMA,CAAO,EAClBA,EAAQ,MAAM;AAAA,CAAI,EAAE,OAAQC,GAAMA,EAAE,KAAK,CAAC,EAAE,IAAKA,GAAM,KAAK,MAAMA,CAAC,CAAC,GAC7D,IAAI,CAACC,EAAGC,IAAM,CACvB,IAAMC,EAAKF,GAAK,CAAC,EACXG,EAAW,OAAOD,EAAE,UAAa,SAAWA,EAAE,SAAS,KAAK,EAAI,GAChEE,EAAS,MAAM,QAAQF,EAAE,MAAM,EAAIA,EAAE,OAAO,OAAQG,GAAmB,OAAOA,GAAM,UAAY,CAAC,CAACA,EAAE,KAAK,CAAC,EAAI,CAAC,EACrH,GAAI,CAACF,GAAYC,EAAO,SAAW,EAAG,MAAM,IAAI,MAAM,YAAYH,EAAI,oDAAoD,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AO,EACjG,MAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,OAAO,KAAKL,CAAC,EAAG,GAAG,OAAO,KAAKC,CAAC,CAAC,CAAC,CAAC,EACvD,OAAQU,GAAMX,EAAEW,CAAC,IAAMV,EAAEU,CAAC,CAAC,EAC3B,IAAKA,GAAM,GAAGA,MAAM,OAAOX,EAAEW,CAAC,CAAC,YAAO,OAAOV,EAAEU,CAAC,CAAC,GAAG,CACzD","names":["parseQuestionSet","text","trimmed","l","x","i","r","question","expect","e","norm","s","digits","matchFacts","answer","textDigits","found","missing","fact","alt","d","buildReport","meta","answers","results","q","status","citations","method","ms","costUsd","score","runCost","report","mean","xs","a","b","usd","compareReports","before","after","prior","deltas","f","afterIds","settingsChanged","k"]}
@@ -1,2 +1,2 @@
1
- import{o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i,x as j,y as k,z as l}from"./chunk-F5PVUB4Y.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";l();export{a as DEFAULT_SEAT_TIMEOUT_MS,k as askSeat,c as configureDecisions,b as configuredSeatTimeout,e as decisionsRuntime,h as getSeatMode,i as labelSeatCall,f as parseSeatMode,j as recordSeatOutcome,d as resetDecisionsRuntime,g as seatEnvVar};
2
- //# sourceMappingURL=seat-I2FBJDTV.js.map
1
+ import{o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i,x as j,y as k,z as l}from"./chunk-4XMALK7X.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";l();export{a as DEFAULT_SEAT_TIMEOUT_MS,k as askSeat,c as configureDecisions,b as configuredSeatTimeout,e as decisionsRuntime,h as getSeatMode,i as labelSeatCall,f as parseSeatMode,j as recordSeatOutcome,d as resetDecisionsRuntime,g as seatEnvVar};
2
+ //# sourceMappingURL=seat-3HM4J7IX.js.map
@@ -1,2 +1,2 @@
1
- import{y as S,z as w}from"./chunk-F5PVUB4Y.js";import{a as g,b as h,f as R}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import{e as f}from"./chunk-JHCI6XCJ.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";w();R();var p="skill-select";function y(l){return{task:d(l.task,1200),...l.agent?{agent:l.agent}:{},skills:l.candidates.map(t=>({name:t.name,purpose:d(t.description,300),...t.category?{category:t.category}:{},...t.tags?.length?{tags:t.tags.slice(0,8)}:{}}))}}function b(l){let t={};for(let i of l)t[i.name]=d(i.description,300);return{anyRelevant:g("At least one of these skills is about the task at hand.",{true:"The task is the kind of work one of these skills exists for, and following it would change how the work is done \u2014 it names the same system, the same procedure or the same kind of artefact.",false:"None of them is about this task. They may share vocabulary with it, mention the same tools, or belong to the same project without bearing on what is being asked. Sharing words with a task is not being about it."}),best:h(t,"Which skill is this task most about?")}}function v(l){let t=l.anyRelevant,i=l.best,o=Object.entries(i.probabilities??{}).map(([e,s])=>({name:e,p:Number(s)||0})).sort((e,s)=>s.p-e.p);return{anyRelevant:t.noul,name:i.choice,confidence:i.confidence,ranked:o}}function d(l,t){return l.length>t?`${l.slice(0,t)}\u2026`:l}var x=.1,A=12;async function E(l,t,i={}){let o=i.minRelevant??.6,e=f(l,t).filter(n=>n.relevance>=x).slice(0,A),s=e.map(n=>({name:n.skill.frontmatter.name,lexical:n.relevance}));if(e.length===0)return{skill:null,anyRelevant:0,confidence:0,shortlist:s,judged:!1,reason:"no skill mentions anything in this task"};if(e.length===1)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`only ${e[0].skill.frontmatter.name} matched (${e[0].matchReason})`};let r=e.map(n=>({name:n.skill.frontmatter.name,description:n.skill.frontmatter.description,category:n.skill.frontmatter.category??null,tags:n.skill.frontmatter.tags})),m=await S(p,y({task:t,agent:i.agent??null,candidates:r}),b(r),{incumbent:{best:r[0].name},features:{agent:i.agent??"unknown",candidates:r.length}});if(!m)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`seat off \u2014 lexical top match (${e[0].matchReason})`};let a=v(m.answers),c=s.map(n=>({...n,p:a.ranked.find(k=>k.name===n.name)?.p??0})).sort((n,k)=>(k.p??0)-(n.p??0));if(a.anyRelevant<o)return{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`nothing on the shortlist is about this task (${a.anyRelevant.toFixed(2)} below ${o})`};let u=e.find(n=>n.skill.frontmatter.name===a.name);return u?{skill:u.skill,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`${a.name} (confidence ${a.confidence.toFixed(2)})`}:{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`seat chose "${a.name}", which was not on the shortlist`}}export{E as pickSkillForTask};
2
- //# sourceMappingURL=select-5YZQJLLD.js.map
1
+ import{y as S,z as w}from"./chunk-4XMALK7X.js";import{a as g,b as h,f as R}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import{e as f}from"./chunk-JHCI6XCJ.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";w();R();var p="skill-select";function y(l){return{task:d(l.task,1200),...l.agent?{agent:l.agent}:{},skills:l.candidates.map(t=>({name:t.name,purpose:d(t.description,300),...t.category?{category:t.category}:{},...t.tags?.length?{tags:t.tags.slice(0,8)}:{}}))}}function b(l){let t={};for(let i of l)t[i.name]=d(i.description,300);return{anyRelevant:g("At least one of these skills is about the task at hand.",{true:"The task is the kind of work one of these skills exists for, and following it would change how the work is done \u2014 it names the same system, the same procedure or the same kind of artefact.",false:"None of them is about this task. They may share vocabulary with it, mention the same tools, or belong to the same project without bearing on what is being asked. Sharing words with a task is not being about it."}),best:h(t,"Which skill is this task most about?")}}function v(l){let t=l.anyRelevant,i=l.best,o=Object.entries(i.probabilities??{}).map(([e,s])=>({name:e,p:Number(s)||0})).sort((e,s)=>s.p-e.p);return{anyRelevant:t.noul,name:i.choice,confidence:i.confidence,ranked:o}}function d(l,t){return l.length>t?`${l.slice(0,t)}\u2026`:l}var x=.1,A=12;async function E(l,t,i={}){let o=i.minRelevant??.6,e=f(l,t).filter(n=>n.relevance>=x).slice(0,A),s=e.map(n=>({name:n.skill.frontmatter.name,lexical:n.relevance}));if(e.length===0)return{skill:null,anyRelevant:0,confidence:0,shortlist:s,judged:!1,reason:"no skill mentions anything in this task"};if(e.length===1)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`only ${e[0].skill.frontmatter.name} matched (${e[0].matchReason})`};let r=e.map(n=>({name:n.skill.frontmatter.name,description:n.skill.frontmatter.description,category:n.skill.frontmatter.category??null,tags:n.skill.frontmatter.tags})),m=await S(p,y({task:t,agent:i.agent??null,candidates:r}),b(r),{incumbent:{best:r[0].name},features:{agent:i.agent??"unknown",candidates:r.length}});if(!m)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`seat off \u2014 lexical top match (${e[0].matchReason})`};let a=v(m.answers),c=s.map(n=>({...n,p:a.ranked.find(k=>k.name===n.name)?.p??0})).sort((n,k)=>(k.p??0)-(n.p??0));if(a.anyRelevant<o)return{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`nothing on the shortlist is about this task (${a.anyRelevant.toFixed(2)} below ${o})`};let u=e.find(n=>n.skill.frontmatter.name===a.name);return u?{skill:u.skill,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`${a.name} (confidence ${a.confidence.toFixed(2)})`}:{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`seat chose "${a.name}", which was not on the shortlist`}}export{E as pickSkillForTask};
2
+ //# sourceMappingURL=select-VEFE2ESF.js.map
@@ -1,2 +1,2 @@
1
- import{b as a}from"./chunk-D5IHICX3.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";async function i(o,r,s={}){let e=null,n=await a(l=>{let t=l.crons?.[o];if(t?r&&t.approval?.action==="create"?e={ok:!1,status:409,error:`schedule "${o}" is waiting for approval: agentx schedule approve ${o}`}:t.enabled===r&&(e={ok:!0,id:o,enabled:r,changed:!1}):e={ok:!1,status:404,error:`no schedule "${o}"`},e)throw new Error("no write");t.enabled=r,e={ok:!0,id:o,enabled:r,changed:!0}},{configPath:s.configPath,reload:!1});return e&&(!e.ok||!e.changed)?e:n.success?e??{ok:!1,status:500,error:"mutation did not run"}:{ok:!1,status:500,error:n.error||"could not write agentx.json"}}export{i as setCronEnabled};
2
- //# sourceMappingURL=set-enabled-CQEUZLHU.js.map
1
+ import{b as a}from"./chunk-LUYN6RAC.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";async function i(o,r,s={}){let e=null,n=await a(l=>{let t=l.crons?.[o];if(t?r&&t.approval?.action==="create"?e={ok:!1,status:409,error:`schedule "${o}" is waiting for approval: agentx schedule approve ${o}`}:t.enabled===r&&(e={ok:!0,id:o,enabled:r,changed:!1}):e={ok:!1,status:404,error:`no schedule "${o}"`},e)throw new Error("no write");t.enabled=r,e={ok:!0,id:o,enabled:r,changed:!0}},{configPath:s.configPath,reload:!1});return e&&(!e.ok||!e.changed)?e:n.success?e??{ok:!1,status:500,error:"mutation did not run"}:{ok:!1,status:500,error:n.error||"could not write agentx.json"}}export{i as setCronEnabled};
2
+ //# sourceMappingURL=set-enabled-US5BYKFZ.js.map
@@ -1,6 +1,6 @@
1
- import{b as h}from"./chunk-GZY5DYXT.js";import"./chunk-RKPAVWXF.js";import{b as l}from"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-RJFPCW7T.js";import"./chunk-S2UXDEGW.js";import"./chunk-D5IHICX3.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";var g=t=>typeof t=="string"?t.trim():"",w={in_progress:"in progress",waiting_owner:"waiting on the owner",waiting_other:"waiting on another agent",needs_attention:"needs attention"};function f(t){return t.length?t.map(e=>{let a=new Date(e.createdAt).toISOString().slice(0,16).replace("T"," "),c=e.state==="waiting_owner"&&e.question?` Question: ${e.question}`:e.state==="needs_attention"&&e.attentionReason?` ${e.attentionReason}`:"",n=String(e.text).replace(/\s+/g," ").trim();return`- ${e.id} [${w[e.state]??e.state}] ${a} UTC, ${e.channel}, ${e.agentId}: ${n.length>160?`${n.slice(0,159)}\u2026`:n}.${c}`}).join(`
1
+ import{b as h}from"./chunk-RRGITX5B.js";import"./chunk-RKPAVWXF.js";import{b as l}from"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-FWDRBUMS.js";import"./chunk-SSQMFHSM.js";import"./chunk-LUYN6RAC.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";var g=t=>typeof t=="string"?t.trim():"",w={in_progress:"in progress",waiting_owner:"waiting on the owner",waiting_other:"waiting on another agent",needs_attention:"needs attention"};function f(t){return t.length?t.map(e=>{let a=new Date(e.createdAt).toISOString().slice(0,16).replace("T"," "),c=e.state==="waiting_owner"&&e.question?` Question: ${e.question}`:e.state==="needs_attention"&&e.attentionReason?` ${e.attentionReason}`:"",n=String(e.text).replace(/\s+/g," ").trim();return`- ${e.id} [${w[e.state]??e.state}] ${a} UTC, ${e.channel}, ${e.agentId}: ${n.length>160?`${n.slice(0,159)}\u2026`:n}.${c}`}).join(`
2
2
  `):"No open requests."}function $(t){return(t??[]).map(e=>`${e.idx}. ${e.name} (${e.agentId}, ${e.kind}) [${e.state}]${e.needsApproval?` approval: ${e.approval}`:""}`)}async function y(t,e){let a=e.fetch??fetch,c=e.daemonUrl.replace(/\/$/,""),n=(g(t.action)||"list").toLowerCase();try{if(n==="list"){let u=await a(`${c}/requests`,{signal:AbortSignal.timeout(1e4)}),r=await u.json().catch(()=>({}));return u.ok?r.enabled?`${r.count} open request${r.count===1?"":"s"}, oldest first.
3
3
  ${f(r.items??[])}`:"Requests are turned off on this node (requests.enabled), so nothing is recorded.":`Error: ${r?.error||`HTTP ${u.status}`}`}let i=e.env??process.env,p=h(t,i);if(!p)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let d=await a(`${c}/requests`,{method:"POST",headers:{"Content-Type":"application/json",...l(i)},body:JSON.stringify({action:n,agentId:p.agentId,id:t.id,question:t.question,evidence:t.evidence,reason:t.reason,steps:t.steps,step:t.step,status:t.status,note:t.note}),signal:AbortSignal.timeout(1e4)}),s=await d.json().catch(()=>({}));if(!d.ok)return`Error: ${s?.error||`HTTP ${d.status}`}`;let o=s.request;return n==="accept"&&s.plan?[`Request ${o.id} is open with a plan of ${s.steps.length} steps. The daemon hands each step to its agent in order, nudges a step that goes quiet, and tells the owner when it is finished or blocked.`,...$(s.steps),`Steps the owner approves get a decision card now; an approved message is sent by the daemon itself. Report your own steps with {action:"step", id:"${o.id}", step:<n>, status:"progress"|"done"|"blocked"}.`].join(`
4
4
  `):n==="step"?[`Step reported. Plan of ${o.id}:`,...$(s.steps)].join(`
5
5
  `):n==="accept"?`Request ${o.id} is open and in progress. Close it with done (and a link to the evidence) or decline (and the reason); it stays on the owner's list until then.`:n==="wait"?`Request ${o.id} is waiting on the owner with your question. Ask them the question now, once.`:n==="done"?`Request ${o.id} is closed as done. Evidence: ${o.evidence}`:`Request ${o.id} is closed as declined. Reason: ${o.closeReason}`}catch(i){return`Error: couldn't reach the daemon (${i?.message??i}).`}}export{f as describeOpen,$ as describeSteps,y as runRequestTool};
6
- //# sourceMappingURL=tool-PIJXUBEC.js.map
6
+ //# sourceMappingURL=tool-HUSCHORN.js.map
@@ -1,4 +1,4 @@
1
- import{b as h}from"./chunk-GZY5DYXT.js";import"./chunk-RKPAVWXF.js";import{f}from"./chunk-Y4CYQV7G.js";import{b as u}from"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-RJFPCW7T.js";import"./chunk-S2UXDEGW.js";import"./chunk-D5IHICX3.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";var m=new Set(["cron","heartbeat","api","a2a","mesh","approvals","requests"]);function y(e){return typeof e=="string"?e.trim():""}async function A(e,i){let c=i.fetch??fetch,d=i.daemonUrl.replace(/\/$/,""),s=(y(e.action)||"create").toLowerCase(),r=h(e,i.env??process.env);if(s==="status"){let o=y(e.id);if(!o)return"Error: `id` is required for status (the card id you got when you raised it).";try{let n=await c(`${d}/approvals/${encodeURIComponent(o)}`,{signal:AbortSignal.timeout(1e4)}),a=await n.json().catch(()=>({}));if(!n.ok)return`Error: ${a?.error||`HTTP ${n.status}`}`;let t=a.card;if(r&&t.raised_by!==r.agentId)return`Error: card "${o}" was raised by another agent.`;if(t.status==="pending")return`Card ${t.id} is still waiting for the operator. It expires ${t.expires}; then "${t.if_silent}" applies.`;if(t.status==="decided"){let p=t.verdict==="yes"?f(t).join(`
1
+ import{b as h}from"./chunk-RRGITX5B.js";import"./chunk-RKPAVWXF.js";import{f}from"./chunk-Y4CYQV7G.js";import{b as u}from"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-FWDRBUMS.js";import"./chunk-SSQMFHSM.js";import"./chunk-LUYN6RAC.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";var m=new Set(["cron","heartbeat","api","a2a","mesh","approvals","requests"]);function y(e){return typeof e=="string"?e.trim():""}async function A(e,i){let c=i.fetch??fetch,d=i.daemonUrl.replace(/\/$/,""),s=(y(e.action)||"create").toLowerCase(),r=h(e,i.env??process.env);if(s==="status"){let o=y(e.id);if(!o)return"Error: `id` is required for status (the card id you got when you raised it).";try{let n=await c(`${d}/approvals/${encodeURIComponent(o)}`,{signal:AbortSignal.timeout(1e4)}),a=await n.json().catch(()=>({}));if(!n.ok)return`Error: ${a?.error||`HTTP ${n.status}`}`;let t=a.card;if(r&&t.raised_by!==r.agentId)return`Error: card "${o}" was raised by another agent.`;if(t.status==="pending")return`Card ${t.id} is still waiting for the operator. It expires ${t.expires}; then "${t.if_silent}" applies.`;if(t.status==="decided"){let p=t.verdict==="yes"?f(t).join(`
2
2
  `):"";return`Card ${t.id}: the operator said ${String(t.verdict).toUpperCase()}.${t.note?` Note: ${t.note}`:""}${p?`
3
3
  ${p}`:""}`}return`Card ${t.id} expired unanswered; the default applied: ${t.outcome??t.if_silent}.`}catch(n){return`Error: couldn't reach the daemon (${n?.message??n}).`}}if(s!=="create")return`Error: unknown action "${s}". Use create or status.`;if(!r)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let l=r.channel&&r.chatId&&!m.has(r.channel)?{channel:r.channel,chatId:r.chatId,...r.accountId?{accountId:r.accountId}:{}}:void 0,$={title:e.title,ask:e.ask,recommend:e.recommend,if_silent:e.if_silent,expires:e.expires,source:e.source,choices:e.choices,draft:e.draft,say:e.say,context:e.context,raised_by:r.agentId,...l?{reply:l}:{}};try{let o=await c(`${d}/approvals`,{method:"POST",headers:{"Content-Type":"application/json",...u(i.env??process.env)},body:JSON.stringify($),signal:AbortSignal.timeout(1e4)}),n=await o.json().catch(()=>({}));if(!o.ok)return`Error: ${n?.error||`HTTP ${o.status}`}`;let a=n.card;return[`Decision card ${a.id} is in the operator's Approvals inbox.`,`If nobody answers by ${a.expires}, "${a.if_silent}" applies.`,"You will get a message with the result. Tell the requester it is waiting for approval; don't ask the operator again in chat."].join(" ")}catch(o){return`Error: couldn't reach the daemon (${o?.message??o}).`}}export{A as runApprovalTool};
4
- //# sourceMappingURL=tool-R77KFLZ3.js.map
4
+ //# sourceMappingURL=tool-XLWLXGB5.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-KEXBEUSU.js";import"./chunk-QIJLFPWE.js";export{a as WIKI_ARTICLE_TYPES,b as isWikiArticleType};
2
+ //# sourceMappingURL=types-ARP27T6T.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-RGZARSHV.js";import"./chunk-QIJLFPWE.js";export{a as IMPORTANCE_LEVELS};
2
+ //# sourceMappingURL=types-LJZ2YY5W.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ import"./chunk-VWTBHLMX.js";import{a as b}from"./chunk-6WF56ME6.js";import{a}from"./chunk-NY7NHGVT.js";import"./chunk-KEXBEUSU.js";import"./chunk-RGZARSHV.js";import{b as c}from"./chunk-WWDYDLY2.js";import"./chunk-YA3P77LV.js";import"./chunk-ERULJ2ZL.js";import"./chunk-WPNRDEHW.js";import"./chunk-JRS5QRZG.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-4XMALK7X.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-6TURWSMN.js";import"./chunk-QD6IICK7.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-DYGQF3MI.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as WikiHub,a as WikiStore,c as agenticQuery};
2
+ //# sourceMappingURL=wiki-GCRRINW3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-MI7WOGH6.js";import"./chunk-QIJLFPWE.js";export{a as claudeCall,b as registerWikiEnrich};
2
+ //# sourceMappingURL=wiki-enrich-P5TNWACZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentix-cli",
3
- "version": "0.133.0",
3
+ "version": "0.135.0",
4
4
  "description": "AI operations layer for small and medium businesses. Routes Telegram, WhatsApp, GitLab, GitHub, crons, webhooks, and mesh tasks to AI agents. Web wizard for operators, CLI for engineers. Self-hosted.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,2 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-PHCWYKQW.js";import"./chunk-OQV3LWJI.js";import"./chunk-57Y2WZT2.js";import"./chunk-IZDKRNXC.js";import"./chunk-JA5Y4LDP.js";import"./chunk-WPNRDEHW.js";import"./chunk-7VLLZQ3N.js";import"./chunk-BIJHMWXK.js";import"./chunk-F5PVUB4Y.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-6TURWSMN.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-2BF6HJJD.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{i as JUDGE_ENTRY_CHARS,e as WEAK_CITATION,j as buildJudgePrompt,l as buildScorecard,f as checkArticle,n as envelopeUsage,h as findDuplicates,k as parseJudgeReply,b as pickSample,m as renderScorecard,a as seededRandom,o as summariseRuns,d as termOverlap,c as terms,g as uncitedWithFacts};
2
- //# sourceMappingURL=absorb-eval-37XZJACN.js.map