@zythum02/fello-server 0.1.46 → 0.1.48
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/README.md +11 -2
- package/out/renderer/assets/{_baseUniq-JI50qq3v.js → _baseUniq-D023PlQD.js} +1 -1
- package/out/renderer/assets/_baseUniq-D023PlQD.js.br +0 -0
- package/out/renderer/assets/_baseUniq-D023PlQD.js.gz +0 -0
- package/out/renderer/assets/{arc-D82BffDI.js → arc-Bgp6YWjh.js} +1 -1
- package/out/renderer/assets/arc-Bgp6YWjh.js.br +0 -0
- package/out/renderer/assets/arc-Bgp6YWjh.js.gz +0 -0
- package/out/renderer/assets/{architectureDiagram-Q4EWVU46-BBRMDHvv.js → architectureDiagram-Q4EWVU46-B40mk-XJ.js} +5 -5
- package/out/renderer/assets/architectureDiagram-Q4EWVU46-B40mk-XJ.js.br +0 -0
- package/out/renderer/assets/{architectureDiagram-Q4EWVU46-BBRMDHvv.js.gz → architectureDiagram-Q4EWVU46-B40mk-XJ.js.gz} +0 -0
- package/out/renderer/assets/{blockDiagram-DXYQGD6D-CiCuaiyL.js → blockDiagram-DXYQGD6D-BBdankH4.js} +6 -6
- package/out/renderer/assets/blockDiagram-DXYQGD6D-BBdankH4.js.br +0 -0
- package/out/renderer/assets/blockDiagram-DXYQGD6D-BBdankH4.js.gz +0 -0
- package/out/renderer/assets/{c4Diagram-AHTNJAMY-D9PM_R8p.js → c4Diagram-AHTNJAMY-BfRmGEJy.js} +2 -2
- package/out/renderer/assets/c4Diagram-AHTNJAMY-BfRmGEJy.js.br +0 -0
- package/out/renderer/assets/{c4Diagram-AHTNJAMY-D9PM_R8p.js.gz → c4Diagram-AHTNJAMY-BfRmGEJy.js.gz} +0 -0
- package/out/renderer/assets/{channel-CklIgqOK.js → channel-CHGPt1xL.js} +1 -1
- package/out/renderer/assets/{chunk-4BX2VUAB-DK0KQU1M.js → chunk-4BX2VUAB-Dbg5pk8D.js} +1 -1
- package/out/renderer/assets/{chunk-4TB4RGXK-CxHdBbdg.js → chunk-4TB4RGXK-CBjV8oAS.js} +5 -5
- package/out/renderer/assets/chunk-4TB4RGXK-CBjV8oAS.js.br +0 -0
- package/out/renderer/assets/chunk-4TB4RGXK-CBjV8oAS.js.gz +0 -0
- package/out/renderer/assets/{chunk-55IACEB6-ykIH_AN3.js → chunk-55IACEB6-_eYsto3b.js} +1 -1
- package/out/renderer/assets/{chunk-EDXVE4YY-DUOS0pBH.js → chunk-EDXVE4YY-DaXCRd0a.js} +1 -1
- package/out/renderer/assets/chunk-EDXVE4YY-DaXCRd0a.js.br +0 -0
- package/out/renderer/assets/chunk-EDXVE4YY-DaXCRd0a.js.gz +0 -0
- package/out/renderer/assets/{chunk-FMBD7UC4-Bm3BHCuh.js → chunk-FMBD7UC4-BwtLRaQu.js} +1 -1
- package/out/renderer/assets/{chunk-OYMX7WX6-DH9JMSMI.js → chunk-OYMX7WX6-h3hRYV_y.js} +3 -3
- package/out/renderer/assets/chunk-OYMX7WX6-h3hRYV_y.js.br +0 -0
- package/out/renderer/assets/chunk-OYMX7WX6-h3hRYV_y.js.gz +0 -0
- package/out/renderer/assets/{chunk-QZHKN3VN-LffrA1jF.js → chunk-QZHKN3VN-DUU1c_qe.js} +1 -1
- package/out/renderer/assets/{chunk-YZCP3GAM-B1pm_POM.js → chunk-YZCP3GAM-fw4tpwlW.js} +1 -1
- package/out/renderer/assets/chunk-YZCP3GAM-fw4tpwlW.js.br +0 -0
- package/out/renderer/assets/chunk-YZCP3GAM-fw4tpwlW.js.gz +0 -0
- package/out/renderer/assets/{classDiagram-6PBFFD2Q-O6uMquiH.js → classDiagram-6PBFFD2Q-ql_64jJs.js} +6 -6
- package/out/renderer/assets/{classDiagram-v2-HSJHXN6E-O6uMquiH.js → classDiagram-v2-HSJHXN6E-ql_64jJs.js} +6 -6
- package/out/renderer/assets/{clone-BhlnPWG5.js → clone-DZQhm3qm.js} +1 -1
- package/out/renderer/assets/{cose-bilkent-S5V4N54A-ljZi9cz-.js → cose-bilkent-S5V4N54A-Bjtibz95.js} +1 -1
- package/out/renderer/assets/cose-bilkent-S5V4N54A-Bjtibz95.js.br +0 -0
- package/out/renderer/assets/{cose-bilkent-S5V4N54A-ljZi9cz-.js.gz → cose-bilkent-S5V4N54A-Bjtibz95.js.gz} +0 -0
- package/out/renderer/assets/{dagre-KV5264BT-DqnNoP69.js → dagre-KV5264BT-DW9CSFRI.js} +6 -6
- package/out/renderer/assets/dagre-KV5264BT-DW9CSFRI.js.br +0 -0
- package/out/renderer/assets/dagre-KV5264BT-DW9CSFRI.js.gz +0 -0
- package/out/renderer/assets/{diagram-5BDNPKRD-pBYJseHI.js → diagram-5BDNPKRD-Dptg-C7O.js} +6 -6
- package/out/renderer/assets/diagram-5BDNPKRD-Dptg-C7O.js.br +0 -0
- package/out/renderer/assets/diagram-5BDNPKRD-Dptg-C7O.js.gz +0 -0
- package/out/renderer/assets/{diagram-G4DWMVQ6-IPm9zWeG.js → diagram-G4DWMVQ6-CX-JVWk7.js} +6 -6
- package/out/renderer/assets/diagram-G4DWMVQ6-CX-JVWk7.js.br +0 -0
- package/out/renderer/assets/diagram-G4DWMVQ6-CX-JVWk7.js.gz +0 -0
- package/out/renderer/assets/{diagram-MMDJMWI5-DSH58P_m.js → diagram-MMDJMWI5-DUDbXS-d.js} +5 -5
- package/out/renderer/assets/diagram-MMDJMWI5-DUDbXS-d.js.br +0 -0
- package/out/renderer/assets/diagram-MMDJMWI5-DUDbXS-d.js.gz +0 -0
- package/out/renderer/assets/{diagram-TYMM5635-Czl-GGCp.js → diagram-TYMM5635-9K0cZf20.js} +5 -5
- package/out/renderer/assets/diagram-TYMM5635-9K0cZf20.js.br +0 -0
- package/out/renderer/assets/diagram-TYMM5635-9K0cZf20.js.gz +0 -0
- package/out/renderer/assets/{erDiagram-SMLLAGMA-BENPNKae.js → erDiagram-SMLLAGMA-DaVqqCcL.js} +4 -4
- package/out/renderer/assets/erDiagram-SMLLAGMA-DaVqqCcL.js.br +0 -0
- package/out/renderer/assets/erDiagram-SMLLAGMA-DaVqqCcL.js.gz +0 -0
- package/out/renderer/assets/{flowDiagram-DWJPFMVM-T3H9Pqwa.js → flowDiagram-DWJPFMVM-BrHGujcg.js} +6 -6
- package/out/renderer/assets/flowDiagram-DWJPFMVM-BrHGujcg.js.br +0 -0
- package/out/renderer/assets/flowDiagram-DWJPFMVM-BrHGujcg.js.gz +0 -0
- package/out/renderer/assets/{ganttDiagram-T4ZO3ILL-Hh-AJvLC.js → ganttDiagram-T4ZO3ILL-D9tlSXpr.js} +2 -2
- package/out/renderer/assets/ganttDiagram-T4ZO3ILL-D9tlSXpr.js.br +0 -0
- package/out/renderer/assets/{ganttDiagram-T4ZO3ILL-Hh-AJvLC.js.gz → ganttDiagram-T4ZO3ILL-D9tlSXpr.js.gz} +0 -0
- package/out/renderer/assets/{gitGraphDiagram-UUTBAWPF-BDXB9jT_.js → gitGraphDiagram-UUTBAWPF-dFtBMZmH.js} +6 -6
- package/out/renderer/assets/gitGraphDiagram-UUTBAWPF-dFtBMZmH.js.br +0 -0
- package/out/renderer/assets/gitGraphDiagram-UUTBAWPF-dFtBMZmH.js.gz +0 -0
- package/out/renderer/assets/{graph-MWvZ47Hf.js → graph-CNmSjTZd.js} +2 -2
- package/out/renderer/assets/graph-CNmSjTZd.js.br +0 -0
- package/out/renderer/assets/graph-CNmSjTZd.js.gz +0 -0
- package/out/renderer/assets/{highlighted-body-OFNGDK62-Bvl34wyh.js → highlighted-body-OFNGDK62-EglK-D82.js} +1 -1
- package/out/renderer/assets/{index-BpPCAjGn.js → index-BuO0MTa-.js} +1490 -945
- package/out/renderer/assets/index-BuO0MTa-.js.br +0 -0
- package/out/renderer/assets/index-BuO0MTa-.js.gz +0 -0
- package/out/renderer/assets/{index-BTEKdfpj.css → index-BwSaFLCv.css} +1 -1
- package/out/renderer/assets/index-BwSaFLCv.css.br +0 -0
- package/out/renderer/assets/index-BwSaFLCv.css.gz +0 -0
- package/out/renderer/assets/{infoDiagram-42DDH7IO-Ca_9-363.js → infoDiagram-42DDH7IO-CwoWvadJ.js} +4 -4
- package/out/renderer/assets/{ishikawaDiagram-UXIWVN3A-D3GtyA4e.js → ishikawaDiagram-UXIWVN3A-9MhN_EF5.js} +1 -1
- package/out/renderer/assets/ishikawaDiagram-UXIWVN3A-9MhN_EF5.js.br +0 -0
- package/out/renderer/assets/ishikawaDiagram-UXIWVN3A-9MhN_EF5.js.gz +0 -0
- package/out/renderer/assets/{journeyDiagram-VCZTEJTY-DkQAlc0b.js → journeyDiagram-VCZTEJTY-BwKJh5pl.js} +4 -4
- package/out/renderer/assets/journeyDiagram-VCZTEJTY-BwKJh5pl.js.br +0 -0
- package/out/renderer/assets/journeyDiagram-VCZTEJTY-BwKJh5pl.js.gz +0 -0
- package/out/renderer/assets/{kanban-definition-6JOO6SKY-DamLzi6S.js → kanban-definition-6JOO6SKY-uDhuFOXv.js} +2 -2
- package/out/renderer/assets/kanban-definition-6JOO6SKY-uDhuFOXv.js.br +0 -0
- package/out/renderer/assets/kanban-definition-6JOO6SKY-uDhuFOXv.js.gz +0 -0
- package/out/renderer/assets/{layout-Dw_ZcO_L.js → layout-C7Mg2ajy.js} +4 -4
- package/out/renderer/assets/layout-C7Mg2ajy.js.br +0 -0
- package/out/renderer/assets/layout-C7Mg2ajy.js.gz +0 -0
- package/out/renderer/assets/{linear-Dh5vwFy4.js → linear-CkQXAw4A.js} +1 -1
- package/out/renderer/assets/linear-CkQXAw4A.js.br +0 -0
- package/out/renderer/assets/linear-CkQXAw4A.js.gz +0 -0
- package/out/renderer/assets/{min-DDCW5FhP.js → min-DRTvcNIL.js} +2 -2
- package/out/renderer/assets/min-DRTvcNIL.js.br +0 -0
- package/out/renderer/assets/min-DRTvcNIL.js.gz +0 -0
- package/out/renderer/assets/{mindmap-definition-QFDTVHPH-B3rcYXPK.js → mindmap-definition-QFDTVHPH-_8DjK16S.js} +3 -3
- package/out/renderer/assets/mindmap-definition-QFDTVHPH-_8DjK16S.js.br +0 -0
- package/out/renderer/assets/mindmap-definition-QFDTVHPH-_8DjK16S.js.gz +0 -0
- package/out/renderer/assets/{pieDiagram-DEJITSTG-CsCXUSKq.js → pieDiagram-DEJITSTG-owvRXepN.js} +6 -6
- package/out/renderer/assets/pieDiagram-DEJITSTG-owvRXepN.js.br +0 -0
- package/out/renderer/assets/pieDiagram-DEJITSTG-owvRXepN.js.gz +0 -0
- package/out/renderer/assets/{quadrantDiagram-34T5L4WZ-B91qjO1u.js → quadrantDiagram-34T5L4WZ-C9LRroTe.js} +2 -2
- package/out/renderer/assets/quadrantDiagram-34T5L4WZ-C9LRroTe.js.br +0 -0
- package/out/renderer/assets/quadrantDiagram-34T5L4WZ-C9LRroTe.js.gz +0 -0
- package/out/renderer/assets/{requirementDiagram-MS252O5E-oDcN7qN5.js → requirementDiagram-MS252O5E-Ds_36REQ.js} +3 -3
- package/out/renderer/assets/requirementDiagram-MS252O5E-Ds_36REQ.js.br +0 -0
- package/out/renderer/assets/requirementDiagram-MS252O5E-Ds_36REQ.js.gz +0 -0
- package/out/renderer/assets/{sankeyDiagram-XADWPNL6-DNQO_6oX.js → sankeyDiagram-XADWPNL6-6HuBoz3Q.js} +1 -1
- package/out/renderer/assets/sankeyDiagram-XADWPNL6-6HuBoz3Q.js.br +0 -0
- package/out/renderer/assets/sankeyDiagram-XADWPNL6-6HuBoz3Q.js.gz +0 -0
- package/out/renderer/assets/{sequenceDiagram-FGHM5R23-DCh5u6wY.js → sequenceDiagram-FGHM5R23-BdGUPHNX.js} +3 -3
- package/out/renderer/assets/sequenceDiagram-FGHM5R23-BdGUPHNX.js.br +0 -0
- package/out/renderer/assets/sequenceDiagram-FGHM5R23-BdGUPHNX.js.gz +0 -0
- package/out/renderer/assets/{stateDiagram-FHFEXIEX-DV0gaxkj.js → stateDiagram-FHFEXIEX-CruNLY-0.js} +8 -8
- package/out/renderer/assets/stateDiagram-FHFEXIEX-CruNLY-0.js.br +0 -0
- package/out/renderer/assets/stateDiagram-FHFEXIEX-CruNLY-0.js.gz +0 -0
- package/out/renderer/assets/{stateDiagram-v2-QKLJ7IA2-D1Sk_TKE.js → stateDiagram-v2-QKLJ7IA2-CfBaNTRC.js} +4 -4
- package/out/renderer/assets/{timeline-definition-GMOUNBTQ-Nq47TkPV.js → timeline-definition-GMOUNBTQ-CHPlJ2ZI.js} +2 -2
- package/out/renderer/assets/timeline-definition-GMOUNBTQ-CHPlJ2ZI.js.br +0 -0
- package/out/renderer/assets/timeline-definition-GMOUNBTQ-CHPlJ2ZI.js.gz +0 -0
- package/out/renderer/assets/{vennDiagram-DHZGUBPP-CMbmY-R_.js → vennDiagram-DHZGUBPP-DMdQtt7i.js} +1 -1
- package/out/renderer/assets/vennDiagram-DHZGUBPP-DMdQtt7i.js.br +0 -0
- package/out/renderer/assets/vennDiagram-DHZGUBPP-DMdQtt7i.js.gz +0 -0
- package/out/renderer/assets/{wardley-RL74JXVD-aLLqbf8o.js → wardley-RL74JXVD-HjjY3yRY.js} +3 -3
- package/out/renderer/assets/wardley-RL74JXVD-HjjY3yRY.js.br +0 -0
- package/out/renderer/assets/wardley-RL74JXVD-HjjY3yRY.js.gz +0 -0
- package/out/renderer/assets/{wardleyDiagram-NUSXRM2D-8Kc4VQIw.js → wardleyDiagram-NUSXRM2D-BI-3rQpv.js} +5 -5
- package/out/renderer/assets/wardleyDiagram-NUSXRM2D-BI-3rQpv.js.br +0 -0
- package/out/renderer/assets/wardleyDiagram-NUSXRM2D-BI-3rQpv.js.gz +0 -0
- package/out/renderer/assets/{xychartDiagram-5P7HB3ND-YtEoXmYf.js → xychartDiagram-5P7HB3ND-Bzj4rKGX.js} +2 -2
- package/out/renderer/assets/xychartDiagram-5P7HB3ND-Bzj4rKGX.js.br +0 -0
- package/out/renderer/assets/xychartDiagram-5P7HB3ND-Bzj4rKGX.js.gz +0 -0
- package/out/renderer/index.html +2 -2
- package/out/renderer/index.html.br +0 -0
- package/out/renderer/index.html.gz +0 -0
- package/out/server/main.js +874 -226
- package/package.json +3 -1
- package/out/renderer/assets/_baseUniq-JI50qq3v.js.br +0 -0
- package/out/renderer/assets/_baseUniq-JI50qq3v.js.gz +0 -0
- package/out/renderer/assets/arc-D82BffDI.js.br +0 -0
- package/out/renderer/assets/arc-D82BffDI.js.gz +0 -0
- package/out/renderer/assets/architectureDiagram-Q4EWVU46-BBRMDHvv.js.br +0 -0
- package/out/renderer/assets/blockDiagram-DXYQGD6D-CiCuaiyL.js.br +0 -0
- package/out/renderer/assets/blockDiagram-DXYQGD6D-CiCuaiyL.js.gz +0 -0
- package/out/renderer/assets/c4Diagram-AHTNJAMY-D9PM_R8p.js.br +0 -0
- package/out/renderer/assets/chunk-4TB4RGXK-CxHdBbdg.js.br +0 -0
- package/out/renderer/assets/chunk-4TB4RGXK-CxHdBbdg.js.gz +0 -0
- package/out/renderer/assets/chunk-EDXVE4YY-DUOS0pBH.js.br +0 -0
- package/out/renderer/assets/chunk-EDXVE4YY-DUOS0pBH.js.gz +0 -0
- package/out/renderer/assets/chunk-OYMX7WX6-DH9JMSMI.js.br +0 -0
- package/out/renderer/assets/chunk-OYMX7WX6-DH9JMSMI.js.gz +0 -0
- package/out/renderer/assets/chunk-YZCP3GAM-B1pm_POM.js.br +0 -0
- package/out/renderer/assets/chunk-YZCP3GAM-B1pm_POM.js.gz +0 -0
- package/out/renderer/assets/cose-bilkent-S5V4N54A-ljZi9cz-.js.br +0 -0
- package/out/renderer/assets/dagre-KV5264BT-DqnNoP69.js.br +0 -0
- package/out/renderer/assets/dagre-KV5264BT-DqnNoP69.js.gz +0 -0
- package/out/renderer/assets/diagram-5BDNPKRD-pBYJseHI.js.br +0 -0
- package/out/renderer/assets/diagram-5BDNPKRD-pBYJseHI.js.gz +0 -0
- package/out/renderer/assets/diagram-G4DWMVQ6-IPm9zWeG.js.br +0 -0
- package/out/renderer/assets/diagram-G4DWMVQ6-IPm9zWeG.js.gz +0 -0
- package/out/renderer/assets/diagram-MMDJMWI5-DSH58P_m.js.br +0 -0
- package/out/renderer/assets/diagram-MMDJMWI5-DSH58P_m.js.gz +0 -0
- package/out/renderer/assets/diagram-TYMM5635-Czl-GGCp.js.br +0 -0
- package/out/renderer/assets/diagram-TYMM5635-Czl-GGCp.js.gz +0 -0
- package/out/renderer/assets/erDiagram-SMLLAGMA-BENPNKae.js.br +0 -0
- package/out/renderer/assets/erDiagram-SMLLAGMA-BENPNKae.js.gz +0 -0
- package/out/renderer/assets/flowDiagram-DWJPFMVM-T3H9Pqwa.js.br +0 -0
- package/out/renderer/assets/flowDiagram-DWJPFMVM-T3H9Pqwa.js.gz +0 -0
- package/out/renderer/assets/ganttDiagram-T4ZO3ILL-Hh-AJvLC.js.br +0 -0
- package/out/renderer/assets/gitGraphDiagram-UUTBAWPF-BDXB9jT_.js.br +0 -0
- package/out/renderer/assets/gitGraphDiagram-UUTBAWPF-BDXB9jT_.js.gz +0 -0
- package/out/renderer/assets/graph-MWvZ47Hf.js.br +0 -0
- package/out/renderer/assets/graph-MWvZ47Hf.js.gz +0 -0
- package/out/renderer/assets/index-BTEKdfpj.css.br +0 -0
- package/out/renderer/assets/index-BTEKdfpj.css.gz +0 -0
- package/out/renderer/assets/index-BpPCAjGn.js.br +0 -0
- package/out/renderer/assets/index-BpPCAjGn.js.gz +0 -0
- package/out/renderer/assets/ishikawaDiagram-UXIWVN3A-D3GtyA4e.js.br +0 -0
- package/out/renderer/assets/ishikawaDiagram-UXIWVN3A-D3GtyA4e.js.gz +0 -0
- package/out/renderer/assets/journeyDiagram-VCZTEJTY-DkQAlc0b.js.br +0 -0
- package/out/renderer/assets/journeyDiagram-VCZTEJTY-DkQAlc0b.js.gz +0 -0
- package/out/renderer/assets/kanban-definition-6JOO6SKY-DamLzi6S.js.br +0 -0
- package/out/renderer/assets/kanban-definition-6JOO6SKY-DamLzi6S.js.gz +0 -0
- package/out/renderer/assets/layout-Dw_ZcO_L.js.br +0 -0
- package/out/renderer/assets/layout-Dw_ZcO_L.js.gz +0 -0
- package/out/renderer/assets/linear-Dh5vwFy4.js.br +0 -0
- package/out/renderer/assets/linear-Dh5vwFy4.js.gz +0 -0
- package/out/renderer/assets/min-DDCW5FhP.js.br +0 -0
- package/out/renderer/assets/min-DDCW5FhP.js.gz +0 -0
- package/out/renderer/assets/mindmap-definition-QFDTVHPH-B3rcYXPK.js.br +0 -0
- package/out/renderer/assets/mindmap-definition-QFDTVHPH-B3rcYXPK.js.gz +0 -0
- package/out/renderer/assets/pieDiagram-DEJITSTG-CsCXUSKq.js.br +0 -0
- package/out/renderer/assets/pieDiagram-DEJITSTG-CsCXUSKq.js.gz +0 -0
- package/out/renderer/assets/quadrantDiagram-34T5L4WZ-B91qjO1u.js.br +0 -0
- package/out/renderer/assets/quadrantDiagram-34T5L4WZ-B91qjO1u.js.gz +0 -0
- package/out/renderer/assets/requirementDiagram-MS252O5E-oDcN7qN5.js.br +0 -0
- package/out/renderer/assets/requirementDiagram-MS252O5E-oDcN7qN5.js.gz +0 -0
- package/out/renderer/assets/sankeyDiagram-XADWPNL6-DNQO_6oX.js.br +0 -0
- package/out/renderer/assets/sankeyDiagram-XADWPNL6-DNQO_6oX.js.gz +0 -0
- package/out/renderer/assets/sequenceDiagram-FGHM5R23-DCh5u6wY.js.br +0 -0
- package/out/renderer/assets/sequenceDiagram-FGHM5R23-DCh5u6wY.js.gz +0 -0
- package/out/renderer/assets/stateDiagram-FHFEXIEX-DV0gaxkj.js.br +0 -0
- package/out/renderer/assets/stateDiagram-FHFEXIEX-DV0gaxkj.js.gz +0 -0
- package/out/renderer/assets/timeline-definition-GMOUNBTQ-Nq47TkPV.js.br +0 -0
- package/out/renderer/assets/timeline-definition-GMOUNBTQ-Nq47TkPV.js.gz +0 -0
- package/out/renderer/assets/vennDiagram-DHZGUBPP-CMbmY-R_.js.br +0 -0
- package/out/renderer/assets/vennDiagram-DHZGUBPP-CMbmY-R_.js.gz +0 -0
- package/out/renderer/assets/wardley-RL74JXVD-aLLqbf8o.js.br +0 -0
- package/out/renderer/assets/wardley-RL74JXVD-aLLqbf8o.js.gz +0 -0
- package/out/renderer/assets/wardleyDiagram-NUSXRM2D-8Kc4VQIw.js.br +0 -0
- package/out/renderer/assets/wardleyDiagram-NUSXRM2D-8Kc4VQIw.js.gz +0 -0
- package/out/renderer/assets/xychartDiagram-5P7HB3ND-YtEoXmYf.js.br +0 -0
- package/out/renderer/assets/xychartDiagram-5P7HB3ND-YtEoXmYf.js.gz +0 -0
package/out/server/main.js
CHANGED
|
@@ -57,6 +57,9 @@ var DEFAULT_SETTINGS = {
|
|
|
57
57
|
volume: 50,
|
|
58
58
|
muted: false,
|
|
59
59
|
theme: "soft"
|
|
60
|
+
},
|
|
61
|
+
proxy: {
|
|
62
|
+
mode: "off"
|
|
60
63
|
}
|
|
61
64
|
};
|
|
62
65
|
function settingsPath() {
|
|
@@ -188,6 +191,20 @@ function readSettings() {
|
|
|
188
191
|
theme: raw2.theme === "soft" || raw2.theme === "crisp" ? raw2.theme : DEFAULT_SETTINGS.sound.theme
|
|
189
192
|
};
|
|
190
193
|
})();
|
|
194
|
+
const proxy = (() => {
|
|
195
|
+
const raw2 = rawObj && isObject(rawObj.proxy) ? rawObj.proxy : null;
|
|
196
|
+
if (!raw2) return DEFAULT_SETTINGS.proxy;
|
|
197
|
+
const mode = raw2.mode === "off" || raw2.mode === "manual" || raw2.mode === "system" ? raw2.mode : DEFAULT_SETTINGS.proxy.mode;
|
|
198
|
+
const str = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
199
|
+
return {
|
|
200
|
+
mode,
|
|
201
|
+
httpProxy: str(raw2.httpProxy),
|
|
202
|
+
httpsProxy: str(raw2.httpsProxy),
|
|
203
|
+
noProxy: str(raw2.noProxy),
|
|
204
|
+
username: str(raw2.username),
|
|
205
|
+
password: str(raw2.password)
|
|
206
|
+
};
|
|
207
|
+
})();
|
|
191
208
|
const snippets = Array.isArray(rawObj?.snippets) ? rawObj.snippets.filter(
|
|
192
209
|
(s) => isObject(s) && typeof s.id === "string" && typeof s.title === "string" && typeof s.content === "string"
|
|
193
210
|
) : [];
|
|
@@ -230,6 +247,7 @@ function readSettings() {
|
|
|
230
247
|
ilink,
|
|
231
248
|
editor,
|
|
232
249
|
sound,
|
|
250
|
+
proxy,
|
|
233
251
|
snippets,
|
|
234
252
|
imageGeneration
|
|
235
253
|
};
|
|
@@ -321,6 +339,7 @@ function getSettings() {
|
|
|
321
339
|
muted: meta.sound.muted,
|
|
322
340
|
theme: meta.sound.theme
|
|
323
341
|
},
|
|
342
|
+
proxy: meta.proxy ?? DEFAULT_SETTINGS.proxy,
|
|
324
343
|
snippets: meta.snippets ?? [],
|
|
325
344
|
imageGeneration: (meta.imageGeneration ?? []).map((p) => ({
|
|
326
345
|
id: p.id,
|
|
@@ -461,6 +480,21 @@ function updateSettings(settings) {
|
|
|
461
480
|
theme: settings.sound.theme === "soft" || settings.sound.theme === "crisp" ? settings.sound.theme : prevMeta.sound.theme
|
|
462
481
|
};
|
|
463
482
|
})(),
|
|
483
|
+
proxy: (() => {
|
|
484
|
+
if (!settings.proxy) {
|
|
485
|
+
return prevMeta.proxy;
|
|
486
|
+
}
|
|
487
|
+
const mode = settings.proxy.mode === "off" || settings.proxy.mode === "manual" || settings.proxy.mode === "system" ? settings.proxy.mode : prevMeta.proxy?.mode ?? DEFAULT_SETTINGS.proxy.mode;
|
|
488
|
+
const str = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
489
|
+
return {
|
|
490
|
+
mode,
|
|
491
|
+
httpProxy: str(settings.proxy.httpProxy),
|
|
492
|
+
httpsProxy: str(settings.proxy.httpsProxy),
|
|
493
|
+
noProxy: str(settings.proxy.noProxy),
|
|
494
|
+
username: str(settings.proxy.username),
|
|
495
|
+
password: str(settings.proxy.password)
|
|
496
|
+
};
|
|
497
|
+
})(),
|
|
464
498
|
snippets: settings.snippets ?? prevMeta.snippets,
|
|
465
499
|
imageGeneration: settings.imageGeneration ? settings.imageGeneration.map((p) => ({
|
|
466
500
|
id: p.id,
|
|
@@ -1505,19 +1539,6 @@ import { relative as relative2, resolve as resolve2, isAbsolute as isAbsolute2 }
|
|
|
1505
1539
|
function toPosixPath(p) {
|
|
1506
1540
|
return p.replace(/\\/g, "/");
|
|
1507
1541
|
}
|
|
1508
|
-
var IGNORE_NAME_SET = /* @__PURE__ */ new Set([".git", ".svn", ".hg", "node_modules", "vendor", "__pycache__"]);
|
|
1509
|
-
function isIgnorePath(fullPath, cwd) {
|
|
1510
|
-
if (fullPath === cwd) return false;
|
|
1511
|
-
const relPath = relative2(cwd, fullPath);
|
|
1512
|
-
if (!relPath) return false;
|
|
1513
|
-
const segments = relPath.split(/[\\/]+/);
|
|
1514
|
-
for (let i = 0; i < segments.length; i++) {
|
|
1515
|
-
const name = segments[i];
|
|
1516
|
-
if (!name || name === ".") continue;
|
|
1517
|
-
if (IGNORE_NAME_SET.has(name)) return true;
|
|
1518
|
-
}
|
|
1519
|
-
return false;
|
|
1520
|
-
}
|
|
1521
1542
|
function resolveSafePath(cwd, relativePath) {
|
|
1522
1543
|
const safeCwd = resolve2(cwd);
|
|
1523
1544
|
const fullPath = resolve2(safeCwd, relativePath || "");
|
|
@@ -2948,7 +2969,11 @@ function createAskUserModule(ctx, deps) {
|
|
|
2948
2969
|
async function askUser(options) {
|
|
2949
2970
|
const { sessionId } = options;
|
|
2950
2971
|
const askUserId = randomUUID2();
|
|
2951
|
-
const request = {
|
|
2972
|
+
const request = {
|
|
2973
|
+
...options,
|
|
2974
|
+
askUserId,
|
|
2975
|
+
timeoutAt: Date.now() + USER_REQUEST_TIMEOUT_MS
|
|
2976
|
+
};
|
|
2952
2977
|
sendEvent("ask-user-request", request);
|
|
2953
2978
|
const ilinkBridge = deps.ilink.getBridge();
|
|
2954
2979
|
const ilinkActiveSessionId = deps.ilink.getActiveSessionId();
|
|
@@ -4041,6 +4066,208 @@ async function closeACPClientTools(session) {
|
|
|
4041
4066
|
import { createMCPClient } from "@ai-sdk/mcp";
|
|
4042
4067
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
4043
4068
|
import { ContentBlockSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
4069
|
+
|
|
4070
|
+
// src/backend/proxy.ts
|
|
4071
|
+
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
4072
|
+
import http from "node:http";
|
|
4073
|
+
import https from "node:https";
|
|
4074
|
+
import { Agent as UndiciAgent, EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
|
|
4075
|
+
import { ProxyAgent as NodeProxyAgent } from "proxy-agent";
|
|
4076
|
+
var PROXY_ENV_KEYS = [
|
|
4077
|
+
"HTTP_PROXY",
|
|
4078
|
+
"HTTPS_PROXY",
|
|
4079
|
+
"NO_PROXY",
|
|
4080
|
+
"http_proxy",
|
|
4081
|
+
"https_proxy",
|
|
4082
|
+
"no_proxy"
|
|
4083
|
+
];
|
|
4084
|
+
var currentConfig = { enabled: false };
|
|
4085
|
+
function settingProxyInfoToProxyConfig(input) {
|
|
4086
|
+
if (!input || input.mode === "off") return { enabled: false };
|
|
4087
|
+
const str = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
4088
|
+
return {
|
|
4089
|
+
enabled: true,
|
|
4090
|
+
httpProxy: str(input.httpProxy),
|
|
4091
|
+
httpsProxy: str(input.httpsProxy),
|
|
4092
|
+
noProxy: str(input.noProxy),
|
|
4093
|
+
username: str(input.username),
|
|
4094
|
+
password: str(input.password)
|
|
4095
|
+
};
|
|
4096
|
+
}
|
|
4097
|
+
function normalizeProxyUrl(raw) {
|
|
4098
|
+
if (!raw) return void 0;
|
|
4099
|
+
const trimmed = raw.trim();
|
|
4100
|
+
if (!trimmed) return void 0;
|
|
4101
|
+
let url;
|
|
4102
|
+
try {
|
|
4103
|
+
url = new URL(trimmed);
|
|
4104
|
+
} catch {
|
|
4105
|
+
try {
|
|
4106
|
+
url = new URL(`http://${trimmed}`);
|
|
4107
|
+
} catch {
|
|
4108
|
+
return void 0;
|
|
4109
|
+
}
|
|
4110
|
+
}
|
|
4111
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") return void 0;
|
|
4112
|
+
return url.toString().replace(/\/+$/, "");
|
|
4113
|
+
}
|
|
4114
|
+
function withAuth(url, username, password) {
|
|
4115
|
+
if (!username) return url;
|
|
4116
|
+
try {
|
|
4117
|
+
const parsed = new URL(url);
|
|
4118
|
+
parsed.username = username;
|
|
4119
|
+
if (password) parsed.password = password;
|
|
4120
|
+
return parsed.toString().replace(/\/+$/, "");
|
|
4121
|
+
} catch {
|
|
4122
|
+
return url;
|
|
4123
|
+
}
|
|
4124
|
+
}
|
|
4125
|
+
function buildProxyEnv() {
|
|
4126
|
+
const config = currentConfig;
|
|
4127
|
+
if (config.enabled === false) return {};
|
|
4128
|
+
const httpProxy = normalizeProxyUrl(config.httpProxy);
|
|
4129
|
+
const httpsProxy = normalizeProxyUrl(config.httpsProxy ?? config.httpProxy);
|
|
4130
|
+
if (!httpProxy && !httpsProxy) return {};
|
|
4131
|
+
const noProxy = config.noProxy?.trim();
|
|
4132
|
+
const env = {};
|
|
4133
|
+
if (httpProxy) {
|
|
4134
|
+
const httpUrl = withAuth(httpProxy, config.username, config.password);
|
|
4135
|
+
if (httpUrl) {
|
|
4136
|
+
env.HTTP_PROXY = httpUrl;
|
|
4137
|
+
env.http_proxy = httpUrl;
|
|
4138
|
+
}
|
|
4139
|
+
}
|
|
4140
|
+
if (httpsProxy) {
|
|
4141
|
+
const httpsUrl = withAuth(httpsProxy, config.username, config.password);
|
|
4142
|
+
if (httpsUrl) {
|
|
4143
|
+
env.HTTPS_PROXY = httpsUrl;
|
|
4144
|
+
env.https_proxy = httpsUrl;
|
|
4145
|
+
}
|
|
4146
|
+
}
|
|
4147
|
+
if (noProxy) {
|
|
4148
|
+
env.NO_PROXY = noProxy;
|
|
4149
|
+
env.no_proxy = noProxy;
|
|
4150
|
+
}
|
|
4151
|
+
return env;
|
|
4152
|
+
}
|
|
4153
|
+
function setProcessEnv(env) {
|
|
4154
|
+
for (const key of PROXY_ENV_KEYS) {
|
|
4155
|
+
if (env[key]) {
|
|
4156
|
+
process.env[key] = env[key];
|
|
4157
|
+
} else {
|
|
4158
|
+
delete process.env[key];
|
|
4159
|
+
}
|
|
4160
|
+
}
|
|
4161
|
+
}
|
|
4162
|
+
function resetGlobalDispatchers() {
|
|
4163
|
+
setGlobalDispatcher(new UndiciAgent());
|
|
4164
|
+
http.globalAgent = new http.Agent();
|
|
4165
|
+
https.globalAgent = new https.Agent();
|
|
4166
|
+
}
|
|
4167
|
+
function enableGlobalDispatchers() {
|
|
4168
|
+
setGlobalDispatcher(new EnvHttpProxyAgent());
|
|
4169
|
+
http.globalAgent = new NodeProxyAgent();
|
|
4170
|
+
https.globalAgent = new NodeProxyAgent();
|
|
4171
|
+
}
|
|
4172
|
+
function applyProxy(config) {
|
|
4173
|
+
currentConfig = config;
|
|
4174
|
+
if (config.enabled === false) {
|
|
4175
|
+
setProcessEnv({});
|
|
4176
|
+
resetGlobalDispatchers();
|
|
4177
|
+
return;
|
|
4178
|
+
}
|
|
4179
|
+
const env = buildProxyEnv();
|
|
4180
|
+
if (Object.keys(env).length === 0) {
|
|
4181
|
+
setProcessEnv({});
|
|
4182
|
+
resetGlobalDispatchers();
|
|
4183
|
+
return;
|
|
4184
|
+
}
|
|
4185
|
+
setProcessEnv(env);
|
|
4186
|
+
enableGlobalDispatchers();
|
|
4187
|
+
}
|
|
4188
|
+
function detectSystemProxy() {
|
|
4189
|
+
const envHttp = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy;
|
|
4190
|
+
if (envHttp) {
|
|
4191
|
+
return {
|
|
4192
|
+
enabled: true,
|
|
4193
|
+
httpProxy: process.env.HTTP_PROXY || process.env.http_proxy || void 0,
|
|
4194
|
+
httpsProxy: process.env.HTTPS_PROXY || process.env.https_proxy || void 0,
|
|
4195
|
+
noProxy: process.env.NO_PROXY || process.env.no_proxy || void 0
|
|
4196
|
+
};
|
|
4197
|
+
}
|
|
4198
|
+
try {
|
|
4199
|
+
if (process.platform === "darwin") {
|
|
4200
|
+
const stdout = execFileSync2("scutil", ["--proxy"], { timeout: 3e3 }).toString();
|
|
4201
|
+
return parseScutilProxy(stdout);
|
|
4202
|
+
}
|
|
4203
|
+
if (process.platform === "win32") {
|
|
4204
|
+
const stdout = execFileSync2("netsh", ["winhttp", "show", "proxy"], {
|
|
4205
|
+
timeout: 3e3
|
|
4206
|
+
}).toString();
|
|
4207
|
+
return parseNetshProxy(stdout);
|
|
4208
|
+
}
|
|
4209
|
+
} catch {
|
|
4210
|
+
}
|
|
4211
|
+
return { enabled: false };
|
|
4212
|
+
}
|
|
4213
|
+
function parseScutilProxy(stdout) {
|
|
4214
|
+
const get = (key) => {
|
|
4215
|
+
const m = stdout.match(new RegExp(`^\\s*${key}\\s*:\\s*(.+)$`, "m"));
|
|
4216
|
+
return m ? m[1].trim() : void 0;
|
|
4217
|
+
};
|
|
4218
|
+
const host = (key) => {
|
|
4219
|
+
const value = get(key);
|
|
4220
|
+
if (!value || value === "<null>") return void 0;
|
|
4221
|
+
return value.replace(/^"|"$/g, "");
|
|
4222
|
+
};
|
|
4223
|
+
const port2 = (key) => {
|
|
4224
|
+
const value = get(key);
|
|
4225
|
+
return value && value !== "0" ? value : void 0;
|
|
4226
|
+
};
|
|
4227
|
+
const build = (enableKey, hostKey, portKey) => {
|
|
4228
|
+
if (get(enableKey) !== "1") return void 0;
|
|
4229
|
+
const h = host(hostKey);
|
|
4230
|
+
if (!h) return void 0;
|
|
4231
|
+
const p = port2(portKey);
|
|
4232
|
+
let proxyUrl = `http://${h}`;
|
|
4233
|
+
if (p) {
|
|
4234
|
+
proxyUrl += `:${p}`;
|
|
4235
|
+
}
|
|
4236
|
+
return proxyUrl;
|
|
4237
|
+
};
|
|
4238
|
+
const httpProxy = build("HTTPEnable", "HTTPProxy", "HTTPPort");
|
|
4239
|
+
const httpsProxy = build("HTTPSEnable", "HTTPSProxy", "HTTPSPort");
|
|
4240
|
+
if (!httpProxy && !httpsProxy) return { enabled: false };
|
|
4241
|
+
return { enabled: true, httpProxy, httpsProxy };
|
|
4242
|
+
}
|
|
4243
|
+
function parseNetshProxy(stdout) {
|
|
4244
|
+
const match = stdout.match(/Proxy\s*Server\(s\)\s*:\s*(.+)$/m);
|
|
4245
|
+
if (!match) return { enabled: false };
|
|
4246
|
+
const raw = match[1].trim();
|
|
4247
|
+
if (!raw || raw === "<none>") return { enabled: false };
|
|
4248
|
+
let httpProxy;
|
|
4249
|
+
let httpsProxy;
|
|
4250
|
+
for (const part of raw.split(";")) {
|
|
4251
|
+
const trimmed = part.trim();
|
|
4252
|
+
if (!trimmed) continue;
|
|
4253
|
+
const eq = trimmed.indexOf("=");
|
|
4254
|
+
if (eq === -1) {
|
|
4255
|
+
httpProxy = `http://${trimmed}`;
|
|
4256
|
+
httpsProxy = `http://${trimmed}`;
|
|
4257
|
+
} else {
|
|
4258
|
+
const scheme = trimmed.slice(0, eq).trim().toLowerCase();
|
|
4259
|
+
const value = trimmed.slice(eq + 1).trim();
|
|
4260
|
+
if (scheme === "http") httpProxy = `http://${value}`;
|
|
4261
|
+
else if (scheme === "https") httpsProxy = `http://${value}`;
|
|
4262
|
+
}
|
|
4263
|
+
}
|
|
4264
|
+
const bypass = stdout.match(/Bypass\s*List\s*:\s*(.+)$/m);
|
|
4265
|
+
const noProxy = bypass ? bypass[1].trim().replace(/<local>/g, "localhost,127.0.0.1") : void 0;
|
|
4266
|
+
if (!httpProxy && !httpsProxy) return { enabled: false };
|
|
4267
|
+
return { enabled: true, httpProxy, httpsProxy, noProxy };
|
|
4268
|
+
}
|
|
4269
|
+
|
|
4270
|
+
// src/agents/mcp-tools.ts
|
|
4044
4271
|
function sanitizeName(input) {
|
|
4045
4272
|
return input.trim().toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
|
|
4046
4273
|
}
|
|
@@ -4090,7 +4317,10 @@ async function createClient(server, cwd) {
|
|
|
4090
4317
|
transport: new StdioClientTransport({
|
|
4091
4318
|
command: server.command,
|
|
4092
4319
|
args: server.args,
|
|
4093
|
-
env:
|
|
4320
|
+
env: {
|
|
4321
|
+
...buildProxyEnv(),
|
|
4322
|
+
...toEnvRecord(server.env)
|
|
4323
|
+
},
|
|
4094
4324
|
cwd
|
|
4095
4325
|
}),
|
|
4096
4326
|
clientName: "fello-openai-compatible-agent",
|
|
@@ -4754,7 +4984,6 @@ function buildWorkspaceSystemPrompt(cwd, additionalDirectories) {
|
|
|
4754
4984
|
const workspacePrompt = `Current session working directory (cwd): ${cwd}.${extras} Use this as the default base path for relative paths.`;
|
|
4755
4985
|
const now = /* @__PURE__ */ new Date();
|
|
4756
4986
|
const dateStr = now.toLocaleDateString("en-CA");
|
|
4757
|
-
const timeStr = now.toLocaleTimeString("en-US", { hour12: false });
|
|
4758
4987
|
const weekday = now.toLocaleDateString("en-US", { weekday: "long" });
|
|
4759
4988
|
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
4760
4989
|
const timezoneOffset = -now.getTimezoneOffset();
|
|
@@ -4763,7 +4992,7 @@ function buildWorkspaceSystemPrompt(cwd, additionalDirectories) {
|
|
|
4763
4992
|
const offsetMinutes = String(Math.abs(timezoneOffset) % 60).padStart(2, "0");
|
|
4764
4993
|
const utcOffset = `UTC${offsetSign}${offsetHours}:${offsetMinutes}`;
|
|
4765
4994
|
const platform = process.platform;
|
|
4766
|
-
const envContext = `Date
|
|
4995
|
+
const envContext = `Date: ${dateStr} (${weekday})
|
|
4767
4996
|
Timezone: ${timezone} (${utcOffset})
|
|
4768
4997
|
Platform: ${platform}`;
|
|
4769
4998
|
let prompt = `${BASE_SYSTEM_PROMPT}
|
|
@@ -5508,14 +5737,14 @@ function spawnOpenaiCompatibleApiAgent(options) {
|
|
|
5508
5737
|
}
|
|
5509
5738
|
|
|
5510
5739
|
// src/backend/agent/agent-terminal-manager.ts
|
|
5511
|
-
import { spawn as spawn2, execFileSync as
|
|
5740
|
+
import { spawn as spawn2, execFileSync as execFileSync3 } from "child_process";
|
|
5512
5741
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
5513
5742
|
function detectTerminalOutputEncoding() {
|
|
5514
5743
|
if (process.platform !== "win32") {
|
|
5515
5744
|
return "utf-8";
|
|
5516
5745
|
}
|
|
5517
5746
|
try {
|
|
5518
|
-
const output =
|
|
5747
|
+
const output = execFileSync3("cmd", ["/d", "/s", "/c", "chcp"], {
|
|
5519
5748
|
encoding: "buffer",
|
|
5520
5749
|
windowsHide: true
|
|
5521
5750
|
});
|
|
@@ -5816,7 +6045,7 @@ var ACPBridge = class {
|
|
|
5816
6045
|
const applyConfigOptions = this.applyConfigOptions.bind(this);
|
|
5817
6046
|
const terminalManager = this.terminalManager;
|
|
5818
6047
|
const sessionsCwdMap = this._sessionsCwdMap;
|
|
5819
|
-
|
|
6048
|
+
let clientApp = client({ name: "Fello" }).onRequest(methods3.client.session.requestPermission, (ctx) => {
|
|
5820
6049
|
return onPermission(ctx.params);
|
|
5821
6050
|
}).onNotification(methods3.client.session.update, (ctx) => {
|
|
5822
6051
|
const params = ctx.params;
|
|
@@ -5859,25 +6088,12 @@ var ACPBridge = class {
|
|
|
5859
6088
|
}).onRequest(methods3.client.terminal.release, (ctx) => {
|
|
5860
6089
|
terminalManager.release(ctx.params.terminalId);
|
|
5861
6090
|
return {};
|
|
5862
|
-
})
|
|
5863
|
-
|
|
5864
|
-
(
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
).onNotification(
|
|
5869
|
-
"_kiro.dev/commands/available",
|
|
5870
|
-
(p) => p,
|
|
5871
|
-
(ctx) => {
|
|
5872
|
-
onExtNotification("_kiro.dev/commands/available", ctx.params);
|
|
5873
|
-
}
|
|
5874
|
-
).onNotification(
|
|
5875
|
-
"_kiro.dev/subagent/list_update",
|
|
5876
|
-
(p) => p,
|
|
5877
|
-
(ctx) => {
|
|
5878
|
-
onExtNotification("_kiro.dev/subagent/list_update", ctx.params);
|
|
5879
|
-
}
|
|
5880
|
-
);
|
|
6091
|
+
});
|
|
6092
|
+
for (const spec of this.options.extNotificationSpecs) {
|
|
6093
|
+
clientApp = clientApp.onNotification(spec.method, spec.parse, (ctx) => {
|
|
6094
|
+
onExtNotification(spec.method, ctx.params);
|
|
6095
|
+
});
|
|
6096
|
+
}
|
|
5881
6097
|
this.connection = clientApp.connect(stream);
|
|
5882
6098
|
const initResult = await this.connection.agent.request(methods3.agent.initialize, {
|
|
5883
6099
|
protocolVersion: PROTOCOL_VERSION2,
|
|
@@ -6139,6 +6355,327 @@ var ACPBridge = class {
|
|
|
6139
6355
|
}
|
|
6140
6356
|
};
|
|
6141
6357
|
|
|
6358
|
+
// src/backend/acp-adapters/acp-adapter.ts
|
|
6359
|
+
var AcpAdapter = class {
|
|
6360
|
+
/** Ext notification specs to register on the ACP client. */
|
|
6361
|
+
extNotificationSpecs = [];
|
|
6362
|
+
/**
|
|
6363
|
+
* Process an incoming notification.
|
|
6364
|
+
* - Return null to drop.
|
|
6365
|
+
* - Return [notification] to pass through (possibly transformed).
|
|
6366
|
+
* - Return [notification, ...synthetic] to pass through AND produce
|
|
6367
|
+
* additional notifications.
|
|
6368
|
+
*
|
|
6369
|
+
* Results go through the REST of the pipeline (title check, broadcast,
|
|
6370
|
+
* storage) — NOT through preprocessNotification again, so adapters
|
|
6371
|
+
* can safely inspect _meta fields without recursion risk. The original
|
|
6372
|
+
* notification (if included in results) is stored, which preserves
|
|
6373
|
+
* _meta for replay/state-rebuild.
|
|
6374
|
+
*/
|
|
6375
|
+
preprocessNotification(notification, _currentSessionId, _agentId) {
|
|
6376
|
+
return [notification];
|
|
6377
|
+
}
|
|
6378
|
+
handleExtNotification(_method, _params, _currentSessionId, _agentId) {
|
|
6379
|
+
return [];
|
|
6380
|
+
}
|
|
6381
|
+
// ── State lifecycle (default no-ops) ───────────────────────────────
|
|
6382
|
+
rekey(_oldKey, _newKey) {
|
|
6383
|
+
}
|
|
6384
|
+
cleanup(_sessionKey) {
|
|
6385
|
+
}
|
|
6386
|
+
clearAll() {
|
|
6387
|
+
}
|
|
6388
|
+
};
|
|
6389
|
+
|
|
6390
|
+
// src/backend/acp-adapters/codebuddy-adapter.ts
|
|
6391
|
+
var CODEBUDDY_STATUS_MAP = {
|
|
6392
|
+
running: "in_progress",
|
|
6393
|
+
completed: "completed",
|
|
6394
|
+
idle: "in_progress",
|
|
6395
|
+
pending: "pending",
|
|
6396
|
+
failed: "failed"
|
|
6397
|
+
};
|
|
6398
|
+
var CodebuddyAdapter = class extends AcpAdapter {
|
|
6399
|
+
stateMap = /* @__PURE__ */ new Map();
|
|
6400
|
+
/**
|
|
6401
|
+
* Per-session max _meta.timestamp for content chunks
|
|
6402
|
+
* (agent_message_chunk / agent_thought_chunk). Used to detect
|
|
6403
|
+
* replayed chunks whose timestamp is earlier than the max seen
|
|
6404
|
+
* for the same session. Only content chunks with
|
|
6405
|
+
* codebuddy.ai/requestId participate — other notification types
|
|
6406
|
+
* (tool_call, session_info_update, etc.) are not tracked.
|
|
6407
|
+
*/
|
|
6408
|
+
sessionUpdateTimestamp = /* @__PURE__ */ new Map();
|
|
6409
|
+
/**
|
|
6410
|
+
* One unified hook for all notification processing:
|
|
6411
|
+
*
|
|
6412
|
+
* 1. Replay detection — drop agent_message_chunk / agent_thought_chunk
|
|
6413
|
+
* whose _meta.timestamp is earlier than the max seen for the same
|
|
6414
|
+
* session. CodeBuddy sometimes re-sends previous responses during
|
|
6415
|
+
* a new prompt; these replayed chunks carry original (earlier)
|
|
6416
|
+
* timestamps. Only applies to chunks that carry codebuddy.ai/requestId.
|
|
6417
|
+
* 2. memberEvent chunk routing — rewrite notification.sessionId from
|
|
6418
|
+
* parent to member sessionId (CodeBuddy stamps all member chunks
|
|
6419
|
+
* with the parent session).
|
|
6420
|
+
* 3. Drop teammate-directed user_message_chunks (task assignments from
|
|
6421
|
+
* team-lead to members, wrapped in <teammate-message>).
|
|
6422
|
+
* 4. teamUpdate lifecycle — convert team_created / member_status_change /
|
|
6423
|
+
* team_deleted into AddonSessionUpdate broadcasts via _meta.fello.update.
|
|
6424
|
+
*
|
|
6425
|
+
* Returns null to drop, [notification] to pass through, or
|
|
6426
|
+
* [notification, ...synthetic] to pass through + produce additional.
|
|
6427
|
+
* Results go through the REST of the pipeline (not this method again).
|
|
6428
|
+
*/
|
|
6429
|
+
preprocessNotification(notification, currentSessionId, agentId) {
|
|
6430
|
+
const meta = notification.update?._meta;
|
|
6431
|
+
const sessionUpdate = notification.update?.sessionUpdate;
|
|
6432
|
+
const requestId = meta?.["codebuddy.ai/requestId"];
|
|
6433
|
+
const metaTimestamp = meta?.["timestamp"];
|
|
6434
|
+
if (typeof requestId === "string" && typeof metaTimestamp === "string" && (sessionUpdate === "agent_message_chunk" || sessionUpdate === "agent_thought_chunk")) {
|
|
6435
|
+
const ts = Date.parse(metaTimestamp);
|
|
6436
|
+
if (!isNaN(ts)) {
|
|
6437
|
+
const maxTs = this.sessionUpdateTimestamp.get(currentSessionId);
|
|
6438
|
+
if (maxTs !== void 0 && ts < maxTs) {
|
|
6439
|
+
return null;
|
|
6440
|
+
}
|
|
6441
|
+
if (maxTs === void 0 || ts > maxTs) {
|
|
6442
|
+
this.sessionUpdateTimestamp.set(currentSessionId, ts);
|
|
6443
|
+
}
|
|
6444
|
+
}
|
|
6445
|
+
}
|
|
6446
|
+
const memberEvent = meta?.["codebuddy.ai/memberEvent"];
|
|
6447
|
+
if (sessionUpdate === "user_message_chunk" && typeof memberEvent === "string") {
|
|
6448
|
+
return null;
|
|
6449
|
+
}
|
|
6450
|
+
let result = notification;
|
|
6451
|
+
if (typeof memberEvent === "string") {
|
|
6452
|
+
const state = this.stateMap.get(currentSessionId);
|
|
6453
|
+
const memberSessionId = state?.members.get(memberEvent)?.sessionId;
|
|
6454
|
+
if (memberSessionId && notification.sessionId !== memberSessionId) {
|
|
6455
|
+
result = { ...notification, sessionId: memberSessionId };
|
|
6456
|
+
}
|
|
6457
|
+
}
|
|
6458
|
+
const teamUpdate = meta?.["codebuddy.ai/teamUpdate"];
|
|
6459
|
+
if (teamUpdate && typeof teamUpdate === "object") {
|
|
6460
|
+
const synthetic = this.processTeamUpdate(
|
|
6461
|
+
teamUpdate,
|
|
6462
|
+
currentSessionId,
|
|
6463
|
+
agentId
|
|
6464
|
+
);
|
|
6465
|
+
return synthetic.length > 0 ? [result, ...synthetic] : [result];
|
|
6466
|
+
}
|
|
6467
|
+
return [result];
|
|
6468
|
+
}
|
|
6469
|
+
// ── Team update processing ─────────────────────────────────────────
|
|
6470
|
+
/**
|
|
6471
|
+
* Process a codebuddy.ai/teamUpdate event. Updates the cached team
|
|
6472
|
+
* state and produces synthetic subagent_update notifications.
|
|
6473
|
+
*
|
|
6474
|
+
* - team_created → cache teamName as activeTeamName (no notifications)
|
|
6475
|
+
* - member_status_change → resolve each member's teamName via event-level
|
|
6476
|
+
* teamName / existing member's teamName / activeTeamName, then produce
|
|
6477
|
+
* a subagent_update notification per member
|
|
6478
|
+
* - team_deleted → mark still-active members of THAT team as `failed`
|
|
6479
|
+
* (preserving completed/failed), then produce a notification per active
|
|
6480
|
+
* member. Only removes that team's members from the cache.
|
|
6481
|
+
* - team_idle / others → no-op
|
|
6482
|
+
*/
|
|
6483
|
+
processTeamUpdate(teamUpdate, currentSessionId, agentId) {
|
|
6484
|
+
const type = typeof teamUpdate.type === "string" ? teamUpdate.type : "";
|
|
6485
|
+
const eventTeamName = typeof teamUpdate.teamName === "string" ? teamUpdate.teamName : null;
|
|
6486
|
+
const getOrCreateState = () => {
|
|
6487
|
+
let s = this.stateMap.get(currentSessionId);
|
|
6488
|
+
if (!s) {
|
|
6489
|
+
s = { members: /* @__PURE__ */ new Map(), activeTeamName: null };
|
|
6490
|
+
this.stateMap.set(currentSessionId, s);
|
|
6491
|
+
}
|
|
6492
|
+
return s;
|
|
6493
|
+
};
|
|
6494
|
+
const makeSubagentUpdate = (memberSessionId, memberName, prompt, status) => {
|
|
6495
|
+
const update = {
|
|
6496
|
+
sessionUpdate: "subagent_update",
|
|
6497
|
+
sessionId: memberSessionId,
|
|
6498
|
+
...memberName !== void 0 && { name: memberName },
|
|
6499
|
+
...prompt !== void 0 && { prompt },
|
|
6500
|
+
status
|
|
6501
|
+
};
|
|
6502
|
+
return {
|
|
6503
|
+
sessionId: currentSessionId.replace(`${agentId}:`, ""),
|
|
6504
|
+
update: {
|
|
6505
|
+
sessionUpdate: "session_info_update",
|
|
6506
|
+
_meta: { fello: { update } }
|
|
6507
|
+
}
|
|
6508
|
+
};
|
|
6509
|
+
};
|
|
6510
|
+
if (type === "team_created") {
|
|
6511
|
+
const state = getOrCreateState();
|
|
6512
|
+
if (eventTeamName) state.activeTeamName = eventTeamName;
|
|
6513
|
+
return [];
|
|
6514
|
+
}
|
|
6515
|
+
if (type === "team_deleted") {
|
|
6516
|
+
const state = this.stateMap.get(currentSessionId);
|
|
6517
|
+
if (!state || !eventTeamName) return [];
|
|
6518
|
+
const results = [];
|
|
6519
|
+
for (const [memberName, member] of state.members) {
|
|
6520
|
+
if (member.teamName !== eventTeamName) continue;
|
|
6521
|
+
if (member.status !== "completed" && member.status !== "failed") {
|
|
6522
|
+
results.push(makeSubagentUpdate(member.sessionId, void 0, void 0, "failed"));
|
|
6523
|
+
}
|
|
6524
|
+
state.members.delete(memberName);
|
|
6525
|
+
}
|
|
6526
|
+
if (state.activeTeamName === eventTeamName) {
|
|
6527
|
+
state.activeTeamName = null;
|
|
6528
|
+
}
|
|
6529
|
+
return results;
|
|
6530
|
+
}
|
|
6531
|
+
if (type === "member_status_change") {
|
|
6532
|
+
const state = getOrCreateState();
|
|
6533
|
+
const members = Array.isArray(teamUpdate.members) ? teamUpdate.members : [];
|
|
6534
|
+
const results = [];
|
|
6535
|
+
for (const member of members) {
|
|
6536
|
+
if (!member || typeof member !== "object") continue;
|
|
6537
|
+
const m = member;
|
|
6538
|
+
const memberName = typeof m.name === "string" ? m.name : null;
|
|
6539
|
+
const memberSessionId = typeof m.sessionId === "string" ? m.sessionId : null;
|
|
6540
|
+
if (!memberName || !memberSessionId) continue;
|
|
6541
|
+
const status = typeof m.status === "string" ? CODEBUDDY_STATUS_MAP[m.status] ?? "in_progress" : "in_progress";
|
|
6542
|
+
const existing = state.members.get(memberName);
|
|
6543
|
+
const resolvedTeamName = eventTeamName ?? existing?.teamName ?? state.activeTeamName ?? "";
|
|
6544
|
+
state.members.set(memberName, {
|
|
6545
|
+
sessionId: memberSessionId,
|
|
6546
|
+
status,
|
|
6547
|
+
teamName: resolvedTeamName
|
|
6548
|
+
});
|
|
6549
|
+
const prompt = typeof m.description === "string" ? m.description : void 0;
|
|
6550
|
+
results.push(makeSubagentUpdate(memberSessionId, memberName, prompt, status));
|
|
6551
|
+
}
|
|
6552
|
+
return results;
|
|
6553
|
+
}
|
|
6554
|
+
return [];
|
|
6555
|
+
}
|
|
6556
|
+
// ── State lifecycle (mirror bridge-connect) ────────────────────────
|
|
6557
|
+
rekey(oldKey, newKey) {
|
|
6558
|
+
const state = this.stateMap.get(oldKey);
|
|
6559
|
+
if (state) {
|
|
6560
|
+
this.stateMap.delete(oldKey);
|
|
6561
|
+
this.stateMap.set(newKey, state);
|
|
6562
|
+
}
|
|
6563
|
+
}
|
|
6564
|
+
cleanup(sessionKey) {
|
|
6565
|
+
this.stateMap.delete(sessionKey);
|
|
6566
|
+
this.sessionUpdateTimestamp.delete(sessionKey);
|
|
6567
|
+
}
|
|
6568
|
+
clearAll() {
|
|
6569
|
+
this.stateMap.clear();
|
|
6570
|
+
this.sessionUpdateTimestamp.clear();
|
|
6571
|
+
}
|
|
6572
|
+
};
|
|
6573
|
+
|
|
6574
|
+
// src/backend/acp-adapters/kiro-adapter.ts
|
|
6575
|
+
var KIRO_STATUS_MAP = {
|
|
6576
|
+
pending: "pending",
|
|
6577
|
+
working: "in_progress",
|
|
6578
|
+
terminated: "completed",
|
|
6579
|
+
failed: "failed"
|
|
6580
|
+
};
|
|
6581
|
+
var parseMetadata = (p) => p;
|
|
6582
|
+
var parseCommandsAvailable = (p) => p;
|
|
6583
|
+
var parseSubagentList = (p) => p;
|
|
6584
|
+
var KiroAdapter = class extends AcpAdapter {
|
|
6585
|
+
/** Ext notification specs declared here, registered by ACPBridge. */
|
|
6586
|
+
extNotificationSpecs = [
|
|
6587
|
+
{ method: "_kiro.dev/metadata", parse: parseMetadata },
|
|
6588
|
+
{ method: "_kiro.dev/commands/available", parse: parseCommandsAvailable },
|
|
6589
|
+
{ method: "_kiro.dev/subagent/list_update", parse: parseSubagentList }
|
|
6590
|
+
];
|
|
6591
|
+
/**
|
|
6592
|
+
* Translate a Kiro ext notification into synthetic SessionNotification(s).
|
|
6593
|
+
* Returns an empty array if the method is unrecognized.
|
|
6594
|
+
*/
|
|
6595
|
+
handleExtNotification(method, params, currentSessionId, agentId) {
|
|
6596
|
+
switch (method) {
|
|
6597
|
+
case "_kiro.dev/metadata":
|
|
6598
|
+
return this.handleMetadata(params, currentSessionId, agentId);
|
|
6599
|
+
case "_kiro.dev/commands/available":
|
|
6600
|
+
return this.handleCommandsAvailable(params, currentSessionId, agentId);
|
|
6601
|
+
case "_kiro.dev/subagent/list_update":
|
|
6602
|
+
return this.handleSubagentListUpdate(params, currentSessionId, agentId);
|
|
6603
|
+
default:
|
|
6604
|
+
return [];
|
|
6605
|
+
}
|
|
6606
|
+
}
|
|
6607
|
+
// ── Handlers ──────────────────────────────────────────────────────
|
|
6608
|
+
handleMetadata(params, currentSessionId, agentId) {
|
|
6609
|
+
if (typeof params === "object" && params && "sessionId" in params && typeof params.sessionId === "string" && "contextUsagePercentage" in params && typeof params.contextUsagePercentage === "number" && currentSessionId === `${agentId}:${params.sessionId}`) {
|
|
6610
|
+
return [
|
|
6611
|
+
{
|
|
6612
|
+
sessionId: params.sessionId,
|
|
6613
|
+
update: {
|
|
6614
|
+
sessionUpdate: "usage_update",
|
|
6615
|
+
used: params.contextUsagePercentage / 100,
|
|
6616
|
+
size: 1
|
|
6617
|
+
}
|
|
6618
|
+
}
|
|
6619
|
+
];
|
|
6620
|
+
}
|
|
6621
|
+
return [];
|
|
6622
|
+
}
|
|
6623
|
+
handleCommandsAvailable(params, currentSessionId, agentId) {
|
|
6624
|
+
if (typeof params === "object" && params && "sessionId" in params && typeof params.sessionId === "string" && "commands" in params && Array.isArray(params.commands) && currentSessionId === `${agentId}:${params.sessionId}`) {
|
|
6625
|
+
const commands = [];
|
|
6626
|
+
for (const item of params.commands) {
|
|
6627
|
+
if (typeof item === "object" && item && "name" in item && typeof item.name === "string") {
|
|
6628
|
+
commands.push({
|
|
6629
|
+
name: item.name.replace(/^\//, ""),
|
|
6630
|
+
description: item.description ? String(item.description) : ""
|
|
6631
|
+
});
|
|
6632
|
+
}
|
|
6633
|
+
}
|
|
6634
|
+
return [
|
|
6635
|
+
{
|
|
6636
|
+
sessionId: params.sessionId,
|
|
6637
|
+
update: {
|
|
6638
|
+
sessionUpdate: "available_commands_update",
|
|
6639
|
+
availableCommands: commands
|
|
6640
|
+
}
|
|
6641
|
+
}
|
|
6642
|
+
];
|
|
6643
|
+
}
|
|
6644
|
+
return [];
|
|
6645
|
+
}
|
|
6646
|
+
handleSubagentListUpdate(params, currentSessionId, agentId) {
|
|
6647
|
+
if (typeof params === "object" && params && currentSessionId && "subagents" in params && Array.isArray(params.subagents)) {
|
|
6648
|
+
const results = [];
|
|
6649
|
+
for (const subagent of params.subagents) {
|
|
6650
|
+
if (typeof subagent === "object" && subagent && "sessionId" in subagent && typeof subagent.sessionId === "string") {
|
|
6651
|
+
const update = {
|
|
6652
|
+
sessionUpdate: "subagent_update",
|
|
6653
|
+
sessionId: subagent.sessionId,
|
|
6654
|
+
name: typeof subagent.sessionName === "string" ? subagent.sessionName : void 0,
|
|
6655
|
+
prompt: typeof subagent.initialQuery === "string" ? subagent.initialQuery : void 0,
|
|
6656
|
+
status: KIRO_STATUS_MAP[String(subagent?.status?.type)]
|
|
6657
|
+
};
|
|
6658
|
+
results.push({
|
|
6659
|
+
sessionId: currentSessionId.replace(`${agentId}:`, ""),
|
|
6660
|
+
update: {
|
|
6661
|
+
sessionUpdate: "session_info_update",
|
|
6662
|
+
_meta: { fello: { update } }
|
|
6663
|
+
}
|
|
6664
|
+
});
|
|
6665
|
+
}
|
|
6666
|
+
}
|
|
6667
|
+
return results;
|
|
6668
|
+
}
|
|
6669
|
+
return [];
|
|
6670
|
+
}
|
|
6671
|
+
};
|
|
6672
|
+
|
|
6673
|
+
// src/backend/acp-adapters/adapters.ts
|
|
6674
|
+
var codebuddyAdapter = new CodebuddyAdapter();
|
|
6675
|
+
var kiroAdapter = new KiroAdapter();
|
|
6676
|
+
var adapters = [codebuddyAdapter, kiroAdapter];
|
|
6677
|
+
var extNotificationSpecs = adapters.flatMap((a) => a.extNotificationSpecs);
|
|
6678
|
+
|
|
6142
6679
|
// src/backend/agent/resolve-agent-info.ts
|
|
6143
6680
|
function resolveAgentInfo(agentId) {
|
|
6144
6681
|
const settings = storageOps.getSettings();
|
|
@@ -6200,10 +6737,58 @@ function createBridgeConnectModule(ctx, deps) {
|
|
|
6200
6737
|
}
|
|
6201
6738
|
sessionAgentMap.set(sessionKey, agentId);
|
|
6202
6739
|
let currentSessionId = null;
|
|
6740
|
+
function processSessionUpdate(notification) {
|
|
6741
|
+
let results = [notification];
|
|
6742
|
+
if (currentSessionId) {
|
|
6743
|
+
for (const adapter of adapters) {
|
|
6744
|
+
const next = [];
|
|
6745
|
+
for (const n of results) {
|
|
6746
|
+
const processed = adapter.preprocessNotification(n, currentSessionId, agentId);
|
|
6747
|
+
if (processed !== null) {
|
|
6748
|
+
next.push(...processed);
|
|
6749
|
+
}
|
|
6750
|
+
}
|
|
6751
|
+
results = next;
|
|
6752
|
+
}
|
|
6753
|
+
}
|
|
6754
|
+
if (results.length === 0) return;
|
|
6755
|
+
if (!currentSessionId) return;
|
|
6756
|
+
for (const result of results) {
|
|
6757
|
+
const sessionUpdate = result.update?.sessionUpdate;
|
|
6758
|
+
if (currentSessionId && currentSessionId === `${agentId}:${result.sessionId}`) {
|
|
6759
|
+
if (sessionUpdate === "session_info_update") {
|
|
6760
|
+
if (result.update.title) {
|
|
6761
|
+
storage.updateSession(currentSessionId, { title: result.update.title });
|
|
6762
|
+
const updated = storage.getSession(currentSessionId);
|
|
6763
|
+
if (updated) sendEvent("session-changed", { session: updated });
|
|
6764
|
+
}
|
|
6765
|
+
}
|
|
6766
|
+
if (sessionUpdate === "usage_update") {
|
|
6767
|
+
publishUsage(currentSessionId, result.update);
|
|
6768
|
+
continue;
|
|
6769
|
+
}
|
|
6770
|
+
if (sessionUpdate === "available_commands_update") {
|
|
6771
|
+
publishAvailableCommands(currentSessionId, result.update.availableCommands ?? []);
|
|
6772
|
+
continue;
|
|
6773
|
+
}
|
|
6774
|
+
if (sessionUpdate === "current_mode_update") {
|
|
6775
|
+
const session = storage.getSession(currentSessionId);
|
|
6776
|
+
if (session && session.modes) {
|
|
6777
|
+
session.modes.currentModeId = result.update.currentModeId ?? null;
|
|
6778
|
+
storage.updateSession(currentSessionId, { modes: session.modes });
|
|
6779
|
+
const updated = storage.getSession(currentSessionId);
|
|
6780
|
+
if (updated) sendEvent("session-changed", { session: updated });
|
|
6781
|
+
}
|
|
6782
|
+
}
|
|
6783
|
+
}
|
|
6784
|
+
broadcastAndSaveSessionUpdate(currentSessionId, result);
|
|
6785
|
+
}
|
|
6786
|
+
}
|
|
6203
6787
|
const agentInfo = resolveAgentInfo(agentId);
|
|
6204
6788
|
const bridge = new ACPBridge(agentId, {
|
|
6205
6789
|
agentInfo,
|
|
6206
6790
|
cwd,
|
|
6791
|
+
extNotificationSpecs,
|
|
6207
6792
|
onSessionConnect: (connection) => {
|
|
6208
6793
|
currentSessionId = `${agentId}:${connection.sessionId}`;
|
|
6209
6794
|
storage.updateSession(currentSessionId, { connectionStatus: "connected" }, false);
|
|
@@ -6211,96 +6796,17 @@ function createBridgeConnectModule(ctx, deps) {
|
|
|
6211
6796
|
if (updated) sendEvent("session-changed", { session: updated });
|
|
6212
6797
|
},
|
|
6213
6798
|
onSessionUpdate: (notification) => {
|
|
6214
|
-
|
|
6215
|
-
if (currentSessionId) {
|
|
6216
|
-
if (currentSessionId === `${agentId}:${notification.sessionId}`) {
|
|
6217
|
-
if (sessionUpdate === "session_info_update") {
|
|
6218
|
-
if (notification.update.title) {
|
|
6219
|
-
storage.updateSession(currentSessionId, { title: notification.update.title });
|
|
6220
|
-
const updated = storage.getSession(currentSessionId);
|
|
6221
|
-
if (updated) sendEvent("session-changed", { session: updated });
|
|
6222
|
-
}
|
|
6223
|
-
}
|
|
6224
|
-
if (sessionUpdate === "usage_update") {
|
|
6225
|
-
publishUsage(currentSessionId, notification.update);
|
|
6226
|
-
return;
|
|
6227
|
-
}
|
|
6228
|
-
if (sessionUpdate === "available_commands_update") {
|
|
6229
|
-
publishAvailableCommands(
|
|
6230
|
-
currentSessionId,
|
|
6231
|
-
notification.update.availableCommands ?? []
|
|
6232
|
-
);
|
|
6233
|
-
return;
|
|
6234
|
-
}
|
|
6235
|
-
if (sessionUpdate === "current_mode_update") {
|
|
6236
|
-
const session = storage.getSession(currentSessionId);
|
|
6237
|
-
if (session && session.modes) {
|
|
6238
|
-
session.modes.currentModeId = notification.update.currentModeId ?? null;
|
|
6239
|
-
storage.updateSession(currentSessionId, { modes: session.modes });
|
|
6240
|
-
const updated = storage.getSession(currentSessionId);
|
|
6241
|
-
if (updated) sendEvent("session-changed", { session: updated });
|
|
6242
|
-
}
|
|
6243
|
-
}
|
|
6244
|
-
}
|
|
6245
|
-
broadcastAndSaveSessionUpdate(currentSessionId, notification);
|
|
6246
|
-
}
|
|
6799
|
+
processSessionUpdate(notification);
|
|
6247
6800
|
},
|
|
6248
6801
|
onExtNotification: (method, params) => {
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
});
|
|
6255
|
-
}
|
|
6256
|
-
return;
|
|
6257
|
-
}
|
|
6258
|
-
if (method === "_kiro.dev/commands/available") {
|
|
6259
|
-
if (typeof params === "object" && params && "sessionId" in params && typeof params.sessionId === "string" && "commands" in params && Array.isArray(params.commands) && currentSessionId === `${agentId}:${params.sessionId}`) {
|
|
6260
|
-
const commands = [];
|
|
6261
|
-
for (const item of params.commands) {
|
|
6262
|
-
if (typeof item === "object" && item && "name" in item && typeof item.name === "string") {
|
|
6263
|
-
commands.push({
|
|
6264
|
-
name: item.name.replace(/^\//, ""),
|
|
6265
|
-
description: item.description ? String(item.description) : ""
|
|
6266
|
-
});
|
|
6267
|
-
}
|
|
6268
|
-
}
|
|
6269
|
-
publishAvailableCommands(currentSessionId, commands);
|
|
6270
|
-
}
|
|
6271
|
-
return;
|
|
6272
|
-
}
|
|
6273
|
-
if (method === "_kiro.dev/subagent/list_update") {
|
|
6274
|
-
if (typeof params === "object" && params && currentSessionId && "subagents" in params && Array.isArray(params.subagents)) {
|
|
6275
|
-
for (const subagent of params.subagents) {
|
|
6276
|
-
if (typeof subagent === "object" && subagent && "sessionId" in subagent && typeof subagent.sessionId === "string") {
|
|
6277
|
-
const update = {
|
|
6278
|
-
sessionUpdate: "subagent_update",
|
|
6279
|
-
sessionId: subagent.sessionId,
|
|
6280
|
-
name: typeof subagent.sessionName === "string" ? subagent.sessionName : void 0,
|
|
6281
|
-
prompt: typeof subagent.initialQuery === "string" ? subagent.initialQuery : void 0,
|
|
6282
|
-
status: {
|
|
6283
|
-
pending: "pending",
|
|
6284
|
-
working: "in_progress",
|
|
6285
|
-
terminated: "completed",
|
|
6286
|
-
failed: "failed"
|
|
6287
|
-
}[String(subagent?.status?.type)]
|
|
6288
|
-
};
|
|
6289
|
-
broadcastAndSaveSessionUpdate(currentSessionId, {
|
|
6290
|
-
sessionId: currentSessionId.replace(`${agentId}:`, ""),
|
|
6291
|
-
update: {
|
|
6292
|
-
sessionUpdate: "session_info_update",
|
|
6293
|
-
_meta: {
|
|
6294
|
-
fello: {
|
|
6295
|
-
update
|
|
6296
|
-
}
|
|
6297
|
-
}
|
|
6298
|
-
}
|
|
6299
|
-
});
|
|
6300
|
-
}
|
|
6802
|
+
for (const adapter of adapters) {
|
|
6803
|
+
const results = adapter.handleExtNotification(method, params, currentSessionId, agentId);
|
|
6804
|
+
if (results.length > 0) {
|
|
6805
|
+
for (const result of results) {
|
|
6806
|
+
processSessionUpdate(result);
|
|
6301
6807
|
}
|
|
6808
|
+
return;
|
|
6302
6809
|
}
|
|
6303
|
-
return;
|
|
6304
6810
|
}
|
|
6305
6811
|
},
|
|
6306
6812
|
onPermissionRequest: async (request) => {
|
|
@@ -6382,12 +6888,14 @@ function createBridgeConnectModule(ctx, deps) {
|
|
|
6382
6888
|
sessionAgentMap.delete(oldKey);
|
|
6383
6889
|
sessionAgentMap.set(newKey, agentId);
|
|
6384
6890
|
}
|
|
6891
|
+
for (const a of adapters) a.rekey(oldKey, newKey);
|
|
6385
6892
|
}
|
|
6386
6893
|
async function killBridge(sessionKey) {
|
|
6387
6894
|
const p = bridges.get(sessionKey);
|
|
6388
6895
|
if (p) {
|
|
6389
6896
|
bridges.delete(sessionKey);
|
|
6390
6897
|
sessionAgentMap.delete(sessionKey);
|
|
6898
|
+
for (const a of adapters) a.cleanup(sessionKey);
|
|
6391
6899
|
try {
|
|
6392
6900
|
const b = await p;
|
|
6393
6901
|
await b.kill();
|
|
@@ -6417,6 +6925,7 @@ function createBridgeConnectModule(ctx, deps) {
|
|
|
6417
6925
|
}
|
|
6418
6926
|
bridges.clear();
|
|
6419
6927
|
sessionAgentMap.clear();
|
|
6928
|
+
for (const a of adapters) a.clearAll();
|
|
6420
6929
|
await Promise.all(killPromises);
|
|
6421
6930
|
}
|
|
6422
6931
|
return {
|
|
@@ -6677,10 +7186,109 @@ import {
|
|
|
6677
7186
|
copyFile
|
|
6678
7187
|
} from "fs/promises";
|
|
6679
7188
|
import * as mimeTypes4 from "mime-types";
|
|
6680
|
-
import { dirname as
|
|
7189
|
+
import { dirname as dirname7, join as join17, relative as relative8, extname as extname2, basename as basename3 } from "path";
|
|
7190
|
+
|
|
7191
|
+
// src/backend/project/git-utils.ts
|
|
7192
|
+
import { execFile, spawn as spawn3 } from "child_process";
|
|
7193
|
+
import { dirname as dirname6, relative as relative7 } from "path";
|
|
7194
|
+
import { promisify } from "util";
|
|
7195
|
+
var execFileAsync = promisify(execFile);
|
|
7196
|
+
async function getGitIgnoredPaths(cwd, relPaths) {
|
|
7197
|
+
if (relPaths.length === 0) return /* @__PURE__ */ new Set();
|
|
7198
|
+
return new Promise((resolve8) => {
|
|
7199
|
+
const child = spawn3("git", ["check-ignore", "-z", "--stdin"], {
|
|
7200
|
+
cwd,
|
|
7201
|
+
timeout: 3e3,
|
|
7202
|
+
// spawn defaults windowsHide to false; without this, every readDir
|
|
7203
|
+
// would flash a console window on Windows.
|
|
7204
|
+
windowsHide: true
|
|
7205
|
+
});
|
|
7206
|
+
const chunks = [];
|
|
7207
|
+
child.stdout.on("data", (chunk) => chunks.push(chunk));
|
|
7208
|
+
child.on("error", () => resolve8(/* @__PURE__ */ new Set()));
|
|
7209
|
+
child.on("close", () => {
|
|
7210
|
+
const ignored = /* @__PURE__ */ new Set();
|
|
7211
|
+
for (const p of Buffer.concat(chunks).toString("utf8").split("\0")) {
|
|
7212
|
+
if (p) ignored.add(toPosixPath(p));
|
|
7213
|
+
}
|
|
7214
|
+
resolve8(ignored);
|
|
7215
|
+
});
|
|
7216
|
+
try {
|
|
7217
|
+
child.stdin.write(relPaths.join("\0") + "\0");
|
|
7218
|
+
child.stdin.end();
|
|
7219
|
+
} catch {
|
|
7220
|
+
resolve8(/* @__PURE__ */ new Set());
|
|
7221
|
+
}
|
|
7222
|
+
});
|
|
7223
|
+
}
|
|
7224
|
+
async function getGitStatus(cwd) {
|
|
7225
|
+
try {
|
|
7226
|
+
const { stdout } = await execFileAsync("git", ["status", "--porcelain", "-b", "-z"], {
|
|
7227
|
+
cwd,
|
|
7228
|
+
timeout: 2e3,
|
|
7229
|
+
maxBuffer: 10 * 1024 * 1024
|
|
7230
|
+
});
|
|
7231
|
+
const lines = stdout.split("\0").filter(Boolean);
|
|
7232
|
+
if (lines.length === 0) return null;
|
|
7233
|
+
let branchLine = lines[0];
|
|
7234
|
+
let branch = "";
|
|
7235
|
+
if (branchLine.startsWith("## ")) {
|
|
7236
|
+
branchLine = branchLine.slice(3);
|
|
7237
|
+
if (branchLine.startsWith("No commits yet on "))
|
|
7238
|
+
branch = branchLine.slice("No commits yet on ".length);
|
|
7239
|
+
else if (branchLine.startsWith("HEAD (no branch)")) branch = "HEAD";
|
|
7240
|
+
else branch = branchLine.split("...")[0];
|
|
7241
|
+
}
|
|
7242
|
+
const files = {};
|
|
7243
|
+
for (let i = 1; i < lines.length; i++) {
|
|
7244
|
+
const line = lines[i];
|
|
7245
|
+
const status = line.slice(0, 2);
|
|
7246
|
+
if (line.length < 4) continue;
|
|
7247
|
+
let path2 = line.slice(3);
|
|
7248
|
+
if ((status.includes("R") || status.includes("C")) && i + 1 < lines.length) {
|
|
7249
|
+
path2 = lines[i + 1];
|
|
7250
|
+
i++;
|
|
7251
|
+
}
|
|
7252
|
+
files[toPosixPath(path2)] = status;
|
|
7253
|
+
}
|
|
7254
|
+
return { branch, files };
|
|
7255
|
+
} catch {
|
|
7256
|
+
return null;
|
|
7257
|
+
}
|
|
7258
|
+
}
|
|
7259
|
+
async function readGitHeadFile(targetPath, encoding) {
|
|
7260
|
+
try {
|
|
7261
|
+
const cwd = dirname6(targetPath);
|
|
7262
|
+
const relPath = relative7(cwd, targetPath);
|
|
7263
|
+
const { stdout } = await execFileAsync("git", ["show", `HEAD:./${relPath}`], {
|
|
7264
|
+
cwd,
|
|
7265
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
7266
|
+
encoding: encoding ?? "utf8"
|
|
7267
|
+
});
|
|
7268
|
+
return stdout;
|
|
7269
|
+
} catch {
|
|
7270
|
+
return "";
|
|
7271
|
+
}
|
|
7272
|
+
}
|
|
7273
|
+
|
|
7274
|
+
// src/backend/project/filesystem.ts
|
|
6681
7275
|
var SEARCH_MAX_RESULTS = 10;
|
|
6682
7276
|
var SEARCH_FUSE_THRESHOLD = 0.4;
|
|
6683
7277
|
var SEARCH_CACHE_TTL_MS = 6e4;
|
|
7278
|
+
var IGNORE_NAME_SET = /* @__PURE__ */ new Set([".git", ".svn", ".hg"]);
|
|
7279
|
+
var SEARCH_IGNORE_NAME_SET = /* @__PURE__ */ new Set(["node_modules", "vendor", "__pycache__"]);
|
|
7280
|
+
function hasForbiddenSegment(fullPath, cwd, ...nameSets) {
|
|
7281
|
+
if (fullPath === cwd) return false;
|
|
7282
|
+
const relPath = relative8(cwd, fullPath);
|
|
7283
|
+
if (!relPath) return false;
|
|
7284
|
+
const segments = relPath.split(/[\\/]+/);
|
|
7285
|
+
for (let i = 0; i < segments.length; i++) {
|
|
7286
|
+
const name = segments[i];
|
|
7287
|
+
if (!name || name === ".") continue;
|
|
7288
|
+
if (nameSets.some((set) => set.has(name))) return true;
|
|
7289
|
+
}
|
|
7290
|
+
return false;
|
|
7291
|
+
}
|
|
6684
7292
|
function createFilesystemState(ctx) {
|
|
6685
7293
|
const { storage } = ctx;
|
|
6686
7294
|
const projectFsVersions = /* @__PURE__ */ new Map();
|
|
@@ -6713,9 +7321,9 @@ function createFilesystemState(ctx) {
|
|
|
6713
7321
|
const full = join17(dir, name);
|
|
6714
7322
|
const s = await stat4(full).catch(() => null);
|
|
6715
7323
|
if (!s) continue;
|
|
6716
|
-
if (
|
|
7324
|
+
if (hasForbiddenSegment(full, cwd, IGNORE_NAME_SET, SEARCH_IGNORE_NAME_SET)) continue;
|
|
6717
7325
|
if (fileScene.has(full)) continue;
|
|
6718
|
-
const rel =
|
|
7326
|
+
const rel = relative8(cwd, full);
|
|
6719
7327
|
const posixRel = toPosixPath(rel);
|
|
6720
7328
|
allFiles.push({ id: posixRel, filename: rel, isFolder: s.isDirectory() });
|
|
6721
7329
|
if (s.isDirectory()) await collect(full);
|
|
@@ -6732,7 +7340,7 @@ function createFilesystemState(ctx) {
|
|
|
6732
7340
|
const project = storage.getProject(projectId);
|
|
6733
7341
|
if (!project) throw new Error("Project not found");
|
|
6734
7342
|
if (isAbsolute6) return resolveSafePath(project.cwd, inputPath);
|
|
6735
|
-
return
|
|
7343
|
+
return relative8(project.cwd, resolveSafePath(project.cwd, inputPath));
|
|
6736
7344
|
}
|
|
6737
7345
|
async function copyFileToWorkspace({
|
|
6738
7346
|
projectId,
|
|
@@ -6755,7 +7363,7 @@ function createFilesystemState(ctx) {
|
|
|
6755
7363
|
}
|
|
6756
7364
|
await copyFile(sourcePath, destPath);
|
|
6757
7365
|
markProjectFsDirty(projectId);
|
|
6758
|
-
return { success: true, destPath: toPosixPath(
|
|
7366
|
+
return { success: true, destPath: toPosixPath(relative8(cwd, destPath)) };
|
|
6759
7367
|
}
|
|
6760
7368
|
async function readUrlAsDataUrl({ url: inputUrl, mimeType }) {
|
|
6761
7369
|
const MAX_FILE_SIZE = 20 * 1024 * 1024;
|
|
@@ -6805,12 +7413,12 @@ function createFilesystemState(ctx) {
|
|
|
6805
7413
|
const results = [];
|
|
6806
7414
|
for (const name of entries) {
|
|
6807
7415
|
const full = join17(cwd, name);
|
|
6808
|
-
if (
|
|
7416
|
+
if (hasForbiddenSegment(full, cwd, IGNORE_NAME_SET, SEARCH_IGNORE_NAME_SET)) continue;
|
|
6809
7417
|
if (fileScene.has(full)) continue;
|
|
6810
7418
|
fileScene.add(full);
|
|
6811
7419
|
const s = await stat4(full).catch(() => null);
|
|
6812
7420
|
if (!s) continue;
|
|
6813
|
-
const rel =
|
|
7421
|
+
const rel = relative8(cwd, full);
|
|
6814
7422
|
results.push({ id: toPosixPath(rel), filename: rel, isFolder: s.isDirectory() });
|
|
6815
7423
|
if (results.length >= SEARCH_MAX_RESULTS) break;
|
|
6816
7424
|
}
|
|
@@ -6849,14 +7457,23 @@ function createFilesystemState(ctx) {
|
|
|
6849
7457
|
const full = join17(startPath, name);
|
|
6850
7458
|
const s = await stat4(full).catch(() => null);
|
|
6851
7459
|
if (!s) continue;
|
|
6852
|
-
if (
|
|
6853
|
-
const relId = toPosixPath(
|
|
6854
|
-
results.push({ id: relId, name, isFolder: s.isDirectory() });
|
|
7460
|
+
if (hasForbiddenSegment(full, cwd, IGNORE_NAME_SET)) continue;
|
|
7461
|
+
const relId = toPosixPath(relative8(cwd, full));
|
|
7462
|
+
results.push({ id: relId, name, isFolder: s.isDirectory(), ignored: false });
|
|
6855
7463
|
}
|
|
6856
7464
|
results.sort((a, b) => {
|
|
6857
7465
|
if (a.isFolder !== b.isFolder) return a.isFolder ? -1 : 1;
|
|
6858
7466
|
return a.name.localeCompare(b.name);
|
|
6859
7467
|
});
|
|
7468
|
+
const ignoredPaths = await getGitIgnoredPaths(
|
|
7469
|
+
cwd,
|
|
7470
|
+
results.map((r) => r.id)
|
|
7471
|
+
);
|
|
7472
|
+
if (ignoredPaths.size > 0) {
|
|
7473
|
+
for (const r of results) {
|
|
7474
|
+
if (ignoredPaths.has(r.id)) r.ignored = true;
|
|
7475
|
+
}
|
|
7476
|
+
}
|
|
6860
7477
|
return results;
|
|
6861
7478
|
}
|
|
6862
7479
|
async function createFile({
|
|
@@ -6870,7 +7487,7 @@ function createFilesystemState(ctx) {
|
|
|
6870
7487
|
if (isFolder) {
|
|
6871
7488
|
await mkdir(targetPath, { recursive: true });
|
|
6872
7489
|
} else {
|
|
6873
|
-
await mkdir(
|
|
7490
|
+
await mkdir(dirname7(targetPath), { recursive: true });
|
|
6874
7491
|
await writeFile3(targetPath, "");
|
|
6875
7492
|
}
|
|
6876
7493
|
markProjectFsDirty(projectId);
|
|
@@ -6977,6 +7594,22 @@ function createFilesystemState(ctx) {
|
|
|
6977
7594
|
await writeFile3(currentDest, buffer);
|
|
6978
7595
|
markProjectFsDirty(projectId);
|
|
6979
7596
|
}
|
|
7597
|
+
async function getGitStatus2({ projectId, cwd }) {
|
|
7598
|
+
const project = storage.getProject(projectId);
|
|
7599
|
+
if (!project) return null;
|
|
7600
|
+
const targetCwd = cwd ? resolveSafePath(project.cwd, cwd) : project.cwd;
|
|
7601
|
+
return getGitStatus(targetCwd);
|
|
7602
|
+
}
|
|
7603
|
+
async function readGitHeadFile2({
|
|
7604
|
+
projectId,
|
|
7605
|
+
relativePath,
|
|
7606
|
+
encoding
|
|
7607
|
+
}) {
|
|
7608
|
+
const project = storage.getProject(projectId);
|
|
7609
|
+
if (!project) return "";
|
|
7610
|
+
const targetPath = resolveSafePath(project.cwd, relativePath);
|
|
7611
|
+
return readGitHeadFile(targetPath, encoding);
|
|
7612
|
+
}
|
|
6980
7613
|
async function getPlatform() {
|
|
6981
7614
|
return process.platform;
|
|
6982
7615
|
}
|
|
@@ -6996,83 +7629,16 @@ function createFilesystemState(ctx) {
|
|
|
6996
7629
|
readFile: readFile11,
|
|
6997
7630
|
getFileInfo,
|
|
6998
7631
|
writeExternalFile,
|
|
7632
|
+
getGitStatus: getGitStatus2,
|
|
7633
|
+
readGitHeadFile: readGitHeadFile2,
|
|
6999
7634
|
getPlatform
|
|
7000
7635
|
};
|
|
7001
7636
|
}
|
|
7002
7637
|
|
|
7003
|
-
// src/backend/project/git.ts
|
|
7004
|
-
import { execFile } from "child_process";
|
|
7005
|
-
import { dirname as dirname7, relative as relative8 } from "path";
|
|
7006
|
-
import { promisify } from "util";
|
|
7007
|
-
var execFileAsync = promisify(execFile);
|
|
7008
|
-
function createGitHandlers(ctx) {
|
|
7009
|
-
const { storage } = ctx;
|
|
7010
|
-
async function getGitStatus({ projectId, cwd }) {
|
|
7011
|
-
try {
|
|
7012
|
-
const project = storage.getProject(projectId);
|
|
7013
|
-
if (!project) throw new Error("Project not found");
|
|
7014
|
-
const targetCwd = cwd ? resolveSafePath(project.cwd, cwd) : project.cwd;
|
|
7015
|
-
const { stdout } = await execFileAsync("git", ["status", "--porcelain", "-b", "-z"], {
|
|
7016
|
-
cwd: targetCwd,
|
|
7017
|
-
timeout: 2e3
|
|
7018
|
-
});
|
|
7019
|
-
const lines = stdout.split("\0").filter(Boolean);
|
|
7020
|
-
if (lines.length === 0) return null;
|
|
7021
|
-
let branchLine = lines[0];
|
|
7022
|
-
let branch = "";
|
|
7023
|
-
if (branchLine.startsWith("## ")) {
|
|
7024
|
-
branchLine = branchLine.slice(3);
|
|
7025
|
-
if (branchLine.startsWith("No commits yet on "))
|
|
7026
|
-
branch = branchLine.slice("No commits yet on ".length);
|
|
7027
|
-
else if (branchLine.startsWith("HEAD (no branch)")) branch = "HEAD";
|
|
7028
|
-
else branch = branchLine.split("...")[0];
|
|
7029
|
-
}
|
|
7030
|
-
const files = {};
|
|
7031
|
-
for (let i = 1; i < lines.length; i++) {
|
|
7032
|
-
const line = lines[i];
|
|
7033
|
-
const status = line.slice(0, 2);
|
|
7034
|
-
if (line.length < 4) continue;
|
|
7035
|
-
let path2 = line.slice(3);
|
|
7036
|
-
if ((status.includes("R") || status.includes("C")) && i + 1 < lines.length) {
|
|
7037
|
-
path2 = lines[i + 1];
|
|
7038
|
-
i++;
|
|
7039
|
-
}
|
|
7040
|
-
files[toPosixPath(path2)] = status;
|
|
7041
|
-
}
|
|
7042
|
-
return { branch, files };
|
|
7043
|
-
} catch {
|
|
7044
|
-
return null;
|
|
7045
|
-
}
|
|
7046
|
-
}
|
|
7047
|
-
async function readGitHeadFile({
|
|
7048
|
-
projectId,
|
|
7049
|
-
relativePath,
|
|
7050
|
-
encoding
|
|
7051
|
-
}) {
|
|
7052
|
-
try {
|
|
7053
|
-
const project = storage.getProject(projectId);
|
|
7054
|
-
if (!project) throw new Error("Project not found");
|
|
7055
|
-
const targetPath = resolveSafePath(project.cwd, relativePath);
|
|
7056
|
-
const cwd = dirname7(targetPath);
|
|
7057
|
-
const relPath = relative8(cwd, targetPath);
|
|
7058
|
-
const { stdout } = await execFileAsync("git", ["show", `HEAD:./${relPath}`], {
|
|
7059
|
-
cwd,
|
|
7060
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
7061
|
-
encoding: encoding ?? "utf8"
|
|
7062
|
-
});
|
|
7063
|
-
return stdout;
|
|
7064
|
-
} catch {
|
|
7065
|
-
return "";
|
|
7066
|
-
}
|
|
7067
|
-
}
|
|
7068
|
-
return { getGitStatus, readGitHeadFile };
|
|
7069
|
-
}
|
|
7070
|
-
|
|
7071
7638
|
// src/backend/project/index.ts
|
|
7072
7639
|
function createProjectModule(ctx, deps) {
|
|
7073
7640
|
const { sendEvent, onEvent, storage } = ctx;
|
|
7074
7641
|
const fs2 = createFilesystemState(ctx);
|
|
7075
|
-
const git = createGitHandlers(ctx);
|
|
7076
7642
|
onEvent((channel, payload) => {
|
|
7077
7643
|
if (channel === "fs-changed") {
|
|
7078
7644
|
fs2.markProjectFsDirty(payload.projectId);
|
|
@@ -7108,8 +7674,7 @@ function createProjectModule(ctx, deps) {
|
|
|
7108
7674
|
addProject: addProject2,
|
|
7109
7675
|
renameProject,
|
|
7110
7676
|
deleteProject: deleteProject2,
|
|
7111
|
-
...fs2
|
|
7112
|
-
...git
|
|
7677
|
+
...fs2
|
|
7113
7678
|
};
|
|
7114
7679
|
}
|
|
7115
7680
|
|
|
@@ -8455,6 +9020,33 @@ function createSessionModule(ctx, deps) {
|
|
|
8455
9020
|
shouldUpdateCache = true;
|
|
8456
9021
|
} else finalThoughtLevels = session.thoughtLevels;
|
|
8457
9022
|
}
|
|
9023
|
+
const restorePushback = [];
|
|
9024
|
+
if (finalModels && session.models?.currentModelId && finalModels.currentModelId !== session.models.currentModelId && finalModels.availableModels.some((m) => m.modelId === session.models.currentModelId)) {
|
|
9025
|
+
const cachedModelId = session.models.currentModelId;
|
|
9026
|
+
finalModels = { ...finalModels, currentModelId: cachedModelId };
|
|
9027
|
+
restorePushback.push(
|
|
9028
|
+
b.setSessionModel({ sessionId: session.resumeId, modelId: cachedModelId }).catch((err) => console.warn("[loadSession] Failed to restore model selection:", err))
|
|
9029
|
+
);
|
|
9030
|
+
}
|
|
9031
|
+
if (finalModes && session.modes?.currentModeId && finalModes.currentModeId !== session.modes.currentModeId && finalModes.availableModes.some((m) => m.id === session.modes.currentModeId)) {
|
|
9032
|
+
const cachedModeId = session.modes.currentModeId;
|
|
9033
|
+
finalModes = { ...finalModes, currentModeId: cachedModeId };
|
|
9034
|
+
restorePushback.push(
|
|
9035
|
+
b.setSessionMode({ sessionId: session.resumeId, modeId: cachedModeId }).catch((err) => console.warn("[loadSession] Failed to restore mode selection:", err))
|
|
9036
|
+
);
|
|
9037
|
+
}
|
|
9038
|
+
if (finalThoughtLevels && session.thoughtLevels?.currentThoughtLevelId && finalThoughtLevels.currentThoughtLevelId !== session.thoughtLevels.currentThoughtLevelId && finalThoughtLevels.availableThoughtLevels.some(
|
|
9039
|
+
(m) => m.id === session.thoughtLevels.currentThoughtLevelId
|
|
9040
|
+
)) {
|
|
9041
|
+
const cachedId = session.thoughtLevels.currentThoughtLevelId;
|
|
9042
|
+
finalThoughtLevels = { ...finalThoughtLevels, currentThoughtLevelId: cachedId };
|
|
9043
|
+
restorePushback.push(
|
|
9044
|
+
b.setThoughtLevel({ sessionId: session.resumeId, thoughtLevelId: cachedId }).catch((err) => console.warn("[loadSession] Failed to restore thought level:", err))
|
|
9045
|
+
);
|
|
9046
|
+
}
|
|
9047
|
+
if (restorePushback.length > 0) {
|
|
9048
|
+
await Promise.all(restorePushback);
|
|
9049
|
+
}
|
|
8458
9050
|
if (shouldUpdateCache || b.initializeInfo) {
|
|
8459
9051
|
storage.updateSession(
|
|
8460
9052
|
session.id,
|
|
@@ -8541,15 +9133,20 @@ function createSessionModule(ctx, deps) {
|
|
|
8541
9133
|
ctx,
|
|
8542
9134
|
mcpDeps
|
|
8543
9135
|
);
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
9136
|
+
notif.addRestoring(session.id);
|
|
9137
|
+
try {
|
|
9138
|
+
await b.loadSession({
|
|
9139
|
+
sessionId: session.resumeId,
|
|
9140
|
+
cwd: session.cwd,
|
|
9141
|
+
mcpServers: activeMcpServers
|
|
9142
|
+
});
|
|
9143
|
+
await createSessionSocketServer(session.id, {
|
|
9144
|
+
socketPath,
|
|
9145
|
+
project
|
|
9146
|
+
});
|
|
9147
|
+
} finally {
|
|
9148
|
+
notif.removeRestoring(session.id);
|
|
9149
|
+
}
|
|
8553
9150
|
}
|
|
8554
9151
|
storage.updateSession(sessionId, { isStreaming: true });
|
|
8555
9152
|
const updated = storage.getSession(sessionId);
|
|
@@ -9389,22 +9986,53 @@ function createInferenceModule(_ctx, deps) {
|
|
|
9389
9986
|
const textChunks = [];
|
|
9390
9987
|
const terminalLogs = {};
|
|
9391
9988
|
const agentInfo = resolveAgentInfo(agentId);
|
|
9989
|
+
let currentSessionId = null;
|
|
9990
|
+
function processNotification(notification) {
|
|
9991
|
+
let results = [notification];
|
|
9992
|
+
if (currentSessionId) {
|
|
9993
|
+
for (const adapter of adapters) {
|
|
9994
|
+
const next = [];
|
|
9995
|
+
for (const n of results) {
|
|
9996
|
+
const processed = adapter.preprocessNotification(n, currentSessionId, agentId);
|
|
9997
|
+
if (processed !== null) {
|
|
9998
|
+
next.push(...processed);
|
|
9999
|
+
}
|
|
10000
|
+
}
|
|
10001
|
+
results = next;
|
|
10002
|
+
}
|
|
10003
|
+
}
|
|
10004
|
+
if (results.length === 0) return;
|
|
10005
|
+
for (const result of results) {
|
|
10006
|
+
notifications.push(result);
|
|
10007
|
+
if (result.update?.sessionUpdate === "agent_message_chunk") {
|
|
10008
|
+
const content = result.update.content;
|
|
10009
|
+
if (content?.type === "text" && content.text) {
|
|
10010
|
+
textChunks.push(content.text);
|
|
10011
|
+
}
|
|
10012
|
+
}
|
|
10013
|
+
}
|
|
10014
|
+
}
|
|
9392
10015
|
const bridge = new ACPBridge(agentId, {
|
|
9393
10016
|
agentInfo,
|
|
9394
10017
|
cwd,
|
|
9395
|
-
|
|
10018
|
+
extNotificationSpecs,
|
|
10019
|
+
onSessionConnect: (connection) => {
|
|
10020
|
+
currentSessionId = `${agentId}:${connection.sessionId}`;
|
|
9396
10021
|
},
|
|
9397
10022
|
onSessionUpdate: (notification) => {
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
10023
|
+
processNotification(notification);
|
|
10024
|
+
},
|
|
10025
|
+
onExtNotification: (method, params) => {
|
|
10026
|
+
for (const adapter of adapters) {
|
|
10027
|
+
const results = adapter.handleExtNotification(method, params, currentSessionId, agentId);
|
|
10028
|
+
if (results.length > 0) {
|
|
10029
|
+
for (const result of results) {
|
|
10030
|
+
processNotification(result);
|
|
10031
|
+
}
|
|
10032
|
+
return;
|
|
9403
10033
|
}
|
|
9404
10034
|
}
|
|
9405
10035
|
},
|
|
9406
|
-
onExtNotification: () => {
|
|
9407
|
-
},
|
|
9408
10036
|
onPermissionRequest: async (request) => {
|
|
9409
10037
|
const opt = request.options.find((o) => o.kind === "allow_always") ?? request.options.find((o) => o.kind === "allow_once") ?? request.options[0];
|
|
9410
10038
|
return { outcome: { outcome: "selected", optionId: opt?.optionId ?? "allow" } };
|
|
@@ -10143,7 +10771,15 @@ function createMemoryModule(_ctx, deps) {
|
|
|
10143
10771
|
if (file.entries.length === 0 && !existsSync8(getMemoryPath(projectId))) {
|
|
10144
10772
|
return null;
|
|
10145
10773
|
}
|
|
10146
|
-
return file;
|
|
10774
|
+
return { version: file.version, entries: getMemoEntries(file.entries) };
|
|
10775
|
+
}
|
|
10776
|
+
function deleteMemoryEntry(projectId, entryId) {
|
|
10777
|
+
const file = readMemoryFile(projectId);
|
|
10778
|
+
const index = file.entries.findIndex((entry) => getMemoryEntryId(entry.text) === entryId);
|
|
10779
|
+
if (index === -1) return false;
|
|
10780
|
+
file.entries.splice(index, 1);
|
|
10781
|
+
writeMemoryFile(projectId, file);
|
|
10782
|
+
return true;
|
|
10147
10783
|
}
|
|
10148
10784
|
function clearMemory(projectId) {
|
|
10149
10785
|
const memoryPath = getMemoryPath(projectId);
|
|
@@ -10159,6 +10795,7 @@ function createMemoryModule(_ctx, deps) {
|
|
|
10159
10795
|
registerMemoryRoute,
|
|
10160
10796
|
buildMemoryMcpServer,
|
|
10161
10797
|
getMemory,
|
|
10798
|
+
deleteMemoryEntry,
|
|
10162
10799
|
clearMemory,
|
|
10163
10800
|
getFilePath
|
|
10164
10801
|
};
|
|
@@ -11071,6 +11708,9 @@ function initBackend(emitter) {
|
|
|
11071
11708
|
async getMemory({ projectId }) {
|
|
11072
11709
|
return memory.getMemory(projectId);
|
|
11073
11710
|
},
|
|
11711
|
+
async deleteMemoryEntry({ projectId, entryId }) {
|
|
11712
|
+
return memory.deleteMemoryEntry(projectId, entryId);
|
|
11713
|
+
},
|
|
11074
11714
|
async clearMemory({ projectId }) {
|
|
11075
11715
|
memory.clearMemory(projectId);
|
|
11076
11716
|
},
|
|
@@ -11096,7 +11736,7 @@ function initBackend(emitter) {
|
|
|
11096
11736
|
}
|
|
11097
11737
|
|
|
11098
11738
|
// package.json
|
|
11099
|
-
var version = "0.1.
|
|
11739
|
+
var version = "0.1.48";
|
|
11100
11740
|
|
|
11101
11741
|
// src/server/main.ts
|
|
11102
11742
|
var port;
|
|
@@ -11125,6 +11765,14 @@ Options:
|
|
|
11125
11765
|
process.exit(0);
|
|
11126
11766
|
}
|
|
11127
11767
|
}
|
|
11768
|
+
var proxySettings = storageOps.getSettings().proxy;
|
|
11769
|
+
if (proxySettings.mode === "system") {
|
|
11770
|
+
const detected = detectSystemProxy();
|
|
11771
|
+
applyProxy(detected);
|
|
11772
|
+
console.log(`[proxy] system proxy: ${detected.httpProxy || detected.httpsProxy || "none"}`);
|
|
11773
|
+
} else {
|
|
11774
|
+
applyProxy(settingProxyInfoToProxyConfig(proxySettings));
|
|
11775
|
+
}
|
|
11128
11776
|
var { backendHandlers, closeBackend } = initBackend(() => false);
|
|
11129
11777
|
backendHandlers.startWebUIServer({ port, token }).then(({ url }) => {
|
|
11130
11778
|
const title = `Fello Server v${version}`;
|