@marimo-team/frontend 0.25.1-dev90 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-Bdak5-o8.js → ConnectedDataExplorerComponent-DJ5jwKfp.js} +1 -1
- package/dist/assets/{ErrorBoundary-DrliQ_7g.js → ErrorBoundary-BeE1cdgM.js} +2 -2
- package/dist/assets/{ImageComparisonComponent-DLxkuRy3.js → ImageComparisonComponent-pCLPT6RA.js} +1 -1
- package/dist/assets/LazyAnyLanguageCodeMirror-B_IYTCX5.js +2 -0
- package/dist/assets/{RunButton-qknEPbRR.js → RunButton-C2kFUhyO.js} +10 -10
- package/dist/assets/{abnfDiagram-VCTEODGH-dm832Yw9.js → abnfDiagram-VCTEODGH-CSPJSGaM.js} +1 -1
- package/dist/assets/add-cell-with-ai-BFgdVPaN.js +76 -0
- package/dist/assets/{agent-panel-CJva58SL.js → agent-panel-Dh7yWh9P.js} +5 -5
- package/dist/assets/ai-model-dropdown-DJ2elMLM.js +5 -0
- package/dist/assets/{any-language-editor-B7QvjaYO.js → any-language-editor-Cj_HzlZY.js} +1 -1
- package/dist/assets/app-config-button-DBCTefOX.js +1 -0
- package/dist/assets/{architectureDiagram-5GKGNRK7-CiRaYU5G.js → architectureDiagram-5GKGNRK7-7iukRoC9.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-BK3JcsXA.js → blockDiagram-I7D4REHJ-cuhpQB60.js} +1 -1
- package/dist/assets/{c4Diagram-7LVT6UL2-BbMz-zwF.js → c4Diagram-7LVT6UL2-CMQEYn6T.js} +1 -1
- package/dist/assets/{cache-panel-DxdmvFwH.js → cache-panel-C0oB1kE2.js} +1 -1
- package/dist/assets/{cells-BcQ8Tm3j.js → cells-CzugpTQu.js} +33 -33
- package/dist/assets/channel-CGdeorQk.js +1 -0
- package/dist/assets/{chat-display-TI342pMF.js → chat-display-DevO4F8W.js} +1 -1
- package/dist/assets/chat-panel-BGw0bqDk.js +4 -0
- package/dist/assets/{chat-ui-B1aeiWdr.js → chat-ui-CZZFGlZi.js} +4 -4
- package/dist/assets/{chunk-4HAMMTFA-F3WVmmmo.js → chunk-4HAMMTFA-C6Tl7kEY.js} +1 -1
- package/dist/assets/{chunk-75Z2AOVW-DA_lihEi.js → chunk-75Z2AOVW-BzzYECN7.js} +1 -1
- package/dist/assets/{chunk-DU6HZSFF-J-califE.js → chunk-DU6HZSFF-BlpgvKzl.js} +2 -2
- package/dist/assets/{chunk-F27PBJKO-BzJrz4xx.js → chunk-F27PBJKO-BVIgLGPF.js} +1 -1
- package/dist/assets/{chunk-GMAD6QVW-mXoq4V-T.js → chunk-GMAD6QVW-hv6IsAru.js} +1 -1
- package/dist/assets/{chunk-GVQU2GXP-B-87l3Xt.js → chunk-GVQU2GXP-Duv4ZYb-.js} +1 -1
- package/dist/assets/{chunk-IMKFNOWR-yy9Ec7ZM.js → chunk-IMKFNOWR-BIILwBhp.js} +1 -1
- package/dist/assets/{chunk-L3NEJ4N5-DLeZO9l0.js → chunk-L3NEJ4N5-B2hafvRU.js} +1 -1
- package/dist/assets/{chunk-OSK3NFVY-PWoOtECb.js → chunk-OSK3NFVY-SNGRdtNA.js} +1 -1
- package/dist/assets/{chunk-P2QGCYS3-DsJshZeL.js → chunk-P2QGCYS3-_SeE0QXb.js} +1 -1
- package/dist/assets/{chunk-POPQ4Y6H-CCg5TpSp.js → chunk-POPQ4Y6H-BB5NNJFE.js} +1 -1
- package/dist/assets/{chunk-PWAF6VOD-CrFPAGFi.js → chunk-PWAF6VOD-BZoBqp8x.js} +1 -1
- package/dist/assets/{chunk-SHT3W25Y-lri4OQTX.js → chunk-SHT3W25Y-BtLGdeDB.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-B3ISFgJc.js → chunk-SVP7TREG-B0UfxhUP.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-CJ7ETjY3.js → chunk-TICWLB2K-BP7vel_P.js} +1 -1
- package/dist/assets/classDiagram-ZZMXUADV-CoNXKNMZ.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-CoNXKNMZ.js +1 -0
- package/dist/assets/code-visibility-BFNYI7hr.js +1 -0
- package/dist/assets/command-palette-DN4JoOLD.js +1 -0
- package/dist/assets/{common-cDzShymV.js → common-DUCPhoyP.js} +1 -1
- package/dist/assets/{components-B3KlHXnD.js → components-CK7CeYlo.js} +1 -1
- package/dist/assets/components-DAmFBASm.js +1 -0
- package/dist/assets/config-B4VJJibu.js +1 -0
- package/dist/assets/{utils-B3E7otfg.js → config-BxZgoFvi.js} +1 -1
- package/dist/assets/config-DpGPGznL.js +1 -0
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-1zl1wSTB.js → cynefinDiagram-5FMLGOSQ-BARZRQBb.js} +1 -1
- package/dist/assets/{dagre-DM-Ch8wC.js → dagre-DVyyr7Cb.js} +1 -1
- package/dist/assets/{dagre-GXQ25YYZ-BqoUeivc.js → dagre-GXQ25YYZ-79s0lOP0.js} +1 -1
- package/dist/assets/data-grid-overlay-editor-DPfnIudL.js +1 -0
- package/dist/assets/{dependency-graph-panel-C-SFFOPF.js → dependency-graph-panel-BN4CLayU.js} +3 -3
- package/dist/assets/{diagram-S7CK7UJ4-CF90sb1m.js → diagram-S7CK7UJ4-BCviGhvd.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-DgbZAUCH.js → diagram-UQ7AKVKN-Ds-BT46T.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-DOQllF_r.js → diagram-VSXAHHWV-CK4GkM-q.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-6dC0a_-i.js → diagram-VX7I27RA-BtL2eh0t.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-C1OXYmlB.js → diagram-Z3DM3KII-C6SmbLBS.js} +1 -1
- package/dist/assets/{dist-0HQ0BMF5.js → dist-CQvJDryh.js} +1 -1
- package/dist/assets/{documentation-panel-idK3s0j3.js → documentation-panel-CzRbXV5u.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-7gC3cuC7.js → ebnfDiagram-PWID7BFC-D_JU4cMQ.js} +1 -1
- package/dist/assets/edit-page-jGNYBqQo.js +174 -0
- package/dist/assets/{erDiagram-RLTQ6QDP-BsE87b_i.js → erDiagram-RLTQ6QDP-Z9MJ6X-r.js} +1 -1
- package/dist/assets/{error-entries-C-LFkdXb.js → error-entries-CDSsy76p.js} +1 -1
- package/dist/assets/{error-panel-YAFgCest.js → error-panel-ABvjFG3p.js} +1 -1
- package/dist/assets/{feedback-button-sRQQL2TH.js → feedback-button-CZhLiwkO.js} +2 -2
- package/dist/assets/file-explorer-panel-DTiEpmVE.js +1 -0
- package/dist/assets/file-name-input-C1C8xrjA.js +3 -0
- package/dist/assets/filename-fxG7K_MU.js +1 -0
- package/dist/assets/flowDiagram-HODETNUW-ncLciK2K.js +1 -0
- package/dist/assets/{gallery-page-CH8TM7bV.js → gallery-page-Moi4ZdJ0.js} +1 -1
- package/dist/assets/{ganttDiagram-EL5Y4UJY-d9Qqbnau.js → ganttDiagram-EL5Y4UJY-Cgy11k0G.js} +1 -1
- package/dist/assets/{gitGraphDiagram-WWUBYQGX-DBunV_fz.js → gitGraphDiagram-WWUBYQGX-CVH8fay_.js} +1 -1
- package/dist/assets/glide-data-editor-CbsCWu-K.js +131 -0
- package/dist/assets/{graphlib-DDJ8O6ZH.js → graphlib-3maKwbRO.js} +1 -1
- package/dist/assets/has-cJsIKK9t.js +1 -0
- package/dist/assets/home-page-UAgVOkCZ.js +4 -0
- package/dist/assets/index--sT8xf-8.css +2 -0
- package/dist/assets/index-DafnX1Xx.js +62 -0
- package/dist/assets/{infoDiagram-27XIBGKW-FE7De1I6.js → infoDiagram-27XIBGKW-Dk8U81nJ.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-CSEGYrJ-.js → ishikawaDiagram-5VMMS53U-CzHQlMUQ.js} +1 -1
- package/dist/assets/{journeyDiagram-3NMN7TZE-Cp4mxQrE.js → journeyDiagram-3NMN7TZE-DRc8ACzh.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-d7iAZsOb.js → kanban-definition-UXKFOSKX-CVyVYiI6.js} +1 -1
- package/dist/assets/katex-DkE0ukCy.js +257 -0
- package/dist/assets/{logs-panel-xMj01DRN.js → logs-panel-Bz5ysVX4.js} +1 -1
- package/dist/assets/{mermaid-CNjXdDrA.js → mermaid-D_jPUVqz.js} +4 -4
- package/dist/assets/mhchem-CmzEtQj8.js +1 -0
- package/dist/assets/{mindmap-definition-YA3MSWOX-CddM9_uP.js → mindmap-definition-YA3MSWOX-D5t6Aq5Z.js} +1 -1
- package/dist/assets/{number-overlay-editor-N57if5NT.js → number-overlay-editor-FAD8sjFU.js} +1 -1
- package/dist/assets/{outline-panel-Garp-f5k.js → outline-panel-85oiQ0XX.js} +1 -1
- package/dist/assets/packages-panel-ClKIaP5S.js +1 -0
- package/dist/assets/{panels-CnbmgzkS.js → panels-B48zp96D.js} +9 -9
- package/dist/assets/{pegDiagram-XKGWAZYB-CEns8d-M.js → pegDiagram-XKGWAZYB-BTkTm4ej.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-wyb0xQ0R.js → pieDiagram-E7YTZNPT-Bq6X88M1.js} +1 -1
- package/dist/assets/{process-output-ObDfw1uu.js → process-output-Cg2ta3vY.js} +1 -1
- package/dist/assets/{quadrantDiagram-AXDQQJYC-BE-xlTLH.js → quadrantDiagram-AXDQQJYC-D_wrOwLk.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-DZZVHmr2.js → railroadDiagram-O6MQD6OU-fv8HXW_g.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-C3Bf4dd5.js → requirementDiagram-BXWQKSXE-DDOOMUfC.js} +1 -1
- package/dist/assets/{reveal-component-DgrXq3Kv.js → reveal-component-CR43gpTZ.js} +3 -3
- package/dist/assets/run-page-NR_KFWk8.js +1 -0
- package/dist/assets/{sankeyDiagram-P5KCCOFB-BWLQCyjK.js → sankeyDiagram-P5KCCOFB-CvvUY6tS.js} +1 -1
- package/dist/assets/scratchpad-panel-DHc-oVb1.js +1 -0
- package/dist/assets/{secrets-panel-4dRIaZfY.js → secrets-panel-C-65ZjnM.js} +1 -1
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-BIY0mgX7.js → sequenceDiagram-WJ2MYXX4-DdpBhQaS.js} +1 -1
- package/dist/assets/session-DXKMv4Bs.js +1 -0
- package/dist/assets/session-panel-DiwQqIbt.js +1 -0
- package/dist/assets/{SelectionIndicator-DLJBcP4e.js → shell-BSnvn9t7.js} +1 -1
- package/dist/assets/snippets-panel-BLmXrneD.js +1 -0
- package/dist/assets/{stateDiagram-D77RDMKH-D_xRHRLf.js → stateDiagram-D77RDMKH-D3p19fac.js} +1 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-CplsDaDl.js +1 -0
- package/dist/assets/{swimlanes-42K2YHIH-CDQzpfz0.js → swimlanes-42K2YHIH-CLxCSvU4.js} +1 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-DPoIFx8T.js +8 -0
- package/dist/assets/{swiper-component-j-Lk25wW.js → swiper-component-rqJChT_P.js} +1 -1
- package/dist/assets/{terminal-BToH-U1t.js → terminal-CY4h1UmO.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-D5Jgj1fz.js → timeline-definition-24CTP7MA-Cw2PY--x.js} +1 -1
- package/dist/assets/tooltip-PLkI_UfK.js +61 -0
- package/dist/assets/{tracing-DtKLmNHj.js → tracing-Q8NAdlrA.js} +1 -1
- package/dist/assets/tracing-panel-Ci4kY4dr.js +2 -0
- package/dist/assets/useCellActionButton-DpYtVfFe.js +1 -0
- package/dist/assets/useTheme-DcnXlv0_.js +1 -0
- package/dist/assets/{constants-BDbGiS7O.js → utils-B4K466FK.js} +1 -1
- package/dist/assets/{vega-component-DVSvu4vP.js → vega-component-BpoSew4K.js} +1 -1
- package/dist/assets/{vega-embed-container-QM1zZmYi.js → vega-embed-container-BOJG8mCA.js} +1 -1
- package/dist/assets/{vennDiagram-4TSXK5OY-Cv6jxbpX.js → vennDiagram-4TSXK5OY-D8bN6lVl.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-lwv-YoWo.js → wardleyDiagram-VM6X3IG4-CbZdo0SA.js} +1 -1
- package/dist/assets/{write-secret-modal-CBUZw27N.js → write-secret-modal-BiG2tahJ.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-CGM4LlFN.js → xychartDiagram-S5SC5T6Z-DUUQ9tau.js} +1 -1
- package/dist/assets/youtube-A9VT7NHb.js +1 -0
- package/dist/index.html +14 -13
- 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/TableTopBar.tsx +2 -2
- package/src/components/data-table/__tests__/export-actions.test.tsx +662 -0
- 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/data-table/data-table.tsx +1 -1
- package/src/components/data-table/export-actions.tsx +642 -176
- package/src/components/data-table/schemas.ts +25 -3
- 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/markdown/markdown-renderer.css +1 -1
- 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/__tests__/share-modal.test.tsx +154 -0
- package/src/components/static-html/__tests__/stage-for-publish.test.ts +111 -0
- package/src/components/static-html/share-modal.tsx +114 -144
- package/src/components/static-html/stage-for-publish.ts +56 -0
- 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/kernel/__tests__/session.test.ts +110 -1
- package/src/core/kernel/session.ts +46 -15
- 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/network/__tests__/export-asset-url.test.ts +45 -0
- package/src/core/network/export-asset-url.ts +19 -0
- package/src/core/network/requests-network.ts +2 -7
- 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 +132 -133
- 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/assets/LazyAnyLanguageCodeMirror-EBegnOE0.js +0 -2
- package/dist/assets/add-cell-with-ai-Ovbsj95O.js +0 -76
- package/dist/assets/ai-model-dropdown-1t7m1iFc.js +0 -3
- package/dist/assets/app-config-button-vCxNGhe2.js +0 -1
- package/dist/assets/channel-ni7ei-yz.js +0 -1
- package/dist/assets/chat-panel-CzdR8RG_.js +0 -4
- package/dist/assets/classDiagram-ZZMXUADV-CIEFh40S.js +0 -1
- package/dist/assets/classDiagram-v2-VYDZK3BY-CIEFh40S.js +0 -1
- package/dist/assets/code-visibility-G0W4ym3Y.js +0 -1
- package/dist/assets/command-palette-DhdK67bL.js +0 -1
- package/dist/assets/components-CQVZgYvR.js +0 -1
- package/dist/assets/config-CMqNngzA.js +0 -1
- package/dist/assets/config-CmBpjGXk.js +0 -1
- package/dist/assets/data-grid-overlay-editor-DbqMOWZn.js +0 -1
- package/dist/assets/edit-page-_D_Nv3dJ.js +0 -176
- package/dist/assets/file-explorer-panel-LAa-LxTN.js +0 -1
- package/dist/assets/file-name-input-BXq6eIDs.js +0 -3
- package/dist/assets/flowDiagram-HODETNUW-B4xRBXB1.js +0 -1
- package/dist/assets/glide-data-editor-DPMjaN4R.js +0 -131
- package/dist/assets/has-CanCEarv.js +0 -1
- package/dist/assets/home-page-vDWLpS4F.js +0 -4
- package/dist/assets/index-2TQenOiQ.css +0 -2
- package/dist/assets/index-CgQsZfww.js +0 -62
- package/dist/assets/katex-mNPPSsir.js +0 -257
- package/dist/assets/katex-ukvJUC1e.js +0 -257
- package/dist/assets/mhchem-DcHTrqjv.js +0 -1
- package/dist/assets/packages-panel-B8HU9FAM.js +0 -1
- package/dist/assets/run-page-E0qMru0p.js +0 -1
- package/dist/assets/scratchpad-panel-CCFyaegO.js +0 -1
- package/dist/assets/session-C8nQMsOE.js +0 -1
- package/dist/assets/session-panel-CR3BHLhQ.js +0 -1
- package/dist/assets/snippets-panel-Dn22yTr_.js +0 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-BQvYFx_a.js +0 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-BAn2JKhB.js +0 -8
- package/dist/assets/tooltip-B1vGi-z4.js +0 -61
- package/dist/assets/tracing-panel-C5ybTQyJ.js +0 -2
- package/dist/assets/useCellActionButton-Bm9OZdcq.js +0 -1
- package/dist/assets/useTheme-Ho3YdAx3.js +0 -1
- package/dist/assets/youtube-ELpGJEdR.js +0 -1
|
@@ -3,9 +3,24 @@
|
|
|
3
3
|
import z from "zod";
|
|
4
4
|
import { rpc } from "@/plugins/core/rpc";
|
|
5
5
|
|
|
6
|
-
export type
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export type DownloadFormat = "csv" | "json" | "parquet" | "tsv";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Per-request export options. Each field is optional. A missing field keeps
|
|
10
|
+
* the widget's default for that setting.
|
|
11
|
+
*/
|
|
12
|
+
export interface DownloadAsOptions {
|
|
13
|
+
separator?: string;
|
|
14
|
+
encoding?: string;
|
|
15
|
+
ensure_ascii?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface DownloadAsRequest {
|
|
19
|
+
format: DownloadFormat;
|
|
20
|
+
options?: DownloadAsOptions;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type DownloadAsArgs = (req: DownloadAsRequest) => Promise<{
|
|
9
24
|
url: string;
|
|
10
25
|
filename: string;
|
|
11
26
|
error?: string | null;
|
|
@@ -16,6 +31,13 @@ export const DownloadAsSchema = rpc
|
|
|
16
31
|
.input(
|
|
17
32
|
z.object({
|
|
18
33
|
format: z.enum(["csv", "json", "parquet", "tsv"]),
|
|
34
|
+
options: z
|
|
35
|
+
.object({
|
|
36
|
+
separator: z.string().optional(),
|
|
37
|
+
encoding: z.string().optional(),
|
|
38
|
+
ensure_ascii: z.boolean().optional(),
|
|
39
|
+
})
|
|
40
|
+
.optional(),
|
|
19
41
|
}),
|
|
20
42
|
)
|
|
21
43
|
.output(
|
|
@@ -225,7 +225,7 @@ export class VerticalElementsBuilder implements ElementsBuilder {
|
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
createElements(
|
|
228
|
+
public createElements(
|
|
229
229
|
cellIds: CellId[],
|
|
230
230
|
cellAtoms: Atom<CellData>[],
|
|
231
231
|
variables: Variables,
|
|
@@ -311,7 +311,7 @@ export class TreeElementsBuilder implements ElementsBuilder {
|
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
-
createElements(
|
|
314
|
+
public createElements(
|
|
315
315
|
cellIds: CellId[],
|
|
316
316
|
cellAtoms: Atom<CellData>[],
|
|
317
317
|
variables: Variables,
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
4
|
+
import { createStore, Provider } from "jotai";
|
|
5
|
+
import { expect, it, vi } from "vitest";
|
|
6
|
+
import { MockRequestClient } from "@/__mocks__/requests";
|
|
7
|
+
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
8
|
+
import { alertAtom } from "@/core/alerts/state";
|
|
9
|
+
import {
|
|
10
|
+
defaultUserConfig,
|
|
11
|
+
type PackageManagerName,
|
|
12
|
+
} from "@/core/config/config-schema";
|
|
13
|
+
import { userConfigAtom } from "@/core/config/config";
|
|
14
|
+
import { requestClientAtom } from "@/core/network/requests";
|
|
15
|
+
import { sandboxAtom } from "@/core/packages/sandbox-state";
|
|
16
|
+
import { PackageAlert } from "../package-alert";
|
|
17
|
+
|
|
18
|
+
vi.mock("@/hooks/usePackageMetadata", () => ({
|
|
19
|
+
usePackageMetadata: () => ({
|
|
20
|
+
data: { versions: ["1.2.3"], extras: [] },
|
|
21
|
+
error: null,
|
|
22
|
+
isPending: false,
|
|
23
|
+
}),
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
function mountPackageAlert({
|
|
27
|
+
configuredManager,
|
|
28
|
+
sandboxBackend,
|
|
29
|
+
source = "kernel",
|
|
30
|
+
}: {
|
|
31
|
+
configuredManager: PackageManagerName;
|
|
32
|
+
sandboxBackend: "uv" | "pixi" | null;
|
|
33
|
+
source?: "kernel" | "server";
|
|
34
|
+
}) {
|
|
35
|
+
const store = createStore();
|
|
36
|
+
const client = MockRequestClient.create();
|
|
37
|
+
const config = defaultUserConfig();
|
|
38
|
+
store.set(userConfigAtom, {
|
|
39
|
+
...config,
|
|
40
|
+
package_management: { manager: configuredManager },
|
|
41
|
+
});
|
|
42
|
+
store.set(requestClientAtom, client);
|
|
43
|
+
store.set(
|
|
44
|
+
sandboxAtom,
|
|
45
|
+
sandboxBackend
|
|
46
|
+
? {
|
|
47
|
+
backend: sandboxBackend,
|
|
48
|
+
manifest: "",
|
|
49
|
+
filename: "notebook.py",
|
|
50
|
+
}
|
|
51
|
+
: null,
|
|
52
|
+
);
|
|
53
|
+
store.set(alertAtom, {
|
|
54
|
+
...store.get(alertAtom),
|
|
55
|
+
packageAlert: {
|
|
56
|
+
id: "missing-package",
|
|
57
|
+
kind: "missing",
|
|
58
|
+
packages: ["polars"],
|
|
59
|
+
isolated: true,
|
|
60
|
+
source,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
render(
|
|
64
|
+
<Provider store={store}>
|
|
65
|
+
<TooltipProvider>
|
|
66
|
+
<PackageAlert />
|
|
67
|
+
</TooltipProvider>
|
|
68
|
+
</Provider>,
|
|
69
|
+
);
|
|
70
|
+
return client;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
it.each(["uv", "pixi"] as const)(
|
|
74
|
+
"shows the fixed %s manager for a sandbox",
|
|
75
|
+
(sandboxBackend) => {
|
|
76
|
+
const client = mountPackageAlert({
|
|
77
|
+
configuredManager: sandboxBackend === "uv" ? "pixi" : "uv",
|
|
78
|
+
sandboxBackend,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const managerSelect = screen.getByTestId("install-package-manager-select");
|
|
82
|
+
expect(managerSelect).toHaveValue(sandboxBackend);
|
|
83
|
+
expect(managerSelect).toBeDisabled();
|
|
84
|
+
|
|
85
|
+
fireEvent.click(screen.getByTestId("install-packages-button"));
|
|
86
|
+
expect(client.sendInstallMissingPackages).toHaveBeenCalledWith(
|
|
87
|
+
expect.objectContaining({ manager: sandboxBackend }),
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
it("keeps the configured package manager selectable outside a sandbox", () => {
|
|
93
|
+
mountPackageAlert({ configuredManager: "uv", sandboxBackend: null });
|
|
94
|
+
|
|
95
|
+
const managerSelect = screen.getByTestId("install-package-manager-select");
|
|
96
|
+
expect(managerSelect).toHaveValue("uv");
|
|
97
|
+
expect(managerSelect).not.toBeDisabled();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("installs a selected version in a Pixi sandbox", () => {
|
|
101
|
+
const client = mountPackageAlert({
|
|
102
|
+
configuredManager: "uv",
|
|
103
|
+
sandboxBackend: "pixi",
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
fireEvent.change(screen.getByDisplayValue("latest"), {
|
|
107
|
+
target: { value: "1.2.3" },
|
|
108
|
+
});
|
|
109
|
+
fireEvent.click(screen.getByTestId("install-packages-button"));
|
|
110
|
+
expect(client.sendInstallMissingPackages).toHaveBeenCalledExactlyOnceWith({
|
|
111
|
+
manager: "pixi",
|
|
112
|
+
versions: { polars: "1.2.3" },
|
|
113
|
+
source: "kernel",
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it("does not offer version selection for Pixi outside a sandbox", () => {
|
|
118
|
+
mountPackageAlert({ configuredManager: "pixi", sandboxBackend: null });
|
|
119
|
+
|
|
120
|
+
expect(screen.queryByDisplayValue("latest")).not.toBeInTheDocument();
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("uses the configured package manager for a server installation", () => {
|
|
124
|
+
const client = mountPackageAlert({
|
|
125
|
+
configuredManager: "uv",
|
|
126
|
+
sandboxBackend: "pixi",
|
|
127
|
+
source: "server",
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
expect(
|
|
131
|
+
screen.queryByTestId("install-package-manager-select"),
|
|
132
|
+
).not.toBeInTheDocument();
|
|
133
|
+
|
|
134
|
+
fireEvent.click(screen.getByTestId("install-packages-button"));
|
|
135
|
+
expect(client.sendInstallMissingPackages).toHaveBeenCalledExactlyOnceWith({
|
|
136
|
+
manager: "uv",
|
|
137
|
+
versions: { polars: "" },
|
|
138
|
+
source: "server",
|
|
139
|
+
});
|
|
140
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
4
|
+
import { Provider } from "jotai";
|
|
5
|
+
import type React from "react";
|
|
6
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
7
|
+
import { ModalProvider } from "@/components/modal/ImperativeModal";
|
|
8
|
+
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
9
|
+
import { store } from "@/core/state/jotai";
|
|
10
|
+
import { PairWithAgentBanner, PairWithAgentButton } from "../pair-with-agent";
|
|
11
|
+
|
|
12
|
+
const mocks = vi.hoisted(() => ({
|
|
13
|
+
isWasm: vi.fn(() => false),
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
vi.mock("@/core/wasm/utils", () => ({
|
|
17
|
+
isWasm: mocks.isWasm,
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
function wrapper({ children }: { children: React.ReactNode }) {
|
|
21
|
+
return (
|
|
22
|
+
<Provider store={store}>
|
|
23
|
+
<TooltipProvider>
|
|
24
|
+
<ModalProvider>{children}</ModalProvider>
|
|
25
|
+
</TooltipProvider>
|
|
26
|
+
</Provider>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function stubTokenFetch() {
|
|
31
|
+
vi.stubGlobal(
|
|
32
|
+
"fetch",
|
|
33
|
+
vi.fn().mockResolvedValue(new Response(JSON.stringify({ token: null }))),
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
describe("PairWithAgent", () => {
|
|
38
|
+
afterEach(() => {
|
|
39
|
+
vi.unstubAllGlobals();
|
|
40
|
+
mocks.isWasm.mockReset();
|
|
41
|
+
mocks.isWasm.mockReturnValue(false);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("shows local agent options", () => {
|
|
45
|
+
render(<PairWithAgentBanner />, { wrapper });
|
|
46
|
+
|
|
47
|
+
expect(
|
|
48
|
+
screen.getByRole("group", { name: "Supported agents" }),
|
|
49
|
+
).toBeVisible();
|
|
50
|
+
expect(screen.getByRole("figure", { name: "Claude Code" })).toBeVisible();
|
|
51
|
+
expect(screen.getByRole("figure", { name: "Codex" })).toBeVisible();
|
|
52
|
+
expect(screen.getByRole("figure", { name: "Cursor" })).toBeVisible();
|
|
53
|
+
expect(screen.getByRole("figure", { name: "Gemini CLI" })).toBeVisible();
|
|
54
|
+
expect(screen.getByRole("figure", { name: "OpenCode" })).toBeVisible();
|
|
55
|
+
expect(
|
|
56
|
+
screen.getByRole("figure", { name: "GitHub Copilot" }),
|
|
57
|
+
).toBeVisible();
|
|
58
|
+
expect(
|
|
59
|
+
screen.getByRole("figure", { name: "Any local agent" }),
|
|
60
|
+
).toBeVisible();
|
|
61
|
+
expect(
|
|
62
|
+
screen.getByRole("button", {
|
|
63
|
+
name: "Learn more.",
|
|
64
|
+
}),
|
|
65
|
+
).toBeVisible();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("opens the pairing dialog from the banner description", () => {
|
|
69
|
+
stubTokenFetch();
|
|
70
|
+
render(<PairWithAgentBanner />, { wrapper });
|
|
71
|
+
|
|
72
|
+
fireEvent.click(
|
|
73
|
+
screen.getByRole("button", {
|
|
74
|
+
name: "Learn more.",
|
|
75
|
+
}),
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
expect(
|
|
79
|
+
screen.getByRole("dialog", { name: "Pair with an agent" }),
|
|
80
|
+
).toBeVisible();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("opens the pairing dialog and preserves a passed click handler", () => {
|
|
84
|
+
const onClick = vi.fn();
|
|
85
|
+
stubTokenFetch();
|
|
86
|
+
render(<PairWithAgentButton onClick={onClick} />, { wrapper });
|
|
87
|
+
|
|
88
|
+
fireEvent.click(screen.getByRole("button", { name: "Connect your agent" }));
|
|
89
|
+
|
|
90
|
+
expect(onClick).toHaveBeenCalledOnce();
|
|
91
|
+
expect(
|
|
92
|
+
screen.getByRole("dialog", { name: "Pair with an agent" }),
|
|
93
|
+
).toBeVisible();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("hides pairing controls in WASM", () => {
|
|
97
|
+
mocks.isWasm.mockReturnValue(true);
|
|
98
|
+
|
|
99
|
+
const { container, rerender } = render(<PairWithAgentButton />, {
|
|
100
|
+
wrapper,
|
|
101
|
+
});
|
|
102
|
+
expect(container).toBeEmptyDOMElement();
|
|
103
|
+
|
|
104
|
+
rerender(<PairWithAgentBanner />);
|
|
105
|
+
expect(container).toBeEmptyDOMElement();
|
|
106
|
+
});
|
|
107
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { BotIcon } from "lucide-react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { AiProviderIcon } from "@/components/ai/ai-provider-icon";
|
|
6
|
+
import { useImperativeModal } from "@/components/modal/ImperativeModal";
|
|
7
|
+
import { Button, type ButtonProps } from "@/components/ui/button";
|
|
8
|
+
import { isWasm } from "@/core/wasm/utils";
|
|
9
|
+
import { cn } from "@/utils/cn";
|
|
10
|
+
import { PairWithAgentModal } from "./pair-with-agent-modal";
|
|
11
|
+
|
|
12
|
+
const FEATURED_AGENTS = [
|
|
13
|
+
{ id: "claude", label: "Claude Code" },
|
|
14
|
+
{ id: "codex", label: "Codex" },
|
|
15
|
+
{ id: "cursor", label: "Cursor" },
|
|
16
|
+
{ id: "gemini", label: "Gemini CLI" },
|
|
17
|
+
{ id: "opencode", label: "OpenCode" },
|
|
18
|
+
{ id: "github", label: "GitHub Copilot" },
|
|
19
|
+
{ id: "openai-compatible", label: "Any local agent" },
|
|
20
|
+
] as const satisfies ReadonlyArray<{
|
|
21
|
+
id: React.ComponentProps<typeof AiProviderIcon>["provider"];
|
|
22
|
+
label: string;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
export const usePairWithAgentModal = () => {
|
|
26
|
+
const { openModal, closeModal } = useImperativeModal();
|
|
27
|
+
|
|
28
|
+
return React.useCallback(
|
|
29
|
+
() => openModal(<PairWithAgentModal onClose={closeModal} />),
|
|
30
|
+
[openModal, closeModal],
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const PairWithAgentButton: React.FC<
|
|
35
|
+
ButtonProps & { label?: string }
|
|
36
|
+
> = ({ className, label = "Connect your agent", onClick, ...props }) => {
|
|
37
|
+
const openPairWithAgentModal = usePairWithAgentModal();
|
|
38
|
+
|
|
39
|
+
if (isWasm()) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Button
|
|
45
|
+
type="button"
|
|
46
|
+
variant="link"
|
|
47
|
+
size="xs"
|
|
48
|
+
className={cn("h-auto gap-1 px-0", className)}
|
|
49
|
+
onClick={(event) => {
|
|
50
|
+
onClick?.(event);
|
|
51
|
+
if (!event.defaultPrevented) {
|
|
52
|
+
openPairWithAgentModal();
|
|
53
|
+
}
|
|
54
|
+
}}
|
|
55
|
+
{...props}
|
|
56
|
+
>
|
|
57
|
+
{label}
|
|
58
|
+
</Button>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const PairWithAgentBanner: React.FC<{
|
|
63
|
+
label?: string;
|
|
64
|
+
className?: string;
|
|
65
|
+
}> = ({ label = "Connect your agent", className }) => {
|
|
66
|
+
const openPairWithAgentModal = usePairWithAgentModal();
|
|
67
|
+
|
|
68
|
+
if (isWasm()) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
className={cn(
|
|
75
|
+
"rounded-lg border border-(--blue-6) bg-(--blue-2)/50 p-3",
|
|
76
|
+
className,
|
|
77
|
+
)}
|
|
78
|
+
>
|
|
79
|
+
<div className="flex items-center gap-2 text-sm font-semibold">
|
|
80
|
+
{label}
|
|
81
|
+
<fieldset
|
|
82
|
+
className="m-0 flex min-w-0 -space-x-1.5 border-0 p-0 mb-0.5"
|
|
83
|
+
aria-label="Supported agents"
|
|
84
|
+
>
|
|
85
|
+
{FEATURED_AGENTS.map(({ id, label }) => (
|
|
86
|
+
<figure
|
|
87
|
+
key={id}
|
|
88
|
+
title={label}
|
|
89
|
+
aria-label={label}
|
|
90
|
+
className="flex size-6 items-center justify-center rounded-full border bg-background shadow-xs"
|
|
91
|
+
>
|
|
92
|
+
{id === "openai-compatible" ? (
|
|
93
|
+
<BotIcon className="size-3.5" aria-hidden={true} />
|
|
94
|
+
) : (
|
|
95
|
+
<AiProviderIcon
|
|
96
|
+
provider={id}
|
|
97
|
+
className="size-3.5"
|
|
98
|
+
aria-hidden={true}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
</figure>
|
|
102
|
+
))}
|
|
103
|
+
</fieldset>
|
|
104
|
+
</div>
|
|
105
|
+
<div className="mt-1 text-xs leading-relaxed">
|
|
106
|
+
<p className="inline">
|
|
107
|
+
Use your AI coding agent to pair-program on this notebook.
|
|
108
|
+
</p>
|
|
109
|
+
<button
|
|
110
|
+
type="button"
|
|
111
|
+
onClick={openPairWithAgentModal}
|
|
112
|
+
className="text-link hover:underline ml-1"
|
|
113
|
+
>
|
|
114
|
+
Learn more.
|
|
115
|
+
</button>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
@@ -297,11 +297,12 @@ export function useNotebookActions({
|
|
|
297
297
|
|
|
298
298
|
{
|
|
299
299
|
icon: <SparklesIcon size={14} strokeWidth={1.5} />,
|
|
300
|
-
label: "
|
|
300
|
+
label: "Connect your agent",
|
|
301
301
|
hidden: isWasm(),
|
|
302
302
|
handle: async () => {
|
|
303
303
|
openModal(<PairWithAgentModal onClose={closeModal} />);
|
|
304
304
|
},
|
|
305
|
+
additionalKeywords: ["connect"],
|
|
305
306
|
},
|
|
306
307
|
|
|
307
308
|
{
|
|
@@ -29,6 +29,7 @@ import useEvent from "react-use-event-hook";
|
|
|
29
29
|
import { DefaultChatTransport } from "ai";
|
|
30
30
|
import { z } from "zod";
|
|
31
31
|
import { AIModelDropdown } from "@/components/ai/ai-model-dropdown";
|
|
32
|
+
import { PairWithAgentButton } from "@/components/editor/actions/pair-with-agent";
|
|
32
33
|
import {
|
|
33
34
|
AddContextButton,
|
|
34
35
|
AttachFileButton,
|
|
@@ -301,6 +302,7 @@ export const AddCellWithAI: React.FC<{
|
|
|
301
302
|
showAddCustomModelDocs={true}
|
|
302
303
|
/>
|
|
303
304
|
{languageDropdown}
|
|
305
|
+
<PairWithAgentButton />
|
|
304
306
|
</div>
|
|
305
307
|
<div className="flex flex-row items-center">
|
|
306
308
|
{files.length > 0 && (
|
|
@@ -14,13 +14,13 @@ interface SubmissionAttempt {
|
|
|
14
14
|
export class StagedCellSubmissionController {
|
|
15
15
|
private activeAttempt: SubmissionAttempt | null = null;
|
|
16
16
|
|
|
17
|
-
cancel() {
|
|
17
|
+
public cancel() {
|
|
18
18
|
if (this.activeAttempt) {
|
|
19
19
|
this.activeAttempt.cancelled = true;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
async run<T>({ prepare, submit, onError }: SubmissionCallbacks<T>) {
|
|
23
|
+
public async run<T>({ prepare, submit, onError }: SubmissionCallbacks<T>) {
|
|
24
24
|
if (this.activeAttempt !== null) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -15,7 +15,7 @@ export class StreamingChunkTransport<
|
|
|
15
15
|
> extends DefaultChatTransport<UI_MESSAGE> {
|
|
16
16
|
private onChunkReceived: (chunk: UIMessageChunk) => void;
|
|
17
17
|
|
|
18
|
-
constructor(
|
|
18
|
+
public constructor(
|
|
19
19
|
options: HttpChatTransportInitOptions<UI_MESSAGE>,
|
|
20
20
|
onChunkReceived: (chunk: UIMessageChunk) => void,
|
|
21
21
|
) {
|
|
@@ -40,7 +40,12 @@ const ContributeSnippetModal: React.FC<{
|
|
|
40
40
|
<DialogDescription>
|
|
41
41
|
Have a useful snippet you want to share with the community? Make a
|
|
42
42
|
pull request{" "}
|
|
43
|
-
<a
|
|
43
|
+
<a
|
|
44
|
+
href={Constants.githubPage}
|
|
45
|
+
target="_blank"
|
|
46
|
+
rel="noreferrer"
|
|
47
|
+
className="underline"
|
|
48
|
+
>
|
|
44
49
|
on GitHub
|
|
45
50
|
</a>
|
|
46
51
|
.
|