@marimo-team/frontend 0.25.2-dev99 → 0.25.3-dev141
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/dist/assets/{CellStatus-Bj7PvY_u.js → CellStatus-BP2mavAq.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-C5UW0p9I.js → ConnectedDataExplorerComponent-t8fH_TNc.js} +1 -1
- package/dist/assets/{ErrorBoundary-CG6gtgym.js → ErrorBoundary-Gl5nCA8C.js} +2 -2
- package/dist/assets/{I18nProvider-BFOBKCJB.js → I18nProvider-Cg2I_s1_.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-pCLPT6RA.js → ImageComparisonComponent-Bq-l26rq.js} +1 -1
- package/dist/assets/{Inputs-BlygJyl1.js → Inputs-BsQm29hD.js} +1 -1
- package/dist/assets/JsonOutput-D6HIIsCb.js +11 -0
- package/dist/assets/{LazyAnyLanguageCodeMirror-CeTd_wFt.js → LazyAnyLanguageCodeMirror-CKcCbG2G.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-BEsxXqp6.js → MarimoErrorOutput-D60XkCny.js} +1 -1
- package/dist/assets/{Plot-CNtRAZBG.js → Plot-B8w5_jU-.js} +1 -1
- package/dist/assets/{RenderHTML-C7QcdAgB.js → RenderHTML-BbOqmHy3.js} +1 -1
- package/dist/assets/{RunButton-A__3wcpF.js → RunButton-CK3LhnP5.js} +1 -1
- package/dist/assets/__vite-browser-external-CYO_P3S8.js +1 -0
- package/dist/assets/__vite-browser-external-FeDVGZU8.js +1 -0
- package/dist/assets/{abnfDiagram-VCTEODGH-BuHNQB7l.js → abnfDiagram-VCTEODGH-3eD1PSvc.js} +1 -1
- package/dist/assets/add-cell-with-ai-8UBC0xwR.js +76 -0
- package/dist/assets/{add-connection-dialog-bl8dqCVs.js → add-connection-dialog-DXQnd6eB.js} +1 -1
- package/dist/assets/{agent-panel-BPLrf7mA.js → agent-panel-D7kMZLG-.js} +5 -5
- package/dist/assets/ai-model-dropdown-B0z6-zhp.js +5 -0
- package/dist/assets/{alert-MrQXRIin.js → alert-DTaqCu_d.js} +1 -1
- package/dist/assets/{alert-dialog-DlL1c-bx.js → alert-dialog-BaPGzeOK.js} +1 -1
- package/dist/assets/{any-language-editor-DtOWujZJ.js → any-language-editor-BLCAD3yx.js} +1 -1
- package/dist/assets/{api-DVLtXyp7.js → api-BeC_VSGv.js} +1 -1
- package/dist/assets/app-config-button-BKEG4x9u.js +1 -0
- package/dist/assets/{architectureDiagram-5GKGNRK7-DvIXijdN.js → architectureDiagram-5GKGNRK7-Bx_zXJUH.js} +1 -1
- package/dist/assets/arrow-down-C9Bslqr3.js +1 -0
- package/dist/assets/arrow-left-BaPN-xbg.js +1 -0
- package/dist/assets/arrow-right-Cgit4Nk2.js +1 -0
- package/dist/assets/{badge-DFf033uX.js → badge-crT3E0Rm.js} +1 -1
- package/dist/assets/ban-YzvUro5I.js +1 -0
- package/dist/assets/{blob-Bx8A10xl.js → blob-D5nfNHOo.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-DGAMO17L.js → blockDiagram-I7D4REHJ-CuwUGEGQ.js} +1 -1
- package/dist/assets/{bot-message-square-BfGaNy9r.js → bot-message-square-8xmbrehG.js} +1 -1
- package/dist/assets/{bundle.esm-CklCb9AD.js → bundle.esm-D3tw5rqW.js} +1 -1
- package/dist/assets/{button-M49xxKoi.js → button-COI-NGrx.js} +1 -1
- package/dist/assets/{c4Diagram-7LVT6UL2-qqO5IOnV.js → c4Diagram-7LVT6UL2-nj0NbEUh.js} +1 -1
- package/dist/assets/{cache-panel-BNPF4X5e.js → cache-panel-DTY1dqvi.js} +1 -1
- package/dist/assets/{capabilities-BScjbYOK.js → capabilities-BJvf-MD4.js} +1 -1
- package/dist/assets/{card-BYZGhhhx.js → card-DOABds5l.js} +1 -1
- package/dist/assets/{cell-editor-C3818WlB.js → cell-editor-ADVfycpN.js} +12 -12
- package/dist/assets/{cell-link-DC1UZQr_.js → cell-link-LSth_8hT.js} +1 -1
- package/dist/assets/cells-BRkCaSsh.js +220 -0
- package/dist/assets/channel-DtckUh1_.js +1 -0
- package/dist/assets/{chart-no-axes-column-B6FT5Xvu.js → chart-no-axes-column-C4_v6fQW.js} +1 -1
- package/dist/assets/{chat-display-YETh6yXV.js → chat-display-Dnagy4Nv.js} +1 -1
- package/dist/assets/chat-panel-DQ6HkWEF.js +4 -0
- package/dist/assets/{chat-ui-D_QL46qM.js → chat-ui-Df8Vcj6n.js} +1 -1
- package/dist/assets/check-BQNapYaf.js +1 -0
- package/dist/assets/chevron-right-eAtVhbNZ.js +1 -0
- package/dist/assets/{chunk-2E4U76K2-DqA2CBL0.js → chunk-2E4U76K2-dDf4JvCq.js} +1 -1
- package/dist/assets/{chunk-4HAMMTFA-DaFOJTOO.js → chunk-4HAMMTFA-Bhjs7H7G.js} +1 -1
- package/dist/assets/{chunk-75Z2AOVW-DEp7Wbaj.js → chunk-75Z2AOVW-DlSlUzCU.js} +1 -1
- package/dist/assets/{chunk-CLGD4ZFX-BxW11Imt.js → chunk-CLGD4ZFX-CvGMvSe-.js} +1 -1
- package/dist/assets/{chunk-DU6HZSFF-CDmPCRkr.js → chunk-DU6HZSFF-BxQd02hX.js} +2 -2
- package/dist/assets/{chunk-F27PBJKO-455JWNM3.js → chunk-F27PBJKO-DL9FG-iN.js} +1 -1
- package/dist/assets/{chunk-GMAD6QVW-ahdTJvh0.js → chunk-GMAD6QVW-B1Ai6qbk.js} +1 -1
- package/dist/assets/{chunk-GVQU2GXP-CPkYne1h.js → chunk-GVQU2GXP-a_N0QLD4.js} +1 -1
- package/dist/assets/{chunk-IMKFNOWR-fARccL86.js → chunk-IMKFNOWR-7KbFyW3C.js} +1 -1
- package/dist/assets/{chunk-L3NEJ4N5-BOK6HmaY.js → chunk-L3NEJ4N5-BcHj9aiN.js} +1 -1
- package/dist/assets/{chunk-OSK3NFVY-CEcyPnHo.js → chunk-OSK3NFVY-Dc7tMbN9.js} +1 -1
- package/dist/assets/{chunk-P2QGCYS3-Bw5LRT6S.js → chunk-P2QGCYS3-G6pmnA0z.js} +1 -1
- package/dist/assets/{chunk-POPQ4Y6H-C--NLIXc.js → chunk-POPQ4Y6H-C3iw1mOR.js} +1 -1
- package/dist/assets/{chunk-PWAF6VOD-B1mxlptQ.js → chunk-PWAF6VOD-Dy1Fp4eJ.js} +1 -1
- package/dist/assets/{chunk-SHT3W25Y-Diet96b1.js → chunk-SHT3W25Y-B3kFJuvo.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-BbcEGfNl.js → chunk-SVP7TREG-BNmfcKnL.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-BypOyFjf.js → chunk-TICWLB2K-CI3x9ENh.js} +1 -1
- package/dist/assets/{chunk-TLUHSLCS-DvvqZUl_.js → chunk-TLUHSLCS-Q72uYeUY.js} +2 -2
- package/dist/assets/{chunk-YOKDWASO-84E-_nIR.js → chunk-YOKDWASO-BIpRENEC.js} +4 -4
- package/dist/assets/{circle-Bb1IbBVn.js → circle-DXf-VWZG.js} +1 -1
- package/dist/assets/circle-check-BCurAHEb.js +1 -0
- package/dist/assets/{circle-play-X3K8DkEc.js → circle-play-CYIb0qT6.js} +1 -1
- package/dist/assets/classDiagram-ZZMXUADV-vm4wDTPy.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-vm4wDTPy.js +1 -0
- package/dist/assets/{clear-button-BGfeXcJ3.js → clear-button-p6YcvzLy.js} +1 -1
- package/dist/assets/{click-outside-container-CHoodRk9.js → click-outside-container-D_Dy5sZY.js} +1 -1
- package/dist/assets/{clipboard-paste-D0gau9Xw.js → clipboard-paste-HVpozQmt.js} +1 -1
- package/dist/assets/code-BEiQP4pS.js +1 -0
- package/dist/assets/{code-visibility-DNzJgrTz.js → code-visibility-B-_GvwR5.js} +1 -1
- package/dist/assets/{code-xml-CW65k2pN.js → code-xml-SQaZqvcO.js} +1 -1
- package/dist/assets/coerce-CpE6kUdX.js +1 -0
- package/dist/assets/{column-preview-fD3qW2B5.js → column-preview-Cm2D6vyX.js} +1 -1
- package/dist/assets/command-palette-DTSQ7gOC.js +1 -0
- package/dist/assets/{common-Cy3lJDvJ.js → common-Cu6CDbuw.js} +1 -1
- package/dist/assets/{compiler-runtime-BQ9S8nyo.js → compiler-runtime-BrajqUja.js} +1 -1
- package/dist/assets/{components-D9ZIJGG8.js → components-CGw16R_N.js} +1 -1
- package/dist/assets/{components-M5WFQ0gs.js → components-CP_UoFtT.js} +1 -1
- package/dist/assets/{components-ufN33X-R.js → components-CXfO-F47.js} +1 -1
- package/dist/assets/{config-CR2d-XsP.js → config-BOKzA3tF.js} +1 -1
- package/dist/assets/{config-D_c_6ce1.js → config-DX8Y2WbJ.js} +1 -1
- package/dist/assets/{config-Cyum2gRs.js → config-VPSq73n8.js} +1 -1
- package/dist/assets/{copy-D03Y7IMR.js → copy-D8O_CYCG.js} +1 -1
- package/dist/assets/{copy-RyCOE8jo.js → copy-Djr5m5ac.js} +1 -1
- package/dist/assets/{copy-icon-wfSGfX8v.js → copy-icon-BIiRXh_3.js} +1 -1
- package/dist/assets/{createLucideIcon-rHn2EdoM.js → createLucideIcon-DfJ2oMlA.js} +1 -1
- package/dist/assets/{createReducer-W5dowuCe.js → createReducer-DgRODTW6.js} +1 -1
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-BW3uXbHa.js → cynefinDiagram-5FMLGOSQ-Cy86eSwK.js} +1 -1
- package/dist/assets/{dagre-GXQ25YYZ-DIV0whJf.js → dagre-GXQ25YYZ-CcWiU9Wf.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-DuYKABwo.js → data-grid-overlay-editor-CMnBpfPb.js} +1 -1
- package/dist/assets/{database-zap-CrkOvbyN.js → database-zap-B_PMVg8T.js} +1 -1
- package/dist/assets/{datasource-Tst92Pzi.js → datasource-Cq6x_5ML.js} +1 -1
- package/dist/assets/dates-BbFQ2oE4.js +1 -0
- package/dist/assets/{dependency-graph-panel-CLrAZrHA.js → dependency-graph-panel--Kgtktcw.js} +1 -1
- package/dist/assets/{diagram-S7CK7UJ4-BzoPaaoH.js → diagram-S7CK7UJ4-hmuvh6TI.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-BnOSn29R.js → diagram-UQ7AKVKN-CM3XDKRP.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-DAz8vger.js → diagram-VSXAHHWV-B8HedxR3.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-BQOZxgYE.js → diagram-VX7I27RA-D_5dmdWD.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-B_OF69Ac.js → diagram-Z3DM3KII-DWHvDoOc.js} +1 -1
- package/dist/assets/{dist-DoyTOIOd.js → dist-D6KQW558.js} +1 -1
- package/dist/assets/{dist-Cm7MoInu.js → dist-DR-Kwzb9.js} +1 -1
- package/dist/assets/{dist-Bqtq4wYM.js → dist-iaThVDkA.js} +1 -1
- package/dist/assets/{documentation-panel-OMUbXgKW.js → documentation-panel-BHmbeznw.js} +1 -1
- package/dist/assets/{download-CPMAf7re.js → download-DCJXy66H.js} +1 -1
- package/dist/assets/{dropdown-menu-B2JUUcK7.js → dropdown-menu-C1rnl-0o.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-BbkBTazy.js → ebnfDiagram-PWID7BFC-2XbadxRe.js} +1 -1
- package/dist/assets/{edit-page-Ctwp3mZE.js → edit-page-ChcSgpke.js} +6 -6
- package/dist/assets/{ellipsis-CLMWXUqY.js → ellipsis-63DyBLHQ.js} +1 -1
- package/dist/assets/{empty-state-CzxjZqGW.js → empty-state-BaCKb7o3.js} +1 -1
- package/dist/assets/{en-US-B4U3zuiu.js → en-US-Buu61juQ.js} +1 -1
- package/dist/assets/{erDiagram-RLTQ6QDP-DxDHwsU0.js → erDiagram-RLTQ6QDP-DbTcKdOV.js} +1 -1
- package/dist/assets/{error-banner-D1_bPN9u.js → error-banner-Cd69vvyX.js} +1 -1
- package/dist/assets/{error-entries-DBpwg0GC.js → error-entries-Dk3VZ-OK.js} +1 -1
- package/dist/assets/{error-panel-BgYJTJpA.js → error-panel-BPRYmC5J.js} +1 -1
- package/dist/assets/{errors-D9vyuMar.js → errors-DCrsa1nH.js} +1 -1
- package/dist/assets/{es-KNLgCZL4.js → es-Cqst59WX.js} +1 -1
- package/dist/assets/{esm-3WkPrffD.js → esm-CI_o7NhW.js} +1 -1
- package/dist/assets/{external-link-D2lKwXyB.js → external-link-UrX9KO36.js} +1 -1
- package/dist/assets/{eye-off-CfkK-QS3.js → eye-off-CxVozGAC.js} +1 -1
- package/dist/assets/feedback-button-B2gKC5cn.js +1 -0
- package/dist/assets/{feedback-button-7KY7nL-j.js → feedback-button-Bik2-e33.js} +1 -1
- package/dist/assets/{file-mCR_SMtq.js → file-BPBVl9pl.js} +1 -1
- package/dist/assets/{file-explorer-panel-HvVNt0Qs.js → file-explorer-panel-BEEK5lcl.js} +1 -1
- package/dist/assets/{file-headphone-DKocX1z0.js → file-headphone-Dl35U6h3.js} +1 -1
- package/dist/assets/{file-icons-e7tmeyP-.js → file-icons-CdJgUy-I.js} +1 -1
- package/dist/assets/{file-name-input-DZehOHLA.js → file-name-input-Cdc-TVqO.js} +1 -1
- package/dist/assets/{fileToBase64-aqhlf6Jj.js → fileToBase64-BgBraYAr.js} +1 -1
- package/dist/assets/{floating-outline-K7cVdOlC.js → floating-outline-XD9FAV-f.js} +1 -1
- package/dist/assets/flowDiagram-HODETNUW-DR34jHUd.js +1 -0
- package/dist/assets/{formats-DkOlpVdf.js → formats-yZ06h1Pl.js} +1 -1
- package/dist/assets/{formatting-Civx9FAg.js → formatting-BqrP-n49.js} +1 -1
- package/dist/assets/{fullscreen-DEBblJKh.js → fullscreen-B9tHcfpV.js} +1 -1
- package/dist/assets/{gallery-page-DoriMrLH.js → gallery-page-Dm6mGwBi.js} +1 -1
- package/dist/assets/{ganttDiagram-EL5Y4UJY-BzkL5tY7.js → ganttDiagram-EL5Y4UJY-2n7Ig5Jm.js} +1 -1
- package/dist/assets/{gitGraphDiagram-WWUBYQGX-DqtmYSBS.js → gitGraphDiagram-WWUBYQGX-DxR7RNkL.js} +1 -1
- package/dist/assets/{github-khsXwCtv.js → github-DQZhN3La.js} +1 -1
- package/dist/assets/{glide-data-editor-DWyeHe3u.js → glide-data-editor-J9CAb70d.js} +4 -4
- package/dist/assets/{glide-utils-BzwA3q-e.js → glide-utils-CIrAxdjv.js} +1 -1
- package/dist/assets/{globe-CmFhHoL1.js → globe-UdPdIbF7.js} +1 -1
- package/dist/assets/{hat-glasses-DVgK5i5l.js → hat-glasses-C8RhSVii.js} +1 -1
- package/dist/assets/{highlighted-body-KPVGNVTW-DxcqwMAu.js → highlighted-body-KPVGNVTW-BBA_Oaqj.js} +1 -1
- package/dist/assets/{home-page-BcJJsD_Q.js → home-page-DMHnsRxm.js} +1 -1
- package/dist/assets/{hooks-Qxjt0Ypd.js → hooks-93IwHd2u.js} +1 -1
- package/dist/assets/{house-CbkYoQ5W.js → house-CpsMWsLL.js} +1 -1
- package/dist/assets/{html-to-image-CFVIG1VZ.js → html-to-image-DK9Zl1lU.js} +1 -1
- package/dist/assets/{icons-CVdkfEA3.js → icons-CiZ_8zS-.js} +1 -1
- package/dist/assets/{image-CTch9x2I.js → image-wZvTj8WY.js} +1 -1
- package/dist/assets/{index-CXX6l_22.css → index-Bcdzex-3.css} +1 -1
- package/dist/assets/{index-B3pNgH5o.js → index-s-M1OXjs.js} +6 -6
- package/dist/assets/{infoDiagram-27XIBGKW-7rLCp1UQ.js → infoDiagram-27XIBGKW-U5Oqw16-.js} +1 -1
- package/dist/assets/{input-DPd57MDP.js → input-BoBxR50a.js} +1 -1
- package/dist/assets/{isValid-BEbe1fFs.js → isValid-q_Ad80ug.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-BH7XUtkN.js → ishikawaDiagram-5VMMS53U-Bob74yfq.js} +1 -1
- package/dist/assets/{journeyDiagram-3NMN7TZE-BOj0kV6v.js → journeyDiagram-3NMN7TZE-CO3wos0F.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-CPrudFOv.js → kanban-definition-UXKFOSKX-HnyRfUfJ.js} +1 -1
- package/dist/assets/katex-C9vVdkK0.js +1 -0
- package/dist/assets/{katex-DUp2KybH.js → katex-CF1UBJcr.js} +5 -5
- package/dist/assets/{kbd-BnUiViRu.js → kbd-pdKBv96t.js} +1 -1
- package/dist/assets/kiosk-mode-BZECfg9k.js +1 -0
- package/dist/assets/{layout-CSLw6wGo.js → layout-DmcNEu3P.js} +4 -4
- package/dist/assets/{link-BF4dGmOQ.js → link-NuFVR7G9.js} +1 -1
- package/dist/assets/links-DkkL9DVa.js +1 -0
- package/dist/assets/{logs-panel-OkoO5mbN.js → logs-panel-ABM16htT.js} +1 -1
- package/dist/assets/loro_wasm_bg-C2Fqi8D-.js +1 -0
- package/dist/assets/loro_wasm_bg-CSolyDSZ.wasm +0 -0
- package/dist/assets/loro_wasm_bg-Ctp2cNI9.js +1 -0
- package/dist/assets/{marimo-icons-B_1oPpIE.js → marimo-icons-CqliHyTr.js} +1 -1
- package/dist/assets/{markdown-renderer-mDlWBE1M.js → markdown-renderer-BG3sp2rs.js} +2 -2
- package/dist/assets/{menu-items-DAaNKHJF.js → menu-items-BrwnTgyK.js} +1 -1
- package/dist/assets/mermaid-HWGCJPDP-B7ByBG-a.js +1 -0
- package/dist/assets/{mermaid-CX6aTquk.js → mermaid-a3xYymTy.js} +3 -3
- package/dist/assets/{message-circle-OTHnVlxO.js → message-circle-C3rKm8_a.js} +1 -1
- package/dist/assets/{mhchem-hMh9XtQZ.js → mhchem-B6WrVrmp.js} +1 -1
- package/dist/assets/{mindmap-definition-YA3MSWOX-kWyI8sXl.js → mindmap-definition-YA3MSWOX-Tl5cqnHr.js} +1 -1
- package/dist/assets/{multi-icon-DWzZu-9u.js → multi-icon-DL465pPF.js} +1 -1
- package/dist/assets/{name-cell-input-D_Q2IhP9.js → name-cell-input-BgEBmqyL.js} +1 -1
- package/dist/assets/{number-overlay-editor-myrryj7o.js → number-overlay-editor-DS8xi0jE.js} +1 -1
- package/dist/assets/{numbers-BEfBaQtu.js → numbers-Mk3-CcoU.js} +1 -1
- package/dist/assets/{outline-panel-Dy2cmYDF.js → outline-panel-DCXQ3_F6.js} +1 -1
- package/dist/assets/{package-BeYhVWvM.js → package-GSoSTiIK.js} +1 -1
- package/dist/assets/{package-data-BwaspaKJ.js → package-data-dv4FBHxR.js} +1 -1
- package/dist/assets/{packages-panel-CIvhx0hb.js → packages-panel-BMGOmZkR.js} +1 -1
- package/dist/assets/pair-CaQyK6En.js +1 -0
- package/dist/assets/{panel-accordion-state-BI4SU22L.js → panel-accordion-state-C1sdPp0m.js} +1 -1
- package/dist/assets/{panel-context-BPaQeOuV.js → panel-context-C2QXpKfx.js} +1 -1
- package/dist/assets/{panels-BdsXFz1w.js → panels-CxVG8-v2.js} +1 -1
- package/dist/assets/{pathUtils-BKesuhdv.js → pathUtils-DPmlLd-r.js} +1 -1
- package/dist/assets/{paths-CzfpItSz.js → paths-bkIFVj8h.js} +1 -1
- package/dist/assets/{pegDiagram-XKGWAZYB-CiBJGPte.js → pegDiagram-XKGWAZYB-a0itOiYa.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-RpjpKhU6.js → pieDiagram-E7YTZNPT-DFve8H9P.js} +1 -1
- package/dist/assets/plus-C5silF6g.js +1 -0
- package/dist/assets/process-output-D0KGq04R.js +1 -0
- package/dist/assets/{quadrantDiagram-AXDQQJYC-Ci_qzCqs.js → quadrantDiagram-AXDQQJYC-yBhCDI7E.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-B2IWK3fJ.js → railroadDiagram-O6MQD6OU-CgwdYhrd.js} +1 -1
- package/dist/assets/react-DVplv7_D.js +1 -0
- package/dist/assets/react-dom-_LrxgvjW.js +1 -0
- package/dist/assets/{react-icons.esm-C6SMwKZH.js → react-icons.esm-D6tfmvq8.js} +1 -1
- package/dist/assets/{react-resizable-panels.browser.esm-BL2E7f5c.js → react-resizable-panels.browser.esm-Dbe0MrFr.js} +1 -1
- package/dist/assets/{react-vega-Jq3Jd7eX.js → react-vega-C3rYGtP6.js} +1 -1
- package/dist/assets/{readonly-code-display-CNbw6v1-.js → readonly-code-display-Do50PHI8.js} +1 -1
- package/dist/assets/{readonly-python-code-DcYhdd1B.js → readonly-python-code-DCSMIsTX.js} +1 -1
- package/dist/assets/{refresh-cw-CEGpOrzd.js → refresh-cw-Qw1f8Jhy.js} +1 -1
- package/dist/assets/{renderShortcut-BnRfkbwf.js → renderShortcut-BkVJQ_Zh.js} +1 -1
- package/dist/assets/requests-CgSY1X4a.js +1 -0
- package/dist/assets/{requests-yTHMxhVa.js → requests-lt0JK8Jt.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-B0_CyV0T.js → requirementDiagram-BXWQKSXE-BCDzS-aV.js} +1 -1
- package/dist/assets/{reveal-component-wEV_sB3u.css → reveal-component-DMRR6gKy.css} +1 -1
- package/dist/assets/reveal-component-ltaepAqw.js +1069 -0
- package/dist/assets/{rotate-ccw-se3Oa1US.js → rotate-ccw-D8WCVWNE.js} +1 -1
- package/dist/assets/{rotate-cw-BcRERxHa.js → rotate-cw-CZ2syZTu.js} +1 -1
- package/dist/assets/{run-page-CVWospEP.js → run-page-DF3c5cDk.js} +1 -1
- package/dist/assets/{runs-DyluVj69.js → runs-BLp5jezv.js} +1 -1
- package/dist/assets/{runtime-details-state-lxXYwJcI.js → runtime-details-state-CSPobEdR.js} +1 -1
- package/dist/assets/{sankeyDiagram-P5KCCOFB-BekzhMvv.js → sankeyDiagram-P5KCCOFB-byYeKbB2.js} +1 -1
- package/dist/assets/{save-D4cG4pP2.js → save-Dgoim6QF.js} +1 -1
- package/dist/assets/save-worker-BbUSwZRG.js +118 -0
- package/dist/assets/schemas-Dv42wLFq.js +56 -0
- package/dist/assets/{scratchpad-panel-B4qlmwP-.js → scratchpad-panel-Dwd6W5PE.js} +1 -1
- package/dist/assets/{scroll-to-bottom-button-Dmrd5bjQ.js → scroll-to-bottom-button-1FyowpWV.js} +1 -1
- package/dist/assets/{secrets-panel-DT1Nansx.js → secrets-panel-Bctbtkrp.js} +1 -1
- package/dist/assets/{select-BwRFbZty.js → select-DTBn5eTb.js} +1 -1
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-DELi1Kz5.js → sequenceDiagram-WJ2MYXX4-CLLPBM4B.js} +1 -1
- package/dist/assets/{session-BykGt6S3.js → session-DqoWmb7X.js} +1 -1
- package/dist/assets/{session-panel-Ch5jQNj0.js → session-panel-VdDhEBa-.js} +1 -1
- package/dist/assets/{settings-DlKTeV_0.js → settings-BpdQZRgT.js} +1 -1
- package/dist/assets/{shell-BSnvn9t7.js → shell-Fj8a65ii.js} +1 -1
- package/dist/assets/{shim-5li_pJY_.js → shim-CjjJUhDo.js} +1 -1
- package/dist/assets/{skeleton-CKpBjoLm.js → skeleton-Cqh4O9g1.js} +1 -1
- package/dist/assets/{snippets-panel-YttkYAW9.js → snippets-panel-Bh1oTw4m.js} +1 -1
- package/dist/assets/{spec-D9d9nT0z.js → spec-BfSBcO5B.js} +1 -1
- package/dist/assets/{spinner-CGdRKCnw.js → spinner-DyNE-o8o.js} +1 -1
- package/dist/assets/square-BPmgQFnh.js +1 -0
- package/dist/assets/{square-function-DyFIOFp5.js → square-function-_W_Lo0P4.js} +1 -1
- package/dist/assets/state-BAJYRhmO.js +1 -0
- package/dist/assets/{state-ja7GWeCS.js → state-C3oDoyFe.js} +1 -1
- package/dist/assets/{state-B2ZbImvm.js → state-DxQnC_1I.js} +1 -1
- package/dist/assets/{state-BI0fn_YF.js → state-XsPO8hNi.js} +1 -1
- package/dist/assets/{state-sbCCk7ZP.js → state-_Qai_QyX.js} +2 -2
- package/dist/assets/{state-BxLm8vme.js → state-uwRvJLb8.js} +1 -1
- package/dist/assets/{stateDiagram-D77RDMKH-udui7EYS.js → stateDiagram-D77RDMKH-BeIsqkgQ.js} +1 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-YdOj4q4D.js +1 -0
- package/dist/assets/{strings-hlCLC-K1.js → strings-B2vv-ENv.js} +1 -1
- package/dist/assets/{swimlanes-42K2YHIH-C-iTrYJs.js → swimlanes-42K2YHIH-CIhaeNCx.js} +1 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-BLZbCKkx.js +8 -0
- package/dist/assets/{swiper-component-eXUBvFuA.js → swiper-component-a07domrZ.js} +1 -1
- package/dist/assets/{switch-C-83e2fG.js → switch-CTaiAjrz.js} +1 -1
- package/dist/assets/{table-B7KYyTxw.js → table-DG7Ap4H4.js} +1 -1
- package/dist/assets/{table-Dg1KxH-q.js → table-vrvqpuKJ.js} +1 -1
- package/dist/assets/{tabs-QRT1DYjj.js → tabs-BuQlZFbt.js} +1 -1
- package/dist/assets/{terminal-3hxM6K9q.js → terminal-Ck_vK-34.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-D2u0nOZp.js → timeline-definition-24CTP7MA-BSH7-Tss.js} +1 -1
- package/dist/assets/toDate-DOj9Q6uC.js +1 -0
- package/dist/assets/{toast-BRwEbWb6.js → toast-BGzLGnvw.js} +1 -1
- package/dist/assets/{tooltip-B5pI8o2n.js → tooltip-C9TuY18o.js} +1 -1
- package/dist/assets/{tooltip-BeP4eX87.js → tooltip-mT3CGest.js} +1 -1
- package/dist/assets/{tracing-DZYfCw6p.js → tracing-Di6pUmX8.js} +1 -1
- package/dist/assets/tracing-panel-PeRXHD8_.js +2 -0
- package/dist/assets/{trash-2-BJG-7Qob.js → trash-2-DcgaW8fn.js} +1 -1
- package/dist/assets/{trash-BKbZYRHl.js → trash-ChRHEGfM.js} +1 -1
- package/dist/assets/{tree-actions-D5clvgKl.js → tree-actions-GM5E_bUs.js} +1 -1
- package/dist/assets/{triangle-alert-BeRqoThc.js → triangle-alert-DmIqR8sY.js} +1 -1
- package/dist/assets/{use-restore-focus-GUh2Nd8Z.js → use-restore-focus-BxEGwIbk.js} +1 -1
- package/dist/assets/{use-toast-CC89xOwH.js → use-toast-Wu434mLr.js} +1 -1
- package/dist/assets/{use-vega-container-remeasure-CS3c8wGN.js → use-vega-container-remeasure-BpmHehNK.js} +1 -1
- package/dist/assets/{useAddCell-Bhv6GT3m.js → useAddCell-GR7eEQrT.js} +1 -1
- package/dist/assets/{useAsyncData-DucTwMkf.js → useAsyncData-C7aJJz0Y.js} +1 -1
- package/dist/assets/{useBoolean-Co-_MyFz.js → useBoolean-BDD6_xQQ.js} +1 -1
- package/dist/assets/{useCellActionButton-BTsPn8Dv.js → useCellActionButton-B-9eG5z_.js} +1 -1
- package/dist/assets/{useDateFormatter-CTYCgKB-.js → useDateFormatter-DA-62E-Y.js} +1 -1
- package/dist/assets/{useDebounce-DMbg9X18.js → useDebounce-B_ccBZTp.js} +1 -1
- package/dist/assets/useDeepCompareMemoize-DFIVN9dn.js +1 -0
- package/dist/assets/{useDeleteCell-BKN7t4DH.js → useDeleteCell-2_bMClHd.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-BTsnw2rN.js → useDependencyPanelTab-k3C3M18S.js} +1 -1
- package/dist/assets/{useEvent-Dc9HkKI2.js → useEvent-Dfcbgjhg.js} +1 -1
- package/dist/assets/{useEventListener-IRzG-0mH.js → useEventListener-D9cftcHj.js} +1 -1
- package/dist/assets/useIframeCapabilities-CwTkczVN.js +1 -0
- package/dist/assets/{useInstallPackage-HTUlGg0U.js → useInstallPackage-iX1eufdl.js} +1 -1
- package/dist/assets/{useInterval-D1QGqQ_I.js → useInterval--x3s1VpI.js} +1 -1
- package/dist/assets/{useLifecycle-DKSBdWUf.js → useLifecycle-Mq4gc5kS.js} +1 -1
- package/dist/assets/useNotebookActions-NHN6A-cN.js +1 -0
- package/dist/assets/{useNumberFormatter-BP99Zbyy.js → useNumberFormatter-D7O_26UI.js} +1 -1
- package/dist/assets/{useRunCells-zMO43eNR.js → useRunCells-B2vUhREg.js} +1 -1
- package/dist/assets/useSplitCell-DEb03htp.js +1 -0
- package/dist/assets/{useTheme-BkPLyRl9.js → useTheme-COhSHkCj.js} +1 -1
- package/dist/assets/{vega-component-Chbfi__Q.js → vega-component-CnadTgoE.js} +1 -1
- package/dist/assets/vega-embed-container-DJPNkHPb.js +1 -0
- package/dist/assets/{vennDiagram-4TSXK5OY-BKSHsv-w.js → vennDiagram-4TSXK5OY-DsmfChmC.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-CUDQDDoy.js → wardleyDiagram-VM6X3IG4-BDZlVpJI.js} +1 -1
- package/dist/assets/worker-DTQ7oH2A.js +158 -0
- package/dist/assets/{workflow-nBi9HGeO.js → workflow-cw-0b9g5.js} +1 -1
- package/dist/assets/{write-secret-modal-BcosCmZy.js → write-secret-modal-DzKAInL2.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-BXDsTxGu.js → xychartDiagram-S5SC5T6Z-KbGzG6-u.js} +1 -1
- package/dist/assets/{youtube-2MBs34oQ.js → youtube-CbJhsgLy.js} +1 -1
- package/dist/index.html +123 -123
- package/package.json +21 -21
- package/src/components/data-table/__tests__/column_formatting.test.ts +30 -0
- package/src/components/data-table/__tests__/columns.test.tsx +70 -0
- package/src/components/data-table/column-formatting/feature.ts +20 -1
- package/src/components/data-table/columns.tsx +25 -18
- package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +4 -3
- package/src/components/editor/output/console/ConsoleOutput.tsx +5 -3
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +18 -0
- package/src/components/storage/__tests__/storage-file-viewer.test.tsx +2 -1
- package/src/core/cells/__tests__/document-roundtrip.test.ts +16 -0
- package/src/core/codemirror/copilot/__tests__/completion-integration.test.ts +447 -0
- package/src/core/codemirror/copilot/__tests__/inline-completion.test.ts +395 -0
- package/src/core/codemirror/copilot/__tests__/language-server.test.ts +511 -2
- package/src/core/codemirror/copilot/__tests__/rpc-cancellation.test.ts +201 -0
- package/src/core/codemirror/copilot/extension.ts +22 -11
- package/src/core/codemirror/copilot/language-server.ts +109 -60
- package/src/core/codemirror/language/__tests__/sql.test.ts +4 -3
- package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +138 -26
- package/src/core/codemirror/language/embedded/embedded-python.ts +47 -13
- package/src/core/codemirror/language/embedded/latex.ts +20 -13
- package/src/core/datasets/__tests__/data-source-discovery.test.ts +18 -11
- package/src/core/islands/bridge.ts +2 -2
- package/src/core/kernel/messages.ts +4 -7
- package/src/core/network/__tests__/api.test.ts +114 -1
- package/src/core/network/api.ts +3 -2
- package/src/core/wasm/bridge.ts +2 -2
- package/src/core/wasm/worker/types.ts +2 -2
- package/src/css/katex-css.test.ts +1 -1
- package/src/css/katex.min.css +6 -1
- package/src/hooks/__tests__/useEventListener.test.tsx +45 -1
- package/src/hooks/useEventListener.ts +6 -1
- package/src/plugins/impl/NumberPlugin.tsx +20 -3
- package/src/plugins/impl/__tests__/NumberPlugin.test.tsx +159 -1
- package/dist/assets/JsonOutput-DCGUcLVV.js +0 -11
- package/dist/assets/__vite-browser-external-BgsHWynV.js +0 -1
- package/dist/assets/__vite-browser-external-DMJaCYJh.js +0 -1
- package/dist/assets/add-cell-with-ai-Wyt6GBhk.js +0 -76
- package/dist/assets/ai-model-dropdown-CvJsRj9y.js +0 -5
- package/dist/assets/app-config-button-C7QrZbqr.js +0 -1
- package/dist/assets/arrow-down-BFFrjzad.js +0 -1
- package/dist/assets/arrow-left-DzPJ79ZB.js +0 -1
- package/dist/assets/arrow-right-xoNT7eIQ.js +0 -1
- package/dist/assets/ban-3HAzm9Fj.js +0 -1
- package/dist/assets/cells-CxY8RSp7.js +0 -220
- package/dist/assets/channel-DXBvxHxq.js +0 -1
- package/dist/assets/chat-panel-BZipGUZV.js +0 -4
- package/dist/assets/check-Wea4hZ6R.js +0 -1
- package/dist/assets/chevron-right-DOPs2jx8.js +0 -1
- package/dist/assets/circle-check-BF80fXZd.js +0 -1
- package/dist/assets/classDiagram-ZZMXUADV--9ShP1h2.js +0 -1
- package/dist/assets/classDiagram-v2-VYDZK3BY--9ShP1h2.js +0 -1
- package/dist/assets/code-DW4kNwKG.js +0 -1
- package/dist/assets/coerce-CZiN7rQ_.js +0 -1
- package/dist/assets/command-palette-BM9fUfEe.js +0 -1
- package/dist/assets/dates-BgcKUsHb.js +0 -1
- package/dist/assets/feedback-button-DxjoRfo3.js +0 -1
- package/dist/assets/flowDiagram-HODETNUW-BGVnBaF-.js +0 -1
- package/dist/assets/katex-CQIbPNPT.js +0 -1
- package/dist/assets/kiosk-mode-DCHo0R3W.js +0 -1
- package/dist/assets/links-BJx6KCyC.js +0 -1
- package/dist/assets/loro_wasm_bg-PyJsS6iH.wasm +0 -0
- package/dist/assets/loro_wasm_bg-Vo2IoHaL.js +0 -1
- package/dist/assets/loro_wasm_bg-oTW3uoGB.js +0 -1
- package/dist/assets/mermaid-HWGCJPDP-Bk1fR60Q.js +0 -1
- package/dist/assets/pair-_FSgYVX4.js +0 -1
- package/dist/assets/plus-gbN72xHe.js +0 -1
- package/dist/assets/process-output-Crm0vqbi.js +0 -1
- package/dist/assets/react-CUdNIagt.js +0 -1
- package/dist/assets/react-dom-CKsE8sC1.js +0 -1
- package/dist/assets/requests-DFPPfagc.js +0 -1
- package/dist/assets/reveal-component-B5GUiD5Q.js +0 -1069
- package/dist/assets/save-worker-C880NC3o.js +0 -113
- package/dist/assets/schemas-BL-NsLlF.js +0 -51
- package/dist/assets/square-DvOKKLHZ.js +0 -1
- package/dist/assets/state-YaAkDV8S.js +0 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-BhduIvF1.js +0 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-WC2Zewqb.js +0 -8
- package/dist/assets/toDate-BbJ1_N2T.js +0 -1
- package/dist/assets/tracing-panel-BUPJ77jB.js +0 -2
- package/dist/assets/useDeepCompareMemoize-DSlTt6u_.js +0 -1
- package/dist/assets/useIframeCapabilities-yd8sMuIo.js +0 -1
- package/dist/assets/useNotebookActions-BzJtySGp.js +0 -1
- package/dist/assets/useSplitCell-xEtFLByO.js +0 -1
- package/dist/assets/vega-embed-container-CRZZ4FTx.js +0 -1
- package/dist/assets/worker-B5tVfGoh.js +0 -153
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import type { CompletionContext } from "@codemirror/autocomplete";
|
|
4
4
|
import { python } from "@codemirror/lang-python";
|
|
5
|
+
import { StreamLanguage } from "@codemirror/language";
|
|
6
|
+
import { stexMath } from "@codemirror/legacy-modes/mode/stex";
|
|
5
7
|
import { EditorState } from "@codemirror/state";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
+
import { classHighlighter, highlightTree } from "@lezer/highlight";
|
|
9
|
+
import { parser as markdownParser } from "@lezer/markdown";
|
|
10
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
8
11
|
import { cellId, variableName } from "@/__tests__/branded";
|
|
9
12
|
import { store } from "@/core/state/jotai";
|
|
10
13
|
import { variablesAtom } from "@/core/variables/state";
|
|
11
14
|
import { parsePython, variableCompletionSource } from "../embedded-python";
|
|
15
|
+
import { parseLatex } from "../latex";
|
|
12
16
|
|
|
13
17
|
const IS_ACTIVE = () => true;
|
|
14
18
|
|
|
@@ -23,25 +27,133 @@ describe("parsePython", () => {
|
|
|
23
27
|
]);
|
|
24
28
|
});
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
const cases = [
|
|
31
|
+
"{math.exp(3)}",
|
|
32
|
+
'${math.exp(3) + len("$}")} $',
|
|
33
|
+
"${math.exp(3)} + {math.sin(3)}$",
|
|
34
|
+
"${math.exp(3)}$",
|
|
35
|
+
"$$ {math.exp(3)} $$",
|
|
36
|
+
String.raw`\({math.exp(3)}\)`,
|
|
37
|
+
String.raw`\[{math.exp(3)}\]`,
|
|
38
|
+
String.raw`\\({math.exp(3)}\\)`,
|
|
39
|
+
String.raw`\\[{math.exp(3)}\\]`,
|
|
40
|
+
String.raw`$\frac{{{math.exp(3)}}}{{2}}$`,
|
|
41
|
+
String.raw`$\{math.exp(3)}$`,
|
|
42
|
+
'${ {"}": math.exp(3)} }$',
|
|
43
|
+
"${math.exp(3):{width}.{precision}f}$",
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
function highlightedProperties(doc: string, prefix: string) {
|
|
47
|
+
const parser = markdownParser.configure([
|
|
48
|
+
parseLatex(StreamLanguage.define(stexMath).parser),
|
|
49
|
+
parsePython(python().language.parser, () => prefix.includes("f")),
|
|
50
|
+
]);
|
|
51
|
+
const properties: string[] = [];
|
|
52
|
+
highlightTree(parser.parse(doc), classHighlighter, (from, to, classes) => {
|
|
53
|
+
if (classes.split(" ").includes("tok-propertyName")) {
|
|
54
|
+
properties.push(doc.slice(from, to));
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return properties;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
it.each(["f", "rf", "fr"])(
|
|
61
|
+
"highlights interpolation with %s strings",
|
|
62
|
+
(prefix) => {
|
|
63
|
+
for (const doc of cases) {
|
|
64
|
+
expect(highlightedProperties(doc, prefix)).toEqual(
|
|
65
|
+
doc.includes("math.sin") ? ["exp", "sin"] : ["exp"],
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
it.each(["", "r"])("does not interpolate %s strings", (prefix) => {
|
|
72
|
+
for (const doc of cases) {
|
|
73
|
+
expect(highlightedProperties(doc, prefix)).toEqual([]);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("parses replacement boundaries once for a paragraph with many interpolations", () => {
|
|
27
78
|
const pythonParser = python().language.parser;
|
|
28
|
-
const
|
|
79
|
+
const parse = vi.spyOn(pythonParser, "parse");
|
|
80
|
+
try {
|
|
81
|
+
const doc = "{math.exp(3)} ".repeat(1000);
|
|
82
|
+
const parser = markdownParser.configure([
|
|
83
|
+
parseLatex(StreamLanguage.define(stexMath).parser),
|
|
84
|
+
parsePython(pythonParser, IS_ACTIVE),
|
|
85
|
+
]);
|
|
86
|
+
const properties: string[] = [];
|
|
87
|
+
highlightTree(
|
|
88
|
+
parser.parse(doc),
|
|
89
|
+
classHighlighter,
|
|
90
|
+
(from, to, classes) => {
|
|
91
|
+
if (classes.split(" ").includes("tok-propertyName")) {
|
|
92
|
+
properties.push(doc.slice(from, to));
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
);
|
|
96
|
+
expect(properties).toEqual(Array.from({ length: 1000 }, () => "exp"));
|
|
97
|
+
expect(parse).toHaveBeenCalledTimes(1);
|
|
98
|
+
} finally {
|
|
99
|
+
parse.mockRestore();
|
|
100
|
+
}
|
|
101
|
+
});
|
|
29
102
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
103
|
+
it("preserves raw backslashes between replacements", () => {
|
|
104
|
+
expect(
|
|
105
|
+
highlightedProperties(String.raw`{math.exp(3)} \N{math.sin(3)}`, "rf"),
|
|
106
|
+
).toEqual(["exp", "sin"]);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("finds replacements after triple quotes in markdown text", () => {
|
|
110
|
+
expect(
|
|
111
|
+
highlightedProperties('{math.exp(3)} """ {math.sin(3)}', "f"),
|
|
112
|
+
).toEqual(["exp", "sin"]);
|
|
113
|
+
});
|
|
40
114
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
115
|
+
it("keeps replacement positions local to each paragraph", () => {
|
|
116
|
+
expect(
|
|
117
|
+
highlightedProperties("${math.exp(3)}$\n\n${math.sin(3)}$", "rf"),
|
|
118
|
+
).toEqual(["exp", "sin"]);
|
|
44
119
|
});
|
|
120
|
+
|
|
121
|
+
it("preserves LaTeX highlighting around Python replacements", () => {
|
|
122
|
+
const doc = String.raw`$\frac{{{math.exp(3)}}}{{2}} + \alpha$`;
|
|
123
|
+
const parser = markdownParser.configure([
|
|
124
|
+
parseLatex(StreamLanguage.define(stexMath).parser),
|
|
125
|
+
parsePython(python().language.parser, IS_ACTIVE),
|
|
126
|
+
]);
|
|
127
|
+
const highlighted: string[] = [];
|
|
128
|
+
highlightTree(parser.parse(doc), classHighlighter, (from, to) => {
|
|
129
|
+
highlighted.push(doc.slice(from, to));
|
|
130
|
+
});
|
|
131
|
+
expect(highlighted).toEqual(
|
|
132
|
+
expect.arrayContaining(["\\frac", "exp", "\\alpha"]),
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it.each(["${math.exp(3)$", "${math.exp(3)", "${{math.exp(3)}$"])(
|
|
137
|
+
"does not treat incomplete or escaped braces as replacements: %s",
|
|
138
|
+
(doc) => {
|
|
139
|
+
expect(highlightedProperties(doc, "f")).toEqual([]);
|
|
140
|
+
},
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
it.each(["f", "rf", "fr"])(
|
|
144
|
+
"keeps doubled braces literal in %s strings",
|
|
145
|
+
(prefix) => {
|
|
146
|
+
for (const doc of [
|
|
147
|
+
"{{math.exp(3)}}",
|
|
148
|
+
"${{math.exp(3)}}$",
|
|
149
|
+
"$ {{{{math.exp(3)}}}} $",
|
|
150
|
+
String.raw`$\{{math.exp(3)}}$`,
|
|
151
|
+
String.raw`$\frac{{1}}{{2}}$`,
|
|
152
|
+
]) {
|
|
153
|
+
expect(highlightedProperties(doc, prefix)).toEqual([]);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
);
|
|
45
157
|
});
|
|
46
158
|
|
|
47
159
|
describe("variableCompletionSource", () => {
|
|
@@ -72,10 +184,10 @@ describe("variableCompletionSource", () => {
|
|
|
72
184
|
const context: Partial<CompletionContext> = {
|
|
73
185
|
pos: 8,
|
|
74
186
|
explicit: false,
|
|
75
|
-
matchBefore: (
|
|
187
|
+
matchBefore: (_expr: RegExp) => ({ from: 7, to: 8, text: "v" }),
|
|
76
188
|
state,
|
|
77
189
|
aborted: false,
|
|
78
|
-
tokenBefore: (
|
|
190
|
+
tokenBefore: (_types: readonly string[]) => null,
|
|
79
191
|
};
|
|
80
192
|
|
|
81
193
|
const result = variableCompletionSource(context as CompletionContext);
|
|
@@ -92,10 +204,10 @@ describe("variableCompletionSource", () => {
|
|
|
92
204
|
const context: Partial<CompletionContext> = {
|
|
93
205
|
pos: 7,
|
|
94
206
|
explicit: false,
|
|
95
|
-
matchBefore: (
|
|
207
|
+
matchBefore: (_expr: RegExp) => ({ from: 6, to: 7, text: "v" }),
|
|
96
208
|
state,
|
|
97
209
|
aborted: false,
|
|
98
|
-
tokenBefore: (
|
|
210
|
+
tokenBefore: (_types: readonly string[]) => null,
|
|
99
211
|
};
|
|
100
212
|
|
|
101
213
|
const result = variableCompletionSource(context as CompletionContext);
|
|
@@ -110,10 +222,10 @@ describe("variableCompletionSource", () => {
|
|
|
110
222
|
const context: Partial<CompletionContext> = {
|
|
111
223
|
pos: 13,
|
|
112
224
|
explicit: false,
|
|
113
|
-
matchBefore: (
|
|
225
|
+
matchBefore: (_expr: RegExp) => ({ from: 12, to: 13, text: "v" }),
|
|
114
226
|
state,
|
|
115
227
|
aborted: false,
|
|
116
|
-
tokenBefore: (
|
|
228
|
+
tokenBefore: (_types: readonly string[]) => null,
|
|
117
229
|
};
|
|
118
230
|
|
|
119
231
|
const result = variableCompletionSource(context as CompletionContext);
|
|
@@ -131,7 +243,7 @@ describe("variableCompletionSource", () => {
|
|
|
131
243
|
matchBefore: () => null,
|
|
132
244
|
state,
|
|
133
245
|
aborted: false,
|
|
134
|
-
tokenBefore: (
|
|
246
|
+
tokenBefore: (_types: readonly string[]) => null,
|
|
135
247
|
};
|
|
136
248
|
|
|
137
249
|
const result = variableCompletionSource(context as CompletionContext);
|
|
@@ -146,10 +258,10 @@ describe("variableCompletionSource", () => {
|
|
|
146
258
|
const context: Partial<CompletionContext> = {
|
|
147
259
|
pos: 9,
|
|
148
260
|
explicit: false,
|
|
149
|
-
matchBefore: (
|
|
261
|
+
matchBefore: (_expr: RegExp) => ({ from: 8, to: 9, text: "v" }),
|
|
150
262
|
state,
|
|
151
263
|
aborted: false,
|
|
152
|
-
tokenBefore: (
|
|
264
|
+
tokenBefore: (_types: readonly string[]) => null,
|
|
153
265
|
};
|
|
154
266
|
|
|
155
267
|
const result = variableCompletionSource(context as CompletionContext);
|
|
@@ -16,11 +16,8 @@ import { getVariableCompletions } from "../../completion/variable-completions";
|
|
|
16
16
|
const PYTHON = "Python";
|
|
17
17
|
|
|
18
18
|
const OPEN_BRACE = 123; // {
|
|
19
|
-
const CLOSE_BRACE = 125; // }
|
|
20
19
|
const DELIMITER_LENGTH = 1;
|
|
21
20
|
|
|
22
|
-
const MARK = { mark: `${PYTHON}Mark`, resolve: PYTHON };
|
|
23
|
-
|
|
24
21
|
/**
|
|
25
22
|
* Define a Python code block parser for Markdown.
|
|
26
23
|
*
|
|
@@ -31,6 +28,11 @@ export function parsePython(
|
|
|
31
28
|
pythonParser: Parser,
|
|
32
29
|
isActivated: () => boolean,
|
|
33
30
|
): MarkdownConfig {
|
|
31
|
+
const replacements = new WeakMap<
|
|
32
|
+
InlineContext,
|
|
33
|
+
{ ends: Map<number, number>; parsedTo: number }
|
|
34
|
+
>();
|
|
35
|
+
|
|
34
36
|
const defineNodes = [
|
|
35
37
|
{ name: PYTHON, style: tags.emphasis },
|
|
36
38
|
{ name: `${PYTHON}Mark`, style: tags.processingInstruction },
|
|
@@ -41,26 +43,58 @@ export function parsePython(
|
|
|
41
43
|
parseInline: [
|
|
42
44
|
{
|
|
43
45
|
name: PYTHON,
|
|
46
|
+
before: "Escape",
|
|
44
47
|
parse(cx: InlineContext, next: number, pos: number): number {
|
|
45
48
|
if (!isActivated()) {
|
|
46
49
|
return -1;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
|
|
52
|
+
// A backslash does not escape a brace in Python f-strings.
|
|
53
|
+
if (next === 92 && cx.char(pos + 1) === OPEN_BRACE) {
|
|
54
|
+
return pos + 1;
|
|
55
|
+
}
|
|
56
|
+
if (next !== OPEN_BRACE) {
|
|
50
57
|
return -1;
|
|
51
58
|
}
|
|
59
|
+
if (cx.char(pos + 1) === OPEN_BRACE) {
|
|
60
|
+
return pos + 2;
|
|
61
|
+
}
|
|
52
62
|
|
|
53
|
-
|
|
54
|
-
if (
|
|
63
|
+
let cached = replacements.get(cx);
|
|
64
|
+
if (!cached || pos >= cached.parsedTo) {
|
|
65
|
+
// Cache all replacements so each brace does not reparse the paragraph.
|
|
66
|
+
// Keep Markdown backslashes from consuming braces as Python escapes.
|
|
67
|
+
const prefix = 'rf"""';
|
|
68
|
+
const tree = pythonParser.parse(
|
|
69
|
+
`${prefix}${cx.slice(pos, cx.end)}\n"""`,
|
|
70
|
+
);
|
|
71
|
+
const formatString = tree.topNode
|
|
72
|
+
.getChild("ExpressionStatement")
|
|
73
|
+
?.getChild("FormatString");
|
|
74
|
+
const offset = pos - prefix.length;
|
|
75
|
+
const ends = new Map<number, number>();
|
|
76
|
+
for (const replacement of formatString?.getChildren(
|
|
77
|
+
"FormatReplacement",
|
|
78
|
+
) ?? []) {
|
|
79
|
+
if (replacement.lastChild?.name === "}") {
|
|
80
|
+
ends.set(offset + replacement.from, offset + replacement.to);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
cached = {
|
|
84
|
+
ends,
|
|
85
|
+
parsedTo: formatString ? offset + formatString.to : cx.end,
|
|
86
|
+
};
|
|
87
|
+
replacements.set(cx, cached);
|
|
88
|
+
}
|
|
89
|
+
const end = cached.ends.get(pos);
|
|
90
|
+
if (end === undefined) {
|
|
55
91
|
return -1;
|
|
56
92
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
next === OPEN_BRACE,
|
|
63
|
-
next === CLOSE_BRACE,
|
|
93
|
+
return cx.addElement(
|
|
94
|
+
cx.elt(PYTHON, pos, end, [
|
|
95
|
+
cx.elt(`${PYTHON}Mark`, pos, pos + 1),
|
|
96
|
+
cx.elt(`${PYTHON}Mark`, end - 1, end),
|
|
97
|
+
]),
|
|
64
98
|
);
|
|
65
99
|
},
|
|
66
100
|
},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
30
30
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
31
31
|
|
|
32
|
-
import { type Parser, parseMixed } from "@lezer/common";
|
|
32
|
+
import { IterMode, type Parser, parseMixed } from "@lezer/common";
|
|
33
33
|
import { tags } from "@lezer/highlight";
|
|
34
34
|
import type {
|
|
35
35
|
DelimiterType,
|
|
@@ -231,24 +231,31 @@ export function parseLatex(latexParser: Parser): MarkdownConfig {
|
|
|
231
231
|
// Test if the node type is one of the math expression
|
|
232
232
|
const delimiterLength = DELIMITER_LENGTH[node.type.name];
|
|
233
233
|
if (delimiterLength) {
|
|
234
|
-
const from = node.from + delimiterLength;
|
|
235
|
-
const to = node.to - delimiterLength;
|
|
234
|
+
const from = node.node.firstChild?.to ?? node.from + delimiterLength;
|
|
235
|
+
const to = node.node.lastChild?.from ?? node.to - delimiterLength;
|
|
236
236
|
|
|
237
237
|
// Ensure valid ranges
|
|
238
238
|
if (from >= to || from < 0 || to < 0) {
|
|
239
239
|
return null;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
242
|
+
// Leave Python replacements to their own parser and highlighter.
|
|
243
|
+
const overlay: { from: number; to: number }[] = [];
|
|
244
|
+
let start = from;
|
|
245
|
+
node.node.cursor(IterMode.IgnoreMounts).iterate((child) => {
|
|
246
|
+
if (child.name !== "Python") {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (start < child.from) {
|
|
250
|
+
overlay.push({ from: start, to: child.from });
|
|
251
|
+
}
|
|
252
|
+
start = child.to;
|
|
253
|
+
return false;
|
|
254
|
+
});
|
|
255
|
+
if (start < to) {
|
|
256
|
+
overlay.push({ from: start, to });
|
|
257
|
+
}
|
|
258
|
+
return overlay.length ? { parser: latexParser, overlay } : null;
|
|
252
259
|
}
|
|
253
260
|
|
|
254
261
|
return null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { requestId } from "@/__tests__/branded";
|
|
4
|
+
import type { DataSourceDiscoveryResult } from "@/core/kernel/messages";
|
|
3
5
|
import { connectionAtom } from "@/core/network/connection";
|
|
4
6
|
import { store } from "@/core/state/jotai";
|
|
5
7
|
import { ConnectionState } from "@/core/websocket/types";
|
|
@@ -41,7 +43,7 @@ describe("fetchDataSourceDiscovery", () => {
|
|
|
41
43
|
it("shares a single in-flight request across concurrent callers", async () => {
|
|
42
44
|
const request = vi
|
|
43
45
|
.spyOn(DiscoverDataSources, "request")
|
|
44
|
-
.mockResolvedValue({ request_id: "request-id", sources: [] });
|
|
46
|
+
.mockResolvedValue({ request_id: requestId("request-id"), sources: [] });
|
|
45
47
|
|
|
46
48
|
await Promise.all([
|
|
47
49
|
fetchDataSourceDiscovery(),
|
|
@@ -55,7 +57,7 @@ describe("fetchDataSourceDiscovery", () => {
|
|
|
55
57
|
it("re-runs discovery after the cache is invalidated", async () => {
|
|
56
58
|
const request = vi
|
|
57
59
|
.spyOn(DiscoverDataSources, "request")
|
|
58
|
-
.mockResolvedValue({ request_id: "request-id", sources: [] });
|
|
60
|
+
.mockResolvedValue({ request_id: requestId("request-id"), sources: [] });
|
|
59
61
|
|
|
60
62
|
await fetchDataSourceDiscovery();
|
|
61
63
|
invalidateDataSourceDiscovery();
|
|
@@ -68,7 +70,10 @@ describe("fetchDataSourceDiscovery", () => {
|
|
|
68
70
|
const request = vi
|
|
69
71
|
.spyOn(DiscoverDataSources, "request")
|
|
70
72
|
.mockRejectedValueOnce(new Error("boom"))
|
|
71
|
-
.mockResolvedValueOnce({
|
|
73
|
+
.mockResolvedValueOnce({
|
|
74
|
+
request_id: requestId("request-id"),
|
|
75
|
+
sources: [],
|
|
76
|
+
});
|
|
72
77
|
|
|
73
78
|
await expect(fetchDataSourceDiscovery()).rejects.toThrow("boom");
|
|
74
79
|
await expect(fetchDataSourceDiscovery()).resolves.toEqual([]);
|
|
@@ -77,16 +82,18 @@ describe("fetchDataSourceDiscovery", () => {
|
|
|
77
82
|
|
|
78
83
|
it("does not clear a newer cache entry when an invalidated request fails", async () => {
|
|
79
84
|
let rejectFirstRequest: ((error: Error) => void) | undefined;
|
|
80
|
-
const firstRequest = new Promise<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
85
|
+
const firstRequest = new Promise<DataSourceDiscoveryResult>(
|
|
86
|
+
(_resolve, reject) => {
|
|
87
|
+
rejectFirstRequest = reject;
|
|
88
|
+
},
|
|
89
|
+
);
|
|
86
90
|
const request = vi
|
|
87
91
|
.spyOn(DiscoverDataSources, "request")
|
|
88
92
|
.mockReturnValueOnce(firstRequest)
|
|
89
|
-
.mockResolvedValueOnce({
|
|
93
|
+
.mockResolvedValueOnce({
|
|
94
|
+
request_id: requestId("request-id"),
|
|
95
|
+
sources: [],
|
|
96
|
+
});
|
|
90
97
|
|
|
91
98
|
const staleResult = fetchDataSourceDiscovery().catch((error) => error);
|
|
92
99
|
await vi.waitFor(() => expect(request).toHaveBeenCalledTimes(1));
|
|
@@ -116,7 +123,7 @@ describe("fetchDataSourceDiscovery", () => {
|
|
|
116
123
|
}),
|
|
117
124
|
];
|
|
118
125
|
vi.spyOn(DiscoverDataSources, "request").mockResolvedValue({
|
|
119
|
-
request_id: "request-id",
|
|
126
|
+
request_id: requestId("request-id"),
|
|
120
127
|
sources,
|
|
121
128
|
});
|
|
122
129
|
|
|
@@ -7,7 +7,7 @@ import { throwNotImplemented } from "@/utils/functions";
|
|
|
7
7
|
import { Logger } from "@/utils/Logger";
|
|
8
8
|
import { generateUUID } from "@/utils/uuid";
|
|
9
9
|
import { initialNotebookState, notebookAtom } from "../cells/cells";
|
|
10
|
-
import type {
|
|
10
|
+
import type { ClientCommand } from "../kernel/messages";
|
|
11
11
|
import type { EditRequests, RunRequests } from "../network/types";
|
|
12
12
|
import { store as defaultStore } from "../state/jotai";
|
|
13
13
|
import { getMarimoExportContext } from "../static/export-context";
|
|
@@ -392,7 +392,7 @@ export class IslandsPyodideBridge implements RunRequests, EditRequests {
|
|
|
392
392
|
// The kernel uses msgspec to parse control requests, which requires a 'type'
|
|
393
393
|
// field for discriminated union deserialization.
|
|
394
394
|
private async putControlRequest(
|
|
395
|
-
operation:
|
|
395
|
+
operation: ClientCommand,
|
|
396
396
|
session?: AppSession,
|
|
397
397
|
): Promise<void> {
|
|
398
398
|
session ??= await this.getActiveSession();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { components } from "@marimo-team/marimo-api";
|
|
3
3
|
|
|
4
4
|
export type schemas = components["schemas"];
|
|
5
|
-
export type DataType = schemas["
|
|
5
|
+
export type DataType = schemas["DataType"];
|
|
6
6
|
export const DATA_TYPES = [
|
|
7
7
|
"string",
|
|
8
8
|
"boolean",
|
|
@@ -24,10 +24,7 @@ export type DatabaseSchema = schemas["Schema"];
|
|
|
24
24
|
export type DataSourceConnection = schemas["DataSourceConnection"];
|
|
25
25
|
export type OutputChannel = schemas["CellChannel"];
|
|
26
26
|
export type CellOutput = schemas["CellOutput"];
|
|
27
|
-
export type MarimoError =
|
|
28
|
-
CellOutput["data"],
|
|
29
|
-
{ type: string }[]
|
|
30
|
-
>[number];
|
|
27
|
+
export type MarimoError = schemas["MarimoError"];
|
|
31
28
|
export type OutputMessage = schemas["CellOutput"];
|
|
32
29
|
export type CompletionOption =
|
|
33
30
|
schemas["CompletionResultNotification"]["options"][0];
|
|
@@ -54,8 +51,8 @@ export type Capabilities =
|
|
|
54
51
|
NotificationMessageData<"kernel-ready">["capabilities"];
|
|
55
52
|
export type CacheInfoFetched = NotificationMessageData<"cache-info">;
|
|
56
53
|
|
|
57
|
-
export type NotificationMessage = schemas["
|
|
58
|
-
export type
|
|
54
|
+
export type NotificationMessage = schemas["NotificationMessage"];
|
|
55
|
+
export type ClientCommand = schemas["ClientCommand"];
|
|
59
56
|
|
|
60
57
|
export type NotificationMessageType = NotificationMessage["op"];
|
|
61
58
|
export interface NotificationPayload {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
-
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
4
4
|
import { HTTPError } from "@/utils/errors";
|
|
5
|
+
import { Logger } from "@/utils/Logger";
|
|
5
6
|
import { API } from "../api";
|
|
6
7
|
|
|
7
8
|
// Mock fetch globally
|
|
@@ -25,6 +26,118 @@ describe("API", () => {
|
|
|
25
26
|
baseUrl = "http://localhost:8000";
|
|
26
27
|
});
|
|
27
28
|
|
|
29
|
+
afterEach(() => {
|
|
30
|
+
vi.restoreAllMocks();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it.each(["before fetch", "during fetch"])(
|
|
34
|
+
"API.post propagates cancellation %s without logging it",
|
|
35
|
+
async (timing) => {
|
|
36
|
+
const log = vi.spyOn(Logger, "error").mockReturnValue(undefined);
|
|
37
|
+
const controller = new AbortController();
|
|
38
|
+
mockFetch.mockImplementation(
|
|
39
|
+
(_url: string, { signal }: RequestInit) =>
|
|
40
|
+
new Promise<Response>((_resolve, reject) => {
|
|
41
|
+
if (signal?.aborted) {
|
|
42
|
+
reject(signal.reason);
|
|
43
|
+
} else {
|
|
44
|
+
signal?.addEventListener("abort", () => reject(signal.reason), {
|
|
45
|
+
once: true,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
50
|
+
if (timing === "before fetch") {
|
|
51
|
+
controller.abort();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const response = API.post("/foo", {}, { signal: controller.signal });
|
|
55
|
+
controller.abort();
|
|
56
|
+
|
|
57
|
+
await expect(response).rejects.toBe(controller.signal.reason);
|
|
58
|
+
expect(mockFetch).toHaveBeenCalledWith(
|
|
59
|
+
"http://localhost:8000/api/foo",
|
|
60
|
+
expect.objectContaining({ signal: controller.signal }),
|
|
61
|
+
);
|
|
62
|
+
expect(log).not.toHaveBeenCalled();
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
it.each(["application/json", "text/plain"])(
|
|
67
|
+
"API.post propagates an abort while reading %s without logging it",
|
|
68
|
+
async (contentType) => {
|
|
69
|
+
const log = vi.spyOn(Logger, "error").mockReturnValue(undefined);
|
|
70
|
+
const error = new DOMException("Body read aborted", "AbortError");
|
|
71
|
+
const readBody = vi.fn().mockRejectedValue(error);
|
|
72
|
+
mockFetch.mockResolvedValue({
|
|
73
|
+
ok: true,
|
|
74
|
+
headers: new Headers({ "Content-Type": contentType }),
|
|
75
|
+
json: readBody,
|
|
76
|
+
text: readBody,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
await expect(API.post("/foo", {})).rejects.toBe(error);
|
|
80
|
+
expect(readBody).toHaveBeenCalledExactlyOnceWith();
|
|
81
|
+
expect(log).not.toHaveBeenCalled();
|
|
82
|
+
},
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
it.each([new TypeError("Failed to fetch"), null, "Request failed"])(
|
|
86
|
+
"API.post logs and preserves non-abort fetch failures: %s",
|
|
87
|
+
async (error) => {
|
|
88
|
+
const log = vi.spyOn(Logger, "error").mockReturnValue(undefined);
|
|
89
|
+
const controller = new AbortController();
|
|
90
|
+
controller.abort();
|
|
91
|
+
mockFetch.mockRejectedValue(error);
|
|
92
|
+
|
|
93
|
+
await expect(
|
|
94
|
+
API.post("/foo", {}, { signal: controller.signal }),
|
|
95
|
+
).rejects.toBe(error);
|
|
96
|
+
expect(log).toHaveBeenCalledExactlyOnceWith(
|
|
97
|
+
"Error requesting http://localhost:8000/api/foo",
|
|
98
|
+
error,
|
|
99
|
+
);
|
|
100
|
+
},
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
it("API.post logs HTTP failures and preserves their status and body", async () => {
|
|
104
|
+
const log = vi.spyOn(Logger, "error").mockReturnValue(undefined);
|
|
105
|
+
const body = { detail: "Service unavailable" };
|
|
106
|
+
mockFetch.mockResolvedValue(
|
|
107
|
+
new Response(JSON.stringify(body), {
|
|
108
|
+
status: 503,
|
|
109
|
+
statusText: "Service Unavailable",
|
|
110
|
+
headers: { "Content-Type": "application/json" },
|
|
111
|
+
}),
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
await expect(API.post("/foo", {})).rejects.toMatchObject({
|
|
115
|
+
name: "HTTPError",
|
|
116
|
+
status: 503,
|
|
117
|
+
message: "Service Unavailable",
|
|
118
|
+
cause: body,
|
|
119
|
+
});
|
|
120
|
+
expect(log).toHaveBeenCalledExactlyOnceWith(
|
|
121
|
+
"Error requesting http://localhost:8000/api/foo",
|
|
122
|
+
expect.any(HTTPError),
|
|
123
|
+
);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it("API.post logs malformed JSON responses", async () => {
|
|
127
|
+
const log = vi.spyOn(Logger, "error").mockReturnValue(undefined);
|
|
128
|
+
mockFetch.mockResolvedValue(
|
|
129
|
+
new Response("invalid json", {
|
|
130
|
+
headers: { "Content-Type": "application/json" },
|
|
131
|
+
}),
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
await expect(API.post("/foo", {})).rejects.toBeInstanceOf(SyntaxError);
|
|
135
|
+
expect(log).toHaveBeenCalledExactlyOnceWith(
|
|
136
|
+
"Error requesting http://localhost:8000/api/foo",
|
|
137
|
+
expect.any(SyntaxError),
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
|
|
28
141
|
it("API.post calls fetch with POST and correct URL", async () => {
|
|
29
142
|
mockFetch.mockResolvedValue({
|
|
30
143
|
ok: true,
|
package/src/core/network/api.ts
CHANGED
|
@@ -101,8 +101,9 @@ export const API = {
|
|
|
101
101
|
return response.text() as unknown as RESP;
|
|
102
102
|
})
|
|
103
103
|
.catch((error) => {
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
if (error?.name !== "AbortError") {
|
|
105
|
+
Logger.error(`Error requesting ${fullUrl}`, error);
|
|
106
|
+
}
|
|
106
107
|
throw error;
|
|
107
108
|
});
|
|
108
109
|
},
|
package/src/core/wasm/bridge.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { reloadSafe } from "@/utils/reload-safe";
|
|
|
11
11
|
import { generateUUID } from "@/utils/uuid";
|
|
12
12
|
import { createModuleWorker } from "@/utils/worker";
|
|
13
13
|
import { notebookIsRunningAtom } from "../cells/cells";
|
|
14
|
-
import type {
|
|
14
|
+
import type { ClientCommand } from "../kernel/messages";
|
|
15
15
|
import { getInitialAppMode } from "../mode";
|
|
16
16
|
import { API } from "../network/api";
|
|
17
17
|
import { withDevAssetUrl } from "../network/export-asset-url";
|
|
@@ -711,7 +711,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
711
711
|
public listStorageEntries = throwNotImplemented;
|
|
712
712
|
public downloadStorage = throwNotImplemented;
|
|
713
713
|
|
|
714
|
-
private async putControlRequest(operation:
|
|
714
|
+
private async putControlRequest(operation: ClientCommand) {
|
|
715
715
|
await this.rpc.proxy.request.bridge({
|
|
716
716
|
functionName: "put_control_request",
|
|
717
717
|
payload: operation,
|
|
@@ -3,7 +3,7 @@ import type { PyodideInterface } from "pyodide";
|
|
|
3
3
|
import type { WasmRuntimeConfig } from "../runtime-config";
|
|
4
4
|
import type { UserConfig } from "@/core/config/config-schema";
|
|
5
5
|
import type {
|
|
6
|
-
|
|
6
|
+
ClientCommand,
|
|
7
7
|
NotificationPayload,
|
|
8
8
|
} from "@/core/kernel/messages";
|
|
9
9
|
import type { JsonString } from "@/utils/json/base64";
|
|
@@ -74,7 +74,7 @@ export interface WasmController {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export interface RawBridge {
|
|
77
|
-
put_control_request(operation:
|
|
77
|
+
put_control_request(operation: ClientCommand): Promise<string>;
|
|
78
78
|
put_input(input: string): Promise<string>;
|
|
79
79
|
code_complete(request: CodeCompletionRequest): Promise<string>;
|
|
80
80
|
read_code(): Promise<{ contents: string }>;
|