abtars 0.1.0-alpha.2 → 0.1.0-alpha.21
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/bundle/_registry.generated-KQODGKTQ.js +36 -0
- package/bundle/{_registry.generated-M4WY2MMI.js.map → _registry.generated-KQODGKTQ.js.map} +1 -1
- package/bundle/abtars-browser.js +8 -7
- package/bundle/abtars-browser.js.map +1 -1
- package/bundle/abtars-cli.js +646 -73
- package/bundle/abtars-cli.js.map +4 -4
- package/bundle/abtars-restart.js +7 -6
- package/bundle/abtars-rss.js +2 -1
- package/bundle/abtars-rss.js.map +1 -1
- package/bundle/abtars-task.js +9 -8
- package/bundle/abtars-task.js.map +1 -1
- package/bundle/abtars.js +103 -96
- package/bundle/abtars.js.map +2 -2
- package/bundle/{agent-api-rate-limit-OQNFMXTZ.js → agent-api-rate-limit-7R5TX2F2.js} +7 -6
- package/bundle/{agent-api-rate-limit-OQNFMXTZ.js.map → agent-api-rate-limit-7R5TX2F2.js.map} +1 -1
- package/bundle/agent-registry-5M77ZOMV.js +19 -0
- package/bundle/agent-registry-VJMNIQ5W.js +19 -0
- package/bundle/{anthropic-adapter-2APTH3LA.js → anthropic-adapter-IBY3NPXW.js} +4 -3
- package/bundle/{anthropic-adapter-2APTH3LA.js.map → anthropic-adapter-IBY3NPXW.js.map} +1 -1
- package/bundle/{bridge-lock-transport-4AC2G5G6.js → bridge-lock-transport-HO545SBK.js} +9 -8
- package/bundle/browse-delivery-64GQIUHG.js +18 -0
- package/bundle/browser-EXR5OQGK.js +19 -0
- package/bundle/capability-HIE7UGFU.js +18 -0
- package/bundle/{chunk-BUUVFUPO.js → chunk-2BY6I4P5.js} +5 -4
- package/bundle/{chunk-BUUVFUPO.js.map → chunk-2BY6I4P5.js.map} +1 -1
- package/bundle/{chunk-Y6XAEX2Q.js → chunk-2F6XKG7Y.js} +15 -9
- package/bundle/chunk-2F6XKG7Y.js.map +7 -0
- package/bundle/{chunk-V76TVMCM.js → chunk-3MO2MDXJ.js} +5 -4
- package/bundle/{chunk-V76TVMCM.js.map → chunk-3MO2MDXJ.js.map} +1 -1
- package/bundle/{chunk-6UCRKRWR.js → chunk-6XX4OAAM.js} +22 -21
- package/bundle/chunk-6XX4OAAM.js.map +7 -0
- package/bundle/{chunk-XREWVCUO.js → chunk-7CHLS36W.js} +16 -148
- package/bundle/chunk-7CHLS36W.js.map +7 -0
- package/bundle/{chunk-NWDBD4PA.js → chunk-7K2YZTLD.js} +3 -2
- package/bundle/{chunk-JCJS4ZIB.js → chunk-AQVOAQQI.js} +5 -4
- package/bundle/{chunk-JCJS4ZIB.js.map → chunk-AQVOAQQI.js.map} +1 -1
- package/bundle/chunk-AUQD2PKM.js +136 -0
- package/bundle/chunk-AUQD2PKM.js.map +7 -0
- package/bundle/{chunk-YOCTDKKL.js → chunk-BYDUMHXT.js} +4 -3
- package/bundle/{chunk-YOCTDKKL.js.map → chunk-BYDUMHXT.js.map} +1 -1
- package/bundle/{chunk-RVE2N7FA.js → chunk-CELR236Q.js} +5 -4
- package/bundle/{chunk-RVE2N7FA.js.map → chunk-CELR236Q.js.map} +1 -1
- package/bundle/{chunk-2XU2X4OI.js → chunk-CUQA2AJT.js} +3 -2
- package/bundle/{chunk-2XU2X4OI.js.map → chunk-CUQA2AJT.js.map} +1 -1
- package/bundle/chunk-DMPR5MYT.js +183 -0
- package/bundle/chunk-DMPR5MYT.js.map +7 -0
- package/bundle/{chunk-BHMZ4RCC.js → chunk-DY3R7LDW.js} +55 -54
- package/bundle/{chunk-BHMZ4RCC.js.map → chunk-DY3R7LDW.js.map} +1 -1
- package/bundle/{chunk-AR6GO6YC.js → chunk-ELRAH7VL.js} +5 -4
- package/bundle/{chunk-AR6GO6YC.js.map → chunk-ELRAH7VL.js.map} +1 -1
- package/bundle/{chunk-FMWKEPM7.js → chunk-EX2SRTUE.js} +5 -4
- package/bundle/{chunk-FMWKEPM7.js.map → chunk-EX2SRTUE.js.map} +1 -1
- package/bundle/{chunk-JW6RU47G.js → chunk-FVQGP5YO.js} +8 -7
- package/bundle/{chunk-JW6RU47G.js.map → chunk-FVQGP5YO.js.map} +1 -1
- package/bundle/{chunk-GRNENTPA.js → chunk-G6IXMYIO.js} +4 -3
- package/bundle/{chunk-GRNENTPA.js.map → chunk-G6IXMYIO.js.map} +1 -1
- package/bundle/{chunk-6NR3OHEW.js → chunk-H2RZ4NEJ.js} +6 -5
- package/bundle/{chunk-6NR3OHEW.js.map → chunk-H2RZ4NEJ.js.map} +1 -1
- package/bundle/chunk-HVKJN3AG.js +189 -0
- package/bundle/chunk-HVKJN3AG.js.map +7 -0
- package/bundle/{chunk-265TPOPC.js → chunk-HXJRZWKA.js} +3 -2
- package/bundle/{chunk-265TPOPC.js.map → chunk-HXJRZWKA.js.map} +1 -1
- package/bundle/chunk-IU3RI5E4.js +645 -0
- package/bundle/chunk-IU3RI5E4.js.map +7 -0
- package/bundle/{chunk-GST5T3WZ.js → chunk-J5YIMCLT.js} +6 -5
- package/bundle/{chunk-GST5T3WZ.js.map → chunk-J5YIMCLT.js.map} +1 -1
- package/bundle/chunk-JAJ3DUQ2.js +30 -0
- package/bundle/{chunk-OP7BTAWY.js.map → chunk-JAJ3DUQ2.js.map} +1 -1
- package/bundle/chunk-JHF25OOG.js +645 -0
- package/bundle/chunk-JHF25OOG.js.map +7 -0
- package/bundle/{chunk-MPX525QO.js → chunk-JRG4EFMP.js} +5 -4
- package/bundle/{chunk-MPX525QO.js.map → chunk-JRG4EFMP.js.map} +1 -1
- package/bundle/{chunk-VVEDVGCR.js → chunk-JU3UBWLN.js} +17 -16
- package/bundle/{chunk-VVEDVGCR.js.map → chunk-JU3UBWLN.js.map} +1 -1
- package/bundle/{chunk-QBGBT5QS.js → chunk-JX3ZZU3O.js} +5 -4
- package/bundle/{chunk-QBGBT5QS.js.map → chunk-JX3ZZU3O.js.map} +1 -1
- package/bundle/{chunk-6SETMHNN.js → chunk-K7P74UNQ.js} +8 -7
- package/bundle/{chunk-6SETMHNN.js.map → chunk-K7P74UNQ.js.map} +1 -1
- package/bundle/{chunk-AZJIODTQ.js → chunk-KED3G7HS.js} +6 -5
- package/bundle/{chunk-AZJIODTQ.js.map → chunk-KED3G7HS.js.map} +1 -1
- package/bundle/chunk-KI2ROWAH.js +3707 -0
- package/bundle/chunk-KI2ROWAH.js.map +7 -0
- package/bundle/{chunk-UHRP745J.js → chunk-L7YHV5DL.js} +6 -5
- package/bundle/{chunk-UHRP745J.js.map → chunk-L7YHV5DL.js.map} +1 -1
- package/bundle/{chunk-BSSBCSCL.js → chunk-LD5BMLHG.js} +11 -10
- package/bundle/{chunk-BSSBCSCL.js.map → chunk-LD5BMLHG.js.map} +1 -1
- package/bundle/{chunk-2UPU3OW6.js → chunk-LYEAHE5V.js} +5 -4
- package/bundle/{chunk-2UPU3OW6.js.map → chunk-LYEAHE5V.js.map} +1 -1
- package/bundle/{chunk-3B7BBE4F.js → chunk-MCGEXAG5.js} +8 -7
- package/bundle/{chunk-3B7BBE4F.js.map → chunk-MCGEXAG5.js.map} +1 -1
- package/bundle/{chunk-X76UX47U.js → chunk-MJ6PHMOK.js} +4 -3
- package/bundle/{chunk-X76UX47U.js.map → chunk-MJ6PHMOK.js.map} +1 -1
- package/bundle/{chunk-LSPKJQCI.js → chunk-MV6CJFWR.js} +3 -2
- package/bundle/{chunk-LSPKJQCI.js.map → chunk-MV6CJFWR.js.map} +1 -1
- package/bundle/chunk-MZWMYN4O.js +17 -0
- package/bundle/{chunk-M6VBAPNT.js.map → chunk-MZWMYN4O.js.map} +1 -1
- package/bundle/{chunk-HX7Y7EYP.js → chunk-NIRYBWUW.js} +4 -3
- package/bundle/{chunk-HX7Y7EYP.js.map → chunk-NIRYBWUW.js.map} +1 -1
- package/bundle/{chunk-3E545J66.js → chunk-OW64RUE5.js} +3 -2
- package/bundle/{chunk-3E545J66.js.map → chunk-OW64RUE5.js.map} +1 -1
- package/bundle/chunk-P56PLAIC.js +126 -0
- package/bundle/chunk-P56PLAIC.js.map +7 -0
- package/bundle/{chunk-TZHIDLDS.js → chunk-P6PN34XD.js} +5 -4
- package/bundle/{chunk-TZHIDLDS.js.map → chunk-P6PN34XD.js.map} +1 -1
- package/bundle/{chunk-2UENBO6M.js → chunk-PF5UQ64X.js} +9 -8
- package/bundle/{chunk-2UENBO6M.js.map → chunk-PF5UQ64X.js.map} +1 -1
- package/bundle/{chunk-6CPN4IGS.js → chunk-PQ62LZNA.js} +9 -8
- package/bundle/{chunk-6CPN4IGS.js.map → chunk-PQ62LZNA.js.map} +1 -1
- package/bundle/{chunk-UCQ2WC3B.js → chunk-PQW5QBPY.js} +15 -8
- package/bundle/chunk-PQW5QBPY.js.map +7 -0
- package/bundle/{chunk-D2DCBO6M.js → chunk-R36WIOYX.js} +3 -2
- package/bundle/{chunk-D2DCBO6M.js.map → chunk-R36WIOYX.js.map} +1 -1
- package/bundle/chunk-RB3X66KM.js +386 -0
- package/bundle/chunk-RB3X66KM.js.map +7 -0
- package/bundle/{chunk-GUQVJC3U.js → chunk-RE3F3CFW.js} +7 -6
- package/bundle/{chunk-GUQVJC3U.js.map → chunk-RE3F3CFW.js.map} +1 -1
- package/bundle/chunk-RWUINZUQ.js +19 -0
- package/bundle/chunk-RWUINZUQ.js.map +7 -0
- package/bundle/{chunk-NT3OBORC.js → chunk-S54DBUZ4.js} +10 -9
- package/bundle/{chunk-NT3OBORC.js.map → chunk-S54DBUZ4.js.map} +1 -1
- package/bundle/{chunk-CWOHNFUV.js → chunk-SY67HM2Y.js} +3 -2
- package/bundle/{chunk-CWOHNFUV.js.map → chunk-SY67HM2Y.js.map} +1 -1
- package/bundle/{chunk-BQ2L4GMG.js → chunk-TBLYGCPQ.js} +4 -3
- package/bundle/{chunk-BQ2L4GMG.js.map → chunk-TBLYGCPQ.js.map} +1 -1
- package/bundle/chunk-TCBMBX3Z.js +183 -0
- package/bundle/chunk-TCBMBX3Z.js.map +7 -0
- package/bundle/chunk-TXRWQIQQ.js +3707 -0
- package/bundle/chunk-TXRWQIQQ.js.map +7 -0
- package/bundle/chunk-U34CSHFS.js +645 -0
- package/bundle/chunk-U34CSHFS.js.map +7 -0
- package/bundle/{chunk-CEVRHKJY.js → chunk-UDZIZB5F.js} +6 -5
- package/bundle/{chunk-CEVRHKJY.js.map → chunk-UDZIZB5F.js.map} +1 -1
- package/bundle/{chunk-W6FAL35D.js → chunk-VA5WKN3Z.js} +7 -6
- package/bundle/{chunk-W6FAL35D.js.map → chunk-VA5WKN3Z.js.map} +1 -1
- package/bundle/{chunk-X6TERNVJ.js → chunk-WX7GHGFX.js} +10 -9
- package/bundle/{chunk-X6TERNVJ.js.map → chunk-WX7GHGFX.js.map} +1 -1
- package/bundle/{chunk-PNEDC45Y.js → chunk-XETTJVEU.js} +4 -3
- package/bundle/{chunk-PNEDC45Y.js.map → chunk-XETTJVEU.js.map} +1 -1
- package/bundle/{chunk-PLCY3GFH.js → chunk-XLLSPBBT.js} +5 -4
- package/bundle/{chunk-PLCY3GFH.js.map → chunk-XLLSPBBT.js.map} +1 -1
- package/bundle/{chunk-ZXPXCDA6.js → chunk-XOCP5BMO.js} +6 -5
- package/bundle/{chunk-ZXPXCDA6.js.map → chunk-XOCP5BMO.js.map} +1 -1
- package/bundle/chunk-ZEY6YZAB.js +138 -0
- package/bundle/chunk-ZEY6YZAB.js.map +7 -0
- package/bundle/{chunk-MW6WDLU7.js → chunk-ZZR3JZHR.js} +10 -9
- package/bundle/{chunk-MW6WDLU7.js.map → chunk-ZZR3JZHR.js.map} +1 -1
- package/bundle/commands-AIL4XOIZ.js +33 -0
- package/bundle/commands-K77NVSXZ.js +32 -0
- package/bundle/commands-V6RSVC4Y.js +32 -0
- package/bundle/completion-buffer-S3LXDZG2.js +14 -0
- package/bundle/config-C6VHRJQ7.js +20 -0
- package/bundle/{config-show-ERTATR6E.js → config-show-ZTXX27FW.js} +4 -3
- package/bundle/{config-show-ERTATR6E.js.map → config-show-ZTXX27FW.js.map} +1 -1
- package/bundle/{context-HCEGZNDC.js → context-OCS7HLJP.js} +5 -4
- package/bundle/{context-HCEGZNDC.js.map → context-OCS7HLJP.js.map} +1 -1
- package/bundle/daemon-NPKYZ3CJ.js +292 -0
- package/bundle/daemon-NPKYZ3CJ.js.map +7 -0
- package/bundle/delegation-tools-PF7RD2RW.js +28 -0
- package/bundle/{deploy-lib-import-32ZFKHWP.js → deploy-lib-import-ODLDL2DB.js} +5 -4
- package/bundle/digital-signature-PNY4TR2W.js +14 -0
- package/bundle/{direct-api-transport-YR7SXXNN.js → direct-api-transport-EADHM67Z.js} +21 -20
- package/bundle/{direct-api-transport-YR7SXXNN.js.map → direct-api-transport-EADHM67Z.js.map} +1 -1
- package/bundle/direct-api-transport-SLJ2Z6NX.js +861 -0
- package/bundle/direct-api-transport-SLJ2Z6NX.js.map +7 -0
- package/bundle/{discord-adapter-YYWVMPPU.js → discord-adapter-FBJOJSTW.js} +25 -24
- package/bundle/{discord-adapter-YYWVMPPU.js.map → discord-adapter-FBJOJSTW.js.map} +1 -1
- package/bundle/discord-adapter-IJISVHUE.js +585 -0
- package/bundle/discord-adapter-IJISVHUE.js.map +7 -0
- package/bundle/discord-adapter-UYOCKRDF.js +586 -0
- package/bundle/discord-adapter-UYOCKRDF.js.map +7 -0
- package/bundle/{dist-MTMKARCP.js → dist-J3T4XVKX.js} +4 -3
- package/bundle/{dist-MTMKARCP.js.map → dist-J3T4XVKX.js.map} +1 -1
- package/bundle/{dns-wakeup-27M7D2MR.js → dns-wakeup-RYOCQ6GR.js} +6 -5
- package/bundle/{dns-wakeup-27M7D2MR.js.map → dns-wakeup-RYOCQ6GR.js.map} +1 -1
- package/bundle/{doctor-QNUSDY73.js → doctor-R54GZPKL.js} +10 -9
- package/bundle/{doctor-QNUSDY73.js.map → doctor-R54GZPKL.js.map} +1 -1
- package/bundle/{ensure-invariants-NMXNS476.js → ensure-invariants-K2ZUZ6NR.js} +7 -6
- package/bundle/{ensure-invariants-NMXNS476.js.map → ensure-invariants-K2ZUZ6NR.js.map} +1 -1
- package/bundle/ensure-invariants-KUXIW73S.js +50 -0
- package/bundle/ensure-invariants-KUXIW73S.js.map +7 -0
- package/bundle/env-schema-DGD6QWPA.js +20 -0
- package/bundle/{esm-DDP6NCZG.js → esm-PFOJARXA.js} +5 -4
- package/bundle/{esm-DDP6NCZG.js.map → esm-PFOJARXA.js.map} +1 -1
- package/bundle/{fallback-policy-L4QV2PEJ.js → fallback-policy-SR6ED5I3.js} +4 -3
- package/bundle/{fallback-policy-L4QV2PEJ.js.map → fallback-policy-SR6ED5I3.js.map} +1 -1
- package/bundle/{health-check-SPA7NT6N.js → health-check-RJ2SUJYL.js} +4 -3
- package/bundle/{health-check-SPA7NT6N.js.map → health-check-RJ2SUJYL.js.map} +1 -1
- package/bundle/hook-system-POI5VRIX.js +18 -0
- package/bundle/hotskills-6ECHLXTJ.js +13 -0
- package/bundle/install-24XR5FO5.js +13 -0
- package/bundle/install-AJ7VW76P.js +13 -0
- package/bundle/{install-log-IAPHYKD4.js → install-log-Q6RUHKWC.js} +4 -3
- package/bundle/{install-log-IAPHYKD4.js.map → install-log-Q6RUHKWC.js.map} +1 -1
- package/bundle/{install-manifest-SPQRUNXL.js → install-manifest-MCJCAYSR.js} +9 -7
- package/bundle/install-manifest-MCJCAYSR.js.map +7 -0
- package/bundle/install-manifest-ZETY4AFS.js +104 -0
- package/bundle/install-manifest-ZETY4AFS.js.map +7 -0
- package/bundle/{install-validate-PVLZXYLQ.js → install-validate-H74LUCE2.js} +4 -3
- package/bundle/{install-validate-PVLZXYLQ.js.map → install-validate-H74LUCE2.js.map} +1 -1
- package/bundle/{irc-adapter-OI5UZSQF.js → irc-adapter-RKRUSZXB.js} +7 -6
- package/bundle/{irc-adapter-OI5UZSQF.js.map → irc-adapter-RKRUSZXB.js.map} +1 -1
- package/bundle/{irc-config-55YO6EGB.js → irc-config-6VY67UPQ.js} +8 -7
- package/bundle/{irc-config-55YO6EGB.js.map → irc-config-6VY67UPQ.js.map} +1 -1
- package/bundle/{logs-ZNYXX5PA.js → logs-EK4HYRKR.js} +4 -3
- package/bundle/{logs-ZNYXX5PA.js.map → logs-EK4HYRKR.js.map} +1 -1
- package/bundle/{media-utils-XNNDTYFI.js → media-utils-QBY5WBF3.js} +8 -7
- package/bundle/{media-utils-XNNDTYFI.js.map → media-utils-QBY5WBF3.js.map} +1 -1
- package/bundle/message-pipeline-ANSMPK5O.js +34 -0
- package/bundle/message-pipeline-HXZMRGXZ.js +34 -0
- package/bundle/message-pipeline-XUUTGPFH.js +35 -0
- package/bundle/meta.json +1828 -1650
- package/bundle/model-health-registry-7ECZFCW4.js +12 -0
- package/bundle/model-health-registry-LDC76RPP.js +12 -0
- package/bundle/notification-OJ4YE4VG.js +14 -0
- package/bundle/{openrouter-credits-EDY7ETAU.js → openrouter-credits-L45SYKT3.js} +7 -6
- package/bundle/{openrouter-credits-EDY7ETAU.js.map → openrouter-credits-L45SYKT3.js.map} +1 -1
- package/bundle/{passwd-RRFV4CC5.js → passwd-QSHZJ2CG.js} +4 -3
- package/bundle/{passwd-RRFV4CC5.js.map → passwd-QSHZJ2CG.js.map} +1 -1
- package/bundle/paths-ZJYIDND2.js +18 -0
- package/bundle/{peer-client-52XYMNI7.js → peer-client-T44VI7NB.js} +13 -12
- package/bundle/{peer-client-52XYMNI7.js.map → peer-client-T44VI7NB.js.map} +1 -1
- package/bundle/peer-config-D5A4454H.js +17 -0
- package/bundle/{peer-sessions-EAXTNQ36.js → peer-sessions-MY2YVXHC.js} +4 -3
- package/bundle/{peer-sessions-EAXTNQ36.js.map → peer-sessions-MY2YVXHC.js.map} +1 -1
- package/bundle/{pending-callback-RIMQZ7FJ.js → pending-callback-6KLBSHLX.js} +4 -3
- package/bundle/{pending-callback-RIMQZ7FJ.js.map → pending-callback-6KLBSHLX.js.map} +1 -1
- package/bundle/phase-transport-43NP5XBK.js +23 -0
- package/bundle/phase-transport-GNUZI6EW.js +23 -0
- package/bundle/phase-transport-Q7K6V3VZ.js +23 -0
- package/bundle/phase-transport-SLJXIAY5.js +23 -0
- package/bundle/{responses-adapter-AAQTY3K4.js → responses-adapter-DAV2JUL7.js} +4 -3
- package/bundle/{responses-adapter-AAQTY3K4.js.map → responses-adapter-DAV2JUL7.js.map} +1 -1
- package/bundle/{restore-ZE3SEPSS.js → restore-ROJF22R2.js} +5 -4
- package/bundle/{restore-ZE3SEPSS.js.map → restore-ROJF22R2.js.map} +1 -1
- package/bundle/{self-healer-utils-DMUUXC47.js → self-healer-utils-7NFH22VJ.js} +7 -6
- package/bundle/{self-healer-utils-DMUUXC47.js.map → self-healer-utils-7NFH22VJ.js.map} +1 -1
- package/bundle/skill-stats-IPVKMWN3.js +23 -0
- package/bundle/sleep-4NVWZHVN.js +20 -0
- package/bundle/soul-bundle-7EYTEKFE.js +15 -0
- package/bundle/soul-loader-7FN7WDHM.js +18 -0
- package/bundle/soul-loader-K237NP4T.js +17 -0
- package/bundle/soul-loader-K237NP4T.js.map +7 -0
- package/bundle/soul-loader-UVJ6HZM3.js +17 -0
- package/bundle/soul-loader-UVJ6HZM3.js.map +7 -0
- package/bundle/src-Z3WR7SRT.js +9 -0
- package/bundle/src-Z3WR7SRT.js.map +7 -0
- package/bundle/{sse-parser-anthropic-P7CE2MH2.js → sse-parser-anthropic-H42TTLBD.js} +7 -6
- package/bundle/{sse-parser-anthropic-P7CE2MH2.js.map → sse-parser-anthropic-H42TTLBD.js.map} +1 -1
- package/bundle/{sse-parser-responses-EQQA5FWN.js → sse-parser-responses-WG2LY2ML.js} +7 -6
- package/bundle/{sse-parser-responses-EQQA5FWN.js.map → sse-parser-responses-WG2LY2ML.js.map} +1 -1
- package/bundle/{ssrf-guard-FZCBYIVW.js → ssrf-guard-E2KBBC5E.js} +7 -6
- package/bundle/{ssrf-guard-FZCBYIVW.js.map → ssrf-guard-E2KBBC5E.js.map} +1 -1
- package/bundle/{start-FH3GRMJ4.js → start-4IWBKLWO.js} +4 -3
- package/bundle/{start-FH3GRMJ4.js.map → start-4IWBKLWO.js.map} +1 -1
- package/bundle/{stream-single-WSG4D53C.js → stream-single-RFJNUTL6.js} +4 -3
- package/bundle/{stream-single-WSG4D53C.js.map → stream-single-RFJNUTL6.js.map} +1 -1
- package/bundle/stt-CF3CPFDC.js +15 -0
- package/bundle/stt-CF3CPFDC.js.map +7 -0
- package/bundle/subagent-runtime-P7GCFBM3.js +13 -0
- package/bundle/subagent-runtime-P7GCFBM3.js.map +7 -0
- package/bundle/subagent-runtime-USNPO4WF.js +13 -0
- package/bundle/subagent-runtime-USNPO4WF.js.map +7 -0
- package/bundle/subagent-runtime-XS2ZXYOZ.js +13 -0
- package/bundle/subagent-runtime-XS2ZXYOZ.js.map +7 -0
- package/bundle/{system-message-T5R3EYYN.js → system-message-TALP6GP2.js} +6 -5
- package/bundle/{system-message-T5R3EYYN.js.map → system-message-TALP6GP2.js.map} +1 -1
- package/bundle/{system-status-KQ6KHFJ6.js → system-status-2CR5OUDY.js} +10 -9
- package/bundle/{system-status-KQ6KHFJ6.js.map → system-status-2CR5OUDY.js.map} +1 -1
- package/bundle/task-store-KIBFZL5A.js +23 -0
- package/bundle/task-store-KIBFZL5A.js.map +7 -0
- package/bundle/{telegram-adapter-2V3XUMT5.js → telegram-adapter-ISQRW7PN.js} +34 -33
- package/bundle/{telegram-adapter-2V3XUMT5.js.map → telegram-adapter-ISQRW7PN.js.map} +1 -1
- package/bundle/telegram-adapter-QCD7AG5D.js +1062 -0
- package/bundle/telegram-adapter-QCD7AG5D.js.map +7 -0
- package/bundle/telegram-adapter-Y3PVA25S.js +1061 -0
- package/bundle/telegram-adapter-Y3PVA25S.js.map +7 -0
- package/bundle/telegram-adapter-YAXSK2RT.js +1062 -0
- package/bundle/telegram-adapter-YAXSK2RT.js.map +7 -0
- package/bundle/tool-registry-DFCCGZCB.js +39 -0
- package/bundle/tool-registry-DFCCGZCB.js.map +7 -0
- package/bundle/tool-sandbox-OZMXJZLQ.js +21 -0
- package/bundle/tool-sandbox-OZMXJZLQ.js.map +7 -0
- package/bundle/{transport-config-YLXU33RO.js → transport-config-ANPS2RYT.js} +11 -10
- package/bundle/transport-config-ANPS2RYT.js.map +7 -0
- package/bundle/update-check-O5MS6B3L.js +13 -0
- package/bundle/update-check-O5MS6B3L.js.map +7 -0
- package/bundle/usage-tracker-S4Z2G2K5.js +18 -0
- package/bundle/usage-tracker-S4Z2G2K5.js.map +7 -0
- package/bundle/user-registry-GTAJIW6E.js +17 -0
- package/bundle/user-registry-GTAJIW6E.js.map +7 -0
- package/config/.env +2 -0
- package/config/auto-fix.json +14 -0
- package/config/irc.json.example +30 -0
- package/config/models.json.example +229 -0
- package/config/peers.json.example +12 -0
- package/config/schemas/irc.schema.json +42 -0
- package/config/schemas/models.schema.json +17 -0
- package/config/schemas/peers.schema.json +35 -0
- package/config/schemas/transport.schema.json +35 -0
- package/config/schemas/users.schema.json +22 -0
- package/config/transport.default.json +30 -0
- package/config/transport.json.example +102 -0
- package/config/users.json.example +11 -0
- package/install-manifest.json +148 -0
- package/package.json +4 -2
- package/scripts/abtars-daemon.service +1 -0
- package/scripts/watchdog.sh +1 -1
- package/bundle/_registry.generated-M4WY2MMI.js +0 -35
- package/bundle/agent-registry-LT4JNQH6.js +0 -18
- package/bundle/browse-delivery-JXBY36GK.js +0 -17
- package/bundle/browser-ELNDVPLC.js +0 -18
- package/bundle/capability-CIL3G4FI.js +0 -17
- package/bundle/chunk-5R2ANXQ7.js +0 -510
- package/bundle/chunk-5R2ANXQ7.js.map +0 -7
- package/bundle/chunk-6UCRKRWR.js.map +0 -7
- package/bundle/chunk-M6VBAPNT.js +0 -16
- package/bundle/chunk-OP7BTAWY.js +0 -29
- package/bundle/chunk-UCQ2WC3B.js.map +0 -7
- package/bundle/chunk-XREWVCUO.js.map +0 -7
- package/bundle/chunk-Y6XAEX2Q.js.map +0 -7
- package/bundle/commands-BHVUOU3V.js +0 -31
- package/bundle/completion-buffer-P253ONKF.js +0 -13
- package/bundle/config-RGSDAPZN.js +0 -19
- package/bundle/delegation-tools-GYTS2D6A.js +0 -27
- package/bundle/digital-signature-OFCGSHWO.js +0 -13
- package/bundle/env-schema-2KBHBDGN.js +0 -19
- package/bundle/hook-system-6Q5YTR53.js +0 -17
- package/bundle/hotskills-K7BM4YLB.js +0 -12
- package/bundle/install-6HRZVKUM.js +0 -15
- package/bundle/install-manifest-SPQRUNXL.js.map +0 -7
- package/bundle/message-pipeline-LLH5SYMO.js +0 -33
- package/bundle/model-health-registry-35LQNVQR.js +0 -11
- package/bundle/notification-Y5S5MMLV.js +0 -13
- package/bundle/paths-G33RZWZ7.js +0 -17
- package/bundle/peer-config-VK6EDLN5.js +0 -16
- package/bundle/phase-transport-KYERDL2O.js +0 -22
- package/bundle/skill-stats-LLEXEXLR.js +0 -22
- package/bundle/sleep-OYIUOVQD.js +0 -19
- package/bundle/soul-loader-54WCVNLJ.js +0 -16
- package/bundle/src-JL4PVO23.js +0 -8
- package/bundle/stt-2UH3RITX.js +0 -14
- package/bundle/subagent-runtime-LE2ZXH3G.js +0 -12
- package/bundle/task-store-K7CQDEPI.js +0 -22
- package/bundle/tool-registry-MU3OX4UI.js +0 -38
- package/bundle/tool-sandbox-VYOK4ZOA.js +0 -20
- package/bundle/update-QCW5LXRN.js +0 -13
- package/bundle/update-check-27KZSAP6.js +0 -12
- package/bundle/usage-tracker-OVVEVMOY.js +0 -17
- package/bundle/user-registry-D4SD73UV.js +0 -16
- /package/bundle/{agent-registry-LT4JNQH6.js.map → agent-registry-5M77ZOMV.js.map} +0 -0
- /package/bundle/{bridge-lock-transport-4AC2G5G6.js.map → agent-registry-VJMNIQ5W.js.map} +0 -0
- /package/bundle/{browse-delivery-JXBY36GK.js.map → bridge-lock-transport-HO545SBK.js.map} +0 -0
- /package/bundle/{browser-ELNDVPLC.js.map → browse-delivery-64GQIUHG.js.map} +0 -0
- /package/bundle/{capability-CIL3G4FI.js.map → browser-EXR5OQGK.js.map} +0 -0
- /package/bundle/{chunk-NWDBD4PA.js.map → capability-HIE7UGFU.js.map} +0 -0
- /package/bundle/{commands-BHVUOU3V.js.map → chunk-7K2YZTLD.js.map} +0 -0
- /package/bundle/{completion-buffer-P253ONKF.js.map → commands-AIL4XOIZ.js.map} +0 -0
- /package/bundle/{config-RGSDAPZN.js.map → commands-K77NVSXZ.js.map} +0 -0
- /package/bundle/{delegation-tools-GYTS2D6A.js.map → commands-V6RSVC4Y.js.map} +0 -0
- /package/bundle/{deploy-lib-import-32ZFKHWP.js.map → completion-buffer-S3LXDZG2.js.map} +0 -0
- /package/bundle/{digital-signature-OFCGSHWO.js.map → config-C6VHRJQ7.js.map} +0 -0
- /package/bundle/{env-schema-2KBHBDGN.js.map → delegation-tools-PF7RD2RW.js.map} +0 -0
- /package/bundle/{hook-system-6Q5YTR53.js.map → deploy-lib-import-ODLDL2DB.js.map} +0 -0
- /package/bundle/{hotskills-K7BM4YLB.js.map → digital-signature-PNY4TR2W.js.map} +0 -0
- /package/bundle/{install-6HRZVKUM.js.map → env-schema-DGD6QWPA.js.map} +0 -0
- /package/bundle/{message-pipeline-LLH5SYMO.js.map → hook-system-POI5VRIX.js.map} +0 -0
- /package/bundle/{model-health-registry-35LQNVQR.js.map → hotskills-6ECHLXTJ.js.map} +0 -0
- /package/bundle/{notification-Y5S5MMLV.js.map → install-24XR5FO5.js.map} +0 -0
- /package/bundle/{paths-G33RZWZ7.js.map → install-AJ7VW76P.js.map} +0 -0
- /package/bundle/{peer-config-VK6EDLN5.js.map → message-pipeline-ANSMPK5O.js.map} +0 -0
- /package/bundle/{phase-transport-KYERDL2O.js.map → message-pipeline-HXZMRGXZ.js.map} +0 -0
- /package/bundle/{skill-stats-LLEXEXLR.js.map → message-pipeline-XUUTGPFH.js.map} +0 -0
- /package/bundle/{sleep-OYIUOVQD.js.map → model-health-registry-7ECZFCW4.js.map} +0 -0
- /package/bundle/{soul-loader-54WCVNLJ.js.map → model-health-registry-LDC76RPP.js.map} +0 -0
- /package/bundle/{src-JL4PVO23.js.map → notification-OJ4YE4VG.js.map} +0 -0
- /package/bundle/{stt-2UH3RITX.js.map → paths-ZJYIDND2.js.map} +0 -0
- /package/bundle/{subagent-runtime-LE2ZXH3G.js.map → peer-config-D5A4454H.js.map} +0 -0
- /package/bundle/{task-store-K7CQDEPI.js.map → phase-transport-43NP5XBK.js.map} +0 -0
- /package/bundle/{tool-registry-MU3OX4UI.js.map → phase-transport-GNUZI6EW.js.map} +0 -0
- /package/bundle/{tool-sandbox-VYOK4ZOA.js.map → phase-transport-Q7K6V3VZ.js.map} +0 -0
- /package/bundle/{transport-config-YLXU33RO.js.map → phase-transport-SLJXIAY5.js.map} +0 -0
- /package/bundle/{update-QCW5LXRN.js.map → skill-stats-IPVKMWN3.js.map} +0 -0
- /package/bundle/{update-check-27KZSAP6.js.map → sleep-4NVWZHVN.js.map} +0 -0
- /package/bundle/{usage-tracker-OVVEVMOY.js.map → soul-bundle-7EYTEKFE.js.map} +0 -0
- /package/bundle/{user-registry-D4SD73UV.js.map → soul-loader-7FN7WDHM.js.map} +0 -0
|
@@ -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-EX2SRTUE.js";
|
|
7
|
+
import {
|
|
8
|
+
init_logger,
|
|
9
|
+
logInfo,
|
|
10
|
+
logWarn
|
|
11
|
+
} from "./chunk-2BY6I4P5.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-DFCCGZCB.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-VJMNIQ5W.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-7EYTEKFE.js");
|
|
162
|
+
const bundle = buildSoulBundle(sessionType);
|
|
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-DFCCGZCB.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-TCBMBX3Z.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(sessionType);\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: \"browse\",\n coding: \"coding\",\n task: \"task\",\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAMA;AAEA;AACA,SAAS,mBAAmB;AAI5B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