@zythum02/fello-server 0.1.45 → 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-B2L-gQdU.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-Dh0s2UpX.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-CQ2ioqAL.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-B40mk-XJ.js.gz +0 -0
- package/out/renderer/assets/{blockDiagram-DXYQGD6D-Wh0G1xzO.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-BYn4M8r3.js → c4Diagram-AHTNJAMY-BfRmGEJy.js} +2 -2
- package/out/renderer/assets/c4Diagram-AHTNJAMY-BfRmGEJy.js.br +0 -0
- package/out/renderer/assets/c4Diagram-AHTNJAMY-BfRmGEJy.js.gz +0 -0
- package/out/renderer/assets/{channel-BbsS770v.js → channel-CHGPt1xL.js} +1 -1
- package/out/renderer/assets/{chunk-4BX2VUAB-BqmuvYx4.js → chunk-4BX2VUAB-Dbg5pk8D.js} +1 -1
- package/out/renderer/assets/{chunk-4TB4RGXK-CGWvo0MB.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-B2F_rVhp.js → chunk-55IACEB6-_eYsto3b.js} +1 -1
- package/out/renderer/assets/{chunk-EDXVE4YY-rv_Sxmdr.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-B5pWdaON.js → chunk-FMBD7UC4-BwtLRaQu.js} +1 -1
- package/out/renderer/assets/{chunk-OYMX7WX6-CK7U7B55.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-CK7U7B55.js.gz → chunk-OYMX7WX6-h3hRYV_y.js.gz} +0 -0
- package/out/renderer/assets/{chunk-QZHKN3VN-CEGxn157.js → chunk-QZHKN3VN-DUU1c_qe.js} +1 -1
- package/out/renderer/assets/{chunk-YZCP3GAM-CP9VxQ_4.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-DDq47uie.js → classDiagram-6PBFFD2Q-ql_64jJs.js} +6 -6
- package/out/renderer/assets/{classDiagram-v2-HSJHXN6E-DDq47uie.js → classDiagram-v2-HSJHXN6E-ql_64jJs.js} +6 -6
- package/out/renderer/assets/{clone-D_yz9tHs.js → clone-DZQhm3qm.js} +1 -1
- package/out/renderer/assets/{cose-bilkent-S5V4N54A-4f3CSmy0.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-Bjtibz95.js.gz +0 -0
- package/out/renderer/assets/{dagre-KV5264BT-CUE2rJbD.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-pp0PcxKz.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-C-riu5J4.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-qa5mZzds.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-BJb8gvcB.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/docx_parser_bg-CIRepKGp.wasm +0 -0
- package/out/renderer/assets/{erDiagram-SMLLAGMA-BImpezHs.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-BGPw25aw.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-DcKLeP7M.js → ganttDiagram-T4ZO3ILL-D9tlSXpr.js} +2 -2
- package/out/renderer/assets/ganttDiagram-T4ZO3ILL-D9tlSXpr.js.br +0 -0
- package/out/renderer/assets/ganttDiagram-T4ZO3ILL-D9tlSXpr.js.gz +0 -0
- package/out/renderer/assets/{gitGraphDiagram-UUTBAWPF-BQE3VROE.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-BpsL6VlK.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-BKJZddky.js → highlighted-body-OFNGDK62-EglK-D82.js} +1 -1
- package/out/renderer/assets/{index-Dd5g6jOl.js → index-BuO0MTa-.js} +37445 -31569
- 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-C-1Mla-o.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-BfDiSuRt.js → infoDiagram-42DDH7IO-CwoWvadJ.js} +4 -4
- package/out/renderer/assets/{ishikawaDiagram-UXIWVN3A-D3NlGVXH.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-DqeLAWW-.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-C25BBRvk.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-C25BBRvk.js.gz → kanban-definition-6JOO6SKY-uDhuFOXv.js.gz} +0 -0
- package/out/renderer/assets/{layout-DtW-aq94.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-rNBYTEYz.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-MG_Ci7_B.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-C67ROQav.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-C67ROQav.js.gz → mindmap-definition-QFDTVHPH-_8DjK16S.js.gz} +0 -0
- package/out/renderer/assets/{pdf-worker-wrapper-D9W0fDhT.js → pdf-worker-wrapper-D6dv_dnM.js} +2803 -2560
- package/out/renderer/assets/pdf-worker-wrapper-D6dv_dnM.js.br +0 -0
- package/out/renderer/assets/pdf-worker-wrapper-D6dv_dnM.js.gz +0 -0
- package/out/renderer/assets/{pieDiagram-DEJITSTG-DE1aBCQW.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/pptx_parser_bg-Dnsy0qwf.wasm +0 -0
- package/out/renderer/assets/{quadrantDiagram-34T5L4WZ-B5mGDuN5.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/render-worker-host-BG3a7brz-Q7Y2znhP.js +25 -0
- package/out/renderer/assets/render-worker-host-BG3a7brz-Q7Y2znhP.js.br +0 -0
- package/out/renderer/assets/render-worker-host-BG3a7brz-Q7Y2znhP.js.gz +0 -0
- package/out/renderer/assets/render-worker-host-CsB-dPJv-gJhIrzf_.js +25 -0
- package/out/renderer/assets/render-worker-host-CsB-dPJv-gJhIrzf_.js.br +0 -0
- package/out/renderer/assets/render-worker-host-CsB-dPJv-gJhIrzf_.js.gz +0 -0
- package/out/renderer/assets/render-worker-host-Cyv5Hkbh-BAiWfcv_.js +25 -0
- package/out/renderer/assets/render-worker-host-Cyv5Hkbh-BAiWfcv_.js.br +0 -0
- package/out/renderer/assets/render-worker-host-Cyv5Hkbh-BAiWfcv_.js.gz +0 -0
- package/out/renderer/assets/{requirementDiagram-MS252O5E-CiGX4Xpv.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-BPM4lpDs.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-D1Ok0mDp.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-C0DqB63K.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-CcTyZcy9.js → stateDiagram-v2-QKLJ7IA2-CfBaNTRC.js} +4 -4
- package/out/renderer/assets/theming_false-C5NatR_w.js +5 -0
- package/out/renderer/assets/theming_false-CG4cvbgC.js +5 -0
- package/out/renderer/assets/theming_false-CM9D8h_m.js +5 -0
- package/out/renderer/assets/theming_false-CdT0AbCV.js +5 -0
- package/out/renderer/assets/theming_false-Cfu67eQJ.js +5 -0
- package/out/renderer/assets/theming_false-Cx4KIHFf.js +5 -0
- package/out/renderer/assets/theming_false-DT3t1zD4.js +5 -0
- package/out/renderer/assets/theming_false-Djik2YgE.js +5 -0
- package/out/renderer/assets/theming_false-PG6ooLjt.js +5 -0
- package/out/renderer/assets/theming_false-XUCKLqh3.js +5 -0
- package/out/renderer/assets/{timeline-definition-GMOUNBTQ-CY70j9aj.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-DpZP-SME.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-DUTOcssT.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-ZVKE_8YQ.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/xlsx_parser_bg-BM7cLtfq.wasm +0 -0
- package/out/renderer/assets/{xychartDiagram-5P7HB3ND-B8kViTNI.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/scripts/mcp-toolbox/server.mjs +35 -0
- package/out/server/main.js +904 -233
- package/package.json +11 -8
- package/out/renderer/assets/_baseUniq-B2L-gQdU.js.br +0 -0
- package/out/renderer/assets/_baseUniq-B2L-gQdU.js.gz +0 -0
- package/out/renderer/assets/arc-Dh0s2UpX.js.br +0 -0
- package/out/renderer/assets/arc-Dh0s2UpX.js.gz +0 -0
- package/out/renderer/assets/architectureDiagram-Q4EWVU46-CQ2ioqAL.js.br +0 -0
- package/out/renderer/assets/architectureDiagram-Q4EWVU46-CQ2ioqAL.js.gz +0 -0
- package/out/renderer/assets/blockDiagram-DXYQGD6D-Wh0G1xzO.js.br +0 -0
- package/out/renderer/assets/blockDiagram-DXYQGD6D-Wh0G1xzO.js.gz +0 -0
- package/out/renderer/assets/c4Diagram-AHTNJAMY-BYn4M8r3.js.br +0 -0
- package/out/renderer/assets/c4Diagram-AHTNJAMY-BYn4M8r3.js.gz +0 -0
- package/out/renderer/assets/chunk-4TB4RGXK-CGWvo0MB.js.br +0 -0
- package/out/renderer/assets/chunk-4TB4RGXK-CGWvo0MB.js.gz +0 -0
- package/out/renderer/assets/chunk-EDXVE4YY-rv_Sxmdr.js.br +0 -0
- package/out/renderer/assets/chunk-EDXVE4YY-rv_Sxmdr.js.gz +0 -0
- package/out/renderer/assets/chunk-OYMX7WX6-CK7U7B55.js.br +0 -0
- package/out/renderer/assets/chunk-YZCP3GAM-CP9VxQ_4.js.br +0 -0
- package/out/renderer/assets/chunk-YZCP3GAM-CP9VxQ_4.js.gz +0 -0
- package/out/renderer/assets/cose-bilkent-S5V4N54A-4f3CSmy0.js.br +0 -0
- package/out/renderer/assets/cose-bilkent-S5V4N54A-4f3CSmy0.js.gz +0 -0
- package/out/renderer/assets/dagre-KV5264BT-CUE2rJbD.js.br +0 -0
- package/out/renderer/assets/dagre-KV5264BT-CUE2rJbD.js.gz +0 -0
- package/out/renderer/assets/diagram-5BDNPKRD-pp0PcxKz.js.br +0 -0
- package/out/renderer/assets/diagram-5BDNPKRD-pp0PcxKz.js.gz +0 -0
- package/out/renderer/assets/diagram-G4DWMVQ6-C-riu5J4.js.br +0 -0
- package/out/renderer/assets/diagram-G4DWMVQ6-C-riu5J4.js.gz +0 -0
- package/out/renderer/assets/diagram-MMDJMWI5-qa5mZzds.js.br +0 -0
- package/out/renderer/assets/diagram-MMDJMWI5-qa5mZzds.js.gz +0 -0
- package/out/renderer/assets/diagram-TYMM5635-BJb8gvcB.js.br +0 -0
- package/out/renderer/assets/diagram-TYMM5635-BJb8gvcB.js.gz +0 -0
- package/out/renderer/assets/docx_parser_bg-B5rV91hd.wasm +0 -0
- package/out/renderer/assets/erDiagram-SMLLAGMA-BImpezHs.js.br +0 -0
- package/out/renderer/assets/erDiagram-SMLLAGMA-BImpezHs.js.gz +0 -0
- package/out/renderer/assets/flowDiagram-DWJPFMVM-BGPw25aw.js.br +0 -0
- package/out/renderer/assets/flowDiagram-DWJPFMVM-BGPw25aw.js.gz +0 -0
- package/out/renderer/assets/ganttDiagram-T4ZO3ILL-DcKLeP7M.js.br +0 -0
- package/out/renderer/assets/ganttDiagram-T4ZO3ILL-DcKLeP7M.js.gz +0 -0
- package/out/renderer/assets/gitGraphDiagram-UUTBAWPF-BQE3VROE.js.br +0 -0
- package/out/renderer/assets/gitGraphDiagram-UUTBAWPF-BQE3VROE.js.gz +0 -0
- package/out/renderer/assets/graph-BpsL6VlK.js.br +0 -0
- package/out/renderer/assets/graph-BpsL6VlK.js.gz +0 -0
- package/out/renderer/assets/index-C-1Mla-o.css.br +0 -0
- package/out/renderer/assets/index-C-1Mla-o.css.gz +0 -0
- package/out/renderer/assets/index-Dd5g6jOl.js.br +0 -0
- package/out/renderer/assets/index-Dd5g6jOl.js.gz +0 -0
- package/out/renderer/assets/ishikawaDiagram-UXIWVN3A-D3NlGVXH.js.br +0 -0
- package/out/renderer/assets/ishikawaDiagram-UXIWVN3A-D3NlGVXH.js.gz +0 -0
- package/out/renderer/assets/journeyDiagram-VCZTEJTY-DqeLAWW-.js.br +0 -0
- package/out/renderer/assets/journeyDiagram-VCZTEJTY-DqeLAWW-.js.gz +0 -0
- package/out/renderer/assets/kanban-definition-6JOO6SKY-C25BBRvk.js.br +0 -0
- package/out/renderer/assets/layout-DtW-aq94.js.br +0 -0
- package/out/renderer/assets/layout-DtW-aq94.js.gz +0 -0
- package/out/renderer/assets/linear-rNBYTEYz.js.br +0 -0
- package/out/renderer/assets/linear-rNBYTEYz.js.gz +0 -0
- package/out/renderer/assets/min-MG_Ci7_B.js.br +0 -0
- package/out/renderer/assets/min-MG_Ci7_B.js.gz +0 -0
- package/out/renderer/assets/mindmap-definition-QFDTVHPH-C67ROQav.js.br +0 -0
- package/out/renderer/assets/pdf-worker-wrapper-D9W0fDhT.js.br +0 -0
- package/out/renderer/assets/pdf-worker-wrapper-D9W0fDhT.js.gz +0 -0
- package/out/renderer/assets/pieDiagram-DEJITSTG-DE1aBCQW.js.br +0 -0
- package/out/renderer/assets/pieDiagram-DEJITSTG-DE1aBCQW.js.gz +0 -0
- package/out/renderer/assets/pierre-dark-BL-l9r39.js +0 -4
- package/out/renderer/assets/pierre-dark-BL-l9r39.js.br +0 -0
- package/out/renderer/assets/pierre-dark-BL-l9r39.js.gz +0 -0
- package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-BBjGuJQU.js +0 -4
- package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-BBjGuJQU.js.br +0 -0
- package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-BBjGuJQU.js.gz +0 -0
- package/out/renderer/assets/pierre-dark-soft-B6TBhICr.js +0 -4
- package/out/renderer/assets/pierre-dark-soft-B6TBhICr.js.br +0 -0
- package/out/renderer/assets/pierre-dark-soft-B6TBhICr.js.gz +0 -0
- package/out/renderer/assets/pierre-dark-tritanopia-f-j_EX9A.js +0 -4
- package/out/renderer/assets/pierre-dark-tritanopia-f-j_EX9A.js.br +0 -0
- package/out/renderer/assets/pierre-dark-tritanopia-f-j_EX9A.js.gz +0 -0
- package/out/renderer/assets/pierre-dark-vibrant-yElMGqZN.js +0 -4
- package/out/renderer/assets/pierre-dark-vibrant-yElMGqZN.js.br +0 -0
- package/out/renderer/assets/pierre-dark-vibrant-yElMGqZN.js.gz +0 -0
- package/out/renderer/assets/pierre-light-BUzWTcjO.js +0 -4
- package/out/renderer/assets/pierre-light-BUzWTcjO.js.br +0 -0
- package/out/renderer/assets/pierre-light-BUzWTcjO.js.gz +0 -0
- package/out/renderer/assets/pierre-light-protanopia-deuteranopia-DlvVSCaI.js +0 -4
- package/out/renderer/assets/pierre-light-protanopia-deuteranopia-DlvVSCaI.js.br +0 -0
- package/out/renderer/assets/pierre-light-protanopia-deuteranopia-DlvVSCaI.js.gz +0 -0
- package/out/renderer/assets/pierre-light-soft-CCMU-Zh0.js +0 -4
- package/out/renderer/assets/pierre-light-soft-CCMU-Zh0.js.br +0 -0
- package/out/renderer/assets/pierre-light-soft-CCMU-Zh0.js.gz +0 -0
- package/out/renderer/assets/pierre-light-tritanopia-v4xacE1C.js +0 -4
- package/out/renderer/assets/pierre-light-tritanopia-v4xacE1C.js.br +0 -0
- package/out/renderer/assets/pierre-light-tritanopia-v4xacE1C.js.gz +0 -0
- package/out/renderer/assets/pierre-light-vibrant-BRUbQnMc.js +0 -4
- package/out/renderer/assets/pierre-light-vibrant-BRUbQnMc.js.br +0 -0
- package/out/renderer/assets/pierre-light-vibrant-BRUbQnMc.js.gz +0 -0
- package/out/renderer/assets/pptx_parser_bg-C6x8HRdb.wasm +0 -0
- package/out/renderer/assets/quadrantDiagram-34T5L4WZ-B5mGDuN5.js.br +0 -0
- package/out/renderer/assets/quadrantDiagram-34T5L4WZ-B5mGDuN5.js.gz +0 -0
- package/out/renderer/assets/render-worker-host-B-Y1DmN9-CMFsEp7s.js +0 -25
- package/out/renderer/assets/render-worker-host-B-Y1DmN9-CMFsEp7s.js.br +0 -0
- package/out/renderer/assets/render-worker-host-B-Y1DmN9-CMFsEp7s.js.gz +0 -0
- package/out/renderer/assets/render-worker-host-B5otq5TA-D0PN4GJN.js +0 -25
- package/out/renderer/assets/render-worker-host-B5otq5TA-D0PN4GJN.js.br +0 -0
- package/out/renderer/assets/render-worker-host-B5otq5TA-D0PN4GJN.js.gz +0 -0
- package/out/renderer/assets/render-worker-host-GGVmi0tj-BJOvCVyx.js +0 -25
- package/out/renderer/assets/render-worker-host-GGVmi0tj-BJOvCVyx.js.br +0 -0
- package/out/renderer/assets/render-worker-host-GGVmi0tj-BJOvCVyx.js.gz +0 -0
- package/out/renderer/assets/requirementDiagram-MS252O5E-CiGX4Xpv.js.br +0 -0
- package/out/renderer/assets/requirementDiagram-MS252O5E-CiGX4Xpv.js.gz +0 -0
- package/out/renderer/assets/sankeyDiagram-XADWPNL6-BPM4lpDs.js.br +0 -0
- package/out/renderer/assets/sankeyDiagram-XADWPNL6-BPM4lpDs.js.gz +0 -0
- package/out/renderer/assets/sequenceDiagram-FGHM5R23-D1Ok0mDp.js.br +0 -0
- package/out/renderer/assets/sequenceDiagram-FGHM5R23-D1Ok0mDp.js.gz +0 -0
- package/out/renderer/assets/stateDiagram-FHFEXIEX-C0DqB63K.js.br +0 -0
- package/out/renderer/assets/stateDiagram-FHFEXIEX-C0DqB63K.js.gz +0 -0
- package/out/renderer/assets/timeline-definition-GMOUNBTQ-CY70j9aj.js.br +0 -0
- package/out/renderer/assets/timeline-definition-GMOUNBTQ-CY70j9aj.js.gz +0 -0
- package/out/renderer/assets/vennDiagram-DHZGUBPP-DpZP-SME.js.br +0 -0
- package/out/renderer/assets/vennDiagram-DHZGUBPP-DpZP-SME.js.gz +0 -0
- package/out/renderer/assets/wardley-RL74JXVD-DUTOcssT.js.br +0 -0
- package/out/renderer/assets/wardley-RL74JXVD-DUTOcssT.js.gz +0 -0
- package/out/renderer/assets/wardleyDiagram-NUSXRM2D-ZVKE_8YQ.js.br +0 -0
- package/out/renderer/assets/wardleyDiagram-NUSXRM2D-ZVKE_8YQ.js.gz +0 -0
- package/out/renderer/assets/xlsx_parser_bg-ByWgODYl.wasm +0 -0
- package/out/renderer/assets/xychartDiagram-5P7HB3ND-B8kViTNI.js.br +0 -0
- package/out/renderer/assets/xychartDiagram-5P7HB3ND-B8kViTNI.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();
|
|
@@ -4002,13 +4027,11 @@ This tool directly sends a plan update to the client, which replaces the entire
|
|
|
4002
4027
|
throw new Error("ACP connection is not available.");
|
|
4003
4028
|
}
|
|
4004
4029
|
const plan = {
|
|
4005
|
-
entries: entries.map(
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
})
|
|
4011
|
-
)
|
|
4030
|
+
entries: entries.map((entry) => ({
|
|
4031
|
+
content: entry.content,
|
|
4032
|
+
priority: entry.priority,
|
|
4033
|
+
status: entry.status
|
|
4034
|
+
}))
|
|
4012
4035
|
};
|
|
4013
4036
|
await connection.sessionUpdate({
|
|
4014
4037
|
sessionId: params.sessionId,
|
|
@@ -4043,6 +4066,208 @@ async function closeACPClientTools(session) {
|
|
|
4043
4066
|
import { createMCPClient } from "@ai-sdk/mcp";
|
|
4044
4067
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
4045
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
|
|
4046
4271
|
function sanitizeName(input) {
|
|
4047
4272
|
return input.trim().toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
|
|
4048
4273
|
}
|
|
@@ -4092,7 +4317,10 @@ async function createClient(server, cwd) {
|
|
|
4092
4317
|
transport: new StdioClientTransport({
|
|
4093
4318
|
command: server.command,
|
|
4094
4319
|
args: server.args,
|
|
4095
|
-
env:
|
|
4320
|
+
env: {
|
|
4321
|
+
...buildProxyEnv(),
|
|
4322
|
+
...toEnvRecord(server.env)
|
|
4323
|
+
},
|
|
4096
4324
|
cwd
|
|
4097
4325
|
}),
|
|
4098
4326
|
clientName: "fello-openai-compatible-agent",
|
|
@@ -4756,7 +4984,6 @@ function buildWorkspaceSystemPrompt(cwd, additionalDirectories) {
|
|
|
4756
4984
|
const workspacePrompt = `Current session working directory (cwd): ${cwd}.${extras} Use this as the default base path for relative paths.`;
|
|
4757
4985
|
const now = /* @__PURE__ */ new Date();
|
|
4758
4986
|
const dateStr = now.toLocaleDateString("en-CA");
|
|
4759
|
-
const timeStr = now.toLocaleTimeString("en-US", { hour12: false });
|
|
4760
4987
|
const weekday = now.toLocaleDateString("en-US", { weekday: "long" });
|
|
4761
4988
|
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
4762
4989
|
const timezoneOffset = -now.getTimezoneOffset();
|
|
@@ -4765,7 +4992,7 @@ function buildWorkspaceSystemPrompt(cwd, additionalDirectories) {
|
|
|
4765
4992
|
const offsetMinutes = String(Math.abs(timezoneOffset) % 60).padStart(2, "0");
|
|
4766
4993
|
const utcOffset = `UTC${offsetSign}${offsetHours}:${offsetMinutes}`;
|
|
4767
4994
|
const platform = process.platform;
|
|
4768
|
-
const envContext = `Date
|
|
4995
|
+
const envContext = `Date: ${dateStr} (${weekday})
|
|
4769
4996
|
Timezone: ${timezone} (${utcOffset})
|
|
4770
4997
|
Platform: ${platform}`;
|
|
4771
4998
|
let prompt = `${BASE_SYSTEM_PROMPT}
|
|
@@ -5510,14 +5737,14 @@ function spawnOpenaiCompatibleApiAgent(options) {
|
|
|
5510
5737
|
}
|
|
5511
5738
|
|
|
5512
5739
|
// src/backend/agent/agent-terminal-manager.ts
|
|
5513
|
-
import { spawn as spawn2, execFileSync as
|
|
5740
|
+
import { spawn as spawn2, execFileSync as execFileSync3 } from "child_process";
|
|
5514
5741
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
5515
5742
|
function detectTerminalOutputEncoding() {
|
|
5516
5743
|
if (process.platform !== "win32") {
|
|
5517
5744
|
return "utf-8";
|
|
5518
5745
|
}
|
|
5519
5746
|
try {
|
|
5520
|
-
const output =
|
|
5747
|
+
const output = execFileSync3("cmd", ["/d", "/s", "/c", "chcp"], {
|
|
5521
5748
|
encoding: "buffer",
|
|
5522
5749
|
windowsHide: true
|
|
5523
5750
|
});
|
|
@@ -5818,7 +6045,7 @@ var ACPBridge = class {
|
|
|
5818
6045
|
const applyConfigOptions = this.applyConfigOptions.bind(this);
|
|
5819
6046
|
const terminalManager = this.terminalManager;
|
|
5820
6047
|
const sessionsCwdMap = this._sessionsCwdMap;
|
|
5821
|
-
|
|
6048
|
+
let clientApp = client({ name: "Fello" }).onRequest(methods3.client.session.requestPermission, (ctx) => {
|
|
5822
6049
|
return onPermission(ctx.params);
|
|
5823
6050
|
}).onNotification(methods3.client.session.update, (ctx) => {
|
|
5824
6051
|
const params = ctx.params;
|
|
@@ -5861,25 +6088,12 @@ var ACPBridge = class {
|
|
|
5861
6088
|
}).onRequest(methods3.client.terminal.release, (ctx) => {
|
|
5862
6089
|
terminalManager.release(ctx.params.terminalId);
|
|
5863
6090
|
return {};
|
|
5864
|
-
})
|
|
5865
|
-
|
|
5866
|
-
(
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
).onNotification(
|
|
5871
|
-
"_kiro.dev/commands/available",
|
|
5872
|
-
(p) => p,
|
|
5873
|
-
(ctx) => {
|
|
5874
|
-
onExtNotification("_kiro.dev/commands/available", ctx.params);
|
|
5875
|
-
}
|
|
5876
|
-
).onNotification(
|
|
5877
|
-
"_kiro.dev/subagent/list_update",
|
|
5878
|
-
(p) => p,
|
|
5879
|
-
(ctx) => {
|
|
5880
|
-
onExtNotification("_kiro.dev/subagent/list_update", ctx.params);
|
|
5881
|
-
}
|
|
5882
|
-
);
|
|
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
|
+
}
|
|
5883
6097
|
this.connection = clientApp.connect(stream);
|
|
5884
6098
|
const initResult = await this.connection.agent.request(methods3.agent.initialize, {
|
|
5885
6099
|
protocolVersion: PROTOCOL_VERSION2,
|
|
@@ -6141,6 +6355,327 @@ var ACPBridge = class {
|
|
|
6141
6355
|
}
|
|
6142
6356
|
};
|
|
6143
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
|
+
|
|
6144
6679
|
// src/backend/agent/resolve-agent-info.ts
|
|
6145
6680
|
function resolveAgentInfo(agentId) {
|
|
6146
6681
|
const settings = storageOps.getSettings();
|
|
@@ -6202,10 +6737,58 @@ function createBridgeConnectModule(ctx, deps) {
|
|
|
6202
6737
|
}
|
|
6203
6738
|
sessionAgentMap.set(sessionKey, agentId);
|
|
6204
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
|
+
}
|
|
6205
6787
|
const agentInfo = resolveAgentInfo(agentId);
|
|
6206
6788
|
const bridge = new ACPBridge(agentId, {
|
|
6207
6789
|
agentInfo,
|
|
6208
6790
|
cwd,
|
|
6791
|
+
extNotificationSpecs,
|
|
6209
6792
|
onSessionConnect: (connection) => {
|
|
6210
6793
|
currentSessionId = `${agentId}:${connection.sessionId}`;
|
|
6211
6794
|
storage.updateSession(currentSessionId, { connectionStatus: "connected" }, false);
|
|
@@ -6213,96 +6796,17 @@ function createBridgeConnectModule(ctx, deps) {
|
|
|
6213
6796
|
if (updated) sendEvent("session-changed", { session: updated });
|
|
6214
6797
|
},
|
|
6215
6798
|
onSessionUpdate: (notification) => {
|
|
6216
|
-
|
|
6217
|
-
if (currentSessionId) {
|
|
6218
|
-
if (currentSessionId === `${agentId}:${notification.sessionId}`) {
|
|
6219
|
-
if (sessionUpdate === "session_info_update") {
|
|
6220
|
-
if (notification.update.title) {
|
|
6221
|
-
storage.updateSession(currentSessionId, { title: notification.update.title });
|
|
6222
|
-
const updated = storage.getSession(currentSessionId);
|
|
6223
|
-
if (updated) sendEvent("session-changed", { session: updated });
|
|
6224
|
-
}
|
|
6225
|
-
}
|
|
6226
|
-
if (sessionUpdate === "usage_update") {
|
|
6227
|
-
publishUsage(currentSessionId, notification.update);
|
|
6228
|
-
return;
|
|
6229
|
-
}
|
|
6230
|
-
if (sessionUpdate === "available_commands_update") {
|
|
6231
|
-
publishAvailableCommands(
|
|
6232
|
-
currentSessionId,
|
|
6233
|
-
notification.update.availableCommands ?? []
|
|
6234
|
-
);
|
|
6235
|
-
return;
|
|
6236
|
-
}
|
|
6237
|
-
if (sessionUpdate === "current_mode_update") {
|
|
6238
|
-
const session = storage.getSession(currentSessionId);
|
|
6239
|
-
if (session && session.modes) {
|
|
6240
|
-
session.modes.currentModeId = notification.update.currentModeId ?? null;
|
|
6241
|
-
storage.updateSession(currentSessionId, { modes: session.modes });
|
|
6242
|
-
const updated = storage.getSession(currentSessionId);
|
|
6243
|
-
if (updated) sendEvent("session-changed", { session: updated });
|
|
6244
|
-
}
|
|
6245
|
-
}
|
|
6246
|
-
}
|
|
6247
|
-
broadcastAndSaveSessionUpdate(currentSessionId, notification);
|
|
6248
|
-
}
|
|
6799
|
+
processSessionUpdate(notification);
|
|
6249
6800
|
},
|
|
6250
6801
|
onExtNotification: (method, params) => {
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
});
|
|
6257
|
-
}
|
|
6258
|
-
return;
|
|
6259
|
-
}
|
|
6260
|
-
if (method === "_kiro.dev/commands/available") {
|
|
6261
|
-
if (typeof params === "object" && params && "sessionId" in params && typeof params.sessionId === "string" && "commands" in params && Array.isArray(params.commands) && currentSessionId === `${agentId}:${params.sessionId}`) {
|
|
6262
|
-
const commands = [];
|
|
6263
|
-
for (const item of params.commands) {
|
|
6264
|
-
if (typeof item === "object" && item && "name" in item && typeof item.name === "string") {
|
|
6265
|
-
commands.push({
|
|
6266
|
-
name: item.name.replace(/^\//, ""),
|
|
6267
|
-
description: item.description ? String(item.description) : ""
|
|
6268
|
-
});
|
|
6269
|
-
}
|
|
6270
|
-
}
|
|
6271
|
-
publishAvailableCommands(currentSessionId, commands);
|
|
6272
|
-
}
|
|
6273
|
-
return;
|
|
6274
|
-
}
|
|
6275
|
-
if (method === "_kiro.dev/subagent/list_update") {
|
|
6276
|
-
if (typeof params === "object" && params && currentSessionId && "subagents" in params && Array.isArray(params.subagents)) {
|
|
6277
|
-
for (const subagent of params.subagents) {
|
|
6278
|
-
if (typeof subagent === "object" && subagent && "sessionId" in subagent && typeof subagent.sessionId === "string") {
|
|
6279
|
-
const update = {
|
|
6280
|
-
sessionUpdate: "subagent_update",
|
|
6281
|
-
sessionId: subagent.sessionId,
|
|
6282
|
-
name: typeof subagent.sessionName === "string" ? subagent.sessionName : void 0,
|
|
6283
|
-
prompt: typeof subagent.initialQuery === "string" ? subagent.initialQuery : void 0,
|
|
6284
|
-
status: {
|
|
6285
|
-
pending: "pending",
|
|
6286
|
-
working: "in_progress",
|
|
6287
|
-
terminated: "completed",
|
|
6288
|
-
failed: "failed"
|
|
6289
|
-
}[String(subagent?.status?.type)]
|
|
6290
|
-
};
|
|
6291
|
-
broadcastAndSaveSessionUpdate(currentSessionId, {
|
|
6292
|
-
sessionId: currentSessionId.replace(`${agentId}:`, ""),
|
|
6293
|
-
update: {
|
|
6294
|
-
sessionUpdate: "session_info_update",
|
|
6295
|
-
_meta: {
|
|
6296
|
-
fello: {
|
|
6297
|
-
update
|
|
6298
|
-
}
|
|
6299
|
-
}
|
|
6300
|
-
}
|
|
6301
|
-
});
|
|
6302
|
-
}
|
|
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);
|
|
6303
6807
|
}
|
|
6808
|
+
return;
|
|
6304
6809
|
}
|
|
6305
|
-
return;
|
|
6306
6810
|
}
|
|
6307
6811
|
},
|
|
6308
6812
|
onPermissionRequest: async (request) => {
|
|
@@ -6384,12 +6888,14 @@ function createBridgeConnectModule(ctx, deps) {
|
|
|
6384
6888
|
sessionAgentMap.delete(oldKey);
|
|
6385
6889
|
sessionAgentMap.set(newKey, agentId);
|
|
6386
6890
|
}
|
|
6891
|
+
for (const a of adapters) a.rekey(oldKey, newKey);
|
|
6387
6892
|
}
|
|
6388
6893
|
async function killBridge(sessionKey) {
|
|
6389
6894
|
const p = bridges.get(sessionKey);
|
|
6390
6895
|
if (p) {
|
|
6391
6896
|
bridges.delete(sessionKey);
|
|
6392
6897
|
sessionAgentMap.delete(sessionKey);
|
|
6898
|
+
for (const a of adapters) a.cleanup(sessionKey);
|
|
6393
6899
|
try {
|
|
6394
6900
|
const b = await p;
|
|
6395
6901
|
await b.kill();
|
|
@@ -6419,6 +6925,7 @@ function createBridgeConnectModule(ctx, deps) {
|
|
|
6419
6925
|
}
|
|
6420
6926
|
bridges.clear();
|
|
6421
6927
|
sessionAgentMap.clear();
|
|
6928
|
+
for (const a of adapters) a.clearAll();
|
|
6422
6929
|
await Promise.all(killPromises);
|
|
6423
6930
|
}
|
|
6424
6931
|
return {
|
|
@@ -6679,10 +7186,109 @@ import {
|
|
|
6679
7186
|
copyFile
|
|
6680
7187
|
} from "fs/promises";
|
|
6681
7188
|
import * as mimeTypes4 from "mime-types";
|
|
6682
|
-
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
|
|
6683
7275
|
var SEARCH_MAX_RESULTS = 10;
|
|
6684
7276
|
var SEARCH_FUSE_THRESHOLD = 0.4;
|
|
6685
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
|
+
}
|
|
6686
7292
|
function createFilesystemState(ctx) {
|
|
6687
7293
|
const { storage } = ctx;
|
|
6688
7294
|
const projectFsVersions = /* @__PURE__ */ new Map();
|
|
@@ -6715,9 +7321,9 @@ function createFilesystemState(ctx) {
|
|
|
6715
7321
|
const full = join17(dir, name);
|
|
6716
7322
|
const s = await stat4(full).catch(() => null);
|
|
6717
7323
|
if (!s) continue;
|
|
6718
|
-
if (
|
|
7324
|
+
if (hasForbiddenSegment(full, cwd, IGNORE_NAME_SET, SEARCH_IGNORE_NAME_SET)) continue;
|
|
6719
7325
|
if (fileScene.has(full)) continue;
|
|
6720
|
-
const rel =
|
|
7326
|
+
const rel = relative8(cwd, full);
|
|
6721
7327
|
const posixRel = toPosixPath(rel);
|
|
6722
7328
|
allFiles.push({ id: posixRel, filename: rel, isFolder: s.isDirectory() });
|
|
6723
7329
|
if (s.isDirectory()) await collect(full);
|
|
@@ -6734,7 +7340,7 @@ function createFilesystemState(ctx) {
|
|
|
6734
7340
|
const project = storage.getProject(projectId);
|
|
6735
7341
|
if (!project) throw new Error("Project not found");
|
|
6736
7342
|
if (isAbsolute6) return resolveSafePath(project.cwd, inputPath);
|
|
6737
|
-
return
|
|
7343
|
+
return relative8(project.cwd, resolveSafePath(project.cwd, inputPath));
|
|
6738
7344
|
}
|
|
6739
7345
|
async function copyFileToWorkspace({
|
|
6740
7346
|
projectId,
|
|
@@ -6757,7 +7363,7 @@ function createFilesystemState(ctx) {
|
|
|
6757
7363
|
}
|
|
6758
7364
|
await copyFile(sourcePath, destPath);
|
|
6759
7365
|
markProjectFsDirty(projectId);
|
|
6760
|
-
return { success: true, destPath: toPosixPath(
|
|
7366
|
+
return { success: true, destPath: toPosixPath(relative8(cwd, destPath)) };
|
|
6761
7367
|
}
|
|
6762
7368
|
async function readUrlAsDataUrl({ url: inputUrl, mimeType }) {
|
|
6763
7369
|
const MAX_FILE_SIZE = 20 * 1024 * 1024;
|
|
@@ -6807,12 +7413,12 @@ function createFilesystemState(ctx) {
|
|
|
6807
7413
|
const results = [];
|
|
6808
7414
|
for (const name of entries) {
|
|
6809
7415
|
const full = join17(cwd, name);
|
|
6810
|
-
if (
|
|
7416
|
+
if (hasForbiddenSegment(full, cwd, IGNORE_NAME_SET, SEARCH_IGNORE_NAME_SET)) continue;
|
|
6811
7417
|
if (fileScene.has(full)) continue;
|
|
6812
7418
|
fileScene.add(full);
|
|
6813
7419
|
const s = await stat4(full).catch(() => null);
|
|
6814
7420
|
if (!s) continue;
|
|
6815
|
-
const rel =
|
|
7421
|
+
const rel = relative8(cwd, full);
|
|
6816
7422
|
results.push({ id: toPosixPath(rel), filename: rel, isFolder: s.isDirectory() });
|
|
6817
7423
|
if (results.length >= SEARCH_MAX_RESULTS) break;
|
|
6818
7424
|
}
|
|
@@ -6851,14 +7457,23 @@ function createFilesystemState(ctx) {
|
|
|
6851
7457
|
const full = join17(startPath, name);
|
|
6852
7458
|
const s = await stat4(full).catch(() => null);
|
|
6853
7459
|
if (!s) continue;
|
|
6854
|
-
if (
|
|
6855
|
-
const relId = toPosixPath(
|
|
6856
|
-
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 });
|
|
6857
7463
|
}
|
|
6858
7464
|
results.sort((a, b) => {
|
|
6859
7465
|
if (a.isFolder !== b.isFolder) return a.isFolder ? -1 : 1;
|
|
6860
7466
|
return a.name.localeCompare(b.name);
|
|
6861
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
|
+
}
|
|
6862
7477
|
return results;
|
|
6863
7478
|
}
|
|
6864
7479
|
async function createFile({
|
|
@@ -6872,7 +7487,7 @@ function createFilesystemState(ctx) {
|
|
|
6872
7487
|
if (isFolder) {
|
|
6873
7488
|
await mkdir(targetPath, { recursive: true });
|
|
6874
7489
|
} else {
|
|
6875
|
-
await mkdir(
|
|
7490
|
+
await mkdir(dirname7(targetPath), { recursive: true });
|
|
6876
7491
|
await writeFile3(targetPath, "");
|
|
6877
7492
|
}
|
|
6878
7493
|
markProjectFsDirty(projectId);
|
|
@@ -6979,6 +7594,22 @@ function createFilesystemState(ctx) {
|
|
|
6979
7594
|
await writeFile3(currentDest, buffer);
|
|
6980
7595
|
markProjectFsDirty(projectId);
|
|
6981
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
|
+
}
|
|
6982
7613
|
async function getPlatform() {
|
|
6983
7614
|
return process.platform;
|
|
6984
7615
|
}
|
|
@@ -6998,83 +7629,16 @@ function createFilesystemState(ctx) {
|
|
|
6998
7629
|
readFile: readFile11,
|
|
6999
7630
|
getFileInfo,
|
|
7000
7631
|
writeExternalFile,
|
|
7632
|
+
getGitStatus: getGitStatus2,
|
|
7633
|
+
readGitHeadFile: readGitHeadFile2,
|
|
7001
7634
|
getPlatform
|
|
7002
7635
|
};
|
|
7003
7636
|
}
|
|
7004
7637
|
|
|
7005
|
-
// src/backend/project/git.ts
|
|
7006
|
-
import { execFile } from "child_process";
|
|
7007
|
-
import { dirname as dirname7, relative as relative8 } from "path";
|
|
7008
|
-
import { promisify } from "util";
|
|
7009
|
-
var execFileAsync = promisify(execFile);
|
|
7010
|
-
function createGitHandlers(ctx) {
|
|
7011
|
-
const { storage } = ctx;
|
|
7012
|
-
async function getGitStatus({ projectId, cwd }) {
|
|
7013
|
-
try {
|
|
7014
|
-
const project = storage.getProject(projectId);
|
|
7015
|
-
if (!project) throw new Error("Project not found");
|
|
7016
|
-
const targetCwd = cwd ? resolveSafePath(project.cwd, cwd) : project.cwd;
|
|
7017
|
-
const { stdout } = await execFileAsync("git", ["status", "--porcelain", "-b", "-z"], {
|
|
7018
|
-
cwd: targetCwd,
|
|
7019
|
-
timeout: 2e3
|
|
7020
|
-
});
|
|
7021
|
-
const lines = stdout.split("\0").filter(Boolean);
|
|
7022
|
-
if (lines.length === 0) return null;
|
|
7023
|
-
let branchLine = lines[0];
|
|
7024
|
-
let branch = "";
|
|
7025
|
-
if (branchLine.startsWith("## ")) {
|
|
7026
|
-
branchLine = branchLine.slice(3);
|
|
7027
|
-
if (branchLine.startsWith("No commits yet on "))
|
|
7028
|
-
branch = branchLine.slice("No commits yet on ".length);
|
|
7029
|
-
else if (branchLine.startsWith("HEAD (no branch)")) branch = "HEAD";
|
|
7030
|
-
else branch = branchLine.split("...")[0];
|
|
7031
|
-
}
|
|
7032
|
-
const files = {};
|
|
7033
|
-
for (let i = 1; i < lines.length; i++) {
|
|
7034
|
-
const line = lines[i];
|
|
7035
|
-
const status = line.slice(0, 2);
|
|
7036
|
-
if (line.length < 4) continue;
|
|
7037
|
-
let path2 = line.slice(3);
|
|
7038
|
-
if ((status.includes("R") || status.includes("C")) && i + 1 < lines.length) {
|
|
7039
|
-
path2 = lines[i + 1];
|
|
7040
|
-
i++;
|
|
7041
|
-
}
|
|
7042
|
-
files[toPosixPath(path2)] = status;
|
|
7043
|
-
}
|
|
7044
|
-
return { branch, files };
|
|
7045
|
-
} catch {
|
|
7046
|
-
return null;
|
|
7047
|
-
}
|
|
7048
|
-
}
|
|
7049
|
-
async function readGitHeadFile({
|
|
7050
|
-
projectId,
|
|
7051
|
-
relativePath,
|
|
7052
|
-
encoding
|
|
7053
|
-
}) {
|
|
7054
|
-
try {
|
|
7055
|
-
const project = storage.getProject(projectId);
|
|
7056
|
-
if (!project) throw new Error("Project not found");
|
|
7057
|
-
const targetPath = resolveSafePath(project.cwd, relativePath);
|
|
7058
|
-
const cwd = dirname7(targetPath);
|
|
7059
|
-
const relPath = relative8(cwd, targetPath);
|
|
7060
|
-
const { stdout } = await execFileAsync("git", ["show", `HEAD:./${relPath}`], {
|
|
7061
|
-
cwd,
|
|
7062
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
7063
|
-
encoding: encoding ?? "utf8"
|
|
7064
|
-
});
|
|
7065
|
-
return stdout;
|
|
7066
|
-
} catch {
|
|
7067
|
-
return "";
|
|
7068
|
-
}
|
|
7069
|
-
}
|
|
7070
|
-
return { getGitStatus, readGitHeadFile };
|
|
7071
|
-
}
|
|
7072
|
-
|
|
7073
7638
|
// src/backend/project/index.ts
|
|
7074
7639
|
function createProjectModule(ctx, deps) {
|
|
7075
7640
|
const { sendEvent, onEvent, storage } = ctx;
|
|
7076
7641
|
const fs2 = createFilesystemState(ctx);
|
|
7077
|
-
const git = createGitHandlers(ctx);
|
|
7078
7642
|
onEvent((channel, payload) => {
|
|
7079
7643
|
if (channel === "fs-changed") {
|
|
7080
7644
|
fs2.markProjectFsDirty(payload.projectId);
|
|
@@ -7110,8 +7674,7 @@ function createProjectModule(ctx, deps) {
|
|
|
7110
7674
|
addProject: addProject2,
|
|
7111
7675
|
renameProject,
|
|
7112
7676
|
deleteProject: deleteProject2,
|
|
7113
|
-
...fs2
|
|
7114
|
-
...git
|
|
7677
|
+
...fs2
|
|
7115
7678
|
};
|
|
7116
7679
|
}
|
|
7117
7680
|
|
|
@@ -8457,6 +9020,33 @@ function createSessionModule(ctx, deps) {
|
|
|
8457
9020
|
shouldUpdateCache = true;
|
|
8458
9021
|
} else finalThoughtLevels = session.thoughtLevels;
|
|
8459
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
|
+
}
|
|
8460
9050
|
if (shouldUpdateCache || b.initializeInfo) {
|
|
8461
9051
|
storage.updateSession(
|
|
8462
9052
|
session.id,
|
|
@@ -8543,15 +9133,20 @@ function createSessionModule(ctx, deps) {
|
|
|
8543
9133
|
ctx,
|
|
8544
9134
|
mcpDeps
|
|
8545
9135
|
);
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
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
|
+
}
|
|
8555
9150
|
}
|
|
8556
9151
|
storage.updateSession(sessionId, { isStreaming: true });
|
|
8557
9152
|
const updated = storage.getSession(sessionId);
|
|
@@ -9391,22 +9986,53 @@ function createInferenceModule(_ctx, deps) {
|
|
|
9391
9986
|
const textChunks = [];
|
|
9392
9987
|
const terminalLogs = {};
|
|
9393
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
|
+
}
|
|
9394
10015
|
const bridge = new ACPBridge(agentId, {
|
|
9395
10016
|
agentInfo,
|
|
9396
10017
|
cwd,
|
|
9397
|
-
|
|
10018
|
+
extNotificationSpecs,
|
|
10019
|
+
onSessionConnect: (connection) => {
|
|
10020
|
+
currentSessionId = `${agentId}:${connection.sessionId}`;
|
|
9398
10021
|
},
|
|
9399
10022
|
onSessionUpdate: (notification) => {
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
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;
|
|
9405
10033
|
}
|
|
9406
10034
|
}
|
|
9407
10035
|
},
|
|
9408
|
-
onExtNotification: () => {
|
|
9409
|
-
},
|
|
9410
10036
|
onPermissionRequest: async (request) => {
|
|
9411
10037
|
const opt = request.options.find((o) => o.kind === "allow_always") ?? request.options.find((o) => o.kind === "allow_once") ?? request.options[0];
|
|
9412
10038
|
return { outcome: { outcome: "selected", optionId: opt?.optionId ?? "allow" } };
|
|
@@ -10145,7 +10771,15 @@ function createMemoryModule(_ctx, deps) {
|
|
|
10145
10771
|
if (file.entries.length === 0 && !existsSync8(getMemoryPath(projectId))) {
|
|
10146
10772
|
return null;
|
|
10147
10773
|
}
|
|
10148
|
-
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;
|
|
10149
10783
|
}
|
|
10150
10784
|
function clearMemory(projectId) {
|
|
10151
10785
|
const memoryPath = getMemoryPath(projectId);
|
|
@@ -10161,6 +10795,7 @@ function createMemoryModule(_ctx, deps) {
|
|
|
10161
10795
|
registerMemoryRoute,
|
|
10162
10796
|
buildMemoryMcpServer,
|
|
10163
10797
|
getMemory,
|
|
10798
|
+
deleteMemoryEntry,
|
|
10164
10799
|
clearMemory,
|
|
10165
10800
|
getFilePath
|
|
10166
10801
|
};
|
|
@@ -10353,6 +10988,7 @@ function createImageGenerationModule(ctx, deps) {
|
|
|
10353
10988
|
import { join as join23, resolve as resolve7, dirname as dirname9, basename as basename4, extname as extname3 } from "path";
|
|
10354
10989
|
import { writeFile as writeFile6 } from "fs/promises";
|
|
10355
10990
|
import { createHash as createHash6, randomUUID as randomUUID13, randomInt } from "crypto";
|
|
10991
|
+
import * as qr from "qr-image";
|
|
10356
10992
|
|
|
10357
10993
|
// src/shared/zod/mcp-toolbox-schema.ts
|
|
10358
10994
|
import { z as z10 } from "zod";
|
|
@@ -10483,6 +11119,18 @@ var imageConvertRespondSchema = z10.object({
|
|
|
10483
11119
|
metadata: imageMetadataRespondSchema.shape.result
|
|
10484
11120
|
})
|
|
10485
11121
|
});
|
|
11122
|
+
var qrCodeRequestSchema = z10.object({
|
|
11123
|
+
text: z10.string().min(1).describe("Text to encode in the QR code."),
|
|
11124
|
+
output: z10.string().optional().describe("Output PNG path. If omitted, saves as 'qrcode.png' in the project root."),
|
|
11125
|
+
size: z10.number().int().min(1).max(50).default(5).describe("Size of each QR module in pixels (1-50). Default: 5."),
|
|
11126
|
+
margin: z10.number().int().min(0).max(100).default(4).describe("White-space margin around the QR code in modules (0-100). Default: 4."),
|
|
11127
|
+
errorCorrection: z10.enum(["L", "M", "Q", "H"]).default("M").describe("Error correction level. Default: M.")
|
|
11128
|
+
});
|
|
11129
|
+
var qrCodeRespondSchema = z10.object({
|
|
11130
|
+
result: z10.object({
|
|
11131
|
+
output: z10.string()
|
|
11132
|
+
})
|
|
11133
|
+
});
|
|
10486
11134
|
|
|
10487
11135
|
// src/backend/toolbox.ts
|
|
10488
11136
|
var CHARSETS = {
|
|
@@ -10629,6 +11277,18 @@ function createToolboxModule(_ctx) {
|
|
|
10629
11277
|
const metadata = await sharp(outputPath).metadata();
|
|
10630
11278
|
return { result: { output: outputPath, metadata: extractMetadata(metadata) } };
|
|
10631
11279
|
});
|
|
11280
|
+
server.registry("toolbox/image-qrcode", async (payload) => {
|
|
11281
|
+
const { text, output, size, margin, errorCorrection } = qrCodeRequestSchema.parse(payload);
|
|
11282
|
+
const outputPath = resolve7(projectDir, output ?? "qrcode.png");
|
|
11283
|
+
const png = qr.imageSync(text, {
|
|
11284
|
+
type: "png",
|
|
11285
|
+
size,
|
|
11286
|
+
margin,
|
|
11287
|
+
ec_level: errorCorrection
|
|
11288
|
+
});
|
|
11289
|
+
await writeFile6(outputPath, png);
|
|
11290
|
+
return { result: { output: outputPath } };
|
|
11291
|
+
});
|
|
10632
11292
|
}
|
|
10633
11293
|
function buildToolboxMcpServer(options) {
|
|
10634
11294
|
return {
|
|
@@ -11048,6 +11708,9 @@ function initBackend(emitter) {
|
|
|
11048
11708
|
async getMemory({ projectId }) {
|
|
11049
11709
|
return memory.getMemory(projectId);
|
|
11050
11710
|
},
|
|
11711
|
+
async deleteMemoryEntry({ projectId, entryId }) {
|
|
11712
|
+
return memory.deleteMemoryEntry(projectId, entryId);
|
|
11713
|
+
},
|
|
11051
11714
|
async clearMemory({ projectId }) {
|
|
11052
11715
|
memory.clearMemory(projectId);
|
|
11053
11716
|
},
|
|
@@ -11073,7 +11736,7 @@ function initBackend(emitter) {
|
|
|
11073
11736
|
}
|
|
11074
11737
|
|
|
11075
11738
|
// package.json
|
|
11076
|
-
var version = "0.1.
|
|
11739
|
+
var version = "0.1.48";
|
|
11077
11740
|
|
|
11078
11741
|
// src/server/main.ts
|
|
11079
11742
|
var port;
|
|
@@ -11102,6 +11765,14 @@ Options:
|
|
|
11102
11765
|
process.exit(0);
|
|
11103
11766
|
}
|
|
11104
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
|
+
}
|
|
11105
11776
|
var { backendHandlers, closeBackend } = initBackend(() => false);
|
|
11106
11777
|
backendHandlers.startWebUIServer({ port, token }).then(({ url }) => {
|
|
11107
11778
|
const title = `Fello Server v${version}`;
|