@nextclaw/ui 0.15.24 → 0.15.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/assets/{abnfDiagram-VRR7QNED-DvTjgVMf.js → abnfDiagram-VRR7QNED-BcFJp_1X.js} +1 -1
- package/dist/assets/{aiden0z-pptx-renderer.es-C1nfBAXR.js → aiden0z-pptx-renderer.es-Dp2ezlQn.js} +1 -1
- package/dist/assets/{api-BxPNDp30.js → api-CK3Fro7z.js} +6 -6
- package/dist/assets/appearance-settings-page-zqwWO8Dy.js +1 -0
- package/dist/assets/{arc-BvhODBXv.js → arc-CkgyPMyW.js} +1 -1
- package/dist/assets/architecture-TIHT7OUA-DO2x53FK.js +1 -0
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-BKO9RgNS.js → architectureDiagram-ZJ3FMSHR-CMd4cIjI.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-DHpDXy7D.js → blockDiagram-677ZJIJ3-Bz3tbhet.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-BG_iQnDr.js → c4Diagram-LMCZKHZV-D9hFNAGv.js} +1 -1
- package/dist/assets/channel-nBvMaVyP.js +1 -0
- package/dist/assets/{channels-list-page-DRaNWAxC.js → channels-list-page-CVCZBlCL.js} +2 -2
- package/dist/assets/chat-page-D4wehRTz.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-CJgqFDS4.js +1 -0
- package/dist/assets/{chunk-32BRIVSS-DR9M0LLx.js → chunk-32BRIVSS-7NrjEITq.js} +1 -1
- package/dist/assets/{chunk-52WLFC77-698iC3BB.js → chunk-52WLFC77-viIcqj9q.js} +1 -1
- package/dist/assets/{chunk-5FCAYU7R-DikTj9Ey.js → chunk-5FCAYU7R-Vsu4J-VM.js} +1 -1
- package/dist/assets/{chunk-5HE753X5-ko0o7_q0.js → chunk-5HE753X5-C-w6CQZK.js} +1 -1
- package/dist/assets/{chunk-5JV3BV7I-CEHufhgo.js → chunk-5JV3BV7I-CuKgJQ4W.js} +1 -1
- package/dist/assets/{chunk-5TONJI2A-CGgno1cu.js → chunk-5TONJI2A-CYeiWZKb.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-DkiB4cUQ.js → chunk-5VM5RSS4-DRCbfwIn.js} +1 -1
- package/dist/assets/{chunk-7BUUIJ7U-DzptcytQ.js → chunk-7BUUIJ7U-BvydOcm3.js} +1 -1
- package/dist/assets/{chunk-BIQX33UG-DMRSQJvT.js → chunk-BIQX33UG-RlppOXKo.js} +1 -1
- package/dist/assets/{chunk-C7G6YPKG-Bw1BwwuY.js → chunk-C7G6YPKG-DAizzYwr.js} +1 -1
- package/dist/assets/{chunk-CQNSW5MT-C0z6eHBk.js → chunk-CQNSW5MT-5eChJHca.js} +1 -1
- package/dist/assets/{chunk-CYSBUYHQ-ByPyAouO.js → chunk-CYSBUYHQ-YHPr53fv.js} +1 -1
- package/dist/assets/{chunk-EMLP6XTP-CJlAXWZg.js → chunk-EMLP6XTP-CK4D7Hz5.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-Dqq4zKJu.js → chunk-EX3LRPZG-BmlDFIRW.js} +1 -1
- package/dist/assets/{chunk-FWX5IMBZ-B0SNoCmi.js → chunk-FWX5IMBZ-D0ksHZZ9.js} +2 -2
- package/dist/assets/{chunk-HOUHSVGY-DG_GJih_.js → chunk-HOUHSVGY-DPkq8FCm.js} +1 -1
- package/dist/assets/{chunk-ICXQ74PX-Drxk_6bE.js → chunk-ICXQ74PX-FAatv5fC.js} +1 -1
- package/dist/assets/{chunk-JG7HCLWE-DdLFPpnd.js → chunk-JG7HCLWE-DLkIi4F7.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-B8M4G76F.js → chunk-JWPE2WC7-DawOjNE3.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-XP6FJHY_.js → chunk-MOJQB5TN-Di52TorW.js} +1 -1
- package/dist/assets/{chunk-MOZMSUNE-C_6x18Qw.js → chunk-MOZMSUNE-PfyK9w1-.js} +1 -1
- package/dist/assets/{chunk-OGEWGWER-N25BzCmG.js → chunk-OGEWGWER-C3jdH3Ty.js} +1 -1
- package/dist/assets/{chunk-OSBZ3O6U-ASDEm7y0.js → chunk-OSBZ3O6U-CecHo-f0.js} +1 -1
- package/dist/assets/{chunk-PUDLZKDR-CTlvAcn7.js → chunk-PUDLZKDR-f3IJh3sN.js} +1 -1
- package/dist/assets/{chunk-Q4XR5HBZ-Da9BWfB6.js → chunk-Q4XR5HBZ-DQFeUPxZ.js} +1 -1
- package/dist/assets/{chunk-QBLGF6JB-Bi6RpTJO.js → chunk-QBLGF6JB-BhUeG0y2.js} +1 -1
- package/dist/assets/{chunk-R7FJI6CG-DkMsSPvK.js → chunk-R7FJI6CG-C3XpZ-2u.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-DZp0eU-j.js → chunk-RYQCIY6F-CAqa5klQ.js} +1 -1
- package/dist/assets/{chunk-U6XO7XAA-vfinDSrj.js → chunk-U6XO7XAA-D_WXezeD.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-C9Nksccs.js → chunk-V7JOEXUC-CZ70oOtp.js} +1 -1
- package/dist/assets/chunk-VAUOI2AC-BGvh3yIx.js +1 -0
- package/dist/assets/{chunk-VR4S4FIN-Xv6zfwXs.js → chunk-VR4S4FIN-B7AHEYYk.js} +1 -1
- package/dist/assets/{chunk-WYO6CB5R-mOJNzbWl.js → chunk-WYO6CB5R-Dn9To_OI.js} +2 -2
- package/dist/assets/chunk-XXDRQBXY-DaBxG5gs.js +1 -0
- package/dist/assets/{chunk-YOTPTUD7-1-aKSu4o.js → chunk-YOTPTUD7-BYEgRBk3.js} +1 -1
- package/dist/assets/{chunk-ZGVPDNZ5-OJ8veMpK.js → chunk-ZGVPDNZ5-C6YtZDU0.js} +1 -1
- package/dist/assets/{chunk-ZIRB5QZD-SR_Nq_PP.js → chunk-ZIRB5QZD-DMuYtnHF.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-P6N03G2R.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-B1_uLvMv.js +1 -0
- package/dist/assets/config-split-page-CceNFvlY.js +1 -0
- package/dist/assets/confirm-dialog-CWeNYWZY.js +5 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-NjVgz2Bw.js → cose-bilkent-JH36ORCC-Bc2Ex5Y3.js} +1 -1
- package/dist/assets/cynefin-VYW2F7L2-B-H8Qp-n.js +1 -0
- package/dist/assets/{cynefinDiagram-TSTJHNR4-B_17LDqD.js → cynefinDiagram-TSTJHNR4-DVysQoGz.js} +1 -1
- package/dist/assets/{dagre-CMe101gk.js → dagre-CMhQ1cAG.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-qo8nLb3B.js → dagre-VKFMJZFB-RYyWpPJZ.js} +1 -1
- package/dist/assets/desktop-update-config-Dirc3bpt.js +1 -0
- package/dist/assets/{diagram-FQU43EPY-Ba3XIklC.js → diagram-FQU43EPY-BD6KONdF.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-CG45TcUx.js → diagram-G47NLZAW-CGB2ptRR.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-2F2HrwV-.js → diagram-NH7WQ7WH-DnkOI6cU.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-CXfWH9NZ.js → diagram-OA4YK3LP-DF82RZ7P.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-CH_4yepc.js → diagram-WEI45ONY-Be2v7Ck9.js} +1 -1
- package/dist/assets/{dist-B4Pf5X3Q.js → dist-AYxkFx2B.js} +1 -1
- package/dist/assets/{dist-DHEWkGWX.js → dist-D9xtGgdL.js} +1 -1
- package/dist/assets/doc-browser-4Sud6dWw.js +1 -0
- package/dist/assets/doc-browser-D4x_yH5F.js +1 -0
- package/dist/assets/doc-browser-context-Cb7Z0j90.js +1 -0
- package/dist/assets/{docx-preview-CoM4JK7_.js → docx-preview-BqwAjrj3.js} +1 -1
- package/dist/assets/{ebnfDiagram-CCIWWBDH-BwiG4Ea1.js → ebnfDiagram-CCIWWBDH-CP98OYk8.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-BML3hpnQ.js → erDiagram-Q63AITRT-ZLlx8xfs.js} +1 -1
- package/dist/assets/eventmodeling-45OFAUF4-YVtShyFA.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-BeKXabVO.js +1 -0
- package/dist/assets/form-actions-B2q4jgjE.js +1 -0
- package/dist/assets/{ganttDiagram-NO4QXBWP-80enfWbD.js → ganttDiagram-NO4QXBWP-DXCDjHR2.js} +1 -1
- package/dist/assets/gitGraph-TEB2WS4Q-jTSiBj-p.js +1 -0
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-CVLqXr-b.js → gitGraphDiagram-IHSO6WYX-l2HWrTJp.js} +1 -1
- package/dist/assets/index-CdyTsSBu.css +1 -0
- package/dist/assets/index-Das_bw2h.js +107 -0
- package/dist/assets/info-DKCQHKI2-BIporNWb.js +1 -0
- package/dist/assets/{infoDiagram-FWYZ7A6U-Dyvs2t0i.js → infoDiagram-FWYZ7A6U-D-DjX-bn.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-sSnxDKfh.js → ishikawaDiagram-FXEZZL3T-y_Xy128F.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-D22V71Mf.js → journeyDiagram-5HDEW3XC-DJn5xYcQ.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-D3ds0p-g.js → kanban-definition-HUTT4EX6-DJVIOR21.js} +1 -1
- package/dist/assets/{line-CbyFs065.js → line-Cos7PIOj.js} +1 -1
- package/dist/assets/{linear-4DKtnZBS.js → linear-BtDLqtzF.js} +1 -1
- package/dist/assets/loader-circle-CpmBdaon.js +1 -0
- package/dist/assets/{map-CcZzEoz6.js → map-BKnQyvd0.js} +1 -1
- package/dist/assets/mcp-marketplace-page-CdOY3Sop.js +1 -0
- package/dist/assets/mcp-marketplace-page-DvjrfqEt.js +9 -0
- package/dist/assets/{mermaid-parser.core-DPmMOjXD.js → mermaid-parser.core-XUNZhr2W.js} +2 -2
- package/dist/assets/{mermaid.core-BSf-ddRa.js → mermaid.core-ySrvolIe.js} +3 -3
- package/dist/assets/{mindmap-definition-LN4V7U3C-BUTwWPyx.js → mindmap-definition-LN4V7U3C-BypL9tei.js} +1 -1
- package/dist/assets/model-config-page-DfOLyQqR.js +1 -0
- package/dist/assets/{navigation-link-CAFOcXNg.js → navigation-link-MiiyoIjH.js} +2 -2
- package/dist/assets/{ordinal-BgLYtOZE.js → ordinal-CxxVWxYU.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-CuFMADV0.js +1 -0
- package/dist/assets/{pegDiagram-2B236MQR-BEu_ZBjc.js → pegDiagram-2B236MQR-D-U2KBGv.js} +1 -1
- package/dist/assets/pie-RZYD4A2V-XUeIXhM9.js +1 -0
- package/dist/assets/{pieDiagram-ENE6RG2P-CAwAwuBd.js → pieDiagram-ENE6RG2P-CBi3GusJ.js} +1 -1
- package/dist/assets/plus-C8FkjpSZ.js +1 -0
- package/dist/assets/provider-scoped-model-input-DXzjr5l0.js +1 -0
- package/dist/assets/providers-config-page-CaO8WfZH.js +1 -0
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-CwE6F-_2.js → quadrantDiagram-ABIIQ3AL-H0ZuvnZL.js} +1 -1
- package/dist/assets/radar-I7S5WNFK-D-NNGh1k.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-C67_uDaM.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-BZ8Yflnd.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-B7zO7RoK.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-R63PTgLz.js +1 -0
- package/dist/assets/{railroadDiagram-RFXS5EU6-xgLekU3B.js → railroadDiagram-RFXS5EU6-D7Y2EqSd.js} +1 -1
- package/dist/assets/react-C8XFFvuz.js +8 -0
- package/dist/assets/{refresh-cw-CWDp_JnN.js → refresh-cw-a2VVeeAF.js} +1 -1
- package/dist/assets/remote-BJHXa4mB.js +1 -0
- package/dist/assets/{requirementDiagram-TGXJPOKE-CyVUzEX5.js → requirementDiagram-TGXJPOKE-BiXNX1NN.js} +1 -1
- package/dist/assets/rotate-cw-DJ7UF3F2.js +1 -0
- package/dist/assets/runtime-config-page-BuA4A02z.js +1 -0
- package/dist/assets/{sankeyDiagram-HTMAVEWB-JK6bFmYB.js → sankeyDiagram-HTMAVEWB-qzDeLztW.js} +1 -1
- package/dist/assets/{save-Cnr71JON.js → save-CGm23Yww.js} +1 -1
- package/dist/assets/{search-CCX11X2m.js → search-CH2t--sH.js} +1 -1
- package/dist/assets/search-config-page-BAmYqoAz.js +1 -0
- package/dist/assets/secrets-config-page-BlPOuql_.js +3 -0
- package/dist/assets/security-config-CbDiY2xr.js +1 -0
- package/dist/assets/{select-DvwBu99K.js → select-DnxxDpcV.js} +2 -2
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-BR5IokXV.js → sequenceDiagram-DBY2YBRQ-BtRbPQtL.js} +1 -1
- package/dist/assets/{settings-2-Dmv6zMne.js → settings-2-agnMYc8a.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-SxG_YnMA.js → sizeCapture-X5ZJPWSS-CMYvM3SL.js} +1 -1
- package/dist/assets/skeleton-XpqeWL62.js +1 -0
- package/dist/assets/{src-vgz8E_-O.js → src-Bw-mzbQb.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-DD4OoYhn.js → stateDiagram-2N3HPSRC-BJ-mFeOz.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-BE-HqxOK.js +1 -0
- package/dist/assets/{swimlanes-5IMT3BWC-BWkFeyCT.js → swimlanes-5IMT3BWC-BsucVOO2.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-Dr1H9LJH.js +8 -0
- package/dist/assets/{tag-chip-gMPvx7n_.js → tag-chip-CPOc8b2N.js} +1 -1
- package/dist/assets/{timeline-definition-FHXFAJF6-VTRPy6KA.js → timeline-definition-FHXFAJF6-Bicewlzo.js} +1 -1
- package/dist/assets/treeView-QDETBFTQ-npJ5dbqS.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-pYrBx6oa.js +1 -0
- package/dist/assets/{vennDiagram-L72KCM5P-Bvk42Pek.js → vennDiagram-L72KCM5P-BxOOnO9x.js} +1 -1
- package/dist/assets/wardley-OPB4EBWU-CmSRKLR8.js +1 -0
- package/dist/assets/{wardleyDiagram-EHGQE667-DOFjx2s3.js → wardleyDiagram-EHGQE667-Cl7NltMv.js} +1 -1
- package/dist/assets/x-odTHAtLZ.js +1 -0
- package/dist/assets/{xychartDiagram-FW5EYKEG-DY5yRTUc.js → xychartDiagram-FW5EYKEG-DiMIxQ7N.js} +1 -1
- package/dist/index.html +21 -22
- package/package.json +8 -8
- package/src/features/apps/components/__tests__/app-packages-panel.test.tsx +234 -0
- package/src/features/apps/components/app-marketplace-dialog.tsx +262 -0
- package/src/features/apps/components/app-package-card.tsx +268 -0
- package/src/features/apps/components/app-packages-panel.tsx +301 -0
- package/src/features/apps/components/apps-panel.tsx +11 -4
- package/src/features/apps/hooks/use-app-marketplace.ts +95 -0
- package/src/features/apps/hooks/use-app-packages.ts +59 -0
- package/src/features/chat/components/chat-sidebar-list-mode-switch.tsx +27 -4
- package/src/features/chat/components/layout/__tests__/chat-sidebar-session-area.test.tsx +36 -5
- package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +12 -13
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-area.test.tsx +79 -2
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +4 -4
- package/src/features/chat/features/conversation/components/session-conversation-area.tsx +26 -5
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +3 -0
- package/src/features/chat/features/conversation/hooks/use-system-object-reference-select.ts +27 -0
- package/src/features/chat/features/conversation/utils/session-message-composer.utils.ts +5 -0
- package/src/features/chat/features/input/hooks/__tests__/use-chat-input-surface-state.test.tsx +102 -0
- package/src/features/chat/features/input/hooks/use-chat-input-surface-state.ts +71 -120
- package/src/features/chat/features/input/input-surface-plugins/__tests__/context-reference-plugin.test.ts +265 -18
- package/src/features/chat/features/input/input-surface-plugins/chat-input-product-plugin-adapters.types.ts +7 -2
- package/src/features/chat/features/input/input-surface-plugins/chat-input-product-plugin-adapters.utils.ts +124 -0
- package/src/features/chat/features/input/input-surface-plugins/context-reference-items.utils.ts +99 -15
- package/src/features/chat/features/input/input-surface-plugins/context-reference-plugin.utils.ts +143 -139
- package/src/features/chat/features/input/input-surface-plugins/panel-app-input-surface-items.utils.ts +116 -0
- package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +1 -1
- package/src/features/chat/features/input/utils/__tests__/chat-inline-token.utils.test.ts +53 -1
- package/src/features/chat/features/input/utils/chat-composer-token-protocol.utils.ts +5 -0
- package/src/features/chat/features/input/utils/chat-inline-token-composer.utils.ts +134 -0
- package/src/features/chat/features/input/utils/chat-inline-token.utils.ts +30 -101
- package/src/features/chat/features/input/utils/chat-system-object-reference.utils.test.ts +44 -0
- package/src/features/chat/features/input/utils/chat-system-object-reference.utils.ts +46 -0
- package/src/features/chat/features/ncp/hooks/__tests__/use-hydrated-ncp-agent.test.tsx +40 -3
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.selection.test.tsx +66 -0
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.test.tsx +13 -1
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel-content.test.tsx +653 -90
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-text-selection.test.tsx +12 -8
- package/src/features/chat/features/workspace/components/chat-session-workspace-directory-browser.tsx +401 -288
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +54 -35
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +79 -148
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +156 -94
- package/src/features/chat/features/workspace/components/project-files/__tests__/workspace-directory-entry-menu.test.tsx +50 -0
- package/src/features/chat/features/workspace/components/project-files/workspace-directory-entry-menu.tsx +209 -0
- package/src/features/chat/features/workspace/components/project-files/workspace-directory-tree.tsx +459 -0
- package/src/features/chat/features/workspace/components/project-files/workspace-new-folder-tree-item.tsx +112 -0
- package/src/features/chat/features/workspace/components/project-files/workspace-project-files-toolbar.tsx +64 -0
- package/src/features/chat/features/workspace/hooks/use-workspace-explorer-layout.ts +85 -0
- package/src/features/chat/features/workspace/hooks/use-workspace-file-actions.ts +357 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-path-mutation.utils.ts +58 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-tab.utils.ts +23 -22
- package/src/features/chat/features/workspace/utils/chat-workspace-panel-layout.utils.ts +13 -4
- package/src/features/chat/index.ts +1 -1
- package/src/features/chat/managers/__tests__/chat-composer-intent.manager.test.ts +86 -60
- package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +103 -99
- package/src/features/chat/managers/chat-composer-intent.manager.ts +37 -33
- package/src/features/chat/managers/chat-draft-intent.manager.ts +18 -2
- package/src/features/chat/managers/chat-thread.manager.ts +132 -128
- package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +26 -40
- package/src/features/chat/stores/chat-thread.store.ts +53 -74
- package/src/features/inbox/components/inbox-reader-dialog.test.tsx +38 -5
- package/src/features/inbox/components/inbox-reader-dialog.tsx +5 -3
- package/src/features/inbox/managers/inbox.manager.test.ts +28 -3
- package/src/features/inbox/managers/inbox.manager.ts +14 -4
- package/src/features/inbox/pages/inbox-page.test.ts +121 -2
- package/src/features/inbox/pages/inbox-page.tsx +5 -3
- package/src/features/marketplace/components/__tests__/marketplace-page.test.tsx +85 -1
- package/src/features/marketplace/hooks/__tests__/use-marketplace.test.tsx +44 -1
- package/src/features/marketplace/hooks/use-marketplace-item-actions.ts +23 -2
- package/src/features/marketplace/hooks/use-marketplace.ts +10 -0
- package/src/features/marketplace/index.ts +4 -0
- package/src/features/panel-apps/index.ts +5 -1
- package/src/features/panel-apps/utils/__tests__/panel-app-doc-browser.utils.test.ts +13 -6
- package/src/features/panel-apps/utils/panel-app-doc-browser.utils.tsx +6 -3
- package/src/features/right-panel-resources/index.ts +1 -0
- package/src/features/right-panel-resources/utils/right-panel-resource-uri.utils.ts +7 -4
- package/src/features/system-status/components/__tests__/desktop-update-config.test.tsx +20 -1
- package/src/features/system-status/components/desktop-update-config.tsx +14 -13
- package/src/features/system-status/managers/__tests__/runtime-update.manager.test.ts +99 -0
- package/src/features/system-status/managers/runtime-update.manager.ts +22 -0
- package/src/features/system-status/stores/runtime-update.store.ts +1 -0
- package/src/shared/components/resizable-right-panel/__tests__/resizable-right-panel.test.tsx +35 -38
- package/src/shared/components/resizable-right-panel/resizable-right-panel.tsx +25 -19
- package/src/shared/components/ui/actions/__tests__/icon-action-button.test.tsx +15 -0
- package/src/shared/components/ui/actions/icon-action-button.tsx +4 -2
- package/src/shared/components/ui/context-menu/__tests__/context-menu.test.tsx +60 -34
- package/src/shared/components/ui/context-menu/context-menu.tsx +95 -68
- package/src/shared/hooks/use-system-object-references.ts +22 -0
- package/src/shared/lib/api/managers/client.manager.ts +31 -17
- package/src/shared/lib/api/server-path/server-path.types.ts +66 -0
- package/src/shared/lib/api/types.ts +155 -116
- package/src/shared/lib/api/utils/server-path.utils.ts +35 -11
- package/src/shared/lib/i18n/locales/en-US/chat.json +58 -9
- package/src/shared/lib/i18n/locales/en-US/desktop-update.json +7 -4
- package/src/shared/lib/i18n/locales/en-US/doc-browser.json +40 -0
- package/src/shared/lib/i18n/locales/en-US/marketplace.json +3 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +60 -11
- package/src/shared/lib/i18n/locales/zh-CN/desktop-update.json +7 -4
- package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +40 -0
- package/src/shared/lib/i18n/locales/zh-CN/marketplace.json +3 -0
- package/dist/assets/appearance-settings-page-DpVJjvkB.js +0 -1
- package/dist/assets/architecture-TIHT7OUA-Bjp9jf0h.js +0 -1
- package/dist/assets/channel-5T3pdR-s.js +0 -1
- package/dist/assets/chat-page-BuFDmG5_.js +0 -1
- package/dist/assets/chunk-2Q5K7J3B-DTZ3tGfE.js +0 -1
- package/dist/assets/chunk-VAUOI2AC-HLGIHQ6k.js +0 -1
- package/dist/assets/chunk-XXDRQBXY-Dl0m6Ni-.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-DcDnzGNX.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-BKXKMzKM.js +0 -1
- package/dist/assets/config-split-page-BVWVDbvG.js +0 -1
- package/dist/assets/confirm-dialog-mA2iVzxh.js +0 -5
- package/dist/assets/cynefin-VYW2F7L2-BWg7U2UD.js +0 -1
- package/dist/assets/desktop-update-config-DyQb1LXr.js +0 -1
- package/dist/assets/doc-browser-CtO_HtRy.js +0 -1
- package/dist/assets/doc-browser-context-CuGI6PQc.js +0 -1
- package/dist/assets/doc-browser-eMUagyBV.js +0 -1
- package/dist/assets/eventmodeling-45OFAUF4-SB-J4tpq.js +0 -1
- package/dist/assets/flowDiagram-23GEKE2U-BQ_u-eLM.js +0 -1
- package/dist/assets/form-actions-BOfIyG3O.js +0 -1
- package/dist/assets/gitGraph-TEB2WS4Q-DPxNwsFd.js +0 -1
- package/dist/assets/index-BjBdWHV1.js +0 -107
- package/dist/assets/index-DmpmjAGQ.css +0 -1
- package/dist/assets/info-DKCQHKI2-DNlNGH90.js +0 -1
- package/dist/assets/loader-circle-Df8wF2Pr.js +0 -1
- package/dist/assets/mcp-marketplace-page-DI49IKxp.js +0 -1
- package/dist/assets/mcp-marketplace-page-ofDqbOIF.js +0 -9
- package/dist/assets/model-config-page-D73Tu3jW.js +0 -1
- package/dist/assets/packet-7NZHBO7P-BpeiqkBZ.js +0 -1
- package/dist/assets/pie-RZYD4A2V-Cy1yxsPd.js +0 -1
- package/dist/assets/plus-DVU5RLCS.js +0 -1
- package/dist/assets/provider-scoped-model-input-BaJJJYMX.js +0 -1
- package/dist/assets/providers-config-page-BL6IRVBm.js +0 -1
- package/dist/assets/radar-I7S5WNFK-CEcPKCj8.js +0 -1
- package/dist/assets/railroad-3IZDKUUU-CW38eNDs.js +0 -1
- package/dist/assets/railroad-abnf-AHOZXSZD-ByrylcXf.js +0 -1
- package/dist/assets/railroad-ebnf-EBAXGLYW-CNB6GwP-.js +0 -1
- package/dist/assets/railroad-peg-LSFZ7HO6-x6hnqlBG.js +0 -1
- package/dist/assets/react-BC_orpAj.js +0 -8
- package/dist/assets/remote-T24O58lH.js +0 -1
- package/dist/assets/rotate-cw-BqhwSV5p.js +0 -1
- package/dist/assets/runtime-config-page-CXUx017t.js +0 -1
- package/dist/assets/search-config-page-BB6d5gT7.js +0 -1
- package/dist/assets/secrets-config-page-DYsDeT9K.js +0 -3
- package/dist/assets/security-config-CVPgqL7G.js +0 -1
- package/dist/assets/skeleton-C5tWata3.js +0 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-ZC6dFORv.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-CRkh51Im.js +0 -8
- package/dist/assets/treeView-QDETBFTQ-Bw0DSCH7.js +0 -1
- package/dist/assets/treemap-6X3UGDF4-DFWBFcfh.js +0 -1
- package/dist/assets/use-confirm-dialog-D_3-QpZU.js +0 -1
- package/dist/assets/wardley-OPB4EBWU-CoWturk0.js +0 -1
- package/dist/assets/x-BEWSqeux.js +0 -1
- /package/dist/assets/{array-NADKd9aU.js → array-BQVzeGRt.js} +0 -0
- /package/dist/assets/{chunk-KEIR6QF5-BuyuzJJL.js → chunk-KEIR6QF5-f9psyCXK.js} +0 -0
- /package/dist/assets/{chunk-Y2CYZVJY-D_B2ZRNt.js → chunk-Y2CYZVJY-D1mAU_Po.js} +0 -0
- /package/dist/assets/{config-hints-BcfVUMij.js → config-hints-nV5HPOvq.js} +0 -0
- /package/dist/assets/{cytoscape.esm-BANTlgza.js → cytoscape.esm-0uDtdD0l.js} +0 -0
- /package/dist/assets/{defaultLocale-C4_L0aEs.js → defaultLocale-DSWXGgt0.js} +0 -0
- /package/dist/assets/{dist-DAPEIJbz.js → dist--ta5rX12.js} +0 -0
- /package/dist/assets/{graphlib-ChqXg0dI.js → graphlib-CQ6QV4yP.js} +0 -0
- /package/dist/assets/{host-capabilities-D9C4CBK5.js → host-capabilities-Tk038i04.js} +0 -0
- /package/dist/assets/{init-D8wZg9xq.js → init-Y6h9jGtZ.js} +0 -0
- /package/dist/assets/{jszip.min-CkbBfwAQ.js → jszip.min-8hyJpgpx.js} +0 -0
- /package/dist/assets/{katex-TZJFa0J_.js → katex-ARhY9PS1.js} +0 -0
- /package/dist/assets/{middleware-B3k-TSmZ.js → middleware-DXsbf9xI.js} +0 -0
- /package/dist/assets/{path-DodfxcX7.js → path-10BjdyLh.js} +0 -0
- /package/dist/assets/{rough.esm-CUaa1Rbe.js → rough.esm-DxgC_14r.js} +0 -0
- /package/dist/assets/{xlsx-CxByi7bR.js → xlsx-DrDuDNAa.js} +0 -0
package/src/features/chat/features/workspace/components/chat-session-workspace-directory-browser.tsx
CHANGED
|
@@ -1,285 +1,421 @@
|
|
|
1
|
-
import { useState, type ReactNode } from
|
|
2
|
-
import {
|
|
1
|
+
import { useState, type MouseEventHandler, type ReactNode } from 'react';
|
|
2
|
+
import type { ChatFileOpenActionViewModel } from '@nextclaw/agent-chat-ui';
|
|
3
|
+
import { ChevronsUp, Copy, FilePlus2, FolderPlus, LocateFixed, Upload, RefreshCw } from 'lucide-react';
|
|
4
|
+
import { toast } from 'sonner';
|
|
5
|
+
import { usePresenter } from '@/features/chat/components/providers/chat-presenter.provider';
|
|
3
6
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
MessageSquarePlus,
|
|
11
|
-
} from "lucide-react";
|
|
12
|
-
import { toast } from "sonner";
|
|
13
|
-
import { usePresenter } from "@/features/chat/components/providers/chat-presenter.provider";
|
|
14
|
-
import { FileTypeIcon } from "@/shared/components/file-type-icon";
|
|
7
|
+
copyWorkspacePath,
|
|
8
|
+
readBrowseError,
|
|
9
|
+
WorkspaceDirectoryTreeEntry,
|
|
10
|
+
} from '@/features/chat/features/workspace/components/project-files/workspace-directory-tree';
|
|
11
|
+
import { WorkspaceNewFolderTreeItem } from '@/features/chat/features/workspace/components/project-files/workspace-new-folder-tree-item';
|
|
12
|
+
import { WorkspaceProjectFilesToolbar } from '@/features/chat/features/workspace/components/project-files/workspace-project-files-toolbar';
|
|
15
13
|
import {
|
|
16
|
-
|
|
17
|
-
type
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
14
|
+
useWorkspaceProjectFilesController,
|
|
15
|
+
type RefreshDirectory,
|
|
16
|
+
type WorkspaceDirectoryActionTarget,
|
|
17
|
+
type WorkspaceTreeSelection,
|
|
18
|
+
} from '@/features/chat/features/workspace/hooks/use-workspace-file-actions';
|
|
19
|
+
import { ContextMenu, type ContextMenuGroup } from '@/shared/components/ui/context-menu/context-menu';
|
|
20
|
+
import { useConfirmDialog } from '@/shared/hooks/use-confirm-dialog';
|
|
21
|
+
import type { useServerPathBrowse } from '@/shared/hooks/use-server-path-browse';
|
|
22
|
+
import type { ServerPathEntryView } from '@/shared/lib/api';
|
|
23
|
+
import { hostCapabilityManager } from '@/shared/lib/host-capabilities';
|
|
24
|
+
import { t } from '@/shared/lib/i18n';
|
|
24
25
|
|
|
25
26
|
type ChatSessionWorkspaceDirectoryBrowserProps = {
|
|
27
|
+
activeRelativePath?: string | null;
|
|
26
28
|
browseQuery: ReturnType<typeof useServerPathBrowse>;
|
|
27
29
|
onFileOpen: (action: ChatFileOpenActionViewModel) => void;
|
|
28
30
|
sessionKey?: string | null;
|
|
29
|
-
renderStatus: (params: {
|
|
30
|
-
text: string;
|
|
31
|
-
tone?: "muted" | "error";
|
|
32
|
-
}) => ReactNode;
|
|
31
|
+
renderStatus: (params: { text: string; tone?: 'muted' | 'error' }) => ReactNode;
|
|
33
32
|
showRoot?: boolean;
|
|
34
33
|
};
|
|
35
34
|
|
|
36
|
-
function buildDirectoryEntryLabel(entry: ServerPathEntryView): string {
|
|
37
|
-
const actionLabel =
|
|
38
|
-
entry.kind === "directory"
|
|
39
|
-
? t("chatWorkspaceOpenDirectory")
|
|
40
|
-
: t("chatWorkspaceOpenFile");
|
|
41
|
-
return `${actionLabel}: ${entry.name}`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
35
|
function readPathName(path: string): string {
|
|
45
36
|
return path.split(/[\\/]/).filter(Boolean).pop() ?? path;
|
|
46
37
|
}
|
|
47
38
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
return browseQuery.error instanceof Error
|
|
62
|
-
? browseQuery.error.message
|
|
63
|
-
: String(browseQuery.error);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function WorkspaceDirectoryEntryIcon({
|
|
67
|
-
fileName,
|
|
68
|
-
isDirectory,
|
|
69
|
-
isExpanded,
|
|
70
|
-
}: {
|
|
71
|
-
fileName: string;
|
|
72
|
-
isDirectory: boolean;
|
|
73
|
-
isExpanded: boolean;
|
|
74
|
-
}) {
|
|
75
|
-
if (!isDirectory) {
|
|
76
|
-
return <FileTypeIcon fileName={fileName} />;
|
|
77
|
-
}
|
|
78
|
-
return isExpanded ? (
|
|
79
|
-
<FolderOpen className="h-4 w-4 shrink-0 text-amber-500" />
|
|
80
|
-
) : (
|
|
81
|
-
<Folder className="h-4 w-4 shrink-0 text-amber-500" />
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function WorkspaceDirectoryTreeChildren({
|
|
86
|
-
browseQuery,
|
|
87
|
-
level,
|
|
88
|
-
onAddFileToChat,
|
|
39
|
+
function WorkspaceDirectoryEntries({
|
|
40
|
+
activeRelativePath,
|
|
41
|
+
busy,
|
|
42
|
+
collapseVersion,
|
|
43
|
+
createTarget,
|
|
44
|
+
entries,
|
|
45
|
+
fallbackParentTarget,
|
|
46
|
+
mutable,
|
|
47
|
+
onAddToChat,
|
|
48
|
+
onCreateFile,
|
|
49
|
+
onCreateFolder,
|
|
50
|
+
onDelete,
|
|
89
51
|
onFileOpen,
|
|
52
|
+
onRevealComplete,
|
|
53
|
+
onRename,
|
|
90
54
|
onRevealPath,
|
|
91
|
-
|
|
55
|
+
onSelect,
|
|
56
|
+
onUpload,
|
|
57
|
+
refresh,
|
|
58
|
+
relativePaths,
|
|
59
|
+
renderCreateFolder,
|
|
60
|
+
revealPath,
|
|
61
|
+
selectedPath,
|
|
62
|
+
showRoot,
|
|
92
63
|
}: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
64
|
+
activeRelativePath: string | null;
|
|
65
|
+
busy: boolean;
|
|
66
|
+
collapseVersion: number;
|
|
67
|
+
createTarget: WorkspaceDirectoryActionTarget | null;
|
|
68
|
+
entries: readonly ServerPathEntryView[];
|
|
69
|
+
fallbackParentTarget: WorkspaceDirectoryActionTarget;
|
|
70
|
+
mutable: boolean;
|
|
71
|
+
onAddToChat?: (entry: ServerPathEntryView, relativePath: string) => void;
|
|
72
|
+
onCreateFile: (target: WorkspaceDirectoryActionTarget) => void;
|
|
73
|
+
onCreateFolder: (target: WorkspaceDirectoryActionTarget) => void;
|
|
74
|
+
onDelete: (entry: ServerPathEntryView, refresh: RefreshDirectory) => void;
|
|
96
75
|
onFileOpen: (action: ChatFileOpenActionViewModel) => void;
|
|
76
|
+
onRevealComplete: () => void;
|
|
77
|
+
onRename: (entry: ServerPathEntryView, name: string, refresh: RefreshDirectory) => Promise<unknown>;
|
|
97
78
|
onRevealPath?: (path: string) => void;
|
|
98
|
-
|
|
79
|
+
onSelect: (selection: WorkspaceTreeSelection) => void;
|
|
80
|
+
onUpload: (target: WorkspaceDirectoryActionTarget) => void;
|
|
81
|
+
refresh: RefreshDirectory;
|
|
82
|
+
relativePaths: boolean;
|
|
83
|
+
renderCreateFolder: (level: number) => ReactNode;
|
|
84
|
+
revealPath: string | null;
|
|
85
|
+
selectedPath: string | null;
|
|
86
|
+
showRoot: boolean;
|
|
99
87
|
}) {
|
|
100
|
-
const entries = browseQuery.data?.entries ?? [];
|
|
101
|
-
const errorMessage = readBrowseError(browseQuery);
|
|
102
|
-
const statusStyle = { paddingLeft: `${36 + level * 14}px` };
|
|
103
|
-
|
|
104
|
-
if (browseQuery.isLoading && !browseQuery.data) {
|
|
105
|
-
return (
|
|
106
|
-
<div
|
|
107
|
-
className="h-7 truncate pr-2 text-[11px] leading-7 text-gray-400"
|
|
108
|
-
style={statusStyle}
|
|
109
|
-
>
|
|
110
|
-
{t("chatWorkspaceLoadingDirectory")}
|
|
111
|
-
</div>
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
if (errorMessage && !browseQuery.data) {
|
|
115
|
-
return (
|
|
116
|
-
<div
|
|
117
|
-
className="h-7 truncate pr-2 text-[11px] leading-7 text-rose-600"
|
|
118
|
-
style={statusStyle}
|
|
119
|
-
title={errorMessage}
|
|
120
|
-
>
|
|
121
|
-
{t("chatWorkspaceDirectoryLoadFailed")}
|
|
122
|
-
</div>
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
88
|
if (entries.length === 0) {
|
|
126
|
-
return (
|
|
127
|
-
<div
|
|
128
|
-
className="h-7 truncate pr-2 text-[11px] leading-7 text-gray-400"
|
|
129
|
-
style={statusStyle}
|
|
130
|
-
>
|
|
131
|
-
{t("chatWorkspaceDirectoryEmpty")}
|
|
132
|
-
</div>
|
|
133
|
-
);
|
|
89
|
+
return <div className="px-4 py-8 text-center text-xs text-gray-400">{t('chatWorkspaceDirectoryEmpty')}</div>;
|
|
134
90
|
}
|
|
135
91
|
return entries.map((entry) => (
|
|
136
92
|
<WorkspaceDirectoryTreeEntry
|
|
93
|
+
activeRelativePath={activeRelativePath}
|
|
137
94
|
key={entry.path}
|
|
95
|
+
browseParentRefresh={refresh}
|
|
96
|
+
busy={busy}
|
|
97
|
+
collapseVersion={collapseVersion}
|
|
98
|
+
createTarget={createTarget}
|
|
138
99
|
entry={entry}
|
|
139
|
-
level={
|
|
140
|
-
|
|
100
|
+
level={showRoot ? 1 : 0}
|
|
101
|
+
onAddToChat={onAddToChat}
|
|
102
|
+
onCreateFile={mutable ? onCreateFile : undefined}
|
|
103
|
+
onCreateFolder={mutable ? onCreateFolder : undefined}
|
|
104
|
+
onDelete={mutable ? onDelete : undefined}
|
|
141
105
|
onFileOpen={onFileOpen}
|
|
106
|
+
onRevealComplete={onRevealComplete}
|
|
107
|
+
onRename={onRename}
|
|
142
108
|
onRevealPath={onRevealPath}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
109
|
+
onSelect={onSelect}
|
|
110
|
+
onUpload={mutable ? onUpload : undefined}
|
|
111
|
+
parentCreateTarget={fallbackParentTarget}
|
|
112
|
+
relativePath={relativePaths ? entry.name : null}
|
|
113
|
+
renderCreateFolder={renderCreateFolder}
|
|
114
|
+
revealPath={revealPath}
|
|
115
|
+
selectedPath={selectedPath}
|
|
148
116
|
/>
|
|
149
117
|
));
|
|
150
118
|
}
|
|
151
119
|
|
|
152
|
-
function
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
120
|
+
function buildRootContextMenuGroups({
|
|
121
|
+
busy,
|
|
122
|
+
onCollapseAll,
|
|
123
|
+
onCreateFile,
|
|
124
|
+
onCreateFolder,
|
|
125
|
+
onRefresh,
|
|
157
126
|
onRevealPath,
|
|
158
|
-
|
|
127
|
+
onUpload,
|
|
128
|
+
target,
|
|
159
129
|
}: {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
130
|
+
busy: boolean;
|
|
131
|
+
onCollapseAll: () => void;
|
|
132
|
+
onCreateFile: () => void;
|
|
133
|
+
onCreateFolder: () => void;
|
|
134
|
+
onRefresh: () => void;
|
|
164
135
|
onRevealPath?: (path: string) => void;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const browseQuery = useServerPathBrowse({
|
|
170
|
-
path: entry.path,
|
|
171
|
-
includeFiles: true,
|
|
172
|
-
enabled: isDirectory && isExpanded,
|
|
173
|
-
});
|
|
174
|
-
const contextMenuGroups: ContextMenuGroup[] = [
|
|
136
|
+
onUpload: () => void;
|
|
137
|
+
target: WorkspaceDirectoryActionTarget;
|
|
138
|
+
}): ContextMenuGroup[] {
|
|
139
|
+
return [
|
|
175
140
|
{
|
|
176
|
-
key:
|
|
141
|
+
key: 'manage',
|
|
177
142
|
items: [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
143
|
+
{
|
|
144
|
+
key: 'new-file',
|
|
145
|
+
label: t('chatWorkspaceNewFile'),
|
|
146
|
+
icon: <FilePlus2 className="h-4 w-4" />,
|
|
147
|
+
disabled: busy,
|
|
148
|
+
restoreFocus: false,
|
|
149
|
+
onSelect: onCreateFile,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
key: 'new-folder',
|
|
153
|
+
label: t('chatWorkspaceNewFolder'),
|
|
154
|
+
icon: <FolderPlus className="h-4 w-4" />,
|
|
155
|
+
disabled: busy,
|
|
156
|
+
restoreFocus: false,
|
|
157
|
+
onSelect: onCreateFolder,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
key: 'upload',
|
|
161
|
+
label: t('chatWorkspaceUploadFilesHere'),
|
|
162
|
+
icon: <Upload className="h-4 w-4" />,
|
|
163
|
+
disabled: busy,
|
|
164
|
+
restoreFocus: false,
|
|
165
|
+
onSelect: onUpload,
|
|
166
|
+
},
|
|
195
167
|
],
|
|
196
168
|
},
|
|
197
169
|
{
|
|
198
|
-
key:
|
|
170
|
+
key: 'view',
|
|
199
171
|
items: [
|
|
200
172
|
{
|
|
201
|
-
key:
|
|
202
|
-
label: t(
|
|
203
|
-
icon: <
|
|
204
|
-
onSelect:
|
|
173
|
+
key: 'refresh',
|
|
174
|
+
label: t('chatWorkspaceRefreshExplorer'),
|
|
175
|
+
icon: <RefreshCw className="h-4 w-4" />,
|
|
176
|
+
onSelect: onRefresh,
|
|
205
177
|
},
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
178
|
+
{
|
|
179
|
+
key: 'collapse',
|
|
180
|
+
label: t('chatWorkspaceCollapseAll'),
|
|
181
|
+
icon: <ChevronsUp className="h-4 w-4" />,
|
|
182
|
+
onSelect: onCollapseAll,
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
key: 'path',
|
|
188
|
+
items: [
|
|
189
|
+
...(onRevealPath
|
|
190
|
+
? [
|
|
191
|
+
{
|
|
192
|
+
key: 'reveal',
|
|
193
|
+
label: t('chatWorkspaceRevealInFileManager'),
|
|
194
|
+
icon: <LocateFixed className="h-4 w-4" />,
|
|
195
|
+
onSelect: () => onRevealPath(target.path),
|
|
196
|
+
},
|
|
197
|
+
]
|
|
213
198
|
: []),
|
|
199
|
+
{
|
|
200
|
+
key: 'copy-path',
|
|
201
|
+
label: t('chatWorkspaceCopyPath'),
|
|
202
|
+
icon: <Copy className="h-4 w-4" />,
|
|
203
|
+
onSelect: () => void copyWorkspacePath(target.path),
|
|
204
|
+
},
|
|
214
205
|
],
|
|
215
206
|
},
|
|
216
207
|
];
|
|
217
|
-
|
|
218
|
-
if (isDirectory) {
|
|
219
|
-
setIsExpanded((value) => !value);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
onFileOpen({
|
|
223
|
-
path: entry.path,
|
|
224
|
-
label: entry.name,
|
|
225
|
-
viewMode: "preview",
|
|
226
|
-
});
|
|
227
|
-
};
|
|
208
|
+
}
|
|
228
209
|
|
|
210
|
+
function WorkspaceProjectTree({
|
|
211
|
+
children,
|
|
212
|
+
currentPath,
|
|
213
|
+
onBlankContext,
|
|
214
|
+
onContextMenu,
|
|
215
|
+
rootDraft,
|
|
216
|
+
showRoot,
|
|
217
|
+
}: {
|
|
218
|
+
children: ReactNode;
|
|
219
|
+
currentPath: string | null;
|
|
220
|
+
onBlankContext: () => void;
|
|
221
|
+
onContextMenu?: MouseEventHandler<HTMLDivElement>;
|
|
222
|
+
rootDraft: ReactNode;
|
|
223
|
+
showRoot: boolean;
|
|
224
|
+
}) {
|
|
229
225
|
return (
|
|
230
226
|
<div
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
227
|
+
data-testid="workspace-directory-browser"
|
|
228
|
+
role="tree"
|
|
229
|
+
tabIndex={-1}
|
|
230
|
+
aria-label={t('chatWorkspaceProjectFiles')}
|
|
231
|
+
className="min-h-0 flex-1 overflow-auto py-1 custom-scrollbar"
|
|
232
|
+
onContextMenu={(event) => {
|
|
233
|
+
if (!(event.target as HTMLElement).closest('[data-workspace-tree-entry]')) onBlankContext();
|
|
234
|
+
onContextMenu?.(event);
|
|
235
|
+
}}
|
|
234
236
|
>
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
onClick={activateEntry}
|
|
247
|
-
>
|
|
248
|
-
<span className="inline-flex h-4 w-4 shrink-0 items-center justify-center text-gray-400">
|
|
249
|
-
{isDirectory ? (
|
|
250
|
-
isExpanded ? (
|
|
251
|
-
<ChevronDown className="h-3.5 w-3.5" />
|
|
252
|
-
) : (
|
|
253
|
-
<ChevronRight className="h-3.5 w-3.5" />
|
|
254
|
-
)
|
|
255
|
-
) : null}
|
|
256
|
-
</span>
|
|
257
|
-
<WorkspaceDirectoryEntryIcon
|
|
258
|
-
fileName={entry.name}
|
|
259
|
-
isDirectory={isDirectory}
|
|
260
|
-
isExpanded={isExpanded}
|
|
261
|
-
/>
|
|
262
|
-
<span className="min-w-0 flex-1 truncate">{entry.name}</span>
|
|
263
|
-
</button>
|
|
264
|
-
</ContextMenu>
|
|
237
|
+
{showRoot && currentPath ? (
|
|
238
|
+
<>
|
|
239
|
+
{rootDraft}
|
|
240
|
+
{children}
|
|
241
|
+
</>
|
|
242
|
+
) : (
|
|
243
|
+
children
|
|
244
|
+
)}
|
|
245
|
+
</div>
|
|
246
|
+
);
|
|
247
|
+
}
|
|
265
248
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
249
|
+
function WorkspaceDirectoryBrowserReady({
|
|
250
|
+
activeRelativePath,
|
|
251
|
+
browseQuery,
|
|
252
|
+
ConfirmDialog,
|
|
253
|
+
controller,
|
|
254
|
+
entries,
|
|
255
|
+
onAddToChat,
|
|
256
|
+
onFileOpen,
|
|
257
|
+
onRevealPath,
|
|
258
|
+
rootLabel,
|
|
259
|
+
rootPath,
|
|
260
|
+
showRoot,
|
|
261
|
+
}: {
|
|
262
|
+
activeRelativePath: string | null;
|
|
263
|
+
browseQuery: ReturnType<typeof useServerPathBrowse>;
|
|
264
|
+
ConfirmDialog: () => ReactNode;
|
|
265
|
+
controller: ReturnType<typeof useWorkspaceProjectFilesController>;
|
|
266
|
+
entries: readonly ServerPathEntryView[];
|
|
267
|
+
onAddToChat?: (entry: ServerPathEntryView, relativePath: string) => void;
|
|
268
|
+
onFileOpen: (action: ChatFileOpenActionViewModel) => void;
|
|
269
|
+
onRevealPath?: (path: string) => void;
|
|
270
|
+
rootLabel: string;
|
|
271
|
+
rootPath: string | null;
|
|
272
|
+
showRoot: boolean;
|
|
273
|
+
}) {
|
|
274
|
+
const {
|
|
275
|
+
cancelCreateFolder,
|
|
276
|
+
clearSelection,
|
|
277
|
+
completeReveal,
|
|
278
|
+
submitCreate,
|
|
279
|
+
deleteEntry,
|
|
280
|
+
openCreateFile,
|
|
281
|
+
openCreateFolder,
|
|
282
|
+
requestUpload,
|
|
283
|
+
renameEntry,
|
|
284
|
+
selectEntry,
|
|
285
|
+
setCreateError,
|
|
286
|
+
setCreateName,
|
|
287
|
+
uploadFiles,
|
|
288
|
+
} = controller.actions;
|
|
289
|
+
const { fileInputRef } = controller.refs;
|
|
290
|
+
const {
|
|
291
|
+
createError,
|
|
292
|
+
createKind,
|
|
293
|
+
createName,
|
|
294
|
+
createTarget,
|
|
295
|
+
pendingAction,
|
|
296
|
+
revealPath,
|
|
297
|
+
selectedCreateTarget,
|
|
298
|
+
selectedPath,
|
|
299
|
+
} = controller.state;
|
|
300
|
+
const busy = pendingAction !== null;
|
|
301
|
+
const [collapseVersion, setCollapseVersion] = useState(0);
|
|
302
|
+
const rootRefresh = () => browseQuery.refetch();
|
|
303
|
+
const rootTarget: WorkspaceDirectoryActionTarget | null = rootPath
|
|
304
|
+
? { label: rootLabel, path: rootPath, refresh: rootRefresh }
|
|
305
|
+
: null;
|
|
306
|
+
const toolbarTarget = selectedCreateTarget ?? rootTarget;
|
|
307
|
+
const renderCreateFolder = (level: number) => (
|
|
308
|
+
<WorkspaceNewFolderTreeItem
|
|
309
|
+
error={createError}
|
|
310
|
+
kind={createKind}
|
|
311
|
+
isCreating={pendingAction === 'create-directory' || pendingAction === 'create-file'}
|
|
312
|
+
level={level}
|
|
313
|
+
name={createName}
|
|
314
|
+
onCancel={cancelCreateFolder}
|
|
315
|
+
onNameChange={(name) => {
|
|
316
|
+
setCreateName(name);
|
|
317
|
+
setCreateError(null);
|
|
318
|
+
}}
|
|
319
|
+
onSubmit={() => void submitCreate()}
|
|
320
|
+
/>
|
|
321
|
+
);
|
|
322
|
+
const fallbackParentTarget = rootTarget ?? {
|
|
323
|
+
label: '',
|
|
324
|
+
path: browseQuery.data?.currentPath ?? '',
|
|
325
|
+
refresh: rootRefresh,
|
|
326
|
+
};
|
|
327
|
+
const treeEntries = (
|
|
328
|
+
<WorkspaceDirectoryEntries
|
|
329
|
+
activeRelativePath={activeRelativePath}
|
|
330
|
+
busy={busy}
|
|
331
|
+
collapseVersion={collapseVersion}
|
|
332
|
+
createTarget={createTarget}
|
|
333
|
+
entries={entries}
|
|
334
|
+
fallbackParentTarget={fallbackParentTarget}
|
|
335
|
+
mutable={Boolean(rootPath)}
|
|
336
|
+
onAddToChat={onAddToChat}
|
|
337
|
+
onCreateFile={openCreateFile}
|
|
338
|
+
onCreateFolder={openCreateFolder}
|
|
339
|
+
onDelete={(target, refresh) => void deleteEntry(target, refresh)}
|
|
340
|
+
onFileOpen={onFileOpen}
|
|
341
|
+
onRevealComplete={completeReveal}
|
|
342
|
+
onRename={renameEntry}
|
|
343
|
+
onRevealPath={onRevealPath}
|
|
344
|
+
onSelect={selectEntry}
|
|
345
|
+
onUpload={requestUpload}
|
|
346
|
+
refresh={rootRefresh}
|
|
347
|
+
relativePaths={Boolean(onAddToChat)}
|
|
348
|
+
renderCreateFolder={renderCreateFolder}
|
|
349
|
+
revealPath={revealPath}
|
|
350
|
+
selectedPath={selectedPath}
|
|
351
|
+
showRoot={false}
|
|
352
|
+
/>
|
|
353
|
+
);
|
|
354
|
+
const tree = (
|
|
355
|
+
<WorkspaceProjectTree
|
|
356
|
+
currentPath={rootPath}
|
|
357
|
+
onBlankContext={clearSelection}
|
|
358
|
+
rootDraft={createTarget?.path === rootPath ? renderCreateFolder(0) : null}
|
|
359
|
+
showRoot={showRoot}
|
|
360
|
+
>
|
|
361
|
+
{treeEntries}
|
|
362
|
+
</WorkspaceProjectTree>
|
|
363
|
+
);
|
|
364
|
+
const rootMenuGroups = rootTarget
|
|
365
|
+
? buildRootContextMenuGroups({
|
|
366
|
+
busy,
|
|
367
|
+
onCollapseAll: () => setCollapseVersion((value) => value + 1),
|
|
368
|
+
onCreateFile: () => openCreateFile(rootTarget),
|
|
369
|
+
onCreateFolder: () => openCreateFolder(rootTarget),
|
|
370
|
+
onRefresh: () => void browseQuery.refetch(),
|
|
371
|
+
onRevealPath,
|
|
372
|
+
onUpload: () => requestUpload(rootTarget),
|
|
373
|
+
target: rootTarget,
|
|
374
|
+
})
|
|
375
|
+
: [];
|
|
376
|
+
|
|
377
|
+
const content = (
|
|
378
|
+
<div
|
|
379
|
+
className="flex h-full min-h-0 flex-col bg-white"
|
|
380
|
+
onContextMenu={(event) => {
|
|
381
|
+
if (!(event.target as HTMLElement).closest('[data-workspace-tree-entry]')) clearSelection();
|
|
382
|
+
}}
|
|
383
|
+
>
|
|
384
|
+
{rootPath && toolbarTarget ? (
|
|
385
|
+
<WorkspaceProjectFilesToolbar
|
|
386
|
+
disabled={busy}
|
|
387
|
+
rootLabel={rootLabel}
|
|
388
|
+
onCollapseAll={() => setCollapseVersion((value) => value + 1)}
|
|
389
|
+
onNewFile={() => openCreateFile(toolbarTarget)}
|
|
390
|
+
onNewFolder={() => openCreateFolder(toolbarTarget)}
|
|
391
|
+
onRefresh={() => void browseQuery.refetch()}
|
|
392
|
+
/>
|
|
393
|
+
) : null}
|
|
394
|
+
{rootPath ? (
|
|
395
|
+
<input
|
|
396
|
+
ref={fileInputRef}
|
|
397
|
+
type="file"
|
|
398
|
+
multiple
|
|
399
|
+
className="sr-only"
|
|
400
|
+
aria-label={t('chatWorkspaceUploadFiles')}
|
|
401
|
+
onChange={(event) => void uploadFiles(Array.from(event.currentTarget.files ?? []))}
|
|
402
|
+
/>
|
|
277
403
|
) : null}
|
|
404
|
+
{tree}
|
|
405
|
+
<ConfirmDialog />
|
|
278
406
|
</div>
|
|
279
407
|
);
|
|
408
|
+
return rootTarget ? (
|
|
409
|
+
<ContextMenu groups={rootMenuGroups} label={t('chatWorkspaceRootContextMenu')}>
|
|
410
|
+
{content}
|
|
411
|
+
</ContextMenu>
|
|
412
|
+
) : (
|
|
413
|
+
content
|
|
414
|
+
);
|
|
280
415
|
}
|
|
281
416
|
|
|
282
417
|
export function ChatSessionWorkspaceDirectoryBrowser({
|
|
418
|
+
activeRelativePath = null,
|
|
283
419
|
browseQuery,
|
|
284
420
|
onFileOpen,
|
|
285
421
|
sessionKey,
|
|
@@ -287,85 +423,62 @@ export function ChatSessionWorkspaceDirectoryBrowser({
|
|
|
287
423
|
showRoot = false,
|
|
288
424
|
}: ChatSessionWorkspaceDirectoryBrowserProps) {
|
|
289
425
|
const presenter = usePresenter();
|
|
426
|
+
const { confirm, ConfirmDialog } = useConfirmDialog();
|
|
290
427
|
const entries = browseQuery.data?.entries ?? [];
|
|
291
428
|
const errorMessage = readBrowseError(browseQuery);
|
|
429
|
+
const rootPath = showRoot ? (browseQuery.data?.currentPath ?? null) : null;
|
|
430
|
+
const rootLabel = rootPath ? readPathName(rootPath) : '';
|
|
431
|
+
const controller = useWorkspaceProjectFilesController({
|
|
432
|
+
activeRelativePath,
|
|
433
|
+
confirm,
|
|
434
|
+
onEntryDeleted: presenter.chatThreadManager.removeWorkspacePath,
|
|
435
|
+
onEntryRenamed: presenter.chatThreadManager.renameWorkspacePath,
|
|
436
|
+
rootPath,
|
|
437
|
+
});
|
|
292
438
|
const onRevealPath = hostCapabilityManager.canRevealPath()
|
|
293
439
|
? (path: string) => {
|
|
294
440
|
void hostCapabilityManager.revealPath(path).then((result) => {
|
|
295
|
-
if (!result.revealed)
|
|
296
|
-
toast.error(t("chatWorkspaceRevealPathFailed"));
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
: undefined;
|
|
301
|
-
const onAddFileToChat = sessionKey !== undefined
|
|
302
|
-
? (entry: ServerPathEntryView, relativePath: string) => {
|
|
303
|
-
presenter.chatComposerIntentManager.requestFileReference({
|
|
304
|
-
targetSessionKey: sessionKey,
|
|
305
|
-
tokenKey: relativePath,
|
|
306
|
-
label: entry.name,
|
|
441
|
+
if (!result.revealed) toast.error(t('chatWorkspaceRevealPathFailed'));
|
|
307
442
|
});
|
|
308
443
|
}
|
|
309
444
|
: undefined;
|
|
445
|
+
const onAddToChat =
|
|
446
|
+
sessionKey !== undefined
|
|
447
|
+
? (entry: ServerPathEntryView, relativePath: string) => {
|
|
448
|
+
const request =
|
|
449
|
+
entry.kind === 'directory'
|
|
450
|
+
? presenter.chatComposerIntentManager.requestDirectoryReference
|
|
451
|
+
: presenter.chatComposerIntentManager.requestFileReference;
|
|
452
|
+
request({
|
|
453
|
+
targetSessionKey: sessionKey,
|
|
454
|
+
tokenKey: relativePath,
|
|
455
|
+
label: entry.name,
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
: undefined;
|
|
310
459
|
|
|
311
460
|
if (browseQuery.isLoading && !browseQuery.data) {
|
|
312
|
-
return renderStatus({ text: t(
|
|
461
|
+
return renderStatus({ text: t('chatWorkspaceLoadingDirectory') });
|
|
313
462
|
}
|
|
314
|
-
|
|
315
463
|
if (errorMessage && !browseQuery.data) {
|
|
316
464
|
return renderStatus({
|
|
317
|
-
tone:
|
|
318
|
-
text: `${t(
|
|
465
|
+
tone: 'error',
|
|
466
|
+
text: `${t('chatWorkspaceDirectoryLoadFailed')}: ${errorMessage}`,
|
|
319
467
|
});
|
|
320
468
|
}
|
|
321
|
-
|
|
322
|
-
if (entries.length === 0) {
|
|
323
|
-
return renderStatus({ text: t("chatWorkspaceDirectoryEmpty") });
|
|
324
|
-
}
|
|
325
|
-
|
|
326
469
|
return (
|
|
327
|
-
<
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
{
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
</span>
|
|
341
|
-
</div>
|
|
342
|
-
<div role="group" className="pt-1">
|
|
343
|
-
{entries.map((entry) => (
|
|
344
|
-
<WorkspaceDirectoryTreeEntry
|
|
345
|
-
key={entry.path}
|
|
346
|
-
entry={entry}
|
|
347
|
-
level={1}
|
|
348
|
-
onAddFileToChat={onAddFileToChat}
|
|
349
|
-
onFileOpen={onFileOpen}
|
|
350
|
-
onRevealPath={onRevealPath}
|
|
351
|
-
relativePath={onAddFileToChat ? entry.name : null}
|
|
352
|
-
/>
|
|
353
|
-
))}
|
|
354
|
-
</div>
|
|
355
|
-
</div>
|
|
356
|
-
) : (
|
|
357
|
-
entries.map((entry) => (
|
|
358
|
-
<WorkspaceDirectoryTreeEntry
|
|
359
|
-
key={entry.path}
|
|
360
|
-
entry={entry}
|
|
361
|
-
level={0}
|
|
362
|
-
onAddFileToChat={onAddFileToChat}
|
|
363
|
-
onFileOpen={onFileOpen}
|
|
364
|
-
onRevealPath={onRevealPath}
|
|
365
|
-
relativePath={onAddFileToChat ? entry.name : null}
|
|
366
|
-
/>
|
|
367
|
-
))
|
|
368
|
-
)}
|
|
369
|
-
</div>
|
|
470
|
+
<WorkspaceDirectoryBrowserReady
|
|
471
|
+
activeRelativePath={activeRelativePath}
|
|
472
|
+
browseQuery={browseQuery}
|
|
473
|
+
ConfirmDialog={ConfirmDialog}
|
|
474
|
+
controller={controller}
|
|
475
|
+
entries={entries}
|
|
476
|
+
onAddToChat={onAddToChat}
|
|
477
|
+
onFileOpen={onFileOpen}
|
|
478
|
+
onRevealPath={onRevealPath}
|
|
479
|
+
rootLabel={rootLabel}
|
|
480
|
+
rootPath={rootPath}
|
|
481
|
+
showRoot={showRoot}
|
|
482
|
+
/>
|
|
370
483
|
);
|
|
371
484
|
}
|