@marimo-team/islands 0.25.3-dev143 → 0.25.3-dev144

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 (124) hide show
  1. package/dist/{ErrorBoundary-BRBKqg2U.js → ErrorBoundary-h1USoT64.js} +1 -1
  2. package/dist/{code-visibility-CAgcNzoX.js → code-visibility-COfR8EW1.js} +1 -1
  3. package/dist/{common-BovIV1xq.js → common-0YnRj3Nk.js} +5147 -5143
  4. package/dist/{data-grid-overlay-editor-CBsr8Yo0.js → data-grid-overlay-editor-D0f9mjF4.js} +1 -1
  5. package/dist/{feedback-button-B_9o6DdV.js → feedback-button-BoLxN-to.js} +2 -2
  6. package/dist/{glide-data-editor-i7BEAfhs.js → glide-data-editor-DAFwdDUi.js} +3 -3
  7. package/dist/{globals-BDzA_Re9.js → globals-Bw3_VBRf.js} +1 -1
  8. package/dist/main.js +6 -6
  9. package/dist/{number-overlay-editor-D9WjQlOL.js → number-overlay-editor-BSF_HajG.js} +1 -1
  10. package/dist/{reveal-component-BxP2jlPx.js → reveal-component-D0kz9zvJ.js} +2 -2
  11. package/package.json +1 -1
  12. package/src/__tests__/module-entry.test.ts +22 -10
  13. package/src/__tests__/mount.test.ts +1 -1
  14. package/src/__tests__/{host-imports.test.ts → replica-imports.test.ts} +11 -11
  15. package/src/{core/attachments/__tests__/toast.test.tsx → components/editor/__tests__/agent-toast.test.tsx} +1 -1
  16. package/src/components/editor/actions/useRestartKernel.tsx +1 -1
  17. package/src/components/editor/alerts/__tests__/connection-notice.test.tsx +1 -1
  18. package/src/components/editor/alerts/connection-notice.tsx +1 -1
  19. package/src/components/editor/app-container.tsx +1 -1
  20. package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +1 -1
  21. package/src/components/editor/cell/CreateCellButton.tsx +2 -2
  22. package/src/components/editor/cell/DeleteButton.tsx +2 -2
  23. package/src/components/editor/cell/RunButton.tsx +2 -2
  24. package/src/components/editor/cell/StopButton.tsx +2 -2
  25. package/src/components/editor/cell/code/cell-editor.tsx +1 -1
  26. package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +1 -1
  27. package/src/components/editor/chrome/components/feedback-button.tsx +1 -1
  28. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +1 -1
  29. package/src/components/editor/chrome/panels/__tests__/runtime-details.test.tsx +1 -1
  30. package/src/components/editor/chrome/panels/__tests__/sandbox-recovery.test.tsx +1 -1
  31. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +6 -9
  32. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +4 -4
  33. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
  34. package/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx +1 -1
  35. package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +1 -1
  36. package/src/components/editor/controls/Controls.tsx +2 -2
  37. package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +1 -1
  38. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +6 -9
  39. package/src/components/editor/errors/send-error-report-button.tsx +3 -6
  40. package/src/components/editor/header/__tests__/status.test.tsx +5 -3
  41. package/src/components/editor/header/app-header.tsx +1 -1
  42. package/src/components/editor/header/status.tsx +12 -15
  43. package/src/components/editor/notebook-cell.tsx +1 -1
  44. package/src/core/codemirror/readonly/__tests__/extension.test.ts +1 -1
  45. package/src/core/codemirror/readonly/extension.ts +2 -2
  46. package/src/core/datasets/__tests__/data-source-discovery.test.ts +1 -1
  47. package/src/core/edit-app.tsx +2 -2
  48. package/src/core/export/hooks.ts +1 -1
  49. package/src/core/network/__tests__/connection.test.ts +1 -1
  50. package/src/core/network/connection-notice.ts +1 -1
  51. package/src/core/network/connection.ts +1 -1
  52. package/src/core/network/requests-lazy.ts +1 -1
  53. package/src/core/notebook/attachments.ts +38 -0
  54. package/src/core/{document → notebook/document}/__tests__/codemirror.test.ts +7 -7
  55. package/src/core/{document → notebook/document}/__tests__/fixtures.ts +1 -1
  56. package/src/core/{document → notebook/document}/__tests__/hooks.test.tsx +43 -38
  57. package/src/core/{document → notebook/document}/__tests__/model.test.ts +3 -3
  58. package/src/core/{document → notebook/document}/__tests__/protocol-fixtures.ts +3 -3
  59. package/src/core/{document → notebook/document}/__tests__/scenario-fixture.ts +1 -1
  60. package/src/core/{document → notebook/document}/__tests__/state.test.ts +1 -1
  61. package/src/core/{document → notebook/document}/__tests__/submission.test.ts +1 -1
  62. package/src/core/{document → notebook/document}/__tests__/test-host.ts +1 -1
  63. package/src/core/{document → notebook/document}/__tests__/test-notebook.ts +2 -2
  64. package/src/core/{document → notebook/document}/codemirror.ts +3 -3
  65. package/src/core/{document → notebook/document}/draft.ts +1 -1
  66. package/src/core/{document → notebook/document}/hooks.tsx +9 -9
  67. package/src/core/{document → notebook/document}/index.ts +7 -7
  68. package/src/core/{document → notebook/document}/model.ts +1 -1
  69. package/src/core/{document → notebook/document}/state.ts +1 -1
  70. package/src/core/{document → notebook/document}/sync.ts +1 -1
  71. package/src/core/notebook/index.ts +18 -0
  72. package/src/core/notebook/replica/AGENTS.md +11 -0
  73. package/src/core/{host → notebook/replica}/__tests__/fixtures.ts +1 -1
  74. package/src/core/{host → notebook/replica}/__tests__/replica.test.ts +1 -1
  75. package/src/core/{host → notebook/replica}/index.ts +1 -2
  76. package/src/core/packages/__tests__/useSandboxController.test.tsx +1 -1
  77. package/src/core/packages/useSandboxController.ts +1 -1
  78. package/src/core/run-app.tsx +3 -3
  79. package/src/core/runtime/__tests__/adapter.test.ts +1 -1
  80. package/src/core/runtime/adapter.ts +1 -1
  81. package/src/core/runtime/config.ts +2 -2
  82. package/src/core/saving/filename.ts +1 -1
  83. package/src/core/saving/save-component.tsx +1 -1
  84. package/src/core/saving/useAutoSave.ts +1 -1
  85. package/src/core/{websocket → session}/__tests__/backend.test.ts +3 -3
  86. package/src/core/{websocket → session}/__tests__/useNotebookReplica.hook.test.tsx +49 -7
  87. package/src/core/{websocket → session}/__tests__/useNotebookSession.hook.test.tsx +2 -2
  88. package/src/core/{websocket/state.ts → session/active-notebook.ts} +2 -2
  89. package/src/core/{websocket → session}/backend.ts +3 -7
  90. package/src/core/{websocket → session}/types.ts +2 -2
  91. package/src/core/{websocket → session}/useNotebookReplica.ts +8 -5
  92. package/src/core/{websocket → session}/useNotebookSession.tsx +1 -1
  93. package/src/core/{websocket → transports}/__tests__/connection-state.test.ts +1 -1
  94. package/src/core/{websocket/transports/__tests__/notebook.test.ts → transports/__tests__/server.test.ts} +7 -4
  95. package/src/core/{host → transports}/__tests__/static.test.ts +2 -2
  96. package/src/core/{host → transports}/__tests__/wasm.test.ts +1 -1
  97. package/src/core/{websocket → transports}/connection-state.ts +9 -6
  98. package/src/core/{websocket/transports/notebook.ts → transports/server.ts} +1 -8
  99. package/src/core/{host → transports}/static.ts +9 -2
  100. package/src/core/{host → transports}/wasm.ts +1 -1
  101. package/src/core/wasm/__tests__/bridge.test.ts +8 -8
  102. package/src/core/wasm/bridge.ts +3 -3
  103. package/src/mount.tsx +1 -1
  104. package/src/stories/cell.stories.tsx +1 -1
  105. package/src/stories/layout/vertical/one-column.stories.tsx +1 -1
  106. package/src/stories/runtime-story.tsx +1 -1
  107. package/src/core/attachments/state.ts +0 -18
  108. package/src/core/host/AGENTS.md +0 -12
  109. /package/src/{core/attachments/toast.ts → components/editor/agent-toast.ts} +0 -0
  110. /package/src/core/{document → notebook/document}/__tests__/draft.test.ts +0 -0
  111. /package/src/core/{document → notebook/document}/__tests__/lifecycle-scenarios.test.ts +0 -0
  112. /package/src/core/{document → notebook/document}/__tests__/recovery-scenarios.test.ts +0 -0
  113. /package/src/core/{document → notebook/document}/__tests__/scenarios.test.ts +0 -0
  114. /package/src/core/{document → notebook/document}/__tests__/test-host.test.ts +0 -0
  115. /package/src/core/{document → notebook/document}/__tests__/user.ts +0 -0
  116. /package/src/core/{document → notebook/document}/select.ts +0 -0
  117. /package/src/core/{host → notebook/replica}/__tests__/attachments.test.ts +0 -0
  118. /package/src/core/{host → notebook/replica}/__tests__/document.test.ts +0 -0
  119. /package/src/core/{host → notebook/replica}/backend.ts +0 -0
  120. /package/src/core/{host → notebook/replica}/connection.ts +0 -0
  121. /package/src/core/{host → notebook/replica}/replica.ts +0 -0
  122. /package/src/core/{host → notebook/replica}/resources/attachments.ts +0 -0
  123. /package/src/core/{host → notebook/replica}/resources/document.ts +0 -0
  124. /package/src/core/{websocket → session}/connection-utils.ts +0 -0
