@marimo-team/islands 0.15.2 → 0.15.3

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.
Files changed (189) hide show
  1. package/dist/{ConnectedDataExplorerComponent-C39nQwtD.js → ConnectedDataExplorerComponent-DfvW3rBn.js} +323 -328
  2. package/dist/{ImageComparisonComponent-BhkiyswP.js → ImageComparisonComponent-XaJshw7d.js} +13 -13
  3. package/dist/{_baseUniq-DdHL34FO.js → _baseUniq-dN9WKF9m.js} +67 -67
  4. package/dist/any-language-editor-CpFniVi-.js +27 -0
  5. package/dist/{arc-BXrety1g.js → arc-BOhn-m2C.js} +1 -1
  6. package/dist/{architectureDiagram-KFL7JDKH-BMy6ywCF.js → architectureDiagram-W76B3OCA-Bpg85ZKv.js} +144 -144
  7. package/dist/assets/{worker-COGufAQn.js → worker-Y-Q4G-N2.js} +30 -26
  8. package/dist/asterisk-DS281yxp.js +271 -0
  9. package/dist/{blockDiagram-ZYB65J3Q-DYT2-nlI.js → blockDiagram-QIGZ2CNN-DS1kOHlW.js} +10 -10
  10. package/dist/{c4Diagram-AAMF2YG6-ZiQzioe6.js → c4Diagram-FPNF74CW-CyRVKssw.js} +8 -8
  11. package/dist/{channel-CeuXqUAU.js → channel-BilGXox7.js} +1 -1
  12. package/dist/{chunk-ANTBXLJU-BvYnIrdq.js → chunk-4BX2VUAB-CZR39zCO.js} +1 -1
  13. package/dist/{chunk-WVR4S24B-DXj8yaUk.js → chunk-55IACEB6-BIH-MYov.js} +1 -1
  14. package/dist/{chunk-GLLZNHP4-CyFsosAe.js → chunk-FMBD7UC4-4PZXFZE8.js} +1 -1
  15. package/dist/{chunk-JBRWN2VN-DA_EEhy2.js → chunk-K7UQS3LO-CEvWKznk.js} +117 -117
  16. package/dist/{chunk-NRVI72HA-BYx2jMlI.js → chunk-QN33PNHL-D5LO5Jq_.js} +1 -1
  17. package/dist/{chunk-FHKO5MBM-DfCztBk8.js → chunk-QZHKN3VN-6gwUonWI.js} +1 -1
  18. package/dist/{chunk-LXBSTHXV-Se7vdY6J.js → chunk-TVAH2DTR-3gm06QdU.js} +7 -7
  19. package/dist/{chunk-OMD6QJNC-CqgcPMgL.js → chunk-TZMSLE5B-Cm8Iy9bO.js} +1 -1
  20. package/dist/{classDiagram-v2-QTMF73CY-B19A3G1l.js → classDiagram-KNZD7YFC-DC529O_z.js} +2 -2
  21. package/dist/{classDiagram-3BZAVTQC-B19A3G1l.js → classDiagram-v2-RKCZMP56-DC529O_z.js} +2 -2
  22. package/dist/{clone-78au0tn1.js → clone-CLoRX3j6.js} +1 -1
  23. package/dist/cose-bilkent-S5V4N54A-qf5DlS6Y.js +2609 -0
  24. package/dist/{cytoscape.esm-BYnVVhJX.js → cytoscape.esm-DfdJODL8.js} +34 -34
  25. package/dist/{dagre-2BBEFEWP-BfEn3ZUV.js → dagre-5GWH7T2D-Ceocls0m.js} +6 -6
  26. package/dist/{data-grid-overlay-editor-CH_qLkV2.js → data-grid-overlay-editor-AqDS_UKe.js} +11 -11
  27. package/dist/{diagram-4IRLE6MV-CL8xidnG.js → diagram-N5W7TBWH-CP66oSiv.js} +59 -60
  28. package/dist/{diagram-RP2FKANI-B1BPcUew.js → diagram-QEK2KX5R-_YD4kxxi.js} +15 -15
  29. package/dist/{diagram-GUPCWM2R-CZ5cfqlq.js → diagram-S2PKOQOG-Cnj8T-OP.js} +10 -10
  30. package/dist/dockerfile-Cm8cRYCN.js +194 -0
  31. package/dist/ebnf-DUPDuY4r.js +78 -0
  32. package/dist/{erDiagram-HZWUO2LU-BEAIww50.js → erDiagram-AWTI2OKA-CGnvoHx6.js} +8 -8
  33. package/dist/fcl-CPC2WYrI.js +103 -0
  34. package/dist/{flowDiagram-THRYKUMA-Czs2UAI2.js → flowDiagram-PVAE7QVJ-DG-pr9R9.js} +9 -9
  35. package/dist/{ganttDiagram-WV7ZQ7D5-ByYIAVFO.js → ganttDiagram-OWAHRB6G-JmChtxvn.js} +34 -34
  36. package/dist/{gitGraphDiagram-OJR772UL-BcpDsiyB.js → gitGraphDiagram-NY62KEGX-D8wLfOPd.js} +4 -4
  37. package/dist/{glide-data-editor-CmN6FVyi.js → glide-data-editor-9nC3iCIZ.js} +33 -33
  38. package/dist/{graph-77W6heli.js → graph-CoRe7vAN.js} +3 -3
  39. package/dist/http-D9LttvKF.js +44 -0
  40. package/dist/{index-Bfk9dnyS.js → index-6qYeHHjQ.js} +33090 -32892
  41. package/dist/{index-BOojn38D.js → index-BpzLh4Qe.js} +7711 -7711
  42. package/dist/{index-CmozKMxx.js → index-BthgsgYX.js} +6 -6
  43. package/dist/{index-pBmAzQJl.js → index-MCx5v1x0.js} +2 -2
  44. package/dist/index-jkm77Jrz.js +98 -0
  45. package/dist/{infoDiagram-6WOFNB3A-CfzLHHVP.js → infoDiagram-STP46IZ2-BlXxvOrR.js} +2 -2
  46. package/dist/{journeyDiagram-FFXJYRFH-ndAcpkGn.js → journeyDiagram-BIP6EPQ6-CNRYs_Fc.js} +24 -26
  47. package/dist/{kanban-definition-KOZQBZVT-DcQYzNvc.js → kanban-definition-6OIFK2YF-B9HeMAuP.js} +14 -14
  48. package/dist/{layout-XySVHJgD.js → layout-m2vOUiW1.js} +81 -81
  49. package/dist/{linear-PbooOqg7.js → linear-DU6Q5CX3.js} +35 -35
  50. package/dist/{main-B5yML0bw.js → main-BD2KGFpU.js} +74594 -68034
  51. package/dist/main.js +1 -1
  52. package/dist/{mermaid-Cg5IX6Nv.js → mermaid-HVCtvbyx.js} +6160 -7493
  53. package/dist/min-DcGMA4e_.js +80 -0
  54. package/dist/mindmap-definition-Q6HEUPPD-BW8UmIDQ.js +785 -0
  55. package/dist/nginx-zDPm3Z74.js +89 -0
  56. package/dist/{number-overlay-editor-DUhfZqtP.js → number-overlay-editor-D8Hl0Syo.js} +19 -19
  57. package/dist/{pieDiagram-DBDJKBY4-DTOlNsja.js → pieDiagram-ADFJNKIX-Bg-3zg5U.js} +17 -17
  58. package/dist/{quadrantDiagram-YPSRARAO-BX2d8VS-.js → quadrantDiagram-LMRXKWRM-BO4IG6Yz.js} +6 -6
  59. package/dist/{react-plotly-Dcyw-3Sa.js → react-plotly-dkvHVuRb.js} +3577 -3577
  60. package/dist/{requirementDiagram-EGVEC5DT-D1T5u-wG.js → requirementDiagram-4UW4RH46-5sdTguSM.js} +7 -7
  61. package/dist/{sankeyDiagram-HRAUVNP4-G6xDfnp-.js → sankeyDiagram-GR3RE2ED-Buhlv9OI.js} +5 -5
  62. package/dist/sequenceDiagram-C3RYC4MD-C3qsM2UP.js +2519 -0
  63. package/dist/{slides-component-BJLlPJSr.js → slides-component-D209A0-s.js} +66 -66
  64. package/dist/solr-BNlsLglM.js +41 -0
  65. package/dist/spreadsheet-C-cy4P5N.js +49 -0
  66. package/dist/{stateDiagram-UUKSUZ4H-CYXbjaom.js → stateDiagram-KXAO66HF-CopJ7G6P.js} +5 -5
  67. package/dist/{stateDiagram-v2-EYPG3UTE-Br1HYKT6.js → stateDiagram-v2-UMBNRL4Z-CejL8AKf.js} +2 -2
  68. package/dist/style.css +1 -1
  69. package/dist/tiddlywiki-5wqsXtSk.js +155 -0
  70. package/dist/tiki-__Kn3CeS.js +181 -0
  71. package/dist/{time-B9SZnSen.js → time-BwSBitlN.js} +58 -58
  72. package/dist/{timeline-definition-3HZDQTIS-DeK_ZRD0.js → timeline-definition-XQNQX7LJ-DzMNTX-C.js} +10 -12
  73. package/dist/{timer-BYwnU4DF.js → timer-B0-z63CM.js} +16 -16
  74. package/dist/{treemap-75Q7IDZK-CKP4vV_0.js → treemap-75Q7IDZK-zeJG07dk.js} +14 -14
  75. package/dist/{vega-component-CpgdqX2d.js → vega-component-CUkiTayd.js} +30 -30
  76. package/dist/{xychartDiagram-FDP5SA34-AMEPsx_R.js → xychartDiagram-6GGTOJPD-DiENNXMS.js} +7 -7
  77. package/package.json +39 -39
  78. package/src/__mocks__/notebook.ts +3 -0
  79. package/src/__mocks__/requests.ts +3 -0
  80. package/src/__tests__/__snapshots__/CellStatus.test.tsx.snap +12 -12
  81. package/src/__tests__/chat-utils.test.ts +26 -211
  82. package/src/components/ai/ai-model-dropdown.tsx +25 -9
  83. package/src/components/app-config/ai-config.tsx +7 -0
  84. package/src/components/chat/chat-components.tsx +71 -0
  85. package/src/components/chat/chat-panel.tsx +481 -291
  86. package/src/components/chat/chat-utils.ts +50 -0
  87. package/src/components/chat/markdown-renderer.tsx +3 -7
  88. package/src/components/chat/tool-call-accordion.tsx +5 -5
  89. package/src/components/datasources/__tests__/utils.test.ts +6 -0
  90. package/src/components/datasources/column-preview.tsx +1 -3
  91. package/src/components/editor/actions/useNotebookActions.tsx +1 -1
  92. package/src/components/editor/ai/add-cell-with-ai.tsx +20 -15
  93. package/src/components/editor/ai/ai-completion-editor.tsx +22 -3
  94. package/src/components/editor/ai/completion-handlers.tsx +2 -4
  95. package/src/components/editor/ai/completion-utils.ts +85 -11
  96. package/src/components/editor/alerts/startup-logs-alert.tsx +72 -0
  97. package/src/components/editor/chrome/panels/datasources-panel.tsx +3 -1
  98. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +3 -1
  99. package/src/components/editor/chrome/panels/documentation-panel.tsx +3 -1
  100. package/src/components/editor/chrome/panels/error-panel.tsx +3 -1
  101. package/src/components/editor/chrome/panels/file-explorer-panel.tsx +3 -1
  102. package/src/components/editor/chrome/panels/logs-panel.tsx +3 -1
  103. package/src/components/editor/chrome/panels/outline-panel.tsx +3 -1
  104. package/src/components/editor/chrome/panels/packages-panel.tsx +4 -2
  105. package/src/components/editor/chrome/panels/scratchpad-panel.tsx +3 -1
  106. package/src/components/editor/chrome/panels/secrets-panel.tsx +3 -1
  107. package/src/components/editor/chrome/panels/snippets-panel.tsx +3 -1
  108. package/src/components/editor/chrome/panels/tracing-panel.tsx +3 -1
  109. package/src/components/editor/chrome/panels/variable-panel.tsx +3 -1
  110. package/src/components/editor/chrome/wrapper/app-chrome.tsx +38 -28
  111. package/src/components/editor/controls/command-palette-button.tsx +1 -1
  112. package/src/components/editor/controls/command-palette.tsx +5 -4
  113. package/src/components/editor/controls/state.ts +4 -0
  114. package/src/components/editor/package-alert.tsx +108 -58
  115. package/src/components/editor/renderers/CellArray.tsx +2 -0
  116. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +0 -1
  117. package/src/components/pages/edit-page.tsx +7 -3
  118. package/src/core/ai/chat-utils.ts +26 -43
  119. package/src/core/ai/config.ts +1 -1
  120. package/src/core/ai/context/__tests__/registry.test.ts +277 -3
  121. package/src/core/ai/context/context.ts +11 -1
  122. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +378 -0
  123. package/src/core/ai/context/providers/__tests__/error.test.ts +3 -2
  124. package/src/core/ai/context/providers/__tests__/file.test.ts +119 -0
  125. package/src/core/ai/context/providers/cell-output.ts +349 -0
  126. package/src/core/ai/context/providers/common.ts +5 -1
  127. package/src/core/ai/context/providers/file.ts +287 -0
  128. package/src/core/ai/context/registry.ts +79 -0
  129. package/src/core/ai/state.ts +22 -5
  130. package/src/core/alerts/state.ts +71 -3
  131. package/src/core/cells/cell.ts +2 -2
  132. package/src/core/cells/cells.ts +1 -1
  133. package/src/core/cells/logs.ts +1 -1
  134. package/src/core/cells/runs.ts +6 -5
  135. package/src/core/codemirror/ai/resources.ts +47 -5
  136. package/src/core/codemirror/ai/state.ts +12 -0
  137. package/src/core/codemirror/language/__tests__/sql.test.ts +45 -0
  138. package/src/core/codemirror/markdown/__tests__/commands.test.ts +1 -0
  139. package/src/core/codemirror/theme/dark.ts +1 -1
  140. package/src/core/config/capabilities.ts +1 -1
  141. package/src/core/datasets/__tests__/data-source.test.ts +24 -0
  142. package/src/core/errors/__tests__/errors.test.ts +2 -0
  143. package/src/core/islands/bridge.ts +1 -0
  144. package/src/core/islands/main.ts +1 -0
  145. package/src/core/kernel/messages.ts +12 -6
  146. package/src/core/layout/layout.ts +3 -3
  147. package/src/core/network/requests-network.ts +8 -0
  148. package/src/core/network/requests-static.ts +1 -0
  149. package/src/core/network/requests-toasting.ts +1 -0
  150. package/src/core/network/types.ts +4 -1
  151. package/src/core/wasm/bridge.ts +18 -2
  152. package/src/core/wasm/worker/bootstrap.ts +3 -1
  153. package/src/core/wasm/worker/getMarimoWheel.ts +3 -8
  154. package/src/core/wasm/worker/types.ts +3 -0
  155. package/src/core/websocket/useMarimoWebSocket.tsx +7 -1
  156. package/src/css/app/Cell.css +42 -21
  157. package/src/css/app/codemirror.css +5 -1
  158. package/src/css/globals.css +3 -0
  159. package/src/css/md.css +1 -1
  160. package/src/plugins/impl/MicrophonePlugin.tsx +2 -2
  161. package/src/plugins/impl/chat/ChatPlugin.tsx +2 -9
  162. package/src/plugins/impl/chat/chat-ui.tsx +129 -110
  163. package/src/plugins/impl/chat/types.ts +5 -8
  164. package/src/plugins/impl/code/__tests__/language.test.ts +15 -0
  165. package/src/plugins/impl/code/any-language-editor.tsx +11 -8
  166. package/src/plugins/layout/MimeRenderPlugin.tsx +3 -6
  167. package/src/stories/cell.stories.tsx +6 -0
  168. package/src/stories/layout/vertical/one-column.stories.tsx +215 -0
  169. package/src/theme/useTheme.ts +11 -6
  170. package/src/utils/__tests__/blob.test.ts +37 -0
  171. package/src/utils/arrays.ts +13 -0
  172. package/src/utils/fileToBase64.ts +21 -6
  173. package/src/utils/json/base64.ts +5 -2
  174. package/src/utils/numbers.ts +9 -7
  175. package/dist/any-language-editor-DC5170DQ.js +0 -45
  176. package/dist/asn1-jKiBa2Ya.js +0 -95
  177. package/dist/clojure-CCKyeQKf.js +0 -800
  178. package/dist/css-BkF-NPzE.js +0 -1553
  179. package/dist/index-5ZH_qS8j.js +0 -288
  180. package/dist/index-U4yn89qO.js +0 -341
  181. package/dist/javascript-C2yteZeJ.js +0 -691
  182. package/dist/min-DS5Jz-hg.js +0 -80
  183. package/dist/mindmap-definition-LNHGMQRG-0aOVaMR8.js +0 -3234
  184. package/dist/mllike-BSnXJBGA.js +0 -272
  185. package/dist/pug-CwAQJzGR.js +0 -248
  186. package/dist/python-BkR3uSy8.js +0 -313
  187. package/dist/rpm-IznJm2Xc.js +0 -57
  188. package/dist/sequenceDiagram-WFGC7UMF-DMhHzllb.js +0 -2284
  189. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
