@marimo-team/frontend 0.24.3-dev1 → 0.24.3-dev10

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 (148) hide show
  1. package/dist/assets/{CellStatus-LoTwk7fR.js → CellStatus-DXkwkuL9.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-DW6cJ-Lr.js → ConnectedDataExplorerComponent-DiXd-oqU.js} +1 -1
  3. package/dist/assets/JsonOutput-izmGhjov.js +50 -0
  4. package/dist/assets/LazyAnyLanguageCodeMirror-C_cwGmDg.js +2 -0
  5. package/dist/assets/{MarimoErrorOutput-DqpoYOvw.js → MarimoErrorOutput-CdmP3ZHL.js} +2 -2
  6. package/dist/assets/{RenderHTML-DwhMAd9l.js → RenderHTML-DlYXvh8D.js} +1 -1
  7. package/dist/assets/{RunButton-BlpbweyH.js → RunButton-Bieadi9w.js} +1 -1
  8. package/dist/assets/add-cell-with-ai-ZpV9L4qe.js +76 -0
  9. package/dist/assets/{add-connection-dialog-BGfpw5lC.js → add-connection-dialog-a8mkIeXa.js} +73 -73
  10. package/dist/assets/agent-panel-rVtDSi07.js +286 -0
  11. package/dist/assets/ai-model-dropdown-C8IztRe2.js +3 -0
  12. package/dist/assets/{any-language-editor-DflLjPSQ.js → any-language-editor-pGZDaSqz.js} +1 -1
  13. package/dist/assets/app-config-button-DLr-6jwI.js +1 -0
  14. package/dist/assets/{blob-B2d_dHwI.js → blob-B2Qs47Zi.js} +1 -1
  15. package/dist/assets/cell-editor-3VpJI5EQ.js +21 -0
  16. package/dist/assets/cell-link-DEXHmwy1.js +1 -0
  17. package/dist/assets/{cells-Cp-G34Rz.js → cells--Hh9voS5.js} +25 -25
  18. package/dist/assets/chat-display-DtQ0tOGK.js +1 -0
  19. package/dist/assets/{chat-panel-BlUwNY5j.js → chat-panel-DLgUUTdo.js} +2 -2
  20. package/dist/assets/{chat-ui-DGiVDzNh.js → chat-ui-DIXDoCsM.js} +4 -4
  21. package/dist/assets/{column-preview-riSXbYe_.js → column-preview-H8rmRiii.js} +1 -1
  22. package/dist/assets/{command-palette-CCVzJcyf.js → command-palette-Pmg3QxZ0.js} +1 -1
  23. package/dist/assets/{common-CHR7w7aQ.js → common-CrhvbKbI.js} +1 -1
  24. package/dist/assets/components-DWwMSfV5.js +1 -0
  25. package/dist/assets/components-rCVlCccf.js +1 -0
  26. package/dist/assets/{config-BlNM0caL.js → config-BuGkUPaK.js} +1 -1
  27. package/dist/assets/{copy-icon-z8fuTE3w.js → copy-icon-BUOcnUgJ.js} +1 -1
  28. package/dist/assets/{datasource-DrODSIs0.js → datasource-DgkQfSw3.js} +2 -2
  29. package/dist/assets/{dependency-graph-panel-AY5BEVH2.js → dependency-graph-panel-D1BZdQJH.js} +3 -3
  30. package/dist/assets/dist-0lSCnrrf.js +1 -0
  31. package/dist/assets/dist-CLXTUtr2.js +1 -0
  32. package/dist/assets/{documentation-panel-CaJF7e-j.js → documentation-panel-DzNGB1Zx.js} +1 -1
  33. package/dist/assets/{download-DMxOzI7b.js → download-DtQweFN1.js} +1 -1
  34. package/dist/assets/dropdown-menu-DnvwbPho.js +1 -0
  35. package/dist/assets/edit-page-fb5fV9UA.js +9 -0
  36. package/dist/assets/{error-entries-Cv2m1yhc.js → error-entries-CMsalXvZ.js} +1 -1
  37. package/dist/assets/{error-panel-Bhlvt6_H.js → error-panel-D6kqFA9f.js} +1 -1
  38. package/dist/assets/file-explorer-panel-D3APtOiy.js +1 -0
  39. package/dist/assets/file-icons-wArFRwmS.js +1 -0
  40. package/dist/assets/{file-name-input-K4MKESI_.js → file-name-input-CdDGwb85.js} +3 -3
  41. package/dist/assets/{floating-outline-DaUHnl_e.js → floating-outline-D2WpILR-.js} +1 -1
  42. package/dist/assets/gallery-page-B39w2KuX.js +1 -0
  43. package/dist/assets/{glide-data-editor-sICUMEhk.js → glide-data-editor-BufxOYjB.js} +1 -1
  44. package/dist/assets/home-page-BXgJYrZ5.js +4 -0
  45. package/dist/assets/index-B4Fq20-p.js +29 -0
  46. package/dist/assets/{kiosk-mode-mxgb5lWf.js → kiosk-mode-m6yKu6eh.js} +1 -1
  47. package/dist/assets/{layout-DWnrxIo2.js → layout-VgriO3Ll.js} +5 -5
  48. package/dist/assets/logs-panel-DsbX3K3h.js +1 -0
  49. package/dist/assets/{markdown-renderer-BZKlbm2Q.js → markdown-renderer-DD7ui8RW.js} +1 -1
  50. package/dist/assets/{name-cell-input-BMCdK-el.js → name-cell-input-EjA-eGvA.js} +1 -1
  51. package/dist/assets/{outline-panel-Dr5u73V6.js → outline-panel-DeDFCw9s.js} +1 -1
  52. package/dist/assets/packages-panel-B__MaP9u.js +1 -0
  53. package/dist/assets/{pair-with-agent-modal-CbUFKJHP.js → pair-with-agent-modal-DYvcjx3q.js} +1 -1
  54. package/dist/assets/panel-accordion-state-CwLKISCL.js +1 -0
  55. package/dist/assets/panels-c3iYYVuV.js +4 -0
  56. package/dist/assets/{pathUtils-Cryrlpma.js → pathUtils-D7lk2rYQ.js} +1 -1
  57. package/dist/assets/paths-ClYq6Exe.js +1 -0
  58. package/dist/assets/process-output-DQoLxPra.js +1 -0
  59. package/dist/assets/readonly-code-display-DuFy8860.js +1 -0
  60. package/dist/assets/{readonly-python-code-DpIyjHqY.js → readonly-python-code-yR65TOiM.js} +1 -1
  61. package/dist/assets/{renderShortcut-X-CJUSM8.js → renderShortcut-BE8QI9Yi.js} +1 -1
  62. package/dist/assets/{reveal-component-nZIAapoD.js → reveal-component-CgskYNVn.js} +2 -2
  63. package/dist/assets/rotate-cw-CESctpLh.js +1 -0
  64. package/dist/assets/run-page-C_mciAdT.js +1 -0
  65. package/dist/assets/{scratchpad-panel-BleGt2KM.js → scratchpad-panel-Bj4yxnuS.js} +1 -1
  66. package/dist/assets/{secrets-panel-D3BpDIgg.js → secrets-panel-Cf-U5wY0.js} +1 -1
  67. package/dist/assets/select-C1IYgK48.js +1 -0
  68. package/dist/assets/session-panel-NQyDQouJ.js +1 -0
  69. package/dist/assets/share-BZW3tzEX.js +1 -0
  70. package/dist/assets/{skeleton-BKeh8hf3.js → skeleton-CUFHwpIk.js} +1 -1
  71. package/dist/assets/{snippets-panel-D5yy7kj0.js → snippets-panel-Bx2wFck8.js} +1 -1
  72. package/dist/assets/{state-B6AklCzD.js → state-CdjswcRf.js} +1 -1
  73. package/dist/assets/state-CiPrV156.js +3 -0
  74. package/dist/assets/switch-DhPDzMo3.js +1 -0
  75. package/dist/assets/{terminal-CQAFGBfN.js → terminal-DH54UV0y.js} +2 -2
  76. package/dist/assets/tooltip-BvU0ko_d.js +1 -0
  77. package/dist/assets/tracing-Qjfb3Qm1.js +1 -0
  78. package/dist/assets/tracing-panel-Cj_-LD2X.js +2 -0
  79. package/dist/assets/{tree-actions-CG5g7aUQ.js → tree-actions-CmY9PFuu.js} +1 -1
  80. package/dist/assets/{useAddCell-DdB_uBif.js → useAddCell-Bvb-C_H5.js} +1 -1
  81. package/dist/assets/{useBoolean-BXC4CItZ.js → useBoolean-zcg-oxnj.js} +1 -1
  82. package/dist/assets/useCellActionButton-Df4qSnWR.js +1 -0
  83. package/dist/assets/{useDeleteCell-Bz49_cFj.js → useDeleteCell-eNMTvg8D.js} +1 -1
  84. package/dist/assets/useDependencyPanelTab-BusYWoB8.js +1 -0
  85. package/dist/assets/useInstallPackage-ClaR_nYb.js +1 -0
  86. package/dist/assets/useNotebookActions-bWJW4dS_.js +10 -0
  87. package/dist/assets/{useRunCells-CX7oW5zy.js → useRunCells-D8B7UNsg.js} +1 -1
  88. package/dist/assets/{useSplitCell-Dy2_DmJR.js → useSplitCell-Cy7fCcQW.js} +1 -1
  89. package/dist/assets/{vega-component-C7TCzyaU.js → vega-component-Z8mt9AUF.js} +1 -1
  90. package/dist/assets/{write-secret-modal-D6zoZgLY.js → write-secret-modal-CSWlDX_Z.js} +1 -1
  91. package/dist/index.html +36 -35
  92. package/package.json +1 -1
  93. package/src/__mocks__/requests.ts +7 -2
  94. package/src/components/data-table/column-visibility-dropdown.tsx +9 -3
  95. package/src/components/datasources/components.tsx +4 -2
  96. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +143 -0
  97. package/src/components/editor/chrome/panels/packages-panel.tsx +145 -51
  98. package/src/components/editor/package-alert.tsx +25 -1
  99. package/src/components/home/components.tsx +17 -0
  100. package/src/components/pages/gallery-page.tsx +2 -4
  101. package/src/components/pages/home-page.tsx +2 -4
  102. package/src/components/terminal/terminal.tsx +4 -4
  103. package/src/core/islands/__tests__/parse.test.ts +140 -7
  104. package/src/core/islands/parse.ts +20 -0
  105. package/src/core/packages/__tests__/useInstallPackage.test.tsx +47 -1
  106. package/src/core/packages/toast-components.tsx +26 -0
  107. package/src/core/packages/useInstallPackage.ts +7 -2
  108. package/src/core/runtime/__tests__/runtime.test.ts +11 -0
  109. package/src/core/runtime/runtime.ts +7 -2
  110. package/src/core/wasm/bridge.ts +1 -0
  111. package/dist/assets/JsonOutput-CzIGPEZQ.js +0 -50
  112. package/dist/assets/LazyAnyLanguageCodeMirror-LboTfNDv.js +0 -2
  113. package/dist/assets/add-cell-with-ai-R-3DS79K.js +0 -76
  114. package/dist/assets/agent-panel-Cgt_K0tD.js +0 -286
  115. package/dist/assets/ai-model-dropdown-DCmiuk7x.js +0 -3
  116. package/dist/assets/app-config-button-DUJC6b6x.js +0 -1
  117. package/dist/assets/cell-editor-Dw09J9yD.js +0 -21
  118. package/dist/assets/cell-link-6burT2XF.js +0 -1
  119. package/dist/assets/chat-display-Bu405iyc.js +0 -1
  120. package/dist/assets/components-C7mWrmXr.js +0 -1
  121. package/dist/assets/dist-DzCQtGkt.js +0 -1
  122. package/dist/assets/dropdown-menu-C40jM9o4.js +0 -1
  123. package/dist/assets/edit-page-xlMlcLnI.js +0 -9
  124. package/dist/assets/file-explorer-panel-s0ohSG_L.js +0 -1
  125. package/dist/assets/file-icons-DdGYuADJ.js +0 -1
  126. package/dist/assets/gallery-page-C3pBpHlY.js +0 -1
  127. package/dist/assets/home-page-BLd6rnbk.js +0 -4
  128. package/dist/assets/index-4n22QjCD.js +0 -29
  129. package/dist/assets/logs-panel-BGS2v3ba.js +0 -1
  130. package/dist/assets/packages-panel-BdpRg9tX.js +0 -1
  131. package/dist/assets/panel-accordion-state-DjUTN7i5.js +0 -1
  132. package/dist/assets/panels-CWn0Yh1D.js +0 -4
  133. package/dist/assets/paths-zcL04qUW.js +0 -1
  134. package/dist/assets/process-output-Ck7-P_xp.js +0 -1
  135. package/dist/assets/readonly-code-display--S2daDa6.js +0 -1
  136. package/dist/assets/run-page-9pl8qhQR.js +0 -1
  137. package/dist/assets/select-nLt2y0Sw.js +0 -1
  138. package/dist/assets/session-panel-DRGPlL5J.js +0 -1
  139. package/dist/assets/share-CPtBiNgr.js +0 -1
  140. package/dist/assets/state-Di9TbuV9.js +0 -3
  141. package/dist/assets/switch-DjXr9Y9D.js +0 -1
  142. package/dist/assets/tooltip-BUtPzKB4.js +0 -1
  143. package/dist/assets/tracing-DNk3gmWv.js +0 -1
  144. package/dist/assets/tracing-panel-Yqazr6w_.js +0 -2
  145. package/dist/assets/useCellActionButton-B31neI3m.js +0 -1
  146. package/dist/assets/useDependencyPanelTab-C_ps0r--.js +0 -1
  147. package/dist/assets/useInstallPackage-DsD08SLK.js +0 -1
  148. package/dist/assets/useNotebookActions-CQtbk9CB.js +0 -10
