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

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-wSOY07qE.js} +1 -1
  2. package/dist/{code-visibility-CAgcNzoX.js → code-visibility-ClBVaJxO.js} +1 -1
  3. package/dist/{common-BovIV1xq.js → common-CUexlJOX.js} +5147 -5143
  4. package/dist/{data-grid-overlay-editor-CBsr8Yo0.js → data-grid-overlay-editor-Bw6eRAP6.js} +1 -1
  5. package/dist/{feedback-button-B_9o6DdV.js → feedback-button-DXCqy1zU.js} +2 -2
  6. package/dist/{glide-data-editor-i7BEAfhs.js → glide-data-editor-C5McBx2B.js} +3 -3
  7. package/dist/{globals-BDzA_Re9.js → globals-axkELZAO.js} +1 -1
  8. package/dist/main.js +6 -6
  9. package/dist/{number-overlay-editor-D9WjQlOL.js → number-overlay-editor-bp_Nz8bW.js} +1 -1
  10. package/dist/{reveal-component-BxP2jlPx.js → reveal-component-FoSlb0Gk.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,7 +2,7 @@ import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-sHtZdjeP.js";
3
3
  import { t as n } from "./react-dom-DUmH0GXv.js";
4
4
  import { c as r, l as i, u as a } from "./data-grid-types-0PJ-9N5n.js";
5
- import { a as o, i as s, n as c, r as l } from "./glide-data-editor-i7BEAfhs.js";
5
+ import { a as o, i as s, n as c, r as l } from "./glide-data-editor-C5McBx2B.js";
6
6
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.0_27cffe7f1bc30287d59ac27db3240c5b/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/data-grid-overlay-editor-style.js
7
7
  var u = /* @__PURE__ */ e(t(), 1), d = /* @__PURE__ */ e(n(), 1), f = /*#__PURE__*/ o("div")({
8
8
  name: "DataGridOverlayEditorStyle",
@@ -5,12 +5,12 @@ import { t as i } from "./compiler-runtime-CldRdSsv.js";
5
5
  import { t as a } from "./copy-icon-C1trdvVt.js";
6
6
  import { H as o, K as s, Lt as c, Ot as l, fn as u, h as d, i as f, n as p, q as m, zt as h } from "./error-entries-CmFDQ9CA.js";
7
7
  import { b as g } from "./select-CkF_GBxO.js";
8
- import { n as ee, t as te } from "./globals-BDzA_Re9.js";
8
+ import { n as ee, t as te } from "./globals-axkELZAO.js";
9
9
  import { t as _ } from "./jsx-runtime-3BD1kT0s.js";
10
10
  import { C as v, _ as ne, i as y } from "./useTheme-Bq9pi_vz.js";
11
11
  import { a as re, i as ie, n as ae, r as oe } from "./dialog-DgeqyrEZ.js";
12
12
  import { t as se } from "./useAsyncData-BmVgnMP5.js";
13
- import { t as ce } from "./code-visibility-CAgcNzoX.js";
13
+ import { t as ce } from "./code-visibility-ClBVaJxO.js";
14
14
  //#region src/components/ui/skeleton.tsx
15
15
  var b = /* @__PURE__ */ e(r(), 1), x = i(), S = _(), le = (e) => {
16
16
  let n = (0, x.c)(8), r, i;
@@ -6,7 +6,7 @@ import { i as s, n as c, r as l } from "./copy-icon-C1trdvVt.js";
6
6
  import { C as u, c as d, i as f, n as p, s as m, t as h, x as g } from "./select-CkF_GBxO.js";
7
7
  import { d as _, h as v, i as y, l as b, n as x, o as S, s as C, t as w, u as T } from "./dropdown-menu-GWcGCcxE.js";
8
8
  import { c as E, d as D, l as O, n as k, o as A, s as ee, t as j, u as te } from "./glide-utils-Dz_F4pAY.js";
9
- import { n as ne, t as re } from "./ErrorBoundary-BRBKqg2U.js";
9
+ import { n as ne, t as re } from "./ErrorBoundary-wSOY07qE.js";
10
10
  import { t as ie } from "./react-dom-DUmH0GXv.js";
11
11
  import { t as M } from "./jsx-runtime-3BD1kT0s.js";
12
12
  import { t as N } from "./label-D9_-zSg-.js";
@@ -7062,7 +7062,7 @@ function rs(e, t, n, r, i) {
7062
7062
  }
7063
7063
  //#endregion
7064
7064
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.0_27cffe7f1bc30287d59ac27db3240c5b/node_modules/@glideapps/glide-data-grid/dist/esm/data-editor/data-editor.js
7065
- var is = /* @__PURE__ */ e(_r(), 1), as = /* @__PURE__ */ e(xr(), 1), os = K.lazy(async () => await import("./data-grid-overlay-editor-CBsr8Yo0.js")), ss = 0;
7065
+ var is = /* @__PURE__ */ e(_r(), 1), as = /* @__PURE__ */ e(xr(), 1), os = K.lazy(async () => await import("./data-grid-overlay-editor-Bw6eRAP6.js")), ss = 0;
7066
7066
  function cs(e) {
7067
7067
  return (0, is.default)((0, as.default)((0, as.default)(e).filter((e) => e.span !== void 0).map((e) => (0, Za.default)((e.span?.[0] ?? 0) + 1, (e.span?.[1] ?? 0) + 1))));
7068
7068
  }
@@ -9293,7 +9293,7 @@ function Vs(e, t, n, r, i) {
9293
9293
  }
9294
9294
  //#endregion
9295
9295
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.0_27cffe7f1bc30287d59ac27db3240c5b/node_modules/@glideapps/glide-data-grid/dist/esm/cells/number-cell.js
9296
- var Hs = K.lazy(async () => await import("./number-overlay-editor-D9WjQlOL.js")), Us = {
9296
+ var Hs = K.lazy(async () => await import("./number-overlay-editor-bp_Nz8bW.js")), Us = {
9297
9297
  getAccessibilityString: (e) => e.data?.toString() ?? "",
9298
9298
  kind: W.Number,
9299
9299
  needsHover: (e) => e.hoverEffect === !0,
@@ -1,6 +1,6 @@
1
1
  import { m as e } from "./tooltip-CJ4Rqasp.js";
2
2
  import { _ as t } from "./useTheme-Bq9pi_vz.js";
3
- import { r as n } from "./code-visibility-CAgcNzoX.js";
3
+ import { r as n } from "./code-visibility-ClBVaJxO.js";
4
4
  var r = e("triangle-alert", [
5
5
  ["path", {
6
6
  d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
package/dist/main.js CHANGED
@@ -7,7 +7,7 @@ import { C as T, F as E, G as D, I as O, J as k, K as A, L as j, P as M, R as N,
7
7
  import { a as oe, d as se, i as ce, m as le, n as ue, o as de, p as fe, r as pe, t as me } from "./tooltip-CJ4Rqasp.js";
8
8
  import { $ as he, A as ge, At as _e, B as ve, Bt as ye, D as be, Dt as xe, G as Se, H as Ce, Ht as we, It as Te, J as Ee, Jt as De, Kt as Oe, M as ke, Mt as Ae, N as je, Nt as Me, O as Ne, Ot as Pe, P as Fe, Q as Ie, S as Le, Tt as Re, V as ze, Vt as Be, Wt as Ve, X as He, Xt as Ue, Y as We, Yt as Ge, _ as Ke, _n as qe, _t as Je, an as Ye, b as Xe, cn as Ze, ct as Qe, dn as $e, dt as et, en as tt, f as nt, ft as rt, g as it, gn as at, gt as ot, h as st, it as ct, jt as lt, k as ut, kt as dt, ln as ft, m as pt, mn as mt, nn as ht, o as gt, p as _t, pn as vt, pt as yt, qt as bt, rn as xt, rt as St, s as Ct, tn as wt, u as Tt, un as Et, v as Dt, xt as Ot, y as kt, z as At } from "./error-entries-CmFDQ9CA.js";
9
9
  import { D as jt, E as Mt, O as Nt, S as Pt, T as Ft, _ as It, a as Lt, c as Rt, d as zt, f as Bt, g as Vt, h as Ht, i as Ut, l as Wt, m as Gt, n as Kt, o as qt, p as Jt, r as Yt, s as Xt, t as Zt, u as Qt, v as $t, w as en, x as tn, y as nn } from "./spec-DiSh_qJC.js";
10
- import { $t as rn, A as an, At as on, B as sn, Bt as cn, C as ln, Ct as un, D as dn, Dt as fn, E as pn, Et as mn, F as hn, Ft as gn, G as _n, Gt as vn, H as yn, Ht as bn, I as xn, It as Sn, J as Cn, Jt as wn, K as Tn, Kt as En, L as Dn, Lt as On, M as kn, Mt as An, N as jn, Nt as Mn, O as Nn, Ot as Pn, P as Fn, Pt as In, Qt as Ln, R as Rn, Rt as zn, S as Bn, St as Vn, T as Hn, Tt as Un, U as Wn, Ut as Gn, V as Kn, Vt as qn, W as Jn, Wt as Yn, X as Xn, Xt as Zn, Y as Qn, Yt as $n, Zt as er, _ as tr, _t as nr, an as rr, at as ir, b as ar, c as or, cn as sr, ct as cr, d as lr, dn as ur, dt as dr, en as fr, et as pr, f as mr, fn as hr, ft as gr, g as _r, gt as vr, h as yr, hn as br, ht as xr, in as Sr, it as Cr, j as wr, jt as Tr, k as Er, kt as Dr, ln as Or, lt as kr, m as Ar, mn as jr, mt as Mr, nn as Nr, nt as Pr, ot as Fr, p as Ir, pn as Lr, pt as Rr, q as zr, qt as Br, r as Vr, rn as Hr, rt as Ur, sn as Wr, st as Gr, t as Kr, tn as qr, tt as Jr, u as Yr, un as Xr, ut as Zr, v as Qr, vt as $r, w as ei, wt as ti, x as ni, y as ri, yt as ii, z as ai, zt as oi } from "./common-BovIV1xq.js";
10
+ import { $t as rn, A as an, At as on, B as sn, Bt as cn, C as ln, Ct as un, D as dn, Dt as fn, E as pn, Et as mn, F as hn, Ft as gn, G as _n, Gt as vn, H as yn, Ht as bn, I as xn, It as Sn, J as Cn, Jt as wn, K as Tn, Kt as En, L as Dn, Lt as On, M as kn, Mt as An, N as jn, Nt as Mn, O as Nn, Ot as Pn, P as Fn, Pt as In, Qt as Ln, R as Rn, Rt as zn, S as Bn, St as Vn, T as Hn, Tt as Un, U as Wn, Ut as Gn, V as Kn, Vt as qn, W as Jn, Wt as Yn, X as Xn, Xt as Zn, Y as Qn, Yt as $n, Zt as er, _ as tr, _t as nr, an as rr, at as ir, b as ar, c as or, cn as sr, ct as cr, d as lr, dn as ur, dt as dr, en as fr, et as pr, f as mr, fn as hr, ft as gr, g as _r, gt as vr, h as yr, hn as br, ht as xr, in as Sr, it as Cr, j as wr, jt as Tr, k as Er, kt as Dr, ln as Or, lt as kr, m as Ar, mn as jr, mt as Mr, nn as Nr, nt as Pr, ot as Fr, p as Ir, pn as Lr, pt as Rr, q as zr, qt as Br, r as Vr, rn as Hr, rt as Ur, sn as Wr, st as Gr, t as Kr, tn as qr, tt as Jr, u as Yr, un as Xr, ut as Zr, v as Qr, vt as $r, w as ei, wt as ti, x as ni, y as ri, yt as ii, z as ai, zt as oi } from "./common-CUexlJOX.js";
11
11
  import { c as si, i as ci, n as li, o as ui, t as di } from "./useLifecycle-B5BX921H.js";
12
12
  import { t as fi } from "./check-SpOMoCLP.js";
13
13
  import { A as pi, C as mi, D as hi, E as gi, M as _i, O as vi, S as yi, T as bi, a as xi, b as Si, c as Ci, i as wi, l as Ti, n as Ei, o as Di, r as Oi, s as ki, t as Ai, w as ji, x as Mi } from "./select-CkF_GBxO.js";
@@ -15,8 +15,8 @@ import { B as Ni, C as Pi, J as Fi, Ot as Ii, S as Li, W as Ri, X as zi, Y as Bi
15
15
  import { C as fa, _ as pa, a as ma, b as ha, c as ga, f as _a, h as va, m as ya, p as ba, s as xa, u as Sa, x as Ca, y as wa } from "./toDate-DGvRHwTk.js";
16
16
  import { a as Ta, c as Ea, d as Da, f as Oa, i as ka, l as Aa, n as ja, o as Ma, r as Na, s as Pa, t as Fa } from "./process-output-Bw-vzyoy.js";
17
17
  import { a as Ia, c as La, d as Ra, i as za, l as Ba, r as Va, u as Ha } from "./glide-utils-Dz_F4pAY.js";
18
- import { n as Ua, t as Wa } from "./ErrorBoundary-BRBKqg2U.js";
19
- import { n as Ga, t as Ka } from "./globals-BDzA_Re9.js";
18
+ import { n as Ua, t as Wa } from "./ErrorBoundary-wSOY07qE.js";
19
+ import { n as Ga, t as Ka } from "./globals-axkELZAO.js";
20
20
  import { t as qa } from "./react-dom-DUmH0GXv.js";
21
21
  import { t as Ja } from "./jsx-runtime-3BD1kT0s.js";
22
22
  import { B as Ya, C as H, Ct as Xa, D as Za, Dt as Qa, E as $a, Et as eo, F as U, G as to, H as no, I as ro, L as io, M as W, N as ao, O as oo, P as so, Q as co, R as lo, S as G, St as uo, Tt as fo, U as po, W as mo, Y as ho, Z as go, _ as _o, _t as vo, a as yo, b as bo, bt as xo, c as So, d as Co, f as wo, g as To, h as Eo, i as Do, j as K, k as Oo, l as ko, m as Ao, n as jo, o as Mo, p as No, r as Po, s as Fo, u as Io, ut as Lo, v as Ro, w as zo, wt as Bo, x as Vo, xt as Ho, y as Uo, yt as Wo } from "./use-restore-focus-CmGwRNId.js";
@@ -39,7 +39,7 @@ import { t as Ps } from "./useAsyncData-BmVgnMP5.js";
39
39
  import { i as Fs, n as Is, r as Ls } from "./formats-CCxaLPNs.js";
40
40
  import { D as Rs, O as zs } from "./vega-loader.browser-B9Pz0EGP.js";
41
41
  import { a as Bs, n as Vs } from "./loader-DOVB0Syl.js";
42
- import { c as Hs, d as Us, i as Ws, l as Gs, o as Ks, s as qs, t as Js, u as Ys } from "./code-visibility-CAgcNzoX.js";
42
+ import { c as Hs, d as Us, i as Ws, l as Gs, o as Ks, s as qs, t as Js, u as Ys } from "./code-visibility-ClBVaJxO.js";
43
43
  import { t as Xs } from "./useDeepCompareMemoize-Ch_AeGu6.js";
44
44
  import { t as Zs } from "./esm-D2gTsXEV.js";
45
45
  //#region ../node_modules/.pnpm/iconify-icon@2.3.0/node_modules/iconify-icon/dist/iconify-icon.mjs
@@ -10635,7 +10635,7 @@ function WC(e, t) {
10635
10635
  }
10636
10636
  //#endregion
10637
10637
  //#region src/plugins/impl/DataEditorPlugin.tsx
10638
- var GC = J.lazy(() => import("./glide-data-editor-i7BEAfhs.js").then((e) => e.t)), KC = DS("marimo-data-editor", { cssStyles: [XS] }).withData(W({
10638
+ var GC = J.lazy(() => import("./glide-data-editor-C5McBx2B.js").then((e) => e.t)), KC = DS("marimo-data-editor", { cssStyles: [XS] }).withData(W({
10639
10639
  initialValue: W({ edits: G(W({
10640
10640
  rowIdx: K(),
10641
10641
  columnId: U(),
@@ -30407,7 +30407,7 @@ function WR(e) {
30407
30407
  }
30408
30408
  //#endregion
30409
30409
  //#region src/components/editor/renderers/slides-layout/slides-layout.tsx
30410
- var GR = J.lazy(() => import("./reveal-component-BxP2jlPx.js")), KR = (e) => {
30410
+ var GR = J.lazy(() => import("./reveal-component-FoSlb0Gk.js")), KR = (e) => {
30411
30411
  let t = (0, X.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = is(pa), s = a === "read" || o, c = is(Ke) > 1, [l, u] = (0, J.useState)(null), d;
30412
30412
  t[0] !== i || t[1] !== n ? (d = HP(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
30413
30413
  let { slideCells: f, skippedIds: p, noOutputIds: m, slideTypes: h, startCellIndex: g } = d, _;
@@ -1,6 +1,6 @@
1
1
  import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-sHtZdjeP.js";
3
- import { a as n } from "./glide-data-editor-i7BEAfhs.js";
3
+ import { a as n } from "./glide-data-editor-C5McBx2B.js";
4
4
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.0_27cffe7f1bc30287d59ac27db3240c5b/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/private/number-overlay-editor-style.js
5
5
  var r = /* @__PURE__ */ e(t()), i = /*#__PURE__*/ n("div")({
6
6
  name: "NumberOverlayEditorStyle",
@@ -4,14 +4,14 @@ import { t as o } from "./react-sHtZdjeP.js";
4
4
  import { t as s } from "./compiler-runtime-CldRdSsv.js";
5
5
  import { m as c, t as l } from "./tooltip-CJ4Rqasp.js";
6
6
  import { k as u } from "./error-entries-CmFDQ9CA.js";
7
- import { $ as d, Q as f, Z as p, an as m, i as h, l as g, ln as _, n as v, on as y, r as b, t as x, u as S } from "./common-BovIV1xq.js";
7
+ import { $ as d, Q as f, Z as p, an as m, i as h, l as g, ln as _, n as v, on as y, r as b, t as x, u as S } from "./common-CUexlJOX.js";
8
8
  import { M as C } from "./select-CkF_GBxO.js";
9
9
  import { J as ee } from "./dropdown-menu-GWcGCcxE.js";
10
10
  import { _ as w } from "./toDate-DGvRHwTk.js";
11
11
  import { t as T } from "./jsx-runtime-3BD1kT0s.js";
12
12
  import { q as E } from "./use-restore-focus-CmGwRNId.js";
13
13
  import { A as D, C as O, b as k } from "./useTheme-Bq9pi_vz.js";
14
- import { a as A, n as te, t as ne } from "./code-visibility-CAgcNzoX.js";
14
+ import { a as A, n as te, t as ne } from "./code-visibility-ClBVaJxO.js";
15
15
  /* empty css */
16
16
  var j = c("sticky-note", [["path", {
17
17
  d: "M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.25.3-dev143",
3
+ "version": "0.25.3-dev145",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -17,16 +17,28 @@ function reports(file: string, source: string): boolean {
17
17
  }
18
18
 
19
19
  it.each([
20
- ["core/websocket/state.ts", "@/core/host", false],
21
- ["core/websocket/state.ts", "../host", false],
22
- ["core/websocket/state.ts", "@/core/document", false],
23
- ["core/host/replica.ts", "./resources/document", false],
24
- ["core/host/replica.ts", "@/core/host/backend", false],
25
- ["core/websocket/__tests__/a.test.ts", "../../host/replica", false],
26
- ["core/websocket/fixtures.ts", "../host/__tests__/fixtures", false],
27
- ["core/websocket/state.ts", "@/core/host/replica", true],
28
- ["core/websocket/state.ts", "../host/resources/document", true],
29
- ["core/websocket/state.ts", "../document/hooks", true],
20
+ ["components/editor.tsx", "@/core/notebook", false],
21
+ ["components/editor.tsx", "@/core/notebook/attachments", true],
22
+ ["core/notebook/index.ts", "./attachments", false],
23
+ ["core/notebook/index.ts", "./document/hooks", true],
24
+ ["core/session/active-notebook.ts", "@/core/notebook/replica", false],
25
+ ["core/session/active-notebook.ts", "../notebook/replica", false],
26
+ ["core/session/active-notebook.ts", "@/core/notebook/document", false],
27
+ ["core/notebook/replica/replica.ts", "./resources/document", false],
28
+ [
29
+ "core/notebook/replica/replica.ts",
30
+ "@/core/notebook/replica/backend",
31
+ false,
32
+ ],
33
+ ["core/session/__tests__/a.test.ts", "../../notebook/replica/replica", false],
34
+ ["core/session/fixtures.ts", "../notebook/replica/__tests__/fixtures", false],
35
+ ["core/session/active-notebook.ts", "@/core/notebook/replica/replica", true],
36
+ [
37
+ "core/session/active-notebook.ts",
38
+ "../notebook/replica/resources/document",
39
+ true,
40
+ ],
41
+ ["core/session/active-notebook.ts", "../notebook/document/hooks", true],
30
42
  ])("from %s, importing %s reports %s", (file, source, expected) => {
31
43
  expect(reports(file, source)).toBe(expected);
32
44
  });
@@ -7,7 +7,7 @@ import { kioskModeAtom } from "@/core/mode";
7
7
  import { connectionAtom } from "@/core/network/connection";
8
8
  import { store } from "@/core/state/jotai";
9
9
  import { isStaticNotebook } from "@/core/static/static-state";
10
- import { ConnectionState } from "@/core/websocket/types";
10
+ import { ConnectionState } from "@/core/session/types";
11
11
  import { pairConfigAtom } from "@/core/config/pair";
12
12
  import { PAIR_CONFIG } from "./fixtures/pair-config";
13
13
  import { mount, visibleForTesting } from "../mount";
@@ -8,31 +8,31 @@ import NodeUrl from "node:url";
8
8
  import { expect, it } from "vitest";
9
9
  import { z } from "zod";
10
10
 
11
- it("enforces host dependencies for runtime and type imports", () => {
11
+ it("enforces replica dependencies for runtime and type imports", () => {
12
12
  const frontend = NodeUrl.fileURLToPath(
13
- new NodeUrl.URL("../../", import.meta.url),
13
+ new NodeUrl.URL("../..", import.meta.url),
14
14
  );
15
15
  const directory = NodeFs.mkdtempSync(
16
- NodePath.join(NodeOs.tmpdir(), "host-imports-"),
16
+ NodePath.join(NodeOs.tmpdir(), "replica-imports-"),
17
17
  );
18
18
  const files = {
19
- "src/core/host/allowed.ts": `
19
+ "src/core/notebook/replica/allowed.ts": `
20
20
  import { atom } from "jotai/vanilla";
21
21
  import { z } from "zod";
22
22
  import * as Protocol from "@marimo-team/client/protocol";
23
23
  import { Logger } from "@/utils/Logger";
24
24
  import type { Document } from "./document";
25
- export * from "@/core/host/events";
25
+ export * from "@/core/notebook/replica/events";
26
26
  type Event = import("./events").NotebookEvent;
27
27
  void import("./protocol");
28
28
  `,
29
- "src/core/host/protocol.ts": `
29
+ "src/core/notebook/replica/protocol.ts": `
30
30
  import type { NotificationMessage as A } from "../kernel/messages";
31
31
  import { type NotificationMessage as B } from "@/core/kernel/messages";
32
32
  import { NotificationMessage as C } from "../kernel/messages";
33
33
  import type { NotificationPayload } from "../kernel/messages";
34
34
  `,
35
- "src/core/host/forbidden.ts": `
35
+ "src/core/notebook/replica/forbidden.ts": `
36
36
  import { useEffect } from "react";
37
37
  import type { NotificationMessage } from "../kernel/messages";
38
38
  export * from "../kernel/messages";
@@ -44,10 +44,10 @@ it("enforces host dependencies for runtime and type imports", () => {
44
44
  import "./__tests__/allowed";
45
45
  import "./allowed.test";
46
46
  `,
47
- "src/core/host/__tests__/allowed.ts": `import { useEffect } from "react";`,
48
- "src/core/host/allowed.test.ts": `import { useEffect } from "react";`,
49
- "src/core/host/allowed.spec.ts": `import { useEffect } from "react";`,
50
- "src/core/websocket/allowed.ts": `import { useEffect } from "react";`,
47
+ "src/core/notebook/replica/__tests__/allowed.ts": `import { useEffect } from "react";`,
48
+ "src/core/notebook/replica/allowed.test.ts": `import { useEffect } from "react";`,
49
+ "src/core/notebook/replica/allowed.spec.ts": `import { useEffect } from "react";`,
50
+ "src/core/session/allowed.ts": `import { useEffect } from "react";`,
51
51
  };
52
52
  try {
53
53
  for (const [path, source] of Object.entries(files)) {
@@ -5,7 +5,7 @@ import { act, render, renderHook } from "@testing-library/react";
5
5
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
6
6
  import { Toaster } from "@/components/ui/toaster";
7
7
  import { clearToasts, toast, useToast } from "@/components/ui/use-toast";
8
- import { agentToast } from "../toast";
8
+ import { agentToast } from "../agent-toast";
9
9
 
10
10
  describe("agent notifications", () => {
11
11
  beforeEach(() => {
@@ -5,7 +5,7 @@ import { useImperativeModal } from "@/components/modal/ImperativeModal";
5
5
  import { AlertDialogDestructiveAction } from "@/components/ui/alert-dialog";
6
6
  import { connectionAtom } from "@/core/network/connection";
7
7
  import { useRequestClient } from "@/core/network/requests";
8
- import { ConnectionState } from "@/core/websocket/types";
8
+ import { ConnectionState } from "@/core/session/types";
9
9
  import { reloadSafe } from "@/utils/reload-safe";
10
10
 
11
11
  export function useRestartKernel() {
@@ -11,7 +11,7 @@ import { AppConfigSchema } from "@/core/config/config-schema";
11
11
  import { kernelStartupErrorAtom } from "@/core/errors/state";
12
12
  import { connectionAtom } from "@/core/network/connection";
13
13
  import { sandboxAtom, sandboxSyncAtom } from "@/core/packages/sandbox-state";
14
- import { WebSocketClosedReason, ConnectionState } from "@/core/websocket/types";
14
+ import { WebSocketClosedReason, ConnectionState } from "@/core/session/types";
15
15
  import { chromeAtom } from "../../chrome/state";
16
16
  import { runtimeDetailsExpandedAtom } from "../../chrome/panels/runtime-details-state";
17
17
  import { ConnectionNotice } from "../connection-notice";
@@ -8,7 +8,7 @@ import type { AppConfig } from "@/core/config/config-schema";
8
8
  import { connectionAtom } from "@/core/network/connection";
9
9
  import { useConnectionNotice } from "@/core/network/useConnectionNotice";
10
10
  import { sandboxAtom } from "@/core/packages/sandbox-state";
11
- import { ConnectionState } from "@/core/websocket/types";
11
+ import { ConnectionState } from "@/core/session/types";
12
12
  import { useInterval } from "@/hooks/useInterval";
13
13
  import { cn } from "@/utils/cn";
14
14
  import { runtimeDetailsExpandedAtom } from "../chrome/panels/runtime-details-state";
@@ -8,7 +8,7 @@ import {
8
8
  type ConnectionStatus,
9
9
  WebSocketClosedReason,
10
10
  ConnectionState,
11
- } from "@/core/websocket/types";
11
+ } from "@/core/session/types";
12
12
  import { cn } from "@/utils/cn";
13
13
  import { DynamicFavicon } from "./dynamic-favicon";
14
14
  import { StatusOverlay } from "./header/status";
@@ -14,7 +14,7 @@ import { requestClientAtom } from "@/core/network/requests";
14
14
  import type { EnvironmentInfo } from "@/core/network/types";
15
15
  import { filenameAtom } from "@/core/saving/file-state";
16
16
  import { store } from "@/core/state/jotai";
17
- import { ConnectionState } from "@/core/websocket/types";
17
+ import { ConnectionState } from "@/core/session/types";
18
18
  import { ErrorBoundary } from "../ErrorBoundary";
19
19
 
20
20
  vi.mock("@/utils/copy", () => ({
@@ -16,8 +16,8 @@ import { MARKDOWN_INITIAL_HIDE_CODE } from "@/core/codemirror/language/languages
16
16
  import {
17
17
  getConnectionTooltip,
18
18
  isAppInteractionDisabled,
19
- } from "@/core/websocket/connection-utils";
20
- import type { ConnectionState } from "@/core/websocket/types";
19
+ } from "@/core/session/connection-utils";
20
+ import type { ConnectionState } from "@/core/session/types";
21
21
  import { cn } from "@/utils/cn";
22
22
  import { Tooltip } from "../../ui/tooltip";
23
23
  import { MarkdownIcon, PythonIcon } from "./code/icons";
@@ -5,8 +5,8 @@ import type { RuntimeState } from "@/core/network/types";
5
5
  import {
6
6
  getConnectionTooltip,
7
7
  isAppInteractionDisabled,
8
- } from "@/core/websocket/connection-utils";
9
- import type { ConnectionState } from "@/core/websocket/types";
8
+ } from "@/core/session/connection-utils";
9
+ import type { ConnectionState } from "@/core/session/types";
10
10
  import { cn } from "@/utils/cn";
11
11
  import { Events } from "@/utils/events";
12
12
  import { Button } from "../../ui/button";
@@ -5,8 +5,8 @@ import type { CellConfig, RuntimeState } from "@/core/network/types";
5
5
  import {
6
6
  getConnectionTooltip,
7
7
  isAppInteractionDisabled,
8
- } from "@/core/websocket/connection-utils";
9
- import type { ConnectionState } from "@/core/websocket/types";
8
+ } from "@/core/session/connection-utils";
9
+ import type { ConnectionState } from "@/core/session/types";
10
10
  import { renderShortcut } from "../../shortcuts/renderShortcut";
11
11
  import { ToolbarItem } from "./toolbar";
12
12
 
@@ -3,8 +3,8 @@ import { SquareIcon } from "lucide-react";
3
3
  import type { JSX } from "react";
4
4
  import { useRequestClient } from "@/core/network/requests";
5
5
  import type { RuntimeState } from "@/core/network/types";
6
- import { isAppInteractionDisabled } from "@/core/websocket/connection-utils";
7
- import type { ConnectionState } from "@/core/websocket/types";
6
+ import { isAppInteractionDisabled } from "@/core/session/connection-utils";
7
+ import type { ConnectionState } from "@/core/session/types";
8
8
  import { Functions } from "@/utils/functions";
9
9
  import { renderShortcut } from "../../shortcuts/renderShortcut";
10
10
  import { ToolbarItem } from "./toolbar";
@@ -41,7 +41,7 @@ import { connectionAtom } from "@/core/network/connection";
41
41
  import { useRequestClient } from "@/core/network/requests";
42
42
  import { canUseRtc, isRtcEnabled } from "@/core/rtc/state";
43
43
  import { useSaveNotebook } from "@/core/saving/save-component";
44
- import { isAppConnecting } from "@/core/websocket/connection-utils";
44
+ import { isAppConnecting } from "@/core/session/connection-utils";
45
45
  import type { Theme } from "@/theme/useTheme";
46
46
  import { cn } from "@/utils/cn";
47
47
  import { invariant } from "@/utils/invariant";
@@ -14,7 +14,7 @@ import { requestClientAtom } from "@/core/network/requests";
14
14
  import type { EnvironmentInfo } from "@/core/network/types";
15
15
  import { filenameAtom } from "@/core/saving/file-state";
16
16
  import { store } from "@/core/state/jotai";
17
- import { ConnectionState } from "@/core/websocket/types";
17
+ import { ConnectionState } from "@/core/session/types";
18
18
  import * as copyModule from "@/utils/copy";
19
19
  import { FeedbackModal } from "../feedback-button";
20
20
 
@@ -39,7 +39,7 @@ import { connectionAtom } from "@/core/network/connection";
39
39
  import { requestClientAtom } from "@/core/network/requests";
40
40
  import { filenameAtom } from "@/core/saving/file-state";
41
41
  import { store } from "@/core/state/jotai";
42
- import { ConnectionState } from "@/core/websocket/types";
42
+ import { ConnectionState } from "@/core/session/types";
43
43
  import { useAsyncData } from "@/hooks/useAsyncData";
44
44
  import { useLocalStorage } from "@/hooks/useLocalStorage";
45
45
  import { cn } from "@/utils/cn";
@@ -25,7 +25,7 @@ import {
25
25
  import { useInstallPackages } from "@/core/packages/useInstallPackage";
26
26
  import { sandboxAtom, sandboxSyncAtom } from "@/core/packages/sandbox-state";
27
27
  import { store } from "@/core/state/jotai";
28
- import { ConnectionState } from "@/core/websocket/types";
28
+ import { ConnectionState } from "@/core/session/types";
29
29
  import PackagesPanel from "../packages-panel";
30
30
  import { PanelSectionProvider } from "../panel-context";
31
31
  import { RuntimeStatusToggle } from "../runtime-status-toggle";
@@ -11,7 +11,7 @@ import { kernelStartupErrorAtom } from "@/core/errors/state";
11
11
  import { connectionAtom, startupProgressAtom } from "@/core/network/connection";
12
12
  import { requestClientAtom } from "@/core/network/requests";
13
13
  import { sandboxAtom } from "@/core/packages/sandbox-state";
14
- import { WebSocketClosedReason, ConnectionState } from "@/core/websocket/types";
14
+ import { WebSocketClosedReason, ConnectionState } from "@/core/session/types";
15
15
  import PackagesPanel from "../packages-panel";
16
16
  import { PanelSectionProvider } from "../panel-context";
17
17
  import { RuntimeStatusToggle } from "../runtime-status-toggle";
@@ -24,7 +24,7 @@ import {
24
24
  } from "@/core/packages/sandbox-state";
25
25
  import { filenameAtom } from "@/core/saving/file-state";
26
26
  import { store } from "@/core/state/jotai";
27
- import { WebSocketClosedReason, ConnectionState } from "@/core/websocket/types";
27
+ import { WebSocketClosedReason, ConnectionState } from "@/core/session/types";
28
28
  import { chromeAtom } from "../../state";
29
29
  import PackagesPanel from "../packages-panel";
30
30
  import { PanelSectionProvider } from "../panel-context";
@@ -14,17 +14,15 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
14
14
  import { PAIR_CONFIG } from "@/__tests__/fixtures/pair-config";
15
15
  import { TooltipProvider } from "@/components/ui/tooltip";
16
16
  import { toast } from "@/components/ui/use-toast";
17
- import type { Attachment } from "@/core/attachments/state";
17
+ import type { Attachment } from "@/core/notebook/attachments";
18
18
  import { pairConfigAtom } from "@/core/config/pair";
19
- import { createNotebookReplica } from "@/core/host/replica";
20
19
  import {
21
20
  type StableSessionId,
22
21
  stableSessionIdAtom,
23
22
  } from "@/core/kernel/session";
24
23
  import { API } from "@/core/network/api";
25
24
  import { connectionAtom } from "@/core/network/connection";
26
- import { notebookReplicaAtom } from "@/core/websocket/state";
27
- import { ConnectionState } from "@/core/websocket/types";
25
+ import { ConnectionState } from "@/core/session/types";
28
26
  import { Deferred } from "@/utils/Deferred";
29
27
  import { AttachmentStatus } from "../footer-items/attachment-status";
30
28
 
@@ -32,6 +30,10 @@ vi.mock("@/components/ui/use-toast", () => ({ toast: vi.fn() }));
32
30
  vi.mock("@/core/network/api", () => ({ API: { post: vi.fn() } }));
33
31
 
34
32
  const attachmentsAtom = atom<Attachment[]>([]);
33
+ vi.mock("@/core/session/active-notebook", async (importOriginal) => ({
34
+ ...(await importOriginal<typeof import("@/core/session/active-notebook")>()),
35
+ activeNotebookReplicaAtom: atom(() => ({ attachmentsAtom })),
36
+ }));
35
37
 
36
38
  const AGENT: Attachment = {
37
39
  id: "a1",
@@ -45,11 +47,6 @@ function renderStatus(attachments: Attachment[] = [AGENT], preview = true) {
45
47
  const store = createStore();
46
48
  store.set(connectionAtom, { state: ConnectionState.OPEN });
47
49
  store.set(pairConfigAtom, { ...PAIR_CONFIG, hostEnabled: preview });
48
- store.set(notebookReplicaAtom, {
49
- ...createNotebookReplica(store),
50
- connectionAtom: atom({ state: ConnectionState.OPEN }),
51
- attachmentsAtom,
52
- });
53
50
  store.set(attachmentsAtom, attachments);
54
51
  store.set(stableSessionIdAtom, "stable/test" as StableSessionId);
55
52
  return {
@@ -17,10 +17,10 @@ import {
17
17
  } from "@/components/ui/popover";
18
18
  import {
19
19
  type Attachment,
20
- agentAttachmentsAtom,
21
20
  attachmentLabel,
22
- } from "@/core/attachments/state";
23
- import { agentToast } from "@/core/attachments/toast";
21
+ useNotebookAttachments,
22
+ } from "@/core/notebook";
23
+ import { agentToast } from "@/components/editor/agent-toast";
24
24
  import { pairConfigAtom } from "@/core/config/pair";
25
25
  import { stableSessionIdAtom } from "@/core/kernel/session";
26
26
  import { API } from "@/core/network/api";
@@ -29,7 +29,7 @@ import { FooterItem } from "../footer-item";
29
29
 
30
30
  export function AttachmentStatus() {
31
31
  const hostEnabled = useAtomValue(pairConfigAtom)?.hostEnabled;
32
- const agents = useAtomValue(agentAttachmentsAtom);
32
+ const agents = useNotebookAttachments("agent");
33
33
  const [open, setOpen] = useState(false);
34
34
  const previous = useRef(new Set<string>());
35
35
  const automatic = useRef(false);
@@ -14,7 +14,7 @@ import {
14
14
  isAppConnected,
15
15
  isAppConnecting,
16
16
  isAppNotStarted,
17
- } from "@/core/websocket/connection-utils";
17
+ } from "@/core/session/connection-utils";
18
18
  import { useAsyncData } from "@/hooks/useAsyncData";
19
19
  import { useInterval } from "@/hooks/useInterval";
20
20
  import { Strings } from "@/utils/strings";
@@ -14,7 +14,7 @@ import type {
14
14
  LspRestartResponse,
15
15
  } from "@/core/network/types";
16
16
  import { isWasm } from "@/core/wasm/utils";
17
- import { isAppConnected } from "@/core/websocket/connection-utils";
17
+ import { isAppConnected } from "@/core/session/connection-utils";
18
18
  import { useAsyncData } from "@/hooks/useAsyncData";
19
19
  import { useInterval } from "@/hooks/useInterval";
20
20
 
@@ -10,7 +10,7 @@ import { connectionAtom } from "@/core/network/connection";
10
10
  import { useRequestClient } from "@/core/network/requests";
11
11
  import type { UsageResponse } from "@/core/network/types";
12
12
  import { isWasm } from "@/core/wasm/utils";
13
- import { ConnectionState } from "@/core/websocket/types";
13
+ import { ConnectionState } from "@/core/session/types";
14
14
  import { useAsyncData } from "@/hooks/useAsyncData";
15
15
  import { useInterval } from "@/hooks/useInterval";
16
16
  import { cn } from "@/utils/cn";
@@ -20,8 +20,8 @@ import { SaveComponent } from "@/core/saving/save-component";
20
20
  import {
21
21
  getConnectionTooltip,
22
22
  isAppInteractionDisabled,
23
- } from "@/core/websocket/connection-utils";
24
- import { ConnectionState } from "@/core/websocket/types";
23
+ } from "@/core/session/connection-utils";
24
+ import { ConnectionState } from "@/core/session/types";
25
25
  import { cn } from "@/utils/cn";
26
26
  import { Functions } from "@/utils/functions";
27
27
  import {
@@ -26,7 +26,7 @@ import { requestClientAtom } from "@/core/network/requests";
26
26
  import { filenameAtom } from "@/core/saving/file-state";
27
27
  import { store } from "@/core/state/jotai";
28
28
  import { isWasm } from "@/core/wasm/utils";
29
- import { ConnectionState } from "@/core/websocket/types";
29
+ import { ConnectionState } from "@/core/session/types";
30
30
  import {
31
31
  DEFAULT_EXPORT_OPTIONS,
32
32
  exportOptionsAtom,
@@ -16,7 +16,7 @@ import { cellId } from "@/__tests__/branded";
16
16
  import { PAIR_CONFIG } from "@/__tests__/fixtures/pair-config";
17
17
  import { TooltipProvider } from "@/components/ui/tooltip";
18
18
  import { toast } from "@/components/ui/use-toast";
19
- import type { Attachment } from "@/core/attachments/state";
19
+ import type { Attachment } from "@/core/notebook/attachments";
20
20
  import { exportedForTesting, notebookAtom } from "@/core/cells/cells";
21
21
  import {
22
22
  type CellOutputMessage,
@@ -25,7 +25,6 @@ import {
25
25
  } from "@/core/cells/error-report";
26
26
  import { pairConfigAtom } from "@/core/config/pair";
27
27
  import { notebookStateFromSession } from "@/core/cells/session";
28
- import { createNotebookReplica } from "@/core/host/replica";
29
28
  import type { MarimoError, OutputMessage } from "@/core/kernel/messages";
30
29
  import {
31
30
  type StableSessionId,
@@ -33,8 +32,7 @@ import {
33
32
  } from "@/core/kernel/session";
34
33
  import { API } from "@/core/network/api";
35
34
  import { connectionAtom } from "@/core/network/connection";
36
- import { notebookReplicaAtom } from "@/core/websocket/state";
37
- import { ConnectionState } from "@/core/websocket/types";
35
+ import { ConnectionState } from "@/core/session/types";
38
36
  import { Deferred } from "@/utils/Deferred";
39
37
  import { HTTPError } from "@/utils/errors";
40
38
  import { MarimoErrorOutput } from "../../output/MarimoErrorOutput";
@@ -51,6 +49,10 @@ vi.mock("@/components/editor/chrome/wrapper/useOpenAiAssistant", () => ({
51
49
  const CELL_ID = cellId("test-cell");
52
50
  const STABLE_ID = "stable/test" as StableSessionId;
53
51
  const attachmentsAtom = atom<Attachment[]>([]);
52
+ vi.mock("@/core/session/active-notebook", async (importOriginal) => ({
53
+ ...(await importOriginal<typeof import("@/core/session/active-notebook")>()),
54
+ activeNotebookReplicaAtom: atom(() => ({ attachmentsAtom })),
55
+ }));
54
56
 
55
57
  const AGENT: Attachment = {
56
58
  id: "a1",
@@ -97,11 +99,6 @@ function renderButton({
97
99
  const store = createStore();
98
100
  store.set(connectionAtom, { state: ConnectionState.OPEN });
99
101
  store.set(pairConfigAtom, { ...PAIR_CONFIG, hostEnabled: preview });
100
- store.set(notebookReplicaAtom, {
101
- ...createNotebookReplica(store),
102
- connectionAtom: atom({ state: ConnectionState.OPEN }),
103
- attachmentsAtom,
104
- });
105
102
  store.set(attachmentsAtom, attachments);
106
103
  store.set(stableSessionIdAtom, stableId);
107
104
  const wrapper = ({ children }: { children: React.ReactNode }) => (