@nextclaw/ui 0.15.22 → 0.15.24
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 +66 -0
- package/dist/assets/{abnfDiagram-VRR7QNED-M4g_AyR8.js → abnfDiagram-VRR7QNED-DvTjgVMf.js} +1 -1
- package/dist/assets/{aiden0z-pptx-renderer.es-Bd99vut2.js → aiden0z-pptx-renderer.es-C1nfBAXR.js} +1 -1
- package/dist/assets/api-BxPNDp30.js +13 -0
- package/dist/assets/appearance-settings-page-DpVJjvkB.js +1 -0
- package/dist/assets/{arc-IO7WNWOB.js → arc-BvhODBXv.js} +1 -1
- package/dist/assets/architecture-TIHT7OUA-Bjp9jf0h.js +1 -0
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-Dc-lvdUh.js → architectureDiagram-ZJ3FMSHR-BKO9RgNS.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-CcsoWpIY.js → blockDiagram-677ZJIJ3-DHpDXy7D.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-Bsrtg6b2.js → c4Diagram-LMCZKHZV-BG_iQnDr.js} +1 -1
- package/dist/assets/channel-5T3pdR-s.js +1 -0
- package/dist/assets/channels-list-page-DRaNWAxC.js +8 -0
- package/dist/assets/chat-page-BuFDmG5_.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-DTZ3tGfE.js +1 -0
- package/dist/assets/{chunk-32BRIVSS-Bt08t8oG.js → chunk-32BRIVSS-DR9M0LLx.js} +1 -1
- package/dist/assets/{chunk-52WLFC77-Ddx68Xzx.js → chunk-52WLFC77-698iC3BB.js} +1 -1
- package/dist/assets/{chunk-5FCAYU7R-B7p9_q55.js → chunk-5FCAYU7R-DikTj9Ey.js} +1 -1
- package/dist/assets/{chunk-5HE753X5-D52KvdTm.js → chunk-5HE753X5-ko0o7_q0.js} +1 -1
- package/dist/assets/{chunk-5JV3BV7I-C329h8nI.js → chunk-5JV3BV7I-CEHufhgo.js} +1 -1
- package/dist/assets/{chunk-5TONJI2A-BZyUBxWt.js → chunk-5TONJI2A-CGgno1cu.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-BUiYXZmu.js → chunk-5VM5RSS4-DkiB4cUQ.js} +1 -1
- package/dist/assets/{chunk-7BUUIJ7U-B7o-mn4r.js → chunk-7BUUIJ7U-DzptcytQ.js} +1 -1
- package/dist/assets/{chunk-BIQX33UG-Bey9GoRP.js → chunk-BIQX33UG-DMRSQJvT.js} +1 -1
- package/dist/assets/{chunk-C7G6YPKG-C6tosszM.js → chunk-C7G6YPKG-Bw1BwwuY.js} +1 -1
- package/dist/assets/{chunk-CQNSW5MT-BNrdkgGQ.js → chunk-CQNSW5MT-C0z6eHBk.js} +1 -1
- package/dist/assets/{chunk-CYSBUYHQ-DHODFeyB.js → chunk-CYSBUYHQ-ByPyAouO.js} +1 -1
- package/dist/assets/{chunk-EMLP6XTP-BcmLjrcq.js → chunk-EMLP6XTP-CJlAXWZg.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-r-_eEtJI.js → chunk-EX3LRPZG-Dqq4zKJu.js} +1 -1
- package/dist/assets/{chunk-FWX5IMBZ-DOObDWbf.js → chunk-FWX5IMBZ-B0SNoCmi.js} +2 -2
- package/dist/assets/{chunk-HOUHSVGY-Bd0FnbWZ.js → chunk-HOUHSVGY-DG_GJih_.js} +1 -1
- package/dist/assets/{chunk-ICXQ74PX-ntNwAm4_.js → chunk-ICXQ74PX-Drxk_6bE.js} +1 -1
- package/dist/assets/{chunk-JG7HCLWE-YtRpblZN.js → chunk-JG7HCLWE-DdLFPpnd.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-De5-D9ta.js → chunk-JWPE2WC7-B8M4G76F.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-CdvKhyp2.js → chunk-MOJQB5TN-XP6FJHY_.js} +1 -1
- package/dist/assets/{chunk-MOZMSUNE-DJMMN_lu.js → chunk-MOZMSUNE-C_6x18Qw.js} +1 -1
- package/dist/assets/{chunk-OGEWGWER-DOFWVw3O.js → chunk-OGEWGWER-N25BzCmG.js} +1 -1
- package/dist/assets/{chunk-OSBZ3O6U-DZkrIN9r.js → chunk-OSBZ3O6U-ASDEm7y0.js} +1 -1
- package/dist/assets/{chunk-PUDLZKDR-D1wma2Yf.js → chunk-PUDLZKDR-CTlvAcn7.js} +1 -1
- package/dist/assets/{chunk-Q4XR5HBZ-CjPy94Lz.js → chunk-Q4XR5HBZ-Da9BWfB6.js} +1 -1
- package/dist/assets/{chunk-QBLGF6JB-Hy1bEgS-.js → chunk-QBLGF6JB-Bi6RpTJO.js} +1 -1
- package/dist/assets/{chunk-R7FJI6CG-CUPIHyh-.js → chunk-R7FJI6CG-DkMsSPvK.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-D5Ua4pcv.js → chunk-RYQCIY6F-DZp0eU-j.js} +1 -1
- package/dist/assets/{chunk-U6XO7XAA-DaUQcqb7.js → chunk-U6XO7XAA-vfinDSrj.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-DX2zLfQe.js → chunk-V7JOEXUC-C9Nksccs.js} +1 -1
- package/dist/assets/chunk-VAUOI2AC-HLGIHQ6k.js +1 -0
- package/dist/assets/{chunk-VR4S4FIN-CFA-WQik.js → chunk-VR4S4FIN-Xv6zfwXs.js} +1 -1
- package/dist/assets/{chunk-WYO6CB5R-Bk2HeDvJ.js → chunk-WYO6CB5R-mOJNzbWl.js} +2 -2
- package/dist/assets/chunk-XXDRQBXY-Dl0m6Ni-.js +1 -0
- package/dist/assets/{chunk-YOTPTUD7-DUG4FpBN.js → chunk-YOTPTUD7-1-aKSu4o.js} +1 -1
- package/dist/assets/{chunk-ZGVPDNZ5-70JdIGo0.js → chunk-ZGVPDNZ5-OJ8veMpK.js} +1 -1
- package/dist/assets/{chunk-ZIRB5QZD-XZdgBt5L.js → chunk-ZIRB5QZD-SR_Nq_PP.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-DcDnzGNX.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-BKXKMzKM.js +1 -0
- package/dist/assets/config-split-page-BVWVDbvG.js +1 -0
- package/dist/assets/confirm-dialog-mA2iVzxh.js +5 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-B-PQoGX-.js → cose-bilkent-JH36ORCC-NjVgz2Bw.js} +1 -1
- package/dist/assets/cynefin-VYW2F7L2-BWg7U2UD.js +1 -0
- package/dist/assets/{cynefinDiagram-TSTJHNR4-BoLCPEM0.js → cynefinDiagram-TSTJHNR4-B_17LDqD.js} +1 -1
- package/dist/assets/{dagre-D7Ie4eXr.js → dagre-CMe101gk.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-CKRrwZA-.js → dagre-VKFMJZFB-qo8nLb3B.js} +1 -1
- package/dist/assets/desktop-update-config-DyQb1LXr.js +1 -0
- package/dist/assets/{diagram-FQU43EPY-CASL1J3_.js → diagram-FQU43EPY-Ba3XIklC.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-CvLPBIzf.js → diagram-G47NLZAW-CG45TcUx.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-Ba6fGdYP.js → diagram-NH7WQ7WH-2F2HrwV-.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-DkpfgEjM.js → diagram-OA4YK3LP-CXfWH9NZ.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-BP5UMVsN.js → diagram-WEI45ONY-CH_4yepc.js} +1 -1
- package/dist/assets/dist-B4Pf5X3Q.js +1 -0
- package/dist/assets/dist-DHEWkGWX.js +1 -0
- package/dist/assets/doc-browser-CtO_HtRy.js +1 -0
- package/dist/assets/doc-browser-context-CuGI6PQc.js +1 -0
- package/dist/assets/doc-browser-eMUagyBV.js +1 -0
- package/dist/assets/{docx-preview-D0tp3a9T.js → docx-preview-CoM4JK7_.js} +1 -1
- package/dist/assets/{ebnfDiagram-CCIWWBDH-TJKbUcmc.js → ebnfDiagram-CCIWWBDH-BwiG4Ea1.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-DzGPKkKH.js → erDiagram-Q63AITRT-BML3hpnQ.js} +1 -1
- package/dist/assets/eventmodeling-45OFAUF4-SB-J4tpq.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-BQ_u-eLM.js +1 -0
- package/dist/assets/form-actions-BOfIyG3O.js +1 -0
- package/dist/assets/{ganttDiagram-NO4QXBWP-JhJzsGp2.js → ganttDiagram-NO4QXBWP-80enfWbD.js} +1 -1
- package/dist/assets/gitGraph-TEB2WS4Q-DPxNwsFd.js +1 -0
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-DZ1CKMj8.js → gitGraphDiagram-IHSO6WYX-CVLqXr-b.js} +1 -1
- package/dist/assets/host-capabilities-D9C4CBK5.js +1 -0
- package/dist/assets/index-BjBdWHV1.js +107 -0
- package/dist/assets/index-DmpmjAGQ.css +1 -0
- package/dist/assets/info-DKCQHKI2-DNlNGH90.js +1 -0
- package/dist/assets/{infoDiagram-FWYZ7A6U-BNXNKfRQ.js → infoDiagram-FWYZ7A6U-Dyvs2t0i.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-DoiEfjNw.js → ishikawaDiagram-FXEZZL3T-sSnxDKfh.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-D6oK2HSy.js → journeyDiagram-5HDEW3XC-D22V71Mf.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-B2UnLOH-.js → kanban-definition-HUTT4EX6-D3ds0p-g.js} +1 -1
- package/dist/assets/{line-BM7PoxY5.js → line-CbyFs065.js} +1 -1
- package/dist/assets/{linear-B3DiqMjk.js → linear-4DKtnZBS.js} +1 -1
- package/dist/assets/loader-circle-Df8wF2Pr.js +1 -0
- package/dist/assets/{map-BAAdHTqR.js → map-CcZzEoz6.js} +1 -1
- package/dist/assets/mcp-marketplace-page-DI49IKxp.js +1 -0
- package/dist/assets/mcp-marketplace-page-ofDqbOIF.js +9 -0
- package/dist/assets/{mermaid-parser.core-BeMviefY.js → mermaid-parser.core-DPmMOjXD.js} +2 -2
- package/dist/assets/{mermaid.core-D0Q77r9I.js → mermaid.core-BSf-ddRa.js} +3 -3
- package/dist/assets/{mindmap-definition-LN4V7U3C-BQ7r7bR8.js → mindmap-definition-LN4V7U3C-BUTwWPyx.js} +1 -1
- package/dist/assets/model-config-page-D73Tu3jW.js +1 -0
- package/dist/assets/navigation-link-CAFOcXNg.js +3 -0
- package/dist/assets/{ordinal-Bt2N4IkA.js → ordinal-BgLYtOZE.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-BpeiqkBZ.js +1 -0
- package/dist/assets/{pegDiagram-2B236MQR-B-C9-LGz.js → pegDiagram-2B236MQR-BEu_ZBjc.js} +1 -1
- package/dist/assets/pie-RZYD4A2V-Cy1yxsPd.js +1 -0
- package/dist/assets/{pieDiagram-ENE6RG2P-CtirZLtn.js → pieDiagram-ENE6RG2P-CAwAwuBd.js} +1 -1
- package/dist/assets/plus-DVU5RLCS.js +1 -0
- package/dist/assets/provider-scoped-model-input-BaJJJYMX.js +1 -0
- package/dist/assets/providers-config-page-BL6IRVBm.js +1 -0
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-DiBWAzDU.js → quadrantDiagram-ABIIQ3AL-CwE6F-_2.js} +1 -1
- package/dist/assets/radar-I7S5WNFK-CEcPKCj8.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-CW38eNDs.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-ByrylcXf.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-CNB6GwP-.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-x6hnqlBG.js +1 -0
- package/dist/assets/{railroadDiagram-RFXS5EU6-CP6b3PBI.js → railroadDiagram-RFXS5EU6-xgLekU3B.js} +1 -1
- package/dist/assets/react-BC_orpAj.js +8 -0
- package/dist/assets/{refresh-cw-CkKwPztT.js → refresh-cw-CWDp_JnN.js} +1 -1
- package/dist/assets/remote-T24O58lH.js +1 -0
- package/dist/assets/{requirementDiagram-TGXJPOKE-D8YV0-Jz.js → requirementDiagram-TGXJPOKE-CyVUzEX5.js} +1 -1
- package/dist/assets/rotate-cw-BqhwSV5p.js +1 -0
- package/dist/assets/runtime-config-page-CXUx017t.js +1 -0
- package/dist/assets/{sankeyDiagram-HTMAVEWB-C2vA4ojE.js → sankeyDiagram-HTMAVEWB-JK6bFmYB.js} +1 -1
- package/dist/assets/{save-BINMWate.js → save-Cnr71JON.js} +1 -1
- package/dist/assets/{search-7M38azRp.js → search-CCX11X2m.js} +1 -1
- package/dist/assets/search-config-page-BB6d5gT7.js +1 -0
- package/dist/assets/{secrets-config-page-2mVejXf2.js → secrets-config-page-DYsDeT9K.js} +2 -2
- package/dist/assets/security-config-CVPgqL7G.js +1 -0
- package/dist/assets/select-DvwBu99K.js +41 -0
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-B9LBmpUo.js → sequenceDiagram-DBY2YBRQ-BR5IokXV.js} +1 -1
- package/dist/assets/{settings-2-DqZstREV.js → settings-2-Dmv6zMne.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-9UIfya9-.js → sizeCapture-X5ZJPWSS-SxG_YnMA.js} +1 -1
- package/dist/assets/skeleton-C5tWata3.js +1 -0
- package/dist/assets/{src-DKf77Yzo.js → src-vgz8E_-O.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-oTW44vds.js → stateDiagram-2N3HPSRC-DD4OoYhn.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-ZC6dFORv.js +1 -0
- package/dist/assets/{swimlanes-5IMT3BWC-Cf7lcsay.js → swimlanes-5IMT3BWC-BWkFeyCT.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-CRkh51Im.js +8 -0
- package/dist/assets/{tag-chip-BoDaLnWt.js → tag-chip-gMPvx7n_.js} +1 -1
- package/dist/assets/{timeline-definition-FHXFAJF6-DoCuWKDJ.js → timeline-definition-FHXFAJF6-VTRPy6KA.js} +1 -1
- package/dist/assets/treeView-QDETBFTQ-Bw0DSCH7.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-DFWBFcfh.js +1 -0
- package/dist/assets/use-confirm-dialog-D_3-QpZU.js +1 -0
- package/dist/assets/{vennDiagram-L72KCM5P-CpU0pzGe.js → vennDiagram-L72KCM5P-Bvk42Pek.js} +1 -1
- package/dist/assets/wardley-OPB4EBWU-CoWturk0.js +1 -0
- package/dist/assets/{wardleyDiagram-EHGQE667-CkN6nn6-.js → wardleyDiagram-EHGQE667-DOFjx2s3.js} +1 -1
- package/dist/assets/x-BEWSqeux.js +1 -0
- package/dist/assets/{xychartDiagram-FW5EYKEG-DATpapm2.js → xychartDiagram-FW5EYKEG-DY5yRTUc.js} +1 -1
- package/dist/index.html +30 -32
- package/index.html +8 -0
- package/package.json +9 -9
- package/src/app/components/layout/page-layout.tsx +15 -6
- package/src/app/styles/charcoal-theme.css +85 -0
- package/src/app/styles/design-system.css +11 -13
- package/src/features/agents/components/__tests__/agents-page.test.tsx +36 -24
- package/src/features/agents/components/agent-advanced-config-fields.tsx +7 -7
- package/src/features/agents/components/agent-details-dialog.tsx +8 -8
- package/src/features/agents/components/agent-dialogs.tsx +7 -7
- package/src/features/agents/components/agents-page.tsx +42 -62
- package/src/features/chat/components/conversation/__tests__/chat-conversation-content.test.tsx +27 -3
- package/src/features/chat/components/conversation/__tests__/chat-conversation-header-section.test.tsx +16 -0
- package/src/features/chat/components/conversation/__tests__/chat-conversation-panel.test.tsx +8 -22
- package/src/features/chat/components/conversation/__tests__/chat-conversation-workspace-section.test.tsx +69 -3
- package/src/features/chat/components/conversation/chat-conversation-content.tsx +20 -6
- package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +30 -31
- package/src/features/chat/components/conversation/chat-conversation-panel.tsx +1 -8
- package/src/features/chat/components/conversation/chat-conversation-workspace-section.tsx +16 -4
- package/src/features/chat/components/layout/__tests__/chat-page-shell.test.tsx +23 -0
- package/src/features/chat/components/layout/__tests__/chat-sidebar-toolbar.test.tsx +6 -0
- package/src/features/chat/components/layout/chat-page-shell.tsx +5 -4
- package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +4 -4
- package/src/features/chat/components/providers/chat-presenter.provider.tsx +2 -0
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-area.test.tsx +84 -12
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +243 -5
- package/src/features/chat/features/conversation/components/session-conversation-area.tsx +48 -31
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +46 -37
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-controller.test.tsx +128 -1
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-input-state.test.tsx +67 -1
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-slash-commands.test.tsx +4 -0
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-provider-model-catalog.test.tsx +161 -0
- package/src/features/chat/features/conversation/hooks/use-chat-composer-reference-intent.ts +55 -0
- package/src/features/chat/features/conversation/hooks/use-session-conversation-composer-nodes.ts +26 -0
- package/src/features/chat/features/conversation/hooks/use-session-conversation-controller.ts +45 -12
- package/src/features/chat/features/conversation/hooks/use-session-conversation-input-query.ts +28 -3
- package/src/features/chat/features/conversation/hooks/use-session-conversation-input-state.ts +91 -37
- package/src/features/chat/features/conversation/hooks/use-session-conversation-recovery-actions.ts +64 -0
- package/src/features/chat/features/conversation/hooks/use-session-conversation-slash-commands.ts +2 -0
- package/src/features/chat/features/conversation/hooks/use-session-provider-model-catalog.ts +159 -0
- package/src/features/chat/features/conversation/utils/__tests__/session-message-composer.utils.test.ts +34 -0
- package/src/features/chat/features/conversation/utils/session-conversation-input-toolbar.utils.ts +23 -1
- package/src/features/chat/features/conversation/utils/session-message-composer.utils.ts +117 -0
- package/src/features/chat/features/conversation/utils/session-queued-input.utils.ts +10 -98
- package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +2 -1
- package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +3 -1
- package/src/features/chat/features/input/utils/__tests__/chat-composer-state.utils.test.ts +22 -1
- package/src/features/chat/features/input/utils/__tests__/chat-inline-token.utils.test.ts +52 -0
- package/src/features/chat/features/input/utils/__tests__/chat-input-bar.utils.test.ts +111 -0
- package/src/features/chat/features/input/utils/chat-composer-state.utils.ts +27 -2
- package/src/features/chat/features/input/utils/chat-composer-token-protocol.utils.ts +10 -0
- package/src/features/chat/features/input/utils/chat-conversation-excerpt-token.utils.ts +59 -0
- package/src/features/chat/features/input/utils/chat-inline-token.utils.ts +123 -32
- package/src/features/chat/features/input/utils/chat-input-bar.utils.ts +1 -0
- package/src/features/chat/features/input/utils/chat-input-toolbar.utils.ts +97 -10
- package/src/features/chat/features/message/components/__tests__/chat-message-assistant-header.container.test.tsx +149 -0
- package/src/features/chat/features/message/components/__tests__/chat-message-inline-editor.test.tsx +59 -0
- package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +123 -90
- package/src/features/chat/features/message/components/__tests__/chat-message-timeline-dividers.test.tsx +43 -0
- package/src/features/chat/features/message/components/chat-message-inline-editor.tsx +111 -0
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +120 -171
- package/src/features/chat/features/message/components/chat-message-timeline-dividers.tsx +75 -0
- package/src/features/chat/features/message/hooks/use-chat-inline-token-actions.ts +125 -0
- package/src/features/chat/features/message/hooks/use-chat-message-actions.tsx +187 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-action-targets.utils.test.ts +89 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-timeline-compaction.utils.test.ts +194 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-timeline-continuation-compaction.utils.test.ts +167 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-timeline.utils.test.ts +175 -1
- package/src/features/chat/features/message/utils/__tests__/chat-message.utils.test.ts +26 -0
- package/src/features/chat/features/message/utils/chat-message-action-targets.utils.ts +28 -0
- package/src/features/chat/features/message/utils/chat-message-part.utils.ts +38 -0
- package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +6 -0
- package/src/features/chat/features/message/utils/chat-message-timeline.utils.ts +201 -7
- package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-agent-runtime.test.tsx +180 -1
- package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-session-conversation.test.tsx +184 -10
- package/src/features/chat/features/ncp/hooks/use-hydrated-ncp-agent.integration.test.tsx +57 -0
- package/src/features/chat/features/ncp/hooks/use-ncp-session-conversation.ts +90 -1
- package/src/features/chat/features/ncp/utils/__tests__/ncp-chat-query-derived.utils.test.ts +110 -0
- package/src/features/chat/features/ncp/utils/ncp-chat-query-derived.utils.ts +65 -3
- package/src/features/chat/features/session/components/session-header/__tests__/chat-session-header-actions.test.tsx +17 -0
- package/src/features/chat/features/session/components/session-header/chat-session-header-actions.tsx +63 -54
- package/src/features/chat/features/session/hooks/__tests__/use-selected-session-context-window-indicator.test.tsx +87 -0
- package/src/features/chat/features/session/utils/__tests__/ncp-session-adapter.utils.test.ts +19 -0
- package/src/features/chat/features/session/utils/chat-context-window-indicator.utils.ts +44 -5
- package/src/features/chat/features/session/utils/ncp-session-adapter.utils.ts +10 -0
- package/src/features/chat/features/session/utils/ncp-session-context-metadata.utils.ts +42 -4
- package/src/features/chat/features/welcome/components/__tests__/chat-welcome.test.tsx +17 -2
- package/src/features/chat/features/welcome/components/chat-welcome-project-picker.tsx +8 -3
- package/src/features/chat/features/welcome/components/chat-welcome.tsx +2 -2
- package/src/features/chat/features/welcome/utils/__tests__/chat-welcome-project-options.utils.test.ts +22 -6
- package/src/features/chat/features/welcome/utils/chat-welcome-project-options.utils.ts +13 -0
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel-content.test.tsx +72 -2
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +21 -1
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-text-selection.test.tsx +75 -0
- package/src/features/chat/features/workspace/components/__tests__/workspace-text-selection-menu.test.tsx +109 -0
- package/src/features/chat/features/workspace/components/chat-session-workspace-directory-browser.tsx +145 -26
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +42 -18
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +50 -10
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-nav.tsx +48 -22
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +13 -2
- package/src/features/chat/features/workspace/components/workspace-text-selection-menu.tsx +45 -0
- package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +80 -0
- package/src/features/chat/features/workspace/utils/__tests__/workspace-text-excerpt.utils.test.ts +54 -0
- package/src/features/chat/features/workspace/utils/chat-thread-workspace-session.utils.ts +47 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-tab.utils.ts +16 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-panel-view-model.utils.ts +22 -1
- package/src/features/chat/features/workspace/utils/workspace-text-excerpt.utils.ts +53 -0
- package/src/features/chat/index.ts +1 -0
- package/src/features/chat/managers/__tests__/chat-composer-intent.manager.test.ts +129 -0
- package/src/features/chat/managers/__tests__/chat-session-list.manager.test.ts +38 -2
- package/src/features/chat/managers/__tests__/chat-thread-workspace.manager.test.ts +93 -1
- package/src/features/chat/managers/__tests__/provider-model-catalog-notice.manager.test.ts +57 -0
- package/src/features/chat/managers/chat-composer-intent.manager.ts +190 -0
- package/src/features/chat/managers/chat-session-list.manager.ts +13 -4
- package/src/features/chat/managers/chat-thread.manager.ts +30 -11
- package/src/features/chat/managers/provider-model-catalog-notice.manager.ts +121 -0
- package/src/features/chat/presenters/chat.presenter.ts +3 -0
- package/src/features/chat/stores/__tests__/chat-composer-draft.store.test.ts +55 -0
- package/src/features/chat/stores/chat-composer-draft.store.ts +92 -0
- package/src/features/chat/stores/chat-thread.store.ts +2 -4
- package/src/features/chat/types/chat-input-bar.types.ts +8 -0
- package/src/features/chat/types/chat-input.types.ts +5 -0
- package/src/features/chat/types/chat-message.types.ts +5 -0
- package/src/features/cron/components/__tests__/cron-config.test.tsx +100 -19
- package/src/features/cron/components/cron-config.tsx +19 -33
- package/src/features/cron/components/cron-job-detail-dialog.tsx +42 -16
- package/src/features/cron/components/cron-job-row.tsx +18 -1
- package/src/features/inbox/components/inbox-delivery-content.test.tsx +8 -2
- package/src/features/inbox/components/inbox-delivery-content.tsx +1 -1
- package/src/features/inbox/components/inbox-reader-dialog.test.tsx +10 -4
- package/src/features/inbox/components/inbox-reader-dialog.tsx +37 -61
- package/src/features/inbox/pages/inbox-page.tsx +90 -98
- package/src/features/notifications/components/__tests__/app-notification-toast.test.tsx +28 -6
- package/src/features/notifications/components/app-notification-toast.tsx +54 -15
- package/src/features/notifications/managers/__tests__/app-notification.manager.test.ts +2 -0
- package/src/features/notifications/managers/app-notification.manager.ts +3 -0
- package/src/features/panel-apps/utils/panel-app-doc-browser.utils.tsx +1 -0
- package/src/features/pwa/managers/__tests__/pwa-shell-theme.manager.test.ts +9 -0
- package/src/features/pwa/managers/pwa-shell-theme.manager.ts +1 -0
- package/src/features/service-apps/components/__tests__/service-apps-panel.test.tsx +5 -4
- package/src/features/service-apps/components/service-app-list-item.tsx +470 -0
- package/src/features/service-apps/components/service-apps-panel.tsx +76 -490
- package/src/features/settings/components/config/__tests__/provider-models-section.test.tsx +239 -0
- package/src/features/settings/components/config/provider-form-detail-pane.tsx +307 -0
- package/src/features/settings/components/config/provider-form.tsx +149 -360
- package/src/features/settings/components/config/provider-model-list.tsx +293 -0
- package/src/features/settings/components/config/provider-model-suggestions-panel.tsx +151 -0
- package/src/features/settings/components/config/provider-models-section.tsx +178 -149
- package/src/features/settings/hooks/__tests__/use-provider-connectivity.test.tsx +98 -0
- package/src/features/settings/hooks/__tests__/use-provider-model-suggestions.test.tsx +107 -0
- package/src/features/settings/hooks/use-provider-connectivity.ts +132 -0
- package/src/features/settings/hooks/use-provider-model-suggestions.ts +51 -0
- package/src/features/settings/pages/__tests__/appearance-settings-page.test.tsx +2 -2
- package/src/features/settings/pages/__tests__/search-config-page.test.tsx +48 -0
- package/src/features/settings/pages/search-config-page.tsx +17 -8
- package/src/features/settings/utils/__tests__/provider-form-support.utils.test.ts +42 -0
- package/src/features/settings/utils/provider-form-context.utils.ts +2 -0
- package/src/features/settings/utils/provider-form-model.utils.ts +25 -0
- package/src/features/settings/utils/provider-form-support.utils.ts +21 -5
- package/src/features/side-dock/components/__tests__/side-dock.test.tsx +1 -0
- package/src/features/side-dock/configs/side-dock-built-in-items.config.ts +0 -9
- package/src/index.css +1 -1
- package/src/platforms/desktop/types/desktop-update.types.ts +5 -0
- package/src/shared/components/actions/__tests__/navigation-link.test.tsx +14 -3
- package/src/shared/components/actions/navigation-link.tsx +35 -15
- package/src/shared/components/common/__tests__/agent-avatar.test.tsx +3 -2
- package/src/shared/components/common/agent-avatar.tsx +3 -3
- package/src/shared/components/doc-browser/__tests__/doc-browser.test.tsx +66 -0
- package/src/shared/components/doc-browser/doc-browser-panel-parts.tsx +4 -1
- package/src/shared/components/doc-browser/doc-browser-renderer.types.ts +1 -0
- package/src/shared/components/doc-browser/doc-browser.tsx +9 -0
- package/src/shared/components/doc-browser/hooks/use-doc-browser-scroll-restoration.ts +126 -0
- package/src/shared/components/settings/settings-page.tsx +1 -1
- package/src/shared/components/ui/context-menu/__tests__/context-menu.test.tsx +103 -0
- package/src/shared/components/ui/context-menu/context-menu.tsx +263 -0
- package/src/shared/components/ui/tab-strip/__tests__/compact-tab-strip.test.tsx +19 -6
- package/src/shared/components/ui/tab-strip/compact-tab-strip.tsx +28 -67
- package/src/shared/hooks/use-config.ts +33 -1
- package/src/shared/lib/api/__tests__/ncp-session-query-cache.utils.test.ts +26 -0
- package/src/shared/lib/api/ncp-session-query-cache.utils.ts +7 -10
- package/src/shared/lib/api/ncp-session.types.ts +6 -0
- package/src/shared/lib/api/types.ts +36 -1
- package/src/shared/lib/api/utils/config.utils.ts +14 -0
- package/src/shared/lib/cron/cron-job-view.utils.ts +4 -0
- package/src/shared/lib/host-capabilities/__tests__/host-capability.manager.test.ts +26 -0
- package/src/shared/lib/host-capabilities/host-capability.manager.ts +28 -0
- package/src/shared/lib/i18n/locales/en-US/chat.json +39 -4
- package/src/shared/lib/i18n/locales/en-US/core.json +26 -0
- package/src/shared/lib/i18n/locales/en-US/doc-browser.json +1 -0
- package/src/shared/lib/i18n/locales/en-US/search.json +1 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +39 -4
- package/src/shared/lib/i18n/locales/zh-CN/core.json +26 -0
- package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +1 -0
- package/src/shared/lib/i18n/locales/zh-CN/search.json +1 -0
- package/src/shared/lib/session-project/__tests__/workspace-file-breadcrumb.test.ts +28 -1
- package/src/shared/lib/session-project/workspace-file-breadcrumb.utils.ts +23 -0
- package/src/shared/lib/theme/index.test.ts +11 -0
- package/src/shared/lib/theme/index.ts +2 -0
- package/dist/assets/api-B1yHQYs-.js +0 -13
- package/dist/assets/app-presenter-provider-D3BuuOyZ.css +0 -1
- package/dist/assets/app-presenter-provider-uP9waOzv.js +0 -108
- package/dist/assets/appearance-settings-page-C9Zq3hP9.js +0 -1
- package/dist/assets/architecture-TIHT7OUA-Cii4JyA2.js +0 -1
- package/dist/assets/book-open-oSmyVXea.js +0 -1
- package/dist/assets/card-CGvJZTZp.js +0 -1
- package/dist/assets/channel-BSKkTPe8.js +0 -1
- package/dist/assets/channels-list-page-5BTxpQHw.js +0 -8
- package/dist/assets/chat-page-jTvli8Jp.js +0 -1
- package/dist/assets/chunk-2Q5K7J3B-CDMOR1xZ.js +0 -1
- package/dist/assets/chunk-VAUOI2AC-BRvqNW76.js +0 -1
- package/dist/assets/chunk-XXDRQBXY-CwX_mqJ3.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-RzbGxG77.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-C_gWB7WT.js +0 -1
- package/dist/assets/config-split-page-BgBsUmp1.js +0 -1
- package/dist/assets/confirm-dialog-h849QRWO.js +0 -5
- package/dist/assets/cynefin-VYW2F7L2-fSLIS0X3.js +0 -1
- package/dist/assets/desktop-update-config-BGGHxClR.js +0 -1
- package/dist/assets/dist-CxUhurq9.js +0 -41
- package/dist/assets/doc-browser-0eL8AX42.js +0 -1
- package/dist/assets/doc-browser-DEqE9lsh.js +0 -1
- package/dist/assets/doc-browser-context-DkzFIUoK.js +0 -1
- package/dist/assets/eventmodeling-45OFAUF4-XVcQGgha.js +0 -1
- package/dist/assets/eye-gOWQGt8N.js +0 -1
- package/dist/assets/flowDiagram-23GEKE2U-BiFSctqz.js +0 -1
- package/dist/assets/form-actions-CgjYZUzM.js +0 -1
- package/dist/assets/gitGraph-TEB2WS4Q-C014uXqS.js +0 -1
- package/dist/assets/host-capabilities-B-TtABsP.js +0 -1
- package/dist/assets/index-DSAUWCfl.js +0 -2
- package/dist/assets/index-G7cBryJ4.css +0 -1
- package/dist/assets/info-DKCQHKI2-CQ2qjGhU.js +0 -1
- package/dist/assets/loader-circle-BAuycGf6.js +0 -1
- package/dist/assets/logo-badge-BNcsDsUM.js +0 -1
- package/dist/assets/mcp-marketplace-page-BX39MtPa.js +0 -9
- package/dist/assets/mcp-marketplace-page-CkDtOEA4.js +0 -1
- package/dist/assets/model-config-page-7MIXg2fQ.js +0 -1
- package/dist/assets/navigation-link-B3iFOdxx.js +0 -1
- package/dist/assets/packet-7NZHBO7P-6IFyydij.js +0 -1
- package/dist/assets/pie-RZYD4A2V-spXQC_wr.js +0 -1
- package/dist/assets/plus-yvhFgfal.js +0 -1
- package/dist/assets/popover-Cpep_rJe.js +0 -1
- package/dist/assets/provider-models-CUrptZ-o.js +0 -1
- package/dist/assets/provider-scoped-model-input-CHmOzz7x.js +0 -1
- package/dist/assets/providers-config-page-A6J7Y0II.js +0 -1
- package/dist/assets/radar-I7S5WNFK-DWVA8lvY.js +0 -1
- package/dist/assets/railroad-3IZDKUUU-Ce51u8y1.js +0 -1
- package/dist/assets/railroad-abnf-AHOZXSZD-D7i7cqI_.js +0 -1
- package/dist/assets/railroad-ebnf-EBAXGLYW-BEg2hcPs.js +0 -1
- package/dist/assets/railroad-peg-LSFZ7HO6-CxROSzbi.js +0 -1
- package/dist/assets/react-BCJGCjrP.js +0 -8
- package/dist/assets/remote-FD-ZfSIn.js +0 -1
- package/dist/assets/rotate-cw-DrJMfHhp.js +0 -1
- package/dist/assets/runtime-config-page-DwjO-Vs6.js +0 -1
- package/dist/assets/search-config-page-T6tMhXbP.js +0 -1
- package/dist/assets/security-config-DD5RrjDe.js +0 -1
- package/dist/assets/select-BvidP5Oa.js +0 -1
- package/dist/assets/skeleton-BEQW2Dva.js +0 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-Bui4RXQK.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-DTwUsCBz.js +0 -8
- package/dist/assets/tabs-BeLxVmkt.js +0 -1
- package/dist/assets/trash-2-CYUskMMN.js +0 -1
- package/dist/assets/treeView-QDETBFTQ-D5zsTiuL.js +0 -1
- package/dist/assets/treemap-6X3UGDF4-CR3dxqNs.js +0 -1
- package/dist/assets/use-config-CxKRXXCl.js +0 -1
- package/dist/assets/use-confirm-dialog-HASTvOP2.js +0 -1
- package/dist/assets/use-viewport-layout-CJxkjoRz.js +0 -1
- package/dist/assets/wardley-OPB4EBWU-LatRT_Lx.js +0 -1
- package/dist/assets/x-DdUwjre5.js +0 -1
- /package/dist/assets/{array-CAkJT3no.js → array-NADKd9aU.js} +0 -0
- /package/dist/assets/{chunk-KEIR6QF5-BgdDoWEH.js → chunk-KEIR6QF5-BuyuzJJL.js} +0 -0
- /package/dist/assets/{chunk-Y2CYZVJY-pTllD0P3.js → chunk-Y2CYZVJY-D_B2ZRNt.js} +0 -0
- /package/dist/assets/{config-hints-S3g-UVZb.js → config-hints-BcfVUMij.js} +0 -0
- /package/dist/assets/{cytoscape.esm-DmURt-5G.js → cytoscape.esm-BANTlgza.js} +0 -0
- /package/dist/assets/{defaultLocale-BKy_KP3O.js → defaultLocale-C4_L0aEs.js} +0 -0
- /package/dist/assets/{dist-IgNNB7K9.js → dist-DAPEIJbz.js} +0 -0
- /package/dist/assets/{graphlib-xw_TBHyH.js → graphlib-ChqXg0dI.js} +0 -0
- /package/dist/assets/{init-C9xlLIAu.js → init-D8wZg9xq.js} +0 -0
- /package/dist/assets/{jszip.min-Das2IAnb.js → jszip.min-CkbBfwAQ.js} +0 -0
- /package/dist/assets/{katex-DSy1eD2d.js → katex-TZJFa0J_.js} +0 -0
- /package/dist/assets/{middleware-Df-a4x-q.js → middleware-B3k-TSmZ.js} +0 -0
- /package/dist/assets/{path-DB0USYHi.js → path-DodfxcX7.js} +0 -0
- /package/dist/assets/{rough.esm-B1B52ZQS.js → rough.esm-CUaa1Rbe.js} +0 -0
- /package/dist/assets/{xlsx-DfjC_iml.js → xlsx-CxByi7bR.js} +0 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import type { RuntimeModelSelectionMode } from '@nextclaw/shared';
|
|
3
|
+
|
|
4
|
+
import type { ConfigView, ProvidersView, ProviderTemplatesView } from '@/shared/lib/api';
|
|
5
|
+
import { useProviderModelCatalog, useUpdateProvider } from '@/shared/hooks/use-config';
|
|
6
|
+
import { normalizeStringList } from '@/shared/lib/provider-models';
|
|
7
|
+
import type { DiscoveredChatModelOption } from '@/features/chat/types/chat-input.types';
|
|
8
|
+
import {
|
|
9
|
+
buildNcpChatDiscoveredModelOptions,
|
|
10
|
+
filterNcpChatDiscoveredModelOptionsBySessionType,
|
|
11
|
+
} from '@/features/chat/features/ncp/utils/ncp-chat-query-derived.utils';
|
|
12
|
+
import { providerModelCatalogNoticeManager } from '@/features/chat/managers/provider-model-catalog-notice.manager';
|
|
13
|
+
|
|
14
|
+
const MODEL_DISCOVERY_PREVIEW_PROVIDER_PREFIX = '__nextclaw-preview__';
|
|
15
|
+
const MODEL_DISCOVERY_PREVIEW_GROUPS = [
|
|
16
|
+
{
|
|
17
|
+
providerId: 'opencode',
|
|
18
|
+
providerLabel: 'OpenCode Zen Free Trial',
|
|
19
|
+
models: [
|
|
20
|
+
'deepseek-v4-flash-free',
|
|
21
|
+
'laguna-s-2.1-free',
|
|
22
|
+
'longcat-2.0-free',
|
|
23
|
+
'mimo-v2.5-free',
|
|
24
|
+
'nemotron-3-ultra-free',
|
|
25
|
+
'north-mini-code-free',
|
|
26
|
+
'trinity-large-preview-free',
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
providerId: 'openrouter',
|
|
31
|
+
providerLabel: 'OpenRouter',
|
|
32
|
+
models: [
|
|
33
|
+
'inclusionai/ling-3.0-tiny:free',
|
|
34
|
+
'qwen/qwen3-coder:free',
|
|
35
|
+
'deepseek/deepseek-r1:free',
|
|
36
|
+
'mistralai/mistral-small:free',
|
|
37
|
+
'google/gemma-3-27b-it:free',
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
providerId: 'kimi',
|
|
42
|
+
providerLabel: 'Kimi',
|
|
43
|
+
models: ['kimi-k2.5-preview', 'kimi-dev-72b', 'moonshot-v1-128k-preview'],
|
|
44
|
+
},
|
|
45
|
+
] as const;
|
|
46
|
+
|
|
47
|
+
export function buildProviderModelDiscoveryPreviewOptions(params: {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
search: string;
|
|
50
|
+
}): DiscoveredChatModelOption[] {
|
|
51
|
+
if (!params.enabled || new URLSearchParams(params.search).get('preview') !== 'model-discovery') {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
return MODEL_DISCOVERY_PREVIEW_GROUPS.flatMap((group) =>
|
|
55
|
+
group.models.map((model) => ({
|
|
56
|
+
value: `${MODEL_DISCOVERY_PREVIEW_PROVIDER_PREFIX}${group.providerId}/${model}`,
|
|
57
|
+
providerId: `${MODEL_DISCOVERY_PREVIEW_PROVIDER_PREFIX}${group.providerId}`,
|
|
58
|
+
providerModel: model,
|
|
59
|
+
modelLabel: model,
|
|
60
|
+
providerLabel: group.providerLabel,
|
|
61
|
+
thinkingCapability: null,
|
|
62
|
+
})),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function isProviderModelDiscoveryPreviewOption(option: DiscoveredChatModelOption): boolean {
|
|
67
|
+
return option.providerId.startsWith(MODEL_DISCOVERY_PREVIEW_PROVIDER_PREFIX);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
type UseSessionProviderModelCatalogParams = {
|
|
71
|
+
readonly config: ConfigView | null;
|
|
72
|
+
readonly providersView: ProvidersView | null;
|
|
73
|
+
readonly templatesView: ProviderTemplatesView | null;
|
|
74
|
+
readonly modelSelectionMode?: RuntimeModelSelectionMode;
|
|
75
|
+
readonly supportedModels?: string[];
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export function useSessionProviderModelCatalog(params: UseSessionProviderModelCatalogParams) {
|
|
79
|
+
const {
|
|
80
|
+
config,
|
|
81
|
+
modelSelectionMode,
|
|
82
|
+
providersView,
|
|
83
|
+
supportedModels,
|
|
84
|
+
templatesView,
|
|
85
|
+
} = params;
|
|
86
|
+
const catalogQuery = useProviderModelCatalog();
|
|
87
|
+
const { mutateAsync: updateProvider } = useUpdateProvider();
|
|
88
|
+
const [noticeRevision, setNoticeRevision] = useState(0);
|
|
89
|
+
const [previewDismissed, setPreviewDismissed] = useState(false);
|
|
90
|
+
const previewModelOptions = useMemo(
|
|
91
|
+
() => buildProviderModelDiscoveryPreviewOptions({
|
|
92
|
+
enabled: import.meta.env.DEV && !import.meta.env.VITEST,
|
|
93
|
+
search: typeof window === 'undefined' ? '' : window.location.search,
|
|
94
|
+
}),
|
|
95
|
+
[],
|
|
96
|
+
);
|
|
97
|
+
const catalogModelOptions = useMemo(
|
|
98
|
+
() => buildNcpChatDiscoveredModelOptions({
|
|
99
|
+
catalogView: catalogQuery.data ?? null,
|
|
100
|
+
config,
|
|
101
|
+
providersView,
|
|
102
|
+
templatesView,
|
|
103
|
+
}),
|
|
104
|
+
[catalogQuery.data, config, providersView, templatesView],
|
|
105
|
+
);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
providerModelCatalogNoticeManager.initializeLargeCatalogs(catalogModelOptions);
|
|
108
|
+
}, [catalogModelOptions]);
|
|
109
|
+
const discoveredModelOptions = useMemo(
|
|
110
|
+
() => {
|
|
111
|
+
void noticeRevision;
|
|
112
|
+
if (previewModelOptions.length > 0 && !previewDismissed) {
|
|
113
|
+
return previewModelOptions;
|
|
114
|
+
}
|
|
115
|
+
return filterNcpChatDiscoveredModelOptionsBySessionType({
|
|
116
|
+
modelOptions: providerModelCatalogNoticeManager.filterUnseen(catalogModelOptions),
|
|
117
|
+
modelSelectionMode,
|
|
118
|
+
supportedModels,
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
[catalogModelOptions, modelSelectionMode, noticeRevision, previewDismissed, previewModelOptions, supportedModels],
|
|
122
|
+
);
|
|
123
|
+
const addDiscoveredModel = useCallback(async (value: string) => {
|
|
124
|
+
const option = discoveredModelOptions.find((candidate) => candidate.value === value);
|
|
125
|
+
if (option && isProviderModelDiscoveryPreviewOption(option)) {
|
|
126
|
+
return option;
|
|
127
|
+
}
|
|
128
|
+
const provider = option ? providersView?.providers[option.providerId] : undefined;
|
|
129
|
+
if (!option || !provider) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
await updateProvider({
|
|
133
|
+
provider: option.providerId,
|
|
134
|
+
data: {
|
|
135
|
+
models: normalizeStringList([...(provider.models ?? []), option.providerModel]),
|
|
136
|
+
},
|
|
137
|
+
silentSuccess: true,
|
|
138
|
+
});
|
|
139
|
+
providerModelCatalogNoticeManager.acknowledge([option]);
|
|
140
|
+
setNoticeRevision((current) => current + 1);
|
|
141
|
+
return option;
|
|
142
|
+
}, [discoveredModelOptions, providersView, updateProvider]);
|
|
143
|
+
const dismissDiscoveredModels = useCallback(() => {
|
|
144
|
+
if (discoveredModelOptions.some(isProviderModelDiscoveryPreviewOption)) {
|
|
145
|
+
setPreviewDismissed(true);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (providerModelCatalogNoticeManager.acknowledge(discoveredModelOptions)) {
|
|
149
|
+
setNoticeRevision((current) => current + 1);
|
|
150
|
+
}
|
|
151
|
+
}, [discoveredModelOptions]);
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
addDiscoveredModel,
|
|
155
|
+
dismissDiscoveredModels,
|
|
156
|
+
discoveredModelOptions,
|
|
157
|
+
refreshProviderModelCatalog: catalogQuery.refetch,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { buildSessionMessageComposerSnapshot } from '@/features/chat/features/conversation/utils/session-message-composer.utils';
|
|
4
|
+
|
|
5
|
+
describe('buildSessionMessageComposerSnapshot', () => {
|
|
6
|
+
it('round-trips text, attachment and requested skill state into the shared composer', () => {
|
|
7
|
+
const snapshot = buildSessionMessageComposerSnapshot({
|
|
8
|
+
attachmentIdPrefix: 'edit-user-1',
|
|
9
|
+
availableSkills: [{ ref: 'skill://review', name: 'Review' }],
|
|
10
|
+
message: {
|
|
11
|
+
id: 'user-1',
|
|
12
|
+
sessionId: 'session-1',
|
|
13
|
+
role: 'user',
|
|
14
|
+
status: 'final',
|
|
15
|
+
timestamp: '2026-08-08T10:00:00.000Z',
|
|
16
|
+
metadata: { requested_skill_refs: ['skill://review'] },
|
|
17
|
+
parts: [
|
|
18
|
+
{ type: 'text', text: 'check this' },
|
|
19
|
+
{ type: 'file', name: 'notes.txt', mimeType: 'text/plain', sizeBytes: 12 },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
expect(snapshot.text).toContain('check this');
|
|
25
|
+
expect(snapshot.selectedSkills).toEqual(['skill://review']);
|
|
26
|
+
expect(snapshot.skillRecords).toEqual([{ ref: 'skill://review', name: 'Review' }]);
|
|
27
|
+
expect(snapshot.attachments).toEqual([
|
|
28
|
+
expect.objectContaining({ id: 'edit-user-1-1', name: 'notes.txt' }),
|
|
29
|
+
]);
|
|
30
|
+
expect(snapshot.nodes).toEqual(expect.arrayContaining([
|
|
31
|
+
expect.objectContaining({ type: 'token', tokenKind: 'file' }),
|
|
32
|
+
]));
|
|
33
|
+
});
|
|
34
|
+
});
|
package/src/features/chat/features/conversation/utils/session-conversation-input-toolbar.utils.ts
CHANGED
|
@@ -28,9 +28,13 @@ type ToolbarSelectBuildParams = {
|
|
|
28
28
|
readonly hasModelOptions: boolean;
|
|
29
29
|
readonly isModelOptionsLoading: boolean;
|
|
30
30
|
readonly modelRecords: ChatModelRecord[];
|
|
31
|
+
readonly discoveredModelRecords: ChatModelRecord[];
|
|
31
32
|
readonly modelSearchEmptyLabel: string;
|
|
32
33
|
readonly modelSearchPlaceholder: string;
|
|
33
34
|
readonly onFavoriteModelToggle: (value: string, favorite: boolean) => void;
|
|
35
|
+
readonly onDiscoveredModelSelect: (value: string) => Promise<void> | void;
|
|
36
|
+
readonly onDiscoveredModelsDismiss: () => void;
|
|
37
|
+
readonly onModelSelectOpen: () => void;
|
|
34
38
|
readonly onModelChange: (value: string) => void;
|
|
35
39
|
readonly onThinkingChange: (value: ChatThinkingLevel | null) => void;
|
|
36
40
|
readonly recentModelValues: string[];
|
|
@@ -42,7 +46,9 @@ type ToolbarSelectBuildParams = {
|
|
|
42
46
|
readonly unfavoriteModelLabel: string;
|
|
43
47
|
};
|
|
44
48
|
|
|
45
|
-
export function buildSessionConversationToolbarSelects(
|
|
49
|
+
export function buildSessionConversationToolbarSelects(
|
|
50
|
+
params: ToolbarSelectBuildParams,
|
|
51
|
+
) {
|
|
46
52
|
const {
|
|
47
53
|
allModelsLabel,
|
|
48
54
|
favoriteModelLabel,
|
|
@@ -51,9 +57,13 @@ export function buildSessionConversationToolbarSelects(params: ToolbarSelectBuil
|
|
|
51
57
|
hasModelOptions,
|
|
52
58
|
isModelOptionsLoading,
|
|
53
59
|
modelRecords,
|
|
60
|
+
discoveredModelRecords,
|
|
54
61
|
modelSearchEmptyLabel,
|
|
55
62
|
modelSearchPlaceholder,
|
|
56
63
|
onFavoriteModelToggle,
|
|
64
|
+
onDiscoveredModelSelect,
|
|
65
|
+
onDiscoveredModelsDismiss,
|
|
66
|
+
onModelSelectOpen,
|
|
57
67
|
onModelChange,
|
|
58
68
|
onThinkingChange,
|
|
59
69
|
recentModelValues,
|
|
@@ -67,12 +77,16 @@ export function buildSessionConversationToolbarSelects(params: ToolbarSelectBuil
|
|
|
67
77
|
return [
|
|
68
78
|
buildModelToolbarSelect({
|
|
69
79
|
modelOptions: modelRecords,
|
|
80
|
+
discoveredModelOptions: discoveredModelRecords,
|
|
70
81
|
favoriteModelValues,
|
|
71
82
|
recentModelValues,
|
|
72
83
|
selectedModel,
|
|
73
84
|
isModelOptionsLoading,
|
|
74
85
|
hasModelOptions,
|
|
75
86
|
onFavoriteToggle: onFavoriteModelToggle,
|
|
87
|
+
onDiscoveredModelSelect,
|
|
88
|
+
onDiscoveredModelsDismiss,
|
|
89
|
+
onOpen: onModelSelectOpen,
|
|
76
90
|
onValueChange: onModelChange,
|
|
77
91
|
texts: {
|
|
78
92
|
modelSelectPlaceholder: t('chatSelectModel'),
|
|
@@ -83,6 +97,14 @@ export function buildSessionConversationToolbarSelects(params: ToolbarSelectBuil
|
|
|
83
97
|
favoriteModelLabel,
|
|
84
98
|
unfavoriteModelLabel,
|
|
85
99
|
manageModelsLabel: t('chatManageModels'),
|
|
100
|
+
discoveredModelsSummaryLabel: t('chatDiscoveredModelsSummary'),
|
|
101
|
+
discoveredModelsViewLabel: t('chatDiscoveredModelsView'),
|
|
102
|
+
discoveredModelsGroupLabel: t('chatDiscoveredModelsGroup'),
|
|
103
|
+
discoveredModelAddLabel: t('chatDiscoveredModelAdd'),
|
|
104
|
+
discoveredModelAddedLabel: t('chatDiscoveredModelAddedShort'),
|
|
105
|
+
discoveredModelsDismissLabel: t('chatDiscoveredModelsDismiss'),
|
|
106
|
+
discoveredModelsDoneLabel: t('chatDiscoveredModelsDone'),
|
|
107
|
+
discoveredModelsCloseLabel: t('chatDiscoveredModelsClose'),
|
|
86
108
|
recentModelsLabel,
|
|
87
109
|
allModelsLabel,
|
|
88
110
|
},
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createChatComposerTextNode,
|
|
3
|
+
createChatComposerTokenNode,
|
|
4
|
+
normalizeChatComposerNodes,
|
|
5
|
+
type ChatComposerNode,
|
|
6
|
+
} from '@nextclaw/agent-chat-ui';
|
|
7
|
+
import type { NcpMessage } from '@nextclaw/ncp';
|
|
8
|
+
import type { NcpDraftAttachment } from '@nextclaw/ncp-react';
|
|
9
|
+
|
|
10
|
+
import { deriveChatComposerDraft } from '@/features/chat/features/input/utils/chat-composer-state.utils';
|
|
11
|
+
import {
|
|
12
|
+
readInlineTokensFromMetadata,
|
|
13
|
+
resolveInlineTokensForText,
|
|
14
|
+
type ChatInlineTokenSource,
|
|
15
|
+
} from '@/features/chat/features/input/utils/chat-inline-token.utils';
|
|
16
|
+
import { normalizeRequestedSkills } from '@/features/chat/features/runtime/utils/chat-runtime.utils';
|
|
17
|
+
import type { SessionConversationComposerState } from '@/features/chat/features/conversation/hooks/use-session-conversation-input-state';
|
|
18
|
+
|
|
19
|
+
export type SessionMessageComposerSnapshot = SessionConversationComposerState & {
|
|
20
|
+
readonly attachments: readonly NcpDraftAttachment[];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function buildTextNodes(
|
|
24
|
+
text: string,
|
|
25
|
+
inlineTokens: readonly ChatInlineTokenSource[],
|
|
26
|
+
): ChatComposerNode[] {
|
|
27
|
+
const nodes: ChatComposerNode[] = [];
|
|
28
|
+
let offset = 0;
|
|
29
|
+
while (offset < text.length) {
|
|
30
|
+
const nextToken = inlineTokens
|
|
31
|
+
.flatMap((token) => {
|
|
32
|
+
const index = text.indexOf(token.rawText, offset);
|
|
33
|
+
return index < 0 ? [] : [{ index, token }];
|
|
34
|
+
})
|
|
35
|
+
.sort((left, right) => left.index - right.index || right.token.rawText.length - left.token.rawText.length)[0];
|
|
36
|
+
if (!nextToken) {
|
|
37
|
+
nodes.push(createChatComposerTextNode(text.slice(offset)));
|
|
38
|
+
return nodes;
|
|
39
|
+
}
|
|
40
|
+
if (nextToken.index > offset) {
|
|
41
|
+
nodes.push(createChatComposerTextNode(text.slice(offset, nextToken.index)));
|
|
42
|
+
}
|
|
43
|
+
nodes.push(createChatComposerTokenNode({
|
|
44
|
+
tokenKind: nextToken.token.kind,
|
|
45
|
+
tokenKey: 'ref' in nextToken.token ? nextToken.token.ref : nextToken.token.key,
|
|
46
|
+
label: nextToken.token.label,
|
|
47
|
+
}));
|
|
48
|
+
offset = nextToken.index + nextToken.token.rawText.length;
|
|
49
|
+
}
|
|
50
|
+
return nodes;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function readRequestedSkills(metadata: Record<string, unknown>): string[] {
|
|
54
|
+
const raw = metadata.requested_skill_refs;
|
|
55
|
+
return normalizeRequestedSkills(
|
|
56
|
+
Array.isArray(raw)
|
|
57
|
+
? raw.filter((value): value is string => typeof value === 'string')
|
|
58
|
+
: undefined,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function buildSessionMessageComposerSnapshot(params: {
|
|
63
|
+
readonly attachmentIdPrefix: string;
|
|
64
|
+
readonly availableSkills: readonly { ref: string; name: string }[];
|
|
65
|
+
readonly message: NcpMessage;
|
|
66
|
+
readonly metadata?: Record<string, unknown>;
|
|
67
|
+
}): SessionMessageComposerSnapshot {
|
|
68
|
+
const { attachmentIdPrefix, availableSkills, message } = params;
|
|
69
|
+
const metadata = params.metadata ?? message.metadata ?? {};
|
|
70
|
+
const metadataTokens = readInlineTokensFromMetadata(metadata);
|
|
71
|
+
const nodes: ChatComposerNode[] = [];
|
|
72
|
+
const attachments: NcpDraftAttachment[] = [];
|
|
73
|
+
|
|
74
|
+
message.parts.forEach((part, index) => {
|
|
75
|
+
if (part.type === 'text' || part.type === 'rich-text' || part.type === 'reasoning') {
|
|
76
|
+
nodes.push(...buildTextNodes(
|
|
77
|
+
part.text,
|
|
78
|
+
resolveInlineTokensForText(part.text, metadataTokens),
|
|
79
|
+
));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (part.type !== 'file') {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const id = `${attachmentIdPrefix}-${index}`;
|
|
86
|
+
const attachment: NcpDraftAttachment = {
|
|
87
|
+
id,
|
|
88
|
+
name: part.name ?? 'attachment',
|
|
89
|
+
mimeType: part.mimeType ?? 'application/octet-stream',
|
|
90
|
+
sizeBytes: part.sizeBytes ?? 0,
|
|
91
|
+
assetUri: part.assetUri,
|
|
92
|
+
url: part.url,
|
|
93
|
+
contentBase64: part.contentBase64,
|
|
94
|
+
};
|
|
95
|
+
attachments.push(attachment);
|
|
96
|
+
nodes.push(createChatComposerTokenNode({
|
|
97
|
+
tokenKind: 'file',
|
|
98
|
+
tokenKey: id,
|
|
99
|
+
label: attachment.name,
|
|
100
|
+
previewUrl: attachment.mimeType.startsWith('image/') ? attachment.url : undefined,
|
|
101
|
+
}));
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const normalizedNodes = normalizeChatComposerNodes(nodes);
|
|
105
|
+
const selectedSkills = readRequestedSkills(metadata);
|
|
106
|
+
const skillNameByRef = new Map(availableSkills.map(({ ref, name }) => [ref, name]));
|
|
107
|
+
return {
|
|
108
|
+
text: deriveChatComposerDraft(normalizedNodes),
|
|
109
|
+
nodes: normalizedNodes,
|
|
110
|
+
selectedSkills,
|
|
111
|
+
skillRecords: selectedSkills.map((ref) => ({
|
|
112
|
+
ref,
|
|
113
|
+
name: skillNameByRef.get(ref) ?? ref,
|
|
114
|
+
})),
|
|
115
|
+
attachments,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createChatComposerTextNode,
|
|
3
|
-
createChatComposerTokenNode,
|
|
4
|
-
normalizeChatComposerNodes,
|
|
5
|
-
type ChatComposerNode,
|
|
6
|
-
} from '@nextclaw/agent-chat-ui';
|
|
7
1
|
import type { UiNcpSessionQueuedInputView } from '@nextclaw/client-sdk';
|
|
8
|
-
import type { NcpDraftAttachment } from '@nextclaw/ncp-react';
|
|
9
2
|
|
|
10
3
|
import {
|
|
11
4
|
readInlineTokensFromMetadata,
|
|
12
|
-
resolveInlineTokensForText,
|
|
13
|
-
type ChatInlineTokenSource,
|
|
14
5
|
} from '@/features/chat/features/input/utils/chat-inline-token.utils';
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export type SessionQueuedInputComposerSnapshot = SessionConversationComposerState & {
|
|
20
|
-
readonly attachments: readonly NcpDraftAttachment[];
|
|
21
|
-
};
|
|
6
|
+
import {
|
|
7
|
+
buildSessionMessageComposerSnapshot,
|
|
8
|
+
type SessionMessageComposerSnapshot,
|
|
9
|
+
} from '@/features/chat/features/conversation/utils/session-message-composer.utils';
|
|
22
10
|
|
|
23
|
-
|
|
24
|
-
text: string,
|
|
25
|
-
inlineTokens: readonly ChatInlineTokenSource[],
|
|
26
|
-
): ChatComposerNode[] {
|
|
27
|
-
const nodes: ChatComposerNode[] = [];
|
|
28
|
-
let offset = 0;
|
|
29
|
-
while (offset < text.length) {
|
|
30
|
-
const nextToken = inlineTokens
|
|
31
|
-
.flatMap((token) => {
|
|
32
|
-
const index = text.indexOf(token.rawText, offset);
|
|
33
|
-
return index < 0 ? [] : [{ index, token }];
|
|
34
|
-
})
|
|
35
|
-
.sort((left, right) => left.index - right.index || right.token.rawText.length - left.token.rawText.length)[0];
|
|
36
|
-
if (!nextToken) {
|
|
37
|
-
nodes.push(createChatComposerTextNode(text.slice(offset)));
|
|
38
|
-
return nodes;
|
|
39
|
-
}
|
|
40
|
-
if (nextToken.index > offset) {
|
|
41
|
-
nodes.push(createChatComposerTextNode(text.slice(offset, nextToken.index)));
|
|
42
|
-
}
|
|
43
|
-
nodes.push(createChatComposerTokenNode({
|
|
44
|
-
tokenKind: nextToken.token.kind,
|
|
45
|
-
tokenKey: "ref" in nextToken.token ? nextToken.token.ref : nextToken.token.key,
|
|
46
|
-
label: nextToken.token.label,
|
|
47
|
-
}));
|
|
48
|
-
offset = nextToken.index + nextToken.token.rawText.length;
|
|
49
|
-
}
|
|
50
|
-
return nodes;
|
|
51
|
-
}
|
|
11
|
+
export type SessionQueuedInputComposerSnapshot = SessionMessageComposerSnapshot;
|
|
52
12
|
|
|
53
13
|
function readInputMetadata(input: UiNcpSessionQueuedInputView): Record<string, unknown> {
|
|
54
14
|
return {
|
|
@@ -57,13 +17,6 @@ function readInputMetadata(input: UiNcpSessionQueuedInputView): Record<string, u
|
|
|
57
17
|
};
|
|
58
18
|
}
|
|
59
19
|
|
|
60
|
-
function readRequestedSkills(input: UiNcpSessionQueuedInputView): string[] {
|
|
61
|
-
const raw = readInputMetadata(input).requested_skill_refs;
|
|
62
|
-
return normalizeRequestedSkills(
|
|
63
|
-
Array.isArray(raw) ? raw.filter((value): value is string => typeof value === 'string') : undefined,
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
20
|
export function buildSessionQueuedInputPreview(input: UiNcpSessionQueuedInputView): string {
|
|
68
21
|
const inlineTokens = readInlineTokensFromMetadata(readInputMetadata(input));
|
|
69
22
|
const text = input.message.parts.flatMap((part) =>
|
|
@@ -85,51 +38,10 @@ export function buildSessionQueuedInputComposerSnapshot(
|
|
|
85
38
|
input: UiNcpSessionQueuedInputView,
|
|
86
39
|
availableSkills: readonly { ref: string; name: string }[],
|
|
87
40
|
): SessionQueuedInputComposerSnapshot {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (part.type === 'text' || part.type === 'rich-text' || part.type === 'reasoning') {
|
|
94
|
-
nodes.push(...buildTextNodes(
|
|
95
|
-
part.text,
|
|
96
|
-
resolveInlineTokensForText(part.text, metadataTokens),
|
|
97
|
-
));
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (part.type !== 'file') {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const id = `queued-attachment-${input.id}-${index}`;
|
|
104
|
-
const attachment: NcpDraftAttachment = {
|
|
105
|
-
id,
|
|
106
|
-
name: part.name ?? 'attachment',
|
|
107
|
-
mimeType: part.mimeType ?? 'application/octet-stream',
|
|
108
|
-
sizeBytes: part.sizeBytes ?? 0,
|
|
109
|
-
assetUri: part.assetUri,
|
|
110
|
-
url: part.url,
|
|
111
|
-
contentBase64: part.contentBase64,
|
|
112
|
-
};
|
|
113
|
-
attachments.push(attachment);
|
|
114
|
-
nodes.push(createChatComposerTokenNode({
|
|
115
|
-
tokenKind: 'file',
|
|
116
|
-
tokenKey: id,
|
|
117
|
-
label: attachment.name,
|
|
118
|
-
previewUrl: attachment.mimeType.startsWith('image/') ? attachment.url : undefined,
|
|
119
|
-
}));
|
|
41
|
+
return buildSessionMessageComposerSnapshot({
|
|
42
|
+
attachmentIdPrefix: `queued-attachment-${input.id}`,
|
|
43
|
+
availableSkills,
|
|
44
|
+
message: input.message,
|
|
45
|
+
metadata: readInputMetadata(input),
|
|
120
46
|
});
|
|
121
|
-
|
|
122
|
-
const normalizedNodes = normalizeChatComposerNodes(nodes);
|
|
123
|
-
const selectedSkills = readRequestedSkills(input);
|
|
124
|
-
const skillNameByRef = new Map(availableSkills.map(({ ref, name }) => [ref, name]));
|
|
125
|
-
return {
|
|
126
|
-
text: deriveChatComposerDraft(normalizedNodes),
|
|
127
|
-
nodes: normalizedNodes,
|
|
128
|
-
selectedSkills,
|
|
129
|
-
skillRecords: selectedSkills.map((ref) => ({
|
|
130
|
-
ref,
|
|
131
|
-
name: skillNameByRef.get(ref) ?? ref,
|
|
132
|
-
})),
|
|
133
|
-
attachments,
|
|
134
|
-
};
|
|
135
47
|
}
|
|
@@ -35,6 +35,7 @@ function createPlugin(
|
|
|
35
35
|
commands: [
|
|
36
36
|
{
|
|
37
37
|
key: 'side-chat',
|
|
38
|
+
icon: 'message-square-plus',
|
|
38
39
|
title: 'Side chat',
|
|
39
40
|
description: 'Open side chat',
|
|
40
41
|
detailLines: ['Creates a child session on first send'],
|
|
@@ -133,7 +134,7 @@ describe('createSlashCommandInputSurfacePlugin', () => {
|
|
|
133
134
|
{ key: 'panel-apps', label: 'Panel Apps', sectionKeys: ['panel-apps'] },
|
|
134
135
|
]);
|
|
135
136
|
expect(state.panel?.items[0]).toMatchObject({
|
|
136
|
-
icon: '
|
|
137
|
+
icon: 'message-square-plus',
|
|
137
138
|
sectionKey: 'commands',
|
|
138
139
|
sectionLabel: 'Commands',
|
|
139
140
|
hintLabel: 'Run command',
|
package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
CHAT_INPUT_SURFACE_SLASH_TRIGGER_SPEC,
|
|
3
3
|
createInputSurfaceTriggeredPanelPlugin,
|
|
4
4
|
type ChatInputSurfaceItem,
|
|
5
|
+
type ChatInputSurfaceItemIcon,
|
|
5
6
|
type ChatInputSurfaceMenuTexts,
|
|
6
7
|
type ChatInputSurfacePlugin,
|
|
7
8
|
} from '@nextclaw/agent-chat-ui';
|
|
@@ -24,6 +25,7 @@ const SLASH_SKILL_SECTION_KEY = 'skills';
|
|
|
24
25
|
|
|
25
26
|
export type ChatSlashCommandDescriptor = {
|
|
26
27
|
key: string;
|
|
28
|
+
icon: ChatInputSurfaceItemIcon;
|
|
27
29
|
title: string;
|
|
28
30
|
description: string;
|
|
29
31
|
detailLines?: readonly string[];
|
|
@@ -69,7 +71,7 @@ function buildSlashCommandItems(params: {
|
|
|
69
71
|
})
|
|
70
72
|
.map(({ command }) => ({
|
|
71
73
|
key: `command:${command.key}`,
|
|
72
|
-
icon:
|
|
74
|
+
icon: command.icon,
|
|
73
75
|
title: command.title,
|
|
74
76
|
subtitle: params.texts.commandSubtitle,
|
|
75
77
|
description: command.description,
|
|
@@ -56,7 +56,7 @@ describe('deriveNcpMessagePartsFromComposer', () => {
|
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
type: 'text',
|
|
59
|
-
text: ' between $Web
|
|
59
|
+
text: ' between $Web Search after'
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
type: 'file',
|
|
@@ -115,6 +115,27 @@ describe('deriveNcpMessagePartsFromComposer', () => {
|
|
|
115
115
|
]);
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
+
it('separates workspace references from adjacent message text', () => {
|
|
119
|
+
expect(
|
|
120
|
+
deriveNcpMessagePartsFromComposer(
|
|
121
|
+
[
|
|
122
|
+
createChatComposerTokenNode({
|
|
123
|
+
tokenKind: 'workspace_file',
|
|
124
|
+
tokenKey: 'AGENTS.md',
|
|
125
|
+
label: 'AGENTS.md',
|
|
126
|
+
}),
|
|
127
|
+
createChatComposerTextNode('这里面有啥'),
|
|
128
|
+
],
|
|
129
|
+
[],
|
|
130
|
+
),
|
|
131
|
+
).toEqual([
|
|
132
|
+
{
|
|
133
|
+
type: 'text',
|
|
134
|
+
text: '@file:AGENTS.md 这里面有啥',
|
|
135
|
+
},
|
|
136
|
+
]);
|
|
137
|
+
});
|
|
138
|
+
|
|
118
139
|
it('preserves uploaded attachment references when the attachment has a server uri', () => {
|
|
119
140
|
const parts = deriveNcpMessagePartsFromComposer(
|
|
120
141
|
[
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
buildInlineTokensFromTextProtocol,
|
|
4
4
|
buildInlineTokensFromComposer,
|
|
5
5
|
CHAT_INLINE_TOKENS_METADATA_KEY,
|
|
6
|
+
createInlineTokensMetadata,
|
|
6
7
|
readInlineTokensFromMetadata,
|
|
7
8
|
resolveInlineTokensForText,
|
|
8
9
|
resolveWorkspaceReferencePath,
|
|
@@ -226,6 +227,29 @@ describe('chat inline token workspace references', () => {
|
|
|
226
227
|
]);
|
|
227
228
|
});
|
|
228
229
|
|
|
230
|
+
it('prefers persisted token metadata over a greedy protocol fallback', () => {
|
|
231
|
+
expect(
|
|
232
|
+
resolveInlineTokensForText(
|
|
233
|
+
'@file:AGENTS.md这里面有啥',
|
|
234
|
+
[
|
|
235
|
+
{
|
|
236
|
+
kind: 'workspace_file',
|
|
237
|
+
key: 'AGENTS.md',
|
|
238
|
+
label: 'AGENTS.md',
|
|
239
|
+
rawText: '@file:AGENTS.md',
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
),
|
|
243
|
+
).toEqual([
|
|
244
|
+
{
|
|
245
|
+
kind: 'workspace_file',
|
|
246
|
+
key: 'AGENTS.md',
|
|
247
|
+
label: 'AGENTS.md',
|
|
248
|
+
rawText: '@file:AGENTS.md',
|
|
249
|
+
},
|
|
250
|
+
]);
|
|
251
|
+
});
|
|
252
|
+
|
|
229
253
|
it('serializes project references with their registered path and display name', () => {
|
|
230
254
|
expect(
|
|
231
255
|
buildInlineTokensFromComposer([
|
|
@@ -255,6 +279,34 @@ describe('chat inline token workspace references', () => {
|
|
|
255
279
|
]);
|
|
256
280
|
});
|
|
257
281
|
|
|
282
|
+
it('round-trips conversation excerpts with their immutable snapshot', () => {
|
|
283
|
+
const tokens = buildInlineTokensFromComposer([
|
|
284
|
+
createChatComposerTokenNode({
|
|
285
|
+
tokenKind: 'conversation_excerpt',
|
|
286
|
+
tokenKey: 'assistant-1#excerpt-demo',
|
|
287
|
+
label: 'AI reply',
|
|
288
|
+
data: {
|
|
289
|
+
messageId: 'assistant-1',
|
|
290
|
+
role: 'assistant',
|
|
291
|
+
excerpt: 'Keep the visible tag concise.',
|
|
292
|
+
},
|
|
293
|
+
}),
|
|
294
|
+
]);
|
|
295
|
+
|
|
296
|
+
expect(tokens).toEqual([{
|
|
297
|
+
kind: 'conversation_excerpt',
|
|
298
|
+
key: 'assistant-1#excerpt-demo',
|
|
299
|
+
messageId: 'assistant-1',
|
|
300
|
+
role: 'assistant',
|
|
301
|
+
label: 'AI reply',
|
|
302
|
+
excerpt: 'Keep the visible tag concise.',
|
|
303
|
+
rawText: '@message-excerpt:assistant-1%23excerpt-demo',
|
|
304
|
+
}]);
|
|
305
|
+
expect(readInlineTokensFromMetadata({
|
|
306
|
+
ui_inline_tokens: createInlineTokensMetadata(tokens),
|
|
307
|
+
})).toEqual(tokens);
|
|
308
|
+
});
|
|
309
|
+
|
|
258
310
|
it('resolves workspace token paths inside POSIX and Windows project roots', () => {
|
|
259
311
|
expect(resolveWorkspaceReferencePath({
|
|
260
312
|
projectRoot: '/tmp/project/',
|