abtars 0.3.4-alpha.7 → 0.3.4
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/bundle/{_registry.generated-WGR4WOPT.js → _registry.generated-AVR7DK2A.js} +17 -14
- package/bundle/{_registry.generated-WGR4WOPT.js.map → _registry.generated-AVR7DK2A.js.map} +1 -1
- package/bundle/{abmind-lazy-7Z44NODV.js → abmind-lazy-E3YCFKQ5.js} +15 -5
- package/bundle/abtars-browser.js +4 -4
- package/bundle/abtars-cli.js +23 -13
- package/bundle/abtars-cli.js.map +2 -2
- package/bundle/abtars-restart.js +3 -3
- package/bundle/abtars-task.js +3 -3
- package/bundle/abtars-task.js.map +2 -2
- package/bundle/abtars.js +610 -455
- package/bundle/abtars.js.map +4 -4
- package/bundle/{acp-raw-client-E6FM45NC.js → acp-raw-client-UCNK3OTU.js} +2 -2
- package/bundle/{action-gate-G2V47NHW.js → action-gate-V4FCBHFB.js} +2 -2
- package/bundle/{agent-api-adapter-YAHKQMMZ.js → agent-api-adapter-7HEPYSIN.js} +3 -3
- package/bundle/{agent-api-rate-limit-WCFXJMGY.js → agent-api-rate-limit-RZSAM3SW.js} +4 -4
- package/bundle/{agent-registry-GI6CLT3Z.js → agent-registry-46A2R5KP.js} +7 -7
- package/bundle/{bootstrap-X2QYIZIJ.js → bootstrap-MIHJJSWU.js} +2 -2
- package/bundle/{bridge-lock-transport-4ZH7QTJP.js → bridge-lock-transport-7RSN7OLJ.js} +4 -4
- package/bundle/{browser-DMARZJIN.js → browser-F6BCWJWW.js} +6 -6
- package/bundle/{budget-45QOBDWA.js → budget-WUM3SPKW.js} +3 -3
- package/bundle/{capability-JFWX3IQF.js → capability-QVRKGRFC.js} +5 -5
- package/bundle/{chunk-YSKCQH6E.js → chunk-2IYJ4I66.js} +2 -2
- package/bundle/{chunk-KTYGKPYM.js → chunk-2NLUT5S2.js} +6 -6
- package/bundle/chunk-3BG3AIDP.js +191 -0
- package/bundle/chunk-3BG3AIDP.js.map +7 -0
- package/bundle/{chunk-OKAQICWY.js → chunk-3GQX34S2.js} +3 -3
- package/bundle/{chunk-QROWBWLL.js → chunk-3XZ773BS.js} +2 -2
- package/bundle/{chunk-DYBW4XXL.js → chunk-467SRLLR.js} +2 -2
- package/bundle/{chunk-LGP6TYFI.js → chunk-4AILRHUI.js} +97 -8
- package/bundle/chunk-4AILRHUI.js.map +7 -0
- package/bundle/{chunk-GPZNXY2U.js → chunk-4S3H4OK7.js} +4 -4
- package/bundle/{chunk-NDCRWEEJ.js → chunk-4Y5MJQRE.js} +6 -6
- package/bundle/{chunk-FRKW6LWB.js → chunk-55UWKI5C.js} +3 -3
- package/bundle/{chunk-4UL3KINB.js → chunk-5PNJFDSW.js} +8 -8
- package/bundle/{chunk-LUNA6PM5.js → chunk-5RVOEFGT.js} +4 -2
- package/bundle/{chunk-LUNA6PM5.js.map → chunk-5RVOEFGT.js.map} +2 -2
- package/bundle/{chunk-OXTSWQCX.js → chunk-5Y3FJ2Y7.js} +2 -2
- package/bundle/{chunk-TMUYFERL.js → chunk-6B5ZFUPD.js} +2 -2
- package/bundle/{chunk-65VCEC32.js → chunk-6PA5JBUU.js} +2 -2
- package/bundle/chunk-BNXV7SZI.js +195 -0
- package/bundle/chunk-BNXV7SZI.js.map +7 -0
- package/bundle/{chunk-AFREM7FX.js → chunk-CK7YTA2F.js} +2 -2
- package/bundle/{chunk-NRUSRJXR.js → chunk-DZJ5QZFD.js} +2 -2
- package/bundle/{chunk-YRSMGJFP.js → chunk-E67KESEG.js} +2 -2
- package/bundle/{chunk-ZV4IWKDJ.js → chunk-E7XD5UGB.js} +3 -3
- package/bundle/{chunk-GXL7HJPT.js → chunk-EAX5ZZUL.js} +63 -39
- package/bundle/chunk-EAX5ZZUL.js.map +7 -0
- package/bundle/{chunk-PEDX56EL.js → chunk-EFGBM555.js} +2 -2
- package/bundle/{chunk-EQSG2CRM.js → chunk-FGYDIX54.js} +22 -15
- package/bundle/chunk-FGYDIX54.js.map +7 -0
- package/bundle/{chunk-XWRADSXO.js → chunk-GF6NVNA7.js} +15 -5
- package/bundle/chunk-GF6NVNA7.js.map +7 -0
- package/bundle/{chunk-SIFPBTI4.js → chunk-HGSHCQ5F.js} +113 -73
- package/bundle/chunk-HGSHCQ5F.js.map +7 -0
- package/bundle/{chunk-YRU2K3O6.js → chunk-IMIGG5EO.js} +39 -39
- package/bundle/chunk-IMIGG5EO.js.map +7 -0
- package/bundle/{chunk-W4EA4GCA.js → chunk-ITOFPJAV.js} +43 -31
- package/bundle/chunk-ITOFPJAV.js.map +7 -0
- package/bundle/{chunk-UPRZDU6T.js → chunk-IY6UKLPS.js} +3 -3
- package/bundle/{chunk-EUZDKV3C.js → chunk-J4RUFAPK.js} +3 -3
- package/bundle/{chunk-HZDLFLRP.js → chunk-J7DRPVMU.js} +35 -5
- package/bundle/chunk-J7DRPVMU.js.map +7 -0
- package/bundle/{chunk-EGL6UMAO.js → chunk-JG4BKXBN.js} +7 -1
- package/bundle/chunk-JG4BKXBN.js.map +7 -0
- package/bundle/{chunk-5B5B6EHL.js → chunk-JLWYPGWI.js} +5 -5
- package/bundle/{chunk-5QUTMUIK.js → chunk-JXYWDAHD.js} +12 -12
- package/bundle/{chunk-GRVWZO4C.js → chunk-KOSFXW2S.js} +24 -3
- package/bundle/{chunk-GRVWZO4C.js.map → chunk-KOSFXW2S.js.map} +1 -1
- package/bundle/{chunk-ONBF5DDU.js → chunk-L72RIPEC.js} +248 -182
- package/bundle/chunk-L72RIPEC.js.map +7 -0
- package/bundle/{chunk-TEFZ4JA4.js → chunk-NHPLD3C7.js} +2 -2
- package/bundle/{chunk-2KC5G3EA.js → chunk-OWUO5RS3.js} +5 -5
- package/bundle/{chunk-4MULJ5SS.js → chunk-OY4Q6AMY.js} +71 -49
- package/bundle/chunk-OY4Q6AMY.js.map +7 -0
- package/bundle/{chunk-WBTJ2E62.js → chunk-P3NODAHF.js} +2 -5
- package/bundle/{chunk-WBTJ2E62.js.map → chunk-P3NODAHF.js.map} +2 -2
- package/bundle/{chunk-BROFMHC2.js → chunk-PB5GF4FG.js} +334 -237
- package/bundle/chunk-PB5GF4FG.js.map +7 -0
- package/bundle/{chunk-WYHGNI56.js → chunk-PMD5BLFS.js} +6 -6
- package/bundle/{chunk-URQPDCK5.js → chunk-Q66LQMMZ.js} +3 -3
- package/bundle/{chunk-HKRSMUXJ.js → chunk-SC2Y5NR2.js} +71 -132
- package/bundle/chunk-SC2Y5NR2.js.map +7 -0
- package/bundle/chunk-SFL4EPCZ.js +555 -0
- package/bundle/chunk-SFL4EPCZ.js.map +7 -0
- package/bundle/{chunk-LDUOOKQY.js → chunk-SJPUNDZ3.js} +5 -5
- package/bundle/{chunk-LDUOOKQY.js.map → chunk-SJPUNDZ3.js.map} +1 -1
- package/bundle/{chunk-JQDJPUHM.js → chunk-TWB2ZGVH.js} +2 -2
- package/bundle/{chunk-IJT4KWXT.js → chunk-U4U47YE7.js} +2 -2
- package/bundle/{chunk-2FAZIA37.js → chunk-W546CU3A.js} +3 -3
- package/bundle/chunk-WC5O5KOE.js +211 -0
- package/bundle/chunk-WC5O5KOE.js.map +7 -0
- package/bundle/{chunk-JNIHEDKF.js → chunk-XPWYDNWL.js} +2 -2
- package/bundle/{chunk-GWILHZPT.js → chunk-XRTXYN66.js} +10 -7
- package/bundle/{chunk-GWILHZPT.js.map → chunk-XRTXYN66.js.map} +2 -2
- package/bundle/{chunk-EFJVUJBE.js → chunk-Y5FEFKGM.js} +6 -6
- package/bundle/chunk-YJZE4OK3.js +169 -0
- package/bundle/chunk-YJZE4OK3.js.map +7 -0
- package/bundle/{chunk-GVM5YU5I.js → chunk-Z4FZPB42.js} +2 -2
- package/bundle/{chunk-7BSQ5UQO.js → chunk-ZSIDQ66D.js} +3 -3
- package/bundle/{chunk-XX6BGTPO.js → chunk-ZZZCJJEO.js} +4 -4
- package/bundle/{commands-XYEGVUZF.js → commands-2ZW6CMLC.js} +17 -16
- package/bundle/{config-M3P5IOAI.js → config-YMY5YHKN.js} +6 -6
- package/bundle/{context-2RJHC2LE.js → context-CL2RSLII.js} +7 -5
- package/bundle/context-CL2RSLII.js.map +7 -0
- package/bundle/{daemon-TB23FFWY.js → daemon-D7SU63OY.js} +3 -3
- package/bundle/{delegation-tools-QKNYQGTQ.js → delegation-tools-WS7Z56KZ.js} +12 -12
- package/bundle/{deploy-EPDWNHJU.js → deploy-AMTVKIMU.js} +2 -2
- package/bundle/{deps-WVK553KF.js → deps-T63AVJKJ.js} +3 -3
- package/bundle/{direct-api-transport-E3LNDBJT.js → direct-api-transport-QNNY2WWP.js} +56 -33
- package/bundle/direct-api-transport-QNNY2WWP.js.map +7 -0
- package/bundle/{discord-adapter-IT3KP3VB.js → discord-adapter-ABAD56Y2.js} +21 -20
- package/bundle/{discord-adapter-IT3KP3VB.js.map → discord-adapter-ABAD56Y2.js.map} +1 -1
- package/bundle/{dns-wakeup-IDOJIXBX.js → dns-wakeup-V3LEFXPE.js} +9 -33
- package/bundle/dns-wakeup-V3LEFXPE.js.map +7 -0
- package/bundle/{doctor-probes-B54JFIW3.js → doctor-probes-O6YI6XSZ.js} +6 -2
- package/bundle/{env-schema-4JXQUOH4.js → env-schema-B5RB32DC.js} +3 -3
- package/bundle/{gossip-3C3BSNPN.js → gossip-SKRCPOBS.js} +9 -5
- package/bundle/{guardrails-DL7ZSWVN.js → guardrails-64GQ5Y5K.js} +4 -4
- package/bundle/{heartbeat-system-MVTRS4GP.js → heartbeat-system-X4MUTKJD.js} +6 -6
- package/bundle/{heartbeat-tier3-ABWL3P7M.js → heartbeat-tier3-2PTPWEQQ.js} +53 -76
- package/bundle/heartbeat-tier3-2PTPWEQQ.js.map +7 -0
- package/bundle/{hook-system-M3POLUIB.js → hook-system-YB635OC4.js} +3 -3
- package/bundle/{hotskills-FWX4QI7V.js → hotskills-Q75D2DK3.js} +5 -5
- package/bundle/{install-OS3CU7NF.js → install-RFKKFSGS.js} +17 -30
- package/bundle/install-RFKKFSGS.js.map +7 -0
- package/bundle/{install-manifest-5PPWMD2W.js → install-manifest-J7ICPCJN.js} +2 -2
- package/bundle/{irc-adapter-PTTZD32W.js → irc-adapter-TVEV4R6H.js} +3 -3
- package/bundle/{irc-config-CP7ZMUOX.js → irc-config-M676FOFI.js} +4 -4
- package/bundle/{kanban-board-M326B2XJ.js → kanban-board-DLEJUCNN.js} +9 -7
- package/bundle/{kanban-channel-IJ52OMNA.js → kanban-channel-XOLUHJZJ.js} +6 -6
- package/bundle/kanban-delivery-C4QPBNPX.js +45 -0
- package/bundle/kanban-delivery-C4QPBNPX.js.map +7 -0
- package/bundle/{lazy-require-KCRVT4SI.js → lazy-require-JKQSALXN.js} +3 -3
- package/bundle/{logger-OWCSNYCA.js → logger-3EGHBD4R.js} +2 -2
- package/bundle/{main-chat-ZNUZCTNS.js → main-chat-3H63REKK.js} +4 -4
- package/bundle/{master-user-HSKM4ZFN.js → master-user-MUBUP3KD.js} +5 -5
- package/bundle/{media-utils-3ZYOD7SK.js → media-utils-HUUIALAJ.js} +3 -3
- package/bundle/{message-pipeline-P5GAQU4Z.js → message-pipeline-GRDRWONR.js} +17 -16
- package/bundle/meta.json +3699 -3138
- package/bundle/{metrics-collector-L3VPEHII.js → metrics-collector-YMUGY3PI.js} +31 -2
- package/bundle/metrics-collector-YMUGY3PI.js.map +7 -0
- package/bundle/{model-health-registry-MLEIZSTV.js → model-health-registry-QADMFQFQ.js} +2 -2
- package/bundle/{nerve-IGSXBKZZ.js → nerve-QPAEBRKX.js} +3 -3
- package/bundle/{notification-BFSIEECG.js → notification-3JICGXWU.js} +6 -6
- package/bundle/{openrouter-credits-NTVZDRYM.js → openrouter-credits-7NEIPYJN.js} +3 -3
- package/bundle/{orc-tools-4CHEFWSN.js → orc-tools-UZVPONKY.js} +5 -3
- package/bundle/{peer-auth-QC4EF2PM.js → peer-auth-RI43DKJE.js} +24 -15
- package/bundle/{peer-client-RGEU5HOK.js → peer-client-UITTMWJ2.js} +34 -29
- package/bundle/peer-client-UITTMWJ2.js.map +7 -0
- package/bundle/{peer-config-TN55LFDC.js → peer-config-URM7DCW6.js} +9 -4
- package/bundle/{peer-transport-I6JPLFZ2.js → peer-transport-SI7I72DB.js} +12 -10
- package/bundle/{phase-transport-PGKU2KD4.js → phase-transport-ESWWACZI.js} +17 -17
- package/bundle/{reconcile-CTFCLQRN.js → reconcile-GFDQYNBD.js} +3 -3
- package/bundle/{reconciler-EBKH3JNU.js → reconciler-IEUJXJN2.js} +12 -12
- package/bundle/{restore-IFHPI7I7.js → restore-FARTGLQQ.js} +3 -3
- package/bundle/{rollback-ANRI3T5Z.js → rollback-GEWPZABG.js} +2 -2
- package/bundle/{sandbox-runtime-QROWHDCS.js → sandbox-runtime-DV6E25J6.js} +2 -2
- package/bundle/{self-healer-utils-IFAYOQO2.js → self-healer-utils-P4SKNNEM.js} +3 -3
- package/bundle/{sha-tracker-ZWBP6CIJ.js → sha-tracker-77SHLYNY.js} +3 -3
- package/bundle/{skill-session-BMSRQSHV.js → skill-session-5HSMXY54.js} +3 -3
- package/bundle/{skill-stats-JORH5DGM.js → skill-stats-MI3RSWWL.js} +4 -4
- package/bundle/{skill-watcher-E4MGLKLS.js → skill-watcher-5L7JE6TN.js} +4 -4
- package/bundle/{sleep-36XS6MHJ.js → sleep-I4JFASCY.js} +11 -8
- package/bundle/{soul-bundle-VWAVHCZ6.js → soul-bundle-522C3IRH.js} +9 -8
- package/bundle/{spin-TI3TSVVT.js → spin-VHNGNWTD.js} +11 -11
- package/bundle/{spin-notifications-SE2HVZI7.js → spin-notifications-7NC5XZEM.js} +5 -5
- package/bundle/{spin-types-BLPYAETA.js → spin-types-C5KOQOPD.js} +7 -3
- package/bundle/{sse-parser-anthropic-A6R4Z2TB.js → sse-parser-anthropic-MMTVWHLI.js} +3 -3
- package/bundle/{sse-parser-responses-HSZY3QGJ.js → sse-parser-responses-3AOFN64C.js} +3 -3
- package/bundle/{ssrf-guard-O6SHIK6Q.js → ssrf-guard-U2JA72TC.js} +3 -3
- package/bundle/{start-7QZIWO3S.js → start-H5IUFAWF.js} +4 -2
- package/bundle/{start-7QZIWO3S.js.map → start-H5IUFAWF.js.map} +2 -2
- package/bundle/{stt-LGVPXMVR.js → stt-PSOPPBV4.js} +4 -4
- package/bundle/{system-status-JZU5FO7B.js → system-status-4LYGOFNO.js} +38 -24
- package/bundle/system-status-4LYGOFNO.js.map +7 -0
- package/bundle/{task-store-W5BFIAIH.js → task-store-MNCW42BW.js} +4 -4
- package/bundle/{telegram-adapter-H6PMFPMB.js → telegram-adapter-O6KIZDY6.js} +69 -46
- package/bundle/telegram-adapter-O6KIZDY6.js.map +7 -0
- package/bundle/{tool-registry-IZX2IOBM.js → tool-registry-JJMWCQKZ.js} +26 -24
- package/bundle/{tool-sandbox-4UC6GAKA.js → tool-sandbox-CNL6V6IH.js} +4 -4
- package/bundle/{transport-config-KBF5W2DP.js → transport-config-6MB2K2XC.js} +7 -7
- package/bundle/tribe-GDTFYJTK.js +111 -0
- package/bundle/tribe-GDTFYJTK.js.map +7 -0
- package/bundle/{update-MESYO4LO.js → update-HGQAOC5L.js} +3 -3
- package/bundle/{usage-tracker-NXD364VX.js → usage-tracker-SR4BI6ZT.js} +2 -2
- package/bundle/{user-registry-35BW4XKM.js → user-registry-4PACZJIJ.js} +4 -4
- package/bundle/wire-platform-KKPWNNNQ.js +88 -0
- package/bundle/wire-platform-KKPWNNNQ.js.map +7 -0
- package/bundle/ws-peer-client-U3NNPOK7.js +370 -0
- package/bundle/ws-peer-client-U3NNPOK7.js.map +7 -0
- package/package.json +1 -1
- package/scripts/abtars-watchdog.service +2 -1
- package/scripts/abtars-watchdog.sh +1 -5
- package/scripts/emergency-deploy.sh +2 -2
- package/scripts/emergency-update.sh +88 -41
- package/bundle/chunk-3AAENI2K.js +0 -210
- package/bundle/chunk-3AAENI2K.js.map +0 -7
- package/bundle/chunk-4MULJ5SS.js.map +0 -7
- package/bundle/chunk-4S554KLW.js +0 -105
- package/bundle/chunk-4S554KLW.js.map +0 -7
- package/bundle/chunk-5GCLBUBS.js +0 -257
- package/bundle/chunk-5GCLBUBS.js.map +0 -7
- package/bundle/chunk-BROFMHC2.js.map +0 -7
- package/bundle/chunk-EGL6UMAO.js.map +0 -7
- package/bundle/chunk-EQSG2CRM.js.map +0 -7
- package/bundle/chunk-GXL7HJPT.js.map +0 -7
- package/bundle/chunk-HKRSMUXJ.js.map +0 -7
- package/bundle/chunk-HT2BPTZY.js +0 -241
- package/bundle/chunk-HT2BPTZY.js.map +0 -7
- package/bundle/chunk-HZDLFLRP.js.map +0 -7
- package/bundle/chunk-IKUZPMVA.js +0 -82
- package/bundle/chunk-IKUZPMVA.js.map +0 -7
- package/bundle/chunk-LGP6TYFI.js.map +0 -7
- package/bundle/chunk-ONBF5DDU.js.map +0 -7
- package/bundle/chunk-RWRRGE4U.js +0 -72
- package/bundle/chunk-RWRRGE4U.js.map +0 -7
- package/bundle/chunk-SIFPBTI4.js.map +0 -7
- package/bundle/chunk-VUIX5AGB.js +0 -65
- package/bundle/chunk-VUIX5AGB.js.map +0 -7
- package/bundle/chunk-W4EA4GCA.js.map +0 -7
- package/bundle/chunk-XWRADSXO.js.map +0 -7
- package/bundle/chunk-Y76VUJSF.js +0 -75
- package/bundle/chunk-Y76VUJSF.js.map +0 -7
- package/bundle/chunk-YRU2K3O6.js.map +0 -7
- package/bundle/context-2RJHC2LE.js.map +0 -7
- package/bundle/direct-api-transport-E3LNDBJT.js.map +0 -7
- package/bundle/dns-wakeup-IDOJIXBX.js.map +0 -7
- package/bundle/heartbeat-tier3-ABWL3P7M.js.map +0 -7
- package/bundle/install-OS3CU7NF.js.map +0 -7
- package/bundle/metrics-collector-L3VPEHII.js.map +0 -7
- package/bundle/peer-client-RGEU5HOK.js.map +0 -7
- package/bundle/peer-jwt-NCCPXJRX.js +0 -18
- package/bundle/public/css/dashboard.css +0 -542
- package/bundle/public/index.html +0 -180
- package/bundle/public/js/app.js +0 -437
- package/bundle/public/memory-universe.js +0 -384
- package/bundle/stream-single-RFJNUTL6.js +0 -34
- package/bundle/stream-single-RFJNUTL6.js.map +0 -7
- package/bundle/subagent-runtime-5QUVES3W.js +0 -14
- package/bundle/system-status-JZU5FO7B.js.map +0 -7
- package/bundle/telegram-adapter-H6PMFPMB.js.map +0 -7
- package/bundle/usage-tracker-NXD364VX.js.map +0 -7
- package/bundle/user-registry-35BW4XKM.js.map +0 -7
- package/bundle/ws-peer-client-AIXCXF7V.js +0 -173
- package/bundle/ws-peer-client-AIXCXF7V.js.map +0 -7
- /package/bundle/{abmind-lazy-7Z44NODV.js.map → abmind-lazy-E3YCFKQ5.js.map} +0 -0
- /package/bundle/{acp-raw-client-E6FM45NC.js.map → acp-raw-client-UCNK3OTU.js.map} +0 -0
- /package/bundle/{action-gate-G2V47NHW.js.map → action-gate-V4FCBHFB.js.map} +0 -0
- /package/bundle/{agent-api-adapter-YAHKQMMZ.js.map → agent-api-adapter-7HEPYSIN.js.map} +0 -0
- /package/bundle/{agent-api-rate-limit-WCFXJMGY.js.map → agent-api-rate-limit-RZSAM3SW.js.map} +0 -0
- /package/bundle/{agent-registry-GI6CLT3Z.js.map → agent-registry-46A2R5KP.js.map} +0 -0
- /package/bundle/{bootstrap-X2QYIZIJ.js.map → bootstrap-MIHJJSWU.js.map} +0 -0
- /package/bundle/{bridge-lock-transport-4ZH7QTJP.js.map → bridge-lock-transport-7RSN7OLJ.js.map} +0 -0
- /package/bundle/{browser-DMARZJIN.js.map → browser-F6BCWJWW.js.map} +0 -0
- /package/bundle/{budget-45QOBDWA.js.map → budget-WUM3SPKW.js.map} +0 -0
- /package/bundle/{capability-JFWX3IQF.js.map → capability-QVRKGRFC.js.map} +0 -0
- /package/bundle/{chunk-YSKCQH6E.js.map → chunk-2IYJ4I66.js.map} +0 -0
- /package/bundle/{chunk-KTYGKPYM.js.map → chunk-2NLUT5S2.js.map} +0 -0
- /package/bundle/{chunk-OKAQICWY.js.map → chunk-3GQX34S2.js.map} +0 -0
- /package/bundle/{chunk-QROWBWLL.js.map → chunk-3XZ773BS.js.map} +0 -0
- /package/bundle/{chunk-DYBW4XXL.js.map → chunk-467SRLLR.js.map} +0 -0
- /package/bundle/{chunk-GPZNXY2U.js.map → chunk-4S3H4OK7.js.map} +0 -0
- /package/bundle/{chunk-NDCRWEEJ.js.map → chunk-4Y5MJQRE.js.map} +0 -0
- /package/bundle/{chunk-FRKW6LWB.js.map → chunk-55UWKI5C.js.map} +0 -0
- /package/bundle/{chunk-4UL3KINB.js.map → chunk-5PNJFDSW.js.map} +0 -0
- /package/bundle/{chunk-OXTSWQCX.js.map → chunk-5Y3FJ2Y7.js.map} +0 -0
- /package/bundle/{chunk-TMUYFERL.js.map → chunk-6B5ZFUPD.js.map} +0 -0
- /package/bundle/{chunk-65VCEC32.js.map → chunk-6PA5JBUU.js.map} +0 -0
- /package/bundle/{chunk-AFREM7FX.js.map → chunk-CK7YTA2F.js.map} +0 -0
- /package/bundle/{chunk-NRUSRJXR.js.map → chunk-DZJ5QZFD.js.map} +0 -0
- /package/bundle/{chunk-YRSMGJFP.js.map → chunk-E67KESEG.js.map} +0 -0
- /package/bundle/{chunk-ZV4IWKDJ.js.map → chunk-E7XD5UGB.js.map} +0 -0
- /package/bundle/{chunk-PEDX56EL.js.map → chunk-EFGBM555.js.map} +0 -0
- /package/bundle/{chunk-UPRZDU6T.js.map → chunk-IY6UKLPS.js.map} +0 -0
- /package/bundle/{chunk-EUZDKV3C.js.map → chunk-J4RUFAPK.js.map} +0 -0
- /package/bundle/{chunk-5B5B6EHL.js.map → chunk-JLWYPGWI.js.map} +0 -0
- /package/bundle/{chunk-5QUTMUIK.js.map → chunk-JXYWDAHD.js.map} +0 -0
- /package/bundle/{chunk-TEFZ4JA4.js.map → chunk-NHPLD3C7.js.map} +0 -0
- /package/bundle/{chunk-2KC5G3EA.js.map → chunk-OWUO5RS3.js.map} +0 -0
- /package/bundle/{chunk-WYHGNI56.js.map → chunk-PMD5BLFS.js.map} +0 -0
- /package/bundle/{chunk-URQPDCK5.js.map → chunk-Q66LQMMZ.js.map} +0 -0
- /package/bundle/{chunk-JQDJPUHM.js.map → chunk-TWB2ZGVH.js.map} +0 -0
- /package/bundle/{chunk-IJT4KWXT.js.map → chunk-U4U47YE7.js.map} +0 -0
- /package/bundle/{chunk-2FAZIA37.js.map → chunk-W546CU3A.js.map} +0 -0
- /package/bundle/{chunk-JNIHEDKF.js.map → chunk-XPWYDNWL.js.map} +0 -0
- /package/bundle/{chunk-EFJVUJBE.js.map → chunk-Y5FEFKGM.js.map} +0 -0
- /package/bundle/{chunk-GVM5YU5I.js.map → chunk-Z4FZPB42.js.map} +0 -0
- /package/bundle/{chunk-7BSQ5UQO.js.map → chunk-ZSIDQ66D.js.map} +0 -0
- /package/bundle/{chunk-XX6BGTPO.js.map → chunk-ZZZCJJEO.js.map} +0 -0
- /package/bundle/{commands-XYEGVUZF.js.map → commands-2ZW6CMLC.js.map} +0 -0
- /package/bundle/{config-M3P5IOAI.js.map → config-YMY5YHKN.js.map} +0 -0
- /package/bundle/{daemon-TB23FFWY.js.map → daemon-D7SU63OY.js.map} +0 -0
- /package/bundle/{delegation-tools-QKNYQGTQ.js.map → delegation-tools-WS7Z56KZ.js.map} +0 -0
- /package/bundle/{deploy-EPDWNHJU.js.map → deploy-AMTVKIMU.js.map} +0 -0
- /package/bundle/{deps-WVK553KF.js.map → deps-T63AVJKJ.js.map} +0 -0
- /package/bundle/{doctor-probes-B54JFIW3.js.map → doctor-probes-O6YI6XSZ.js.map} +0 -0
- /package/bundle/{env-schema-4JXQUOH4.js.map → env-schema-B5RB32DC.js.map} +0 -0
- /package/bundle/{gossip-3C3BSNPN.js.map → gossip-SKRCPOBS.js.map} +0 -0
- /package/bundle/{guardrails-DL7ZSWVN.js.map → guardrails-64GQ5Y5K.js.map} +0 -0
- /package/bundle/{heartbeat-system-MVTRS4GP.js.map → heartbeat-system-X4MUTKJD.js.map} +0 -0
- /package/bundle/{hook-system-M3POLUIB.js.map → hook-system-YB635OC4.js.map} +0 -0
- /package/bundle/{hotskills-FWX4QI7V.js.map → hotskills-Q75D2DK3.js.map} +0 -0
- /package/bundle/{install-manifest-5PPWMD2W.js.map → install-manifest-J7ICPCJN.js.map} +0 -0
- /package/bundle/{irc-adapter-PTTZD32W.js.map → irc-adapter-TVEV4R6H.js.map} +0 -0
- /package/bundle/{irc-config-CP7ZMUOX.js.map → irc-config-M676FOFI.js.map} +0 -0
- /package/bundle/{kanban-board-M326B2XJ.js.map → kanban-board-DLEJUCNN.js.map} +0 -0
- /package/bundle/{kanban-channel-IJ52OMNA.js.map → kanban-channel-XOLUHJZJ.js.map} +0 -0
- /package/bundle/{lazy-require-KCRVT4SI.js.map → lazy-require-JKQSALXN.js.map} +0 -0
- /package/bundle/{logger-OWCSNYCA.js.map → logger-3EGHBD4R.js.map} +0 -0
- /package/bundle/{main-chat-ZNUZCTNS.js.map → main-chat-3H63REKK.js.map} +0 -0
- /package/bundle/{master-user-HSKM4ZFN.js.map → master-user-MUBUP3KD.js.map} +0 -0
- /package/bundle/{media-utils-3ZYOD7SK.js.map → media-utils-HUUIALAJ.js.map} +0 -0
- /package/bundle/{message-pipeline-P5GAQU4Z.js.map → message-pipeline-GRDRWONR.js.map} +0 -0
- /package/bundle/{model-health-registry-MLEIZSTV.js.map → model-health-registry-QADMFQFQ.js.map} +0 -0
- /package/bundle/{nerve-IGSXBKZZ.js.map → nerve-QPAEBRKX.js.map} +0 -0
- /package/bundle/{notification-BFSIEECG.js.map → notification-3JICGXWU.js.map} +0 -0
- /package/bundle/{openrouter-credits-NTVZDRYM.js.map → openrouter-credits-7NEIPYJN.js.map} +0 -0
- /package/bundle/{orc-tools-4CHEFWSN.js.map → orc-tools-UZVPONKY.js.map} +0 -0
- /package/bundle/{peer-auth-QC4EF2PM.js.map → peer-auth-RI43DKJE.js.map} +0 -0
- /package/bundle/{peer-config-TN55LFDC.js.map → peer-config-URM7DCW6.js.map} +0 -0
- /package/bundle/{peer-jwt-NCCPXJRX.js.map → peer-transport-SI7I72DB.js.map} +0 -0
- /package/bundle/{peer-transport-I6JPLFZ2.js.map → phase-transport-ESWWACZI.js.map} +0 -0
- /package/bundle/{phase-transport-PGKU2KD4.js.map → reconcile-GFDQYNBD.js.map} +0 -0
- /package/bundle/{reconciler-EBKH3JNU.js.map → reconciler-IEUJXJN2.js.map} +0 -0
- /package/bundle/{restore-IFHPI7I7.js.map → restore-FARTGLQQ.js.map} +0 -0
- /package/bundle/{reconcile-CTFCLQRN.js.map → rollback-GEWPZABG.js.map} +0 -0
- /package/bundle/{sandbox-runtime-QROWHDCS.js.map → sandbox-runtime-DV6E25J6.js.map} +0 -0
- /package/bundle/{self-healer-utils-IFAYOQO2.js.map → self-healer-utils-P4SKNNEM.js.map} +0 -0
- /package/bundle/{rollback-ANRI3T5Z.js.map → sha-tracker-77SHLYNY.js.map} +0 -0
- /package/bundle/{skill-session-BMSRQSHV.js.map → skill-session-5HSMXY54.js.map} +0 -0
- /package/bundle/{sha-tracker-ZWBP6CIJ.js.map → skill-stats-MI3RSWWL.js.map} +0 -0
- /package/bundle/{skill-stats-JORH5DGM.js.map → skill-watcher-5L7JE6TN.js.map} +0 -0
- /package/bundle/{skill-watcher-E4MGLKLS.js.map → sleep-I4JFASCY.js.map} +0 -0
- /package/bundle/{sleep-36XS6MHJ.js.map → soul-bundle-522C3IRH.js.map} +0 -0
- /package/bundle/{soul-bundle-VWAVHCZ6.js.map → spin-VHNGNWTD.js.map} +0 -0
- /package/bundle/{spin-notifications-SE2HVZI7.js.map → spin-notifications-7NC5XZEM.js.map} +0 -0
- /package/bundle/{spin-TI3TSVVT.js.map → spin-types-C5KOQOPD.js.map} +0 -0
- /package/bundle/{sse-parser-anthropic-A6R4Z2TB.js.map → sse-parser-anthropic-MMTVWHLI.js.map} +0 -0
- /package/bundle/{sse-parser-responses-HSZY3QGJ.js.map → sse-parser-responses-3AOFN64C.js.map} +0 -0
- /package/bundle/{ssrf-guard-O6SHIK6Q.js.map → ssrf-guard-U2JA72TC.js.map} +0 -0
- /package/bundle/{spin-types-BLPYAETA.js.map → stt-PSOPPBV4.js.map} +0 -0
- /package/bundle/{stt-LGVPXMVR.js.map → task-store-MNCW42BW.js.map} +0 -0
- /package/bundle/{subagent-runtime-5QUVES3W.js.map → tool-registry-JJMWCQKZ.js.map} +0 -0
- /package/bundle/{task-store-W5BFIAIH.js.map → tool-sandbox-CNL6V6IH.js.map} +0 -0
- /package/bundle/{tool-registry-IZX2IOBM.js.map → transport-config-6MB2K2XC.js.map} +0 -0
- /package/bundle/{tool-sandbox-4UC6GAKA.js.map → update-HGQAOC5L.js.map} +0 -0
- /package/bundle/{transport-config-KBF5W2DP.js.map → usage-tracker-SR4BI6ZT.js.map} +0 -0
- /package/bundle/{update-MESYO4LO.js.map → user-registry-4PACZJIJ.js.map} +0 -0
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# emergency-update.sh — fully-manual deploy when the abtars CLI cannot update itself.
|
|
3
3
|
#
|
|
4
|
-
# Builds the fresh dev bundle with plain npm + esbuild (NO abtars
|
|
4
|
+
# Builds the fresh dev bundle with plain npm + esbuild (NO abtars CLI
|
|
5
5
|
# invocation), stages a release, repoints the symlinks, and restarts the
|
|
6
6
|
# watchdog directly via launchctl/systemd. Result is identical to
|
|
7
7
|
# `abtars update --dev` but needs no working deployed binary.
|
|
8
8
|
#
|
|
9
|
-
# This is a MANUAL MIRROR of src/cli/deploy-lib/deploy.ts (deployActivation)
|
|
10
|
-
#
|
|
9
|
+
# This is a MANUAL MIRROR of src/cli/deploy-lib/deploy.ts (deployActivation),
|
|
10
|
+
# EXCEPT for the stop/respawn sequence, which intentionally diverges (#1299):
|
|
11
|
+
# - deploy.ts `/update dev` runs INSIDE the abtars-watchdog.service cgroup, so
|
|
12
|
+
# it must NOT stop the service or kill the watchdog (cgroup suicide under
|
|
13
|
+
# KillMode=control-group). It kills only the bridge and lets L3 respawn it;
|
|
14
|
+
# it CANNOT refresh the watchdog.
|
|
15
|
+
# - THIS script runs OUTSIDE the cgroup (manual login shell), so it CAN and
|
|
16
|
+
# DOES fully refresh the watchdog via one atomic `systemctl restart`. This is
|
|
17
|
+
# the foolproof, dependency-free WD-refresh path for when the CLI is broken.
|
|
18
|
+
# If deploy.ts changes its release path layout, UPDATE THIS. Do NOT "re-sync" the
|
|
19
|
+
# stop/respawn sequences — the divergence is deliberate.
|
|
11
20
|
#
|
|
12
21
|
# Usage: bash ~/.abtars-releases/src/abtars/scripts/emergency-update.sh
|
|
13
22
|
|
|
14
23
|
set -euo pipefail
|
|
15
24
|
|
|
16
25
|
SRC_DIR="${ABTARS_SRC:-$HOME/.abtars-releases/src/abtars}"
|
|
17
|
-
ABMIND_DIR="${ABMIND_SRC:-$HOME/.abtars-releases/src/abmind}"
|
|
18
26
|
RELEASES_DIR="$HOME/.abtars-releases"
|
|
19
27
|
ABTARS_HOME="${ABTARS_HOME:-$HOME/.abtars}"
|
|
20
28
|
PLIST="$HOME/Library/LaunchAgents/com.abtars.watchdog.plist"
|
|
@@ -33,10 +41,6 @@ jget() { node -e 'const fs=require("fs");try{const v=JSON.parse(fs.readFileSync(
|
|
|
33
41
|
step "bypassing dev branch fetch/reset..."
|
|
34
42
|
# git -C "$SRC_DIR" fetch --depth 1 origin dev
|
|
35
43
|
# git -C "$SRC_DIR" reset --hard origin/dev
|
|
36
|
-
# if [ -d "$ABMIND_DIR/.git" ]; then
|
|
37
|
-
# git -C "$ABMIND_DIR" fetch --depth 1 origin dev
|
|
38
|
-
# git -C "$ABMIND_DIR" reset --hard origin/dev
|
|
39
|
-
# fi
|
|
40
44
|
|
|
41
45
|
|
|
42
46
|
COMMIT="$(git -C "$SRC_DIR" rev-parse --short HEAD)"
|
|
@@ -59,22 +63,6 @@ if [ -d "$SRC_DIR/agents" ]; then
|
|
|
59
63
|
cp -r "$SRC_DIR/agents" "$SRC_DIR/bundle/agents"
|
|
60
64
|
fi
|
|
61
65
|
|
|
62
|
-
# ── 3. Build abmind + copy into bundle ─────────────────────────────────────
|
|
63
|
-
if [ -f "$ABMIND_DIR/package.json" ]; then
|
|
64
|
-
step "building abmind..."
|
|
65
|
-
( cd "$ABMIND_DIR" && npm install --ignore-scripts && npm run build )
|
|
66
|
-
if [ -f "$ABMIND_DIR/dist/cli/abmind.js" ]; then
|
|
67
|
-
ABMIND_DEST="$SRC_DIR/bundle/node_modules/abmind"
|
|
68
|
-
rm -rf "$ABMIND_DEST"
|
|
69
|
-
mkdir -p "$ABMIND_DEST"
|
|
70
|
-
cp -r "$ABMIND_DIR/." "$ABMIND_DEST/"
|
|
71
|
-
rm -rf "$ABMIND_DEST/node_modules" "$ABMIND_DEST/.git"
|
|
72
|
-
chmod +x "$ABMIND_DEST/dist/cli/abmind.js" 2>/dev/null || true
|
|
73
|
-
else
|
|
74
|
-
echo "! abmind build produced no dist — bundle will fall back to global abmind"
|
|
75
|
-
fi
|
|
76
|
-
fi
|
|
77
|
-
|
|
78
66
|
# ── 4. Stage release ───────────────────────────────────────────────────────
|
|
79
67
|
step "staging release $VERSION -> $RELEASE_DIR ..."
|
|
80
68
|
mkdir -p "$RELEASES_DIR"
|
|
@@ -112,40 +100,99 @@ node -e '
|
|
|
112
100
|
fs.writeFileSync(path, JSON.stringify(m, null, 2) + "\n");
|
|
113
101
|
' "$ABTARS_HOME" "$VERSION" "$COMMIT"
|
|
114
102
|
|
|
115
|
-
# ── 8. Stop
|
|
103
|
+
# ── 8. Stop (mirrors deploy.ts, but see #1299 divergence) ──────────────────
|
|
116
104
|
step "stopping daemon..."
|
|
117
105
|
OLD_PID="$(jget "$BRIDGE_LOCK" pid)"
|
|
118
106
|
WD_PID="$(jget "$BRIDGE_LOCK" watchdogPid)"
|
|
119
107
|
if [ "$IS_MAC" = "1" ]; then
|
|
108
|
+
# macOS: bootout now, bootstrap in step 9. No cgroup teardown, so the detached
|
|
109
|
+
# deploy survives — the full stop/kill sequence is safe here.
|
|
120
110
|
launchctl bootout "$UID_LABEL/com.abtars.watchdog" 2>/dev/null || true
|
|
121
|
-
|
|
122
|
-
|
|
111
|
+
echo "update:$VERSION" > "$ABTARS_HOME/.start-reason"
|
|
112
|
+
[ -n "$OLD_PID" ] && kill "$OLD_PID" 2>/dev/null || true
|
|
113
|
+
[ -n "$WD_PID" ] && kill "$WD_PID" 2>/dev/null || true
|
|
114
|
+
for _ in 1 2 3 4 5 6 7 8 9 10; do # wait up to ~5s for bridge to exit
|
|
115
|
+
if [ -z "$OLD_PID" ] || ! kill -0 "$OLD_PID" 2>/dev/null; then break; fi
|
|
116
|
+
sleep 0.5
|
|
117
|
+
done
|
|
118
|
+
[ -n "$OLD_PID" ] && kill -9 "$OLD_PID" 2>/dev/null || true
|
|
119
|
+
[ -n "$WD_PID" ] && kill -9 "$WD_PID" 2>/dev/null || true
|
|
123
120
|
fi
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
[ -n "$WD_PID" ] && kill -9 "$WD_PID" 2>/dev/null || true
|
|
121
|
+
# Linux (#1299): NO `systemctl stop` and NO manual kill here. An explicit stop
|
|
122
|
+
# opens a durable "stopped" window — if the reconcile in 8b fails under set -e,
|
|
123
|
+
# the watchdog is left dead before the verify in 9b (the 2026-07-03 14.4h outage
|
|
124
|
+
# class). Instead we reconcile while the watchdog is still up, then do ONE atomic
|
|
125
|
+
# `systemctl restart` in step 9: it tears down the old watchdog cgroup (old WD +
|
|
126
|
+
# bridge) and starts a fresh watchdog with the new service def + new
|
|
127
|
+
# abtars-watchdog.sh. This script runs OUTSIDE the service cgroup (manual login
|
|
128
|
+
# shell), so the restart does not kill it — this is the foolproof WD-refresh path.
|
|
133
129
|
rm -f "$ABTARS_HOME/.stopped"
|
|
134
130
|
|
|
131
|
+
# ── 8b. Reconcile watchdog service definition from repo template (#1284) ────
|
|
132
|
+
# MIRROR of deploy.ts deployActivation (the plist/systemd reconcile block).
|
|
133
|
+
# Renders the service definition from the source-of-truth template so we never
|
|
134
|
+
# bootstrap a stale plist left over from an older path scheme. The template
|
|
135
|
+
# points ProgramArguments at the persistent source checkout
|
|
136
|
+
# ($SRC_DIR/scripts/abtars-watchdog.sh), which git pull keeps current — no
|
|
137
|
+
# copy into the release dir, no versioned path, no drift. Fails loudly (set -e)
|
|
138
|
+
# if the template is missing rather than bootstrapping a wrong path.
|
|
139
|
+
step "reconciling watchdog service definition..."
|
|
140
|
+
if [ "$IS_MAC" = "1" ]; then
|
|
141
|
+
mkdir -p "$HOME/Library/LaunchAgents"
|
|
142
|
+
# {{HOME}} -> $HOME. Use | as sed delimiter ($HOME contains /).
|
|
143
|
+
sed "s|{{HOME}}|$HOME|g" "$SRC_DIR/scripts/com.abtars.watchdog.plist" > "$PLIST"
|
|
144
|
+
else
|
|
145
|
+
mkdir -p "$HOME/.config/systemd/user"
|
|
146
|
+
cp "$SRC_DIR/scripts/abtars-watchdog.service" "$HOME/.config/systemd/user/abtars-watchdog.service"
|
|
147
|
+
systemctl --user daemon-reload 2>/dev/null || true
|
|
148
|
+
fi
|
|
149
|
+
|
|
135
150
|
# ── 9. Respawn ─────────────────────────────────────────────────────────────
|
|
136
151
|
step "respawning daemon..."
|
|
137
152
|
echo "deploy-respawn" > "$ABTARS_HOME/.start-reason"
|
|
138
153
|
if [ "$IS_MAC" = "1" ]; then
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
launchctl bootstrap "$UID_LABEL" "$PLIST" 2>/dev/null || { sleep 2; launchctl bootstrap "$UID_LABEL" "$PLIST" 2>/dev/null || echo "! watchdog bootstrap failed — run: launchctl bootstrap $UID_LABEL \"$PLIST\""; }
|
|
142
|
-
fi
|
|
154
|
+
# bootout->bootstrap can race (launchd tear-down); retry once after a beat
|
|
155
|
+
launchctl bootstrap "$UID_LABEL" "$PLIST" 2>/dev/null || { sleep 2; launchctl bootstrap "$UID_LABEL" "$PLIST" 2>/dev/null || true; }
|
|
143
156
|
else
|
|
144
157
|
systemctl --user daemon-reload 2>/dev/null || true
|
|
145
158
|
systemctl --user unmask abtars-watchdog 2>/dev/null || true
|
|
146
159
|
systemctl --user enable abtars-watchdog 2>/dev/null || true
|
|
147
|
-
|
|
160
|
+
# #1278/#1299: single atomic restart is the ONLY teardown+respawn on Linux —
|
|
161
|
+
# step 8 no longer does an explicit stop, so there is no durable stopped
|
|
162
|
+
# window. restart tears down the old watchdog cgroup and starts a fresh
|
|
163
|
+
# watchdog with the reconciled service def + new abtars-watchdog.sh.
|
|
164
|
+
systemctl --user restart abtars-watchdog 2>/dev/null || systemctl --user start abtars-watchdog 2>/dev/null || true
|
|
165
|
+
fi
|
|
166
|
+
|
|
167
|
+
# ── 9b. Verify the watchdog actually came up (#1278) ───────────────────────
|
|
168
|
+
# The old code masked the restart with `|| true` and only probed BRIDGE health.
|
|
169
|
+
# A swallowed watchdog restart left the unit dead with no signal — the 2026-07-03
|
|
170
|
+
# 14.4h outage. Verify the watchdog is alive; loud-fail (exit 1) if not, with a
|
|
171
|
+
# copy-pasteable recovery command. No silent mask on this critical path.
|
|
172
|
+
step "verifying watchdog is alive..."
|
|
173
|
+
wd_ok=""
|
|
174
|
+
WD_NEW=""
|
|
175
|
+
for _ in 1 2 3 4 5 6 7 8 9 10; do
|
|
176
|
+
WD_NEW="$(jget "$BRIDGE_LOCK" watchdogPid)"
|
|
177
|
+
if [ -n "$WD_NEW" ] && [ "$WD_NEW" != "0" ] && kill -0 "$WD_NEW" 2>/dev/null; then
|
|
178
|
+
if [ "$IS_MAC" = "1" ]; then
|
|
179
|
+
if launchctl print "$UID_LABEL/com.abtars.watchdog" >/dev/null 2>&1; then wd_ok=1; break; fi
|
|
180
|
+
else
|
|
181
|
+
if systemctl --user is-active --quiet abtars-watchdog; then wd_ok=1; break; fi
|
|
182
|
+
fi
|
|
183
|
+
fi
|
|
184
|
+
sleep 1
|
|
185
|
+
done
|
|
186
|
+
if [ -z "$wd_ok" ]; then
|
|
187
|
+
echo "x watchdog did NOT come up after respawn — bridge has NO supervisor." >&2
|
|
188
|
+
if [ "$IS_MAC" = "1" ]; then
|
|
189
|
+
echo " recover: launchctl bootout \"$UID_LABEL/com.abtars.watchdog\" 2>/dev/null; launchctl bootstrap \"$UID_LABEL\" \"$PLIST\"" >&2
|
|
190
|
+
else
|
|
191
|
+
echo " recover: systemctl --user daemon-reload && systemctl --user enable --now abtars-watchdog" >&2
|
|
192
|
+
fi
|
|
193
|
+
exit 1
|
|
148
194
|
fi
|
|
195
|
+
step "watchdog alive (pid $WD_NEW)"
|
|
149
196
|
|
|
150
197
|
# ── 10. Health probe (new pid + fresh lastHeartbeat) ───────────────────────
|
|
151
198
|
step "waiting for bridge health..."
|
package/bundle/chunk-3AAENI2K.js
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
3
|
-
import {
|
|
4
|
-
init_log_and_swallow,
|
|
5
|
-
logAndSwallow
|
|
6
|
-
} from "./chunk-YSKCQH6E.js";
|
|
7
|
-
import {
|
|
8
|
-
init_logger,
|
|
9
|
-
logInfo,
|
|
10
|
-
logWarn
|
|
11
|
-
} from "./chunk-GWILHZPT.js";
|
|
12
|
-
|
|
13
|
-
// src/components/subagent-runtime.ts
|
|
14
|
-
init_log_and_swallow();
|
|
15
|
-
init_logger();
|
|
16
|
-
import { randomBytes } from "node:crypto";
|
|
17
|
-
var TAG = "runtime";
|
|
18
|
-
var DEFAULT_SESSION = {
|
|
19
|
-
professor: "reuse",
|
|
20
|
-
dreamy: "fresh",
|
|
21
|
-
browsie: "fresh",
|
|
22
|
-
coding: "reuse",
|
|
23
|
-
task: "fresh"
|
|
24
|
-
};
|
|
25
|
-
var DEFAULT_SPAWN_TIMEOUT_MS = 6e5;
|
|
26
|
-
var SubagentRuntime = class {
|
|
27
|
-
cache = /* @__PURE__ */ new Map();
|
|
28
|
-
activeSpawns = /* @__PURE__ */ new Map();
|
|
29
|
-
_registry = null;
|
|
30
|
-
_mainTransport = null;
|
|
31
|
-
_lastUsage = null;
|
|
32
|
-
/** Token usage from last complete() call. */
|
|
33
|
-
get lastUsage() {
|
|
34
|
-
return this._lastUsage;
|
|
35
|
-
}
|
|
36
|
-
_sessionManager = null;
|
|
37
|
-
_sandboxEnabled = false;
|
|
38
|
-
/** Set shared model health registry (from boot ctx). */
|
|
39
|
-
setRegistry(registry) {
|
|
40
|
-
this._registry = registry;
|
|
41
|
-
}
|
|
42
|
-
/** Set main transport reference for currentModel reads. */
|
|
43
|
-
setMainTransport(transport) {
|
|
44
|
-
this._mainTransport = transport;
|
|
45
|
-
}
|
|
46
|
-
/** Set session manager for auto-spawn sub-session creation (#510). */
|
|
47
|
-
setSessionManager(mgr) {
|
|
48
|
-
this._sessionManager = mgr;
|
|
49
|
-
}
|
|
50
|
-
/** Get session manager (may be null before boot completes). */
|
|
51
|
-
get sessionManager() {
|
|
52
|
-
return this._sessionManager;
|
|
53
|
-
}
|
|
54
|
-
/** Enable Docker sandbox for W/B/C sessions (#478). */
|
|
55
|
-
setSandboxEnabled(enabled) {
|
|
56
|
-
this._sandboxEnabled = enabled;
|
|
57
|
-
}
|
|
58
|
-
/** Send a prompt to a named agent and get the response. */
|
|
59
|
-
async complete(agent, prompt, opts) {
|
|
60
|
-
const { checkBudget, sendBudgetNotification } = await import("./budget-45QOBDWA.js");
|
|
61
|
-
const budgetCheck = checkBudget(agent);
|
|
62
|
-
if (!budgetCheck.allowed) {
|
|
63
|
-
const reason = budgetCheck.remaining.tokens <= 0 ? "token" : "call";
|
|
64
|
-
void sendBudgetNotification(agent, reason);
|
|
65
|
-
throw new Error(`Daily ${reason} budget exceeded for ${agent}. Resets at midnight.`);
|
|
66
|
-
}
|
|
67
|
-
const sessionStrategy = opts?.session ?? DEFAULT_SESSION[agent] ?? "fresh";
|
|
68
|
-
const start = Date.now();
|
|
69
|
-
const cached = this.cache.get(agent);
|
|
70
|
-
if (cached && sessionStrategy === "fresh") {
|
|
71
|
-
await cached.transport.resetSession?.(cached.sessionKey);
|
|
72
|
-
(await import("./tool-registry-IZX2IOBM.js")).resetStoreCounter();
|
|
73
|
-
}
|
|
74
|
-
const { transport, model, sessionKey } = cached ?? await this.createAgent(agent, opts?.sessionType);
|
|
75
|
-
if (opts?.timeoutMs && transport.setTimeoutOverride) {
|
|
76
|
-
transport.setTimeoutOverride(opts.timeoutMs);
|
|
77
|
-
}
|
|
78
|
-
try {
|
|
79
|
-
const response = await transport.sendPrompt(sessionKey, prompt);
|
|
80
|
-
const elapsed = Date.now() - start;
|
|
81
|
-
this._lastUsage = transport.lastUsage?.() ?? null;
|
|
82
|
-
logInfo(TAG, `${agent} complete: ${prompt.length}ch \u2192 ${response?.length ?? 0}ch (${elapsed}ms, ${model})`);
|
|
83
|
-
return response ?? "";
|
|
84
|
-
} catch (err) {
|
|
85
|
-
logWarn(TAG, `${agent} complete failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
86
|
-
this.cache.delete(agent);
|
|
87
|
-
throw err;
|
|
88
|
-
} finally {
|
|
89
|
-
if (opts?.timeoutMs && transport.setTimeoutOverride) {
|
|
90
|
-
transport.setTimeoutOverride(null);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
/** Get a persistent session handle for multi-turn callers. */
|
|
95
|
-
async session(agent, key) {
|
|
96
|
-
const cacheKey = key ? `${agent}:${key}` : agent;
|
|
97
|
-
const cached = this.cache.get(cacheKey) ?? await this.createAgent(agent, void 0, cacheKey);
|
|
98
|
-
return {
|
|
99
|
-
sendPrompt: (sessionKey, prompt) => cached.transport.sendPrompt(sessionKey, prompt),
|
|
100
|
-
destroy: async () => {
|
|
101
|
-
try {
|
|
102
|
-
cached.transport.destroy();
|
|
103
|
-
} catch (err) {
|
|
104
|
-
logAndSwallow("subagent_runtime", "op", err);
|
|
105
|
-
}
|
|
106
|
-
this.cache.delete(cacheKey);
|
|
107
|
-
logInfo(TAG, `${cacheKey} session destroyed`);
|
|
108
|
-
},
|
|
109
|
-
get isReady() {
|
|
110
|
-
return cached.transport.isReady;
|
|
111
|
-
},
|
|
112
|
-
get transport() {
|
|
113
|
-
return cached.transport;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
/** Fire-and-forget: run complete() in background, deliver result via callback. */
|
|
118
|
-
async spawn(agent, prompt, opts) {
|
|
119
|
-
const taskId = randomBytes(4).toString("hex");
|
|
120
|
-
const abort = new AbortController();
|
|
121
|
-
this.activeSpawns.set(taskId, { abort, startedAt: Date.now() });
|
|
122
|
-
const timeoutMs = opts?.timeoutMs ?? DEFAULT_SPAWN_TIMEOUT_MS;
|
|
123
|
-
const timer = setTimeout(() => abort.abort(), timeoutMs);
|
|
124
|
-
void (async () => {
|
|
125
|
-
try {
|
|
126
|
-
const result = await this.complete(agent, prompt);
|
|
127
|
-
if (!abort.signal.aborted) opts?.onComplete?.(taskId, result);
|
|
128
|
-
} catch (err) {
|
|
129
|
-
if (!abort.signal.aborted) opts?.onError?.(taskId, err instanceof Error ? err : new Error(String(err)));
|
|
130
|
-
} finally {
|
|
131
|
-
clearTimeout(timer);
|
|
132
|
-
this.activeSpawns.delete(taskId);
|
|
133
|
-
}
|
|
134
|
-
})();
|
|
135
|
-
logInfo(TAG, `${agent} spawned: taskId=${taskId}, timeout=${timeoutMs}ms`);
|
|
136
|
-
return { taskId };
|
|
137
|
-
}
|
|
138
|
-
/** Shut down all cached transports and abort active spawns. */
|
|
139
|
-
async shutdown() {
|
|
140
|
-
for (const [id, { abort }] of this.activeSpawns) {
|
|
141
|
-
abort.abort();
|
|
142
|
-
logInfo(TAG, `spawn ${id} aborted`);
|
|
143
|
-
}
|
|
144
|
-
this.activeSpawns.clear();
|
|
145
|
-
for (const [name, cached] of this.cache) {
|
|
146
|
-
try {
|
|
147
|
-
cached.transport.destroy();
|
|
148
|
-
} catch (err) {
|
|
149
|
-
logAndSwallow("subagent_runtime", "op", err);
|
|
150
|
-
}
|
|
151
|
-
logInfo(TAG, `${name} transport closed`);
|
|
152
|
-
}
|
|
153
|
-
this.cache.clear();
|
|
154
|
-
}
|
|
155
|
-
/** Active registry: list running background spawns. */
|
|
156
|
-
listActive() {
|
|
157
|
-
return [...this.activeSpawns.entries()].map(([taskId, entry]) => ({
|
|
158
|
-
taskId,
|
|
159
|
-
startedAt: entry.startedAt ?? 0
|
|
160
|
-
}));
|
|
161
|
-
}
|
|
162
|
-
/** Interrupt a specific spawn by taskId. Returns true if found. */
|
|
163
|
-
interruptSpawn(taskId) {
|
|
164
|
-
const entry = this.activeSpawns.get(taskId);
|
|
165
|
-
if (!entry) return false;
|
|
166
|
-
entry.abort.abort();
|
|
167
|
-
this.activeSpawns.delete(taskId);
|
|
168
|
-
logInfo(TAG, `spawn ${taskId} interrupted`);
|
|
169
|
-
return true;
|
|
170
|
-
}
|
|
171
|
-
async createAgent(agent, sessionType, cacheKey) {
|
|
172
|
-
const typeMap = { browsie: "B", coding: "C", task: "T" };
|
|
173
|
-
const resolvedType = sessionType || typeMap[agent];
|
|
174
|
-
const sandboxTypes = /* @__PURE__ */ new Set(["B", "C", "W"]);
|
|
175
|
-
if (this._sandboxEnabled && resolvedType && sandboxTypes.has(resolvedType)) {
|
|
176
|
-
const { logInfo: logInfo2 } = await import("./logger-OWCSNYCA.js");
|
|
177
|
-
logInfo2("subagent", `Sandbox spawn: ${agent} (type=${resolvedType}) \u2192 Docker container`);
|
|
178
|
-
}
|
|
179
|
-
const { createSubagentTransport } = await import("./agent-registry-GI6CLT3Z.js");
|
|
180
|
-
const role = AGENT_TO_ROLE[agent];
|
|
181
|
-
const mainModel = this._mainTransport && "currentModel" in this._mainTransport ? this._mainTransport.currentModel : void 0;
|
|
182
|
-
const { transport, model } = await createSubagentTransport(role, this._registry ?? void 0, mainModel);
|
|
183
|
-
if (transport.agent?.pid) {
|
|
184
|
-
import("./bridge-lock-transport-4ZH7QTJP.js").then(({ trackAcpPid }) => trackAcpPid(transport.agent.pid)).catch(() => {
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
if (resolvedType && "setSystemPrompt" in transport && typeof transport.setSystemPrompt === "function") {
|
|
188
|
-
const { buildSoulBundle } = await import("./soul-bundle-VWAVHCZ6.js");
|
|
189
|
-
const bundle = buildSoulBundle(resolvedType);
|
|
190
|
-
if (bundle) transport.setSystemPrompt(bundle);
|
|
191
|
-
}
|
|
192
|
-
const sessionKey = `system:${cacheKey ?? agent}`;
|
|
193
|
-
const entry = { transport, model, sessionKey };
|
|
194
|
-
this.cache.set(cacheKey ?? agent, entry);
|
|
195
|
-
(await import("./tool-registry-IZX2IOBM.js")).resetStoreCounter();
|
|
196
|
-
return entry;
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
var AGENT_TO_ROLE = {
|
|
200
|
-
professor: "task",
|
|
201
|
-
dreamy: "sleep",
|
|
202
|
-
browsie: "browse",
|
|
203
|
-
coding: "coding",
|
|
204
|
-
task: "task"
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
export {
|
|
208
|
-
SubagentRuntime
|
|
209
|
-
};
|
|
210
|
-
//# sourceMappingURL=chunk-3AAENI2K.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/subagent-runtime.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * SubagentRuntime \u2014 unified LLM access for all subagents.\n * Replaces manual createSubagentTransport() calls.\n * Caches transports per agent, handles session lifecycle + fallback.\n */\n\nimport { logAndSwallow } from \"./log-and-swallow.js\";\nimport type { IKiroTransport } from \"./transport/kiro-transport.js\";\nimport { logInfo, logWarn } from \"./logger.js\";\nimport { randomBytes } from \"node:crypto\";\n\nimport type { ModelHealthRegistry } from \"./transport/model-health-registry.js\";\n\nconst TAG = \"runtime\";\n\nexport type AgentName = \"professor\" | \"dreamy\" | \"browsie\" | \"coding\" | \"task\";\n\nexport interface AgentOpts {\n /** Override default session strategy for this call. */\n session?: \"fresh\" | \"reuse\";\n /** Context passed to tool executor (userId, metadata). */\n context?: Record<string, unknown>;\n /** Override model API timeout for this call (ms). */\n timeoutMs?: number;\n /** Override session type (default: derived from agent name). */\n sessionType?: import(\"./spin-types.js\").SessionType;\n}\n\n/** Persistent transport handle for multi-turn callers. */\nexport interface AgentSession {\n sendPrompt(sessionKey: string, prompt: string, image?: { mime: string; base64: string }): Promise<string>;\n destroy(): Promise<void>;\n readonly isReady: boolean;\n /** Underlying transport \u2014 used to set sandboxPolicy for peer sessions (#678). */\n readonly transport?: IKiroTransport;\n}\n\nexport interface SpawnResult {\n taskId: string;\n}\n\nexport interface SpawnOpts {\n onComplete?: (taskId: string, result: string) => void;\n onError?: (taskId: string, error: Error) => void;\n timeoutMs?: number;\n}\n\ninterface CachedAgent {\n transport: IKiroTransport;\n model: string;\n sessionKey: string;\n}\n\nconst DEFAULT_SESSION: Record<AgentName, \"fresh\" | \"reuse\"> = {\n professor: \"reuse\",\n dreamy: \"fresh\",\n browsie: \"fresh\",\n coding: \"reuse\",\n task: \"fresh\",\n};\n\nconst DEFAULT_SPAWN_TIMEOUT_MS = 600_000; // 10 min\n\nexport class SubagentRuntime {\n private readonly cache = new Map<AgentName, CachedAgent>();\n private readonly activeSpawns = new Map<string, { abort: AbortController; startedAt: number }>();\n private _registry: ModelHealthRegistry | null = null;\n private _mainTransport: IKiroTransport | null = null;\n private _lastUsage: { input: number; output: number } | null = null;\n\n /** Token usage from last complete() call. */\n get lastUsage(): { input: number; output: number } | null { return this._lastUsage; }\n private _sessionManager: import(\"./spin.js\").Spin | null = null;\n private _sandboxEnabled = false;\n\n /** Set shared model health registry (from boot ctx). */\n setRegistry(registry: ModelHealthRegistry): void { this._registry = registry; }\n\n /** Set main transport reference for currentModel reads. */\n setMainTransport(transport: IKiroTransport): void { this._mainTransport = transport; }\n\n /** Set session manager for auto-spawn sub-session creation (#510). */\n setSessionManager(mgr: import(\"./spin.js\").Spin): void { this._sessionManager = mgr; }\n\n /** Get session manager (may be null before boot completes). */\n get sessionManager(): import(\"./spin.js\").Spin | null { return this._sessionManager; }\n\n /** Enable Docker sandbox for W/B/C sessions (#478). */\n setSandboxEnabled(enabled: boolean): void { this._sandboxEnabled = enabled; }\n\n /** Send a prompt to a named agent and get the response. */\n async complete(agent: AgentName, prompt: string, opts?: AgentOpts): Promise<string> {\n const { checkBudget, sendBudgetNotification } = await import(\"./budget.js\");\n const budgetCheck = checkBudget(agent);\n if (!budgetCheck.allowed) {\n const reason = budgetCheck.remaining.tokens <= 0 ? \"token\" : \"call\";\n void sendBudgetNotification(agent, reason);\n throw new Error(`Daily ${reason} budget exceeded for ${agent}. Resets at midnight.`);\n }\n\n const sessionStrategy = opts?.session ?? DEFAULT_SESSION[agent] ?? \"fresh\";\n const start = Date.now();\n\n const cached = this.cache.get(agent);\n if (cached && sessionStrategy === \"fresh\") {\n await cached.transport.resetSession?.(cached.sessionKey);\n (await import(\"./transport/tool-registry.js\")).resetStoreCounter();\n }\n\n const { transport, model, sessionKey } = cached ?? await this.createAgent(agent, opts?.sessionType);\n\n // Per-call timeout override (e.g. dreamy sleep steps need longer than default)\n if (opts?.timeoutMs && transport.setTimeoutOverride) {\n transport.setTimeoutOverride(opts.timeoutMs);\n }\n\n try {\n const response = await transport.sendPrompt(sessionKey, prompt);\n const elapsed = Date.now() - start;\n this._lastUsage = transport.lastUsage?.() ?? null;\n logInfo(TAG, `${agent} complete: ${prompt.length}ch \u2192 ${response?.length ?? 0}ch (${elapsed}ms, ${model})`);\n return response ?? \"\";\n } catch (err) {\n logWarn(TAG, `${agent} complete failed: ${err instanceof Error ? err.message : String(err)}`);\n this.cache.delete(agent);\n throw err;\n } finally {\n if (opts?.timeoutMs && transport.setTimeoutOverride) {\n transport.setTimeoutOverride(null);\n }\n }\n }\n\n /** Get a persistent session handle for multi-turn callers. */\n async session(agent: AgentName, key?: string): Promise<AgentSession> {\n const cacheKey = key ? `${agent}:${key}` : agent;\n const cached = this.cache.get(cacheKey as AgentName) ?? await this.createAgent(agent, undefined, cacheKey);\n return {\n sendPrompt: (sessionKey: string, prompt: string) => cached.transport.sendPrompt(sessionKey, prompt),\n destroy: async () => {\n try { cached.transport.destroy(); } catch (err) { logAndSwallow(\"subagent_runtime\", \"op\", err); }\n this.cache.delete(cacheKey as AgentName);\n logInfo(TAG, `${cacheKey} session destroyed`);\n },\n get isReady() { return cached.transport.isReady; },\n get transport() { return cached.transport; },\n };\n }\n\n /** Fire-and-forget: run complete() in background, deliver result via callback. */\n async spawn(agent: AgentName, prompt: string, opts?: SpawnOpts): Promise<SpawnResult> {\n const taskId = randomBytes(4).toString(\"hex\");\n const abort = new AbortController();\n this.activeSpawns.set(taskId, { abort, startedAt: Date.now() });\n\n const timeoutMs = opts?.timeoutMs ?? DEFAULT_SPAWN_TIMEOUT_MS;\n const timer = setTimeout(() => abort.abort(), timeoutMs);\n\n // Fire and forget \u2014 don't await\n void (async () => {\n try {\n const result = await this.complete(agent, prompt);\n if (!abort.signal.aborted) opts?.onComplete?.(taskId, result);\n } catch (err) {\n if (!abort.signal.aborted) opts?.onError?.(taskId, err instanceof Error ? err : new Error(String(err)));\n } finally {\n clearTimeout(timer);\n this.activeSpawns.delete(taskId);\n }\n })();\n\n logInfo(TAG, `${agent} spawned: taskId=${taskId}, timeout=${timeoutMs}ms`);\n return { taskId };\n }\n\n /** Shut down all cached transports and abort active spawns. */\n async shutdown(): Promise<void> {\n for (const [id, { abort }] of this.activeSpawns) {\n abort.abort();\n logInfo(TAG, `spawn ${id} aborted`);\n }\n this.activeSpawns.clear();\n\n for (const [name, cached] of this.cache) {\n try { cached.transport.destroy(); } catch (err) { logAndSwallow(\"subagent_runtime\", \"op\", err); }\n logInfo(TAG, `${name} transport closed`);\n }\n this.cache.clear();\n }\n\n /** Active registry: list running background spawns. */\n listActive(): Array<{ taskId: string; startedAt: number }> {\n return [...this.activeSpawns.entries()].map(([taskId, entry]) => ({\n taskId,\n startedAt: (entry as any).startedAt ?? 0,\n }));\n }\n\n /** Interrupt a specific spawn by taskId. Returns true if found. */\n interruptSpawn(taskId: string): boolean {\n const entry = this.activeSpawns.get(taskId);\n if (!entry) return false;\n entry.abort.abort();\n this.activeSpawns.delete(taskId);\n logInfo(TAG, `spawn ${taskId} interrupted`);\n return true;\n }\n\n private async createAgent(agent: AgentName, sessionType?: import(\"./spin-types.js\").SessionType, cacheKey?: string): Promise<CachedAgent> {\n const typeMap: Partial<Record<AgentName, import(\"./spin-types.js\").SessionType>> = { browsie: \"B\", coding: \"C\", task: \"T\" };\n const resolvedType = sessionType || typeMap[agent];\n const sandboxTypes = new Set([\"B\", \"C\", \"W\"]);\n\n // #478: Route to Docker container for sandboxed session types\n if (this._sandboxEnabled && resolvedType && sandboxTypes.has(resolvedType)) {\n const { logInfo } = await import(\"./logger.js\");\n logInfo(\"subagent\", `Sandbox spawn: ${agent} (type=${resolvedType}) \u2192 Docker container`);\n // TODO (#478-integration): spawn container, connect socket, return proxy transport\n // For now, fall through to in-process (container-side agent code not yet implemented)\n }\n\n const { createSubagentTransport } = await import(\"./agent-registry.js\");\n const role = AGENT_TO_ROLE[agent];\n const mainModel = this._mainTransport && \"currentModel\" in this._mainTransport\n ? (this._mainTransport as unknown as { currentModel: string }).currentModel\n : undefined;\n const { transport, model } = await createSubagentTransport(role, this._registry ?? undefined, mainModel);\n\n // #1012: Track PID so boot-time cleanup finds orphans\n if ((transport as any).agent?.pid) {\n import(\"./transport/bridge-lock-transport.js\").then(({ trackAcpPid }) => trackAcpPid((transport as any).agent.pid)).catch(() => {});\n }\n\n // Inject session-type-appropriate SOUL bundle (#744)\n if (resolvedType && \"setSystemPrompt\" in transport && typeof (transport as any).setSystemPrompt === \"function\") {\n const { buildSoulBundle } = await import(\"./soul-bundle.js\");\n const bundle = buildSoulBundle(resolvedType);\n if (bundle) (transport as any).setSystemPrompt(bundle);\n }\n\n const sessionKey = `system:${cacheKey ?? agent}`;\n const entry: CachedAgent = { transport, model, sessionKey };\n this.cache.set((cacheKey ?? agent) as AgentName, entry);\n (await import(\"./transport/tool-registry.js\")).resetStoreCounter();\n return entry;\n }\n}\n\nconst AGENT_TO_ROLE: Record<AgentName, import(\"./agent-registry.js\").SubagentRole> = {\n professor: \"task\",\n dreamy: \"sleep\",\n browsie: \"browse\",\n coding: \"coding\",\n task: \"task\",\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;AAMA;AAEA;AACA,SAAS,mBAAmB;AAI5B,IAAM,MAAM;AAwCZ,IAAM,kBAAwD;AAAA,EAC5D,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AACR;AAEA,IAAM,2BAA2B;AAE1B,IAAM,kBAAN,MAAsB;AAAA,EACV,QAAQ,oBAAI,IAA4B;AAAA,EACxC,eAAe,oBAAI,IAA2D;AAAA,EACvF,YAAwC;AAAA,EACxC,iBAAwC;AAAA,EACxC,aAAuD;AAAA;AAAA,EAG/D,IAAI,YAAsD;AAAE,WAAO,KAAK;AAAA,EAAY;AAAA,EAC5E,kBAAmD;AAAA,EACnD,kBAAkB;AAAA;AAAA,EAG1B,YAAY,UAAqC;AAAE,SAAK,YAAY;AAAA,EAAU;AAAA;AAAA,EAG9E,iBAAiB,WAAiC;AAAE,SAAK,iBAAiB;AAAA,EAAW;AAAA;AAAA,EAGrF,kBAAkB,KAAqC;AAAE,SAAK,kBAAkB;AAAA,EAAK;AAAA;AAAA,EAGrF,IAAI,iBAAkD;AAAE,WAAO,KAAK;AAAA,EAAiB;AAAA;AAAA,EAGrF,kBAAkB,SAAwB;AAAE,SAAK,kBAAkB;AAAA,EAAS;AAAA;AAAA,EAG5E,MAAM,SAAS,OAAkB,QAAgB,MAAmC;AAClF,UAAM,EAAE,aAAa,uBAAuB,IAAI,MAAM,OAA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ctor-probes.ts \u2014 structured health probes grouped by subsystem layer.\n * Replaces scripts/doctor.sh entirely.\n */\n\nimport { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { homedir } from \"node:os\";\nimport { abtarsHome } from \"../../paths.js\";\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\u2500\n\nexport interface ProbeResult {\n name: string;\n status: \"ok\" | \"failed\" | \"skipped\";\n detail?: string;\n ms?: number;\n}\n\nexport interface FixResult {\n probe: string;\n action: string;\n success: boolean;\n}\n\nexport type LayerName = \"body\" | \"heart\" | \"brain\" | \"soul\" | \"tribe\";\n\nexport interface DoctorOutput {\n version: \"1.0\";\n totalMs: number;\n layers: Record<LayerName, ProbeResult[]>;\n fixes?: FixResult[];\n}\n\n// \u2500\u2500 Helpers \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\nconst home = abtarsHome();\nconst configDir = join(home, \"config\");\n\nfunction readJson(path: string): any | null {\n try { return JSON.parse(readFileSync(path, \"utf-8\")); } catch { return null; }\n}\n\nfunction readEnv(): Map<string, string> {\n const envPath = join(configDir, \".env\");\n const map = new Map<string, string>();\n if (!existsSync(envPath)) return map;\n for (const line of readFileSync(envPath, \"utf-8\").split(\"\\n\")) {\n const m = line.match(/^([A-Z_]+)=(.*)$/);\n if (m) map.set(m[1]!, m[2]!.replace(/^[\"']|[\"']$/g, \"\"));\n }\n return map;\n}\n\nfunction pidAlive(pid: number): boolean {\n try { process.kill(pid, 0); return true; } catch { return false; }\n}\n\nfunction ago(ms: number): string {\n const s = Math.round(ms / 1000);\n if (s < 60) return `${s}s ago`;\n return `${Math.round(s / 60)}m ago`;\n}\n\nasync function timedProbe(fn: () => Promise<ProbeResult>): Promise<ProbeResult> {\n const start = Date.now();\n try {\n const r = await fn();\n r.ms = r.ms ?? (Date.now() - start);\n return r;\n } catch (err) {\n return { name: \"unknown\", status: \"failed\", detail: String(err), ms: Date.now() - start };\n }\n}\n\n// \u2500\u2500 Body Probes \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\nasync function probePlatforms(): Promise<ProbeResult> {\n const { readSecret, initSecretsKey } = await import(\"../../components/secrets.js\");\n initSecretsKey();\n\n const results: Array<{ name: string; status: \"ok\" | \"failed\" | \"skipped\"; detail: string }> = [];\n\n // Telegram: read token, call getMe\n const telegramToken = readSecret(\"TELEGRAM_BOT_TOKEN\") ?? readSecret(\"TELEGRAM_TOKEN\");\n if (telegramToken) {\n const r = await verifyTelegram(telegramToken);\n results.push({ name: \"telegram\", ...r });\n }\n\n // Discord: read token, call gateway\n const discordToken = readSecret(\"DISCORD_BOT_TOKEN\") ?? readSecret(\"DISCORD_TOKEN\");\n if (discordToken) {\n const r = await verifyDiscord(discordToken);\n results.push({ name: \"discord\", ...r });\n }\n\n // IRC: skip real verification (connection-based), just check if configured\n const ircServer = readSecret(\"IRC_SERVER\");\n if (ircServer) {\n results.push({ name: \"irc\", status: \"ok\", detail: \"server configured (connection not verified)\" });\n }\n\n if (results.length === 0) return { name: \"platforms\", status: \"skipped\", detail: \"no platform configured\" };\n\n const failed = results.filter(r => r.status === \"failed\");\n const skipped = results.filter(r => r.status === \"skipped\");\n const allOk = failed.length === 0 && skipped.length === 0;\n const status = allOk ? \"ok\" : failed.length > 0 ? \"failed\" : \"ok\";\n const detail = results.map(r => `${r.name}: ${r.status}${r.detail ? ` (${r.detail})` : \"\"}`).join(\", \");\n return { name: \"platforms\", status, detail };\n}\n\nasync function verifyTelegram(token: string): Promise<{ status: \"ok\" | \"failed\" | \"skipped\"; detail: string }> {\n try {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), 5000);\n const res = await fetch(`https://api.telegram.org/bot${token}/getMe`, { signal: controller.signal });\n clearTimeout(timeout);\n if (res.ok) return { status: \"ok\", detail: \"getMe ok\" };\n if (res.status === 401 || res.status === 403) return { status: \"failed\", detail: \"invalid token\" };\n return { status: \"skipped\", detail: `http ${res.status}` };\n } catch {\n return { status: \"skipped\", detail: \"unreachable\" };\n }\n}\n\nasync function verifyDiscord(token: string): Promise<{ status: \"ok\" | \"failed\" | \"skipped\"; detail: string }> {\n try {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), 5000);\n const res = await fetch(\"https://discord.com/api/v10/users/@me\", {\n headers: { \"Authorization\": `Bot ${token}` },\n signal: controller.signal,\n });\n clearTimeout(timeout);\n if (res.ok) return { status: \"ok\", detail: \"gateway ok\" };\n if (res.status === 401 || res.status === 403) return { status: \"failed\", detail: \"invalid token\" };\n return { status: \"skipped\", detail: `http ${res.status}` };\n } catch {\n return { status: \"skipped\", detail: \"unreachable\" };\n }\n}\n\nasync function probeDashboard(): Promise<ProbeResult> {\n const env = readEnv();\n if (env.get(\"ENABLE_DASHBOARD\") !== \"true\") return { name: \"dashboard\", status: \"skipped\", detail: \"not enabled\" };\n const port = env.get(\"DASHBOARD_PORT\") || env.get(\"WEB_PORT\") || \"3000\";\n try {\n const res = await fetch(`http://127.0.0.1:${port}/`, { signal: AbortSignal.timeout(3000) });\n return { name: \"dashboard\", status: res.ok ? \"ok\" : \"failed\", detail: `:${port}` };\n } catch {\n return { name: \"dashboard\", status: \"failed\", detail: `:${port} unreachable` };\n }\n}\n\nasync function probeSecurity(): Promise<ProbeResult> {\n const env = readEnv();\n const mode = env.get(\"SECURITY_MODE\") || \"off\";\n const validModes = [\"off\", \"guardrails\", \"seatbelt\", \"docker\"];\n if (!validModes.includes(mode)) return { name: \"security\", status: \"failed\", detail: `invalid mode: ${mode}` };\n\n // Check secret file perms\n const secretDir = join(home, \"secret\");\n let permIssues = 0;\n if (existsSync(secretDir)) {\n for (const f of readdirSync(secretDir)) {\n const st = statSync(join(secretDir, f));\n if (st.isFile() && (st.mode & 0o777) !== 0o600) permIssues++;\n }\n }\n\n const parts = [mode];\n if (existsSync(join(home, \"auth\", \"rules.json\"))) parts.push(\"ActionGate\");\n if (permIssues > 0) return { name: \"security\", status: \"failed\", detail: `${mode}, ${permIssues} file(s) not 600` };\n return { name: \"security\", status: \"ok\", detail: parts.join(\", \") };\n}\n\nasync function probeWatchdog(): Promise<ProbeResult> {\n const lock = readJson(join(home, \"bridge.lock\"));\n if (!lock) return { name: \"watchdog\", status: \"failed\", detail: \"bridge.lock missing\" };\n\n const bridgePid = lock.pid ?? 0;\n const wdPid = lock.watchdogPid ?? 0;\n const bridgeAlive = bridgePid > 0 && pidAlive(bridgePid);\n const wdAlive = wdPid > 0 && pidAlive(wdPid);\n\n if (bridgeAlive && wdAlive) return { name: \"watchdog\", status: \"ok\", detail: `bridge:${bridgePid}, wd:${wdPid}` };\n if (!bridgeAlive && !wdAlive) return { name: \"watchdog\", status: \"failed\", detail: `bridge:${bridgePid} dead, wd:${wdPid} dead` };\n if (!wdAlive) return { name: \"watchdog\", status: \"failed\", detail: `bridge:${bridgePid} alive, wd:${wdPid} dead (unprotected)` };\n return { name: \"watchdog\", status: \"failed\", detail: `bridge:${bridgePid} dead, wd:${wdPid} alive (will restart)` };\n}\n\n// \u2500\u2500 Heart Probes \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\nasync function probeHeartbeat(): Promise<ProbeResult> {\n const lock = readJson(join(home, \"bridge.lock\"));\n if (!lock?.lastHeartbeat) return { name: \"heartbeat\", status: \"skipped\", detail: \"no bridge.lock\" };\n const ageMs = Date.now() - lock.lastHeartbeat;\n if (ageMs > 120_000) return { name: \"heartbeat\", status: \"failed\", detail: `stale (${ago(ageMs)})` };\n return { name: \"heartbeat\", status: \"ok\", detail: ago(ageMs) };\n}\n\n// #1261: single-bridge invariant \u2014 catches duplicate-bridge regressions at runtime.\n// pgrep counts the bridge processes. >1 means a second bridge is running (likely orphaned).\nasync function probeSingleBridge(): Promise<ProbeResult> {\n const { spawnSync } = await import(\"node:child_process\");\n const pgrep = spawnSync(\"pgrep\", [\"-f\", \"app/bundle/abtars.js\"], { encoding: \"utf-8\" });\n const pids = pgrep.stdout ? pgrep.stdout.trim().split(\"\\n\").filter(Boolean) : [];\n if (pids.length === 0) return { name: \"single-bridge\", status: \"skipped\", detail: \"no bridge running\" };\n if (pids.length === 1) return { name: \"single-bridge\", status: \"ok\", detail: `pid:${pids[0]}` };\n return { name: \"single-bridge\", status: \"failed\", detail: `${pids.length} bridges running: ${pids.join(\",\")}` };\n}\n\n// \u2500\u2500 Brain Probes \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\nasync function probeTransport(): Promise<ProbeResult> {\n const tPath = join(configDir, \"transport.json\");\n const t = readJson(tPath);\n if (!t) return { name: \"transport\", status: \"failed\", detail: \"transport.json missing or invalid\" };\n const agents = Object.keys(t.agents ?? {});\n if (agents.length === 0) return { name: \"transport\", status: \"failed\", detail: \"no agents configured\" };\n return { name: \"transport\", status: \"ok\", detail: `${agents.length} agent(s): ${agents.join(\", \")}` };\n}\n\nasync function probeSpin(): Promise<ProbeResult> {\n const lock = readJson(join(home, \"bridge.lock\"));\n if (!lock?.pid || !pidAlive(lock.pid)) return { name: \"spin\", status: \"failed\", detail: \"bridge not running\" };\n return { name: \"spin\", status: \"ok\", detail: \"bridge alive\" };\n}\n\nasync function probeKanban(): Promise<ProbeResult> {\n const dbPath = join(home, \"kanban\", \"kanban.db\");\n if (!existsSync(dbPath)) return { name: \"kanban\", status: \"skipped\", detail: \"kanban.db not found\" };\n const sharedNm = join(homedir(), \".local\", \"lib\", \"node_modules\", \"better-sqlite3\");\n if (!existsSync(sharedNm)) return { name: \"kanban\", status: \"skipped\", detail: \"better-sqlite3 not installed (run: abtars deps install)\" };\n let Db: any;\n try {\n const { createRequire } = await import(\"node:module\");\n const _require = createRequire(import.meta.url);\n Db = _require(sharedNm);\n } catch (err) {\n return { name: \"kanban\", status: \"skipped\", detail: `better-sqlite3 not loadable: ${err instanceof Error ? err.message : String(err)}` };\n }\n try {\n const db = new Db(dbPath, { readonly: true });\n const row = db.prepare(\"SELECT COUNT(*) as cnt FROM kanban_board\").get() as { cnt: number };\n const stuck = db.prepare(\"SELECT COUNT(*) as cnt FROM kanban_board WHERE status='running' AND updated_at < datetime('now', '-10 minutes')\").get() as { cnt: number };\n db.close();\n const detail = stuck.cnt > 0 ? `${row.cnt} cards, ${stuck.cnt} stuck` : `${row.cnt} cards`;\n return { name: \"kanban\", status: stuck.cnt > 0 ? \"failed\" : \"ok\", detail };\n } catch (err) {\n return { name: \"kanban\", status: \"skipped\", detail: `kanban.db query failed: ${err instanceof Error ? err.message : String(err)}` };\n }\n}\n\nasync function probeSkills(): Promise<ProbeResult> {\n const catalog = join(home, \"skills\", \"skills_catalog.md\");\n if (!existsSync(catalog)) return { name: \"skills\", status: \"failed\", detail: \"skills_catalog.md missing\" };\n const content = readFileSync(catalog, \"utf-8\");\n const count = (content.match(/^## /gm) || []).length;\n if (count === 0) return { name: \"skills\", status: \"failed\", detail: \"catalog empty\" };\n return { name: \"skills\", status: \"ok\", detail: `${count} loaded` };\n}\n\nasync function probeSha(): Promise<ProbeResult> {\n // Check if healer skill exists in catalog\n const catalog = join(home, \"skills\", \"skills_catalog.md\");\n if (!existsSync(catalog)) return { name: \"sha\", status: \"skipped\", detail: \"no catalog\" };\n const content = readFileSync(catalog, \"utf-8\");\n if (/self.heal|healer|auto.fix/i.test(content)) return { name: \"sha\", status: \"ok\", detail: \"rules loaded\" };\n // Check sha-policy.json\n if (existsSync(join(configDir, \"sha-policy.json\"))) return { name: \"sha\", status: \"ok\", detail: \"rules loaded\" };\n return { name: \"sha\", status: \"skipped\", detail: \"no healer rules configured\" };\n}\n\n// \u2500\u2500 Tribe Probes \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\nasync function probeAgentApi(): Promise<ProbeResult> {\n const env = readEnv();\n if (env.get(\"ENABLE_AGENT_API\") !== \"true\") return { name: \"agent-api\", status: \"skipped\", detail: \"not enabled\" };\n const port = parseInt(env.get(\"AGENT_API_PORT\") || \"7100\", 10);\n try {\n const { createConnection } = await import(\"node:net\");\n await new Promise<void>((resolve, reject) => {\n const sock = createConnection({ port, host: \"127.0.0.1\" }, () => { sock.destroy(); resolve(); });\n sock.on(\"error\", reject);\n sock.setTimeout(2000, () => { sock.destroy(); reject(new Error(\"timeout\")); });\n });\n return { name: \"agent-api\", status: \"ok\", detail: `:${port}` };\n } catch {\n return { name: \"agent-api\", status: \"failed\", detail: `:${port} not listening` };\n }\n}\n\nasync function probePeers(): Promise<ProbeResult> {\n const peersPath = join(configDir, \"peers.json\");\n const peers = readJson(peersPath);\n if (!peers) return { name: \"peers\", status: \"skipped\", detail: \"peers.json missing\" };\n const peerCount = Object.keys(peers.peers ?? {}).length;\n if (peerCount === 0) return { name: \"peers\", status: \"ok\", detail: \"no peers configured\" };\n\n const lock = readJson(join(home, \"bridge.lock\"));\n const gossipAge = lock?.lastGossipBroadcast ? ago(Date.now() - lock.lastGossipBroadcast) : \"unknown\";\n return { name: \"peers\", status: \"ok\", detail: `${peerCount} configured, gossip: ${gossipAge}` };\n}\n\nasync function probeTls(): Promise<ProbeResult> {\n const env = readEnv();\n if (env.get(\"ENABLE_AGENT_API\") !== \"true\") return { name: \"tls\", status: \"skipped\", detail: \"agent-api disabled\" };\n const certExists = existsSync(join(configDir, \"identity.crt\"));\n const keyExists = existsSync(join(configDir, \"identity.tls.key\"));\n if (certExists && keyExists) return { name: \"tls\", status: \"ok\", detail: \"certs present\" };\n const missing = [!certExists && \"identity.crt\", !keyExists && \"identity.tls.key\"].filter(Boolean);\n return { name: \"tls\", status: \"failed\", detail: `missing: ${missing.join(\", \")}` };\n}\n\nasync function probeA2a(): Promise<ProbeResult> {\n const peersPath = join(configDir, \"peers.json\");\n const peers = readJson(peersPath) as { gossipSecret?: string; peers?: Record<string, { token?: string }>; self?: { udpPort?: number } } | null;\n if (!peers?.self?.udpPort) return { name: \"a2a\", status: \"skipped\", detail: \"no gossip port configured\" };\n\n const port = peers.self.udpPort;\n try {\n const dgram = await import(\"node:dgram\");\n const { createHmac } = await import(\"node:crypto\");\n const key = peers.gossipSecret ?? Object.values(peers.peers ?? {})[0]?.token ?? \"default\";\n const payload = JSON.stringify({ type: \"ping\", name: \"__doctor__\" });\n const sig = createHmac(\"sha256\", key).update(payload).digest(\"base64url\").slice(0, 16);\n const ping = Buffer.from(`${payload}|${sig}`);\n\n const alive = await new Promise<boolean>((resolve) => {\n const sock = dgram.createSocket(\"udp4\");\n const timer = setTimeout(() => { sock.close(); resolve(false); }, 500);\n sock.on(\"message\", () => { clearTimeout(timer); sock.close(); resolve(true); });\n sock.on(\"error\", () => { clearTimeout(timer); sock.close(); resolve(false); });\n sock.send(ping, port, \"127.0.0.1\");\n });\n return { name: \"a2a\", status: alive ? \"ok\" : \"failed\", detail: alive ? `UDP :${port} alive` : `UDP :${port} no response` };\n } catch {\n return { name: \"a2a\", status: \"failed\", detail: \"UDP probe error\" };\n }\n}\n\n// \u2500\u2500 Soul Probes \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\nasync function probeMind(): Promise<ProbeResult> {\n try {\n const { loadAbmind } = await import(\"../../utils/abmind-lazy.js\");\n const mod = await loadAbmind();\n if (!mod) return { name: \"mind\", status: \"skipped\", detail: \"abmind not installed\" };\n return { name: \"mind\", status: \"ok\", detail: \"abmind loaded (in-process)\" };\n } catch {\n return { name: \"mind\", status: \"skipped\", detail: \"abmind load failed\" };\n }\n}\n\n// \u2500\u2500 Runner \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 async function runAllProbes(): Promise<DoctorOutput> {\n const start = Date.now();\n\n const [body, heart, brain, soul, tribe] = await Promise.all([\n Promise.all([probePlatforms(), probeDashboard(), probeSecurity(), probeWatchdog(), probeSingleBridge()].map(p => timedProbe(() => p))),\n Promise.all([probeHeartbeat()].map(p => timedProbe(() => p))),\n Promise.all([probeTransport(), probeSpin(), probeKanban(), probeSkills(), probeSha()].map(p => timedProbe(() => p))),\n Promise.all([probeMind()].map(p => timedProbe(() => p))),\n Promise.all([probeAgentApi(), probePeers(), probeTls(), probeA2a()].map(p => timedProbe(() => p))),\n ]);\n\n return { version: \"1.0\", totalMs: Date.now() - start, layers: { body, heart, brain, soul, tribe } };\n}\n\n// \u2500\u2500 Fix Logic \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 async function runFixes(): Promise<FixResult[]> {\n const { chmodSync, unlinkSync, mkdirSync, existsSync: ex, readdirSync: rd, statSync: st, readFileSync: rf, writeFileSync: wf } = await import(\"node:fs\");\n const { spawnSync } = await import(\"node:child_process\");\n const fixes: FixResult[] = [];\n\n function fix(probe: string, action: string, fn: () => void): void {\n try { fn(); fixes.push({ probe, action, success: true }); }\n catch { fixes.push({ probe, action, success: false }); }\n }\n\n // 1. chmod 700 sensitive dirs\n for (const dir of [\"config\", \"secret\", \"auth\", \"hooks\"]) {\n const p = join(home, dir);\n if (ex(p) && (st(p).mode & 0o777) !== 0o700) {\n fix(\"security\", `${dir}/ \u2192 700`, () => chmodSync(p, 0o700));\n }\n }\n\n // 2. chmod 600 secret files\n const secretDir = join(home, \"secret\");\n if (ex(secretDir)) {\n for (const f of rd(secretDir)) {\n const fp = join(secretDir, f);\n if (st(fp).isFile() && (st(fp).mode & 0o777) !== 0o600) {\n fix(\"security\", `${f} \u2192 600`, () => chmodSync(fp, 0o600));\n }\n }\n }\n\n // 3. chmod 600 config files\n if (ex(configDir)) {\n for (const f of rd(configDir)) {\n const fp = join(configDir, f);\n if (st(fp).isFile() && (st(fp).mode & 0o777) !== 0o600) {\n fix(\"security\", `config/${f} \u2192 600`, () => chmodSync(fp, 0o600));\n }\n }\n }\n\n // 4. Stale deploy.lock\n const deployLock = join(home, \"deploy.lock\");\n if (ex(deployLock)) {\n const lock = readJson(deployLock);\n const lockAge = lock?.startedAt ? (Date.now() - new Date(lock.startedAt).getTime()) / 1000 : 9999;\n const lockPid = lock?.pid ?? 0;\n if (lockAge > 300 && (lockPid === 0 || !pidAlive(lockPid))) {\n fix(\"watchdog\", \"removed stale deploy.lock\", () => unlinkSync(deployLock));\n }\n }\n\n // 5. Stale .start-reason\n const startReason = join(home, \".start-reason\");\n if (ex(startReason)) {\n const age = (Date.now() - st(startReason).mtimeMs) / 1000;\n if (age > 300) fix(\"watchdog\", \"removed stale .start-reason\", () => unlinkSync(startReason));\n }\n\n // 6. Create missing dirs\n for (const dir of [\"logs\", \"workspace\", \"overflow\", \"received\"]) {\n const p = join(home, dir);\n if (!ex(p)) fix(\"watchdog\", `created ${dir}/`, () => mkdirSync(p, { recursive: true }));\n }\n\n // 7. Kill orphan CLI processes\n try {\n const lock = readJson(join(home, \"bridge.lock\"));\n const bridgePid = lock?.pid ?? 0;\n const wdPid = lock?.watchdogPid ?? 0;\n\n // Orphan kiro-cli\n const kiro = spawnSync(\"pgrep\", [\"-f\", \"kiro-cli.*acp\"], { encoding: \"utf-8\" });\n if (kiro.stdout) {\n for (const pid of kiro.stdout.trim().split(\"\\n\").filter(Boolean).map(Number)) {\n if (pid > 0 && pid !== bridgePid && pid !== wdPid && pid !== process.pid) {\n fix(\"brain\", `killed orphan kiro-cli ${pid}`, () => process.kill(pid, \"SIGTERM\"));\n }\n }\n }\n\n // Orphan abtars-sleep\n const sleep = spawnSync(\"pgrep\", [\"-f\", \"abtars-sleep\"], { encoding: \"utf-8\" });\n if (sleep.stdout) {\n for (const pid of sleep.stdout.trim().split(\"\\n\").filter(Boolean).map(Number)) {\n if (pid > 0 && pid !== bridgePid) {\n fix(\"brain\", `killed orphan abtars-sleep ${pid}`, () => process.kill(pid, \"SIGTERM\"));\n }\n }\n }\n } catch { /* pgrep not available or no orphans */ }\n\n // 8. Stale locks/sockets\n for (const f of [\"sleep.lock\", \"memory.sock\"]) {\n const p = join(home, f);\n if (ex(p)) {\n const age = (Date.now() - st(p).mtimeMs) / 1000;\n const lock = readJson(join(home, \"bridge.lock\"));\n if (age > 600 && (!lock?.pid || !pidAlive(lock.pid))) {\n fix(\"watchdog\", `removed stale ${f}`, () => unlinkSync(p));\n }\n }\n }\n\n // 9. Retention: delete old logs/overflow/media\n const LOGS_KEEP_DAYS = 7;\n const DATA_KEEP_DAYS = 30;\n try {\n const cutoffLogs = Date.now() - LOGS_KEEP_DAYS * 86400_000;\n const cutoffData = Date.now() - DATA_KEEP_DAYS * 86400_000;\n\n for (const [dir, cutoff] of [[join(home, \"logs\"), cutoffLogs], [join(home, \"overflow\"), cutoffData], [join(home, \"received\", \"media\"), cutoffLogs]] as const) {\n if (!ex(dir)) continue;\n let deleted = 0;\n for (const f of rd(dir)) {\n const fp = join(dir, f);\n if (st(fp).isFile() && st(fp).mtimeMs < cutoff) { unlinkSync(fp); deleted++; }\n }\n if (deleted > 0) fixes.push({ probe: \"retention\", action: `deleted ${deleted} stale file(s) from ${dir.split(\"/\").pop()}`, success: true });\n }\n\n // Truncate audit.jsonl if >10MB\n const auditPath = join(home, \"auth\", \"audit.jsonl\");\n if (ex(auditPath) && st(auditPath).size > 10_000_000) {\n const lines = rf(auditPath, \"utf-8\").split(\"\\n\");\n wf(auditPath, lines.slice(-1000).join(\"\\n\"));\n fixes.push({ probe: \"retention\", action: \"truncated audit.jsonl\", success: true });\n }\n } catch { /* retention errors non-fatal */ }\n\n // 10. Kill duplicate bridges\n try {\n const lock = readJson(join(home, \"bridge.lock\"));\n const expectedPid = lock?.pid ?? 0;\n const pgrep = spawnSync(\"pgrep\", [\"-f\", \"abtars.*main\"], { encoding: \"utf-8\" });\n if (pgrep.stdout) {\n for (const pid of pgrep.stdout.trim().split(\"\\n\").filter(Boolean).map(Number)) {\n if (pid > 0 && pid !== expectedPid && pid !== process.pid) {\n fix(\"watchdog\", `killed duplicate bridge ${pid}`, () => process.kill(pid, \"SIGTERM\"));\n }\n }\n }\n } catch { /* non-fatal */ }\n\n // 11. Hooks dir perms\n const hooksDir = join(home, \"hooks\");\n if (ex(hooksDir) && (st(hooksDir).mode & 0o777) !== 0o700) {\n fix(\"security\", \"hooks/ \u2192 700\", () => chmodSync(hooksDir, 0o700));\n }\n\n // 12. Install watchdog service if missing\n try {\n const manifest = readJson(join(home, \"manifest.json\"));\n if (manifest?.installMode === \"daemon\") {\n const { platform } = await import(\"node:os\");\n if (platform() === \"darwin\") {\n const plist = `${home}/com.abtars.watchdog.plist`;\n const dst = `${process.env[\"HOME\"]}/Library/LaunchAgents/com.abtars.watchdog.plist`;\n if (ex(plist) && !ex(dst)) {\n fix(\"watchdog\", \"installed LaunchAgent\", () => {\n const { copyFileSync } = require(\"node:fs\");\n copyFileSync(plist, dst);\n spawnSync(\"launchctl\", [\"load\", dst]);\n });\n }\n } else {\n const svc = `${home}/abtars-watchdog.service`;\n const dst = `${process.env[\"HOME\"]}/.config/systemd/user/abtars-watchdog.service`;\n if (ex(svc) && !ex(dst)) {\n fix(\"watchdog\", \"installed systemd unit\", () => {\n mkdirSync(join(process.env[\"HOME\"]!, \".config\", \"systemd\", \"user\"), { recursive: true });\n const { copyFileSync } = require(\"node:fs\");\n copyFileSync(svc, dst);\n spawnSync(\"systemctl\", [\"--user\", \"enable\", \"--now\", \"abtars-watchdog.service\"]);\n });\n }\n }\n }\n } catch { /* non-fatal */ }\n\n return fixes;\n}\n\n// \u2500\u2500 Renderer \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\nconst ICON = { ok: \"\u2713\", failed: \"\u2717\", skipped: \"~\" } as const;\n\nexport function renderHuman(output: DoctorOutput): string {\n const lines: string[] = [];\n for (const [layer, probes] of Object.entries(output.layers) as [string, ProbeResult[]][]) {\n lines.push(`${layer.charAt(0).toUpperCase() + layer.slice(1)}:`);\n for (const p of probes) {\n const ms = p.ms && p.ms > 500 ? ` (${p.ms}ms)` : \"\";\n const detail = p.detail ? ` \u2014 ${p.detail}` : \"\";\n lines.push(` ${ICON[p.status]} ${p.name}${ms}${detail}`);\n }\n }\n const total = Object.values(output.layers).flat();\n const okCount = total.filter(r => r.status === \"ok\").length;\n lines.push(`\\n${okCount}/${total.length} ok (${(output.totalMs / 1000).toFixed(1)}s)`);\n return lines.join(\"\\n\");\n}\n\nexport function renderJson(output: DoctorOutput): string {\n return JSON.stringify(output, null, 2);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAQA;AAHA,SAAS,YAAY,cAAc,aAAa,gBAAgB;AAChE,SAAS,YAAY;AACrB,SAAS,eAAe;AA6BxB,IAAM,OAAO,WAAW;AACxB,IAAM,YAAY,KAAK,MAAM,QAAQ;AAErC,SAAS,SAAS,MAA0B;AAC1C,MAAI;AAAE,WAAO,KAAK,MAAM,aAAa,MAAM,OAAO,CAAC;AAAA,EAAG,QAAQ;AAAE,WAAO;AAAA,EAAM;AAC/E;AAEA,SAAS,UAA+B;AACtC,QAAM,UAAU,KAAK,WAAW,MAAM;AACtC,QAAM,MAAM,oBAAI,IAAoB;AACpC,MAAI,CAAC,WAAW,OAAO,EAAG,QAAO;AACjC,aAAW,QAAQ,aAAa,SAAS,OAAO,EAAE,MAAM,IAAI,GAAG;AAC7D,UAAM,IAAI,KAAK,MAAM,kBAAkB;AACvC,QAAI,EAAG,KAAI,IAAI,EAAE,CAAC,GAAI,EAAE,CAAC,EAAG,QAAQ,gBAAgB,EAAE,CAAC;AAAA,EACzD;AACA,SAAO;AACT;AAEA,SAAS,SAAS,KAAsB;AACtC,MAAI;AAAE,YAAQ,KAAK,KAAK,CAAC;AAAG,WAAO;AAAA,EAAM,QAAQ;AAAE,WAAO;AAAA,EAAO;AACnE;AAEA,SAAS,IAAI,IAAoB;AAC/B,QAAM,IAAI,KAAK,MAAM,KAAK,GAAI;AAC9B,MAAI,IAAI,GAAI,QAAO,GAAG,CAAC;AACvB,SAAO,GAAG,KAAK,MAAM,IAAI,EAAE,CAAC;AAC9B;AAEA,eAAe,WAAW,IAAsD;AAC9E,QAAM,QAAQ,KAAK,IAAI;AACvB,MA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