@@ -3,6 +3,8 @@
3
3
  import type React from "react";
4
4
  import { ScratchPad } from "@/components/scratchpad/scratchpad";
5
5
 
6
- export const ScratchpadPanel: React.FC = () => {
6
+ const ScratchpadPanel: React.FC = () => {
7
7
  return <ScratchPad />;
8
8
  };
9
+
10
+ export default ScratchpadPanel;
@@ -22,7 +22,7 @@ import { copyToClipboard } from "@/utils/copy";
22
22
  import { PanelEmptyState } from "./empty-state";
23
23
  import { sortProviders, WriteSecretModal } from "./write-secret-modal";
24
24
 
25
- export const SecretsPanel: React.FC = () => {
25
+ const SecretsPanel: React.FC = () => {
26
26
  const { openModal, closeModal } = useImperativeModal();
27
27
  const {
28
28
  data: secretKeyProviders,
@@ -125,6 +125,8 @@ export const SecretsPanel: React.FC = () => {
125
125
  );
126
126
  };
127
127
 
128
+ export default SecretsPanel;
129
+
128
130
  const CopyButton: React.FC<{
129
131
  className?: string;
130
132
  ariaLabel: string;
@@ -32,7 +32,7 @@ import { ContributeSnippetButton } from "../components/contribute-snippet-button
32
32
 
33
33
  const extensions = [EditorView.lineWrapping];
34
34
 
35
- export const SnippetsPanel: React.FC = () => {
35
+ const SnippetsPanel: React.FC = () => {
36
36
  const { readSnippets } = useRequestClient();
37
37
  const [selectedSnippet, setSelectedSnippet] = React.useState<Snippet>();
38
38
  const {
@@ -98,6 +98,8 @@ export const SnippetsPanel: React.FC = () => {
98
98
  );
99
99
  };
100
100
 
101
+ export default SnippetsPanel;
102
+
101
103
  const SnippetViewer: React.FC<{ snippet: Snippet; onClose: () => void }> = ({
102
104
  snippet,
103
105
  onClose,
@@ -11,7 +11,7 @@ const LazyTracing = React.lazy(() =>
11
11
  }),
12
12
  );
13
13
 
14
- export const TracingPanel: React.FC = () => {
14
+ const TracingPanel: React.FC = () => {
15
15
  return (
16
16
  <React.Suspense fallback={<Loading />}>
17
17
  <LazyTracing />
@@ -19,6 +19,8 @@ export const TracingPanel: React.FC = () => {
19
19
  );
20
20
  };
21
21
 
22
+ export default TracingPanel;
23
+
22
24
  const Loading = () => {
23
25
  return (
24
26
  <div className="flex flex-col items-center justify-center h-full">
@@ -7,7 +7,7 @@ import { useCellIds } from "@/core/cells/cells";
7
7
  import { useVariables } from "@/core/variables/state";
8
8
  import { PanelEmptyState } from "./empty-state";
9
9
 
10
- export const VariablePanel: React.FC = () => {
10
+ const VariablePanel: React.FC = () => {
11
11
  const variables = useVariables();
12
12
  const cellIds = useCellIds();
13
13
 
@@ -29,3 +29,5 @@ export const VariablePanel: React.FC = () => {
29
29
  />
30
30
  );
31
31
  };
32
+
33
+ export default VariablePanel;
@@ -11,26 +11,12 @@ import { Sidebar } from "./sidebar";
11
11
  import "./app-chrome.css";
12
12
  import { TooltipProvider } from "@radix-ui/react-tooltip";
13
13
  import { XIcon } from "lucide-react";
14
- import { ChatPanel } from "@/components/chat/chat-panel";
15
- import { DependencyGraphPanel } from "@/components/editor/chrome/panels/dependency-graph-panel";
16
14
  import { Button } from "@/components/ui/button";
17
15
  import { LazyMount } from "@/components/utils/lazy-mount";
18
16
  import { IfCapability } from "@/core/config/if-capability";
19
17
  import { cn } from "@/utils/cn";
20
18
  import { ErrorBoundary } from "../../boundary/ErrorBoundary";
21
19
  import { ContextAwarePanel } from "../panels/context-aware-panel/context-aware-panel";
22
- import { DataSourcesPanel } from "../panels/datasources-panel";
23
- import { DocumentationPanel } from "../panels/documentation-panel";
24
- import { ErrorsPanel } from "../panels/error-panel";
25
- import { FileExplorerPanel } from "../panels/file-explorer-panel";
26
- import { LogsPanel } from "../panels/logs-panel";
27
- import { OutlinePanel } from "../panels/outline-panel";
28
- import { PackagesPanel } from "../panels/packages-panel";
29
- import { ScratchpadPanel } from "../panels/scratchpad-panel";
30
- import { SecretsPanel } from "../panels/secrets-panel";
31
- import { SnippetsPanel } from "../panels/snippets-panel";
32
- import { TracingPanel } from "../panels/tracing-panel";
33
- import { VariablePanel } from "../panels/variable-panel";
34
20
  import { useChromeActions, useChromeState } from "../state";
35
21
  import { Minimap } from "./minimap";
36
22
  import { PanelsWrapper } from "./panels";
@@ -38,6 +24,30 @@ import { createStorage } from "./storage";
38
24
  import { handleDragging } from "./utils";
39
25
 
40
26
  const LazyTerminal = React.lazy(() => import("@/components/terminal/terminal"));
27
+ const LazyChatPanel = React.lazy(() => import("@/components/chat/chat-panel"));
28
+ const LazyDependencyGraphPanel = React.lazy(
29
+ () => import("@/components/editor/chrome/panels/dependency-graph-panel"),
30
+ );
31
+ const LazyDataSourcesPanel = React.lazy(
32
+ () => import("../panels/datasources-panel"),
33
+ );
34
+ const LazyDocumentationPanel = React.lazy(
35
+ () => import("../panels/documentation-panel"),
36
+ );
37
+ const LazyErrorsPanel = React.lazy(() => import("../panels/error-panel"));
38
+ const LazyFileExplorerPanel = React.lazy(
39
+ () => import("../panels/file-explorer-panel"),
40
+ );
41
+ const LazyLogsPanel = React.lazy(() => import("../panels/logs-panel"));
42
+ const LazyOutlinePanel = React.lazy(() => import("../panels/outline-panel"));
43
+ const LazyPackagesPanel = React.lazy(() => import("../panels/packages-panel"));
44
+ const LazyScratchpadPanel = React.lazy(
45
+ () => import("../panels/scratchpad-panel"),
46
+ );
47
+ const LazySecretsPanel = React.lazy(() => import("../panels/secrets-panel"));
48
+ const LazySnippetsPanel = React.lazy(() => import("../panels/snippets-panel"));
49
+ const LazyTracingPanel = React.lazy(() => import("../panels/tracing-panel"));
50
+ const LazyVariablePanel = React.lazy(() => import("../panels/variable-panel"));
41
51
 
42
52
  export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {
43
53
  const { isSidebarOpen, isTerminalOpen, selectedPanel } = useChromeState();
@@ -140,20 +150,20 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {
140
150
  </div>
141
151
  <Suspense>
142
152
  <TooltipProvider>
143
- {selectedPanel === "files" && <FileExplorerPanel />}
144
- {selectedPanel === "errors" && <ErrorsPanel />}
145
- {selectedPanel === "variables" && <VariablePanel />}
146
- {selectedPanel === "dependencies" && <DependencyGraphPanel />}
147
- {selectedPanel === "packages" && <PackagesPanel />}
148
- {selectedPanel === "outline" && <OutlinePanel />}
149
- {selectedPanel === "datasources" && <DataSourcesPanel />}
150
- {selectedPanel === "documentation" && <DocumentationPanel />}
151
- {selectedPanel === "snippets" && <SnippetsPanel />}
152
- {selectedPanel === "scratchpad" && <ScratchpadPanel />}
153
- {selectedPanel === "chat" && <ChatPanel />}
154
- {selectedPanel === "logs" && <LogsPanel />}
155
- {selectedPanel === "tracing" && <TracingPanel />}
156
- {selectedPanel === "secrets" && <SecretsPanel />}
153
+ {selectedPanel === "files" && <LazyFileExplorerPanel />}
154
+ {selectedPanel === "errors" && <LazyErrorsPanel />}
155
+ {selectedPanel === "variables" && <LazyVariablePanel />}
156
+ {selectedPanel === "dependencies" && <LazyDependencyGraphPanel />}
157
+ {selectedPanel === "packages" && <LazyPackagesPanel />}
158
+ {selectedPanel === "outline" && <LazyOutlinePanel />}
159
+ {selectedPanel === "datasources" && <LazyDataSourcesPanel />}
160
+ {selectedPanel === "documentation" && <LazyDocumentationPanel />}
161
+ {selectedPanel === "snippets" && <LazySnippetsPanel />}
162
+ {selectedPanel === "scratchpad" && <LazyScratchpadPanel />}
163
+ {selectedPanel === "chat" && <LazyChatPanel />}
164
+ {selectedPanel === "logs" && <LazyLogsPanel />}
165
+ {selectedPanel === "tracing" && <LazyTracingPanel />}
166
+ {selectedPanel === "secrets" && <LazySecretsPanel />}
157
167
  </TooltipProvider>
158
168
  </Suspense>
159
169
  </div>
@@ -6,7 +6,7 @@ import React from "react";
6
6
  import { renderShortcut } from "@/components/shortcuts/renderShortcut";
7
7
  import { Tooltip } from "@/components/ui/tooltip";
8
8
  import { Button } from "../inputs/Inputs";
9
- import { commandPaletteAtom } from "./command-palette";
9
+ import { commandPaletteAtom } from "./state";
10
10
 
11
11
  export const CommandPaletteButton: React.FC = () => {
12
12
  const setCommandPaletteOpen = useSetAtom(commandPaletteAtom);
@@ -1,6 +1,6 @@
1
1
  /* Copyright 2024 Marimo. All rights reserved. */
2
2
 
3
- import { atom, useAtom, useAtomValue } from "jotai";
3
+ import { useAtom, useAtomValue } from "jotai";
4
4
  import {
5
5
  CommandDialog,
6
6
  CommandEmpty,
@@ -28,10 +28,9 @@ import {
28
28
  import { useCellActionButtons } from "../actions/useCellActionButton";
29
29
  import { useConfigActions } from "../actions/useConfigActions";
30
30
  import { useNotebookActions } from "../actions/useNotebookActions";
31
+ import { commandPaletteAtom } from "./state";
31
32
 
32
- export const commandPaletteAtom = atom(false);
33
-
34
- export const CommandPalette = () => {
33
+ const CommandPalette = () => {
35
34
  const [open, setOpen] = useAtom(commandPaletteAtom);
36
35
  const registeredActions = useRegisteredActions();
37
36
  const lastFocusedCell = useAtomValue(lastFocusedCellAtom);
@@ -208,3 +207,5 @@ export const CommandPalette = () => {
208
207
  </CommandDialog>
209
208
  );
210
209
  };
210
+
211
+ export default CommandPalette;
@@ -0,0 +1,4 @@
1
+ /* Copyright 2024 Marimo. All rights reserved. */
2
+ import { atom } from "jotai";
3
+
4
+ export const commandPaletteAtom = atom(false);
@@ -4,6 +4,8 @@ import { zodResolver } from "@hookform/resolvers/zod";
4
4
  import {
5
5
  BoxIcon,
6
6
  CheckIcon,
7
+ ChevronDownIcon,
8
+ ChevronRightIcon,
7
9
  DownloadCloudIcon,
8
10
  PackageCheckIcon,
9
11
  PackageXIcon,
@@ -73,7 +75,7 @@ function buildPackageSpecifier(name: string, extras: string[]): string {
73
75
  }
74
76
 
75
77
  export const PackageAlert: React.FC = () => {
76
- const { packageAlert } = useAlerts();
78
+ const { packageAlert, packageLogs } = useAlerts();
77
79
  const { clearPackageAlert } = useAlertActions();
78
80
  const [userConfig] = useResolvedMarimoConfig();
79
81
  const [desiredPackageVersions, setDesiredPackageVersions] = useState<
@@ -92,10 +94,10 @@ export const PackageAlert: React.FC = () => {
92
94
 
93
95
  if (isMissingPackageAlert(packageAlert)) {
94
96
  return (
95
- <div className="flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-200 opacity-95">
97
+ <div className="flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-200 opacity-95 max-w-[600px]">
96
98
  <Banner
97
99
  kind="danger"
98
- className="flex flex-col rounded py-3 px-5 animate-in slide-in-from-left"
100
+ className="flex flex-col rounded py-3 px-5 animate-in slide-in-from-left overflow-auto max-h-[80vh] scrollbar-thin"
99
101
  >
100
102
  <div className="flex justify-between">
101
103
  <span className="font-bold text-lg flex items-center mb-2">
@@ -114,45 +116,46 @@ export const PackageAlert: React.FC = () => {
114
116
  <div className="flex flex-col gap-4 justify-between items-start text-muted-foreground text-base">
115
117
  <div>
116
118
  <p>The following packages were not found:</p>
117
- <ul className="list-disc ml-4 mt-1">
119
+ <table className="list-disc ml-2 mt-1">
118
120
  {packageAlert.packages.map((pkg, index) => {
119
121
  const parsed = parsePackageSpecifier(pkg);
120
122
  const currentExtras = selectedExtras[pkg] || parsed.extras;
121
123
 
122
124
  return (
123
- <li
124
- className="flex items-center gap-2 font-mono text-sm"
125
- key={index}
126
- >
127
- <BoxIcon size="1rem" />
128
-
129
- <ExtrasSelector
130
- packageName={parsed.name}
131
- selectedExtras={currentExtras}
132
- onExtrasChange={(extras) =>
133
- setSelectedExtras((prev) => ({
134
- ...prev,
135
- [pkg]: extras,
136
- }))
137
- }
138
- />
139
-
140
- {doesSupportVersioning && (
141
- <PackageVersionSelect
142
- value={desiredPackageVersions[pkg] ?? "latest"}
143
- onChange={(value) =>
144
- setDesiredPackageVersions((prev) => ({
125
+ <tr className="font-mono text-sm" key={index}>
126
+ <td className="pr-2 py-1 align-middle">
127
+ <BoxIcon size="1rem" />
128
+ </td>
129
+ <td className="pr-2 py-1 align-middle">
130
+ <ExtrasSelector
131
+ packageName={parsed.name}
132
+ selectedExtras={currentExtras}
133
+ onExtrasChange={(extras) =>
134
+ setSelectedExtras((prev) => ({
145
135
  ...prev,
146
- [pkg]: value,
136
+ [pkg]: extras,
147
137
  }))
148
138
  }
149
- packageName={parsed.name}
150
139
  />
140
+ </td>
141
+ {doesSupportVersioning && (
142
+ <td className="pr-2 py-1 align-middle">
143
+ <PackageVersionSelect
144
+ value={desiredPackageVersions[pkg] ?? "latest"}
145
+ onChange={(value) =>
146
+ setDesiredPackageVersions((prev) => ({
147
+ ...prev,
148
+ [pkg]: value,
149
+ }))
150
+ }
151
+ packageName={parsed.name}
152
+ />
153
+ </td>
151
154
  )}
152
- </li>
155
+ </tr>
153
156
  );
154
157
  })}
155
- </ul>
158
+ </table>
156
159
  </div>
157
160
  <div className="ml-auto flex flex-row items-baseline">
158
161
  {packageAlert.isolated ? (
@@ -200,10 +203,10 @@ export const PackageAlert: React.FC = () => {
200
203
  }
201
204
 
202
205
  return (
203
- <div className="flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-200 opacity-95">
206
+ <div className="flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-200 opacity-95 max-w-[600px] ">
204
207
  <Banner
205
208
  kind={status === "failed" ? "danger" : "info"}
206
- className="flex flex-col rounded pt-3 pb-4 px-5"
209
+ className="flex flex-col rounded pt-3 pb-4 px-5 overflow-auto max-h-[80vh] scrollbar-thin"
207
210
  >
208
211
  <div className="flex justify-between">
209
212
  <span className="font-bold text-lg flex items-center mb-2">
@@ -225,30 +228,29 @@ export const PackageAlert: React.FC = () => {
225
228
  status === "installed" && "text-accent-foreground",
226
229
  )}
227
230
  >
228
- <div>
229
- <p>{description}</p>
230
- <ul className="list-disc ml-4 mt-1">
231
- {Object.entries(packageAlert.packages).map(
232
- ([pkg, st], index) => (
233
- <li
234
- className={cn(
235
- "flex items-center gap-1 font-mono text-sm",
236
- st === "installing" && "font-semibold",
237
- st === "failed" && "text-destructive",
238
- st === "installed" && "text-accent-foreground",
239
- st === "installed" &&
240
- status === "failed" &&
241
- "text-muted-foreground",
242
- )}
243
- key={index}
244
- >
245
- <ProgressIcon status={st} />
246
- {pkg}
247
- </li>
248
- ),
249
- )}
250
- </ul>
251
- </div>
231
+ <p>{description}</p>
232
+ <ul className="list-disc ml-2 mt-1">
233
+ {Object.entries(packageAlert.packages).map(([pkg, st], index) => (
234
+ <li
235
+ className={cn(
236
+ "flex items-center gap-1 font-mono text-sm",
237
+ st === "installing" && "font-semibold",
238
+ st === "failed" && "text-destructive",
239
+ st === "installed" && "text-accent-foreground",
240
+ st === "installed" &&
241
+ status === "failed" &&
242
+ "text-muted-foreground",
243
+ )}
244
+ key={index}
245
+ >
246
+ <ProgressIcon status={st} />
247
+ {pkg}
248
+ </li>
249
+ ))}
250
+ </ul>
251
+ {Object.keys(packageLogs).length > 0 && (
252
+ <StreamingLogsViewer packageLogs={packageLogs} />
253
+ )}
252
254
  </div>
253
255
  </Banner>
254
256
  </div>
@@ -288,7 +290,7 @@ function getInstallationStatusElements(packages: PackageInstallationStatus) {
288
290
  status: "failed",
289
291
  title: "Some packages failed to install",
290
292
  titleIcon: <PackageXIcon className="w-5 h-5 inline-block mr-2" />,
291
- description: "See terminal for error logs.",
293
+ description: "See error logs.",
292
294
  };
293
295
  }
294
296
 
@@ -441,7 +443,7 @@ const ExtrasSelector: React.FC<ExtrasSelectorProps> = ({
441
443
 
442
444
  return (
443
445
  <div className="flex items-center max-w-72">
444
- <span className="shrink-0">{packageName}</span>
446
+ <span className="shrink-0 flex-1">{packageName}</span>
445
447
 
446
448
  {selectedExtras.length > 0 ? (
447
449
  <span className="flex items-center min-w-0 flex-1">
@@ -594,3 +596,51 @@ const PackageVersionSelect: React.FC<PackageVersionSelectProps> = ({
594
596
  </NativeSelect>
595
597
  );
596
598
  };
599
+
600
+ interface StreamingLogsViewerProps {
601
+ packageLogs: { [packageName: string]: string };
602
+ }
603
+
604
+ const StreamingLogsViewer: React.FC<StreamingLogsViewerProps> = ({
605
+ packageLogs,
606
+ }) => {
607
+ const [isExpanded, setIsExpanded] = useState(true);
608
+
609
+ const packageCount = Object.keys(packageLogs).length;
610
+ if (packageCount === 0) {
611
+ return null;
612
+ }
613
+
614
+ return (
615
+ <div className="mt-4 border-t border-border pt-4 w-full">
616
+ <button
617
+ onClick={() => setIsExpanded(!isExpanded)}
618
+ className="flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors"
619
+ >
620
+ {isExpanded ? (
621
+ <ChevronDownIcon className="w-4 h-4" />
622
+ ) : (
623
+ <ChevronRightIcon className="w-4 h-4" />
624
+ )}
625
+ Installation logs
626
+ </button>
627
+
628
+ {isExpanded && (
629
+ <div className="mt-3 space-y-3 w-full">
630
+ {Object.entries(packageLogs).map(([packageName, logs]) => (
631
+ <div key={packageName} className="w-full">
632
+ <h4 className="font-mono text-sm font-medium mb-2 text-foreground">
633
+ {packageName}
634
+ </h4>
635
+ <div className="border border-border rounded w-full">
636
+ <pre className="p-3 text-xs font-mono bg-background max-h-64 overflow-y-auto text-muted-foreground whitespace-pre-wrap scrollbar-thin">
637
+ {logs || "No logs available"}
638
+ </pre>
639
+ </div>
640
+ </div>
641
+ ))}
642
+ </div>
643
+ )}
644
+ </div>
645
+ );
646
+ };
@@ -13,6 +13,7 @@ import {
13
13
  SquareMIcon,
14
14
  } from "lucide-react";
15
15
  import { useEffect } from "react";
16
+ import { StartupLogsAlert } from "@/components/editor/alerts/startup-logs-alert";
16
17
  import { Cell } from "@/components/editor/Cell";
17
18
  import { PackageAlert } from "@/components/editor/package-alert";
18
19
  import { SortableCellsProvider } from "@/components/sort/SortableCellsProvider";
@@ -120,6 +121,7 @@ const CellArrayInternal: React.FC<CellArrayProps> = ({
120
121
  innerClassName="pr-4" // For the floating actions
121
122
  >
122
123
  <PackageAlert />
124
+ <StartupLogsAlert />
123
125
  <StdinBlockingAlert />
124
126
  <ConnectingAlert />
125
127
  <NotebookBanner width={appConfig.width} />
@@ -327,7 +327,6 @@ const VerticalCell = memo(
327
327
  "hover-actions-parent empty:invisible",
328
328
  {
329
329
  published: published,
330
- interactive: mode === "edit",
331
330
  "has-error": errored,
332
331
  stopped: stopped,
333
332
  borderless: isPureMarkdown && !published,
@@ -1,10 +1,14 @@
1
1
  /* Copyright 2024 Marimo. All rights reserved. */
2
2
 
3
+ import { lazy } from "react";
3
4
  import type { AppConfig, UserConfig } from "@/core/config/config-schema";
4
5
  import { KnownQueryParams } from "@/core/constants";
5
6
  import { EditApp } from "@/core/edit-app";
6
7
  import { AppChrome } from "../editor/chrome/wrapper/app-chrome";
7
- import { CommandPalette } from "../editor/controls/command-palette";
8
+
9
+ const LazyCommandPalette = lazy(
10
+ () => import("../editor/controls/command-palette"),
11
+ );
8
12
 
9
13
  interface Props {
10
14
  userConfig: UserConfig;
@@ -21,7 +25,7 @@ const EditPage = (props: Props) => {
21
25
  return (
22
26
  <>
23
27
  <EditApp hideControls={true} {...props} />
24
- <CommandPalette />
28
+ <LazyCommandPalette />
25
29
  </>
26
30
  );
27
31
  }
@@ -29,7 +33,7 @@ const EditPage = (props: Props) => {
29
33
  return (
30
34
  <AppChrome>
31
35
  <EditApp {...props} />
32
- <CommandPalette />
36
+ <LazyCommandPalette />
33
37
  </AppChrome>
34
38
  );
35
39
  };
@@ -1,17 +1,29 @@
1
1
  /* Copyright 2024 Marimo. All rights reserved. */
2
2
 
3
- import type { Message as AIMessage } from "@ai-sdk/react";
3
+ import type { UIMessage } from "@ai-sdk/react";
4
4
  import { Logger } from "@/utils/Logger";
5
5
  import type { ChatId, ChatState } from "./state";
6
6
 
7
- export const addMessageToChat = (
8
- chatState: ChatState,
9
- chatId: ChatId | null,
10
- messageId: string,
11
- role: "user" | "assistant",
12
- content: string,
13
- parts?: AIMessage["parts"],
14
- ): ChatState => {
7
+ interface ReplaceMessagesInChatParams {
8
+ /**
9
+ * The state of the chats
10
+ */
11
+ chatState: ChatState;
12
+ /**
13
+ * The chat to replace the messages in
14
+ */
15
+ chatId: ChatId | null;
16
+ /**
17
+ * The messages to replace in the chat
18
+ */
19
+ messages: UIMessage[];
20
+ }
21
+
22
+ export const replaceMessagesInChat = ({
23
+ chatState,
24
+ chatId,
25
+ messages,
26
+ }: ReplaceMessagesInChatParams): ChatState => {
15
27
  if (!chatId) {
16
28
  Logger.warn("No active chat");
17
29
  return chatState;
@@ -22,44 +34,15 @@ export const addMessageToChat = (
22
34
  return chatState;
23
35
  }
24
36
 
25
- const messageIndex = chat.messages.findIndex(
26
- (message) => message.id === messageId,
27
- );
28
-
29
37
  // Create copy of chats to modify
30
38
  const newChats = new Map(chatState.chats);
31
39
  const timestamp = Date.now();
32
40
 
33
- if (messageIndex === -1) {
34
- // Handle new message
35
- newChats.set(chatId, {
36
- ...chat,
37
- messages: [
38
- ...chat.messages,
39
- {
40
- id: messageId,
41
- role,
42
- content,
43
- timestamp: timestamp,
44
- parts,
45
- },
46
- ],
47
- updatedAt: timestamp,
48
- });
49
- } else {
50
- // Handle update message
51
- const newMessages = [...chat.messages];
52
- newMessages[messageIndex] = {
53
- ...newMessages[messageIndex],
54
- content,
55
- parts,
56
- };
57
- newChats.set(chat.id, {
58
- ...chat,
59
- messages: newMessages,
60
- updatedAt: timestamp,
61
- });
62
- }
41
+ newChats.set(chat.id, {
42
+ ...chat,
43
+ messages: messages,
44
+ updatedAt: timestamp,
45
+ });
63
46
 
64
47
  return {
65
48
  ...chatState,
@@ -8,7 +8,7 @@ import type { AIModelKey, UserConfig } from "@/core/config/config-schema";
8
8
  import { useRequestClient } from "@/core/network/requests";
9
9
 
10
10
  // Extract only the supported roles from the Role type
11
- type SupportedRole = Extract<Role, "chat" | "autocomplete" | "edit">;
11
+ export type SupportedRole = Extract<Role, "chat" | "autocomplete" | "edit">;
12
12
 
13
13
  const getModelKeyForRole = (forRole: SupportedRole): AIModelKey | null => {
14
14
  switch (forRole) {