smelt.notebook¶
Tier: UiHost — Requires a terminal UI; calling these from headless mode raises.
Parse, read, and apply notebook cell edits, plus compute preview data for the edit_notebook tool. UiHost-only.
smelt.notebook.apply_edit¶
Apply a notebook edit (cell insert/replace/delete) described by args and persist the new file. Returns (message_table, nil) on success or (nil, err_msg) on failure. Callers are expected to hold the per-path advisory flock.
smelt.notebook.is_notebook_path¶
Return true if path looks like a Jupyter notebook (.ipynb extension).
smelt.notebook.parse¶
Parse a notebook JSON string. Returns (notebook, nil) with { nbformat, nbformat_minor, cells = { { kind, id?, source, execution_count? } } } on success, or (nil, error) on failure.
smelt.notebook.preview_data¶
Compute the preview payload for an edit_notebook call. Returns nil when the notebook can't be read/parsed or the target cell is out of range. The returned table has { edit_mode, path, title, old_source, new_source, syntax_ext }.
smelt.notebook.read¶
Render a Jupyter notebook at path as cell-by-cell text starting at offset for at most limit cells. Returns (text, nil) on success or (nil, err_msg) on parse failure — same output the built-in read_file tool produces.