@marimo-team/islands 0.26.1-dev20 → 0.26.1-dev21

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 (30) hide show
  1. package/dist/{ErrorBoundary-Cx-CwafE.js → ErrorBoundary-C5X_T831.js} +1 -1
  2. package/dist/{code-visibility-CVfXV6fG.js → code-visibility-7FxdzbDq.js} +1 -1
  3. package/dist/{common-BXRJCkJO.js → common-D-iTRwaQ.js} +1 -1
  4. package/dist/{data-grid-overlay-editor-Mbtx3F9C.js → data-grid-overlay-editor-DoWUW2oW.js} +1 -1
  5. package/dist/{feedback-button-zx4NcNDn.js → feedback-button-OUiV15AL.js} +2 -2
  6. package/dist/{glide-data-editor-CvezoJKg.js → glide-data-editor-CFouYM6e.js} +3 -3
  7. package/dist/{globals-CQuPaxzy.js → globals-B_U6Frqj.js} +1 -1
  8. package/dist/main.js +8 -8
  9. package/dist/{number-overlay-editor-DxM7vsCk.js → number-overlay-editor-CiQQjf9m.js} +1 -1
  10. package/dist/{reveal-component-BefmhjJF.js → reveal-component-B73BObRc.js} +2 -2
  11. package/package.json +1 -1
  12. package/src/__mocks__/executions.ts +2 -2
  13. package/src/__tests__/branded.ts +4 -0
  14. package/src/components/editor/cell/__tests__/useRunCells.test.tsx +2 -2
  15. package/src/components/tracing/tracing-keyboard.test.tsx +4 -3
  16. package/src/core/cells/__tests__/runs.test.ts +11 -11
  17. package/src/core/cells/runs.ts +6 -4
  18. package/src/core/cells/session.ts +4 -1
  19. package/src/core/executions/__tests__/atoms.test.ts +2 -2
  20. package/src/core/executions/__tests__/freshness.test.ts +2 -2
  21. package/src/core/executions/__tests__/interrupt.test.ts +2 -1
  22. package/src/core/executions/__tests__/output-lifecycle.test.ts +3 -3
  23. package/src/core/executions/__tests__/output.test.ts +2 -2
  24. package/src/core/executions/__tests__/run.test.ts +2 -2
  25. package/src/core/executions/__tests__/select.test.ts +9 -9
  26. package/src/core/executions/atoms.ts +1 -1
  27. package/src/core/notebook/replica/__tests__/executions.test.ts +9 -7
  28. package/src/core/notebook/replica/__tests__/replica.test.ts +7 -2
  29. package/src/core/transports/__tests__/static.test.ts +2 -1
  30. package/src/core/wasm/bridge.ts +5 -4
@@ -148,7 +148,7 @@ function L(e) {
148
148
  }
149
149
  //#endregion
150
150
  //#region src/components/editor/boundary/ErrorBoundary.tsx
