agentix-cli 0.50.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/mac-voice/Sources/AgentXVoice/AgentClient.swift +67 -14
- package/apps/mac-voice/Sources/AgentXVoice/Config.swift +20 -3
- package/apps/mac-voice/Sources/AgentXVoice/Panel.swift +24 -31
- package/apps/mac-voice/Sources/AgentXVoice/Speech.swift +16 -2
- package/apps/mac-voice/Sources/AgentXVoice/StatusMenu.swift +173 -0
- package/apps/mac-voice/Sources/AgentXVoice/main.swift +62 -15
- package/dist/{App-KE4SURSS.js → App-QVNQ5BQK.js} +2 -2
- package/dist/{ChatApp-NNHIKXO2.js → ChatApp-CC57XC23.js} +2 -2
- package/dist/agent-ILH6ANOM.js +2 -0
- package/dist/{article-fields-L4D2BOGY.js → article-fields-PITN4NHA.js} +2 -2
- package/dist/{article-quality-44ONVGLN.js → article-quality-JFJMZWFQ.js} +2 -2
- package/dist/{audit-4245CX6P.js → audit-CMJ2TZ3K.js} +2 -2
- package/dist/{backfill-MTD2B62I.js → backfill-7TCF4SHG.js} +2 -2
- package/dist/{board-dashboard-RUOASCSQ.js → board-dashboard-XPPBRPQE.js} +117 -117
- package/dist/board-dashboard-XPPBRPQE.js.map +1 -0
- package/dist/{builtin-B67DMJ3M.js → builtin-W6KNX7RS.js} +2 -2
- package/dist/calibration-MCCVYGZQ.js +2 -0
- package/dist/{chunk-3SCPRYJB.js → chunk-2AXFYDWF.js} +2 -2
- package/dist/{chunk-4TITGMPX.js → chunk-2KQTE4XI.js} +2 -2
- package/dist/{chunk-QDE75R4U.js → chunk-6HAZ6YWI.js} +2 -2
- package/dist/{chunk-F4HZTZHW.js → chunk-72SZI2UW.js} +2 -2
- package/dist/{chunk-L2WSPY6S.js → chunk-7I7IEX4S.js} +2 -2
- package/dist/{chunk-OTW5MPFT.js → chunk-CAA546XN.js} +2 -2
- package/dist/{chunk-5XQCGPQJ.js → chunk-F7WY24UZ.js} +2 -2
- package/dist/{chunk-ZTEU5JVQ.js → chunk-FCPTN6NF.js} +2 -2
- package/dist/{chunk-AJONZWLT.js → chunk-FX3D7YON.js} +2 -2
- package/dist/{chunk-5ALS7SVV.js → chunk-H2TWRZC2.js} +2 -2
- package/dist/{chunk-WPMX3VGI.js → chunk-J3SOEFRE.js} +2 -2
- package/dist/{chunk-4NBWF4TL.js → chunk-JQR3NTHI.js} +2 -2
- package/dist/{chunk-OUZ7YVQZ.js → chunk-KFALP5NO.js} +2 -2
- package/dist/{chunk-Y6I3BYWV.js → chunk-LBMZP7TG.js} +95 -95
- package/dist/chunk-LBMZP7TG.js.map +1 -0
- package/dist/{chunk-WQLBJ2O5.js → chunk-PSDCRZZM.js} +6 -6
- package/dist/chunk-QIJLFPWE.js +2 -0
- package/dist/{chunk-PZCTCCC5.js → chunk-QP6XNTBB.js} +2 -2
- package/dist/{chunk-BH3GTCZ6.js → chunk-RGDKHYY2.js} +2 -2
- package/dist/{chunk-JVNFRS26.js → chunk-ROCUOXCW.js} +2 -2
- package/dist/{chunk-FULEQYM6.js → chunk-S7CVSKOX.js} +2 -2
- package/dist/chunk-S7CVSKOX.js.map +1 -0
- package/dist/{chunk-K33GIBSE.js → chunk-SIU6STB2.js} +2 -2
- package/dist/{chunk-P2ZYT5D6.js → chunk-SRCXUZM2.js} +5 -5
- package/dist/{chunk-P2ZYT5D6.js.map → chunk-SRCXUZM2.js.map} +1 -1
- package/dist/{chunk-LCIREYTD.js → chunk-SZJMS7K4.js} +2 -2
- package/dist/{chunk-AJ5RMU7X.js → chunk-TFVUOC2C.js} +2 -2
- package/dist/chunk-U67EG5IF.js +19 -0
- package/dist/chunk-U67EG5IF.js.map +1 -0
- package/dist/{chunk-BYD55JXH.js → chunk-UBRMOTBH.js} +181 -180
- package/dist/chunk-UBRMOTBH.js.map +1 -0
- package/dist/chunk-V7XZN3MQ.js +123 -0
- package/dist/chunk-V7XZN3MQ.js.map +1 -0
- package/dist/{chunk-NLZD2QKF.js → chunk-VMS3HVTT.js} +2 -2
- package/dist/{chunk-TUNQFPVA.js → chunk-WCMQRSVU.js} +2 -2
- package/dist/{chunk-OHA3J5ZV.js → chunk-WDQ3BPFS.js} +2 -2
- package/dist/{chunk-6VKCUMCN.js → chunk-WKTFP3SK.js} +2 -2
- package/dist/{chunk-Q7C3X3R6.js → chunk-WP6KLXTP.js} +2 -2
- package/dist/{chunk-IXUEJBHD.js → chunk-XZTR5MBJ.js} +2 -2
- package/dist/{chunk-W5C2GDNC.js → chunk-Y57CULGE.js} +2 -2
- package/dist/chunk-YE2BUU3Z.js +28 -0
- package/dist/chunk-YE2BUU3Z.js.map +1 -0
- package/dist/{chunk-TTL37CS5.js → chunk-YEV6W34S.js} +55 -55
- package/dist/{chunk-TTL37CS5.js.map → chunk-YEV6W34S.js.map} +1 -1
- package/dist/cli.js +1 -1
- package/dist/client-I7GAAM3T.js +2 -0
- package/dist/{compaction-PIZINFHR.js → compaction-NWPBPWY2.js} +4 -4
- package/dist/{config-R47ITLIY.js → config-TVW7UCKG.js} +2 -2
- package/dist/config-mutator-JHM53P5A.js +2 -0
- package/dist/{conflict-detector-ZPOT3M2C.js → conflict-detector-KS7OSS45.js} +2 -2
- package/dist/{context-planner-FJMU5WAT.js → context-planner-LJT5IKH6.js} +3 -3
- package/dist/debug-FTAGG7MN.js +2 -0
- package/dist/{discover-D4VVRNAI.js → discover-7YFQNYLC.js} +2 -2
- package/dist/doctor-CXFMV6PT.js +2 -0
- package/dist/{editor-chat-MOMQHMO4.js → editor-chat-V24MXQIB.js} +2 -2
- package/dist/{entry-triage-LK34TSQD.js → entry-triage-LZWMMLLN.js} +2 -2
- package/dist/{facts-YVEJOM7O.js → facts-4YPSHIXJ.js} +2 -2
- package/dist/{failure-candidates-ARRMFXRY.js → failure-candidates-RIXA3Y6D.js} +2 -2
- package/dist/heal-HVYQD3EZ.js +2 -0
- package/dist/index.d.ts +256 -6
- package/dist/index.js +2 -2
- package/dist/{ingest-whatsapp-NS4OWDOU.js → ingest-whatsapp-4POCTRTP.js} +2 -2
- package/dist/loader-EVHZ2R73.js +2 -0
- package/dist/loader-KKMG24O5.js +2 -0
- package/dist/memory-extract-MGGXIZTE.js +2 -0
- package/dist/{migrate-v2-V4WN2VVM.js → migrate-v2-5VGHWPBW.js} +2 -2
- package/dist/{ntfy-X7EPB3TG.js → ntfy-ZY2NPGBA.js} +2 -2
- package/dist/processes-CMTMB7LG.js +2 -0
- package/dist/program-ZCFMO4ZD.js +2 -0
- package/dist/{projects-api-QE6L65SK.js → projects-api-E337EQNV.js} +2 -2
- package/dist/{projects-mutate-MY7JTLSZ.js → projects-mutate-S5MY7V3V.js} +2 -2
- package/dist/promote-4T64VW5K.js +2 -0
- package/dist/proposals-O4B5LD5T.js +2 -0
- package/dist/providers-NRPX2FHP.js +2 -0
- package/dist/query-6IKL52WT.js +2 -0
- package/dist/{questions-4B4KSPXG.js → questions-2V2VGIT4.js} +2 -2
- package/dist/recipes-423CIPZ3.js +2 -0
- package/dist/registry-E4QUXHMQ.js +2 -0
- package/dist/{request-planner-PEAYYXAP.js → request-planner-BRLDCYU5.js} +2 -2
- package/dist/{review-candidates-W7NIHNAI.js → review-candidates-QWW5PDUU.js} +2 -2
- package/dist/{review-store-B4YE3EFK.js → review-store-PW3OBGZQ.js} +2 -2
- package/dist/{rotation-memo-QEO3COFH.js → rotation-memo-453FXKHQ.js} +2 -2
- package/dist/routing-DP6S7OJL.js +2 -0
- package/dist/runner-56G3N7M4.js +2 -0
- package/dist/schedule-tool-TPJ6GR47.js +2 -0
- package/dist/scheduler-7QPG6OTY.js +2 -0
- package/dist/seat-3KUNRM5Z.js +2 -0
- package/dist/{select-4XYRIZ5L.js → select-ILXHYJGD.js} +2 -2
- package/dist/shutdown-ZAF7RW25.js +2 -0
- package/dist/store-TWQPEM5V.js +2 -0
- package/dist/{subagent-2SJHSSJS.js → subagent-XY5N7TUU.js} +2 -2
- package/dist/{surface-usage-V2BX4SBD.js → surface-usage-HVVP22SA.js} +2 -2
- package/dist/timers-KK7GF77Y.js +2 -0
- package/dist/{tool-PAQ47HV2.js → tool-SF3BCY55.js} +2 -2
- package/dist/{triage-backtest-JNO7RKX7.js → triage-backtest-DLKYJSEB.js} +2 -2
- package/dist/types-DO3KLIBS.js +2 -0
- package/dist/types-S6NHM5C3.js +2 -0
- package/dist/{whatsapp-state-6D6FHHD2.js → whatsapp-state-LB3R32BK.js} +2 -2
- package/dist/wiki-WETANN3W.js +2 -0
- package/dist/{workspace-setup-G6KGWPHY.js → workspace-setup-42ARC42I.js} +2 -2
- package/package.json +1 -1
- package/dist/agent-RY7Z3IYY.js +0 -2
- package/dist/board-dashboard-RUOASCSQ.js.map +0 -1
- package/dist/calibration-ILS5OI44.js +0 -2
- package/dist/chunk-B5XHX44Y.js +0 -123
- package/dist/chunk-B5XHX44Y.js.map +0 -1
- package/dist/chunk-BYD55JXH.js.map +0 -1
- package/dist/chunk-EMI3VJLH.js +0 -28
- package/dist/chunk-EMI3VJLH.js.map +0 -1
- package/dist/chunk-FIOB3MEX.js +0 -2
- package/dist/chunk-FULEQYM6.js.map +0 -1
- package/dist/chunk-N2XXKFJ6.js +0 -19
- package/dist/chunk-N2XXKFJ6.js.map +0 -1
- package/dist/chunk-Y6I3BYWV.js.map +0 -1
- package/dist/client-JZTH46N2.js +0 -2
- package/dist/config-mutator-T6JGXJ26.js +0 -2
- package/dist/debug-3MEUO2P2.js +0 -2
- package/dist/doctor-2DMGAWMW.js +0 -2
- package/dist/heal-FVLBHYP7.js +0 -2
- package/dist/loader-4ZGTK7LD.js +0 -2
- package/dist/loader-BOKE5M5S.js +0 -2
- package/dist/memory-extract-OWTI6MN5.js +0 -2
- package/dist/processes-KUJJ7XE7.js +0 -2
- package/dist/program-KY5ZYPFN.js +0 -2
- package/dist/promote-57YNOVXV.js +0 -2
- package/dist/proposals-TX2HBBYV.js +0 -2
- package/dist/providers-KO2DODIO.js +0 -2
- package/dist/query-ZT7WXY2F.js +0 -2
- package/dist/recipes-7S4MC5OJ.js +0 -2
- package/dist/registry-LLAFJJN4.js +0 -2
- package/dist/routing-7LCO7UJ7.js +0 -2
- package/dist/runner-YRBVNYTY.js +0 -2
- package/dist/schedule-tool-ZD3VBUBW.js +0 -2
- package/dist/scheduler-GC3FQKXY.js +0 -2
- package/dist/seat-HR6QMAR2.js +0 -2
- package/dist/shutdown-6GCMKYAD.js +0 -2
- package/dist/store-MCOA6N4F.js +0 -2
- package/dist/timers-PCB4ZIBD.js +0 -2
- package/dist/types-H5ENIUIT.js +0 -2
- package/dist/types-OIFU3KSQ.js +0 -2
- package/dist/wiki-EREMPSAE.js +0 -2
- /package/dist/{App-KE4SURSS.js.map → App-QVNQ5BQK.js.map} +0 -0
- /package/dist/{ChatApp-NNHIKXO2.js.map → ChatApp-CC57XC23.js.map} +0 -0
- /package/dist/{agent-RY7Z3IYY.js.map → agent-ILH6ANOM.js.map} +0 -0
- /package/dist/{article-fields-L4D2BOGY.js.map → article-fields-PITN4NHA.js.map} +0 -0
- /package/dist/{article-quality-44ONVGLN.js.map → article-quality-JFJMZWFQ.js.map} +0 -0
- /package/dist/{audit-4245CX6P.js.map → audit-CMJ2TZ3K.js.map} +0 -0
- /package/dist/{backfill-MTD2B62I.js.map → backfill-7TCF4SHG.js.map} +0 -0
- /package/dist/{builtin-B67DMJ3M.js.map → builtin-W6KNX7RS.js.map} +0 -0
- /package/dist/{calibration-ILS5OI44.js.map → calibration-MCCVYGZQ.js.map} +0 -0
- /package/dist/{chunk-3SCPRYJB.js.map → chunk-2AXFYDWF.js.map} +0 -0
- /package/dist/{chunk-4TITGMPX.js.map → chunk-2KQTE4XI.js.map} +0 -0
- /package/dist/{chunk-QDE75R4U.js.map → chunk-6HAZ6YWI.js.map} +0 -0
- /package/dist/{chunk-F4HZTZHW.js.map → chunk-72SZI2UW.js.map} +0 -0
- /package/dist/{chunk-L2WSPY6S.js.map → chunk-7I7IEX4S.js.map} +0 -0
- /package/dist/{chunk-OTW5MPFT.js.map → chunk-CAA546XN.js.map} +0 -0
- /package/dist/{chunk-5XQCGPQJ.js.map → chunk-F7WY24UZ.js.map} +0 -0
- /package/dist/{chunk-ZTEU5JVQ.js.map → chunk-FCPTN6NF.js.map} +0 -0
- /package/dist/{chunk-AJONZWLT.js.map → chunk-FX3D7YON.js.map} +0 -0
- /package/dist/{chunk-5ALS7SVV.js.map → chunk-H2TWRZC2.js.map} +0 -0
- /package/dist/{chunk-WPMX3VGI.js.map → chunk-J3SOEFRE.js.map} +0 -0
- /package/dist/{chunk-4NBWF4TL.js.map → chunk-JQR3NTHI.js.map} +0 -0
- /package/dist/{chunk-OUZ7YVQZ.js.map → chunk-KFALP5NO.js.map} +0 -0
- /package/dist/{chunk-WQLBJ2O5.js.map → chunk-PSDCRZZM.js.map} +0 -0
- /package/dist/{chunk-FIOB3MEX.js.map → chunk-QIJLFPWE.js.map} +0 -0
- /package/dist/{chunk-PZCTCCC5.js.map → chunk-QP6XNTBB.js.map} +0 -0
- /package/dist/{chunk-BH3GTCZ6.js.map → chunk-RGDKHYY2.js.map} +0 -0
- /package/dist/{chunk-JVNFRS26.js.map → chunk-ROCUOXCW.js.map} +0 -0
- /package/dist/{chunk-K33GIBSE.js.map → chunk-SIU6STB2.js.map} +0 -0
- /package/dist/{chunk-LCIREYTD.js.map → chunk-SZJMS7K4.js.map} +0 -0
- /package/dist/{chunk-AJ5RMU7X.js.map → chunk-TFVUOC2C.js.map} +0 -0
- /package/dist/{chunk-NLZD2QKF.js.map → chunk-VMS3HVTT.js.map} +0 -0
- /package/dist/{chunk-TUNQFPVA.js.map → chunk-WCMQRSVU.js.map} +0 -0
- /package/dist/{chunk-OHA3J5ZV.js.map → chunk-WDQ3BPFS.js.map} +0 -0
- /package/dist/{chunk-6VKCUMCN.js.map → chunk-WKTFP3SK.js.map} +0 -0
- /package/dist/{chunk-Q7C3X3R6.js.map → chunk-WP6KLXTP.js.map} +0 -0
- /package/dist/{chunk-IXUEJBHD.js.map → chunk-XZTR5MBJ.js.map} +0 -0
- /package/dist/{chunk-W5C2GDNC.js.map → chunk-Y57CULGE.js.map} +0 -0
- /package/dist/{client-JZTH46N2.js.map → client-I7GAAM3T.js.map} +0 -0
- /package/dist/{compaction-PIZINFHR.js.map → compaction-NWPBPWY2.js.map} +0 -0
- /package/dist/{config-R47ITLIY.js.map → config-TVW7UCKG.js.map} +0 -0
- /package/dist/{config-mutator-T6JGXJ26.js.map → config-mutator-JHM53P5A.js.map} +0 -0
- /package/dist/{conflict-detector-ZPOT3M2C.js.map → conflict-detector-KS7OSS45.js.map} +0 -0
- /package/dist/{context-planner-FJMU5WAT.js.map → context-planner-LJT5IKH6.js.map} +0 -0
- /package/dist/{debug-3MEUO2P2.js.map → debug-FTAGG7MN.js.map} +0 -0
- /package/dist/{discover-D4VVRNAI.js.map → discover-7YFQNYLC.js.map} +0 -0
- /package/dist/{doctor-2DMGAWMW.js.map → doctor-CXFMV6PT.js.map} +0 -0
- /package/dist/{editor-chat-MOMQHMO4.js.map → editor-chat-V24MXQIB.js.map} +0 -0
- /package/dist/{entry-triage-LK34TSQD.js.map → entry-triage-LZWMMLLN.js.map} +0 -0
- /package/dist/{facts-YVEJOM7O.js.map → facts-4YPSHIXJ.js.map} +0 -0
- /package/dist/{failure-candidates-ARRMFXRY.js.map → failure-candidates-RIXA3Y6D.js.map} +0 -0
- /package/dist/{heal-FVLBHYP7.js.map → heal-HVYQD3EZ.js.map} +0 -0
- /package/dist/{ingest-whatsapp-NS4OWDOU.js.map → ingest-whatsapp-4POCTRTP.js.map} +0 -0
- /package/dist/{loader-4ZGTK7LD.js.map → loader-EVHZ2R73.js.map} +0 -0
- /package/dist/{loader-BOKE5M5S.js.map → loader-KKMG24O5.js.map} +0 -0
- /package/dist/{memory-extract-OWTI6MN5.js.map → memory-extract-MGGXIZTE.js.map} +0 -0
- /package/dist/{migrate-v2-V4WN2VVM.js.map → migrate-v2-5VGHWPBW.js.map} +0 -0
- /package/dist/{ntfy-X7EPB3TG.js.map → ntfy-ZY2NPGBA.js.map} +0 -0
- /package/dist/{processes-KUJJ7XE7.js.map → processes-CMTMB7LG.js.map} +0 -0
- /package/dist/{program-KY5ZYPFN.js.map → program-ZCFMO4ZD.js.map} +0 -0
- /package/dist/{projects-api-QE6L65SK.js.map → projects-api-E337EQNV.js.map} +0 -0
- /package/dist/{projects-mutate-MY7JTLSZ.js.map → projects-mutate-S5MY7V3V.js.map} +0 -0
- /package/dist/{promote-57YNOVXV.js.map → promote-4T64VW5K.js.map} +0 -0
- /package/dist/{proposals-TX2HBBYV.js.map → proposals-O4B5LD5T.js.map} +0 -0
- /package/dist/{providers-KO2DODIO.js.map → providers-NRPX2FHP.js.map} +0 -0
- /package/dist/{query-ZT7WXY2F.js.map → query-6IKL52WT.js.map} +0 -0
- /package/dist/{questions-4B4KSPXG.js.map → questions-2V2VGIT4.js.map} +0 -0
- /package/dist/{recipes-7S4MC5OJ.js.map → recipes-423CIPZ3.js.map} +0 -0
- /package/dist/{registry-LLAFJJN4.js.map → registry-E4QUXHMQ.js.map} +0 -0
- /package/dist/{request-planner-PEAYYXAP.js.map → request-planner-BRLDCYU5.js.map} +0 -0
- /package/dist/{review-candidates-W7NIHNAI.js.map → review-candidates-QWW5PDUU.js.map} +0 -0
- /package/dist/{review-store-B4YE3EFK.js.map → review-store-PW3OBGZQ.js.map} +0 -0
- /package/dist/{rotation-memo-QEO3COFH.js.map → rotation-memo-453FXKHQ.js.map} +0 -0
- /package/dist/{routing-7LCO7UJ7.js.map → routing-DP6S7OJL.js.map} +0 -0
- /package/dist/{runner-YRBVNYTY.js.map → runner-56G3N7M4.js.map} +0 -0
- /package/dist/{schedule-tool-ZD3VBUBW.js.map → schedule-tool-TPJ6GR47.js.map} +0 -0
- /package/dist/{scheduler-GC3FQKXY.js.map → scheduler-7QPG6OTY.js.map} +0 -0
- /package/dist/{seat-HR6QMAR2.js.map → seat-3KUNRM5Z.js.map} +0 -0
- /package/dist/{select-4XYRIZ5L.js.map → select-ILXHYJGD.js.map} +0 -0
- /package/dist/{shutdown-6GCMKYAD.js.map → shutdown-ZAF7RW25.js.map} +0 -0
- /package/dist/{store-MCOA6N4F.js.map → store-TWQPEM5V.js.map} +0 -0
- /package/dist/{subagent-2SJHSSJS.js.map → subagent-XY5N7TUU.js.map} +0 -0
- /package/dist/{surface-usage-V2BX4SBD.js.map → surface-usage-HVVP22SA.js.map} +0 -0
- /package/dist/{timers-PCB4ZIBD.js.map → timers-KK7GF77Y.js.map} +0 -0
- /package/dist/{tool-PAQ47HV2.js.map → tool-SF3BCY55.js.map} +0 -0
- /package/dist/{triage-backtest-JNO7RKX7.js.map → triage-backtest-DLKYJSEB.js.map} +0 -0
- /package/dist/{types-H5ENIUIT.js.map → types-DO3KLIBS.js.map} +0 -0
- /package/dist/{types-OIFU3KSQ.js.map → types-S6NHM5C3.js.map} +0 -0
- /package/dist/{whatsapp-state-6D6FHHD2.js.map → whatsapp-state-LB3R32BK.js.map} +0 -0
- /package/dist/{wiki-EREMPSAE.js.map → wiki-WETANN3W.js.map} +0 -0
- /package/dist/{workspace-setup-G6KGWPHY.js.map → workspace-setup-42ARC42I.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,i as d,j as e}from"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-
|
|
2
|
-
//# sourceMappingURL=builtin-
|
|
1
|
+
import{a,b,c,i as d,j as e}from"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-QIJLFPWE.js";export{e as _resetBuiltinsForTesting,a as getBuiltin,b as listBuiltins,d as registerAllBuiltins,c as runBuiltin};
|
|
2
|
+
//# sourceMappingURL=builtin-W6KNX7RS.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";l();export{a as agreement,h as applyTemperature,j as bootstrapInterval,e as brier,k as calibrationReport,g as coverageCurve,c as ece,i as fitTemperature,f as logLoss,d as mce,b as reliabilityBins};
|
|
2
|
+
//# sourceMappingURL=calibration-MCCVYGZQ.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as y,f as k}from"./chunk-
|
|
1
|
+
import{a as y,f as k}from"./chunk-72SZI2UW.js";k();var v="article-fields",w=["foundation","pillar","walls","openings","furniture"],c={foundation:0,pillar:1,walls:2,openings:3,furniture:4},R={foundation:"what the thing is \u2014 without it the article is about nothing",pillar:"the facts the article exists to carry \u2014 without them it cannot be acted on",walls:"what it connects to \u2014 people, projects, systems, status",openings:"how to work with it \u2014 access conventions, language, ownership",furniture:"history and colour \u2014 useful, replaceable, last"};function f(e){return e.tier==="foundation"||e.tier==="pillar"}var l=[{key:"whatItIs",tier:"foundation",label:"what it is, in its own terms",question:"Does the article say what the subject is, in its own terms?"},{key:"whyItMatters",tier:"walls",label:"why it matters to our work",question:"Does the article say why the subject matters to our work?"},{key:"relationships",tier:"walls",label:"which named people, projects or systems it connects to",question:"Does the article connect the subject to specific named people, projects or systems?"}],q={person:[...l,{key:"role",tier:"pillar",label:"role or job title",question:"Does the article state this person's role or job title?"},{key:"organisation",tier:"pillar",label:"organisation or team, and their position in it",question:"Does the article name the organisation or team this person belongs to?"},{key:"contactValue",tier:"pillar",label:'contact identifiers VERBATIM \u2014 the actual values, not "reaches us on WhatsApp"',question:"Does the article give an actual contact value \u2014 a number, handle, email or address \u2014 rather than only naming a channel?"},{key:"language",tier:"openings",label:"preferred language",question:"Does the article say what language to use with this person?"},{key:"ourOwner",tier:"openings",label:"who on our side owns the relationship",question:"Does the article say who on our side owns this relationship?"}],place:[...l,{key:"address",tier:"pillar",label:"hostname, IP, URL or path",question:"Does the article give a hostname, IP, URL or filesystem path for this system?"},{key:"access",tier:"pillar",label:"how access is obtained",question:"Does the article say how access is obtained?"},{key:"runsWhat",tier:"walls",label:"what runs on or is stored in it",question:"Does the article say what runs on or is stored in this system?"},{key:"administrator",tier:"walls",label:"who administers it",question:"Does the article say who administers it?"}],project:[...l,{key:"oneLine",tier:"foundation",label:"what it is, in one line",question:"Does the article describe in one line what the project delivers?"},{key:"ownerClient",tier:"pillar",label:"client or internal owner",question:"Does the article name the client or internal owner?"},{key:"locations",tier:"pillar",label:"repository, environment and URLs",question:"Does the article give a repository, environment or URL for it?"},{key:"status",tier:"walls",label:"current status",question:"Does the article state the project's current status?"},{key:"people",tier:"walls",label:"who works on it",question:"Does the article name who works on it?"}],concept:[...l,{key:"definition",tier:"foundation",label:"a one-line definition, first",question:"Does the article open with a one-line definition of the concept?"},{key:"whenApplies",tier:"walls",label:"when it applies",question:"Does the article say when this concept applies?"}],pattern:[...l,{key:"definition",tier:"foundation",label:"a one-line statement of the pattern, first",question:"Does the article open with a one-line statement of the pattern?"},{key:"whenApplies",tier:"pillar",label:"when to apply it",question:"Does the article say when to apply it?"},{key:"whatToDo",tier:"pillar",label:"what to actually do",question:"Does the article say what to actually do?"}],event:[...l,{key:"when",tier:"foundation",label:"the date it happened",question:"Does the article give the date the event happened?"},{key:"outcome",tier:"pillar",label:"what changed as a result",question:"Does the article say what changed as a result?"},{key:"who",tier:"walls",label:"who was involved",question:"Does the article name who was involved?"}],decision:[...l,{key:"what",tier:"foundation",label:"what was decided",question:"Does the article state plainly what was decided?"},{key:"why",tier:"pillar",label:"the reasoning behind it",question:"Does the article give the reasoning behind the decision?"},{key:"when",tier:"walls",label:"when it was decided",question:"Does the article say when it was decided?"},{key:"consequence",tier:"walls",label:"what it changed",question:"Does the article say what the decision changed?"}]},E={contactValue:{heading:"Contact identifiers",match:/contact|reach|phone|whatsapp|e-?mail/i},organisation:{heading:"Organisation and position",match:/organis|organiz|company|employer|team and/i},role:{heading:"Role or job title",match:/role|job title/i},language:{heading:"Preferred language",match:/language/i},ourOwner:{heading:"Relationship owner",match:/relationship owner|owns the relationship|our owner/i},address:{heading:"Address",match:/hostname|address|url|path/i},access:{heading:"Access",match:/access|credential|how to get in/i},administrator:{heading:"Administrator",match:/administrat|maintained by|who runs/i},ownerClient:{heading:"Client or owner",match:/client|owner/i},status:{heading:"Status",match:/status/i},locations:{heading:"Repository and environments",match:/repositor|environment|url/i}},j={contactValue:{heading:"Contact identifiers",match:/contact|reach|phone|whatsapp|e-?mail/i,from:["phone","whatsapp","email","gitlab"]},organisation:{heading:"Organisation and position",match:/organis|organiz|company|employer|team and/i,from:["organisation"]},role:{heading:"Role or job title",match:/role|job title/i,from:["role"]}},A=["contactValue","organisation","role"],D={contactValue:["wacli","gog","gitlab"],organisation:["gog","gitlab","erp"],role:["gog","gitlab"],locations:["gitlab"],address:["gitlab"],ownerClient:["erp"]};function d(e){return q[e??""]??l}function T(e){return[...d(e)].sort((n,o)=>c[n.tier]-c[o.tier])}function I(e){let n={};for(let o of d(e))n[o.key]=y(o.question);return n}function F(e,n=12e3){let o=String(e.body??"").trim();return{title:e.title,type:e.type??null,body:o.length>n?`${o.slice(0,n)}
|
|
2
2
|
\u2026[truncated]`:o}}function C(e,n,o={}){let a=o.low??.3,u=o.high??.7,s=d(e),t=[],r=[],h=[];for(let i of s){let g=n[i.key]?.noul;if(g===void 0){h.push(i.key);continue}g>u?t.push(i.key):g<=a?r.push(i.key):h.push(i.key)}let p=Object.fromEntries(w.map(i=>[i,[]]));for(let i of s)r.includes(i.key)&&p[i.tier].push(i.key);let m=s.filter(i=>f(i)&&r.includes(i.key)).map(i=>i.key),b=w.find(i=>p[i].length>0)??null;return{type:e??"?",present:t,missing:r,unclear:h,missingCritical:m,missingByTier:p,worstTier:b,coverage:s.length?t.length/s.length:0,fit:m.length===0}}function L(e,n={}){let o=new Map(d(e.type==="?"?void 0:e.type).map(t=>[t.key,t])),a=n.maxTier?c[n.maxTier]:c.furniture,u=[...e.missing,...n.includeUnclear?e.unclear:[]],s=[];for(let t of u){let r=o.get(t);if(!r||c[r.tier]>a)continue;let h=D[t]??[];s.push({field:t,label:r.label,tier:r.tier,sources:h,needsHuman:h.length===0,uncertain:e.unclear.includes(t)})}return s.sort((t,r)=>c[t.tier]-c[r.tier]||Number(t.needsHuman)-Number(r.needsHuman)||t.field.localeCompare(r.field))}function S(){let e=["person","project","place","concept","pattern","event","decision"],n=new Set(l.map(a=>a.key)),o=a=>{if(a.includes("**"))throw new Error(`field label must not carry its own emphasis: ${a}`);return`**${a}**`};return e.map(a=>{let s=T(a).filter(t=>!n.has(t.key)).map(t=>f(t)?o(t.label):t.label);return`- **${a}** \u2014 ${s.join("; ")}.`}).join(`
|
|
3
3
|
`)}function O(){return w.map((e,n)=>`${n+1}. **${e}** \u2014 ${R[e]}`).join(`
|
|
4
4
|
`)}export{v as a,w as b,c,R as d,f as e,q as f,E as g,j as h,A as i,D as j,d as k,T as l,I as m,F as n,C as o,L as p,S as q,O as r};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-2AXFYDWF.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as D,b as _}from"./chunk-RKPAVWXF.js";import{a as q,b as O,c as R,d as B,f as b,g as S,h as E,i as w,j as y}from"./chunk-
|
|
1
|
+
import{a as D,b as _}from"./chunk-RKPAVWXF.js";import{a as q,b as O,c as R,d as B,f as b,g as S,h as E,i as w,j as y}from"./chunk-F7WY24UZ.js";import{a as T,b as C,c as I,d as x,e as P}from"./chunk-VMS3HVTT.js";import{existsSync as X,readFileSync as F}from"fs";var J=new Set(["cron","heartbeat","api","a2a","mesh"]),M=160;function s(n){return typeof n=="string"&&n.trim()?n.trim():void 0}function A(n,e=M){let t=n.replace(/\s+/g," ").trim();return t.length>e?`${t.slice(0,e-1)}\u2026`:t}function V(n){let e=T(n);if(!X(e))throw new Error(`config not found at ${e}`);return JSON.parse(F(e,"utf-8"))}function W(n,e){return n?.agents?.[e]?.admin===!0}function Y(n,e,t){return W(n,t.agentId)||e?.createdBy===t.agentId}function Z(n,e){let t=e?.createdBy?`agent "${e.createdBy}"`:"the operator";return`Not allowed: "${n}" was created by ${t}. Agents manage only schedules they created (unless configured admin).`}function K(n,e){let t=s(n.notify);if(t!=="none"){if(t&&t!=="here"){let r=t.split(":");return r.length<2||!r[0]||!r[1]?"invalid":{channel:r[0],chatId:r.slice(1).join(":")}}if(e.channel&&e.chatId&&!J.has(e.channel))return{channel:e.channel,chatId:e.chatId,...e.accountId?{accountId:e.accountId}:{}}}}function Q(n,e,t){let r=e.timezone||"UTC",u=e.enabled&&!y(e)?w(E(e.schedule,r,t),r):"\u2014",h=e.approval?`pending ${e.approval.action} approval`:e.enabled?"active":"paused",p=[`- ${n} [${h}] ${e.schedule} \u2014 ${S(e.schedule)} (${r})`,` agent: ${e.agent}; created by: ${e.createdBy||"operator"}; next: ${u}`];return e.notify&&p.push(` notify: ${e.notify.channel} ${e.notify.chatId}`),e.command?p.push(` command: ${A(String(e.command))}`):e.prompt&&p.push(` prompt: ${A(String(e.prompt))}`),p.join(`
|
|
2
2
|
`)}async function k(n,e,t){let r=n?.notifications?.destination;if(!r?.channel||!r?.chatId)return"No operator notification destination is configured (notifications.destination); the operator must check `agentx schedule list`.";if(!e.notifyOperator)return"Operator notification is unavailable in this context.";try{return await e.notifyOperator({channel:r.channel,chatId:r.chatId,accountId:r.accountId},t),"The operator has been notified."}catch(u){return`Could not notify the operator (${u?.message??u}); the request is still recorded.`}}async function re(n,e,t={}){let r=(s(n.action)||"list").toLowerCase(),u=t.now?t.now():new Date,h;try{h=V(t.configPath)}catch(a){return`Error: ${a.message}`}let p=h.crons||{};if(r==="list"){let a=n.mine===!0,l=Object.entries(p).filter(([,i])=>!a||e&&i?.createdBy===e.agentId);return l.length?l.map(([i,f])=>Q(i,f,u)).join(`
|
|
3
3
|
`):a?"You have no schedules.":"No schedules."}if(!e?.agentId)return"Error: caller agent is unknown (AGENTX_AGENT_ID not set). Pass callerAgentId.";if(!h.agents?.[e.agentId])return`Error: caller "${e.agentId}" is not an agent on this node.`;let o=s(n.id),m=a=>C(a,{configPath:t.configPath,reload:t.reload});if(r==="create"){let a=s(n.when),l=s(n.prompt);if(!a||!l)return"Error: create needs `when` (plain English) and `prompt`.";let i=D(a);if(!i)return`Error: couldn't parse "${a}". ${O}.`;let f=s(n.agent)||e.agentId;if(!h.agents?.[f])return`Error: agent "${f}" not found on this node.`;let g=s(n.timezone)||q;if(!B(g))return`Error: unknown timezone "${g}".`;let d=o||_(i.matched,f);if(!R(d))return`Error: invalid id "${d}" (letters, digits, "-" and "_" only).`;if(p[d])return`Error: a schedule "${d}" already exists. Pick another \`id\`.`;let $=K(n,e);if($==="invalid")return'Error: `notify` must be "here", "none", or "channel:chatId".';let z={action:"create",requestedBy:e.agentId,requestedAt:u.toISOString()},L=b({parsed:i,agent:f,prompt:l,timezone:g,notify:$,enabled:!1,createdBy:e.agentId,approval:z}),v=await m(U=>I(U,`crons.${d}`,L));if(!v.success)return`Error: ${v.error}`;let N=w(E(i.cron,g,u),g),G=[`Schedule approval requested by ${e.agentId}`,`Create: ${d}`,`When: ${i.human} \u2014 cron \`${i.cron}\` (${g})`,`Next fire: ${N}`,`Agent: ${f}`,$?`Notify: ${$.channel} ${$.chatId}`:"Notify: none",`Prompt: ${A(l,400)}`,"",`Approve: agentx schedule approve ${d}`,`Reject: agentx schedule reject ${d}`].join(`
|
|
4
4
|
`),H=await k(h,t,G);return[`Requested schedule "${d}": ${i.human} (cron ${i.cron}, ${g}); next fire would be ${N}.`,"It is saved DISABLED and will not run until the operator approves it.",H].join(`
|
|
5
5
|
`)}if(!o)return`Error: ${r} needs \`id\`.`;let c=p[o];if(!c)return`Error: schedule "${o}" not found.`;if(!Y(h,c,e))return Z(o,c);if(r==="pause"||r==="resume"){let a=r==="resume";if(a&&y(c))return`"${o}" is still awaiting operator approval; it can't be resumed until approved.`;if(c.enabled===a)return`"${o}" is already ${a?"active":"paused"}.`;let l=await m(i=>I(i,`crons.${o}.enabled`,a));return l.success?`"${o}" ${a?"resumed":"paused"}.`:`Error: ${l.error}`}if(r==="delete"){if(y(c)&&c.approval.requestedBy===e.agentId){let d=await m($=>P($,`crons.${o}`));return d.success?`Withdrew the pending request "${o}".`:`Error: ${d.error}`}if(y(c))return`"${o}" is a creation request still awaiting approval; only its requester or the operator (\`agentx schedule reject ${o}\`) can drop it.`;if(c.approval?.action==="delete")return`Deletion of "${o}" is already awaiting approval.`;let a={action:"delete",requestedBy:e.agentId,requestedAt:u.toISOString()},l=await m(d=>{if(!x(d,`crons.${o}`))throw new Error(`schedule "${o}" not found`);I(d,`crons.${o}.approval`,a)});if(!l.success)return`Error: ${l.error}`;let i=c.timezone||"UTC",f=[`Schedule approval requested by ${e.agentId}`,`Delete: ${o}`,`When: ${S(c.schedule)} \u2014 cron \`${c.schedule}\` (${i})`,`Next fire: ${c.enabled?w(E(c.schedule,i,u),i):"\u2014 (paused)"}`,`Agent: ${c.agent}`,"",`Approve: agentx schedule approve ${o}`,`Reject: agentx schedule reject ${o}`].join(`
|
|
6
6
|
`),g=await k(h,t,f);return[`Deletion of "${o}" requested. It keeps its current state until the operator approves.`,g].join(`
|
|
7
7
|
`)}return`Error: unknown action "${r}". Use list, create, pause, resume or delete.`}function oe(n,e=process.env){let t=s(e.AGENTX_AGENT_ID)||s(n.callerAgentId);if(!t)return null;let r=!!(s(e.AGENTX_CHANNEL)&&s(e.AGENTX_CHAT_ID)),u=s(r?e.AGENTX_CHANNEL:n.channel),h=s(r?e.AGENTX_CHAT_ID:n.chatId),p=s(n.accountId);return{agentId:t,channel:u,chatId:h,...p?{accountId:p}:{}}}export{re as a,oe as b};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-2KQTE4XI.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as R,b as j,c as O,d as W,e as D}from"./chunk-
|
|
1
|
+
import{a as R,b as j,c as O,d as W,e as D}from"./chunk-TFVUOC2C.js";import{b as C}from"./chunk-2GIDVZ4H.js";import{v,w as Q}from"./chunk-JQR3NTHI.js";import{b as $,c as M}from"./chunk-QOYAX2FT.js";import{readFileSync as T,existsSync as _}from"fs";Q();import{resolve as b}from"path";import{execSync as Y}from"child_process";async function V(n,i,s,e={}){let d=e.selectorModel??"haiku",a=e.synthModel??"sonnet",c=e.maxCandidates??3,l=e.maxHops??2,r=e.maxArticles??8,p=e.timeoutMs??6e4,u=e.log??console.error.bind(console,"[wiki-query]"),h=b(i.baseDir,"_index.md");if(!_(h))return w("no-catalog",n,"No _index.md found \u2014 run `agentx wiki status` to rebuild.");let k=T(h,"utf-8"),t=Date.now(),g=[],m="";try{let o=await B(n,i,s,c);o?(g=o,m=`[wiki-rerank seat] ${o.map(y=>y.title).join(" | ")}`):(m=await N(I(n,k,c),d,p),g=F(m))}catch(o){return u("selector failed:",o?.message),{...w("error",n,`Selector: ${o?.message||"unknown"}`),trace:{selectorMs:Date.now()-t,synthesisMs:0,selectorOutput:m}}}let A=Date.now()-t;if(g.length===0)return{...w("no-candidates",n,"Selector returned no candidates."),trace:{selectorMs:A,synthesisMs:0,selectorOutput:m}};let f=E(g,i,s,l,r);if(f.length===0)return{...w("no-candidates",n,"Candidates did not resolve to readable articles."),candidates:g,trace:{selectorMs:A,synthesisMs:0,selectorOutput:m}};let S=Date.now(),x="";try{x=await N(L(n,f),a,p*2)}catch(o){return u("synthesis failed:",o?.message),{...w("error",n,`Synthesis: ${o?.message||"unknown"}`),candidates:g,walked:f.map(y=>({title:y.meta.title,path:y.path,type:y.meta.type,hop:y.hop??0})),trace:{selectorMs:A,synthesisMs:Date.now()-S,selectorOutput:m}}}let P=Date.now()-S;return{answer:x.trim(),citations:f.map(o=>({title:o.meta.title,path:o.path,type:o.meta.type})),candidates:g,walked:f.map(o=>({title:o.meta.title,path:o.path,type:o.meta.type,hop:o.hop??0})),status:"ok",trace:{selectorMs:A,synthesisMs:P,selectorOutput:m}}}function w(n,i,s){return{answer:"",citations:[],candidates:[],walked:[],status:n,error:s}}function E(n,i,s,e,d){let a=new Map;for(let r of i.listArticles(s||""))a.set(r.meta.title.toLowerCase(),r.path);let c=new Map,l=[];for(let r of n)c.has(r.path)||l.push({path:r.path,hop:0});for(;l.length&&c.size<d;){let r=l.shift();if(c.has(r.path)||r.hop>e)continue;let p=s?i.readArticleAs(r.path,s):i.readArticle(r.path);if(p&&(c.set(r.path,{...p,hop:r.hop}),!(r.hop>=e)))for(let u of p.meta.related||[]){let h=a.get(u.toLowerCase());h&&!c.has(h)&&l.push({path:h,hop:r.hop+1})}}return Array.from(c.values())}async function B(n,i,s,e){try{let a=(i.rebuildIndex().articles??[]).filter(t=>t.path&&!t.path.includes("/_versions/"));if(a.length<2)return null;let c=a.map(t=>[t.title,(t.tags??[]).join(" "),(t.related??[]).join(" ")].join(" ")),l=M(n,$(c)).map(t=>t.docIndex);for(let t=0;t<a.length;t++)l.includes(t)||l.push(t);let p=l.slice(0,j).map(t=>({id:`k${t}`,title:a[t].title||a[t].path,tags:a[t].tags,excerpt:[a[t].type?`type: ${a[t].type}`:"",(a[t].related??[]).length?`related: ${(a[t].related??[]).join(", ")}`:""].filter(Boolean).join(" \xB7 ")})),u=await v(R,O({query:n,candidates:p,excerptChars:300}),W(p),{features:{agent:s??"unknown",stage:"catalog-selector"}});if(!u||u.mode!=="active")return null;let k=D(u.answers,p).ranked.slice(0,e).map(t=>a[Number(t.slice(1))]).filter(Boolean).map(t=>({title:t.title,path:t.path}));return k.length>0?k:null}catch{return null}}function I(n,i,s){return`You are picking candidate articles from a wiki catalog to answer a question. You do NOT answer the question. You pick which articles the answer is likely to come from.
|
|
2
2
|
|
|
3
3
|
## Question
|
|
4
4
|
|
|
@@ -42,4 +42,4 @@ ${s}
|
|
|
42
42
|
Answer the question in 2\u20136 sentences. Cite articles by their title in square brackets like [Article Title]. If the articles do not answer the question, say so plainly (do not invent). Prefer concrete facts over hedging.
|
|
43
43
|
|
|
44
44
|
Output ONLY the answer \u2014 no preamble, no "here is my answer:", no markdown fencing.`}function F(n){let i=n.match(/\[[\s\S]*?\]/);if(!i)return[];try{let s=JSON.parse(i[0]);return Array.isArray(s)?s.filter(e=>e&&typeof e.title=="string"&&typeof e.path=="string").map(e=>({title:e.title,path:e.path})):[]}catch{return[]}}async function N(n,i,s){let{writeFileSync:e,mkdirSync:d,rmSync:a}=await import("fs"),{tmpdir:c}=await import("os"),l=b(c(),`agentx-wiki-query-${process.pid}`);d(l,{recursive:!0});let r=b(l,`prompt-${Date.now()}.txt`);e(r,n);try{let p=`cat '${r}' | claude -p - --output-format json --max-turns 1 --model ${i} --disallowedTools "Bash Read Write Edit Glob Grep Agent WebSearch WebFetch NotebookEdit"`,u=Y(p,{env:C({...process.env}),encoding:"utf-8",timeout:s,maxBuffer:4*1024*1024});try{let h=JSON.parse(u);return String(h.result||h.content||"")}catch{return u}}finally{try{a(r,{force:!0})}catch{}}}export{V as a};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-6HAZ6YWI.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-QIJLFPWE.js";function l(e,t){return{...{type:"noul"},...e?{instructions:e}:{},...t?{criteria:t}:{}}}function u(e,t){let o=Object.keys(e);if(o.length<2)throw new Error(`choice() needs at least 2 options, got ${o.length}`);if(o.length>255)throw new Error(`choice() supports at most 255 options (Jev's cap), got ${o.length} \u2014 narrow the set first, or split into two stages`);return{type:"choice",...t?{instructions:t}:{},criteria:e}}function a(e,t){if(e.length<2)throw new Error(`score() needs at least 2 rubric levels, got ${e.length}`);return{type:"score",...t?{instructions:t}:{},criteria:e}}function p(e){return e.type==="choice"?Object.keys(e.criteria):e.type==="score"?e.criteria.map((t,o)=>String(o)):[]}function h(e){let t=Object.keys(e);if(t.length===0)throw new Error("at least one question is required");for(let o of t){let n=e[o];if(n.type==="choice"){let r=Object.keys(n.criteria).length;if(r<2)throw new Error(`question "${o}": choice needs at least 2 options, got ${r}`);if(r>255)throw new Error(`question "${o}": choice has ${r} options, over the 255 cap`)}else if(n.type==="score"&&n.criteria.length<2)throw new Error(`question "${o}": score needs at least 2 rubric levels, got ${n.criteria.length}`)}}var c,i=s(()=>{"use strict";c=255});export{l as a,u as b,a as c,p as d,h as e,i as f};
|
|
2
|
+
//# sourceMappingURL=chunk-72SZI2UW.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-QIJLFPWE.js";import n from"chalk";var c,l=e(()=>{"use strict";c={error(...o){console.log(n.red(...o))},warn(...o){console.log(n.yellow(...o))},info(...o){console.log(n.cyan(...o))},success(...o){console.log(n.green(...o))},break(){console.log("")}}});export{c as a,l as b};
|
|
2
|
+
//# sourceMappingURL=chunk-7I7IEX4S.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{g as S,h as j,o as O,p as I}from"./chunk-
|
|
1
|
+
import{g as S,h as j,o as O,p as I}from"./chunk-S7CVSKOX.js";import{m as A,p as T}from"./chunk-SRCXUZM2.js";T();import{Command as _}from"commander";import f from"chalk";import{execFileSync as h}from"child_process";import{accessSync as q,constants as z,existsSync as y,readFileSync as k,readdirSync as x,statSync as B}from"fs";import{join as E,resolve as m}from"path";import{homedir as M}from"os";import{createRequire as X}from"module";import{execFile as D}from"child_process";var L=(n,t)=>new Promise(e=>{try{D(n,t,{timeout:5e3},(i,s)=>e(i?null:String(s)))}catch{e(null)}}),R="Open System Settings \u203A Notifications \u203A AgentX Helper, turn on Allow notifications and choose Banners.";async function N(n={}){if((n.platform??process.platform)!=="darwin")return{state:"unsupported",message:"Desktop banners are only shown on a Mac."};let t=n.helper===void 0?I():n.helper;if(!t)return{state:"missing",message:"AgentX Helper is not installed, so banners come from Script Editor and show its icon.",fix:'Run agentx desktop install, then run agentx notify "Hello" --title "Test" and click Allow.'};let e=await(n.run??L)(t,["notify-status"]),i=null;try{i=e?JSON.parse(e):null}catch{i=null}return i?i.authorization==="notDetermined"?{state:"not-asked",path:t,message:"macOS has not asked yet whether AgentX Helper may notify; banners show the Script Editor icon until it does.",fix:'Run agentx notify "Hello" --title "Test" and click Allow when macOS asks.'}:i.authorization==="denied"?{state:"not-allowed",path:t,message:"macOS does not allow AgentX Helper to notify, so banners show the Script Editor icon.",fix:R}:i.alertStyle==="none"?{state:"hidden",path:t,message:"AgentX Helper may notify, but its banner style is None, so nothing appears on screen.",fix:R}:{state:"ready",path:t,message:"AgentX Helper posts banners with the AgentX icon."}:{state:"outdated",path:t,message:"AgentX Helper is too old to report whether it may notify.",fix:"Run agentx desktop install to update it."}}async function J(n={}){let t=[];await Z(t),G(t);let e=V(t);return e&&K(t,e),e&&U(t,e),e&&Q(t,e),e&&Y(t,e),e&&te(t,e),e&&await F(t,e),n.running!==!1&&e&&await ee(t,e),{checks:t,summary:P(t)}}var ye=new _().name("doctor").description("pre-flight health check: Node, config, credentials, daemon").option("--no-running","skip the live daemon probe").option("--json","emit machine-readable JSON (stable shape for CI)").action(async n=>{let{checks:t,summary:e}=await J({running:n.running!==!1});n.json?process.stdout.write(JSON.stringify({checks:t,summary:e},null,2)+`
|
|
2
2
|
`):ne(t),process.exit(e.errors>0?1:0)});async function F(n,t,e=N){if(!O(t.notifications?.local).banner)return;let i=await e();i.state!=="unsupported"&&n.push({severity:i.state==="ready"?"ok":"warn",group:"Notifications",title:i.message,detail:i.path,fix:i.fix})}async function Z(n){let t=Number(process.versions.node.split(".")[0]);n.push({severity:t==22?"ok":"fail",group:"Environment",title:`Node.js ${process.versions.node}`,detail:t==22?void 0:"AgentX requires Node 22.x.",fix:t==22?void 0:"Install Node 22 (nvm install 22 && nvm use 22)"});let e=a=>{try{return h(process.platform==="win32"?"where":"which",[a],{encoding:"utf-8"}).trim().split(`
|
|
3
3
|
`)[0]}catch{return null}},i=e("npm");n.push({severity:i?"ok":"fail",group:"Environment",title:i?"npm on PATH":"npm not found",detail:i||void 0});let s=e("claude");if(s){let a;try{a=h("claude",["--version"],{encoding:"utf-8",timeout:3e3}).trim()}catch{}n.push({severity:"ok",group:"Environment",title:`claude CLI ${a||"installed"}`,detail:s})}else n.push({severity:"warn",group:"Environment",title:"claude CLI not on PATH",detail:"Only required for agents on the claude-code tier.",fix:"See https://docs.anthropic.com/en/docs/claude-code"});let r=e("codex");if(r){let a;try{a=h("codex",["--version"],{encoding:"utf-8",timeout:3e3}).trim()}catch{}n.push({severity:"ok",group:"Environment",title:`codex CLI ${a||"installed"}`,detail:r})}else n.push({severity:"warn",group:"Environment",title:"codex CLI not on PATH",detail:"Only required for agents on the codex-cli tier.",fix:"Install with `npm i -g @openai/codex`."});let l=e("opencode");if(l){let a;try{a=h("opencode",["--version"],{encoding:"utf-8",timeout:3e3}).trim()}catch{}n.push({severity:"ok",group:"Environment",title:`opencode CLI ${a||"installed"}`,detail:l})}else n.push({severity:"warn",group:"Environment",title:"opencode CLI not on PATH",detail:"Only required for agents on the opencode tier.",fix:"Install from https://opencode.ai/docs/."});try{X(import.meta.url)("better-sqlite3"),n.push({severity:"ok",group:"Environment",title:`better-sqlite3 loads for Node ${process.version}`,detail:`NODE_MODULE_VERSION ${process.versions.modules}`})}catch(a){n.push({severity:"fail",group:"Environment",title:"better-sqlite3 native binding does not load",detail:a?.message??String(a),fix:`Run "pnpm rebuild better-sqlite3" with the same Node used by the daemon (${process.version}, modules ${process.versions.modules}).`})}}function G(n){if(process.platform!=="darwin")return;let t=E(M(),"Library/LaunchAgents"),e=[];try{e=x(t).filter(s=>/agentx\.voice.*\.plist$/.test(s))}catch{return}let i=s=>{try{return q(s,z.X_OK),!0}catch{return!1}};for(let s of e){let r=S(k(E(t,s),"utf-8")),l=j("ffmpeg",r,i);n.push(l?{severity:"ok",group:"Desktop",title:"ffmpeg reachable by the desktop app",detail:`${l} (${s})`}:{severity:"warn",group:"Desktop",title:"ffmpeg not reachable by the desktop app",detail:`Local Whisper transcription fails without it. ${s} sets PATH to ${r}.`,fix:"Install ffmpeg (brew install ffmpeg), then rerun agentx desktop install."})}}function V(n){let t=m(process.cwd(),"agentx.json");if(!y(t))return n.push({severity:"fail",group:"Config",title:"agentx.json not found",detail:`Looked in ${t}`,fix:"Run `agentx setup` to create one via the web wizard."}),null;let e;try{e=JSON.parse(k(t,"utf-8"))}catch(l){return n.push({severity:"fail",group:"Config",title:"agentx.json is not valid JSON",detail:l.message}),null}try{A(t),n.push({severity:"ok",group:"Config",title:`agentx.json valid (${Object.keys(e.agents||{}).length} agents, ${Object.keys(e.crons||{}).length} schedules)`})}catch(l){n.push({severity:"fail",group:"Config",title:"agentx.json failed schema validation",detail:l.message,fix:"Open /admin \u2192 Advanced tab to edit and re-save."})}let i=Object.entries(e.agents||{}).filter(([,l])=>l.tier==="claude-code");i.length>0&&((()=>{try{return h(process.platform==="win32"?"where":"which",["claude"],{stdio:"ignore"}),!0}catch{return!1}})()||n.push({severity:"fail",group:"Config",title:`${i.length} agent(s) use claude-code tier but claude CLI is missing`,detail:i.map(([a])=>a).join(", "),fix:"Install Claude Code (https://docs.anthropic.com/en/docs/claude-code) or switch these agents to tier=sdk."}));let s=Object.entries(e.agents||{}).filter(([,l])=>l.tier==="codex-cli");s.length>0&&((()=>{try{return h(process.platform==="win32"?"where":"which",["codex"],{stdio:"ignore"}),!0}catch{return!1}})()||n.push({severity:"fail",group:"Config",title:`${s.length} agent(s) use codex-cli tier but codex CLI is missing`,detail:s.map(([a])=>a).join(", "),fix:"Install Codex CLI with `npm i -g @openai/codex` or switch these agents to tier=claude-code."}));let r=Object.entries(e.agents||{}).filter(([,l])=>l.tier==="opencode");return r.length>0&&((()=>{try{return h(process.platform==="win32"?"where":"which",["opencode"],{stdio:"ignore"}),!0}catch{return!1}})()||n.push({severity:"fail",group:"Config",title:`${r.length} agent(s) use opencode tier but OpenCode CLI is missing`,detail:r.map(([a])=>a).join(", "),fix:"Install OpenCode from https://opencode.ai/docs/ or switch these agents to another tier."})),e}function K(n,t){let e=new Set;if($(t,e),e.size===0){n.push({severity:"ok",group:"Secrets",title:"No ${VAR} references in agentx.json"});return}let i=m(process.cwd(),".env"),s={};if(y(i))for(let a of k(i,"utf-8").split(/\r?\n/)){let g=a.match(/^\s*([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/i);g&&(s[g[1]]=g[2])}let r=[],l=[];for(let a of e){let g=process.env[a]??s[a];g===void 0?r.push(a):(!g.trim()||/^["']?\s*["']?$/.test(g))&&l.push(a)}r.length===0&&l.length===0?n.push({severity:"ok",group:"Secrets",title:`${e.size} env reference(s) resolved`}):(r.length>0&&n.push({severity:"fail",group:"Secrets",title:`${r.length} env var(s) referenced in agentx.json but missing`,detail:r.join(", "),fix:`Add to .env \u2014 e.g. ${r[0]}=<value>`}),l.length>0&&n.push({severity:"warn",group:"Secrets",title:`${l.length} env var(s) set but empty`,detail:l.join(", ")}))}function $(n,t){if(typeof n=="string")for(let e of n.matchAll(/\$\{([A-Z_][A-Z0-9_]*)\}/g))t.add(e[1]);else if(Array.isArray(n))for(let e of n)$(e,t);else if(n&&typeof n=="object")for(let e of Object.values(n))$(e,t)}function U(n,t){let e=[];for(let[i,s]of Object.entries(t.agents||{})){if(!s.workspace)continue;let r=s.workspace.startsWith("/")?s.workspace:m(process.cwd(),s.workspace);try{B(r).isDirectory()||e.push(`${i}: ${r} (exists but not a directory)`)}catch{e.push(`${i}: ${r}`)}}e.length===0?n.push({severity:"ok",group:"Workspaces",title:"All agent workspace folders exist"}):n.push({severity:"warn",group:"Workspaces",title:`${e.length} agent workspace(s) missing`,detail:e.join(`
|
|
4
4
|
`),fix:"The daemon will create missing folders on first task, but you won't see CLAUDE.md / skills until you populate them."})}function Q(n,t){let e=/\$\{[A-Za-z_][A-Za-z0-9_]*\}/g,i=[];for(let[s,r]of Object.entries(t.agents||{})){if(!r.workspace)continue;let l=r.workspace.startsWith("/")?r.workspace:m(process.cwd(),r.workspace);for(let a of["settings.json","settings.local.json"]){let g=m(l,".claude",a);if(!y(g))continue;let w;try{w=JSON.parse(k(g,"utf-8"))}catch(d){i.push({severity:"fail",agent:s,msg:`${a}: JSON parse error \u2014 ${d.message}`});continue}let b=w.env||{};for(let[d,p]of Object.entries(b)){if(typeof p!="string")continue;let u=p.match(e);u&&i.push({severity:"fail",agent:s,msg:`${a} env.${d} contains unexpanded ${[...new Set(u)].join(",")} \u2014 Claude Code does NOT expand \${VAR} in settings.json (use a fully-literal value)`})}let o=b.PATH;if(typeof o=="string"){let d=o.split(":").filter(Boolean);d.includes("/usr/bin")||i.push({severity:"fail",agent:s,msg:`${a} env.PATH missing /usr/bin \u2014 cat/head/sh/which will fail`}),d.includes("/bin")||i.push({severity:"fail",agent:s,msg:`${a} env.PATH missing /bin \u2014 ls/cp/mv will fail`})}let c=w.permissions;if(c&&typeof c=="object"&&"allow"in c){let d=c.allow,p=c.deny;Array.isArray(d)&&d.length===0&&Array.isArray(p)&&p.length>0&&i.push({severity:"warn",agent:s,msg:`${a} permissions.allow is explicitly [] with ${p.length} deny rules \u2014 agent may be locked out (omit the key to use defaults instead)`})}}}if(i.length===0){n.push({severity:"ok",group:"Workspace settings",title:`All ${Object.keys(t.agents||{}).length} agent .claude/settings.json files clean`});return}for(let s of i)n.push({severity:s.severity,group:"Workspace settings",title:`${s.agent}: ${s.msg}`,fix:s.severity==="fail"?"Edit .claude/settings.json \u2014 replace ${VAR} with the literal value or omit the key to inherit.":"Either remove the empty allow list or populate it."})}function Y(n,t){let e=t.webhooks??[],i=[],s=m(process.cwd(),t.workflows?.dir||".agentx/workflows"),r=new Set;try{if(y(s))for(let o of x(s))o.endsWith(".json")&&!o.startsWith("_")&&!o.endsWith(".disabled.json")&&r.add(o.replace(/\.json$/,""))}catch{}let l=new Set(["github","gitlab"]);for(let o of e){if(!o.enabled||!l.has(o.source))continue;!(o.triggers&&Object.keys(o.triggers).length>0)&&!o.defaultWorkflow&&i.push({severity:"warn",title:`webhook "${o.id}" (${o.source} -> ${o.agentId}) has no triggers map; every event-type collapses to the bound agent`,fix:'Add a triggers map: { "issues.opened": "wf-id", "pull_request.synchronize": "wf-id" } \u2014 or set defaultWorkflow.'})}for(let o of e)if(!(!o.enabled||!o.triggers)){for(let[c,d]of Object.entries(o.triggers))r.size>0&&!r.has(d)&&i.push({severity:"fail",title:`webhook "${o.id}".triggers["${c}"] -> "${d}" \u2014 no such workflow under ${t.workflows?.dir||".agentx/workflows"}`,fix:"Create the workflow file or fix the id in agentx.json"});o.defaultWorkflow&&r.size>0&&!r.has(o.defaultWorkflow)&&i.push({severity:"fail",title:`webhook "${o.id}".defaultWorkflow -> "${o.defaultWorkflow}" \u2014 no such workflow`,fix:"Create the workflow file or fix the id in agentx.json"})}try{if(y(s)){for(let o of x(s))if(!(!o.endsWith(".json")||o.startsWith("_")||o.endsWith(".disabled.json")))try{let c=JSON.parse(k(m(s,o),"utf-8"));c?.status==="active"&&c?.state==="quarantined"&&i.push({severity:"warn",title:`workflow "${c.id??o}" is status=active but state=quarantined \u2014 it looks live but will never dispatch`,fix:'Resolve the conflict the detector flagged, then set state back to "active" (or set status to "review" while parked).'})}catch{}}}catch{}let a=new Set((t.mesh?.peers??[]).map(o=>o.name));for(let o of e)!o.enabled||!o.node||a.has(o.node)||i.push({severity:"fail",title:`webhook "${o.id}" routes to mesh peer "${o.node}" which is not in mesh.peers`,fix:"Add the peer to mesh.peers or remove the node field on the webhook."});let g=new Map;for(let o of e){if(!o.enabled)continue;let c=`${o.source}:${o.agentId}`,d=g.get(c);d?i.push({severity:"warn",title:`webhook entries "${d}" and "${o.id}" both enabled for ${o.source} -> ${o.agentId}; only the first is dispatched`,fix:"Disable one entry, or merge their triggers maps into a single entry."}):g.set(c,o.id)}let w=new Set(Object.keys(t.agents??{}));for(let o of t.channels?.gitlab?.agentMappings??[])if(o?.agentId){if(o.node){a.has(o.node)||i.push({severity:"fail",title:`gitlab.agentMappings entry agentId="${o.agentId}" routes to mesh peer "${o.node}" which is not in mesh.peers`,fix:"Add the peer to mesh.peers or drop the node field on the mapping."});continue}w.has(o.agentId)||i.push({severity:"warn",title:`gitlab.agentMappings entry agentId="${o.agentId}" \u2014 no such agent in agents.* (and no node field, so it's not a cross-mesh route)`,fix:'Add the agent to agents.*, set node:"<peer>" if the agent lives remotely, or remove the mapping.'})}for(let[o,c]of Object.entries(t.channels?.telegram?.accounts??{}))c.agentBinding?w.has(c.agentBinding)||i.push({severity:"fail",title:`telegram account "${o}".agentBinding -> "${c.agentBinding}" \u2014 no such agent in agents.*`,fix:"Fix the agentBinding or define the agent in agents.*."}):i.push({severity:"fail",title:`telegram account "${o}" has no agentBinding; every DM to this bot will drop`,fix:"Set agentBinding to a valid agent id."});let b=new Set(["telegram-bot","whatsapp","slack-bot","discord-bot","gitlab-user","github-user","gmail","hotmail","smtp","hubspot","salesforce","pipedrive","odoo","trello","linear","asana","jira","notion","stripe","sentry","vercel","twilio","custom"]);for(let[o,c]of Object.entries(t.agents??{})){let d=c.integrations??[];if(!d.length)continue;let p=new Set;for(let u of d){let C=`${u.kind}::${u.label}`;p.has(C)&&i.push({severity:"warn",title:`agents.${o}.integrations: duplicate (${u.kind}, ${u.label})`,fix:"Remove the duplicate or rename one. (kind, label) must be unique per agent."}),p.add(C),b.has(u.kind)||i.push({severity:"warn",title:`agents.${o}.integrations: unknown kind "${u.kind}" on integration "${u.label}"`,fix:'Use a canonical kind from INTEGRATION_KINDS, or "custom" for ad-hoc services.'});let W=u.credentials||{};for(let[H,v]of Object.entries(W))typeof v=="string"&&/^[A-Z][A-Z0-9_]*$/.test(v)&&!process.env[v]&&i.push({severity:"warn",title:`agents.${o}.integrations[${u.kind}/${u.label}].${H} -> $${v} but env var is unset (in this shell)`,fix:`Set ${v} on the daemon environment. The daemon's process.env is what matters; this warning fires from your local shell.`})}}if(i.length===0){n.push({severity:"ok",group:"Routing",title:`${e.length} webhook(s), ${Object.keys(t.channels?.telegram?.accounts??{}).length} telegram account(s) \u2014 all routing references resolve`});return}for(let o of i)n.push({severity:o.severity,group:"Routing",title:o.title,fix:o.fix})}async function ee(n,t){let e=t.dashboard?.daemonUrl?.replace(/\/+$/,"")||"http://127.0.0.1:18800",i={};t.dashboard?.token&&(i.Authorization=`Bearer ${t.dashboard.token}`);try{let s=new AbortController,r=setTimeout(()=>s.abort(),2e3),l=await fetch(e+"/health",{headers:i,signal:s.signal});if(clearTimeout(r),!l.ok){n.push({severity:"warn",group:"Runtime",title:`Daemon responded ${l.status}`,detail:e});return}let a=await l.json();n.push({severity:"ok",group:"Runtime",title:`Daemon healthy \u2014 ${a.agents?.length??0} agents live, uptime ${Math.round((a.uptime??0)/60)}m`,detail:e})}catch{n.push({severity:"warn",group:"Runtime",title:"Daemon not reachable (not running?)",detail:e,fix:"Run `agentx daemon start`. Skip this check with `agentx doctor --no-running`."})}}function te(n,t){let e=Object.entries(t.agents||{}).filter(([,s])=>s?.codegraph===!0&&(s.tier==="claude-code"||s.tier==="codex-cli"));if(e.length===0)return;let i=null;try{i=h(process.platform==="win32"?"where":"which",["codegraph"],{encoding:"utf-8"}).trim().split(`
|
|
5
5
|
`)[0]||null}catch{i=null}if(i){let s;try{s=h("codegraph",["--version"],{encoding:"utf-8",timeout:3e3}).trim()}catch{}n.push({severity:"ok",group:"CodeGraph",title:`codegraph CLI ${s||"installed"}`,detail:i})}else n.push({severity:"fail",group:"CodeGraph",title:"codegraph CLI not on PATH",detail:`${e.length} agent(s) have codegraph:true but the binary isn't available.`,fix:"Install with `npm i -g @colbymchenry/codegraph`."});for(let[s,r]of e){if(!r.workspace||!y(r.workspace)){n.push({severity:"warn",group:"CodeGraph",title:`${s}: workspace missing`,detail:`Workspace path ${r.workspace} does not exist \u2014 codegraph will skip this agent.`});continue}let l=m(r.workspace,".codegraph","codegraph.db");y(l)?n.push({severity:"ok",group:"CodeGraph",title:`${s}: index present`,detail:l}):n.push({severity:"warn",group:"CodeGraph",title:`${s}: index not built yet`,detail:".codegraph/ missing \u2014 daemon will background-index this workspace on next boot.",fix:`Run \`codegraph init --index ${r.workspace}\` to build it now.`})}}function P(n){return{errors:n.filter(t=>t.severity==="fail").length,warnings:n.filter(t=>t.severity==="warn").length,ok:n.filter(t=>t.severity==="ok").length}}function ne(n){console.log(),console.log(f.bold(" agentx doctor")),console.log();let t=new Map;for(let i of n)t.has(i.group)||t.set(i.group,[]),t.get(i.group).push(i);for(let[i,s]of t){console.log(f.bold(" "+i));for(let r of s){let l=r.severity==="ok"?f.green("\u2713"):r.severity==="warn"?f.yellow("!"):f.red("\u2717");console.log(` ${l} ${r.title}`),r.detail&&console.log(f.dim(" "+r.detail.replace(/\n/g,`
|
|
6
6
|
`))),r.fix&&console.log(f.dim(" \u2192 "+r.fix))}console.log()}let e=P(n);e.errors>0?console.log(f.red.bold(` ${e.errors} error${e.errors===1?"":"s"}`)+(e.warnings?f.yellow(`, ${e.warnings} warning${e.warnings===1?"":"s"}`):"")+`. Fix the error${e.errors===1?"":"s"} and rerun.`):e.warnings>0?console.log(f.yellow.bold(` ${e.warnings} warning${e.warnings===1?"":"s"}.`)+f.dim(" Review but not blocking.")):console.log(f.green.bold(` All checks passed (${e.ok}).`)),console.log()}export{N as a,J as b,ye as c,F as d};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-CAA546XN.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{q as p}from"./chunk-V7XZN3MQ.js";import{b as i,c as u,d as l,e as c}from"./chunk-VMS3HVTT.js";import d from"cronstrue";var f=Intl.DateTimeFormat().resolvedOptions().timeZone,m=600,E='Try: "every morning at 9", "weekdays at 6pm", "every 15 minutes", "every monday at 10am", "1st of every month at noon", "daily at 9:30am", "every hour"',g=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;function w(e){return g.test(e)}function x(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}function $(e){return e?e.split(",").map(r=>r.trim().toLowerCase()).filter(r=>r==="log"||r==="notify"||r==="disable"):["log"]}function S(e){let r=[...e.onError??["log"]];e.notify&&!r.includes("notify")&&r.push("notify");let t={enabled:e.enabled??!0,schedule:e.parsed.cron,timezone:e.timezone||f,agent:e.agent,prompt:e.prompt,timeout:e.timeout??m,onError:r};return e.model&&(t.model=e.model),e.notify&&(t.notify=e.notify),e.createdBy&&(t.createdBy=e.createdBy),e.approval&&(t.approval=e.approval),t}function P(e){try{return d.toString(e,{use24HourTimeFormat:!1})}catch{return e}}function T(e,r,t=new Date){try{return p(e,t,r)}catch{return null}}function A(e,r){if(!e)return"unknown (no match within a year)";try{return`${new Intl.DateTimeFormat("en-GB",{timeZone:r,weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(e)} (${r})`}catch{return e.toISOString()}}function h(e){return e?.approval?.action==="create"}async function D(e,r={}){let t="",o=await i(n=>{let a=l(n,`crons.${e}`);if(!a)throw new Error(`cron "${e}" not found`);let s=a.approval;if(!s)throw new Error(`cron "${e}" has no pending request`);s.action==="create"?(delete a.approval,a.enabled=!0,t=`${e} approved and enabled (requested by ${s.requestedBy})`):(c(n,`crons.${e}`),t=`${e} deletion approved; job removed (requested by ${s.requestedBy})`)},{configPath:r.configPath,reload:r.reload});return o.success?{success:!0,message:t,result:o}:{success:!1,message:o.error||"failed",result:o}}async function I(e,r={}){let t="",o=await i(n=>{let a=l(n,`crons.${e}`);if(!a)throw new Error(`cron "${e}" not found`);let s=a.approval;if(!s)throw new Error(`cron "${e}" has no pending request`);s.action==="create"?(c(n,`crons.${e}`),t=`${e} rejected; pending job removed`):(delete a.approval,t=`${e} deletion rejected; job kept`)},{configPath:r.configPath,reload:r.reload});return o.success?{success:!0,message:t,result:o}:{success:!1,message:o.error||"failed",result:o}}async function O(e,r,t={}){return i(o=>{let n=l(o,`crons.${e}`);if(!n)throw new Error(`cron "${e}" not found`);if(r&&h(n))throw new Error(`cron "${e}" is awaiting approval; run \`agentx schedule approve ${e}\``);u(o,`crons.${e}.enabled`,r)},{configPath:t.configPath,reload:t.reload})}export{f as a,E as b,w as c,x as d,$ as e,S as f,P as g,T as h,A as i,h as j,D as k,I as l,O as m};
|
|
2
|
+
//# sourceMappingURL=chunk-F7WY24UZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-QIJLFPWE.js";import{randomBytes as c}from"crypto";function f(t){let n="";for(let e=u-1;e>=0;e--)n=r[t&31]+n,t=Math.floor(t/32);return n}function s(){let t=c(o),n="";for(let e=0;e<o;e++)n+=r[t[e]&31];return n}function l(t=Date.now()){return f(t)+s()}var r,u,o,a=i(()=>{"use strict";r="0123456789ABCDEFGHJKMNPQRSTVWXYZ",u=10,o=16});export{l as a,a as b};
|
|
2
|
+
//# sourceMappingURL=chunk-FCPTN6NF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-QIJLFPWE.js";function g(e){if(!e)return null;let s=l(e);if(s!==void 0)return s;let c=e.match(/```(?:json)?\s*([\s\S]*?)```/);if(c){let n=l(c[1]);if(n!==void 0)return n}let f=[["{","}"],["[","]"]].map(([n,i])=>({open:n,close:i,at:e.indexOf(n)})).filter(n=>n.at>=0).sort((n,i)=>n.at-i.at);for(let{open:n,close:i}of f){let t=a(e,n,i);if(t!==null){let r=l(t);if(r!==void 0)return r}}return null}function l(e){try{return JSON.parse(e.trim())}catch{return}}function a(e,s,c){let f=e.indexOf(s);if(f<0)return null;let n=0,i=!1,t=!1;for(let r=f;r<e.length;r++){let u=e[r];if(t){t=!1;continue}if(u==="\\"){i&&(t=!0);continue}if(u==='"'){i=!i;continue}if(!i){if(u===s)n++;else if(u===c&&(n--,n===0))return e.slice(f,r+1)}}return null}var d=o(()=>{"use strict"});export{g as a,d as b};
|
|
2
|
+
//# sourceMappingURL=chunk-FX3D7YON.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{v as l,w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{v as l,w}from"./chunk-JQR3NTHI.js";import{a as i,f as p}from"./chunk-72SZI2UW.js";w();p();var d="task-tier";function u(e){return{task:f(e.message,2e3),agent:e.agent,channel:e.channel??null,continuesExistingSession:e.isFollowUp??!1,...e.toolsAvailable?{toolsAvailable:e.toolsAvailable}:{}}}var c={needsFlagship:i("This task needs the strongest available model to be done correctly.",{true:"Doing it well takes real reasoning: writing or reviewing code, diagnosing a failure, planning work across several steps, weighing a judgement, handling money, touching production or anything irreversible, following a long or ambiguous instruction, or work where being subtly wrong would not be noticed. Anything where a weaker model would produce something that LOOKS right belongs here.",false:"It is mechanical and its result is obvious on sight: acknowledging or confirming a message, restating or formatting something already written, a greeting, a status echo, reading one file and reporting what it says, a lookup with one right answer, a scheduled heartbeat with nothing to decide."})};function g(e){return e.needsFlagship.noul}function f(e,n){return e.length>n?`${e.slice(0,n)}\u2026`:e}var h=.2,m=60*60*1e3;function F(e,n){if(e==="claude-code"){let t=n?.cheapModels?.[e]??n?.cheapModel;return t&&/^(claude-|haiku$|sonnet$|opus$)/.test(t)?t:void 0}if(e==="codex-cli"){let t=n?.cheapModels?.[e];return t&&/^(gpt-|o\d)/.test(t)?t:void 0}}async function M(e){let n=(o,r=null)=>({downgraded:!1,needsFlagship:r,reason:o});if(e.channel==="voice"||e.channel==="desktop"||e.channel==="opencode")return n(`${e.channel} requests retain the configured model`);if(!e.cheapModel)return n("no cheaper model configured");if(e.isFollowUp){let o=e.sessionIdleMs??0,r=e.cacheTtlMs??m;if(o<r)return n(`follow-up on a warm cache (idle ${Math.round(o/1e3)}s) \u2014 swapping would cost more than it saves`)}let t;try{t=await l(d,u(e),c,{incumbent:{needsFlagship:1},features:{agent:e.agent,channel:e.channel??"unknown"}})}catch{return n("routing seat threw \u2014 keeping the flagship")}if(!t)return n("routing seat unavailable \u2014 keeping the flagship");let s=g(t.answers);if(t.mode!=="active")return n(`shadow \u2014 would ${s<(e.threshold??h)?"downgrade":"keep"} (${s.toFixed(2)})`,s);let a=e.threshold??h;return s>=a?n(`needs the flagship (${s.toFixed(2)})`,s):{model:e.cheapModel,downgraded:!0,needsFlagship:s,reason:`mechanical task (${s.toFixed(2)} below ${a}) \u2192 ${e.cheapModel}`}}export{F as a,M as b};
|
|
2
|
+
//# sourceMappingURL=chunk-H2TWRZC2.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as l,b as y}from"./chunk-
|
|
1
|
+
import{a as l,b as y}from"./chunk-7I7IEX4S.js";y();import{existsSync as h,promises as b}from"fs";import g from"path";import I from"js-yaml";import $ from"fast-glob";import{z as e}from"zod";var u=e.enum(["ssh","gitlab","path","contact","http","secret-pointer"]),R=e.object({id:e.string().regex(/^[a-z0-9][a-z0-9._-]*[a-z0-9]$/,"id must be a dotted slug"),kind:u,summary:e.string(),fields:e.record(e.string(),e.union([e.string(),e.number(),e.boolean()])),tags:e.array(e.string()).default([]),ownerAgent:e.string().optional(),lastVerified:e.string().optional(),notes:e.string().optional()}),m=e.object({namespace:e.string().optional(),cards:e.array(R)});var x=["references",".references",".agentx/references"],C="**/*.{yaml,yml}";async function T(t){let r={byId:new Map,byTag:new Map,sourceById:new Map};for(let c of x){let o=g.resolve(t,c);if(!h(o))continue;let i=await $.glob(C,{cwd:o,deep:5});for(let a of i){let s=g.resolve(o,a);if(!a.startsWith("recipes/"))try{await w(s,r)}catch(n){l.warn({file:s,error:n?.message},"references: failed to load file")}}}return r}async function w(t,r){let c=await b.readFile(t,"utf8"),o=I.load(c),i=m.parse(o),a=i.namespace?`${i.namespace}.`:"";for(let s of i.cards){let n=`${a}${s.id}`;if(r.byId.has(n)){let f=r.sourceById.get(n);throw new Error(`references: duplicate id "${n}" in ${t}`+(f?` (also defined in ${f})`:""))}let d={...s,id:n};r.byId.set(n,d),r.sourceById.set(n,t);for(let f of d.tags){let p=r.byTag.get(f)??[];p.push(d),r.byTag.set(f,p)}}}function K(t,r=2e3){if(t.length===0)return"";let c=[...t].sort((s,n)=>s.id.localeCompare(n.id)),o="[Verified References \u2014 deterministic, do not re-query]",i=[o],a=o.length;for(let s of c){let n=E(s);if(a+n.length+1>r)break;i.push(n),a+=n.length+1}return i.join(`
|
|
2
2
|
`)}function E(t){let r=Object.entries(t.fields).map(([c,o])=>`${c}=${o}`).join(" ");return`- ${t.id} (${t.kind}): ${t.summary}${r?` { ${r} }`:""}`}export{T as a,K as b};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-J3SOEFRE.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as et,b as tt,c as nt,d as S,e as A,f as N}from"./chunk-
|
|
1
|
+
import{a as et,b as tt,c as nt,d as S,e as A,f as N}from"./chunk-72SZI2UW.js";import{a as Te,b as ft}from"./chunk-FX3D7YON.js";import{a as ne,b as He}from"./chunk-FCPTN6NF.js";import{o as we,p as Ke}from"./chunk-SZJMS7K4.js";import{o as We,p as Ze}from"./chunk-SRCXUZM2.js";import{a as rt,b as ot,c as st,d as it,e as at,f as ct,g as ut,h as lt,i as dt,j as pt,k as mt,l as bt}from"./chunk-RGDKHYY2.js";import{a as E,b as Ye,c as he}from"./chunk-QIJLFPWE.js";function R(e,t){$.set(e,t),X.delete(e)}function D(e){let t=X.get(e);if(t)return t;let r=$.get(e);if(!r){let o=Ee();throw new Error(`unknown decision backend "${e}"`+(o.length>0?` \u2014 registered: ${o.join(", ")}`:" \u2014 none registered"))}let n=r();return X.set(e,n),n}function Ee(){return[...$.keys()].sort()}function gt(){$.clear(),X.clear()}var $,X,C=E(()=>{"use strict";$=new Map,X=new Map});import yt from"better-sqlite3";import{createHash as ht}from"crypto";import{mkdirSync as wt}from"fs";import{dirname as Tt,resolve as Et}from"path";function Q(e){if(e.type==="noul"){let r=e.noul,n={yes:r,no:1-r},o=r>=.5?"yes":"no",s=Math.abs(r-.5)*2;return{predicted:o,confidence:s,probabilities:n,topLabel:o,topProb:Math.max(r,1-r),expectedScore:null,pMax:Math.max(r,1-r),negEntropy:s}}if(e.type==="choice")return{predicted:e.choice,confidence:e.confidence,probabilities:{...e.probabilities},topLabel:e.choice,topProb:e.probabilities[e.choice]??0,expectedScore:null,pMax:e.pMax,negEntropy:e.negEntropy};let t=String(Math.round(e.score));return{predicted:t,confidence:e.confidence,probabilities:{...e.probabilities},topLabel:t,topProb:e.probabilities[t]??0,expectedScore:e.score,pMax:e.pMax,negEntropy:e.negEntropy}}function kt(e){if(typeof e!="string"||e.length===0)return{};try{let t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function xt(e){e.exec("CREATE TABLE IF NOT EXISTS schema_version (v INTEGER PRIMARY KEY);");let t=e.prepare("SELECT MAX(v) AS v FROM schema_version").get().v??0;t<1&&Rt(e),t<2&&At(e),t<3&&St(e)}function St(e){e.exec(`
|
|
2
2
|
ALTER TABLE decision_calls ADD COLUMN features_json TEXT;
|
|
3
3
|
INSERT INTO schema_version (v) VALUES (3);
|
|
4
4
|
`)}function At(e){e.exec(`
|
|
@@ -111,4 +111,4 @@ import{a as et,b as tt,c as nt,d as S,e as A,f as N}from"./chunk-F4HZTZHW.js";im
|
|
|
111
111
|
`)}if(!m)throw new Error(`local decision backend could not get a valid answer after ${f+1} attempt(s): ${h}`);let M={},L=!1;for(let[k,q]of Object.entries(s.questions)){let x=_(q,m[k],{normalize:e.normalizeProbabilities??!0});M[k]=x.answer,x.repaired&&(L=!0)}return{model:a,answers:M,usage:g,meta:{backend:"local",structureMode:c,answerMode:"probabilities",repaired:L,retries:f,stateTruncated:l.truncated,latencyMs:Date.now()-i}}}finally{b()}}}}async function $t(e,t,r,n,o){if(!e.generateRaw)throw new Error(`provider "${e.name}" has no generateRaw(); use structureMode "text"`);let s=[{role:"user",content:r},...n?[{role:"user",content:n}]:[]],i=await e.generateRaw(s,J,[{name:B,description:"Report a probability distribution for every question.",input_schema:se(t)}],{...o,toolChoice:{type:"tool",name:B}}),a=i.content.find(c=>c.type==="tool_use"&&c.name===B),u=a&&a.type==="tool_use"?a.input:null;return{answers:Pe(u),usage:{inputTokens:i.usage.input_tokens,outputTokens:i.usage.output_tokens}}}async function Vt(e,t,r,n,o){let s=[r,ae(t)].join(`
|
|
112
112
|
`),i=[{role:"system",content:J},{role:"user",content:s},...n?[{role:"user",content:n}]:[]],a=await e.generate(i,o);return{answers:Pe(Te(a.content??"")),usage:{inputTokens:0,outputTokens:a.tokensUsed??0}}}function Pe(e){if(e&&typeof e=="object"&&!Array.isArray(e)){let t=e;if(t.answers&&typeof t.answers=="object")return t.answers}return e}function zt(e,t){return e!=="auto"?e:t.generateRaw&&me[t.name]?.structuredOutput?"tool":"text"}function Jt(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(new Error(`decision timed out after ${t}ms`)),t),o=()=>r.abort(e?.reason);return e&&(e.aborted?o():e.addEventListener("abort",o,{once:!0})),{signal:r.signal,dispose:()=>{clearTimeout(n),e?.removeEventListener("abort",o)}}}var Bt,Pt,qt,Be,Xt,be=E(()=>{"use strict";Ke();Ue();ft();j();Y();N();z();Bt="claude-code",Pt="claude-haiku-4-5-20251001",qt=24e3,Be=2e3,Xt=3e4});import{readFileSync as Gt}from"fs";import{homedir as Yt}from"os";import{join as Kt}from"path";function v(e={}){let t=(e.baseUrl??Ht).replace(/\/+$/,""),r=e.path??"/classifier",n=e.name??"simple-jev",o=e.maxStateChars??Zt,s=e.maxChoiceOptions??en,i={probabilitySource:e.probabilitySource??"logits",calibratedProbabilities:!1,maxChoiceOptions:s,maxStateChars:o,parallelQuestions:!0,images:!1};return{name:n,capabilities:i,async decide(a){A(a.questions),on(a.questions,s);let u=Date.now(),c=a.model??e.model;if(!c)throw new Error("simple-jev backend needs a model id");let l=G(a.state,o),p=e.fetchImpl??fetch,{signal:y,dispose:d}=sn(a.abortSignal,a.timeoutMs??e.timeoutMs??Wt);try{let b={"Content-Type":"application/json"},g=rn(e.apiKeyEnv,e.apiKeyFile);g&&(b.Authorization=`Bearer ${g}`);let w=await p(`${t}${r}`,{method:"POST",headers:b,body:JSON.stringify({model:c,state:l.text,questions:nn(a.questions)}),signal:y});if(!w.ok){let k=await w.text().catch(()=>"");throw new Error(`${n} ${w.status}: ${k.slice(0,300)}`)}let f=await w.json(),m=F(a.questions).safeParse(f.answers);if(!m.success)throw new Error(`${n} returned a response that does not match the requested questions (contract drift, not a model slip \u2014 retrying will not help):
|
|
113
113
|
${U(m.error)}`);let h=m.data,M={},L=!1;for(let[k,q]of Object.entries(a.questions)){let x=_(q,h[k]);M[k]=x.answer,x.repaired&&(L=!0)}return{model:f.model??c,answers:M,usage:{inputTokens:f.usage?.input_tokens??0,outputTokens:f.usage?.output_tokens??0},meta:{backend:n,structureMode:i.probabilitySource==="native"?"native":"logprobs",answerMode:"probabilities",repaired:L,retries:0,stateTruncated:l.truncated,latencyMs:Date.now()-u}}}finally{d()}}}}function nn(e){let t={};for(let[r,n]of Object.entries(e))t[r]=n.instructions?n:{...n,instructions:tn[n.type]};return t}function rn(e,t){let r=e?process.env[e]:void 0;if(r)return r;if(!t)return;let n=t.startsWith("~/")?Kt(Yt(),t.slice(2)):t;if(!Z.has(n))try{let o=Gt(n,"utf-8").trim();Z.set(n,o.length>0?o:null)}catch{Z.set(n,null)}return Z.get(n)??void 0}function on(e,t){for(let[r,n]of Object.entries(e))if(n.type==="choice"){let o=Object.keys(n.criteria).length;if(o>t)throw new Error(`question "${r}": accepts at most ${t} choice options, got ${o}`)}else if(n.type==="score"&&n.criteria.length>t)throw new Error(`question "${r}": accepts at most ${t} score levels, got ${n.criteria.length}`)}function sn(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(new Error(`decision timed out after ${t}ms`)),t),o=()=>r.abort(e?.reason);return e&&(e.aborted?o():e.addEventListener("abort",o,{once:!0})),{signal:r.signal,dispose:()=>{clearTimeout(n),e?.removeEventListener("abort",o)}}}var Ht,Wt,Zt,en,tn,Z,fe=E(()=>{"use strict";j();N();z();Y();Ht="http://127.0.0.1:8000/v1",Wt=3e4,Zt=6e3,en=50;tn={choice:"Which option best fits?",score:"Which level best fits?",noul:"Is this true of the state?"};Z=new Map});var qe={};Ye(qe,{DecisionStore:()=>I,MAX_CHOICE_OPTIONS:()=>MAX_CHOICE_OPTIONS,SYSTEM_PROMPT:()=>J,TOOL_NAME:()=>B,UNCERTAINTY_HIGH:()=>Ce,UNCERTAINTY_LOW:()=>De,_resetDecisionBackendsForTesting:()=>gt,agreement:()=>rt,answerView:()=>Q,applyRecalibrator:()=>ue,applyTemperature:()=>lt,askSeat:()=>pn,band:()=>Ie,bootstrapInterval:()=>pt,brier:()=>at,buildDesign:()=>Ne,calibrationReport:()=>mt,choice:()=>tt,compareCalibrators:()=>Lt,confidenceFor:()=>re,configureDecisions:()=>cn,coverageCurve:()=>ut,createLocalDecisionBackend:()=>W,createMockDecisionBackend:()=>H,createSimpleJevBackend:()=>v,decisionsRuntime:()=>ln,describeIssues:()=>U,ece:()=>st,expectedScore:()=>Ae,finalizeAnswer:()=>_,fitLogistic:()=>ve,fitRecalibrator:()=>P,fitTemperature:()=>dt,getDecisionBackend:()=>D,getSeatMode:()=>Ve,labelsOf:()=>S,listDecisionBackends:()=>Ee,logLoss:()=>ct,logit:()=>le,mce:()=>it,measureConsistency:()=>Qt,normalizeDistribution:()=>xe,normalizedNegEntropy:()=>oe,noul:()=>et,pMax:()=>Se,parseSeatMode:()=>ge,rawAnswerSchema:()=>Re,rawAnswersSchema:()=>F,recordSeatOutcome:()=>dn,registerBuiltinDecisionBackends:()=>an,registerDecisionBackend:()=>R,reliabilityBins:()=>ot,renderQuestions:()=>_e,renderShapeInstructions:()=>ae,renderState:()=>G,renderUserPrompt:()=>ie,resetDecisionsRuntime:()=>un,score:()=>nt,seatEnvVar:()=>$e,sigmoid:()=>de,toolInputSchema:()=>se,validateQuestions:()=>A,withUid:()=>Qe});function an(e={},t={},r={},n={}){R("mock",()=>H()),R("local",()=>W(e)),R("simple-jev",()=>v(t)),R("jev",()=>v({name:"jev",baseUrl:"https://openrouter.ai/api/alpha",path:"/decisions",model:"jev-latest",apiKeyEnv:"OPENROUTER_API_KEY",apiKeyFile:"~/.agentx/openrouter-key.txt",probabilitySource:"native",maxChoiceOptions:255,maxStateChars:9e4,...r})),R("typesafe",()=>v({name:"typesafe",baseUrl:"https://api.typesafe.ai/v1",path:"/systemone",model:"jev-latest",apiKeyEnv:"TYPESAFE_API_KEY",apiKeyFile:"~/.agentx/typesafe-key.txt",probabilitySource:"native",maxChoiceOptions:255,maxStateChars:9e4,...n}))}var Xe=E(()=>{"use strict";ke();N();j();z();C();Y();V();bt();Me();je();ze();pe();be();fe();C();pe();be();fe()});function cn(e){T={...ye,...T,...e},ee=!0}function un(){T={...ye,seats:{}},ee=!1}function mn(){if(!ee){ee=!0;try{let{loadDaemonConfig:e}=(Ze(),he(We)),t=e()?.decisions;if(!t?.enabled)return;let{registerBuiltinDecisionBackends:r}=(Xe(),he(qe)),n=t.backends??{};r(n.local,n.simpleJev,n.jev,n.typesafe);let o=null;try{o=new I({path:t.dbPath})}catch{}T={enabled:!0,defaultBackend:t.defaultBackend,store:o,seats:Object.fromEntries(Object.entries(t.seats??{}).map(([s,i])=>[s,{...i,redactState:t.redactState,keepStateRows:t.keepStateRows}]))}}catch{}}}function ln(){return T}function ge(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return bn.includes(t)?t:null}function $e(e){return`AGENTX_DECISION_SEAT_${e.toUpperCase().replace(/[^A-Z0-9]+/g,"_")}`}function Ve(e,t=process.env){mn();let r=ge(t[$e(e)]);return r||(T.enabled?ge(T.seats[e]?.mode)??"off":"off")}function dn(e,t,r=!1){if(!(!e||!T.store))try{T.store.recordOutcome(e,t,r)}catch{}}async function pn(e,t,r,n={}){let o=Ve(e);if(o==="off")return null;let s=T.seats[e]??{mode:o},i=n.backend??s.backend??T.defaultBackend,a=Date.now();try{let c=await D(i).decide({state:t,questions:r,model:n.model??s.model,abortSignal:n.signal,timeoutMs:n.timeoutMs??s.timeoutMs}),l=fn(e,o,t,r,c,n,s);return{answers:c.answers,callId:l,mode:o}}catch(u){return gn(e,o,t,r,i,n,s,a,u),yn(e,i,u),null}}function fn(e,t,r,n,o,s,i){if(!T.store)return null;try{return T.store.recordCall({seat:e,mode:t,backend:o.meta.backend,model:o.model,meta:o.meta,state:r,questions:n,answers:o.answers,usage:o.usage,incumbent:Ge(s.incumbent),links:s.links,features:s.features,keepState:!i.redactState})}catch{return null}}function gn(e,t,r,n,o,s,i,a,u){if(T.store)try{T.store.recordCall({seat:e,mode:t,backend:o,model:s.model??i.model??"unknown",meta:{structureMode:"text",answerMode:"probabilities",retries:0,stateTruncated:!1,latencyMs:Date.now()-a},state:r,questions:n,answers:{},incumbent:Ge(s.incumbent),links:s.links,features:s.features,error:String(u?.message??u).slice(0,500),keepState:!i.redactState})}catch{}}function Ge(e){if(!e)return;let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]={value:n});return t}function yn(e,t,r){let n=Date.now();n-Je<6e4||(Je=n,console.warn(`[decisions] seat "${e}" on backend "${t}" failed: ${r?.message??r}`))}var ye,T,ee,bn,Je,ze=E(()=>{C();V();ye={enabled:!1,defaultBackend:"local",seats:{},store:null},T={...ye},ee=!1;bn=["off","shadow","active"];Je=0});export{D as a,Ee as b,C as c,I as d,V as e,Lt as f,Me as g,Qt as h,je as i,me as j,Un as k,Ue as l,an as m,Xe as n,cn as o,un as p,ln as q,ge as r,$e as s,Ve as t,dn as u,pn as v,ze as w};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-JQR3NTHI.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{m,p as b}from"./chunk-
|
|
1
|
+
import{m,p as b}from"./chunk-SRCXUZM2.js";b();function w(t){let e=typeof t.node=="string"?t.node:"",n=typeof t.token=="string"?t.token:"";if(!e||!n)try{let o=m(t.config);e||(e=o.dashboard?.daemonUrl||""),n||(n=o.dashboard?.token||"")}catch{}return e||(e="http://localhost:18800"),{baseUrl:e.replace(/\/+$/,""),token:n}}async function d(t,e,n){let o={Accept:"application/json"};t.token&&(o.Authorization=`Bearer ${t.token}`);let r=await fetch(`${t.baseUrl}${e}`,{headers:o,signal:n});if(!r.ok)throw new Error(`GET ${e} \u2192 HTTP ${r.status}`);return await r.json()}function R(t,e){return d(t,"/agents",e)}async function S(t,e){return(await d(t,"/api/processes",e)).processes??[]}function P(t,e){return d(t,"/crons",e)}async function h(t,e,n,o){let r={Accept:"application/json","Content-Type":"application/json"};t.token&&(r.Authorization=`Bearer ${t.token}`);let s=await fetch(`${t.baseUrl}${e}`,{method:"POST",headers:r,body:JSON.stringify(n),signal:o}),a=await s.text(),i;try{i=a?JSON.parse(a):{}}catch{i={raw:a}}if(!s.ok)throw new Error(i?.error||`POST ${e} \u2192 HTTP ${s.status}`);return i}function A(t,e,n="tui"){return h(t,"/api/processes/kill",{...e,reason:n})}function C(t,e,n,o){return h(t,"/task",{agent:e,message:n,context:o??{channel:"tui",chatId:"tui:operator"}})}async function $(t,e,n,o={}){let r={Accept:"text/event-stream","Content-Type":"application/json"};t.token&&(r.Authorization=`Bearer ${t.token}`);let s=await fetch(`${t.baseUrl}/task`,{method:"POST",headers:r,body:JSON.stringify({agent:e,message:n,stream:!0,context:{channel:o.channel??"chat-cli",chatId:o.chatId??"chat-cli:operator"}}),signal:o.signal});if(!s.ok||!s.body){let g=await s.text().catch(()=>"");throw new Error(`POST /task (stream) \u2192 HTTP ${s.status}${g?`: ${g.slice(0,200)}`:""}`)}let a=s.body.getReader(),i=new TextDecoder,u={content:""},c="";try{for(;;){let{done:g,value:p}=await a.read();if(g)break;c+=i.decode(p,{stream:!0});let l;for(;(l=c.indexOf(`
|
|
2
2
|
|
|
3
3
|
`))>=0;){let k=c.slice(0,l);c=c.slice(l+2);let f=x(k);f&&T(f,o,u)}}}finally{try{a.releaseLock()}catch{}}return u}function T(t,e,n){let{event:o,data:r}=t;switch(o){case"text":r?.text&&(n.content+=r.text,e.onText?.(r.text));break;case"thinking":r?.text&&e.onThinking?.(r.text);break;case"tool":e.onTool?.(r);break;case"done":typeof r?.content=="string"&&(n.content=r.content),n.usage=r?.usage,n.duration=r?.duration;break;case"error":n.error=r?.error,n.errorKind=r?.errorKind;break}}function x(t){let e="message",n="";for(let r of t.split(`
|
|
4
4
|
`))r.startsWith("event: ")?e=r.slice(7).trim():r.startsWith("data: ")&&(n=r.slice(6));if(!n)return null;let o;try{o=JSON.parse(n)}catch{o=n}return{event:e,data:o}}export{w as a,R as b,S as c,P as d,A as e,C as f,$ as g};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-KFALP5NO.js.map
|