abtars 0.2.1-alpha.9 → 0.2.2
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/CHANGELOG.md +64 -0
- package/README.md +93 -34
- package/bundle/{_registry.generated-ADOYFJJ4.js → _registry.generated-KYX63MGY.js} +19 -16
- package/bundle/{_registry.generated-ADOYFJJ4.js.map → _registry.generated-KYX63MGY.js.map} +1 -1
- package/bundle/abtars-browser.js +5 -6
- package/bundle/abtars-browser.js.map +2 -2
- package/bundle/abtars-cli.js +205 -179
- 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 +305 -182
- 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-5VL5KI6U.js} +8 -8
- package/bundle/agent-registry-PIS5XJHX.js +19 -0
- 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-3IPMKYYH.js +672 -0
- package/bundle/chunk-3IPMKYYH.js.map +7 -0
- package/bundle/{chunk-PZE3J7ER.js → chunk-3OXQWII3.js} +2 -2
- package/bundle/{chunk-X5FBUA53.js → chunk-4WKWPU6U.js} +137 -30
- package/bundle/chunk-4WKWPU6U.js.map +7 -0
- package/bundle/{chunk-4KJ76TTE.js → chunk-4XW7YA3K.js} +3 -3
- package/bundle/{chunk-A5OJYQNU.js → chunk-5WFIAUQC.js} +49 -22
- package/bundle/chunk-5WFIAUQC.js.map +7 -0
- package/bundle/{chunk-ZVDVNSXK.js → chunk-7WFE2JI5.js} +7 -7
- package/bundle/{chunk-R36WIOYX.js → chunk-B52YRWR6.js} +34 -6
- package/bundle/chunk-B52YRWR6.js.map +7 -0
- package/bundle/{chunk-Q62SXS73.js → chunk-BBDKU4EH.js} +9 -9
- package/bundle/chunk-BBTQKKDO.js +258 -0
- package/bundle/chunk-BBTQKKDO.js.map +7 -0
- 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-GXKJKYU4.js +1089 -0
- package/bundle/chunk-GXKJKYU4.js.map +7 -0
- package/bundle/{chunk-GPL57SRN.js → chunk-H7RX7UCR.js} +3 -3
- package/bundle/{chunk-BYDUMHXT.js → chunk-HAF2AFBW.js} +2 -2
- package/bundle/chunk-HAS5NEK7.js +189 -0
- package/bundle/chunk-HAS5NEK7.js.map +7 -0
- package/bundle/chunk-HB54S5OY.js +4036 -0
- package/bundle/chunk-HB54S5OY.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-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-KWBGYWDO.js → chunk-N24ROESF.js} +15 -17
- package/bundle/chunk-N24ROESF.js.map +7 -0
- package/bundle/{chunk-P2BZSLJJ.js → chunk-N7UG4FID.js} +448 -129
- package/bundle/chunk-N7UG4FID.js.map +7 -0
- package/bundle/chunk-NIYVCGBC.js +330 -0
- package/bundle/chunk-NIYVCGBC.js.map +7 -0
- package/bundle/{chunk-TOUZC6NR.js → chunk-OKMN6J4Z.js} +3 -3
- package/bundle/{chunk-RV54J75Q.js → chunk-PKHYCNTT.js} +13 -12
- package/bundle/chunk-PKHYCNTT.js.map +7 -0
- package/bundle/{chunk-XZSYMCLF.js → chunk-PUDGA4RR.js} +7 -7
- package/bundle/{chunk-CELR236Q.js → chunk-Q7CH5DA3.js} +2 -2
- package/bundle/chunk-QSC6QZ44.js +183 -0
- package/bundle/chunk-QSC6QZ44.js.map +7 -0
- 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-4BUOO6WI.js → chunk-SMZQDMSZ.js} +31 -11
- package/bundle/chunk-SMZQDMSZ.js.map +7 -0
- package/bundle/{chunk-GBBTK6H2.js → chunk-SRFEIZQT.js} +4 -4
- package/bundle/{chunk-ELRAH7VL.js → chunk-VXUVKC66.js} +3 -3
- package/bundle/chunk-VY2BUO6L.js +4035 -0
- package/bundle/chunk-VY2BUO6L.js.map +7 -0
- package/bundle/chunk-W6ELWLAR.js +143 -0
- package/bundle/chunk-W6ELWLAR.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-Y2XBDQP3.js +4055 -0
- package/bundle/chunk-Y2XBDQP3.js.map +7 -0
- package/bundle/chunk-YMGX6HNP.js +131 -0
- package/bundle/chunk-YMGX6HNP.js.map +7 -0
- package/bundle/chunk-YWZPKBO6.js +22 -0
- package/bundle/chunk-YWZPKBO6.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-IGRSOSK6.js} +15 -14
- package/bundle/commands-LAWVNQTO.js +34 -0
- package/bundle/commands-RBWY7YXB.js +34 -0
- package/bundle/commands-XFZNMZN6.js +34 -0
- 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-OZICXTWQ.js} +43 -15
- package/bundle/direct-api-transport-OZICXTWQ.js.map +7 -0
- package/bundle/direct-api-transport-QIWA5ES2.js +889 -0
- package/bundle/direct-api-transport-QIWA5ES2.js.map +7 -0
- package/bundle/{discord-adapter-WA2MFRK3.js → discord-adapter-JFIIVG34.js} +27 -24
- package/bundle/discord-adapter-JFIIVG34.js.map +7 -0
- package/bundle/discord-adapter-U3FA5OTY.js +589 -0
- package/bundle/discord-adapter-U3FA5OTY.js.map +7 -0
- package/bundle/discord-adapter-W6L5KJ6T.js +589 -0
- package/bundle/discord-adapter-W6L5KJ6T.js.map +7 -0
- package/bundle/discord-adapter-WWM6ROTW.js +589 -0
- package/bundle/discord-adapter-WWM6ROTW.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-SH4UVUXQ.js → install-I3CXVW52.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/kanban-board-6Q5E5GEB.js +31 -0
- package/bundle/kanban-board-I52RHNHQ.js +31 -0
- 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-4CTBJ6K2.js} +17 -14
- package/bundle/message-pipeline-4KL7OWUH.js +38 -0
- package/bundle/message-pipeline-GFKSHRFU.js +38 -0
- package/bundle/message-pipeline-TGI2WJJM.js +38 -0
- package/bundle/meta.json +3181 -2356
- 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-INFD6ELA.js} +10 -10
- package/bundle/phase-transport-KXFZ5BVF.js +23 -0
- package/bundle/{restore-MFSW3EBL.js → restore-Z6MF54HS.js} +4 -4
- package/bundle/{restore-MFSW3EBL.js.map → restore-Z6MF54HS.js.map} +2 -2
- package/bundle/{update-check-O5MS6B3L.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-ENFZFUJJ.js} +8 -8
- package/bundle/sleep-ENFZFUJJ.js.map +7 -0
- package/bundle/{soul-bundle-BRIUDEQ2.js → soul-bundle-QTPWDJB2.js} +7 -7
- package/bundle/soul-bundle-QTPWDJB2.js.map +7 -0
- package/bundle/{soul-loader-GBXJ7EBH.js → soul-loader-LCPTN4PK.js} +8 -8
- package/bundle/soul-loader-LCPTN4PK.js.map +7 -0
- 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/stt-YN77NND6.js.map +7 -0
- package/bundle/{subagent-runtime-4MTYUBIZ.js → subagent-runtime-5AYOXOU2.js} +5 -5
- package/bundle/subagent-runtime-5AYOXOU2.js.map +7 -0
- package/bundle/subagent-runtime-VKTX6Q2M.js +13 -0
- package/bundle/subagent-runtime-VKTX6Q2M.js.map +7 -0
- 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-failure-buffer-DPM5MWZ5.js.map +7 -0
- package/bundle/{task-store-LC7ZMS72.js → task-store-VCBHAB43.js} +5 -5
- package/bundle/task-store-VCBHAB43.js.map +7 -0
- package/bundle/{telegram-adapter-BJJYXN7J.js → telegram-adapter-4KI4CJPG.js} +51 -33
- package/bundle/telegram-adapter-4KI4CJPG.js.map +7 -0
- package/bundle/telegram-adapter-76B4JRJJ.js +1080 -0
- package/bundle/telegram-adapter-76B4JRJJ.js.map +7 -0
- package/bundle/telegram-adapter-VZA74EMT.js +1080 -0
- package/bundle/telegram-adapter-VZA74EMT.js.map +7 -0
- package/bundle/telegram-adapter-ZO2CLU22.js +1080 -0
- package/bundle/telegram-adapter-ZO2CLU22.js.map +7 -0
- package/bundle/{tool-registry-T7XLTI2Q.js → tool-registry-CG7GIS64.js} +13 -9
- package/bundle/tool-registry-CG7GIS64.js.map +7 -0
- package/bundle/tool-registry-TGNU5AMG.js +43 -0
- package/bundle/tool-registry-TGNU5AMG.js.map +7 -0
- package/bundle/{tool-sandbox-OZMXJZLQ.js → tool-sandbox-TLAL55QP.js} +5 -5
- package/bundle/tool-sandbox-TLAL55QP.js.map +7 -0
- package/bundle/{transport-config-G5NKQXPJ.js → transport-config-JIKHB7GT.js} +8 -8
- package/bundle/transport-config-JIKHB7GT.js.map +7 -0
- 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/bundle/user-registry-PEFDZ5AV.js.map +7 -0
- package/core/skills/tools/gmail/SKILL.md +5 -14
- package/core/skills/tools/rss/SKILL.md +51 -0
- package/install-manifest.json +8 -2
- package/package.json +4 -2
- package/scripts/abtars-daemon.service +3 -0
- package/scripts/abtars@.service +3 -0
- package/scripts/build-and-deploy.sh +68 -0
- 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-RSWUPUNA.js.map +0 -7
- package/bundle/chunk-RV54J75Q.js.map +0 -7
- package/bundle/chunk-TYVI3ZWA.js.map +0 -7
- package/bundle/chunk-X5FBUA53.js.map +0 -7
- package/bundle/direct-api-transport-TRV45NO6.js.map +0 -7
- package/bundle/discord-adapter-WA2MFRK3.js.map +0 -7
- package/bundle/system-status-GLYXXDE3.js.map +0 -7
- package/bundle/telegram-adapter-BJJYXN7J.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-5VL5KI6U.js.map} +0 -0
- /package/bundle/{bridge-lock-transport-HO545SBK.js.map → agent-registry-PIS5XJHX.js.map} +0 -0
- /package/bundle/{browse-delivery-VTLEAVYA.js.map → bridge-lock-transport-N6OGDOSE.js.map} +0 -0
- /package/bundle/{browser-REIXOJ6S.js.map → browse-delivery-DXGMDMXA.js.map} +0 -0
- /package/bundle/{capability-ILW3D5HS.js.map → browser-QMYGSP5W.js.map} +0 -0
- /package/bundle/{commands-WUGPBPHI.js.map → capability-733TLH4W.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-ZVDVNSXK.js.map → chunk-7WFE2JI5.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-XZSYMCLF.js.map → chunk-PUDGA4RR.js.map} +0 -0
- /package/bundle/{chunk-CELR236Q.js.map → chunk-Q7CH5DA3.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/{config-DQIGDX4W.js.map → commands-IGRSOSK6.js.map} +0 -0
- /package/bundle/{delegation-tools-6FICZQ5G.js.map → commands-LAWVNQTO.js.map} +0 -0
- /package/bundle/{deploy-lib-import-SBKXDD3F.js.map → commands-RBWY7YXB.js.map} +0 -0
- /package/bundle/{env-schema-XCPAJ6IZ.js.map → commands-XFZNMZN6.js.map} +0 -0
- /package/bundle/{hook-system-POI5VRIX.js.map → config-NDEYF4AQ.js.map} +0 -0
- /package/bundle/{daemon-NPKYZ3CJ.js.map → daemon-WOQXCKNL.js.map} +0 -0
- /package/bundle/{hotskills-6ECHLXTJ.js.map → delegation-tools-Z5OM3TXS.js.map} +0 -0
- /package/bundle/{install-SH4UVUXQ.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/{lazy-require-UFYFFX2R.js.map → env-schema-T43X43BU.js.map} +0 -0
- /package/bundle/{message-pipeline-2MBT44FO.js.map → hook-system-ZCVOFFRD.js.map} +0 -0
- /package/bundle/{notification-U6F5ZBSG.js.map → hotskills-DTROJY6G.js.map} +0 -0
- /package/bundle/{paths-ZJYIDND2.js.map → install-I3CXVW52.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/{peer-config-D5A4454H.js.map → kanban-board-6Q5E5GEB.js.map} +0 -0
- /package/bundle/{phase-transport-FEZ4SIJJ.js.map → kanban-board-I52RHNHQ.js.map} +0 -0
- /package/bundle/{skill-stats-IPVKMWN3.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/{sleep-BPWX3FCN.js.map → message-pipeline-4CTBJ6K2.js.map} +0 -0
- /package/bundle/{soul-bundle-BRIUDEQ2.js.map → message-pipeline-4KL7OWUH.js.map} +0 -0
- /package/bundle/{soul-loader-GBXJ7EBH.js.map → message-pipeline-GFKSHRFU.js.map} +0 -0
- /package/bundle/{stt-CF3CPFDC.js.map → message-pipeline-TGI2WJJM.js.map} +0 -0
- /package/bundle/{subagent-runtime-4MTYUBIZ.js.map → notification-ULESRDHB.js.map} +0 -0
- /package/bundle/{openrouter-credits-7XXO6QGQ.js.map → openrouter-credits-PLIKRY5D.js.map} +0 -0
- /package/bundle/{task-store-LC7ZMS72.js.map → paths-QQM74XYT.js.map} +0 -0
- /package/bundle/{peer-client-T44VI7NB.js.map → peer-client-D2F5QWRV.js.map} +0 -0
- /package/bundle/{tool-registry-T7XLTI2Q.js.map → peer-config-5SUIBJLG.js.map} +0 -0
- /package/bundle/{tool-sandbox-OZMXJZLQ.js.map → phase-transport-INFD6ELA.js.map} +0 -0
- /package/bundle/{transport-config-G5NKQXPJ.js.map → phase-transport-KXFZ5BVF.js.map} +0 -0
- /package/bundle/{update-check-O5MS6B3L.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/{user-registry-NUVNEHJU.js.map → skill-stats-NHNH47QW.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/{system-message-TALP6GP2.js.map → system-message-BRU267FW.js.map} +0 -0
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import {
|
|
4
4
|
init_log_and_swallow,
|
|
5
5
|
logAndSwallow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CYSGXNBY.js";
|
|
7
7
|
import {
|
|
8
8
|
init_logger,
|
|
9
9
|
logInfo,
|
|
10
10
|
logWarn
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GUTRAMK3.js";
|
|
12
12
|
|
|
13
13
|
// src/components/subagent-runtime.ts
|
|
14
14
|
init_log_and_swallow();
|
|
@@ -48,7 +48,7 @@ var SubagentRuntime = class {
|
|
|
48
48
|
const cached = this.cache.get(agent);
|
|
49
49
|
if (cached && sessionStrategy === "fresh") {
|
|
50
50
|
await cached.transport.resetSession?.(cached.sessionKey);
|
|
51
|
-
(await import("./tool-registry-
|
|
51
|
+
(await import("./tool-registry-TGNU5AMG.js")).resetStoreCounter();
|
|
52
52
|
}
|
|
53
53
|
const { transport, model, sessionKey } = cached ?? await this.createAgent(agent, opts?.sessionType);
|
|
54
54
|
if (opts?.timeoutMs && transport.setTimeoutOverride) {
|
|
@@ -151,21 +151,21 @@ var SubagentRuntime = class {
|
|
|
151
151
|
return true;
|
|
152
152
|
}
|
|
153
153
|
async createAgent(agent, sessionType) {
|
|
154
|
-
const { createSubagentTransport } = await import("./agent-registry-
|
|
154
|
+
const { createSubagentTransport } = await import("./agent-registry-5VL5KI6U.js");
|
|
155
155
|
const role = AGENT_TO_ROLE[agent];
|
|
156
156
|
const mainModel = this._mainTransport && "currentModel" in this._mainTransport ? this._mainTransport.currentModel : void 0;
|
|
157
157
|
const { transport, model } = await createSubagentTransport(role, this._registry ?? void 0, mainModel);
|
|
158
158
|
const typeMap = { browsie: "B", coding: "C", task: "T" };
|
|
159
159
|
const resolvedType = sessionType || typeMap[agent];
|
|
160
160
|
if (resolvedType && "setSystemPrompt" in transport && typeof transport.setSystemPrompt === "function") {
|
|
161
|
-
const { buildSoulBundle } = await import("./soul-bundle-
|
|
161
|
+
const { buildSoulBundle } = await import("./soul-bundle-QTPWDJB2.js");
|
|
162
162
|
const bundle = buildSoulBundle(resolvedType);
|
|
163
163
|
if (bundle) transport.setSystemPrompt(bundle);
|
|
164
164
|
}
|
|
165
165
|
const sessionKey = `system:${agent}`;
|
|
166
166
|
const entry = { transport, model, sessionKey };
|
|
167
167
|
this.cache.set(agent, entry);
|
|
168
|
-
(await import("./tool-registry-
|
|
168
|
+
(await import("./tool-registry-TGNU5AMG.js")).resetStoreCounter();
|
|
169
169
|
return entry;
|
|
170
170
|
}
|
|
171
171
|
};
|
|
@@ -180,4 +180,4 @@ var AGENT_TO_ROLE = {
|
|
|
180
180
|
export {
|
|
181
181
|
SubagentRuntime
|
|
182
182
|
};
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
183
|
+
//# sourceMappingURL=chunk-PUDGA4RR.js.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
init_log_and_swallow,
|
|
5
5
|
logAndSwallow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CYSGXNBY.js";
|
|
7
7
|
import {
|
|
8
8
|
__esm,
|
|
9
9
|
__export
|
|
@@ -68,4 +68,4 @@ export {
|
|
|
68
68
|
peer_jwt_exports,
|
|
69
69
|
init_peer_jwt
|
|
70
70
|
};
|
|
71
|
-
//# sourceMappingURL=chunk-
|
|
71
|
+
//# sourceMappingURL=chunk-Q7CH5DA3.js.map
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
3
|
+
import {
|
|
4
|
+
init_log_and_swallow,
|
|
5
|
+
logAndSwallow
|
|
6
|
+
} from "./chunk-CYSGXNBY.js";
|
|
7
|
+
import {
|
|
8
|
+
init_logger,
|
|
9
|
+
logInfo,
|
|
10
|
+
logWarn
|
|
11
|
+
} from "./chunk-GUTRAMK3.js";
|
|
12
|
+
|
|
13
|
+
// src/components/subagent-runtime.ts
|
|
14
|
+
init_log_and_swallow();
|
|
15
|
+
init_logger();
|
|
16
|
+
import { randomBytes } from "node:crypto";
|
|
17
|
+
var TAG = "runtime";
|
|
18
|
+
var DEFAULT_SESSION = {
|
|
19
|
+
professor: "reuse",
|
|
20
|
+
dreamy: "fresh",
|
|
21
|
+
browsie: "fresh",
|
|
22
|
+
coding: "reuse",
|
|
23
|
+
task: "fresh"
|
|
24
|
+
};
|
|
25
|
+
var DEFAULT_SPAWN_TIMEOUT_MS = 6e5;
|
|
26
|
+
var SubagentRuntime = class {
|
|
27
|
+
cache = /* @__PURE__ */ new Map();
|
|
28
|
+
activeSpawns = /* @__PURE__ */ new Map();
|
|
29
|
+
_registry = null;
|
|
30
|
+
_mainTransport = null;
|
|
31
|
+
_sessionManager = null;
|
|
32
|
+
/** Set shared model health registry (from boot ctx). */
|
|
33
|
+
setRegistry(registry) {
|
|
34
|
+
this._registry = registry;
|
|
35
|
+
}
|
|
36
|
+
/** Set main transport reference for currentModel reads. */
|
|
37
|
+
setMainTransport(transport) {
|
|
38
|
+
this._mainTransport = transport;
|
|
39
|
+
}
|
|
40
|
+
/** Set session manager for auto-spawn sub-session creation (#510). */
|
|
41
|
+
setSessionManager(mgr) {
|
|
42
|
+
this._sessionManager = mgr;
|
|
43
|
+
}
|
|
44
|
+
/** Send a prompt to a named agent and get the response. */
|
|
45
|
+
async complete(agent, prompt, opts) {
|
|
46
|
+
const sessionStrategy = opts?.session ?? DEFAULT_SESSION[agent] ?? "fresh";
|
|
47
|
+
const start = Date.now();
|
|
48
|
+
const cached = this.cache.get(agent);
|
|
49
|
+
if (cached && sessionStrategy === "fresh") {
|
|
50
|
+
await cached.transport.resetSession?.(cached.sessionKey);
|
|
51
|
+
(await import("./tool-registry-CG7GIS64.js")).resetStoreCounter();
|
|
52
|
+
}
|
|
53
|
+
const { transport, model, sessionKey } = cached ?? await this.createAgent(agent, opts?.sessionType);
|
|
54
|
+
if (opts?.timeoutMs && transport.setTimeoutOverride) {
|
|
55
|
+
transport.setTimeoutOverride(opts.timeoutMs);
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
const response = await transport.sendPrompt(sessionKey, prompt);
|
|
59
|
+
const elapsed = Date.now() - start;
|
|
60
|
+
logInfo(TAG, `${agent} complete: ${prompt.length}ch \u2192 ${response?.length ?? 0}ch (${elapsed}ms, ${model})`);
|
|
61
|
+
return response ?? "";
|
|
62
|
+
} catch (err) {
|
|
63
|
+
logWarn(TAG, `${agent} complete failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
64
|
+
this.cache.delete(agent);
|
|
65
|
+
throw err;
|
|
66
|
+
} finally {
|
|
67
|
+
if (opts?.timeoutMs && transport.setTimeoutOverride) {
|
|
68
|
+
transport.setTimeoutOverride(null);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Get a persistent session handle for multi-turn callers. */
|
|
73
|
+
async session(agent) {
|
|
74
|
+
const cached = this.cache.get(agent) ?? await this.createAgent(agent);
|
|
75
|
+
return {
|
|
76
|
+
sendPrompt: (sessionKey, prompt) => cached.transport.sendPrompt(sessionKey, prompt),
|
|
77
|
+
destroy: async () => {
|
|
78
|
+
try {
|
|
79
|
+
cached.transport.destroy();
|
|
80
|
+
} catch (err) {
|
|
81
|
+
logAndSwallow("subagent_runtime", "op", err);
|
|
82
|
+
}
|
|
83
|
+
this.cache.delete(agent);
|
|
84
|
+
logInfo(TAG, `${agent} session destroyed`);
|
|
85
|
+
},
|
|
86
|
+
get isReady() {
|
|
87
|
+
return cached.transport.isReady;
|
|
88
|
+
},
|
|
89
|
+
get transport() {
|
|
90
|
+
return cached.transport;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** Fire-and-forget: run complete() in background, deliver result via callback. */
|
|
95
|
+
async spawn(agent, prompt, opts) {
|
|
96
|
+
const taskId = randomBytes(4).toString("hex");
|
|
97
|
+
const abort = new AbortController();
|
|
98
|
+
this.activeSpawns.set(taskId, { abort, startedAt: Date.now() });
|
|
99
|
+
if (this._sessionManager) {
|
|
100
|
+
const typeMap = { browsie: "B", coding: "C", task: "T" };
|
|
101
|
+
const sessionType = typeMap[agent];
|
|
102
|
+
if (sessionType) this._sessionManager.createSubSession("master", "telegram", sessionType);
|
|
103
|
+
}
|
|
104
|
+
const timeoutMs = opts?.timeoutMs ?? DEFAULT_SPAWN_TIMEOUT_MS;
|
|
105
|
+
const timer = setTimeout(() => abort.abort(), timeoutMs);
|
|
106
|
+
void (async () => {
|
|
107
|
+
try {
|
|
108
|
+
const result = await this.complete(agent, prompt);
|
|
109
|
+
if (!abort.signal.aborted) opts?.onComplete?.(taskId, result);
|
|
110
|
+
} catch (err) {
|
|
111
|
+
if (!abort.signal.aborted) opts?.onError?.(taskId, err instanceof Error ? err : new Error(String(err)));
|
|
112
|
+
} finally {
|
|
113
|
+
clearTimeout(timer);
|
|
114
|
+
this.activeSpawns.delete(taskId);
|
|
115
|
+
}
|
|
116
|
+
})();
|
|
117
|
+
logInfo(TAG, `${agent} spawned: taskId=${taskId}, timeout=${timeoutMs}ms`);
|
|
118
|
+
return { taskId };
|
|
119
|
+
}
|
|
120
|
+
/** Shut down all cached transports and abort active spawns. */
|
|
121
|
+
async shutdown() {
|
|
122
|
+
for (const [id, { abort }] of this.activeSpawns) {
|
|
123
|
+
abort.abort();
|
|
124
|
+
logInfo(TAG, `spawn ${id} aborted`);
|
|
125
|
+
}
|
|
126
|
+
this.activeSpawns.clear();
|
|
127
|
+
for (const [name, cached] of this.cache) {
|
|
128
|
+
try {
|
|
129
|
+
cached.transport.destroy();
|
|
130
|
+
} catch (err) {
|
|
131
|
+
logAndSwallow("subagent_runtime", "op", err);
|
|
132
|
+
}
|
|
133
|
+
logInfo(TAG, `${name} transport closed`);
|
|
134
|
+
}
|
|
135
|
+
this.cache.clear();
|
|
136
|
+
}
|
|
137
|
+
/** Active registry: list running background spawns. */
|
|
138
|
+
listActive() {
|
|
139
|
+
return [...this.activeSpawns.entries()].map(([taskId, entry]) => ({
|
|
140
|
+
taskId,
|
|
141
|
+
startedAt: entry.startedAt ?? 0
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
/** Interrupt a specific spawn by taskId. Returns true if found. */
|
|
145
|
+
interruptSpawn(taskId) {
|
|
146
|
+
const entry = this.activeSpawns.get(taskId);
|
|
147
|
+
if (!entry) return false;
|
|
148
|
+
entry.abort.abort();
|
|
149
|
+
this.activeSpawns.delete(taskId);
|
|
150
|
+
logInfo(TAG, `spawn ${taskId} interrupted`);
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
async createAgent(agent, sessionType) {
|
|
154
|
+
const { createSubagentTransport } = await import("./agent-registry-PIS5XJHX.js");
|
|
155
|
+
const role = AGENT_TO_ROLE[agent];
|
|
156
|
+
const mainModel = this._mainTransport && "currentModel" in this._mainTransport ? this._mainTransport.currentModel : void 0;
|
|
157
|
+
const { transport, model } = await createSubagentTransport(role, this._registry ?? void 0, mainModel);
|
|
158
|
+
const typeMap = { browsie: "B", coding: "C", task: "T" };
|
|
159
|
+
const resolvedType = sessionType || typeMap[agent];
|
|
160
|
+
if (resolvedType && "setSystemPrompt" in transport && typeof transport.setSystemPrompt === "function") {
|
|
161
|
+
const { buildSoulBundle } = await import("./soul-bundle-QTPWDJB2.js");
|
|
162
|
+
const bundle = buildSoulBundle(resolvedType);
|
|
163
|
+
if (bundle) transport.setSystemPrompt(bundle);
|
|
164
|
+
}
|
|
165
|
+
const sessionKey = `system:${agent}`;
|
|
166
|
+
const entry = { transport, model, sessionKey };
|
|
167
|
+
this.cache.set(agent, entry);
|
|
168
|
+
(await import("./tool-registry-CG7GIS64.js")).resetStoreCounter();
|
|
169
|
+
return entry;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
var AGENT_TO_ROLE = {
|
|
173
|
+
professor: "task",
|
|
174
|
+
dreamy: "sleep",
|
|
175
|
+
browsie: "browse",
|
|
176
|
+
coding: "coding",
|
|
177
|
+
task: "task"
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export {
|
|
181
|
+
SubagentRuntime
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=chunk-QSC6QZ44.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/subagent-runtime.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * SubagentRuntime \u2014 unified LLM access for all subagents.\n * Replaces manual createSubagentTransport() calls.\n * Caches transports per agent, handles session lifecycle + fallback.\n */\n\nimport { logAndSwallow } from \"./log-and-swallow.js\";\nimport type { IKiroTransport } from \"./transport/kiro-transport.js\";\nimport { logInfo, logWarn } from \"./logger.js\";\nimport { randomBytes } from \"node:crypto\";\n\nimport type { ModelHealthRegistry } from \"./transport/model-health-registry.js\";\n\nconst TAG = \"runtime\";\n\nexport type AgentName = \"professor\" | \"dreamy\" | \"browsie\" | \"coding\" | \"task\";\n\nexport interface AgentOpts {\n /** Override default session strategy for this call. */\n session?: \"fresh\" | \"reuse\";\n /** Context passed to tool executor (userId, metadata). */\n context?: Record<string, unknown>;\n /** Override model API timeout for this call (ms). */\n timeoutMs?: number;\n /** Override session type (default: derived from agent name). */\n sessionType?: import(\"./session-manager.js\").SessionType;\n}\n\n/** Persistent transport handle for multi-turn callers. */\nexport interface AgentSession {\n sendPrompt(sessionKey: string, prompt: string, image?: { mime: string; base64: string }): Promise<string>;\n destroy(): Promise<void>;\n readonly isReady: boolean;\n /** Underlying transport \u2014 used to set sandboxPolicy for peer sessions (#678). */\n readonly transport?: IKiroTransport;\n}\n\nexport interface SpawnResult {\n taskId: string;\n}\n\nexport interface SpawnOpts {\n onComplete?: (taskId: string, result: string) => void;\n onError?: (taskId: string, error: Error) => void;\n timeoutMs?: number;\n}\n\ninterface CachedAgent {\n transport: IKiroTransport;\n model: string;\n sessionKey: string;\n}\n\nconst DEFAULT_SESSION: Record<AgentName, \"fresh\" | \"reuse\"> = {\n professor: \"reuse\",\n dreamy: \"fresh\",\n browsie: \"fresh\",\n coding: \"reuse\",\n task: \"fresh\",\n};\n\nconst DEFAULT_SPAWN_TIMEOUT_MS = 600_000; // 10 min\n\nexport class SubagentRuntime {\n private readonly cache = new Map<AgentName, CachedAgent>();\n private readonly activeSpawns = new Map<string, { abort: AbortController; startedAt: number }>();\n private _registry: ModelHealthRegistry | null = null;\n private _mainTransport: IKiroTransport | null = null;\n private _sessionManager: import(\"./session-manager.js\").SessionManager | null = null;\n\n /** Set shared model health registry (from boot ctx). */\n setRegistry(registry: ModelHealthRegistry): void { this._registry = registry; }\n\n /** Set main transport reference for currentModel reads. */\n setMainTransport(transport: IKiroTransport): void { this._mainTransport = transport; }\n\n /** Set session manager for auto-spawn sub-session creation (#510). */\n setSessionManager(mgr: import(\"./session-manager.js\").SessionManager): void { this._sessionManager = mgr; }\n\n /** Send a prompt to a named agent and get the response. */\n async complete(agent: AgentName, prompt: string, opts?: AgentOpts): Promise<string> {\n const sessionStrategy = opts?.session ?? DEFAULT_SESSION[agent] ?? \"fresh\";\n const start = Date.now();\n\n const cached = this.cache.get(agent);\n if (cached && sessionStrategy === \"fresh\") {\n await cached.transport.resetSession?.(cached.sessionKey);\n (await import(\"./transport/tool-registry.js\")).resetStoreCounter();\n }\n\n const { transport, model, sessionKey } = cached ?? await this.createAgent(agent, opts?.sessionType);\n\n // Per-call timeout override (e.g. dreamy sleep steps need longer than default)\n if (opts?.timeoutMs && transport.setTimeoutOverride) {\n transport.setTimeoutOverride(opts.timeoutMs);\n }\n\n try {\n const response = await transport.sendPrompt(sessionKey, prompt);\n const elapsed = Date.now() - start;\n logInfo(TAG, `${agent} complete: ${prompt.length}ch \u2192 ${response?.length ?? 0}ch (${elapsed}ms, ${model})`);\n return response ?? \"\";\n } catch (err) {\n logWarn(TAG, `${agent} complete failed: ${err instanceof Error ? err.message : String(err)}`);\n this.cache.delete(agent);\n throw err;\n } finally {\n if (opts?.timeoutMs && transport.setTimeoutOverride) {\n transport.setTimeoutOverride(null);\n }\n }\n }\n\n /** Get a persistent session handle for multi-turn callers. */\n async session(agent: AgentName): Promise<AgentSession> {\n const cached = this.cache.get(agent) ?? await this.createAgent(agent);\n return {\n sendPrompt: (sessionKey: string, prompt: string) => cached.transport.sendPrompt(sessionKey, prompt),\n destroy: async () => {\n try { cached.transport.destroy(); } catch (err) { logAndSwallow(\"subagent_runtime\", \"op\", err); }\n this.cache.delete(agent);\n logInfo(TAG, `${agent} session destroyed`);\n },\n get isReady() { return cached.transport.isReady; },\n get transport() { return cached.transport; },\n };\n }\n\n /** Fire-and-forget: run complete() in background, deliver result via callback. */\n async spawn(agent: AgentName, prompt: string, opts?: SpawnOpts): Promise<SpawnResult> {\n const taskId = randomBytes(4).toString(\"hex\");\n const abort = new AbortController();\n this.activeSpawns.set(taskId, { abort, startedAt: Date.now() });\n\n // Create sub-session for visibility in /session list (#510)\n if (this._sessionManager) {\n const typeMap: Partial<Record<AgentName, import(\"./session-manager.js\").SessionType>> = { browsie: \"B\", coding: \"C\", task: \"T\" };\n const sessionType = typeMap[agent];\n if (sessionType) this._sessionManager.createSubSession(\"master\", \"telegram\", sessionType);\n }\n\n const timeoutMs = opts?.timeoutMs ?? DEFAULT_SPAWN_TIMEOUT_MS;\n const timer = setTimeout(() => abort.abort(), timeoutMs);\n\n // Fire and forget \u2014 don't await\n void (async () => {\n try {\n const result = await this.complete(agent, prompt);\n if (!abort.signal.aborted) opts?.onComplete?.(taskId, result);\n } catch (err) {\n if (!abort.signal.aborted) opts?.onError?.(taskId, err instanceof Error ? err : new Error(String(err)));\n } finally {\n clearTimeout(timer);\n this.activeSpawns.delete(taskId);\n }\n })();\n\n logInfo(TAG, `${agent} spawned: taskId=${taskId}, timeout=${timeoutMs}ms`);\n return { taskId };\n }\n\n /** Shut down all cached transports and abort active spawns. */\n async shutdown(): Promise<void> {\n for (const [id, { abort }] of this.activeSpawns) {\n abort.abort();\n logInfo(TAG, `spawn ${id} aborted`);\n }\n this.activeSpawns.clear();\n\n for (const [name, cached] of this.cache) {\n try { cached.transport.destroy(); } catch (err) { logAndSwallow(\"subagent_runtime\", \"op\", err); }\n logInfo(TAG, `${name} transport closed`);\n }\n this.cache.clear();\n }\n\n /** Active registry: list running background spawns. */\n listActive(): Array<{ taskId: string; startedAt: number }> {\n return [...this.activeSpawns.entries()].map(([taskId, entry]) => ({\n taskId,\n startedAt: (entry as any).startedAt ?? 0,\n }));\n }\n\n /** Interrupt a specific spawn by taskId. Returns true if found. */\n interruptSpawn(taskId: string): boolean {\n const entry = this.activeSpawns.get(taskId);\n if (!entry) return false;\n entry.abort.abort();\n this.activeSpawns.delete(taskId);\n logInfo(TAG, `spawn ${taskId} interrupted`);\n return true;\n }\n\n private async createAgent(agent: AgentName, sessionType?: import(\"./session-manager.js\").SessionType): Promise<CachedAgent> {\n const { createSubagentTransport } = await import(\"./agent-registry.js\");\n const role = AGENT_TO_ROLE[agent];\n const mainModel = this._mainTransport && \"currentModel\" in this._mainTransport\n ? (this._mainTransport as unknown as { currentModel: string }).currentModel\n : undefined;\n const { transport, model } = await createSubagentTransport(role, this._registry ?? undefined, mainModel);\n\n // Inject session-type-appropriate SOUL bundle (#744)\n const typeMap: Partial<Record<AgentName, import(\"./session-manager.js\").SessionType>> = { browsie: \"B\", coding: \"C\", task: \"T\" };\n const resolvedType = sessionType || typeMap[agent];\n if (resolvedType && \"setSystemPrompt\" in transport && typeof (transport as any).setSystemPrompt === \"function\") {\n const { buildSoulBundle } = await import(\"./soul-bundle.js\");\n const bundle = buildSoulBundle(resolvedType);\n if (bundle) (transport as any).setSystemPrompt(bundle);\n }\n\n const sessionKey = `system:${agent}`;\n const entry: CachedAgent = { transport, model, sessionKey };\n this.cache.set(agent, entry);\n (await import(\"./transport/tool-registry.js\")).resetStoreCounter();\n return entry;\n }\n}\n\nconst AGENT_TO_ROLE: Record<AgentName, import(\"./agent-registry.js\").SubagentRole> = {\n professor: \"task\",\n dreamy: \"sleep\",\n browsie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createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
3
|
+
import {
|
|
4
|
+
checkBrowseTasks,
|
|
5
|
+
deliverBrowseResult,
|
|
6
|
+
readPendingBrowse,
|
|
7
|
+
writePendingBrowse
|
|
8
|
+
} from "./chunk-DHPFI7OF.js";
|
|
9
|
+
import {
|
|
10
|
+
BrowserIpcServer,
|
|
11
|
+
BrowserManager,
|
|
12
|
+
BrowserTool,
|
|
13
|
+
DomainAllowlist
|
|
14
|
+
} from "./chunk-JFKOPNKL.js";
|
|
15
|
+
import {
|
|
16
|
+
getEnv,
|
|
17
|
+
init_env_schema
|
|
18
|
+
} from "./chunk-3OXQWII3.js";
|
|
19
|
+
import {
|
|
20
|
+
init_logger,
|
|
21
|
+
logError,
|
|
22
|
+
logInfo,
|
|
23
|
+
logWarn
|
|
24
|
+
} from "./chunk-GUTRAMK3.js";
|
|
25
|
+
import {
|
|
26
|
+
abtarsHome,
|
|
27
|
+
init_paths
|
|
28
|
+
} from "./chunk-WW5F2DCO.js";
|
|
29
|
+
import {
|
|
30
|
+
__export
|
|
31
|
+
} from "./chunk-7K2YZTLD.js";
|
|
32
|
+
|
|
33
|
+
// src/capabilities/browser/index.ts
|
|
34
|
+
var browser_exports = {};
|
|
35
|
+
__export(browser_exports, {
|
|
36
|
+
register: () => register
|
|
37
|
+
});
|
|
38
|
+
init_logger();
|
|
39
|
+
init_env_schema();
|
|
40
|
+
init_paths();
|
|
41
|
+
import * as net from "node:net";
|
|
42
|
+
import { join } from "node:path";
|
|
43
|
+
import { unlinkSync, mkdirSync, chmodSync } from "node:fs";
|
|
44
|
+
function register(api) {
|
|
45
|
+
const browserManager = new BrowserManager();
|
|
46
|
+
const allowlist = DomainAllowlist.fromEnv();
|
|
47
|
+
const browserTool = new BrowserTool(browserManager, allowlist);
|
|
48
|
+
let browserIpc = null;
|
|
49
|
+
const ensureBrowserIpc = async () => {
|
|
50
|
+
if (browserIpc || getEnv().browserDocker) return;
|
|
51
|
+
browserIpc = new BrowserIpcServer(browserTool);
|
|
52
|
+
await browserIpc.start();
|
|
53
|
+
logInfo("browser", `\u{1F50C} Browser IPC listening on ${browserIpc.socketPath}`);
|
|
54
|
+
};
|
|
55
|
+
const spawnSocketPath = join(abtarsHome(), "browser-socket", "browse-spawn.sock");
|
|
56
|
+
try {
|
|
57
|
+
mkdirSync(join(abtarsHome(), "browser-socket"), { recursive: true, mode: 448 });
|
|
58
|
+
try {
|
|
59
|
+
unlinkSync(spawnSocketPath);
|
|
60
|
+
} catch {
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
chmodSync(join(abtarsHome(), "browser-socket"), 448);
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
const spawnServer = net.createServer((conn) => {
|
|
67
|
+
let buf = "";
|
|
68
|
+
conn.on("data", (chunk) => {
|
|
69
|
+
buf += chunk.toString();
|
|
70
|
+
const nl = buf.indexOf("\n");
|
|
71
|
+
if (nl === -1) return;
|
|
72
|
+
const line = buf.slice(0, nl);
|
|
73
|
+
buf = buf.slice(nl + 1);
|
|
74
|
+
try {
|
|
75
|
+
const { taskId, task, prompt, chatId, threadId, timeoutMs } = JSON.parse(line);
|
|
76
|
+
const entry = {
|
|
77
|
+
taskId,
|
|
78
|
+
task,
|
|
79
|
+
chatId,
|
|
80
|
+
threadId,
|
|
81
|
+
pid: process.pid,
|
|
82
|
+
// bridge pid — runtime manages the actual transport
|
|
83
|
+
startedAt: Date.now(),
|
|
84
|
+
timeoutMs,
|
|
85
|
+
logFile: ""
|
|
86
|
+
// no log file — result comes from callback
|
|
87
|
+
};
|
|
88
|
+
const entries = readPendingBrowse();
|
|
89
|
+
entries.push(entry);
|
|
90
|
+
writePendingBrowse(entries);
|
|
91
|
+
api.runtime.spawn("browsie", prompt, {
|
|
92
|
+
timeoutMs,
|
|
93
|
+
onComplete: (_id, result) => {
|
|
94
|
+
deliverBrowseResult(entry, result);
|
|
95
|
+
const remaining = readPendingBrowse().filter((e) => e.taskId !== taskId);
|
|
96
|
+
writePendingBrowse(remaining);
|
|
97
|
+
},
|
|
98
|
+
onError: (_id, err) => {
|
|
99
|
+
logWarn("browser", `Browsie spawn failed for ${taskId}: ${err.message}`);
|
|
100
|
+
deliverBrowseResult(entry, `Browse task failed: ${err.message}`);
|
|
101
|
+
const remaining = readPendingBrowse().filter((e) => e.taskId !== taskId);
|
|
102
|
+
writePendingBrowse(remaining);
|
|
103
|
+
}
|
|
104
|
+
}).then(({ taskId: spawnId }) => {
|
|
105
|
+
conn.write(JSON.stringify({ ok: true, taskId, spawnId, status: "spawned" }) + "\n");
|
|
106
|
+
}).catch((err) => {
|
|
107
|
+
conn.write(JSON.stringify({ ok: false, error: err instanceof Error ? err.message : String(err) }) + "\n");
|
|
108
|
+
});
|
|
109
|
+
} catch (err) {
|
|
110
|
+
conn.write(JSON.stringify({ ok: false, error: err instanceof Error ? err.message : String(err) }) + "\n");
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
conn.on("error", () => {
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
spawnServer.on("error", (err) => {
|
|
117
|
+
logError("browser", `\u26A0\uFE0F Browse-spawn IPC socket error \u2014 browser degraded: ${err.message}`);
|
|
118
|
+
});
|
|
119
|
+
spawnServer.listen(spawnSocketPath, () => {
|
|
120
|
+
logInfo("browser", `\u{1F50C} Browse spawn IPC listening on ${spawnSocketPath}`);
|
|
121
|
+
});
|
|
122
|
+
} catch (err) {
|
|
123
|
+
logError("browser", `\u26A0\uFE0F Browse-spawn IPC failed \u2014 browser disabled: ${err instanceof Error ? err.message : String(err)}`);
|
|
124
|
+
}
|
|
125
|
+
api.registerHeartbeatTask({
|
|
126
|
+
name: "browse-checker",
|
|
127
|
+
execute: async () => {
|
|
128
|
+
await ensureBrowserIpc();
|
|
129
|
+
checkBrowseTasks();
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export {
|
|
135
|
+
register,
|
|
136
|
+
browser_exports
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=chunk-RITEGAW6.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/capabilities/browser/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { logInfo, logWarn, logError } from \"../../components/logger.js\";\nimport { getEnv } from \"../../components/env-schema.js\";\n/**\n * Browser capability \u2014 browse-spawn IPC + browse-checker heartbeat.\n * Level 1 (lightpanda fetch) is handled by the agent via skill \u2014 no bridge code needed.\n * Level 2 (Browsie) uses runtime.spawn() via IPC socket.\n */\n\nimport { BrowserManager } from \"./browser-manager.js\";\nimport { BrowserTool } from \"./browser-tool.js\";\nimport { BrowserIpcServer } from \"./browser-ipc-server.js\";\nimport { DomainAllowlist } from \"./domain-allowlist.js\";\nimport { checkBrowseTasks, deliverBrowseResult } from \"./browse-delivery.js\";\nimport { readPendingBrowse, writePendingBrowse } from \"./abtars-browse.js\";\nimport type { PendingBrowseEntry } from \"./abtars-browse.js\";\nimport { abtarsHome } from \"../../paths.js\";\nimport type { CapabilityApi } from \"../capability.js\";\nimport * as net from \"node:net\";\nimport { join } from \"node:path\";\nimport { unlinkSync, mkdirSync, chmodSync } from \"node:fs\";\n\nexport function register(api: CapabilityApi): void {\n const browserManager = new BrowserManager();\n const allowlist = DomainAllowlist.fromEnv();\n const browserTool = new BrowserTool(browserManager, allowlist);\n let browserIpc: BrowserIpcServer | null = null;\n\n const ensureBrowserIpc = async (): Promise<void> => {\n if (browserIpc || getEnv().browserDocker) return;\n browserIpc = new BrowserIpcServer(browserTool);\n await browserIpc.start();\n logInfo(\"browser\", `\uD83D\uDD0C Browser IPC listening on ${browserIpc.socketPath}`);\n };\n\n // Browse-spawn IPC \u2014 CLI sends task, bridge spawns via runtime\n const spawnSocketPath = join(abtarsHome(), \"browser-socket\", \"browse-spawn.sock\");\n try {\n mkdirSync(join(abtarsHome(), \"browser-socket\"), { recursive: true, mode: 0o700 });\n try { unlinkSync(spawnSocketPath); } catch { /* doesn't exist \u2014 fine */ }\n try { chmodSync(join(abtarsHome(), \"browser-socket\"), 0o700); } catch { /* best effort */ }\n\n const spawnServer = net.createServer((conn) => {\n let buf = \"\";\n conn.on(\"data\", (chunk) => {\n buf += chunk.toString();\n const nl = buf.indexOf(\"\\n\");\n if (nl === -1) return;\n const line = buf.slice(0, nl);\n buf = buf.slice(nl + 1);\n\n try {\n const { taskId, task, prompt, chatId, threadId, timeoutMs } = JSON.parse(line);\n\n const entry: PendingBrowseEntry = {\n taskId, task, chatId, threadId,\n pid: process.pid, // bridge pid \u2014 runtime manages the actual transport\n startedAt: Date.now(), timeoutMs,\n logFile: \"\", // no log file \u2014 result comes from callback\n };\n const entries = readPendingBrowse();\n entries.push(entry);\n writePendingBrowse(entries);\n\n // Fire-and-forget via runtime\n api.runtime.spawn(\"browsie\", prompt, {\n timeoutMs,\n onComplete: (_id: string, result: string) => {\n deliverBrowseResult(entry, result);\n const remaining = readPendingBrowse().filter(e => e.taskId !== taskId);\n writePendingBrowse(remaining);\n },\n onError: (_id: string, err: Error) => {\n logWarn(\"browser\", `Browsie spawn failed for ${taskId}: ${err.message}`);\n deliverBrowseResult(entry, `Browse task failed: ${err.message}`);\n const remaining = readPendingBrowse().filter(e => e.taskId !== taskId);\n writePendingBrowse(remaining);\n },\n }).then(({ taskId: spawnId }) => {\n conn.write(JSON.stringify({ ok: true, taskId, spawnId, status: \"spawned\" }) + \"\\n\");\n }).catch((err) => {\n conn.write(JSON.stringify({ ok: false, error: err instanceof Error ? err.message : String(err) }) + \"\\n\");\n });\n } catch (err) {\n conn.write(JSON.stringify({ ok: false, error: err instanceof Error ? err.message : String(err) }) + \"\\n\");\n }\n });\n conn.on(\"error\", () => {});\n });\n\n spawnServer.on(\"error\", (err: Error) => {\n logError(\"browser\", `\u26A0\uFE0F Browse-spawn IPC socket error \u2014 browser degraded: ${err.message}`);\n });\n\n spawnServer.listen(spawnSocketPath, () => {\n logInfo(\"browser\", `\uD83D\uDD0C Browse spawn IPC listening on ${spawnSocketPath}`);\n });\n } catch (err) {\n logError(\"browser\", `\u26A0\uFE0F Browse-spawn IPC failed \u2014 browser disabled: ${err instanceof Error ? err.message : String(err)}`);\n }\n\n api.registerHeartbeatTask({\n name: \"browse-checker\",\n execute: async () => { await ensureBrowserIpc(); checkBrowseTasks(); },\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAcA;AAEA,YAAY,SAAS;AACrB,SAAS,YAAY;AACrB,SAAS,YAAY,WAAW,iBAAiB;AAE1C,SAAS,SAAS,KAA0B;AACjD,QAAM,iBAAiB,IAAI,eAAe;AAC1C,QAAM,YAAY,gBAAgB,QAAQ;AAC1C,QAAM,cAAc,IAAI,YAAY,gBAAgB,SAAS;AAC7D,MAAI,aAAsC;AAE1C,QAAM,mBAAmB,YAA2B;AAClD,QAAI,cAAc,OAAO,EAAE,cAAe;AAC1C,iBAAa,IAAI,iBAAiB,WAAW;AAC7C,UAAM,WAAW,MAAM;AACvB,YAAQ,WAAW,sCAA+B,WAAW,UAAU,EAAE;AAAA,EAC3E;AAGA,QAAM,kBAAkB,KAAK,WAAW,GAAG,kBAAkB,mBAAmB;AAChF,MAAI;AACF,cAAU,KAAK,WAAW,GAAG,gBAAgB,GAAG,EAAE,WAAW,MAAM,MAAM,IAAM,CAAC;AAChF,QAAI;AAAE,iBAAW,eAAe;AAAA,IAAG,QAAQ;AAAA,IAA6B;AACxE,QAAI;AAAE,gBAAU,KAAK,WAAW,GAAG,gBAAgB,GAAG,GAAK;AAAA,IAAG,QAAQ;AAAA,IAAoB;AAE5F,UAAM,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,CAAC,QAAQ;AAChB,iBAAK,MAAM,KAAK,UAAU,EAAE,IAAI,OAAO,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE,CAAC,IAAI,IAAI;AAAA,UAC1G,CAAC;AAAA,QACH,SAAS,KAAK;AACZ,eAAK,MAAM,KAAK,UAAU,EAAE,IAAI,OAAO,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE,CAAC,IAAI,IAAI;AAAA,QAC1G;AAAA,MACF,CAAC;AACD,WAAK,GAAG,SAAS,MAAM;AAAA,MAAC,CAAC;AAAA,IAC3B,CAAC;AAED,gBAAY,GAAG,SAAS,CAAC,QAAe;AACtC,eAAS,WAAW,uEAAwD,IAAI,OAAO,EAAE;AAAA,IAC3F,CAAC;AAED,gBAAY,OAAO,iBAAiB,MAAM;AACxC,cAAQ,WAAW,2CAAoC,eAAe,EAAE;AAAA,IAC1E,CAAC;AAAA,EACD,SAAS,KAAK;AACZ,aAAS,WAAW,iEAAkD,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC,EAAE;AAAA,EAC1H;AAEA,MAAI,sBAAsB;AAAA,IACxB,MAAM;AAAA,IACN,SAAS,YAAY;AAAE,YAAM,iBAAiB;AAAG,uBAAiB;AAAA,IAAG;AAAA,EACvE,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
init_log_and_swallow,
|
|
8
8
|
logAndSwallow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CYSGXNBY.js";
|
|
10
10
|
import {
|
|
11
11
|
abtarsHome,
|
|
12
12
|
init_paths
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WW5F2DCO.js";
|
|
14
14
|
|
|
15
15
|
// src/components/transport/bridge-lock-transport.ts
|
|
16
16
|
init_log_and_swallow();
|
|
@@ -129,4 +129,4 @@ export {
|
|
|
129
129
|
initBridgeLock,
|
|
130
130
|
updateLastHeartbeat
|
|
131
131
|
};
|
|
132
|
-
//# sourceMappingURL=chunk-
|
|
132
|
+
//# sourceMappingURL=chunk-RTL7HO3N.js.map
|
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
3
3
|
import {
|
|
4
4
|
readEnvWithDefault
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HAF2AFBW.js";
|
|
6
6
|
import {
|
|
7
7
|
TRANSPORT_SCHEMA,
|
|
8
8
|
init_config_validator,
|
|
9
9
|
validateShape
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
init_log_and_swallow,
|
|
13
|
-
logAndSwallow
|
|
14
|
-
} from "./chunk-EX2SRTUE.js";
|
|
10
|
+
} from "./chunk-DCY7DGMT.js";
|
|
15
11
|
import {
|
|
16
12
|
getEnv,
|
|
17
13
|
init_env_schema
|
|
18
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3OXQWII3.js";
|
|
15
|
+
import {
|
|
16
|
+
init_log_and_swallow,
|
|
17
|
+
logAndSwallow
|
|
18
|
+
} from "./chunk-CYSGXNBY.js";
|
|
19
19
|
import {
|
|
20
20
|
init_logger,
|
|
21
21
|
logError,
|
|
22
22
|
logInfo,
|
|
23
23
|
logWarn
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GUTRAMK3.js";
|
|
25
25
|
import {
|
|
26
26
|
abtarsHome,
|
|
27
27
|
init_paths
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-WW5F2DCO.js";
|
|
29
29
|
import {
|
|
30
30
|
__require
|
|
31
31
|
} from "./chunk-7K2YZTLD.js";
|
|
@@ -411,4 +411,4 @@ export {
|
|
|
411
411
|
validateProviderReady,
|
|
412
412
|
formatValidationError
|
|
413
413
|
};
|
|
414
|
-
//# sourceMappingURL=chunk-
|
|
414
|
+
//# sourceMappingURL=chunk-SA44ITVX.js.map
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import {
|
|
4
4
|
init_log_and_swallow,
|
|
5
5
|
logAndSwallow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CYSGXNBY.js";
|
|
7
7
|
import {
|
|
8
8
|
init_logger,
|
|
9
9
|
logDebug,
|
|
10
10
|
logInfo
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GUTRAMK3.js";
|
|
12
12
|
|
|
13
13
|
// src/components/stt.ts
|
|
14
14
|
init_logger();
|
|
@@ -56,4 +56,4 @@ export {
|
|
|
56
56
|
LANGUAGE_HINT_PROMPT,
|
|
57
57
|
transcribeAudio
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-SA6YEFNG.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
readManifest,
|
|
7
7
|
resolveUserBinDir,
|
|
8
8
|
writeManifest
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WMWI3SJ7.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/commands/install.ts
|
|
12
12
|
import { mkdir, readFile, stat, symlink, writeFile } from "node:fs/promises";
|
|
@@ -51,7 +51,7 @@ async function isSymlink(p) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
async function createSkeleton(home, dryRun) {
|
|
54
|
-
const { loadManifest } = await import("./install-manifest-
|
|
54
|
+
const { loadManifest } = await import("./install-manifest-KBYD7SAY.js");
|
|
55
55
|
const manifest = loadManifest();
|
|
56
56
|
const dirs = manifest.directories.map((d) => join(home, d.path));
|
|
57
57
|
if (dryRun) {
|
|
@@ -65,7 +65,7 @@ async function createSkeleton(home, dryRun) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
async function seedConfig(repoRoot, _configDir, dryRun, home) {
|
|
68
|
-
const { loadManifest } = await import("./install-manifest-
|
|
68
|
+
const { loadManifest } = await import("./install-manifest-KBYD7SAY.js");
|
|
69
69
|
const manifest = loadManifest(repoRoot);
|
|
70
70
|
const seeded = [];
|
|
71
71
|
for (const seed of manifest.configSeeds) {
|
|
@@ -128,16 +128,35 @@ async function reconcilePathLink(binDir, userBinDir, name, force, dryRun) {
|
|
|
128
128
|
}
|
|
129
129
|
async function writeWrapper(binDir, name, currentLink, dryRun) {
|
|
130
130
|
const bundleFile = name === "abtars" ? "abtars-cli.js" : `${name}.js`;
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
const home = currentLink.replace(/\/current$/, "");
|
|
132
|
+
let content;
|
|
133
|
+
if (name === "abmind") {
|
|
134
|
+
content = `#!/usr/bin/env bash
|
|
135
|
+
# Resolve abmind CLI \u2014 no ~/.abmind/current dependency (#863)
|
|
136
|
+
BUNDLE_CLI="$HOME/.abtars/app/bundle/node_modules/abmind/dist/cli/abmind.js"
|
|
137
|
+
SRC_CLI="$HOME/.abtars/src/abmind/dist/cli/abmind.js"
|
|
138
|
+
GLOBAL_CLI="$(npm root -g 2>/dev/null)/abmind/dist/cli/abmind.js"
|
|
139
|
+
if [ -f "$BUNDLE_CLI" ]; then
|
|
140
|
+
exec node "$BUNDLE_CLI" "$@"
|
|
141
|
+
elif [ -f "$SRC_CLI" ]; then
|
|
142
|
+
exec node "$SRC_CLI" "$@"
|
|
143
|
+
elif [ -f "$GLOBAL_CLI" ]; then
|
|
144
|
+
exec node "$GLOBAL_CLI" "$@"
|
|
145
|
+
else
|
|
146
|
+
echo "abmind: not found. Install via npm or deploy via abtars update." >&2
|
|
147
|
+
exit 1
|
|
148
|
+
fi
|
|
149
|
+
`;
|
|
150
|
+
} else {
|
|
151
|
+
const target = join(currentLink, "bundle", bundleFile);
|
|
152
|
+
const distFile = name === "abtars" ? "abtars.js" : `${name}.js`;
|
|
153
|
+
const fallback = join(currentLink, "dist", "cli", distFile);
|
|
154
|
+
content = `#!/usr/bin/env bash
|
|
135
155
|
if [ -f "${target}" ]; then
|
|
136
156
|
exec node "${target}" "$@"
|
|
137
157
|
elif [ -f "${fallback}" ]; then
|
|
138
158
|
exec node "${fallback}" "$@"
|
|
139
159
|
else
|
|
140
|
-
# No local release \u2014 fall through to npm global binary
|
|
141
160
|
GLOBAL_BIN="$(npm root -g 2>/dev/null)/abtars/bundle/${bundleFile}"
|
|
142
161
|
if [ -f "$GLOBAL_BIN" ]; then
|
|
143
162
|
exec node "$GLOBAL_BIN" "$@"
|
|
@@ -146,9 +165,10 @@ else
|
|
|
146
165
|
exit 1
|
|
147
166
|
fi
|
|
148
167
|
`;
|
|
168
|
+
}
|
|
149
169
|
const path = join(binDir, name);
|
|
150
170
|
if (dryRun) {
|
|
151
|
-
process.stdout.write(`[dry-run] write wrapper ${path}
|
|
171
|
+
process.stdout.write(`[dry-run] write wrapper ${path}
|
|
152
172
|
`);
|
|
153
173
|
return;
|
|
154
174
|
}
|
|
@@ -249,7 +269,7 @@ Use 'abtars update' to upgrade, or --force to re-seed missing config.
|
|
|
249
269
|
process.stdout.write(`\u2713 seeded config: ${seeded.join(", ")}
|
|
250
270
|
`);
|
|
251
271
|
}
|
|
252
|
-
const { loadManifest: loadInstallManifest } = await import("./install-manifest-
|
|
272
|
+
const { loadManifest: loadInstallManifest } = await import("./install-manifest-KBYD7SAY.js");
|
|
253
273
|
const installManifest = loadInstallManifest(repoRoot);
|
|
254
274
|
if (!opts.dryRun) {
|
|
255
275
|
await mkdir(paths.bin, { recursive: true });
|
|
@@ -408,4 +428,4 @@ export {
|
|
|
408
428
|
writeWrapper,
|
|
409
429
|
install
|
|
410
430
|
};
|
|
411
|
-
//# sourceMappingURL=chunk-
|
|
431
|
+
//# sourceMappingURL=chunk-SMZQDMSZ.js.map
|