@@ -2,9 +2,9 @@
2
2
 
3
3
  /** A backend that serves a document snapshot without a host. */
4
4
 
5
- import type { NotebookClient } from "@marimo-team/client";
5
+ import type { NotebookClient, NotebookTransport } from "@marimo-team/client";
6
6
  import type * as Protocol from "@marimo-team/client/protocol";
7
- import type { NotebookBackend } from "./backend";
7
+ import type { NotebookBackend } from "../notebook/replica";
8
8
 
9
9
  /** A document snapshot with its own identity and revision metadata. */
10
10
  export interface StaticNotebookSnapshot {
@@ -75,3 +75,10 @@ export function createStaticNotebookBackend(
75
75
  },
76
76
  };
77
77
  }
78
+
79
+ /** A connection that opens and delivers nothing, for static notebooks. */
80
+ export const idle: NotebookTransport = ({ signal }, { open }) =>
81
+ new Promise((settle) => {
82
+ open();
83
+ signal.addEventListener("abort", () => settle(), { once: true });
84
+ });
@@ -7,7 +7,7 @@ import {
7
7
  StreamStopped,
8
8
  type unstable_NotebookCall,
9
9
  } from "@marimo-team/client";
10
- import type { NotebookBackend } from "./backend";
10
+ import type { NotebookBackend } from "../notebook/replica";
11
11
 
