@marimo-team/islands 0.25.1-dev4 → 0.25.1-dev40
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/{ConnectedDataExplorerComponent-KVhjDMSe.js → ConnectedDataExplorerComponent-CwMXfDQR.js} +3 -3
- package/dist/{ErrorBoundary-pV36lYEK.js → ErrorBoundary-CAJO-M56.js} +1 -1
- package/dist/{ImageComparisonComponent-Dlm5aWnH.js → ImageComparisonComponent-Cpfz30OZ.js} +51 -52
- package/dist/{abnfDiagram-VCTEODGH-CpN0FRda.js → abnfDiagram-VCTEODGH-AFhOQTt8.js} +3 -3
- package/dist/{architectureDiagram-5GKGNRK7-DDyj5SRB.js → architectureDiagram-5GKGNRK7-BngksAAQ.js} +5 -5
- package/dist/{blockDiagram-I7D4REHJ-BbXEXJRu.js → blockDiagram-I7D4REHJ-CvBmppdy.js} +9 -9
- package/dist/{c4Diagram-7LVT6UL2-DcLsbQmR.js → c4Diagram-7LVT6UL2-EceL4_jH.js} +7 -7
- package/dist/{cells-B5-y5EY3.js → cells-Cv93oav_.js} +3 -3
- package/dist/{channel-B5XnTarr.js → channel-z7HZXHwv.js} +1 -1
- package/dist/{chat-ui-HJZsTl7o.js → chat-ui-DLSF8a04.js} +4 -4
- package/dist/{chunk-4HAMMTFA-D2qv8E0X.js → chunk-4HAMMTFA-BPTTOOC5.js} +5 -5
- package/dist/{chunk-75Z2AOVW-5_HsvXwr.js → chunk-75Z2AOVW-C4AOleKf.js} +1 -1
- package/dist/{chunk-DU6HZSFF-BUgAHvnM.js → chunk-DU6HZSFF-1TwWR6gh.js} +1 -1
- package/dist/{chunk-F27PBJKO-DHmYWZXr.js → chunk-F27PBJKO-DMI1PBe4.js} +1 -1
- package/dist/{chunk-GMAD6QVW-Czynz8aA.js → chunk-GMAD6QVW-vStrMz2P.js} +3 -3
- package/dist/{chunk-GVQU2GXP-yQEdulRS.js → chunk-GVQU2GXP-2HwWgs4u.js} +2 -2
- package/dist/{chunk-IMKFNOWR-BfwTebD0.js → chunk-IMKFNOWR-UOVZuZVn.js} +5 -5
- package/dist/{chunk-L3NEJ4N5-DwRWnDDK.js → chunk-L3NEJ4N5-RhC7i0I2.js} +5 -5
- package/dist/{chunk-OSK3NFVY-BBKU_Ign.js → chunk-OSK3NFVY-CZV09N-U.js} +6 -6
- package/dist/{chunk-P2QGCYS3-C0iGU29N.js → chunk-P2QGCYS3-0TAWai9C.js} +1 -1
- package/dist/{chunk-POPQ4Y6H-BCbS3Ozc.js → chunk-POPQ4Y6H-Cc3_56GX.js} +1 -1
- package/dist/{chunk-PWAF6VOD-CTFCL0jI.js → chunk-PWAF6VOD-lNxB9k8z.js} +1 -1
- package/dist/{chunk-SHT3W25Y-BspJEJ5H.js → chunk-SHT3W25Y-CrEPyWy1.js} +7 -7
- package/dist/{chunk-SVP7TREG-DX3rFNTe.js → chunk-SVP7TREG-uIyyySp6.js} +2 -2
- package/dist/{chunk-TICWLB2K-fVF7Uujg.js → chunk-TICWLB2K-DdXM3eg6.js} +5 -5
- package/dist/classDiagram-ZZMXUADV-BiATbBE4.js +30 -0
- package/dist/classDiagram-v2-VYDZK3BY-JnH97GYw.js +30 -0
- package/dist/{code-visibility-CgZS2a3W.js → code-visibility-XU9RAJNV.js} +2 -2
- package/dist/{common-DnMDPPaW.js → common-C0fbrgB8.js} +13 -13
- package/dist/{cynefinDiagram-5FMLGOSQ-CFQrqzSX.js → cynefinDiagram-5FMLGOSQ-zknaAsGy.js} +3 -3
- package/dist/{dagre-GXQ25YYZ-xHNAUTyG.js → dagre-GXQ25YYZ-BhMOoMGJ.js} +10 -10
- package/dist/{data-grid-overlay-editor-hHYgD_Sm.js → data-grid-overlay-editor-BnhbJgoq.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-Bt1rPbAx.js → diagram-S7CK7UJ4-V5-Z-EDY.js} +4 -4
- package/dist/{diagram-UQ7AKVKN-D1sq5FoZ.js → diagram-UQ7AKVKN-qw8AjDal.js} +3 -3
- package/dist/{diagram-VSXAHHWV-BKpmG23x.js → diagram-VSXAHHWV-CR7BJygZ.js} +2 -2
- package/dist/{diagram-VX7I27RA-BMwGFVD6.js → diagram-VX7I27RA-DfuqFb1E.js} +5 -5
- package/dist/{diagram-Z3DM3KII--KLDR9Pl.js → diagram-Z3DM3KII-DpWwlYZB.js} +3 -3
- package/dist/{dist-BaHjhkpZ.js → dist-CcyKTBTF.js} +1 -1
- package/dist/{ebnfDiagram-PWID7BFC-WnG4cvSQ.js → ebnfDiagram-PWID7BFC-C20OnNMZ.js} +3 -3
- package/dist/{erDiagram-RLTQ6QDP-DhzKiYHc.js → erDiagram-RLTQ6QDP-DBXLWO9v.js} +12 -12
- package/dist/{error-entries-Bkbpx0T0.js → error-entries-DLl0XqoW.js} +1 -1
- package/dist/{feedback-button-CvKssdG_.js → feedback-button-B0QSkbSp.js} +4 -4
- package/dist/flowDiagram-HODETNUW-DL52nMkt.js +16 -0
- package/dist/{formats-C8rLgZT9.js → formats-Cl_67ghI.js} +1 -1
- package/dist/{ganttDiagram-EL5Y4UJY-DbzEBLbl.js → ganttDiagram-EL5Y4UJY-cRRaDt88.js} +2 -2
- package/dist/{gitGraphDiagram-WWUBYQGX-BMf0iKi1.js → gitGraphDiagram-WWUBYQGX-Pox5k9-Y.js} +2 -2
- package/dist/{glide-data-editor-Ohetlgag.js → glide-data-editor-ymIQdwrb.js} +3 -3
- package/dist/{globals-CPNNcOJI.js → globals-B0S3-e_D.js} +1 -1
- package/dist/{html-to-image-BAgJOlSW.js → html-to-image-CGVgroef.js} +2 -2
- package/dist/{infoDiagram-27XIBGKW-BagtCX_5.js → infoDiagram-27XIBGKW-ntpxMfrq.js} +2 -2
- package/dist/{ishikawaDiagram-5VMMS53U-DByDehYy.js → ishikawaDiagram-5VMMS53U-BllIlHE5.js} +3 -3
- package/dist/{journeyDiagram-3NMN7TZE-D2LcKDUO.js → journeyDiagram-3NMN7TZE-EPJDPlt0.js} +2 -2
- package/dist/{kanban-definition-UXKFOSKX-BxwkbBI_.js → kanban-definition-UXKFOSKX-GYtNMjtS.js} +9 -9
- package/dist/{katex-C6D4cX_N.js → katex-BNCmKUol.js} +983 -1120
- package/dist/{loader-D2W4oM-3.js → loader-DEZSzvma.js} +253 -248
- package/dist/main.js +72 -69
- package/dist/{mermaid-DPNuhemn.js → mermaid-Dnzoxjt1.js} +49 -49
- package/dist/{mhchem-DWCF06w9.js → mhchem-BEc7A1or.js} +1 -1
- package/dist/{mindmap-definition-YA3MSWOX-Cgvojw3y.js → mindmap-definition-YA3MSWOX-Cth76xgH.js} +11 -11
- package/dist/{number-overlay-editor-CHWg5gGO.js → number-overlay-editor-DB3HJDI1.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-DahHhYyN.js → pegDiagram-XKGWAZYB-Cu4uOXii.js} +3 -3
- package/dist/{pieDiagram-E7YTZNPT-CCtX0oCK.js → pieDiagram-E7YTZNPT-Bh3eDa9s.js} +3 -3
- package/dist/{process-output-zDX4jbhd.js → process-output-CGfg-JmZ.js} +2 -2
- package/dist/{quadrantDiagram-AXDQQJYC-DftINo6g.js → quadrantDiagram-AXDQQJYC--kqzFC3w.js} +1 -1
- package/dist/{railroadDiagram-O6MQD6OU-Du5NsPUb.js → railroadDiagram-O6MQD6OU-DG-M6Rnc.js} +3 -3
- package/dist/{react-vega-5AcMW8gG.js → react-vega-ewj7q_U5.js} +1 -1
- package/dist/{requirementDiagram-BXWQKSXE-0pmmxL6_.js → requirementDiagram-BXWQKSXE-DCwsThh0.js} +11 -11
- package/dist/{reveal-component-BujcZI2B.js → reveal-component-CfTzIkA2.js} +3 -3
- package/dist/{sankeyDiagram-P5KCCOFB-CDKR5TJH.js → sankeyDiagram-P5KCCOFB-BdzhT0BM.js} +1 -1
- package/dist/{sequenceDiagram-WJ2MYXX4-DB-ChWwU.js → sequenceDiagram-WJ2MYXX4-CbXB1_PU.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-orN6AwMx.js → stateDiagram-D77RDMKH-A-Zf3Sb2.js} +13 -13
- package/dist/stateDiagram-v2-MP3YSRHH-D9YMnUGx.js +30 -0
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-BkSDcqDT.js → swimlanes-42K2YHIH-B_pMf0J4.js} +10 -10
- package/dist/swimlanesDiagram-VR7AAH4N-Ctgy-yGP.js +30 -0
- package/dist/{timeline-definition-24CTP7MA-BuqJUIRZ.js → timeline-definition-24CTP7MA-DTXFjTTM.js} +3 -3
- package/dist/{vega-component-CNf5gcrm.js → vega-component-tFOzgarw.js} +4 -4
- package/dist/{vega-embed-container-CbnTccZi.js → vega-embed-container-sSR5hAsy.js} +2 -2
- package/dist/{vega-loader.browser-D95WfUcj.js → vega-loader.browser-DNST6uVf.js} +2 -2
- package/dist/{vennDiagram-4TSXK5OY-CTUlJ2PK.js → vennDiagram-4TSXK5OY-BPHjZo0R.js} +3 -3
- package/dist/{wardleyDiagram-VM6X3IG4-3evLUb0M.js → wardleyDiagram-VM6X3IG4-6fTLYBuD.js} +3 -3
- package/dist/{xychartDiagram-S5SC5T6Z-DL2E3K8-.js → xychartDiagram-S5SC5T6Z-BYjwjrzE.js} +5 -5
- package/package.json +1 -2
- package/src/__mocks__/common.ts +3 -3
- package/src/__tests__/CellStatus.test.tsx +1 -1
- package/src/__tests__/setup.ts +7 -7
- package/src/components/app-config/ai-config.tsx +2 -0
- package/src/components/app-config/optional-features.tsx +1 -1
- package/src/components/chat/chat-panel.tsx +19 -8
- package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +286 -0
- package/src/components/data-table/charts/charts.tsx +26 -13
- package/src/components/data-table/column-summary/chart-spec-model.tsx +4 -4
- package/src/components/dependency-graph/elements.ts +2 -2
- package/src/components/editor/__tests__/package-alert.test.tsx +140 -0
- package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +107 -0
- package/src/components/editor/actions/pair-with-agent.tsx +119 -0
- package/src/components/editor/actions/useNotebookActions.tsx +2 -1
- package/src/components/editor/ai/add-cell-with-ai.tsx +2 -0
- package/src/components/editor/ai/staged-cell-submission.ts +2 -2
- package/src/components/editor/ai/transport/chat-transport.tsx +1 -1
- package/src/components/editor/chrome/components/contribute-snippet-button.tsx +6 -1
- package/src/components/editor/connections/database/as-code.ts +44 -44
- package/src/components/editor/connections/storage/as-code.ts +3 -3
- package/src/components/editor/file-tree/requesting-tree.tsx +16 -13
- package/src/components/editor/navigation/clipboard.ts +2 -2
- package/src/components/editor/notebook-cell.tsx +2 -2
- package/src/components/editor/output/MarimoTracebackOutput.tsx +1 -1
- package/src/components/editor/output/VideoOutput.tsx +1 -1
- package/src/components/editor/output/ansi-reduce.ts +21 -17
- package/src/components/editor/output/console/ConsoleOutput.tsx +3 -3
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +59 -0
- package/src/components/editor/output/console/text-rendering.tsx +3 -1
- package/src/components/editor/package-alert.tsx +20 -7
- package/src/components/home/components.tsx +1 -0
- package/src/components/pages/run-page.tsx +1 -0
- package/src/components/slides/__tests__/minimap-actions.test.tsx +7 -7
- package/src/components/slides/__tests__/minimap.test.ts +12 -12
- package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +8 -8
- package/src/components/static-html/share-modal.tsx +2 -1
- package/src/components/static-html/static-banner.tsx +2 -2
- package/src/components/ui/links.tsx +6 -1
- package/src/components/ui/typography.tsx +16 -8
- package/src/core/ai/context/__tests__/registry.test.ts +31 -28
- package/src/core/ai/context/providers/cell-output.ts +8 -8
- package/src/core/ai/context/providers/datasource.ts +10 -7
- package/src/core/ai/context/providers/error.ts +7 -7
- package/src/core/ai/context/providers/file.ts +8 -8
- package/src/core/ai/context/providers/tables.ts +7 -7
- package/src/core/ai/context/providers/variable.ts +7 -7
- package/src/core/ai/context/registry.ts +18 -18
- package/src/core/ai/ids/ids.ts +5 -5
- package/src/core/ai/model-registry.ts +12 -9
- package/src/core/ai/staged-cells.ts +6 -6
- package/src/core/ai/tools/base.ts +6 -6
- package/src/core/ai/tools/edit-notebook-tool.ts +6 -6
- package/src/core/ai/tools/registry.ts +4 -4
- package/src/core/ai/tools/run-cells-tool.ts +7 -7
- package/src/core/ai/tools/sample-tool.ts +6 -6
- package/src/core/cells/__tests__/cells.test.ts +27 -0
- package/src/core/cells/cells.ts +2 -1
- package/src/core/codemirror/cells/debugger-decorations.ts +13 -7
- package/src/core/codemirror/cells/line-timing-decorations.ts +9 -9
- package/src/core/codemirror/cells/traceback-decorations.ts +7 -4
- package/src/core/codemirror/code-lens/extension.ts +13 -13
- package/src/core/codemirror/copilot/__tests__/language-server.test.ts +6 -6
- package/src/core/codemirror/copilot/__tests__/transport.test.ts +12 -12
- package/src/core/codemirror/copilot/language-server.ts +13 -13
- package/src/core/codemirror/copilot/transport.ts +1 -1
- package/src/core/codemirror/find-replace/search-highlight.ts +5 -5
- package/src/core/codemirror/go-to-definition/underline.ts +3 -3
- package/src/core/codemirror/keymaps/vim.ts +3 -3
- package/src/core/codemirror/language/languages/markdown.ts +8 -8
- package/src/core/codemirror/language/languages/python.ts +7 -7
- package/src/core/codemirror/language/languages/sql/completion-builder.ts +5 -5
- package/src/core/codemirror/language/languages/sql/completion-store.ts +4 -4
- package/src/core/codemirror/language/languages/sql/sql.ts +21 -21
- package/src/core/codemirror/lsp/__tests__/transports.test.ts +10 -10
- package/src/core/codemirror/lsp/federated-lsp.ts +29 -27
- package/src/core/codemirror/lsp/notebook-lsp.ts +21 -21
- package/src/core/codemirror/misc/__tests__/dnd.test.ts +10 -10
- package/src/core/codemirror/misc/__tests__/paste.test.ts +7 -4
- package/src/core/codemirror/reactive-references/extension.ts +3 -3
- package/src/core/codemirror/rtc/loro/awareness.ts +12 -12
- package/src/core/codemirror/rtc/loro/sync.ts +5 -5
- package/src/core/codemirror/vim/cursor-visibility.ts +3 -3
- package/src/core/dom/ui-element.ts +5 -5
- package/src/core/dom/uiregistry.ts +10 -10
- package/src/core/hotkeys/hotkeys.ts +9 -9
- package/src/core/islands/__tests__/bridge.test.ts +4 -4
- package/src/core/islands/__tests__/test-utils.tsx +4 -4
- package/src/core/islands/bridge.ts +85 -82
- package/src/core/islands/components/web-components.tsx +7 -7
- package/src/core/islands/worker/__tests__/controller.test.ts +1 -1
- package/src/core/islands/worker/controller.ts +6 -3
- package/src/core/islands/worker-factory.ts +2 -2
- package/src/core/kernel/RuntimeState.ts +4 -4
- package/src/core/lsp/__tests__/transport.test.ts +19 -19
- package/src/core/lsp/transport.ts +5 -5
- package/src/core/network/CachingRequestRegistry.ts +2 -2
- package/src/core/network/DeferredRequestRegistry.ts +4 -4
- package/src/core/runtime/runtime.ts +25 -20
- package/src/core/static/virtual-file-tracker.ts +5 -5
- package/src/core/wasm/__tests__/bridge.test.ts +2 -2
- package/src/core/wasm/bridge.ts +130 -126
- package/src/core/wasm/router.ts +5 -5
- package/src/core/wasm/store.ts +4 -4
- package/src/core/wasm/worker/bootstrap.ts +8 -5
- package/src/core/wasm/worker/message-buffer.ts +3 -3
- package/src/core/websocket/transports/__tests__/ws.test.ts +8 -8
- package/src/core/websocket/transports/basic.ts +15 -8
- package/src/core/websocket/transports/sse.ts +7 -7
- package/src/core/websocket/transports/transport.ts +3 -3
- package/src/core/websocket/transports/ws.ts +9 -7
- package/src/css/globals.css +18 -21
- package/src/css/katex.min.css +260 -241
- package/src/hooks/__tests__/useOverflowDetection.test.tsx +5 -5
- package/src/hooks/__tests__/useResizeObserver.test.tsx +12 -12
- package/src/plugins/core/registerReactComponent.tsx +5 -5
- package/src/plugins/core/sidebar-element.tsx +2 -2
- package/src/plugins/impl/ButtonPlugin.tsx +3 -3
- package/src/plugins/impl/CheckboxPlugin.tsx +3 -3
- package/src/plugins/impl/CodeEditorPlugin.tsx +3 -3
- package/src/plugins/impl/DatePickerPlugin.tsx +3 -3
- package/src/plugins/impl/DateRangePlugin.tsx +3 -3
- package/src/plugins/impl/DateTimePickerPlugin.tsx +3 -3
- package/src/plugins/impl/DictPlugin.tsx +3 -3
- package/src/plugins/impl/DropdownPlugin.tsx +3 -3
- package/src/plugins/impl/FileUploadPlugin.tsx +3 -3
- package/src/plugins/impl/MatrixPlugin.tsx +4 -4
- package/src/plugins/impl/MicrophonePlugin.tsx +3 -3
- package/src/plugins/impl/MultiselectPlugin.tsx +3 -3
- package/src/plugins/impl/NumberPlugin.tsx +3 -3
- package/src/plugins/impl/RadioPlugin.tsx +9 -5
- package/src/plugins/impl/RangeSliderPlugin.tsx +3 -3
- package/src/plugins/impl/RefreshPlugin.tsx +3 -3
- package/src/plugins/impl/SliderPlugin.tsx +3 -3
- package/src/plugins/impl/SwitchPlugin.tsx +3 -3
- package/src/plugins/impl/TabsPlugin.tsx +3 -3
- package/src/plugins/impl/TextAreaPlugin.tsx +3 -3
- package/src/plugins/impl/TextInputPlugin.tsx +3 -3
- package/src/plugins/impl/__tests__/MatrixPlugin.test.tsx +2 -2
- package/src/plugins/impl/anywidget/model.ts +10 -10
- package/src/plugins/impl/anywidget/registry.ts +12 -9
- package/src/plugins/impl/anywidget/runtime.ts +11 -9
- package/src/plugins/impl/anywidget/widget-binding.ts +6 -6
- package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +7 -6
- package/src/plugins/impl/matplotlib/MatplotlibPlugin.tsx +3 -3
- package/src/plugins/impl/matplotlib/__tests__/matplotlib-renderer.test.ts +2 -2
- package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +2 -2
- package/src/plugins/impl/mpl-interactive/mpl-websocket-shim.ts +10 -10
- package/src/plugins/impl/panel/utils.ts +5 -5
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +3 -3
- package/src/plugins/impl/vega/VegaPlugin.tsx +3 -3
- package/src/plugins/impl/vega/__tests__/use-vega-container-remeasure.test.ts +7 -7
- package/src/plugins/impl/vega/__tests__/utils.test.ts +16 -1
- package/src/plugins/impl/vega/__tests__/vega.test.ts +37 -0
- package/src/plugins/impl/vega/loader.ts +23 -1
- package/src/plugins/impl/vega/utils.ts +5 -4
- package/src/plugins/layout/AccordionPlugin.tsx +3 -3
- package/src/plugins/layout/CalloutPlugin.tsx +3 -3
- package/src/plugins/layout/ImageComparisonPlugin.tsx +5 -3
- package/src/plugins/layout/JsonOutputPlugin.tsx +3 -3
- package/src/plugins/layout/MimeRenderPlugin.tsx +3 -3
- package/src/plugins/layout/NavigationMenuPlugin.tsx +3 -3
- package/src/plugins/layout/OutlinePlugin.tsx +3 -3
- package/src/plugins/layout/ProgressPlugin.tsx +3 -3
- package/src/plugins/layout/RoutesPlugin.tsx +6 -8
- package/src/plugins/layout/StatPlugin.tsx +3 -3
- package/src/plugins/layout/TexPlugin.tsx +3 -3
- package/src/plugins/layout/carousel/CarouselPlugin.tsx +4 -4
- package/src/plugins/layout/mermaid/MermaidPlugin.tsx +3 -3
- package/src/utils/Deferred.ts +6 -6
- package/src/utils/async-capture-tracker.ts +10 -7
- package/src/utils/errors.ts +5 -5
- package/src/utils/id-tree.tsx +83 -80
- package/src/utils/lru.ts +1 -1
- package/src/utils/multi-map.ts +14 -12
- package/src/utils/paths.ts +6 -6
- package/src/utils/pluralize.ts +3 -3
- package/src/utils/progress.ts +6 -6
- package/src/utils/python-poet/poet.ts +14 -14
- package/src/utils/routes.ts +4 -2
- package/src/utils/semaphore.ts +6 -6
- package/src/utils/storage/storage.ts +6 -6
- package/src/utils/storage/typed.ts +16 -12
- package/src/utils/time.ts +9 -9
- package/src/utils/timed-cache.ts +4 -4
- package/src/utils/tracer.ts +9 -6
- package/dist/classDiagram-ZZMXUADV-Fe-V14Sc.js +0 -30
- package/dist/classDiagram-v2-VYDZK3BY-xTDg7lOs.js +0 -30
- package/dist/flowDiagram-HODETNUW-6dMdB8pR.js +0 -16
- package/dist/katex-DFBiSucW.js +0 -21840
- package/dist/stateDiagram-v2-MP3YSRHH-o05_rJN8.js +0 -30
- package/dist/swimlanesDiagram-VR7AAH4N-D_nFQfRc.js +0 -30
|
@@ -51,7 +51,7 @@ export class MarimoIslandElement extends HTMLElement {
|
|
|
51
51
|
public static readonly editorTagName = ISLAND_TAG_NAMES.CODE_EDITOR;
|
|
52
52
|
public static readonly styleNamespace = ISLAND_CSS_CLASSES.NAMESPACE;
|
|
53
53
|
|
|
54
|
-
constructor() {
|
|
54
|
+
public constructor() {
|
|
55
55
|
super();
|
|
56
56
|
this.classList.add(MarimoIslandElement.styleNamespace);
|
|
57
57
|
}
|
|
@@ -59,7 +59,7 @@ export class MarimoIslandElement extends HTMLElement {
|
|
|
59
59
|
/**
|
|
60
60
|
* Gets the app ID from the element's data attribute
|
|
61
61
|
*/
|
|
62
|
-
get appId(): string {
|
|
62
|
+
public get appId(): string {
|
|
63
63
|
const appId = this.getAttribute(ISLAND_DATA_ATTRIBUTES.APP_ID);
|
|
64
64
|
invariant(appId, "Missing data-app-id attribute");
|
|
65
65
|
return appId;
|
|
@@ -68,7 +68,7 @@ export class MarimoIslandElement extends HTMLElement {
|
|
|
68
68
|
/**
|
|
69
69
|
* Whether this island is reactive (has code sent to Python for execution)
|
|
70
70
|
*/
|
|
71
|
-
get isReactive(): boolean {
|
|
71
|
+
public get isReactive(): boolean {
|
|
72
72
|
return this.getAttribute(ISLAND_DATA_ATTRIBUTES.REACTIVE) === "true";
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -76,7 +76,7 @@ export class MarimoIslandElement extends HTMLElement {
|
|
|
76
76
|
* Gets the cell ID by looking up the cell index in the notebook state.
|
|
77
77
|
* Returns undefined for non-reactive islands (they have no corresponding cell).
|
|
78
78
|
*/
|
|
79
|
-
get cellId(): CellId | undefined {
|
|
79
|
+
public get cellId(): CellId | undefined {
|
|
80
80
|
if (!this.isReactive) {
|
|
81
81
|
return undefined;
|
|
82
82
|
}
|
|
@@ -95,7 +95,7 @@ export class MarimoIslandElement extends HTMLElement {
|
|
|
95
95
|
/**
|
|
96
96
|
* Gets the code for this island cell
|
|
97
97
|
*/
|
|
98
|
-
get code(): string {
|
|
98
|
+
public get code(): string {
|
|
99
99
|
return extractIslandCodeFromEmbed(this);
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -115,7 +115,7 @@ export class MarimoIslandElement extends HTMLElement {
|
|
|
115
115
|
* which can happen inside a React render cycle. Rendering
|
|
116
116
|
* synchronously from there causes "unmount during render" warnings.
|
|
117
117
|
*/
|
|
118
|
-
connectedCallback(): void {
|
|
118
|
+
public connectedCallback(): void {
|
|
119
119
|
const connectionGeneration = ++this.connectionGeneration;
|
|
120
120
|
this.addEventListener(
|
|
121
121
|
ISLAND_SOURCE_CHANGED_EVENT,
|
|
@@ -296,7 +296,7 @@ export class MarimoIslandElement extends HTMLElement {
|
|
|
296
296
|
/**
|
|
297
297
|
* Cleanup when element is removed from DOM
|
|
298
298
|
*/
|
|
299
|
-
disconnectedCallback(): void {
|
|
299
|
+
public disconnectedCallback(): void {
|
|
300
300
|
this.removeEventListener(
|
|
301
301
|
ISLAND_SOURCE_CHANGED_EVENT,
|
|
302
302
|
this.handleSourceChanged,
|
|
@@ -5,7 +5,7 @@ import { describe, expect, it, vi } from "vitest";
|
|
|
5
5
|
import { ReadonlyWasmController } from "../controller";
|
|
6
6
|
|
|
7
7
|
class TestController extends ReadonlyWasmController {
|
|
8
|
-
setPyodide(pyodide: PyodideInterface) {
|
|
8
|
+
public setPyodide(pyodide: PyodideInterface) {
|
|
9
9
|
this.pyodide = pyodide;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -9,7 +9,7 @@ import type { JsonString } from "@/utils/json/base64";
|
|
|
9
9
|
import { Logger } from "../../../utils/Logger";
|
|
10
10
|
|
|
11
11
|
export class ReadonlyWasmController extends DefaultWasmController {
|
|
12
|
-
override async bootstrap(opts: {
|
|
12
|
+
public override async bootstrap(opts: {
|
|
13
13
|
version: string;
|
|
14
14
|
pyodideVersion: string;
|
|
15
15
|
}): Promise<PyodideInterface> {
|
|
@@ -17,7 +17,10 @@ export class ReadonlyWasmController extends DefaultWasmController {
|
|
|
17
17
|
return pyodide;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
override async mountFilesystem(opts: {
|
|
20
|
+
public override async mountFilesystem(opts: {
|
|
21
|
+
code: string;
|
|
22
|
+
filename: string;
|
|
23
|
+
}) {
|
|
21
24
|
const { code, filename } = opts;
|
|
22
25
|
// Write file
|
|
23
26
|
try {
|
|
@@ -34,7 +37,7 @@ export class ReadonlyWasmController extends DefaultWasmController {
|
|
|
34
37
|
return { code, filename };
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
override async startSession(opts: {
|
|
40
|
+
public override async startSession(opts: {
|
|
38
41
|
code: string;
|
|
39
42
|
filename: string | null;
|
|
40
43
|
onMessage: (message: JsonString<NotificationPayload>) => void;
|
|
@@ -39,7 +39,7 @@ export class DefaultWorkerFactory implements WorkerFactory {
|
|
|
39
39
|
private readonly url: string;
|
|
40
40
|
private readonly name: string;
|
|
41
41
|
|
|
42
|
-
constructor(config: DefaultWorkerFactoryConfig = {}) {
|
|
42
|
+
public constructor(config: DefaultWorkerFactoryConfig = {}) {
|
|
43
43
|
this.url = config.workerUrl || this.getDefaultWorkerUrl();
|
|
44
44
|
this.name = config.workerName || getMarimoVersion();
|
|
45
45
|
}
|
|
@@ -47,7 +47,7 @@ export class DefaultWorkerFactory implements WorkerFactory {
|
|
|
47
47
|
/**
|
|
48
48
|
* Creates a new Pyodide worker
|
|
49
49
|
*/
|
|
50
|
-
create(): Worker {
|
|
50
|
+
public create(): Worker {
|
|
51
51
|
return createModuleWorker(new URL(this.url, import.meta.url), {
|
|
52
52
|
name: this.name,
|
|
53
53
|
});
|
|
@@ -17,7 +17,7 @@ export class RuntimeState {
|
|
|
17
17
|
/**
|
|
18
18
|
* Shared instance of RuntimeState since this must be a singleton.
|
|
19
19
|
*/
|
|
20
|
-
static get INSTANCE(): RuntimeState {
|
|
20
|
+
public static get INSTANCE(): RuntimeState {
|
|
21
21
|
const KEY = "_marimo_private_RuntimeState";
|
|
22
22
|
if (!window[KEY]) {
|
|
23
23
|
window[KEY] = new RuntimeState(UI_ELEMENT_REGISTRY);
|
|
@@ -31,7 +31,7 @@ export class RuntimeState {
|
|
|
31
31
|
private _sendComponentValues: RunRequests["sendComponentValues"] | undefined;
|
|
32
32
|
private uiElementRegistry: UIElementRegistry;
|
|
33
33
|
|
|
34
|
-
constructor(uiElementRegistry: UIElementRegistry) {
|
|
34
|
+
public constructor(uiElementRegistry: UIElementRegistry) {
|
|
35
35
|
this.uiElementRegistry = uiElementRegistry;
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -45,7 +45,7 @@ export class RuntimeState {
|
|
|
45
45
|
/**
|
|
46
46
|
* Start listening for events from UIElements
|
|
47
47
|
*/
|
|
48
|
-
start(sendComponentValues: RunRequests["sendComponentValues"]) {
|
|
48
|
+
public start(sendComponentValues: RunRequests["sendComponentValues"]) {
|
|
49
49
|
if (this.hasStarted) {
|
|
50
50
|
Logger.warn("RuntimeState already started");
|
|
51
51
|
return;
|
|
@@ -61,7 +61,7 @@ export class RuntimeState {
|
|
|
61
61
|
/**
|
|
62
62
|
* Stop listening for events from UIElements
|
|
63
63
|
*/
|
|
64
|
-
stop() {
|
|
64
|
+
public stop() {
|
|
65
65
|
if (!this.hasStarted) {
|
|
66
66
|
Logger.warn("RuntimeState already stopped");
|
|
67
67
|
return;
|
|
@@ -10,28 +10,28 @@ vi.mock("@/utils/Logger", () => ({
|
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
12
|
class FakeWebSocket {
|
|
13
|
-
static readonly CONNECTING = 0;
|
|
14
|
-
static readonly OPEN = 1;
|
|
15
|
-
static readonly CLOSING = 2;
|
|
16
|
-
static readonly CLOSED = 3;
|
|
17
|
-
static readonly instances: FakeWebSocket[] = [];
|
|
18
|
-
|
|
19
|
-
readonly sent: string[] = [];
|
|
20
|
-
readonly url: string;
|
|
21
|
-
readonly protocols: string | string[] | undefined;
|
|
22
|
-
readyState = FakeWebSocket.CONNECTING;
|
|
13
|
+
public static readonly CONNECTING = 0;
|
|
14
|
+
public static readonly OPEN = 1;
|
|
15
|
+
public static readonly CLOSING = 2;
|
|
16
|
+
public static readonly CLOSED = 3;
|
|
17
|
+
public static readonly instances: FakeWebSocket[] = [];
|
|
18
|
+
|
|
19
|
+
public readonly sent: string[] = [];
|
|
20
|
+
public readonly url: string;
|
|
21
|
+
public readonly protocols: string | string[] | undefined;
|
|
22
|
+
public readyState = FakeWebSocket.CONNECTING;
|
|
23
23
|
private readonly listeners = new Map<
|
|
24
24
|
string,
|
|
25
25
|
Set<(event: { data?: unknown }) => void>
|
|
26
26
|
>();
|
|
27
27
|
|
|
28
|
-
constructor(url: string, protocols?: string | string[]) {
|
|
28
|
+
public constructor(url: string, protocols?: string | string[]) {
|
|
29
29
|
this.url = url;
|
|
30
30
|
this.protocols = protocols;
|
|
31
31
|
FakeWebSocket.instances.push(this);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
addEventListener(
|
|
34
|
+
public addEventListener(
|
|
35
35
|
type: string,
|
|
36
36
|
listener: (event: { data?: unknown }) => void,
|
|
37
37
|
) {
|
|
@@ -40,34 +40,34 @@ class FakeWebSocket {
|
|
|
40
40
|
this.listeners.set(type, listeners);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
send(frame: string) {
|
|
43
|
+
public send(frame: string) {
|
|
44
44
|
this.sent.push(frame);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
close() {
|
|
47
|
+
public close() {
|
|
48
48
|
this.readyState = FakeWebSocket.CLOSED;
|
|
49
49
|
this.emit("close", {});
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
open() {
|
|
52
|
+
public open() {
|
|
53
53
|
this.readyState = FakeWebSocket.OPEN;
|
|
54
54
|
this.emit("open", {});
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
fail() {
|
|
57
|
+
public fail() {
|
|
58
58
|
this.emit("error", {});
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
disconnect() {
|
|
61
|
+
public disconnect() {
|
|
62
62
|
this.readyState = FakeWebSocket.CLOSED;
|
|
63
63
|
this.emit("close", {});
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
receive(message: JSONRPCMessage) {
|
|
66
|
+
public receive(message: JSONRPCMessage) {
|
|
67
67
|
this.emit("message", { data: JSON.stringify(message) });
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
messages(): JSONRPCMessage[] {
|
|
70
|
+
public messages(): JSONRPCMessage[] {
|
|
71
71
|
return this.sent.map((frame) => {
|
|
72
72
|
const message: unknown = JSON.parse(frame);
|
|
73
73
|
if (!isJSONRPCMessage(message)) {
|
|
@@ -100,7 +100,7 @@ export class ReconnectingWebSocketTransport implements Transport {
|
|
|
100
100
|
|
|
101
101
|
public onReconnect: (() => Promise<void>) | undefined;
|
|
102
102
|
|
|
103
|
-
constructor(options: ReconnectingWebSocketTransportOptions) {
|
|
103
|
+
public constructor(options: ReconnectingWebSocketTransportOptions) {
|
|
104
104
|
this.options = {
|
|
105
105
|
...options,
|
|
106
106
|
retries: options.retries ?? 1,
|
|
@@ -109,7 +109,7 @@ export class ReconnectingWebSocketTransport implements Transport {
|
|
|
109
109
|
this.onReconnect = options.onReconnect;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
async connect(): Promise<void> {
|
|
112
|
+
public async connect(): Promise<void> {
|
|
113
113
|
if (this.isClosed) {
|
|
114
114
|
throw new Error("Transport is closed");
|
|
115
115
|
}
|
|
@@ -136,7 +136,7 @@ export class ReconnectingWebSocketTransport implements Transport {
|
|
|
136
136
|
return this.isClosed || generation !== this.connectionGeneration;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
send(message: JSONRPCMessage): void {
|
|
139
|
+
public send(message: JSONRPCMessage): void {
|
|
140
140
|
if (this.isClosed) {
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
@@ -162,14 +162,14 @@ export class ReconnectingWebSocketTransport implements Transport {
|
|
|
162
162
|
this.reconnect();
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
onMessage(handler: (message: JSONRPCMessage) => void): () => void {
|
|
165
|
+
public onMessage(handler: (message: JSONRPCMessage) => void): () => void {
|
|
166
166
|
this.messageHandlers.add(handler);
|
|
167
167
|
return () => {
|
|
168
168
|
this.messageHandlers.delete(handler);
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
close(): void {
|
|
172
|
+
public close(): void {
|
|
173
173
|
if (this.isClosed) {
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
@@ -22,7 +22,7 @@ export class CachingRequestRegistry<REQ, RES> {
|
|
|
22
22
|
private toKey: ToKey<REQ>;
|
|
23
23
|
private cache: LRUCache<string, Promise<RES>>;
|
|
24
24
|
|
|
25
|
-
static jsonStringifySortKeys<T>(): ToKey<T> {
|
|
25
|
+
public static jsonStringifySortKeys<T>(): ToKey<T> {
|
|
26
26
|
return (o: T) => {
|
|
27
27
|
if (typeof o !== "object" || o === null) {
|
|
28
28
|
return String(o);
|
|
@@ -31,7 +31,7 @@ export class CachingRequestRegistry<REQ, RES> {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
constructor(
|
|
34
|
+
public constructor(
|
|
35
35
|
delegate: DeferredRequestRegistry<REQ, RES>,
|
|
36
36
|
options: CachingOptions<REQ> = {},
|
|
37
37
|
) {
|
|
@@ -27,7 +27,7 @@ export class DeferredRequestRegistry<REQ, RES> {
|
|
|
27
27
|
resolveExistingRequests?: () => RES;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
constructor(
|
|
30
|
+
public constructor(
|
|
31
31
|
operation: string,
|
|
32
32
|
makeRequest: (id: RequestId, req: REQ) => Promise<void>,
|
|
33
33
|
opts: {
|
|
@@ -42,7 +42,7 @@ export class DeferredRequestRegistry<REQ, RES> {
|
|
|
42
42
|
this.opts = opts;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
async request(opts: REQ): Promise<RES> {
|
|
45
|
+
public async request(opts: REQ): Promise<RES> {
|
|
46
46
|
if (this.opts.resolveExistingRequests) {
|
|
47
47
|
const result = this.opts.resolveExistingRequests();
|
|
48
48
|
for (const deferred of this.requests.values()) {
|
|
@@ -63,7 +63,7 @@ export class DeferredRequestRegistry<REQ, RES> {
|
|
|
63
63
|
return deferred.promise;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
resolve(requestId: RequestId, response: RES) {
|
|
66
|
+
public resolve(requestId: RequestId, response: RES) {
|
|
67
67
|
const entry = this.requests.get(requestId);
|
|
68
68
|
if (entry === undefined) {
|
|
69
69
|
return;
|
|
@@ -73,7 +73,7 @@ export class DeferredRequestRegistry<REQ, RES> {
|
|
|
73
73
|
this.requests.delete(requestId);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
reject(requestId: RequestId, error: Error) {
|
|
76
|
+
public reject(requestId: RequestId, error: Error) {
|
|
77
77
|
const entry = this.requests.get(requestId);
|
|
78
78
|
if (entry === undefined) {
|
|
79
79
|
return;
|
|
@@ -14,7 +14,7 @@ export class RuntimeManager {
|
|
|
14
14
|
private config: RuntimeConfig;
|
|
15
15
|
private lazy: boolean;
|
|
16
16
|
|
|
17
|
-
constructor(config: RuntimeConfig, lazy = false) {
|
|
17
|
+
public constructor(config: RuntimeConfig, lazy = false) {
|
|
18
18
|
this.config = config;
|
|
19
19
|
this.lazy = lazy;
|
|
20
20
|
// Validate the URL on construction
|
|
@@ -32,15 +32,15 @@ export class RuntimeManager {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
get isLazy(): boolean {
|
|
35
|
+
public get isLazy(): boolean {
|
|
36
36
|
return this.lazy;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
get httpURL(): URL {
|
|
39
|
+
public get httpURL(): URL {
|
|
40
40
|
return new URL(this.config.url);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
get isSameOrigin(): boolean {
|
|
43
|
+
public get isSameOrigin(): boolean {
|
|
44
44
|
return this.httpURL.origin === window.location.origin;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -51,7 +51,7 @@ export class RuntimeManager {
|
|
|
51
51
|
/**
|
|
52
52
|
* The base URL of the runtime.
|
|
53
53
|
*/
|
|
54
|
-
formatHttpURL({
|
|
54
|
+
public formatHttpURL({
|
|
55
55
|
path = "",
|
|
56
56
|
searchParams,
|
|
57
57
|
restrictToKnownQueryParams = true,
|
|
@@ -105,7 +105,10 @@ export class RuntimeManager {
|
|
|
105
105
|
* An HTTP URL for requests made by browser navigation (e.g. anchor-click
|
|
106
106
|
* downloads), which cannot attach auth headers.
|
|
107
107
|
*/
|
|
108
|
-
formatNavigableHttpURL(
|
|
108
|
+
public formatNavigableHttpURL(
|
|
109
|
+
path: string,
|
|
110
|
+
searchParams?: URLSearchParams,
|
|
111
|
+
): URL {
|
|
109
112
|
const url = this.formatHttpURL({ path, searchParams });
|
|
110
113
|
// Drop any token inherited from the current page's query params; re-add it
|
|
111
114
|
// only when cross-origin. Same-origin downloads authenticate via the
|
|
@@ -115,7 +118,7 @@ export class RuntimeManager {
|
|
|
115
118
|
return this.appendCrossOriginAuth(url);
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
formatWsURL(path: string, searchParams?: URLSearchParams): URL {
|
|
121
|
+
public formatWsURL(path: string, searchParams?: URLSearchParams): URL {
|
|
119
122
|
// We don't restrict to known query parameters, since mo.query_params()
|
|
120
123
|
// can accept arbitrary parameters.
|
|
121
124
|
const url = this.formatHttpURL({
|
|
@@ -150,7 +153,7 @@ export class RuntimeManager {
|
|
|
150
153
|
/**
|
|
151
154
|
* The WebSocket URL of the runtime.
|
|
152
155
|
*/
|
|
153
|
-
getWsURL(sessionId: SessionId): URL {
|
|
156
|
+
public getWsURL(sessionId: SessionId): URL {
|
|
154
157
|
return this.formatWsURL("/ws", this.getSessionSearchParams(sessionId));
|
|
155
158
|
}
|
|
156
159
|
|
|
@@ -160,7 +163,7 @@ export class RuntimeManager {
|
|
|
160
163
|
* can send headers, so auth travels in the Authorization header
|
|
161
164
|
* (see `headers()`) instead of the URL.
|
|
162
165
|
*/
|
|
163
|
-
getSseURL(sessionId: SessionId): URL {
|
|
166
|
+
public getSseURL(sessionId: SessionId): URL {
|
|
164
167
|
const url = this.formatHttpURL({
|
|
165
168
|
path: "/sse",
|
|
166
169
|
searchParams: this.getSessionSearchParams(sessionId),
|
|
@@ -176,14 +179,14 @@ export class RuntimeManager {
|
|
|
176
179
|
/**
|
|
177
180
|
* The WebSocket Sync URL of the runtime, for real-time updates.
|
|
178
181
|
*/
|
|
179
|
-
getWsSyncURL(sessionId: SessionId): URL {
|
|
182
|
+
public getWsSyncURL(sessionId: SessionId): URL {
|
|
180
183
|
return this.formatWsURL("/ws_sync", this.getSessionSearchParams(sessionId));
|
|
181
184
|
}
|
|
182
185
|
|
|
183
186
|
/**
|
|
184
187
|
* The WebSocket URL of the terminal.
|
|
185
188
|
*/
|
|
186
|
-
getTerminalWsURL(size?: { rows: number; cols: number }): URL {
|
|
189
|
+
public getTerminalWsURL(size?: { rows: number; cols: number }): URL {
|
|
187
190
|
const url = this.formatWsURL("/terminal/ws");
|
|
188
191
|
if (size) {
|
|
189
192
|
url.searchParams.set("rows", String(size.rows));
|
|
@@ -195,7 +198,9 @@ export class RuntimeManager {
|
|
|
195
198
|
/**
|
|
196
199
|
* The URL of the copilot server.
|
|
197
200
|
*/
|
|
198
|
-
getLSPURL(
|
|
201
|
+
public getLSPURL(
|
|
202
|
+
lsp: "pylsp" | "basedpyright" | "copilot" | "ty" | "pyrefly",
|
|
203
|
+
): URL {
|
|
199
204
|
if (lsp === "copilot") {
|
|
200
205
|
// For copilot, strip all query parameters except the auth token.
|
|
201
206
|
// Copilot doesn't understand arbitrary query params, but we still
|
|
@@ -211,14 +216,14 @@ export class RuntimeManager {
|
|
|
211
216
|
return this.formatWsURL(`/lsp/${lsp}`);
|
|
212
217
|
}
|
|
213
218
|
|
|
214
|
-
getAiURL(path: "completion" | "chat"): URL {
|
|
219
|
+
public getAiURL(path: "completion" | "chat"): URL {
|
|
215
220
|
return this.formatHttpURL({ path: `/api/ai/${path}` });
|
|
216
221
|
}
|
|
217
222
|
|
|
218
223
|
/**
|
|
219
224
|
* The URL of the health check endpoint.
|
|
220
225
|
*/
|
|
221
|
-
healthURL(): URL {
|
|
226
|
+
public healthURL(): URL {
|
|
222
227
|
return this.formatHttpURL({ path: "/health" });
|
|
223
228
|
}
|
|
224
229
|
|
|
@@ -234,7 +239,7 @@ export class RuntimeManager {
|
|
|
234
239
|
}
|
|
235
240
|
}
|
|
236
241
|
|
|
237
|
-
async reconcileFromHealth(): Promise<boolean> {
|
|
242
|
+
public async reconcileFromHealth(): Promise<boolean> {
|
|
238
243
|
// Always healthy if WASM, Islands, or a static notebook (no server)
|
|
239
244
|
if (this.isServerless) {
|
|
240
245
|
return true;
|
|
@@ -261,7 +266,7 @@ export class RuntimeManager {
|
|
|
261
266
|
return response.ok;
|
|
262
267
|
}
|
|
263
268
|
|
|
264
|
-
async probeHealth(): Promise<boolean> {
|
|
269
|
+
public async probeHealth(): Promise<boolean> {
|
|
265
270
|
// Always healthy if WASM, Islands, or a static notebook (no server)
|
|
266
271
|
if (this.isServerless) {
|
|
267
272
|
return true;
|
|
@@ -304,7 +309,7 @@ export class RuntimeManager {
|
|
|
304
309
|
}
|
|
305
310
|
}
|
|
306
311
|
|
|
307
|
-
async init(options?: { disableRetryDelay?: boolean }) {
|
|
312
|
+
public async init(options?: { disableRetryDelay?: boolean }) {
|
|
308
313
|
Logger.debug("Initializing runtime...");
|
|
309
314
|
let retries = 0;
|
|
310
315
|
// This matches backoff logic elsewhere.
|
|
@@ -335,11 +340,11 @@ export class RuntimeManager {
|
|
|
335
340
|
/**
|
|
336
341
|
* Wait for the runtime to be healthy.
|
|
337
342
|
*/
|
|
338
|
-
async waitForHealthy(): Promise<void> {
|
|
343
|
+
public async waitForHealthy(): Promise<void> {
|
|
339
344
|
return this.initialHealthyCheck.promise;
|
|
340
345
|
}
|
|
341
346
|
|
|
342
|
-
headers(): KnownHeaders {
|
|
347
|
+
public headers(): KnownHeaders {
|
|
343
348
|
const headers: KnownHeaders = {
|
|
344
349
|
"Marimo-Session-Id": getSessionId(),
|
|
345
350
|
"Marimo-Server-Token": this.config.serverToken ?? "",
|
|
@@ -356,7 +361,7 @@ export class RuntimeManager {
|
|
|
356
361
|
return headers;
|
|
357
362
|
}
|
|
358
363
|
|
|
359
|
-
sessionHeaders(): Pick<KnownHeaders, "Marimo-Session-Id"> {
|
|
364
|
+
public sessionHeaders(): Pick<KnownHeaders, "Marimo-Session-Id"> {
|
|
360
365
|
return {
|
|
361
366
|
"Marimo-Session-Id": getSessionId(),
|
|
362
367
|
};
|
|
@@ -13,7 +13,7 @@ export class VirtualFileTracker {
|
|
|
13
13
|
/**
|
|
14
14
|
* Shared instance of VirtualFileTracker since this must be a singleton.
|
|
15
15
|
*/
|
|
16
|
-
static get INSTANCE(): VirtualFileTracker {
|
|
16
|
+
public static get INSTANCE(): VirtualFileTracker {
|
|
17
17
|
const KEY = "_marimo_private_VirtualFileTracker";
|
|
18
18
|
if (!window[KEY]) {
|
|
19
19
|
window[KEY] = new VirtualFileTracker();
|
|
@@ -21,13 +21,13 @@ export class VirtualFileTracker {
|
|
|
21
21
|
return window[KEY] as VirtualFileTracker;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
virtualFiles = new Map<CellId, Set<string>>();
|
|
24
|
+
public virtualFiles = new Map<CellId, Set<string>>();
|
|
25
25
|
|
|
26
26
|
private constructor() {
|
|
27
27
|
// Private
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
track(message: Pick<CellMessage, "cell_id" | "output">): void {
|
|
30
|
+
public track(message: Pick<CellMessage, "cell_id" | "output">): void {
|
|
31
31
|
const output = message.output;
|
|
32
32
|
const cellId = message.cell_id;
|
|
33
33
|
if (!output) {
|
|
@@ -48,7 +48,7 @@ export class VirtualFileTracker {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
filenames(): string[] {
|
|
51
|
+
public filenames(): string[] {
|
|
52
52
|
const set = new Set<string>();
|
|
53
53
|
for (const files of this.virtualFiles.values()) {
|
|
54
54
|
files.forEach((file) => set.add(file));
|
|
@@ -57,7 +57,7 @@ export class VirtualFileTracker {
|
|
|
57
57
|
return [...set];
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
removeForCellId(cellId: CellId): void {
|
|
60
|
+
public removeForCellId(cellId: CellId): void {
|
|
61
61
|
this.virtualFiles.delete(cellId);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -35,8 +35,8 @@ vi.stubGlobal(
|
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
class MockURL extends URL {
|
|
38
|
-
static override createObjectURL = vi.fn(() => "blob:mock-url");
|
|
39
|
-
static override revokeObjectURL = vi.fn();
|
|
38
|
+
public static override createObjectURL = vi.fn(() => "blob:mock-url");
|
|
39
|
+
public static override revokeObjectURL = vi.fn();
|
|
40
40
|
}
|
|
41
41
|
vi.stubGlobal("URL", MockURL);
|
|
42
42
|
|