@marimo-team/islands 0.25.3-dev142 → 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.
- package/dist/{ErrorBoundary-DxdeETpm.js → ErrorBoundary-h1USoT64.js} +1 -1
- package/dist/{code-visibility-CO8abjLo.js → code-visibility-COfR8EW1.js} +1 -1
- package/dist/{common-CbFJQhaI.js → common-0YnRj3Nk.js} +5147 -5143
- package/dist/{data-grid-overlay-editor-DBjVUS2K.js → data-grid-overlay-editor-D0f9mjF4.js} +1 -1
- package/dist/{feedback-button-CWQoIUKQ.js → feedback-button-BoLxN-to.js} +2 -2
- package/dist/{glide-data-editor-BxT8eGip.js → glide-data-editor-DAFwdDUi.js} +3 -3
- package/dist/{globals-f0UxWZkr.js → globals-Bw3_VBRf.js} +1 -1
- package/dist/main.js +6 -6
- package/dist/{number-overlay-editor-Dso2H7DV.js → number-overlay-editor-BSF_HajG.js} +1 -1
- package/dist/{reveal-component-DMglhlng.js → reveal-component-D0kz9zvJ.js} +2 -2
- package/package.json +1 -1
- package/src/__tests__/module-entry.test.ts +22 -10
- package/src/__tests__/mount.test.ts +1 -1
- package/src/__tests__/{host-imports.test.ts → replica-imports.test.ts} +11 -11
- package/src/{core/attachments/__tests__/toast.test.tsx → components/editor/__tests__/agent-toast.test.tsx} +1 -1
- package/src/components/editor/actions/useRestartKernel.tsx +1 -1
- package/src/components/editor/alerts/__tests__/connection-notice.test.tsx +1 -1
- package/src/components/editor/alerts/connection-notice.tsx +1 -1
- package/src/components/editor/app-container.tsx +1 -1
- package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +1 -1
- package/src/components/editor/cell/CreateCellButton.tsx +2 -2
- package/src/components/editor/cell/DeleteButton.tsx +2 -2
- package/src/components/editor/cell/RunButton.tsx +2 -2
- package/src/components/editor/cell/StopButton.tsx +2 -2
- package/src/components/editor/cell/code/cell-editor.tsx +1 -1
- package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +1 -1
- package/src/components/editor/chrome/components/feedback-button.tsx +1 -1
- package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +1 -1
- package/src/components/editor/chrome/panels/__tests__/runtime-details.test.tsx +1 -1
- package/src/components/editor/chrome/panels/__tests__/sandbox-recovery.test.tsx +1 -1
- package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +6 -9
- package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +4 -4
- package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
- package/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx +1 -1
- package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +1 -1
- package/src/components/editor/controls/Controls.tsx +2 -2
- package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +1 -1
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +6 -9
- package/src/components/editor/errors/send-error-report-button.tsx +3 -6
- package/src/components/editor/header/__tests__/status.test.tsx +5 -3
- package/src/components/editor/header/app-header.tsx +1 -1
- package/src/components/editor/header/status.tsx +12 -15
- package/src/components/editor/notebook-cell.tsx +1 -1
- package/src/core/codemirror/readonly/__tests__/extension.test.ts +1 -1
- package/src/core/codemirror/readonly/extension.ts +2 -2
- package/src/core/datasets/__tests__/data-source-discovery.test.ts +1 -1
- package/src/core/edit-app.tsx +2 -2
- package/src/core/export/hooks.ts +1 -1
- package/src/core/network/__tests__/connection.test.ts +1 -1
- package/src/core/network/connection-notice.ts +1 -1
- package/src/core/network/connection.ts +1 -1
- package/src/core/network/requests-lazy.ts +1 -1
- package/src/core/notebook/attachments.ts +38 -0
- package/src/core/{document → notebook/document}/__tests__/codemirror.test.ts +7 -7
- package/src/core/{document → notebook/document}/__tests__/fixtures.ts +1 -1
- package/src/core/{document → notebook/document}/__tests__/hooks.test.tsx +43 -38
- package/src/core/{document → notebook/document}/__tests__/model.test.ts +3 -3
- package/src/core/{document → notebook/document}/__tests__/protocol-fixtures.ts +3 -3
- package/src/core/{document → notebook/document}/__tests__/scenario-fixture.ts +1 -1
- package/src/core/{document → notebook/document}/__tests__/state.test.ts +1 -1
- package/src/core/{document → notebook/document}/__tests__/submission.test.ts +1 -1
- package/src/core/{document → notebook/document}/__tests__/test-host.ts +1 -1
- package/src/core/{document → notebook/document}/__tests__/test-notebook.ts +2 -2
- package/src/core/{document → notebook/document}/codemirror.ts +3 -3
- package/src/core/{document → notebook/document}/draft.ts +1 -1
- package/src/core/{document → notebook/document}/hooks.tsx +9 -9
- package/src/core/{document → notebook/document}/index.ts +7 -7
- package/src/core/{document → notebook/document}/model.ts +1 -1
- package/src/core/{document → notebook/document}/state.ts +1 -1
- package/src/core/{document → notebook/document}/sync.ts +1 -1
- package/src/core/notebook/index.ts +18 -0
- package/src/core/notebook/replica/AGENTS.md +11 -0
- package/src/core/{host → notebook/replica}/__tests__/fixtures.ts +1 -1
- package/src/core/{host → notebook/replica}/__tests__/replica.test.ts +1 -1
- package/src/core/{host → notebook/replica}/index.ts +1 -2
- package/src/core/packages/__tests__/useSandboxController.test.tsx +1 -1
- package/src/core/packages/useSandboxController.ts +1 -1
- package/src/core/run-app.tsx +3 -3
- package/src/core/runtime/__tests__/adapter.test.ts +1 -1
- package/src/core/runtime/adapter.ts +1 -1
- package/src/core/runtime/config.ts +2 -2
- package/src/core/saving/filename.ts +1 -1
- package/src/core/saving/save-component.tsx +1 -1
- package/src/core/saving/useAutoSave.ts +1 -1
- package/src/core/{websocket → session}/__tests__/backend.test.ts +3 -3
- package/src/core/{websocket → session}/__tests__/useNotebookReplica.hook.test.tsx +49 -7
- package/src/core/{websocket → session}/__tests__/useNotebookSession.hook.test.tsx +2 -2
- package/src/core/{websocket/state.ts → session/active-notebook.ts} +2 -2
- package/src/core/{websocket → session}/backend.ts +3 -7
- package/src/core/{websocket → session}/types.ts +2 -2
- package/src/core/{websocket → session}/useNotebookReplica.ts +8 -5
- package/src/core/{websocket → session}/useNotebookSession.tsx +1 -1
- package/src/core/{websocket → transports}/__tests__/connection-state.test.ts +1 -1
- package/src/core/{websocket/transports/__tests__/notebook.test.ts → transports/__tests__/server.test.ts} +7 -4
- package/src/core/{host → transports}/__tests__/static.test.ts +2 -2
- package/src/core/{host → transports}/__tests__/wasm.test.ts +1 -1
- package/src/core/{websocket → transports}/connection-state.ts +9 -6
- package/src/core/{websocket/transports/notebook.ts → transports/server.ts} +1 -8
- package/src/core/{host → transports}/static.ts +9 -2
- package/src/core/{host → transports}/wasm.ts +1 -1
- package/src/core/wasm/__tests__/bridge.test.ts +8 -8
- package/src/core/wasm/bridge.ts +3 -3
- package/src/mount.tsx +1 -1
- package/src/stories/cell.stories.tsx +1 -1
- package/src/stories/layout/vertical/one-column.stories.tsx +1 -1
- package/src/stories/runtime-story.tsx +1 -1
- package/src/core/attachments/state.ts +0 -18
- package/src/core/host/AGENTS.md +0 -12
- /package/src/{core/attachments/toast.ts → components/editor/agent-toast.ts} +0 -0
- /package/src/core/{document → notebook/document}/__tests__/draft.test.ts +0 -0
- /package/src/core/{document → notebook/document}/__tests__/lifecycle-scenarios.test.ts +0 -0
- /package/src/core/{document → notebook/document}/__tests__/recovery-scenarios.test.ts +0 -0
- /package/src/core/{document → notebook/document}/__tests__/scenarios.test.ts +0 -0
- /package/src/core/{document → notebook/document}/__tests__/test-host.test.ts +0 -0
- /package/src/core/{document → notebook/document}/__tests__/user.ts +0 -0
- /package/src/core/{document → notebook/document}/select.ts +0 -0
- /package/src/core/{host → notebook/replica}/__tests__/attachments.test.ts +0 -0
- /package/src/core/{host → notebook/replica}/__tests__/document.test.ts +0 -0
- /package/src/core/{host → notebook/replica}/backend.ts +0 -0
- /package/src/core/{host → notebook/replica}/connection.ts +0 -0
- /package/src/core/{host → notebook/replica}/replica.ts +0 -0
- /package/src/core/{host → notebook/replica}/resources/attachments.ts +0 -0
- /package/src/core/{host → notebook/replica}/resources/document.ts +0 -0
- /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 "
|
|
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 "
|
|
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/
|
|
113
|
-
import { createNotebookReplica } from "@/core/
|
|
114
|
-
import {
|
|
115
|
-
import { createEditorBackend } from "@/core/
|
|
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(
|
|
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(
|
|
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(
|
|
275
|
+
store.set(activeNotebookReplicaAtom, null);
|
|
276
276
|
} else if (state === "not ready") {
|
|
277
|
-
store.set(
|
|
277
|
+
store.set(activeNotebookReplicaAtom, createNotebookReplica(store));
|
|
278
278
|
} else {
|
|
279
279
|
disconnect();
|
|
280
280
|
}
|
package/src/core/wasm/bridge.ts
CHANGED
|
@@ -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 "../
|
|
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 {
|
|
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(
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
-
}
|
package/src/core/host/AGENTS.md
DELETED
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|