agentix-cli 0.49.0 → 0.50.1
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/README.md +17 -0
- package/dist/{App-KE4SURSS.js → App-TDUUFVDV.js} +2 -2
- package/dist/{ChatApp-NNHIKXO2.js → ChatApp-IOWDXM3R.js} +2 -2
- package/dist/agent-KRLAT3YJ.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-LG3ECH7C.js → board-dashboard-VA4VSCMQ.js} +9 -9
- package/dist/board-dashboard-VA4VSCMQ.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-MWUJOAAW.js → chunk-2BRX2EMT.js} +6 -6
- package/dist/{chunk-DLKRPK5M.js → chunk-4BNQSUWV.js} +7 -2
- package/dist/{chunk-DLKRPK5M.js.map → chunk-4BNQSUWV.js.map} +1 -1
- package/dist/{chunk-OHA3J5ZV.js → chunk-5KCOH5FQ.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-GCHUE3TN.js → chunk-7WDJW37G.js} +2 -2
- package/dist/{chunk-QDE75R4U.js → chunk-A6IV2VQY.js} +2 -2
- package/dist/{chunk-JVNFRS26.js → chunk-AVJRATR5.js} +2 -2
- package/dist/{chunk-PZCTCCC5.js → chunk-BVRUDRCM.js} +2 -2
- package/dist/{chunk-4NBWF4TL.js → chunk-F2PEUQW4.js} +2 -2
- package/dist/{chunk-ZTEU5JVQ.js → chunk-FCPTN6NF.js} +2 -2
- package/dist/{chunk-5ALS7SVV.js → chunk-FDYGTQVW.js} +2 -2
- package/dist/{chunk-AJONZWLT.js → chunk-FX3D7YON.js} +2 -2
- package/dist/{chunk-OTW5MPFT.js → chunk-HHY3MSMN.js} +2 -2
- package/dist/chunk-HRBKSZ34.js +2 -0
- package/dist/chunk-HRBKSZ34.js.map +1 -0
- package/dist/{chunk-WPMX3VGI.js → chunk-J3SOEFRE.js} +2 -2
- package/dist/{chunk-3L2FKVR6.js → chunk-JUJ3TCOE.js} +3 -3
- package/dist/{chunk-FM2GGPSD.js → chunk-JWLTI6NZ.js} +68 -68
- package/dist/chunk-JWLTI6NZ.js.map +1 -0
- package/dist/{chunk-B5XHX44Y.js → chunk-JY7POTMB.js} +2 -2
- package/dist/{chunk-DTJKN5VT.js → chunk-KH6L7GDO.js} +2 -2
- package/dist/chunk-QIJLFPWE.js +2 -0
- package/dist/{chunk-BH3GTCZ6.js → chunk-RGDKHYY2.js} +2 -2
- package/dist/{chunk-HGT4AKOH.js → chunk-RP7GLXOA.js} +8 -8
- package/dist/{chunk-K33GIBSE.js → chunk-SIU6STB2.js} +2 -2
- package/dist/{chunk-LCIREYTD.js → chunk-SZJMS7K4.js} +2 -2
- package/dist/{chunk-AJ5RMU7X.js → chunk-TFVUOC2C.js} +2 -2
- package/dist/{chunk-DVNIFP7S.js → chunk-WKTFP3SK.js} +3 -3
- package/dist/{chunk-Q7C3X3R6.js → chunk-WP6KLXTP.js} +2 -2
- package/dist/{chunk-RKAJR37K.js → chunk-WUDXUY7H.js} +2 -2
- package/dist/{chunk-NLZD2QKF.js → chunk-WW6KNRIR.js} +2 -2
- package/dist/{chunk-5XQCGPQJ.js → chunk-X5K3HR4V.js} +2 -2
- package/dist/{chunk-P2ZYT5D6.js → chunk-XSFXAJDA.js} +2 -2
- package/dist/{chunk-W5C2GDNC.js → chunk-Y57CULGE.js} +2 -2
- package/dist/{chunk-HVQJIROJ.js → chunk-ZKDWQJVS.js} +9 -9
- package/dist/{chunk-IXUEJBHD.js → chunk-ZN7637EF.js} +2 -2
- package/dist/{chunk-OUZ7YVQZ.js → chunk-ZQSB6IX4.js} +2 -2
- package/dist/{chunk-4TITGMPX.js → chunk-ZWGRRFJI.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/client-PC7OEKSK.js +2 -0
- package/dist/{compaction-U5SAYTX6.js → compaction-NWPBPWY2.js} +4 -4
- package/dist/{config-R47ITLIY.js → config-I4GWI22T.js} +2 -2
- package/dist/config-mutator-3RFKH3OV.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-OG6DK52Y.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 +1 -1
- 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-RFAHI4SS.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-EDEG2HQR.js +2 -0
- package/dist/proposals-O4B5LD5T.js +2 -0
- package/dist/providers-NRPX2FHP.js +2 -0
- package/dist/query-P5LMGXVS.js +2 -0
- package/dist/{questions-4B4KSPXG.js → questions-2V2VGIT4.js} +2 -2
- package/dist/recipes-423CIPZ3.js +2 -0
- package/dist/registry-GJLY5J5E.js +2 -0
- package/dist/{request-planner-PEAYYXAP.js → request-planner-JDBXFNQ4.js} +2 -2
- package/dist/{review-candidates-W7NIHNAI.js → review-candidates-EBP5CFOB.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-Q2EOZ3VW.js +2 -0
- package/dist/runner-56G3N7M4.js +2 -0
- package/dist/schedule-tool-N2Z5E6AR.js +2 -0
- package/dist/scheduler-WTPERNYJ.js +2 -0
- package/dist/seat-LV3STEXI.js +2 -0
- package/dist/{select-4XYRIZ5L.js → select-5NHY4T5A.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-2RKPJWDG.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-XQMJ2FPU.js +2 -0
- package/dist/{workspace-setup-G6KGWPHY.js → workspace-setup-42ARC42I.js} +2 -2
- package/package.json +1 -1
- package/dist/agent-J7SLJYQ6.js +0 -2
- package/dist/board-dashboard-LG3ECH7C.js.map +0 -1
- package/dist/calibration-ILS5OI44.js +0 -2
- package/dist/chunk-7DXE264B.js +0 -2
- package/dist/chunk-7DXE264B.js.map +0 -1
- package/dist/chunk-FIOB3MEX.js +0 -2
- package/dist/chunk-FM2GGPSD.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-YZI2QZVR.js +0 -2
- package/dist/processes-XWRGOLMT.js +0 -2
- package/dist/program-3CDFUJVE.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-722GXALE.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-TDUUFVDV.js.map} +0 -0
- /package/dist/{ChatApp-NNHIKXO2.js.map → ChatApp-IOWDXM3R.js.map} +0 -0
- /package/dist/{agent-J7SLJYQ6.js.map → agent-KRLAT3YJ.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-MWUJOAAW.js.map → chunk-2BRX2EMT.js.map} +0 -0
- /package/dist/{chunk-OHA3J5ZV.js.map → chunk-5KCOH5FQ.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-GCHUE3TN.js.map → chunk-7WDJW37G.js.map} +0 -0
- /package/dist/{chunk-QDE75R4U.js.map → chunk-A6IV2VQY.js.map} +0 -0
- /package/dist/{chunk-JVNFRS26.js.map → chunk-AVJRATR5.js.map} +0 -0
- /package/dist/{chunk-PZCTCCC5.js.map → chunk-BVRUDRCM.js.map} +0 -0
- /package/dist/{chunk-4NBWF4TL.js.map → chunk-F2PEUQW4.js.map} +0 -0
- /package/dist/{chunk-ZTEU5JVQ.js.map → chunk-FCPTN6NF.js.map} +0 -0
- /package/dist/{chunk-5ALS7SVV.js.map → chunk-FDYGTQVW.js.map} +0 -0
- /package/dist/{chunk-AJONZWLT.js.map → chunk-FX3D7YON.js.map} +0 -0
- /package/dist/{chunk-OTW5MPFT.js.map → chunk-HHY3MSMN.js.map} +0 -0
- /package/dist/{chunk-WPMX3VGI.js.map → chunk-J3SOEFRE.js.map} +0 -0
- /package/dist/{chunk-3L2FKVR6.js.map → chunk-JUJ3TCOE.js.map} +0 -0
- /package/dist/{chunk-B5XHX44Y.js.map → chunk-JY7POTMB.js.map} +0 -0
- /package/dist/{chunk-DTJKN5VT.js.map → chunk-KH6L7GDO.js.map} +0 -0
- /package/dist/{chunk-FIOB3MEX.js.map → chunk-QIJLFPWE.js.map} +0 -0
- /package/dist/{chunk-BH3GTCZ6.js.map → chunk-RGDKHYY2.js.map} +0 -0
- /package/dist/{chunk-HGT4AKOH.js.map → chunk-RP7GLXOA.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-DVNIFP7S.js.map → chunk-WKTFP3SK.js.map} +0 -0
- /package/dist/{chunk-Q7C3X3R6.js.map → chunk-WP6KLXTP.js.map} +0 -0
- /package/dist/{chunk-RKAJR37K.js.map → chunk-WUDXUY7H.js.map} +0 -0
- /package/dist/{chunk-NLZD2QKF.js.map → chunk-WW6KNRIR.js.map} +0 -0
- /package/dist/{chunk-5XQCGPQJ.js.map → chunk-X5K3HR4V.js.map} +0 -0
- /package/dist/{chunk-P2ZYT5D6.js.map → chunk-XSFXAJDA.js.map} +0 -0
- /package/dist/{chunk-W5C2GDNC.js.map → chunk-Y57CULGE.js.map} +0 -0
- /package/dist/{chunk-HVQJIROJ.js.map → chunk-ZKDWQJVS.js.map} +0 -0
- /package/dist/{chunk-IXUEJBHD.js.map → chunk-ZN7637EF.js.map} +0 -0
- /package/dist/{chunk-OUZ7YVQZ.js.map → chunk-ZQSB6IX4.js.map} +0 -0
- /package/dist/{chunk-4TITGMPX.js.map → chunk-ZWGRRFJI.js.map} +0 -0
- /package/dist/{client-JZTH46N2.js.map → client-PC7OEKSK.js.map} +0 -0
- /package/dist/{compaction-U5SAYTX6.js.map → compaction-NWPBPWY2.js.map} +0 -0
- /package/dist/{config-R47ITLIY.js.map → config-I4GWI22T.js.map} +0 -0
- /package/dist/{config-mutator-T6JGXJ26.js.map → config-mutator-3RFKH3OV.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-OG6DK52Y.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-YZI2QZVR.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-XWRGOLMT.js.map → processes-CMTMB7LG.js.map} +0 -0
- /package/dist/{program-3CDFUJVE.js.map → program-RFAHI4SS.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-EDEG2HQR.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-P5LMGXVS.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-722GXALE.js.map → registry-GJLY5J5E.js.map} +0 -0
- /package/dist/{request-planner-PEAYYXAP.js.map → request-planner-JDBXFNQ4.js.map} +0 -0
- /package/dist/{review-candidates-W7NIHNAI.js.map → review-candidates-EBP5CFOB.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-Q2EOZ3VW.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-N2Z5E6AR.js.map} +0 -0
- /package/dist/{scheduler-GC3FQKXY.js.map → scheduler-WTPERNYJ.js.map} +0 -0
- /package/dist/{seat-HR6QMAR2.js.map → seat-LV3STEXI.js.map} +0 -0
- /package/dist/{select-4XYRIZ5L.js.map → select-5NHY4T5A.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-2RKPJWDG.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-XQMJ2FPU.js.map} +0 -0
- /package/dist/{workspace-setup-G6KGWPHY.js.map → workspace-setup-42ARC42I.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";var $=/\bssh\s+(?:-i\s+(\S+)\s+)?([a-z_][a-z0-9_-]*)@([a-z0-9][a-z0-9.-]+|\d{1,3}(?:\.\d{1,3}){3})/gi,R=/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,y=/\b([a-z0-9][a-z0-9._-]*)@([a-z0-9][a-z0-9.-]+\.[a-z]{2,})\b/gi;var k=/groups\/([a-z0-9][a-z0-9._-]+)[^\n|]*\(?\s*ID:?\s*(\d+)\s*\)?/gi,_=/(\/Users\/[^\s)`'"\]]+|\/home\/[^\s)`'"\]]+|\/var\/www\/[^\s)`'"\]]+|\/etc\/[^\s)`'"\]]+)/g,v=/(\+\d{1,3}[\s.-]?(?:\(\d+\)[\s.-]?)?\d[\s.\d-]{6,}\d)/g,z=/^(?:127\.|10\.|192\.168\.|172\.(?:1[6-9]|2\d|3[01])\.)/;function x(i,r){let s={byKind:{ssh:[],gitlab:[],path:[],contact:[]},scannedSkills:[],diagnostics:[]},c=new Set;for(let a of i){let e=a.frontmatter,n=a.instructions??"";if(r.filter?.length){let t=[e.name,e.description,...e.tags??[],e.category??"",a.path??"",n.slice(0,500)].join(" ").toLowerCase();if(!r.filter.some(u=>t.includes(u.toLowerCase())))continue}s.scannedSkills.push(e.name);let o=e.name;for(let t of w(n,r.namespace,o))m(s,t,"ssh",c)&&s.diagnostics.push({skill:e.name,kind:"ssh",id:t.id});for(let t of E(n,r.namespace,r.gitlabHost))m(s,t,"gitlab",c)&&s.diagnostics.push({skill:e.name,kind:"gitlab",id:t.id});for(let t of I(n,r.namespace))m(s,t,"path",c)&&s.diagnostics.push({skill:e.name,kind:"path",id:t.id});for(let t of j(n,r.namespace))m(s,t,"contact",c)&&s.diagnostics.push({skill:e.name,kind:"contact",id:t.id})}return s}function m(i,r,s,c){return c.has(r.id)?!1:(c.add(r.id),i.byKind[s].push(r),!0)}function w(i,r,s){let c=[];for(let e of i.matchAll($)){let[,n,o,t]=e;if(!o||!t)continue;let d=g(`${o}-${t.replace(/[^a-z0-9-]/gi,"-")}`);c.push({id:`${r}.ssh.${d}`,kind:"ssh",summary:`SSH ${o}@${t}`,fields:D({user:o,host:t,key:n}),tags:["discovered"],ownerAgent:s})}let a=new Set(c.flatMap(e=>Object.values(e.fields)));for(let e of i.matchAll(R)){let n=e[0];if(a.has(n)||z.test(n))continue;let o=g(`host-${n.replace(/\./g,"-")}`);c.push({id:`${r}.ssh.${o}`,kind:"ssh",summary:`Host ${n} (user not detected \u2014 fill in)`,fields:{host:n},tags:["discovered","needs-review"],ownerAgent:s}),a.add(n)}return c}var C=/\b([a-z0-9][a-z0-9._-]{1,40})\/([a-z0-9][a-z0-9._-]{1,40})\b/i,A=/\b(\d{1,8})\b/g;function E(i,r,s){let c=[];if(s&&!i.includes(s.replace(/^https?:\/\//,"")))return c;for(let e of i.matchAll(k)){let[,n,o]=e;!n||!o||c.push({id:`${r}.gitlab.group.${g(n)}`,kind:"gitlab",summary:`GitLab group ${n}`,fields:{groupId:Number(o),path:n},tags:["discovered"]})}let a=new RegExp(C.source,"gi");for(let e of i.split(/\r?\n/)){if(!/^\s*\|.+\|/.test(e)&&!/\bID[:\s]/i.test(e)&&!/gitlab/i.test(e))continue;let o,t,d=e.match(/https?:\/\/[^\s)]*gitlab[^\s)]*?\/([a-z0-9][a-z0-9._-]+)\/([a-z0-9][a-z0-9._-]+)/i);if(d&&d[1]&&d[2])o=d[1],t=d[2].replace(/[).,;:]+$/,"");else for(let f of e.matchAll(a)){let p=f[1],h=f[2];!p||!h||p==="wp-content"||h==="wp-content"||p.includes(".")||S(h)||(o=p,t=h)}if(!o||!t)continue;let l=[...e.matchAll(A)].map(f=>Number(f[1])).find(f=>f>=10&&f<=9999999);l&&c.push({id:`${r}.gitlab.project.${g(t)}`,kind:"gitlab",summary:`GitLab project ${o}/${t}`,fields:{projectId:l,path:`${o}/${t}`},tags:["discovered"]})}return c}function S(i){return/\.(md|ya?ml|json|ts|tsx|js|jsx|py|sh|conf|env)$/i.test(i)}function I(i,r){let s=[];for(let c of i.matchAll(_)){let a=c[1].replace(/[.,;:)]+$/,"");if(a.length<4)continue;let e=g(a.replace(/^\//,"").replace(/[/.]/g,"-"));s.push({id:`${r}.paths.${e}`,kind:"path",summary:a,fields:{path:a},tags:["discovered"]})}return s}function j(i,r){let s=[];for(let a of i.matchAll(y)){let[,e,n]=a;if(n.endsWith(".png")||n.endsWith(".jpg"))continue;let o=g(e);s.push({id:`${r}.contacts.${o}`,kind:"contact",summary:`${e}@${n}`,fields:{email:`${e}@${n}`},tags:["discovered"]})}let c=[...i.matchAll(v)].map(a=>a[1].trim());for(let a of c){let e=g(`phone-${a.replace(/\D+/g,"")}`);s.push({id:`${r}.contacts.${e}`,kind:"contact",summary:`Phone ${a}`,fields:{mobile:a},tags:["discovered","needs-review"]})}return s}function D(i){let r={};for(let[s,c]of Object.entries(i))c===void 0||c===""||(r[s]=c);return r}function g(i){return i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)||"x"}function L(i,r){let s={},c={ssh:"ssh.yaml",gitlab:"gitlab.yaml",path:"paths.yaml",contact:"contacts.yaml"};for(let[a,e]of Object.entries(i.byKind)){if(e.length===0)continue;let n=`${r}.${a==="path"?"paths":a==="contact"?"contacts":a}`,o=["# Discovered automatically by 'agentx references discover'.",'# Review every card \u2014 flagged ones (tags include "needs-review") are',"# best-effort guesses. Set lastVerified once you've confirmed.",`namespace: ${n}`,"cards:"];for(let t of e){let d=t.id.startsWith(`${n}.`)?t.id.slice(n.length+1):t.id;o.push(` - id: ${d}`),o.push(` kind: ${t.kind}`),o.push(` summary: ${b(t.summary)}`),o.push(" fields:");for(let[u,l]of Object.entries(t.fields))o.push(` ${u}: ${typeof l=="number"||typeof l=="boolean"?l:b(String(l))}`);o.push(` tags: [${t.tags.join(", ")}]`),t.ownerAgent&&o.push(` ownerAgent: ${t.ownerAgent}`)}s[c[a]]=o.join(`
|
|
2
2
|
`)+`
|
|
3
3
|
`}return s}function b(i){return/^[A-Za-z0-9_./@+:-]+$/.test(i)&&!/^\d/.test(i)?i:`"${i.replace(/"/g,'\\"')}"`}export{x as discoverFromSkills,L as renderDiscovery};
|
|
4
|
-
//# sourceMappingURL=discover-
|
|
4
|
+
//# sourceMappingURL=discover-7YFQNYLC.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";function c(o){let s=o.store.list().map(t=>({id:t.id,title:t.title})),e=[];if(e.push(r),e.push(""),e.push(i),e.push(""),e.push("# Environment \u2014 only reference values that exist"),e.push(""),e.push("## Available agents (for `agent` nodes)"),o.availableAgents.length===0)e.push(" (none registered \u2014 the user must add an agent first for `agent` nodes to work)");else for(let t of o.availableAgents)e.push(` - \`${t.id}\`${t.description?` \u2014 ${t.description}`:""}`);if(e.push(""),e.push("## Assignees (for `userTask.assignTo`)"),e.push(" Any agent id above, or a plain string naming the person responsible."),e.push(""),e.push("## Available roles (for `userTask.assignTo`)"),e.push(""),e.push("## Available channels (for `action.*` and `trigger.channel`)"),e.push(` ${o.availableChannels.length?o.availableChannels.map(t=>`\`${t}\``).join(", "):"(none live on this node)"}`),e.push(""),e.push("## Existing workflows (for `subProcess.workflowId`)"),s.length===0)e.push(" (no other workflows defined)");else for(let t of s)e.push(` - \`${t.id}\` \u2014 ${t.title}`);e.push(""),o.currentWorkflow&&(e.push("# Current workflow on canvas"),e.push(""),e.push("The user is editing this workflow. Build on it \u2014 do NOT replace it unless they explicitly ask."),e.push(""),e.push("```json"),e.push(JSON.stringify(o.currentWorkflow,null,2)),e.push("```"),e.push("")),e.push("# Conversation"),e.push("");for(let t of o.messages){let a=t.role==="user"?"USER":"ASSISTANT";e.push(`${a}: ${t.content}`),e.push("")}return e.push(l),e.join(`
|
|
2
2
|
`)}function u(o){let s=/```(?:json)?\s*\n([\s\S]*?)```/.exec(o),e=[];s&&e.push(s[1]);let t=o.match(/\{[\s\S]*\}/);t&&e.push(t[0]);for(let a of e)try{let n=JSON.parse(a);if(n&&typeof n=="object"&&"id"in n&&"nodes"in n)return n}catch{}return null}var r=`You are AgentX's workflow author. The user describes a business process in
|
|
3
3
|
plain language; you return a valid V2 workflow JSON that implements it.
|
|
4
4
|
|
|
@@ -134,4 +134,4 @@ Only reference agent ids, actor ids, role ids, and channel names that
|
|
|
134
134
|
appear in the Environment section above. If the user asks for an agent
|
|
135
135
|
that doesn't exist, tell them which agent to register first. Never
|
|
136
136
|
invent workflowIds for subProcess that aren't in the existing list.`;export{c as buildWorkflowAuthorPrompt,u as extractWorkflowJson};
|
|
137
|
-
//# sourceMappingURL=editor-chat-
|
|
137
|
+
//# sourceMappingURL=editor-chat-V24MXQIB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r,b as c,c as u,f as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=entry-triage-
|
|
1
|
+
import{a as r,b as c,c as u,f as g}from"./chunk-72SZI2UW.js";import"./chunk-QIJLFPWE.js";g();var w="entry-triage",f={person:"A named human, team, or agent",project:"A named piece of work with a lifecycle",place:"A server, environment, repository, or system",concept:"A durable idea, term, or explanation",event:"Something that happened at a time \u2014 an incident, deploy, meeting",decision:"A choice made, and why",pattern:"A recurring way of doing or seeing something",none:"Nothing that fits a wiki article \u2014 chatter, a transient status, a duplicate, or noise"},T={citeWorthy:r("Would a curated wiki cite this entry for anything at all \u2014 a fact, a date, a name, a decision \u2014 even a single sentence inside an article about something else?"),type:c(f,"What kind of wiki article, if any, does this entry belong in?"),worthKeeping:r("Would this entry still be useful to someone in six months?"),procedure:r("Does this entry describe how to do something, step by step?"),durability:u(["True only in the moment it was written","True for days \u2014 a status, a run, a transient state","True for months \u2014 a project, a person's role, a current setup","True indefinitely \u2014 a decision, an incident that happened, a rule"],"How long will what this entry says remain true?")};function A(e,t=2e3){let n=String(e.content??"").replace(/\s+/g," ").trim();return{date:e.date??null,source:e.source??null,context:e.sourceContext?l(e.sourceContext,200):null,content:l(n,t)}}function x(e,t={}){let n=e.type,o=e.worthKeeping.noul,p=e.procedure.noul,i=e.durability.score,y=t.minTypeConfidence??.5,d=t.minWorth??.5,m=t.minDurability??1.5,h=n.choice!=="none"&&n.confidence>=y,a=o>=d,s=i>=m;return{type:n.choice,typeConfidence:n.confidence,worthKeeping:o,procedure:p,durability:i,absorb:h&&a&&s,rememberOnly:!s&&a}}function l(e,t){return e.length>t?e.slice(0,t):e}export{w as ENTRY_TRIAGE_SEAT,f as ENTRY_TYPES,T as entryTriageQuestions,x as triage,A as triageState};
|
|
2
|
+
//# sourceMappingURL=entry-triage-LZWMMLLN.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-QIJLFPWE.js";import{existsSync as E,readFileSync as T}from"fs";import{resolve as j}from"path";import{execFile as N}from"child_process";function p(e,t,o={}){return new Promise(n=>{N(e,t,{timeout:o.timeoutMs??15e3,signal:o.signal,maxBuffer:4*1024*1024,env:{...process.env,PATH:[process.env.PATH??"","/opt/homebrew/bin","/usr/local/bin",`${process.env.HOME??""}/.local/bin`].filter(Boolean).join(":")}},(r,a,i)=>{let s=r&&typeof r.code=="number"?r.code:r?1:0;n({stdout:String(a??""),stderr:String(i??""),code:s})})})}async function y(e){let{code:t}=await p("command",["-v",e],{timeoutMs:3e3}).catch(()=>({code:1}));if(t===0)return!0;let{code:o}=await p("/usr/bin/which",[e],{timeoutMs:3e3});return o===0}var G=[["216","Tunisia"],["966","Saudi Arabia"],["971","UAE"],["974","Qatar"],["965","Kuwait"],["973","Bahrain"],["968","Oman"],["962","Jordan"],["961","Lebanon"],["212","Morocco"],["213","Algeria"],["218","Libya"],["249","Sudan"],["20","Egypt"],["90","Turkey"],["33","France"],["49","Germany"],["39","Italy"],["34","Spain"],["44","United Kingdom"],["31","Netherlands"],["32","Belgium"],["41","Switzerland"],["1","US/Canada"]];function m(e){let t=e.replace(/\D/g,""),o,n=0;for(let[r,a]of G)t.startsWith(r)&&r.length>n&&(o=a,n=r.length);return o}function F(e){let t=[];for(let o of e.split(`
|
|
2
2
|
`)){let n=o.trim();if(!n||n.startsWith("ALIAS"))continue;let r=n.split(/\s{2,}/).filter(Boolean);if(r.length<2)continue;let a=r[r.length-1];if(!a.includes("@"))continue;let i=r[r.length-2],s=r.length>=3?r[r.length-3]:"";if(!s||!/\d/.test(i))continue;let l=m(i);t.push({name:s,source:"wacli",fields:{phone:`+${i.replace(/\D/g,"")}`,whatsapp:a,...l?{country:l}:{}}})}return t}function w(){return{name:"wacli",provides:["contact value","country"],async available(){if(!await y("wacli"))return{kind:"not-installed",hint:"brew install wacli \u2014 see https://wacli.sh"};let{stdout:e,stderr:t,code:o}=await p("wacli",["contacts","search","__agentx_probe__"],{timeoutMs:1e4});return o!==0&&/auth|not logged in|no session|login/i.test(e+t)?{kind:"not-configured",hint:"wacli auth \u2014 scan the QR to link the account"}:null},async lookup(e,t){let o=[],n=new Set;for(let r of e)for(let a of P(r.name)){let{stdout:i,code:s}=await p("wacli",["contacts","search",a],{signal:t,timeoutMs:15e3});if(s!==0)continue;let l=F(i).filter(u=>A(u.name,r.name));if(l.length!==0){for(let u of l){let c=u.fields.whatsapp;n.has(c)||(n.add(c),o.push({...u,fuzzy:!I(u.name,r.name)}))}break}}return o}}}var h=e=>e.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9 ]/g,"").trim(),I=(e,t)=>h(e)===h(t);function P(e){let t=h(e).split(/\s+/).filter(o=>o.length>2);return t.length>1?[e,t[t.length-1]]:[e]}function A(e,t){let o=h(e).split(/\s+/).filter(Boolean),n=h(t).split(/\s+/).filter(Boolean);if(o.length===0||n.length===0)return!1;let[r,a]=o.length<=n.length?[o,n]:[n,o];return r.every(i=>a.includes(i))}var M={whatsapp:"whatsapp",telegram:"telegram",gitlab:"gitlab",github:"github",email:"email",phone:"phone",slack:"slack",discord:"discord"};function D(e=".agentx"){return j(process.cwd(),e,"contacts.json")}function S(e){if(!E(e))return[];try{let t=JSON.parse(T(e,"utf-8"));return Array.isArray(t?.contacts)?t.contacts:[]}catch{return[]}}var b=e=>e.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9 ]/g,"").trim();function C(e){return[e.name,e.id,...e.aliases??[]].filter(t=>!!(t&&t.trim())).map(b)}function _(e){let t={};for(let[o,n]of Object.entries(e.channels??{})){let r=String(n??"").trim();if(!r)continue;let a=M[o.toLowerCase()]??o.toLowerCase();if(a==="whatsapp"){let i=r.split("@")[0].replace(/\D/g,"");if(t.whatsapp=r.includes("@")?r:`${i}@s.whatsapp.net`,i){t.phone??=`+${i}`;let s=m(i);s&&(t.country??=s)}continue}if(a==="phone"){let i=r.replace(/\D/g,"");t.phone=r.startsWith("+")?r:`+${i}`;let s=m(i);s&&(t.country??=s);continue}if(a==="telegram"&&/^\d+$/.test(r)){t.telegramId=r;continue}t[a]=a==="gitlab"||a==="github"?r.startsWith("@")?r:`@${r}`:r}return t}function k(e={}){let t=e.path??D();return{name:"contacts",provides:["contact value","handles","country"],async available(){return E(t)?S(t).length>0?null:{kind:"not-configured",hint:`${t} has no contacts`}:{kind:"not-configured",hint:`no ${t} \u2014 add {"contacts":[{"name":"\u2026","aliases":[],"channels":{"whatsapp":"\u2026"}}]}`}},async lookup(o){let n=S(t);if(n.length===0)return[];let r=new Map;for(let s of n)for(let l of C(s))l&&r.set(l,s);let a=[],i=new Set;for(let s of o){let l=r.get(b(s.name));if(!l||i.has(l))continue;i.add(l);let u=_(l);Object.keys(u).length!==0&&a.push({name:l.name??s.name,source:"contacts",fields:u,fuzzy:b(l.name??"")!==b(s.name)})}return a}}}function v(e={}){let t=(e.baseUrl??process.env.GITLAB_URL??"").replace(/\/+$/,""),o=e.token??process.env.GITLAB_ADMIN_TOKEN??process.env.GITLAB_TOKEN;return{name:"gitlab",provides:["email","handle","profile URL"],async available(){if(!t)return{kind:"not-configured",hint:"export GITLAB_URL=https://<your-gitlab-host>"};if(!o)return{kind:"not-configured",hint:"export GITLAB_ADMIN_TOKEN=<PAT> (read_api scope is enough)"};try{let n=await fetch(`${t}/api/v4/user`,{headers:{"PRIVATE-TOKEN":o}});if(n.status===401||n.status===403)return{kind:"not-configured",hint:`GitLab rejected the token (${n.status}) \u2014 set a valid GITLAB_ADMIN_TOKEN`};if(!n.ok)return{kind:"failed",hint:`GitLab returned ${n.status} for the auth probe`}}catch(n){return{kind:"failed",hint:`cannot reach ${t}: ${String(n?.message??n)}`}}return null},async lookup(n,r){if(!o||!t)return[];let a=[],i=new Set;for(let s of n){let l=`${t}/api/v4/users?search=${encodeURIComponent(s.name)}&per_page=5`,u;try{let c=await fetch(l,{headers:{"PRIVATE-TOKEN":o},signal:r});if(!c.ok)continue;u=await c.json()}catch{continue}if(Array.isArray(u))for(let c of u){let d=c.username??c.web_url??"";if(!d||i.has(d))continue;i.add(d);let f={},g=c.email||c.public_email;g&&(f.email=g),c.username&&(f.gitlab=`@${c.username}`),c.web_url&&(f.profile=c.web_url),c.organization&&(f.organisation=c.organization),c.job_title&&(f.role=c.job_title),c.state&&c.state!=="active"&&(f.accountState=c.state),Object.keys(f).length!==0&&a.push({name:c.name??s.name,source:"gitlab",fields:f,fuzzy:(c.name??"").toLowerCase()!==s.name.toLowerCase()})}}return a}}}function x(){return{name:"gog",provides:["contact value","email","organisation","role","country"],async available(){if(!await y("gog"))return{kind:"not-installed",hint:"brew install gog \u2014 Google CLI"};let{stdout:e,stderr:t}=await p("gog",["contacts","list","-j"],{timeoutMs:2e4}),o=e+t;return/unknown flag|Run with --help/i.test(o)?{kind:"failed",hint:`gog rejected the probe: ${o.split(`
|
|
3
3
|
`)[0]}`}:/accessNotConfigured|has not been used in project/i.test(o)?{kind:"not-configured",hint:"enable the People API on the gog OAuth project, then retry (console.developers.google.com \u2192 APIs \u2192 People API)"}:/invalid_grant|PERMISSION_DENIED|unauthenticated/i.test(o)?{kind:"not-configured",hint:"gog auth login \u2014 the stored token is expired or lacks contacts scope"}:null},async lookup(e,t){let o=[];for(let n of e){let{stdout:r,code:a}=await p("gog",["contacts","search",n.name,"-j","--results-only"],{signal:t,timeoutMs:2e4});if(a!==0)continue;let i;try{i=JSON.parse(r)}catch{continue}let s=Array.isArray(i)?i:i?.results??i?.people??[];for(let l of s){let u={},c=l.phoneNumbers?.[0]?.value,d=l.emailAddresses?.[0]?.value,f=l.organizations?.[0];c&&(u.phone=c),d&&(u.email=d),f?.name&&(u.organisation=f.name),f?.title&&(u.role=f.title);let g=l.addresses?.[0]?.country;g&&(u.country=g),Object.keys(u).length!==0&&o.push({name:l.names?.[0]?.displayName??n.name,source:"gog",fields:u})}}return o}}}var R=e=>typeof e=="string"&&e.trim()?e.trim():void 0;function L(e){return String(e??"").split("@")[0].split(":")[0].toLowerCase()}function z(e){let t=new Map;for(let o of e){let n=R(o.meta?.sender);if(!n)continue;let r=R(o.meta?.senderId),a=R(o.meta?.senderUsername),i=L(o.source),s={};if(r&&/@s\.whatsapp\.net$/.test(r)){let c=r.split("@")[0].replace(/\D/g,"");if(c){s.phone=`+${c}`,s.whatsapp=r;let d=m(c);d&&(s.country=d)}}else if(i==="whatsapp"&&r&&/^\d{6,}$/.test(r)){s.phone=`+${r}`,s.whatsapp=`${r}@s.whatsapp.net`;let c=m(r);c&&(s.country=c)}if(a){let c=a.startsWith("@")?a:`@${a}`;i==="gitlab"?s.gitlab=c:i==="github"?s.github=c:i==="telegram"?s.telegram=c:s.handle=c}if(r&&!s.phone&&!a&&(s[`${i||"platform"}Id`]=r),Object.keys(s).length===0)continue;let l=n.toLowerCase(),u=t.get(l);if(!u){t.set(l,{name:n,source:"entries",fields:s});continue}for(let[c,d]of Object.entries(s))u.fields[c]??=d}return Array.from(t.values())}function H(e){let t;return{...e,available:()=>t??=e.available(),lookup:(o,n)=>e.lookup(o,n)}}function O(){return[k(),w(),v(),x()].map(H)}function ct(e,t={}){let o=t.max??25,n=new Map;for(let a of e){let i=(a.sender??"").trim();i&&$(i)&&n.set(i.toLowerCase(),{name:i,origin:"sender",type:"person"})}for(let a of e){let i=(a.context??"").trim();if(!$(i))continue;let s=i.toLowerCase();n.has(s)||n.set(s,{name:i,origin:"context"})}let r=(t.known??[]).filter(a=>a.trim().length>2);if(r.length>0){let a=e.map(i=>i.content??"").join(`
|
|
4
4
|
`).toLowerCase();for(let i of r){let s=i.toLowerCase().trim();n.has(s)||a.includes(s)&&n.set(s,{name:i,origin:"body",type:"person"})}}return Array.from(n.values()).slice(0,o)}var U=new Set(["me","user","system","cron","unknown","anonymous","bot","agent","self","test","admin","none","null","n/a"]),B=new Set(["group","team","chat","channel","squad","crew","room","family","project","board","committee","club","staff","office","dept","department","support","sales","ops","admins","everyone","all"]);function $(e){let t=e.trim();if(!t||t.length>48||U.has(t.toLowerCase())||/[\d@/\\#:|_]/.test(t))return!1;let o=t.split(/\s+/);return o.length<2||o.length>4||o.some(n=>B.has(n.toLowerCase()))?!1:o.every(n=>/^[\p{Lu}][\p{L}'’.-]*$/u.test(n))}async function lt(e,t={}){let o=t.sources??O(),n=e.slice(0,t.maxEntities??25);if(n.length===0)return{records:[],results:[]};let r=new AbortController,a=setTimeout(()=>r.abort(),t.timeoutMs??12e4);try{let i=await Promise.all(o.map(async s=>{let l=Date.now();try{let u=await s.available();if(u)return{source:s.name,records:[],unavailable:u,ms:Date.now()-l};let c=await s.lookup(n,r.signal);return{source:s.name,records:c,ms:Date.now()-l}}catch(u){return{source:s.name,records:[],unavailable:{kind:"failed",hint:String(u?.message??u)},ms:Date.now()-l}}}));for(let s of i)t.onResult?.(s);return{records:i.flatMap(s=>s.records),results:i}}finally{clearTimeout(a)}}function ut(e,t=O()){let o=new Map(t.map(n=>[n.name,n.provides]));return e.filter(n=>n.unavailable&&n.unavailable.kind!=="failed").map(n=>({source:n.source,kind:n.unavailable.kind,hint:n.unavailable.hint,provides:o.get(n.source)??[]}))}function ft(e){let t=new Map;for(let o of e){let n=o.name.toLowerCase().trim(),r=t.get(n);r||(r={name:o.name,fields:{}},t.set(n,r));for(let[a,i]of Object.entries(o.fields)){if(!i?.trim())continue;let s=r.fields[a];if(!s){r.fields[a]={value:i,source:o.source};continue}s.value!==i&&(r.fields[`${a} (${o.source})`]??={value:i,source:o.source})}}return Array.from(t.values())}function dt(e){if(e.length===0)return"";let t=e.filter(o=>Object.keys(o.fields).length>0).map(o=>{let n=Object.entries(o.fields).map(([r,a])=>` - ${r}: \`${a.value}\` _(${a.source})_`).join(`
|
|
@@ -19,4 +19,4 @@ contradicts the entries, this wins and the entry is stale.
|
|
|
19
19
|
${t.join(`
|
|
20
20
|
`)}
|
|
21
21
|
`}export{m as countryFromPhone,k as createContactsSource,v as createGitlabSource,x as createGogSource,w as createWacliSource,O as defaultSources,ct as extractHints,_ as factsFrom,ut as installPrompts,$ as isPersonName,S as loadContacts,H as memoizeAvailability,ft as mergeRecords,C as namesOf,F as parseContactsTable,L as platformOf,A as plausible,z as recordsFromEntries,dt as renderFactsBlock,lt as resolveFacts};
|
|
22
|
-
//# sourceMappingURL=facts-
|
|
22
|
+
//# sourceMappingURL=facts-4YPSHIXJ.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{f,k as I}from"./chunk-
|
|
1
|
+
import{f,k as I}from"./chunk-WP6KLXTP.js";import"./chunk-FCPTN6NF.js";import"./chunk-QIJLFPWE.js";import{createHash as $}from"crypto";var k="failure:",x=3,p=5,A=["error","timeout"],T=["memory-promote","procedure-miner"];function h(t,s){return(s??"").toLowerCase().replace(/https?:\/\/\S+/g,"<url>").replace(/(["'`]).*?\1/g,"<v>").replace(/(?:~|\.{0,2})?\/[\w.@-]+(?:\/[\w.@-]+)*/g,"<path>").replace(/\b[0-9a-z]*\d[0-9a-z]*\b/g,"<n>").replace(/[^a-z<>\s]+/g," ").replace(/\s+/g," ").trim().split(" ").filter(Boolean).slice(0,8).join(" ")||t}function y(t){return`${t.agentId}|${t.tool??"no-tool"}|${t.status}|${h(t.status,t.error)}`}function S(t){return $("sha1").update(t).digest("hex").slice(0,10)}function w(t,s){return`${k}${S(t)}@${Math.floor(Math.log2(Math.max(1,s)))}`}function F(t){return t.finalSessionId??t.resumeSessionId??t.taskId}function _(t,s={}){return A.flatMap(e=>I(t,{status:e,since:s.since,limit:1e3})).filter(e=>!T.some(i=>(e.chatId??"").startsWith(i))).map(e=>{let{tool:i,error:n}=b(f(t,e.taskId)?.steps??[]);return{taskId:e.taskId,agentId:e.agentId,chatId:e.chatId,sessionId:F(e),status:e.status,startedAt:e.startedAt,error:n??e.error,messagePreview:e.messagePreview,tool:i}})}function b(t){let s=null,a=null;for(let e of t)e.name==="tool_use"&&e.action?(s=e.action,e.status==="error"&&(a={tool:e.action,error:e.error??e.outputSummary})):e.name==="tool_result"&&e.status==="error"&&(a={tool:e.action??s,error:e.error??e.outputSummary});return a??{tool:s,error:null}}function C(t,s={}){let a=Math.max(2,s.minSessions??x),e=new Map;for(let n of t){let r=y(n);e.set(r,[...e.get(r)??[],n])}let i=[];for(let[n,r]of e){let l=[...new Set([...r].sort((c,g)=>g.startedAt-c.startedAt).map(c=>c.sessionId))];if(l.length<a)continue;r.sort((c,g)=>g.startedAt-c.startedAt);let o=r[0],u=o.tool??"no tool",d=h(o.status,o.error),m=`failure-${S(n)}`;i.push({occurrences:l.length,sessions:l.slice(0,p),tasks:r.slice(0,p).map(c=>c.taskId),failure:{tool:u,errorClass:d,runs:r.length},agentId:o.agentId,key:`${o.agentId}/feedback_${m}`,stamp:w(n,l.length),memory:{name:m,type:"feedback",description:`${o.agentId}: ${u} keeps failing (${d}) in ${l.length} sessions`.slice(0,200),body:E(o.agentId,u,d,l.length,r),createdAt:new Date(r[r.length-1].startedAt).toISOString(),updatedAt:new Date(o.startedAt).toISOString()}})}return i.sort((n,r)=>r.occurrences-n.occurrences)}function E(t,s,a,e,i){let n=i.slice(0,p).map(r=>{let l=(r.messagePreview??"").replace(/\s+/g," ").trim().slice(0,120),o=(r.error??r.status).replace(/\s+/g," ").trim().slice(0,160);return`- ${new Date(r.startedAt).toISOString().slice(0,10)} \`${r.taskId}\` (${r.status})${l?` \u2014 task: ${l}`:""}
|
|
2
2
|
error: ${o}`});return[`**${t}** hit the same failure in ${e} separate sessions (${i.length} runs).`,`- Tool: \`${s}\`
|
|
3
3
|
- Error class: \`${a}\``,"Recurrence across sessions is the finding: any one of these runs is session state. Propose the fix that stops it recurring \u2014 what fails, the likely cause, and what to do instead (a missing fact, a better approach, or a tool or configuration change to make) \u2014 or skip it if the examples do not share a cause.",`**Examples (newest first):**
|
|
4
4
|
${n.join(`
|
|
5
5
|
`)}`].join(`
|
|
6
6
|
|
|
7
7
|
`)}export{x as DEFAULT_MIN_SESSIONS,k as FAILURE_STAMP_PREFIX,p as MAX_FAILURE_EXAMPLES,h as errorClass,b as failingTool,y as failureSignature,w as failureStamp,C as failuresToCandidates,_ as loadFailedTraces,F as sessionOf};
|
|
8
|
-
//# sourceMappingURL=failure-candidates-
|
|
8
|
+
//# sourceMappingURL=failure-candidates-RIXA3Y6D.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -7814,7 +7814,7 @@ interface DriftReport {
|
|
|
7814
7814
|
}
|
|
7815
7815
|
|
|
7816
7816
|
type SourceTrust =
|
|
7817
|
-
/** Only the operator can reach it: CLI, dashboard, local voice and
|
|
7817
|
+
/** Only the operator can reach it: CLI, dashboard, local voice, TUI and Raycast. */
|
|
7818
7818
|
"operator"
|
|
7819
7819
|
/** Authenticated people or peers: allow-listed chat senders, forge
|
|
7820
7820
|
* project members, mesh callers. */
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as L}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-Y57CULGE.js";import{a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,ia as bt,ja as Tt,ka as Mt}from"./chunk-RP7GLXOA.js";import"./chunk-KH6L7GDO.js";import"./chunk-BVRUDRCM.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-FULEQYM6.js";import"./chunk-5KCOH5FQ.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-L53FTKEP.js";import{N as yt,l as lt,m as ct,n as dt,o as mt,p as pt}from"./chunk-ZKDWQJVS.js";import"./chunk-JUJ3TCOE.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-2BRX2EMT.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-X5K3HR4V.js";import{m as ut}from"./chunk-JY7POTMB.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-WW6KNRIR.js";import"./chunk-FDYGTQVW.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-ZN7637EF.js";import{a as gt,b as ft,e as ht}from"./chunk-AVJRATR5.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-A6IV2VQY.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-F2PEUQW4.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-SZJMS7K4.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{a as Fe,b as Le,c as A,d as De}from"./chunk-VDMYBPYB.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{k as tt,m as st,n as ot,p as nt}from"./chunk-XSFXAJDA.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
|
|
2
2
|
`)}
|
|
3
3
|
|
|
4
|
-
${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-
|
|
4
|
+
${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-EVHZ2R73.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).
|
|
5
5
|
You create high-quality SKILL.md files that provide reusable instructions for AI coding agents.
|
|
6
6
|
|
|
7
7
|
A skill is a markdown document with YAML frontmatter that teaches an agent how to perform a specific task.
|
|
@@ -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-JWLTI6NZ.js";import"./chunk-ZQSB6IX4.js";import"./chunk-WUDXUY7H.js";import"./chunk-Z3IP66SL.js";import"./chunk-4BNQSUWV.js";import"./chunk-HHY3MSMN.js";import"./chunk-RKPAVWXF.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-RP7GLXOA.js";import"./chunk-KH6L7GDO.js";import"./chunk-BVRUDRCM.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-FULEQYM6.js";import"./chunk-5KCOH5FQ.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-L53FTKEP.js";import"./chunk-ZKDWQJVS.js";import"./chunk-JUJ3TCOE.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-2BRX2EMT.js";import"./chunk-SFQUP3BP.js";import"./chunk-X5K3HR4V.js";import"./chunk-JY7POTMB.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-WW6KNRIR.js";import"./chunk-FDYGTQVW.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-ZN7637EF.js";import"./chunk-AVJRATR5.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-A6IV2VQY.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-F2PEUQW4.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-XSFXAJDA.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as buildProgram};
|
|
2
|
+
//# sourceMappingURL=program-RFAHI4SS.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-5KCOH5FQ.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-DP7RTNDM.js";import"./chunk-AVJRATR5.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-TFVUOC2C.js";import"./chunk-F2PEUQW4.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-XSFXAJDA.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-EDEG2HQR.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-A6IV2VQY.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-F2PEUQW4.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-XSFXAJDA.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as agenticQuery};
|
|
2
|
+
//# sourceMappingURL=query-P5LMGXVS.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{E as a,F as b,G as c,H as d,I as e,J as f,K as g,L as h,M as i,N as j}from"./chunk-ZKDWQJVS.js";import"./chunk-JUJ3TCOE.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-JY7POTMB.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-WW6KNRIR.js";import"./chunk-FDYGTQVW.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-ZN7637EF.js";import"./chunk-AVJRATR5.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-A6IV2VQY.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-F2PEUQW4.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-XSFXAJDA.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-GJLY5J5E.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-F2PEUQW4.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-XSFXAJDA.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-JDBXFNQ4.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as I}from"./chunk-
|
|
1
|
+
import{b as I}from"./chunk-BVRUDRCM.js";import"./chunk-WP6KLXTP.js";import"./chunk-2GIDVZ4H.js";import"./chunk-F2PEUQW4.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.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-EBP5CFOB.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-FDYGTQVW.js";import"./chunk-F2PEUQW4.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as cheapModelForEngine,b as routeTaskModel};
|
|
2
|
+
//# sourceMappingURL=routing-Q2EOZ3VW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"./chunk-ZWGRRFJI.js";import"./chunk-RKPAVWXF.js";import"./chunk-X5K3HR4V.js";import"./chunk-JY7POTMB.js";import"./chunk-WW6KNRIR.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.js";import"./chunk-QIJLFPWE.js";export{b as resolveScheduleCaller,a as runScheduleTool};
|
|
2
|
+
//# sourceMappingURL=schedule-tool-N2Z5E6AR.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{h as a,i as b,j as c,k as d,l as e,m as f}from"./chunk-JY7POTMB.js";import"./chunk-WW6KNRIR.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.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-WTPERNYJ.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-F2PEUQW4.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.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-LV3STEXI.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-F2PEUQW4.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-XSFXAJDA.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-5NHY4T5A.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-ZWGRRFJI.js";import"./chunk-RKPAVWXF.js";import"./chunk-X5K3HR4V.js";import"./chunk-JY7POTMB.js";import"./chunk-WW6KNRIR.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.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-2RKPJWDG.js.map
|