12
12
  /** The worker owns the notebook; this interface only carries commands and events. */
13
13
  export interface WasmNotebookBridge {
@@ -109,10 +109,10 @@ vi.mock("@/core/cells/document-changes", () => ({
109
109
  // Import after all mocks are set up
110
110
  import { store } from "@/core/state/jotai";
111
111
  import { initialModeAtom } from "@/core/mode";
112
- import { fixtureEvents } from "@/core/host/__tests__/fixtures";
113
- import { createNotebookReplica } from "@/core/host";
114
- import { notebookReplicaAtom } from "@/core/websocket/state";
115
- import { createEditorBackend } from "@/core/websocket/backend";
112
+ import { fixtureEvents } from "@/core/notebook/replica/__tests__/fixtures";
113
+ import { createNotebookReplica } from "@/core/notebook/replica";
114
+ import { activeNotebookReplicaAtom } from "@/core/session/active-notebook";
115
+ import { createEditorBackend } from "@/core/session/backend";
116
116
  import { fallbackFileStore, notebookFileStore } from "../store";
117
117
  import { getWasmWorkerName, PyodideBridge } from "../bridge";
118
118
 
@@ -232,7 +232,7 @@ describe("PyodideBridge.sendSave", () => {
232
232
  }
233
233
  });
234
234
  const replica = createNotebookReplica(store);
235
- store.set(notebookReplicaAtom, replica);
235
+ store.set(activeNotebookReplicaAtom, replica);
236
236
  const backend = createEditorBackend({
237
237
  static: false,
238
238
  transportType: "sse",
@@ -250,7 +250,7 @@ describe("PyodideBridge.sendSave", () => {
250
250
 
251
251
  afterEach(() => {
252
252
  disconnect();
253
- store.set(notebookReplicaAtom, null);
253
+ store.set(activeNotebookReplicaAtom, null);
254
254
  store.set(initialModeAtom, undefined);
255
255
  });
256
256
 
@@ -272,9 +272,9 @@ describe("PyodideBridge.sendSave", () => {
272
272
  "does not save when the notebook is %s",
273
273
  async (state) => {
274
274
  if (state === "unmounted") {
275
- store.set(notebookReplicaAtom, null);
275
+ store.set(activeNotebookReplicaAtom, null);
276
276
  } else if (state === "not ready") {
277
- store.set(notebookReplicaAtom, createNotebookReplica(store));
277
+ store.set(activeNotebookReplicaAtom, createNotebookReplica(store));
278
278
  } else {
279
279
  disconnect();
280
280
  }
@@ -14,7 +14,7 @@ import { generateUUID } from "@/utils/uuid";
14
14
  import { createModuleWorker } from "@/utils/worker";
15
15
  import { notebookIsRunningAtom } from "../cells/cells";
16
16
  import { flushDocumentChanges } from "../cells/document-changes";
17
- import { createWasmNotebookBackend } from "../host";
17
+ import { createWasmNotebookBackend } from "../transports/wasm";
18
18
  import type { ClientCommand } from "../kernel/messages";
19
19
  import { getInitialAppMode } from "../mode";
20
20
  import { API } from "../network/api";
@@ -42,7 +42,7 @@ import type {
42
42
  } from "../network/types";
43
43
  import { filenameAtom } from "../saving/file-state";
44
44
  import { store } from "../state/jotai";
45
- import { notebookReplicaAtom } from "../websocket/state";
45
+ import { activeNotebookReplicaAtom } from "../session/active-notebook";
46
46
  import { PyodideRouter } from "./router";
47
47
  import { getWorkerRPC, type PersistNotebookRequest } from "./rpc";
48
48
  import { getWasmRuntimeConfig } from "./runtime-config";
@@ -267,7 +267,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
267
267
  };
268
268
 
269
269
  private async saveHostNotebook() {
270
- const replica = store.get(notebookReplicaAtom);
270
+ const replica = store.get(activeNotebookReplicaAtom);
271
271
  const notebook = replica && store.get(replica.notebookAtom);
272
272
  const backend = replica && store.get(replica.backendAtom);
273
273
  if (!notebook || !backend) {
package/src/mount.tsx CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  import { maybeRegisterVSCodeBindings } from "./core/vscode/vscode-bindings";
63
63
  import type { FileStore } from "./core/wasm/store";
64
64
  import { notebookFileStore } from "./core/wasm/store";
65
- import { ConnectionState } from "./core/websocket/types";
65
+ import { ConnectionState } from "./core/session/types";
66
66
  import {
67
67
  handleWidgetMessage,
68
68
  WIDGET_REGISTRY,
@@ -14,7 +14,7 @@ import { connectionAtom } from "@/core/network/connection";
14
14
  import { requestClientAtom } from "@/core/network/requests";
15
15
  import { resolveRequestClient } from "@/core/network/resolve";
16
16
  import type { CellConfig } from "@/core/network/types";
17
- import { ConnectionState } from "@/core/websocket/types";
17
+ import { ConnectionState } from "@/core/session/types";
18
18
  import { MultiColumn } from "@/utils/id-tree";
19
19
  import type { Milliseconds, Seconds } from "@/utils/time";
20
20
  import { Cell as EditorCell } from "../components/editor/notebook-cell";
@@ -11,7 +11,7 @@ import { showCodeInRunModeAtom } from "@/core/meta/state";
11
11
  import { connectionAtom } from "@/core/network/connection";
12
12
  import { requestClientAtom } from "@/core/network/requests";
13
13
  import { resolveRequestClient } from "@/core/network/resolve";
14
- import { ConnectionState } from "@/core/websocket/types";
14
+ import { ConnectionState } from "@/core/session/types";
15
15
  import { MultiColumn } from "@/utils/id-tree";
16
16
  import type { Milliseconds, Seconds } from "@/utils/time";
17
17
  import { CellArray } from "../../../components/editor/renderers/cell-array";
@@ -30,7 +30,7 @@ import { requestClientAtom } from "@/core/network/requests";
30
30
  import { createStaticRequests } from "@/core/network/requests-static";
31
31
  import { sandboxActionsAtom, sandboxAtom } from "@/core/packages/sandbox-state";
32
32
  import { filenameAtom } from "@/core/saving/file-state";
33
- import { WebSocketClosedReason, ConnectionState } from "@/core/websocket/types";
33
+ import { WebSocketClosedReason, ConnectionState } from "@/core/session/types";
34
34
  import { HTTPError } from "@/utils/errors";
35
35
 
36
36
  const manifest = `requires-python = ">=3.13"
@@ -1,18 +0,0 @@
1
- /* Copyright 2026 Marimo. All rights reserved. */
2
-
3
- import { atom } from "jotai";
4
- import type { Attachment } from "@marimo-team/client/protocol";
5
- import { notebookReplicaAtom } from "@/core/websocket/state";
6
-
7
- export type { Attachment } from "@marimo-team/client/protocol";
8
-
9
- export const agentAttachmentsAtom = atom((get) => {
10
- const notebook = get(notebookReplicaAtom);
11
- return (notebook ? get(notebook.attachmentsAtom) : []).filter(
12
- (attachment) => attachment.kind === "agent",
13
- );
14
- });
15
-
16
- export function attachmentLabel(attachment: Attachment): string {
17
- return attachment.name || "Agent";
18
- }
@@ -1,12 +0,0 @@
1
- # Host core
2
-
3
- Production code may import host modules, `@marimo-team/client`,
4
- `jotai/vanilla`, `zod`, and `@/utils/Logger`. Enforced by
5
- `marimo/host-imports`. Tests are exempt.
6
-
7
- Code outside this directory imports it as `@/core/host`. Enforced by
8
- `marimo/module-entry`.
9
-
10
- The protocol schemas and types live in `@marimo-team/client/protocol`.
11
-
12
- Define interfaces here and inject application behavior through adapters.
File without changes
File without changes