@marimo-team/islands 0.21.2-dev39 → 0.21.2-dev40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/main.js +5 -2
  2. package/package.json +1 -1
  3. package/src/__mocks__/notebook.ts +9 -9
  4. package/src/__tests__/branded.ts +20 -0
  5. package/src/components/data-table/charts/__tests__/storage.test.ts +7 -7
  6. package/src/components/editor/__tests__/data-attributes.test.tsx +8 -8
  7. package/src/components/editor/ai/__tests__/completion-utils.test.ts +15 -15
  8. package/src/components/editor/navigation/__tests__/clipboard.test.ts +2 -2
  9. package/src/components/editor/navigation/__tests__/selection.test.ts +7 -6
  10. package/src/components/editor/navigation/__tests__/state.test.ts +8 -7
  11. package/src/components/editor/output/MarimoErrorOutput.tsx +7 -7
  12. package/src/components/editor/output/__tests__/traceback.test.tsx +4 -4
  13. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +4 -4
  14. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +8 -1
  15. package/src/components/storage/storage-inspector.tsx +1 -2
  16. package/src/components/tracing/tracing.tsx +3 -1
  17. package/src/core/ai/__tests__/staged-cells.test.ts +9 -8
  18. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +31 -31
  19. package/src/core/ai/context/providers/__tests__/datasource.test.ts +3 -3
  20. package/src/core/ai/context/providers/__tests__/tables.test.ts +3 -2
  21. package/src/core/ai/context/providers/__tests__/variable.test.ts +84 -63
  22. package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +10 -9
  23. package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +6 -6
  24. package/src/core/ai/tools/edit-notebook-tool.ts +3 -3
  25. package/src/core/cells/__tests__/add-missing-import.test.ts +3 -3
  26. package/src/core/cells/__tests__/cells.test.ts +192 -135
  27. package/src/core/cells/__tests__/focus.test.ts +5 -4
  28. package/src/core/cells/__tests__/logs.test.ts +13 -12
  29. package/src/core/cells/__tests__/pending-delete-service.test.tsx +3 -3
  30. package/src/core/cells/__tests__/runs.test.ts +22 -21
  31. package/src/core/cells/__tests__/scrollCellIntoView.test.ts +8 -7
  32. package/src/core/cells/__tests__/session.test.ts +23 -22
  33. package/src/core/cells/cells.ts +1 -1
  34. package/src/core/cells/ids.ts +5 -5
  35. package/src/core/cells/logs.ts +2 -2
  36. package/src/core/cells/runs.ts +6 -8
  37. package/src/core/codemirror/__tests__/format.test.ts +34 -36
  38. package/src/core/codemirror/__tests__/setup.test.ts +2 -2
  39. package/src/core/codemirror/cells/__tests__/traceback-decorations.test.ts +33 -32
  40. package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +12 -13
  41. package/src/core/codemirror/language/__tests__/utils.test.ts +3 -3
  42. package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +7 -8
  43. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +4 -3
  44. package/src/core/codemirror/reactive-references/__tests__/analyzer.test.ts +7 -6
  45. package/src/core/codemirror/reactive-references/analyzer.ts +2 -2
  46. package/src/core/datasets/__tests__/data-source.test.ts +5 -6
  47. package/src/core/datasets/state.ts +1 -1
  48. package/src/core/errors/__tests__/errors.test.ts +2 -1
  49. package/src/core/export/__tests__/hooks.test.ts +37 -36
  50. package/src/core/islands/main.ts +2 -7
  51. package/src/core/kernel/__tests__/handlers.test.ts +5 -4
  52. package/src/core/kernel/handlers.ts +7 -4
  53. package/src/core/network/DeferredRequestRegistry.ts +2 -2
  54. package/src/core/network/__tests__/CachingRequestRegistry.test.ts +9 -10
  55. package/src/core/network/__tests__/DeferredRequestRegistry.test.ts +4 -6
  56. package/src/core/static/__tests__/virtual-file-tracker.test.ts +8 -8
  57. package/src/core/static/virtual-file-tracker.ts +1 -1
  58. package/src/core/storage/__tests__/state.test.ts +31 -21
  59. package/src/core/storage/state.ts +1 -1
  60. package/src/core/variables/__tests__/state.test.ts +6 -6
  61. package/src/core/variables/types.ts +2 -2
  62. package/src/core/wasm/__tests__/state.test.ts +8 -8
  63. package/src/core/websocket/useMarimoKernelConnection.tsx +12 -15
  64. package/src/plugins/impl/anywidget/model.ts +1 -2
  65. package/src/stories/cell.stories.tsx +8 -8
  66. package/src/stories/layout/vertical/one-column.stories.tsx +9 -8
  67. package/src/stories/log-viewer.stories.tsx +8 -8
  68. package/src/stories/variables.stories.tsx +2 -2
  69. package/src/utils/__tests__/download.test.tsx +19 -18
  70. package/src/utils/json/base64.ts +3 -3
  71. package/src/utils/traceback.ts +5 -3
@@ -90,7 +90,7 @@ export class EditNotebookTool
90
90
  switch (edit.type) {
91
91
  case "update_cell": {
92
92
  const { position, code } = edit;
93
- const cellId = position.cellId as CellId;
93
+ const cellId = position.cellId as CellId | undefined;
94
94
 
95
95
  if (!cellId) {
96
96
  throw new ToolExecutionError(
@@ -152,7 +152,7 @@ export class EditNotebookTool
152
152
 
153
153
  switch (position.type) {
154
154
  case "relative": {
155
- const cellId = position.cellId as CellId;
155
+ const cellId = position.cellId as CellId | undefined;
156
156
  if (!cellId) {
157
157
  throw new ToolExecutionError(
158
158
  "Cell ID is required for add_cell with relative position",
@@ -214,7 +214,7 @@ export class EditNotebookTool
214
214
  }
215
215
  case "delete_cell": {
216
216
  const { position } = edit;
217
- const cellId = position.cellId as CellId;
217
+ const cellId = position.cellId as CellId | undefined;
218
218
 
219
219
  if (!cellId) {
220
220
  throw new ToolExecutionError(
@@ -4,6 +4,7 @@ import { createStore } from "jotai";
4
4
  import { beforeEach, describe, expect, it, vi } from "vitest";
5
5
  import { MockNotebook } from "@/__mocks__/notebook";
6
6
  import { MockRequestClient } from "@/__mocks__/requests";
7
+ import { cellId } from "@/__tests__/branded";
7
8
  import { store } from "@/core/state/jotai";
8
9
  import { variablesAtom } from "@/core/variables/state";
9
10
  import type { Variables } from "@/core/variables/types";
@@ -13,7 +14,6 @@ import {
13
14
  maybeAddMissingImport,
14
15
  } from "../add-missing-import";
15
16
  import { notebookAtom } from "../cells";
16
- import type { CellId } from "../ids";
17
17
 
18
18
  // Mock the getRequestClient function
19
19
  const mockRequestClient = MockRequestClient.create();
@@ -21,8 +21,8 @@ vi.mock("@/core/network/requests", () => ({
21
21
  getRequestClient: () => mockRequestClient,
22
22
  }));
23
23
 
24
- const Cell1 = "1" as CellId;
25
- const Cell2 = "2" as CellId;
24
+ const Cell1 = cellId("1");
25
+ const Cell2 = cellId("2");
26
26
 
27
27
  describe("maybeAddMissingImport", () => {
28
28
  beforeEach(() => {