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,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/components/transport/fallback-policy.ts
|
|
5
6
|
var FallbackPolicy = class {
|
|
@@ -43,4 +44,4 @@ var FallbackPolicy = class {
|
|
|
43
44
|
export {
|
|
44
45
|
FallbackPolicy
|
|
45
46
|
};
|
|
46
|
-
//# sourceMappingURL=fallback-policy-
|
|
47
|
+
//# sourceMappingURL=fallback-policy-SR6ED5I3.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/components/transport/fallback-policy.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * FallbackPolicy \u2014 per-agent model selection with shared health registry.\n * Owns an ordered candidate list. Delegates health checks to ModelHealthRegistry.\n */\n\nimport type { ModelHealthRegistry, ErrorKind } from \"./model-health-registry.js\";\n\nexport interface ModelCandidate {\n model: string;\n endpoint: string;\n apiKey?: string;\n maxContext: number;\n}\n\nexport interface FallbackDecision {\n chosen: ModelCandidate;\n skipped: string[];\n}\n\nexport class FallbackPolicy {\n readonly candidates: readonly ModelCandidate[];\n readonly registry: ModelHealthRegistry;\n lastDecision: FallbackDecision | null = null;\n\n constructor(candidates: readonly ModelCandidate[], registry: ModelHealthRegistry) {\n this.candidates = candidates;\n this.registry = registry;\n }\n\n /** Pick the next candidate to try. Returns null if all exhausted. */\n selectModel(sessionTokens?: number): ModelCandidate | null {\n const skipped: string[] = [];\n for (const c of this.candidates) {\n if (this.registry.shouldSkip(c.model, c.endpoint)) {\n const level = this.registry.getBucketLevel(c.model, c.endpoint);\n skipped.push(`${c.model}: bucket ${level}%`);\n continue;\n }\n if (sessionTokens && sessionTokens > 0 && c.maxContext > 0 && sessionTokens > c.maxContext * 0.95) {\n skipped.push(`${c.model}: context too large`);\n continue;\n }\n this.lastDecision = { chosen: c, skipped };\n return c;\n }\n this.lastDecision = null;\n return null;\n }\n\n /** Get surviving candidates (not skipped by health). For compaction fallback. */\n survivingCandidates(): ModelCandidate[] {\n return this.candidates.filter(c => !this.registry.shouldSkip(c.model, c.endpoint));\n }\n\n recordSuccess(candidate: ModelCandidate): void {\n this.registry.recordSuccess(candidate.model, candidate.endpoint);\n }\n\n recordError(candidate: ModelCandidate, kind: ErrorKind, retryAfterMs?: number): void {\n this.registry.recordError(candidate.model, candidate.endpoint, kind, retryAfterMs);\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;AAmBO,IAAM,iBAAN,MAAqB;AAAA,EACjB;AAAA,EACA;AAAA,EACT,eAAwC;AAAA,EAExC,YAAY,YAAuC,UAA+B;AAChF,SAAK,aAAa;AAClB,SAAK,WAAW;AAAA,EAClB;AAAA;AAAA,EAGA,YAAY,eAA+C;AACzD,UAAM,UAAoB,CAAC;AAC3B,eAAW,KAAK,KAAK,YAAY;AAC/B,UAAI,KAAK,SAAS,WAAW,EAAE,OAAO,EAAE,QAAQ,GAAG;AACjD,cAAM,QAAQ,KAAK,SAAS,eAAe,EAAE,OAAO,EAAE,QAAQ;AAC9D,gBAAQ,KAAK,GAAG,EAAE,KAAK,YAAY,KAAK,GAAG;AAC3C;AAAA,MACF;AACA,UAAI,iBAAiB,gBAAgB,KAAK,EAAE,aAAa,KAAK,gBAAgB,EAAE,aAAa,MAAM;AACjG,gBAAQ,KAAK,GAAG,EAAE,KAAK,qBAAqB;AAC5C;AAAA,MACF;AACA,WAAK,eAAe,EAAE,QAAQ,GAAG,QAAQ;AACzC,aAAO;AAAA,IACT;AACA,SAAK,eAAe;AACpB,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,sBAAwC;AACtC,WAAO,KAAK,WAAW,OAAO,OAAK,CAAC,KAAK,SAAS,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EACnF;AAAA,EAEA,cAAc,WAAiC;AAC7C,SAAK,SAAS,cAAc,UAAU,OAAO,UAAU,QAAQ;AAAA,EACjE;AAAA,EAEA,YAAY,WAA2B,MAAiB,cAA6B;AACnF,SAAK,SAAS,YAAY,UAAU,OAAO,UAAU,UAAU,MAAM,YAAY;AAAA,EACnF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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/health-check.ts
|
|
5
6
|
import { execFileSync } from "node:child_process";
|
|
@@ -53,4 +54,4 @@ function printHealthSummary(home) {
|
|
|
53
54
|
export {
|
|
54
55
|
printHealthSummary
|
|
55
56
|
};
|
|
56
|
-
//# sourceMappingURL=health-check-
|
|
57
|
+
//# sourceMappingURL=health-check-RJ2SUJYL.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli/commands/health-check.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * Post-install/update health summary \u2014 detect missing external deps.\n */\n\nimport { execFileSync } from \"node:child_process\";\nimport { join } from \"node:path\";\nimport { existsSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\n\ninterface HealthItem {\n ok: boolean;\n label: string;\n hint?: string;\n}\n\nfunction checkOllama(): HealthItem {\n try {\n execFileSync(\"ollama\", [\"--version\"], { timeout: 5000, stdio: \"pipe\" });\n return { ok: true, label: \"Ollama\" };\n } catch {\n return { ok: false, label: \"Ollama (memory embeddings disabled)\", hint: \"Install: curl -fsSL https://ollama.com/install.sh | sh\" };\n }\n}\n\nfunction checkEmbeddingModel(): HealthItem {\n try {\n const out = execFileSync(\"ollama\", [\"list\"], { timeout: 10000, stdio: \"pipe\", encoding: \"utf-8\" });\n if (out.includes(\"nomic-embed-text\")) {\n return { ok: true, label: \"Embedding model (nomic-embed-text)\" };\n }\n return { ok: false, label: \"Embedding model missing\", hint: \"Run: ollama pull nomic-embed-text\" };\n } catch {\n return { ok: false, label: \"Embedding model (ollama not reachable)\", hint: \"Start ollama, then: ollama pull nomic-embed-text\" };\n }\n}\n\nfunction checkSqliteVec(home: string): HealthItem {\n const abmindLib = join(process.env[\"ABMIND_HOME\"] ?? join(homedir(), \".abmind\"), \"lib\", \"node_modules\", \"sqlite-vec\");\n const bundleNm = join(home, \"current\", \"node_modules\", \"sqlite-vec\");\n if (existsSync(abmindLib) || existsSync(bundleNm)) {\n return { ok: true, label: \"sqlite-vec (vector search)\" };\n }\n return { ok: false, label: \"sqlite-vec (falling back to brute-force search)\", hint: \"Run: abmind install or cd ~/.abmind/lib && npm install sqlite-vec\" };\n}\n\nexport function printHealthSummary(home: string): void {\n const items: HealthItem[] = [\n { ok: true, label: `Node.js ${process.versions.node}` },\n checkOllama(),\n checkEmbeddingModel(),\n checkSqliteVec(home),\n ];\n\n process.stdout.write(\"\\n\u2500\u2500 Dependency health \u2500\u2500\\n\");\n for (const item of items) {\n const icon = item.ok ? \"\u2705\" : \"\u26A0\uFE0F \";\n process.stdout.write(` ${icon} ${item.label}\\n`);\n if (item.hint) process.stdout.write(` ${item.hint}\\n`);\n }\n process.stdout.write(\"\\n\");\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;AAIA,SAAS,oBAAoB;AAC7B,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AAQxB,SAAS,cAA0B;AACjC,MAAI;AACF,iBAAa,UAAU,CAAC,WAAW,GAAG,EAAE,SAAS,KAAM,OAAO,OAAO,CAAC;AACtE,WAAO,EAAE,IAAI,MAAM,OAAO,SAAS;AAAA,EACrC,QAAQ;AACN,WAAO,EAAE,IAAI,OAAO,OAAO,uCAAuC,MAAM,yDAAyD;AAAA,EACnI;AACF;AAEA,SAAS,sBAAkC;AACzC,MAAI;AACF,UAAM,MAAM,aAAa,UAAU,CAAC,MAAM,GAAG,EAAE,SAAS,KAAO,OAAO,QAAQ,UAAU,QAAQ,CAAC;AACjG,QAAI,IAAI,SAAS,kBAAkB,GAAG;AACpC,aAAO,EAAE,IAAI,MAAM,OAAO,qCAAqC;AAAA,IACjE;AACA,WAAO,EAAE,IAAI,OAAO,OAAO,2BAA2B,MAAM,oCAAoC;AAAA,EAClG,QAAQ;AACN,WAAO,EAAE,IAAI,OAAO,OAAO,0CAA0C,MAAM,mDAAmD;AAAA,EAChI;AACF;AAEA,SAAS,eAAe,MAA0B;AAChD,QAAM,YAAY,KAAK,QAAQ,IAAI,aAAa,KAAK,KAAK,QAAQ,GAAG,SAAS,GAAG,OAAO,gBAAgB,YAAY;AACpH,QAAM,WAAW,KAAK,MAAM,WAAW,gBAAgB,YAAY;AACnE,MAAI,WAAW,SAAS,KAAK,WAAW,QAAQ,GAAG;AACjD,WAAO,EAAE,IAAI,MAAM,OAAO,6BAA6B;AAAA,EACzD;AACA,SAAO,EAAE,IAAI,OAAO,OAAO,mDAAmD,MAAM,oEAAoE;AAC1J;AAEO,SAAS,mBAAmB,MAAoB;AACrD,QAAM,QAAsB;AAAA,IAC1B,EAAE,IAAI,MAAM,OAAO,WAAW,QAAQ,SAAS,IAAI,GAAG;AAAA,IACtD,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,eAAe,IAAI;AAAA,EACrB;AAEA,UAAQ,OAAO,MAAM,iDAA6B;AAClD,aAAW,QAAQ,OAAO;AACxB,UAAM,OAAO,KAAK,KAAK,WAAM;AAC7B,YAAQ,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK;AAAA,CAAI;AAChD,QAAI,KAAK,KAAM,SAAQ,OAAO,MAAM,QAAQ,KAAK,IAAI;AAAA,CAAI;AAAA,EAC3D;AACA,UAAQ,OAAO,MAAM,IAAI;AAC3B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
fire,
|
|
5
|
+
getHookSummary,
|
|
6
|
+
hasHooks,
|
|
7
|
+
loadHookConfig
|
|
8
|
+
} from "./chunk-G6IXMYIO.js";
|
|
9
|
+
import "./chunk-2BY6I4P5.js";
|
|
10
|
+
import "./chunk-MJ6PHMOK.js";
|
|
11
|
+
import "./chunk-7K2YZTLD.js";
|
|
12
|
+
export {
|
|
13
|
+
fire,
|
|
14
|
+
getHookSummary,
|
|
15
|
+
hasHooks,
|
|
16
|
+
loadHookConfig
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=hook-system-POI5VRIX.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
register
|
|
5
|
+
} from "./chunk-RE3F3CFW.js";
|
|
6
|
+
import "./chunk-EX2SRTUE.js";
|
|
7
|
+
import "./chunk-2BY6I4P5.js";
|
|
8
|
+
import "./chunk-MJ6PHMOK.js";
|
|
9
|
+
import "./chunk-7K2YZTLD.js";
|
|
10
|
+
export {
|
|
11
|
+
register
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=hotskills-6ECHLXTJ.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
install,
|
|
5
|
+
writeWrapper
|
|
6
|
+
} from "./chunk-7CHLS36W.js";
|
|
7
|
+
import "./chunk-HXJRZWKA.js";
|
|
8
|
+
import "./chunk-7K2YZTLD.js";
|
|
9
|
+
export {
|
|
10
|
+
install,
|
|
11
|
+
writeWrapper
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=install-24XR5FO5.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
install,
|
|
5
|
+
writeWrapper
|
|
6
|
+
} from "./chunk-RB3X66KM.js";
|
|
7
|
+
import "./chunk-HXJRZWKA.js";
|
|
8
|
+
import "./chunk-7K2YZTLD.js";
|
|
9
|
+
export {
|
|
10
|
+
install,
|
|
11
|
+
writeWrapper
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=install-AJ7VW76P.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/install-log.ts
|
|
5
6
|
import { appendFileSync, mkdirSync } from "node:fs";
|
|
@@ -25,4 +26,4 @@ export {
|
|
|
25
26
|
logInstall,
|
|
26
27
|
logInstallHeader
|
|
27
28
|
};
|
|
28
|
-
//# sourceMappingURL=install-log-
|
|
29
|
+
//# sourceMappingURL=install-log-Q6RUHKWC.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli/install-log.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * install-log.ts \u2014 Append-only install/onboard log at ~/.abtars/logs/install.log\n */\n\nimport { appendFileSync, mkdirSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nlet logPath: string | null = null;\n\nexport function initInstallLog(abtarsHome: string): void {\n const logsDir = join(abtarsHome, \"logs\");\n mkdirSync(logsDir, { recursive: true });\n logPath = join(logsDir, \"install.log\");\n}\n\nexport function logInstall(line: string): void {\n if (!logPath) return;\n appendFileSync(logPath, line + \"\\n\");\n}\n\nexport function logInstallHeader(command: string): void {\n if (!logPath) return;\n appendFileSync(logPath, `\\n=== abtars ${command} ${new Date().toISOString().slice(0, 16)} ===\\n`);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;AAIA,SAAS,gBAAgB,iBAAiB;AAC1C,SAAS,YAAY;AAErB,IAAI,UAAyB;AAEtB,SAAS,eAAe,YAA0B;AACvD,QAAM,UAAU,KAAK,YAAY,MAAM;AACvC,YAAU,SAAS,EAAE,WAAW,KAAK,CAAC;AACtC,YAAU,KAAK,SAAS,aAAa;AACvC;AAEO,SAAS,WAAW,MAAoB;AAC7C,MAAI,CAAC,QAAS;AACd,iBAAe,SAAS,OAAO,IAAI;AACrC;AAEO,SAAS,iBAAiB,SAAuB;AACtD,MAAI,CAAC,QAAS;AACd,iBAAe,SAAS;AAAA,aAAgB,OAAO,KAAI,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC;AAAA,CAAQ;AAClG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
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_logger,
|
|
4
5
|
logWarn
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-2BY6I4P5.js";
|
|
7
|
+
import "./chunk-MJ6PHMOK.js";
|
|
8
|
+
import "./chunk-7K2YZTLD.js";
|
|
8
9
|
|
|
9
10
|
// src/cli/install-manifest.ts
|
|
10
11
|
init_logger();
|
|
11
12
|
import { readFileSync, existsSync, mkdirSync, copyFileSync, chmodSync, statSync } from "node:fs";
|
|
12
|
-
import { join } from "node:path";
|
|
13
|
+
import { join, dirname } from "node:path";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
13
15
|
var TAG = "manifest";
|
|
14
16
|
var SUPPORTED_VERSION = 2;
|
|
15
17
|
var cached = null;
|
|
16
18
|
function loadManifest(repoRoot) {
|
|
17
19
|
if (cached) return cached;
|
|
18
|
-
const root = repoRoot ??
|
|
20
|
+
const root = repoRoot ?? join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
19
21
|
const p = join(root, "install-manifest.json");
|
|
20
22
|
let raw;
|
|
21
23
|
try {
|
|
@@ -99,4 +101,4 @@ export {
|
|
|
99
101
|
loadManifest,
|
|
100
102
|
reconcileManifest
|
|
101
103
|
};
|
|
102
|
-
//# sourceMappingURL=install-manifest-
|
|
104
|
+
//# sourceMappingURL=install-manifest-MCJCAYSR.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/cli/install-manifest.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * install-manifest.ts \u2014 Load and validate install-manifest.json.\n * Single source of truth for install-time requirements.\n */\n\nimport { readFileSync, existsSync, mkdirSync, copyFileSync, chmodSync, statSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { logWarn } from \"../components/logger.js\";\n\nconst TAG = \"manifest\";\nconst SUPPORTED_VERSION = 2;\n\n// \u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface ManifestDirectory {\n path: string;\n mode?: string;\n}\n\nexport interface ManifestConfigSeed {\n source: string;\n dest: string;\n mode?: string;\n}\n\nexport interface ManifestRequiredConfig {\n path: string;\n remediation: string;\n}\n\nexport interface ManifestScripts {\n include: string[];\n executable: string;\n}\n\nexport interface ManifestServices {\n supervised: {\n macos?: { plist: string; placeholders: string[] };\n linux?: { units: string[] };\n };\n}\n\n\nexport interface InstallManifest {\n manifestVersion: number;\n directories: ManifestDirectory[];\n lazyRoots: string[];\n configSeeds: ManifestConfigSeed[];\n requiredConfigs: ManifestRequiredConfig[];\n scripts: ManifestScripts;\n services: ManifestServices;\n cliWrappers: string[];\n}\n\n// \u2500\u2500 Loader \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet cached: InstallManifest | null = null;\n\nexport function loadManifest(repoRoot?: string): InstallManifest {\n if (cached) return cached;\n const root = repoRoot ?? join(dirname(fileURLToPath(import.meta.url)), \"..\");\n const p = join(root, \"install-manifest.json\");\n let raw: InstallManifest;\n try { raw = JSON.parse(readFileSync(p, \"utf-8\")) as InstallManifest; }\n catch (err) { throw new Error(`Invalid JSON in install-manifest.json: ${err instanceof Error ? err.message : String(err)}`); }\n if (raw.manifestVersion > SUPPORTED_VERSION) {\n logWarn(TAG, `manifest version ${raw.manifestVersion} > supported ${SUPPORTED_VERSION} \u2014 some features may not be applied`);\n }\n cached = raw;\n return raw;\n}\n\n/** Clear cache (for tests). */\nexport function _resetManifestCache(): void { cached = null; }\n\n/** Check if a path is under a declared lazyRoot. */\nexport function isLazyRootAllowed(manifest: InstallManifest, relPath: string): boolean {\n return manifest.lazyRoots.some(root => relPath === root || relPath.startsWith(root + \"/\"));\n}\n\n// \u2500\u2500 Reconciliation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface ReconcileResult {\n ok: string[];\n fixed: string[];\n warnings: string[];\n}\n\n/**\n * Reconcile install state against manifest. If fix=true, creates missing dirs\n * and seeds missing configs. Returns a report.\n */\nexport function reconcileManifest(\n manifest: InstallManifest,\n home: string,\n repoRoot: string,\n fix: boolean,\n): ReconcileResult {\n const ok: string[] = [];\n const fixed: string[] = [];\n const warnings: string[] = [];\n\n // Eager directories\n for (const dir of manifest.directories) {\n const abs = join(home, dir.path);\n if (existsSync(abs)) {\n if (dir.mode) {\n const actual = (statSync(abs).mode & 0o777).toString(8);\n const expected = dir.mode.replace(/^0/, \"\");\n if (actual !== expected) {\n if (fix) {\n chmodSync(abs, parseInt(dir.mode, 8));\n fixed.push(`${dir.path}/ permissions ${actual} \u2192 ${expected}`);\n } else {\n warnings.push(`${dir.path}/ permissions ${actual}, expected ${expected}`);\n }\n } else {\n ok.push(`${dir.path}/`);\n }\n } else {\n ok.push(`${dir.path}/`);\n }\n } else if (fix) {\n mkdirSync(abs, { recursive: true, mode: dir.mode ? parseInt(dir.mode, 8) : undefined });\n fixed.push(`created ${dir.path}/`);\n } else {\n warnings.push(`${dir.path}/ MISSING`);\n }\n }\n\n // Config seeds\n for (const seed of manifest.configSeeds) {\n const dest = join(home, seed.dest);\n if (existsSync(dest)) {\n ok.push(seed.dest);\n } else {\n const src = join(repoRoot, seed.source);\n if (fix && existsSync(src)) {\n mkdirSync(join(home, seed.dest, \"..\"), { recursive: true });\n copyFileSync(src, dest);\n if (seed.mode) chmodSync(dest, parseInt(seed.mode, 8));\n fixed.push(`seeded ${seed.dest} from ${seed.source}`);\n } else if (!existsSync(src)) {\n warnings.push(`${seed.dest} MISSING (source ${seed.source} not found)`);\n } else {\n warnings.push(`${seed.dest} MISSING (seed from ${seed.source})`);\n }\n }\n }\n\n // Required configs (report only, never auto-fix)\n for (const req of manifest.requiredConfigs) {\n const abs = join(home, req.path);\n if (existsSync(abs)) {\n ok.push(req.path);\n } else {\n warnings.push(`${req.path} MISSING \u2014 ${req.remediation}`);\n }\n }\n\n return { ok, fixed, warnings };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAQA;AAHA,SAAS,cAAc,YAAY,WAAW,cAAc,WAAW,gBAAgB;AACvF,SAAS,MAAM,eAAe;AAC9B,SAAS,qBAAqB;AAG9B,IAAM,MAAM;AACZ,IAAM,oBAAoB;AA8C1B,IAAI,SAAiC;AAE9B,SAAS,aAAa,UAAoC;AAC/D,MAAI,OAAQ,QAAO;AACnB,QAAM,OAAO,YAAY,KAAK,QAAQ,cAAc,Y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,IAC1D;AAAA,EACF;AAEA,SAAO,EAAE,IAAI,OAAO,SAAS;AAC/B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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_logger,
|
|
5
|
+
logWarn
|
|
6
|
+
} from "./chunk-2BY6I4P5.js";
|
|
7
|
+
import "./chunk-MJ6PHMOK.js";
|
|
8
|
+
import "./chunk-7K2YZTLD.js";
|
|
9
|
+
|
|
10
|
+
// src/cli/install-manifest.ts
|
|
11
|
+
init_logger();
|
|
12
|
+
import { readFileSync, existsSync, mkdirSync, copyFileSync, chmodSync, statSync } from "node:fs";
|
|
13
|
+
import { join, dirname } from "node:path";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
var TAG = "manifest";
|
|
16
|
+
var SUPPORTED_VERSION = 2;
|
|
17
|
+
var cached = null;
|
|
18
|
+
function loadManifest(repoRoot) {
|
|
19
|
+
if (cached) return cached;
|
|
20
|
+
const root = repoRoot ?? join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
21
|
+
const p = join(root, "install-manifest.json");
|
|
22
|
+
let raw;
|
|
23
|
+
try {
|
|
24
|
+
raw = JSON.parse(readFileSync(p, "utf-8"));
|
|
25
|
+
} catch (err) {
|
|
26
|
+
throw new Error(`Invalid JSON in install-manifest.json: ${err instanceof Error ? err.message : String(err)}`);
|
|
27
|
+
}
|
|
28
|
+
if (raw.manifestVersion > SUPPORTED_VERSION) {
|
|
29
|
+
logWarn(TAG, `manifest version ${raw.manifestVersion} > supported ${SUPPORTED_VERSION} \u2014 some features may not be applied`);
|
|
30
|
+
}
|
|
31
|
+
cached = raw;
|
|
32
|
+
return raw;
|
|
33
|
+
}
|
|
34
|
+
function _resetManifestCache() {
|
|
35
|
+
cached = null;
|
|
36
|
+
}
|
|
37
|
+
function isLazyRootAllowed(manifest, relPath) {
|
|
38
|
+
return manifest.lazyRoots.some((root) => relPath === root || relPath.startsWith(root + "/"));
|
|
39
|
+
}
|
|
40
|
+
function reconcileManifest(manifest, home, repoRoot, fix) {
|
|
41
|
+
const ok = [];
|
|
42
|
+
const fixed = [];
|
|
43
|
+
const warnings = [];
|
|
44
|
+
for (const dir of manifest.directories) {
|
|
45
|
+
const abs = join(home, dir.path);
|
|
46
|
+
if (existsSync(abs)) {
|
|
47
|
+
if (dir.mode) {
|
|
48
|
+
const actual = (statSync(abs).mode & 511).toString(8);
|
|
49
|
+
const expected = dir.mode.replace(/^0/, "");
|
|
50
|
+
if (actual !== expected) {
|
|
51
|
+
if (fix) {
|
|
52
|
+
chmodSync(abs, parseInt(dir.mode, 8));
|
|
53
|
+
fixed.push(`${dir.path}/ permissions ${actual} \u2192 ${expected}`);
|
|
54
|
+
} else {
|
|
55
|
+
warnings.push(`${dir.path}/ permissions ${actual}, expected ${expected}`);
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
ok.push(`${dir.path}/`);
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
ok.push(`${dir.path}/`);
|
|
62
|
+
}
|
|
63
|
+
} else if (fix) {
|
|
64
|
+
mkdirSync(abs, { recursive: true, mode: dir.mode ? parseInt(dir.mode, 8) : void 0 });
|
|
65
|
+
fixed.push(`created ${dir.path}/`);
|
|
66
|
+
} else {
|
|
67
|
+
warnings.push(`${dir.path}/ MISSING`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
for (const seed of manifest.configSeeds) {
|
|
71
|
+
const dest = join(home, seed.dest);
|
|
72
|
+
if (existsSync(dest)) {
|
|
73
|
+
ok.push(seed.dest);
|
|
74
|
+
} else {
|
|
75
|
+
const src = join(repoRoot, seed.source);
|
|
76
|
+
if (fix && existsSync(src)) {
|
|
77
|
+
mkdirSync(join(home, seed.dest, ".."), { recursive: true });
|
|
78
|
+
copyFileSync(src, dest);
|
|
79
|
+
if (seed.mode) chmodSync(dest, parseInt(seed.mode, 8));
|
|
80
|
+
fixed.push(`seeded ${seed.dest} from ${seed.source}`);
|
|
81
|
+
} else if (!existsSync(src)) {
|
|
82
|
+
warnings.push(`${seed.dest} MISSING (source ${seed.source} not found)`);
|
|
83
|
+
} else {
|
|
84
|
+
warnings.push(`${seed.dest} MISSING (seed from ${seed.source})`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
for (const req of manifest.requiredConfigs) {
|
|
89
|
+
const abs = join(home, req.path);
|
|
90
|
+
if (existsSync(abs)) {
|
|
91
|
+
ok.push(req.path);
|
|
92
|
+
} else {
|
|
93
|
+
warnings.push(`${req.path} MISSING \u2014 ${req.remediation}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return { ok, fixed, warnings };
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
_resetManifestCache,
|
|
100
|
+
isLazyRootAllowed,
|
|
101
|
+
loadManifest,
|
|
102
|
+
reconcileManifest
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=install-manifest-ZETY4AFS.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/cli/install-manifest.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * install-manifest.ts \u2014 Load and validate install-manifest.json.\n * Single source of truth for install-time requirements.\n */\n\nimport { readFileSync, existsSync, mkdirSync, copyFileSync, chmodSync, statSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { logWarn } from \"../components/logger.js\";\n\nconst TAG = \"manifest\";\nconst SUPPORTED_VERSION = 2;\n\n// \u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface ManifestDirectory {\n path: string;\n mode?: string;\n}\n\nexport interface ManifestConfigSeed {\n source: string;\n dest: string;\n mode?: string;\n}\n\nexport interface ManifestRequiredConfig {\n path: string;\n remediation: string;\n}\n\nexport interface ManifestScripts {\n include: string[];\n executable: string;\n}\n\nexport interface ManifestServices {\n supervised: {\n macos?: { plist: string; placeholders: string[] };\n linux?: { units: string[] };\n };\n}\n\n\nexport interface InstallManifest {\n manifestVersion: number;\n directories: ManifestDirectory[];\n lazyRoots: string[];\n configSeeds: ManifestConfigSeed[];\n requiredConfigs: ManifestRequiredConfig[];\n scripts: ManifestScripts;\n services: ManifestServices;\n cliWrappers: string[];\n}\n\n// \u2500\u2500 Loader \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet cached: InstallManifest | null = null;\n\nexport function loadManifest(repoRoot?: string): InstallManifest {\n if (cached) return cached;\n const root = repoRoot ?? join(dirname(fileURLToPath(import.meta.url)), \"..\", \"..\");\n const p = join(root, \"install-manifest.json\");\n let raw: InstallManifest;\n try { raw = JSON.parse(readFileSync(p, \"utf-8\")) as InstallManifest; }\n catch (err) { throw new Error(`Invalid JSON in install-manifest.json: ${err instanceof Error ? err.message : String(err)}`); }\n if (raw.manifestVersion > SUPPORTED_VERSION) {\n logWarn(TAG, `manifest version ${raw.manifestVersion} > supported ${SUPPORTED_VERSION} \u2014 some features may not be applied`);\n }\n cached = raw;\n return raw;\n}\n\n/** Clear cache (for tests). */\nexport function _resetManifestCache(): void { cached = null; }\n\n/** Check if a path is under a declared lazyRoot. */\nexport function isLazyRootAllowed(manifest: InstallManifest, relPath: string): boolean {\n return manifest.lazyRoots.some(root => relPath === root || relPath.startsWith(root + \"/\"));\n}\n\n// \u2500\u2500 Reconciliation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface ReconcileResult {\n ok: string[];\n fixed: string[];\n warnings: string[];\n}\n\n/**\n * Reconcile install state against manifest. If fix=true, creates missing dirs\n * and seeds missing configs. Returns a report.\n */\nexport function reconcileManifest(\n manifest: InstallManifest,\n home: string,\n repoRoot: string,\n fix: boolean,\n): ReconcileResult {\n const ok: string[] = [];\n const fixed: string[] = [];\n const warnings: string[] = [];\n\n // Eager directories\n for (const dir of manifest.directories) {\n const abs = join(home, dir.path);\n if (existsSync(abs)) {\n if (dir.mode) {\n const actual = (statSync(abs).mode & 0o777).toString(8);\n const expected = dir.mode.replace(/^0/, \"\");\n if (actual !== expected) {\n if (fix) {\n chmodSync(abs, parseInt(dir.mode, 8));\n fixed.push(`${dir.path}/ permissions ${actual} \u2192 ${expected}`);\n } else {\n warnings.push(`${dir.path}/ permissions ${actual}, expected ${expected}`);\n }\n } else {\n ok.push(`${dir.path}/`);\n }\n } else {\n ok.push(`${dir.path}/`);\n }\n } else if (fix) {\n mkdirSync(abs, { recursive: true, mode: dir.mode ? parseInt(dir.mode, 8) : undefined });\n fixed.push(`created ${dir.path}/`);\n } else {\n warnings.push(`${dir.path}/ MISSING`);\n }\n }\n\n // Config seeds\n for (const seed of manifest.configSeeds) {\n const dest = join(home, seed.dest);\n if (existsSync(dest)) {\n ok.push(seed.dest);\n } else {\n const src = join(repoRoot, seed.source);\n if (fix && existsSync(src)) {\n mkdirSync(join(home, seed.dest, \"..\"), { recursive: true });\n copyFileSync(src, dest);\n if (seed.mode) chmodSync(dest, parseInt(seed.mode, 8));\n fixed.push(`seeded ${seed.dest} from ${seed.source}`);\n } else if (!existsSync(src)) {\n warnings.push(`${seed.dest} MISSING (source ${seed.source} not found)`);\n } else {\n warnings.push(`${seed.dest} MISSING (seed from ${seed.source})`);\n }\n }\n }\n\n // Required configs (report only, never auto-fix)\n for (const req of manifest.requiredConfigs) {\n const abs = join(home, req.path);\n if (existsSync(abs)) {\n ok.push(req.path);\n } else {\n warnings.push(`${req.path} MISSING \u2014 ${req.remediation}`);\n }\n }\n\n return { ok, fixed, warnings };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAQA;AAHA,SAAS,cAAc,YAAY,WAAW,cAAc,WAAW,gBAAgB;AACvF,SAAS,MAAM,eAAe;AAC9B,SAAS,qBAAqB;AAG9B,IAAM,MAAM;AACZ,IAAM,oBAAoB;AA8C1B,IAAI,SAAiC;AAE9B,SAAS,aAAa,UAAoC;AAC/D,MAAI,OAAQ,QAAO;AACnB,QAAM,OAAO,YAAY,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC,GAAG,MAAM,IAAI;AACjF,QAAM,IAAI,KAAK,MAAM,uBAAuB;AAC5C,MAAI;AACJ,MAAI;AAAE,UAAM,KAAK,MAAM,aAAa,GAAG,OAAO,CAAC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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/install-validate.ts
|
|
5
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -50,4 +51,4 @@ export {
|
|
|
50
51
|
formatValidationError,
|
|
51
52
|
validateMinimumViability
|
|
52
53
|
};
|
|
53
|
-
//# sourceMappingURL=install-validate-
|
|
54
|
+
//# sourceMappingURL=install-validate-H74LUCE2.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli/commands/install-validate.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * install-validate.ts \u2014 Post-install healthcheck.\n * Validates minimum viability BEFORE first boot.\n * Runs ONCE at end of install, not on every boot.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nexport interface ValidationResult {\n ok: boolean;\n errors: string[];\n}\n\n/**\n * Validate that the installed config has at least one viable operator channel.\n * Returns errors if not \u2014 caller decides whether to exit or warn.\n */\nexport function validateMinimumViability(configDir: string): ValidationResult {\n const errors: string[] = [];\n\n // Read .env file \u2014 if no .env exists, skip validation (not configured yet, onboard will handle)\n const envPath = join(configDir, \".env\");\n if (!existsSync(envPath)) return { ok: true, errors: [] };\n\n const envVars = new Map<string, string>();\n const lines = readFileSync(envPath, \"utf-8\").split(\"\\n\");\n for (const line of lines) {\n const match = line.match(/^([A-Z_]+)=(.*)$/);\n if (match) envVars.set(match[1]!, match[2]!.replace(/^[\"']|[\"']$/g, \"\"));\n }\n\n const mainChatId = envVars.get(\"MAIN_CHAT_ID\");\n const provider = envVars.get(\"MAIN_CHAT_PROVIDER\") ?? \"telegram\";\n const tgToken = envVars.get(\"TELEGRAM_BOT_TOKEN\");\n const dcToken = envVars.get(\"DISCORD_BOT_TOKEN\");\n\n // Must have MAIN_CHAT_ID\n if (!mainChatId) {\n errors.push(\"MAIN_CHAT_ID not set (operator delivery address)\");\n }\n\n // Must have the matching platform token\n if (provider === \"telegram\" && !tgToken) {\n errors.push(\"TELEGRAM_BOT_TOKEN not set (required for MAIN_CHAT_PROVIDER=telegram)\");\n } else if (provider === \"discord\" && !dcToken) {\n errors.push(\"DISCORD_BOT_TOKEN not set (required for MAIN_CHAT_PROVIDER=discord)\");\n }\n\n // At least one platform token must exist\n if (!tgToken && !dcToken) {\n errors.push(\"No platform token configured (need TELEGRAM_BOT_TOKEN or DISCORD_BOT_TOKEN)\");\n }\n\n return { ok: errors.length === 0, errors };\n}\n\n/**\n * Format validation failure as a user-friendly error message.\n */\nexport function formatValidationError(result: ValidationResult, invocation: string): string {\n const lines = [\n \"\u274C Install incomplete: no viable operator channel configured.\",\n \"\",\n \"Missing:\",\n ...result.errors.map(e => ` \u2022 ${e}`),\n \"\",\n \"Configure ONE of:\",\n \" 1. Telegram: TELEGRAM_BOT_TOKEN + MAIN_CHAT_ID\",\n \" 2. Discord: DISCORD_BOT_TOKEN + MAIN_CHAT_ID + MAIN_CHAT_PROVIDER=discord\",\n \"\",\n `Then re-run: ${invocation}`,\n ];\n return lines.join(\"\\n\");\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;AAMA,SAAS,YAAY,oBAAoB;AACzC,SAAS,YAAY;AAWd,SAAS,yBAAyB,WAAqC;AAC5E,QAAM,SAAmB,CAAC;AAG1B,QAAM,UAAU,KAAK,WAAW,MAAM;AACtC,MAAI,CAAC,WAAW,OAAO,EAAG,QAAO,EAAE,IAAI,MAAM,QAAQ,CAAC,EAAE;AAExD,QAAM,UAAU,oBAAI,IAAoB;AACxC,QAAM,QAAQ,aAAa,SAAS,OAAO,EAAE,MAAM,IAAI;AACvD,aAAW,QAAQ,OAAO;AACxB,UAAM,QAAQ,KAAK,MAAM,kBAAkB;AAC3C,QAAI,MAAO,SAAQ,IAAI,MAAM,CAAC,GAAI,MAAM,CAAC,EAAG,QAAQ,gBAAgB,EAAE,CAAC;AAAA,EACzE;AAEA,QAAM,aAAa,QAAQ,IAAI,cAAc;AAC7C,QAAM,WAAW,QAAQ,IAAI,oBAAoB,KAAK;AACtD,QAAM,UAAU,QAAQ,IAAI,oBAAoB;AAChD,QAAM,UAAU,QAAQ,IAAI,mBAAmB;AAG/C,MAAI,CAAC,YAAY;AACf,WAAO,KAAK,kDAAkD;AAAA,EAChE;AAGA,MAAI,aAAa,cAAc,CAAC,SAAS;AACvC,WAAO,KAAK,uEAAuE;AAAA,EACrF,WAAW,aAAa,aAAa,CAAC,SAAS;AAC7C,WAAO,KAAK,qEAAqE;AAAA,EACnF;AAGA,MAAI,CAAC,WAAW,CAAC,SAAS;AACxB,WAAO,KAAK,6EAA6E;AAAA,EAC3F;AAEA,SAAO,EAAE,IAAI,OAAO,WAAW,GAAG,OAAO;AAC3C;AAKO,SAAS,sBAAsB,QAA0B,YAA4B;AAC1F,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,OAAO,OAAO,IAAI,OAAK,YAAO,CAAC,EAAE;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,UAAU;AAAA,EAC5B;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
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
|
signMessage,
|
|
4
5
|
verifyMessage
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SY67HM2Y.js";
|
|
6
7
|
import {
|
|
7
8
|
init_logger,
|
|
8
9
|
logDebug,
|
|
9
10
|
logInfo,
|
|
10
11
|
logWarn
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-2BY6I4P5.js";
|
|
13
|
+
import "./chunk-MJ6PHMOK.js";
|
|
14
|
+
import "./chunk-7K2YZTLD.js";
|
|
14
15
|
|
|
15
16
|
// src/platforms/irc/irc-client.ts
|
|
16
17
|
init_logger();
|
|
@@ -290,4 +291,4 @@ function escapeRegex(s) {
|
|
|
290
291
|
export {
|
|
291
292
|
IrcAdapter
|
|
292
293
|
};
|
|
293
|
-
//# sourceMappingURL=irc-adapter-
|
|
294
|
+
//# sourceMappingURL=irc-adapter-RKRUSZXB.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/platforms/irc/irc-client.ts", "../src/platforms/irc/irc-adapter.ts"],
|
|
4
4
|
"sourcesContent": ["import net from \"node:net\";\nimport tls from \"node:tls\";\nimport { logInfo, logWarn, logDebug } from \"../../components/logger.js\";\n\nconst TAG = \"irc-client\";\n\nexport interface IrcClientOptions {\n host: string;\n port: number;\n useTls: boolean;\n nick: string;\n nickservPassword?: string;\n channels: string[];\n onPrivmsg: (sender: string, target: string, text: string, hostmask: string) => void;\n onReady?: () => void;\n onDisconnect?: () => void;\n}\n\nexport interface IrcClient {\n send: (target: string, text: string) => void;\n quit: (reason?: string) => void;\n readonly nick: string;\n}\n\nexport function createIrcClient(opts: IrcClientOptions): IrcClient {\n let socket: net.Socket | null = null;\n let reconnectTimer: NodeJS.Timeout | null = null;\n let reconnectDelay = 5000;\n let registered = false;\n let stopped = false;\n let sendQueue: string[] = [];\n let sendTimer: NodeJS.Timeout | null = null;\n let buffer = \"\";\n let consecutiveFailures = 0;\n const MAX_RETRIES = 5;\n\n function connect(): void {\n if (stopped) return;\n registered = false;\n buffer = \"\";\n\n const onConnect = (): void => {\n logInfo(TAG, `Connected to ${opts.host}:${opts.port}`);\n reconnectDelay = 5000;\n consecutiveFailures = 0;\n raw(`NICK ${opts.nick}`);\n raw(`USER ${opts.nick} 0 * :abtars`);\n };\n\n if (opts.useTls) {\n socket = tls.connect({ host: opts.host, port: opts.port, rejectUnauthorized: false }, onConnect);\n } else {\n socket = net.createConnection({ host: opts.host, port: opts.port }, onConnect);\n }\n\n socket.setEncoding(\"utf-8\");\n socket.on(\"data\", onData);\n socket.on(\"error\", (err) => {\n if (reconnectDelay <= 5000) logWarn(TAG, `Socket error: ${err.message}`);\n else logDebug(TAG, `Socket error (reconnecting): ${err.message}`);\n });\n socket.on(\"close\", () => {\n if (reconnectDelay <= 5000) logWarn(TAG, `Disconnected from ${opts.host}`);\n opts.onDisconnect?.();\n scheduleReconnect();\n });\n }\n\n function scheduleReconnect(): void {\n if (stopped) return;\n consecutiveFailures++;\n if (consecutiveFailures >= MAX_RETRIES) {\n logWarn(TAG, `IRC unavailable \u2014 giving up after ${MAX_RETRIES} attempts. Restart bridge to retry.`);\n stopped = true;\n return;\n }\n reconnectTimer = setTimeout(() => {\n if (reconnectDelay <= 10000) logInfo(TAG, `Reconnecting to ${opts.host}:${opts.port}...`);\n else logDebug(TAG, `Reconnecting to ${opts.host}:${opts.port} (delay=${Math.round(reconnectDelay/1000)}s)...`);\n connect();\n }, reconnectDelay);\n reconnectDelay = Math.min(reconnectDelay * 2, 300000);\n }\n\n function raw(line: string): void {\n socket?.write(line + \"\\r\\n\");\n }\n\n function onData(chunk: string): void {\n buffer += chunk;\n const lines = buffer.split(\"\\r\\n\");\n buffer = lines.pop()!;\n for (const line of lines) {\n if (line) handleLine(line);\n }\n }\n\n function handleLine(line: string): void {\n if (line.startsWith(\"PING\")) {\n raw(\"PONG\" + line.slice(4));\n return;\n }\n\n const parts = line.split(\" \");\n const code = parts[1];\n\n // 001 RPL_WELCOME \u2014 registration complete\n if (code === \"001\" && !registered) {\n registered = true;\n if (opts.nickservPassword) {\n raw(`PRIVMSG NickServ :IDENTIFY ${opts.nickservPassword}`);\n // Join after short delay to let NickServ process\n setTimeout(joinChannels, 2000);\n } else {\n joinChannels();\n }\n return;\n }\n\n // PRIVMSG\n if (code === \"PRIVMSG\") {\n const prefix = parts[0]!.slice(1); // remove leading ':'\n const sender = prefix.split(\"!\")[0]!;\n const target = parts[2]!;\n const textStart = line.indexOf(\":\", line.indexOf(\"PRIVMSG\") + 8);\n const text = textStart >= 0 ? line.slice(textStart + 1) : \"\";\n opts.onPrivmsg(sender, target, text, prefix);\n return;\n }\n }\n\n function joinChannels(): void {\n for (const ch of opts.channels) {\n raw(`JOIN ${ch}`);\n }\n logInfo(TAG, `Joined: ${opts.channels.join(\", \")}`);\n opts.onReady?.();\n }\n\n // Rate-limited send: 1 msg/sec\n function flushQueue(): void {\n if (sendQueue.length === 0) {\n sendTimer = null;\n return;\n }\n const msg = sendQueue.shift()!;\n raw(msg);\n sendTimer = setTimeout(flushQueue, 1000);\n }\n\n function sendPrivmsg(target: string, text: string): void {\n const line = `PRIVMSG ${target} :${text}`;\n sendQueue.push(line);\n if (!sendTimer) {\n sendTimer = setTimeout(flushQueue, 0);\n }\n }\n\n connect();\n\n return {\n nick: opts.nick,\n send: sendPrivmsg,\n quit(reason?: string): void {\n stopped = true;\n if (reconnectTimer) clearTimeout(reconnectTimer);\n if (sendTimer) clearTimeout(sendTimer);\n raw(`QUIT :${reason ?? \"bye\"}`);\n setTimeout(() => socket?.destroy(), 1000);\n },\n };\n}\n", "import type { PlatformAdapter, InboundMessage, SendOpts } from \"../../types/platform.js\";\nimport type { IrcConfig, IrcServerConfig } from \"./irc-config.js\";\nimport { createIrcClient, type IrcClient } from \"./irc-client.js\";\nimport { signMessage, verifyMessage } from \"../../components/digital-signature.js\";\nimport { logInfo, logDebug, logWarn } from \"../../components/logger.js\";\n\nconst TAG = \"irc\";\nconst MAX_LINE_PLAIN = 450;\nconst MAX_LINE_SECURE = 340; // leave room for [sig:ts:base64] suffix\n\nexport interface IrcAdapterDeps {\n onMessage: (msg: InboundMessage) => void;\n}\n\nexport class IrcAdapter implements PlatformAdapter {\n readonly name = \"irc\" as const;\n readonly capabilities = { voice: false, reactions: false, edit: false, typing: false, threads: false };\n readonly supportsStreaming = false;\n\n private clients: IrcClient[] = [];\n private config: IrcConfig;\n private deps: IrcAdapterDeps;\n\n constructor(config: IrcConfig, deps: IrcAdapterDeps) {\n this.config = config;\n this.deps = deps;\n }\n\n async start(): Promise<void> {\n for (const server of this.config.servers) {\n const channels = Object.keys(server.channels);\n const client = createIrcClient({\n host: server.host,\n port: server.port,\n useTls: server.tls,\n nick: server.nick,\n nickservPassword: server.nickservPassword,\n channels,\n onPrivmsg: (sender, target, text, hostmask) => this.handlePrivmsg(server, client, sender, target, text, hostmask),\n onReady: () => logInfo(TAG, `[${server.id}] ready`),\n });\n this.clients.push(client);\n }\n }\n\n stop(): void {\n for (const c of this.clients) c.quit();\n this.clients = [];\n }\n\n authorize(_msg: InboundMessage): boolean {\n return true; // Authorization handled in handlePrivmsg\n }\n\n async sendMessage(channelId: string, text: string, _opts?: SendOpts): Promise<number | undefined> {\n const [serverId, channel] = channelId.split(\":\", 2);\n const client = this.clients.find((_, i) => this.config.servers[i]?.id === serverId);\n if (!client || !channel) return undefined;\n\n const server = this.config.servers.find(s => s.id === serverId);\n const channelConfig = server?.channels[channel];\n const isSigned = channelConfig?.mode === \"signed\";\n const maxLine = isSigned ? MAX_LINE_SECURE : MAX_LINE_PLAIN;\n\n const lines = this.chunkText(text, maxLine);\n for (const line of lines) {\n // Track outgoing for dedup (#420)\n this.recentOutgoing.add(line);\n setTimeout(() => this.recentOutgoing.delete(line), 30_000);\n\n if (isSigned && this.config.identity?.privateKey) {\n const { tag } = signMessage(this.config.identity.privateKey, server!.nick, channel, line);\n client.send(channel, `${line} ${tag}`);\n } else {\n client.send(channel, line);\n }\n }\n return undefined;\n }\n\n chunkResponse(text: string): string[] {\n return this.chunkText(text, MAX_LINE_PLAIN);\n }\n\n private chunkText(text: string, maxLen: number): string[] {\n const result: string[] = [];\n for (const paragraph of text.split(\"\\n\")) {\n if (paragraph.length <= maxLen) {\n if (paragraph.trim()) result.push(paragraph);\n } else {\n let remaining = paragraph;\n while (remaining.length > maxLen) {\n let cut = remaining.lastIndexOf(\" \", maxLen);\n if (cut <= 0) cut = maxLen;\n result.push(remaining.slice(0, cut));\n remaining = remaining.slice(cut).trimStart();\n }\n if (remaining.trim()) result.push(remaining);\n }\n }\n return result;\n }\n\n private recentOutgoing = new Set<string>();\n\n private handlePrivmsg(server: IrcServerConfig, _client: IrcClient, sender: string, target: string, text: string, hostmask: string): void {\n // Self-echo filter \u2014 case-insensitive (#420)\n if (sender.toLowerCase() === server.nick.toLowerCase()) return;\n\n // Content dedup \u2014 catch echoed messages regardless of sender nick (#420)\n if (this.recentOutgoing.has(text)) return;\n\n // [NO_REPLY] filter \u2014 other agent signaled no response needed (#421)\n if (/\\[NO-REPLY\\]/i.test(text)) return;\n\n // Only handle channel messages\n if (!target.startsWith(\"#\")) return;\n\n const channelConfig = server.channels[target];\n if (!channelConfig) {\n logDebug(TAG, `[${server.id}] Ignoring message in unconfigured channel ${target}`);\n return;\n }\n\n if (channelConfig.mode === \"signed\") {\n // Allow specific hostmasks/nicks to bypass signature (humans)\n const allowed = channelConfig.allowUnsigned?.some(pattern =>\n hostmask.startsWith(pattern) || sender === pattern\n );\n if (allowed) {\n logDebug(TAG, `[${server.id}] Unsigned pass for ${hostmask}`);\n } else {\n const pubkey = channelConfig.trustedKeys[sender];\n if (!pubkey) {\n logDebug(TAG, `[${server.id}] Dropped from ${sender} \u2014 no trusted key`);\n return;\n }\n const result = verifyMessage(pubkey, sender, target, text);\n if (!result.valid) {\n logWarn(TAG, `[${server.id}] Signature failed from ${sender}: ${result.reason}`);\n return;\n }\n text = result.text;\n }\n } else {\n // Plain mode: sender allowlist\n if (channelConfig.allowFrom.length > 0 && !channelConfig.allowFrom.includes(sender)) {\n logDebug(TAG, `[${server.id}] Dropped from ${sender} (not in allowFrom)`);\n return;\n }\n }\n\n // Mention gating\n if (channelConfig.requireMention) {\n const nickPattern = new RegExp(`\\\\b${escapeRegex(server.nick)}\\\\b[:,]?`, \"i\");\n if (!nickPattern.test(text)) return;\n text = text.replace(nickPattern, \"\").trim();\n }\n\n if (!text) return;\n\n const channelId = `${server.id}:${target}`;\n const msg: InboundMessage = {\n platform: \"irc\",\n channelId,\n userId: sender,\n senderId: sender,\n senderName: sender,\n text,\n timestamp: Date.now(),\n isGroup: true,\n isVoice: false,\n };\n\n this.deps.onMessage(msg);\n }\n}\n\nfunction escapeRegex(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAEA;AAFA,OAAO,SAAS;AAChB,OAAO,SAAS;AAGhB,IAAM,MAAM;AAoBL,SAAS,gBAAgB,MAAmC;AACjE,MAAI,SAA4B;AAChC,MAAI,iBAAwC;AAC5C,MAAI,iBAAiB;AACrB,MAAI,aAAa;AACjB,MAAI,UAAU;AACd,MAAI,YAAsB,CAAC;AAC3B,MAAI,YAAmC;AACvC,MAAI,SAAS;AACb,MAAI,sBAAsB;AAC1B,QAAM,cAAc;AAEpB,WAAS,UAAgB;AACvB,QAAI,QAAS;AACb,iBAAa;AACb,aAAS;AAET,UAAM,YAAY,MAAY;AAC5B,cAAQ,KAAK,gBAAgB,KAAK,IAAI,IAAI,KAAK,IAAI,EAAE;AACrD,uBAAiB;AACjB,4BAAsB;AACtB,UAAI,QAAQ,KAAK,IAAI,EAAE;AACvB,UAAI,QAAQ,KAAK,IAAI,cAAc;A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OAAO,OAAO;AACjB,kBAAQA,MAAK,IAAI,OAAO,EAAE,2BAA2B,MAAM,KAAK,OAAO,MAAM,EAAE;AAC/E;AAAA,QACF;AACA,eAAO,OAAO;AAAA,MAChB;AAAA,IACF,OAAO;AAEL,UAAI,cAAc,UAAU,SAAS,KAAK,CAAC,cAAc,UAAU,SAAS,MAAM,GAAG;AACnF,iBAASA,MAAK,IAAI,OAAO,EAAE,kBAAkB,MAAM,qBAAqB;AACxE;AAAA,MACF;AAAA,IACF;AAGA,QAAI,cAAc,gBAAgB;AAChC,YAAM,cAAc,IAAI,OAAO,MAAM,YAAY,OAAO,IAAI,CAAC,YAAY,GAAG;AAC5E,UAAI,CAAC,YAAY,KAAK,IAAI,EAAG;AAC7B,aAAO,KAAK,QAAQ,aAAa,EAAE,EAAE,KAAK;AAAA,IAC5C;AAEA,QAAI,CAAC,KAAM;AAEX,UAAM,YAAY,GAAG,OAAO,EAAE,IAAI,MAAM;AACxC,UAAM,MAAsB;AAAA,MAC1B,UAAU;AAAA,MACV;AAAA,MACA,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,MACZ;AAAA,MACA,WAAW,KAAK,IAAI;AAAA,MACpB,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAEA,SAAK,KAAK,UAAU,GAAG;AAAA,EACzB;AACF;AAEA,SAAS,YAAY,GAAmB;AACtC,SAAO,EAAE,QAAQ,uBAAuB,MAAM;AAChD;",
|
|
6
6
|
"names": ["TAG"]
|
|
7
7
|
}
|
|
@@ -1,22 +1,23 @@
|
|
|
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
|
IRC_SCHEMA,
|
|
4
5
|
init_config_validator,
|
|
5
6
|
validateShape
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LYEAHE5V.js";
|
|
7
8
|
import {
|
|
8
9
|
init_log_and_swallow,
|
|
9
10
|
logAndSwallow
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EX2SRTUE.js";
|
|
11
12
|
import {
|
|
12
13
|
init_logger,
|
|
13
14
|
logWarn
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2BY6I4P5.js";
|
|
15
16
|
import {
|
|
16
17
|
abtarsHome,
|
|
17
18
|
init_paths
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-MJ6PHMOK.js";
|
|
20
|
+
import "./chunk-7K2YZTLD.js";
|
|
20
21
|
|
|
21
22
|
// src/platforms/irc/irc-config.ts
|
|
22
23
|
init_paths();
|
|
@@ -85,4 +86,4 @@ function resolveSecret(val) {
|
|
|
85
86
|
export {
|
|
86
87
|
loadIrcConfig
|
|
87
88
|
};
|
|
88
|
-
//# sourceMappingURL=irc-config-
|
|
89
|
+
//# sourceMappingURL=irc-config-6VY67UPQ.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/platforms/irc/irc-config.ts"],
|
|
4
4
|
"sourcesContent": ["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { abtarsHome } from \"../../paths.js\";\nimport { logWarn } from \"../../components/logger.js\";\nimport { logAndSwallow } from \"../../components/log-and-swallow.js\";\nimport { validateShape, IRC_SCHEMA } from \"../../components/config-validator.js\";\n\nconst TAG = \"irc_config\";\n\nexport interface IrcChannelConfig {\n mode: \"plain\" | \"signed\";\n requireMention: boolean;\n allowFrom: string[]; // used in plain mode\n allowUnsigned: string[]; // nicks that bypass signature in signed mode (humans)\n trustedKeys: Record<string, string>; // used in signed mode: nick \u2192 base64 pubkey\n}\n\nexport interface IrcServerConfig {\n id: string;\n host: string;\n port: number;\n tls: boolean;\n nick: string;\n nickservPassword?: string;\n channels: Record<string, IrcChannelConfig>;\n}\n\nexport interface IrcIdentity {\n privateKey: string; // base64 DER Ed25519\n publicKey: string; // base64 DER Ed25519\n}\n\nexport interface IrcConfig {\n identity?: IrcIdentity;\n servers: IrcServerConfig[];\n}\n\nexport function loadIrcConfig(): IrcConfig | null {\n const path = join(abtarsHome(), \"config\", \"irc.json\");\n let raw: string;\n try { raw = readFileSync(path, \"utf-8\"); } catch (err) { logAndSwallow(TAG, \"read irc.json\", err); return null; }\n let parsed: any;\n try { parsed = JSON.parse(raw); } catch (err) {\n logWarn(\"irc-config\", `Invalid JSON in irc.json: ${err instanceof Error ? err.message : String(err)}`);\n return null;\n }\n if (!parsed?.servers?.length) return null;\n validateShape(parsed, IRC_SCHEMA, \"irc.json\");\n\n const identity: IrcIdentity | undefined = parsed.identity ? {\n privateKey: resolveSecret(parsed.identity.privateKey) ?? \"\",\n publicKey: parsed.identity.publicKey ?? \"\",\n } : undefined;\n\n const servers: IrcServerConfig[] = [];\n for (const s of parsed.servers) {\n if (!s.host || !s.nick || !s.channels) {\n logWarn(\"irc\", `Skipping server \"${s.id ?? \"?\"}\" \u2014 missing host/nick/channels`);\n continue;\n }\n const channels: Record<string, IrcChannelConfig> = {};\n for (const [name, cfg] of Object.entries(s.channels as Record<string, any>)) {\n const mode = cfg.mode === \"signed\" ? \"signed\" : \"plain\";\n channels[name] = {\n mode,\n requireMention: cfg.requireMention !== false,\n allowFrom: Array.isArray(cfg.allowFrom) ? cfg.allowFrom : [],\n allowUnsigned: Array.isArray(cfg.allowUnsigned) ? cfg.allowUnsigned : [],\n trustedKeys: (mode === \"signed\" && cfg.trustedKeys && typeof cfg.trustedKeys === \"object\") ? cfg.trustedKeys : {},\n };\n }\n servers.push({\n id: s.id ?? s.host,\n host: s.host,\n port: s.port ?? (s.tls ? 6697 : 6667),\n tls: s.tls ?? false,\n nick: s.nick,\n nickservPassword: resolveSecret(s.nickservPassword),\n channels,\n });\n }\n return servers.length > 0 ? { identity, servers } : null;\n}\n\nfunction resolveSecret(val: string | undefined): string | undefined {\n if (!val) return undefined;\n if (val.startsWith(\"$\")) return process.env[val.slice(1)] ?? undefined;\n return val;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AALA,SAAS,oBAAoB;AAC7B,SAAS,YAAY;AAMrB,IAAM,MAAM;AA8BL,SAAS,gBAAkC;AAChD,QAAM,OAAO,KAAK,WAAW,GAAG,UAAU,UAAU;AACpD,MAAI;AACJ,MAAI;AAAE,UAAM,aAAa,MAAM,OAAO;AAAA,EAAG,SAAS,KAAK;AAAE,kBAAc,KAAK,iBAAiB,GAAG;AAAG,WAAO;AAAA,EAAM;AAChH,MAAI;AACJ,MAAI;AAAE,aAAS,KAAK,MAAM,GAAG;AAAA,EAAG,SAAS,KAAK;AAC5C,YAAQ,cAAc,6BAA6B,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC,EAAE;AACrG,WAAO;AAAA,EACT;AACA,MAAI,CAAC,QAAQ,SAAS,OAAQ,QAAO;AACrC,gBAAc,QAAQ,YAAY,UAAU;AAE5C,QAAM,WAAoC,OAAO,WAAW;AAAA,IAC1D,YAAY,cAAc,OAAO,SAAS,UAAU,KAAK;AAAA,IACzD,WAAW,OAAO,SAAS,aAAa;AAAA,EAC1C,IAAI;AAEJ,QAAM,UAA6B,CAAC;AACpC,aAAW,KAAK,OAAO,SAAS;AAC9B,QAAI,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,EAAE,UAAU;AACrC,cAAQ,OAAO,oBAAoB,EAAE,MAAM,GAAG,qCAAgC;AAC9E;AAAA,IACF;AACA,UAAM,WAA6C,CAAC;AACpD,eAAW,CAAC,MAAM,GAAG,KAAK,OAAO,QAAQ,EAAE,QAA+B,GAAG;AAC3E,YAAM,OAAO,IAAI,SAAS,WAAW,WAAW;AAChD,eAAS,IAAI,IAAI;AAAA,QACf;AAAA,QACA,gBAAgB,IAAI,mBAAmB;AAAA,QACvC,WAAW,MAAM,QAAQ,IAAI,SAAS,IAAI,IAAI,YAAY,CAAC;AAAA,QAC3D,eAAe,MAAM,QAAQ,IAAI,aAAa,IAAI,IAAI,gBAAgB,CAAC;AAAA,QACvE,aAAc,SAAS,YAAY,IAAI,eAAe,OAAO,IAAI,gBAAgB,WAAY,IAAI,cAAc,CAAC;AAAA,MAClH;AAAA,IACF;AACA,YAAQ,KAAK;AAAA,MACX,IAAI,EAAE,MAAM,EAAE;AAAA,MACd,MAAM,EAAE;AAAA,MACR,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO;AAAA,MAChC,KAAK,EAAE,OAAO;AAAA,MACd,MAAM,EAAE;AAAA,MACR,kBAAkB,cAAc,EAAE,gBAAgB;AAAA,MAClD;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO,QAAQ,SAAS,IAAI,EAAE,UAAU,QAAQ,IAAI;AACtD;AAEA,SAAS,cAAc,KAA6C;AAClE,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI,IAAI,WAAW,GAAG,EAAG,QAAO,QAAQ,IAAI,IAAI,MAAM,CAAC,CAAC,KAAK;AAC7D,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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/logs.ts
|
|
5
6
|
import { spawn } from "node:child_process";
|
|
@@ -16,4 +17,4 @@ async function logs() {
|
|
|
16
17
|
export {
|
|
17
18
|
logs
|
|
18
19
|
};
|
|
19
|
-
//# sourceMappingURL=logs-
|
|
20
|
+
//# sourceMappingURL=logs-EK4HYRKR.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli/commands/logs.ts"],
|
|
4
4
|
"sourcesContent": ["import { spawn } 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\nexport async function logs(): Promise<number> {\n const date = new Date().toISOString().slice(0, 10);\n const logFile = join(abtarsHome(), \"logs\", `bridge-${date}.log`);\n const child = spawn(\"tail\", [\"-f\", \"-n\", \"50\", logFile], { stdio: \"inherit\" });\n return new Promise((resolve) => child.on(\"close\", (code) => resolve(code ?? 0)));\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;AAAA,SAAS,aAAa;AACtB,SAAS,YAAY;AAErB,SAAS,aAAqB;AAC5B,SAAO,QAAQ,IAAI,aAAa,KAAK,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,SAAS;AAChF;AAEA,eAAsB,OAAwB;AAC5C,QAAM,QAAO,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AACjD,QAAM,UAAU,KAAK,WAAW,GAAG,QAAQ,UAAU,IAAI,MAAM;AAC/D,QAAM,QAAQ,MAAM,QAAQ,CAAC,MAAM,MAAM,MAAM,OAAO,GAAG,EAAE,OAAO,UAAU,CAAC;AAC7E,SAAO,IAAI,QAAQ,CAAC,YAAY,MAAM,GAAG,SAAS,CAAC,SAAS,QAAQ,QAAQ,CAAC,CAAC,CAAC;AACjF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,21 +1,22 @@
|
|
|
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
|
require_ieee754
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XETTJVEU.js";
|
|
5
6
|
import {
|
|
6
7
|
init_logger,
|
|
7
8
|
logInfo,
|
|
8
9
|
logWarn
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2BY6I4P5.js";
|
|
10
11
|
import {
|
|
11
12
|
abtarsHome,
|
|
12
13
|
init_paths
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MJ6PHMOK.js";
|
|
14
15
|
import {
|
|
15
16
|
__commonJS,
|
|
16
17
|
__require,
|
|
17
18
|
__toESM
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7K2YZTLD.js";
|
|
19
20
|
|
|
20
21
|
// node_modules/ms/index.js
|
|
21
22
|
var require_ms = __commonJS({
|
|
@@ -4585,7 +4586,7 @@ async function saveInboundMedia(buffer, chatId, opts) {
|
|
|
4585
4586
|
return { path, mime, ext, size: finalBuffer.length, isImage };
|
|
4586
4587
|
}
|
|
4587
4588
|
async function resizeImage(buffer, mime) {
|
|
4588
|
-
const { Jimp } = await import("./esm-
|
|
4589
|
+
const { Jimp } = await import("./esm-PFOJARXA.js");
|
|
4589
4590
|
const img = await Jimp.read(buffer);
|
|
4590
4591
|
const maxBytes = IMAGE_MAX_BASE64_MB * 1024 * 1024;
|
|
4591
4592
|
let w = img.width;
|
|
@@ -4659,4 +4660,4 @@ export {
|
|
|
4659
4660
|
saveA2AFile,
|
|
4660
4661
|
saveInboundMedia
|
|
4661
4662
|
};
|
|
4662
|
-
//# sourceMappingURL=media-utils-
|
|
4663
|
+
//# sourceMappingURL=media-utils-QBY5WBF3.js.map
|