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
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
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);
|
|
2
3
|
import {
|
|
3
4
|
__commonJS
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7K2YZTLD.js";
|
|
5
6
|
|
|
6
7
|
// node_modules/ieee754/index.js
|
|
7
8
|
var require_ieee754 = __commonJS({
|
|
@@ -94,4 +95,4 @@ export {
|
|
|
94
95
|
ieee754/index.js:
|
|
95
96
|
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
96
97
|
*/
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
98
|
+
//# sourceMappingURL=chunk-XETTJVEU.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../node_modules/ieee754/index.js"],
|
|
4
4
|
"sourcesContent": ["/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;AAAA;AAAA;AACA,YAAQ,OAAO,SAAU,QAAQ,QAAQ,MAAM,MAAM,QAAQ;AAC3D,UAAI,GAAG;AACP,UAAI,OAAQ,SAAS,IAAK,OAAO;AACjC,UAAI,QAAQ,KAAK,QAAQ;AACzB,UAAI,QAAQ,QAAQ;AACpB,UAAI,QAAQ;AACZ,UAAI,IAAI,OAAQ,SAAS,IAAK;AAC9B,UAAI,IAAI,OAAO,KAAK;AACpB,UAAI,IAAI,OAAO,SAAS,CAAC;AAEzB,WAAK;AAEL,UAAI,KAAM,KAAM,CAAC,SAAU;AAC3B,YAAO,CAAC;AACR,eAAS;AACT,aAAO,QAAQ,GAAG,IAAK,IAAI,MAAO,OAAO,SAAS,CAAC,GAAG,KAAK,GAAG,SAAS,GAAG;AAAA,MAAC;AAE3E,UAAI,KAAM,KAAM,CAAC,SAAU;AAC3B,YAAO,CAAC;AACR,eAAS;AACT,aAAO,QAAQ,GAAG,IAAK,IAAI,MAAO,OAAO,SAAS,CAAC,GAAG,KAAK,GAAG,SAAS,GAAG;AAAA,MAAC;AAE3E,UAAI,MAAM,GAAG;AACX,YAAI,IAAI;AAAA,MACV,WAAW,MAAM,MAAM;AACrB,eAAO,IAAI,OAAQ,IAAI,KAAK,KAAK;AAAA,MACnC,OA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QAAQ,KAAK,IAAI,GAAG,QAAQ,CAAC,IAAI,KAAK,IAAI,GAAG,IAAI;AACrD,cAAI;AAAA,QACN;AAAA,MACF;AAEA,aAAO,QAAQ,GAAG,OAAO,SAAS,CAAC,IAAI,IAAI,KAAM,KAAK,GAAG,KAAK,KAAK,QAAQ,GAAG;AAAA,MAAC;AAE/E,UAAK,KAAK,OAAQ;AAClB,cAAQ;AACR,aAAO,OAAO,GAAG,OAAO,SAAS,CAAC,IAAI,IAAI,KAAM,KAAK,GAAG,KAAK,KAAK,QAAQ,GAAG;AAAA,MAAC;AAE9E,aAAO,SAAS,IAAI,CAAC,KAAK,IAAI;AAAA,IAChC;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
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);
|
|
2
3
|
import {
|
|
3
4
|
init_log_and_swallow,
|
|
4
5
|
logAndSwallow
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EX2SRTUE.js";
|
|
6
7
|
import {
|
|
7
8
|
abtarsHome,
|
|
8
9
|
init_paths
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MJ6PHMOK.js";
|
|
10
11
|
|
|
11
12
|
// src/components/tasks/task-store.ts
|
|
12
13
|
init_paths();
|
|
@@ -74,4 +75,4 @@ export {
|
|
|
74
75
|
recordRun,
|
|
75
76
|
closeDb
|
|
76
77
|
};
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
78
|
+
//# sourceMappingURL=chunk-XLLSPBBT.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/components/tasks/task-store.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * task-store.ts \u2014 JSON-backed task entry storage.\n * Replaces cron-db.ts (SQLite in memory.db) with ~/.abtars/state/tasks.json.\n * Same API surface for callers.\n */\n\nimport { existsSync, readFileSync, writeFileSync, mkdirSync, renameSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport type { CronEntry } from \"../../cli/abtars-task.js\";\nimport { abtarsHome } from \"../../paths.js\";\nimport { logAndSwallow } from \"../log-and-swallow.js\";\n\nconst TAG = \"task_store\";\n\nconst storePath = (): string => join(abtarsHome(), \"state\", \"tasks.json\");\n\nfunction readAll(): CronEntry[] {\n const p = storePath();\n if (!existsSync(p)) return [];\n try { return JSON.parse(readFileSync(p, \"utf-8\")); }\n catch (err) { logAndSwallow(TAG, \"readAll tasks.json\", err); return []; }\n}\n\nfunction writeAll(entries: CronEntry[]): void {\n const p = storePath();\n mkdirSync(dirname(p), { recursive: true });\n const tmp = p + \".tmp\";\n writeFileSync(tmp, JSON.stringify(entries, null, 2), \"utf-8\");\n renameSync(tmp, p);\n}\n\nexport function readEntries(): CronEntry[] {\n return readAll();\n}\n\nexport function readEntry(id: string): CronEntry | null {\n return readAll().find(e => e.id === id) ?? null;\n}\n\nexport function writeEntry(e: CronEntry): void {\n const entries = readAll();\n const idx = entries.findIndex(x => x.id === e.id);\n if (idx >= 0) entries[idx] = e; else entries.push(e);\n writeAll(entries);\n}\n\nexport function removeEntry(id: string): boolean {\n const entries = readAll();\n const before = entries.length;\n const filtered = entries.filter(e => e.id !== id);\n if (filtered.length === before) return false;\n writeAll(filtered);\n return true;\n}\n\nexport function recordRun(entryId: string, exitCode?: number): void {\n const entries = readAll();\n const entry = entries.find(e => e.id === entryId);\n if (!entry) return;\n const history: { ts: number; exitCode?: number }[] = entry.history ?? [];\n history.push({ ts: Date.now(), ...(exitCode !== undefined ? { exitCode } : {}) });\n if (history.length > 10) history.splice(0, history.length - 10);\n entry.history = history;\n writeAll(entries);\n}\n\n/** No-op \u2014 kept for API compat with tests that called closeDb() on the old SQLite store. */\nexport function closeDb(): void { /* JSON store has no connection to close */ }\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AASA;AACA;AAJA,SAAS,YAAY,cAAc,eAAe,WAAW,kBAAkB;AAC/E,SAAS,MAAM,eAAe;AAK9B,IAAM,MAAM;AAEZ,IAAM,YAAY,MAAc,KAAK,WAAW,GAAG,SAAS,YAAY;AAExE,SAAS,UAAuB;AAC9B,QAAM,IAAI,UAAU;AACpB,MAAI,CAAC,WAAW,CAAC,EAAG,QAAO,CAAC;AAC5B,MAAI;AAAE,WAAO,KAAK,MAAM,aAAa,GAAG,OAAO,CAAC;AAAA,EAAG,SAC5C,KAAK;AAAE,kBAAc,KAAK,sBAAsB,GAAG;AAAG,WAAO,CAAC;AAAA,EAAG;AAC1E;AAEA,SAAS,SAAS,SAA4B;AAC5C,QAAM,IAAI,UAAU;AACpB,YAAU,QAAQ,CAAC,GAAG,EAAE,WAAW,KAAK,CAAC;AACzC,QAAM,MAAM,IAAI;AAChB,gBAAc,KAAK,KAAK,UAAU,SAAS,MAAM,CAAC,GAAG,OAAO;AAC5D,aAAW,KAAK,CAAC;AACnB;AAEO,SAAS,cAA2B;AACzC,SAAO,QAAQ;AACjB;AAEO,SAAS,UAAU,IAA8B;AACtD,SAAO,QAAQ,EAAE,KAAK,OAAK,EAAE,OAAO,EAAE,KAAK;AAC7C;AAEO,SAAS,WAAW,GAAoB;AAC7C,QAAM,UAAU,QAAQ;AACxB,QAAM,MAAM,QAAQ,UAAU,OAAK,EAAE,OAAO,EAAE,EAAE;AAChD,MAAI,OAAO,EAAG,SAAQ,GAAG,IAAI;AAAA,MAAQ,SAAQ,KAAK,CAAC;AACnD,WAAS,OAAO;AAClB;AAEO,SAAS,YAAY,IAAqB;AAC/C,QAAM,UAAU,QAAQ;AACxB,QAAM,SAAS,QAAQ;AACvB,QAAM,WAAW,QAAQ,OAAO,OAAK,EAAE,OAAO,EAAE;AAChD,MAAI,SAAS,WAAW,OAAQ,QAAO;AACvC,WAAS,QAAQ;AACjB,SAAO;AACT;AAEO,SAAS,UAAU,SAAiB,UAAyB;AAClE,QAAM,UAAU,QAAQ;AACxB,QAAM,QAAQ,QAAQ,KAAK,OAAK,EAAE,OAAO,OAAO;AAChD,MAAI,CAAC,MAAO;AACZ,QAAM,UAA+C,MAAM,WAAW,CAAC;AACvE,UAAQ,KAAK,EAAE,IAAI,KAAK,IAAI,GAAG,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC,EAAG,CAAC;AAChF,MAAI,QAAQ,SAAS,GAAI,SAAQ,OAAO,GAAG,QAAQ,SAAS,EAAE;AAC9D,QAAM,UAAU;AAChB,WAAS,OAAO;AAClB;AAGO,SAAS,UAAgB;AAA8C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
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);
|
|
2
3
|
import {
|
|
3
4
|
init_log_and_swallow,
|
|
4
5
|
logAndSwallow
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EX2SRTUE.js";
|
|
6
7
|
|
|
7
8
|
// src/cli/commands/restart.ts
|
|
8
9
|
init_log_and_swallow();
|
|
@@ -138,13 +139,13 @@ async function restart(opts) {
|
|
|
138
139
|
}
|
|
139
140
|
if (bridgeAlive) await killBridge(bridgePid);
|
|
140
141
|
killPortHolder(3100);
|
|
141
|
-
const { updateBridgeLockField } = await import("./bridge-lock-transport-
|
|
142
|
+
const { updateBridgeLockField } = await import("./bridge-lock-transport-HO545SBK.js");
|
|
142
143
|
updateBridgeLockField("restartRequested", null);
|
|
143
144
|
const argv = [];
|
|
144
145
|
return spawnLauncher(home, argv);
|
|
145
146
|
}
|
|
146
147
|
if (bridgeAlive) {
|
|
147
|
-
const { writeRestartRequested } = await import("./bridge-lock-transport-
|
|
148
|
+
const { writeRestartRequested } = await import("./bridge-lock-transport-HO545SBK.js");
|
|
148
149
|
writeRestartRequested("restart");
|
|
149
150
|
process.stdout.write(`\u267B\uFE0F Restart requested (PID ${bridgePid}) \u2014 bridge will restart within 30s
|
|
150
151
|
`);
|
|
@@ -157,4 +158,4 @@ async function restart(opts) {
|
|
|
157
158
|
export {
|
|
158
159
|
restart
|
|
159
160
|
};
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
161
|
+
//# sourceMappingURL=chunk-XOCP5BMO.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli/commands/restart.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * abtars restart [--cold] \u2014 unified restart command.\n * Warm (default): writeRestartRequested \u2192 main.ts internal loop restarts.\n * Cold (--cold): kill process + spawn new launcher. Always, both modes.\n */\n\nimport { logAndSwallow } from \"../../components/log-and-swallow.js\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { execSync } from \"node:child_process\";\nimport { join } from \"node:path\";\n\nfunction abtarsHome(): string {\n return process.env[\"ABTARS_HOME\"] ?? join(process.env[\"HOME\"] ?? \"\", \".abtars\");\n}\n\nfunction readJsonField(file: string, field: string): unknown {\n try {\n const data = JSON.parse(readFileSync(file, \"utf-8\"));\n return data[field];\n } catch { return undefined; }\n}\n\nfunction pidAlive(pid: number): boolean {\n try { process.kill(pid, 0); return true; } catch { return false; }\n}\n\n/** #686: Kill any process holding port 3100 before spawning a new bridge. */\nfunction killPortHolder(port: number): void {\n try {\n const pid = execSync(`lsof -ti :${port}`, { encoding: \"utf-8\", timeout: 3000 }).trim();\n if (!pid) return;\n process.stdout.write(`\uD83D\uDED1 Killing stale process on port ${port} (pid ${pid})...\\n`);\n try { execSync(`kill ${pid}`, { timeout: 3000, stdio: \"pipe\" }); } catch { /* */ }\n for (let i = 0; i < 5; i++) {\n try { execSync(`lsof -ti :${port}`, { stdio: \"pipe\", timeout: 1000 }); } catch { return; }\n try { execSync(\"sleep 1\", { timeout: 2000, stdio: \"pipe\" }); } catch { /* */ }\n }\n try { execSync(`kill -9 ${pid}`, { timeout: 1000, stdio: \"pipe\" }); } catch { /* */ }\n } catch { /* no process on port \u2014 good */ }\n}\n\nasync function spawnLauncher(home: string, argv: string[]): Promise<number> {\n const { spawn } = await import(\"node:child_process\");\n const launcher = join(home, \"abtars.sh\");\n if (!existsSync(launcher)) {\n process.stderr.write(`Launcher not found: ${launcher}\\n`);\n return 1;\n }\n const child = spawn(launcher, argv, { detached: true, stdio: \"ignore\", cwd: home });\n child.unref();\n process.stdout.write(`\u267B\uFE0F Bridge starting (args: ${argv.join(\" \")})...\\n`);\n return 0;\n}\n\nasync function killBridge(pid: number): Promise<void> {\n // Verify PID is actually the bridge (Linux /proc, fallback: skip check)\n try {\n const cmdline = readFileSync(`/proc/${pid}/cmdline`, \"utf-8\");\n if (!cmdline.includes(\"abtars\") && !cmdline.includes(\"main.js\") && !cmdline.includes(\"bundle\")) {\n process.stdout.write(`\u26A0\uFE0F PID ${pid} is not abtars \u2014 stale PID file\\n`);\n return;\n }\n } catch (err) { logAndSwallow(\"restart\", \"op\", err); }\n\n try { process.kill(pid, \"SIGTERM\"); } catch { return; }\n process.stdout.write(`\uD83D\uDED1 Killing bridge (PID ${pid})...\\n`);\n\n for (let i = 0; i < 20; i++) {\n await new Promise(r => setTimeout(r, 500));\n if (!pidAlive(pid)) return;\n }\n try { process.kill(pid, \"SIGKILL\"); } catch (err) { logAndSwallow(\"restart\", \"op\", err); }\n await new Promise(r => setTimeout(r, 1000));\n}\n\nexport async function restart(opts: { cold?: boolean }): Promise<number> {\n const home = abtarsHome();\n const lockFile = join(home, \"bridge.lock\");\n const cold = opts.cold ?? false;\n\n const bridgePid = readJsonField(lockFile, \"pid\") as number | undefined;\n const bridgeAlive = bridgePid != null && bridgePid > 0 && pidAlive(bridgePid);\n\n if (cold) {\n // Under supervised-daemon, cold restart requires sudo \u2014 refuse and print instructions\n const manifestPath = join(home, \"manifest.json\");\n const installMode = readJsonField(manifestPath, \"installMode\") as string | undefined;\n if (!installMode) {\n process.stderr.write(\"\u274C installMode not set in manifest.json. Run 'abtars install' first.\\n\");\n return 1;\n }\n if (installMode === \"supervised-daemon\") {\n const platform = process.platform;\n if (platform === \"darwin\") {\n process.stderr.write(`Cold restart under supervised-daemon requires sudo:\\n sudo -k launchctl kickstart -k system/com.abtars.daemon\\n`);\n } else {\n process.stderr.write(`Cold restart under supervised-daemon requires sudo:\\n sudo -k systemctl restart abtars\\n`);\n }\n return 1;\n }\n\n // Run doctor before spawning\n const doctorPath = join(home, \"scripts\", \"doctor.sh\");\n if (existsSync(doctorPath)) {\n process.stdout.write(\"\uD83E\uDE7A Health check...\\n\");\n try {\n const { execSync } = await import(\"node:child_process\");\n execSync(`bash \"${doctorPath}\" --fix`, { stdio: \"inherit\", timeout: 30_000 });\n } catch (err) {\n process.stderr.write(`\u26A0\uFE0F doctor --fix failed: ${err instanceof Error ? err.message : String(err)}\\n`);\n }\n }\n\n if (bridgeAlive) await killBridge(bridgePid!);\n killPortHolder(3100);\n // Clear stale restart requests so the new bridge doesn't restart again (#731)\n const { updateBridgeLockField } = await import(\"../../components/transport/bridge-lock-transport.js\");\n updateBridgeLockField(\"restartRequested\", null);\n const argv: string[] = []; // #534: env is SSoT \u2014 no CLI args needed\n return spawnLauncher(home, argv);\n }\n\n // Warm restart\n if (bridgeAlive) {\n const { writeRestartRequested } = await import(\"../../components/transport/bridge-lock-transport.js\");\n writeRestartRequested(\"restart\");\n process.stdout.write(`\u267B\uFE0F Restart requested (PID ${bridgePid}) \u2014 bridge will restart within 30s\\n`);\n return 0;\n }\n\n process.stdout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AACxB,WAAO,cAAc,MAAM,IAAI;AAAA,EACjC;AAGA,MAAI,aAAa;AACf,UAAM,EAAE,sBAAsB,IAAI,MAAM,OAAO,qCAAqD;AACpG,0BAAsB,SAAS;AAC/B,YAAQ,OAAO,MAAM,uCAA6B,SAAS;AAAA,CAAsC;AACjG,WAAO;AAAA,EACT;AAEA,UAAQ,OAAO,MAAM,4CAA4C;AACjE,SAAO;AACT;",
|
|
6
6
|
"names": ["execSync"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
|
|
4
|
+
// src/components/transport/model-health-registry.ts
|
|
5
|
+
var D_SKIP_THRESHOLD = 0.7;
|
|
6
|
+
var D_LEAK_PER_MIN = 0.03;
|
|
7
|
+
var D_AUTH_STICKY = true;
|
|
8
|
+
var D_RATE_LIMIT_FILL = 0.5;
|
|
9
|
+
var D_WEAK_FILL = 0.35;
|
|
10
|
+
var D_EMPTY_FILL = 0.25;
|
|
11
|
+
var D_TRUNCATED_FILL = 0;
|
|
12
|
+
var D_TRANSIENT_PROGRESSIVE = [0.1, 0.2, 0.4, 0.8];
|
|
13
|
+
var D_TRANSIENT_COOLDOWN_AFTER = 3;
|
|
14
|
+
var D_TRANSIENT_MAX_COOLDOWN_SEC = 300;
|
|
15
|
+
var ModelHealthRegistry = class {
|
|
16
|
+
buckets = /* @__PURE__ */ new Map();
|
|
17
|
+
skipThreshold;
|
|
18
|
+
leakPerMs;
|
|
19
|
+
authSticky;
|
|
20
|
+
rateLimitFill;
|
|
21
|
+
weakFill;
|
|
22
|
+
emptyFill;
|
|
23
|
+
truncatedFill;
|
|
24
|
+
transientProgressive;
|
|
25
|
+
transientCooldownAfter;
|
|
26
|
+
transientMaxCooldownMs;
|
|
27
|
+
/** Fired when a model crosses the demotion threshold. Wired at boot. */
|
|
28
|
+
onDemote;
|
|
29
|
+
constructor(config) {
|
|
30
|
+
this.skipThreshold = config?.skipThreshold ?? D_SKIP_THRESHOLD;
|
|
31
|
+
this.leakPerMs = (config?.leakPerMinute ?? D_LEAK_PER_MIN) / 6e4;
|
|
32
|
+
this.authSticky = config?.authSticky ?? D_AUTH_STICKY;
|
|
33
|
+
this.rateLimitFill = config?.rateLimitFill ?? D_RATE_LIMIT_FILL;
|
|
34
|
+
this.weakFill = config?.weakFill ?? D_WEAK_FILL;
|
|
35
|
+
this.emptyFill = config?.emptyFill ?? D_EMPTY_FILL;
|
|
36
|
+
this.truncatedFill = config?.truncatedFill ?? D_TRUNCATED_FILL;
|
|
37
|
+
this.transientProgressive = config?.transientProgressive ?? D_TRANSIENT_PROGRESSIVE;
|
|
38
|
+
this.transientCooldownAfter = config?.transientCooldownAfter ?? D_TRANSIENT_COOLDOWN_AFTER;
|
|
39
|
+
this.transientMaxCooldownMs = (config?.transientMaxCooldownSec ?? D_TRANSIENT_MAX_COOLDOWN_SEC) * 1e3;
|
|
40
|
+
}
|
|
41
|
+
drain(b, now) {
|
|
42
|
+
if (this.authSticky && b.authFailed) return;
|
|
43
|
+
const elapsed = now - b.lastUpdate;
|
|
44
|
+
b.level = Math.max(0, b.level - elapsed * this.leakPerMs);
|
|
45
|
+
b.lastUpdate = now;
|
|
46
|
+
}
|
|
47
|
+
shouldSkip(model, endpoint) {
|
|
48
|
+
const b = this.buckets.get(`${endpoint}|${model}`);
|
|
49
|
+
if (!b) return false;
|
|
50
|
+
const now = Date.now();
|
|
51
|
+
if (b.cooldownUntil && now < b.cooldownUntil) return true;
|
|
52
|
+
if (b.cooldownUntil && now >= b.cooldownUntil) b.cooldownUntil = void 0;
|
|
53
|
+
this.drain(b, now);
|
|
54
|
+
return b.level > this.skipThreshold;
|
|
55
|
+
}
|
|
56
|
+
recordSuccess(model, endpoint) {
|
|
57
|
+
const b = this.buckets.get(`${endpoint}|${model}`);
|
|
58
|
+
if (!b) return;
|
|
59
|
+
b.consecutiveErrors = 0;
|
|
60
|
+
b.cooldownUntil = void 0;
|
|
61
|
+
b.authFailed = false;
|
|
62
|
+
}
|
|
63
|
+
recordError(model, endpoint, kind, retryAfterMs) {
|
|
64
|
+
const key = `${endpoint}|${model}`;
|
|
65
|
+
const now = Date.now();
|
|
66
|
+
const b = this.buckets.get(key) ?? { level: 0, lastUpdate: now, consecutiveErrors: 0 };
|
|
67
|
+
this.drain(b, now);
|
|
68
|
+
switch (kind) {
|
|
69
|
+
case "auth":
|
|
70
|
+
b.level = 1;
|
|
71
|
+
b.authFailed = true;
|
|
72
|
+
if (this.onDemote && !b.demoted) {
|
|
73
|
+
b.demoted = true;
|
|
74
|
+
this.onDemote(model, endpoint, "auth");
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
case "transient": {
|
|
78
|
+
const idx = Math.min(b.consecutiveErrors, this.transientProgressive.length - 1);
|
|
79
|
+
b.level = Math.min(1, b.level + this.transientProgressive[idx]);
|
|
80
|
+
if (b.consecutiveErrors >= this.transientCooldownAfter) {
|
|
81
|
+
b.cooldownUntil = now + Math.min((b.consecutiveErrors + 1) * 6e4, this.transientMaxCooldownMs);
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
case "rate_limit":
|
|
86
|
+
b.level = Math.min(1, b.level + this.rateLimitFill);
|
|
87
|
+
if (retryAfterMs && retryAfterMs > 0) b.cooldownUntil = now + retryAfterMs;
|
|
88
|
+
break;
|
|
89
|
+
case "weak":
|
|
90
|
+
b.level = Math.min(1, b.level + this.weakFill);
|
|
91
|
+
break;
|
|
92
|
+
case "empty":
|
|
93
|
+
b.level = Math.min(1, b.level + this.emptyFill);
|
|
94
|
+
break;
|
|
95
|
+
case "truncated":
|
|
96
|
+
if (this.truncatedFill > 0) b.level = Math.min(1, b.level + this.truncatedFill);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
b.consecutiveErrors++;
|
|
100
|
+
b.lastUpdate = now;
|
|
101
|
+
this.buckets.set(key, b);
|
|
102
|
+
}
|
|
103
|
+
getHealth() {
|
|
104
|
+
const now = Date.now();
|
|
105
|
+
const result = /* @__PURE__ */ new Map();
|
|
106
|
+
for (const [key, b] of this.buckets) {
|
|
107
|
+
this.drain(b, now);
|
|
108
|
+
let status = "healthy";
|
|
109
|
+
if (b.authFailed) status = "auth_failed";
|
|
110
|
+
else if (b.level > this.skipThreshold) status = "exhausted";
|
|
111
|
+
else if (b.level > 0.3) status = "degraded";
|
|
112
|
+
result.set(key, { level: Math.round(b.level * 100), consecutiveErrors: b.consecutiveErrors, cooldownUntil: b.cooldownUntil, status });
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
/** Get bucket level for a specific model (0-100%). */
|
|
117
|
+
getBucketLevel(model, endpoint) {
|
|
118
|
+
const b = this.buckets.get(`${endpoint}|${model}`);
|
|
119
|
+
if (!b) return 0;
|
|
120
|
+
this.drain(b, Date.now());
|
|
121
|
+
return Math.round(b.level * 100);
|
|
122
|
+
}
|
|
123
|
+
resetAll() {
|
|
124
|
+
this.buckets.clear();
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
function classifyError(status, message) {
|
|
128
|
+
if (status === 429 || status === 402) return "rate_limit";
|
|
129
|
+
if (status === 404 && message && /image input|No endpoints found/i.test(message)) return "transient";
|
|
130
|
+
if (status === 401 || status === 403 || status === 404) return "auth";
|
|
131
|
+
return "transient";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export {
|
|
135
|
+
ModelHealthRegistry,
|
|
136
|
+
classifyError
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=chunk-ZEY6YZAB.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/transport/model-health-registry.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * ModelHealthRegistry \u2014 shared per-model error tracking.\n * Leaky-bucket algorithm: fills on errors, drains over time. Full = skip.\n * One instance per bridge process, shared across all FallbackPolicy instances.\n *\n * All tuning constants configurable via transport.json `healthPolicy` key.\n * Missing fields fall back to hardcoded defaults.\n */\n\nexport type ErrorKind = \"rate_limit\" | \"auth\" | \"transient\" | \"weak\" | \"empty\" | \"truncated\";\nexport type ModelStatus = \"healthy\" | \"degraded\" | \"exhausted\" | \"auth_failed\";\n\nexport interface HealthPolicyConfig {\n /** Bucket level (0-1) above which model is skipped. Default: 0.7 */\n skipThreshold?: number;\n /** Drain rate per minute (0-1). Default: 0.03 */\n leakPerMinute?: number;\n /** Auth error: fill amount (0-1). Default: 1.0 (instant full) */\n authFill?: number;\n /** Auth errors are sticky (never auto-drain). Default: true */\n authSticky?: boolean;\n /** Rate-limit fill per hit. Default: 0.5 */\n rateLimitFill?: number;\n /** Weak-model fill per hit. Default: 0.05 */\n weakFill?: number;\n /** Empty response (0 tokens) fill per hit. Default: 0.25 */\n emptyFill?: number;\n /** Truncated response (finish_reason=length) fill per hit. Default: 0 (disabled) */\n truncatedFill?: number;\n /** Transient progressive fill array. Default: [0.1, 0.2, 0.4, 0.8] */\n transientProgressive?: number[];\n /** Consecutive errors before cooldown kicks in. Default: 3 */\n transientCooldownAfter?: number;\n /** Max cooldown seconds for transient errors. Default: 300 */\n transientMaxCooldownSec?: number;\n}\n\ninterface Bucket {\n level: number;\n lastUpdate: number;\n consecutiveErrors: number;\n cooldownUntil?: number;\n authFailed?: boolean;\n demoted?: boolean;\n}\n\n// Defaults (unchanged from pre-config behavior)\nconst D_SKIP_THRESHOLD = 0.7;\nconst D_LEAK_PER_MIN = 0.03;\nconst D_AUTH_STICKY = true;\nconst D_RATE_LIMIT_FILL = 0.5;\nconst D_WEAK_FILL = 0.35;\nconst D_EMPTY_FILL = 0.25;\nconst D_TRUNCATED_FILL = 0;\nconst D_TRANSIENT_PROGRESSIVE = [0.1, 0.2, 0.4, 0.8];\nconst D_TRANSIENT_COOLDOWN_AFTER = 3;\nconst D_TRANSIENT_MAX_COOLDOWN_SEC = 300;\n\nexport class ModelHealthRegistry {\n private readonly buckets = new Map<string, Bucket>();\n private readonly skipThreshold: number;\n private readonly leakPerMs: number;\n private readonly authSticky: boolean;\n private readonly rateLimitFill: number;\n private readonly weakFill: number;\n private readonly emptyFill: number;\n private readonly truncatedFill: number;\n private readonly transientProgressive: number[];\n private readonly transientCooldownAfter: number;\n private readonly transientMaxCooldownMs: number;\n\n /** Fired when a model crosses the demotion threshold. Wired at boot. */\n onDemote?: (model: string, endpoint: string, reason: \"auth\" | \"timeout\") => void;\n\n constructor(config?: HealthPolicyConfig) {\n this.skipThreshold = config?.skipThreshold ?? D_SKIP_THRESHOLD;\n this.leakPerMs = (config?.leakPerMinute ?? D_LEAK_PER_MIN) / 60000;\n this.authSticky = config?.authSticky ?? D_AUTH_STICKY;\n this.rateLimitFill = config?.rateLimitFill ?? D_RATE_LIMIT_FILL;\n this.weakFill = config?.weakFill ?? D_WEAK_FILL;\n this.emptyFill = config?.emptyFill ?? D_EMPTY_FILL;\n this.truncatedFill = config?.truncatedFill ?? D_TRUNCATED_FILL;\n this.transientProgressive = config?.transientProgressive ?? D_TRANSIENT_PROGRESSIVE;\n this.transientCooldownAfter = config?.transientCooldownAfter ?? D_TRANSIENT_COOLDOWN_AFTER;\n this.transientMaxCooldownMs = (config?.transientMaxCooldownSec ?? D_TRANSIENT_MAX_COOLDOWN_SEC) * 1000;\n }\n\n private drain(b: Bucket, now: number): void {\n if (this.authSticky && b.authFailed) return;\n const elapsed = now - b.lastUpdate;\n b.level = Math.max(0, b.level - elapsed * this.leakPerMs);\n b.lastUpdate = now;\n }\n\n shouldSkip(model: string, endpoint: string): boolean {\n const b = this.buckets.get(`${endpoint}|${model}`);\n if (!b) return false;\n const now = Date.now();\n if (b.cooldownUntil && now < b.cooldownUntil) return true;\n if (b.cooldownUntil && now >= b.cooldownUntil) b.cooldownUntil = undefined;\n this.drain(b, now);\n return b.level > this.skipThreshold;\n }\n\n recordSuccess(model: string, endpoint: string): void {\n const b = this.buckets.get(`${endpoint}|${model}`);\n if (!b) return;\n b.consecutiveErrors = 0;\n b.cooldownUntil = undefined;\n b.authFailed = false;\n }\n\n recordError(model: string, endpoint: string, kind: ErrorKind, retryAfterMs?: number): void {\n const key = `${endpoint}|${model}`;\n const now = Date.now();\n const b = this.buckets.get(key) ?? { level: 0, lastUpdate: now, consecutiveErrors: 0 };\n this.drain(b, now);\n\n switch (kind) {\n case \"auth\":\n b.level = 1.0;\n b.authFailed = true;\n if (this.onDemote && !b.demoted) {\n b.demoted = true;\n this.onDemote(model, endpoint, \"auth\");\n }\n break;\n case \"transient\": {\n const idx = Math.min(b.consecutiveErrors, this.transientProgressive.length - 1);\n b.level = Math.min(1.0, b.level + this.transientProgressive[idx]!);\n if (b.consecutiveErrors >= this.transientCooldownAfter) {\n b.cooldownUntil = now + Math.min((b.consecutiveErrors + 1) * 60_000, this.transientMaxCooldownMs);\n }\n break;\n }\n case \"rate_limit\":\n b.level = Math.min(1.0, b.level + this.rateLimitFill);\n if (retryAfterMs && retryAfterMs > 0) b.cooldownUntil = now + retryAfterMs;\n break;\n case \"weak\":\n b.level = Math.min(1.0, b.level + this.weakFill);\n break;\n case \"empty\":\n b.level = Math.min(1.0, b.level + this.emptyFill);\n break;\n case \"truncated\":\n if (this.truncatedFill > 0) b.level = Math.min(1.0, b.level + this.truncatedFill);\n break;\n }\n\n b.consecutiveErrors++;\n b.lastUpdate = now;\n this.buckets.set(key, b);\n }\n\n getHealth(): Map<string, { level: number; consecutiveErrors: number; cooldownUntil?: number; status: ModelStatus }> {\n const now = Date.now();\n const result = new Map<string, { level: number; consecutiveErrors: number; cooldownUntil?: number; status: ModelStatus }>();\n for (const [key, b] of this.buckets) {\n this.drain(b, now);\n let status: ModelStatus = \"healthy\";\n if (b.authFailed) status = \"auth_failed\";\n else if (b.level > this.skipThreshold) status = \"exhausted\";\n else if (b.level > 0.3) status = \"degraded\";\n result.set(key, { level: Math.round(b.level * 100), consecutiveErrors: b.consecutiveErrors, cooldownUntil: b.cooldownUntil, status });\n }\n return result;\n }\n\n /** Get bucket level for a specific model (0-100%). */\n getBucketLevel(model: string, endpoint: string): number {\n const b = this.buckets.get(`${endpoint}|${model}`);\n if (!b) return 0;\n this.drain(b, Date.now());\n return Math.round(b.level * 100);\n }\n\n resetAll(): void {\n this.buckets.clear();\n }\n}\n\n/** Classify HTTP status to error kind. */\nexport function classifyError(status: number, message?: string): ErrorKind {\n if (status === 429 || status === 402) return \"rate_limit\";\n if (status === 404 && message && /image input|No endpoints found/i.test(message)) return \"transient\";\n if (status === 401 || status === 403 || status === 404) return \"auth\";\n return \"transient\";\n}\n"],
|
|
5
|
+
"mappings": ";;;;AA+CA,IAAM,mBAAmB;AACzB,IAAM,iBAAiB;AACvB,IAAM,gBAAgB;AACtB,IAAM,oBAAoB;AAC1B,IAAM,cAAc;AACpB,IAAM,eAAe;AACrB,IAAM,mBAAmB;AACzB,IAAM,0BAA0B,CAAC,KAAK,KAAK,KAAK,GAAG;AACnD,IAAM,6BAA6B;AACnC,IAAM,+BAA+B;AAE9B,IAAM,sBAAN,MAA0B;AAAA,EACd,UAAU,oBAAI,IAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGjB;AAAA,EAEA,YAAY,QAA6B;AACvC,SAAK,gBAAgB,QAAQ,iBAAiB;AAC9C,SAAK,aAAa,QAAQ,iBAAiB,kBAAkB;AAC7D,SAAK,aAAa,QAAQ,cAAc;AACxC,SAAK,gBAAgB,QAAQ,iBAAiB;AAC9C,SAAK,WAAW,QAAQ,YAAY;AACpC,SAAK,YAAY,QAAQ,aAAa;AACtC,SAAK,gBAAgB,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AAO,KAAK,MAAM,EAAE,QAAQ,GAAG,GAAG,mBAAmB,EAAE,mBAAmB,eAAe,EAAE,eAAe,OAAO,CAAC;AAAA,IACtI;AACA,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,eAAe,OAAe,UAA0B;AACtD,UAAM,IAAI,KAAK,QAAQ,IAAI,GAAG,QAAQ,IAAI,KAAK,EAAE;AACjD,QAAI,CAAC,EAAG,QAAO;AACf,SAAK,MAAM,GAAG,KAAK,IAAI,CAAC;AACxB,WAAO,KAAK,MAAM,EAAE,QAAQ,GAAG;AAAA,EACjC;AAAA,EAEA,WAAiB;AACf,SAAK,QAAQ,MAAM;AAAA,EACrB;AACF;AAGO,SAAS,cAAc,QAAgB,SAA6B;AACzE,MAAI,WAAW,OAAO,WAAW,IAAK,QAAO;AAC7C,MAAI,WAAW,OAAO,WAAW,kCAAkC,KAAK,OAAO,EAAG,QAAO;AACzF,MAAI,WAAW,OAAO,WAAW,OAAO,WAAW,IAAK,QAAO;AAC/D,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
|
|
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);
|
|
2
3
|
import {
|
|
3
4
|
checkBrowseTasks,
|
|
4
5
|
deliverBrowseResult,
|
|
5
6
|
readPendingBrowse,
|
|
6
7
|
writePendingBrowse
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-K7P74UNQ.js";
|
|
8
9
|
import {
|
|
9
10
|
BrowserIpcServer,
|
|
10
11
|
BrowserManager,
|
|
11
12
|
BrowserTool,
|
|
12
13
|
DomainAllowlist
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MCGEXAG5.js";
|
|
14
15
|
import {
|
|
15
16
|
init_log_and_swallow,
|
|
16
17
|
logAndSwallow
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-EX2SRTUE.js";
|
|
18
19
|
import {
|
|
19
20
|
getEnv,
|
|
20
21
|
init_env_schema
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-AQVOAQQI.js";
|
|
22
23
|
import {
|
|
23
24
|
init_logger,
|
|
24
25
|
logInfo,
|
|
25
26
|
logWarn
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2BY6I4P5.js";
|
|
27
28
|
import {
|
|
28
29
|
abtarsHome,
|
|
29
30
|
init_paths
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MJ6PHMOK.js";
|
|
31
32
|
import {
|
|
32
33
|
__export
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-7K2YZTLD.js";
|
|
34
35
|
|
|
35
36
|
// src/capabilities/browser/index.ts
|
|
36
37
|
var browser_exports = {};
|
|
@@ -127,4 +128,4 @@ export {
|
|
|
127
128
|
register,
|
|
128
129
|
browser_exports
|
|
129
130
|
};
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
131
|
+
//# sourceMappingURL=chunk-ZZR3JZHR.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/capabilities/browser/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { logAndSwallow } from \"../../components/log-and-swallow.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 { logInfo, logWarn } from \"../../components/logger.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 } 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(), \"browse-spawn.sock\");\n try { unlinkSync(spawnSocketPath); } catch (err) { logAndSwallow(\"index\", \"op\", err); }\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.listen(spawnSocketPath, () => {\n logInfo(\"browser\", `\uD83D\uDD0C Browse spawn IPC listening on ${spawnSocketPath}`);\n });\n\n api.registerHeartbeatTask({\n name: \"browse-checker\",\n execute: async () => { await ensureBrowserIpc(); checkBrowseTasks(); },\n });\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAcA;AACA;AAEA,YAAY,SAAS;AACrB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAEpB,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,EAC3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,CAAC,EAAE,QAAQ,QAAQ,MAAM;AAC/B,eAAK,MAAM,KAAK,UAAU,EAAE,IAAI,MAAM,QAAQ,SAAS,QAAQ,UAAU,CAAC,IAAI,IAAI;AAAA,QACpF,CAAC,EAAE,MAAM,CAAC,QAAQ;AAChB,eAAK,MAAM,KAAK,UAAU,EAAE,IAAI,OAAO,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE,CAAC,IAAI,IAAI;AAAA,QAC1G,CAAC;AAAA,MACH,SAAS,KAAK;AACZ,aAAK,MAAM,KAAK,UAAU,EAAE,IAAI,OAAO,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE,CAAC,IAAI,IAAI;AAAA,MAC1G;AAAA,IACF,CAAC;AACD,SAAK,GAAG,SAAS,MAAM;AAAA,IAAC,CAAC;AAAA,EAC3B,CAAC;AAED,cAAY,OAAO,iBAAiB,MAAM;AACxC,YAAQ,WAAW,2CAAoC,eAAe,EAAE;AAAA,EAC1E,CAAC;AAED,MAAI,sBAAsB;AAAA,IACxB,MAAM;AAAA,IACN,SAAS,YAAY;AAAE,YAAM,iBAAiB;AAAG,uBAAiB;AAAA,IAAG;AAAA,EACvE,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
handleCommand,
|
|
5
|
+
killWakeInhibit,
|
|
6
|
+
registerCommand,
|
|
7
|
+
triggerNewSession,
|
|
8
|
+
triggerResetSession
|
|
9
|
+
} from "./chunk-DY3R7LDW.js";
|
|
10
|
+
import "./chunk-NIRYBWUW.js";
|
|
11
|
+
import "./chunk-3MO2MDXJ.js";
|
|
12
|
+
import "./chunk-WX7GHGFX.js";
|
|
13
|
+
import "./chunk-RWUINZUQ.js";
|
|
14
|
+
import "./chunk-P56PLAIC.js";
|
|
15
|
+
import "./chunk-J5YIMCLT.js";
|
|
16
|
+
import "./chunk-JAJ3DUQ2.js";
|
|
17
|
+
import "./chunk-G6IXMYIO.js";
|
|
18
|
+
import "./chunk-UDZIZB5F.js";
|
|
19
|
+
import "./chunk-XLLSPBBT.js";
|
|
20
|
+
import "./chunk-MZWMYN4O.js";
|
|
21
|
+
import "./chunk-EX2SRTUE.js";
|
|
22
|
+
import "./chunk-AQVOAQQI.js";
|
|
23
|
+
import "./chunk-2BY6I4P5.js";
|
|
24
|
+
import "./chunk-MJ6PHMOK.js";
|
|
25
|
+
import "./chunk-7K2YZTLD.js";
|
|
26
|
+
export {
|
|
27
|
+
handleCommand,
|
|
28
|
+
killWakeInhibit,
|
|
29
|
+
registerCommand,
|
|
30
|
+
triggerNewSession,
|
|
31
|
+
triggerResetSession
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=commands-AIL4XOIZ.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
handleCommand,
|
|
5
|
+
killWakeInhibit,
|
|
6
|
+
registerCommand,
|
|
7
|
+
triggerNewSession,
|
|
8
|
+
triggerResetSession
|
|
9
|
+
} from "./chunk-TXRWQIQQ.js";
|
|
10
|
+
import "./chunk-NIRYBWUW.js";
|
|
11
|
+
import "./chunk-3MO2MDXJ.js";
|
|
12
|
+
import "./chunk-WX7GHGFX.js";
|
|
13
|
+
import "./chunk-AUQD2PKM.js";
|
|
14
|
+
import "./chunk-J5YIMCLT.js";
|
|
15
|
+
import "./chunk-JAJ3DUQ2.js";
|
|
16
|
+
import "./chunk-G6IXMYIO.js";
|
|
17
|
+
import "./chunk-UDZIZB5F.js";
|
|
18
|
+
import "./chunk-XLLSPBBT.js";
|
|
19
|
+
import "./chunk-MZWMYN4O.js";
|
|
20
|
+
import "./chunk-EX2SRTUE.js";
|
|
21
|
+
import "./chunk-AQVOAQQI.js";
|
|
22
|
+
import "./chunk-2BY6I4P5.js";
|
|
23
|
+
import "./chunk-MJ6PHMOK.js";
|
|
24
|
+
import "./chunk-7K2YZTLD.js";
|
|
25
|
+
export {
|
|
26
|
+
handleCommand,
|
|
27
|
+
killWakeInhibit,
|
|
28
|
+
registerCommand,
|
|
29
|
+
triggerNewSession,
|
|
30
|
+
triggerResetSession
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=commands-K77NVSXZ.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
handleCommand,
|
|
5
|
+
killWakeInhibit,
|
|
6
|
+
registerCommand,
|
|
7
|
+
triggerNewSession,
|
|
8
|
+
triggerResetSession
|
|
9
|
+
} from "./chunk-KI2ROWAH.js";
|
|
10
|
+
import "./chunk-NIRYBWUW.js";
|
|
11
|
+
import "./chunk-3MO2MDXJ.js";
|
|
12
|
+
import "./chunk-WX7GHGFX.js";
|
|
13
|
+
import "./chunk-PQW5QBPY.js";
|
|
14
|
+
import "./chunk-J5YIMCLT.js";
|
|
15
|
+
import "./chunk-JAJ3DUQ2.js";
|
|
16
|
+
import "./chunk-G6IXMYIO.js";
|
|
17
|
+
import "./chunk-UDZIZB5F.js";
|
|
18
|
+
import "./chunk-XLLSPBBT.js";
|
|
19
|
+
import "./chunk-MZWMYN4O.js";
|
|
20
|
+
import "./chunk-EX2SRTUE.js";
|
|
21
|
+
import "./chunk-AQVOAQQI.js";
|
|
22
|
+
import "./chunk-2BY6I4P5.js";
|
|
23
|
+
import "./chunk-MJ6PHMOK.js";
|
|
24
|
+
import "./chunk-7K2YZTLD.js";
|
|
25
|
+
export {
|
|
26
|
+
handleCommand,
|
|
27
|
+
killWakeInhibit,
|
|
28
|
+
registerCommand,
|
|
29
|
+
triggerNewSession,
|
|
30
|
+
triggerResetSession
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=commands-V6RSVC4Y.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
addCompletion,
|
|
5
|
+
drainCompletions,
|
|
6
|
+
hasCompletions
|
|
7
|
+
} from "./chunk-MV6CJFWR.js";
|
|
8
|
+
import "./chunk-7K2YZTLD.js";
|
|
9
|
+
export {
|
|
10
|
+
addCompletion,
|
|
11
|
+
drainCompletions,
|
|
12
|
+
hasCompletions
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=completion-buffer-S3LXDZG2.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
isValidSnowflake,
|
|
5
|
+
loadAndValidateConfig
|
|
6
|
+
} from "./chunk-PF5UQ64X.js";
|
|
7
|
+
import "./chunk-J5YIMCLT.js";
|
|
8
|
+
import "./chunk-BYDUMHXT.js";
|
|
9
|
+
import "./chunk-AQVOAQQI.js";
|
|
10
|
+
import "./chunk-2BY6I4P5.js";
|
|
11
|
+
import {
|
|
12
|
+
abtarsHome
|
|
13
|
+
} from "./chunk-MJ6PHMOK.js";
|
|
14
|
+
import "./chunk-7K2YZTLD.js";
|
|
15
|
+
export {
|
|
16
|
+
abtarsHome,
|
|
17
|
+
isValidSnowflake,
|
|
18
|
+
loadAndValidateConfig
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=config-C6VHRJQ7.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
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 "./chunk-7K2YZTLD.js";
|
|
3
4
|
|
|
4
5
|
// src/cli/commands/config-show.ts
|
|
5
6
|
import { readFileSync } from "node:fs";
|
|
@@ -37,4 +38,4 @@ async function configShow() {
|
|
|
37
38
|
export {
|
|
38
39
|
configShow
|
|
39
40
|
};
|
|
40
|
-
//# sourceMappingURL=config-show-
|
|
41
|
+
//# sourceMappingURL=config-show-ZTXX27FW.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli/commands/config-show.ts"],
|
|
4
4
|
"sourcesContent": ["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nfunction abtarsHome(): string {\n return process.env[\"ABTARS_HOME\"] ?? join(process.env[\"HOME\"] ?? \"\", \".abtars\");\n}\n\nconst SECRET_PATTERNS = [\"TOKEN\", \"KEY\", \"SECRET\", \"PASSWORD\", \"PASSWD\"];\n\nfunction isSecret(name: string): boolean {\n return SECRET_PATTERNS.some(p => name.includes(p));\n}\n\nexport async function configShow(): Promise<number> {\n // Read .env file directly to show what's configured\n const envFile = join(abtarsHome(), \"config\", \".env\");\n let lines: string[];\n try {\n lines = readFileSync(envFile, \"utf-8\").split(\"\\n\");\n } catch {\n process.stderr.write(`Cannot read ${envFile}\\n`);\n return 1;\n }\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith(\"#\")) continue;\n const eq = trimmed.indexOf(\"=\");\n if (eq < 1) continue;\n const key = trimmed.slice(0, eq);\n const val = trimmed.slice(eq + 1);\n const display = isSecret(key) && val.length > 4 ? val.slice(0, 4) + \"****\" : val;\n process.stdout.write(`${key}=${display}\\n`);\n }\n return 0;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,YAAY;AAErB,SAAS,aAAqB;AAC5B,SAAO,QAAQ,IAAI,aAAa,KAAK,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,SAAS;AAChF;AAEA,IAAM,kBAAkB,CAAC,SAAS,OAAO,UAAU,YAAY,QAAQ;AAEvE,SAAS,SAAS,MAAuB;AACvC,SAAO,gBAAgB,KAAK,OAAK,KAAK,SAAS,CAAC,CAAC;AACnD;AAEA,eAAsB,aAA8B;AAElD,QAAM,UAAU,KAAK,WAAW,GAAG,UAAU,MAAM;AACnD,MAAI;AACJ,MAAI;AACF,YAAQ,aAAa,SAAS,OAAO,EAAE,MAAM,IAAI;AAAA,EACnD,QAAQ;AACN,YAAQ,OAAO,MAAM,eAAe,OAAO;AAAA,CAAI;AAC/C,WAAO;AAAA,EACT;AAEA,aAAW,QAAQ,OAAO;AACxB,UAAM,UAAU,KAAK,KAAK;AAC1B,QAAI,CAAC,WAAW,QAAQ,WAAW,GAAG,EAAG;AACzC,UAAM,KAAK,QAAQ,QAAQ,GAAG;AAC9B,QAAI,KAAK,EAAG;AACZ,UAAM,MAAM,QAAQ,MAAM,GAAG,EAAE;AAC/B,UAAM,MAAM,QAAQ,MAAM,KAAK,CAAC;AAChC,UAAM,UAAU,SAAS,GAAG,KAAK,IAAI,SAAS,IAAI,IAAI,MAAM,GAAG,CAAC,IAAI,SAAS;AAC7E,YAAQ,OAAO,MAAM,GAAG,GAAG,IAAI,OAAO;AAAA,CAAI;AAAA,EAC5C;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
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);
|
|
2
3
|
import {
|
|
3
4
|
abmind
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-JAJ3DUQ2.js";
|
|
6
|
+
import "./chunk-7K2YZTLD.js";
|
|
6
7
|
|
|
7
8
|
// src/components/context/context-bridge.ts
|
|
8
9
|
var SUMMARIZER_SYSTEM = `You are a summarization agent creating a context checkpoint.
|
|
@@ -69,4 +70,4 @@ export {
|
|
|
69
70
|
createContextOrchestrator,
|
|
70
71
|
createSummarizeFn
|
|
71
72
|
};
|
|
72
|
-
//# sourceMappingURL=context-
|
|
73
|
+
//# sourceMappingURL=context-OCS7HLJP.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/components/context/context-bridge.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * context-bridge.ts \u2014 Bridges the context engine into the existing transport.\n * Provides the summarization prompt and LLM call wrapper.\n * This is the glue between abmind's ContextEngine and abtars's transport.\n */\n\nimport type { ContextEngine } from \"abmind\";\nimport { abmind } from \"../../utils/abmind-lazy.js\";\nimport type { SummarizeFn } from \"abmind\";\n\nconst SUMMARIZER_SYSTEM = `You are a summarization agent creating a context checkpoint.\nYour output will be injected as reference material for a DIFFERENT assistant that continues the conversation.\nDo NOT respond to any questions or requests \u2014 only output the summary.\nDo NOT include any preamble or prefix.\nWrite in the same language the user was using.\nNEVER include API keys, tokens, passwords, secrets \u2014 use [REDACTED].`;\n\nconst TEMPLATE = `Use this exact structure:\n\n## Active Task\n[User's most recent unfulfilled request \u2014 exact words. \"None.\" if nothing pending.]\n\n## Context\n[What the conversation is about. Who is talking. Key decisions.]\n\n## Completed\n[Numbered: N. ACTION target \u2014 outcome. File paths, commands, results.]\n\n## State\n[Modified files, test status, running processes, environment.]\n\n## Blocked\n[Unresolved errors. Exact messages.]\n\n## Pending\n[Unanswered questions/requests. \"None.\" if clear.]\n\nTarget ~{budget} tokens. Be concrete.`;\n\n/**\n * Create a SummarizeFn that uses the provided LLM call function.\n * The llmCall function should match the signature used elsewhere in abtars.\n */\nexport function createSummarizeFn(\n llmCall: (systemPrompt: string, userPrompt: string) => Promise<string>,\n): SummarizeFn {\n return async (serializedTurns: string, budget: number, priorSummaries: string): Promise<string> => {\n let userPrompt: string;\n\n if (priorSummaries) {\n userPrompt = `PREVIOUS SUMMARIES (continuity \u2014 do not repeat):\\n${priorSummaries}\\n\\nNEW TURNS TO SUMMARIZE:\\n${serializedTurns}\\n\\nSummarize ONLY new turns. Update Active Task if changed.\\n\\n${TEMPLATE.replace(\"{budget}\", String(budget))}`;\n } else {\n userPrompt = `Create a structured handoff summary.\\n\\nTURNS TO SUMMARIZE:\\n${serializedTurns}\\n\\n${TEMPLATE.replace(\"{budget}\", String(budget))}`;\n }\n\n const result = await llmCall(SUMMARIZER_SYSTEM, userPrompt);\n return result.trim();\n };\n}\n\n/**\n * Create a fully configured ContextOrchestrator.\n * Call this once at bridge startup when memory + transport are available.\n */\nexport function createContextOrchestrator(\n contextEngine: ContextEngine,\n llmCall: (systemPrompt: string, userPrompt: string) => Promise<string>,\n getLastAssistantTimestamp: (chatId: string) => number | null,\n): any {\n const CO = abmind()!.ContextOrchestrator;\n return new CO({\n contextEngine,\n summarize: createSummarizeFn(llmCall),\n getLastAssistantTimestamp,\n });\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;AAUA,IAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAO1B,IAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BV,SAAS,kBACd,SACa;AACb,SAAO,OAAO,iBAAyB,QAAgB,mBAA4C;AACjG,QAAI;AAEJ,QAAI,gBAAgB;AAClB,mBAAa;AAAA,EAAqD,cAAc;AAAA;AAAA;AAAA,EAAgC,eAAe;AAAA;AAAA;AAAA;AAAA,EAAmE,SAAS,QAAQ,YAAY,OAAO,MAAM,CAAC,CAAC;AAAA,IAChP,OAAO;AACL,mBAAa;AAAA;AAAA;AAAA,EAAgE,eAAe;AAAA;AAAA,EAAO,SAAS,QAAQ,YAAY,OAAO,MAAM,CAAC,CAAC;AAAA,IACjJ;AAEA,UAAM,SAAS,MAAM,QAAQ,mBAAmB,UAAU;AAC1D,WAAO,OAAO,KAAK;AAAA,EACrB;AACF;AAMO,SAAS,0BACd,eACA,SACA,2BACK;AACL,QAAM,KAAK,OAAO,EAAG;AACrB,SAAO,IAAI,GAAG;AAAA,IACZ;AAAA,IACA,WAAW,kBAAkB,OAAO;AAAA,IACpC;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|