abtars 0.2.1-alpha.8 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -42
- package/bundle/{_registry.generated-ADOYFJJ4.js → _registry.generated-FNJOX7VV.js} +19 -16
- package/bundle/{_registry.generated-ADOYFJJ4.js.map → _registry.generated-FNJOX7VV.js.map} +1 -1
- package/bundle/abtars-browser.js +5 -6
- package/bundle/abtars-browser.js.map +2 -2
- package/bundle/abtars-cli.js +339 -271
- package/bundle/abtars-cli.js.map +4 -4
- package/bundle/abtars-restart.js +4 -4
- package/bundle/abtars-rss.js +25 -81
- package/bundle/abtars-rss.js.map +2 -2
- package/bundle/abtars-task.js +4 -5
- package/bundle/abtars-task.js.map +2 -2
- package/bundle/abtars-todo.js +133 -0
- package/bundle/abtars-todo.js.map +7 -0
- package/bundle/abtars.js +239 -155
- package/bundle/abtars.js.map +3 -3
- package/bundle/action-gate-DYV2XQBP.js +191 -0
- package/bundle/action-gate-DYV2XQBP.js.map +7 -0
- package/bundle/{agent-api-rate-limit-C25WGSFF.js → agent-api-rate-limit-R2OFAQ3N.js} +4 -4
- package/bundle/{agent-registry-SYUFNSVB.js → agent-registry-S2MNHQYQ.js} +8 -8
- package/bundle/{bridge-lock-transport-HO545SBK.js → bridge-lock-transport-N6OGDOSE.js} +5 -5
- package/bundle/{browse-delivery-VTLEAVYA.js → browse-delivery-DXGMDMXA.js} +8 -7
- package/bundle/{browser-REIXOJ6S.js → browser-QMYGSP5W.js} +11 -10
- package/bundle/{capability-ILW3D5HS.js → capability-733TLH4W.js} +6 -6
- package/bundle/{chunk-ZVDVNSXK.js → chunk-2SWKJX64.js} +7 -7
- package/bundle/{chunk-PZE3J7ER.js → chunk-3OXQWII3.js} +2 -2
- package/bundle/{chunk-R36WIOYX.js → chunk-3X6VGRL6.js} +33 -6
- package/bundle/chunk-3X6VGRL6.js.map +7 -0
- package/bundle/{chunk-4KJ76TTE.js → chunk-4XW7YA3K.js} +3 -3
- package/bundle/{chunk-Q62SXS73.js → chunk-BBDKU4EH.js} +9 -9
- package/bundle/{chunk-EX2SRTUE.js → chunk-CYSGXNBY.js} +2 -2
- package/bundle/{chunk-LYEAHE5V.js → chunk-DCY7DGMT.js} +2 -2
- package/bundle/chunk-DGS7J4P6.js +13 -0
- package/bundle/chunk-DGS7J4P6.js.map +7 -0
- package/bundle/{chunk-LDKSCXGL.js → chunk-DHPFI7OF.js} +8 -6
- package/bundle/{chunk-LDKSCXGL.js.map → chunk-DHPFI7OF.js.map} +1 -1
- package/bundle/{chunk-G6IXMYIO.js → chunk-DO4INSXE.js} +2 -2
- package/bundle/{chunk-VA5WKN3Z.js → chunk-EGA6JQVV.js} +4 -4
- package/bundle/chunk-EKHNWFEQ.js +85 -0
- package/bundle/chunk-EKHNWFEQ.js.map +7 -0
- package/bundle/{chunk-URAQLQ2U.js → chunk-F3HMZFIL.js} +4 -4
- package/bundle/{chunk-OOKLEC6V.js → chunk-FY3QUO2L.js} +7 -7
- package/bundle/{chunk-2BY6I4P5.js → chunk-GUTRAMK3.js} +2 -2
- package/bundle/{chunk-GPL57SRN.js → chunk-H7RX7UCR.js} +3 -3
- package/bundle/{chunk-BYDUMHXT.js → chunk-HAF2AFBW.js} +2 -2
- package/bundle/{chunk-A5OJYQNU.js → chunk-HCYENZAB.js} +49 -22
- package/bundle/chunk-HCYENZAB.js.map +7 -0
- package/bundle/{chunk-OZ4IZFV4.js → chunk-HJQZP5CK.js} +9 -9
- package/bundle/{chunk-OZ4IZFV4.js.map → chunk-HJQZP5CK.js.map} +2 -2
- package/bundle/{chunk-HEHD3GG5.js → chunk-ITB2K6LI.js} +6 -13
- package/bundle/{chunk-HEHD3GG5.js.map → chunk-ITB2K6LI.js.map} +3 -3
- package/bundle/{chunk-KSEIWT4T.js → chunk-JFKOPNKL.js} +10 -10
- package/bundle/chunk-JFKOPNKL.js.map +7 -0
- package/bundle/{chunk-4BUOO6WI.js → chunk-KL5QRHHK.js} +31 -11
- package/bundle/chunk-KL5QRHHK.js.map +7 -0
- package/bundle/{chunk-KFENC7BM.js → chunk-L33WNMCP.js} +2 -2
- package/bundle/{chunk-JRG4EFMP.js → chunk-LBMETTUP.js} +3 -3
- package/bundle/{chunk-TYVI3ZWA.js → chunk-LJAG2URA.js} +10 -7
- package/bundle/chunk-LJAG2URA.js.map +7 -0
- package/bundle/{chunk-RV54J75Q.js → chunk-MHK4UPM6.js} +13 -12
- package/bundle/chunk-MHK4UPM6.js.map +7 -0
- package/bundle/chunk-NIYVCGBC.js +330 -0
- package/bundle/chunk-NIYVCGBC.js.map +7 -0
- package/bundle/{chunk-P2BZSLJJ.js → chunk-OGZXYN6E.js} +392 -125
- package/bundle/chunk-OGZXYN6E.js.map +7 -0
- package/bundle/{chunk-TOUZC6NR.js → chunk-OKMN6J4Z.js} +3 -3
- package/bundle/{chunk-CELR236Q.js → chunk-Q7CH5DA3.js} +2 -2
- package/bundle/{chunk-XZSYMCLF.js → chunk-QIAFGDRL.js} +7 -7
- package/bundle/chunk-RITEGAW6.js +138 -0
- package/bundle/chunk-RITEGAW6.js.map +7 -0
- package/bundle/{chunk-UDZIZB5F.js → chunk-RTL7HO3N.js} +3 -3
- package/bundle/{chunk-ITG6XGBS.js → chunk-SA44ITVX.js} +10 -10
- package/bundle/{chunk-3MO2MDXJ.js → chunk-SA6YEFNG.js} +3 -3
- package/bundle/{chunk-GBBTK6H2.js → chunk-SRFEIZQT.js} +4 -4
- package/bundle/{chunk-ELRAH7VL.js → chunk-VXUVKC66.js} +3 -3
- package/bundle/{chunk-X5FBUA53.js → chunk-WLAVZSVZ.js} +69 -30
- package/bundle/chunk-WLAVZSVZ.js.map +7 -0
- package/bundle/{chunk-RSWUPUNA.js → chunk-WMWI3SJ7.js} +30 -6
- package/bundle/chunk-WMWI3SJ7.js.map +7 -0
- package/bundle/{chunk-MJ6PHMOK.js → chunk-WW5F2DCO.js} +11 -2
- package/bundle/chunk-WW5F2DCO.js.map +7 -0
- package/bundle/chunk-YWZPKBO6.js +22 -0
- package/bundle/chunk-YWZPKBO6.js.map +7 -0
- package/bundle/{chunk-KWBGYWDO.js → chunk-Z4SWEFIY.js} +12 -14
- package/bundle/chunk-Z4SWEFIY.js.map +7 -0
- package/bundle/chunk-ZAA7B5BN.js +22 -0
- package/bundle/chunk-ZAA7B5BN.js.map +7 -0
- package/bundle/{commands-WUGPBPHI.js → commands-AXW7L2MZ.js} +15 -14
- package/bundle/{config-DQIGDX4W.js → config-NDEYF4AQ.js} +7 -7
- package/bundle/{daemon-NPKYZ3CJ.js → daemon-WOQXCKNL.js} +4 -4
- package/bundle/{delegation-tools-6FICZQ5G.js → delegation-tools-Z5OM3TXS.js} +5 -5
- package/bundle/{deploy-lib-import-SBKXDD3F.js → deploy-lib-import-6VJTYXEG.js} +2 -2
- package/bundle/{deps-HN6CEXA4.js → deps-65V7XXG4.js} +4 -4
- package/bundle/{direct-api-transport-TRV45NO6.js → direct-api-transport-LSAUIP5S.js} +27 -15
- package/bundle/direct-api-transport-LSAUIP5S.js.map +7 -0
- package/bundle/{discord-adapter-WA2MFRK3.js → discord-adapter-LNWTIOUK.js} +27 -24
- package/bundle/discord-adapter-LNWTIOUK.js.map +7 -0
- package/bundle/{dns-wakeup-RYOCQ6GR.js → dns-wakeup-N46RPU5E.js} +3 -3
- package/bundle/{doctor-R54GZPKL.js → doctor-PIPSGI3H.js} +18 -7
- package/bundle/{doctor-R54GZPKL.js.map → doctor-PIPSGI3H.js.map} +2 -2
- package/bundle/{ensure-invariants-BJIEOSJ2.js → ensure-invariants-3NOBCYWS.js} +4 -4
- package/bundle/{env-schema-XCPAJ6IZ.js → env-schema-T43X43BU.js} +4 -4
- package/bundle/{hook-system-POI5VRIX.js → hook-system-ZCVOFFRD.js} +4 -4
- package/bundle/hotskills-DTROJY6G.js +17 -0
- package/bundle/{install-GEXWJYJC.js → install-FZT43PTH.js} +3 -3
- package/bundle/{install-manifest-QRWID3KZ.js → install-manifest-KBYD7SAY.js} +3 -3
- package/bundle/{irc-adapter-AIEP6OX6.js → irc-adapter-HXO5D4SW.js} +3 -3
- package/bundle/{irc-config-6VY67UPQ.js → irc-config-XN5VW2V4.js} +5 -5
- package/bundle/{lazy-require-UFYFFX2R.js → lazy-require-R3JYCV5M.js} +4 -4
- package/bundle/{media-utils-MOE36VWY.js → media-utils-W7XW3SVV.js} +4 -4
- package/bundle/{message-pipeline-2MBT44FO.js → message-pipeline-QX272U5X.js} +17 -14
- package/bundle/meta.json +2965 -2294
- package/bundle/{notification-U6F5ZBSG.js → notification-ULESRDHB.js} +7 -6
- package/bundle/{openrouter-credits-7XXO6QGQ.js → openrouter-credits-PLIKRY5D.js} +4 -4
- package/bundle/{paths-ZJYIDND2.js → paths-QQM74XYT.js} +4 -2
- package/bundle/{peer-client-T44VI7NB.js → peer-client-D2F5QWRV.js} +8 -8
- package/bundle/{peer-config-D5A4454H.js → peer-config-5SUIBJLG.js} +5 -5
- package/bundle/{phase-transport-FEZ4SIJJ.js → phase-transport-BSGROTHY.js} +10 -10
- package/bundle/restore-Z6MF54HS.js +151 -0
- package/bundle/restore-Z6MF54HS.js.map +7 -0
- package/bundle/{install-SH4UVUXQ.js → rollback-5RXXLUD6.js} +5 -7
- package/bundle/{self-healer-utils-7NFH22VJ.js → self-healer-utils-WPKOVXJD.js} +4 -4
- package/bundle/{skill-stats-IPVKMWN3.js → skill-stats-NHNH47QW.js} +5 -5
- package/bundle/{sleep-BPWX3FCN.js → sleep-K7EXAFGW.js} +8 -8
- package/bundle/{soul-bundle-BRIUDEQ2.js → soul-bundle-QTPWDJB2.js} +7 -7
- package/bundle/{soul-loader-GBXJ7EBH.js → soul-loader-LCPTN4PK.js} +8 -8
- package/bundle/{sse-parser-anthropic-H42TTLBD.js → sse-parser-anthropic-PYDJM3UC.js} +4 -4
- package/bundle/{sse-parser-responses-WG2LY2ML.js → sse-parser-responses-FYT7A5WT.js} +4 -4
- package/bundle/{ssrf-guard-E2KBBC5E.js → ssrf-guard-R4P5OCTO.js} +4 -4
- package/bundle/{start-CBVKNEAT.js → start-4DNURGIY.js} +1 -1
- package/bundle/{stt-CF3CPFDC.js → stt-YN77NND6.js} +5 -5
- package/bundle/{subagent-runtime-4MTYUBIZ.js → subagent-runtime-FQAT3564.js} +5 -5
- package/bundle/system-event-buffer-OEPPNUGK.js +17 -0
- package/bundle/system-event-buffer-OEPPNUGK.js.map +7 -0
- package/bundle/{system-message-TALP6GP2.js → system-message-BRU267FW.js} +3 -3
- package/bundle/{system-status-GLYXXDE3.js → system-status-7K2QTH3J.js} +58 -51
- package/bundle/system-status-7K2QTH3J.js.map +7 -0
- package/bundle/{hotskills-6ECHLXTJ.js → task-failure-buffer-DPM5MWZ5.js} +8 -7
- package/bundle/{task-store-LC7ZMS72.js → task-store-VCBHAB43.js} +5 -5
- package/bundle/{telegram-adapter-BJJYXN7J.js → telegram-adapter-LXLSG4SK.js} +51 -33
- package/bundle/telegram-adapter-LXLSG4SK.js.map +7 -0
- package/bundle/{tool-registry-T7XLTI2Q.js → tool-registry-5PXNSYOI.js} +12 -9
- package/bundle/{tool-sandbox-OZMXJZLQ.js → tool-sandbox-TLAL55QP.js} +5 -5
- package/bundle/{transport-config-G5NKQXPJ.js → transport-config-JIKHB7GT.js} +8 -8
- package/bundle/update-check-AJMIBQGQ.js +81 -0
- package/bundle/update-check-AJMIBQGQ.js.map +7 -0
- package/bundle/{user-registry-NUVNEHJU.js → user-registry-PEFDZ5AV.js} +5 -5
- package/core/skills/tools/rss/SKILL.md +51 -0
- package/install-manifest.json +4 -2
- package/package.json +4 -4
- package/scripts/build-and-deploy.sh +28 -0
- package/scripts/daily-backup.sh +1 -79
- package/scripts/doctor.sh +38 -0
- package/scripts/emergency-deploy.sh +95 -0
- package/scripts/watchdog.sh +51 -5
- package/bundle/chunk-4BUOO6WI.js.map +0 -7
- package/bundle/chunk-A5OJYQNU.js.map +0 -7
- package/bundle/chunk-JX3ZZU3O.js +0 -82
- package/bundle/chunk-JX3ZZU3O.js.map +0 -7
- package/bundle/chunk-KJOCXWJ5.js +0 -131
- package/bundle/chunk-KJOCXWJ5.js.map +0 -7
- package/bundle/chunk-KSEIWT4T.js.map +0 -7
- package/bundle/chunk-KWBGYWDO.js.map +0 -7
- package/bundle/chunk-MJ6PHMOK.js.map +0 -7
- package/bundle/chunk-P2BZSLJJ.js.map +0 -7
- package/bundle/chunk-R36WIOYX.js.map +0 -7
- package/bundle/chunk-RE3F3CFW.js +0 -300
- package/bundle/chunk-RE3F3CFW.js.map +0 -7
- package/bundle/chunk-RJJWPMUZ.js +0 -411
- package/bundle/chunk-RJJWPMUZ.js.map +0 -7
- package/bundle/chunk-RSWUPUNA.js.map +0 -7
- package/bundle/chunk-RV54J75Q.js.map +0 -7
- package/bundle/chunk-RVERPUHT.js +0 -289
- package/bundle/chunk-RVERPUHT.js.map +0 -7
- package/bundle/chunk-TYVI3ZWA.js.map +0 -7
- package/bundle/chunk-X5FBUA53.js.map +0 -7
- package/bundle/deploy-lib-import-HCMZCKZD.js +0 -50
- package/bundle/direct-api-transport-TRV45NO6.js.map +0 -7
- package/bundle/discord-adapter-WA2MFRK3.js.map +0 -7
- package/bundle/restore-ROJF22R2.js +0 -47
- package/bundle/restore-ROJF22R2.js.map +0 -7
- package/bundle/system-status-GLYXXDE3.js.map +0 -7
- package/bundle/telegram-adapter-BJJYXN7J.js.map +0 -7
- package/bundle/update-check-O5MS6B3L.js +0 -13
- package/bundle/user-registry-NUVNEHJU.js.map +0 -7
- /package/bundle/{agent-api-rate-limit-C25WGSFF.js.map → agent-api-rate-limit-R2OFAQ3N.js.map} +0 -0
- /package/bundle/{agent-registry-SYUFNSVB.js.map → agent-registry-S2MNHQYQ.js.map} +0 -0
- /package/bundle/{bridge-lock-transport-HO545SBK.js.map → bridge-lock-transport-N6OGDOSE.js.map} +0 -0
- /package/bundle/{browse-delivery-VTLEAVYA.js.map → browse-delivery-DXGMDMXA.js.map} +0 -0
- /package/bundle/{browser-REIXOJ6S.js.map → browser-QMYGSP5W.js.map} +0 -0
- /package/bundle/{capability-ILW3D5HS.js.map → capability-733TLH4W.js.map} +0 -0
- /package/bundle/{chunk-ZVDVNSXK.js.map → chunk-2SWKJX64.js.map} +0 -0
- /package/bundle/{chunk-PZE3J7ER.js.map → chunk-3OXQWII3.js.map} +0 -0
- /package/bundle/{chunk-4KJ76TTE.js.map → chunk-4XW7YA3K.js.map} +0 -0
- /package/bundle/{chunk-Q62SXS73.js.map → chunk-BBDKU4EH.js.map} +0 -0
- /package/bundle/{chunk-EX2SRTUE.js.map → chunk-CYSGXNBY.js.map} +0 -0
- /package/bundle/{chunk-LYEAHE5V.js.map → chunk-DCY7DGMT.js.map} +0 -0
- /package/bundle/{chunk-G6IXMYIO.js.map → chunk-DO4INSXE.js.map} +0 -0
- /package/bundle/{chunk-VA5WKN3Z.js.map → chunk-EGA6JQVV.js.map} +0 -0
- /package/bundle/{chunk-URAQLQ2U.js.map → chunk-F3HMZFIL.js.map} +0 -0
- /package/bundle/{chunk-OOKLEC6V.js.map → chunk-FY3QUO2L.js.map} +0 -0
- /package/bundle/{chunk-2BY6I4P5.js.map → chunk-GUTRAMK3.js.map} +0 -0
- /package/bundle/{chunk-GPL57SRN.js.map → chunk-H7RX7UCR.js.map} +0 -0
- /package/bundle/{chunk-BYDUMHXT.js.map → chunk-HAF2AFBW.js.map} +0 -0
- /package/bundle/{chunk-KFENC7BM.js.map → chunk-L33WNMCP.js.map} +0 -0
- /package/bundle/{chunk-JRG4EFMP.js.map → chunk-LBMETTUP.js.map} +0 -0
- /package/bundle/{chunk-TOUZC6NR.js.map → chunk-OKMN6J4Z.js.map} +0 -0
- /package/bundle/{chunk-CELR236Q.js.map → chunk-Q7CH5DA3.js.map} +0 -0
- /package/bundle/{chunk-XZSYMCLF.js.map → chunk-QIAFGDRL.js.map} +0 -0
- /package/bundle/{chunk-UDZIZB5F.js.map → chunk-RTL7HO3N.js.map} +0 -0
- /package/bundle/{chunk-ITG6XGBS.js.map → chunk-SA44ITVX.js.map} +0 -0
- /package/bundle/{chunk-3MO2MDXJ.js.map → chunk-SA6YEFNG.js.map} +0 -0
- /package/bundle/{chunk-GBBTK6H2.js.map → chunk-SRFEIZQT.js.map} +0 -0
- /package/bundle/{chunk-ELRAH7VL.js.map → chunk-VXUVKC66.js.map} +0 -0
- /package/bundle/{commands-WUGPBPHI.js.map → commands-AXW7L2MZ.js.map} +0 -0
- /package/bundle/{config-DQIGDX4W.js.map → config-NDEYF4AQ.js.map} +0 -0
- /package/bundle/{daemon-NPKYZ3CJ.js.map → daemon-WOQXCKNL.js.map} +0 -0
- /package/bundle/{delegation-tools-6FICZQ5G.js.map → delegation-tools-Z5OM3TXS.js.map} +0 -0
- /package/bundle/{deploy-lib-import-HCMZCKZD.js.map → deploy-lib-import-6VJTYXEG.js.map} +0 -0
- /package/bundle/{deps-HN6CEXA4.js.map → deps-65V7XXG4.js.map} +0 -0
- /package/bundle/{dns-wakeup-RYOCQ6GR.js.map → dns-wakeup-N46RPU5E.js.map} +0 -0
- /package/bundle/{ensure-invariants-BJIEOSJ2.js.map → ensure-invariants-3NOBCYWS.js.map} +0 -0
- /package/bundle/{deploy-lib-import-SBKXDD3F.js.map → env-schema-T43X43BU.js.map} +0 -0
- /package/bundle/{env-schema-XCPAJ6IZ.js.map → hook-system-ZCVOFFRD.js.map} +0 -0
- /package/bundle/{hook-system-POI5VRIX.js.map → hotskills-DTROJY6G.js.map} +0 -0
- /package/bundle/{hotskills-6ECHLXTJ.js.map → install-FZT43PTH.js.map} +0 -0
- /package/bundle/{install-manifest-QRWID3KZ.js.map → install-manifest-KBYD7SAY.js.map} +0 -0
- /package/bundle/{irc-adapter-AIEP6OX6.js.map → irc-adapter-HXO5D4SW.js.map} +0 -0
- /package/bundle/{irc-config-6VY67UPQ.js.map → irc-config-XN5VW2V4.js.map} +0 -0
- /package/bundle/{install-GEXWJYJC.js.map → lazy-require-R3JYCV5M.js.map} +0 -0
- /package/bundle/{media-utils-MOE36VWY.js.map → media-utils-W7XW3SVV.js.map} +0 -0
- /package/bundle/{install-SH4UVUXQ.js.map → message-pipeline-QX272U5X.js.map} +0 -0
- /package/bundle/{lazy-require-UFYFFX2R.js.map → notification-ULESRDHB.js.map} +0 -0
- /package/bundle/{openrouter-credits-7XXO6QGQ.js.map → openrouter-credits-PLIKRY5D.js.map} +0 -0
- /package/bundle/{message-pipeline-2MBT44FO.js.map → paths-QQM74XYT.js.map} +0 -0
- /package/bundle/{peer-client-T44VI7NB.js.map → peer-client-D2F5QWRV.js.map} +0 -0
- /package/bundle/{notification-U6F5ZBSG.js.map → peer-config-5SUIBJLG.js.map} +0 -0
- /package/bundle/{paths-ZJYIDND2.js.map → phase-transport-BSGROTHY.js.map} +0 -0
- /package/bundle/{peer-config-D5A4454H.js.map → rollback-5RXXLUD6.js.map} +0 -0
- /package/bundle/{self-healer-utils-7NFH22VJ.js.map → self-healer-utils-WPKOVXJD.js.map} +0 -0
- /package/bundle/{phase-transport-FEZ4SIJJ.js.map → skill-stats-NHNH47QW.js.map} +0 -0
- /package/bundle/{skill-stats-IPVKMWN3.js.map → sleep-K7EXAFGW.js.map} +0 -0
- /package/bundle/{sleep-BPWX3FCN.js.map → soul-bundle-QTPWDJB2.js.map} +0 -0
- /package/bundle/{soul-bundle-BRIUDEQ2.js.map → soul-loader-LCPTN4PK.js.map} +0 -0
- /package/bundle/{sse-parser-anthropic-H42TTLBD.js.map → sse-parser-anthropic-PYDJM3UC.js.map} +0 -0
- /package/bundle/{sse-parser-responses-WG2LY2ML.js.map → sse-parser-responses-FYT7A5WT.js.map} +0 -0
- /package/bundle/{ssrf-guard-E2KBBC5E.js.map → ssrf-guard-R4P5OCTO.js.map} +0 -0
- /package/bundle/{start-CBVKNEAT.js.map → start-4DNURGIY.js.map} +0 -0
- /package/bundle/{soul-loader-GBXJ7EBH.js.map → stt-YN77NND6.js.map} +0 -0
- /package/bundle/{stt-CF3CPFDC.js.map → subagent-runtime-FQAT3564.js.map} +0 -0
- /package/bundle/{system-message-TALP6GP2.js.map → system-message-BRU267FW.js.map} +0 -0
- /package/bundle/{subagent-runtime-4MTYUBIZ.js.map → task-failure-buffer-DPM5MWZ5.js.map} +0 -0
- /package/bundle/{task-store-LC7ZMS72.js.map → task-store-VCBHAB43.js.map} +0 -0
- /package/bundle/{tool-registry-T7XLTI2Q.js.map → tool-registry-5PXNSYOI.js.map} +0 -0
- /package/bundle/{tool-sandbox-OZMXJZLQ.js.map → tool-sandbox-TLAL55QP.js.map} +0 -0
- /package/bundle/{transport-config-G5NKQXPJ.js.map → transport-config-JIKHB7GT.js.map} +0 -0
- /package/bundle/{update-check-O5MS6B3L.js.map → user-registry-PEFDZ5AV.js.map} +0 -0
|
@@ -5,45 +5,48 @@ import {
|
|
|
5
5
|
} from "./chunk-NIRYBWUW.js";
|
|
6
6
|
import {
|
|
7
7
|
transcribeAudio
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SA6YEFNG.js";
|
|
9
9
|
import {
|
|
10
10
|
ModelNotFoundError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MHK4UPM6.js";
|
|
12
|
+
import {
|
|
13
|
+
sanitizeOutbound
|
|
14
|
+
} from "./chunk-YWZPKBO6.js";
|
|
12
15
|
import {
|
|
13
16
|
loadMinimalSoul,
|
|
14
17
|
loadSoulBundle
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
loadUsers
|
|
18
|
-
} from "./chunk-GBBTK6H2.js";
|
|
18
|
+
} from "./chunk-L33WNMCP.js";
|
|
19
19
|
import {
|
|
20
20
|
abmind
|
|
21
21
|
} from "./chunk-JAJ3DUQ2.js";
|
|
22
22
|
import {
|
|
23
23
|
fire,
|
|
24
24
|
hasHooks
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-DO4INSXE.js";
|
|
26
26
|
import {
|
|
27
27
|
readAndClearRestartReason,
|
|
28
28
|
readBridgeLockField,
|
|
29
29
|
updateBridgeLockField,
|
|
30
30
|
writeForceSleep,
|
|
31
31
|
writeSleepStatus
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-RTL7HO3N.js";
|
|
33
|
+
import {
|
|
34
|
+
loadUsers
|
|
35
|
+
} from "./chunk-SRFEIZQT.js";
|
|
33
36
|
import {
|
|
34
37
|
readEntries
|
|
35
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-H7RX7UCR.js";
|
|
36
39
|
import {
|
|
37
40
|
localTime
|
|
38
41
|
} from "./chunk-MZWMYN4O.js";
|
|
39
|
-
import {
|
|
40
|
-
init_log_and_swallow,
|
|
41
|
-
logAndSwallow
|
|
42
|
-
} from "./chunk-EX2SRTUE.js";
|
|
43
42
|
import {
|
|
44
43
|
getEnv,
|
|
45
44
|
init_env_schema
|
|
46
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-3OXQWII3.js";
|
|
46
|
+
import {
|
|
47
|
+
init_log_and_swallow,
|
|
48
|
+
logAndSwallow
|
|
49
|
+
} from "./chunk-CYSGXNBY.js";
|
|
47
50
|
import {
|
|
48
51
|
init_logger,
|
|
49
52
|
logDebug,
|
|
@@ -51,11 +54,11 @@ import {
|
|
|
51
54
|
logInfo,
|
|
52
55
|
logTrace,
|
|
53
56
|
logWarn
|
|
54
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-GUTRAMK3.js";
|
|
55
58
|
import {
|
|
56
59
|
abtarsHome,
|
|
57
60
|
init_paths
|
|
58
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-WW5F2DCO.js";
|
|
59
62
|
import {
|
|
60
63
|
__commonJS,
|
|
61
64
|
__require,
|
|
@@ -863,21 +866,6 @@ function cleanForTts(text) {
|
|
|
863
866
|
return result.replace(/\n{3,}/g, "\n\n").trim();
|
|
864
867
|
}
|
|
865
868
|
|
|
866
|
-
// src/components/sanitize-outbound.ts
|
|
867
|
-
var STRIP = [
|
|
868
|
-
/\s*\[TOPICS:\s*.+?\]/gi,
|
|
869
|
-
/\s*\[NO_REPLY\]\s*/gi,
|
|
870
|
-
/\s*\[REACT:.+?\]\s*/gi
|
|
871
|
-
];
|
|
872
|
-
function sanitizeOutbound(text) {
|
|
873
|
-
let out = text;
|
|
874
|
-
for (const re of STRIP) {
|
|
875
|
-
re.lastIndex = 0;
|
|
876
|
-
out = out.replace(re, "");
|
|
877
|
-
}
|
|
878
|
-
return out.trim();
|
|
879
|
-
}
|
|
880
|
-
|
|
881
869
|
// src/components/pipeline/middleware.ts
|
|
882
870
|
async function runPipeline(ctx, middlewares) {
|
|
883
871
|
let index = 0;
|
|
@@ -1206,15 +1194,17 @@ File saved at: ${msg.mediaPath}`;
|
|
|
1206
1194
|
const isSessionStart = entry.pendingStart || !entry.seen;
|
|
1207
1195
|
logTrace(TAG3, `session-state: key=${sessionKey} seen=${entry.seen} pendingStart=${entry.pendingStart} isSessionStart=${isSessionStart}`);
|
|
1208
1196
|
if (isSessionStart && memory) {
|
|
1209
|
-
prompt = buildSessionStartPrompt(prompt, memory, userId, sessionKey, deps.maxContext);
|
|
1197
|
+
prompt = buildSessionStartPrompt(prompt, memory, userId, sessionKey, deps.maxContext, msg.platform);
|
|
1210
1198
|
}
|
|
1211
1199
|
entry.seen = true;
|
|
1212
1200
|
entry.pendingStart = false;
|
|
1213
1201
|
const userRole = registry.byUserId.get(userId)?.role;
|
|
1202
|
+
logTrace(TAG3, `recordMessage gate: memory=${!!memory} userId=${userId} userRole=${userRole}`);
|
|
1214
1203
|
if (memory && userRole !== "guest") {
|
|
1215
1204
|
const numericMsgId = typeof msg.messageId === "number" ? msg.messageId : void 0;
|
|
1216
1205
|
memory.recordMessage({ role: "user", content: text, timestamp: Date.now(), userId, sessionId: sessionKey, platformMessageId: numericMsgId });
|
|
1217
1206
|
}
|
|
1207
|
+
let recalledHits;
|
|
1218
1208
|
if (getEnv().activeMemory && memory) {
|
|
1219
1209
|
const userEntry = registry.byUserId.get(userId);
|
|
1220
1210
|
if (userEntry?.role !== "guest" && (contextPercent < 0 || contextPercent < getEnv().ctxCompactPct)) {
|
|
@@ -1256,6 +1246,7 @@ ${lines.join("\n")}
|
|
|
1256
1246
|
|
|
1257
1247
|
`;
|
|
1258
1248
|
prompt = block + prompt;
|
|
1249
|
+
recalledHits = hits.filter((h) => h.id != null).map((h) => ({ id: h.id, contentEn: h.content }));
|
|
1259
1250
|
logDebug(TAG3, `Active recall: ${hits.length} hits, ${block.length} chars, ${Math.round(performance.now() - t0)}ms`);
|
|
1260
1251
|
logTrace(TAG3, `recall content: ${block}`);
|
|
1261
1252
|
}
|
|
@@ -1273,13 +1264,13 @@ ${lines.join("\n")}
|
|
|
1273
1264
|
const scan = scanFn(text);
|
|
1274
1265
|
if (!scan.safe) {
|
|
1275
1266
|
logInfo(TAG3, `Injection blocked from ${userId}: ${scan.flags.map((f) => f.category).join(", ")}`);
|
|
1276
|
-
return { prompt: "__INJECTION_BLOCKED__", isSessionStart, imageContent: void 0 };
|
|
1267
|
+
return { prompt: "__INJECTION_BLOCKED__", isSessionStart, imageContent: void 0, recalledHits: void 0 };
|
|
1277
1268
|
}
|
|
1278
1269
|
}
|
|
1279
1270
|
}
|
|
1280
|
-
return { prompt, isSessionStart, imageContent };
|
|
1271
|
+
return { prompt, isSessionStart, imageContent, recalledHits };
|
|
1281
1272
|
}
|
|
1282
|
-
function buildSessionStartPrompt(prompt, memory, userId, sessionKey, maxContext) {
|
|
1273
|
+
function buildSessionStartPrompt(prompt, memory, userId, sessionKey, maxContext, platform2) {
|
|
1283
1274
|
const contextParts = [];
|
|
1284
1275
|
const reason = readAndClearRestartReason();
|
|
1285
1276
|
if (reason) {
|
|
@@ -1335,15 +1326,23 @@ You are now talking to ${user.userId} (${user.role}, ${CLASS_NAMES[user.maxClass
|
|
|
1335
1326
|
} else {
|
|
1336
1327
|
logInfo(TAG3, `[CURRENT USER] skipped \u2014 no sessionKey`);
|
|
1337
1328
|
}
|
|
1329
|
+
if (platform2) {
|
|
1330
|
+
const CAPS = { telegram: "voice, reactions, typing, TTS, groups", discord: "reactions, typing, threads", irc: "text only" };
|
|
1331
|
+
contextParts.push(`[SYSTEM] Platform: ${platform2} (${CAPS[platform2] ?? "unknown"})`);
|
|
1332
|
+
}
|
|
1338
1333
|
const compSummary = null;
|
|
1339
1334
|
if (compSummary && sessionKey) {
|
|
1340
1335
|
} else {
|
|
1341
|
-
const ctxOpts = isCodeSession ? { skipDailies: true, maxAgeMs: 48 * 60 * 60 * 1e3 } : void 0;
|
|
1342
|
-
const
|
|
1336
|
+
const ctxOpts = isCodeSession ? { skipDailies: true, maxAgeMs: 48 * 60 * 60 * 1e3 } : maxContext && maxContext >= 64e3 ? { skipMessages: true } : void 0;
|
|
1337
|
+
const ctxResult = abmind()?.buildSessionStartContext(memory, userId, maxContext, ctxOpts);
|
|
1338
|
+
const ctx = ctxResult?.text ?? null;
|
|
1343
1339
|
if (ctx) {
|
|
1344
1340
|
contextParts.push(ctx);
|
|
1345
|
-
|
|
1346
|
-
|
|
1341
|
+
const s = ctxResult.stats;
|
|
1342
|
+
const ctxPct = maxContext ? Math.round(ctx.length / maxContext * 100) : -1;
|
|
1343
|
+
logInfo(TAG3, `Session start: ${s.messages} messages + ${s.dailies} dailies (${(s.usedBytes / 1024).toFixed(1)}KB / ${(s.budget / 1024).toFixed(0)}KB budget, ${ctxPct}% ctx${isCodeSession ? ", Code" : ""})`);
|
|
1344
|
+
logDebug(TAG3, `Session context: ${s.messages} msgs, ${s.dailies} dailies, ${s.usedBytes}B / ${s.budget}B budget, ${ctxPct}% ctx`);
|
|
1345
|
+
logTrace(TAG3, `session-start content: ${ctx.slice(0, 500)}...`);
|
|
1347
1346
|
}
|
|
1348
1347
|
try {
|
|
1349
1348
|
const userRole = loadUsers().byUserId.get(userId)?.role ?? "master";
|
|
@@ -1464,6 +1463,14 @@ async function retrySend(fn, attempts = 3) {
|
|
|
1464
1463
|
}
|
|
1465
1464
|
var TAG4 = "pipeline";
|
|
1466
1465
|
var PRIMING_MAX = 8;
|
|
1466
|
+
var recalledIdsPerMessage = /* @__PURE__ */ new Map();
|
|
1467
|
+
var RECALL_MAP_TTL = 60 * 6e4;
|
|
1468
|
+
setInterval(() => {
|
|
1469
|
+
if (recalledIdsPerMessage.size > 200) recalledIdsPerMessage.clear();
|
|
1470
|
+
}, RECALL_MAP_TTL);
|
|
1471
|
+
function getRecalledIdsForMessage(platformMsgId) {
|
|
1472
|
+
return recalledIdsPerMessage.get(platformMsgId);
|
|
1473
|
+
}
|
|
1467
1474
|
var STOPWORDS = /* @__PURE__ */ new Set([
|
|
1468
1475
|
"the",
|
|
1469
1476
|
"a",
|
|
@@ -1588,7 +1595,7 @@ async function handleInboundMessage(msg, adapter, deps) {
|
|
|
1588
1595
|
resetIdleCompactFlag?.();
|
|
1589
1596
|
const ctxPct = transport.contextPercent;
|
|
1590
1597
|
logInfo(TAG4, `\u2190 [${msg.platform}] ${isVoice ? "\u{1F3A4} " : ""}"${text.slice(0, 60)}"${ctxPct >= 0 ? ` (ctx: ${ctxPct}%)` : ""}`);
|
|
1591
|
-
const { prompt: builtPrompt, imageContent } = await buildPrompt(msg, text, {
|
|
1598
|
+
const { prompt: builtPrompt, imageContent, recalledHits } = await buildPrompt(msg, text, {
|
|
1592
1599
|
memory,
|
|
1593
1600
|
memoryConfig,
|
|
1594
1601
|
sessions,
|
|
@@ -1616,13 +1623,28 @@ Result: ${c.result}${cost}`;
|
|
|
1616
1623
|
|
|
1617
1624
|
---
|
|
1618
1625
|
|
|
1626
|
+
${prompt}`;
|
|
1627
|
+
}
|
|
1628
|
+
const { drainTaskFailures } = await import("./task-failure-buffer-DPM5MWZ5.js");
|
|
1629
|
+
const failures = drainTaskFailures();
|
|
1630
|
+
if (failures.length > 0) {
|
|
1631
|
+
const lines = failures.map((f) => `[SYSTEM] Task "${f.taskName}" failed (exit ${f.exitCode}${f.error ? `: ${f.error}` : ""}). ${f.consecutiveFailures > 1 ? `${f.consecutiveFailures} consecutive failures.` : ""}`);
|
|
1632
|
+
prompt = `${lines.join("\n")}
|
|
1633
|
+
|
|
1634
|
+
${prompt}`;
|
|
1635
|
+
}
|
|
1636
|
+
const { drainSystemEvents } = await import("./system-event-buffer-OEPPNUGK.js");
|
|
1637
|
+
const events = drainSystemEvents();
|
|
1638
|
+
if (events.length > 0) {
|
|
1639
|
+
prompt = `${events.map((e) => `[SYSTEM] ${e}`).join("\n")}
|
|
1640
|
+
|
|
1619
1641
|
${prompt}`;
|
|
1620
1642
|
}
|
|
1621
1643
|
const activeSession = deps.sessionManager.getActiveSession(userId, msg.platform);
|
|
1622
1644
|
const agentSession = activeSession.agentSession;
|
|
1623
1645
|
logDebug(TAG4, `Route: session=${activeSessionId} type=${activeSession.type} agentSession=${agentSession ? "yes" : "no"}`);
|
|
1624
1646
|
if ("sandboxPolicy" in transport) {
|
|
1625
|
-
const { buildPolicy } = await import("./tool-sandbox-
|
|
1647
|
+
const { buildPolicy } = await import("./tool-sandbox-TLAL55QP.js");
|
|
1626
1648
|
transport.sandboxPolicy = buildPolicy("owner");
|
|
1627
1649
|
}
|
|
1628
1650
|
if ("isPaused" in transport) {
|
|
@@ -1826,6 +1848,19 @@ ${prompt}`;
|
|
|
1826
1848
|
const ctxAfter = transport.contextPercent;
|
|
1827
1849
|
logInfo(TAG4, `\u2192 [${msg.platform}] Response delivered${ctxAfter >= 0 ? ` (ctx: ${ctxAfter}%)` : ""}`);
|
|
1828
1850
|
updateBridgeLockField("lastPromptAt", Date.now());
|
|
1851
|
+
if (recalledHits && recalledHits.length > 0 && memory) {
|
|
1852
|
+
try {
|
|
1853
|
+
const { detectCitations } = await import("abmind");
|
|
1854
|
+
const citedIds = detectCitations(userResponse, recalledHits);
|
|
1855
|
+
if (citedIds.length > 0) memory.bumpCitedCount(citedIds);
|
|
1856
|
+
logDebug(TAG4, `Citation: ${citedIds.length}/${recalledHits.length} recalled memories cited`);
|
|
1857
|
+
if (lastSentMsgId != null) {
|
|
1858
|
+
recalledIdsPerMessage.set(Number(lastSentMsgId), recalledHits.map((h) => h.id));
|
|
1859
|
+
}
|
|
1860
|
+
} catch (err) {
|
|
1861
|
+
logDebug(TAG4, `Citation detection failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1829
1864
|
if (hasHooks("AfterMessage")) {
|
|
1830
1865
|
fire("AfterMessage", {
|
|
1831
1866
|
event: "AfterMessage",
|
|
@@ -1900,6 +1935,7 @@ async function startSession(transport, memory, userId, sessionKey, greeting, sen
|
|
|
1900
1935
|
const response = await transport.sendPrompt(sessionKey, prompt, void 0, userId);
|
|
1901
1936
|
if (response?.trim() && response.trim() !== "[NO_REPLY]" && response.trim() !== "(no response)") {
|
|
1902
1937
|
await sendResponse(response);
|
|
1938
|
+
memory.recordMessage({ role: "assistant", content: response, timestamp: Date.now(), userId, sessionId: sessionKey });
|
|
1903
1939
|
}
|
|
1904
1940
|
}
|
|
1905
1941
|
|
|
@@ -1922,7 +1958,7 @@ function registerCommand(name, handler) {
|
|
|
1922
1958
|
registerExact(name, handler);
|
|
1923
1959
|
}
|
|
1924
1960
|
async function handleCommand(text, ctx) {
|
|
1925
|
-
const isMaster = !ctx.userId || ctx.userId === "master" || (await import("./user-registry-
|
|
1961
|
+
const isMaster = !ctx.userId || ctx.userId === "master" || (await import("./user-registry-PEFDZ5AV.js")).loadUsers().byUserId.get(ctx.userId)?.role === "master";
|
|
1926
1962
|
if (!isMaster) {
|
|
1927
1963
|
const cmd = text.split(/\s/)[0];
|
|
1928
1964
|
if (cmd.startsWith("/") && !NON_MASTER_COMMANDS.has(cmd)) {
|
|
@@ -1951,7 +1987,7 @@ Type /help for available commands.`);
|
|
|
1951
1987
|
return false;
|
|
1952
1988
|
}
|
|
1953
1989
|
async function triggerNewSession(ctx, reason = "new-session") {
|
|
1954
|
-
const { hasHooks: hasHooks2, fire: fireHook } = await import("./hook-system-
|
|
1990
|
+
const { hasHooks: hasHooks2, fire: fireHook } = await import("./hook-system-ZCVOFFRD.js");
|
|
1955
1991
|
if (hasHooks2("SessionEnd")) {
|
|
1956
1992
|
await fireHook("SessionEnd", { event: "SessionEnd", timestamp: (/* @__PURE__ */ new Date()).toISOString(), sessionKey: ctx.sessionKey, platform: ctx.platform, userId: ctx.userId, reason }).catch((err) => logAndSwallow(TAG5, "fireHook session", err));
|
|
1957
1993
|
}
|
|
@@ -1970,12 +2006,12 @@ async function triggerNewSession(ctx, reason = "new-session") {
|
|
|
1970
2006
|
}
|
|
1971
2007
|
}
|
|
1972
2008
|
async function triggerResetSession(ctx) {
|
|
1973
|
-
const { hasHooks: hasHooks2, fire: fireHook } = await import("./hook-system-
|
|
2009
|
+
const { hasHooks: hasHooks2, fire: fireHook } = await import("./hook-system-ZCVOFFRD.js");
|
|
1974
2010
|
if (hasHooks2("SessionEnd")) {
|
|
1975
2011
|
await fireHook("SessionEnd", { event: "SessionEnd", timestamp: (/* @__PURE__ */ new Date()).toISOString(), sessionKey: ctx.sessionKey, platform: ctx.platform, userId: ctx.userId, reason: "reset-transport" }).catch((err) => logAndSwallow(TAG5, "fireHook session", err));
|
|
1976
2012
|
}
|
|
1977
2013
|
await ctx.idleSave.save(ctx.sessionKey, ctx.chatId);
|
|
1978
|
-
const { clearTransportCache } = await import("./transport-config-
|
|
2014
|
+
const { clearTransportCache } = await import("./transport-config-JIKHB7GT.js");
|
|
1979
2015
|
clearTransportCache();
|
|
1980
2016
|
if (ctx.rebuildTransport) await ctx.rebuildTransport();
|
|
1981
2017
|
await resetAndPrepare({
|
|
@@ -2014,7 +2050,7 @@ var TAG6 = "cmd";
|
|
|
2014
2050
|
async function handleNewReset(text, ctx) {
|
|
2015
2051
|
const isResetDefault = text.trim().toLowerCase() === "/reset default";
|
|
2016
2052
|
if (isResetDefault) {
|
|
2017
|
-
const { resetToDefaults } = await import("./transport-config-
|
|
2053
|
+
const { resetToDefaults } = await import("./transport-config-JIKHB7GT.js");
|
|
2018
2054
|
resetToDefaults();
|
|
2019
2055
|
} else {
|
|
2020
2056
|
try {
|
|
@@ -2052,7 +2088,7 @@ async function handleEmergencyAlias(_text, ctx) {
|
|
|
2052
2088
|
return handleModels("/model emergency", ctx);
|
|
2053
2089
|
}
|
|
2054
2090
|
async function handleModels(text, ctx) {
|
|
2055
|
-
const { loadTransport, resolveAgent, getModelsForProvider, writeTransportConfig } = await import("./transport-config-
|
|
2091
|
+
const { loadTransport, resolveAgent, getModelsForProvider, writeTransportConfig } = await import("./transport-config-JIKHB7GT.js");
|
|
2056
2092
|
const tc = loadTransport();
|
|
2057
2093
|
const prof = tc ? resolveAgent("professor", tc) : null;
|
|
2058
2094
|
const currentModel = ("currentModel" in ctx.transport ? ctx.transport.currentModel : void 0) ?? prof?.model ?? "unknown";
|
|
@@ -2070,8 +2106,8 @@ async function handleModels(text, ctx) {
|
|
|
2070
2106
|
if (tc) {
|
|
2071
2107
|
const hmProvider = tc.hailMary ? tc.providers[tc.hailMary.provider] : void 0;
|
|
2072
2108
|
if (hmProvider) {
|
|
2073
|
-
const { validateProviderReady, formatValidationError } = await import("./transport-config-
|
|
2074
|
-
const { getEnv: getEnv2 } = await import("./env-schema-
|
|
2109
|
+
const { validateProviderReady, formatValidationError } = await import("./transport-config-JIKHB7GT.js");
|
|
2110
|
+
const { getEnv: getEnv2 } = await import("./env-schema-T43X43BU.js");
|
|
2075
2111
|
const result = validateProviderReady(tc.hailMary.provider, hmProvider, getEnv2());
|
|
2076
2112
|
if (!result.ok) {
|
|
2077
2113
|
await ctx.reply(formatValidationError(tc.hailMary.provider, result));
|
|
@@ -2084,7 +2120,7 @@ async function handleModels(text, ctx) {
|
|
|
2084
2120
|
return true;
|
|
2085
2121
|
}
|
|
2086
2122
|
if (arg === "restore") {
|
|
2087
|
-
const { restorePrevious } = await import("./transport-config-
|
|
2123
|
+
const { restorePrevious } = await import("./transport-config-JIKHB7GT.js");
|
|
2088
2124
|
const result = restorePrevious();
|
|
2089
2125
|
if (!result.ok) {
|
|
2090
2126
|
await ctx.reply(`\u274C ${result.error}`);
|
|
@@ -2096,7 +2132,7 @@ async function handleModels(text, ctx) {
|
|
|
2096
2132
|
return true;
|
|
2097
2133
|
}
|
|
2098
2134
|
if (arg === "default") {
|
|
2099
|
-
const { resetToDefaults } = await import("./transport-config-
|
|
2135
|
+
const { resetToDefaults } = await import("./transport-config-JIKHB7GT.js");
|
|
2100
2136
|
if (!resetToDefaults()) {
|
|
2101
2137
|
await ctx.reply("\u274C Factory config not found \u2014 run abtars install to restore.");
|
|
2102
2138
|
return true;
|
|
@@ -2122,7 +2158,7 @@ async function handleModels(text, ctx) {
|
|
|
2122
2158
|
return true;
|
|
2123
2159
|
}
|
|
2124
2160
|
const endpoint = prof.provider.endpoint ?? "http://localhost:11434/v1";
|
|
2125
|
-
const apiKey = prof.provider.apiKeyEnv ? (await import("./env-schema-
|
|
2161
|
+
const apiKey = prof.provider.apiKeyEnv ? (await import("./env-schema-T43X43BU.js")).getEnv().getApiKey(prof.provider.apiKeyEnv) : void 0;
|
|
2126
2162
|
const models = /* @__PURE__ */ new Set();
|
|
2127
2163
|
for (const [, agent] of Object.entries(tc.agents)) {
|
|
2128
2164
|
if (agent.provider === prof.providerName) models.add(agent.model);
|
|
@@ -2133,7 +2169,7 @@ async function handleModels(text, ctx) {
|
|
|
2133
2169
|
if (tc.hailMary?.provider === prof.providerName) models.add(tc.hailMary.model);
|
|
2134
2170
|
await ctx.reply(`\u{1FA7A} Checking ${models.size} models on ${prof.providerName}...`);
|
|
2135
2171
|
const results = [];
|
|
2136
|
-
const { loadModels } = await import("./transport-config-
|
|
2172
|
+
const { loadModels } = await import("./transport-config-JIKHB7GT.js");
|
|
2137
2173
|
const catalog = loadModels();
|
|
2138
2174
|
for (const model of models) {
|
|
2139
2175
|
try {
|
|
@@ -2170,9 +2206,9 @@ async function handleModels(text, ctx) {
|
|
|
2170
2206
|
if (catalog[model]) catalog[model].lastChecked = (/* @__PURE__ */ new Date()).toISOString();
|
|
2171
2207
|
}
|
|
2172
2208
|
const { writeFileSync: writeFileSync2 } = await import("node:fs");
|
|
2173
|
-
const { join:
|
|
2174
|
-
const { configDir } = await import("./transport-config-
|
|
2175
|
-
writeFileSync2(
|
|
2209
|
+
const { join: join4 } = await import("node:path");
|
|
2210
|
+
const { configDir } = await import("./transport-config-JIKHB7GT.js");
|
|
2211
|
+
writeFileSync2(join4(configDir(), "models.json"), JSON.stringify(catalog, null, 2) + "\n");
|
|
2176
2212
|
await ctx.reply(`\u{1FA7A} Model Health:
|
|
2177
2213
|
${results.join("\n")}`);
|
|
2178
2214
|
return true;
|
|
@@ -2194,8 +2230,8 @@ ${results.join("\n")}`);
|
|
|
2194
2230
|
return true;
|
|
2195
2231
|
}
|
|
2196
2232
|
{
|
|
2197
|
-
const { validateProviderReady, formatValidationError } = await import("./transport-config-
|
|
2198
|
-
const { getEnv: getEnv2 } = await import("./env-schema-
|
|
2233
|
+
const { validateProviderReady, formatValidationError } = await import("./transport-config-JIKHB7GT.js");
|
|
2234
|
+
const { getEnv: getEnv2 } = await import("./env-schema-T43X43BU.js");
|
|
2199
2235
|
const result = validateProviderReady(prof.providerName, prof.provider, getEnv2());
|
|
2200
2236
|
if (!result.ok) {
|
|
2201
2237
|
await ctx.reply(formatValidationError(prof.providerName, result));
|
|
@@ -2203,7 +2239,7 @@ ${results.join("\n")}`);
|
|
|
2203
2239
|
}
|
|
2204
2240
|
}
|
|
2205
2241
|
tc.agents["professor"].model = newModel;
|
|
2206
|
-
const { cleanDemotedModels } = await import("./transport-config-
|
|
2242
|
+
const { cleanDemotedModels } = await import("./transport-config-JIKHB7GT.js");
|
|
2207
2243
|
cleanDemotedModels(tc, newModel);
|
|
2208
2244
|
writeTransportConfig(tc, `professor model \u2192 ${newModel}`);
|
|
2209
2245
|
if ("setModel" in ctx.transport) {
|
|
@@ -2214,7 +2250,7 @@ ${results.join("\n")}`);
|
|
|
2214
2250
|
}
|
|
2215
2251
|
if (arg === "list" || arg.startsWith("list ")) {
|
|
2216
2252
|
const providerArg = arg.slice(5).trim();
|
|
2217
|
-
const { getAvailableProviders, getModelsForProvider: getModels } = await import("./transport-config-
|
|
2253
|
+
const { getAvailableProviders, getModelsForProvider: getModels } = await import("./transport-config-JIKHB7GT.js");
|
|
2218
2254
|
if (!tc) {
|
|
2219
2255
|
await ctx.reply("\u274C transport.json not loaded");
|
|
2220
2256
|
return true;
|
|
@@ -2272,8 +2308,8 @@ Use /model quick <name> to switch.`);
|
|
|
2272
2308
|
await ctx.reply(`\u274C Provider "${providerName}" not found. Available: ${Object.keys(tc.providers).join(", ")}`);
|
|
2273
2309
|
return true;
|
|
2274
2310
|
}
|
|
2275
|
-
const { validateProviderReady, formatValidationError, loadProviderDefaults } = await import("./transport-config-
|
|
2276
|
-
const { getEnv: getEnv2 } = await import("./env-schema-
|
|
2311
|
+
const { validateProviderReady, formatValidationError, loadProviderDefaults } = await import("./transport-config-JIKHB7GT.js");
|
|
2312
|
+
const { getEnv: getEnv2 } = await import("./env-schema-T43X43BU.js");
|
|
2277
2313
|
const validation = validateProviderReady(providerName, provider2, getEnv2());
|
|
2278
2314
|
if (!validation.ok) {
|
|
2279
2315
|
await ctx.reply(formatValidationError(providerName, validation));
|
|
@@ -2361,9 +2397,10 @@ ${raw || "(no output)"}`);
|
|
|
2361
2397
|
}
|
|
2362
2398
|
return true;
|
|
2363
2399
|
}
|
|
2364
|
-
const { getDoctorReport, renderDoctorText } = await import("./doctor-
|
|
2400
|
+
const { getDoctorReport, renderDoctorText } = await import("./doctor-PIPSGI3H.js");
|
|
2365
2401
|
const force = arg === "force";
|
|
2366
2402
|
const svcStates = ctx.registry?.getStates() ?? {};
|
|
2403
|
+
await ctx.reply("\u{1FA7A} Running diagnostics...");
|
|
2367
2404
|
const report = await getDoctorReport({
|
|
2368
2405
|
memory: ctx.memory,
|
|
2369
2406
|
transport: ctx.transport,
|
|
@@ -2376,7 +2413,7 @@ ${raw || "(no output)"}`);
|
|
|
2376
2413
|
}
|
|
2377
2414
|
async function handleStatus(_text, ctx) {
|
|
2378
2415
|
if (ctx.phaseHealth && ctx.registry) {
|
|
2379
|
-
const { getSystemStatus, renderStatusText } = await import("./system-status-
|
|
2416
|
+
const { getSystemStatus, renderStatusText } = await import("./system-status-7K2QTH3J.js");
|
|
2380
2417
|
const status = await getSystemStatus({
|
|
2381
2418
|
phaseHealth: ctx.phaseHealth,
|
|
2382
2419
|
registry: ctx.registry,
|
|
@@ -2387,7 +2424,7 @@ async function handleStatus(_text, ctx) {
|
|
|
2387
2424
|
});
|
|
2388
2425
|
let text = renderStatusText(status);
|
|
2389
2426
|
if (_text.trim().toLowerCase() === "full") {
|
|
2390
|
-
const { envDump } = await import("./env-schema-
|
|
2427
|
+
const { envDump } = await import("./env-schema-T43X43BU.js");
|
|
2391
2428
|
const dump = envDump();
|
|
2392
2429
|
const envLines = Object.entries(dump).slice(0, 30).map(([k, v]) => ` ${k}: ${v}`);
|
|
2393
2430
|
text += "\n\n\u{1F4CB} Config (top 30):\n" + envLines.join("\n");
|
|
@@ -2508,7 +2545,7 @@ async function buildStatusLines(ctx) {
|
|
|
2508
2545
|
if ("currentModel" in ctx.transport) {
|
|
2509
2546
|
model = ctx.transport.currentModel;
|
|
2510
2547
|
} else {
|
|
2511
|
-
const { loadTransport, resolveAgent } = await import("./transport-config-
|
|
2548
|
+
const { loadTransport, resolveAgent } = await import("./transport-config-JIKHB7GT.js");
|
|
2512
2549
|
const tc2 = loadTransport();
|
|
2513
2550
|
const prof2 = tc2 ? resolveAgent("professor", tc2) : null;
|
|
2514
2551
|
model = prof2?.model ?? "unknown";
|
|
@@ -2517,7 +2554,7 @@ async function buildStatusLines(ctx) {
|
|
|
2517
2554
|
const uptime = formatUptime(Date.now() - ctx.startedAt);
|
|
2518
2555
|
const ctxPct = ctx.transport.contextPercent >= 0 ? `${ctx.transport.contextPercent}%` : "n/a";
|
|
2519
2556
|
const cronInfo = ctx.memory?.getCronInfo();
|
|
2520
|
-
const { loadTransport: lt, resolveAgent: ra } = await import("./transport-config-
|
|
2557
|
+
const { loadTransport: lt, resolveAgent: ra } = await import("./transport-config-JIKHB7GT.js");
|
|
2521
2558
|
const tc = lt();
|
|
2522
2559
|
const prof = tc ? ra("professor", tc) : null;
|
|
2523
2560
|
const provider = prof?.providerName ?? "unknown";
|
|
@@ -2579,7 +2616,7 @@ function formatUptime(ms) {
|
|
|
2579
2616
|
}
|
|
2580
2617
|
async function handleUsage(_text, ctx) {
|
|
2581
2618
|
const { readUsage, resetUsage } = await import("./usage-tracker-S4Z2G2K5.js");
|
|
2582
|
-
const { loadModels } = await import("./transport-config-
|
|
2619
|
+
const { loadModels } = await import("./transport-config-JIKHB7GT.js");
|
|
2583
2620
|
const arg = _text.replace("/usage", "").trim();
|
|
2584
2621
|
if (arg === "reset") {
|
|
2585
2622
|
resetUsage();
|
|
@@ -2630,7 +2667,7 @@ async function handleUsage(_text, ctx) {
|
|
|
2630
2667
|
`;
|
|
2631
2668
|
}
|
|
2632
2669
|
}
|
|
2633
|
-
const { fetchOpenRouterCredits } = await import("./openrouter-credits-
|
|
2670
|
+
const { fetchOpenRouterCredits } = await import("./openrouter-credits-PLIKRY5D.js");
|
|
2634
2671
|
const credits = await fetchOpenRouterCredits();
|
|
2635
2672
|
if (credits) {
|
|
2636
2673
|
msg += `
|
|
@@ -2640,7 +2677,7 @@ async function handleUsage(_text, ctx) {
|
|
|
2640
2677
|
return true;
|
|
2641
2678
|
}
|
|
2642
2679
|
async function handleOpenRouter(_text, ctx) {
|
|
2643
|
-
const { fetchOpenRouterCredits } = await import("./openrouter-credits-
|
|
2680
|
+
const { fetchOpenRouterCredits } = await import("./openrouter-credits-PLIKRY5D.js");
|
|
2644
2681
|
const credits = await fetchOpenRouterCredits();
|
|
2645
2682
|
if (!credits) {
|
|
2646
2683
|
await ctx.reply("\u274C OpenRouter API key not set or request failed.");
|
|
@@ -2656,7 +2693,7 @@ Remaining: $${credits.remaining.toFixed(2)}`
|
|
|
2656
2693
|
return true;
|
|
2657
2694
|
}
|
|
2658
2695
|
async function handleWhoami(_text, ctx) {
|
|
2659
|
-
const { loadUsers: loadUsers2 } = await import("./user-registry-
|
|
2696
|
+
const { loadUsers: loadUsers2 } = await import("./user-registry-PEFDZ5AV.js");
|
|
2660
2697
|
const reg = loadUsers2();
|
|
2661
2698
|
const CLASS_NAMES = ["UNCLASSIFIED", "RESTRICTED", "CONFIDENTIAL", "SECRET"];
|
|
2662
2699
|
const user = ctx.userId ? reg.byUserId.get(ctx.userId) : void 0;
|
|
@@ -2668,6 +2705,238 @@ async function handleWhoami(_text, ctx) {
|
|
|
2668
2705
|
}
|
|
2669
2706
|
return true;
|
|
2670
2707
|
}
|
|
2708
|
+
async function handleSoftware(_text, ctx) {
|
|
2709
|
+
const { existsSync } = await import("node:fs");
|
|
2710
|
+
const { abtarsHome: abtarsHome2 } = await import("./paths-QQM74XYT.js");
|
|
2711
|
+
const home = abtarsHome2();
|
|
2712
|
+
const arg = _text.replace(/^\/(software|update)\s*/i, "").trim();
|
|
2713
|
+
const { loadUsers: loadUsers2 } = await import("./user-registry-PEFDZ5AV.js");
|
|
2714
|
+
const user = loadUsers2().byUserId.get(ctx.userId);
|
|
2715
|
+
const isMaster = user?.role === "master";
|
|
2716
|
+
if (arg.startsWith("rollback")) {
|
|
2717
|
+
if (!isMaster) {
|
|
2718
|
+
await ctx.reply("\u274C Requires master role.");
|
|
2719
|
+
return true;
|
|
2720
|
+
}
|
|
2721
|
+
const targetVersion = arg.replace(/^rollback\s*/, "").trim();
|
|
2722
|
+
if (!targetVersion) {
|
|
2723
|
+
await ctx.reply("Usage: /software rollback <version>\nUse /software to see available versions.");
|
|
2724
|
+
return true;
|
|
2725
|
+
}
|
|
2726
|
+
let targetSlot = null;
|
|
2727
|
+
for (let i = 1; i <= 3; i++) {
|
|
2728
|
+
const pkgPath = join2(home, `app.prev.${i}`, "package.json");
|
|
2729
|
+
try {
|
|
2730
|
+
const ver = JSON.parse(readFileSync(pkgPath, "utf-8")).version;
|
|
2731
|
+
if (ver === targetVersion) {
|
|
2732
|
+
targetSlot = i;
|
|
2733
|
+
break;
|
|
2734
|
+
}
|
|
2735
|
+
} catch {
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
if (!targetSlot) {
|
|
2739
|
+
await ctx.reply(`\u274C Version ${targetVersion} not found in rollback slots.`);
|
|
2740
|
+
return true;
|
|
2741
|
+
}
|
|
2742
|
+
await ctx.reply(`\u26A0\uFE0F Rolling back to ${targetVersion}...`);
|
|
2743
|
+
try {
|
|
2744
|
+
const { rollback } = await import("./rollback-5RXXLUD6.js");
|
|
2745
|
+
await rollback({ to: targetSlot });
|
|
2746
|
+
} catch (err) {
|
|
2747
|
+
await ctx.reply(`\u274C Rollback failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
2748
|
+
}
|
|
2749
|
+
return true;
|
|
2750
|
+
}
|
|
2751
|
+
if (arg === "update" || arg === "update deploy" || arg === "deploy" || arg === "update build" || arg === "build" || arg === "update pull" || arg === "pull" || arg === "") {
|
|
2752
|
+
if (arg === "" && _text.match(/^\/software\s*$/i)) {
|
|
2753
|
+
} else if (arg === "update pull" || arg === "pull") {
|
|
2754
|
+
if (!isMaster) {
|
|
2755
|
+
await ctx.reply("Requires master role.");
|
|
2756
|
+
return true;
|
|
2757
|
+
}
|
|
2758
|
+
try {
|
|
2759
|
+
const { spawnSync } = await import("node:child_process");
|
|
2760
|
+
const { mkdirSync: mkdirSync2 } = await import("node:fs");
|
|
2761
|
+
const srcDir = join2(home, "src", "abtars");
|
|
2762
|
+
const abmindDir = join2(home, "src", "abmind");
|
|
2763
|
+
logInfo("update", "Pull requested");
|
|
2764
|
+
if (!existsSync(join2(srcDir, ".git"))) {
|
|
2765
|
+
await ctx.reply("Cloning abtars repo...");
|
|
2766
|
+
mkdirSync2(join2(home, "src"), { recursive: true });
|
|
2767
|
+
const cl = spawnSync("git", ["clone", "git@github.com:aksika/abtars.git", srcDir], { encoding: "utf-8", timeout: 6e4 });
|
|
2768
|
+
if (cl.status !== 0) {
|
|
2769
|
+
logInfo("update", "Clone failed");
|
|
2770
|
+
await ctx.reply(`Clone failed:
|
|
2771
|
+
${(cl.stderr || "").trim().slice(0, 300)}`);
|
|
2772
|
+
return true;
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
spawnSync("git", ["-C", srcDir, "checkout", "--", "package-lock.json"], { encoding: "utf-8" });
|
|
2776
|
+
const r = spawnSync("git", ["-C", srcDir, "pull", "--ff-only", "origin", "dev"], { encoding: "utf-8", timeout: 3e4 });
|
|
2777
|
+
if (r.status !== 0) {
|
|
2778
|
+
await ctx.reply(`Pull failed (abtars):
|
|
2779
|
+
${(r.stderr || "").trim().slice(0, 300)}`);
|
|
2780
|
+
return true;
|
|
2781
|
+
}
|
|
2782
|
+
let pulled = `Pulled:
|
|
2783
|
+
${(r.stdout || "").trim().slice(0, 300)}`;
|
|
2784
|
+
if (existsSync(join2(abmindDir, ".git"))) {
|
|
2785
|
+
spawnSync("git", ["-C", abmindDir, "checkout", "--", "package-lock.json"], { encoding: "utf-8" });
|
|
2786
|
+
const ab = spawnSync("git", ["-C", abmindDir, "pull", "--ff-only", "origin", "dev"], { encoding: "utf-8", timeout: 3e4 });
|
|
2787
|
+
if (ab.status !== 0) {
|
|
2788
|
+
await ctx.reply(`Pull failed (abmind):
|
|
2789
|
+
${(ab.stderr || "").trim().slice(0, 300)}`);
|
|
2790
|
+
return true;
|
|
2791
|
+
}
|
|
2792
|
+
pulled += `
|
|
2793
|
+
abmind: ${(ab.stdout || "").trim().slice(0, 200)}`;
|
|
2794
|
+
}
|
|
2795
|
+
logInfo("update", `Pull complete`);
|
|
2796
|
+
await ctx.reply(`${pulled}
|
|
2797
|
+
|
|
2798
|
+
Ready to deploy: /update deploy`);
|
|
2799
|
+
} catch (err) {
|
|
2800
|
+
await ctx.reply(`Pull failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
2801
|
+
}
|
|
2802
|
+
return true;
|
|
2803
|
+
} else if (arg === "update deploy" || arg === "deploy" || arg === "update build" || arg === "build") {
|
|
2804
|
+
if (!isMaster) {
|
|
2805
|
+
await ctx.reply("Requires master role.");
|
|
2806
|
+
return true;
|
|
2807
|
+
}
|
|
2808
|
+
try {
|
|
2809
|
+
const { spawnSync, spawn: spawn2 } = await import("node:child_process");
|
|
2810
|
+
const srcDir = join2(home, "src", "abtars");
|
|
2811
|
+
const abmindDir = join2(home, "src", "abmind");
|
|
2812
|
+
if (!existsSync(join2(srcDir, ".git"))) {
|
|
2813
|
+
await ctx.reply("No source repo. Run /update pull first.");
|
|
2814
|
+
return true;
|
|
2815
|
+
}
|
|
2816
|
+
const { getDeployedVersion } = await import("./paths-QQM74XYT.js");
|
|
2817
|
+
const head = spawnSync("git", ["-C", srcDir, "rev-parse", "--short", "HEAD"], { encoding: "utf-8" }).stdout.trim();
|
|
2818
|
+
const running = getDeployedVersion();
|
|
2819
|
+
if (head && (running.version.includes(head) || running.commit === head)) {
|
|
2820
|
+
await ctx.reply(`Already running ${head}. Nothing to deploy.`);
|
|
2821
|
+
return true;
|
|
2822
|
+
}
|
|
2823
|
+
logInfo("update", `Deploy starting (non-blocking)`);
|
|
2824
|
+
await ctx.reply("\u2699\uFE0F Deploying (building in background)...");
|
|
2825
|
+
const script = join2(srcDir, "scripts", "build-and-deploy.sh");
|
|
2826
|
+
spawn2("bash", [script, srcDir, abmindDir], {
|
|
2827
|
+
detached: true,
|
|
2828
|
+
stdio: "ignore"
|
|
2829
|
+
}).unref();
|
|
2830
|
+
} catch (err) {
|
|
2831
|
+
await ctx.reply(`Deploy failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
2832
|
+
}
|
|
2833
|
+
return true;
|
|
2834
|
+
} else if (arg === "update") {
|
|
2835
|
+
if (!isMaster) {
|
|
2836
|
+
await ctx.reply("Requires master role.");
|
|
2837
|
+
return true;
|
|
2838
|
+
}
|
|
2839
|
+
logInfo("update", "npm update starting");
|
|
2840
|
+
await ctx.reply("Updating from npm...");
|
|
2841
|
+
const { spawn: spawn2 } = await import("node:child_process");
|
|
2842
|
+
spawn2("abtars", ["update", "--source", "npm"], { detached: true, stdio: "ignore" }).unref();
|
|
2843
|
+
return true;
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
if (arg === "check") {
|
|
2847
|
+
await ctx.reply("\u{1F50D} Checking npm registry...");
|
|
2848
|
+
try {
|
|
2849
|
+
const { spawnSync } = await import("node:child_process");
|
|
2850
|
+
const abtarsLatest = spawnSync("npm", ["view", "abtars", "dist-tags", "--json"], { encoding: "utf-8", timeout: 1e4 });
|
|
2851
|
+
const abmindLatest = spawnSync("npm", ["view", "abmind", "dist-tags", "--json"], { encoding: "utf-8", timeout: 1e4 });
|
|
2852
|
+
const abt = abtarsLatest.status === 0 ? JSON.parse(abtarsLatest.stdout) : null;
|
|
2853
|
+
const abm = abmindLatest.status === 0 ? JSON.parse(abmindLatest.stdout) : null;
|
|
2854
|
+
const lines2 = ["\u{1F4E6} npm registry (fresh):"];
|
|
2855
|
+
if (abt) lines2.push(` abtars: latest=${abt.latest ?? "?"} alpha=${abt.alpha ?? "?"}`);
|
|
2856
|
+
if (abm) lines2.push(` abmind: latest=${abm.latest ?? "?"} alpha=${abm.alpha ?? "?"}`);
|
|
2857
|
+
if (!abt && !abm) lines2.push(" \u26A0\uFE0F npm unreachable");
|
|
2858
|
+
await ctx.reply(lines2.join("\n"));
|
|
2859
|
+
} catch {
|
|
2860
|
+
await ctx.reply("\u274C npm check failed (timeout or network error)");
|
|
2861
|
+
}
|
|
2862
|
+
return true;
|
|
2863
|
+
}
|
|
2864
|
+
const lines = ["\u{1F527} Software"];
|
|
2865
|
+
try {
|
|
2866
|
+
const { getDeployedVersion } = await import("./paths-QQM74XYT.js");
|
|
2867
|
+
const ver = getDeployedVersion();
|
|
2868
|
+
const manifest = existsSync(join2(home, "manifest.json")) ? JSON.parse(readFileSync(join2(home, "manifest.json"), "utf-8")) : null;
|
|
2869
|
+
const deployed = manifest?.activatedAt ? new Date(manifest.activatedAt).toLocaleString() : "unknown";
|
|
2870
|
+
lines.push(` abtars: ${ver.version}${ver.commit && !ver.version.includes(ver.commit) ? "-" + ver.commit : ""} (deployed ${deployed})`);
|
|
2871
|
+
if (manifest?.source) lines.push(` source: ${manifest.source === "local" ? "local" : "npm"}`);
|
|
2872
|
+
try {
|
|
2873
|
+
const { execFileSync } = await import("node:child_process");
|
|
2874
|
+
const raw = execFileSync("npm", ["view", "abtars", "dist-tags", "--json"], { encoding: "utf-8", timeout: 5e3 });
|
|
2875
|
+
const latest = JSON.parse(raw).alpha ?? JSON.parse(raw).latest;
|
|
2876
|
+
if (latest) lines.push(` npm latest: abtars@${latest} ${latest === ver.version || ver.version.startsWith(latest) ? "\u2713" : "\u26A0\uFE0F"}`);
|
|
2877
|
+
} catch {
|
|
2878
|
+
}
|
|
2879
|
+
} catch {
|
|
2880
|
+
lines.push(" abtars: unknown");
|
|
2881
|
+
}
|
|
2882
|
+
lines.push("");
|
|
2883
|
+
const abmindBundlePkg = join2(home, "app", "bundle", "node_modules", "abmind", "package.json");
|
|
2884
|
+
const abmindAppPkg = join2(home, "app", "node_modules", "abmind", "package.json");
|
|
2885
|
+
const abmindHome = process.env["ABMIND_HOME"] ?? join2(home, "..", ".abmind");
|
|
2886
|
+
const abmindManifest = join2(abmindHome, "manifest.json");
|
|
2887
|
+
const abmindPkgPath = existsSync(abmindBundlePkg) ? abmindBundlePkg : existsSync(abmindAppPkg) ? abmindAppPkg : null;
|
|
2888
|
+
if (abmindPkgPath) {
|
|
2889
|
+
try {
|
|
2890
|
+
const pkg = JSON.parse(readFileSync(abmindPkgPath, "utf-8"));
|
|
2891
|
+
const manifest = existsSync(abmindManifest) ? JSON.parse(readFileSync(abmindManifest, "utf-8")) : null;
|
|
2892
|
+
const deployed = manifest?.activatedAt ? new Date(manifest.activatedAt).toLocaleString() : "unknown";
|
|
2893
|
+
lines.push(` abmind: ${pkg.version ?? "?"} (deployed ${deployed})`);
|
|
2894
|
+
lines.push(` source: local`);
|
|
2895
|
+
try {
|
|
2896
|
+
const { execFileSync } = await import("node:child_process");
|
|
2897
|
+
const raw = execFileSync("npm", ["view", "abmind", "dist-tags", "--json"], { encoding: "utf-8", timeout: 5e3 });
|
|
2898
|
+
const latest = JSON.parse(raw).alpha ?? JSON.parse(raw).latest;
|
|
2899
|
+
if (latest) lines.push(` npm latest: abmind@${latest} ${latest === pkg.version ? "\u2713" : "\u26A0\uFE0F"}`);
|
|
2900
|
+
} catch {
|
|
2901
|
+
}
|
|
2902
|
+
} catch {
|
|
2903
|
+
lines.push(" abmind: installed (version unknown)");
|
|
2904
|
+
}
|
|
2905
|
+
} else if (existsSync(abmindManifest)) {
|
|
2906
|
+
try {
|
|
2907
|
+
const m = JSON.parse(readFileSync(abmindManifest, "utf-8"));
|
|
2908
|
+
const deployed = m.activatedAt ? new Date(m.activatedAt).toLocaleString() : "unknown";
|
|
2909
|
+
lines.push(` abmind: ${m.version ?? "?"} (deployed ${deployed})`);
|
|
2910
|
+
lines.push(` source: npm`);
|
|
2911
|
+
try {
|
|
2912
|
+
const { execFileSync } = await import("node:child_process");
|
|
2913
|
+
const raw = execFileSync("npm", ["view", "abmind", "dist-tags", "--json"], { encoding: "utf-8", timeout: 5e3 });
|
|
2914
|
+
const latest = JSON.parse(raw).alpha ?? JSON.parse(raw).latest;
|
|
2915
|
+
if (latest) lines.push(` npm latest: abmind@${latest} ${latest === m.version ? "\u2713" : "\u26A0\uFE0F"}`);
|
|
2916
|
+
} catch {
|
|
2917
|
+
}
|
|
2918
|
+
} catch {
|
|
2919
|
+
lines.push(" abmind: installed (version unknown)");
|
|
2920
|
+
}
|
|
2921
|
+
} else {
|
|
2922
|
+
lines.push(" abmind: not installed");
|
|
2923
|
+
}
|
|
2924
|
+
lines.push("");
|
|
2925
|
+
lines.push(" Rollback:");
|
|
2926
|
+
for (let i = 1; i <= 3; i++) {
|
|
2927
|
+
const pkgPath = join2(home, `app.prev.${i}`, "package.json");
|
|
2928
|
+
try {
|
|
2929
|
+
const ver = JSON.parse(readFileSync(pkgPath, "utf-8")).version;
|
|
2930
|
+
lines.push(` ${i}: ${ver}`);
|
|
2931
|
+
} catch {
|
|
2932
|
+
lines.push(` ${i}: (empty)`);
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
lines.push("");
|
|
2936
|
+
lines.push(" /software update [pull|deploy] | update (npm) | rollback");
|
|
2937
|
+
await ctx.reply(lines.join("\n"));
|
|
2938
|
+
return true;
|
|
2939
|
+
}
|
|
2671
2940
|
|
|
2672
2941
|
// src/components/nlm-command-handler.ts
|
|
2673
2942
|
init_env_schema();
|
|
@@ -2982,7 +3251,7 @@ async function handleTasksList(_text, ctx) {
|
|
|
2982
3251
|
const now = (/* @__PURE__ */ new Date()).toLocaleString("en-GB", { timeZone: tz, dateStyle: "medium", timeStyle: "medium" });
|
|
2983
3252
|
let listing;
|
|
2984
3253
|
try {
|
|
2985
|
-
const { readEntries: readEntries2 } = await import("./task-store-
|
|
3254
|
+
const { readEntries: readEntries2 } = await import("./task-store-VCBHAB43.js");
|
|
2986
3255
|
const entries = readEntries2();
|
|
2987
3256
|
const active = entries.filter((e) => !e.fired);
|
|
2988
3257
|
active.sort((a, b) => {
|
|
@@ -3099,20 +3368,17 @@ async function handleTaskPause(text, ctx) {
|
|
|
3099
3368
|
|
|
3100
3369
|
// src/components/commands/handlers-admin.ts
|
|
3101
3370
|
init_log_and_swallow();
|
|
3102
|
-
init_paths();
|
|
3103
|
-
import { readdirSync as readdirSync3 } from "node:fs";
|
|
3104
|
-
import { join as join4 } from "node:path";
|
|
3105
3371
|
var TAG11 = "cmd_admin";
|
|
3106
3372
|
async function handleUsers(text, ctx) {
|
|
3107
|
-
const { loadUsers: loadUsers2 } = await import("./user-registry-
|
|
3373
|
+
const { loadUsers: loadUsers2 } = await import("./user-registry-PEFDZ5AV.js");
|
|
3108
3374
|
const parts = text.trim().split(/\s+/);
|
|
3109
3375
|
const sub = parts[1];
|
|
3110
3376
|
if (sub === "approve" && parts[2]) {
|
|
3111
3377
|
const platformId = parts[2];
|
|
3112
3378
|
const { writeFileSync: writeFileSync2, readFileSync: readFileSync3 } = await import("node:fs");
|
|
3113
|
-
const { join:
|
|
3114
|
-
const { abtarsHome: abtarsHome2 } = await import("./paths-
|
|
3115
|
-
const configPath =
|
|
3379
|
+
const { join: join4 } = await import("node:path");
|
|
3380
|
+
const { abtarsHome: abtarsHome2 } = await import("./paths-QQM74XYT.js");
|
|
3381
|
+
const configPath = join4(abtarsHome2(), "config", "users.json");
|
|
3116
3382
|
try {
|
|
3117
3383
|
const raw = JSON.parse(readFileSync3(configPath, "utf-8"));
|
|
3118
3384
|
const users = Array.isArray(raw.users) ? raw.users : [];
|
|
@@ -3132,9 +3398,9 @@ async function handleUsers(text, ctx) {
|
|
|
3132
3398
|
if (sub === "revoke" && parts[2]) {
|
|
3133
3399
|
const targetUserId = parts[2];
|
|
3134
3400
|
const { writeFileSync: writeFileSync2, readFileSync: readFileSync3 } = await import("node:fs");
|
|
3135
|
-
const { join:
|
|
3136
|
-
const { abtarsHome: abtarsHome2 } = await import("./paths-
|
|
3137
|
-
const configPath =
|
|
3401
|
+
const { join: join4 } = await import("node:path");
|
|
3402
|
+
const { abtarsHome: abtarsHome2 } = await import("./paths-QQM74XYT.js");
|
|
3403
|
+
const configPath = join4(abtarsHome2(), "config", "users.json");
|
|
3138
3404
|
try {
|
|
3139
3405
|
const raw = JSON.parse(readFileSync3(configPath, "utf-8"));
|
|
3140
3406
|
const users = (Array.isArray(raw.users) ? raw.users : []).filter((u) => u.userId !== targetUserId);
|
|
@@ -3158,30 +3424,34 @@ ${lines.join("\n")}
|
|
|
3158
3424
|
return true;
|
|
3159
3425
|
}
|
|
3160
3426
|
async function handleSkills(_text, ctx) {
|
|
3161
|
-
const
|
|
3162
|
-
const
|
|
3427
|
+
const { getSkillCache } = await import("./hotskills-DTROJY6G.js");
|
|
3428
|
+
const skills = getSkillCache();
|
|
3429
|
+
if (skills.length === 0) {
|
|
3430
|
+
await ctx.reply("\u{1F4DA} No skills loaded.");
|
|
3431
|
+
return true;
|
|
3432
|
+
}
|
|
3433
|
+
const active = skills.filter((s) => !s.skipped);
|
|
3434
|
+
const skipped = skills.filter((s) => s.skipped);
|
|
3435
|
+
const groups = /* @__PURE__ */ new Map();
|
|
3436
|
+
for (const s of skills) {
|
|
3437
|
+
const list = groups.get(s.group) ?? [];
|
|
3438
|
+
list.push(s);
|
|
3439
|
+
groups.set(s.group, list);
|
|
3440
|
+
}
|
|
3441
|
+
const header = `\u{1F4DA} Skills: ${active.length} active${skipped.length ? `, ${skipped.length} skipped` : ""}`;
|
|
3163
3442
|
const sections = [];
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
const files = readdirSync3(dir, { recursive: true }).map((f) => String(f)).filter((f) => f.endsWith(".md") && !f.endsWith("TOOLS.md")).sort();
|
|
3169
|
-
if (files.length > 0) {
|
|
3170
|
-
total += files.length;
|
|
3171
|
-
sections.push(`${group} (${files.length}):
|
|
3172
|
-
${files.map((f) => ` \u2022 ${f.replace(/\.md$/, "")}`).join("\n")}`);
|
|
3173
|
-
}
|
|
3174
|
-
} catch (err) {
|
|
3175
|
-
logAndSwallow("command_handlers", "op", err);
|
|
3176
|
-
}
|
|
3443
|
+
for (const [group, items] of [...groups.entries()].sort((a, b) => a[0].localeCompare(b[0]))) {
|
|
3444
|
+
const lines = items.map((s) => s.skipped ? ` \u2717 ${s.name} (${s.skipped})` : ` \u2713 ${s.name}`);
|
|
3445
|
+
sections.push(`${group} (${items.length}):
|
|
3446
|
+
${lines.join("\n")}`);
|
|
3177
3447
|
}
|
|
3178
|
-
await ctx.reply(
|
|
3448
|
+
await ctx.reply(`${header}
|
|
3179
3449
|
|
|
3180
|
-
${sections.join("\n\n")}`
|
|
3450
|
+
${sections.join("\n\n")}`);
|
|
3181
3451
|
return true;
|
|
3182
3452
|
}
|
|
3183
3453
|
async function handleHooks(_text, ctx) {
|
|
3184
|
-
const { getHookSummary } = await import("./hook-system-
|
|
3454
|
+
const { getHookSummary } = await import("./hook-system-ZCVOFFRD.js");
|
|
3185
3455
|
const summary = getHookSummary();
|
|
3186
3456
|
const lines = ["\u{1FA9D} Hooks:"];
|
|
3187
3457
|
for (const { event, hooks } of summary) {
|
|
@@ -3197,7 +3467,7 @@ async function handleHooks(_text, ctx) {
|
|
|
3197
3467
|
async function handleMcp(_text, ctx) {
|
|
3198
3468
|
const arg = _text.replace(/^\/mcp\s*/i, "").trim().toLowerCase();
|
|
3199
3469
|
if (arg === "start") {
|
|
3200
|
-
const { loadUsers: loadUsers2 } = await import("./user-registry-
|
|
3470
|
+
const { loadUsers: loadUsers2 } = await import("./user-registry-PEFDZ5AV.js");
|
|
3201
3471
|
const registry = loadUsers2();
|
|
3202
3472
|
const user = registry.byUserId.get(ctx.userId);
|
|
3203
3473
|
if (user?.role !== "master") {
|
|
@@ -3254,7 +3524,14 @@ async function handleHelp(_text, ctx) {
|
|
|
3254
3524
|
"/reset \u2014 Reload transport + fresh session",
|
|
3255
3525
|
"/reset default \u2014 Restore transport.default.json + fresh session",
|
|
3256
3526
|
"/compact \u2014 Compact context window (summarize + fresh session)",
|
|
3257
|
-
"/status \u2014
|
|
3527
|
+
"/status \u2014 Operational health (PID, uptime, platforms, context)",
|
|
3528
|
+
"/software \u2014 Version info, deploy date, npm check, rollback",
|
|
3529
|
+
"/software update [pull|deploy] \u2014 Pull & build from git",
|
|
3530
|
+
"/software update npm \u2014 Update from npm registry",
|
|
3531
|
+
"/software rollback <version> \u2014 Roll back to previous version",
|
|
3532
|
+
"/update \u2014 Alias for /software update pull",
|
|
3533
|
+
"/model \u2014 Model configuration (provider, context, fallbacks)",
|
|
3534
|
+
"/model set <name> \u2014 Switch model",
|
|
3258
3535
|
"/doctor \u2014 Deep probe all subsystems",
|
|
3259
3536
|
"/doctor fix \u2014 Run safe auto-repairs",
|
|
3260
3537
|
"/doctor fix-full \u2014 Full repair (+ FTS rebuild, WAL checkpoint)",
|
|
@@ -3263,41 +3540,29 @@ async function handleHelp(_text, ctx) {
|
|
|
3263
3540
|
"/stop, /ctrlc \u2014 Stop current response",
|
|
3264
3541
|
"/memory \u2014 Memory storage statistics",
|
|
3265
3542
|
"/heartbeat \u2014 Heartbeat diagnostics (tasks, last tick)",
|
|
3266
|
-
"/models \u2014 Model, transport & agent status",
|
|
3543
|
+
"/models \u2014 Model, transport & agent status (legacy)",
|
|
3267
3544
|
"/models change \u2014 Switch model/provider (any agent)",
|
|
3268
3545
|
"/models quick <model> \u2014 Instant switch on same provider",
|
|
3269
|
-
"/
|
|
3270
|
-
"/models restore \u2014 Undo last model/provider switch",
|
|
3271
|
-
"/models default \u2014 Factory reset (transport.default.json)",
|
|
3272
|
-
"/models emergency \u2014 \u{1F6A8} Activate paid hailMary model (manual)",
|
|
3273
|
-
"/emergency \u2014 Shortcut for /models emergency",
|
|
3274
|
-
"/models health reset \u2014 Reset model health buckets",
|
|
3546
|
+
"/emergency \u2014 \u{1F6A8} Activate paid hailMary model",
|
|
3275
3547
|
"/tasks \u2014 Scheduled tasks",
|
|
3276
3548
|
"/tasks log <id> \u2014 Last 5 runs for a task",
|
|
3277
3549
|
"/task run <id> \u2014 Manually fire a task",
|
|
3278
|
-
"/task pause <id> \u2014 Pause
|
|
3279
|
-
"/task resume <id> \u2014 Resume a paused task",
|
|
3550
|
+
"/task pause <id> \u2014 Pause / /task resume <id> \u2014 Resume",
|
|
3280
3551
|
"/facts \u2014 Core knowledge (user profile + agent notes)",
|
|
3281
|
-
"/skills \u2014 List
|
|
3552
|
+
"/skills \u2014 List active/skipped skills",
|
|
3282
3553
|
"/session \u2014 List sessions",
|
|
3283
3554
|
"/session new [browse|code|task] \u2014 New session",
|
|
3284
|
-
"/session <#> \u2014 Switch session",
|
|
3285
|
-
"/session end [#] \u2014 End session (keep messages)",
|
|
3286
|
-
"/session kill <#> \u2014 Kill session (wipe messages)",
|
|
3287
|
-
"/default \u2014 Switch back to default agent",
|
|
3555
|
+
"/session <#> \u2014 Switch / /session end [#] \u2014 End / /session kill <#> \u2014 Kill",
|
|
3288
3556
|
"/nlm \u2014 Knowledge base (list/create/sources/query)",
|
|
3289
|
-
"/restart \u2014 Restart
|
|
3290
|
-
"/wakeup \u2014 Wake Mac from sleep
|
|
3291
|
-
"/sleep \u2014 Sleep status",
|
|
3292
|
-
"/
|
|
3293
|
-
"/sleep now \u2014 Full fresh sleep cycle",
|
|
3294
|
-
"/skill reload \u2014 Regenerate skills catalog"
|
|
3557
|
+
"/restart \u2014 Restart bridge",
|
|
3558
|
+
"/wakeup \u2014 Wake Mac from sleep",
|
|
3559
|
+
"/sleep \u2014 Sleep status / /sleep resume / /sleep now",
|
|
3560
|
+
"/whoami \u2014 Your user info & clearance"
|
|
3295
3561
|
];
|
|
3296
3562
|
if (ctx.platform === "telegram") {
|
|
3297
3563
|
cmds.push("/full \u2014 Raw output, TTS disabled", "/short \u2014 Clean responses (default)", "/healing \u2014 Toggle self-healer on/off");
|
|
3298
3564
|
}
|
|
3299
3565
|
cmds.push("/help \u2014 Show this help");
|
|
3300
|
-
cmds.push("/skills \u2014 List available skills");
|
|
3301
3566
|
await ctx.reply(`\u{1F4CB} Available commands:
|
|
3302
3567
|
|
|
3303
3568
|
${cmds.join("\n")}`);
|
|
@@ -3658,6 +3923,8 @@ registerExact("/restart", handleRestart);
|
|
|
3658
3923
|
registerExact("/full", handleFull);
|
|
3659
3924
|
registerExact("/short", handleShort);
|
|
3660
3925
|
registerExact("/healing", handleHealing);
|
|
3926
|
+
registerExact("/software", handleSoftware);
|
|
3927
|
+
registerExact("/update", handleSoftware);
|
|
3661
3928
|
registerExact("/facts", handleFacts);
|
|
3662
3929
|
registerExact("/tasks", handleTasksList);
|
|
3663
3930
|
registerExact("/task", handleTasksList);
|
|
@@ -3699,7 +3966,6 @@ export {
|
|
|
3699
3966
|
SessionRegistry,
|
|
3700
3967
|
SessionManager,
|
|
3701
3968
|
loadNLMConfig,
|
|
3702
|
-
sanitizeOutbound,
|
|
3703
3969
|
routeReaction,
|
|
3704
3970
|
formatReactionSignal,
|
|
3705
3971
|
cleanResponse,
|
|
@@ -3708,10 +3974,11 @@ export {
|
|
|
3708
3974
|
triggerNewSession,
|
|
3709
3975
|
triggerResetSession,
|
|
3710
3976
|
killWakeInhibit,
|
|
3977
|
+
getRecalledIdsForMessage,
|
|
3711
3978
|
resetIdleCompactFlag,
|
|
3712
3979
|
setIdleCompactReset,
|
|
3713
3980
|
resetAndPrepare,
|
|
3714
3981
|
handleInboundMessage,
|
|
3715
3982
|
startSession
|
|
3716
3983
|
};
|
|
3717
|
-
//# sourceMappingURL=chunk-
|
|
3984
|
+
//# sourceMappingURL=chunk-OGZXYN6E.js.map
|