@marimo-team/islands 0.25.3-dev444 → 0.25.3-dev447
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-1xXl5h61.js → ErrorBoundary-DVbdKroW.js} +1 -1
- package/dist/{chat-ui-2c_3M6FX.js → chat-ui-9oyUBL6M.js} +3 -3
- package/dist/{code-visibility-2c4wpMuR.js → code-visibility-DmsDqWUx.js} +2 -2
- package/dist/{common-Czkx_WbM.js → common-BDo_Jwoz.js} +3413 -3410
- package/dist/{data-grid-overlay-editor-C67Mma9k.js → data-grid-overlay-editor-CpHB_knU.js} +1 -1
- package/dist/{error-entries-CNB7O2yS.js → error-entries-CWdDf7iZ.js} +465 -432
- package/dist/{feedback-button-D6tbegap.js → feedback-button-B_Wmi4to.js} +3 -3
- package/dist/{glide-data-editor-rXojB-VV.js → glide-data-editor-CMiIW5WP.js} +3 -3
- package/dist/{globals-BK_sLO9Z.js → globals-DaC3pk9F.js} +1 -1
- package/dist/{html-to-image-B0UiwmMu.js → html-to-image-CexRSGAZ.js} +1 -1
- package/dist/main.js +6385 -6363
- package/dist/{number-overlay-editor-DVGZgzhW.js → number-overlay-editor-Dd4cOJ5I.js} +1 -1
- package/dist/{process-output-3Epq3rw6.js → process-output-hcyVRJCC.js} +2 -2
- package/dist/{reveal-component-CCSXKkl3.js → reveal-component-CTmvBdvu.js} +39 -39
- package/package.json +1 -1
- package/src/__mocks__/requests.ts +1 -0
- package/src/components/editor/alerts/stdin-blocking-alert.tsx +5 -0
- package/src/components/editor/output/console/ConsoleOutput.tsx +27 -1
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +33 -0
- package/src/components/editor/stdin-blocking-alert.tsx +5 -0
- package/src/core/cells/cell.ts +3 -0
- package/src/core/cells/cells.ts +42 -3
- package/src/core/cells/types.ts +7 -0
- package/src/core/codemirror/cells/debugger-state.ts +5 -0
- package/src/core/errors/error-entries.ts +2 -1
- package/src/core/islands/bootstrap.ts +2 -0
- package/src/core/islands/bridge.ts +1 -0
- package/src/core/network/requests-network.ts +5 -0
- package/src/core/network/requests-static.ts +1 -0
- package/src/core/network/requests-toasting.tsx +1 -0
- package/src/core/network/types.ts +1 -0
- package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +69 -1
- package/src/core/session/useNotebookSession.tsx +29 -2
- package/src/core/wasm/bridge.ts +2 -0
|
@@ -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-
|
|
3
|
+
import { a as n } from "./glide-data-editor-CMiIW5WP.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.1_57c124ac5a994dbbf13fd11838cf9ba9/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",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as e } from "./html-to-image-
|
|
1
|
+
import { T as e } from "./html-to-image-CexRSGAZ.js";
|
|
2
2
|
import { h as t } from "./tooltip-CiJ919pg.js";
|
|
3
|
-
import { $ as n, Q as r } from "./error-entries-
|
|
3
|
+
import { $ as n, Q as r } from "./error-entries-CWdDf7iZ.js";
|
|
4
4
|
import { r as i } from "./assertNever-DOTNJ2Y4.js";
|
|
5
5
|
var a = t("file", [["path", {
|
|
6
6
|
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
@@ -3,15 +3,15 @@ import { g as t, h as n, i as r, m as i, t as a } from "./button-qQhINE7z.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-CiJ919pg.js";
|
|
6
|
-
import { $ as u,
|
|
6
|
+
import { $ as u, Q as d, bn as f, et as p, i as m, l as h, ln as g, n as _, r as v, t as y, u as b, wn as x, xn as S } from "./common-BDo_Jwoz.js";
|
|
7
7
|
import { M as C } from "./select-PQHWLm64.js";
|
|
8
8
|
import { X as ee } from "./dropdown-menu-B12Nf3Zf.js";
|
|
9
|
-
import { Nt as w } from "./error-entries-
|
|
9
|
+
import { Nt as w } from "./error-entries-CWdDf7iZ.js";
|
|
10
10
|
import { t as T } from "./jsx-runtime-D8btoEHk.js";
|
|
11
11
|
import { Rt as E, Vt as D, f as O, i as k } from "./use-restore-focus-BLj45Ibw.js";
|
|
12
12
|
import { t as A } from "./useEvent-BoN7U38T.js";
|
|
13
13
|
import { o as te } from "./static-state-CWXd6dYX.js";
|
|
14
|
-
import { n as ne, t as re } from "./code-visibility-
|
|
14
|
+
import { n as ne, t as re } from "./code-visibility-DmsDqWUx.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",
|
|
@@ -6362,12 +6362,12 @@ function sa(e) {
|
|
|
6362
6362
|
}
|
|
6363
6363
|
}
|
|
6364
6364
|
var ca = (e) => {
|
|
6365
|
-
let t = (0, N.c)(14), { cell: n } = e, { execution: r, freshness: i } =
|
|
6366
|
-
t[0] !== n.id || t[1] !== n.name ? (a =
|
|
6365
|
+
let t = (0, N.c)(14), { cell: n } = e, { execution: r, freshness: i } = g(n.id), a;
|
|
6366
|
+
t[0] !== n.id || t[1] !== n.name ? (a = y(n.id, n.name), t[0] = n.id, t[1] = n.name, t[2] = a) : a = t[2];
|
|
6367
6367
|
let o = n.id, s = r.status, c = n.output, l;
|
|
6368
6368
|
t[3] !== r || t[4] !== i ? (l = w(r, i, !1), t[3] = r, t[4] = i, t[5] = l) : l = t[5];
|
|
6369
6369
|
let u;
|
|
6370
|
-
t[6] !== n.id || t[7] !== n.output || t[8] !== r.status || t[9] !== l ? (u = /* @__PURE__ */ (0, W.jsx)(
|
|
6370
|
+
t[6] !== n.id || t[7] !== n.output || t[8] !== r.status || t[9] !== l ? (u = /* @__PURE__ */ (0, W.jsx)(b, {
|
|
6371
6371
|
cellId: o,
|
|
6372
6372
|
status: s,
|
|
6373
6373
|
output: c,
|
|
@@ -6427,7 +6427,7 @@ var da = (e) => {
|
|
|
6427
6427
|
let o;
|
|
6428
6428
|
return t[3] === n ? o = t[4] : (o = /* @__PURE__ */ (0, W.jsx)(ca, { cell: n }), t[3] = n, t[4] = o), o;
|
|
6429
6429
|
}, fa = (e) => {
|
|
6430
|
-
let t = (0, N.c)(164), { slideCells: o, layout: s, setLayout: c, noOutputIds:
|
|
6430
|
+
let t = (0, N.c)(164), { slideCells: o, layout: s, setLayout: c, noOutputIds: g, activeIndex: y, onSlideChange: b, mode: C, configWidth: ee, isEditable: w } = e, T = w !== void 0 && w, D = (0, M.useRef)(null), j = (0, M.useRef)(null), { width: ie, height: P } = ta(D), ae = k() != null, [oe, se] = (0, M.useState)(1), ce;
|
|
6431
6431
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (ce = () => {
|
|
6432
6432
|
let e = requestAnimationFrame(() => {
|
|
6433
6433
|
let e = j.current;
|
|
@@ -6442,19 +6442,19 @@ var da = (e) => {
|
|
|
6442
6442
|
ae
|
|
6443
6443
|
], t[1] = P, t[2] = ae, t[3] = ie, t[4] = F) : F = t[4], (0, M.useEffect)(ce, F);
|
|
6444
6444
|
let I = E(te), le = E(ne).kind, ue = E(_r), de = le !== "wasm" || ue, fe;
|
|
6445
|
-
t[5] !== I || t[6] !== le ? (fe = I || !
|
|
6445
|
+
t[5] !== I || t[6] !== le ? (fe = I || !m(le) ? [] : [Gi], t[5] = I, t[6] = le, t[7] = fe) : fe = t[7];
|
|
6446
6446
|
let pe = fe, [me, he] = (0, M.useState)(pa), ge = re(), _e;
|
|
6447
6447
|
t[8] === ge ? _e = t[9] : (_e = !O() && ge, t[8] = ge, t[9] = _e);
|
|
6448
6448
|
let ve = _e, ye;
|
|
6449
|
-
t[10] === I ? ye = t[11] : (ye =
|
|
6450
|
-
let L = !ye && ve, be =
|
|
6449
|
+
t[10] === I ? ye = t[11] : (ye = v(I, window.location.search), t[10] = I, t[11] = ye);
|
|
6450
|
+
let L = !ye && ve, be = y == null ? void 0 : o[y], xe;
|
|
6451
6451
|
t[12] !== be || t[13] !== o ? (xe = be ?? o.at(0), t[12] = be, t[13] = o, t[14] = xe) : xe = t[14];
|
|
6452
6452
|
let Se = xe, Ce;
|
|
6453
|
-
t[15] !== be || t[16] !== s.cells || t[17] !==
|
|
6453
|
+
t[15] !== be || t[16] !== s.cells || t[17] !== g ? (Ce = {
|
|
6454
6454
|
activeCell: be,
|
|
6455
6455
|
slideConfigs: s.cells,
|
|
6456
|
-
noOutputIds:
|
|
6457
|
-
}, t[15] = be, t[16] = s.cells, t[17] =
|
|
6456
|
+
noOutputIds: g
|
|
6457
|
+
}, t[15] = be, t[16] = s.cells, t[17] = g, t[18] = Ce) : Ce = t[18];
|
|
6458
6458
|
let { parkedPreviewCell: R, isHeldEdit: z, isNoOutputPreview: we, heldEditCellId: Te, heldShowsCode: Ee, toggleHeldShowsCode: De } = aa(Ce), Oe;
|
|
6459
6459
|
t[19] !== ve || t[20] !== s.cells || t[21] !== me ? (Oe = (e) => ra({
|
|
6460
6460
|
cells: s.cells,
|
|
@@ -6467,12 +6467,12 @@ var da = (e) => {
|
|
|
6467
6467
|
let Ae = ke, je;
|
|
6468
6468
|
t[28] !== V || t[29] !== ve || t[30] !== s.cells ? (je = ve && V != null && (s.cells.get(V)?.showCode ?? !1), t[28] = V, t[29] = ve, t[30] = s.cells, t[31] = je) : je = t[31];
|
|
6469
6469
|
let Me = je, Ne;
|
|
6470
|
-
t[32] !== Te || t[33] !== s.cells || t[34] !==
|
|
6470
|
+
t[32] !== Te || t[33] !== s.cells || t[34] !== g ? (Ne = (e) => ia({
|
|
6471
6471
|
cell: e,
|
|
6472
|
-
noOutputIds:
|
|
6472
|
+
noOutputIds: g,
|
|
6473
6473
|
heldEditCellId: Te,
|
|
6474
6474
|
slideConfigs: s.cells
|
|
6475
|
-
}), t[32] = Te, t[33] = s.cells, t[34] =
|
|
6475
|
+
}), t[32] = Te, t[33] = s.cells, t[34] = g, t[35] = Ne) : Ne = t[35];
|
|
6476
6476
|
let Pe;
|
|
6477
6477
|
t[36] !== o || t[37] !== Ne ? (Pe = rr({
|
|
6478
6478
|
cells: o,
|
|
@@ -6487,7 +6487,7 @@ var da = (e) => {
|
|
|
6487
6487
|
let { cellToTarget: Le, targetToCellIndex: H } = Ie, Re = s.deck?.transition ?? "slide", ze = s.deck?.verticalAlign, Be;
|
|
6488
6488
|
t[42] === ze ? Be = t[43] : (Be = sa(ze), t[42] = ze, t[43] = Be);
|
|
6489
6489
|
let Ve = Be, He;
|
|
6490
|
-
t[44] === Symbol.for("react.memo_cache_sentinel") ? (He =
|
|
6490
|
+
t[44] === Symbol.for("react.memo_cache_sentinel") ? (He = _(window.location.href), t[44] = He) : He = t[44];
|
|
6491
6491
|
let Ue = He, We;
|
|
6492
6492
|
t[45] === Re ? We = t[46] : (We = {
|
|
6493
6493
|
embedded: !0,
|
|
@@ -6502,33 +6502,33 @@ var da = (e) => {
|
|
|
6502
6502
|
scrollActivationWidth: 0
|
|
6503
6503
|
}, t[45] = Re, t[46] = We);
|
|
6504
6504
|
let Ge = We, Ke;
|
|
6505
|
-
t[47] !==
|
|
6506
|
-
if (
|
|
6505
|
+
t[47] !== y || t[48] !== de || t[49] !== Le || t[50] !== o ? (Ke = (e) => {
|
|
6506
|
+
if (y == null && window.location.hash.startsWith("#/")) {
|
|
6507
6507
|
if (!de) return;
|
|
6508
6508
|
window.dispatchEvent(new HashChangeEvent("hashchange")), Zi(e);
|
|
6509
6509
|
return;
|
|
6510
6510
|
}
|
|
6511
6511
|
let t = sr({
|
|
6512
|
-
activeIndex:
|
|
6512
|
+
activeIndex: y,
|
|
6513
6513
|
cells: o,
|
|
6514
6514
|
cellToTarget: Le,
|
|
6515
6515
|
getId: ga
|
|
6516
6516
|
}), n = t && cr(e.getIndices(), t);
|
|
6517
6517
|
n && (e.slide(n.h, n.v, n.f), Zi(e));
|
|
6518
|
-
}, t[47] =
|
|
6518
|
+
}, t[47] = y, t[48] = de, t[49] = Le, t[50] = o, t[51] = Ke) : Ke = t[51];
|
|
6519
6519
|
let qe = A(Ke), Je;
|
|
6520
6520
|
t[52] === qe ? Je = t[53] : (Je = () => {
|
|
6521
6521
|
let e = j.current;
|
|
6522
6522
|
e != null && qe(e);
|
|
6523
6523
|
}, t[52] = qe, t[53] = Je);
|
|
6524
6524
|
let Ye;
|
|
6525
|
-
t[54] !==
|
|
6526
|
-
|
|
6525
|
+
t[54] !== y || t[55] !== de || t[56] !== Le || t[57] !== qe || t[58] !== o ? (Ye = [
|
|
6526
|
+
y,
|
|
6527
6527
|
de,
|
|
6528
6528
|
Le,
|
|
6529
6529
|
o,
|
|
6530
6530
|
qe
|
|
6531
|
-
], t[54] =
|
|
6531
|
+
], t[54] = y, t[55] = de, t[56] = Le, t[57] = qe, t[58] = o, t[59] = Ye) : Ye = t[59], (0, M.useEffect)(Je, Ye);
|
|
6532
6532
|
let Xe;
|
|
6533
6533
|
t[60] !== V || t[61] !== Me || t[62] !== z || t[63] !== De ? (Xe = () => {
|
|
6534
6534
|
V == null || Me || (z ? De() : (0, M.startTransition)(() => he((e) => {
|
|
@@ -6548,11 +6548,11 @@ var da = (e) => {
|
|
|
6548
6548
|
};
|
|
6549
6549
|
}, Qe = [L, U], t[65] = L, t[66] = U, t[67] = Ze, t[68] = Qe) : (Ze = t[67], Qe = t[68]), (0, M.useEffect)(Ze, Qe);
|
|
6550
6550
|
let $e;
|
|
6551
|
-
t[69] !==
|
|
6551
|
+
t[69] !== b || t[70] !== R || t[71] !== H ? ($e = (e) => {
|
|
6552
6552
|
if (R != null) return;
|
|
6553
6553
|
let t = ar(H, e.getIndices());
|
|
6554
|
-
t != null &&
|
|
6555
|
-
}, t[69] =
|
|
6554
|
+
t != null && b?.(t);
|
|
6555
|
+
}, t[69] = b, t[70] = R, t[71] = H, t[72] = $e) : $e = t[72];
|
|
6556
6556
|
let et = A($e), tt;
|
|
6557
6557
|
t[73] === et ? tt = t[74] : (tt = () => {
|
|
6558
6558
|
let e = j.current;
|
|
@@ -6569,14 +6569,14 @@ var da = (e) => {
|
|
|
6569
6569
|
t instanceof HTMLElement && (t.tabIndex = -1, t.focus({ preventScroll: !0 }));
|
|
6570
6570
|
}, t[75] = de, t[76] = L, t[77] = qe, t[78] = et, t[79] = U, t[80] = rt) : rt = t[80];
|
|
6571
6571
|
let it = A(rt), at;
|
|
6572
|
-
t[81] !==
|
|
6573
|
-
if (!R ||
|
|
6572
|
+
t[81] !== y || t[82] !== b || t[83] !== R || t[84] !== o ? (at = (e) => {
|
|
6573
|
+
if (!R || y == null || i.fromInput(e)) return;
|
|
6574
6574
|
let t = ea(e);
|
|
6575
6575
|
if (t === 0) return;
|
|
6576
6576
|
e.preventDefault(), e.stopPropagation();
|
|
6577
|
-
let n =
|
|
6578
|
-
n < 0 || n >= o.length ||
|
|
6579
|
-
}, t[81] =
|
|
6577
|
+
let n = y + t;
|
|
6578
|
+
n < 0 || n >= o.length || b?.(n);
|
|
6579
|
+
}, t[81] = y, t[82] = b, t[83] = R, t[84] = o, t[85] = at) : at = t[85];
|
|
6580
6580
|
let ot = A(at), st;
|
|
6581
6581
|
t[86] === nt ? st = t[87] : (st = () => {
|
|
6582
6582
|
nt();
|
|
@@ -6631,7 +6631,7 @@ var da = (e) => {
|
|
|
6631
6631
|
"aria-label": ut ?? void 0,
|
|
6632
6632
|
children: [ut && /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
6633
6633
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-muted-foreground border-b bg-muted/40",
|
|
6634
|
-
children: [/* @__PURE__ */ (0, W.jsx)(
|
|
6634
|
+
children: [/* @__PURE__ */ (0, W.jsx)(f, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ (0, W.jsx)("span", { children: ut })]
|
|
6635
6635
|
}), /* @__PURE__ */ (0, W.jsx)("div", {
|
|
6636
6636
|
className: "reveal mo-slides-theme prose-slides absolute left-1/2 top-1/2",
|
|
6637
6637
|
"data-testid": "slide-preview-canvas",
|
|
@@ -6665,7 +6665,7 @@ var da = (e) => {
|
|
|
6665
6665
|
"aria-disabled": Me,
|
|
6666
6666
|
"aria-label": Me ? "Code always shown" : Ae ? "Hide code" : "Show code",
|
|
6667
6667
|
onClick: U,
|
|
6668
|
-
children: /* @__PURE__ */ (0, W.jsx)(
|
|
6668
|
+
children: /* @__PURE__ */ (0, W.jsx)(x, { className: "h-4 w-4" })
|
|
6669
6669
|
})
|
|
6670
6670
|
}), t[128] = Ae, t[129] = Me, t[130] = L, t[131] = U, t[132] = yt) : yt = t[132];
|
|
6671
6671
|
let xt;
|
|
@@ -6680,7 +6680,7 @@ var da = (e) => {
|
|
|
6680
6680
|
onClick: () => {
|
|
6681
6681
|
j.current?.getViewportElement()?.requestFullscreen().catch(_a);
|
|
6682
6682
|
},
|
|
6683
|
-
children: /* @__PURE__ */ (0, W.jsx)(
|
|
6683
|
+
children: /* @__PURE__ */ (0, W.jsx)(S, { className: "h-4 w-4" })
|
|
6684
6684
|
})
|
|
6685
6685
|
}), t[133] = xt) : xt = t[133];
|
|
6686
6686
|
let St;
|
|
@@ -6711,7 +6711,7 @@ var da = (e) => {
|
|
|
6711
6711
|
}), t[141] = K, t[142] = e), e;
|
|
6712
6712
|
}
|
|
6713
6713
|
let q;
|
|
6714
|
-
t[143] === K ? q = t[144] : (q = /* @__PURE__ */ (0, W.jsx)(
|
|
6714
|
+
t[143] === K ? q = t[144] : (q = /* @__PURE__ */ (0, W.jsx)(d, {
|
|
6715
6715
|
defaultSize: 92,
|
|
6716
6716
|
minSize: 60,
|
|
6717
6717
|
children: K
|
|
@@ -6722,13 +6722,13 @@ var da = (e) => {
|
|
|
6722
6722
|
fine: 4
|
|
6723
6723
|
}, t[145] = wt) : wt = t[145];
|
|
6724
6724
|
let J;
|
|
6725
|
-
t[146] === ae ? J = t[147] : (J = /* @__PURE__ */ (0, W.jsx)(
|
|
6725
|
+
t[146] === ae ? J = t[147] : (J = /* @__PURE__ */ (0, W.jsx)(p, {
|
|
6726
6726
|
className: "mo-slides-notes-resize",
|
|
6727
6727
|
hitAreaMargins: wt,
|
|
6728
6728
|
disabled: ae
|
|
6729
6729
|
}), t[146] = ae, t[147] = J);
|
|
6730
6730
|
let Tt = Se?.id, Y;
|
|
6731
|
-
t[148] !== s || t[149] !== c || t[150] !== Tt ? (Y = /* @__PURE__ */ (0, W.jsx)(
|
|
6731
|
+
t[148] !== s || t[149] !== c || t[150] !== Tt ? (Y = /* @__PURE__ */ (0, W.jsx)(d, {
|
|
6732
6732
|
defaultSize: 10,
|
|
6733
6733
|
minSize: 4,
|
|
6734
6734
|
collapsible: !0,
|
|
@@ -6751,7 +6751,7 @@ var da = (e) => {
|
|
|
6751
6751
|
]
|
|
6752
6752
|
}), t[152] = q, t[153] = J, t[154] = Y, t[155] = Et) : Et = t[155];
|
|
6753
6753
|
let Dt;
|
|
6754
|
-
t[156] !== Se || t[157] !== ee || t[158] !== s || t[159] !== c ? (Dt = /* @__PURE__ */ (0, W.jsx)(
|
|
6754
|
+
t[156] !== Se || t[157] !== ee || t[158] !== s || t[159] !== c ? (Dt = /* @__PURE__ */ (0, W.jsx)(h, {
|
|
6755
6755
|
configWidth: ee,
|
|
6756
6756
|
layout: s,
|
|
6757
6757
|
setLayout: c,
|
package/package.json
CHANGED
|
@@ -42,6 +42,7 @@ export const MockRequestClient = {
|
|
|
42
42
|
.fn()
|
|
43
43
|
.mockRejectedValue(new Error("Environment information unavailable")),
|
|
44
44
|
getFileRoots: vi.fn().mockResolvedValue({ roots: [] }),
|
|
45
|
+
sendPdbReply: vi.fn().mockResolvedValue(null),
|
|
45
46
|
sendPdb: vi.fn().mockResolvedValue({}),
|
|
46
47
|
sendSetBreakpoints: vi.fn().mockResolvedValue({}),
|
|
47
48
|
sendListFiles: vi.fn().mockResolvedValue({ files: [] }),
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { atom, useAtomValue } from "jotai";
|
|
4
4
|
import { notebookAtom } from "@/core/cells/cells";
|
|
5
5
|
import { cellExecutionInputsAtom, cellExecutionView } from "@/core/executions";
|
|
6
|
+
import { pendingPdbInputAtom } from "@/core/codemirror/cells/debugger-state";
|
|
7
|
+
import { kioskModeAtom } from "@/core/mode";
|
|
6
8
|
import { Logger } from "@/utils/Logger";
|
|
7
9
|
import { Button } from "../../ui/button";
|
|
8
10
|
import { Kbd } from "../../ui/kbd";
|
|
@@ -12,6 +14,9 @@ import { FloatingAlert } from "./floating-alert";
|
|
|
12
14
|
const hasBlockingStdinAtom = atom((get) => {
|
|
13
15
|
const notebook = get(notebookAtom);
|
|
14
16
|
const executions = get(cellExecutionInputsAtom);
|
|
17
|
+
if (!get(kioskModeAtom) && get(pendingPdbInputAtom) !== null) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
15
20
|
|
|
16
21
|
// Check each cell in order
|
|
17
22
|
for (const cellId of notebook.cellIds) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
+
import { useAtomValue } from "jotai";
|
|
3
4
|
import {
|
|
4
5
|
ChevronRightIcon,
|
|
5
6
|
ChevronsDownUpIcon,
|
|
@@ -8,6 +9,9 @@ import {
|
|
|
8
9
|
} from "lucide-react";
|
|
9
10
|
import React, { useEffect, useLayoutEffect, useState } from "react";
|
|
10
11
|
import { ToggleButton } from "react-aria-components";
|
|
12
|
+
import { pendingPdbInputAtom } from "@/core/codemirror/cells/debugger-state";
|
|
13
|
+
import { kioskModeAtom } from "@/core/mode";
|
|
14
|
+
import { getRequestClient } from "@/core/network/requests";
|
|
11
15
|
import { DebuggerControls } from "@/components/debugger/debugger-code";
|
|
12
16
|
import { CopyClipboardIcon } from "@/components/icons/copy-icon";
|
|
13
17
|
import { Button } from "@/components/ui/button";
|
|
@@ -124,7 +128,11 @@ const ConsoleOutputInternal = (props: Props): React.ReactNode => {
|
|
|
124
128
|
);
|
|
125
129
|
} */
|
|
126
130
|
|
|
127
|
-
const
|
|
131
|
+
const kioskMode = useAtomValue(kioskModeAtom);
|
|
132
|
+
const prompt = useAtomValue(pendingPdbInputAtom);
|
|
133
|
+
const pdbInput =
|
|
134
|
+
!kioskMode && prompt?.cellId === cellId ? prompt.inputId : null;
|
|
135
|
+
const hasOutputs = consoleOutputs.length > 0 || pdbInput != null;
|
|
128
136
|
|
|
129
137
|
// Enable Ctrl/Cmd-A to select all content within the console output
|
|
130
138
|
const selectAllProps = useSelectAllContent(hasOutputs);
|
|
@@ -235,6 +243,24 @@ const ConsoleOutputInternal = (props: Props): React.ReactNode => {
|
|
|
235
243
|
)}
|
|
236
244
|
style={isExpanded ? { maxHeight: "none" } : undefined}
|
|
237
245
|
>
|
|
246
|
+
{pdbInput != null && (
|
|
247
|
+
<StdInput
|
|
248
|
+
key={pdbInput}
|
|
249
|
+
output=""
|
|
250
|
+
isPdb={true}
|
|
251
|
+
onSubmit={(value) => {
|
|
252
|
+
void getRequestClient()
|
|
253
|
+
.sendPdbReply({ cellId, inputId: pdbInput, value })
|
|
254
|
+
.catch(() => {
|
|
255
|
+
/* The request client reports the failure. */
|
|
256
|
+
});
|
|
257
|
+
}}
|
|
258
|
+
onClear={onClear}
|
|
259
|
+
value={stdinValue}
|
|
260
|
+
setValue={setStdinValue}
|
|
261
|
+
inputHistory={inputHistory}
|
|
262
|
+
/>
|
|
263
|
+
)}
|
|
238
264
|
{reversedOutputs.map((output, idx) => {
|
|
239
265
|
if (output.channel === "pdb") {
|
|
240
266
|
return null;
|
|
@@ -5,9 +5,12 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
5
5
|
import { createStore, Provider } from "jotai";
|
|
6
6
|
import { SetupMocks } from "@/__mocks__/common";
|
|
7
7
|
import { mockDocumentModel } from "@/__mocks__/document";
|
|
8
|
+
import { MockRequestClient } from "@/__mocks__/requests";
|
|
9
|
+
import * as requests from "@/core/network/requests";
|
|
8
10
|
import { cellId } from "@/__tests__/branded";
|
|
9
11
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
10
12
|
import type { WithResponse } from "@/core/cells/types";
|
|
13
|
+
import { pendingPdbInputAtom } from "@/core/codemirror/cells/debugger-state";
|
|
11
14
|
import { DocumentProvider } from "@/core/notebook/document";
|
|
12
15
|
import type { OutputMessage } from "@/core/kernel/messages";
|
|
13
16
|
import { CONSOLE_CLEAR_DEBOUNCE_MS, ConsoleOutput } from "../ConsoleOutput";
|
|
@@ -88,6 +91,36 @@ describe("ConsoleOutput pdb history", () => {
|
|
|
88
91
|
response,
|
|
89
92
|
});
|
|
90
93
|
|
|
94
|
+
it("answers the failed cell's debugger prompt by ID and allows a retry", () => {
|
|
95
|
+
const client = MockRequestClient.create();
|
|
96
|
+
client.sendPdbReply.mockRejectedValueOnce(new Error("disconnected"));
|
|
97
|
+
const getter = vi
|
|
98
|
+
.spyOn(requests, "getRequestClient")
|
|
99
|
+
.mockReturnValue(client);
|
|
100
|
+
try {
|
|
101
|
+
store.set(pendingPdbInputAtom, {
|
|
102
|
+
cellId: defaultProps.cellId,
|
|
103
|
+
inputId: "prompt-1",
|
|
104
|
+
});
|
|
105
|
+
renderWithProvider(<ConsoleOutput {...defaultProps} />);
|
|
106
|
+
const input = screen.getByTestId("console-input");
|
|
107
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
108
|
+
fireEvent.change(input, { target: { value: "where" } });
|
|
109
|
+
fireEvent.keyDown(input, { key: "Enter" });
|
|
110
|
+
}
|
|
111
|
+
expect(client.sendPdbReply).toHaveBeenCalledTimes(2);
|
|
112
|
+
expect(client.sendPdbReply).toHaveBeenLastCalledWith({
|
|
113
|
+
cellId: defaultProps.cellId,
|
|
114
|
+
inputId: "prompt-1",
|
|
115
|
+
value: "where",
|
|
116
|
+
});
|
|
117
|
+
expect(defaultProps.onSubmitDebugger).not.toHaveBeenCalled();
|
|
118
|
+
} finally {
|
|
119
|
+
act(() => store.set(pendingPdbInputAtom, null));
|
|
120
|
+
getter.mockRestore();
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
91
124
|
it("should persist command history across StdInput remounts", () => {
|
|
92
125
|
// Initial state: pdb prompt waiting for input
|
|
93
126
|
const outputs1: WithResponse<OutputMessage>[] = [stdinPrompt("(Pdb) ")];
|
|
@@ -4,6 +4,8 @@ import { atom, useAtomValue } from "jotai";
|
|
|
4
4
|
import { notebookAtom } from "@/core/cells/cells";
|
|
5
5
|
import { cellExecutionInputsAtom, cellExecutionView } from "@/core/executions";
|
|
6
6
|
import { Banner } from "@/plugins/impl/common/error-banner";
|
|
7
|
+
import { pendingPdbInputAtom } from "@/core/codemirror/cells/debugger-state";
|
|
8
|
+
import { kioskModeAtom } from "@/core/mode";
|
|
7
9
|
import { Logger } from "@/utils/Logger";
|
|
8
10
|
import { Button } from "../ui/button";
|
|
9
11
|
import { Kbd } from "../ui/kbd";
|
|
@@ -13,6 +15,9 @@ import { DelayMount } from "../utils/delay-mount";
|
|
|
13
15
|
const hasBlockingStdinAtom = atom((get) => {
|
|
14
16
|
const notebook = get(notebookAtom);
|
|
15
17
|
const executions = get(cellExecutionInputsAtom);
|
|
18
|
+
if (!get(kioskModeAtom) && get(pendingPdbInputAtom) !== null) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
16
21
|
|
|
17
22
|
// Check each cell in order
|
|
18
23
|
for (const cellId of notebook.cellIds) {
|
package/src/core/cells/cell.ts
CHANGED
|
@@ -31,6 +31,9 @@ export function transitionCell(
|
|
|
31
31
|
): CellRuntimeState {
|
|
32
32
|
const nextCell = { ...cell };
|
|
33
33
|
|
|
34
|
+
if (message.status === "running" && nextCell.pdbOutput) {
|
|
35
|
+
delete nextCell.pdbOutput;
|
|
36
|
+
}
|
|
34
37
|
if (message.status === "queued") {
|
|
35
38
|
nextCell.debuggerActive = false;
|
|
36
39
|
}
|
package/src/core/cells/cells.ts
CHANGED
|
@@ -25,7 +25,8 @@ import { foldAllBulk, unfoldAllBulk } from "../codemirror/editing/commands";
|
|
|
25
25
|
import { editorMountScheduler } from "../codemirror/editor-mount-scheduler";
|
|
26
26
|
import type { SerializedEditorState } from "../codemirror/types";
|
|
27
27
|
import { mergeOutlines } from "../dom/outline";
|
|
28
|
-
import
|
|
28
|
+
import { collapseConsoleOutputs } from "./collapseConsoleOutputs";
|
|
29
|
+
import type { NotificationMessage, CellMessage } from "../kernel/messages";
|
|
29
30
|
import { isErrorMime } from "../mime";
|
|
30
31
|
import { createDeepEqualAtom, store } from "../state/jotai";
|
|
31
32
|
import { isWasm } from "../wasm/utils";
|
|
@@ -37,6 +38,8 @@ import { type CellLog, getCellLogsForMessage } from "./logs";
|
|
|
37
38
|
import type { Outline } from "./outline";
|
|
38
39
|
import { focusAndScrollCellIntoView } from "./scrollCellIntoView";
|
|
39
40
|
import {
|
|
41
|
+
withPdbOutput,
|
|
42
|
+
type ConsoleOutputMessage,
|
|
40
43
|
type CellData,
|
|
41
44
|
type CellRuntimeState,
|
|
42
45
|
createCell,
|
|
@@ -170,6 +173,41 @@ const {
|
|
|
170
173
|
cellId: action.cellId,
|
|
171
174
|
cellReducer: (cell) => ({ ...cell, debuggerActive: false }),
|
|
172
175
|
}),
|
|
176
|
+
showPdbOutput: (
|
|
177
|
+
state,
|
|
178
|
+
{
|
|
179
|
+
cell_id,
|
|
180
|
+
entries,
|
|
181
|
+
replace,
|
|
182
|
+
}: Extract<NotificationMessage, { op: "pdb-output" }>,
|
|
183
|
+
) => {
|
|
184
|
+
return updateCellRuntimeState({
|
|
185
|
+
state,
|
|
186
|
+
cellId: cell_id,
|
|
187
|
+
cellReducer: (cell) => {
|
|
188
|
+
let transcript =
|
|
189
|
+
replace || entries.length === 0 ? [] : (cell.pdbOutput ?? []);
|
|
190
|
+
for (const entry of entries) {
|
|
191
|
+
// Execution entries have positive keys.
|
|
192
|
+
const output: ConsoleOutputMessage = {
|
|
193
|
+
...entry,
|
|
194
|
+
id: (transcript.at(-1)?.id ?? 0) - 1,
|
|
195
|
+
};
|
|
196
|
+
transcript = collapseConsoleOutputs([...transcript, output]);
|
|
197
|
+
}
|
|
198
|
+
return { ...cell, pdbOutput: transcript };
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
clearDebuggerOutput: (state) => {
|
|
203
|
+
const cellRuntime = { ...state.cellRuntime };
|
|
204
|
+
for (const cellId of Object.keys(cellRuntime) as CellId[]) {
|
|
205
|
+
if (cellRuntime[cellId].pdbOutput) {
|
|
206
|
+
cellRuntime[cellId] = { ...cellRuntime[cellId], pdbOutput: undefined };
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return { ...state, cellRuntime };
|
|
210
|
+
},
|
|
173
211
|
handleCellMessage: (state, message: CellMessage) => {
|
|
174
212
|
const cellId = message.cell_id;
|
|
175
213
|
const nextState = updateCellRuntimeState({
|
|
@@ -317,6 +355,7 @@ function clearConsoleOutputs(
|
|
|
317
355
|
}
|
|
318
356
|
cellRuntime[cellId] = {
|
|
319
357
|
...cell,
|
|
358
|
+
pdbOutput: undefined,
|
|
320
359
|
consoleOutputs: cell.consoleOutputs.filter(
|
|
321
360
|
(output) => output.channel === "stdin" && output.response == null,
|
|
322
361
|
),
|
|
@@ -520,7 +559,7 @@ export const cellDataAtom = atomFamily((cellId: CellId) =>
|
|
|
520
559
|
atom((get) => get(notebookAtom).cellData[cellId]),
|
|
521
560
|
);
|
|
522
561
|
const cellRuntimeAtom = atomFamily((cellId: CellId) =>
|
|
523
|
-
atom((get) => get(notebookAtom).cellRuntime[cellId]),
|
|
562
|
+
atom((get) => withPdbOutput(get(notebookAtom).cellRuntime[cellId])),
|
|
524
563
|
);
|
|
525
564
|
export const cellHandleAtom = atomFamily((cellId: CellId) =>
|
|
526
565
|
atom((get) => get(notebookAtom).cellHandles[cellId]),
|
|
@@ -585,7 +624,7 @@ export function flattenTopLevelNotebookCells(
|
|
|
585
624
|
const { cellIds, cellData, cellRuntime } = state;
|
|
586
625
|
return cellIds.map((cellId) => ({
|
|
587
626
|
...cellData[cellId],
|
|
588
|
-
...cellRuntime[cellId],
|
|
627
|
+
...withPdbOutput(cellRuntime[cellId]),
|
|
589
628
|
output: outputs.get(cellId) ?? null,
|
|
590
629
|
}));
|
|
591
630
|
}
|
package/src/core/cells/types.ts
CHANGED
|
@@ -70,6 +70,7 @@ export interface CellData {
|
|
|
70
70
|
export interface CellRuntimeState {
|
|
71
71
|
/** messages encoding the cell's console outputs. TODO(MO-8405) */
|
|
72
72
|
consoleOutputs: ConsoleOutputMessage[];
|
|
73
|
+
pdbOutput?: ConsoleOutputMessage[];
|
|
73
74
|
/** debugger active */
|
|
74
75
|
debuggerActive: boolean;
|
|
75
76
|
/** serialization message. TODO(MO-8414) */
|
|
@@ -98,3 +99,9 @@ export type WithResponse<T> = T & {
|
|
|
98
99
|
export type ConsoleOutputMessage = WithResponse<OutputMessage> & {
|
|
99
100
|
id?: number;
|
|
100
101
|
};
|
|
102
|
+
|
|
103
|
+
export function withPdbOutput(cell: CellRuntimeState): CellRuntimeState {
|
|
104
|
+
return cell?.pdbOutput?.length
|
|
105
|
+
? { ...cell, consoleOutputs: [...cell.consoleOutputs, ...cell.pdbOutput] }
|
|
106
|
+
: cell;
|
|
107
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
+
import { withPdbOutput } from "@/core/cells/types";
|
|
3
4
|
import { notebookAtom } from "@/core/cells/cells";
|
|
4
5
|
import type { CellId } from "@/core/cells/ids";
|
|
5
6
|
import { displayCellName } from "@/core/cells/names";
|
|
@@ -107,7 +108,7 @@ export function getCellErrorEntries(store: JotaiStore): CellErrorEntry[] {
|
|
|
107
108
|
errorData: parsed.errorData,
|
|
108
109
|
tracebackHtml: resolveTracebackHtml(
|
|
109
110
|
parsed,
|
|
110
|
-
cellRuntime[cellId].consoleOutputs,
|
|
111
|
+
withPdbOutput(cellRuntime[cellId]).consoleOutputs,
|
|
111
112
|
),
|
|
112
113
|
});
|
|
113
114
|
}
|
|
@@ -390,6 +390,7 @@ export class IslandsPyodideBridge implements RunRequests, EditRequests {
|
|
|
390
390
|
public getFileRoots = throwNotImplemented;
|
|
391
391
|
public sendListFiles = throwNotImplemented;
|
|
392
392
|
public sendSearchFiles = throwNotImplemented;
|
|
393
|
+
public sendPdbReply = throwNotImplemented;
|
|
393
394
|
public sendPdb = throwNotImplemented;
|
|
394
395
|
public sendSetBreakpoints = throwNotImplemented;
|
|
395
396
|
public sendCreateFileOrFolder = throwNotImplemented;
|
|
@@ -253,6 +253,11 @@ export function createNetworkRequests(): EditRequests & RunRequests {
|
|
|
253
253
|
})
|
|
254
254
|
.then(handleResponseReturnNull);
|
|
255
255
|
},
|
|
256
|
+
sendPdbReply: (request) => {
|
|
257
|
+
return getClient()
|
|
258
|
+
.POST("/api/kernel/pdb/reply", { body: request, params: getParams() })
|
|
259
|
+
.then(handleResponseReturnNull);
|
|
260
|
+
},
|
|
256
261
|
sendSetBreakpoints: (request) => {
|
|
257
262
|
return getClient()
|
|
258
263
|
.POST("/api/kernel/pdb/breakpoints", {
|
|
@@ -60,6 +60,7 @@ export function createStaticRequests(): EditRequests & RunRequests {
|
|
|
60
60
|
getFileRoots: throwNotInEditMode,
|
|
61
61
|
sendListFiles: throwNotInEditMode,
|
|
62
62
|
sendSearchFiles: throwNotInEditMode,
|
|
63
|
+
sendPdbReply: throwNotInEditMode,
|
|
63
64
|
sendPdb: throwNotInEditMode,
|
|
64
65
|
sendSetBreakpoints: throwNotInEditMode,
|
|
65
66
|
sendCreateFileOrFolder: throwNotInEditMode,
|
|
@@ -38,6 +38,7 @@ export function createErrorToastingRequests(
|
|
|
38
38
|
getFileRoots: "", // RequestingTree surfaces this error
|
|
39
39
|
sendListFiles: "Failed to list files",
|
|
40
40
|
sendSearchFiles: "", // Search callers handle errors
|
|
41
|
+
sendPdbReply: "Failed to send debugger command",
|
|
41
42
|
sendPdb: "Failed to start debug session",
|
|
42
43
|
sendSetBreakpoints: "", // No toast
|
|
43
44
|
sendCreateFileOrFolder: "Failed to create file or folder",
|
|
@@ -185,6 +185,7 @@ export interface EditRequests {
|
|
|
185
185
|
getUsageStats: () => Promise<UsageResponse>;
|
|
186
186
|
getEnvironmentInfo: () => Promise<EnvironmentInfo>;
|
|
187
187
|
// Debugger
|
|
188
|
+
sendPdbReply: (request: schemas["PdbInputReplyRequest"]) => Promise<null>;
|
|
188
189
|
sendPdb: (request: DebugCellRequest) => Promise<null>;
|
|
189
190
|
sendSetBreakpoints: (request: SetBreakpointsRequest) => Promise<null>;
|
|
190
191
|
// File explorer requests
|