151
- var R = (0, T.lazy)(() => import("./feedback-button-zx4NcNDn.js").then((e) => ({ default: e.FeedbackModal }))), z = (e) => {
151
+ var R = (0, T.lazy)(() => import("./feedback-button-OUiV15AL.js").then((e) => ({ default: e.FeedbackModal }))), z = (e) => {
152
152
  let t = (0, w.c)(2), n;
153
153
  return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ (0, N.jsx)(O, {
154
154
  FallbackComponent: B,
@@ -14,7 +14,7 @@ function y() {
14
14
  return e.warn("Failed to get version from mount config"), null;
15
15
  }
16
16
  }
17
- var b = y() || "0.26.1-dev20", x = a(b), S = a(!0);
17
+ var b = y() || "0.26.1-dev21", x = a(b), S = a(!0);
18
18
  a(null);
19
19
  //#endregion
20
20
  //#region src/core/wasm/state.ts
@@ -33,7 +33,7 @@ import { o as ba } from "./dist-BG-7Qpaj.js";
33
33
  import { a as xa, i as Sa, n as Ca, o as wa, r as Ta, t as Ea } from "./dialog-DGh2HNAO.js";
34
34
  import { t as Da } from "./useAsyncData-P5-Oovhq.js";
35
35
  import { n as W, t as G } from "./objectWithoutPropertiesLoose-BRDcTsfB.js";
36
- import { n as Oa, t as ka } from "./ErrorBoundary-Cx-CwafE.js";
36
+ import { n as Oa, t as ka } from "./ErrorBoundary-C5X_T831.js";
37
37
  import { W as Aa, n as ja } from "./vega-loader.browser-Co9gYE8Z.js";
38
38
  import { a as Ma, n as Na, r as Pa, t as Fa } from "./loader-qPmiRXZd.js";
39
39
  import { t as Ia } from "./useIframeCapabilities-_0KX0nu_.js";
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
2
  import { t } from "./react-Bgs_wQh3.js";
3
3
  import { t as n } from "./react-dom-DdqGVp5N.js";
4
4
  import { c as r, l as i, u as a } from "./data-grid-types-DBNnjiYJ.js";
5
- import { a as o, i as s, n as c, r as l } from "./glide-data-editor-CvezoJKg.js";
5
+ import { a as o, i as s, n as c, r as l } from "./glide-data-editor-CFouYM6e.js";
6
6
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.18.1_marked@15.0.12_react-dom@19.3.1__a94b4518d090e84da26f3a68e82f2953/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",
@@ -4,13 +4,13 @@ import { t as r } from "./react-Bgs_wQh3.js";
4
4
  import { t as i } from "./compiler-runtime-C5KHtL5D.js";
5
5
  import { t as a } from "./copy-icon-BLig0ZKb.js";
6
6
  import { $t as o, D as s, I as c, K as l, O as u, P as d, i as f, in as p, n as m } from "./error-entries-DhI0hGvj.js";
7
- import { n as h, t as ee } from "./globals-CQuPaxzy.js";
7
+ import { n as h, t as ee } from "./globals-B_U6Frqj.js";
8
8
  import { r as g } from "./assertNever-CqwxSD_2.js";
9
9
  import { t as _ } from "./jsx-runtime-D8btoEHk.js";
10
10
  import { Ct as te, m as v, zt as ne } from "./use-restore-focus-BFvwj2Hj.js";
11
11
  import { a as re, i as ie, n as ae, r as oe } from "./dialog-DGh2HNAO.js";
12
12
  import { t as se } from "./useAsyncData-P5-Oovhq.js";
13
- import { t as ce } from "./code-visibility-CVfXV6fG.js";
13
+ import { t as ce } from "./code-visibility-7FxdzbDq.js";
14
14
  //#region src/components/ui/skeleton.tsx
15
15
  var y = /* @__PURE__ */ e(r(), 1), b = i(), x = _(), le = (e) => {
16
16
  let n = (0, b.c)(8), r, i;
@@ -14,7 +14,7 @@ import { t as F } from "./jsx-runtime-D8btoEHk.js";
14
14
  import { d as ae, r as I } from "./use-restore-focus-BFvwj2Hj.js";
15
15
  import { t as oe } from "./useEvent-BoN7U38T.js";
16
16
  import { n as L, t as se } from "./objectWithoutPropertiesLoose-BRDcTsfB.js";
17
- import { t as ce } from "./ErrorBoundary-Cx-CwafE.js";
17
+ import { t as ce } from "./ErrorBoundary-C5X_T831.js";
18
18
  import { A as le, C as ue, D as de, E as fe, F as pe, I as me, L as he, M as ge, N as R, O as z, P as _e, R as ve, S as ye, T as be, _ as xe, a as Se, b as B, c as Ce, d as we, f as V, g as Te, h as Ee, i as De, j as H, k as Oe, l as ke, m as Ae, n as je, o as Me, p as Ne, r as U, s as Pe, t as Fe, u as Ie, v as Le, w as Re, x as ze, y as Be, z as Ve } from "./data-grid-types-DBNnjiYJ.js";
19
19
  //#region ../node_modules/.pnpm/@emotion+memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
20
20
  function He(e) {
@@ -7061,7 +7061,7 @@ function ds(e, t, n, r, i) {
7061
7061
  }
7062
7062
  //#endregion
7063
7063
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.18.1_marked@15.0.12_react-dom@19.3.1__a94b4518d090e84da26f3a68e82f2953/node_modules/@glideapps/glide-data-grid/dist/esm/data-editor/data-editor.js
7064
- var fs = /* @__PURE__ */ e(Tr(), 1), ps = /* @__PURE__ */ e(kr(), 1), ms = W.lazy(async () => await import("./data-grid-overlay-editor-Mbtx3F9C.js")), hs = 0;
7064
+ var fs = /* @__PURE__ */ e(Tr(), 1), ps = /* @__PURE__ */ e(kr(), 1), ms = W.lazy(async () => await import("./data-grid-overlay-editor-DoWUW2oW.js")), hs = 0;
7065
7065
  function gs(e) {
7066
7066
  return (0, fs.default)((0, ps.default)((0, ps.default)(e).filter((e) => e.span !== void 0).map((e) => (0, ao.default)((e.span?.[0] ?? 0) + 1, (e.span?.[1] ?? 0) + 1))));
7067
7067
  }
@@ -9284,7 +9284,7 @@ function Ys(e, t, n, r, i) {
9284
9284
  }
9285
9285
  //#endregion
9286
9286
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.18.1_marked@15.0.12_react-dom@19.3.1__a94b4518d090e84da26f3a68e82f2953/node_modules/@glideapps/glide-data-grid/dist/esm/cells/number-cell.js
9287
- var Xs = W.lazy(async () => await import("./number-overlay-editor-DxM7vsCk.js")), Zs = {
9287
+ var Xs = W.lazy(async () => await import("./number-overlay-editor-CiQQjf9m.js")), Zs = {
9288
9288
  getAccessibilityString: (e) => e.data?.toString() ?? "",
9289
9289
  kind: U.Number,
9290
9290
  needsHover: (e) => e.hoverEffect === !0,
@@ -1,6 +1,6 @@
1
1
  import { h as e } from "./tooltip-D0h-ZJ6j.js";
2
2
  import { Ct as t } from "./use-restore-focus-BFvwj2Hj.js";
3
- import { r as n } from "./code-visibility-CVfXV6fG.js";
3
+ import { r as n } from "./code-visibility-7FxdzbDq.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
@@ -6,7 +6,7 @@ import { i as x, n as S, r as C, t as w } from "./copy-icon-BLig0ZKb.js";
6
6
  import { B as T, Bt as E, Ct as D, E as O, F as k, Ft as A, I as j, It as M, L as N, Lt as P, M as F, Mt as I, O as L, Ot as R, P as z, R as B, Rt as ee, St as te, Ut as ne, Vt as re, Wt as ie, X as ae, Z as oe, _ as se, _t as ce, a as le, at as ue, b as de, bt as fe, c as pe, ct as me, dt as he, i as ge, it as _e, j as ve, kt as ye, lt as be, mt as xe, n as Se, o as Ce, ot as we, q as Te, rt as Ee, ut as De, vt as Oe, yt as ke, z as Ae, zt as je } from "./html-to-image-B803aaWE.js";
7
7
  import { a as Me, f as Ne, h as Pe, i as Fe, m as Ie, n as Le, o as Re, r as ze, t as Be } from "./tooltip-D0h-ZJ6j.js";
8
8
  import { D as Ve, E as He, S as Ue, T as We, _ as Ge, a as Ke, c as qe, d as Je, f as Ye, g as Xe, h as Ze, i as Qe, l as $e, m as et, n as tt, o as nt, p as rt, r as it, s as at, t as ot, u as st, v as ct, w as lt, x as ut, y as dt } from "./spec-ayzaXGVq.js";
9
- import { $ as ft, $t as pt, A as mt, An as ht, At as gt, B as _t, Bt as vt, C as yt, D as bt, Dn as xt, Dt as St, E as Ct, En as wt, Et as Tt, F as Et, Ft as Dt, G as Ot, Gt as kt, H as At, Ht as jt, I as Mt, It as Nt, J as Pt, Jt as Ft, K as It, Kt as Lt, L as Rt, Lt as zt, M as Bt, Mn as Vt, Mt as Ht, N as Ut, Nt as Wt, O as Gt, On as Kt, Ot as qt, P as Jt, Pt as Yt, Q as Xt, Qt as Zt, R as Qt, Rt as $t, S as en, Sn as tn, St as nn, T as rn, Tn as an, Tt as on, U as sn, Ut as cn, V as ln, Vt as un, W as dn, Wt as fn, X as pn, Xt as mn, Y as hn, Yt as gn, Z as _n, Zt as vn, _ as yn, _n as bn, _t as xn, an as Sn, at as Cn, b as wn, bn as Tn, bt as En, c as Dn, cn as On, ct as kn, d as An, dn as jn, dt as Mn, en as Nn, f as Pn, fn as Fn, ft as In, g as Ln, gn as Rn, gt as zn, h as Bn, hn as Vn, ht as Hn, in as Un, it as Wn, j as Gn, jn as Kn, jt as qn, k as Jn, kn as Yn, kt as Xn, ln as Zn, lt as Qn, m as $n, mn as er, mt as tr, nn as nr, on as rr, ot as ir, p as ar, pn as or, pt as sr, q as cr, qt as lr, r as ur, rn as dr, rt as fr, sn as pr, st as mr, t as hr, tn as gr, u as _r, un as vr, ut as yr, v as br, vn as xr, vt as Sr, w as Cr, wn as wr, x as Tr, xn as Er, xt as Dr, y as Or, yn as kr, yt as Ar, z as jr, zt as Mr } from "./common-BXRJCkJO.js";
9
+ import { $ as ft, $t as pt, A as mt, An as ht, At as gt, B as _t, Bt as vt, C as yt, D as bt, Dn as xt, Dt as St, E as Ct, En as wt, Et as Tt, F as Et, Ft as Dt, G as Ot, Gt as kt, H as At, Ht as jt, I as Mt, It as Nt, J as Pt, Jt as Ft, K as It, Kt as Lt, L as Rt, Lt as zt, M as Bt, Mn as Vt, Mt as Ht, N as Ut, Nt as Wt, O as Gt, On as Kt, Ot as qt, P as Jt, Pt as Yt, Q as Xt, Qt as Zt, R as Qt, Rt as $t, S as en, Sn as tn, St as nn, T as rn, Tn as an, Tt as on, U as sn, Ut as cn, V as ln, Vt as un, W as dn, Wt as fn, X as pn, Xt as mn, Y as hn, Yt as gn, Z as _n, Zt as vn, _ as yn, _n as bn, _t as xn, an as Sn, at as Cn, b as wn, bn as Tn, bt as En, c as Dn, cn as On, ct as kn, d as An, dn as jn, dt as Mn, en as Nn, f as Pn, fn as Fn, ft as In, g as Ln, gn as Rn, gt as zn, h as Bn, hn as Vn, ht as Hn, in as Un, it as Wn, j as Gn, jn as Kn, jt as qn, k as Jn, kn as Yn, kt as Xn, ln as Zn, lt as Qn, m as $n, mn as er, mt as tr, nn as nr, on as rr, ot as ir, p as ar, pn as or, pt as sr, q as cr, qt as lr, r as ur, rn as dr, rt as fr, sn as pr, st as mr, t as hr, tn as gr, u as _r, un as vr, ut as yr, v as br, vn as xr, vt as Sr, w as Cr, wn as wr, x as Tr, xn as Er, xt as Dr, y as Or, yn as kr, yt as Ar, z as jr, zt as Mr } from "./common-D-iTRwaQ.js";
10
10
  import { a as Nr, n as Pr, s as Fr, t as Ir } from "./useLifecycle-CE0yGTMF.js";
11
11
  import { t as Lr } from "./check-D9vf6LYF.js";
12
12
  import { A as Rr, C as zr, D as Br, M as Vr, O as Hr, a as Ur, c as Wr, d as Gr, i as Kr, k as qr, l as Jr, n as Yr, o as Xr, r as Zr, s as Qr, t as $r, w as ei, x as ti } from "./select-CvorIE3l.js";
@@ -16,7 +16,7 @@ import { $t as Ui, At as Wi, B as Gi, Ct as Ki, D as qi, Dt as Ji, Ft as Yi, G a
16
16
  import { a as Na, d as Pa, i as Fa, n as Ia, o as La, r as Ra, s as za, t as Ba, u as Va } from "./process-output-CnCLfvnL.js";
17
17
  import { t as Ha } from "./pencil-CHkdsX07.js";
18
18
  import { a as Ua, c as Wa, d as Ga, f as Ka, i as qa, l as Ja, r as Ya } from "./glide-utils-bKdvDwwo.js";
19
- import { n as Xa, t as Za } from "./globals-CQuPaxzy.js";
19
+ import { n as Xa, t as Za } from "./globals-B_U6Frqj.js";
20
20
  import { a as Qa, i as $a, n as eo, r as to, s as no, t as ro } from "./assertNever-CqwxSD_2.js";
21
21
  import { t as io } from "./react-dom-DdqGVp5N.js";
22
22
  import { t as ao } from "./jsx-runtime-D8btoEHk.js";
@@ -40,10 +40,10 @@ import { n as rc, t as ic } from "./esm-Dw2ZydG_.js";
40
40
  import { p as ac } from "./dist-BidYR5m4.js";
41
41
  import { t as oc } from "./useAsyncData-P5-Oovhq.js";
42
42
  import { n as sc, r as cc, t as lc } from "./useDeepCompareMemoize-D-Pbv7dN.js";
43
- import { t as uc } from "./ErrorBoundary-Cx-CwafE.js";
43
+ import { t as uc } from "./ErrorBoundary-C5X_T831.js";
44
44
  import { G as dc, W as fc } from "./vega-loader.browser-Co9gYE8Z.js";
45
45
  import { a as pc, n as mc } from "./loader-qPmiRXZd.js";
46
- import { a as hc, c as gc, i as _c, l as vc, o as yc, s as bc, t as xc } from "./code-visibility-CVfXV6fG.js";
46
+ import { a as hc, c as gc, i as _c, l as vc, o as yc, s as bc, t as xc } from "./code-visibility-7FxdzbDq.js";
47
47
  import { t as Sc } from "./esm-DY8dGAjJ.js";
48
48
  //#region ../node_modules/.pnpm/iconify-icon@2.3.0/node_modules/iconify-icon/dist/iconify-icon.mjs
49
49
  var Cc = Object.freeze({
@@ -3065,7 +3065,7 @@ var Wp = Lp({ offset: !0 }).describe("A date and time with its offset from UTC,
3065
3065
  event: H(["attachment"]),
3066
3066
  id: K().min(1).optional().describe("The resume cursor. Omitted on snapshot and reset events."),
3067
3067
  data: km
3068
- }).describe("The `attachment` event, carried by the catalog and notebook streams."), jm = K().min(1).describe("Identifies a run independently of the request's `Idempotency-Key`. Events carry the key in `request_id`."), Mm = G({
3068
+ }).describe("The `attachment` event, carried by the catalog and notebook streams."), jm = K().min(1).describe("Identifies a run independently of the request's `Idempotency-Key`. Events carry the key in `request_id`.").brand("RunId"), Mm = G({
3069
3069
  kind: H(["cells"]),
3070
3070
  cell_ids: V(rm).min(1).describe("The cells the run was requested for. Fixed when the run is accepted, so a client can tell which cells a queued run will reach before the runtime has planned their executions. Each one's execution in this run reports the fingerprint of the source accepted for it.")
3071
3071
  }), Nm = G({
@@ -3315,7 +3315,7 @@ var Wp = Lp({ offset: !0 }).describe("A date and time with its offset from UTC,
3315
3315
  }).describe("The `attachment.removed` event, carried by the catalog and notebook streams."), Hh = G({
3316
3316
  event: H(["run.removed"]),
3317
3317
  id: K().min(1).optional().describe("The resume cursor. Omitted on snapshot and reset events."),
3318
- data: Ih
3318
+ data: Ih.extend({ id: jm })
3319
3319
  }).describe("The `run.removed` event, carried by the notebook stream."), Uh = G({
3320
3320
  event: H(["execution.removed"]),
3321
3321
  id: K().min(1).optional().describe("The resume cursor. Omitted on snapshot and reset events."),
@@ -13024,7 +13024,7 @@ function BO(e, t) {
13024
13024
  }
13025
13025
  //#endregion
13026
13026
  //#region src/plugins/impl/DataEditorPlugin.tsx
13027
- var VO = J.lazy(() => import("./glide-data-editor-CvezoJKg.js").then((e) => e.t)), HO = SD("marimo-data-editor", { cssStyles: [GD, KD] }).withData(G({
13027
+ var VO = J.lazy(() => import("./glide-data-editor-CFouYM6e.js").then((e) => e.t)), HO = SD("marimo-data-editor", { cssStyles: [GD, KD] }).withData(G({
13028
13028
  initialValue: G({ edits: V(G({
13029
13029
  rowIdx: W(),
13030
13030
  columnId: K(),
@@ -32747,7 +32747,7 @@ function UU(e) {
32747
32747
  }
32748
32748
  //#endregion
32749
32749
  //#region src/components/editor/renderers/slides-layout/slides-layout.tsx
32750
- var WU = J.lazy(() => import("./reveal-component-BefmhjJF.js")), GU = (e) => {
32750
+ var WU = J.lazy(() => import("./reveal-component-B73BObRc.js")), GU = (e) => {
32751
32751
  let t = (0, X.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = Ts(Gs), s = a === "read" || o, c = Ts(Ca) > 1, [l, u] = (0, J.useState)(null), d;
32752
32752
  t[0] !== i || t[1] !== n ? (d = Vz(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
32753
32753
  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-BPCzCO3I.js";
2
2
  import { t } from "./react-Bgs_wQh3.js";
3
- import { a as n } from "./glide-data-editor-CvezoJKg.js";
3
+ import { a as n } from "./glide-data-editor-CFouYM6e.js";
4
4
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.18.1_marked@15.0.12_react-dom@19.3.1__a94b4518d090e84da26f3a68e82f2953/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",
@@ -3,14 +3,14 @@ import { g as t, h as n, m as r, r as i, t as a } from "./button-Z2R2272J.js";
3
3
  import { t as o } from "./react-Bgs_wQh3.js";
4
4
  import { t as s } from "./compiler-runtime-C5KHtL5D.js";
5
5
  import { h as c, t as l } from "./tooltip-D0h-ZJ6j.js";
6
- import { Cn as u, En as d, Sn as f, dn as p, et as m, f as h, i as g, l as _, n as v, nt as y, r as b, t as x, tt as S, u as C } from "./common-BXRJCkJO.js";
6
+ import { Cn as u, En as d, Sn as f, dn as p, et as m, f as h, i as g, l as _, n as v, nt as y, r as b, t as x, tt as S, u as C } from "./common-D-iTRwaQ.js";
7
7
  import { M as w } from "./select-CvorIE3l.js";
8
8
  import { X as T } from "./dropdown-menu-ChH3oiqI.js";
9
9
  import { t as E } from "./jsx-runtime-D8btoEHk.js";
10
10
  import { Ht as D, f as O, i as k, zt as A } from "./use-restore-focus-BFvwj2Hj.js";
11
11
  import { t as j } from "./useEvent-BoN7U38T.js";
12
12
  import { o as ee } from "./static-state-CqwW3B_X.js";
13
- import { n as te, t as ne } from "./code-visibility-CVfXV6fG.js";
13
+ import { n as te, t as ne } from "./code-visibility-7FxdzbDq.js";
14
14
  /* empty css */
15
15
  var M = c("sticky-note", [["path", {
16
16
  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.26.1-dev20",
3
+ "version": "0.26.1-dev21",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -2,7 +2,7 @@
2
2
 
3
3
  /** Executions as the host would report them, for tests that read cell status. */
4
4
 
5
- import { cellId } from "@/__tests__/branded";
5
+ import { cellId, runId } from "@/__tests__/branded";
6
6
  import type * as Protocol from "@marimo-team/client/protocol";
7
7
  import { atom, type createStore } from "jotai";
8
8
  import type { CellExecutionInputs } from "@/core/executions";
@@ -62,7 +62,7 @@ function execution(
62
62
  sequence += 1;
63
63
  return {
64
64
  id: `e${sequence}`,
65
- run_id: "run-1",
65
+ run_id: runId("run-1"),
66
66
  runtime_id: "r1",
67
67
  caused_by_id: null,
68
68
  cell_id: cid === null ? null : cellId(cid),
@@ -10,6 +10,7 @@
10
10
  * everywhere.
11
11
  */
12
12
 
13
+ import type { RunId } from "@marimo-team/client/protocol";
13
14
  import type { components } from "@marimo-team/marimo-api";
14
15
  import type { CellId, UIElementId } from "@/core/cells/ids";
15
16
  import type { RequestId } from "@/core/network/DeferredRequestRegistry";
@@ -18,7 +19,10 @@ import type { VariableName } from "@/core/variables/types";
18
19
  type WidgetModelId = components["schemas"]["WidgetModelId"];
19
20
  type Base64String = components["schemas"]["Base64String"];
20
21
 
22
+ // SAFETY: The fixture author supplies a valid value for each brand, such as
23
+ // the nonempty ID of the run represented in the fixture.
21
24
  export const cellId = (s: string) => s as CellId;
25
+ export const runId = (s: string) => s as RunId;
22
26
  export const variableName = (s: string) => s as VariableName;
23
27
  export const requestId = (s: string) => s as RequestId;
24
28
  export const uiElementId = (s: string) => s as UIElementId;
@@ -7,7 +7,7 @@ import type { ReactNode } from "react";
7
7
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
8
8
  import { MockExecutions } from "@/__mocks__/executions";
9
9
  import { MockNotebook } from "@/__mocks__/notebook";
10
- import { cellId } from "@/__tests__/branded";
10
+ import { cellId, runId } from "@/__tests__/branded";
11
11
  import { notebookAtom } from "@/core/cells/cells";
12
12
  import type { DocumentModel } from "@/core/notebook/document";
13
13
  import {
@@ -37,7 +37,7 @@ const wrapper = ({ children }: { children: ReactNode }) => (
37
37
 
38
38
  function accepted(cells: string[]): Protocol.RunOutput {
39
39
  return {
40
- id: "run-1",
40
+ id: runId("run-1"),
41
41
  notebook_id: "n1",
42
42
  runtime_id: "r1",
43
43
  origin: { kind: "cells", cell_ids: cells.map(cellId) },
@@ -1,10 +1,11 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
+ import { runId } from "@/__tests__/branded";
3
4
  import { act, fireEvent, render, screen } from "@testing-library/react";
4
5
  import { createStore, Provider } from "jotai";
5
6
  import { describe, expect, it, vi } from "vitest";
6
7
  import { TooltipProvider } from "@/components/ui/tooltip";
7
- import { type Run, type RunId, runsAtom } from "@/core/cells/runs";
8
+ import { type Run, runsAtom } from "@/core/cells/runs";
8
9
  import { Tracing } from "./tracing";
9
10
 
10
11
  vi.mock("react-vega", () => ({ useVegaEmbed: () => undefined }));
@@ -14,7 +15,7 @@ vi.mock("@/components/editor/chrome/panels/panel-context", () => ({
14
15
  }));
15
16
 
16
17
  const run: Run = {
17
- runId: "run-1" as RunId,
18
+ runId: runId("run-1"),
18
19
  runStartTime: 1_704_067_200,
19
20
  cellRuns: new Map(),
20
21
  };
@@ -67,7 +68,7 @@ describe("trace disclosure keyboard focus", () => {
67
68
  act(() => header.focus());
68
69
  const newer: Run = {
69
70
  ...run,
70
- runId: "run-2" as RunId,
71
+ runId: runId("run-2"),
71
72
  runStartTime: run.runStartTime + 1,
72
73
  };
73
74
  act(() => {
@@ -1,13 +1,12 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
3
  import { describe, expect, it } from "vitest";
4
- import { cellId } from "@/__tests__/branded";
4
+ import { cellId, runId } from "@/__tests__/branded";
5
5
  import type { ExecutionOutput as Execution } from "@marimo-team/client/protocol";
6
6
  import {
7
7
  exportedForTesting,
8
8
  MAX_CODE_LENGTH,
9
9
  MAX_RUNS,
10
- type RunId,
11
10
  type RunsState,
12
11
  } from "../runs";
13
12
 
@@ -15,7 +14,7 @@ const { reducer, initialState, isPureMarkdown } = exportedForTesting;
15
14
 
16
15
  const queued = {
17
16
  id: "e1",
18
- run_id: "r1",
17
+ run_id: runId("r1"),
19
18
  runtime_id: "runtime",
20
19
  caused_by_id: null,
21
20
  cell_id: cellId("cell"),
@@ -45,7 +44,6 @@ describe("execution traces", () => {
45
44
  status: "completed",
46
45
  outcome: { kind: "cancelled" },
47
46
  } satisfies Execution["state"];
48
- const runId = "r1" as RunId;
49
47
  const running = observe(observe(initialState()), {
50
48
  state: { started_at, status: "running" },
51
49
  });
@@ -53,7 +51,9 @@ describe("execution traces", () => {
53
51
  observe(running, { state: completed }),
54
52
  observe(initialState(), { state: completed }),
55
53
  ]) {
56
- expect(state.runMap.get(runId)?.cellRuns.get(cellId("cell"))).toEqual({
54
+ expect(
55
+ state.runMap.get(queued.run_id)?.cellRuns.get(cellId("cell")),
56
+ ).toEqual({
57
57
  cellId: "cell",
58
58
  executionId: "e1",
59
59
  code: "print(1)",
@@ -66,7 +66,7 @@ describe("execution traces", () => {
66
66
  observe(running, {
67
67
  state: { ...completed, outcome: { kind: "succeeded" } },
68
68
  })
69
- .runMap.get(runId)
69
+ .runMap.get(queued.run_id)
70
70
  ?.cellRuns.get(cellId("cell"))?.status,
71
71
  ).toBe("success");
72
72
  });
@@ -89,7 +89,7 @@ describe("execution traces", () => {
89
89
  },
90
90
  });
91
91
  expect(
92
- state.runMap.get("r1" as RunId)?.cellRuns.get(cellId("cell"))?.status,
92
+ state.runMap.get(queued.run_id)?.cellRuns.get(cellId("cell"))?.status,
93
93
  ).toBe("skipped");
94
94
  },
95
95
  );
@@ -109,7 +109,7 @@ describe("execution traces", () => {
109
109
  },
110
110
  });
111
111
  expect(
112
- next.runMap.get("r1" as RunId)?.cellRuns.get(cellId("cell"))?.code,
112
+ next.runMap.get(queued.run_id)?.cellRuns.get(cellId("cell"))?.code,
113
113
  ).toBe(preview);
114
114
  }
115
115
  });
@@ -119,13 +119,13 @@ describe("execution traces", () => {
119
119
  for (let i = 0; i <= MAX_RUNS; i++) {
120
120
  state = observe(
121
121
  state,
122
- { run_id: String(i) },
122
+ { run_id: runId(String(i)) },
123
123
  "x".repeat(MAX_CODE_LENGTH + 1),
124
124
  );
125
125
  }
126
126
  expect(state.runMap.size).toBe(MAX_RUNS);
127
127
  expect(state.runIds[0]).toBe(String(MAX_RUNS));
128
- expect(state.runMap.has("0" as RunId)).toBe(false);
128
+ expect(state.runMap.has(runId("0"))).toBe(false);
129
129
  expect(
130
130
  state.runMap.get(state.runIds[0])?.cellRuns.get(cellId("cell"))?.code
131
131
  .length,
@@ -148,7 +148,7 @@ describe("execution traces", () => {
148
148
  expect(observe(initial, {}, markdown)).toBe(initial);
149
149
  expect(
150
150
  observe(observe(initial), { cell_id: cellId("md") }, markdown).runMap.get(
151
- "r1" as RunId,
151
+ queued.run_id,
152
152
  )?.cellRuns.size,
153
153
  ).toBe(2);
154
154
  });
@@ -1,10 +1,12 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
  import { createReducerAndAtoms } from "@/utils/createReducer";
3
- import type { TypedString } from "@/utils/typed";
4
- import type { ExecutionOutput as Execution } from "@marimo-team/client/protocol";
3
+ import type {
4
+ ExecutionOutput as Execution,
5
+ RunId,
6
+ } from "@marimo-team/client/protocol";
5
7
  import { completedAt, startedAt } from "@/core/notebook/replica";
6
8
  import type { CellId } from "./ids";
7
- export type RunId = TypedString<"RunId">;
9
+ export type { RunId };
8
10
 
9
11
  export interface CellRun {
10
12
  cellId: CellId;
@@ -75,7 +77,7 @@ const {
75
77
  if (record.run_id === null || record.cell_id === null) {
76
78
  return state;
77
79
  }
78
- const runId = record.run_id as RunId;
80
+ const runId = record.run_id;
79
81
  const cellId = record.cell_id;
80
82
  const previous = state.runMap.get(runId);
81
83
  if (previous === undefined && code !== undefined && isPureMarkdown(code)) {
@@ -16,6 +16,9 @@ import { type CellRuntimeState, createCellRuntimeState } from "./types";
16
16
 
17
17
  /** The identity of a snapshot the page carries. A host's own stream replaces it. */
18
18
  export const EMBEDDED = "embedded";
19
+ // SAFETY: This snapshot assigns one synthetic run ID to all its restored
20
+ // executions. The fixed suffix satisfies RunId's nonempty-string requirement.
21
+ const EMBEDDED_RUN_ID = `${EMBEDDED}:run` as Protocol.RunId;
19
22
 
20
23
  // Constants
21
24
  const DEFAULT_TIMESTAMP = 0;
@@ -261,7 +264,7 @@ function resultRecord(
261
264
  return {
262
265
  execution: {
263
266
  id,
264
- run_id: `${EMBEDDED}:run`,
267
+ run_id: EMBEDDED_RUN_ID,
265
268
  runtime_id: EMBEDDED,
266
269
  caused_by_id: null,
267
270
  cell_id: cell.id,
@@ -3,7 +3,7 @@
3
3
  import { createStore } from "jotai";
4
4
  import { describe, expect, it } from "vitest";
5
5
  import { MockExecutions } from "@/__mocks__/executions";
6
- import { cellId } from "@/__tests__/branded";
6
+ import { cellId, runId } from "@/__tests__/branded";
7
7
  import type * as Protocol from "@marimo-team/client/protocol";
8
8
  import {
9
9
  document as documentOf,
@@ -31,7 +31,7 @@ function run(
31
31
  id = "run-1",
32
32
  ): Protocol.RunOutput {
33
33
  return {
34
- id,
34
+ id: runId(id),
35
35
  notebook_id: "n1",
36
36
  runtime_id: "r1",
37
37
  origin: { kind: "cells", cell_ids: cells },
@@ -4,7 +4,7 @@ import type * as Protocol from "@marimo-team/client/protocol";
4
4
  import { describe, expect, it } from "vitest";
5
5
  import type { Execution, Executions, Result } from "@/core/notebook/replica";
6
6
  import { type CellFreshnessInputs, freshnessOf } from "../freshness";
7
- import { cellId } from "@/__tests__/branded";
7
+ import { cellId, runId } from "@/__tests__/branded";
8
8
 
9
9
  const C3 = cellId("c3");
10
10
  const FIXTURE_CELL = cellId("k7f2");
@@ -63,7 +63,7 @@ function record(
63
63
  },
64
64
  ): Protocol.ExecutionOutput {
65
65
  return {
66
- run_id: "run-1",
66
+ run_id: runId("run-1"),
67
67
  runtime_id: "r1",
68
68
  caused_by_id: null,
69
69
  created_at: null,
@@ -1,5 +1,6 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
+ import { runId } from "@/__tests__/branded";
3
4
  import type { ProblemOf } from "@marimo-team/client";
4
5
  import type * as Protocol from "@marimo-team/client/protocol";
5
6
  import { createStore } from "jotai";
@@ -25,7 +26,7 @@ function run(
25
26
  runtimeId = "r1",
26
27
  ): Protocol.RunOutput {
27
28
  return {
28
- id,
29
+ id: runId(id),
29
30
  notebook_id: "n1",
30
31
  runtime_id: runtimeId,
31
32
  origin: { kind: "code", code: "pass" },
@@ -6,7 +6,7 @@ import type * as Protocol from "@marimo-team/client/protocol";
6
6
  import { createStore } from "jotai";
7
7
  import { describe, expect, it, onTestFinished, vi } from "vitest";
8
8
  import { MockExecutions } from "@/__mocks__/executions";
9
- import { cellId } from "@/__tests__/branded";
9
+ import { cellId, runId } from "@/__tests__/branded";
10
10
  import { createNotebookReplica } from "@/core/notebook/replica";
11
11
  import {
12
12
  fakeBackend,
@@ -116,8 +116,8 @@ describe("output lifetime", () => {
116
116
  const { store, snapshot, message, reconnect } = await setup();
117
117
  const result = MockExecutions.shown(C1, text("A"));
118
118
  snapshot(result);
119
- const run: Protocol.Run = {
120
- id: "missed",
119
+ const run: Protocol.RunOutput = {
120
+ id: runId("missed"),
121
121
  notebook_id: "n1",
122
122
  runtime_id: "r1",
123
123
  origin: { kind: "cells", cell_ids: [C1] },
@@ -3,7 +3,7 @@
3
3
  import type * as Protocol from "@marimo-team/client/protocol";
4
4
  import { describe, expect, it } from "vitest";
5
5
  import { type ExecutionEntries, MockExecutions } from "@/__mocks__/executions";
6
- import { cellId } from "@/__tests__/branded";
6
+ import { cellId, runId } from "@/__tests__/branded";
7
7
  import { cell } from "@/core/notebook/document/__tests__/fixtures";
8
8
  import {
9
9
  type CellOutputInputs,
@@ -321,7 +321,7 @@ describe("scratchOutputView", () => {
321
321
  expect(
322
322
  scratchOutputView({
323
323
  ...executions,
324
- scratchFailure: { ...failure, runId: "run-2" },
324
+ scratchFailure: { ...failure, runId: runId("run-2") },
325
325
  })?.data,
326
326
  ).toEqual([
327
327
  { type: "unknown", msg: "Kernel channel closed", error_type: null },
@@ -4,7 +4,7 @@ import type * as Protocol from "@marimo-team/client/protocol";
4
4
  import { atom } from "jotai";
5
5
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
6
6
  import { MockExecutions } from "@/__mocks__/executions";
7
- import { cellId } from "@/__tests__/branded";
7
+ import { cellId, runId } from "@/__tests__/branded";
8
8
  import type { DocumentModel, EditableDocument } from "@/core/notebook/document";
9
9
  import {
10
10
  cell,
@@ -36,7 +36,7 @@ const C2 = cellId("c2");
36
36
 
37
37
  function accepted(cells: string[]): Protocol.RunOutput {
38
38
  return {
39
- id: "run-1",
39
+ id: runId("run-1"),
40
40
  notebook_id: "n1",
41
41
  runtime_id: "r1",
42
42
  origin: { kind: "cells", cell_ids: cells.map(cellId) },
@@ -13,7 +13,7 @@ import {
13
13
  queuedOrRunningCount,
14
14
  runningCellIds,
15
15
  } from "../select";
16
- import { cellId } from "@/__tests__/branded";
16
+ import { cellId, runId } from "@/__tests__/branded";
17
17
 
18
18
  const C1 = cellId("c1");
19
19
  const C2 = cellId("c2");
@@ -53,7 +53,7 @@ function record(
53
53
  overrides: Partial<Protocol.ExecutionOutput> & { id: string },
54
54
  ): Protocol.ExecutionOutput {
55
55
  return {
56
- run_id: "run-1",
56
+ run_id: runId("run-1"),
57
57
  runtime_id: "r1",
58
58
  caused_by_id: null,
59
59
  cell_id: C1,
@@ -88,7 +88,7 @@ function run(
88
88
  id = "run-1",
89
89
  ): Protocol.RunOutput {
90
90
  return {
91
- id,
91
+ id: runId(id),
92
92
  notebook_id: "n1",
93
93
  runtime_id: "r1",
94
94
  origin: { kind: "cells", cell_ids: cells.map(cellId) },
@@ -303,7 +303,7 @@ describe("cellExecutionView", () => {
303
303
  executions: [
304
304
  execution({
305
305
  id: "e2",
306
- run_id: "run-2",
306
+ run_id: runId("run-2"),
307
307
  state: RUNNING,
308
308
  }),
309
309
  ],
@@ -313,8 +313,8 @@ describe("cellExecutionView", () => {
313
313
 
314
314
  const done = inputs({
315
315
  runs: [run(["c1", "c2"], "running", "run-2")],
316
- executions: [execution({ id: "e2", run_id: "run-2" })],
317
- results: new Map([[C1, execution({ id: "e2", run_id: "run-2" })]]),
316
+ executions: [execution({ id: "e2", run_id: runId("run-2") })],
317
+ results: new Map([[C1, execution({ id: "e2", run_id: runId("run-2") })]]),
318
318
  });
319
319
  expect(cellExecutionView(done, C1).status).toBe("idle");
320
320
  expect(cellExecutionView(done, C1).outcome).toBe("succeeded");
@@ -323,7 +323,7 @@ describe("cellExecutionView", () => {
323
323
  // The stream let the execution go while its run goes on with other cells.
324
324
  const retained = inputs({
325
325
  runs: [run(["c1", "c2"], "running", "run-2")],
326
- results: new Map([[C1, execution({ id: "e2", run_id: "run-2" })]]),
326
+ results: new Map([[C1, execution({ id: "e2", run_id: runId("run-2") })]]),
327
327
  });
328
328
  expect(cellExecutionView(retained, C1).status).toBe("idle");
329
329
  expect(cellExecutionView(retained, C2).status).toBe("queued");
@@ -331,8 +331,8 @@ describe("cellExecutionView", () => {
331
331
  // A later run names the cell again while the earlier one's result stands.
332
332
  const again = inputs({
333
333
  runs: [run(["c1"], "running", "run-2"), run(["c1"], "queued", "run-3")],
334
- executions: [execution({ id: "e2", run_id: "run-2" })],
335
- results: new Map([[C1, execution({ id: "e2", run_id: "run-2" })]]),
334
+ executions: [execution({ id: "e2", run_id: runId("run-2") })],
335
+ results: new Map([[C1, execution({ id: "e2", run_id: runId("run-2") })]]),
336
336
  });
337
337
  expect(cellExecutionView(again, C1).status).toBe("queued");
338
338
 
@@ -380,7 +380,7 @@ export function withdrawRequest(store: Store, request: RunRequest): void {
380
380
  export function acceptRun(
381
381
  store: Store,
382
382
  request: RunRequest,
383
- run: Protocol.Run,
383
+ run: Protocol.RunOutput,
384
384
  ): void {
385
385
  const waitingAtom = atom(
386
386
  (get) =>
@@ -5,7 +5,7 @@ import * as Protocol from "@marimo-team/client/protocol";
5
5
  import { executions, itemsInOrder } from "../resources/executions";
6
6
  import { createNotebookReducer } from "@marimo-team/client";
7
7
  import { fixtureEvents } from "./fixtures";
8
- import { cellId } from "@/__tests__/branded";
8
+ import { cellId, runId } from "@/__tests__/branded";
9
9
 
10
10
  const C3 = cellId("c3");
11
11
 
@@ -49,19 +49,21 @@ describe("executions resource", () => {
49
49
  expect(itemsInOrder(scratch!).map((item) => item.kind)).toEqual([
50
50
  "console",
51
51
  ]);
52
- expect(opening.runs.get("run-scratch")?.state.status).toBe("running");
52
+ expect(opening.runs.get(runId("run-scratch"))?.state.status).toBe(
53
+ "running",
54
+ );
53
55
  expect(opening.latest.size).toBe(0);
54
56
 
55
57
  const done = resource(replay(snapshot));
56
58
  expect(done.executions.get("e7")?.record.state.status).toBe("completed");
57
- expect(done.runs.get("run-scratch")?.state).toMatchObject({
59
+ expect(done.runs.get(runId("run-scratch"))?.state).toMatchObject({
58
60
  outcome: { kind: "succeeded" },
59
61
  });
60
62
  const released = reducer.reduce(
61
63
  replay(snapshot),
62
64
  removed("run", "run-scratch", "98"),
63
65
  );
64
- expect(resource(released).runs.has("run-scratch")).toBe(false);
66
+ expect(resource(released).runs.has(runId("run-scratch"))).toBe(false);
65
67
  });
66
68
 
67
69
  it("indexes a cell's execution while it is on the stream", () => {
@@ -70,7 +72,7 @@ describe("executions resource", () => {
70
72
  expect(running.latest.get(C3)).toBe("e12");
71
73
  expect(running.executions.get("e12")?.record.state.status).toBe("running");
72
74
  expect(running.latest.get(cellId("k7f2"))).toBe("e13");
73
- expect(running.runs.get("run-cells")?.state.status).toBe("running");
75
+ expect(running.runs.get(runId("run-cells"))?.state.status).toBe("running");
74
76
 
75
77
  const done = replay(runCells, start);
76
78
  const e12 = resource(done).executions.get("e12");
@@ -82,7 +84,7 @@ describe("executions resource", () => {
82
84
  x: { execution_id: "e12", update: 0 },
83
85
  },
84
86
  );
85
- expect(resource(done).runs.get("run-cells")?.state).toMatchObject({
87
+ expect(resource(done).runs.get(runId("run-cells"))?.state).toMatchObject({
86
88
  outcome: { kind: "succeeded" },
87
89
  });
88
90
 
@@ -175,7 +177,7 @@ describe("executions resource", () => {
175
177
  expect(prompted.latest.size).toBe(0);
176
178
  const gone = resource(replay(inputs, start));
177
179
  expect(gone.executions.has("e-input")).toBe(false);
178
- expect(gone.runs.get("run-input")?.state).toMatchObject({
180
+ expect(gone.runs.get(runId("run-input"))?.state).toMatchObject({
179
181
  outcome: { kind: "cancelled" },
180
182
  });
181
183
 
@@ -1,6 +1,7 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
  // @vitest-environment jsdom
3
3
 
4
+ import { runId } from "@/__tests__/branded";
4
5
  import { type NotebookTransport, StreamStopped } from "@marimo-team/client";
5
6
  import { createStore } from "jotai";
6
7
  import { afterEach, describe, expect, it, onTestFinished, vi } from "vitest";
@@ -318,7 +319,9 @@ describe("NotebookReplica lifetime", () => {
318
319
  "k7f2",
319
320
  ]);
320
321
  expect(store.get(client.runtimeAtom)?.id).toBe("r1");
321
- expect(store.get(client.executionsAtom).runs.has("run-scratch")).toBe(true);
322
+ expect(
323
+ store.get(client.executionsAtom).runs.has(runId("run-scratch")),
324
+ ).toBe(true);
322
325
  expect(store.get(client.resultsAtom).size).toBe(3);
323
326
  attempt.drop();
324
327
  await backoff();
@@ -328,7 +331,9 @@ describe("NotebookReplica lifetime", () => {
328
331
  "k7f2",
329
332
  ]);
330
333
  expect(store.get(client.runtimeAtom)).toBeNull();
331
- expect(store.get(client.executionsAtom).runs.has("run-scratch")).toBe(true);
334
+ expect(
335
+ store.get(client.executionsAtom).runs.has(runId("run-scratch")),
336
+ ).toBe(true);
332
337
  expect(store.get(client.resultsAtom).size).toBe(3);
333
338
  current.abort();
334
339
  expect(store.get(client.documentAtom)).toBeNull();
@@ -3,6 +3,7 @@
3
3
  import { createNotebookReducer, NotebookEvents } from "@marimo-team/client";
4
4
  import type * as Protocol from "@marimo-team/client/protocol";
5
5
  import { afterEach, assert, describe, expect, it, vi } from "vitest";
6
+ import { runId } from "@/__tests__/branded";
6
7
  import type { NotebookBackend } from "../../notebook/replica";
7
8
  import { document as documentResource } from "../../notebook/replica/resources/document";
8
9
  import { executions } from "../../notebook/replica/resources/executions";
@@ -110,7 +111,7 @@ describe("static notebook backend", () => {
110
111
  const cell = source.cells[0];
111
112
  const execution: Protocol.ExecutionOutput = {
112
113
  id: "embedded:result",
113
- run_id: "embedded:run",
114
+ run_id: runId("embedded:run"),
114
115
  runtime_id: "embedded",
115
116
  caused_by_id: null,
116
117
  cell_id: cell.id,
@@ -1,6 +1,7 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
  /* oxlint-disable typescript/no-explicit-any */
3
3
 
4
+ import type { RunOutput } from "@marimo-team/client/protocol";
4
5
  import { createRPCRequestHandler } from "rpc-anywhere";
5
6
  import { toast } from "@/components/ui/use-toast";
6
7
  import { userConfigAtom } from "@/core/config/config";
@@ -349,10 +350,10 @@ export class PyodideBridge implements RunRequests, EditRequests {
349
350
  if (replica === null) {
350
351
  return false;
351
352
  }
352
- return (
353
- store.get(replica.executionsAtom).runs.get(runId)?.state.status ===
354
- "running"
355
- );
353
+ const runs: ReadonlyMap<string, RunOutput> = store.get(
354
+ replica.executionsAtom,
355
+ ).runs;
356
+ return runs.get(runId)?.state.status === "running";
356
357
  }
357
358
 
358
359
  public sendRename: EditRequests["sendRename"] = async ({ filename }) => {