@nextclaw/ui 0.26.5 → 0.27.1
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 +82 -0
- package/dist/.vite/manifest.json +1342 -1227
- package/dist/assets/{abnfDiagram-VRR7QNED-Dcw10Yt1.js → abnfDiagram-VRR7QNED-BT0_ycaq.js} +1 -1
- package/dist/assets/account-panel-BVNV8XqM.js +1 -0
- package/dist/assets/agents-CfpN8PQc.js +1 -0
- package/dist/assets/agents-E4nu-17c.js +1 -0
- package/dist/assets/{aiden0z-pptx-renderer.es--oNqetPA.js → aiden0z-pptx-renderer.es-ClCaf_Wh.js} +1 -1
- package/dist/assets/api-CI6_8Qt1.js +20 -0
- package/dist/assets/app-presenter-provider-2DwHRRle.js +28 -0
- package/dist/assets/app-presenter-provider-D3BuuOyZ.css +1 -0
- package/dist/assets/appearance-settings-page-Cn9w3F-K.js +1 -0
- package/dist/assets/apps-YFlJirpx.js +1 -0
- package/dist/assets/{arc-DBRedCax.js → arc-cmSdpq1Z.js} +1 -1
- package/dist/assets/architecture-TIHT7OUA-BImoGh10.js +1 -0
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-Dufhtuv-.js → architectureDiagram-ZJ3FMSHR-aYglVeoS.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-BUk0vtJ7.js → blockDiagram-677ZJIJ3-Di_PBl5q.js} +1 -1
- package/dist/assets/{book-open-Bcnn2_uV.js → book-open-i_BjUBqL.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-CxDcVE9p.js → c4Diagram-LMCZKHZV-CfuxybOL.js} +1 -1
- package/dist/assets/{card-Cqs73hGI.js → card-DokH7OBp.js} +1 -1
- package/dist/assets/channel-BDQry0ob.js +1 -0
- package/dist/assets/channels-list-page-B7G9lHUm.js +8 -0
- package/dist/assets/chunk-2Q5K7J3B-DkgSFfIy.js +1 -0
- package/dist/assets/{chunk-32BRIVSS-DSF3KElA.js → chunk-32BRIVSS-CCGc4qg4.js} +1 -1
- package/dist/assets/{chunk-52WLFC77-Costxzr3.js → chunk-52WLFC77-aJoxU2Ow.js} +1 -1
- package/dist/assets/{chunk-5FCAYU7R-rhqzGGZo.js → chunk-5FCAYU7R-CGwtZSax.js} +1 -1
- package/dist/assets/{chunk-5HE753X5-BsEsmIao.js → chunk-5HE753X5-DqaMSMeS.js} +1 -1
- package/dist/assets/{chunk-5JV3BV7I-Dqw_DCoN.js → chunk-5JV3BV7I-DnabINcd.js} +1 -1
- package/dist/assets/{chunk-5TONJI2A-Cft82fp8.js → chunk-5TONJI2A-BhpKv1k2.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-DqNHn9Dl.js → chunk-5VM5RSS4-DvkRPit_.js} +1 -1
- package/dist/assets/{chunk-7BUUIJ7U-A5SBEMYY.js → chunk-7BUUIJ7U-CgDQOLnC.js} +1 -1
- package/dist/assets/{chunk-BIQX33UG-1Ng3mTrH.js → chunk-BIQX33UG-9FEv5b7T.js} +1 -1
- package/dist/assets/{chunk-C7G6YPKG-DRJEy8ZI.js → chunk-C7G6YPKG-CNGFAFYL.js} +1 -1
- package/dist/assets/{chunk-CQNSW5MT-Bydv_J3J.js → chunk-CQNSW5MT-DovTZx0M.js} +1 -1
- package/dist/assets/{chunk-CYSBUYHQ-HkMIg12u.js → chunk-CYSBUYHQ-DpLEgYa1.js} +1 -1
- package/dist/assets/{chunk-EMLP6XTP-C5ndDvm3.js → chunk-EMLP6XTP-D4NuN01W.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-DzeloZRo.js → chunk-EX3LRPZG-D8Jf4kc2.js} +1 -1
- package/dist/assets/{chunk-FWX5IMBZ-n_2_CLTQ.js → chunk-FWX5IMBZ-BdHymAs0.js} +2 -2
- package/dist/assets/{chunk-HOUHSVGY-kx_slvu3.js → chunk-HOUHSVGY-Dd_Ycn9Z.js} +1 -1
- package/dist/assets/{chunk-ICXQ74PX-sQLMURqL.js → chunk-ICXQ74PX-BRPUu3ff.js} +1 -1
- package/dist/assets/{chunk-JG7HCLWE-CMUn5Elc.js → chunk-JG7HCLWE-DnCasQja.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-Cra3s-Uk.js → chunk-JWPE2WC7-C3CkbEj1.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-umcrg5Bi.js → chunk-MOJQB5TN-Pi--K4-1.js} +1 -1
- package/dist/assets/{chunk-MOZMSUNE-BnljD1ig.js → chunk-MOZMSUNE-3VTspvlh.js} +1 -1
- package/dist/assets/{chunk-OGEWGWER-BXx5pQjU.js → chunk-OGEWGWER-BetLLyJt.js} +1 -1
- package/dist/assets/{chunk-OSBZ3O6U-D-1qfdWu.js → chunk-OSBZ3O6U-D1VcupAj.js} +1 -1
- package/dist/assets/{chunk-PUDLZKDR-DLzX78LC.js → chunk-PUDLZKDR-Cy4G8SjV.js} +1 -1
- package/dist/assets/{chunk-Q4XR5HBZ-DTK-rtW6.js → chunk-Q4XR5HBZ-UYxXzi7_.js} +1 -1
- package/dist/assets/{chunk-QBLGF6JB-CsFeIGfr.js → chunk-QBLGF6JB-CHiGeRY1.js} +1 -1
- package/dist/assets/{chunk-R7FJI6CG-4xNYUeng.js → chunk-R7FJI6CG-C5kVJus8.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-DJiHiTE5.js → chunk-RYQCIY6F-C6cuuEBn.js} +1 -1
- package/dist/assets/{chunk-U6XO7XAA-BVYkauHz.js → chunk-U6XO7XAA-CM0EK7Y0.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-BsazE8cS.js → chunk-V7JOEXUC-DWJZIsME.js} +1 -1
- package/dist/assets/chunk-VAUOI2AC-CsTIB8qD.js +1 -0
- package/dist/assets/{chunk-VR4S4FIN-7RoZQffO.js → chunk-VR4S4FIN-CY5KYeEi.js} +1 -1
- package/dist/assets/{chunk-WYO6CB5R-DEuS6N1R.js → chunk-WYO6CB5R-B30N3ZP8.js} +3 -3
- package/dist/assets/chunk-XXDRQBXY-DK6dz0Q3.js +1 -0
- package/dist/assets/{chunk-YOTPTUD7-9KBrosZL.js → chunk-YOTPTUD7-CBu82JpO.js} +1 -1
- package/dist/assets/{chunk-ZGVPDNZ5-IYgN9f5A.js → chunk-ZGVPDNZ5-BN5NX5qA.js} +1 -1
- package/dist/assets/{chunk-ZIRB5QZD-BUo0-zcp.js → chunk-ZIRB5QZD-DcDXK29L.js} +1 -1
- package/dist/assets/{circle-dashed-EY1ScSMe.js → circle-dashed-Cx8CIEbg.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-BYygHCrp.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-BgQ0XKYz.js +1 -0
- package/dist/assets/{client-CH7w6yRV.js → client-CUJUci3r.js} +1 -1
- package/dist/assets/config-split-page-hY1xug28.js +1 -0
- package/dist/assets/confirm-dialog-B-ejV666.js +1 -0
- package/dist/assets/{app-presenter-provider-jNGlmBLe.css → context-menu-DEcVZfaU.css} +1 -1
- package/dist/assets/context-menu-dGVv8klA.js +211 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-DhqbC1fR.js → cose-bilkent-JH36ORCC-CmeJVoTw.js} +1 -1
- package/dist/assets/{createLucideIcon-Cfo2ySi5.js → createLucideIcon-reFMl-W-.js} +1 -1
- package/dist/assets/cron-CH5c55CR.js +1 -0
- package/dist/assets/cynefin-VYW2F7L2-DKbotNWS.js +1 -0
- package/dist/assets/{cynefinDiagram-TSTJHNR4-C-TBRi5V.js → cynefinDiagram-TSTJHNR4-DGOUMgPP.js} +1 -1
- package/dist/assets/{dagre-CrgsRasE.js → dagre-CMxSkbJJ.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-BmafJymp.js → dagre-VKFMJZFB-3YUBEXwo.js} +1 -1
- package/dist/assets/{desktop-capabilities-page-BDYITStl.js → desktop-capabilities-page-CYJTQ3nC.js} +1 -1
- package/dist/assets/desktop-update-config-guKAozXO.js +1 -0
- package/dist/assets/{diagram-FQU43EPY-BoOMwa6D.js → diagram-FQU43EPY-Br1g--ww.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-Le7N6Uym.js → diagram-G47NLZAW-D1wJCBgr.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-Fbpj3-MO.js → diagram-NH7WQ7WH-Cgg2auLH.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-D3QuGGuu.js → diagram-OA4YK3LP-R-wHiWqh.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-Cxu1uiN6.js → diagram-WEI45ONY-CsNnKV0P.js} +1 -1
- package/dist/assets/dialog-DLOwdjT1.js +1 -0
- package/dist/assets/dist-ZaFFmAGl.js +41 -0
- package/dist/assets/doc-browser-ClDUWo9V.js +1 -0
- package/dist/assets/doc-browser-context-CTmOmuqa.js +1 -0
- package/dist/assets/{docx-preview-CkU2psnd.js → docx-preview-kPn_EtAr.js} +1 -1
- package/dist/assets/{download-BoaKzDJk.js → download-DovI3Yvf.js} +1 -1
- package/dist/assets/{ebnfDiagram-CCIWWBDH-CCAjuQM6.js → ebnfDiagram-CCIWWBDH-DCyhIPdi.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-BuzUAq-d.js → erDiagram-Q63AITRT-D0ZJYAUf.js} +1 -1
- package/dist/assets/eventmodeling-45OFAUF4-SIhbIFIw.js +1 -0
- package/dist/assets/extensions-BZ3qrM8M.js +1 -0
- package/dist/assets/external-link-DUD3AbsF.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-DdAjkU7I.js +1 -0
- package/dist/assets/{form-actions-D9JWSFQu.js → form-actions-B8VniHts.js} +1 -1
- package/dist/assets/{ganttDiagram-NO4QXBWP-cJmWVY8F.js → ganttDiagram-NO4QXBWP-CiXDcXZD.js} +1 -1
- package/dist/assets/gitGraph-TEB2WS4Q-DnMNpESZ.js +1 -0
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-F58o-vtP.js → gitGraphDiagram-IHSO6WYX-BSiIV48S.js} +1 -1
- package/dist/assets/{i18n-Bm3Ov7Fy.js → i18n-IGQbjBqS.js} +2 -2
- package/dist/assets/inbox-BjBZIbgx.js +1 -0
- package/dist/assets/inbox-ClAG7SI_.js +1 -0
- package/dist/assets/info-DKCQHKI2-BSm-69p_.js +1 -0
- package/dist/assets/{infoDiagram-FWYZ7A6U-Gt59b83C.js → infoDiagram-FWYZ7A6U-CCIgBCVq.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-1u4IAj1I.js → ishikawaDiagram-FXEZZL3T-nQ_baN5u.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-CCQsfV-5.js → journeyDiagram-5HDEW3XC-ABueIPzj.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-vlB6O_Zn.js → kanban-definition-HUTT4EX6-8FKS3fmQ.js} +1 -1
- package/dist/assets/katex-DPgHtix3.js +1 -0
- package/dist/assets/keyboard-shortcuts-settings-page-BqfbbKir.js +1 -0
- package/dist/assets/{line-D_bHubTL.js → line-Biw8iEUz.js} +1 -1
- package/dist/assets/{linear-ChlwuS5y.js → linear-D7CWUHTF.js} +1 -1
- package/dist/assets/login-page-BxSMwUsc.js +1 -0
- package/dist/assets/{login-page-C-DvcG3L.js → login-page-DYaozpzz.js} +1 -1
- package/dist/assets/main-CWYF9QU_.js +2 -0
- package/dist/assets/main-D_zmSVS1.css +1 -0
- package/dist/assets/main-i18n-catalog.config-itg3Gvzp.js +1 -0
- package/dist/assets/{map-oGHTsIu8.js → map-CDu47gTf.js} +1 -1
- package/dist/assets/marketplace-CnQ5USfr.js +1 -0
- package/dist/assets/mcp-marketplace-page-Dor6H9IC.js +1 -0
- package/dist/assets/{mermaid-parser.core-CuRe1ZG4.js → mermaid-parser.core-Cc9wjl82.js} +2 -2
- package/dist/assets/{mermaid.core-u4YCFKRf.js → mermaid.core-GWlaVWz1.js} +3 -3
- package/dist/assets/{mindmap-definition-LN4V7U3C-DeJAQYTu.js → mindmap-definition-LN4V7U3C-oqnKsz-R.js} +1 -1
- package/dist/assets/model-config-page-Cduyz2Hy.js +1 -0
- package/dist/assets/{navigation-link-CjxNC8aT.js → navigation-link-D-JSWFxj.js} +2 -2
- package/dist/assets/{ordinal-C6JFfkKN.js → ordinal-DImbxqBz.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-1YQvC6mT.js +1 -0
- package/dist/assets/panel-app-BBTg0tVp.js +1 -0
- package/dist/assets/panel-app-i18n-catalog.config-BfLHr1tc.js +1 -0
- package/dist/assets/panel-apps-C-izvtu9.js +1 -0
- package/dist/assets/panelStandalone-XRlWxbRS.css +1 -0
- package/dist/assets/panelStandalone-oHxbXvYt.js +2 -0
- package/dist/assets/{pegDiagram-2B236MQR-nVMkxShH.js → pegDiagram-2B236MQR-DYAB8CEz.js} +1 -1
- package/dist/assets/pie-RZYD4A2V-BGoNOSwu.js +1 -0
- package/dist/assets/{pieDiagram-ENE6RG2P-8aUH44QZ.js → pieDiagram-ENE6RG2P-DGsH0Kk5.js} +1 -1
- package/dist/assets/plus-DUdl68Eo.js +1 -0
- package/dist/assets/privacy-settings-page-DG9E8N-F.js +1 -0
- package/dist/assets/projects-CzBaTOTL.js +1 -0
- package/dist/assets/provider-models-COzjYl29.js +1 -0
- package/dist/assets/provider-scoped-model-input-Cvy74uj8.js +1 -0
- package/dist/assets/providers-config-page-7rCwVnhh.js +1 -0
- package/dist/assets/puzzle-C5Wfpjk_.js +1 -0
- package/dist/assets/pwa-CAg_9zFs.js +1 -0
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-EY8hpFv8.js → quadrantDiagram-ABIIQ3AL-BegGcT3l.js} +1 -1
- package/dist/assets/radar-I7S5WNFK-uPku9RRq.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-DHnmbuIo.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-DiZs--Iw.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-Nr53gnNE.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-Cm_PuwJS.js +1 -0
- package/dist/assets/{railroadDiagram-RFXS5EU6-CNhcIeji.js → railroadDiagram-RFXS5EU6-B3yJ2yxE.js} +1 -1
- package/dist/assets/{refresh-cw-BlXDrVP0.js → refresh-cw-OhwaPDn1.js} +1 -1
- package/dist/assets/remote-DvCdHjzA.js +1 -0
- package/dist/assets/{requirementDiagram-TGXJPOKE-D8Dcs-Rt.js → requirementDiagram-TGXJPOKE-DtEyoEXG.js} +1 -1
- package/dist/assets/{rotate-cw-ei6rPD6z.js → rotate-cw-aBponvp7.js} +1 -1
- package/dist/assets/runtime-config-page-BF1wxvzR.js +1 -0
- package/dist/assets/{sankeyDiagram-HTMAVEWB-HTrb6aa-.js → sankeyDiagram-HTMAVEWB-h9AYS2UB.js} +1 -1
- package/dist/assets/{save-DdF-bXgC.js → save-394QCMXn.js} +1 -1
- package/dist/assets/search-BG2qAlNZ.js +1 -0
- package/dist/assets/search-config-page-D4LeiB9y.js +1 -0
- package/dist/assets/secrets-config-page-BzGcr5Vw.js +3 -0
- package/dist/assets/security-config-vD_V0BQF.js +1 -0
- package/dist/assets/select-xUXYV0Gr.js +1 -0
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-6f_4X16Y.js → sequenceDiagram-DBY2YBRQ-D-uxCkob.js} +1 -1
- package/dist/assets/service-apps-panel-D3wwPRzV.js +1 -0
- package/dist/assets/{settings-2-CrNhfInU.js → settings-2-CWOGRRaA.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-Ck9rsuwL.js → sizeCapture-X5ZJPWSS-DBzZytQo.js} +1 -1
- package/dist/assets/{src-C8AUg09O.js → src-zrGbZsfc.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-Cm33MLHu.js → stateDiagram-2N3HPSRC-DyDy7AHq.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-CtkpO6aA.js +1 -0
- package/dist/assets/{status-dot-C3SRFEta.js → status-dot-CYifnSnt.js} +1 -1
- package/dist/assets/{swimlanes-5IMT3BWC-B107vmvM.js → swimlanes-5IMT3BWC-BzOduS38.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-BSdi6mvi.js +8 -0
- package/dist/assets/tag-chip-CjM6lyeh.js +1 -0
- package/dist/assets/theme-provider-BToFZGZG.js +1 -0
- package/dist/assets/{timeline-definition-FHXFAJF6-CJEoAj33.js → timeline-definition-FHXFAJF6-CmgnEF2t.js} +1 -1
- package/dist/assets/trash-2-DvJ6duOW.js +1 -0
- package/dist/assets/treeView-QDETBFTQ-DBoqypPR.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-BMeL3P0q.js +1 -0
- package/dist/assets/use-config-COusaY5p.js +1 -0
- package/dist/assets/{use-desktop-capabilities-BYDjFlpt.js → use-desktop-capabilities-B-u6ojjW.js} +1 -1
- package/dist/assets/use-viewport-layout-IKKGpjzF.js +1 -0
- package/dist/assets/{vennDiagram-L72KCM5P-DzsUHk5I.js → vennDiagram-L72KCM5P-DwS7D2kg.js} +1 -1
- package/dist/assets/wardley-OPB4EBWU-Dqxe7zN6.js +1 -0
- package/dist/assets/{wardleyDiagram-EHGQE667-1NfFs5ua.js → wardleyDiagram-EHGQE667-B4X8OOL4.js} +1 -1
- package/dist/assets/x-E9VB4HQx.js +1 -0
- package/dist/assets/{xychartDiagram-FW5EYKEG-Ci8AI3Qo.js → xychartDiagram-FW5EYKEG-BjRQ_0nx.js} +1 -1
- package/dist/index.html +44 -106
- package/dist/panel-standalone.html +19 -13
- package/index.html +15 -66
- package/package.json +5 -5
- package/src/app/styles/design-system.css +85 -1
- package/src/app/styles/island-theme.css +8 -6
- package/src/features/agents/components/__tests__/agents-page.test.tsx +8 -5
- package/src/features/agents/components/agent-details-dialog.tsx +24 -18
- package/src/features/agents/components/agents-page.tsx +27 -38
- package/src/features/app-data/components/app-retained-data-section.tsx +4 -4
- package/src/features/apps/components/__tests__/app-marketplace-catalog.test.tsx +2 -2
- package/src/features/apps/components/__tests__/app-packages-panel.test.tsx +94 -23
- package/src/features/apps/components/__tests__/apps-panel.test.tsx +5 -3
- package/src/features/apps/components/app-document-access-section.tsx +17 -14
- package/src/features/apps/components/app-marketplace-catalog.tsx +69 -42
- package/src/features/apps/components/app-marketplace-cover.tsx +5 -2
- package/src/features/apps/components/app-marketplace-detail.tsx +20 -8
- package/src/features/apps/components/app-marketplace-operation.tsx +8 -3
- package/src/features/apps/components/app-marketplace-panel.tsx +168 -0
- package/src/features/apps/components/app-package-card.tsx +224 -147
- package/src/features/apps/components/app-package-details-dialog.tsx +103 -0
- package/src/features/apps/components/app-packages-panel.tsx +162 -147
- package/src/features/apps/components/apps-panel.tsx +43 -12
- package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +1 -1
- package/src/features/chat/components/conversation/chat-conversation-header.tsx +1 -1
- package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +2 -2
- package/src/features/chat/components/layout/chat-sidebar-utility-menu.tsx +9 -7
- package/src/features/chat/components/providers/chat-runtime.provider.tsx +1 -1
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-area.test.tsx +0 -1
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +13 -2
- package/src/features/chat/features/conversation/components/floating-session-conversation.tsx +2 -3
- package/src/features/chat/features/conversation/components/session-conversation-area.tsx +9 -1
- package/src/features/chat/features/conversation/components/session-conversation-input-top-slot.tsx +44 -0
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +4 -38
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-controller.test.tsx +86 -10
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-input-state.test.tsx +44 -1
- package/src/features/chat/features/conversation/hooks/use-session-conversation-controller.ts +85 -73
- package/src/features/chat/features/conversation/hooks/use-session-conversation-input-query.ts +5 -15
- package/src/features/chat/features/conversation/hooks/use-session-conversation-input-state.ts +53 -13
- package/src/features/chat/features/conversation/hooks/use-session-submission-recovery.ts +83 -0
- package/src/features/chat/features/conversation/types/session-conversation-input.types.ts +38 -0
- package/src/features/chat/features/input/utils/__tests__/ncp-chat-input-availability.utils.test.ts +1 -29
- package/src/features/chat/features/input/utils/ncp-chat-input-availability.utils.ts +1 -8
- package/src/features/chat/features/message/components/__tests__/chat-message-list-skill-preview.container.test.tsx +14 -1
- package/src/features/chat/features/message/hooks/use-chat-inline-token-actions.ts +7 -2
- package/src/features/chat/features/message/utils/chat-message-execution-summary.utils.ts +3 -0
- package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +1 -0
- package/src/features/chat/features/message/utils/chat-message-trigger-details.utils.ts +3 -0
- package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +1 -1
- package/src/features/chat/features/session/components/session-header/chat-session-metadata-dialog.tsx +1 -1
- package/src/features/chat/features/session/components/session-header/chat-session-project-badge.tsx +2 -2
- package/src/features/chat/features/session/utils/__tests__/chat-session-route.utils.test.ts +26 -0
- package/src/features/chat/features/session/utils/chat-session-preference-governance.utils.ts +14 -8
- package/src/features/chat/features/session/utils/chat-session-route.utils.ts +9 -12
- package/src/features/chat/features/welcome/components/__tests__/chat-welcome.test.tsx +31 -6
- package/src/features/chat/features/welcome/components/chat-conversation-welcome.tsx +13 -1
- package/src/features/chat/features/welcome/components/chat-welcome-agent-picker.tsx +1 -1
- package/src/features/chat/features/welcome/components/chat-welcome-project-picker.tsx +1 -1
- package/src/features/chat/features/welcome/components/chat-welcome-prompt-suggestions.tsx +56 -13
- package/src/features/chat/features/welcome/components/chat-welcome-session-type-picker.tsx +3 -3
- package/src/features/chat/features/welcome/components/chat-welcome.tsx +14 -4
- package/src/features/chat/features/welcome/utils/__tests__/chat-welcome-continuation.utils.test.ts +40 -0
- package/src/features/chat/features/welcome/utils/chat-welcome-continuation.utils.ts +21 -0
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.selection.test.tsx +14 -2
- package/src/features/chat/features/workspace/components/__tests__/session-cron-job-content.test.tsx +5 -1
- package/src/features/chat/features/workspace/components/chat-session-workspace-directory-browser.tsx +1 -1
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +3 -7
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +6 -5
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +27 -27
- package/src/features/chat/features/workspace/components/overview/chat-session-continuous-attention.tsx +11 -11
- package/src/features/chat/features/workspace/components/overview/chat-session-token-usage.tsx +15 -15
- package/src/features/chat/features/workspace/components/project-files/workspace-directory-tree.tsx +2 -2
- package/src/features/chat/features/workspace/components/project-files/workspace-new-folder-tree-item.tsx +1 -1
- package/src/features/chat/features/workspace/components/project-files/workspace-project-files-toolbar.tsx +2 -2
- package/src/features/chat/features/workspace/components/session-cron-job-content.tsx +13 -26
- package/src/features/chat/index.ts +1 -0
- package/src/features/chat/pages/__tests__/ncp-chat-page.test.ts +37 -47
- package/src/features/chat/pages/ncp-chat-page.tsx +3 -3
- package/src/features/chat/stores/__tests__/chat-composer-draft.store.test.ts +67 -1
- package/src/features/chat/stores/chat-composer-draft.store.ts +230 -29
- package/src/features/cron/components/__tests__/cron-config.test.tsx +8 -2
- package/src/features/cron/components/cron-config.tsx +6 -17
- package/src/features/cron/components/cron-job-detail-dialog.tsx +10 -9
- package/src/features/cron/components/cron-job-resource.tsx +51 -0
- package/src/features/cron/components/cron-job-row.tsx +5 -4
- package/src/features/cron/index.ts +1 -0
- package/src/features/desktop-capabilities/components/desktop-authorization-dialog.tsx +5 -5
- package/src/features/inbox/components/inbox-reader-dialog.test.tsx +46 -6
- package/src/features/inbox/components/inbox-reader-dialog.tsx +38 -29
- package/src/features/inbox/managers/inbox.manager.test.ts +28 -0
- package/src/features/inbox/managers/inbox.manager.ts +18 -4
- package/src/features/inbox/pages/inbox-page.test.ts +4 -2
- package/src/features/inbox/pages/inbox-page.tsx +14 -10
- package/src/features/marketplace/components/__tests__/marketplace-page-detail.test.tsx +1 -0
- package/src/features/marketplace/components/__tests__/marketplace-page.test.tsx +1 -0
- package/src/features/marketplace/components/mcp/__tests__/mcp-marketplace-page.test.tsx +2 -0
- package/src/features/marketplace/components/mcp/mcp-marketplace-card.tsx +2 -2
- package/src/features/marketplace/components/mcp/mcp-marketplace-page.tsx +23 -1
- package/src/features/marketplace/hooks/use-marketplace-item-detail.ts +11 -0
- package/src/features/panel-apps/components/panel-app-list-item.tsx +4 -3
- package/src/features/panel-apps/components/panel-app-service-action-authorization-dialog.tsx +2 -2
- package/src/features/panel-apps/index.ts +1 -0
- package/src/features/panel-apps/utils/panel-app-doc-browser.utils.tsx +5 -24
- package/src/features/projects/components/work/project-work-item-drawer.tsx +7 -10
- package/src/features/projects/components/work/project-work-items.tsx +1 -1
- package/src/features/projects/pages/project-home-page.tsx +18 -23
- package/src/features/projects/pages/projects-page.test.tsx +4 -1
- package/src/features/pwa/managers/__tests__/pwa-shell-theme.manager.test.ts +3 -3
- package/src/features/pwa/managers/pwa-shell-theme.manager.ts +8 -3
- package/src/features/right-panel-resources/components/__tests__/page-resource-icon.test.tsx +13 -2
- package/src/features/right-panel-resources/components/__tests__/system-object-resource.test.tsx +74 -6
- package/src/features/right-panel-resources/components/native-object-resource.tsx +134 -0
- package/src/features/right-panel-resources/components/page-resource-icon.tsx +16 -8
- package/src/features/right-panel-resources/components/system-object-resource.tsx +66 -1
- package/src/features/right-panel-resources/components/workspace-file-resource.tsx +9 -0
- package/src/features/right-panel-resources/configs/right-panel-resource-routes.config.ts +11 -21
- package/src/features/right-panel-resources/index.ts +3 -0
- package/src/features/right-panel-resources/managers/__tests__/page-resource.manager.test.ts +14 -4
- package/src/features/right-panel-resources/managers/page-resource.manager.ts +38 -21
- package/src/features/right-panel-resources/utils/__tests__/right-panel-resource-route-resolver.utils.test.ts +17 -0
- package/src/features/right-panel-resources/utils/right-panel-resource-uri.utils.ts +3 -2
- package/src/features/service-apps/components/service-action-row.tsx +4 -3
- package/src/features/service-apps/components/service-app-delete-dialog.tsx +2 -2
- package/src/features/service-apps/components/service-app-list-item.tsx +5 -4
- package/src/features/service-apps/components/service-apps-panel.tsx +5 -2
- package/src/features/settings/components/config/provider-model-suggestions-panel.tsx +1 -1
- package/src/features/settings/pages/providers-config-page.tsx +3 -2
- package/src/index.css +42 -8
- package/src/shared/components/doc-browser/__tests__/doc-browser-context.test.tsx +16 -0
- package/src/shared/components/doc-browser/__tests__/doc-browser.test.tsx +2 -2
- package/src/shared/components/doc-browser/__tests__/resource-link-interceptor.test.tsx +29 -1
- package/src/shared/components/doc-browser/doc-browser-tab-strip.tsx +2 -2
- package/src/shared/components/doc-browser/stores/doc-browser.store.ts +13 -7
- package/src/shared/components/doc-browser/utils/doc-browser-url.utils.ts +2 -1
- package/src/shared/components/path-picker/server-path-picker-dialog.tsx +5 -3
- package/src/shared/components/ui/__tests__/dialog.test.tsx +37 -1
- package/src/shared/components/ui/actions/action-feedback.ts +1 -8
- package/src/shared/components/ui/actions/icon-action-button.tsx +1 -1
- package/src/shared/components/ui/confirm-dialog.tsx +1 -2
- package/src/shared/components/ui/context-menu/context-menu-items.tsx +2 -2
- package/src/shared/components/ui/dialog.tsx +29 -7
- package/src/shared/components/ui/popover.tsx +14 -3
- package/src/shared/components/ui/skeleton.tsx +16 -2
- package/src/shared/components/ui/tab-strip/compact-tab-strip.tsx +2 -2
- package/src/shared/components/ui/tooltip.tsx +2 -1
- package/src/shared/components/workbench/__tests__/workbench-surface.test.tsx +21 -0
- package/src/shared/components/workbench/workbench-surface-toolbar.tsx +4 -0
- package/src/shared/components/workbench/workbench-surface.tsx +4 -1
- package/src/shared/lib/i18n/locales/en-US/chat.json +21 -7
- package/src/shared/lib/i18n/locales/en-US/core.json +5 -1
- package/src/shared/lib/i18n/locales/en-US/doc-browser.json +10 -5
- package/src/shared/lib/i18n/locales/en-US/inbox.json +1 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +21 -7
- package/src/shared/lib/i18n/locales/zh-CN/core.json +5 -1
- package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +11 -6
- package/src/shared/lib/i18n/locales/zh-CN/inbox.json +1 -0
- package/src/shared/lib/theme/index.test.ts +28 -1
- package/src/shared/lib/theme/index.ts +14 -3
- package/src/shared/lib/transport/__tests__/local-transport.service.test.ts +24 -0
- package/src/shared/lib/transport/local-transport.service.ts +8 -6
- package/dist/assets/account-panel-BAH7FW6z.js +0 -1
- package/dist/assets/api-DjiZvIa0.js +0 -20
- package/dist/assets/app-presenter-provider-CCRFsFYr.js +0 -232
- package/dist/assets/appearance-settings-page-CdP86QJ7.js +0 -1
- package/dist/assets/architecture-TIHT7OUA-CvnC-LeA.js +0 -1
- package/dist/assets/channel-CpMstUPF.js +0 -1
- package/dist/assets/channels-list-page-5qGagKuE.js +0 -8
- package/dist/assets/chunk-2Q5K7J3B-Djp3VF0s.js +0 -1
- package/dist/assets/chunk-VAUOI2AC-BrbiIC1Q.js +0 -1
- package/dist/assets/chunk-XXDRQBXY-Cx9N40wF.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-DFN1v3PQ.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-DRvglADa.js +0 -1
- package/dist/assets/config-split-page-CuEGQL8Z.js +0 -1
- package/dist/assets/confirm-dialog-CxfecBzO.js +0 -1
- package/dist/assets/context-menu-BsCj2fRs.js +0 -1
- package/dist/assets/cynefin-VYW2F7L2-DXUGnpJH.js +0 -1
- package/dist/assets/desktop-update-config-e-zhkJuS.js +0 -1
- package/dist/assets/dialog-QjQoKbIV.js +0 -5
- package/dist/assets/doc-browser-CLEdkH9z.js +0 -1
- package/dist/assets/doc-browser-context-DwgG6wrz.js +0 -1
- package/dist/assets/es2015-Bp6cuSGh.js +0 -41
- package/dist/assets/eventmodeling-45OFAUF4-ZBfVS3ZC.js +0 -1
- package/dist/assets/extensions-CgShSIkd.js +0 -1
- package/dist/assets/eye-kisejBFH.js +0 -1
- package/dist/assets/flowDiagram-23GEKE2U-CqdsKk6x.js +0 -1
- package/dist/assets/gitGraph-TEB2WS4Q-fHYFd9Es.js +0 -1
- package/dist/assets/info-DKCQHKI2-CSaOL_bb.js +0 -1
- package/dist/assets/katex-B4FQSo9k.js +0 -1
- package/dist/assets/keyboard-shortcuts-settings-page-DZ8A1iLg.js +0 -1
- package/dist/assets/loader-circle-Bd1fTm-x.js +0 -1
- package/dist/assets/login-page-D99JjH9F.js +0 -1
- package/dist/assets/main-Bt5r6b21.js +0 -2
- package/dist/assets/main-DXd_aKJV.css +0 -1
- package/dist/assets/main-i18n-catalog.config-D0Ll36J_.js +0 -1
- package/dist/assets/mcp-marketplace-page-DUoGfSmY.js +0 -1
- package/dist/assets/model-config-page-9NNf-mzK.js +0 -1
- package/dist/assets/packet-7NZHBO7P-D-YFTczs.js +0 -1
- package/dist/assets/panel-app-BYfQu_TS.js +0 -1
- package/dist/assets/panel-app-i18n-catalog.config-Ddf2Kv8A.js +0 -1
- package/dist/assets/panelStandalone-BRg7B1EI.css +0 -1
- package/dist/assets/panelStandalone-BaUzY8Wy.js +0 -2
- package/dist/assets/pie-RZYD4A2V-VEnYu9s5.js +0 -1
- package/dist/assets/privacy-settings-page-CVMBFuak.js +0 -1
- package/dist/assets/projects-BEsU3box.js +0 -1
- package/dist/assets/provider-models-Dm-pmWAA.js +0 -1
- package/dist/assets/provider-scoped-model-input-CzrXg4cX.js +0 -1
- package/dist/assets/providers-config-page-839uUADZ.js +0 -1
- package/dist/assets/puzzle-BGvD2DPZ.js +0 -1
- package/dist/assets/pwa-DNNK_8E9.js +0 -1
- package/dist/assets/radar-I7S5WNFK-BFNIekC1.js +0 -1
- package/dist/assets/railroad-3IZDKUUU-lVqJ3Hak.js +0 -1
- package/dist/assets/railroad-abnf-AHOZXSZD-DYaefdFC.js +0 -1
- package/dist/assets/railroad-ebnf-EBAXGLYW-CTAk6lVq.js +0 -1
- package/dist/assets/railroad-peg-LSFZ7HO6-Cob294tg.js +0 -1
- package/dist/assets/remote-B5qIuUbT.js +0 -1
- package/dist/assets/runtime-config-page-Bf-4JYxQ.js +0 -1
- package/dist/assets/search-config-page-C0qA3j-T.js +0 -1
- package/dist/assets/secrets-config-page-DxfZWpnk.js +0 -3
- package/dist/assets/security-config-CItfIQZ4.js +0 -1
- package/dist/assets/select-CWyjnar7.js +0 -1
- package/dist/assets/service-apps-panel-D3SOkRVv.js +0 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-BrNv-raG.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-ntcxaPXp.js +0 -8
- package/dist/assets/tag-chip-BIuavK2K.js +0 -1
- package/dist/assets/theme-provider-CWUz4yO9.js +0 -1
- package/dist/assets/trash-2-hAbJh9VZ.js +0 -1
- package/dist/assets/treeView-QDETBFTQ-DbFmr-gw.js +0 -1
- package/dist/assets/treemap-6X3UGDF4-C8aY96pi.js +0 -1
- package/dist/assets/use-config-evzage09.js +0 -1
- package/dist/assets/use-viewport-layout-D_9XWGDV.js +0 -1
- package/dist/assets/wardley-OPB4EBWU-D8d6DbbJ.js +0 -1
- package/dist/assets/x-ChPbNv39.js +0 -1
- package/src/features/apps/components/app-marketplace-dialog.tsx +0 -168
- /package/dist/assets/{array-BV9OtnO8.js → array-DsNX3jRj.js} +0 -0
- /package/dist/assets/{chunk-KEIR6QF5-Cx-8EJ4_.js → chunk-KEIR6QF5-BOAXXeyv.js} +0 -0
- /package/dist/assets/{chunk-Y2CYZVJY-Dy1ufvjf.js → chunk-Y2CYZVJY-CHjSjwoV.js} +0 -0
- /package/dist/assets/{config-hints-DbmiyTKg.js → config-hints-CaB3I7KP.js} +0 -0
- /package/dist/assets/{cytoscape.esm-CSCjuT4Z.js → cytoscape.esm-j4J9a91l.js} +0 -0
- /package/dist/assets/{defaultLocale-DWTiNsbT.js → defaultLocale-Bmxjp-V_.js} +0 -0
- /package/dist/assets/{dist-BVCSkfWY.js → dist-DwLj1Wg5.js} +0 -0
- /package/dist/assets/{graphlib-B1yb1Wl8.js → graphlib-CC0HTn1v.js} +0 -0
- /package/dist/assets/{host-capabilities-DuIFVsvM.js → host-capabilities-B107nwS3.js} +0 -0
- /package/dist/assets/{init-BF6GH5oe.js → init-Biz9Rus1.js} +0 -0
- /package/dist/assets/{jszip.min-D12teKzP.js → jszip.min-DQvBVV_R.js} +0 -0
- /package/dist/assets/{katex-CsAM73R9.js → katex-BzT-4KBu.js} +0 -0
- /package/dist/assets/{navigation-history-CzErJuPG.js → navigation-history-CCnxsAKR.js} +0 -0
- /package/dist/assets/{path-C56XkznJ.js → path-4azsBPZv.js} +0 -0
- /package/dist/assets/{preload-helper-ca-nBW7U.js → preload-helper-DWTEM3RW.js} +0 -0
- /package/dist/assets/{rough.esm-CGfeEbtE.js → rough.esm-w1lBArN6.js} +0 -0
- /package/dist/assets/{xlsx-sds5nUpL.js → xlsx--SB9KlFl.js} +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ACTION_FEEDBACK, ACTION_MENU_ITEM_CLASS } from '@/shared/components/ui/actions/action-feedback';
|
|
2
|
+
import { Trash2 } from 'lucide-react';
|
|
1
3
|
import { useState } from "react";
|
|
2
4
|
import {
|
|
3
5
|
CalendarClock,
|
|
@@ -9,9 +11,11 @@ import {
|
|
|
9
11
|
} from "lucide-react";
|
|
10
12
|
|
|
11
13
|
import {
|
|
12
|
-
CronJobDetailDialog,
|
|
13
14
|
useCronJobActions,
|
|
14
15
|
} from "@/features/cron";
|
|
16
|
+
import { useAppPresenter } from "@/app/components/app-presenter-provider";
|
|
17
|
+
import { useNavigate } from "react-router-dom";
|
|
18
|
+
import { pageResourceFromSystemObject } from "@/features/right-panel-resources";
|
|
15
19
|
import type { CronJobView } from "@/shared/lib/api";
|
|
16
20
|
import { Button } from "@/shared/components/ui/button";
|
|
17
21
|
import {
|
|
@@ -181,7 +185,7 @@ function SessionCronJobCard({
|
|
|
181
185
|
</TooltipTrigger>
|
|
182
186
|
<TooltipContent>{t("cronMoreActions")}</TooltipContent>
|
|
183
187
|
</Tooltip>
|
|
184
|
-
<PopoverContent align="end" sideOffset={4}
|
|
188
|
+
<PopoverContent align="end" sideOffset={4} variant="menu">
|
|
185
189
|
<button
|
|
186
190
|
type="button"
|
|
187
191
|
disabled={isPending}
|
|
@@ -189,9 +193,9 @@ function SessionCronJobCard({
|
|
|
189
193
|
setMenuOpen(false);
|
|
190
194
|
void cronActions.runJob(job);
|
|
191
195
|
}}
|
|
192
|
-
className=
|
|
196
|
+
className={`${ACTION_MENU_ITEM_CLASS} text-foreground ${ACTION_FEEDBACK.item}`}
|
|
193
197
|
>
|
|
194
|
-
<Play className="h-
|
|
198
|
+
<Play className="h-4 w-4 shrink-0 text-muted-foreground" />
|
|
195
199
|
{t("cronRunNow")}
|
|
196
200
|
</button>
|
|
197
201
|
<button
|
|
@@ -201,8 +205,9 @@ function SessionCronJobCard({
|
|
|
201
205
|
setMenuOpen(false);
|
|
202
206
|
void cronActions.deleteJob(job);
|
|
203
207
|
}}
|
|
204
|
-
className=
|
|
208
|
+
className={`${ACTION_MENU_ITEM_CLASS} ${ACTION_FEEDBACK.destructive}`}
|
|
205
209
|
>
|
|
210
|
+
<Trash2 className="h-4 w-4 shrink-0" />
|
|
206
211
|
{t("delete")}
|
|
207
212
|
</button>
|
|
208
213
|
</PopoverContent>
|
|
@@ -224,9 +229,9 @@ export function SessionCronJobContent({
|
|
|
224
229
|
readonly isLoading?: boolean;
|
|
225
230
|
readonly onRetry?: () => void;
|
|
226
231
|
}) {
|
|
227
|
-
const
|
|
232
|
+
const app = useAppPresenter();
|
|
233
|
+
const navigate = useNavigate();
|
|
228
234
|
const cronActions = useCronJobActions();
|
|
229
|
-
const selectedJob = jobs.find((job) => job.id === selectedJobId) ?? null;
|
|
230
235
|
|
|
231
236
|
return (
|
|
232
237
|
<div className="h-full overflow-y-auto custom-scrollbar px-4 py-4">
|
|
@@ -268,29 +273,11 @@ export function SessionCronJobContent({
|
|
|
268
273
|
key={job.id}
|
|
269
274
|
cronActions={cronActions}
|
|
270
275
|
job={job}
|
|
271
|
-
onOpenDetails={(item) =>
|
|
276
|
+
onOpenDetails={(item) => app.pageResourceManager.open(pageResourceFromSystemObject("cron-job", item.id, item.name || item.id), "default", navigate)}
|
|
272
277
|
/>
|
|
273
278
|
))}
|
|
274
279
|
</div>
|
|
275
280
|
)}
|
|
276
|
-
<CronJobDetailDialog
|
|
277
|
-
job={selectedJob}
|
|
278
|
-
open={Boolean(selectedJob)}
|
|
279
|
-
onOpenChange={(open) => {
|
|
280
|
-
if (!open) {
|
|
281
|
-
setSelectedJobId(null);
|
|
282
|
-
}
|
|
283
|
-
}}
|
|
284
|
-
onDelete={(job) => {
|
|
285
|
-
void cronActions.deleteJob(job, () => setSelectedJobId(null));
|
|
286
|
-
}}
|
|
287
|
-
onRun={(job) => {
|
|
288
|
-
void cronActions.runJob(job);
|
|
289
|
-
}}
|
|
290
|
-
onToggle={(job, enabled) => {
|
|
291
|
-
void cronActions.toggleJob(job, enabled);
|
|
292
|
-
}}
|
|
293
|
-
/>
|
|
294
281
|
<cronActions.ConfirmDialog />
|
|
295
282
|
</div>
|
|
296
283
|
);
|
|
@@ -39,3 +39,4 @@ export { ChatSessionWorkspaceFilePreview } from './features/workspace/components
|
|
|
39
39
|
export { createWorkspaceFileTab, createWorkspaceFileViewerTab } from './features/workspace/utils/chat-workspace-file-tab.utils';
|
|
40
40
|
export { WORKSPACE_FILE_PANEL_KIND, resolveFileResourceTarget, createWorkspaceFilePanelTarget, readWorkspaceFilePanelView } from './features/workspace/utils/workspace-file-panel-route.utils';
|
|
41
41
|
export { resolveAlternateWorkspaceFileViewer } from './features/workspace/utils/chat-workspace-file-viewer.utils';
|
|
42
|
+
export { WORKSPACE_TEXT_EXCERPT_MAX_CHARACTERS, type WorkspaceTextExcerpt } from './features/workspace/utils/workspace-text-excerpt.utils';
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import type { SessionEntryView, ThinkingLevel } from '@/shared/lib/api';
|
|
8
8
|
import type { ChatModelOption } from '@/features/chat/types/chat-input.types';
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
resolveRecentSessionPreferenceSnapshot,
|
|
11
11
|
resolveSelectedModelValue,
|
|
12
12
|
resolveSelectedThinkingLevelValue
|
|
13
13
|
} from '@/features/chat/features/session/utils/chat-session-preference-governance.utils';
|
|
@@ -461,50 +461,54 @@ describe('shouldClearPendingProjectRootOverride', () => {
|
|
|
461
461
|
});
|
|
462
462
|
});
|
|
463
463
|
|
|
464
|
-
describe('
|
|
465
|
-
it('returns the
|
|
464
|
+
describe('resolveRecentSessionPreferenceSnapshot', () => {
|
|
465
|
+
it('returns the model and thinking level from the same recent runtime session', () => {
|
|
466
466
|
const sessions = [
|
|
467
467
|
createSession({
|
|
468
468
|
key: 'native-1',
|
|
469
469
|
sessionType: 'native',
|
|
470
470
|
preferredModel: 'anthropic/claude-sonnet-4',
|
|
471
|
+
preferredThinking: 'low',
|
|
471
472
|
updatedAt: '2026-03-18T01:00:00.000Z'
|
|
472
473
|
}),
|
|
473
474
|
createSession({
|
|
474
475
|
key: 'codex-1',
|
|
475
476
|
sessionType: 'codex',
|
|
476
477
|
preferredModel: 'openai/gpt-5',
|
|
478
|
+
preferredThinking: 'high',
|
|
477
479
|
updatedAt: '2026-03-18T03:00:00.000Z'
|
|
478
480
|
}),
|
|
479
481
|
createSession({
|
|
480
482
|
key: 'codex-2',
|
|
481
483
|
sessionType: 'codex',
|
|
482
484
|
preferredModel: 'anthropic/claude-sonnet-4',
|
|
485
|
+
preferredThinking: 'medium',
|
|
483
486
|
updatedAt: '2026-03-18T02:00:00.000Z'
|
|
484
487
|
})
|
|
485
488
|
];
|
|
486
489
|
|
|
487
490
|
expect(
|
|
488
|
-
|
|
491
|
+
resolveRecentSessionPreferenceSnapshot({
|
|
489
492
|
sessions,
|
|
490
493
|
selectedSessionKey: 'draft',
|
|
491
|
-
sessionType: 'codex'
|
|
492
|
-
readPreference: (session) => session.preferredModel?.trim() || undefined
|
|
494
|
+
sessionType: 'codex'
|
|
493
495
|
})
|
|
494
|
-
).
|
|
496
|
+
).toEqual({ model: 'openai/gpt-5', thinking: 'high' });
|
|
495
497
|
});
|
|
496
498
|
|
|
497
|
-
it('ignores the
|
|
499
|
+
it('ignores the current session and does not borrow thinking from an older model', () => {
|
|
498
500
|
const sessions = [
|
|
499
501
|
createSession({
|
|
500
502
|
key: 'codex-current',
|
|
501
503
|
sessionType: 'codex',
|
|
502
504
|
preferredModel: 'openai/gpt-5',
|
|
505
|
+
preferredThinking: 'high',
|
|
503
506
|
updatedAt: '2026-03-18T03:00:00.000Z'
|
|
504
507
|
}),
|
|
505
508
|
createSession({
|
|
506
|
-
key: 'codex-
|
|
509
|
+
key: 'codex-thinking-only',
|
|
507
510
|
sessionType: 'codex',
|
|
511
|
+
preferredThinking: 'high',
|
|
508
512
|
updatedAt: '2026-03-18T04:00:00.000Z'
|
|
509
513
|
}),
|
|
510
514
|
createSession({
|
|
@@ -512,17 +516,37 @@ describe('resolveRecentSessionPreferredModel', () => {
|
|
|
512
516
|
sessionType: 'codex',
|
|
513
517
|
preferredModel: 'anthropic/claude-sonnet-4',
|
|
514
518
|
updatedAt: '2026-03-18T02:00:00.000Z'
|
|
519
|
+
}),
|
|
520
|
+
createSession({
|
|
521
|
+
key: 'codex-older-thinking',
|
|
522
|
+
sessionType: 'codex',
|
|
523
|
+
preferredModel: 'openai/gpt-5',
|
|
524
|
+
preferredThinking: 'medium',
|
|
525
|
+
updatedAt: '2026-03-18T01:00:00.000Z'
|
|
515
526
|
})
|
|
516
527
|
];
|
|
517
528
|
|
|
518
529
|
expect(
|
|
519
|
-
|
|
530
|
+
resolveRecentSessionPreferenceSnapshot({
|
|
520
531
|
sessions,
|
|
521
532
|
selectedSessionKey: 'codex-current',
|
|
522
|
-
sessionType: 'codex'
|
|
523
|
-
readPreference: (session) => session.preferredModel?.trim() || undefined
|
|
533
|
+
sessionType: 'codex'
|
|
524
534
|
})
|
|
525
|
-
).
|
|
535
|
+
).toEqual({ model: 'anthropic/claude-sonnet-4' });
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
it('returns no fallback when the runtime has no persisted model', () => {
|
|
539
|
+
expect(
|
|
540
|
+
resolveRecentSessionPreferenceSnapshot({
|
|
541
|
+
sessions: [createSession({
|
|
542
|
+
key: 'codex-thinking-only',
|
|
543
|
+
sessionType: 'codex',
|
|
544
|
+
preferredThinking: 'high'
|
|
545
|
+
})],
|
|
546
|
+
selectedSessionKey: 'draft',
|
|
547
|
+
sessionType: 'codex'
|
|
548
|
+
})
|
|
549
|
+
).toBeUndefined();
|
|
526
550
|
});
|
|
527
551
|
});
|
|
528
552
|
|
|
@@ -587,37 +611,3 @@ describe('resolveSelectedThinkingLevelValue', () => {
|
|
|
587
611
|
).toBe('medium');
|
|
588
612
|
});
|
|
589
613
|
});
|
|
590
|
-
|
|
591
|
-
describe('resolveRecentSessionPreferredThinking', () => {
|
|
592
|
-
it('returns the most recent preferred thinking from the same runtime', () => {
|
|
593
|
-
const sessions = [
|
|
594
|
-
createSession({
|
|
595
|
-
key: 'native-1',
|
|
596
|
-
sessionType: 'native',
|
|
597
|
-
preferredThinking: 'low',
|
|
598
|
-
updatedAt: '2026-03-18T01:00:00.000Z'
|
|
599
|
-
}),
|
|
600
|
-
createSession({
|
|
601
|
-
key: 'codex-1',
|
|
602
|
-
sessionType: 'codex',
|
|
603
|
-
preferredThinking: 'high',
|
|
604
|
-
updatedAt: '2026-03-18T03:00:00.000Z'
|
|
605
|
-
}),
|
|
606
|
-
createSession({
|
|
607
|
-
key: 'codex-2',
|
|
608
|
-
sessionType: 'codex',
|
|
609
|
-
preferredThinking: 'medium',
|
|
610
|
-
updatedAt: '2026-03-18T02:00:00.000Z'
|
|
611
|
-
})
|
|
612
|
-
];
|
|
613
|
-
|
|
614
|
-
expect(
|
|
615
|
-
resolveRecentSessionPreferredValue<ThinkingLevel>({
|
|
616
|
-
sessions,
|
|
617
|
-
selectedSessionKey: 'draft',
|
|
618
|
-
sessionType: 'codex',
|
|
619
|
-
readPreference: (session) => session.preferredThinking ?? undefined
|
|
620
|
-
})
|
|
621
|
-
).toBe('high');
|
|
622
|
-
});
|
|
623
|
-
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLocation } from "react-router-dom";
|
|
2
2
|
import {
|
|
3
3
|
ChatPageLayout,
|
|
4
4
|
type ChatPageProps,
|
|
@@ -10,9 +10,9 @@ import { useUiShowContentEvent } from "@/features/chat/features/ncp/hooks/use-ui
|
|
|
10
10
|
|
|
11
11
|
export function NcpChatPage({ view }: ChatPageProps) {
|
|
12
12
|
const presenter = usePresenter();
|
|
13
|
-
const {
|
|
13
|
+
const { pathname } = useLocation();
|
|
14
14
|
useChatSessionSync({
|
|
15
|
-
routeSessionKey: parseSessionKeyFromRoute(
|
|
15
|
+
routeSessionKey: parseSessionKeyFromRoute(pathname.startsWith('/chat/') ? pathname.slice('/chat/'.length) : undefined),
|
|
16
16
|
syncRouteSessionSelection: presenter.chatSessionListManager.syncRouteSessionSelection,
|
|
17
17
|
});
|
|
18
18
|
useUiShowContentEvent();
|
|
@@ -26,7 +26,73 @@ const EMPTY_DRAFT: ChatComposerDraftSnapshot = {
|
|
|
26
26
|
describe('chat composer draft store', () => {
|
|
27
27
|
beforeEach(() => {
|
|
28
28
|
window.localStorage.clear();
|
|
29
|
-
useChatComposerDraftStore.setState({ drafts: {} });
|
|
29
|
+
useChatComposerDraftStore.setState({ drafts: {}, submissions: {}, recentSubmittedNodes: {} });
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const submittedNodes = [{ id: 'text-1', type: 'text' as const, text: 'sent text' }];
|
|
33
|
+
const submission = {
|
|
34
|
+
envelope: {
|
|
35
|
+
sessionId: 'session-a',
|
|
36
|
+
idempotencyKey: 'user-one',
|
|
37
|
+
message: {
|
|
38
|
+
id: 'user-one', sessionId: 'session-a', role: 'user' as const,
|
|
39
|
+
status: 'final' as const, timestamp: '2026-09-24T00:00:00.000Z',
|
|
40
|
+
parts: [{ type: 'text' as const, text: 'sent text' }],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
composer: { text: 'sent text', nodes: submittedNodes, attachments: [], selectedSkills: [], skillRecords: [] },
|
|
44
|
+
status: 'sending' as const,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
it('keeps submitted text out of the draft across late editor updates and acceptance', () => {
|
|
48
|
+
const store = useChatComposerDraftStore.getState();
|
|
49
|
+
const key = 'session:session-a';
|
|
50
|
+
store.updateDraft(key, EMPTY_DRAFT, (draft) => ({ ...draft, ...submission.composer }));
|
|
51
|
+
store.beginSubmission(key, EMPTY_DRAFT, submission);
|
|
52
|
+
expect(useChatComposerDraftStore.getState().drafts[key]?.text).toBe('');
|
|
53
|
+
store.updateDraft(key, EMPTY_DRAFT, (draft) => ({
|
|
54
|
+
...draft, nodes: [{ ...submittedNodes[0]!, text: '' }], text: '',
|
|
55
|
+
}));
|
|
56
|
+
store.updateDraft(key, EMPTY_DRAFT, (draft) => ({ ...draft, ...submission.composer }));
|
|
57
|
+
expect(useChatComposerDraftStore.getState().drafts[key]?.text).toBe('');
|
|
58
|
+
store.acceptSubmission(key, 'user-one');
|
|
59
|
+
store.updateDraft(key, EMPTY_DRAFT, (draft) => ({ ...draft, ...submission.composer }));
|
|
60
|
+
expect(useChatComposerDraftStore.getState().drafts[key]?.text).toBe('');
|
|
61
|
+
store.updateDraft(key, EMPTY_DRAFT, (draft) => ({
|
|
62
|
+
...draft, text: 'new input', nodes: [{ ...submittedNodes[0]!, text: 'new input' }],
|
|
63
|
+
}));
|
|
64
|
+
expect(useChatComposerDraftStore.getState().drafts[key]?.text).toBe('new input');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('persists an interrupted send separately from the composer draft', async () => {
|
|
68
|
+
const store = useChatComposerDraftStore.getState();
|
|
69
|
+
const key = 'session:session-a';
|
|
70
|
+
store.beginSubmission(key, EMPTY_DRAFT, submission);
|
|
71
|
+
const persisted = window.localStorage.getItem(STORAGE_KEY)!;
|
|
72
|
+
useChatComposerDraftStore.setState({ drafts: {}, submissions: {}, recentSubmittedNodes: {} });
|
|
73
|
+
window.localStorage.setItem(STORAGE_KEY, persisted);
|
|
74
|
+
await useChatComposerDraftStore.persist.rehydrate();
|
|
75
|
+
const restored = useChatComposerDraftStore.getState();
|
|
76
|
+
expect(restored.drafts[key]?.text).toBe('');
|
|
77
|
+
expect(restored.submissions[key]?.status).toBe('uncertain');
|
|
78
|
+
expect(restored.submissions[key]?.envelope.message.id).toBe('user-one');
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('restores a rejected send only when it cannot overwrite newer input', () => {
|
|
82
|
+
const store = useChatComposerDraftStore.getState();
|
|
83
|
+
const key = 'session:session-a';
|
|
84
|
+
store.beginSubmission(key, EMPTY_DRAFT, submission);
|
|
85
|
+
store.failSubmission(key, 'user-one', 'rejected', 'rejected');
|
|
86
|
+
expect(useChatComposerDraftStore.getState().drafts[key]?.text).toBe('sent text');
|
|
87
|
+
expect(useChatComposerDraftStore.getState().submissions[key]).toBeUndefined();
|
|
88
|
+
|
|
89
|
+
store.beginSubmission(key, EMPTY_DRAFT, submission);
|
|
90
|
+
store.updateDraft(key, EMPTY_DRAFT, (draft) => ({
|
|
91
|
+
...draft, text: 'new input', nodes: [{ ...submittedNodes[0]!, text: 'new input' }],
|
|
92
|
+
}));
|
|
93
|
+
store.failSubmission(key, 'user-one', 'rejected', 'rejected');
|
|
94
|
+
expect(useChatComposerDraftStore.getState().drafts[key]?.text).toBe('new input');
|
|
95
|
+
expect(useChatComposerDraftStore.getState().submissions[key]?.status).toBe('rejected');
|
|
30
96
|
});
|
|
31
97
|
|
|
32
98
|
it('uses one fixed partition for the uncreated session', () => {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { ChatComposerNode } from
|
|
2
|
-
import type { NcpDraftAttachment } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ChatComposerNode } from "@nextclaw/agent-chat-ui";
|
|
2
|
+
import type { NcpDraftAttachment } from "@nextclaw/ncp-react";
|
|
3
|
+
import type { NcpAgentSendEnvelope } from "@nextclaw/ncp";
|
|
4
|
+
import { create, type StoreApi } from "zustand";
|
|
5
|
+
import { createJSONStorage, persist } from "zustand/middleware";
|
|
5
6
|
|
|
6
|
-
import type { ThinkingLevel } from
|
|
7
|
+
import type { ThinkingLevel } from "@/shared/lib/api";
|
|
7
8
|
|
|
8
|
-
export const CHAT_NEW_SESSION_DRAFT_KEY =
|
|
9
|
+
export const CHAT_NEW_SESSION_DRAFT_KEY = "new-session";
|
|
9
10
|
|
|
10
11
|
type ChatComposerDraftSkillSelection = {
|
|
11
12
|
readonly ref: string;
|
|
@@ -26,21 +27,57 @@ export type ChatComposerDraftSnapshot = {
|
|
|
26
27
|
readonly sendError: string | null;
|
|
27
28
|
};
|
|
28
29
|
|
|
30
|
+
export type ChatComposerSubmission = {
|
|
31
|
+
readonly envelope: NcpAgentSendEnvelope;
|
|
32
|
+
readonly composer: Pick<
|
|
33
|
+
ChatComposerDraftSnapshot,
|
|
34
|
+
"text" | "nodes" | "selectedSkills" | "skillRecords" | "attachments"
|
|
35
|
+
>;
|
|
36
|
+
readonly status: "sending" | "uncertain" | "rejected";
|
|
37
|
+
};
|
|
38
|
+
|
|
29
39
|
type ChatComposerDraftStore = {
|
|
30
40
|
drafts: Record<string, ChatComposerDraftSnapshot>;
|
|
31
|
-
|
|
41
|
+
submissions: Record<string, ChatComposerSubmission>;
|
|
42
|
+
recentSubmittedNodes: Record<string, string>;
|
|
43
|
+
ensureDraft: (
|
|
44
|
+
draftKey: string,
|
|
45
|
+
initialSnapshot: ChatComposerDraftSnapshot,
|
|
46
|
+
) => void;
|
|
32
47
|
updateDraft: (
|
|
33
48
|
draftKey: string,
|
|
34
49
|
initialSnapshot: ChatComposerDraftSnapshot,
|
|
35
|
-
update: (
|
|
36
|
-
snapshot: ChatComposerDraftSnapshot,
|
|
37
|
-
) => ChatComposerDraftSnapshot,
|
|
50
|
+
update: (snapshot: ChatComposerDraftSnapshot) => ChatComposerDraftSnapshot,
|
|
38
51
|
) => void;
|
|
52
|
+
beginSubmission: (
|
|
53
|
+
draftKey: string,
|
|
54
|
+
initialSnapshot: ChatComposerDraftSnapshot,
|
|
55
|
+
submission: ChatComposerSubmission,
|
|
56
|
+
) => void;
|
|
57
|
+
acceptSubmission: (draftKey: string, messageId: string) => void;
|
|
58
|
+
failSubmission: (
|
|
59
|
+
draftKey: string,
|
|
60
|
+
messageId: string,
|
|
61
|
+
status: "uncertain" | "rejected",
|
|
62
|
+
message: string,
|
|
63
|
+
) => void;
|
|
64
|
+
restoreSubmission: (draftKey: string, messageId: string) => void;
|
|
65
|
+
discardSubmission: (draftKey: string, messageId: string) => void;
|
|
39
66
|
};
|
|
40
67
|
|
|
41
|
-
const CHAT_COMPOSER_DRAFT_STORAGE_KEY =
|
|
68
|
+
const CHAT_COMPOSER_DRAFT_STORAGE_KEY = "nextclaw.chat.composer-drafts";
|
|
42
69
|
const CHAT_COMPOSER_DRAFT_STORAGE_VERSION = 1;
|
|
43
70
|
|
|
71
|
+
const isComposerEmpty = (draft: ChatComposerDraftSnapshot): boolean =>
|
|
72
|
+
draft.attachments.length === 0 &&
|
|
73
|
+
draft.selectedSkills.length === 0 &&
|
|
74
|
+
!draft.text.trim();
|
|
75
|
+
|
|
76
|
+
const restoreComposer = (
|
|
77
|
+
draft: ChatComposerDraftSnapshot,
|
|
78
|
+
submission: ChatComposerSubmission,
|
|
79
|
+
): ChatComposerDraftSnapshot => ({ ...draft, ...submission.composer });
|
|
80
|
+
|
|
44
81
|
export function resolveChatComposerDraftKey(sessionKey: string | null): string {
|
|
45
82
|
const normalizedSessionKey = sessionKey?.trim();
|
|
46
83
|
return normalizedSessionKey
|
|
@@ -48,28 +85,180 @@ export function resolveChatComposerDraftKey(sessionKey: string | null): string {
|
|
|
48
85
|
: CHAT_NEW_SESSION_DRAFT_KEY;
|
|
49
86
|
}
|
|
50
87
|
|
|
88
|
+
class ChatComposerDraftActions {
|
|
89
|
+
constructor(
|
|
90
|
+
private readonly set: StoreApi<ChatComposerDraftStore>["setState"],
|
|
91
|
+
) {}
|
|
92
|
+
|
|
93
|
+
ensureDraft: ChatComposerDraftStore["ensureDraft"] = (
|
|
94
|
+
draftKey,
|
|
95
|
+
initialSnapshot,
|
|
96
|
+
) => {
|
|
97
|
+
this.set((state) =>
|
|
98
|
+
state.drafts[draftKey]
|
|
99
|
+
? state
|
|
100
|
+
: {
|
|
101
|
+
drafts: {
|
|
102
|
+
...state.drafts,
|
|
103
|
+
[draftKey]: initialSnapshot,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
updateDraft: ChatComposerDraftStore["updateDraft"] = (
|
|
110
|
+
draftKey,
|
|
111
|
+
initialSnapshot,
|
|
112
|
+
update,
|
|
113
|
+
) => {
|
|
114
|
+
this.set((state) => {
|
|
115
|
+
const current = state.drafts[draftKey] ?? initialSnapshot;
|
|
116
|
+
const next = update(current);
|
|
117
|
+
const submittedNodes = state.recentSubmittedNodes[draftKey];
|
|
118
|
+
if (
|
|
119
|
+
submittedNodes &&
|
|
120
|
+
isComposerEmpty(current) &&
|
|
121
|
+
!isComposerEmpty(next) &&
|
|
122
|
+
JSON.stringify(next.nodes) === submittedNodes
|
|
123
|
+
) {
|
|
124
|
+
return state;
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
drafts: { ...state.drafts, [draftKey]: next },
|
|
128
|
+
recentSubmittedNodes:
|
|
129
|
+
submittedNodes && !isComposerEmpty(next)
|
|
130
|
+
? Object.fromEntries(
|
|
131
|
+
Object.entries(state.recentSubmittedNodes).filter(
|
|
132
|
+
([key]) => key !== draftKey,
|
|
133
|
+
),
|
|
134
|
+
)
|
|
135
|
+
: state.recentSubmittedNodes,
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
beginSubmission: ChatComposerDraftStore["beginSubmission"] = (
|
|
141
|
+
draftKey,
|
|
142
|
+
initialSnapshot,
|
|
143
|
+
submission,
|
|
144
|
+
) => {
|
|
145
|
+
this.set((state) => ({
|
|
146
|
+
drafts: {
|
|
147
|
+
...state.drafts,
|
|
148
|
+
[draftKey]: {
|
|
149
|
+
...(state.drafts[draftKey] ?? initialSnapshot),
|
|
150
|
+
text: "",
|
|
151
|
+
nodes: [],
|
|
152
|
+
selectedSkills: [],
|
|
153
|
+
skillRecords: [],
|
|
154
|
+
attachments: [],
|
|
155
|
+
sendError: null,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
submissions: { ...state.submissions, [draftKey]: submission },
|
|
159
|
+
recentSubmittedNodes: {
|
|
160
|
+
...state.recentSubmittedNodes,
|
|
161
|
+
[draftKey]: JSON.stringify(submission.composer.nodes),
|
|
162
|
+
},
|
|
163
|
+
}));
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
acceptSubmission: ChatComposerDraftStore["acceptSubmission"] = (
|
|
167
|
+
draftKey,
|
|
168
|
+
messageId,
|
|
169
|
+
) => {
|
|
170
|
+
this.set((state) => {
|
|
171
|
+
if (state.submissions[draftKey]?.envelope.message.id !== messageId)
|
|
172
|
+
return state;
|
|
173
|
+
const submissions = { ...state.submissions };
|
|
174
|
+
delete submissions[draftKey];
|
|
175
|
+
return { submissions };
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
failSubmission: ChatComposerDraftStore["failSubmission"] = (
|
|
180
|
+
draftKey,
|
|
181
|
+
messageId,
|
|
182
|
+
status,
|
|
183
|
+
message,
|
|
184
|
+
) => {
|
|
185
|
+
this.set((state) => {
|
|
186
|
+
const submission = state.submissions[draftKey];
|
|
187
|
+
if (!submission || submission.envelope.message.id !== messageId)
|
|
188
|
+
return state;
|
|
189
|
+
const draft = state.drafts[draftKey];
|
|
190
|
+
if (!draft) return state;
|
|
191
|
+
const shouldRestore = status === "rejected" && isComposerEmpty(draft);
|
|
192
|
+
const submissions = { ...state.submissions };
|
|
193
|
+
if (shouldRestore) delete submissions[draftKey];
|
|
194
|
+
else submissions[draftKey] = { ...submission, status };
|
|
195
|
+
const recentSubmittedNodes = { ...state.recentSubmittedNodes };
|
|
196
|
+
if (shouldRestore) delete recentSubmittedNodes[draftKey];
|
|
197
|
+
return {
|
|
198
|
+
submissions,
|
|
199
|
+
recentSubmittedNodes,
|
|
200
|
+
drafts: {
|
|
201
|
+
...state.drafts,
|
|
202
|
+
[draftKey]: {
|
|
203
|
+
...(shouldRestore ? restoreComposer(draft, submission) : draft),
|
|
204
|
+
sendError: message,
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
restoreSubmission: ChatComposerDraftStore["restoreSubmission"] = (
|
|
212
|
+
draftKey,
|
|
213
|
+
messageId,
|
|
214
|
+
) => {
|
|
215
|
+
this.set((state) => {
|
|
216
|
+
const submission = state.submissions[draftKey];
|
|
217
|
+
const draft = state.drafts[draftKey];
|
|
218
|
+
if (
|
|
219
|
+
!submission ||
|
|
220
|
+
submission.status !== "rejected" ||
|
|
221
|
+
submission.envelope.message.id !== messageId ||
|
|
222
|
+
!draft ||
|
|
223
|
+
!isComposerEmpty(draft)
|
|
224
|
+
)
|
|
225
|
+
return state;
|
|
226
|
+
const submissions = { ...state.submissions };
|
|
227
|
+
delete submissions[draftKey];
|
|
228
|
+
const recentSubmittedNodes = { ...state.recentSubmittedNodes };
|
|
229
|
+
delete recentSubmittedNodes[draftKey];
|
|
230
|
+
return {
|
|
231
|
+
submissions,
|
|
232
|
+
recentSubmittedNodes,
|
|
233
|
+
drafts: {
|
|
234
|
+
...state.drafts,
|
|
235
|
+
[draftKey]: restoreComposer(draft, submission),
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
discardSubmission: ChatComposerDraftStore["discardSubmission"] = (
|
|
242
|
+
draftKey,
|
|
243
|
+
messageId,
|
|
244
|
+
) => {
|
|
245
|
+
this.set((state) => {
|
|
246
|
+
if (state.submissions[draftKey]?.envelope.message.id !== messageId)
|
|
247
|
+
return state;
|
|
248
|
+
const submissions = { ...state.submissions };
|
|
249
|
+
delete submissions[draftKey];
|
|
250
|
+
return { submissions };
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
51
255
|
export const useChatComposerDraftStore = create<ChatComposerDraftStore>()(
|
|
52
256
|
persist(
|
|
53
257
|
(set) => ({
|
|
54
258
|
drafts: {},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
: {
|
|
59
|
-
drafts: {
|
|
60
|
-
...state.drafts,
|
|
61
|
-
[draftKey]: initialSnapshot,
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
updateDraft: (draftKey, initialSnapshot, update) => {
|
|
66
|
-
set((state) => ({
|
|
67
|
-
drafts: {
|
|
68
|
-
...state.drafts,
|
|
69
|
-
[draftKey]: update(state.drafts[draftKey] ?? initialSnapshot),
|
|
70
|
-
},
|
|
71
|
-
}));
|
|
72
|
-
},
|
|
259
|
+
submissions: {},
|
|
260
|
+
recentSubmittedNodes: {},
|
|
261
|
+
...new ChatComposerDraftActions(set),
|
|
73
262
|
}),
|
|
74
263
|
{
|
|
75
264
|
name: CHAT_COMPOSER_DRAFT_STORAGE_KEY,
|
|
@@ -86,6 +275,18 @@ export const useChatComposerDraftStore = create<ChatComposerDraftStore>()(
|
|
|
86
275
|
},
|
|
87
276
|
]),
|
|
88
277
|
),
|
|
278
|
+
submissions: Object.fromEntries(
|
|
279
|
+
Object.entries(state.submissions).map(([draftKey, submission]) => [
|
|
280
|
+
draftKey,
|
|
281
|
+
{
|
|
282
|
+
...submission,
|
|
283
|
+
status:
|
|
284
|
+
submission.status === "sending"
|
|
285
|
+
? "uncertain"
|
|
286
|
+
: submission.status,
|
|
287
|
+
},
|
|
288
|
+
]),
|
|
289
|
+
),
|
|
89
290
|
}),
|
|
90
291
|
},
|
|
91
292
|
),
|
|
@@ -7,8 +7,10 @@ import type { CronJobView } from "@/shared/lib/api";
|
|
|
7
7
|
import { setLanguage } from "@/shared/lib/i18n";
|
|
8
8
|
import { buildSessionPath } from "@/features/chat";
|
|
9
9
|
import { CronConfig } from "@/features/cron";
|
|
10
|
+
import { CronJobResource } from "@/features/cron/components/cron-job-resource";
|
|
10
11
|
|
|
11
12
|
const mocks = vi.hoisted(() => ({
|
|
13
|
+
openResource: vi.fn(),
|
|
12
14
|
confirm: vi.fn(async () => true),
|
|
13
15
|
createSession: vi.fn(),
|
|
14
16
|
deleteJob: vi.fn(),
|
|
@@ -26,6 +28,7 @@ const mocks = vi.hoisted(() => ({
|
|
|
26
28
|
isLoading: false,
|
|
27
29
|
},
|
|
28
30
|
}));
|
|
31
|
+
vi.mock("@/app/components/app-presenter-provider", () => ({ useAppPresenter: () => ({ pageResourceManager: { open: mocks.openResource } }) }));
|
|
29
32
|
|
|
30
33
|
vi.mock("@/features/chat", async () => {
|
|
31
34
|
const routeUtils = await vi.importActual<{
|
|
@@ -275,12 +278,15 @@ describe("CronConfig", () => {
|
|
|
275
278
|
|
|
276
279
|
it("exposes the bound session destination from task details", async () => {
|
|
277
280
|
const user = userEvent.setup();
|
|
278
|
-
renderCronConfig();
|
|
281
|
+
const view = renderCronConfig();
|
|
279
282
|
|
|
280
283
|
await user.click(
|
|
281
284
|
screen.getByRole("button", { name: "查看任务详情 Agent 产品雷达" }),
|
|
282
285
|
);
|
|
283
|
-
expect(
|
|
286
|
+
expect(mocks.openResource).toHaveBeenCalled();
|
|
287
|
+
view.unmount();
|
|
288
|
+
render(<MemoryRouter><CronJobResource jobId="agent-radar" /></MemoryRouter>);
|
|
289
|
+
expect(screen.getByTestId("cron-job-detail")).toBeTruthy();
|
|
284
290
|
expect(screen.getByText("当前系统只保存最近一次执行快照。")).toBeTruthy();
|
|
285
291
|
|
|
286
292
|
expect(
|