cx-viewer 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -20
- package/build.js +15 -0
- package/cli.js +102 -18
- package/concepts/ar/BodyDiffJSON.md +1 -1
- package/concepts/ar/BodyFields.md +30 -33
- package/concepts/ar/GlobalSettings.md +165 -167
- package/concepts/ar/MainAgent.md +3 -4
- package/concepts/ar/ProxySwitch.md +3 -3
- package/concepts/ar/QRCode.md +1 -1
- package/concepts/ar/ResponseFields.md +29 -41
- package/concepts/ar/SubAgent-Search.md +12 -12
- package/concepts/ar/Teammate.md +16 -16
- package/concepts/ar/ToolsFirst.md +42 -48
- package/concepts/ar/TranslateContextPollution.md +9 -9
- package/concepts/ar/UltraPlan.md +38 -38
- package/concepts/da/BodyDiffJSON.md +2 -2
- package/concepts/da/BodyFields.md +30 -33
- package/concepts/da/GlobalSettings.md +165 -167
- package/concepts/da/MainAgent.md +3 -4
- package/concepts/da/ProxySwitch.md +3 -3
- package/concepts/da/QRCode.md +1 -1
- package/concepts/da/ResponseFields.md +29 -41
- package/concepts/da/SubAgent-Search.md +11 -11
- package/concepts/da/Teammate.md +16 -16
- package/concepts/da/ToolsFirst.md +42 -48
- package/concepts/da/TranslateContextPollution.md +9 -9
- package/concepts/da/UltraPlan.md +38 -38
- package/concepts/de/BodyDiffJSON.md +2 -2
- package/concepts/de/BodyFields.md +30 -33
- package/concepts/de/GlobalSettings.md +165 -167
- package/concepts/de/MainAgent.md +3 -4
- package/concepts/de/ProxySwitch.md +3 -3
- package/concepts/de/QRCode.md +1 -1
- package/concepts/de/ResponseFields.md +29 -41
- package/concepts/de/SubAgent-Search.md +11 -11
- package/concepts/de/Teammate.md +15 -15
- package/concepts/de/ToolsFirst.md +41 -47
- package/concepts/de/TranslateContextPollution.md +9 -9
- package/concepts/de/UltraPlan.md +38 -38
- package/concepts/en/BodyDiffJSON.md +5 -5
- package/concepts/en/BodyFields.md +17 -20
- package/concepts/en/GlobalSettings.md +49 -51
- package/concepts/en/MainAgent.md +8 -8
- package/concepts/en/ProxySwitch.md +3 -3
- package/concepts/en/QRCode.md +6 -6
- package/concepts/en/ResponseFields.md +7 -19
- package/concepts/en/SubAgent-Search.md +2 -2
- package/concepts/en/Teammate.md +4 -4
- package/concepts/en/Tool-apply_patch.md +11 -0
- package/concepts/en/Tool-create_goal.md +8 -0
- package/concepts/en/Tool-exec.md +88 -0
- package/concepts/en/Tool-followup_task.md +10 -0
- package/concepts/en/Tool-get_goal.md +5 -0
- package/concepts/en/Tool-image_generation.md +5 -0
- package/concepts/en/Tool-interrupt_agent.md +9 -0
- package/concepts/en/Tool-list_agents.md +9 -0
- package/concepts/en/Tool-list_mcp_resource_templates.md +8 -0
- package/concepts/en/Tool-list_mcp_resources.md +8 -0
- package/concepts/en/Tool-read_mcp_resource.md +10 -0
- package/concepts/en/Tool-request_user_input.md +9 -0
- package/concepts/en/Tool-send_message.md +10 -0
- package/concepts/en/Tool-shell_command.md +12 -0
- package/concepts/en/Tool-spawn_agent.md +11 -0
- package/concepts/en/Tool-tool_search.md +12 -0
- package/concepts/en/Tool-update_goal.md +9 -0
- package/concepts/en/Tool-update_plan.md +9 -0
- package/concepts/en/Tool-view_image.md +10 -0
- package/concepts/en/Tool-wait.md +12 -0
- package/concepts/en/Tool-wait_agent.md +9 -0
- package/concepts/en/Tool-web_search.md +11 -0
- package/concepts/en/Tools.md +29 -58
- package/concepts/en/ToolsFirst.md +24 -30
- package/concepts/en/TranslateContextPollution.md +10 -38
- package/concepts/en/UltraPlan.md +7 -7
- package/concepts/es/BodyDiffJSON.md +1 -1
- package/concepts/es/BodyFields.md +35 -38
- package/concepts/es/GlobalSettings.md +165 -167
- package/concepts/es/MainAgent.md +3 -4
- package/concepts/es/ProxySwitch.md +3 -3
- package/concepts/es/QRCode.md +1 -1
- package/concepts/es/ResponseFields.md +28 -40
- package/concepts/es/SubAgent-Search.md +12 -12
- package/concepts/es/Teammate.md +17 -17
- package/concepts/es/ToolsFirst.md +41 -47
- package/concepts/es/TranslateContextPollution.md +9 -9
- package/concepts/es/UltraPlan.md +38 -38
- package/concepts/fr/BodyDiffJSON.md +2 -2
- package/concepts/fr/BodyFields.md +35 -38
- package/concepts/fr/GlobalSettings.md +165 -167
- package/concepts/fr/MainAgent.md +3 -4
- package/concepts/fr/ProxySwitch.md +3 -3
- package/concepts/fr/QRCode.md +1 -1
- package/concepts/fr/ResponseFields.md +25 -37
- package/concepts/fr/SubAgent-Search.md +12 -12
- package/concepts/fr/Teammate.md +16 -16
- package/concepts/fr/ToolsFirst.md +40 -46
- package/concepts/fr/TranslateContextPollution.md +9 -9
- package/concepts/fr/UltraPlan.md +38 -38
- package/concepts/it/BodyDiffJSON.md +2 -2
- package/concepts/it/BodyFields.md +35 -38
- package/concepts/it/GlobalSettings.md +165 -167
- package/concepts/it/MainAgent.md +3 -4
- package/concepts/it/ProxySwitch.md +3 -3
- package/concepts/it/QRCode.md +1 -1
- package/concepts/it/ResponseFields.md +28 -40
- package/concepts/it/SubAgent-Search.md +12 -12
- package/concepts/it/Teammate.md +17 -17
- package/concepts/it/ToolsFirst.md +41 -47
- package/concepts/it/TranslateContextPollution.md +9 -9
- package/concepts/it/UltraPlan.md +38 -38
- package/concepts/ja/BodyDiffJSON.md +1 -1
- package/concepts/ja/BodyFields.md +30 -33
- package/concepts/ja/GlobalSettings.md +165 -167
- package/concepts/ja/MainAgent.md +3 -4
- package/concepts/ja/ProxySwitch.md +3 -3
- package/concepts/ja/QRCode.md +1 -1
- package/concepts/ja/ResponseFields.md +29 -41
- package/concepts/ja/SubAgent-Search.md +12 -12
- package/concepts/ja/Teammate.md +17 -17
- package/concepts/ja/ToolsFirst.md +41 -47
- package/concepts/ja/TranslateContextPollution.md +9 -9
- package/concepts/ja/UltraPlan.md +38 -38
- package/concepts/ko/BodyDiffJSON.md +1 -1
- package/concepts/ko/BodyFields.md +30 -33
- package/concepts/ko/GlobalSettings.md +165 -167
- package/concepts/ko/MainAgent.md +3 -4
- package/concepts/ko/ProxySwitch.md +3 -3
- package/concepts/ko/QRCode.md +1 -1
- package/concepts/ko/ResponseFields.md +29 -41
- package/concepts/ko/SubAgent-Search.md +12 -12
- package/concepts/ko/Teammate.md +17 -17
- package/concepts/ko/ToolsFirst.md +41 -47
- package/concepts/ko/TranslateContextPollution.md +9 -9
- package/concepts/ko/UltraPlan.md +38 -38
- package/concepts/no/BodyDiffJSON.md +2 -2
- package/concepts/no/BodyFields.md +30 -33
- package/concepts/no/GlobalSettings.md +165 -167
- package/concepts/no/MainAgent.md +3 -4
- package/concepts/no/ProxySwitch.md +3 -3
- package/concepts/no/QRCode.md +1 -1
- package/concepts/no/ResponseFields.md +29 -41
- package/concepts/no/SubAgent-Search.md +12 -12
- package/concepts/no/Teammate.md +17 -17
- package/concepts/no/ToolsFirst.md +42 -48
- package/concepts/no/TranslateContextPollution.md +9 -9
- package/concepts/no/UltraPlan.md +38 -38
- package/concepts/pl/BodyDiffJSON.md +2 -2
- package/concepts/pl/BodyFields.md +30 -33
- package/concepts/pl/GlobalSettings.md +165 -167
- package/concepts/pl/MainAgent.md +3 -4
- package/concepts/pl/ProxySwitch.md +3 -3
- package/concepts/pl/QRCode.md +1 -1
- package/concepts/pl/ResponseFields.md +29 -41
- package/concepts/pl/SubAgent-Search.md +12 -12
- package/concepts/pl/Teammate.md +17 -17
- package/concepts/pl/ToolsFirst.md +42 -48
- package/concepts/pl/TranslateContextPollution.md +9 -9
- package/concepts/pl/UltraPlan.md +38 -38
- package/concepts/pt-BR/BodyDiffJSON.md +2 -2
- package/concepts/pt-BR/BodyFields.md +30 -33
- package/concepts/pt-BR/GlobalSettings.md +165 -167
- package/concepts/pt-BR/MainAgent.md +3 -4
- package/concepts/pt-BR/ProxySwitch.md +3 -3
- package/concepts/pt-BR/QRCode.md +1 -1
- package/concepts/pt-BR/ResponseFields.md +29 -41
- package/concepts/pt-BR/SubAgent-Search.md +12 -12
- package/concepts/pt-BR/Teammate.md +17 -17
- package/concepts/pt-BR/ToolsFirst.md +41 -47
- package/concepts/pt-BR/TranslateContextPollution.md +9 -9
- package/concepts/pt-BR/UltraPlan.md +38 -38
- package/concepts/ru/BodyDiffJSON.md +1 -1
- package/concepts/ru/BodyFields.md +30 -33
- package/concepts/ru/GlobalSettings.md +165 -167
- package/concepts/ru/MainAgent.md +3 -4
- package/concepts/ru/ProxySwitch.md +3 -3
- package/concepts/ru/QRCode.md +1 -1
- package/concepts/ru/ResponseFields.md +29 -41
- package/concepts/ru/SubAgent-Search.md +12 -12
- package/concepts/ru/Teammate.md +17 -17
- package/concepts/ru/ToolsFirst.md +41 -47
- package/concepts/ru/TranslateContextPollution.md +9 -9
- package/concepts/ru/UltraPlan.md +38 -38
- package/concepts/th/BodyDiffJSON.md +1 -1
- package/concepts/th/BodyFields.md +30 -33
- package/concepts/th/GlobalSettings.md +165 -167
- package/concepts/th/MainAgent.md +3 -4
- package/concepts/th/ProxySwitch.md +3 -3
- package/concepts/th/QRCode.md +1 -1
- package/concepts/th/ResponseFields.md +29 -41
- package/concepts/th/SubAgent-Search.md +12 -12
- package/concepts/th/Teammate.md +17 -17
- package/concepts/th/ToolsFirst.md +42 -48
- package/concepts/th/TranslateContextPollution.md +9 -9
- package/concepts/th/UltraPlan.md +38 -38
- package/concepts/tr/BodyDiffJSON.md +1 -1
- package/concepts/tr/BodyFields.md +30 -33
- package/concepts/tr/GlobalSettings.md +165 -167
- package/concepts/tr/MainAgent.md +3 -4
- package/concepts/tr/ProxySwitch.md +3 -3
- package/concepts/tr/QRCode.md +1 -1
- package/concepts/tr/ResponseFields.md +29 -41
- package/concepts/tr/SubAgent-Search.md +12 -12
- package/concepts/tr/Teammate.md +16 -16
- package/concepts/tr/ToolsFirst.md +42 -48
- package/concepts/tr/TranslateContextPollution.md +9 -9
- package/concepts/tr/UltraPlan.md +38 -38
- package/concepts/uk/BodyDiffJSON.md +1 -1
- package/concepts/uk/BodyFields.md +30 -33
- package/concepts/uk/GlobalSettings.md +165 -167
- package/concepts/uk/MainAgent.md +3 -4
- package/concepts/uk/ProxySwitch.md +3 -3
- package/concepts/uk/QRCode.md +1 -1
- package/concepts/uk/ResponseFields.md +29 -41
- package/concepts/uk/SubAgent-Search.md +12 -12
- package/concepts/uk/Teammate.md +17 -17
- package/concepts/uk/ToolsFirst.md +42 -48
- package/concepts/uk/TranslateContextPollution.md +9 -9
- package/concepts/uk/UltraPlan.md +38 -38
- package/concepts/zh/BodyDiffJSON.md +4 -4
- package/concepts/zh/BodyFields.md +17 -20
- package/concepts/zh/GlobalSettings.md +26 -28
- package/concepts/zh/MainAgent.md +6 -6
- package/concepts/zh/ProxySwitch.md +1 -1
- package/concepts/zh/ResponseFields.md +7 -18
- package/concepts/zh/SubAgent-Search.md +2 -2
- package/concepts/zh/Teammate.md +4 -4
- package/concepts/zh/Tool-apply_patch.md +11 -0
- package/concepts/zh/Tool-create_goal.md +8 -0
- package/concepts/zh/Tool-exec.md +88 -0
- package/concepts/zh/Tool-followup_task.md +10 -0
- package/concepts/zh/Tool-get_goal.md +5 -0
- package/concepts/zh/Tool-image_generation.md +5 -0
- package/concepts/zh/Tool-interrupt_agent.md +9 -0
- package/concepts/zh/Tool-list_agents.md +9 -0
- package/concepts/zh/Tool-list_mcp_resource_templates.md +8 -0
- package/concepts/zh/Tool-list_mcp_resources.md +8 -0
- package/concepts/zh/Tool-read_mcp_resource.md +10 -0
- package/concepts/zh/Tool-request_user_input.md +9 -0
- package/concepts/zh/Tool-send_message.md +10 -0
- package/concepts/zh/Tool-shell_command.md +12 -0
- package/concepts/zh/Tool-spawn_agent.md +11 -0
- package/concepts/zh/Tool-tool_search.md +12 -0
- package/concepts/zh/Tool-update_goal.md +9 -0
- package/concepts/zh/Tool-update_plan.md +9 -0
- package/concepts/zh/Tool-view_image.md +10 -0
- package/concepts/zh/Tool-wait.md +12 -0
- package/concepts/zh/Tool-wait_agent.md +9 -0
- package/concepts/zh/Tool-web_search.md +11 -0
- package/concepts/zh/Tools.md +29 -58
- package/concepts/zh/ToolsFirst.md +21 -27
- package/concepts/zh/TranslateContextPollution.md +10 -38
- package/concepts/zh/UltraPlan.md +7 -7
- package/concepts/zh-TW/BodyFields.md +27 -30
- package/concepts/zh-TW/GlobalSettings.md +26 -28
- package/concepts/zh-TW/MainAgent.md +0 -1
- package/concepts/zh-TW/ProxySwitch.md +22 -22
- package/concepts/zh-TW/ResponseFields.md +29 -40
- package/concepts/zh-TW/SubAgent-Search.md +12 -12
- package/concepts/zh-TW/Teammate.md +16 -16
- package/concepts/zh-TW/ToolsFirst.md +41 -47
- package/concepts/zh-TW/UltraPlan.md +38 -38
- package/dist/assets/App-BZ9oclBj.js +2 -0
- package/dist/assets/App-rWON7PuS.css +1 -0
- package/dist/assets/MdxEditorPanel-B4lZ7Z_A.js +1 -0
- package/dist/assets/MdxEditorPanel-Da_ceLFo.css +1 -0
- package/dist/assets/Mobile-B5V_-6Hc.css +1 -0
- package/dist/assets/Mobile-C7Hy-TIM.js +1 -0
- package/dist/assets/abnfDiagram-VRR7QNED-DYYppIQV.js +1 -0
- package/dist/assets/apl-B8ZmNFqK.js +1 -0
- package/dist/assets/arc-BT3um7r4.js +1 -0
- package/dist/assets/architectureDiagram-ZJ3FMSHR-uweBqnh-.js +1 -0
- package/dist/assets/asciiarmor-CIte6N-S.js +1 -0
- package/dist/assets/asn1-Ax1-z1nk.js +1 -0
- package/dist/assets/asterisk-CLHf-iRz.js +1 -0
- package/dist/assets/blockDiagram-677ZJIJ3-DzeI4GyV.js +1 -0
- package/dist/assets/brainfuck-CdLnmYpe.js +1 -0
- package/dist/assets/c4Diagram-LMCZKHZV-DBI0K7wS.js +1 -0
- package/dist/assets/channel-BrN6yx0e.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-DK9JA8Ct.js +1 -0
- package/dist/assets/chunk-32BRIVSS-VNg3Ylzs.js +1 -0
- package/dist/assets/chunk-5VM5RSS4-DFhufY9o.js +1 -0
- package/dist/assets/chunk-EX3LRPZG-B93MHNBT.js +1 -0
- package/dist/assets/chunk-JWPE2WC7-C54OW1iN.js +1 -0
- package/dist/assets/chunk-MOJQB5TN-lKhWWIDe.js +1 -0
- package/dist/assets/chunk-RYQCIY6F-BK2jDXwB.js +1 -0
- package/dist/assets/chunk-V7JOEXUC-aLHBmfOc.js +1 -0
- package/dist/assets/chunk-VR4S4FIN-Bomuor1h.js +1 -0
- package/dist/assets/chunk-XXDRQBXY-BPj05P7g.js +1 -0
- package/dist/assets/classDiagram-OUVF2IWQ-COm0X4uJ.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-COm0X4uJ.js +1 -0
- package/dist/assets/clike-BDgEuk0n.js +1 -0
- package/dist/assets/clojure-CrPxgQZl.js +1 -0
- package/dist/assets/cmake-BknZiLBu.js +1 -0
- package/dist/assets/cobol-DN1mHbgw.js +1 -0
- package/dist/assets/coffeescript-DTAwRC7M.js +1 -0
- package/dist/assets/commonlisp-B4DJ--Bo.js +1 -0
- package/dist/assets/cose-bilkent-JH36ORCC-DU44QHSb.js +1 -0
- package/dist/assets/crystal-DoipYOOv.js +1 -0
- package/dist/assets/css-BeQRP3p5.js +1 -0
- package/dist/assets/cynefin-VYW2F7L2-C0dowxsF.js +15 -0
- package/dist/assets/cynefinDiagram-TSTJHNR4-C6vNWPUV.js +1 -0
- package/dist/assets/cypher-BzELKutH.js +1 -0
- package/dist/assets/cytoscape.esm-D0POlJZ1.js +9 -0
- package/dist/assets/d-Mh2Rawoc.js +1 -0
- package/dist/assets/dagre-VKFMJZFB-aLG4uEb-.js +1 -0
- package/dist/assets/defaultLocale-DZ7E7S9R.js +1 -0
- package/dist/assets/diagram-FQU43EPY-D5C8GfdU.js +1 -0
- package/dist/assets/diagram-G47NLZAW-C9tRw_xi.js +1 -0
- package/dist/assets/diagram-NH7WQ7WH-AYxTxwJ2.js +1 -0
- package/dist/assets/diagram-OA4YK3LP-BuBE5n9n.js +1 -0
- package/dist/assets/diagram-WEI45ONY-Cda7zYeO.js +1 -0
- package/dist/assets/diff-B1OtBbfz.js +1 -0
- package/dist/assets/dockerfile-Du7niAGi.js +1 -0
- package/dist/assets/dtd-So5hjSa8.js +1 -0
- package/dist/assets/dylan-Co15g-RX.js +1 -0
- package/dist/assets/ebnf-DWrAnno4.js +1 -0
- package/dist/assets/ebnfDiagram-CCIWWBDH-DC_OGyoh.js +1 -0
- package/dist/assets/ecl-8tbf0rUT.js +1 -0
- package/dist/assets/eiffel-BXtlUtEg.js +1 -0
- package/dist/assets/elm-BwiUluiH.js +1 -0
- package/dist/assets/erDiagram-Q63AITRT-D2G21PVY.js +1 -0
- package/dist/assets/erlang-CrHBLi-m.js +1 -0
- package/dist/assets/factor-C7nC06Ta.js +1 -0
- package/dist/assets/fcl-DKWfryFT.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-CEQPYHrk.js +1 -0
- package/dist/assets/forth-Cg8ASoTj.js +1 -0
- package/dist/assets/fortran-BHf_qfFx.js +1 -0
- package/dist/assets/ganttDiagram-NO4QXBWP-JStxUtFR.js +1 -0
- package/dist/assets/gas-cj_2N_z1.js +1 -0
- package/dist/assets/gherkin-BiuTaH40.js +1 -0
- package/dist/assets/gitGraphDiagram-IHSO6WYX-BiojPH-V.js +1 -0
- package/dist/assets/graph-CnJdn47S.js +1 -0
- package/dist/assets/groovy-Bq8cXYUU.js +1 -0
- package/dist/assets/haskell-1ANuaeie.js +1 -0
- package/dist/assets/haxe-BUNSvWf_.js +1 -0
- package/dist/assets/html2canvas.esm-HFdlUwfn.js +20 -0
- package/dist/assets/http-DPC2IRQA.js +1 -0
- package/dist/assets/idl-DDbIciu_.js +1 -0
- package/dist/assets/index-BEyKG3O5.css +1 -0
- package/dist/assets/index-BduJoLQ5.js +1 -0
- package/dist/assets/index-BqwR8F0v.js +1 -0
- package/dist/assets/index-BsycQyrv.js +1 -0
- package/dist/assets/index-CFSDxZyA.js +1 -0
- package/dist/assets/index-CunNLTHc.js +1 -0
- package/dist/assets/index-OGkDFNTK.js +1 -0
- package/dist/assets/index-oxOyrL07.js +2 -0
- package/dist/assets/index-wvaycTGT.js +1 -0
- package/dist/assets/infoDiagram-FWYZ7A6U-Csl_aBIC.js +1 -0
- package/dist/assets/init-DMZMl1PR.js +1 -0
- package/dist/assets/ishikawaDiagram-FXEZZL3T-CjgGuMwr.js +1 -0
- package/dist/assets/javascript-Cet1BUca.js +1 -0
- package/dist/assets/journeyDiagram-5HDEW3XC-DUOy1PCq.js +1 -0
- package/dist/assets/jszip.min-BxIXdRg4.js +12 -0
- package/dist/assets/julia-CdxLCr68.js +1 -0
- package/dist/assets/kanban-definition-HUTT4EX6-Cx7GSrSj.js +1 -0
- package/dist/assets/katex-CfXf84Fz.js +1 -0
- package/dist/assets/layout-CCUE9ZRw.js +1 -0
- package/dist/assets/linear-GeBi6jJp.js +1 -0
- package/dist/assets/livescript-Bw1Vw7Ae.js +1 -0
- package/dist/assets/lua-DM1wbcnc.js +1 -0
- package/dist/assets/map-DQeg2hXV.js +1 -0
- package/dist/assets/mathematica-BXSv1_O1.js +1 -0
- package/dist/assets/mbox-CWY0keg3.js +1 -0
- package/dist/assets/mermaid.core-Cy9iVxov.js +7 -0
- package/dist/assets/mindmap-definition-LN4V7U3C-CUVxVkK5.js +1 -0
- package/dist/assets/mirc-CMLrLVMT.js +1 -0
- package/dist/assets/mllike-naqhAFf1.js +1 -0
- package/dist/assets/modelica-BvadsaHY.js +1 -0
- package/dist/assets/mscgen-DOr-Q10p.js +1 -0
- package/dist/assets/mumps-DKTl5Nyj.js +1 -0
- package/dist/assets/nginx-DWR90-d1.js +1 -0
- package/dist/assets/nsis-ooFGduGn.js +1 -0
- package/dist/assets/ntriples-q5jkU4X1.js +1 -0
- package/dist/assets/octave-Deu9Ci7_.js +1 -0
- package/dist/assets/orbiting-BCD4Vuij.svg +7 -0
- package/dist/assets/ordinal-DA-_8pMy.js +1 -0
- package/dist/assets/oz-cTQm1aoB.js +1 -0
- package/dist/assets/pascal-Oh3VmczP.js +1 -0
- package/dist/assets/pegDiagram-2B236MQR-BCF1byLY.js +1 -0
- package/dist/assets/perl-BddWF1HQ.js +1 -0
- package/dist/assets/pieDiagram-ENE6RG2P-D2cZTo8-.js +1 -0
- package/dist/assets/pig-g5ZQNIDr.js +1 -0
- package/dist/assets/powershell-CNmQNFVJ.js +1 -0
- package/dist/assets/properties-B41DXfv6.js +1 -0
- package/dist/assets/protobuf-eEBl31OJ.js +1 -0
- package/dist/assets/pug-DRSo4eCK.js +1 -0
- package/dist/assets/puppet-ClfRubAD.js +1 -0
- package/dist/assets/python-BSflc812.js +1 -0
- package/dist/assets/q-BBDx3N9Y.js +1 -0
- package/dist/assets/quadrantDiagram-ABIIQ3AL-Bwsn2--F.js +1 -0
- package/dist/assets/r-CByC1eO8.js +1 -0
- package/dist/assets/railroadDiagram-RFXS5EU6-CLGLpWHs.js +1 -0
- package/dist/assets/requirementDiagram-TGXJPOKE-BfmBYwZl.js +1 -0
- package/dist/assets/rpm-8t935XkD.js +1 -0
- package/dist/assets/ruby-CAgbkLZh.js +1 -0
- package/dist/assets/sankeyDiagram-HTMAVEWB-CqZhbyFn.js +1 -0
- package/dist/assets/sas-C-JWcRvo.js +1 -0
- package/dist/assets/scheme-D7o9RjUX.js +1 -0
- package/dist/assets/seqResourceLoaders-Bkh2Rb9i.js +2 -0
- package/dist/assets/seqResourceLoaders-Do7Kqg3B.css +41 -0
- package/dist/assets/sequenceDiagram-DBY2YBRQ-CcOdXkN2.js +1 -0
- package/dist/assets/shell-BXA79DV6.js +1 -0
- package/dist/assets/shimmer-BBDejmDf.svg +7 -0
- package/dist/assets/sieve-DNwyl0rd.js +1 -0
- package/dist/assets/simple-mode-CoQRusFX.js +1 -0
- package/dist/assets/sizeCapture-X5ZJPWSS-B4OVmPqu.js +1 -0
- package/dist/assets/smalltalk-DggktV6S.js +1 -0
- package/dist/assets/solr-D7NRuIPM.js +1 -0
- package/dist/assets/sparql-Cr71deJQ.js +1 -0
- package/dist/assets/spreadsheet-BMD3tYqw.js +1 -0
- package/dist/assets/sql-CbOjXfBR.js +1 -0
- package/dist/assets/stateDiagram-2N3HPSRC-Dysun0oO.js +1 -0
- package/dist/assets/stateDiagram-v2-6OUMAXLB-BFet8xAz.js +1 -0
- package/dist/assets/stex-iDPIkRmr.js +1 -0
- package/dist/assets/stylus-nWZizI-c.js +1 -0
- package/dist/assets/swift-DOhLK5SG.js +1 -0
- package/dist/assets/swimlanes-5IMT3BWC-_30OXwXy.js +2 -0
- package/dist/assets/swimlanesDiagram-G3AALYLV-C19viY0G.js +1 -0
- package/dist/assets/tcl-CQhJd1WY.js +1 -0
- package/dist/assets/textile-D9XqfVtL.js +1 -0
- package/dist/assets/tiddlywiki-DfOYgVky.js +1 -0
- package/dist/assets/tiki-a0_YLWvV.js +1 -0
- package/dist/assets/timeline-definition-FHXFAJF6-X1Xk3onD.js +1 -0
- package/dist/assets/toml-ekl3F1YB.js +1 -0
- package/dist/assets/troff-Bh_pcXF1.js +1 -0
- package/dist/assets/ttcn-M6363IRW.js +1 -0
- package/dist/assets/ttcn-cfg-7I2DgJEN.js +1 -0
- package/dist/assets/turtle-B5jdxH6D.js +1 -0
- package/dist/assets/vb-DM-xPmVv.js +1 -0
- package/dist/assets/vbscript-B0qu41Yc.js +1 -0
- package/dist/assets/velocity-FCgsuVHf.js +1 -0
- package/dist/assets/vendor-antd-Bzi1WuBb.js +17 -0
- package/dist/assets/vendor-codemirror-CKTrJd47.js +1 -0
- package/dist/assets/vendor-highlight-IFTJ9nxW.js +1 -0
- package/dist/assets/vendor-markdown-BN3QLsBu.js +3 -0
- package/dist/assets/vendor-mdxeditor-4PbKH6K7.js +2 -0
- package/dist/assets/vendor-qrcode-Bnjm0rcu.js +6 -0
- package/dist/assets/vendor-react-l0sNRNKZ.js +1 -0
- package/dist/assets/vendor-virtuoso-2P4SowHC.js +1 -0
- package/dist/assets/vendor-xterm-DckPrCx1.js +37 -0
- package/dist/assets/vennDiagram-L72KCM5P-D3fQnGq7.js +1 -0
- package/dist/assets/verilog-nrfFvR12.js +1 -0
- package/dist/assets/vhdl-WlDXtV-W.js +1 -0
- package/dist/assets/wardleyDiagram-EHGQE667-CRhqI6-g.js +1 -0
- package/dist/assets/webidl-RIQoSXDx.js +1 -0
- package/dist/assets/xquery-BN45G3lJ.js +1 -0
- package/dist/assets/xychartDiagram-FW5EYKEG-Cmtgmmtg.js +1 -0
- package/dist/assets/yacas-U6gaIVhD.js +1 -0
- package/dist/assets/z80-CFe5BHbK.js +1 -0
- package/dist/index.html +25 -6
- package/dist/voice-packs/default/A_choice_for_your_consideration_sir.MP3 +0 -0
- package/dist/voice-packs/default/It_is_done_sir.MP3 +0 -0
- package/dist/voice-packs/default/The_plan_awaits_your_approval_sir.MP3 +0 -0
- package/dist/voice-packs/default/pack.json +24 -0
- package/dist/voice-packs/sanguo/ask.MP3 +0 -0
- package/dist/voice-packs/sanguo/end.MP3 +0 -0
- package/dist/voice-packs/sanguo/pack.json +24 -0
- package/dist/voice-packs/sanguo/plan.MP3 +0 -0
- package/electron/diag.js +110 -0
- package/electron/main.js +1432 -0
- package/electron/menu-model.js +107 -0
- package/electron/tab-bar.html +575 -0
- package/electron/tab-content-preload.js +66 -0
- package/electron/tab-preload.js +24 -0
- package/electron/tab-worker.js +142 -0
- package/electron/window-state.js +60 -0
- package/electron/workspace-preload.js +19 -0
- package/findcx.js +4 -0
- package/i18n.js +3 -423
- package/index.html +30 -0
- package/interceptor.js +144 -70
- package/jsconfig.json +25 -0
- package/lib/approval-reviewer.js +23 -0
- package/lib/appserver-bridge.js +1753 -237
- package/lib/ask-bridge.js +5 -5
- package/lib/cli-args.js +1 -0
- package/lib/codex-config.js +157 -18
- package/lib/context-watcher.js +6 -65
- package/lib/delta-reconstructor.js +74 -52
- package/lib/ensure-hooks.js +37 -30
- package/lib/interceptor-core.js +490 -43
- package/lib/log-watcher.js +3 -8
- package/lib/main-agent-entry.js +68 -0
- package/lib/openai-body.js +95 -0
- package/lib/otel-adapter.js +3 -2
- package/lib/otel-receiver.js +1 -2
- package/lib/perm-bridge.js +84 -44
- package/lib/proxy-env.js +45 -1
- package/lib/sdk-adapter.js +241 -51
- package/lib/sdk-manager.js +523 -370
- package/lib/skills-api.js +364 -0
- package/lib/stats-worker.js +21 -21
- package/lib/token-usage.js +29 -0
- package/lib/updater.js +3 -7
- package/package.json +27 -6
- package/plugins/.gitkeep +0 -0
- package/plugins/README.md +8 -0
- package/proxy.js +187 -241
- package/pty-manager.js +17 -1
- package/public/favicon.ico +0 -0
- package/public/voice-packs/default/A_choice_for_your_consideration_sir.MP3 +0 -0
- package/public/voice-packs/default/It_is_done_sir.MP3 +0 -0
- package/public/voice-packs/default/The_plan_awaits_your_approval_sir.MP3 +0 -0
- package/public/voice-packs/default/pack.json +24 -0
- package/public/voice-packs/sanguo/ask.MP3 +0 -0
- package/public/voice-packs/sanguo/end.MP3 +0 -0
- package/public/voice-packs/sanguo/pack.json +24 -0
- package/public/voice-packs/sanguo/plan.MP3 +0 -0
- package/scripts/check-no-control-bytes.js +130 -0
- package/scripts/check-sign-config.sh +85 -0
- package/scripts/gen-default-voicepack.js +176 -0
- package/scripts/mac-sign.sh +47 -0
- package/scripts/npm-pack-dry-run.mjs +20 -0
- package/server/lib/approval-modal-prefs.js +72 -0
- package/server/lib/context-rules.js +70 -0
- package/server/lib/delta-reconstructor.js +403 -0
- package/server/lib/tools-xml-formatter.js +91 -0
- package/server/lib/voice-pack-events.js +79 -0
- package/server.js +420 -86
- package/src/App.jsx +638 -0
- package/src/App.module.css +1088 -0
- package/src/AppBase.jsx +2803 -0
- package/src/Mobile.jsx +1348 -0
- package/src/components/approval/ApprovalModal.jsx +319 -0
- package/src/components/approval/ApprovalModal.module.css +160 -0
- package/src/components/approval/ToolApprovalPanel.jsx +111 -0
- package/src/components/approval/ToolApprovalPanel.module.css +250 -0
- package/src/components/chat/ApprovalPortalContext.js +26 -0
- package/src/components/chat/AskQuestionForm.jsx +279 -0
- package/src/components/chat/AskTimeoutCountdown.jsx +113 -0
- package/src/components/chat/ChatInputBar.jsx +584 -0
- package/src/components/chat/ChatInputBar.module.css +656 -0
- package/src/components/chat/ChatMessage.jsx +1587 -0
- package/src/components/chat/ChatMessage.module.css +1560 -0
- package/src/components/chat/ChatView.jsx +3533 -0
- package/src/components/chat/ChatView.module.css +418 -0
- package/src/components/chat/DiffView.jsx +111 -0
- package/src/components/chat/DiffView.module.css +141 -0
- package/src/components/chat/RoleFilterBar.jsx +35 -0
- package/src/components/chat/RoleFilterBar.module.css +62 -0
- package/src/components/chat/controllers/askFlowController.js +789 -0
- package/src/components/chat/controllers/permissionController.js +84 -0
- package/src/components/chat/controllers/ptyPromptController.js +166 -0
- package/src/components/chat/controllers/scrollHighlightController.js +50 -0
- package/src/components/chat/controllers/splitDragController.js +135 -0
- package/src/components/chat/controllers/toolFileChangeController.js +216 -0
- package/src/components/chat/interactionOwnership.js +106 -0
- package/src/components/chat/uploadDeferLogic.js +46 -0
- package/src/components/common/ConceptHelp.jsx +97 -0
- package/src/components/common/ConceptHelp.module.css +151 -0
- package/src/components/common/ConfirmRemoveButton.jsx +78 -0
- package/src/components/common/CountryFlag.jsx +105 -0
- package/src/components/common/CountryFlag.module.css +36 -0
- package/src/components/common/DingTalkIcon.jsx +20 -0
- package/src/components/common/DiscordIcon.jsx +21 -0
- package/src/components/common/FeishuIcon.jsx +23 -0
- package/src/components/common/HoverPreviewTip.jsx +62 -0
- package/src/components/common/HoverPreviewTip.module.css +21 -0
- package/src/components/common/ImageLightbox.jsx +244 -0
- package/src/components/common/ImageLightbox.module.css +120 -0
- package/src/components/common/MemoryDetailModal.jsx +75 -0
- package/src/components/common/OpenFolderIcon.jsx +53 -0
- package/src/components/common/OpenFolderIcon.module.css +7 -0
- package/src/components/common/PanelResizer.jsx +48 -0
- package/src/components/common/PanelResizer.module.css +11 -0
- package/src/components/common/QuickAutoApproveRows.jsx +66 -0
- package/src/components/common/RefreshIcon.jsx +50 -0
- package/src/components/common/RefreshIcon.module.css +26 -0
- package/src/components/common/SnapLineOverlay.jsx +47 -0
- package/src/components/common/SnapLineOverlay.module.css +31 -0
- package/src/components/common/ToolsHelp.jsx +113 -0
- package/src/components/common/ToolsHelp.module.css +85 -0
- package/src/components/common/WeComIcon.jsx +22 -0
- package/src/components/common/quickMenuIcons.jsx +99 -0
- package/src/components/common/sharedChrome.module.css +274 -0
- package/src/components/dashboard/AppHeader.jsx +2085 -0
- package/src/components/dashboard/AppHeader.module.css +676 -0
- package/src/components/dashboard/CachePopoverContent.jsx +538 -0
- package/src/components/dashboard/CachePopoverContent.module.css +191 -0
- package/src/components/dashboard/ContextTab.jsx +769 -0
- package/src/components/dashboard/ContextTab.module.css +565 -0
- package/src/components/dashboard/DetailPanel.jsx +813 -0
- package/src/components/dashboard/DetailPanel.module.css +513 -0
- package/src/components/dashboard/LiveTagPopover.jsx +89 -0
- package/src/components/dashboard/LiveTagPopover.module.css +67 -0
- package/src/components/dashboard/RequestList.jsx +146 -0
- package/src/components/dashboard/RequestList.module.css +146 -0
- package/src/components/dashboard/TeamSessionPanel.jsx +584 -0
- package/src/components/dashboard/TeamSessionPanel.module.css +457 -0
- package/src/components/dashboard/UsageWindowPill.jsx +166 -0
- package/src/components/dashboard/UsageWindowPill.module.css +140 -0
- package/src/components/dashboard/WorkflowRunsPanel.jsx +108 -0
- package/src/components/dashboard/WorkflowRunsPanel.module.css +72 -0
- package/src/components/dashboard/WorkspaceList.jsx +410 -0
- package/src/components/dashboard/WorkspaceList.module.css +254 -0
- package/src/components/files/FileContentView.jsx +1013 -0
- package/src/components/files/FileContentView.module.css +418 -0
- package/src/components/files/FileExplorer.jsx +937 -0
- package/src/components/files/FileExplorer.module.css +173 -0
- package/src/components/files/MdxEditorPanel.base.css +9 -0
- package/src/components/files/MdxEditorPanel.jsx +181 -0
- package/src/components/files/MdxEditorPanel.module.css +917 -0
- package/src/components/git/DiffMiniMap.jsx +98 -0
- package/src/components/git/DiffMiniMap.module.css +17 -0
- package/src/components/git/FullFileDiffView.jsx +265 -0
- package/src/components/git/FullFileDiffView.module.css +176 -0
- package/src/components/git/GitChanges.jsx +461 -0
- package/src/components/git/GitChanges.module.css +337 -0
- package/src/components/git/GitDiffView.jsx +161 -0
- package/src/components/git/GitDiffView.module.css +205 -0
- package/src/components/mobile/MobileDrawerCloseButton.jsx +18 -0
- package/src/components/mobile/MobileFileExplorer.jsx +231 -0
- package/src/components/mobile/MobileFileExplorer.module.css +171 -0
- package/src/components/mobile/MobileGitDiff.jsx +293 -0
- package/src/components/mobile/MobileGitDiff.module.css +317 -0
- package/src/components/mobile/MobileStats.jsx +211 -0
- package/src/components/mobile/MobileStats.module.css +75 -0
- package/src/components/settings/ImAppendSystemModal.jsx +104 -0
- package/src/components/settings/ImConversationModal.jsx +328 -0
- package/src/components/settings/ImConversationModal.module.css +49 -0
- package/src/components/settings/ImPlatformSettings.jsx +453 -0
- package/src/components/settings/ImPlatformSettings.module.css +110 -0
- package/src/components/settings/ImSkillsModal.jsx +94 -0
- package/src/components/settings/ImStatusChip.jsx +80 -0
- package/src/components/settings/ImStatusChip.module.css +36 -0
- package/src/components/settings/MessagingModal.jsx +65 -0
- package/src/components/settings/MessagingModal.module.css +95 -0
- package/src/components/settings/ModelPromptTabs.jsx +118 -0
- package/src/components/settings/PluginModal.jsx +423 -0
- package/src/components/settings/PluginModal.module.css +136 -0
- package/src/components/settings/PreferencesForm.jsx +104 -0
- package/src/components/settings/PreferencesForm.module.css +27 -0
- package/src/components/settings/ProcessModal.jsx +175 -0
- package/src/components/settings/ProcessModal.module.css +21 -0
- package/src/components/settings/ProjectAliasEditor.jsx +138 -0
- package/src/components/settings/ProjectAliasEditor.module.css +87 -0
- package/src/components/settings/ProjectPrefsManagerModal.jsx +123 -0
- package/src/components/settings/ProjectPrefsManagerModal.module.css +52 -0
- package/src/components/settings/ProxyModal.jsx +286 -0
- package/src/components/settings/ProxyModal.module.css +141 -0
- package/src/components/settings/SkillsManagerModal.jsx +143 -0
- package/src/components/settings/SkillsManagerModal.module.css +143 -0
- package/src/components/settings/SystemTextModal.jsx +312 -0
- package/src/components/settings/SystemTextModal.module.css +331 -0
- package/src/components/settings/VoicePackSettings.jsx +319 -0
- package/src/components/settings/VoicePackSettings.module.css +151 -0
- package/src/components/settings/imPlatforms.js +177 -0
- package/src/components/terminal/CustomUltraplanEditModal.jsx +227 -0
- package/src/components/terminal/CustomUltraplanEditModal.module.css +189 -0
- package/src/components/terminal/PresetExpertPickerModal.jsx +116 -0
- package/src/components/terminal/PresetExpertPickerModal.module.css +90 -0
- package/src/components/terminal/PresetModal.jsx +118 -0
- package/src/components/terminal/ScratchTerminal.jsx +359 -0
- package/src/components/terminal/TerminalPanel.jsx +2021 -0
- package/src/components/terminal/TerminalPanel.module.css +872 -0
- package/src/components/terminal/TerminalWsContext.jsx +226 -0
- package/src/components/terminal/UltraPlanModal.jsx +328 -0
- package/src/components/terminal/UltraPlanModal.module.css +527 -0
- package/src/components/terminal/UltraplanExpertManagerModal.jsx +114 -0
- package/src/components/terminal/UltraplanExpertManagerModal.module.css +91 -0
- package/src/components/terminal/UltraplanPanel.jsx +307 -0
- package/src/components/terminal/UltraplanPanel.module.css +540 -0
- package/src/components/terminal/terminalThemes.js +33 -0
- package/src/components/viewers/ImageViewer.jsx +288 -0
- package/src/components/viewers/ImageViewer.module.css +203 -0
- package/src/components/viewers/JsonViewer.jsx +40 -0
- package/src/components/viewers/JsonViewer.module.css +9 -0
- package/src/components/viewers/LogTable.jsx +131 -0
- package/src/components/viewers/MarkdownBlock.jsx +112 -0
- package/src/components/viewers/MarkdownBlock.module.css +157 -0
- package/src/components/viewers/ToolResultView.jsx +389 -0
- package/src/components/viewers/ToolResultView.module.css +108 -0
- package/src/components/viewers/WebResultsView.jsx +74 -0
- package/src/components/viewers/WebResultsView.module.css +85 -0
- package/src/components/viewers/WorkflowLiveHud.jsx +153 -0
- package/src/components/viewers/WorkflowLiveHud.module.css +256 -0
- package/src/components/viewers/WorkflowPanel.jsx +243 -0
- package/src/components/viewers/WorkflowPanel.module.css +265 -0
- package/src/components/viewers/WorkflowTimeline.jsx +83 -0
- package/src/components/viewers/WorkflowTimeline.module.css +116 -0
- package/src/contexts/SettingsContext.jsx +140 -0
- package/src/env.js +54 -0
- package/src/global.css +607 -0
- package/src/hooks/useMarkdownExport.js +146 -0
- package/src/hooks/useMermaidRender.js +193 -0
- package/src/hooks/useProjectAlias.js +29 -0
- package/src/hooks/useSessionStoragePersistedSet.js +41 -0
- package/src/i18n/mdxTranslations.js +472 -0
- package/src/i18n.js +12409 -0
- package/src/img/ccv-logo.png +0 -0
- package/src/img/codex/entrance.svg +7 -0
- package/src/img/codex/exit.svg +7 -0
- package/src/img/codex/orbiting.svg +7 -0
- package/src/img/codex/shimmer.svg +7 -0
- package/src/img/codex/thinking.svg +7 -0
- package/src/img/codex/tickle.svg +7 -0
- package/src/img/codex/waiting.svg +7 -0
- package/src/img/codex/writing.svg +7 -0
- package/src/img/default-avatar.svg +1 -0
- package/src/img/default-model-avatar.svg +1 -0
- package/src/img/loading-pet.gif +0 -0
- package/src/img/model-codex.svg +2 -0
- package/src/img/model-deepseek.svg +2 -0
- package/src/img/model-gemini.svg +2 -0
- package/src/img/model-glm.svg +2 -0
- package/src/img/model-kimi.svg +2 -0
- package/src/img/model-minimax.svg +2 -0
- package/src/img/model-openai.svg +2 -0
- package/src/img/model-qwen.svg +2 -0
- package/src/img/teammates/DESIGN.md +165 -0
- package/src/img/teammates/analyst.svg +32 -0
- package/src/img/teammates/auditor.svg +28 -0
- package/src/img/teammates/builder.svg +33 -0
- package/src/img/teammates/default.svg +25 -0
- package/src/img/teammates/designer.svg +25 -0
- package/src/img/teammates/executor.svg +31 -0
- package/src/img/teammates/expert.svg +30 -0
- package/src/img/teammates/explorer.svg +30 -0
- package/src/img/teammates/implementer.svg +34 -0
- package/src/img/teammates/investigator.svg +29 -0
- package/src/img/teammates/marvel/analyst.svg +26 -0
- package/src/img/teammates/marvel/auditor.svg +28 -0
- package/src/img/teammates/marvel/builder.svg +15 -0
- package/src/img/teammates/marvel/default.svg +25 -0
- package/src/img/teammates/marvel/designer.svg +21 -0
- package/src/img/teammates/marvel/executor.svg +25 -0
- package/src/img/teammates/marvel/expert.svg +31 -0
- package/src/img/teammates/marvel/explorer.svg +22 -0
- package/src/img/teammates/marvel/implementer.svg +30 -0
- package/src/img/teammates/marvel/investigator.svg +21 -0
- package/src/img/teammates/marvel/researcher.svg +30 -0
- package/src/img/teammates/marvel/reviewer.svg +21 -0
- package/src/img/teammates/marvel/scanner.svg +23 -0
- package/src/img/teammates/marvel/security.svg +30 -0
- package/src/img/teammates/marvel/tracer.svg +19 -0
- package/src/img/teammates/marvel/translator.svg +24 -0
- package/src/img/teammates/marvel/worker.svg +16 -0
- package/src/img/teammates/researcher.svg +35 -0
- package/src/img/teammates/reviewer.svg +23 -0
- package/src/img/teammates/scanner.svg +31 -0
- package/src/img/teammates/security.svg +31 -0
- package/src/img/teammates/tracer.svg +30 -0
- package/src/img/teammates/translator.svg +32 -0
- package/src/img/teammates/worker.svg +29 -0
- package/src/main.jsx +30 -0
- package/src/tokenInterceptor.js +60 -0
- package/src/utils/apiUrl.js +26 -0
- package/src/utils/approvalReviewerOptions.js +27 -0
- package/src/utils/askFallback.js +21 -0
- package/src/utils/askOptionDesc.js +55 -0
- package/src/utils/askPortalMatcher.js +54 -0
- package/src/utils/autoApproveOptions.js +23 -0
- package/src/utils/avatarAnimationPostPass.js +46 -0
- package/src/utils/builtinPresets.js +18 -0
- package/src/utils/clearCheckpoint.js +154 -0
- package/src/utils/commandValidator.js +45 -0
- package/src/utils/contentFilter.js +675 -0
- package/src/utils/contextRaw.js +17 -0
- package/src/utils/contextSidebarNavigation.js +16 -0
- package/src/utils/conversationEntryNormalize.js +497 -0
- package/src/utils/displayScaleHelper.js +47 -0
- package/src/utils/entry-slim.js +594 -0
- package/src/utils/entryCache.js +179 -0
- package/src/utils/errorReport.js +40 -0
- package/src/utils/fileExpandedPathsStorage.js +70 -0
- package/src/utils/fileIcons.jsx +36 -0
- package/src/utils/fileOpen.js +37 -0
- package/src/utils/formatters.js +48 -0
- package/src/utils/gitApi.js +50 -0
- package/src/utils/gitTreeBuilder.js +19 -0
- package/src/utils/helpers.js +462 -0
- package/src/utils/identityHeal.js +83 -0
- package/src/utils/imOrigin.js +24 -0
- package/src/utils/imTr.js +7 -0
- package/src/utils/imageCompress.js +83 -0
- package/src/utils/imageDownscale.js +28 -0
- package/src/utils/imageResize.js +112 -0
- package/src/utils/ingestPipeline.js +47 -0
- package/src/utils/lazyWithReload.js +53 -0
- package/src/utils/markdown.js +30 -0
- package/src/utils/markdownIncremental.js +39 -0
- package/src/utils/markdownProfiler.js +113 -0
- package/src/utils/mdExtensionDetect.js +64 -0
- package/src/utils/memoryLinkParser.js +44 -0
- package/src/utils/modalMask.js +15 -0
- package/src/utils/monotime.js +6 -0
- package/src/utils/pinnedMenu.js +55 -0
- package/src/utils/presetShortcuts.js +14 -0
- package/src/utils/projectAlias.js +135 -0
- package/src/utils/promptClassifier.js +111 -0
- package/src/utils/promptDetect.js +196 -0
- package/src/utils/promptNav.js +60 -0
- package/src/utils/ptyChunkBuilder.js +251 -0
- package/src/utils/quickMenuHoverIntent.js +35 -0
- package/src/utils/rateLimitParser.js +249 -0
- package/src/utils/readResultPool.js +106 -0
- package/src/utils/refreshCachedItemProp.js +32 -0
- package/src/utils/requestTools.js +19 -0
- package/src/utils/requestType.js +284 -0
- package/src/utils/resizeCalc.js +21 -0
- package/src/utils/resolveLocalized.js +17 -0
- package/src/utils/seqResourceLoaders.js +79 -0
- package/src/utils/sessionManager.js +694 -0
- package/src/utils/sessionMerge.js +290 -0
- package/src/utils/skillModalController.js +111 -0
- package/src/utils/skillsParser.js +116 -0
- package/src/utils/slashCommandLabels.js +80 -0
- package/src/utils/splitDragCalc.js +73 -0
- package/src/utils/stickyBottomController.js +643 -0
- package/src/utils/svgSanitize.js +48 -0
- package/src/utils/systemTags.js +47 -0
- package/src/utils/tCodex.js +20 -0
- package/src/utils/teamModalBuilder.js +347 -0
- package/src/utils/teamSessionParser.js +186 -0
- package/src/utils/teammateAvatars.js +194 -0
- package/src/utils/teammateDetector.js +106 -0
- package/src/utils/termDiag.js +114 -0
- package/src/utils/terminalClipboard.js +117 -0
- package/src/utils/terminalWriteQueue.js +398 -0
- package/src/utils/thinkingMerge.js +49 -0
- package/src/utils/tokenUsage.js +1 -0
- package/src/utils/toolCatalog.js +31 -0
- package/src/utils/toolNameAliases.js +13 -0
- package/src/utils/toolResultBuilder.js +312 -0
- package/src/utils/toolResultClassifier.js +16 -0
- package/src/utils/toolResultCore.js +161 -0
- package/src/utils/toolsDiff.js +44 -0
- package/src/utils/toolsXmlFormatter.js +3 -0
- package/src/utils/ultraplanController.js +109 -0
- package/src/utils/ultraplanExperts.js +86 -0
- package/src/utils/ultraplanTemplates.js +152 -0
- package/src/utils/userImageRefs.js +49 -0
- package/src/utils/voicePackPlayer.js +233 -0
- package/src/utils/webResultGrouping.js +111 -0
- package/src/utils/workflowFormat.js +52 -0
- package/src/utils/workflowRuns.js +118 -0
- package/src/utils/workflowStore.js +94 -0
- package/vite.config.js +106 -0
- package/concepts/ar/CacheRebuild.md +0 -36
- package/concepts/ar/KVCacheContent.md +0 -49
- package/concepts/ar/Tool-Agent.md +0 -125
- package/concepts/ar/Tool-AskUserQuestion.md +0 -75
- package/concepts/ar/Tool-Bash.md +0 -167
- package/concepts/ar/Tool-Edit.md +0 -46
- package/concepts/ar/Tool-EnterPlanMode.md +0 -128
- package/concepts/ar/Tool-EnterWorktree.md +0 -56
- package/concepts/ar/Tool-ExitPlanMode.md +0 -62
- package/concepts/ar/Tool-Glob.md +0 -39
- package/concepts/ar/Tool-Grep.md +0 -57
- package/concepts/ar/Tool-NotebookEdit.md +0 -33
- package/concepts/ar/Tool-Read.md +0 -56
- package/concepts/ar/Tool-SendMessage.md +0 -41
- package/concepts/ar/Tool-Skill.md +0 -56
- package/concepts/ar/Tool-Task.md +0 -51
- package/concepts/ar/Tool-TaskCreate.md +0 -78
- package/concepts/ar/Tool-TaskGet.md +0 -56
- package/concepts/ar/Tool-TaskList.md +0 -56
- package/concepts/ar/Tool-TaskOutput.md +0 -40
- package/concepts/ar/Tool-TaskStop.md +0 -32
- package/concepts/ar/Tool-TaskUpdate.md +0 -123
- package/concepts/ar/Tool-TeamCreate.md +0 -38
- package/concepts/ar/Tool-TeamDelete.md +0 -30
- package/concepts/ar/Tool-WebFetch.md +0 -55
- package/concepts/ar/Tool-WebSearch.md +0 -58
- package/concepts/ar/Tool-Write.md +0 -39
- package/concepts/ar/Tool-executeCode.md +0 -41
- package/concepts/ar/Tool-getDiagnostics.md +0 -32
- package/concepts/ar/Tools.md +0 -67
- package/concepts/da/CacheRebuild.md +0 -36
- package/concepts/da/KVCacheContent.md +0 -49
- package/concepts/da/Tool-Agent.md +0 -125
- package/concepts/da/Tool-AskUserQuestion.md +0 -75
- package/concepts/da/Tool-Bash.md +0 -167
- package/concepts/da/Tool-Edit.md +0 -46
- package/concepts/da/Tool-EnterPlanMode.md +0 -128
- package/concepts/da/Tool-EnterWorktree.md +0 -56
- package/concepts/da/Tool-ExitPlanMode.md +0 -62
- package/concepts/da/Tool-Glob.md +0 -39
- package/concepts/da/Tool-Grep.md +0 -57
- package/concepts/da/Tool-NotebookEdit.md +0 -33
- package/concepts/da/Tool-Read.md +0 -56
- package/concepts/da/Tool-SendMessage.md +0 -41
- package/concepts/da/Tool-Skill.md +0 -56
- package/concepts/da/Tool-Task.md +0 -51
- package/concepts/da/Tool-TaskCreate.md +0 -78
- package/concepts/da/Tool-TaskGet.md +0 -56
- package/concepts/da/Tool-TaskList.md +0 -56
- package/concepts/da/Tool-TaskOutput.md +0 -40
- package/concepts/da/Tool-TaskStop.md +0 -32
- package/concepts/da/Tool-TaskUpdate.md +0 -123
- package/concepts/da/Tool-TeamCreate.md +0 -38
- package/concepts/da/Tool-TeamDelete.md +0 -30
- package/concepts/da/Tool-WebFetch.md +0 -55
- package/concepts/da/Tool-WebSearch.md +0 -58
- package/concepts/da/Tool-Write.md +0 -39
- package/concepts/da/Tool-executeCode.md +0 -41
- package/concepts/da/Tool-getDiagnostics.md +0 -32
- package/concepts/da/Tools.md +0 -67
- package/concepts/de/CacheRebuild.md +0 -36
- package/concepts/de/KVCacheContent.md +0 -49
- package/concepts/de/Tool-Agent.md +0 -125
- package/concepts/de/Tool-AskUserQuestion.md +0 -75
- package/concepts/de/Tool-Bash.md +0 -167
- package/concepts/de/Tool-Edit.md +0 -46
- package/concepts/de/Tool-EnterPlanMode.md +0 -128
- package/concepts/de/Tool-EnterWorktree.md +0 -56
- package/concepts/de/Tool-ExitPlanMode.md +0 -62
- package/concepts/de/Tool-Glob.md +0 -39
- package/concepts/de/Tool-Grep.md +0 -57
- package/concepts/de/Tool-NotebookEdit.md +0 -33
- package/concepts/de/Tool-Read.md +0 -56
- package/concepts/de/Tool-SendMessage.md +0 -41
- package/concepts/de/Tool-Skill.md +0 -56
- package/concepts/de/Tool-Task.md +0 -51
- package/concepts/de/Tool-TaskCreate.md +0 -78
- package/concepts/de/Tool-TaskGet.md +0 -56
- package/concepts/de/Tool-TaskList.md +0 -56
- package/concepts/de/Tool-TaskOutput.md +0 -40
- package/concepts/de/Tool-TaskStop.md +0 -32
- package/concepts/de/Tool-TaskUpdate.md +0 -123
- package/concepts/de/Tool-TeamCreate.md +0 -38
- package/concepts/de/Tool-TeamDelete.md +0 -30
- package/concepts/de/Tool-WebFetch.md +0 -55
- package/concepts/de/Tool-WebSearch.md +0 -58
- package/concepts/de/Tool-Write.md +0 -39
- package/concepts/de/Tool-executeCode.md +0 -41
- package/concepts/de/Tool-getDiagnostics.md +0 -32
- package/concepts/de/Tools.md +0 -67
- package/concepts/en/CacheRebuild.md +0 -36
- package/concepts/en/KVCacheContent.md +0 -49
- package/concepts/en/Tool-Agent.md +0 -125
- package/concepts/en/Tool-AskUserQuestion.md +0 -75
- package/concepts/en/Tool-Bash.md +0 -167
- package/concepts/en/Tool-Edit.md +0 -46
- package/concepts/en/Tool-EnterPlanMode.md +0 -128
- package/concepts/en/Tool-EnterWorktree.md +0 -56
- package/concepts/en/Tool-ExitPlanMode.md +0 -62
- package/concepts/en/Tool-Glob.md +0 -39
- package/concepts/en/Tool-Grep.md +0 -57
- package/concepts/en/Tool-NotebookEdit.md +0 -33
- package/concepts/en/Tool-Read.md +0 -56
- package/concepts/en/Tool-SendMessage.md +0 -41
- package/concepts/en/Tool-Skill.md +0 -56
- package/concepts/en/Tool-Task.md +0 -51
- package/concepts/en/Tool-TaskCreate.md +0 -78
- package/concepts/en/Tool-TaskGet.md +0 -56
- package/concepts/en/Tool-TaskList.md +0 -56
- package/concepts/en/Tool-TaskOutput.md +0 -40
- package/concepts/en/Tool-TaskStop.md +0 -32
- package/concepts/en/Tool-TaskUpdate.md +0 -123
- package/concepts/en/Tool-TeamCreate.md +0 -38
- package/concepts/en/Tool-TeamDelete.md +0 -30
- package/concepts/en/Tool-WebFetch.md +0 -55
- package/concepts/en/Tool-WebSearch.md +0 -58
- package/concepts/en/Tool-Write.md +0 -39
- package/concepts/en/Tool-executeCode.md +0 -41
- package/concepts/en/Tool-getDiagnostics.md +0 -32
- package/concepts/es/CacheRebuild.md +0 -36
- package/concepts/es/KVCacheContent.md +0 -49
- package/concepts/es/Tool-Agent.md +0 -125
- package/concepts/es/Tool-AskUserQuestion.md +0 -75
- package/concepts/es/Tool-Bash.md +0 -167
- package/concepts/es/Tool-Edit.md +0 -46
- package/concepts/es/Tool-EnterPlanMode.md +0 -128
- package/concepts/es/Tool-EnterWorktree.md +0 -56
- package/concepts/es/Tool-ExitPlanMode.md +0 -62
- package/concepts/es/Tool-Glob.md +0 -39
- package/concepts/es/Tool-Grep.md +0 -57
- package/concepts/es/Tool-NotebookEdit.md +0 -33
- package/concepts/es/Tool-Read.md +0 -56
- package/concepts/es/Tool-SendMessage.md +0 -41
- package/concepts/es/Tool-Skill.md +0 -56
- package/concepts/es/Tool-Task.md +0 -51
- package/concepts/es/Tool-TaskCreate.md +0 -78
- package/concepts/es/Tool-TaskGet.md +0 -56
- package/concepts/es/Tool-TaskList.md +0 -56
- package/concepts/es/Tool-TaskOutput.md +0 -40
- package/concepts/es/Tool-TaskStop.md +0 -32
- package/concepts/es/Tool-TaskUpdate.md +0 -123
- package/concepts/es/Tool-TeamCreate.md +0 -38
- package/concepts/es/Tool-TeamDelete.md +0 -30
- package/concepts/es/Tool-WebFetch.md +0 -55
- package/concepts/es/Tool-WebSearch.md +0 -58
- package/concepts/es/Tool-Write.md +0 -39
- package/concepts/es/Tool-executeCode.md +0 -41
- package/concepts/es/Tool-getDiagnostics.md +0 -32
- package/concepts/es/Tools.md +0 -67
- package/concepts/fr/CacheRebuild.md +0 -36
- package/concepts/fr/KVCacheContent.md +0 -49
- package/concepts/fr/Tool-Agent.md +0 -125
- package/concepts/fr/Tool-AskUserQuestion.md +0 -75
- package/concepts/fr/Tool-Bash.md +0 -167
- package/concepts/fr/Tool-Edit.md +0 -46
- package/concepts/fr/Tool-EnterPlanMode.md +0 -128
- package/concepts/fr/Tool-EnterWorktree.md +0 -56
- package/concepts/fr/Tool-ExitPlanMode.md +0 -62
- package/concepts/fr/Tool-Glob.md +0 -39
- package/concepts/fr/Tool-Grep.md +0 -57
- package/concepts/fr/Tool-NotebookEdit.md +0 -33
- package/concepts/fr/Tool-Read.md +0 -56
- package/concepts/fr/Tool-SendMessage.md +0 -41
- package/concepts/fr/Tool-Skill.md +0 -56
- package/concepts/fr/Tool-Task.md +0 -51
- package/concepts/fr/Tool-TaskCreate.md +0 -78
- package/concepts/fr/Tool-TaskGet.md +0 -56
- package/concepts/fr/Tool-TaskList.md +0 -56
- package/concepts/fr/Tool-TaskOutput.md +0 -40
- package/concepts/fr/Tool-TaskStop.md +0 -32
- package/concepts/fr/Tool-TaskUpdate.md +0 -123
- package/concepts/fr/Tool-TeamCreate.md +0 -38
- package/concepts/fr/Tool-TeamDelete.md +0 -30
- package/concepts/fr/Tool-WebFetch.md +0 -55
- package/concepts/fr/Tool-WebSearch.md +0 -58
- package/concepts/fr/Tool-Write.md +0 -39
- package/concepts/fr/Tool-executeCode.md +0 -41
- package/concepts/fr/Tool-getDiagnostics.md +0 -32
- package/concepts/fr/Tools.md +0 -67
- package/concepts/it/CacheRebuild.md +0 -36
- package/concepts/it/KVCacheContent.md +0 -49
- package/concepts/it/Tool-Agent.md +0 -125
- package/concepts/it/Tool-AskUserQuestion.md +0 -75
- package/concepts/it/Tool-Bash.md +0 -167
- package/concepts/it/Tool-Edit.md +0 -46
- package/concepts/it/Tool-EnterPlanMode.md +0 -128
- package/concepts/it/Tool-EnterWorktree.md +0 -56
- package/concepts/it/Tool-ExitPlanMode.md +0 -62
- package/concepts/it/Tool-Glob.md +0 -39
- package/concepts/it/Tool-Grep.md +0 -57
- package/concepts/it/Tool-NotebookEdit.md +0 -33
- package/concepts/it/Tool-Read.md +0 -56
- package/concepts/it/Tool-SendMessage.md +0 -41
- package/concepts/it/Tool-Skill.md +0 -56
- package/concepts/it/Tool-Task.md +0 -51
- package/concepts/it/Tool-TaskCreate.md +0 -78
- package/concepts/it/Tool-TaskGet.md +0 -56
- package/concepts/it/Tool-TaskList.md +0 -56
- package/concepts/it/Tool-TaskOutput.md +0 -40
- package/concepts/it/Tool-TaskStop.md +0 -32
- package/concepts/it/Tool-TaskUpdate.md +0 -123
- package/concepts/it/Tool-TeamCreate.md +0 -38
- package/concepts/it/Tool-TeamDelete.md +0 -30
- package/concepts/it/Tool-WebFetch.md +0 -55
- package/concepts/it/Tool-WebSearch.md +0 -58
- package/concepts/it/Tool-Write.md +0 -39
- package/concepts/it/Tool-executeCode.md +0 -41
- package/concepts/it/Tool-getDiagnostics.md +0 -32
- package/concepts/it/Tools.md +0 -67
- package/concepts/ja/CacheRebuild.md +0 -36
- package/concepts/ja/KVCacheContent.md +0 -49
- package/concepts/ja/Tool-Agent.md +0 -125
- package/concepts/ja/Tool-AskUserQuestion.md +0 -75
- package/concepts/ja/Tool-Bash.md +0 -167
- package/concepts/ja/Tool-Edit.md +0 -46
- package/concepts/ja/Tool-EnterPlanMode.md +0 -128
- package/concepts/ja/Tool-EnterWorktree.md +0 -56
- package/concepts/ja/Tool-ExitPlanMode.md +0 -62
- package/concepts/ja/Tool-Glob.md +0 -39
- package/concepts/ja/Tool-Grep.md +0 -57
- package/concepts/ja/Tool-NotebookEdit.md +0 -33
- package/concepts/ja/Tool-Read.md +0 -56
- package/concepts/ja/Tool-SendMessage.md +0 -41
- package/concepts/ja/Tool-Skill.md +0 -56
- package/concepts/ja/Tool-Task.md +0 -51
- package/concepts/ja/Tool-TaskCreate.md +0 -78
- package/concepts/ja/Tool-TaskGet.md +0 -56
- package/concepts/ja/Tool-TaskList.md +0 -56
- package/concepts/ja/Tool-TaskOutput.md +0 -40
- package/concepts/ja/Tool-TaskStop.md +0 -32
- package/concepts/ja/Tool-TaskUpdate.md +0 -123
- package/concepts/ja/Tool-TeamCreate.md +0 -38
- package/concepts/ja/Tool-TeamDelete.md +0 -30
- package/concepts/ja/Tool-WebFetch.md +0 -55
- package/concepts/ja/Tool-WebSearch.md +0 -58
- package/concepts/ja/Tool-Write.md +0 -39
- package/concepts/ja/Tool-executeCode.md +0 -41
- package/concepts/ja/Tool-getDiagnostics.md +0 -32
- package/concepts/ja/Tools.md +0 -67
- package/concepts/ko/CacheRebuild.md +0 -36
- package/concepts/ko/KVCacheContent.md +0 -49
- package/concepts/ko/Tool-Agent.md +0 -125
- package/concepts/ko/Tool-AskUserQuestion.md +0 -75
- package/concepts/ko/Tool-Bash.md +0 -167
- package/concepts/ko/Tool-Edit.md +0 -46
- package/concepts/ko/Tool-EnterPlanMode.md +0 -128
- package/concepts/ko/Tool-EnterWorktree.md +0 -56
- package/concepts/ko/Tool-ExitPlanMode.md +0 -62
- package/concepts/ko/Tool-Glob.md +0 -39
- package/concepts/ko/Tool-Grep.md +0 -57
- package/concepts/ko/Tool-NotebookEdit.md +0 -33
- package/concepts/ko/Tool-Read.md +0 -56
- package/concepts/ko/Tool-SendMessage.md +0 -41
- package/concepts/ko/Tool-Skill.md +0 -56
- package/concepts/ko/Tool-Task.md +0 -51
- package/concepts/ko/Tool-TaskCreate.md +0 -78
- package/concepts/ko/Tool-TaskGet.md +0 -56
- package/concepts/ko/Tool-TaskList.md +0 -56
- package/concepts/ko/Tool-TaskOutput.md +0 -40
- package/concepts/ko/Tool-TaskStop.md +0 -32
- package/concepts/ko/Tool-TaskUpdate.md +0 -123
- package/concepts/ko/Tool-TeamCreate.md +0 -38
- package/concepts/ko/Tool-TeamDelete.md +0 -30
- package/concepts/ko/Tool-WebFetch.md +0 -55
- package/concepts/ko/Tool-WebSearch.md +0 -58
- package/concepts/ko/Tool-Write.md +0 -39
- package/concepts/ko/Tool-executeCode.md +0 -41
- package/concepts/ko/Tool-getDiagnostics.md +0 -32
- package/concepts/ko/Tools.md +0 -67
- package/concepts/no/CacheRebuild.md +0 -36
- package/concepts/no/KVCacheContent.md +0 -49
- package/concepts/no/Tool-Agent.md +0 -125
- package/concepts/no/Tool-AskUserQuestion.md +0 -75
- package/concepts/no/Tool-Bash.md +0 -167
- package/concepts/no/Tool-Edit.md +0 -46
- package/concepts/no/Tool-EnterPlanMode.md +0 -128
- package/concepts/no/Tool-EnterWorktree.md +0 -56
- package/concepts/no/Tool-ExitPlanMode.md +0 -62
- package/concepts/no/Tool-Glob.md +0 -39
- package/concepts/no/Tool-Grep.md +0 -57
- package/concepts/no/Tool-NotebookEdit.md +0 -33
- package/concepts/no/Tool-Read.md +0 -56
- package/concepts/no/Tool-SendMessage.md +0 -41
- package/concepts/no/Tool-Skill.md +0 -56
- package/concepts/no/Tool-Task.md +0 -51
- package/concepts/no/Tool-TaskCreate.md +0 -78
- package/concepts/no/Tool-TaskGet.md +0 -56
- package/concepts/no/Tool-TaskList.md +0 -56
- package/concepts/no/Tool-TaskOutput.md +0 -40
- package/concepts/no/Tool-TaskStop.md +0 -32
- package/concepts/no/Tool-TaskUpdate.md +0 -123
- package/concepts/no/Tool-TeamCreate.md +0 -38
- package/concepts/no/Tool-TeamDelete.md +0 -30
- package/concepts/no/Tool-WebFetch.md +0 -55
- package/concepts/no/Tool-WebSearch.md +0 -58
- package/concepts/no/Tool-Write.md +0 -39
- package/concepts/no/Tool-executeCode.md +0 -41
- package/concepts/no/Tool-getDiagnostics.md +0 -32
- package/concepts/no/Tools.md +0 -67
- package/concepts/pl/CacheRebuild.md +0 -36
- package/concepts/pl/KVCacheContent.md +0 -49
- package/concepts/pl/Tool-Agent.md +0 -125
- package/concepts/pl/Tool-AskUserQuestion.md +0 -75
- package/concepts/pl/Tool-Bash.md +0 -167
- package/concepts/pl/Tool-Edit.md +0 -46
- package/concepts/pl/Tool-EnterPlanMode.md +0 -128
- package/concepts/pl/Tool-EnterWorktree.md +0 -56
- package/concepts/pl/Tool-ExitPlanMode.md +0 -62
- package/concepts/pl/Tool-Glob.md +0 -39
- package/concepts/pl/Tool-Grep.md +0 -57
- package/concepts/pl/Tool-NotebookEdit.md +0 -33
- package/concepts/pl/Tool-Read.md +0 -56
- package/concepts/pl/Tool-SendMessage.md +0 -41
- package/concepts/pl/Tool-Skill.md +0 -56
- package/concepts/pl/Tool-Task.md +0 -51
- package/concepts/pl/Tool-TaskCreate.md +0 -78
- package/concepts/pl/Tool-TaskGet.md +0 -56
- package/concepts/pl/Tool-TaskList.md +0 -56
- package/concepts/pl/Tool-TaskOutput.md +0 -40
- package/concepts/pl/Tool-TaskStop.md +0 -32
- package/concepts/pl/Tool-TaskUpdate.md +0 -123
- package/concepts/pl/Tool-TeamCreate.md +0 -38
- package/concepts/pl/Tool-TeamDelete.md +0 -30
- package/concepts/pl/Tool-WebFetch.md +0 -55
- package/concepts/pl/Tool-WebSearch.md +0 -58
- package/concepts/pl/Tool-Write.md +0 -39
- package/concepts/pl/Tool-executeCode.md +0 -41
- package/concepts/pl/Tool-getDiagnostics.md +0 -32
- package/concepts/pl/Tools.md +0 -67
- package/concepts/pt-BR/CacheRebuild.md +0 -36
- package/concepts/pt-BR/KVCacheContent.md +0 -49
- package/concepts/pt-BR/Tool-Agent.md +0 -125
- package/concepts/pt-BR/Tool-AskUserQuestion.md +0 -75
- package/concepts/pt-BR/Tool-Bash.md +0 -167
- package/concepts/pt-BR/Tool-Edit.md +0 -46
- package/concepts/pt-BR/Tool-EnterPlanMode.md +0 -128
- package/concepts/pt-BR/Tool-EnterWorktree.md +0 -56
- package/concepts/pt-BR/Tool-ExitPlanMode.md +0 -62
- package/concepts/pt-BR/Tool-Glob.md +0 -39
- package/concepts/pt-BR/Tool-Grep.md +0 -57
- package/concepts/pt-BR/Tool-NotebookEdit.md +0 -33
- package/concepts/pt-BR/Tool-Read.md +0 -56
- package/concepts/pt-BR/Tool-SendMessage.md +0 -41
- package/concepts/pt-BR/Tool-Skill.md +0 -56
- package/concepts/pt-BR/Tool-Task.md +0 -51
- package/concepts/pt-BR/Tool-TaskCreate.md +0 -78
- package/concepts/pt-BR/Tool-TaskGet.md +0 -56
- package/concepts/pt-BR/Tool-TaskList.md +0 -56
- package/concepts/pt-BR/Tool-TaskOutput.md +0 -40
- package/concepts/pt-BR/Tool-TaskStop.md +0 -32
- package/concepts/pt-BR/Tool-TaskUpdate.md +0 -123
- package/concepts/pt-BR/Tool-TeamCreate.md +0 -38
- package/concepts/pt-BR/Tool-TeamDelete.md +0 -30
- package/concepts/pt-BR/Tool-WebFetch.md +0 -55
- package/concepts/pt-BR/Tool-WebSearch.md +0 -58
- package/concepts/pt-BR/Tool-Write.md +0 -39
- package/concepts/pt-BR/Tool-executeCode.md +0 -41
- package/concepts/pt-BR/Tool-getDiagnostics.md +0 -32
- package/concepts/pt-BR/Tools.md +0 -67
- package/concepts/ru/CacheRebuild.md +0 -36
- package/concepts/ru/KVCacheContent.md +0 -49
- package/concepts/ru/Tool-Agent.md +0 -125
- package/concepts/ru/Tool-AskUserQuestion.md +0 -75
- package/concepts/ru/Tool-Bash.md +0 -167
- package/concepts/ru/Tool-Edit.md +0 -46
- package/concepts/ru/Tool-EnterPlanMode.md +0 -128
- package/concepts/ru/Tool-EnterWorktree.md +0 -56
- package/concepts/ru/Tool-ExitPlanMode.md +0 -62
- package/concepts/ru/Tool-Glob.md +0 -39
- package/concepts/ru/Tool-Grep.md +0 -57
- package/concepts/ru/Tool-NotebookEdit.md +0 -33
- package/concepts/ru/Tool-Read.md +0 -56
- package/concepts/ru/Tool-SendMessage.md +0 -41
- package/concepts/ru/Tool-Skill.md +0 -56
- package/concepts/ru/Tool-Task.md +0 -51
- package/concepts/ru/Tool-TaskCreate.md +0 -78
- package/concepts/ru/Tool-TaskGet.md +0 -56
- package/concepts/ru/Tool-TaskList.md +0 -56
- package/concepts/ru/Tool-TaskOutput.md +0 -40
- package/concepts/ru/Tool-TaskStop.md +0 -32
- package/concepts/ru/Tool-TaskUpdate.md +0 -123
- package/concepts/ru/Tool-TeamCreate.md +0 -38
- package/concepts/ru/Tool-TeamDelete.md +0 -30
- package/concepts/ru/Tool-WebFetch.md +0 -55
- package/concepts/ru/Tool-WebSearch.md +0 -58
- package/concepts/ru/Tool-Write.md +0 -39
- package/concepts/ru/Tool-executeCode.md +0 -41
- package/concepts/ru/Tool-getDiagnostics.md +0 -32
- package/concepts/ru/Tools.md +0 -67
- package/concepts/th/CacheRebuild.md +0 -36
- package/concepts/th/KVCacheContent.md +0 -49
- package/concepts/th/Tool-Agent.md +0 -125
- package/concepts/th/Tool-AskUserQuestion.md +0 -75
- package/concepts/th/Tool-Bash.md +0 -167
- package/concepts/th/Tool-Edit.md +0 -46
- package/concepts/th/Tool-EnterPlanMode.md +0 -128
- package/concepts/th/Tool-EnterWorktree.md +0 -56
- package/concepts/th/Tool-ExitPlanMode.md +0 -62
- package/concepts/th/Tool-Glob.md +0 -39
- package/concepts/th/Tool-Grep.md +0 -57
- package/concepts/th/Tool-NotebookEdit.md +0 -33
- package/concepts/th/Tool-Read.md +0 -56
- package/concepts/th/Tool-SendMessage.md +0 -41
- package/concepts/th/Tool-Skill.md +0 -56
- package/concepts/th/Tool-Task.md +0 -51
- package/concepts/th/Tool-TaskCreate.md +0 -78
- package/concepts/th/Tool-TaskGet.md +0 -56
- package/concepts/th/Tool-TaskList.md +0 -56
- package/concepts/th/Tool-TaskOutput.md +0 -40
- package/concepts/th/Tool-TaskStop.md +0 -32
- package/concepts/th/Tool-TaskUpdate.md +0 -123
- package/concepts/th/Tool-TeamCreate.md +0 -38
- package/concepts/th/Tool-TeamDelete.md +0 -30
- package/concepts/th/Tool-WebFetch.md +0 -55
- package/concepts/th/Tool-WebSearch.md +0 -58
- package/concepts/th/Tool-Write.md +0 -39
- package/concepts/th/Tool-executeCode.md +0 -41
- package/concepts/th/Tool-getDiagnostics.md +0 -32
- package/concepts/th/Tools.md +0 -67
- package/concepts/tr/CacheRebuild.md +0 -36
- package/concepts/tr/KVCacheContent.md +0 -49
- package/concepts/tr/Tool-Agent.md +0 -125
- package/concepts/tr/Tool-AskUserQuestion.md +0 -75
- package/concepts/tr/Tool-Bash.md +0 -167
- package/concepts/tr/Tool-Edit.md +0 -46
- package/concepts/tr/Tool-EnterPlanMode.md +0 -128
- package/concepts/tr/Tool-EnterWorktree.md +0 -56
- package/concepts/tr/Tool-ExitPlanMode.md +0 -62
- package/concepts/tr/Tool-Glob.md +0 -39
- package/concepts/tr/Tool-Grep.md +0 -57
- package/concepts/tr/Tool-NotebookEdit.md +0 -33
- package/concepts/tr/Tool-Read.md +0 -56
- package/concepts/tr/Tool-SendMessage.md +0 -41
- package/concepts/tr/Tool-Skill.md +0 -56
- package/concepts/tr/Tool-Task.md +0 -51
- package/concepts/tr/Tool-TaskCreate.md +0 -78
- package/concepts/tr/Tool-TaskGet.md +0 -56
- package/concepts/tr/Tool-TaskList.md +0 -56
- package/concepts/tr/Tool-TaskOutput.md +0 -40
- package/concepts/tr/Tool-TaskStop.md +0 -32
- package/concepts/tr/Tool-TaskUpdate.md +0 -123
- package/concepts/tr/Tool-TeamCreate.md +0 -38
- package/concepts/tr/Tool-TeamDelete.md +0 -30
- package/concepts/tr/Tool-WebFetch.md +0 -55
- package/concepts/tr/Tool-WebSearch.md +0 -58
- package/concepts/tr/Tool-Write.md +0 -39
- package/concepts/tr/Tool-executeCode.md +0 -41
- package/concepts/tr/Tool-getDiagnostics.md +0 -32
- package/concepts/tr/Tools.md +0 -67
- package/concepts/uk/CacheRebuild.md +0 -36
- package/concepts/uk/KVCacheContent.md +0 -49
- package/concepts/uk/Tool-Agent.md +0 -125
- package/concepts/uk/Tool-AskUserQuestion.md +0 -75
- package/concepts/uk/Tool-Bash.md +0 -167
- package/concepts/uk/Tool-Edit.md +0 -46
- package/concepts/uk/Tool-EnterPlanMode.md +0 -128
- package/concepts/uk/Tool-EnterWorktree.md +0 -56
- package/concepts/uk/Tool-ExitPlanMode.md +0 -62
- package/concepts/uk/Tool-Glob.md +0 -39
- package/concepts/uk/Tool-Grep.md +0 -57
- package/concepts/uk/Tool-NotebookEdit.md +0 -33
- package/concepts/uk/Tool-Read.md +0 -56
- package/concepts/uk/Tool-SendMessage.md +0 -41
- package/concepts/uk/Tool-Skill.md +0 -56
- package/concepts/uk/Tool-Task.md +0 -51
- package/concepts/uk/Tool-TaskCreate.md +0 -78
- package/concepts/uk/Tool-TaskGet.md +0 -56
- package/concepts/uk/Tool-TaskList.md +0 -56
- package/concepts/uk/Tool-TaskOutput.md +0 -40
- package/concepts/uk/Tool-TaskStop.md +0 -32
- package/concepts/uk/Tool-TaskUpdate.md +0 -123
- package/concepts/uk/Tool-TeamCreate.md +0 -38
- package/concepts/uk/Tool-TeamDelete.md +0 -30
- package/concepts/uk/Tool-WebFetch.md +0 -55
- package/concepts/uk/Tool-WebSearch.md +0 -58
- package/concepts/uk/Tool-Write.md +0 -39
- package/concepts/uk/Tool-executeCode.md +0 -41
- package/concepts/uk/Tool-getDiagnostics.md +0 -32
- package/concepts/uk/Tools.md +0 -67
- package/concepts/zh/CacheRebuild.md +0 -36
- package/concepts/zh/KVCacheContent.md +0 -49
- package/concepts/zh/Tool-Agent.md +0 -125
- package/concepts/zh/Tool-AskUserQuestion.md +0 -75
- package/concepts/zh/Tool-Bash.md +0 -167
- package/concepts/zh/Tool-Edit.md +0 -46
- package/concepts/zh/Tool-EnterPlanMode.md +0 -128
- package/concepts/zh/Tool-EnterWorktree.md +0 -56
- package/concepts/zh/Tool-ExitPlanMode.md +0 -62
- package/concepts/zh/Tool-Glob.md +0 -39
- package/concepts/zh/Tool-Grep.md +0 -57
- package/concepts/zh/Tool-NotebookEdit.md +0 -33
- package/concepts/zh/Tool-Read.md +0 -56
- package/concepts/zh/Tool-SendMessage.md +0 -41
- package/concepts/zh/Tool-Skill.md +0 -56
- package/concepts/zh/Tool-Task.md +0 -51
- package/concepts/zh/Tool-TaskCreate.md +0 -78
- package/concepts/zh/Tool-TaskGet.md +0 -56
- package/concepts/zh/Tool-TaskList.md +0 -56
- package/concepts/zh/Tool-TaskOutput.md +0 -40
- package/concepts/zh/Tool-TaskStop.md +0 -32
- package/concepts/zh/Tool-TaskUpdate.md +0 -123
- package/concepts/zh/Tool-TeamCreate.md +0 -38
- package/concepts/zh/Tool-TeamDelete.md +0 -30
- package/concepts/zh/Tool-WebFetch.md +0 -55
- package/concepts/zh/Tool-WebSearch.md +0 -58
- package/concepts/zh/Tool-Write.md +0 -39
- package/concepts/zh/Tool-executeCode.md +0 -41
- package/concepts/zh/Tool-getDiagnostics.md +0 -32
- package/concepts/zh-TW/CacheRebuild.md +0 -36
- package/concepts/zh-TW/KVCacheContent.md +0 -49
- package/concepts/zh-TW/Tool-Agent.md +0 -125
- package/concepts/zh-TW/Tool-AskUserQuestion.md +0 -75
- package/concepts/zh-TW/Tool-Bash.md +0 -167
- package/concepts/zh-TW/Tool-Edit.md +0 -46
- package/concepts/zh-TW/Tool-EnterPlanMode.md +0 -128
- package/concepts/zh-TW/Tool-EnterWorktree.md +0 -56
- package/concepts/zh-TW/Tool-ExitPlanMode.md +0 -62
- package/concepts/zh-TW/Tool-Glob.md +0 -39
- package/concepts/zh-TW/Tool-Grep.md +0 -57
- package/concepts/zh-TW/Tool-NotebookEdit.md +0 -33
- package/concepts/zh-TW/Tool-Read.md +0 -56
- package/concepts/zh-TW/Tool-SendMessage.md +0 -41
- package/concepts/zh-TW/Tool-Skill.md +0 -56
- package/concepts/zh-TW/Tool-Task.md +0 -51
- package/concepts/zh-TW/Tool-TaskCreate.md +0 -78
- package/concepts/zh-TW/Tool-TaskGet.md +0 -56
- package/concepts/zh-TW/Tool-TaskList.md +0 -56
- package/concepts/zh-TW/Tool-TaskOutput.md +0 -40
- package/concepts/zh-TW/Tool-TaskStop.md +0 -32
- package/concepts/zh-TW/Tool-TaskUpdate.md +0 -123
- package/concepts/zh-TW/Tool-TeamCreate.md +0 -38
- package/concepts/zh-TW/Tool-TeamDelete.md +0 -30
- package/concepts/zh-TW/Tool-WebFetch.md +0 -55
- package/concepts/zh-TW/Tool-WebSearch.md +0 -58
- package/concepts/zh-TW/Tool-Write.md +0 -39
- package/concepts/zh-TW/Tool-executeCode.md +0 -41
- package/concepts/zh-TW/Tool-getDiagnostics.md +0 -32
- package/concepts/zh-TW/Tools.md +0 -67
- package/dist/assets/App-BN2YmKSu.js +0 -41
- package/dist/assets/App-fG2r3jFq.css +0 -1
- package/dist/assets/AppHeader-BqUGBbBx.css +0 -41
- package/dist/assets/AppHeader.module-CvH9GQQ2.js +0 -1250
- package/dist/assets/Mobile-BnDkLcBv.css +0 -1
- package/dist/assets/Mobile-CbC8YD3O.js +0 -10
- package/dist/assets/_baseUniq-B2ddYY2A.js +0 -1
- package/dist/assets/arc-DFPOHgcd.js +0 -1
- package/dist/assets/architectureDiagram-Q4EWVU46-1tuXixQv.js +0 -36
- package/dist/assets/blockDiagram-DXYQGD6D-BfVKQPAV.js +0 -132
- package/dist/assets/c4Diagram-AHTNJAMY-Bua8O4-1.js +0 -10
- package/dist/assets/channel-Cf9uPxYW.js +0 -1
- package/dist/assets/chunk-4BX2VUAB-YOIkSNn_.js +0 -1
- package/dist/assets/chunk-4TB4RGXK-CjZt-To5.js +0 -206
- package/dist/assets/chunk-55IACEB6-BAEfMF5S.js +0 -1
- package/dist/assets/chunk-EDXVE4YY-BUYDmLXU.js +0 -1
- package/dist/assets/chunk-FMBD7UC4-Cw_LDap-.js +0 -15
- package/dist/assets/chunk-OYMX7WX6-PlfZFFxd.js +0 -231
- package/dist/assets/chunk-QZHKN3VN-C2ReFZl_.js +0 -1
- package/dist/assets/chunk-YZCP3GAM-B7IVGkPB.js +0 -1
- package/dist/assets/classDiagram-6PBFFD2Q-DdwVeNLZ.js +0 -1
- package/dist/assets/classDiagram-v2-HSJHXN6E-DdwVeNLZ.js +0 -1
- package/dist/assets/clone-C8Lz0121.js +0 -1
- package/dist/assets/cose-bilkent-S5V4N54A-M6rBKf0y.js +0 -1
- package/dist/assets/cytoscape.esm-DxGcaOPV.js +0 -331
- package/dist/assets/dagre-KV5264BT-UPacTWnL.js +0 -4
- package/dist/assets/defaultLocale-DX6XiGOO.js +0 -1
- package/dist/assets/diagram-5BDNPKRD-Cjjtnh0e.js +0 -10
- package/dist/assets/diagram-G4DWMVQ6-CjXILMP0.js +0 -24
- package/dist/assets/diagram-MMDJMWI5-C_-XZ9gc.js +0 -43
- package/dist/assets/diagram-TYMM5635-Dxe2GxUR.js +0 -24
- package/dist/assets/erDiagram-SMLLAGMA-1w-wtgMd.js +0 -85
- package/dist/assets/flowDiagram-DWJPFMVM-B9naMGCj.js +0 -162
- package/dist/assets/ganttDiagram-T4ZO3ILL-BPZBdhPv.js +0 -292
- package/dist/assets/gitGraphDiagram-UUTBAWPF-_P9PdiGG.js +0 -106
- package/dist/assets/graph-CjOY8lRz.js +0 -1
- package/dist/assets/html2canvas.esm-QH1iLAAe.js +0 -22
- package/dist/assets/index-BcCW9op4.js +0 -41
- package/dist/assets/index-DCtZ2KSX.css +0 -1
- package/dist/assets/infoDiagram-42DDH7IO-Ch8SOTtq.js +0 -2
- package/dist/assets/init-Gi6I4Gst.js +0 -1
- package/dist/assets/ishikawaDiagram-UXIWVN3A-XLscQrJT.js +0 -70
- package/dist/assets/journeyDiagram-VCZTEJTY-C3FQ_QPk.js +0 -139
- package/dist/assets/kanban-definition-6JOO6SKY-DIQDTOi3.js +0 -89
- package/dist/assets/katex-DkKDou_j.js +0 -257
- package/dist/assets/layout-DO9W0X_b.js +0 -1
- package/dist/assets/linear-ClCJqwn1.js +0 -1
- package/dist/assets/mermaid.core-BW02B1TS.js +0 -308
- package/dist/assets/min-BuzClhio.js +0 -1
- package/dist/assets/mindmap-definition-QFDTVHPH-DuCaTeZu.js +0 -96
- package/dist/assets/ordinal-Cboi1Yqb.js +0 -1
- package/dist/assets/pieDiagram-DEJITSTG-BZoZ6CI1.js +0 -30
- package/dist/assets/quadrantDiagram-34T5L4WZ-DFNwvtmc.js +0 -7
- package/dist/assets/requirementDiagram-MS252O5E-DPG-7raV.js +0 -84
- package/dist/assets/sankeyDiagram-XADWPNL6-Bp92e1ie.js +0 -10
- package/dist/assets/sequenceDiagram-FGHM5R23-C6ADwqJY.js +0 -157
- package/dist/assets/stateDiagram-FHFEXIEX-BfrwZGmF.js +0 -1
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-4gBW7EPI.js +0 -1
- package/dist/assets/timeline-definition-GMOUNBTQ-Bb-TxYx2.js +0 -120
- package/dist/assets/vennDiagram-DHZGUBPP-DTRiNXJu.js +0 -34
- package/dist/assets/wardley-RL74JXVD-C8j_kjXS.js +0 -162
- package/dist/assets/wardleyDiagram-NUSXRM2D-CvICMc3N.js +0 -20
- package/dist/assets/xychartDiagram-5P7HB3ND-DI0bBGwq.js +0 -7
- package/lib/kv-cache-analyzer.js +0 -164
|
@@ -0,0 +1,937 @@
|
|
|
1
|
+
import React, { useState, useCallback, useRef, useEffect, useMemo } from 'react';
|
|
2
|
+
import { Dropdown, Modal, Input, message } from 'antd';
|
|
3
|
+
import { t } from '../../i18n';
|
|
4
|
+
import { apiUrl } from '../../utils/apiUrl';
|
|
5
|
+
import { getFileIcon } from '../../utils/fileIcons';
|
|
6
|
+
import OpenFolderIcon from '../common/OpenFolderIcon';
|
|
7
|
+
import RefreshIcon from '../common/RefreshIcon';
|
|
8
|
+
import styles from './FileExplorer.module.css';
|
|
9
|
+
|
|
10
|
+
function isExternalFileDrag(e) {
|
|
11
|
+
return e.dataTransfer.types.includes('Files') && !e.dataTransfer.types.includes('text/x-internal-move');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Drop 同步阶段抽取顶层 FileSystemEntry;必须在 drop handler 同步周期内调用,否则 items 失效
|
|
15
|
+
function getTopLevelEntries(items) {
|
|
16
|
+
if (!items || !items.length) return null;
|
|
17
|
+
const first = items[0];
|
|
18
|
+
if (typeof first.webkitGetAsEntry !== 'function') return null;
|
|
19
|
+
const entries = [];
|
|
20
|
+
for (let i = 0; i < items.length; i++) {
|
|
21
|
+
if (items[i].kind !== 'file') continue;
|
|
22
|
+
const entry = items[i].webkitGetAsEntry();
|
|
23
|
+
if (entry) entries.push(entry);
|
|
24
|
+
}
|
|
25
|
+
return entries.length ? entries : null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// 批量读 DirectoryReader 直到返回空数组(Chrome 每次最多 100 项,必须循环)
|
|
29
|
+
function readAllEntries(reader) {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
const acc = [];
|
|
32
|
+
const readBatch = () => {
|
|
33
|
+
reader.readEntries(
|
|
34
|
+
(batch) => {
|
|
35
|
+
if (batch.length === 0) resolve(acc);
|
|
36
|
+
else { acc.push(...batch); readBatch(); }
|
|
37
|
+
},
|
|
38
|
+
reject
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
readBatch();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const SKIP_ENTRY_NAMES = new Set(['.DS_Store', 'Thumbs.db', '.localized']);
|
|
46
|
+
|
|
47
|
+
// 递归展开 entry 树为 {file, relPath} 列表;depth cap 32 防 symlink 循环
|
|
48
|
+
async function expandEntries(entries, depth) {
|
|
49
|
+
if (depth > 32) return [];
|
|
50
|
+
const results = [];
|
|
51
|
+
for (const entry of entries) {
|
|
52
|
+
if (!entry || SKIP_ENTRY_NAMES.has(entry.name)) continue;
|
|
53
|
+
if (entry.isFile) {
|
|
54
|
+
try {
|
|
55
|
+
const file = await new Promise((resolve, reject) => entry.file(resolve, reject));
|
|
56
|
+
const rel = entry.fullPath ? (entry.fullPath.startsWith('/') ? entry.fullPath.slice(1) : entry.fullPath) : file.name;
|
|
57
|
+
results.push({ file, relPath: rel });
|
|
58
|
+
} catch (e) {
|
|
59
|
+
console.warn('[FileExplorer] skip unreadable file', entry.name, e && e.message);
|
|
60
|
+
}
|
|
61
|
+
} else if (entry.isDirectory) {
|
|
62
|
+
try {
|
|
63
|
+
const reader = entry.createReader();
|
|
64
|
+
const children = await readAllEntries(reader);
|
|
65
|
+
const sub = await expandEntries(children, depth + 1);
|
|
66
|
+
results.push(...sub);
|
|
67
|
+
} catch (e) {
|
|
68
|
+
console.warn('[FileExplorer] skip unreadable dir', entry.name, e && e.message);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return results;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function TreeNode({ item, path, depth, onFileClick, expandedPaths, onToggleExpand, currentFile, onFileRenamed, refreshTrigger, onHtmlPreview, onAttachToChat, onInsertPathToChat, onImportFiles }) {
|
|
76
|
+
const [children, setChildren] = useState(null);
|
|
77
|
+
const [loading, setLoading] = useState(false);
|
|
78
|
+
const [error, setError] = useState(null);
|
|
79
|
+
const [editing, setEditing] = useState(false);
|
|
80
|
+
const [editName, setEditName] = useState('');
|
|
81
|
+
const [dragging, setDragging] = useState(false);
|
|
82
|
+
const [dragOver, setDragOver] = useState(false);
|
|
83
|
+
const inputRef = useRef(null);
|
|
84
|
+
const submittingRef = useRef(false);
|
|
85
|
+
const itemRef = useRef(null);
|
|
86
|
+
|
|
87
|
+
const childPath = path ? `${path}/${item.name}` : item.name;
|
|
88
|
+
const expanded = expandedPaths.has(childPath);
|
|
89
|
+
const isGitIgnored = item.gitIgnored || false;
|
|
90
|
+
|
|
91
|
+
const fetchChildren = useCallback(async () => {
|
|
92
|
+
setLoading(true);
|
|
93
|
+
setError(null);
|
|
94
|
+
try {
|
|
95
|
+
const res = await fetch(apiUrl(`/api/files?path=${encodeURIComponent(childPath)}`));
|
|
96
|
+
if (!res.ok) throw new Error('Failed');
|
|
97
|
+
const data = await res.json();
|
|
98
|
+
setChildren(data);
|
|
99
|
+
} catch {
|
|
100
|
+
setError('Error');
|
|
101
|
+
} finally {
|
|
102
|
+
setLoading(false);
|
|
103
|
+
}
|
|
104
|
+
}, [childPath]);
|
|
105
|
+
|
|
106
|
+
// expanded 变为 true 时自动加载子节点(恢复展开状态 & 从对话点击路径时级联展开)
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (item.type === 'directory' && expanded && children === null && !loading) {
|
|
109
|
+
fetchChildren();
|
|
110
|
+
}
|
|
111
|
+
}, [expanded]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
112
|
+
|
|
113
|
+
// refreshTrigger 变化时,已展开的目录重新加载子节点
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (refreshTrigger > 0 && item.type === 'directory' && expanded && children !== null) {
|
|
116
|
+
fetchChildren();
|
|
117
|
+
}
|
|
118
|
+
}, [refreshTrigger]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
119
|
+
|
|
120
|
+
const toggle = useCallback(async () => {
|
|
121
|
+
if (item.type !== 'directory') {
|
|
122
|
+
const ext = (childPath || '').split('.').pop().toLowerCase();
|
|
123
|
+
// .html/.htm 文件在弹窗 iframe 中预览
|
|
124
|
+
if (ext === 'html' || ext === 'htm') {
|
|
125
|
+
if (onHtmlPreview) onHtmlPreview(childPath);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
// 点击文件,触发回调(Office 文件由上层 onFileClick 回调统一拦截)
|
|
129
|
+
if (onFileClick) onFileClick(childPath);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (expanded) {
|
|
133
|
+
onToggleExpand(childPath);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (children === null) {
|
|
137
|
+
await fetchChildren();
|
|
138
|
+
}
|
|
139
|
+
onToggleExpand(childPath);
|
|
140
|
+
}, [expanded, children, childPath, item, onFileClick, onToggleExpand, fetchChildren, onHtmlPreview]);
|
|
141
|
+
|
|
142
|
+
const isDir = item.type === 'directory';
|
|
143
|
+
const isSelected = currentFile && currentFile === childPath;
|
|
144
|
+
|
|
145
|
+
// 选中文件时自动滚动到可见区域
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (isSelected && itemRef.current) {
|
|
148
|
+
requestAnimationFrame(() => {
|
|
149
|
+
itemRef.current?.scrollIntoView({ block: 'nearest', behavior: 'instant' });
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}, [isSelected]);
|
|
153
|
+
|
|
154
|
+
// 进入编辑模式
|
|
155
|
+
const startEditing = useCallback(() => {
|
|
156
|
+
setEditName(item.name);
|
|
157
|
+
setEditing(true);
|
|
158
|
+
submittingRef.current = false;
|
|
159
|
+
}, [item.name]);
|
|
160
|
+
|
|
161
|
+
// 编辑模式下自动 focus 并选中文件名(不含扩展名)
|
|
162
|
+
useEffect(() => {
|
|
163
|
+
if (editing && inputRef.current) {
|
|
164
|
+
inputRef.current.focus();
|
|
165
|
+
const dotIdx = item.name.lastIndexOf('.');
|
|
166
|
+
if (dotIdx > 0 && item.type !== 'directory') {
|
|
167
|
+
inputRef.current.setSelectionRange(0, dotIdx);
|
|
168
|
+
} else {
|
|
169
|
+
inputRef.current.select();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}, [editing, item.name, item.type]);
|
|
173
|
+
|
|
174
|
+
// 提交重命名
|
|
175
|
+
const submitRename = useCallback(async () => {
|
|
176
|
+
if (submittingRef.current) return;
|
|
177
|
+
const trimmed = editName.trim();
|
|
178
|
+
if (!trimmed || trimmed === item.name) {
|
|
179
|
+
setEditing(false);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
submittingRef.current = true;
|
|
183
|
+
try {
|
|
184
|
+
const res = await fetch(apiUrl('/api/rename-file'), {
|
|
185
|
+
method: 'POST',
|
|
186
|
+
headers: { 'Content-Type': 'application/json' },
|
|
187
|
+
body: JSON.stringify({ oldPath: childPath, newName: trimmed }),
|
|
188
|
+
});
|
|
189
|
+
const data = await res.json();
|
|
190
|
+
if (!res.ok) {
|
|
191
|
+
alert(t('ui.renameFailed', { error: data.error || res.statusText }));
|
|
192
|
+
setEditing(false);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
setEditing(false);
|
|
196
|
+
if (onFileRenamed) onFileRenamed(childPath, data.newPath);
|
|
197
|
+
} catch (err) {
|
|
198
|
+
alert(t('ui.renameFailed', { error: err.message }));
|
|
199
|
+
setEditing(false);
|
|
200
|
+
}
|
|
201
|
+
}, [editName, item.name, childPath, onFileRenamed]);
|
|
202
|
+
|
|
203
|
+
// 取消编辑
|
|
204
|
+
const cancelEditing = useCallback(() => {
|
|
205
|
+
setEditing(false);
|
|
206
|
+
}, []);
|
|
207
|
+
|
|
208
|
+
// 双击进入编辑模式
|
|
209
|
+
const handleDoubleClick = useCallback((e) => {
|
|
210
|
+
e.stopPropagation();
|
|
211
|
+
if (isSelected) {
|
|
212
|
+
startEditing();
|
|
213
|
+
}
|
|
214
|
+
}, [isSelected, startEditing]);
|
|
215
|
+
|
|
216
|
+
// 键盘事件:Enter 进入编辑模式 / F2 进入编辑模式
|
|
217
|
+
const handleKeyDown = useCallback((e) => {
|
|
218
|
+
if (editing) return;
|
|
219
|
+
if ((e.key === 'Enter' || e.key === 'F2') && isSelected) {
|
|
220
|
+
e.preventDefault();
|
|
221
|
+
e.stopPropagation();
|
|
222
|
+
startEditing();
|
|
223
|
+
}
|
|
224
|
+
}, [editing, isSelected, startEditing]);
|
|
225
|
+
|
|
226
|
+
// 输入框键盘事件
|
|
227
|
+
const handleInputKeyDown = useCallback((e) => {
|
|
228
|
+
if (e.key === 'Enter') {
|
|
229
|
+
e.preventDefault();
|
|
230
|
+
submitRename();
|
|
231
|
+
} else if (e.key === 'Escape') {
|
|
232
|
+
e.preventDefault();
|
|
233
|
+
cancelEditing();
|
|
234
|
+
}
|
|
235
|
+
e.stopPropagation();
|
|
236
|
+
}, [submitRename, cancelEditing]);
|
|
237
|
+
|
|
238
|
+
const handleClick = useCallback((e) => {
|
|
239
|
+
if (editing) {
|
|
240
|
+
e.stopPropagation();
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
toggle();
|
|
244
|
+
}, [editing, toggle]);
|
|
245
|
+
|
|
246
|
+
// 拖拽事件处理
|
|
247
|
+
const handleDragStart = useCallback((e) => {
|
|
248
|
+
if (editing) { e.preventDefault(); return; }
|
|
249
|
+
e.dataTransfer.setData('text/plain', childPath);
|
|
250
|
+
e.dataTransfer.setData('text/x-internal-move', '1');
|
|
251
|
+
e.dataTransfer.effectAllowed = 'move';
|
|
252
|
+
setDragging(true);
|
|
253
|
+
}, [childPath, editing]);
|
|
254
|
+
|
|
255
|
+
const handleDragEnd = useCallback(() => {
|
|
256
|
+
setDragging(false);
|
|
257
|
+
}, []);
|
|
258
|
+
|
|
259
|
+
const autoExpandTimer = useRef(null);
|
|
260
|
+
const handleDragOver = useCallback((e) => {
|
|
261
|
+
const isExternal = isExternalFileDrag(e);
|
|
262
|
+
const isInternal = e.dataTransfer.types.includes('text/x-internal-move');
|
|
263
|
+
// 内部移动只接受目录;外部导入接受任意节点(文件节点→导入到父目录)
|
|
264
|
+
if (isInternal && !isDir) return;
|
|
265
|
+
if (!isExternal && !isInternal) return;
|
|
266
|
+
e.preventDefault();
|
|
267
|
+
// 节点接受 drop 后阻止冒泡:否则容器级 onDragOver 会同帧 setExternalDragOver(true)
|
|
268
|
+
// / 覆写 dropEffect,导致视觉闪烁与"拖到空白处=移到根"的语义被错误触发。
|
|
269
|
+
e.stopPropagation();
|
|
270
|
+
e.dataTransfer.dropEffect = isExternal ? 'copy' : 'move';
|
|
271
|
+
setDragOver(true);
|
|
272
|
+
// hover 在折叠目录上 500ms → 自动展开(外部导入和内部移动都支持)
|
|
273
|
+
if (isDir && !expanded && !autoExpandTimer.current) {
|
|
274
|
+
autoExpandTimer.current = setTimeout(() => {
|
|
275
|
+
onToggleExpand(childPath);
|
|
276
|
+
autoExpandTimer.current = null;
|
|
277
|
+
}, 500);
|
|
278
|
+
}
|
|
279
|
+
}, [isDir, expanded, childPath, onToggleExpand]);
|
|
280
|
+
|
|
281
|
+
const handleDragLeave = useCallback((e) => {
|
|
282
|
+
// 只在真正离开此节点时才移除高亮(忽略子元素事件冒泡)
|
|
283
|
+
if (itemRef.current && !itemRef.current.contains(e.relatedTarget)) {
|
|
284
|
+
setDragOver(false);
|
|
285
|
+
if (autoExpandTimer.current) { clearTimeout(autoExpandTimer.current); autoExpandTimer.current = null; }
|
|
286
|
+
}
|
|
287
|
+
}, []);
|
|
288
|
+
|
|
289
|
+
const handleDrop = useCallback(async (e) => {
|
|
290
|
+
e.preventDefault();
|
|
291
|
+
// 任何已 preventDefault 的 drop 都视为"被节点消费"——同时 stopPropagation 防止冒泡
|
|
292
|
+
// 到容器级 handleContainerDrop 再次触发"移到根"。包含所有 internal early-return 路径。
|
|
293
|
+
e.stopPropagation();
|
|
294
|
+
setDragOver(false);
|
|
295
|
+
// External file drop — 目录节点导入到该目录,文件节点导入到其父目录
|
|
296
|
+
if (isExternalFileDrag(e) && (e.dataTransfer.files.length > 0 || (e.dataTransfer.items && e.dataTransfer.items.length > 0))) {
|
|
297
|
+
// 同步阶段一次性抽取 entry(异步后 items 会失效)
|
|
298
|
+
const topEntries = getTopLevelEntries(e.dataTransfer.items);
|
|
299
|
+
const flatFiles = Array.from(e.dataTransfer.files);
|
|
300
|
+
const targetDir = isDir ? childPath : (childPath.includes('/') ? childPath.substring(0, childPath.lastIndexOf('/')) : '');
|
|
301
|
+
if (onImportFiles) onImportFiles({ topEntries, flatFiles }, targetDir);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
// Internal move
|
|
305
|
+
const fromPath = e.dataTransfer.getData('text/plain');
|
|
306
|
+
if (!fromPath || !isDir) return;
|
|
307
|
+
// 不能拖到自身
|
|
308
|
+
if (fromPath === childPath) return;
|
|
309
|
+
// 不能拖到自身子目录
|
|
310
|
+
if (childPath.startsWith(fromPath + '/')) return;
|
|
311
|
+
// 不能拖到当前所在的同目录(无意义移动)
|
|
312
|
+
const fromDir = fromPath.includes('/') ? fromPath.substring(0, fromPath.lastIndexOf('/')) : '';
|
|
313
|
+
if (fromDir === childPath) return;
|
|
314
|
+
try {
|
|
315
|
+
const res = await fetch(apiUrl('/api/move-file'), {
|
|
316
|
+
method: 'POST',
|
|
317
|
+
headers: { 'Content-Type': 'application/json' },
|
|
318
|
+
body: JSON.stringify({ fromPath, toDir: childPath }),
|
|
319
|
+
});
|
|
320
|
+
const data = await res.json();
|
|
321
|
+
if (!res.ok) {
|
|
322
|
+
message.error(data.error || 'Move failed');
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
if (onFileRenamed) onFileRenamed(fromPath, data.newPath);
|
|
326
|
+
} catch (err) {
|
|
327
|
+
message.error(err.message || 'Move failed');
|
|
328
|
+
}
|
|
329
|
+
}, [childPath, isDir, onFileRenamed, onImportFiles]);
|
|
330
|
+
|
|
331
|
+
// 右键菜单项
|
|
332
|
+
const contextMenuItems = useMemo(() => {
|
|
333
|
+
if (isDir) return [
|
|
334
|
+
{ key: 'reveal', label: t('ui.contextMenu.revealInExplorer') },
|
|
335
|
+
{ key: 'openTerminal', label: t('ui.contextMenu.openTerminal') },
|
|
336
|
+
{ key: 'newFile', label: t('ui.contextMenu.newFile') },
|
|
337
|
+
{ key: 'newDir', label: t('ui.contextMenu.newDir') },
|
|
338
|
+
{ type: 'divider' },
|
|
339
|
+
{ key: 'copyPath', label: t('ui.contextMenu.copyPath') },
|
|
340
|
+
{ key: 'copyRelPath', label: t('ui.contextMenu.copyRelativePath') },
|
|
341
|
+
{ type: 'divider' },
|
|
342
|
+
{ key: 'rename', label: t('ui.contextMenu.rename') },
|
|
343
|
+
{ key: 'delete', label: t('ui.contextMenu.delete'), danger: true },
|
|
344
|
+
];
|
|
345
|
+
return [
|
|
346
|
+
{ key: 'reveal', label: t('ui.contextMenu.revealInExplorer') },
|
|
347
|
+
{ key: 'copyPath', label: t('ui.contextMenu.copyPath') },
|
|
348
|
+
{ key: 'copyRelPath', label: t('ui.contextMenu.copyRelativePath') },
|
|
349
|
+
{ key: 'attachToChat', label: t('ui.contextMenu.attachToChat') },
|
|
350
|
+
{ key: 'insertPathToChat', label: t('ui.contextMenu.insertPathToChat') },
|
|
351
|
+
{ type: 'divider' },
|
|
352
|
+
{ key: 'rename', label: t('ui.contextMenu.rename') },
|
|
353
|
+
{ key: 'delete', label: t('ui.contextMenu.delete'), danger: true },
|
|
354
|
+
];
|
|
355
|
+
}, [isDir]);
|
|
356
|
+
|
|
357
|
+
const handleMenuClick = useCallback(({ key }) => {
|
|
358
|
+
switch (key) {
|
|
359
|
+
case 'reveal':
|
|
360
|
+
fetch(apiUrl('/api/reveal-file'), {
|
|
361
|
+
method: 'POST',
|
|
362
|
+
headers: { 'Content-Type': 'application/json' },
|
|
363
|
+
body: JSON.stringify({ path: childPath }),
|
|
364
|
+
}).catch(() => {});
|
|
365
|
+
break;
|
|
366
|
+
case 'openTerminal':
|
|
367
|
+
fetch(apiUrl('/api/open-terminal'), {
|
|
368
|
+
method: 'POST',
|
|
369
|
+
headers: { 'Content-Type': 'application/json' },
|
|
370
|
+
body: JSON.stringify({ path: childPath }),
|
|
371
|
+
}).catch(() => {});
|
|
372
|
+
break;
|
|
373
|
+
case 'copyPath':
|
|
374
|
+
fetch(apiUrl('/api/resolve-path'), {
|
|
375
|
+
method: 'POST',
|
|
376
|
+
headers: { 'Content-Type': 'application/json' },
|
|
377
|
+
body: JSON.stringify({ path: childPath }),
|
|
378
|
+
})
|
|
379
|
+
.then(r => r.json())
|
|
380
|
+
.then(data => {
|
|
381
|
+
if (data.fullPath) {
|
|
382
|
+
navigator.clipboard.writeText(data.fullPath).then(() => message.success(t('ui.copied'))).catch(() => {});
|
|
383
|
+
}
|
|
384
|
+
})
|
|
385
|
+
.catch(() => {});
|
|
386
|
+
break;
|
|
387
|
+
case 'copyRelPath':
|
|
388
|
+
navigator.clipboard.writeText(childPath).then(() => message.success(t('ui.copied'))).catch(() => {});
|
|
389
|
+
break;
|
|
390
|
+
case 'attachToChat':
|
|
391
|
+
onAttachToChat?.(childPath);
|
|
392
|
+
break;
|
|
393
|
+
case 'insertPathToChat':
|
|
394
|
+
onInsertPathToChat?.(childPath);
|
|
395
|
+
break;
|
|
396
|
+
case 'rename':
|
|
397
|
+
startEditing();
|
|
398
|
+
break;
|
|
399
|
+
case 'newFile': {
|
|
400
|
+
const inputId = `cxv-newfile-${Date.now()}`;
|
|
401
|
+
Modal.confirm({
|
|
402
|
+
title: t('ui.contextMenu.newFile'),
|
|
403
|
+
content: <Input id={inputId} autoFocus placeholder={t('ui.contextMenu.newFilePlaceholder')} style={{ background: 'var(--bg-container)', borderColor: 'var(--border-primary)', color: 'var(--text-secondary)', caretColor: 'var(--text-secondary)' }} onPressEnter={() => { document.querySelector('.ant-modal-confirm-btns .ant-btn-primary')?.click(); }} />,
|
|
404
|
+
okText: t('ui.contextMenu.newFile'),
|
|
405
|
+
// 失败 throw → antd Modal.confirm 保住弹窗供重试;message.error 显式提示,避免静默关闭误以为成功(同 #84 模式)。
|
|
406
|
+
onOk: async () => {
|
|
407
|
+
const input = document.getElementById(inputId);
|
|
408
|
+
const name = (input?.value || '').trim();
|
|
409
|
+
if (!name) throw new Error('Empty filename');
|
|
410
|
+
let errMsg;
|
|
411
|
+
try {
|
|
412
|
+
const r = await fetch(apiUrl('/api/create-file'), {
|
|
413
|
+
method: 'POST',
|
|
414
|
+
headers: { 'Content-Type': 'application/json' },
|
|
415
|
+
body: JSON.stringify({ dirPath: childPath, name }),
|
|
416
|
+
});
|
|
417
|
+
if (r.ok) { if (onFileRenamed) onFileRenamed(null, `${childPath}/${name}`); return; }
|
|
418
|
+
errMsg = `HTTP ${r.status}`;
|
|
419
|
+
try { const d = await r.json(); if (d?.error) errMsg = d.error; } catch {}
|
|
420
|
+
} catch (err) {
|
|
421
|
+
errMsg = err?.message || 'network error';
|
|
422
|
+
}
|
|
423
|
+
message.error(t('ui.contextMenu.createFileFailed', { error: errMsg }));
|
|
424
|
+
throw new Error(errMsg);
|
|
425
|
+
},
|
|
426
|
+
});
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
case 'newDir': {
|
|
430
|
+
const inputId = `cxv-newdir-${Date.now()}`;
|
|
431
|
+
Modal.confirm({
|
|
432
|
+
title: t('ui.contextMenu.newDir'),
|
|
433
|
+
content: <Input id={inputId} autoFocus placeholder={t('ui.contextMenu.newDirPlaceholder')} style={{ background: 'var(--bg-container)', borderColor: 'var(--border-primary)', color: 'var(--text-secondary)', caretColor: 'var(--text-secondary)' }} onPressEnter={() => { document.querySelector('.ant-modal-confirm-btns .ant-btn-primary')?.click(); }} />,
|
|
434
|
+
okText: t('ui.contextMenu.newDir'),
|
|
435
|
+
onOk: async () => {
|
|
436
|
+
const input = document.getElementById(inputId);
|
|
437
|
+
const name = (input?.value || '').trim();
|
|
438
|
+
if (!name) throw new Error('Empty dir name');
|
|
439
|
+
let errMsg;
|
|
440
|
+
try {
|
|
441
|
+
const r = await fetch(apiUrl('/api/create-dir'), {
|
|
442
|
+
method: 'POST',
|
|
443
|
+
headers: { 'Content-Type': 'application/json' },
|
|
444
|
+
body: JSON.stringify({ dirPath: childPath, name }),
|
|
445
|
+
});
|
|
446
|
+
if (r.ok) { if (onFileRenamed) onFileRenamed(null, `${childPath}/${name}`); return; }
|
|
447
|
+
errMsg = `HTTP ${r.status}`;
|
|
448
|
+
try { const d = await r.json(); if (d?.error) errMsg = d.error; } catch {}
|
|
449
|
+
} catch (err) {
|
|
450
|
+
errMsg = err?.message || 'network error';
|
|
451
|
+
}
|
|
452
|
+
message.error(t('ui.contextMenu.createDirFailed', { error: errMsg }));
|
|
453
|
+
throw new Error(errMsg);
|
|
454
|
+
},
|
|
455
|
+
});
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
case 'delete':
|
|
459
|
+
Modal.confirm({
|
|
460
|
+
title: isDir ? t('ui.contextMenu.deleteDirConfirm', { name: item.name }) : t('ui.contextMenu.deleteConfirm', { name: item.name }),
|
|
461
|
+
okType: 'danger',
|
|
462
|
+
okText: t('ui.contextMenu.delete'),
|
|
463
|
+
onOk: async () => {
|
|
464
|
+
let errMsg;
|
|
465
|
+
try {
|
|
466
|
+
const r = await fetch(apiUrl('/api/delete-file'), {
|
|
467
|
+
method: 'POST',
|
|
468
|
+
headers: { 'Content-Type': 'application/json' },
|
|
469
|
+
body: JSON.stringify({ path: childPath }),
|
|
470
|
+
});
|
|
471
|
+
if (r.ok) { if (onFileRenamed) onFileRenamed(childPath, null); return; }
|
|
472
|
+
errMsg = `HTTP ${r.status}`;
|
|
473
|
+
try { const d = await r.json(); if (d?.error) errMsg = d.error; } catch {}
|
|
474
|
+
} catch (err) {
|
|
475
|
+
errMsg = err?.message || 'network error';
|
|
476
|
+
}
|
|
477
|
+
message.error(t('ui.contextMenu.deleteFailed', { error: errMsg }));
|
|
478
|
+
throw new Error(errMsg);
|
|
479
|
+
},
|
|
480
|
+
});
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
}, [childPath, item.name, isDir, startEditing, onFileRenamed, onAttachToChat, onInsertPathToChat]);
|
|
484
|
+
|
|
485
|
+
const treeItemDiv = (
|
|
486
|
+
<div
|
|
487
|
+
ref={itemRef}
|
|
488
|
+
className={`${styles.treeItem}${isSelected ? ' ' + styles.treeItemSelected : ''}${isGitIgnored ? ' ' + styles.treeItemGitIgnored : ''}${dragging ? ' ' + styles.treeItemDragging : ''}${dragOver ? ' ' + styles.treeItemDragOver : ''}`}
|
|
489
|
+
style={{ paddingLeft: 8 + depth * 16 }}
|
|
490
|
+
onClick={handleClick}
|
|
491
|
+
onDoubleClick={handleDoubleClick}
|
|
492
|
+
onKeyDown={handleKeyDown}
|
|
493
|
+
tabIndex={0}
|
|
494
|
+
draggable={!editing}
|
|
495
|
+
onDragStart={handleDragStart}
|
|
496
|
+
onDragEnd={handleDragEnd}
|
|
497
|
+
onDragOver={handleDragOver}
|
|
498
|
+
onDragLeave={handleDragLeave}
|
|
499
|
+
onDrop={handleDrop}
|
|
500
|
+
>
|
|
501
|
+
<span className={styles.arrow}>
|
|
502
|
+
{isDir ? (
|
|
503
|
+
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" className={styles.arrowIcon} style={{ transform: expanded ? 'rotate(90deg)' : 'none' }}>
|
|
504
|
+
<polyline points="9 6 15 12 9 18"/>
|
|
505
|
+
</svg>
|
|
506
|
+
) : ''}
|
|
507
|
+
</span>
|
|
508
|
+
<span className={styles.icon}>{getFileIcon(item.name, item.type)}</span>
|
|
509
|
+
{editing ? (
|
|
510
|
+
<input
|
|
511
|
+
ref={inputRef}
|
|
512
|
+
className={styles.fileNameInput}
|
|
513
|
+
value={editName}
|
|
514
|
+
onChange={e => setEditName(e.target.value)}
|
|
515
|
+
onKeyDown={handleInputKeyDown}
|
|
516
|
+
onBlur={submitRename}
|
|
517
|
+
onClick={e => e.stopPropagation()}
|
|
518
|
+
/>
|
|
519
|
+
) : (
|
|
520
|
+
<span className={styles.fileName}>{item.name}</span>
|
|
521
|
+
)}
|
|
522
|
+
</div>
|
|
523
|
+
);
|
|
524
|
+
|
|
525
|
+
return (
|
|
526
|
+
<>
|
|
527
|
+
<Dropdown menu={{ items: contextMenuItems, onClick: handleMenuClick }} trigger={['contextMenu']}>
|
|
528
|
+
{treeItemDiv}
|
|
529
|
+
</Dropdown>
|
|
530
|
+
{expanded && loading && (
|
|
531
|
+
<div className={styles.loading} style={{ paddingLeft: 24 + depth * 16 }}>...</div>
|
|
532
|
+
)}
|
|
533
|
+
{expanded && error && (
|
|
534
|
+
<div className={styles.error} style={{ paddingLeft: 24 + depth * 16 }}>{error}</div>
|
|
535
|
+
)}
|
|
536
|
+
{expanded && children && children.map(child => (
|
|
537
|
+
<TreeNode key={child.name} item={child} path={childPath} depth={depth + 1} onFileClick={onFileClick} expandedPaths={expandedPaths} onToggleExpand={onToggleExpand} currentFile={currentFile} onFileRenamed={onFileRenamed} refreshTrigger={refreshTrigger} onHtmlPreview={onHtmlPreview} onAttachToChat={onAttachToChat} onInsertPathToChat={onInsertPathToChat} onImportFiles={onImportFiles} />
|
|
538
|
+
))}
|
|
539
|
+
</>
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export default function FileExplorer({ style, onClose, onFileClick, expandedPaths, onToggleExpand, currentFile, refreshTrigger, onManualRefresh, onFileRenamed, onAttachToChat, onInsertPathToChat }) {
|
|
544
|
+
const [items, setItems] = useState(null);
|
|
545
|
+
const [error, setError] = useState(null);
|
|
546
|
+
const [htmlPreviewPath, setHtmlPreviewPath] = useState(null);
|
|
547
|
+
const [externalDragOver, setExternalDragOver] = useState(false);
|
|
548
|
+
// 内部拖动(树内文件拖到容器空白处 = 移到项目根目录)的容器高亮状态。
|
|
549
|
+
// 与 externalDragOver 同帧只可能有一个为 true(容器 dragOver handler 用 isInternal 二选一)。
|
|
550
|
+
const [internalContainerDragOver, setInternalContainerDragOver] = useState(false);
|
|
551
|
+
const mounted = useRef(true);
|
|
552
|
+
const containerRef = useRef(null);
|
|
553
|
+
|
|
554
|
+
// 重新加载根目录
|
|
555
|
+
const refreshRoot = useCallback(() => {
|
|
556
|
+
if (!mounted.current) return;
|
|
557
|
+
fetch(apiUrl('/api/files?path='))
|
|
558
|
+
.then(r => r.ok ? r.json() : Promise.reject())
|
|
559
|
+
.then(data => { if (mounted.current) setItems(data); })
|
|
560
|
+
.catch(() => { if (mounted.current) setError('Failed to load'); });
|
|
561
|
+
}, []);
|
|
562
|
+
|
|
563
|
+
useEffect(() => {
|
|
564
|
+
mounted.current = true;
|
|
565
|
+
|
|
566
|
+
// 加载根目录
|
|
567
|
+
fetch(apiUrl('/api/files?path='))
|
|
568
|
+
.then(r => r.ok ? r.json() : Promise.reject())
|
|
569
|
+
.then(data => { if (mounted.current) setItems(data); })
|
|
570
|
+
.catch(() => { if (mounted.current) setError('Failed to load'); });
|
|
571
|
+
|
|
572
|
+
return () => {
|
|
573
|
+
mounted.current = false;
|
|
574
|
+
};
|
|
575
|
+
}, []); // 空依赖数组,只在挂载时执行一次
|
|
576
|
+
|
|
577
|
+
// 工具触发的增量刷新
|
|
578
|
+
useEffect(() => {
|
|
579
|
+
if (refreshTrigger > 0) refreshRoot();
|
|
580
|
+
}, [refreshTrigger]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
581
|
+
|
|
582
|
+
const headerMenuItems = useMemo(() => [
|
|
583
|
+
{ key: 'reveal', label: t('ui.contextMenu.revealInExplorer') },
|
|
584
|
+
{ key: 'openTerminal', label: t('ui.contextMenu.openTerminal') },
|
|
585
|
+
{ key: 'newFile', label: t('ui.contextMenu.newFile') },
|
|
586
|
+
{ key: 'newDir', label: t('ui.contextMenu.newDir') },
|
|
587
|
+
{ type: 'divider' },
|
|
588
|
+
{ key: 'copyPath', label: t('ui.contextMenu.copyPath') },
|
|
589
|
+
{ key: 'copyRelPath', label: t('ui.contextMenu.copyRelativePath') },
|
|
590
|
+
], []);
|
|
591
|
+
|
|
592
|
+
const handleHeaderMenuClick = useCallback(({ key }) => {
|
|
593
|
+
switch (key) {
|
|
594
|
+
case 'reveal':
|
|
595
|
+
fetch(apiUrl('/api/open-project-dir'), { method: 'POST' }).catch(() => {});
|
|
596
|
+
break;
|
|
597
|
+
case 'openTerminal':
|
|
598
|
+
fetch(apiUrl('/api/open-terminal'), {
|
|
599
|
+
method: 'POST',
|
|
600
|
+
headers: { 'Content-Type': 'application/json' },
|
|
601
|
+
body: JSON.stringify({ path: '' }),
|
|
602
|
+
}).catch(() => {});
|
|
603
|
+
break;
|
|
604
|
+
case 'newFile': {
|
|
605
|
+
const inputId = `cxv-newfile-root-${Date.now()}`;
|
|
606
|
+
Modal.confirm({
|
|
607
|
+
title: t('ui.contextMenu.newFile'),
|
|
608
|
+
content: <Input id={inputId} autoFocus placeholder={t('ui.contextMenu.newFilePlaceholder')} style={{ background: 'var(--bg-container)', borderColor: 'var(--border-primary)', color: 'var(--text-secondary)', caretColor: 'var(--text-secondary)' }} onPressEnter={() => { document.querySelector('.ant-modal-confirm-btns .ant-btn-primary')?.click(); }} />,
|
|
609
|
+
okText: t('ui.contextMenu.newFile'),
|
|
610
|
+
// 失败 throw → antd Modal.confirm 保住弹窗供重试(同 #84 模式)。
|
|
611
|
+
onOk: async () => {
|
|
612
|
+
const input = document.getElementById(inputId);
|
|
613
|
+
const name = (input?.value || '').trim();
|
|
614
|
+
if (!name) throw new Error('Empty filename');
|
|
615
|
+
let errMsg;
|
|
616
|
+
try {
|
|
617
|
+
const r = await fetch(apiUrl('/api/create-file'), {
|
|
618
|
+
method: 'POST',
|
|
619
|
+
headers: { 'Content-Type': 'application/json' },
|
|
620
|
+
body: JSON.stringify({ dirPath: '', name }),
|
|
621
|
+
});
|
|
622
|
+
if (r.ok) { if (onFileRenamed) onFileRenamed(null, name); return; }
|
|
623
|
+
errMsg = `HTTP ${r.status}`;
|
|
624
|
+
try { const d = await r.json(); if (d?.error) errMsg = d.error; } catch {}
|
|
625
|
+
} catch (err) {
|
|
626
|
+
errMsg = err?.message || 'network error';
|
|
627
|
+
}
|
|
628
|
+
message.error(t('ui.contextMenu.createFileFailed', { error: errMsg }));
|
|
629
|
+
throw new Error(errMsg);
|
|
630
|
+
},
|
|
631
|
+
});
|
|
632
|
+
break;
|
|
633
|
+
}
|
|
634
|
+
case 'newDir': {
|
|
635
|
+
const inputId = `cxv-newdir-root-${Date.now()}`;
|
|
636
|
+
Modal.confirm({
|
|
637
|
+
title: t('ui.contextMenu.newDir'),
|
|
638
|
+
content: <Input id={inputId} autoFocus placeholder={t('ui.contextMenu.newDirPlaceholder')} style={{ background: 'var(--bg-container)', borderColor: 'var(--border-primary)', color: 'var(--text-secondary)', caretColor: 'var(--text-secondary)' }} onPressEnter={() => { document.querySelector('.ant-modal-confirm-btns .ant-btn-primary')?.click(); }} />,
|
|
639
|
+
okText: t('ui.contextMenu.newDir'),
|
|
640
|
+
onOk: async () => {
|
|
641
|
+
const input = document.getElementById(inputId);
|
|
642
|
+
const name = (input?.value || '').trim();
|
|
643
|
+
if (!name) throw new Error('Empty dir name');
|
|
644
|
+
let errMsg;
|
|
645
|
+
try {
|
|
646
|
+
const r = await fetch(apiUrl('/api/create-dir'), {
|
|
647
|
+
method: 'POST',
|
|
648
|
+
headers: { 'Content-Type': 'application/json' },
|
|
649
|
+
body: JSON.stringify({ dirPath: '', name }),
|
|
650
|
+
});
|
|
651
|
+
if (r.ok) { if (onFileRenamed) onFileRenamed(null, name); return; }
|
|
652
|
+
errMsg = `HTTP ${r.status}`;
|
|
653
|
+
try { const d = await r.json(); if (d?.error) errMsg = d.error; } catch {}
|
|
654
|
+
} catch (err) {
|
|
655
|
+
errMsg = err?.message || 'network error';
|
|
656
|
+
}
|
|
657
|
+
message.error(t('ui.contextMenu.createDirFailed', { error: errMsg }));
|
|
658
|
+
throw new Error(errMsg);
|
|
659
|
+
},
|
|
660
|
+
});
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
663
|
+
case 'copyPath':
|
|
664
|
+
fetch(apiUrl('/api/resolve-path'), {
|
|
665
|
+
method: 'POST',
|
|
666
|
+
headers: { 'Content-Type': 'application/json' },
|
|
667
|
+
body: JSON.stringify({ path: '' }),
|
|
668
|
+
}).then(r => r.json()).then(data => {
|
|
669
|
+
if (data.fullPath) navigator.clipboard.writeText(data.fullPath).then(() => message.success(t('ui.copied'))).catch(() => {});
|
|
670
|
+
}).catch(() => {});
|
|
671
|
+
break;
|
|
672
|
+
case 'copyRelPath':
|
|
673
|
+
navigator.clipboard.writeText('.').then(() => message.success(t('ui.copied'))).catch(() => {});
|
|
674
|
+
break;
|
|
675
|
+
}
|
|
676
|
+
}, [onFileRenamed]);
|
|
677
|
+
|
|
678
|
+
// Import external files (支持批量文件夹拖入,保留目录结构)
|
|
679
|
+
// 入参 payload:{ topEntries, flatFiles }(drop 事件同步抽取)或 File[](降级兼容)
|
|
680
|
+
const importFiles = useCallback(async (payload, targetDir) => {
|
|
681
|
+
// 1. 统一为 {file, relPath}[]
|
|
682
|
+
let entries = [];
|
|
683
|
+
const topEntries = payload && payload.topEntries;
|
|
684
|
+
const flatFiles = payload && payload.flatFiles;
|
|
685
|
+
const isEntryShape = Array.isArray(topEntries) || Array.isArray(flatFiles);
|
|
686
|
+
if (isEntryShape && topEntries && topEntries.length > 0) {
|
|
687
|
+
// 有 FileSystemEntry:扫描阶段可能耗时,给个 loading
|
|
688
|
+
const hideScan = message.loading(t('ui.importScanning'), 0);
|
|
689
|
+
let scanFailed = false;
|
|
690
|
+
try {
|
|
691
|
+
entries = await expandEntries(topEntries, 0);
|
|
692
|
+
} catch (e) {
|
|
693
|
+
console.warn('[FileExplorer] expandEntries failed, falling back to flat files', e);
|
|
694
|
+
scanFailed = true;
|
|
695
|
+
} finally {
|
|
696
|
+
hideScan();
|
|
697
|
+
}
|
|
698
|
+
// 扫描失败或扫描结果为空时,降级到浏览器展平的 flatFiles(至少顶层文件能导入)
|
|
699
|
+
if ((scanFailed || entries.length === 0) && flatFiles && flatFiles.length > 0) {
|
|
700
|
+
entries = flatFiles.map(f => ({ file: f, relPath: f.name }));
|
|
701
|
+
}
|
|
702
|
+
} else if (isEntryShape && flatFiles && flatFiles.length > 0) {
|
|
703
|
+
// 浏览器不支持 webkitGetAsEntry → 降级为平铺
|
|
704
|
+
entries = flatFiles.map(f => ({ file: f, relPath: f.name }));
|
|
705
|
+
} else if (Array.isArray(payload)) {
|
|
706
|
+
// 纯 File[] 入参(兼容保留)
|
|
707
|
+
entries = payload.map(f => ({ file: f, relPath: f.name }));
|
|
708
|
+
}
|
|
709
|
+
if (entries.length === 0) {
|
|
710
|
+
// 拖入了但没有可导入文件(空文件夹 / 全是被过滤的系统文件)
|
|
711
|
+
if ((topEntries && topEntries.length > 0) || (flatFiles && flatFiles.length > 0)) {
|
|
712
|
+
message.info(t('ui.importNoFiles'));
|
|
713
|
+
}
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// 2. 大批量预警
|
|
718
|
+
if (entries.length > 1000) {
|
|
719
|
+
const proceed = await new Promise(resolve => {
|
|
720
|
+
Modal.confirm({
|
|
721
|
+
title: t('ui.importConfirmLarge', { count: entries.length }),
|
|
722
|
+
okText: t('ui.ok'),
|
|
723
|
+
cancelText: t('ui.cancel'),
|
|
724
|
+
onOk: () => resolve(true),
|
|
725
|
+
onCancel: () => resolve(false),
|
|
726
|
+
});
|
|
727
|
+
});
|
|
728
|
+
if (!proceed) return;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// 3. 并发上传(限制 3),展示持久 loading(总量已知)
|
|
732
|
+
const total = entries.length;
|
|
733
|
+
let successCount = 0;
|
|
734
|
+
const failures = [];
|
|
735
|
+
let firstOkRelPath = null;
|
|
736
|
+
const hideLoading = message.loading(t('ui.importingProgress', { total }), 0);
|
|
737
|
+
|
|
738
|
+
let idx = 0;
|
|
739
|
+
const worker = async () => {
|
|
740
|
+
while (idx < entries.length) {
|
|
741
|
+
const myIdx = idx++;
|
|
742
|
+
const { file, relPath } = entries[myIdx];
|
|
743
|
+
const lastSlash = relPath.lastIndexOf('/');
|
|
744
|
+
const subDir = lastSlash >= 0 ? relPath.slice(0, lastSlash) : '';
|
|
745
|
+
const finalDir = [targetDir, subDir].filter(Boolean).join('/');
|
|
746
|
+
const form = new FormData();
|
|
747
|
+
form.append('file', file);
|
|
748
|
+
try {
|
|
749
|
+
const res = await fetch(apiUrl(`/api/import-file?dir=${encodeURIComponent(finalDir)}`), { method: 'POST', body: form });
|
|
750
|
+
const data = await res.json();
|
|
751
|
+
if (!res.ok) {
|
|
752
|
+
failures.push({ name: relPath, error: data.error || 'Import failed' });
|
|
753
|
+
} else {
|
|
754
|
+
successCount++;
|
|
755
|
+
if (!firstOkRelPath) firstOkRelPath = data.relPath || relPath;
|
|
756
|
+
}
|
|
757
|
+
} catch (err) {
|
|
758
|
+
failures.push({ name: relPath, error: err.message || 'Import failed' });
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
const parallel = Math.min(3, entries.length);
|
|
763
|
+
await Promise.all(Array.from({ length: parallel }, () => worker()));
|
|
764
|
+
hideLoading();
|
|
765
|
+
|
|
766
|
+
// 4. 汇总消息
|
|
767
|
+
if (failures.length === 0) {
|
|
768
|
+
if (successCount === 1) {
|
|
769
|
+
message.success(t('ui.fileImported', { name: firstOkRelPath }));
|
|
770
|
+
} else {
|
|
771
|
+
message.success(t('ui.filesImported', { count: successCount }));
|
|
772
|
+
}
|
|
773
|
+
} else {
|
|
774
|
+
const preview = failures.slice(0, 3).map(f => f.name).join(', ');
|
|
775
|
+
const more = failures.length > 3 ? ` (+${failures.length - 3})` : '';
|
|
776
|
+
if (successCount > 0) {
|
|
777
|
+
message.warning(t('ui.importPartialFailed', { ok: successCount, failed: failures.length, names: preview + more }));
|
|
778
|
+
} else {
|
|
779
|
+
message.error(t('ui.importAllFailed', { failed: failures.length, names: preview + more }));
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
if (successCount > 0 && onFileRenamed) {
|
|
784
|
+
onFileRenamed(null, firstOkRelPath);
|
|
785
|
+
}
|
|
786
|
+
}, [onFileRenamed]);
|
|
787
|
+
|
|
788
|
+
// Container-level drag events for external files
|
|
789
|
+
// dragover 定时器模式:持续收到 dragover 时保持高亮,300ms 无 dragover 则认为拖拽结束
|
|
790
|
+
const dragTimerRef = useRef(null);
|
|
791
|
+
|
|
792
|
+
const resetDragState = useCallback(() => {
|
|
793
|
+
if (dragTimerRef.current) { clearTimeout(dragTimerRef.current); dragTimerRef.current = null; }
|
|
794
|
+
setExternalDragOver(false);
|
|
795
|
+
setInternalContainerDragOver(false);
|
|
796
|
+
}, []);
|
|
797
|
+
|
|
798
|
+
// 全局 drop/dragend 兜底:确保任何情况下状态都能重置
|
|
799
|
+
useEffect(() => {
|
|
800
|
+
const handler = () => resetDragState();
|
|
801
|
+
document.addEventListener('drop', handler);
|
|
802
|
+
document.addEventListener('dragend', handler);
|
|
803
|
+
return () => {
|
|
804
|
+
document.removeEventListener('drop', handler);
|
|
805
|
+
document.removeEventListener('dragend', handler);
|
|
806
|
+
};
|
|
807
|
+
}, [resetDragState]);
|
|
808
|
+
|
|
809
|
+
const handleContainerDragOver = useCallback((e) => {
|
|
810
|
+
const isInternal = e.dataTransfer.types.includes('text/x-internal-move');
|
|
811
|
+
const isExternal = isExternalFileDrag(e);
|
|
812
|
+
if (!isInternal && !isExternal) return;
|
|
813
|
+
e.preventDefault();
|
|
814
|
+
if (isInternal) {
|
|
815
|
+
e.dataTransfer.dropEffect = 'move';
|
|
816
|
+
if (!internalContainerDragOver) setInternalContainerDragOver(true);
|
|
817
|
+
} else {
|
|
818
|
+
e.dataTransfer.dropEffect = 'copy';
|
|
819
|
+
if (!externalDragOver) setExternalDragOver(true);
|
|
820
|
+
}
|
|
821
|
+
// 每次 dragover 重置定时器,300ms 内无新 dragover 则清除状态
|
|
822
|
+
if (dragTimerRef.current) clearTimeout(dragTimerRef.current);
|
|
823
|
+
dragTimerRef.current = setTimeout(() => {
|
|
824
|
+
setExternalDragOver(false);
|
|
825
|
+
setInternalContainerDragOver(false);
|
|
826
|
+
dragTimerRef.current = null;
|
|
827
|
+
}, 300);
|
|
828
|
+
}, [externalDragOver, internalContainerDragOver]);
|
|
829
|
+
|
|
830
|
+
const handleContainerDrop = useCallback(async (e) => {
|
|
831
|
+
resetDragState();
|
|
832
|
+
// 1) External file drop:保留既有 import 行为(拖外部文件到容器空白处 = 导入到根)
|
|
833
|
+
if (isExternalFileDrag(e)) {
|
|
834
|
+
e.preventDefault();
|
|
835
|
+
e.stopPropagation();
|
|
836
|
+
// 同步阶段一次性抽取 entry(异步后 items 会失效)
|
|
837
|
+
const topEntries = getTopLevelEntries(e.dataTransfer.items);
|
|
838
|
+
const flatFiles = Array.from(e.dataTransfer.files);
|
|
839
|
+
if ((topEntries && topEntries.length > 0) || flatFiles.length > 0) {
|
|
840
|
+
importFiles({ topEntries, flatFiles }, '');
|
|
841
|
+
}
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
// 2) Internal move:拖树内文件到容器空白处 = 移到项目根目录。
|
|
845
|
+
// TreeNode 内 drop 已 stopPropagation,所以只有"目标 = 空白处"才会走到这里。
|
|
846
|
+
if (!e.dataTransfer.types.includes('text/x-internal-move')) return;
|
|
847
|
+
e.preventDefault();
|
|
848
|
+
const fromPath = e.dataTransfer.getData('text/plain');
|
|
849
|
+
if (!fromPath) {
|
|
850
|
+
// Safari / Firefox 个别版本在 drop 阶段 getData('text/plain') 偶发返空,
|
|
851
|
+
// 用户感知是"拖到空白处啥也没发生";落一条 warn 便于排查这种平台 bug。
|
|
852
|
+
console.warn('[FileExplorer] internal-move drop with empty fromPath; ignored');
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
const fromDir = fromPath.includes('/') ? fromPath.substring(0, fromPath.lastIndexOf('/')) : '';
|
|
856
|
+
if (fromDir === '') return; // 已在根,no-op(拖回原位无效果,符合直觉)
|
|
857
|
+
try {
|
|
858
|
+
const res = await fetch(apiUrl('/api/move-file'), {
|
|
859
|
+
method: 'POST',
|
|
860
|
+
headers: { 'Content-Type': 'application/json' },
|
|
861
|
+
body: JSON.stringify({ fromPath, toDir: '' }),
|
|
862
|
+
});
|
|
863
|
+
const data = await res.json();
|
|
864
|
+
if (!res.ok) {
|
|
865
|
+
message.error(data.error || 'Move failed');
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
if (onFileRenamed) onFileRenamed(fromPath, data.newPath);
|
|
869
|
+
} catch (err) {
|
|
870
|
+
message.error(err.message || 'Move failed');
|
|
871
|
+
}
|
|
872
|
+
}, [importFiles, resetDragState, onFileRenamed]);
|
|
873
|
+
|
|
874
|
+
return (
|
|
875
|
+
<div ref={containerRef} className={`${styles.fileExplorer}${internalContainerDragOver ? ' ' + styles.internalDragOverContainer : ''}`} style={style} data-file-explorer onDragOver={handleContainerDragOver} onDrop={handleContainerDrop}>
|
|
876
|
+
<div className={styles.header}>
|
|
877
|
+
<Dropdown menu={{ items: headerMenuItems, onClick: handleHeaderMenuClick }} trigger={['contextMenu']}>
|
|
878
|
+
<span className={styles.headerTitle}>
|
|
879
|
+
<OpenFolderIcon apiEndpoint={apiUrl('/api/open-project-dir')} title={t('ui.openProjectDir')} size={14} />
|
|
880
|
+
{t('ui.fileExplorer')}
|
|
881
|
+
{/* 手动刷新:外部 mv/cp/系统级文件变化等 tool_result 感知不到的场景下用户兜底;
|
|
882
|
+
复用既有 refreshTrigger++ 链路(ChatView state.fileExplorerRefresh),TreeNode
|
|
883
|
+
的 useEffect 监听到变化 → 已展开目录全部重拉一次。RefreshIcon 内部封装 300ms
|
|
884
|
+
cooldown 防狂点 + 360° 单次旋转反馈。 */}
|
|
885
|
+
{onManualRefresh && (
|
|
886
|
+
<RefreshIcon onClick={onManualRefresh} title={t('ui.fileExplorer.refresh')} />
|
|
887
|
+
)}
|
|
888
|
+
</span>
|
|
889
|
+
</Dropdown>
|
|
890
|
+
<button className={styles.headerCloseBtn} onClick={onClose} title="Close">
|
|
891
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
892
|
+
<polyline points="11 17 6 12 11 7"/>
|
|
893
|
+
<polyline points="18 17 13 12 18 7"/>
|
|
894
|
+
</svg>
|
|
895
|
+
</button>
|
|
896
|
+
</div>
|
|
897
|
+
<div className={styles.treeContainer}>
|
|
898
|
+
{error && <div className={styles.error}>{error}</div>}
|
|
899
|
+
{!items && !error && <div className={styles.loading}>{t('ui.loading')}</div>}
|
|
900
|
+
{items && items.map(item => (
|
|
901
|
+
<TreeNode key={item.name} item={item} path="" depth={0} onFileClick={onFileClick} expandedPaths={expandedPaths} onToggleExpand={onToggleExpand} currentFile={currentFile} onFileRenamed={onFileRenamed} refreshTrigger={refreshTrigger} onHtmlPreview={setHtmlPreviewPath} onAttachToChat={onAttachToChat} onInsertPathToChat={onInsertPathToChat} onImportFiles={importFiles} />
|
|
902
|
+
))}
|
|
903
|
+
</div>
|
|
904
|
+
{htmlPreviewPath && (
|
|
905
|
+
<Modal
|
|
906
|
+
open
|
|
907
|
+
onCancel={() => setHtmlPreviewPath(null)}
|
|
908
|
+
footer={null}
|
|
909
|
+
closable
|
|
910
|
+
maskClosable
|
|
911
|
+
zIndex={1100}
|
|
912
|
+
width="calc(100vw - 80px)"
|
|
913
|
+
title={<span style={{ color: 'var(--text-primary)', fontSize: 14 }}>{htmlPreviewPath.split('/').pop() || 'Preview'}</span>}
|
|
914
|
+
styles={{
|
|
915
|
+
header: { background: 'var(--bg-container)', borderBottom: '1px solid var(--border-primary)', padding: '12px 20px' },
|
|
916
|
+
body: { background: '#fff', height: 'calc(100vh - 160px)', overflow: 'hidden', padding: 0 },
|
|
917
|
+
mask: { background: 'rgba(0,0,0,0.7)' },
|
|
918
|
+
content: { background: 'var(--bg-container)', border: '1px solid var(--border-primary)', borderRadius: 8, padding: 0 },
|
|
919
|
+
}}
|
|
920
|
+
centered
|
|
921
|
+
>
|
|
922
|
+
<iframe
|
|
923
|
+
// 用 path-style URL 而非 ?path=...:HTML 里相对 `<script src="sorter.js">` 浏览器
|
|
924
|
+
// 才能按"同目录"解析到 `/api/file-raw/<dir>/sorter.js`,c8 / nyc 类报告才完整。
|
|
925
|
+
// path segment 各自 encode 保留分隔斜杠。
|
|
926
|
+
src={apiUrl('/api/file-raw/' + htmlPreviewPath.split('/').map(encodeURIComponent).join('/'))}
|
|
927
|
+
style={{ width: '100%', height: '100%', border: 'none' }}
|
|
928
|
+
title={htmlPreviewPath}
|
|
929
|
+
// 只放 allow-scripts 跟 server CSP 同步(取交集后才生效)。popup / form 都不放:
|
|
930
|
+
// c8 / nyc 报告纯静态交互(sortable / 折叠 / 行内 location.hash 跳转)不依赖这两个。
|
|
931
|
+
sandbox="allow-scripts"
|
|
932
|
+
/>
|
|
933
|
+
</Modal>
|
|
934
|
+
)}
|
|
935
|
+
</div>
|
|
936
|
+
);
|
|
937
|
+
}
|