@@ -30,6 +30,8 @@ export interface MarimoIslandApp {
30
30
  * Whether cells came from a supported JSON payload instead of DOM parsing.
31
31
  */
32
32
  payloadBacked?: boolean;
33
+ /** Explicit notebook dependencies to install before starting the app. */
34
+ dependencies?: string[];
33
35
  /**
34
36
  * Cells in the app.
35
37
  */
@@ -62,6 +64,7 @@ interface MarimoIslandCell {
62
64
  interface MarimoIslandPayload {
63
65
  schemaVersion: 1;
64
66
  appId: string;
67
+ dependencies?: string[];
65
68
  cells: MarimoIslandPayloadCell[];
66
69
  }
67
70
 
@@ -235,6 +238,12 @@ function parsePayloadBackedApps({
235
238
  embed?.setAttribute(ISLAND_DATA_ATTRIBUTES.CELL_IDX, idx.toString());
236
239
  }
237
240
  }
241
+ const app = apps.get(payload.appId);
242
+ if (app && payload.dependencies?.length) {
243
+ app.dependencies = [
244
+ ...new Set([...(app.dependencies ?? []), ...payload.dependencies]),
245
+ ];
246
+ }
238
247
  }
239
248
 
240
249
  // A supported payload is the runtime source for its app. Extra same-app DOM
@@ -371,6 +380,7 @@ export function parseIslandElement(
371
380
 
372
381
  export function createMarimoFile(app: {
373
382
  cells: { code: string; disabled?: boolean }[];
383
+ dependencies?: string[];
374
384
  }): string {
375
385
  const lines = [
376
386
  "import marimo",
@@ -402,6 +412,13 @@ export function createMarimoFile(app: {
402
412
  .join("\n"),
403
413
  ];
404
414
 
415
+ if (app.dependencies?.length) {
416
+ lines.unshift(
417
+ "# /// script",
418
+ `# dependencies = ${JSON.stringify(app.dependencies)}`,
419
+ "# ///",
420
+ );
421
+ }
405
422
  return lines.join("\n");
406
423
  }
407
424
 
@@ -507,6 +524,9 @@ function isMarimoIslandPayload(
507
524
  return (
508
525
  payload.schemaVersion === 1 &&
509
526
  typeof payload.appId === "string" &&
527
+ (payload.dependencies === undefined ||
528
+ (Array.isArray(payload.dependencies) &&
529
+ payload.dependencies.every((dep) => typeof dep === "string"))) &&
510
530
  Array.isArray(payload.cells) &&
511
531
  payload.cells.every(isMarimoIslandPayloadCell)
512
532
  );
@@ -1,10 +1,22 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
- import { act, renderHook } from "@testing-library/react";
2
+ import {
3
+ act,
4
+ fireEvent,
5
+ render,
6
+ renderHook,
7
+ screen,
8
+ } from "@testing-library/react";
3
9
  import { beforeEach, describe, expect, it, vi } from "vitest";
4
10
  import { useInstallPackages } from "../useInstallPackage";
11
+ import { Toast, ToastProvider, ToastViewport } from "@/components/ui/toast";
5
12
 
6
13
  const toast = vi.fn();
7
14
  const addPackage = vi.fn();
15
+ const restartKernel = vi.fn();
16
+
17
+ vi.mock("@/components/editor/actions/useRestartKernel", () => ({
18
+ useRestartKernel: () => restartKernel,
19
+ }));
8
20
 
9
21
  vi.mock("@/components/ui/use-toast", () => ({
10
22
  toast: (...args: unknown[]) => toast(...args),
@@ -20,6 +32,7 @@ describe("useInstallPackages", () => {
20
32
  beforeEach(() => {
21
33
  toast.mockClear();
22
34
  addPackage.mockClear();
35
+ restartKernel.mockClear();
23
36
  });
24
37
 
25
38
  it("batches all packages into a single install call", async () => {
@@ -109,6 +122,39 @@ describe("useInstallPackages", () => {
109
122
  );
110
123
  });
111
124
 
125
+ it("reports saved changes requiring restart without claiming installation", async () => {
126
+ addPackage.mockResolvedValue({
127
+ success: false,
128
+ error: null,
129
+ restartRequired: true,
130
+ });
131
+ const { result } = renderHook(() => useInstallPackages());
132
+ await act(async () => {
133
+ await result.current.handleInstallPackages(["boltons", "six"]);
134
+ });
135
+ expect(toast).toHaveBeenCalledTimes(1);
136
+ expect(toast).toHaveBeenCalledWith(
137
+ expect.objectContaining({
138
+ title: "Changes saved — restart required",
139
+ description: expect.stringContaining(
140
+ "Restarting clears in-memory variables",
141
+ ),
142
+ duration: Infinity,
143
+ action: expect.anything(),
144
+ }),
145
+ );
146
+ expect(toast.mock.calls[0][0].variant).not.toBe("danger");
147
+ render(
148
+ <ToastProvider>
149
+ <Toast>{toast.mock.calls[0][0].action}</Toast>
150
+ <ToastViewport />
151
+ </ToastProvider>,
152
+ );
153
+ expect(restartKernel).not.toHaveBeenCalled();
154
+ fireEvent.click(screen.getByRole("button", { name: "Restart Kernel" }));
155
+ expect(restartKernel).toHaveBeenCalledTimes(1);
156
+ });
157
+
112
158
  it("calls onSuccess after a successful install", async () => {
113
159
  addPackage.mockResolvedValue({ success: true, error: null });
114
160
  const onSuccess = vi.fn();
@@ -1,8 +1,34 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
+ import { useRestartKernel } from "@/components/editor/actions/useRestartKernel";
3
4
  import { Kbd } from "@/components/ui/kbd";
5
+ import { ToastAction } from "@/components/ui/toast";
4
6
  import { toast } from "@/components/ui/use-toast";
5
7
 
8
+ export const RESTART_REQUIRED_DESCRIPTION =
9
+ "Your dependency changes are saved. Restart the kernel to use the updated environment. Restarting clears in-memory variables.";
10
+
11
+ const RestartKernelAction = () => {
12
+ const restartKernel = useRestartKernel();
13
+ return (
14
+ <ToastAction
15
+ altText="Restart the kernel to use the updated dependencies"
16
+ onClick={restartKernel}
17
+ >
18
+ Restart Kernel
19
+ </ToastAction>
20
+ );
21
+ };
22
+
23
+ export const showPackageRestartToast = () => {
24
+ toast({
25
+ title: "Changes saved — restart required",
26
+ description: RESTART_REQUIRED_DESCRIPTION,
27
+ duration: Infinity,
28
+ action: <RestartKernelAction />,
29
+ });
30
+ };
31
+
6
32
  export const showAddPackageToast = (
7
33
  packageName: string | string[],
8
34
  error?: string | null,
@@ -3,7 +3,10 @@
3
3
  import { useState } from "react";
4
4
  import { Logger } from "@/utils/Logger";
5
5
  import { useRequestClient } from "../network/requests";
6
- import { showAddPackageToast } from "./toast-components";
6
+ import {
7
+ showAddPackageToast,
8
+ showPackageRestartToast,
9
+ } from "./toast-components";
7
10
 
8
11
  export function useInstallPackages(): {
9
12
  handleInstallPackages: (
@@ -30,7 +33,9 @@ export function useInstallPackages(): {
30
33
  // response only carries an aggregate success/error. Report a single
31
34
  // toast covering all requested packages rather than implying a
32
35
  // per-package outcome we don't actually have.
33
- if (response.success) {
36
+ if (response.restartRequired) {
37
+ showPackageRestartToast();
38
+ } else if (response.success) {
34
39
  showAddPackageToast(packages);
35
40
  } else {
36
41
  showAddPackageToast(packages, response.error);
@@ -276,6 +276,17 @@ describe("RuntimeManager", () => {
276
276
  });
277
277
 
278
278
  describe("getTerminalWsURL", () => {
279
+ it("should include dimensions in the terminal handshake", () => {
280
+ const runtime = new RuntimeManager(mockConfig);
281
+ const url = runtime.getTerminalWsURL({ rows: 30, cols: 140 });
282
+
283
+ expect(Object.fromEntries(url.searchParams)).toEqual({
284
+ access_token: "test-token",
285
+ rows: "30",
286
+ cols: "140",
287
+ });
288
+ });
289
+
279
290
  it("should return terminal WebSocket URL", () => {
280
291
  const runtime = new RuntimeManager(mockConfig);
281
292
  const url = runtime.getTerminalWsURL();
@@ -183,8 +183,13 @@ export class RuntimeManager {
183
183
  /**
184
184
  * The WebSocket URL of the terminal.
185
185
  */
186
- getTerminalWsURL(): URL {
187
- return this.formatWsURL("/terminal/ws");
186
+ getTerminalWsURL(size?: { rows: number; cols: number }): URL {
187
+ const url = this.formatWsURL("/terminal/ws");
188
+ if (size) {
189
+ url.searchParams.set("rows", String(size.rows));
190
+ url.searchParams.set("cols", String(size.cols));
191
+ }
192
+ return url;
188
193
  }
189
194
 
190
195
  /**
@@ -649,6 +649,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
649
649
  tags: [],
650
650
  version: null,
651
651
  },
652
+ context: { kind: "package-manager", name: "micropip" },
652
653
  };
653
654
  };
654
655