@askexenow/exe-os 0.9.271 → 0.9.273
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/dist/active-agent-BDYXURXQ.js +26 -0
- package/dist/active-agent-YWBGAKGU.js +25 -0
- package/dist/agentic-ontology-56VHSVS3.js +25 -0
- package/dist/backfill-metadata-A3534S32.js +597 -0
- package/dist/backfill-metadata-B6F2KJJV.js +597 -0
- package/dist/backfill-metadata-BOM2MXLI.js +597 -0
- package/dist/backfill-metadata-G46ABBVR.js +597 -0
- package/dist/backfill-metadata-TAU33HJS.js +597 -0
- package/dist/backfill-metadata-VAV27KJK.js +597 -0
- package/dist/behaviors-USUTDXVA.js +25 -0
- package/dist/bin/agentic-ontology-backfill.js +5 -5
- package/dist/bin/agentic-reflection-backfill.js +6 -6
- package/dist/bin/agentic-semantic-label.js +5 -5
- package/dist/bin/backfill-conversations.js +4 -4
- package/dist/bin/backfill-responses.js +4 -4
- package/dist/bin/backfill-vectors.js +5 -5
- package/dist/bin/bulk-sync-postgres.js +6 -6
- package/dist/bin/cc-doctor.js +4 -4
- package/dist/bin/cleanup-stale-review-tasks.js +10 -10
- package/dist/bin/cli.js +16 -16
- package/dist/bin/exe-agent-config.js +3 -3
- package/dist/bin/exe-agent.js +4 -4
- package/dist/bin/exe-assign.js +5 -5
- package/dist/bin/exe-boot.js +17 -17
- package/dist/bin/exe-call.js +4 -4
- package/dist/bin/exe-cloud.js +4 -4
- package/dist/bin/exe-dispatch.js +10 -10
- package/dist/bin/exe-doctor.js +1 -1
- package/dist/bin/exe-export-behaviors.js +7 -7
- package/dist/bin/exe-forget.js +6 -6
- package/dist/bin/exe-gateway.js +7 -7
- package/dist/bin/exe-healthcheck.js +4 -4
- package/dist/bin/exe-heartbeat.js +10 -10
- package/dist/bin/exe-kill.js +13 -13
- package/dist/bin/exe-launch-agent.js +37 -19
- package/dist/bin/exe-new-employee.js +6 -6
- package/dist/bin/exe-pending-messages.js +11 -11
- package/dist/bin/exe-pending-notifications.js +33 -18
- package/dist/bin/exe-pending-reviews.js +10 -10
- package/dist/bin/exe-rename.js +4 -4
- package/dist/bin/exe-review.js +12 -12
- package/dist/bin/exe-search.js +5 -5
- package/dist/bin/exe-session-cleanup.js +15 -15
- package/dist/bin/exe-settings.js +5 -5
- package/dist/bin/exe-start-codex.js +11 -11
- package/dist/bin/exe-start-opencode.js +8 -8
- package/dist/bin/exe-status.js +11 -11
- package/dist/bin/exe-team.js +3 -3
- package/dist/bin/git-sweep.js +11 -11
- package/dist/bin/graph-backfill.js +4 -4
- package/dist/bin/graph-export.js +5 -5
- package/dist/bin/import-history.js +7 -7
- package/dist/bin/install.js +6 -6
- package/dist/bin/intercom-check.js +4 -4
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.js +4 -4
- package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
- package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
- package/dist/bin/scan-tasks.js +10 -10
- package/dist/bin/setup.js +1 -1
- package/dist/bin/shard-migrate.js +4 -4
- package/dist/capacity-monitor-2GJOFXGB.js +49 -0
- package/dist/capacity-monitor-3Z7W4K25.js +49 -0
- package/dist/capacity-monitor-BENS3N7B.js +49 -0
- package/dist/capacity-monitor-IFVRCIM7.js +49 -0
- package/dist/capacity-monitor-MQUUEZKB.js +49 -0
- package/dist/capacity-monitor-Q47GBDSY.js +49 -0
- package/dist/catchup-brief-B4KGAIPU.js +151 -0
- package/dist/catchup-brief-NMOV3SSP.js +151 -0
- package/dist/catchup-brief-RP4QHXNT.js +151 -0
- package/dist/catchup-brief-TKA6TEK4.js +151 -0
- package/dist/catchup-brief-VMF3ESTZ.js +151 -0
- package/dist/catchup-brief-ZL7V3BXC.js +151 -0
- package/dist/chunk-23KJ2LXY.js +58 -0
- package/dist/chunk-2KWVJV6I.js +171 -0
- package/dist/chunk-2NQQP3FF.js +630 -0
- package/dist/chunk-3A4SOC66.js +551 -0
- package/dist/chunk-3FU5I3KV.js +526 -0
- package/dist/chunk-3GSGDPLK.js +171 -0
- package/dist/chunk-3IM3JNQV.js +377 -0
- package/dist/chunk-3OM3V545.js +448 -0
- package/dist/chunk-3T27ZQT6.js +495 -0
- package/dist/chunk-3VI3QIHU.js +214 -0
- package/dist/chunk-3WG3RRWA.js +1345 -0
- package/dist/chunk-42A3JV3A.js +128 -0
- package/dist/chunk-46IEEKPU.js +13696 -0
- package/dist/chunk-46WLFLGP.js +1073 -0
- package/dist/chunk-4JMPQB7K.js +1148 -0
- package/dist/chunk-4L25LLQM.js +382 -0
- package/dist/chunk-4Q7X3SAM.js +204 -0
- package/dist/chunk-4UAUCFHA.js +526 -0
- package/dist/chunk-4VRJX2SP.js +495 -0
- package/dist/chunk-57RBAR2A.js +214 -0
- package/dist/chunk-57UAFTO2.js +3958 -0
- package/dist/chunk-5AS622MM.js +3958 -0
- package/dist/chunk-5JF5OQQU.js +89 -0
- package/dist/chunk-5LTY4GLX.js +13745 -0
- package/dist/chunk-5M5RYJ22.js +3955 -0
- package/dist/chunk-5YO2FER3.js +76 -0
- package/dist/chunk-62DEE65H.js +371 -0
- package/dist/chunk-62YI2JOC.js +333 -0
- package/dist/chunk-64T6DFSS.js +447 -0
- package/dist/chunk-6AGPWYFC.js +447 -0
- package/dist/chunk-6BWDP63Z.js +197 -0
- package/dist/chunk-6CH7TYBG.js +58 -0
- package/dist/chunk-6CHHFVRQ.js +284 -0
- package/dist/chunk-6D64562N.js +330 -0
- package/dist/chunk-6F35WOSR.js +447 -0
- package/dist/chunk-6GPYL7TX.js +214 -0
- package/dist/chunk-6HQ22FC6.js +81 -0
- package/dist/chunk-6KWLUVFL.js +54 -0
- package/dist/chunk-6N5ISWBF.js +1148 -0
- package/dist/chunk-6OD7PVMC.js +333 -0
- package/dist/chunk-6ZSH2BZR.js +244 -0
- package/dist/chunk-74MF4T3T.js +3962 -0
- package/dist/chunk-77H7IO3O.js +382 -0
- package/dist/chunk-7BUWNG6M.js +159 -0
- package/dist/chunk-7ET5CYTD.js +382 -0
- package/dist/chunk-7IWLKR6N.js +76 -0
- package/dist/chunk-7OEUOJL5.js +1021 -0
- package/dist/chunk-7YEQI2WF.js +13745 -0
- package/dist/chunk-AIRJTKDK.js +204 -0
- package/dist/chunk-AJ63GPM7.js +54 -0
- package/dist/chunk-ATJ3NXDP.js +244 -0
- package/dist/chunk-B5IS7LE4.js +128 -0
- package/dist/chunk-BFJ45HQT.js +244 -0
- package/dist/chunk-BKINEQVI.js +244 -0
- package/dist/chunk-BMHE3UQU.js +495 -0
- package/dist/chunk-BNTUZVPS.js +1921 -0
- package/dist/chunk-BOJV6NI3.js +128 -0
- package/dist/chunk-BPHWI6N2.js +284 -0
- package/dist/chunk-BXCQWWJP.js +185 -0
- package/dist/chunk-BZ6K7AY3.js +50 -0
- package/dist/chunk-C54KIFLS.js +214 -0
- package/dist/chunk-C6ODVGTC.js +818 -0
- package/dist/chunk-C6OYEJJI.js +260 -0
- package/dist/chunk-CHBGCQXG.js +333 -0
- package/dist/chunk-CHBHR5W6.js +3556 -0
- package/dist/chunk-CHUOANKE.js +346 -0
- package/dist/chunk-CSF4RUCN.js +58 -0
- package/dist/chunk-CXKHWCNN.js +204 -0
- package/dist/chunk-CZR6Z5D7.js +330 -0
- package/dist/chunk-D24ANCWY.js +204 -0
- package/dist/chunk-D2T3272U.js +171 -0
- package/dist/chunk-DBJCWK6T.js +377 -0
- package/dist/chunk-DCHEIVGT.js +221 -0
- package/dist/chunk-DF4SM6ZX.js +128 -0
- package/dist/chunk-DHIBLMSP.js +30 -0
- package/dist/chunk-DOAC6CLC.js +127 -0
- package/dist/chunk-DOGNJ4VR.js +818 -0
- package/dist/chunk-DYXJFUCI.js +818 -0
- package/dist/chunk-E2AF2WYY.js +346 -0
- package/dist/chunk-E2KZEZZW.js +1090 -0
- package/dist/chunk-E4KWB4WM.js +348 -0
- package/dist/chunk-EGR2NYID.js +50 -0
- package/dist/chunk-ENU7URWK.js +1073 -0
- package/dist/chunk-EQ5UBJGX.js +81 -0
- package/dist/chunk-EZ7KAZMC.js +132 -0
- package/dist/chunk-F4FSSHR4.js +1073 -0
- package/dist/chunk-FBRQGHSU.js +377 -0
- package/dist/chunk-FPXU56FG.js +346 -0
- package/dist/chunk-FY7HHR5I.js +128 -0
- package/dist/chunk-FZ42OCSP.js +333 -0
- package/dist/chunk-G2S2UMU4.js +159 -0
- package/dist/chunk-G33BHQCO.js +70 -0
- package/dist/chunk-G5HWDSBH.js +50 -0
- package/dist/chunk-GCBG5TFS.js +1345 -0
- package/dist/chunk-GESN6IDC.js +127 -0
- package/dist/chunk-GHD7QG6P.js +58 -0
- package/dist/chunk-GJAILPCX.js +171 -0
- package/dist/chunk-GJQTL7RX.js +127 -0
- package/dist/chunk-GKUODJS7.js +214 -0
- package/dist/chunk-GLCKDEM2.js +97 -0
- package/dist/chunk-GLDM2FOM.js +76 -0
- package/dist/chunk-GMA34SXV.js +240 -0
- package/dist/chunk-GMM2BLFB.js +127 -0
- package/dist/chunk-GNM75IOI.js +159 -0
- package/dist/chunk-GVAVEBYR.js +2091 -0
- package/dist/chunk-GYIX2HLD.js +81 -0
- package/dist/chunk-H4LLEQ3F.js +551 -0
- package/dist/chunk-HBVCBBDA.js +127 -0
- package/dist/chunk-HBYRWOH5.js +171 -0
- package/dist/chunk-HFINM2JG.js +284 -0
- package/dist/chunk-HJGHALOG.js +1345 -0
- package/dist/chunk-HOSJTLBQ.js +513 -0
- package/dist/chunk-HRB5CP43.js +13745 -0
- package/dist/chunk-IC6HVAS3.js +56 -0
- package/dist/chunk-IDCLPPIM.js +3959 -0
- package/dist/chunk-IDFJNO44.js +1051 -0
- package/dist/chunk-II5SVNBN.js +551 -0
- package/dist/chunk-IIRLKWNZ.js +50 -0
- package/dist/chunk-ILFJMEY5.js +97 -0
- package/dist/chunk-IQXLUTWC.js +50 -0
- package/dist/chunk-ISQAOSL3.js +1921 -0
- package/dist/chunk-IWXTFDLS.js +244 -0
- package/dist/chunk-J2TGVCPE.js +1090 -0
- package/dist/chunk-J4Z5GAJ4.js +551 -0
- package/dist/chunk-J6V2DCZK.js +382 -0
- package/dist/chunk-JJSDZFKM.js +1148 -0
- package/dist/chunk-JMN2KOC4.js +128 -0
- package/dist/chunk-JP4CLFLR.js +1148 -0
- package/dist/chunk-JQVYPBR2.js +81 -0
- package/dist/chunk-JTIOZHWG.js +58 -0
- package/dist/chunk-KDICWAYV.js +1345 -0
- package/dist/chunk-KMU7PFO3.js +1148 -0
- package/dist/chunk-KOBIB6WG.js +159 -0
- package/dist/chunk-KQFDDQB6.js +13696 -0
- package/dist/chunk-KZNSOHCB.js +280 -0
- package/dist/chunk-LDDCAATQ.js +1090 -0
- package/dist/chunk-LJN2O5IG.js +197 -0
- package/dist/chunk-LSIYHKDS.js +54 -0
- package/dist/chunk-LVMBYP3C.js +171 -0
- package/dist/chunk-M2WQW5NC.js +227 -0
- package/dist/chunk-MREDKOS4.js +731 -0
- package/dist/chunk-MSF2Y5MS.js +346 -0
- package/dist/chunk-MY647ZHR.js +448 -0
- package/dist/chunk-MY6SP5NZ.js +551 -0
- package/dist/chunk-MZ5CEHPQ.js +89 -0
- package/dist/chunk-N2ACW2ZG.js +363 -0
- package/dist/chunk-NESTX6DR.js +76 -0
- package/dist/chunk-NQZORF6L.js +731 -0
- package/dist/chunk-NSMJDATI.js +495 -0
- package/dist/chunk-NSQ5JE23.js +1090 -0
- package/dist/chunk-NWEFAFJS.js +197 -0
- package/dist/chunk-NYF7GHC5.js +526 -0
- package/dist/chunk-NZGGRM4P.js +731 -0
- package/dist/chunk-NZL567WG.js +81 -0
- package/dist/chunk-NZM4E6Y3.js +89 -0
- package/dist/chunk-O5OMH6LI.js +244 -0
- package/dist/chunk-O6XF6NUN.js +1090 -0
- package/dist/chunk-OBUV3W7L.js +163 -0
- package/dist/chunk-OF4KG3L7.js +1090 -0
- package/dist/chunk-OLDS7LJN.js +495 -0
- package/dist/chunk-OO2I22RX.js +38 -0
- package/dist/chunk-OPUUT33V.js +447 -0
- package/dist/chunk-OQZPSWVN.js +526 -0
- package/dist/chunk-OR6KJ5HH.js +58 -0
- package/dist/chunk-OT3VMTKB.js +50 -0
- package/dist/chunk-OV6NT6QX.js +128 -0
- package/dist/chunk-P6RVIOVA.js +157 -0
- package/dist/chunk-PDTR3YUU.js +54 -0
- package/dist/chunk-PEGTV6EJ.js +1345 -0
- package/dist/chunk-PITVTSQW.js +333 -0
- package/dist/chunk-PSUAO4MZ.js +345 -0
- package/dist/chunk-PUA5564C.js +210 -0
- package/dist/chunk-PUQLKLQX.js +731 -0
- package/dist/chunk-PWQIS5E5.js +382 -0
- package/dist/chunk-PXXHKWDH.js +818 -0
- package/dist/chunk-QOC46BDY.js +346 -0
- package/dist/chunk-QROKS65G.js +76 -0
- package/dist/chunk-R54I2N2T.js +818 -0
- package/dist/chunk-RCFYQHUP.js +818 -0
- package/dist/chunk-RJTND4YS.js +284 -0
- package/dist/chunk-RTA6KSSK.js +89 -0
- package/dist/chunk-SBLHQMMZ.js +81 -0
- package/dist/chunk-SBX6HSEO.js +159 -0
- package/dist/chunk-SEUST6U5.js +284 -0
- package/dist/chunk-SG2ANG5C.js +123 -0
- package/dist/chunk-SUEQF3ZS.js +214 -0
- package/dist/chunk-SVFNKSZV.js +333 -0
- package/dist/chunk-SWNAM2NW.js +526 -0
- package/dist/chunk-TAQT2DC7.js +330 -0
- package/dist/chunk-TB7HFW7M.js +127 -0
- package/dist/chunk-TBJP46RP.js +1148 -0
- package/dist/chunk-TS7NGPU4.js +1073 -0
- package/dist/chunk-TUPDOPMG.js +731 -0
- package/dist/chunk-TYKUZVCA.js +1921 -0
- package/dist/chunk-TZMXJVZV.js +345 -0
- package/dist/chunk-U2DCN7M6.js +1073 -0
- package/dist/chunk-UJZPLZLU.js +197 -0
- package/dist/chunk-UKRKOJQZ.js +54 -0
- package/dist/chunk-UUKDAIH2.js +731 -0
- package/dist/chunk-V6VEFEEH.js +1345 -0
- package/dist/chunk-VCVGE7HK.js +1921 -0
- package/dist/chunk-VIO2ALGH.js +290 -0
- package/dist/chunk-VK6YZ6K7.js +1073 -0
- package/dist/chunk-VKCUSNJW.js +377 -0
- package/dist/chunk-VKT4N6WM.js +495 -0
- package/dist/chunk-VQUEP7UA.js +244 -0
- package/dist/chunk-VRPPJFIQ.js +1921 -0
- package/dist/chunk-VXODHQXB.js +377 -0
- package/dist/chunk-WHK7GXFR.js +13745 -0
- package/dist/chunk-WP3PVBBP.js +204 -0
- package/dist/chunk-WQEUY7DC.js +129 -0
- package/dist/chunk-WWPJTPPQ.js +197 -0
- package/dist/chunk-WXMXUKCA.js +262 -0
- package/dist/chunk-WYZSWV6A.js +346 -0
- package/dist/chunk-X2WBH2IO.js +297 -0
- package/dist/chunk-X33TSJNO.js +394 -0
- package/dist/chunk-X7MMI2UI.js +89 -0
- package/dist/chunk-XD6VOXK3.js +159 -0
- package/dist/chunk-XG3BQZIK.js +85 -0
- package/dist/chunk-XIKBIAOS.js +75 -0
- package/dist/chunk-XPEB545Q.js +54 -0
- package/dist/chunk-XWH2MLWS.js +330 -0
- package/dist/chunk-YH7V73XW.js +89 -0
- package/dist/chunk-YHSATGMH.js +3955 -0
- package/dist/chunk-YJBCGD46.js +13745 -0
- package/dist/chunk-YLOJPYCJ.js +284 -0
- package/dist/chunk-YMLM5D65.js +135 -0
- package/dist/chunk-YNJPRQ6J.js +377 -0
- package/dist/chunk-YSNEHBI6.js +551 -0
- package/dist/chunk-Z33XSFND.js +76 -0
- package/dist/chunk-ZA7N3ZTA.js +1921 -0
- package/dist/chunk-ZD6BMW2K.js +33 -0
- package/dist/chunk-ZFRG2MNB.js +382 -0
- package/dist/chunk-ZKG5IYCG.js +668 -0
- package/dist/chunk-ZRRRSVQF.js +204 -0
- package/dist/chunk-ZU4K7ZNX.js +197 -0
- package/dist/co-activation-HZMJC34P.js +72 -0
- package/dist/co-occurrence-AVYXRV4L.js +74 -0
- package/dist/core-memory-554Q3YN5.js +110 -0
- package/dist/core-memory-BC4YN5F4.js +110 -0
- package/dist/core-memory-NID6R3YR.js +110 -0
- package/dist/core-memory-NPJCVUMF.js +110 -0
- package/dist/core-memory-OKGXL33Z.js +110 -0
- package/dist/core-memory-XHIC5NAB.js +110 -0
- package/dist/crdt-sync-ZCH55JNR.js +33 -0
- package/dist/crm-webhook-6OMVUUGR.js +10 -0
- package/dist/crm-webhook-MHZTXU5N.js +10 -0
- package/dist/crm-webhook-TMWJT2Z5.js +10 -0
- package/dist/crm-webhook-UCWF3XDB.js +10 -0
- package/dist/crm-webhook-XISULXI7.js +10 -0
- package/dist/crm-webhook-YJ5A7F2E.js +10 -0
- package/dist/cto-delegation-gate-4PMJZL2T.js +206 -0
- package/dist/cto-delegation-gate-A7YKXTRO.js +206 -0
- package/dist/cto-delegation-gate-JFZFZGC2.js +206 -0
- package/dist/cto-delegation-gate-K32M4GVM.js +206 -0
- package/dist/cto-delegation-gate-OREBAHUM.js +206 -0
- package/dist/cto-delegation-gate-POHESML5.js +206 -0
- package/dist/daemon-orchestration-2Q7BYOHC.js +135 -0
- package/dist/daemon-orchestration-4RJ2CZJL.js +135 -0
- package/dist/daemon-orchestration-HXYPHSYU.js +135 -0
- package/dist/daemon-orchestration-I5BE46P3.js +135 -0
- package/dist/daemon-orchestration-NKE4FYQS.js +135 -0
- package/dist/daemon-orchestration-YWEXRAZA.js +135 -0
- package/dist/db-backup-5GA2YFDX.js +33 -0
- package/dist/dreaming-3F72ROTL.js +32 -0
- package/dist/dreaming-I6KXO6E2.js +32 -0
- package/dist/dreaming-JD7MNJGS.js +32 -0
- package/dist/dreaming-LCKPA3B4.js +32 -0
- package/dist/dreaming-NJBK5ILR.js +32 -0
- package/dist/dreaming-SDS5IQYC.js +32 -0
- package/dist/exe-drift-VSMIMHL4.js +68 -0
- package/dist/exe-export-DVHHIA6Y.js +73 -0
- package/dist/exe-export-GIVQDENS.js +73 -0
- package/dist/exe-export-IZ2OYMT4.js +73 -0
- package/dist/exe-export-JNWX6ZCQ.js +73 -0
- package/dist/exe-export-OQXCJLWB.js +73 -0
- package/dist/exe-export-YLVAZQAV.js +73 -0
- package/dist/exe-import-7N46LSMQ.js +76 -0
- package/dist/exe-import-AEJYBLA7.js +76 -0
- package/dist/exe-import-FINYUV5T.js +76 -0
- package/dist/exe-import-HWPYARCG.js +76 -0
- package/dist/exe-import-K4TWTG24.js +76 -0
- package/dist/exe-import-LZKZQ54C.js +76 -0
- package/dist/exe-key-6FPQHBW6.js +579 -0
- package/dist/exe-key-H45JY44F.js +579 -0
- package/dist/exe-key-MAEQGTB7.js +579 -0
- package/dist/exe-key-N3XYSEXP.js +579 -0
- package/dist/exe-key-Q3ZNYT6L.js +579 -0
- package/dist/exe-key-Q47RPB45.js +579 -0
- package/dist/exe-snapshot-2USE2HHM.js +164 -0
- package/dist/exe-snapshot-3TEM3BFD.js +164 -0
- package/dist/exe-snapshot-HECGUHL3.js +164 -0
- package/dist/exe-snapshot-HZU66HXX.js +164 -0
- package/dist/exe-snapshot-L7OQWZUH.js +164 -0
- package/dist/exe-snapshot-X5N5KIVJ.js +164 -0
- package/dist/fast-db-init-3CNTADVO.js +7 -0
- package/dist/fast-db-init-C6IPNVPU.js +7 -0
- package/dist/fast-db-init-HXCS2AP5.js +7 -0
- package/dist/fast-db-init-I7CMGBAN.js +7 -0
- package/dist/fast-db-init-P6YESOUL.js +7 -0
- package/dist/fast-db-init-VDNEFVQF.js +7 -0
- package/dist/gateway/index.js +8 -8
- package/dist/git-staleness-YCEBBIVK.js +110 -0
- package/dist/git-task-sweep-C4OV2CEY.js +40 -0
- package/dist/git-task-sweep-H34STRNT.js +40 -0
- package/dist/git-task-sweep-J66SYJMW.js +40 -0
- package/dist/git-task-sweep-JYCD3ZKQ.js +40 -0
- package/dist/git-task-sweep-O723DB7F.js +40 -0
- package/dist/git-task-sweep-YL7NLDCK.js +40 -0
- package/dist/global-procedures-IHZM6C2K.js +20 -0
- package/dist/graph-auto-extract-RZQ3MHP2.js +162 -0
- package/dist/hooks/bug-report-worker.js +12 -12
- package/dist/hooks/codex-stop-task-finalizer.js +12 -12
- package/dist/hooks/commit-complete.js +12 -12
- package/dist/hooks/error-recall.js +6 -6
- package/dist/hooks/exe-heartbeat-hook.js +3 -3
- package/dist/hooks/ingest.js +6 -6
- package/dist/hooks/instructions-loaded.js +4 -4
- package/dist/hooks/manifest.json +19 -19
- package/dist/hooks/notification.js +4 -4
- package/dist/hooks/post-compact.js +11 -11
- package/dist/hooks/post-tool-combined.js +5 -5
- package/dist/hooks/pre-compact.js +12 -12
- package/dist/hooks/pre-tool-use.js +15 -15
- package/dist/hooks/prompt-submit.js +21 -21
- package/dist/hooks/session-end.js +16 -16
- package/dist/hooks/session-start.js +10 -10
- package/dist/hooks/stop.js +15 -15
- package/dist/hooks/subagent-stop.js +11 -11
- package/dist/hooks/summary-worker.js +15 -15
- package/dist/index.js +18 -18
- package/dist/installer-4EW5ZDGD.js +296 -0
- package/dist/installer-B2JTQO55.js +38 -0
- package/dist/installer-MIL352T7.js +342 -0
- package/dist/lib/agent-config.js +9 -3
- package/dist/lib/cloud-sync.js +4 -4
- package/dist/lib/consolidation.js +5 -5
- package/dist/lib/database.js +2 -2
- package/dist/lib/db.js +2 -2
- package/dist/lib/employee-templates.js +4 -4
- package/dist/lib/employees.js +2 -2
- package/dist/lib/exe-daemon.js +35 -34
- package/dist/lib/hybrid-search.js +5 -5
- package/dist/lib/identity.js +2 -2
- package/dist/lib/messaging.js +12 -10
- package/dist/lib/reminders.js +3 -3
- package/dist/lib/schedules.js +5 -5
- package/dist/lib/session-registry.js +4 -4
- package/dist/lib/skill-learning.js +4 -4
- package/dist/lib/store.js +4 -4
- package/dist/lib/task-router.js +3 -3
- package/dist/lib/tasks.js +11 -11
- package/dist/lib/tmux-routing.js +9 -9
- package/dist/lib/token-spend.js +3 -3
- package/dist/mcp/register-tools.js +54 -54
- package/dist/mcp/server.js +55 -55
- package/dist/mcp/tools/complete-reminder.js +4 -4
- package/dist/mcp/tools/create-reminder.js +4 -4
- package/dist/mcp/tools/create-task.js +13 -13
- package/dist/mcp/tools/deactivate-behavior.js +5 -5
- package/dist/mcp/tools/list-reminders.js +4 -4
- package/dist/mcp/tools/list-tasks.js +13 -13
- package/dist/mcp/tools/send-message.js +12 -12
- package/dist/mcp/tools/update-task.js +12 -12
- package/dist/mcp-http-config-OJQR246S.js +27 -0
- package/dist/memory-cards-IPULSQFA.js +174 -0
- package/dist/memory-graph-extractor-3TZZOKHY.js +17 -0
- package/dist/memory-poisoning-defense-SGUGR5YJ.js +225 -0
- package/dist/memory-reflection-H3WGCEM6.js +238 -0
- package/dist/notifications-65STXW6N.js +45 -0
- package/dist/notifications-K3JDUPL5.js +45 -0
- package/dist/notifications-KQOD66ZK.js +45 -0
- package/dist/notifications-PFK5OQEF.js +45 -0
- package/dist/notifications-VWPO6NJF.js +45 -0
- package/dist/notifications-WCSRQN2V.js +45 -0
- package/dist/orchestration-events-O5PSDEIO.js +25 -0
- package/dist/orchestrator-3D7QEVGP.js +33 -0
- package/dist/orchestrator-CC32RZO5.js +33 -0
- package/dist/orchestrator-DWAYSAFR.js +33 -0
- package/dist/orchestrator-RAPEJUOI.js +33 -0
- package/dist/orchestrator-TL37EAWA.js +33 -0
- package/dist/orchestrator-XPG6LJAI.js +33 -0
- package/dist/pipeline-router-5NT6FUC3.js +13 -0
- package/dist/pipeline-router-ADLTS6DZ.js +13 -0
- package/dist/pipeline-router-KSUXONDT.js +13 -0
- package/dist/pipeline-router-O6ZLSM6U.js +13 -0
- package/dist/pipeline-router-QKLYUYU7.js +13 -0
- package/dist/pipeline-router-W2W5XDND.js +13 -0
- package/dist/plan-limits-53NXLNDQ.js +26 -0
- package/dist/project-boot-ITN3FZMM.js +299 -0
- package/dist/projection-worker-27XX5M2W.js +964 -0
- package/dist/reranker-3KLYAHO4.js +19 -0
- package/dist/reranker-64KDRYPP.js +19 -0
- package/dist/reranker-GU7L2PJX.js +19 -0
- package/dist/reranker-MGY5A7BQ.js +19 -0
- package/dist/reranker-TZEXIJAN.js +19 -0
- package/dist/reranker-ZBX6HSU2.js +19 -0
- package/dist/review-polling-3ZZ2T26N.js +124 -0
- package/dist/review-polling-BBQUF54Q.js +124 -0
- package/dist/review-polling-FA2J2Q5O.js +124 -0
- package/dist/review-polling-MLS4BQ3N.js +124 -0
- package/dist/review-polling-RXQZPGRY.js +124 -0
- package/dist/review-polling-YBB6DKA5.js +124 -0
- package/dist/runtime/index.js +12 -12
- package/dist/session-events-EAODNMNR.js +36 -0
- package/dist/session-events-MVO6JNUL.js +36 -0
- package/dist/session-events-PRVDH3QS.js +36 -0
- package/dist/session-events-PU5OQKMB.js +36 -0
- package/dist/session-events-WWGF3B2N.js +36 -0
- package/dist/session-events-ZHXXAH6B.js +36 -0
- package/dist/session-kill-telemetry-O4TJHHOZ.js +29 -0
- package/dist/session-scope-CQXB7VMH.js +86 -0
- package/dist/session-scope-HHUMJYF6.js +86 -0
- package/dist/session-scope-M47JR2SD.js +86 -0
- package/dist/session-scope-MRQYSD5S.js +86 -0
- package/dist/session-scope-TAH5BUYW.js +86 -0
- package/dist/session-scope-UXZ6RUWC.js +86 -0
- package/dist/setup-wizard-UM2RHSBJ.js +12 -0
- package/dist/skill-refinement-447DZWNK.js +157 -0
- package/dist/skill-refinement-567JSF7L.js +157 -0
- package/dist/skill-refinement-6JVQ3TMS.js +157 -0
- package/dist/skill-refinement-MJPOHYD5.js +157 -0
- package/dist/skill-refinement-NVUBRK22.js +157 -0
- package/dist/skill-refinement-XNGD3C62.js +157 -0
- package/dist/stack-release-BAPCXMXW.js +713 -0
- package/dist/stack-release-W4TWTEZP.js +731 -0
- package/dist/steward-gate-VLE7OCKO.js +13 -0
- package/dist/task-enforcement-AZEO67N6.js +391 -0
- package/dist/task-enforcement-EOYP6IO4.js +391 -0
- package/dist/task-enforcement-FUHDL6UR.js +391 -0
- package/dist/task-enforcement-L5XQKFOV.js +391 -0
- package/dist/task-enforcement-QL3K4N3F.js +391 -0
- package/dist/task-enforcement-RJPWWEAE.js +391 -0
- package/dist/task-scope-DRQRNWB7.js +35 -0
- package/dist/task-scope-GS7TS3UV.js +35 -0
- package/dist/task-scope-KQNCP42W.js +35 -0
- package/dist/task-scope-SM5F6RD3.js +35 -0
- package/dist/task-scope-TZYMB634.js +35 -0
- package/dist/task-scope-ZVLUBS4C.js +35 -0
- package/dist/tasks-crud-4MSLJWXE.js +77 -0
- package/dist/tasks-crud-6TWWETGB.js +77 -0
- package/dist/tasks-crud-DBHYO4MM.js +77 -0
- package/dist/tasks-crud-EFYWPPEI.js +77 -0
- package/dist/tasks-crud-HIPXKRKX.js +77 -0
- package/dist/tasks-crud-JIS5B4GZ.js +77 -0
- package/dist/tasks-notify-7JBUNE7R.js +38 -0
- package/dist/tasks-notify-GEJKT5TO.js +38 -0
- package/dist/tasks-notify-OW3JDPLK.js +38 -0
- package/dist/tasks-notify-UPIJ3L4O.js +38 -0
- package/dist/tasks-notify-W5WVP2FG.js +38 -0
- package/dist/tasks-notify-YKEOYOKN.js +38 -0
- package/dist/tasks-review-5SJSFTUB.js +47 -0
- package/dist/tasks-review-DRKN34HO.js +47 -0
- package/dist/tasks-review-IQSAXXXE.js +47 -0
- package/dist/tasks-review-JHSYBR5I.js +47 -0
- package/dist/tasks-review-KWELLLS3.js +47 -0
- package/dist/tasks-review-SUJ6AKAS.js +47 -0
- package/dist/telemetry-upload-BSGOXGUP.js +739 -0
- package/dist/telemetry-upload-FPQAB6ZU.js +739 -0
- package/dist/telemetry-upload-LTX3C5HZ.js +739 -0
- package/dist/telemetry-upload-MYVBVUGE.js +739 -0
- package/dist/telemetry-upload-UPAABLGK.js +739 -0
- package/dist/telemetry-upload-UYEHBFGO.js +739 -0
- package/dist/token-budget-2CDWQU3Q.js +84 -0
- package/dist/tool-telemetry-7YS7EN7B.js +17 -0
- package/dist/tui/App.js +17 -17
- package/dist/tui-data-GDGBOS6G.js +258 -0
- package/dist/tui-data-LYUZFNO4.js +258 -0
- package/dist/tui-data-QM5BOKRF.js +258 -0
- package/dist/tui-data-VAE43SM3.js +258 -0
- package/dist/tui-data-VXF2RBVM.js +258 -0
- package/dist/tui-data-X7HT3FXF.js +258 -0
- package/dist/wiki-acl-MJIMXRQV.js +111 -0
- package/dist/worker-gate-BZBWTMCY.js +21 -0
- package/dist/worker-gate-CHVL6UGT.js +21 -0
- package/dist/worker-gate-KQFS4RJE.js +21 -0
- package/dist/worker-gate-NRP7CMS7.js +21 -0
- package/dist/worker-gate-WQGTZOSM.js +21 -0
- package/dist/worker-gate-X2YDTKTL.js +21 -0
- package/dist/workflow-engine-AKKOMJJQ.js +28 -0
- package/dist/workflow-engine-CYXRZXBM.js +28 -0
- package/dist/workflow-engine-EHWQO3LX.js +28 -0
- package/dist/workflow-engine-I3OUMSF4.js +28 -0
- package/dist/workflow-engine-KMLAXVA4.js +28 -0
- package/dist/workflow-engine-PHTLEAXP.js +28 -0
- package/dist/worktree-NLSKVRNC.js +26 -0
- package/dist/worktree-sweep-44TMEPLE.js +19 -0
- package/package.json +1 -1
- package/release-notes.json +46 -35
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
// src/automation/trigger-engine.ts
|
|
2
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
3
|
+
import { randomUUID } from "crypto";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import os from "os";
|
|
6
|
+
var TRIGGERS_PATH = path.join(os.homedir(), ".exe-os", "triggers.json");
|
|
7
|
+
var GRAPH_API_VERSION = "v21.0";
|
|
8
|
+
var MAX_PARAM_LENGTH = 2e3;
|
|
9
|
+
var MAX_TRIGGER_DEPTH = 3;
|
|
10
|
+
var _currentTriggerDepth = 0;
|
|
11
|
+
var OUTBOUND_RATE_LIMIT_PER_HOUR = 100;
|
|
12
|
+
var _outboundWindows = /* @__PURE__ */ new Map();
|
|
13
|
+
function checkOutboundRateLimit(channel) {
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
const cutoff = now - 36e5;
|
|
16
|
+
if (!_outboundWindows.has(channel)) _outboundWindows.set(channel, []);
|
|
17
|
+
const window = _outboundWindows.get(channel);
|
|
18
|
+
while (window.length > 0 && window[0] < cutoff) window.shift();
|
|
19
|
+
if (window.length >= OUTBOUND_RATE_LIMIT_PER_HOUR) return false;
|
|
20
|
+
window.push(now);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
function sanitizeParam(value, maxLen = MAX_PARAM_LENGTH) {
|
|
24
|
+
const cleaned = value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, "");
|
|
25
|
+
return cleaned.length > maxLen ? cleaned.slice(0, maxLen) : cleaned;
|
|
26
|
+
}
|
|
27
|
+
function sanitizeExternalPayload(text) {
|
|
28
|
+
let sanitized = text;
|
|
29
|
+
sanitized = sanitized.replace(/^(system|SYSTEM|System)\s*:/gm, "[filtered]:");
|
|
30
|
+
sanitized = sanitized.replace(/<\/?system[^>]*>/gi, "[filtered]");
|
|
31
|
+
sanitized = sanitized.replace(/ignore\s+(all\s+)?previous\s+(instructions|prompts|rules)/gi, "[filtered]");
|
|
32
|
+
sanitized = sanitized.replace(/you\s+are\s+now\s+/gi, "[filtered] ");
|
|
33
|
+
return sanitized;
|
|
34
|
+
}
|
|
35
|
+
function substituteTemplate(template, record, sanitizeExternal = false) {
|
|
36
|
+
return template.replace(
|
|
37
|
+
/\{\{(\w+(?:\.\w+)*)\}\}/g,
|
|
38
|
+
(_match, dotPath) => {
|
|
39
|
+
const segments = dotPath.split(".");
|
|
40
|
+
if (segments[0] === "record") segments.shift();
|
|
41
|
+
let current = record;
|
|
42
|
+
for (const seg of segments) {
|
|
43
|
+
if (current == null || typeof current !== "object") return "";
|
|
44
|
+
current = current[seg];
|
|
45
|
+
}
|
|
46
|
+
if (current == null) return "";
|
|
47
|
+
const value = String(current);
|
|
48
|
+
return sanitizeExternal ? sanitizeExternalPayload(value) : value;
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function resolveFieldValue(record, field) {
|
|
53
|
+
let current = record;
|
|
54
|
+
for (const segment of field.split(".")) {
|
|
55
|
+
if (current == null || typeof current !== "object") return void 0;
|
|
56
|
+
current = current[segment];
|
|
57
|
+
}
|
|
58
|
+
return current;
|
|
59
|
+
}
|
|
60
|
+
function evaluateCondition(condition, record) {
|
|
61
|
+
const fieldValue = resolveFieldValue(record, condition.field);
|
|
62
|
+
const target = condition.value;
|
|
63
|
+
switch (condition.op) {
|
|
64
|
+
case "eq":
|
|
65
|
+
return String(fieldValue) === String(target);
|
|
66
|
+
case "neq":
|
|
67
|
+
return String(fieldValue) !== String(target);
|
|
68
|
+
case "gt":
|
|
69
|
+
return Number(fieldValue) > Number(target);
|
|
70
|
+
case "lt":
|
|
71
|
+
return Number(fieldValue) < Number(target);
|
|
72
|
+
case "gte":
|
|
73
|
+
return Number(fieldValue) >= Number(target);
|
|
74
|
+
case "lte":
|
|
75
|
+
return Number(fieldValue) <= Number(target);
|
|
76
|
+
case "contains":
|
|
77
|
+
return String(fieldValue).toLowerCase().includes(String(target).toLowerCase());
|
|
78
|
+
case "not_contains":
|
|
79
|
+
return !String(fieldValue).toLowerCase().includes(String(target).toLowerCase());
|
|
80
|
+
default:
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function evaluateConditions(conditions, record) {
|
|
85
|
+
if (conditions.length === 0) return true;
|
|
86
|
+
return conditions.every((c) => evaluateCondition(c, record));
|
|
87
|
+
}
|
|
88
|
+
function loadTriggers(project) {
|
|
89
|
+
if (!existsSync(TRIGGERS_PATH)) return [];
|
|
90
|
+
try {
|
|
91
|
+
const raw = readFileSync(TRIGGERS_PATH, "utf-8");
|
|
92
|
+
const all = JSON.parse(raw);
|
|
93
|
+
if (!Array.isArray(all)) return [];
|
|
94
|
+
if (project) {
|
|
95
|
+
return all.filter((t) => !t.project || t.project === project);
|
|
96
|
+
}
|
|
97
|
+
return all;
|
|
98
|
+
} catch {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function saveTriggers(triggers) {
|
|
103
|
+
const dir = path.dirname(TRIGGERS_PATH);
|
|
104
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
105
|
+
writeFileSync(TRIGGERS_PATH, JSON.stringify(triggers, null, 2), "utf-8");
|
|
106
|
+
}
|
|
107
|
+
function createNewTrigger(input) {
|
|
108
|
+
const triggers = loadTriggers();
|
|
109
|
+
const trigger = {
|
|
110
|
+
id: randomUUID().slice(0, 8),
|
|
111
|
+
...input
|
|
112
|
+
};
|
|
113
|
+
triggers.push(trigger);
|
|
114
|
+
saveTriggers(triggers);
|
|
115
|
+
return trigger;
|
|
116
|
+
}
|
|
117
|
+
async function executeSendWhatsapp(params) {
|
|
118
|
+
if (!checkOutboundRateLimit("whatsapp")) {
|
|
119
|
+
throw new Error(`Outbound rate limit exceeded for WhatsApp (max ${OUTBOUND_RATE_LIMIT_PER_HOUR}/hour)`);
|
|
120
|
+
}
|
|
121
|
+
const { getAccountByName, getDefaultAccount } = await import("./whatsapp-accounts-BWRZUY23.js");
|
|
122
|
+
const account = params.account ? getAccountByName(params.account) : getDefaultAccount();
|
|
123
|
+
if (!account) {
|
|
124
|
+
throw new Error(
|
|
125
|
+
`No WhatsApp account found${params.account ? ` (${params.account})` : ""}`
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
const to = params.to ?? params.recipient;
|
|
129
|
+
const message = params.message ?? params.text;
|
|
130
|
+
if (!to || !message)
|
|
131
|
+
throw new Error("send_whatsapp requires 'to' and 'message' params");
|
|
132
|
+
const url = `https://graph.facebook.com/${GRAPH_API_VERSION}/${account.phoneNumberId}/messages`;
|
|
133
|
+
const res = await fetch(url, {
|
|
134
|
+
method: "POST",
|
|
135
|
+
headers: {
|
|
136
|
+
"Content-Type": "application/json",
|
|
137
|
+
Authorization: `Bearer ${account.accessToken}`
|
|
138
|
+
},
|
|
139
|
+
body: JSON.stringify({
|
|
140
|
+
messaging_product: "whatsapp",
|
|
141
|
+
to,
|
|
142
|
+
type: "text",
|
|
143
|
+
text: { body: message }
|
|
144
|
+
}),
|
|
145
|
+
signal: AbortSignal.timeout(3e4)
|
|
146
|
+
});
|
|
147
|
+
if (!res.ok) {
|
|
148
|
+
const errBody = await res.text();
|
|
149
|
+
throw new Error(`WhatsApp send failed (${res.status}): ${errBody}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async function executeSendMessage(params) {
|
|
153
|
+
const { sendMessage } = await import("./lib/messaging.js");
|
|
154
|
+
const { getCoordinatorName } = await import("./lib/employees.js");
|
|
155
|
+
const rawTo = params.to ?? params.recipient;
|
|
156
|
+
const to = rawTo === "coordinator" ? getCoordinatorName() : rawTo;
|
|
157
|
+
const content = params.message ?? params.content ?? params.text;
|
|
158
|
+
if (!to || !content)
|
|
159
|
+
throw new Error("send_message requires 'to' and 'message' params");
|
|
160
|
+
await sendMessage({
|
|
161
|
+
fromAgent: params.from ?? "trigger-engine",
|
|
162
|
+
targetAgent: to,
|
|
163
|
+
content,
|
|
164
|
+
priority: params.priority ?? "normal"
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
async function executeCreateTask(params) {
|
|
168
|
+
const { createTask } = await import("./lib/tasks.js");
|
|
169
|
+
const { getCoordinatorName } = await import("./lib/employees.js");
|
|
170
|
+
const rawAssignedTo = params.assigned_to;
|
|
171
|
+
await createTask({
|
|
172
|
+
title: params.title ?? "Triggered task",
|
|
173
|
+
assignedTo: !rawAssignedTo || rawAssignedTo === "coordinator" ? getCoordinatorName() : rawAssignedTo,
|
|
174
|
+
assignedBy: "trigger-engine",
|
|
175
|
+
projectName: params.project ?? "exe-os",
|
|
176
|
+
priority: params.priority ?? "p1",
|
|
177
|
+
context: params.context ?? params.description ?? "",
|
|
178
|
+
baseDir: process.cwd()
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
async function executeUpdateWiki(params) {
|
|
182
|
+
const apiUrl = process.env.EXE_WIKI_API_URL;
|
|
183
|
+
const apiKey = process.env.EXE_WIKI_API_KEY;
|
|
184
|
+
if (!apiUrl || !apiKey) {
|
|
185
|
+
throw new Error("Wiki not configured: EXE_WIKI_API_URL / EXE_WIKI_API_KEY not set");
|
|
186
|
+
}
|
|
187
|
+
const workspace = params.workspace;
|
|
188
|
+
const content = params.content ?? params.text;
|
|
189
|
+
const mode = params.mode ?? "append";
|
|
190
|
+
const section = params.section;
|
|
191
|
+
if (!workspace || !content) {
|
|
192
|
+
throw new Error("update_wiki requires 'workspace' and 'content' params");
|
|
193
|
+
}
|
|
194
|
+
const documentId = params.document_id;
|
|
195
|
+
if (documentId && mode === "append") {
|
|
196
|
+
const readRes = await fetch(`${apiUrl}/v1/document/${documentId}`, {
|
|
197
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
198
|
+
signal: AbortSignal.timeout(15e3)
|
|
199
|
+
});
|
|
200
|
+
if (!readRes.ok) {
|
|
201
|
+
throw new Error(`Wiki read failed (${readRes.status})`);
|
|
202
|
+
}
|
|
203
|
+
const doc = await readRes.json();
|
|
204
|
+
const existingContent = String(doc.content ?? "");
|
|
205
|
+
const title = String(doc.title ?? "Untitled");
|
|
206
|
+
await fetch(`${apiUrl}/v1/document/${documentId}`, {
|
|
207
|
+
method: "DELETE",
|
|
208
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
209
|
+
signal: AbortSignal.timeout(15e3)
|
|
210
|
+
}).catch((err) => {
|
|
211
|
+
process.stderr.write(`[trigger-engine] wiki purge failed: ${err instanceof Error ? err.message : String(err)}
|
|
212
|
+
`);
|
|
213
|
+
});
|
|
214
|
+
const uploadRes = await fetch(`${apiUrl}/v1/document/raw-text`, {
|
|
215
|
+
method: "POST",
|
|
216
|
+
headers: {
|
|
217
|
+
"Content-Type": "application/json",
|
|
218
|
+
Authorization: `Bearer ${apiKey}`
|
|
219
|
+
},
|
|
220
|
+
body: JSON.stringify({
|
|
221
|
+
textContent: section ? existingContent + `
|
|
222
|
+
|
|
223
|
+
## ${section}
|
|
224
|
+
${content}` : existingContent + "\n\n" + content,
|
|
225
|
+
metadata: { title },
|
|
226
|
+
workspaceSlugs: [workspace]
|
|
227
|
+
}),
|
|
228
|
+
signal: AbortSignal.timeout(15e3)
|
|
229
|
+
});
|
|
230
|
+
if (!uploadRes.ok) throw new Error(`Wiki upload failed (${uploadRes.status})`);
|
|
231
|
+
} else {
|
|
232
|
+
const title = params.title ?? "Auto-generated";
|
|
233
|
+
const res = await fetch(`${apiUrl}/v1/document/raw-text`, {
|
|
234
|
+
method: "POST",
|
|
235
|
+
headers: {
|
|
236
|
+
"Content-Type": "application/json",
|
|
237
|
+
Authorization: `Bearer ${apiKey}`
|
|
238
|
+
},
|
|
239
|
+
body: JSON.stringify({
|
|
240
|
+
textContent: content,
|
|
241
|
+
metadata: { title },
|
|
242
|
+
workspaceSlugs: [workspace]
|
|
243
|
+
}),
|
|
244
|
+
signal: AbortSignal.timeout(15e3)
|
|
245
|
+
});
|
|
246
|
+
if (!res.ok) throw new Error(`Wiki create failed (${res.status})`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
async function routeToApproval(action, resolvedParams, triggerName) {
|
|
250
|
+
const { createTask } = await import("./lib/tasks.js");
|
|
251
|
+
const { getCoordinatorName } = await import("./lib/employees.js");
|
|
252
|
+
const actionSummary = action.type === "send_whatsapp" ? `Send WhatsApp to ${resolvedParams.to ?? resolvedParams.recipient ?? "unknown"}: "${(resolvedParams.message ?? resolvedParams.text ?? "").slice(0, 100)}"` : `${action.type}: ${JSON.stringify(resolvedParams).slice(0, 200)}`;
|
|
253
|
+
await createTask({
|
|
254
|
+
title: `[Approval Required] ${triggerName}: ${action.type}`,
|
|
255
|
+
assignedTo: getCoordinatorName(),
|
|
256
|
+
assignedBy: "trigger-engine",
|
|
257
|
+
projectName: resolvedParams.project ?? "exe-os",
|
|
258
|
+
priority: "p1",
|
|
259
|
+
context: `Trigger "${triggerName}" wants to execute this action but requires approval.
|
|
260
|
+
|
|
261
|
+
**Action:** ${action.type}
|
|
262
|
+
**Summary:** ${actionSummary}
|
|
263
|
+
**Full params:** ${JSON.stringify(resolvedParams, null, 2)}
|
|
264
|
+
|
|
265
|
+
To approve, manually run the action via MCP tools.`,
|
|
266
|
+
baseDir: process.cwd()
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
async function executeAction(action, record, executor, triggerName) {
|
|
270
|
+
if (executor) {
|
|
271
|
+
return executor(action, record);
|
|
272
|
+
}
|
|
273
|
+
const resolvedParams = {};
|
|
274
|
+
for (const [key, val] of Object.entries(action.params)) {
|
|
275
|
+
resolvedParams[key] = sanitizeParam(substituteTemplate(val, record));
|
|
276
|
+
}
|
|
277
|
+
if (action.requires_approval) {
|
|
278
|
+
try {
|
|
279
|
+
await routeToApproval(action, resolvedParams, triggerName ?? "Unknown trigger");
|
|
280
|
+
return { success: true };
|
|
281
|
+
} catch (err) {
|
|
282
|
+
return {
|
|
283
|
+
success: false,
|
|
284
|
+
error: `Approval routing failed: ${err instanceof Error ? err.message : String(err)}`
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
try {
|
|
289
|
+
switch (action.type) {
|
|
290
|
+
case "send_whatsapp":
|
|
291
|
+
await executeSendWhatsapp(resolvedParams);
|
|
292
|
+
break;
|
|
293
|
+
case "send_message":
|
|
294
|
+
await executeSendMessage(resolvedParams);
|
|
295
|
+
break;
|
|
296
|
+
case "create_task":
|
|
297
|
+
await executeCreateTask(resolvedParams);
|
|
298
|
+
break;
|
|
299
|
+
case "update_wiki":
|
|
300
|
+
await executeUpdateWiki(resolvedParams);
|
|
301
|
+
break;
|
|
302
|
+
case "asana": {
|
|
303
|
+
const { loadAsanaConfig, executeAsanaOperation } = await import("./asana-MRQ2OQMJ.js");
|
|
304
|
+
const asanaConfig = loadAsanaConfig();
|
|
305
|
+
if (!asanaConfig) throw new Error("Asana not configured: set ASANA_API_TOKEN env var");
|
|
306
|
+
const operation = resolvedParams.operation ?? resolvedParams._operation;
|
|
307
|
+
if (!operation) throw new Error("asana action requires 'operation' param");
|
|
308
|
+
await executeAsanaOperation(asanaConfig, operation, resolvedParams);
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
case "mcp_tool":
|
|
312
|
+
console.log(
|
|
313
|
+
`[trigger-engine] mcp_tool action: ${JSON.stringify(resolvedParams)}`
|
|
314
|
+
);
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
return { success: true };
|
|
318
|
+
} catch (err) {
|
|
319
|
+
return {
|
|
320
|
+
success: false,
|
|
321
|
+
error: err instanceof Error ? err.message : String(err)
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
async function processCRMEvent(event, executor, triggersOverride) {
|
|
326
|
+
if (_currentTriggerDepth >= MAX_TRIGGER_DEPTH) {
|
|
327
|
+
console.error(
|
|
328
|
+
`[trigger-engine] Recursion limit (${MAX_TRIGGER_DEPTH}) reached \u2014 skipping event ${event.objectType}.${event.eventType}`
|
|
329
|
+
);
|
|
330
|
+
return [];
|
|
331
|
+
}
|
|
332
|
+
_currentTriggerDepth++;
|
|
333
|
+
try {
|
|
334
|
+
return await _processCRMEventInner(event, executor, triggersOverride);
|
|
335
|
+
} finally {
|
|
336
|
+
_currentTriggerDepth--;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
async function _processCRMEventInner(event, executor, triggersOverride) {
|
|
340
|
+
const eventString = `${event.objectType}.${event.eventType}`;
|
|
341
|
+
const triggers = triggersOverride ?? loadTriggers();
|
|
342
|
+
const logs = [];
|
|
343
|
+
for (const trigger of triggers) {
|
|
344
|
+
if (!trigger.enabled) continue;
|
|
345
|
+
if (trigger.event !== eventString && trigger.event !== "*") continue;
|
|
346
|
+
if (!evaluateConditions(trigger.conditions, event.record)) continue;
|
|
347
|
+
const actionResults = [];
|
|
348
|
+
for (const action of trigger.actions) {
|
|
349
|
+
const result = await executeAction(action, event.record, executor, trigger.name);
|
|
350
|
+
actionResults.push({
|
|
351
|
+
type: action.type,
|
|
352
|
+
success: result.success,
|
|
353
|
+
error: result.error
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
const log = {
|
|
357
|
+
triggerId: trigger.id,
|
|
358
|
+
triggerName: trigger.name,
|
|
359
|
+
event: eventString,
|
|
360
|
+
firedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
361
|
+
actionsExecuted: actionResults
|
|
362
|
+
};
|
|
363
|
+
logs.push(log);
|
|
364
|
+
console.log(
|
|
365
|
+
`[trigger-engine] Fired "${trigger.name}" on ${eventString}: ${actionResults.filter((a) => a.success).length}/${actionResults.length} actions succeeded`
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
return logs;
|
|
369
|
+
}
|
|
370
|
+
function isScheduledTrigger(trigger) {
|
|
371
|
+
return "schedule" in trigger && "query" in trigger;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export {
|
|
375
|
+
sanitizeParam,
|
|
376
|
+
substituteTemplate,
|
|
377
|
+
loadTriggers,
|
|
378
|
+
createNewTrigger,
|
|
379
|
+
executeAction,
|
|
380
|
+
processCRMEvent,
|
|
381
|
+
isScheduledTrigger
|
|
382
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fastDbInit
|
|
3
|
+
} from "./chunk-SBLHQMMZ.js";
|
|
4
|
+
import {
|
|
5
|
+
sessionScopeFilter
|
|
6
|
+
} from "./chunk-57UAFTO2.js";
|
|
7
|
+
import {
|
|
8
|
+
formatStatusAll,
|
|
9
|
+
formatStatusDeep,
|
|
10
|
+
getEmployeeStatuses,
|
|
11
|
+
inTmux
|
|
12
|
+
} from "./chunk-CX6GL3ZJ.js";
|
|
13
|
+
import {
|
|
14
|
+
getClient,
|
|
15
|
+
isCoordinatorRole,
|
|
16
|
+
loadEmployees
|
|
17
|
+
} from "./chunk-UNCGZXPU.js";
|
|
18
|
+
import {
|
|
19
|
+
isMainModule
|
|
20
|
+
} from "./chunk-6Y4B3QF6.js";
|
|
21
|
+
|
|
22
|
+
// src/bin/exe-status.ts
|
|
23
|
+
async function status(targetEmployee) {
|
|
24
|
+
if (!inTmux()) {
|
|
25
|
+
return "Not in a tmux session. Start tmux first: tmux new-session -s work";
|
|
26
|
+
}
|
|
27
|
+
const employees = await loadEmployees();
|
|
28
|
+
const names = employees.filter((e) => !isCoordinatorRole(e.role)).map((e) => e.name);
|
|
29
|
+
const roles = new Map(employees.map((e) => [e.name, e.role ?? ""]));
|
|
30
|
+
await fastDbInit();
|
|
31
|
+
const client = getClient();
|
|
32
|
+
const taskMap = /* @__PURE__ */ new Map();
|
|
33
|
+
try {
|
|
34
|
+
const esScope = sessionScopeFilter();
|
|
35
|
+
const result = await client.execute({
|
|
36
|
+
sql: `SELECT assigned_to, title, priority FROM tasks
|
|
37
|
+
WHERE status = 'in_progress'${esScope.sql}
|
|
38
|
+
ORDER BY priority ASC, created_at ASC`,
|
|
39
|
+
args: [...esScope.args]
|
|
40
|
+
});
|
|
41
|
+
for (const row of result.rows) {
|
|
42
|
+
const assignee = String(row.assigned_to);
|
|
43
|
+
if (!taskMap.has(assignee)) {
|
|
44
|
+
taskMap.set(assignee, {
|
|
45
|
+
title: String(row.title),
|
|
46
|
+
priority: String(row.priority)
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
} catch {
|
|
51
|
+
}
|
|
52
|
+
if (targetEmployee) {
|
|
53
|
+
if (!names.includes(targetEmployee)) {
|
|
54
|
+
return `Employee "${targetEmployee}" not found. Available: ${names.join(", ")}`;
|
|
55
|
+
}
|
|
56
|
+
const statuses2 = getEmployeeStatuses([targetEmployee]);
|
|
57
|
+
const s = statuses2[0];
|
|
58
|
+
return formatStatusDeep(s, taskMap.get(targetEmployee), roles.get(targetEmployee) ?? "");
|
|
59
|
+
}
|
|
60
|
+
const statuses = getEmployeeStatuses(names);
|
|
61
|
+
return formatStatusAll(statuses, taskMap, roles);
|
|
62
|
+
}
|
|
63
|
+
if (isMainModule(import.meta.url)) {
|
|
64
|
+
const target = process.argv[2];
|
|
65
|
+
status(target).then((output) => {
|
|
66
|
+
process.stdout.write(output + "\n");
|
|
67
|
+
}).catch((err) => {
|
|
68
|
+
process.stderr.write(`Error: ${err instanceof Error ? err.message : String(err)}
|
|
69
|
+
`);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
status
|
|
76
|
+
};
|