agentix-cli 0.50.0 → 0.51.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.
- package/apps/mac-voice/Sources/AgentXVoice/AgentClient.swift +67 -14
- package/apps/mac-voice/Sources/AgentXVoice/Config.swift +20 -3
- package/apps/mac-voice/Sources/AgentXVoice/Panel.swift +24 -31
- package/apps/mac-voice/Sources/AgentXVoice/Speech.swift +16 -2
- package/apps/mac-voice/Sources/AgentXVoice/StatusMenu.swift +173 -0
- package/apps/mac-voice/Sources/AgentXVoice/main.swift +62 -15
- package/dist/{App-KE4SURSS.js → App-QVNQ5BQK.js} +2 -2
- package/dist/{ChatApp-NNHIKXO2.js → ChatApp-CC57XC23.js} +2 -2
- package/dist/agent-ILH6ANOM.js +2 -0
- package/dist/{article-fields-L4D2BOGY.js → article-fields-PITN4NHA.js} +2 -2
- package/dist/{article-quality-44ONVGLN.js → article-quality-JFJMZWFQ.js} +2 -2
- package/dist/{audit-4245CX6P.js → audit-CMJ2TZ3K.js} +2 -2
- package/dist/{backfill-MTD2B62I.js → backfill-7TCF4SHG.js} +2 -2
- package/dist/{board-dashboard-RUOASCSQ.js → board-dashboard-XPPBRPQE.js} +117 -117
- package/dist/board-dashboard-XPPBRPQE.js.map +1 -0
- package/dist/{builtin-B67DMJ3M.js → builtin-W6KNX7RS.js} +2 -2
- package/dist/calibration-MCCVYGZQ.js +2 -0
- package/dist/{chunk-3SCPRYJB.js → chunk-2AXFYDWF.js} +2 -2
- package/dist/{chunk-4TITGMPX.js → chunk-2KQTE4XI.js} +2 -2
- package/dist/{chunk-QDE75R4U.js → chunk-6HAZ6YWI.js} +2 -2
- package/dist/{chunk-F4HZTZHW.js → chunk-72SZI2UW.js} +2 -2
- package/dist/{chunk-L2WSPY6S.js → chunk-7I7IEX4S.js} +2 -2
- package/dist/{chunk-OTW5MPFT.js → chunk-CAA546XN.js} +2 -2
- package/dist/{chunk-5XQCGPQJ.js → chunk-F7WY24UZ.js} +2 -2
- package/dist/{chunk-ZTEU5JVQ.js → chunk-FCPTN6NF.js} +2 -2
- package/dist/{chunk-AJONZWLT.js → chunk-FX3D7YON.js} +2 -2
- package/dist/{chunk-5ALS7SVV.js → chunk-H2TWRZC2.js} +2 -2
- package/dist/{chunk-WPMX3VGI.js → chunk-J3SOEFRE.js} +2 -2
- package/dist/{chunk-4NBWF4TL.js → chunk-JQR3NTHI.js} +2 -2
- package/dist/{chunk-OUZ7YVQZ.js → chunk-KFALP5NO.js} +2 -2
- package/dist/{chunk-Y6I3BYWV.js → chunk-LBMZP7TG.js} +95 -95
- package/dist/chunk-LBMZP7TG.js.map +1 -0
- package/dist/{chunk-WQLBJ2O5.js → chunk-PSDCRZZM.js} +6 -6
- package/dist/chunk-QIJLFPWE.js +2 -0
- package/dist/{chunk-PZCTCCC5.js → chunk-QP6XNTBB.js} +2 -2
- package/dist/{chunk-BH3GTCZ6.js → chunk-RGDKHYY2.js} +2 -2
- package/dist/{chunk-JVNFRS26.js → chunk-ROCUOXCW.js} +2 -2
- package/dist/{chunk-FULEQYM6.js → chunk-S7CVSKOX.js} +2 -2
- package/dist/chunk-S7CVSKOX.js.map +1 -0
- package/dist/{chunk-K33GIBSE.js → chunk-SIU6STB2.js} +2 -2
- package/dist/{chunk-P2ZYT5D6.js → chunk-SRCXUZM2.js} +5 -5
- package/dist/{chunk-P2ZYT5D6.js.map → chunk-SRCXUZM2.js.map} +1 -1
- package/dist/{chunk-LCIREYTD.js → chunk-SZJMS7K4.js} +2 -2
- package/dist/{chunk-AJ5RMU7X.js → chunk-TFVUOC2C.js} +2 -2
- package/dist/chunk-U67EG5IF.js +19 -0
- package/dist/chunk-U67EG5IF.js.map +1 -0
- package/dist/{chunk-BYD55JXH.js → chunk-UBRMOTBH.js} +181 -180
- package/dist/chunk-UBRMOTBH.js.map +1 -0
- package/dist/chunk-V7XZN3MQ.js +123 -0
- package/dist/chunk-V7XZN3MQ.js.map +1 -0
- package/dist/{chunk-NLZD2QKF.js → chunk-VMS3HVTT.js} +2 -2
- package/dist/{chunk-TUNQFPVA.js → chunk-WCMQRSVU.js} +2 -2
- package/dist/{chunk-OHA3J5ZV.js → chunk-WDQ3BPFS.js} +2 -2
- package/dist/{chunk-6VKCUMCN.js → chunk-WKTFP3SK.js} +2 -2
- package/dist/{chunk-Q7C3X3R6.js → chunk-WP6KLXTP.js} +2 -2
- package/dist/{chunk-IXUEJBHD.js → chunk-XZTR5MBJ.js} +2 -2
- package/dist/{chunk-W5C2GDNC.js → chunk-Y57CULGE.js} +2 -2
- package/dist/chunk-YE2BUU3Z.js +28 -0
- package/dist/chunk-YE2BUU3Z.js.map +1 -0
- package/dist/{chunk-TTL37CS5.js → chunk-YEV6W34S.js} +55 -55
- package/dist/{chunk-TTL37CS5.js.map → chunk-YEV6W34S.js.map} +1 -1
- package/dist/cli.js +1 -1
- package/dist/client-I7GAAM3T.js +2 -0
- package/dist/{compaction-PIZINFHR.js → compaction-NWPBPWY2.js} +4 -4
- package/dist/{config-R47ITLIY.js → config-TVW7UCKG.js} +2 -2
- package/dist/config-mutator-JHM53P5A.js +2 -0
- package/dist/{conflict-detector-ZPOT3M2C.js → conflict-detector-KS7OSS45.js} +2 -2
- package/dist/{context-planner-FJMU5WAT.js → context-planner-LJT5IKH6.js} +3 -3
- package/dist/debug-FTAGG7MN.js +2 -0
- package/dist/{discover-D4VVRNAI.js → discover-7YFQNYLC.js} +2 -2
- package/dist/doctor-CXFMV6PT.js +2 -0
- package/dist/{editor-chat-MOMQHMO4.js → editor-chat-V24MXQIB.js} +2 -2
- package/dist/{entry-triage-LK34TSQD.js → entry-triage-LZWMMLLN.js} +2 -2
- package/dist/{facts-YVEJOM7O.js → facts-4YPSHIXJ.js} +2 -2
- package/dist/{failure-candidates-ARRMFXRY.js → failure-candidates-RIXA3Y6D.js} +2 -2
- package/dist/heal-HVYQD3EZ.js +2 -0
- package/dist/index.d.ts +256 -6
- package/dist/index.js +2 -2
- package/dist/{ingest-whatsapp-NS4OWDOU.js → ingest-whatsapp-4POCTRTP.js} +2 -2
- package/dist/loader-EVHZ2R73.js +2 -0
- package/dist/loader-KKMG24O5.js +2 -0
- package/dist/memory-extract-MGGXIZTE.js +2 -0
- package/dist/{migrate-v2-V4WN2VVM.js → migrate-v2-5VGHWPBW.js} +2 -2
- package/dist/{ntfy-X7EPB3TG.js → ntfy-ZY2NPGBA.js} +2 -2
- package/dist/processes-CMTMB7LG.js +2 -0
- package/dist/program-ZCFMO4ZD.js +2 -0
- package/dist/{projects-api-QE6L65SK.js → projects-api-E337EQNV.js} +2 -2
- package/dist/{projects-mutate-MY7JTLSZ.js → projects-mutate-S5MY7V3V.js} +2 -2
- package/dist/promote-4T64VW5K.js +2 -0
- package/dist/proposals-O4B5LD5T.js +2 -0
- package/dist/providers-NRPX2FHP.js +2 -0
- package/dist/query-6IKL52WT.js +2 -0
- package/dist/{questions-4B4KSPXG.js → questions-2V2VGIT4.js} +2 -2
- package/dist/recipes-423CIPZ3.js +2 -0
- package/dist/registry-E4QUXHMQ.js +2 -0
- package/dist/{request-planner-PEAYYXAP.js → request-planner-BRLDCYU5.js} +2 -2
- package/dist/{review-candidates-W7NIHNAI.js → review-candidates-QWW5PDUU.js} +2 -2
- package/dist/{review-store-B4YE3EFK.js → review-store-PW3OBGZQ.js} +2 -2
- package/dist/{rotation-memo-QEO3COFH.js → rotation-memo-453FXKHQ.js} +2 -2
- package/dist/routing-DP6S7OJL.js +2 -0
- package/dist/runner-56G3N7M4.js +2 -0
- package/dist/schedule-tool-TPJ6GR47.js +2 -0
- package/dist/scheduler-7QPG6OTY.js +2 -0
- package/dist/seat-3KUNRM5Z.js +2 -0
- package/dist/{select-4XYRIZ5L.js → select-ILXHYJGD.js} +2 -2
- package/dist/shutdown-ZAF7RW25.js +2 -0
- package/dist/store-TWQPEM5V.js +2 -0
- package/dist/{subagent-2SJHSSJS.js → subagent-XY5N7TUU.js} +2 -2
- package/dist/{surface-usage-V2BX4SBD.js → surface-usage-HVVP22SA.js} +2 -2
- package/dist/timers-KK7GF77Y.js +2 -0
- package/dist/{tool-PAQ47HV2.js → tool-SF3BCY55.js} +2 -2
- package/dist/{triage-backtest-JNO7RKX7.js → triage-backtest-DLKYJSEB.js} +2 -2
- package/dist/types-DO3KLIBS.js +2 -0
- package/dist/types-S6NHM5C3.js +2 -0
- package/dist/{whatsapp-state-6D6FHHD2.js → whatsapp-state-LB3R32BK.js} +2 -2
- package/dist/wiki-WETANN3W.js +2 -0
- package/dist/{workspace-setup-G6KGWPHY.js → workspace-setup-42ARC42I.js} +2 -2
- package/package.json +1 -1
- package/dist/agent-RY7Z3IYY.js +0 -2
- package/dist/board-dashboard-RUOASCSQ.js.map +0 -1
- package/dist/calibration-ILS5OI44.js +0 -2
- package/dist/chunk-B5XHX44Y.js +0 -123
- package/dist/chunk-B5XHX44Y.js.map +0 -1
- package/dist/chunk-BYD55JXH.js.map +0 -1
- package/dist/chunk-EMI3VJLH.js +0 -28
- package/dist/chunk-EMI3VJLH.js.map +0 -1
- package/dist/chunk-FIOB3MEX.js +0 -2
- package/dist/chunk-FULEQYM6.js.map +0 -1
- package/dist/chunk-N2XXKFJ6.js +0 -19
- package/dist/chunk-N2XXKFJ6.js.map +0 -1
- package/dist/chunk-Y6I3BYWV.js.map +0 -1
- package/dist/client-JZTH46N2.js +0 -2
- package/dist/config-mutator-T6JGXJ26.js +0 -2
- package/dist/debug-3MEUO2P2.js +0 -2
- package/dist/doctor-2DMGAWMW.js +0 -2
- package/dist/heal-FVLBHYP7.js +0 -2
- package/dist/loader-4ZGTK7LD.js +0 -2
- package/dist/loader-BOKE5M5S.js +0 -2
- package/dist/memory-extract-OWTI6MN5.js +0 -2
- package/dist/processes-KUJJ7XE7.js +0 -2
- package/dist/program-KY5ZYPFN.js +0 -2
- package/dist/promote-57YNOVXV.js +0 -2
- package/dist/proposals-TX2HBBYV.js +0 -2
- package/dist/providers-KO2DODIO.js +0 -2
- package/dist/query-ZT7WXY2F.js +0 -2
- package/dist/recipes-7S4MC5OJ.js +0 -2
- package/dist/registry-LLAFJJN4.js +0 -2
- package/dist/routing-7LCO7UJ7.js +0 -2
- package/dist/runner-YRBVNYTY.js +0 -2
- package/dist/schedule-tool-ZD3VBUBW.js +0 -2
- package/dist/scheduler-GC3FQKXY.js +0 -2
- package/dist/seat-HR6QMAR2.js +0 -2
- package/dist/shutdown-6GCMKYAD.js +0 -2
- package/dist/store-MCOA6N4F.js +0 -2
- package/dist/timers-PCB4ZIBD.js +0 -2
- package/dist/types-H5ENIUIT.js +0 -2
- package/dist/types-OIFU3KSQ.js +0 -2
- package/dist/wiki-EREMPSAE.js +0 -2
- /package/dist/{App-KE4SURSS.js.map → App-QVNQ5BQK.js.map} +0 -0
- /package/dist/{ChatApp-NNHIKXO2.js.map → ChatApp-CC57XC23.js.map} +0 -0
- /package/dist/{agent-RY7Z3IYY.js.map → agent-ILH6ANOM.js.map} +0 -0
- /package/dist/{article-fields-L4D2BOGY.js.map → article-fields-PITN4NHA.js.map} +0 -0
- /package/dist/{article-quality-44ONVGLN.js.map → article-quality-JFJMZWFQ.js.map} +0 -0
- /package/dist/{audit-4245CX6P.js.map → audit-CMJ2TZ3K.js.map} +0 -0
- /package/dist/{backfill-MTD2B62I.js.map → backfill-7TCF4SHG.js.map} +0 -0
- /package/dist/{builtin-B67DMJ3M.js.map → builtin-W6KNX7RS.js.map} +0 -0
- /package/dist/{calibration-ILS5OI44.js.map → calibration-MCCVYGZQ.js.map} +0 -0
- /package/dist/{chunk-3SCPRYJB.js.map → chunk-2AXFYDWF.js.map} +0 -0
- /package/dist/{chunk-4TITGMPX.js.map → chunk-2KQTE4XI.js.map} +0 -0
- /package/dist/{chunk-QDE75R4U.js.map → chunk-6HAZ6YWI.js.map} +0 -0
- /package/dist/{chunk-F4HZTZHW.js.map → chunk-72SZI2UW.js.map} +0 -0
- /package/dist/{chunk-L2WSPY6S.js.map → chunk-7I7IEX4S.js.map} +0 -0
- /package/dist/{chunk-OTW5MPFT.js.map → chunk-CAA546XN.js.map} +0 -0
- /package/dist/{chunk-5XQCGPQJ.js.map → chunk-F7WY24UZ.js.map} +0 -0
- /package/dist/{chunk-ZTEU5JVQ.js.map → chunk-FCPTN6NF.js.map} +0 -0
- /package/dist/{chunk-AJONZWLT.js.map → chunk-FX3D7YON.js.map} +0 -0
- /package/dist/{chunk-5ALS7SVV.js.map → chunk-H2TWRZC2.js.map} +0 -0
- /package/dist/{chunk-WPMX3VGI.js.map → chunk-J3SOEFRE.js.map} +0 -0
- /package/dist/{chunk-4NBWF4TL.js.map → chunk-JQR3NTHI.js.map} +0 -0
- /package/dist/{chunk-OUZ7YVQZ.js.map → chunk-KFALP5NO.js.map} +0 -0
- /package/dist/{chunk-WQLBJ2O5.js.map → chunk-PSDCRZZM.js.map} +0 -0
- /package/dist/{chunk-FIOB3MEX.js.map → chunk-QIJLFPWE.js.map} +0 -0
- /package/dist/{chunk-PZCTCCC5.js.map → chunk-QP6XNTBB.js.map} +0 -0
- /package/dist/{chunk-BH3GTCZ6.js.map → chunk-RGDKHYY2.js.map} +0 -0
- /package/dist/{chunk-JVNFRS26.js.map → chunk-ROCUOXCW.js.map} +0 -0
- /package/dist/{chunk-K33GIBSE.js.map → chunk-SIU6STB2.js.map} +0 -0
- /package/dist/{chunk-LCIREYTD.js.map → chunk-SZJMS7K4.js.map} +0 -0
- /package/dist/{chunk-AJ5RMU7X.js.map → chunk-TFVUOC2C.js.map} +0 -0
- /package/dist/{chunk-NLZD2QKF.js.map → chunk-VMS3HVTT.js.map} +0 -0
- /package/dist/{chunk-TUNQFPVA.js.map → chunk-WCMQRSVU.js.map} +0 -0
- /package/dist/{chunk-OHA3J5ZV.js.map → chunk-WDQ3BPFS.js.map} +0 -0
- /package/dist/{chunk-6VKCUMCN.js.map → chunk-WKTFP3SK.js.map} +0 -0
- /package/dist/{chunk-Q7C3X3R6.js.map → chunk-WP6KLXTP.js.map} +0 -0
- /package/dist/{chunk-IXUEJBHD.js.map → chunk-XZTR5MBJ.js.map} +0 -0
- /package/dist/{chunk-W5C2GDNC.js.map → chunk-Y57CULGE.js.map} +0 -0
- /package/dist/{client-JZTH46N2.js.map → client-I7GAAM3T.js.map} +0 -0
- /package/dist/{compaction-PIZINFHR.js.map → compaction-NWPBPWY2.js.map} +0 -0
- /package/dist/{config-R47ITLIY.js.map → config-TVW7UCKG.js.map} +0 -0
- /package/dist/{config-mutator-T6JGXJ26.js.map → config-mutator-JHM53P5A.js.map} +0 -0
- /package/dist/{conflict-detector-ZPOT3M2C.js.map → conflict-detector-KS7OSS45.js.map} +0 -0
- /package/dist/{context-planner-FJMU5WAT.js.map → context-planner-LJT5IKH6.js.map} +0 -0
- /package/dist/{debug-3MEUO2P2.js.map → debug-FTAGG7MN.js.map} +0 -0
- /package/dist/{discover-D4VVRNAI.js.map → discover-7YFQNYLC.js.map} +0 -0
- /package/dist/{doctor-2DMGAWMW.js.map → doctor-CXFMV6PT.js.map} +0 -0
- /package/dist/{editor-chat-MOMQHMO4.js.map → editor-chat-V24MXQIB.js.map} +0 -0
- /package/dist/{entry-triage-LK34TSQD.js.map → entry-triage-LZWMMLLN.js.map} +0 -0
- /package/dist/{facts-YVEJOM7O.js.map → facts-4YPSHIXJ.js.map} +0 -0
- /package/dist/{failure-candidates-ARRMFXRY.js.map → failure-candidates-RIXA3Y6D.js.map} +0 -0
- /package/dist/{heal-FVLBHYP7.js.map → heal-HVYQD3EZ.js.map} +0 -0
- /package/dist/{ingest-whatsapp-NS4OWDOU.js.map → ingest-whatsapp-4POCTRTP.js.map} +0 -0
- /package/dist/{loader-4ZGTK7LD.js.map → loader-EVHZ2R73.js.map} +0 -0
- /package/dist/{loader-BOKE5M5S.js.map → loader-KKMG24O5.js.map} +0 -0
- /package/dist/{memory-extract-OWTI6MN5.js.map → memory-extract-MGGXIZTE.js.map} +0 -0
- /package/dist/{migrate-v2-V4WN2VVM.js.map → migrate-v2-5VGHWPBW.js.map} +0 -0
- /package/dist/{ntfy-X7EPB3TG.js.map → ntfy-ZY2NPGBA.js.map} +0 -0
- /package/dist/{processes-KUJJ7XE7.js.map → processes-CMTMB7LG.js.map} +0 -0
- /package/dist/{program-KY5ZYPFN.js.map → program-ZCFMO4ZD.js.map} +0 -0
- /package/dist/{projects-api-QE6L65SK.js.map → projects-api-E337EQNV.js.map} +0 -0
- /package/dist/{projects-mutate-MY7JTLSZ.js.map → projects-mutate-S5MY7V3V.js.map} +0 -0
- /package/dist/{promote-57YNOVXV.js.map → promote-4T64VW5K.js.map} +0 -0
- /package/dist/{proposals-TX2HBBYV.js.map → proposals-O4B5LD5T.js.map} +0 -0
- /package/dist/{providers-KO2DODIO.js.map → providers-NRPX2FHP.js.map} +0 -0
- /package/dist/{query-ZT7WXY2F.js.map → query-6IKL52WT.js.map} +0 -0
- /package/dist/{questions-4B4KSPXG.js.map → questions-2V2VGIT4.js.map} +0 -0
- /package/dist/{recipes-7S4MC5OJ.js.map → recipes-423CIPZ3.js.map} +0 -0
- /package/dist/{registry-LLAFJJN4.js.map → registry-E4QUXHMQ.js.map} +0 -0
- /package/dist/{request-planner-PEAYYXAP.js.map → request-planner-BRLDCYU5.js.map} +0 -0
- /package/dist/{review-candidates-W7NIHNAI.js.map → review-candidates-QWW5PDUU.js.map} +0 -0
- /package/dist/{review-store-B4YE3EFK.js.map → review-store-PW3OBGZQ.js.map} +0 -0
- /package/dist/{rotation-memo-QEO3COFH.js.map → rotation-memo-453FXKHQ.js.map} +0 -0
- /package/dist/{routing-7LCO7UJ7.js.map → routing-DP6S7OJL.js.map} +0 -0
- /package/dist/{runner-YRBVNYTY.js.map → runner-56G3N7M4.js.map} +0 -0
- /package/dist/{schedule-tool-ZD3VBUBW.js.map → schedule-tool-TPJ6GR47.js.map} +0 -0
- /package/dist/{scheduler-GC3FQKXY.js.map → scheduler-7QPG6OTY.js.map} +0 -0
- /package/dist/{seat-HR6QMAR2.js.map → seat-3KUNRM5Z.js.map} +0 -0
- /package/dist/{select-4XYRIZ5L.js.map → select-ILXHYJGD.js.map} +0 -0
- /package/dist/{shutdown-6GCMKYAD.js.map → shutdown-ZAF7RW25.js.map} +0 -0
- /package/dist/{store-MCOA6N4F.js.map → store-TWQPEM5V.js.map} +0 -0
- /package/dist/{subagent-2SJHSSJS.js.map → subagent-XY5N7TUU.js.map} +0 -0
- /package/dist/{surface-usage-V2BX4SBD.js.map → surface-usage-HVVP22SA.js.map} +0 -0
- /package/dist/{timers-PCB4ZIBD.js.map → timers-KK7GF77Y.js.map} +0 -0
- /package/dist/{tool-PAQ47HV2.js.map → tool-SF3BCY55.js.map} +0 -0
- /package/dist/{triage-backtest-JNO7RKX7.js.map → triage-backtest-DLKYJSEB.js.map} +0 -0
- /package/dist/{types-H5ENIUIT.js.map → types-DO3KLIBS.js.map} +0 -0
- /package/dist/{types-OIFU3KSQ.js.map → types-S6NHM5C3.js.map} +0 -0
- /package/dist/{whatsapp-state-6D6FHHD2.js.map → whatsapp-state-LB3R32BK.js.map} +0 -0
- /package/dist/{wiki-EREMPSAE.js.map → wiki-WETANN3W.js.map} +0 -0
- /package/dist/{workspace-setup-G6KGWPHY.js.map → workspace-setup-42ARC42I.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";import{createHash as C}from"crypto";function $(e,n){if(!e.enabled)return[];let t=n.listContacts(),d=n.listChats(),i=[],a=r=>r.replace(/^\+/,"").toLowerCase(),s=e.allowContacts.map(a),o=e.allowGroups.map(a),c=e.denyContacts.map(a),u=e.denyGroups.map(a),m=(r,g)=>{if(g.length===0)return!1;let f=a(r);return g.some(p=>f.includes(p)||p.includes(f))};for(let r of t){let g=`${r.phone}|${r.jid}`;if(m(g,c)||!m(g,s))continue;let f=d.find(p=>!p.isGroup&&p.jid===r.jid);i.push({kind:"contact",jid:r.jid,contact:r,chat:f})}for(let r of d)r.isGroup&&(m(r.jid,u)||m(r.jid,o)&&i.push({kind:"group",jid:r.jid,chat:r}));return i}var h=(e=new Date)=>e.toISOString().slice(0,10),l=(e=new Date)=>h(e).replace(/-/g,"");function w(e){return C("sha1").update(e).digest("hex").slice(0,10)}function R(e,n,t=new Date){let d=h(t),i=`wa-contact-${w(e.jid)}-${l(t)}`,s=[`# Contact: ${e.savedName||e.pushName||e.phone||e.jid}`,""];return s.push(`- **JID**: ${e.jid}`),e.phone&&s.push(`- **Phone**: +${e.phone}`),e.savedName&&s.push(`- **Saved name**: ${e.savedName}`),e.pushName&&e.pushName!==e.savedName&&s.push(`- **Push name**: ${e.pushName}`),e.status&&s.push(`- **Status**: ${e.status}`),e.updatedAt&&s.push(`- **Last observed**: ${e.updatedAt}`),{id:i,date:d,agentId:n,source:"whatsapp:contact",sourceContext:e.jid,content:s.join(`
|
|
2
2
|
`),meta:{jid:e.jid,phone:e.phone,kind:"contact",profileHash:x(e)}}}function k(e,n,t=new Date){let d=h(t),i=`wa-group-meta-${w(e.jid)}-${l(t)}`,a=[`# Group: ${e.subject||"(unnamed)"}`,""];a.push(`- **JID**: ${e.jid}`),e.description&&a.push(`- **Description**: ${e.description}`),e.owner&&a.push(`- **Owner**: ${e.owner}`),a.push(`- **Members (${e.memberCount})**:`);let s=e.members.slice(0,50);for(let o of s){let c=o.admin?` (${o.admin})`:"";a.push(` - ${o.jid}${c}`)}return e.members.length>s.length&&a.push(` - \u2026and ${e.members.length-s.length} more`),{id:i,date:d,agentId:n,source:"whatsapp:group-meta",sourceContext:e.jid,content:a.join(`
|
|
3
3
|
`),meta:{jid:e.jid,subject:e.subject,memberCount:e.memberCount,kind:"group-meta"}}}function D(e,n,t,d,i=new Date){if(t.length===0)return null;let a=t[t.length-1].id,s=h(i),o=`wa-dm-${w(e.jid)}-${l(i)}-${b(a)}`,c=n?.savedName||n?.pushName||e.name||e.jid,u=[`# Chat with ${c}`,""];u.push(`- **JID**: ${e.jid}`),n?.phone&&u.push(`- **Phone**: +${n.phone}`),u.push(`- **Messages**: ${t.length}`),u.push("");for(let m of t)u.push(y(m,c));return{id:o,date:s,agentId:d,source:"whatsapp:dm",sourceContext:e.jid,content:u.join(`
|
|
4
4
|
`),meta:{jid:e.jid,kind:"dm",messageCount:t.length,oldestMsgTs:t[0]?.timestamp,newestMsgTs:t[t.length-1]?.timestamp,lastMsgId:a}}}function M(e,n,t,d,i=new Date){if(t.length===0)return null;let a=t[t.length-1].id,s=h(i),o=`wa-group-${w(e.jid)}-${l(i)}-${b(a)}`,c=[`# Group chat: ${n.subject||e.name}`,""];c.push(`- **JID**: ${e.jid}`),c.push(`- **Members**: ${n.memberCount}`),c.push(`- **Messages**: ${t.length}`),c.push("");for(let u of t)c.push(y(u,u.fromJid));return{id:o,date:s,agentId:d,source:"whatsapp:group",sourceContext:e.jid,content:c.join(`
|
|
5
5
|
`),meta:{jid:e.jid,kind:"group",messageCount:t.length,lastMsgId:a}}}function y(e,n){let t=e.timestamp?G(e.timestamp):"",d=e.fromMe?"me":n,i=e.text;return!i&&e.media&&(e.media.kind==="image"?i=`[image${e.media.caption?`: ${e.media.caption}`:""}]`:e.media.kind==="audio"?i="[voice message]":e.media.kind==="video"?i=`[video${e.media.caption?`: ${e.media.caption}`:""}]`:e.media.kind==="document"?i=`[document: ${e.media.filename??"unnamed"}]`:e.media.kind==="sticker"&&(i="[sticker]")),`[${t}] ${d}: ${i}`}function G(e){try{return new Date(e*1e3).toISOString().replace("T"," ").slice(0,16)}catch{return String(e)}}function b(e){return e.replace(/[^A-Za-z0-9]/g,"").slice(-10)}function x(e){let n=C("sha1");return n.update(e.jid),n.update("|"),n.update(e.savedName||""),n.update("|"),n.update(e.pushName||""),n.update("|"),n.update(e.status||""),n.digest("hex").slice(0,10)}async function I(e){let n=e.now??new Date,t={scannedContacts:0,scannedGroups:0,wroteContacts:0,wroteGroups:0,wroteDmWindows:0,wroteGroupWindows:0,skippedUnchanged:0,errors:[]},d=[],i=s=>{if(e.dryRun){d.push(s);return}e.store.addEntry(s)};if(!e.source.isConnected()&&!e.dryRun)return t.errors.push({jid:"-",kind:"source",message:"WhatsApp socket not connected"}),{...t,dryRunEntries:e.dryRun?d:void 0};let a=$(e.config,e.source);a.length>e.config.throttle.maxChatsPerSweep&&(a=a.slice(0,e.config.throttle.maxChatsPerSweep));for(let s of a)try{if(s.kind==="contact"){t.scannedContacts++;let o=s.contact??await e.source.getContactProfile(s.jid);if(!o)continue;let c=R(o,e.agentId,n);if(i(c),t.wroteContacts++,e.config.mode==="messages"){let u=await e.source.getHistory(s.jid,{limit:e.config.messageCap}),m=j(u,e.config.historyDays,n);if(m.length>0&&s.chat){let r=D(s.chat,o,m,e.agentId,n);r&&(i(r),t.wroteDmWindows++)}}}else{t.scannedGroups++;let o=await e.source.getGroupMetadata(s.jid);if(!o)continue;let c=k(o,e.agentId,n);if(i(c),t.wroteGroups++,e.config.mode==="messages"&&s.chat){let u=await e.source.getHistory(s.jid,{limit:e.config.messageCap}),m=j(u,e.config.historyDays,n);if(m.length>0){let r=M(s.chat,o,m,e.agentId,n);r&&(i(r),t.wroteGroupWindows++)}}}}catch(o){t.errors.push({jid:s.jid,kind:s.kind,message:o?.message??String(o)})}return{...t,dryRunEntries:e.dryRun?d:void 0}}function j(e,n,t){let d=Math.floor((t.getTime()-n*864e5)/1e3);return e.filter(i=>!i.timestamp||i.timestamp>=d)}export{x as hashProfile,$ as resolveScope,I as runSweep,R as transformContact,D as transformDm,M as transformGroupMessages,k as transformGroupMeta};
|
|
6
|
-
//# sourceMappingURL=ingest-whatsapp-
|
|
6
|
+
//# sourceMappingURL=ingest-whatsapp-4POCTRTP.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as g,d as l}from"./chunk-PNWNVOEZ.js";import"./chunk-
|
|
1
|
+
import{b as g,d as l}from"./chunk-PNWNVOEZ.js";import"./chunk-QIJLFPWE.js";import{readFileSync as m,writeFileSync as y,existsSync as v,copyFileSync as f}from"fs";import{join as _}from"path";var w=new Set(["code","ops","support","admin","knowledge","social","system"]),x=[{test:/\b(review[-_.]?(merge[-_.]?request|mr|pull[-_.]?request|pr))\b/i,category:"code",verb:"review.merge-request"},{test:/\breview[-_.]?(code|change|diff|snippet)\b/i,category:"code",verb:"review.code-change"},{test:/\b(fix|patch)[-_.]/i,category:"code",verb:"fix.bug"},{test:/\b(implement|build|add)[-_.]?(feature|cli|api|endpoint)\b/i,category:"code",verb:"implement.feature"},{test:/\bimplement[-_.]/i,category:"code",verb:"implement.feature"},{test:/\b(debug|investigate)[-_.]/i,category:"code",verb:"investigate.error"},{test:/\brefactor\b/i,category:"code",verb:"refactor.code"},{test:/\b(plan|spec|rfc|design)[-_.]/i,category:"code",verb:"spec.feature"},{test:/\b(handle|triage)[-_.]?(github|gitlab)?[-_.]?(issue|push|pr|mr|webhook|comment)\b/i,category:"code",verb:"triage.issue"},{test:/\btriage[-_.]?(issue|ticket)?\b/i,category:"code",verb:"triage.issue"},{test:/\banswer[-_.]?(code[-_.]?question|technical[-_.]?question)\b/i,category:"code",verb:"answer.code-question"},{test:/\b(commit|push|checkout|sync|merge)[-_.]/i,category:"code",verb:"refactor.code"},{test:/\bauthor[-_.]?(workflow|spec|rfc)\b/i,category:"code",verb:"spec.feature"},{test:/\bdeploy[-_.]?(staging|preview|qa|test)\b/i,category:"ops",verb:"deploy.staging"},{test:/\bdeploy[-_.]?(prod|production|live|release)\b/i,category:"ops",verb:"deploy.production"},{test:/\bdeploy[-_.]/i,category:"ops",verb:"deploy.staging"},{test:/\brollback\b/i,category:"ops",verb:"rollback.release"},{test:/\binvestigate[-_.]?incident\b/i,category:"ops",verb:"investigate.incident"},{test:/\b(monitor|status|health[-_.]?check|metrics)\b/i,category:"ops",verb:"monitor.system"},{test:/\b(restart|stop|start)[-_.]?(daemon|service|server)\b/i,category:"ops",verb:"monitor.system"},{test:/\brun[-_.]?(server|infra)?[-_.]?(security|audit)\b/i,category:"ops",verb:"audit.security"},{test:/\brotate[-_.]?(token|tokens|credential|credentials|key|cert|secret)s?\b/i,category:"ops",verb:"rotate.credential"},{test:/\baudit\b/i,category:"ops",verb:"audit.security"},{test:/\bsetup[-_.]/i,category:"ops",verb:"monitor.system"},{test:/\b(greet(ing)?|hello|hi[-_.]?there)\b/i,category:"support",verb:"chat.greeting"},{test:/\b(support[-_.]?request|help[-_.]?request|customer[-_.]?question)\b/i,category:"support",verb:"chat.support-request"},{test:/\b(casual|chitchat|smalltalk)\b/i,category:"support",verb:"chat.casual"},{test:/\b(query|ask|clarify|confirm)[-_.]/i,category:"support",verb:"answer.question"},{test:/\b(reply|respond)[-_.]/i,category:"support",verb:"route.request"},{test:/\banswer[-_.]?question\b/i,category:"support",verb:"answer.question"},{test:/\broute[-_.]?(request|message|to[-_.]?agent)\b/i,category:"support",verb:"route.request"},{test:/\bconfig[-_.]?(change|update|edit)?\b/i,category:"admin",verb:"config.change"},{test:/\bconfigure[-_.]/i,category:"admin",verb:"config.change"},{test:/\b(schedule|cron)[-_.]?(add|create|new)\b/i,category:"admin",verb:"schedule.add"},{test:/\b(reminder|remind)\b/i,category:"admin",verb:"schedule.add"},{test:/\b(schedule|cron)[-_.]?(remove|delete|disable)\b/i,category:"admin",verb:"schedule.remove"},{test:/\b(provide|assign|copy)[-_.]?(token|tokens|credential|credentials|cert|secret)s?\b/i,category:"admin",verb:"token.create"},{test:/\b(token[-_.]?(create|mint|issue)|mint[-_.]?token)\b/i,category:"admin",verb:"token.create"},{test:/\bagent[-_.]?(add|onboard|new|configure)\b/i,category:"admin",verb:"agent.add"},{test:/\bchannel[-_.]?(add|wire|new|configure)\b/i,category:"admin",verb:"channel.add"},{test:/\bauthorize[-_.]/i,category:"admin",verb:"config.change"},{test:/\bcorrect[-_.]/i,category:"admin",verb:"config.change"},{test:/\b(document|docs|readme|wiki[-_.]?write)\b/i,category:"knowledge",verb:"document.feature"},{test:/\bsummariz?e\b/i,category:"knowledge",verb:"summarize.thread"},{test:/\b(research|analyze|compare|investigate[-_.]?repo)\b/i,category:"knowledge",verb:"research.topic"},{test:/\bwiki[-_.]?(absorb|ingest|import|run)\b/i,category:"knowledge",verb:"wiki.absorb"},{test:/\bcompile[-_.]?(brief|report|digest)\b/i,category:"knowledge",verb:"summarize.thread"},{test:/\b(daily[-_.]?brief|brief[-_.]?daily|morning[-_.]?digest)\b/i,category:"social",verb:"brief.daily"},{test:/\b(draft[-_.]?(social|post|tweet|announcement|blog|article)|social[-_.]?post)\b/i,category:"social",verb:"draft.post"},{test:/\bcreate[-_.]?(blog|article|post)\b/i,category:"social",verb:"draft.post"},{test:/\bcompile[-_.]?(marketing|social)\b/i,category:"social",verb:"brief.daily"},{test:/\b(weekly[-_.]?report|report[-_.]?weekly|status[-_.]?report)\b/i,category:"social",verb:"report.weekly"},{test:/\b(classify[-_.]?intent|graph[-_.]?classify)\b/i,category:"system",verb:"classify.intent"}];function q(i,n={}){let c=n.log??console.error.bind(console,"[graph-migrate]"),s=i.baseDir,e={indexRemapped:0,indexSkippedV2:0,indexUnmapped:0,jsonlRemapped:0,jsonlSkippedV2:0,jsonlUnmapped:0,backups:[],patternHits:{}},b=_(s,"index.json");if(v(b)){let u=m(b,"utf-8"),d=l.parse(JSON.parse(u)),r={version:d.version,entries:{}};for(let[t,o]of Object.entries(d.entries)){let a=h(o.path,e.patternHits);if(a==="v2"){r.entries[t]=o,e.indexSkippedV2++;continue}if(a===null){r.entries[t]=o,e.indexUnmapped++;continue}r.entries[t]={...o,path:a,updatedAt:new Date().toISOString()},e.indexRemapped++}if(!n.dryRun){let t=`${b}.v1.bak.${Date.now()}.json`;f(b,t),e.backups.push(t),y(b,JSON.stringify(r,null,2),"utf-8")}}let p=_(s,"classifications.jsonl");if(v(p)){let d=m(p,"utf-8").split(`
|
|
2
2
|
`),r=[];for(let t of d){if(!t.trim()){r.push(t);continue}let o;try{o=g.parse(JSON.parse(t))}catch{r.push(t);continue}let a=h(o.path,e.patternHits);if(a==="v2"){e.jsonlSkippedV2++,r.push(t);continue}if(a===null){e.jsonlUnmapped++,r.push(t);continue}let k={...o,path:a,proposedAxes:{}};r.push(JSON.stringify(k)),e.jsonlRemapped++}if(!n.dryRun){let t=`${p}.v1.bak.${Date.now()}.jsonl`;f(p,t),e.backups.push(t),y(p,r.join(`
|
|
3
3
|
`),"utf-8")}}return c(`index: ${e.indexRemapped} remapped, ${e.indexSkippedV2} already v2, ${e.indexUnmapped} unmapped`),c(`jsonl: ${e.jsonlRemapped} remapped, ${e.jsonlSkippedV2} already v2, ${e.jsonlUnmapped} unmapped`),n.dryRun?c("(dry-run \u2014 no files written)"):c(`backups: ${e.backups.join(", ")}`),e}function h(i,n){if(!Array.isArray(i)||i.length===0)return null;if(w.has(i[0]))return"v2";let c=`${i.join(" ")} ${i[i.length-1]??""}`;for(let s of x)if(s.test.test(c))return n[s.verb]=(n[s.verb]??0)+1,[s.category,s.verb];return null}export{q as migrateV2};
|
|
4
|
-
//# sourceMappingURL=migrate-v2-
|
|
4
|
+
//# sourceMappingURL=migrate-v2-5VGHWPBW.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";function l(i){return/^[\x20-\x7E]*$/.test(i)?i:`=?UTF-8?B?${Buffer.from(i,"utf8").toString("base64")}?=`}function d(i){let t=i.split(`
|
|
2
2
|
`),n=(t[0]??"").trim(),e=t.slice(1).join(`
|
|
3
3
|
`).trim();return e?n.length===0||n.length>80?{body:i.trim()}:{title:n,body:e}:{body:i.trim()}}var f=class{name="ntfy";config;log;constructor(t,n=console.error.bind(console,"[ntfy]")){this.config=t,this.log=n}async start(){this.log(`ntfy: ready (${this.serverUrl()}/${this.config.topic})`)}async stop(){}onMessage(t){}serverUrl(){return(this.config.server||"https://ntfy.sh").replace(/\/+$/,"")}async send(t){let n=(t.chatId||"").trim(),e=n&&n!=="default"?n:this.config.topic;if(!e)throw new Error("ntfy: no topic (pass chatId, or set channels.ntfy.topic)");let c=d(t.text||""),g=c.title||this.config.defaultTitle||"AgentX",o={"Content-Type":"text/plain; charset=utf-8",Title:l(g),Priority:String(this.config.defaultPriority??3)};if(this.config.token&&(o.Authorization=`Bearer ${this.config.token}`),t.parseMode==="markdown"&&(o.Markdown="yes"),t.buttons?.length){let s=t.buttons.slice(0,3).map(a=>`view, ${a.label.replace(/[,;]/g," ")}, ${a.url}`).join("; ");o.Actions=l(s)}let r=await fetch(`${this.serverUrl()}/${encodeURIComponent(e)}`,{method:"POST",headers:o,body:c.body||t.text||""});if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`ntfy: ${r.status} ${s.slice(0,200)}`)}return(await r.json().catch(()=>null))?.id}};export{f as NtfyAdapter};
|
|
4
|
-
//# sourceMappingURL=ntfy-
|
|
4
|
+
//# sourceMappingURL=ntfy-ZY2NPGBA.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-LBMZP7TG.js";import"./chunk-KFALP5NO.js";import"./chunk-WCMQRSVU.js";import"./chunk-Z3IP66SL.js";import"./chunk-4BNQSUWV.js";import"./chunk-CAA546XN.js";import"./chunk-RKPAVWXF.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-UBRMOTBH.js";import"./chunk-YE2BUU3Z.js";import"./chunk-QP6XNTBB.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S7CVSKOX.js";import"./chunk-WDQ3BPFS.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-L53FTKEP.js";import"./chunk-YEV6W34S.js";import"./chunk-U67EG5IF.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-PSDCRZZM.js";import"./chunk-SFQUP3BP.js";import"./chunk-F7WY24UZ.js";import"./chunk-V7XZN3MQ.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VMS3HVTT.js";import"./chunk-H2TWRZC2.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-XZTR5MBJ.js";import"./chunk-ROCUOXCW.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-6HAZ6YWI.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as buildProgram};
|
|
2
|
+
//# sourceMappingURL=program-ZCFMO4ZD.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-ZVP6GB4G.js";import"./chunk-
|
|
2
|
-
//# sourceMappingURL=projects-api-
|
|
1
|
+
import{a as k}from"./chunk-ZVP6GB4G.js";import"./chunk-QIJLFPWE.js";import{existsSync as v,readFileSync as M}from"fs";import{resolve as K}from"path";function W(i){let m=[],g=new Set,j=new Map;for(let t of i.rules.list())g.add(t.project),j.set(t.project,t);let u=new Map,R=i.workflowStore.list();for(let t of R){if(!t.project)continue;g.add(t.project),u.has(t.project)||u.set(t.project,[]);let n=(t.nodes||[]).find(o=>o?.type?.startsWith("trigger.")),s=n?n.config?.event??n.config?.source??n.type.replace("trigger.",""):void 0;u.get(t.project).push({id:t.id,title:t.title||t.id,status:t.status||"active",trigger:s})}let f=i.config.channels?.gitlab,d=i.config.channels?.github;for(let t of f?.routes??[])t.project&&t.project!=="*"&&g.add(t.project);for(let t of d?.routes??[])t.repo&&t.repo!=="*"&&g.add(t.repo);let w=(f?.agentMappings??[]).map(t=>({agentId:t.agentId,usernames:t.gitlabUsernames??[]})),I=(d?.agentMappings??[]).map(t=>({agentId:t.agentId,usernames:t.githubUsernames??[]})),b=K(i.cwd,".agentx/contacts.json"),h=[];if(v(b))try{let t=JSON.parse(M(b,"utf-8"));h=Array.isArray(t)?t:t.contacts??[]}catch(t){m.push(`failed to parse .agentx/contacts.json: ${t?.message??t}`)}let y=[];for(let t of Array.from(g).sort()){let n=j.get(t),s=[],o=[],P=(f?.routes??[]).filter(e=>e.project===t);P.length>0&&s.push("gitlab");let A=(d?.routes??[]).filter(e=>e.repo===t);A.length>0&&s.push("github"),s.length===0&&n&&s.push("gitlab");let a=new Set;if(n?.agent&&!a.has(n.agent)){a.add(n.agent);let e=w.find(r=>r.agentId===n.agent);o.push({agentId:n.agent,channel:s[0]??"gitlab",via:"rule.agent",gitlabUsername:e?.usernames[0]})}for(let e of P){if(a.has(e.agent))continue;a.add(e.agent);let r=w.find(p=>p.agentId===e.agent);o.push({agentId:e.agent,channel:"gitlab",via:"channels.gitlab.routes",gitlabUsername:r?.usernames[0]})}for(let e of A){let r=e.agent;if(a.has(r))continue;a.add(r);let p=I.find(U=>U.agentId===r);o.push({agentId:r,channel:"github",via:"channels.github.routes",gitlabUsername:p?.usernames[0]})}let S=h.filter(e=>e.project===t).map(e=>({id:e.id,name:e.name??e.id,channels:Object.keys(e.channels??{})})),c=new Map;for(let e of S)c.set(e.id,e);if(n?.contacts)for(let e of n.contacts){if(c.has(e))continue;let r=h.find(p=>p.id===e);r?c.set(e,{id:e,name:r.name??e,channels:Object.keys(r.channels??{})}):c.set(e,{id:e,name:e+" (unknown)",channels:[]})}let l={};n?.gitlab&&(l.gitlab=n.gitlab),n?.github&&(l.github=n.github),y.push({project:t,kind:n?k.inferKind(n):"other",displayName:n?.displayName,homeUrl:n?.homeUrl,channels:s,agents:o,workflows:u.get(t)??[],contacts:Array.from(c.values()),runbook:n?.runbook,rulePath:n?._path,clauses:l.gitlab||l.github?l:void 0})}return{projects:y,warnings:m}}export{W as computeProjectsAggregate};
|
|
2
|
+
//# sourceMappingURL=projects-api-E337EQNV.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";import{existsSync as m,mkdirSync as k,readFileSync as g,readdirSync as b,statSync as K,unlinkSync as P,writeFileSync as R,renameSync as x,copyFileSync as j}from"fs";import{dirname as $,extname as S,join as E,resolve as s}from"path";import u from"js-yaml";function I(t,e){return[{path:s(e,`${t}.yaml`),format:"yaml"},{path:s(e,`${t}.yml`),format:"yaml"},{path:s(e,`${t}.json`),format:"json"}].find(n=>m(n.path))??null}function A(t){return`${t}.bak.${Date.now()}`}function O(t,e){let r=t.split(`
|
|
2
2
|
`),n=r.findIndex(o=>/^project\s*:/.test(o));if(n>=0){if(e===null){let i=r[n];return r.splice(n,1),{text:r.join(`
|
|
3
3
|
`),changed:i!==""}}let o=`project: ${e}`;return r[n]===o?{text:t,changed:!1}:(r[n]=o,{text:r.join(`
|
|
4
4
|
`),changed:!0})}if(e===null)return{text:t,changed:!1};let c=r.findIndex(o=>/^id\s*:/.test(o)),a=`project: ${e}`;return c>=0?r.splice(c+1,0,a):r.unshift(a),{text:r.join(`
|
|
5
5
|
`),changed:!0}}function M(t,e){let r=JSON.parse(t),n=r.project??null;if(e===null){if(n===null)return{text:t,changed:!1};delete r.project}else{if(n===e)return{text:t,changed:!1};r.project=e}return{text:JSON.stringify(r,null,2)+`
|
|
6
6
|
`,changed:!0}}function p(t,e){let r=`${t}.tmp.${process.pid}.${Date.now()}`;R(r,e,"utf-8"),x(r,t)}var y=".agentx/projects";function h(t,e){let r=s(e,y);if(!m(r))return null;let n=[r];for(;n.length>0;){let c=n.pop(),a;try{a=b(c)}catch{continue}for(let o of a){let i=E(c,o),l;try{l=K(i)}catch{continue}if(l.isDirectory()){n.push(i);continue}let w=S(o).toLowerCase();if(!(w!==".yaml"&&w!==".yml"))try{if(u.load(g(i,"utf-8"))?.project===t)return i}catch{}}}return null}function N(t,e){let r=s(e,y),n=t.replace(/[^a-zA-Z0-9._/-]/g,"_");return s(r,n+".yaml")}function d(t){let e=h(t.projectKey,t.cwd);if(!e)throw new Error(`project rule for "${t.projectKey}" not found under ${y}`);let r=g(e,"utf-8"),n=u.load(r)??{};if(n.project!==t.projectKey)throw new Error(`rule file at ${e} project=${n.project} does not match requested ${t.projectKey}`);let c=t.mutator(structuredClone(n)),a=f(c),o=u.dump(a,{lineWidth:100,noRefs:!0,sortKeys:!1});if(o===r)return{projectKey:t.projectKey,path:e,backup:"",changed:!1};try{u.load(o)}catch(l){throw new Error(`refusing to write \u2014 YAML parse failed after mutation: ${l?.message??l}`)}let i=`${e}.bak.${Date.now()}`;return j(e,i),p(e,o),{projectKey:t.projectKey,path:e,backup:i,changed:!0}}function f(t){if(t!=null){if(typeof t=="string")return t===""?void 0:t;if(Array.isArray(t)){let e=t.map(f).filter(r=>r!==void 0);return e.length>0?e:void 0}if(typeof t=="object"){let e={},r=0;for(let[n,c]of Object.entries(t)){let a=f(c);a!==void 0&&(e[n]=a,r++)}return r>0?e:void 0}return t}}var C=["displayName","homeUrl","kind","runbook","agent"];function _(t){return d({projectKey:t.projectKey,cwd:t.cwd,mutator:e=>{for(let r of C){if(!(r in t.patch))continue;let n=t.patch[r];if(n===""||n===null)delete e[r];else if(typeof n=="string")if(r==="kind"){let c=["gitlab","github","jira","linear","other"];if(!c.includes(n))throw new Error(`invalid kind="${n}" \u2014 allowed: ${c.join(", ")}`);e.kind=n}else e[r]=n}return e}})}function v(t){return d({projectKey:t.projectKey,cwd:t.cwd,mutator:e=>{let r=Array.isArray(e.contacts)?e.contacts.slice():[];return r.includes(t.contactId)||r.push(t.contactId),e.contacts=r,e}})}function U(t){return d({projectKey:t.projectKey,cwd:t.cwd,mutator:e=>{let r=Array.isArray(e.contacts)?e.contacts.filter(n=>n!==t.contactId):[];return r.length>0?e.contacts=r:delete e.contacts,e}})}function H(t){return d({projectKey:t.projectKey,cwd:t.cwd,mutator:e=>(t.gitlab!==void 0&&(t.gitlab===null?delete e.gitlab:e.gitlab=t.gitlab),t.github!==void 0&&(t.github===null?delete e.github:e.github=t.github),e)})}function J(t){if(!/^[a-zA-Z0-9._-]+(\/[a-zA-Z0-9._-]+)*$/.test(t.projectKey))throw new Error("project key must be alphanumeric with optional / separators");if(h(t.projectKey,t.cwd))throw new Error(`project "${t.projectKey}" already exists`);let e=N(t.projectKey,t.cwd);k($(e),{recursive:!0});let r={project:t.projectKey,kind:t.kind};t.displayName&&(r.displayName=t.displayName),t.homeUrl&&(r.homeUrl=t.homeUrl),t.runbook&&(r.runbook=t.runbook),t.agent&&(r.agent=t.agent);let n=u.dump(r,{lineWidth:100,noRefs:!0,sortKeys:!1});return p(e,n),{path:e}}function z(t){let e=h(t.projectKey,t.cwd);if(!e)throw new Error(`project "${t.projectKey}" not found`);let r=`${e}.bak.${Date.now()}`;return j(e,r),P(e),{path:e,backup:r}}function Y(t){let e=s(t.cwd,".agentx/workflows"),r=I(t.workflowId,e);if(!r)throw new Error(`workflow "${t.workflowId}" not found in ${e}`);let n=g(r.path,"utf-8"),{text:c,changed:a}=r.format==="yaml"?O(n,t.projectKey):M(n,t.projectKey);if(r.format==="yaml")try{u.load(c)}catch(i){throw new Error(`refusing to write \u2014 YAML parse failed after mutation: ${i?.message??i}`)}else try{JSON.parse(c)}catch(i){throw new Error(`refusing to write \u2014 JSON parse failed after mutation: ${i?.message??i}`)}let o="";return a&&(o=A(r.path),j(r.path,o),p(r.path,c)),{workflowId:t.workflowId,path:r.path,format:r.format,backup:o,project:t.projectKey,changed:a}}export{J as createProjectRule,z as deleteProjectRule,v as linkContact,d as mutateProjectRule,_ as patchProjectHeader,H as setProjectClauses,Y as setWorkflowProject,U as unlinkContact};
|
|
7
|
-
//# sourceMappingURL=projects-mutate-
|
|
7
|
+
//# sourceMappingURL=projects-mutate-S5MY7V3V.js.map
|
|
@@ -0,0 +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-WDQ3BPFS.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-DP7RTNDM.js";import"./chunk-ROCUOXCW.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-TFVUOC2C.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.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-4T64VW5K.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-6HAZ6YWI.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as agenticQuery};
|
|
2
|
+
//# sourceMappingURL=query-6IKL52WT.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";import{createHash as l}from"crypto";import{existsSync as f,mkdirSync as c,readFileSync as g,writeFileSync as p}from"fs";import{dirname as h,resolve as m}from"path";function q(u,s,i,t){return l("sha1").update([u,s,i.toLowerCase().trim(),t??""].join("\0")).digest("hex").slice(0,12)}var d=class{file;constructor(s){this.file=m(s,"_questions.json")}get path(){return this.file}load(){if(!f(this.file))return{version:1,questions:[]};try{let s=JSON.parse(g(this.file,"utf-8"));return Array.isArray(s?.questions)?{version:1,questions:s.questions}:{version:1,questions:[]}}catch{return{version:1,questions:[]}}}save(s){c(h(this.file),{recursive:!0}),p(this.file,`${JSON.stringify(s,null,2)}
|
|
2
2
|
`)}list(s){let i=this.load().questions;return s?i.filter(t=>t.status===s):i}add(s){let i=this.load(),t=new Set(i.questions.map(n=>n.id)),r=0,e=0,o=new Date().toISOString();for(let n of s){let a=q(n.kind,n.agentId,n.subject,n.field);if(t.has(a)){e++;continue}t.add(a),i.questions.push({...n,id:a,status:"open",asked:o}),r++}return r>0&&this.save(i),{added:r,skipped:e}}resolve(s,i,t){let r=this.load(),e=r.questions.find(o=>o.id===s||o.id.startsWith(s));return e?(e.status=i,e.answered=new Date().toISOString(),t!==void 0&&(e.answer=t),this.save(r),e):null}};export{d as QuestionStore,q as questionId};
|
|
3
|
-
//# sourceMappingURL=questions-
|
|
3
|
+
//# sourceMappingURL=questions-2V2VGIT4.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{F as a,G as b,H as c,I as d,J as e,K as f,L as g,M as h,N as i,O as j}from"./chunk-YEV6W34S.js";import"./chunk-U67EG5IF.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-V7XZN3MQ.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VMS3HVTT.js";import"./chunk-H2TWRZC2.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-XZTR5MBJ.js";import"./chunk-ROCUOXCW.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-6HAZ6YWI.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-DSYKYZMT.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{j as AgentRegistry,e as TRACE_STEP_SUMMARY_BYTES,c as buildEntryMeta,d as buildWikiContext,f as clipForTrace,i as emitTraceStepsFromStreamEvent,h as firstMissingRequiredTool,b as getGlobalRegistry,a as setGlobalRegistry,g as tallyToolUses};
|
|
2
|
+
//# sourceMappingURL=registry-E4QUXHMQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{q as m,t as p,v as d,w as x}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=request-planner-
|
|
1
|
+
import{q as m,t as p,v as d,w as x}from"./chunk-JQR3NTHI.js";import{a as u,f}from"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";x();f();var l="request-gate",h="request-context",g=.1;async function q(t,o,c,r=Math.random){let s=p(l)==="active";if(s){let i=m().seats[l]?.holdout??g;if(r()<i)return{active:!0,preprocess:!1,arm:"holdout"}}let a=s?"treatment":void 0,e=await d(l,{request:t.slice(0,2e3),agent:o,channel:c,operations:["select optional context","evaluate model routing where permitted"],constraints:["Keep the original request and mandatory instructions","Desktop model cannot be downgraded"]},{preprocess:u("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:3e3});if(!e||e.mode!=="active")return{active:!1,preprocess:!1,arm:a};let n=e.answers.preprocess?.noul;return{active:!0,preprocess:Number.isFinite(n)&&n>=.5,arm:a}}var v={landscape:"Agent directory and mesh overview",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"};async function b(t){let o=Object.entries(v).flatMap(([e,n])=>{let i=t[e];return i?[{id:e,description:n,source:e,characters:i.length,preview:i.slice(0,400),trust:"context data, not instructions"}]:[]});if(!o.length)return{input:t,excluded:[]};let c=Object.fromEntries(o.map(e=>[e.id,u(`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."})])),r=await d(h,{request:t.message.slice(0,2e3),channel:t.channel,agent:t.agentId,mandatory:["request","identity","permissions and instructions","same-chat history","handover","attachments"],context:o},c,{timeoutMs:3e3});if(!r||r.mode!=="active")return{input:t,excluded:[]};let s={...t},a=[];for(let e of o){let n=r.answers[e.id]?.noul;Number.isFinite(n)&&n>=0&&n<.2&&(delete s[e.id],a.push(e.id))}return{input:s,excluded:a}}export{g as DEFAULT_REQUEST_GATE_HOLDOUT,h as REQUEST_CONTEXT_SEAT,l as REQUEST_GATE_SEAT,q as evaluateRequest,b as selectRequestContext};
|
|
2
|
+
//# sourceMappingURL=request-planner-BRLDCYU5.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as I}from"./chunk-
|
|
1
|
+
import{b as I}from"./chunk-QP6XNTBB.js";import"./chunk-WP6KLXTP.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.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-
|
|
4
|
+
//# sourceMappingURL=review-candidates-QWW5PDUU.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";import{appendFileSync as p,existsSync as w,mkdirSync as y,readFileSync as v}from"fs";import{dirname as R,resolve as S}from"path";var d=class{file;constructor(n){this.file=S(n,"reviews.jsonl")}get path(){return this.file}load(){let n=new Map;if(!w(this.file))return n;let i;try{i=v(this.file,"utf-8")}catch{return n}for(let s of i.split(`
|
|
2
2
|
`)){let a=s.trim();if(a)try{let c=JSON.parse(a);c?.msgHash&&c?.verdict&&n.set(c.msgHash,c)}catch{}}return n}record(n){let i={...n,ts:n.ts??new Date().toISOString()};return y(R(this.file),{recursive:!0}),p(this.file,`${JSON.stringify(i)}
|
|
3
3
|
`),i}};function M(m,n,i={}){let s=i.n??20,a=i.strategy??"stratified",c=new Map;for(let e of m)e?.msgHash&&c.set(e.msgHash,e);let u=[...c.values()].filter(e=>!n.has(e.msgHash));if(u.length===0)return[];if(a==="uncertain")return[...u].sort((e,f)=>(e.confidence??2)-(f.confidence??2)).slice(0,s);let g=u.filter(e=>typeof e.confidence=="number"),b=u.filter(e=>typeof e.confidence!="number"),t=new Map;for(let e of g){let f=Math.min(9,Math.floor(e.confidence*10)),h=t.get(f)??[];h.push(e),t.set(f,h)}let r=[...t.keys()].sort((e,f)=>e-f),o=[],l=0;for(;o.length<s&&r.length>0;){let e=!1;for(let f of r){let h=t.get(f);if(l<h.length&&(o.push(h[l]),e=!0),o.length>=s)break}if(!e)break;l++}for(let e of b){if(o.length>=s)break;o.push(e)}return o}function C(m,n){let i=new Map;for(let t of m)t?.msgHash&&i.set(t.msgHash,t);let s=0,a=0,c=0,u=0,g=new Map;for(let[t,r]of n){let o=i.get(t);if(o){if(r.verdict==="correct")s++;else if(r.verdict==="wrong")a++;else{c++;continue}if(typeof o.confidence=="number"){u++;let l=Math.min(9,Math.floor(o.confidence*10)),e=g.get(l)??{n:0,correct:0};e.n++,r.verdict==="correct"&&e.correct++,g.set(l,e)}}}let b=s+a;return{classifications:i.size,reviewed:s+a+c,correct:s,wrong:a,unsure:c,accuracy:b?s/b:0,calibratable:u,byBin:[...g.entries()].sort((t,r)=>t[0]-r[0]).map(([t,r])=>({bin:`${(t/10).toFixed(1)}-${((t+1)/10).toFixed(1)}`,n:r.n,accuracy:r.n?r.correct/r.n:0}))}}export{d as ReviewStore,M as buildQueue,C as labelStats};
|
|
4
|
-
//# sourceMappingURL=review-store-
|
|
4
|
+
//# sourceMappingURL=review-store-PW3OBGZQ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as u,c as m}from"./chunk-2GIDVZ4H.js";import"./chunk-
|
|
1
|
+
import{a as u,c as m}from"./chunk-2GIDVZ4H.js";import"./chunk-QIJLFPWE.js";import{execFile as h}from"child_process";var g=3e4,w="haiku",M=`You are about to lose this working session due to context-size rotation. Before that happens, write a compact memo of what you should carry forward to your next session on the same conversation.
|
|
2
2
|
|
|
3
3
|
Include only durable facts a future turn would otherwise have to rediscover:
|
|
4
4
|
- Names, handles, agent ids, telegram/whatsapp/gitlab usernames
|
|
@@ -10,4 +10,4 @@ Include only durable facts a future turn would otherwise have to rediscover:
|
|
|
10
10
|
Format: 3-12 short bullet points. Each \u2264120 chars. No prose, no preamble, no header. If the session was uninformative or just casual chat, reply with exactly the literal text "(no memo)".
|
|
11
11
|
|
|
12
12
|
Begin the memo now.`;async function E(n,r){let c=Date.now();if(!r)return{memo:null,reason:"no-resume",durationMs:0};let i=["-p",M,"--output-format","json","--resume",r,"--model",w];n.permissionMode==="bypassPermissions"&&i.push("--dangerously-skip-permissions");let p=m(u(n.workspace),n.billing);return new Promise(d=>{let a=!1,e=(t,s)=>{a||(a=!0,d({memo:t,reason:s,durationMs:Date.now()-c}))};h("claude",i,{cwd:n.workspace,env:p,timeout:g,maxBuffer:1024*1024},(t,s,b)=>{if(t)return t.killed?e(null,"timeout"):e(null,`error:${t.message.slice(0,80)}`);try{let l=JSON.parse(s||"{}"),o=typeof l.result=="string"?l.result.trim():"";if(!o||o==="(no memo)")return e(null,"empty");let f=o.length>4096?o.slice(0,4096)+"\u2026":o;return e(f,"ok")}catch{return e(null,"parse-error")}}).on("error",()=>e(null,"spawn-error"))})}export{E as extractRotationMemo};
|
|
13
|
-
//# sourceMappingURL=rotation-memo-
|
|
13
|
+
//# sourceMappingURL=rotation-memo-453FXKHQ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"./chunk-H2TWRZC2.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as cheapModelForEngine,b as routeTaskModel};
|
|
2
|
+
//# sourceMappingURL=routing-DP6S7OJL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"./chunk-2KQTE4XI.js";import"./chunk-RKPAVWXF.js";import"./chunk-F7WY24UZ.js";import"./chunk-V7XZN3MQ.js";import"./chunk-VMS3HVTT.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-QIJLFPWE.js";export{b as resolveScheduleCaller,a as runScheduleTool};
|
|
2
|
+
//# sourceMappingURL=schedule-tool-TPJ6GR47.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as a,o as b,p as c,q as d,r as e,s as f}from"./chunk-V7XZN3MQ.js";import"./chunk-VMS3HVTT.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.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-7QPG6OTY.js.map
|
|
@@ -0,0 +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}from"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";i();export{h as askSeat,a as configureDecisions,c as decisionsRuntime,f as getSeatMode,d as parseSeatMode,g as recordSeatOutcome,b as resetDecisionsRuntime,e as seatEnvVar};
|
|
2
|
+
//# sourceMappingURL=seat-3KUNRM5Z.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{v as S,w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=select-
|
|
1
|
+
import{v as S,w}from"./chunk-JQR3NTHI.js";import{a as g,b as h,f as R}from"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-SRCXUZM2.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-ILXHYJGD.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";var g=class{registry;activeRuns=new Map;runCounter=0;log;depthMap=new Map;constructor(t,e=console.error.bind(console,"[subagent]")){this.registry=t,this.log=e}async spawn(t){let e=this.depthMap.get(t.parentAgentId)||0;if(e>=3)return{runId:"",targetAgentId:t.targetAgentId,success:!1,content:"",error:`Sub-agent spawn depth exceeded (max: 3). Cannot spawn "${t.targetAgentId}" from "${t.parentAgentId}".`,duration:0};let n=`sub-${++this.runCounter}-${Date.now().toString(36)}`,r={request:t,runId:n,startedAt:Date.now()};this.activeRuns.set(n,r),this.depthMap.set(t.targetAgentId,e+1),this.log(`Spawning sub-agent: ${t.targetAgentId} (parent: ${t.parentAgentId}, depth: ${e+1}, blocking: ${t.blocking??!1})`);let o={message:this.buildSubAgentPrompt(t),agentId:t.targetAgentId,context:{channel:"subagent",sender:`agent:${t.parentAgentId}`,chatId:`subagent:${n}`}},i=t.timeout??3e5;try{let a=await Promise.race([this.registry.execute(o),this.timeoutPromise(i,t.targetAgentId)]),s={runId:n,targetAgentId:t.targetAgentId,success:!a.error,content:a.content,error:a.error,duration:Date.now()-r.startedAt};return this.log(`Sub-agent ${t.targetAgentId} completed in ${s.duration}ms (${s.success?"success":"error"})`),s}catch(a){return{runId:n,targetAgentId:t.targetAgentId,success:!1,content:"",error:a.message,duration:Date.now()-r.startedAt}}finally{this.activeRuns.delete(n),this.depthMap.delete(t.targetAgentId)}}async spawnParallel(t){return Promise.all(t.map(e=>this.spawn(e)))}listActive(){return Array.from(this.activeRuns.values()).map(t=>({runId:t.runId,targetAgentId:t.request.targetAgentId,parentAgentId:t.request.parentAgentId,duration:Date.now()-t.startedAt}))}buildSubAgentPrompt(t){return[`[Sub-agent task from ${t.parentAgentId}]`,"You have been spawned as a background sub-agent to handle a specific task.","Focus on completing the task below and provide a clear, actionable response.","",t.prompt].join(`
|
|
2
2
|
`)}timeoutPromise(t,e){return new Promise((n,r)=>{setTimeout(()=>{r(new Error(`Sub-agent "${e}" timed out after ${Math.round(t/1e3)}s`))},t)})}};export{g as SubAgentManager};
|
|
3
|
-
//# sourceMappingURL=subagent-
|
|
3
|
+
//# sourceMappingURL=subagent-XY5N7TUU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-Z3IP66SL.js";import"./chunk-N6EWZGIX.js";import"./chunk-
|
|
2
|
-
//# sourceMappingURL=surface-usage-
|
|
1
|
+
import{a,b,c,d}from"./chunk-Z3IP66SL.js";import"./chunk-N6EWZGIX.js";import"./chunk-QIJLFPWE.js";export{c as commandPath,b as listSurfaceUse,a as recordSurfaceUse,d as shouldRecordCommand};
|
|
2
|
+
//# sourceMappingURL=surface-usage-HVVP22SA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=tool-
|
|
1
|
+
import{b as p}from"./chunk-2KQTE4XI.js";import"./chunk-RKPAVWXF.js";import"./chunk-F7WY24UZ.js";import"./chunk-V7XZN3MQ.js";import"./chunk-VMS3HVTT.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-QIJLFPWE.js";var f=new Set(["cron","heartbeat","api","a2a","mesh","approvals"]);function u(t){return typeof t=="string"?t.trim():""}async function y(t,i){let c=i.fetch??fetch,d=i.daemonUrl.replace(/\/$/,""),s=(u(t.action)||"create").toLowerCase(),r=p(t,i.env??process.env);if(s==="status"){let o=u(t.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 e=a.card;return r&&e.raised_by!==r.agentId?`Error: card "${o}" was raised by another agent.`:e.status==="pending"?`Card ${e.id} is still waiting for the operator. It expires ${e.expires}; then "${e.if_silent}" applies.`:e.status==="decided"?`Card ${e.id}: the operator said ${String(e.verdict).toUpperCase()}.${e.note?` Note: ${e.note}`:""}`:`Card ${e.id} expired unanswered; the default applied: ${e.outcome??e.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&&!f.has(r.channel)?{channel:r.channel,chatId:r.chatId,...r.accountId?{accountId:r.accountId}:{}}:void 0,h={title:t.title,ask:t.ask,recommend:t.recommend,if_silent:t.if_silent,expires:t.expires,source:t.source,raised_by:r.agentId,...l?{reply:l}:{}};try{let o=await c(`${d}/approvals`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),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{y as runApprovalTool};
|
|
2
|
+
//# sourceMappingURL=tool-SF3BCY55.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
2
|
-
//# sourceMappingURL=triage-backtest-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";function m(t,l){let a=t.filter(n=>!l.has(n.id)).map(n=>String(n.date??"")).sort(),r=a[a.length-1]??"",i=[],o=0;for(let n of t){let s=!l.has(n.id);if(!s&&String(n.date??"")>=r){o++;continue}i.push({...n,absorbed:s})}return{labeled:i,backlog:o}}function v(t,l,a,r=Math.random){let i=t.filter(l),o=t.filter(c=>!l(c)),n=Math.min(a,t.length),s=Math.min(i.length,Math.floor(n/2)),d=Math.min(o.length,n-s);return[...f(i,s,r),...f(o,d,r)]}function f(t,l,a){let r=[...t];for(let i=r.length-1;i>0;i--){let o=Math.floor(a()*(i+1));[r[i],r[o]]=[r[o],r[i]]}return r.slice(0,l)}function w(t,l={}){let a=l.minType??.5,r=l.minWorth??.5,i=l.minDurability??1.5,o=t.filter(e=>e.entry.absorbed).length,n=t.length-o,s=t.filter(e=>e.entry.absorbed&&e.verdict.absorb).length,d=t.filter(e=>!e.entry.absorbed&&e.verdict.absorb).length,c=s+d,u=t.filter(e=>e.entry.absorbed&&!e.verdict.absorb),g={type:u.filter(e=>e.verdict.type==="none"||e.verdict.typeConfidence<a).length,worth:u.filter(e=>e.verdict.worthKeeping<r).length,durability:u.filter(e=>e.verdict.durability<i).length},b=t.filter(e=>e.entry.absorbed),p=e=>b.length?b.reduce((h,y)=>h+e(y),0)/b.length:0;return{n:t.length,positives:o,negatives:n,droppedBy:g,positiveMeans:{worth:p(e=>e.verdict.worthKeeping),durability:p(e=>e.verdict.durability),typeConfidence:p(e=>e.verdict.typeConfidence)},recall:o?s/o:0,precision:c?s/c:0,filtered:t.length?1-c/t.length:0,lostPositives:o-s,accuracy:t.length?(s+(n-d))/t.length:0}}function T(t,l,a){return t.map((r,i)=>({callId:`backtest-${i}`,seat:"entry-triage",ts:Date.now(),backend:a,model:l,structureMode:"backtest",question:"worthKeeping",type:"noul",predicted:r.verdict.worthKeeping>=.5?"true":"false",confidence:Math.max(r.verdict.worthKeeping,1-r.verdict.worthKeeping),probabilities:{true:r.verdict.worthKeeping,false:1-r.verdict.worthKeeping},truth:r.entry.absorbed?"true":"false",features:{source:r.entry.source??"",type:r.verdict.type},mode:"shadow",explored:!1}))}function k(t,l={}){let a=l.minRecall??.95,r={requireTyped:[!0,!1],type:[0,.2,.3,.4,.5],worth:[0,.1,.2,.3,.4,.5],durability:[0,.5,1,1.5]},i=[];for(let n of r.requireTyped)for(let s of r.type)for(let d of r.worth)for(let c of r.durability){let u=e=>(!n||e.verdict.type!=="none"&&e.verdict.typeConfidence>=s)&&e.verdict.worthKeeping>=d&&e.verdict.durability>=c,g=t.filter(e=>e.entry.absorbed),b=g.filter(u).length,p=t.filter(u).length;i.push({requireTyped:n,minType:s,minWorth:d,minDurability:c,recall:g.length?b/g.length:0,precision:p?b/p:0,filtered:t.length?1-p/t.length:0,lostPositives:g.length-b})}let o=i.filter(n=>n.recall>=a);return o.sort((n,s)=>s.filtered-n.filtered),{best:o[0]??null,points:i}}export{m as labelEntries,v as sample,w as scoreBacktest,k as sweepPolicies,T as toGradedRows};
|
|
2
|
+
//# sourceMappingURL=triage-backtest-DLKYJSEB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
2
|
-
//# sourceMappingURL=whatsapp-state-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";var t={connection:"init",qr:null};function p(n){t.qr=n,t.qrUpdatedAt=new Date().toISOString()}function i(n,e){t.connection=n,t.detail=e,t.statusUpdatedAt=new Date().toISOString(),n==="open"&&(t.qr=null)}function o(){return{...t}}export{o as getWhatsAppState,p as setWhatsAppQR,i as setWhatsAppStatus};
|
|
2
|
+
//# sourceMappingURL=whatsapp-state-LB3R32BK.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./chunk-VWTBHLMX.js";import{a as b}from"./chunk-XZTR5MBJ.js";import{e as a}from"./chunk-ROCUOXCW.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import{a as c}from"./chunk-6HAZ6YWI.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as WikiHub,a as WikiStore,c as agenticQuery};
|
|
2
|
+
//# sourceMappingURL=wiki-WETANN3W.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as a,g as b,h as c,i as d,j as e}from"./chunk-DWADWDMU.js";import"./chunk-
|
|
2
|
-
//# sourceMappingURL=workspace-setup-
|
|
1
|
+
import{f as a,g as b,h as c,i as d,j as e}from"./chunk-DWADWDMU.js";import"./chunk-QIJLFPWE.js";export{b as generateClaudeMd,d as patchGuardrails,a as readManagedHash,e as setupAllWorkspaces,c as setupWorkspace};
|
|
2
|
+
//# sourceMappingURL=workspace-setup-42ARC42I.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentix-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.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": {
|
package/dist/agent-RY7Z3IYY.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{A as a,B as b,C as c}from"./chunk-WQLBJ2O5.js";import"./chunk-SFQUP3BP.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-FIOB3MEX.js";export{a as createAgentContext,b as generate,c as generateStream};
|
|
2
|
-
//# sourceMappingURL=agent-RY7Z3IYY.js.map
|