Skip to content

verso-v1.0.20

Choose a tag to compare

@github-actions github-actions released this 24 May 18:50
· 119 commits to main since this release

Release adding opt-in .ipynb round-trip save so Jupyter notebooks can be edited and saved in Verso without forcing a conversion to .verso, live host streaming and interactive Read-Host support in the PowerShell kernel, per-cell view-state honored across the verso run CLI and HTML/Markdown exporters, smarter SQL handling for BEGIN/END/CASE blocks and @@global session variables, sibling-cell run buttons disabled while a cell is executing, plus fixes for Write-Warning being emitted twice and host protocol output bleeding into cell output when a kernel captures stdout.

Thanks to @eosfor for contributing PR #48 in this release.

New: Opt-In .ipynb Round-Trip Save

  • JupyterSerializer.SerializeAsync now writes Jupyter nbformat v4 (kernelspec, list-of-strings source, execution counts, stream/error/display_data outputs) instead of throwing NotSupportedException; cell outputs round-trip when the toggle is on
  • Host notebook/save accepts an optional format parameter and resolves the matching serializer via ExtensionHost.GetSerializers(), falling back to verso for clients that do not send the field
  • VS Code adds a verso.preserveOriginalFormat setting (default off); when on and the document ends in .ipynb, the editor saves back as .ipynb instead of writing a sibling .verso
  • CLI gains a --preserve-format flag on verso repl and verso serve (default off); .save with no path honors the original .ipynb extension, while explicit .save foo.ipynb is always respected
  • ServerNotebookService selects JupyterSerializer when PreserveFormat is set and the loaded path is .ipynb
  • Verso-specific cell types collapse to Jupyter raw cells with the original type stashed in cell.metadata.verso_type; layouts, parameter definitions, and theme preferences have no Jupyter representation and do not round-trip
  • README, vscode/README.md, src/Verso.Cli/README.md, docs/architecture/engine.md, docs/architecture/front-ends.md, and docs/migration/from-jupyter.md updated to describe the opt-in and its round-trip semantics

New: PowerShell Host UI Streaming and Interactive Input

  • PowerShell kernel now hosts a custom PSHostUserInterface; Write-Host, Write-Verbose, Write-Debug, and Write-Warning stream live through the host callback as the pipeline runs rather than appearing only after the cell completes
  • Read-Host is supported through IExecutionContext.RequestInputAsync; the Blazor Server NotebookPage displays a modal dialog and switches to a password input when the kernel requests a secure read
  • Cell run and run-all handlers start execution on a background task so the Blazor Server circuit can process modal submit, cancel, and close events while a Read-Host cell is waiting for input
  • Information stream filters records tagged PSHOST that already reached the host callback, and final InformationLines are deduplicated against plain-text outputs streamed during the same execution so Write-Information -InformationAction Continue no longer renders twice
  • Verso.PowerShellHost adapter has been folded into Verso.PowerShell as an internal Verso.PowerShell.Kernel.Host namespace; architecture docs updated accordingly
  • SupportsVirtualTerminal is disabled while ANSI escape sequences are stripped, avoiding advertising VT support the host cannot honor yet
  • ServerNotebookService subscribes to Scaffold.OnCellOutputUpdated and forwards updates through OnOutputUpdated so verso serve repaints running cells as host output arrives; cancellation and password-mode flags propagate through the input flow
  • Regression coverage added for live output forwarding, Read-Host happy path, Read-Host cancellation, password flag propagation, modal submit/cancel/password rendering, and Write-Information output

New: Per-Cell View-State in CLI and Exporters

  • New ExportOptions.RespectCellViewState flag (default on) and a CellViewStateReader utility expose user-actionable per-cell view-state metadata (verso:ui.*) to non-interactive consumers
  • HTML and Markdown exporters respect layout visibility from CellVisibilityResolver, skip or hide cells based on combined layout and view-state, render truncated text previews with a footer when requested, and separate code-source rendering from outputs
  • verso run accepts a new --ignore-view-state flag to opt out of honoring per-cell view state for headless runs
  • OutputRenderer honors outputVisibility and inputCollapsed metadata with preview-line truncation; TerminalRenderer skips or partially surfaces outputs accordingly while still showing errors, and treats preview as expanded in the interactive REPL
  • CellViewStateReader is now public; exported HTML and Markdown no longer duplicate rendered markdown outputs because markdown-cell outputs are skipped in exporters
  • Tests cover hidden and preview outputs, input-collapsed markdown, custom preview line counts, and the disable-view-state path

Improved: SQL Statement Splitting

  • SqlStatementSplitter tracks BEGIN/END and CASE/END control-flow blocks so semicolons inside those blocks are no longer treated as statement separators
  • Whole-word keyword matching via helper methods (IsWordChar, IsWordBoundaryStart, MatchKeyword, IsTransactionalBegin)
  • Transactional BEGIN variants (BEGIN TRAN, TRANSACTION, DISTRIBUTED, DIALOG, CONVERSATION) are recognized and excluded from block tracking
  • Unit tests cover nested blocks, TRY/CATCH, transactional BEGINs, CASE expressions, string and identifier edge cases, lowercase keywords, and stray END handling

Improved: SQL Parameter Detection Skips @@globals

  • Parameter regex switches to a negative lookbehind ((?<!@)@(\w+)) so T-SQL and MySQL session variables like @@SPID and @@VERSION are no longer flagged as unresolved parameters
  • Tests verify that globals produce no warnings, mixed queries warn only for real parameters, and globals at the start of a query are ignored

Improved: Sibling Cell Run Buttons During Execution

  • Cell, DashboardCell, and DashboardGrid accept a new IsRunDisabled parameter; both WASM and Blazor Server NotebookPage propagate it so run buttons on non-executing cells are disabled while a cell is running
  • Run button title shows a contextual tooltip when disabled; disabled state accounts for either the cell itself executing or a global run-disabled flag
  • Unit test verifies sibling run buttons disable during execution and re-enable on completion

Improved: WebView Resource Isolation

  • blazorEditorProvider.ts drops context.extensionUri from the webview's localResourceRoots, leaving only the WASM root so the webview can no longer load arbitrary files from the extension installation

Fixed: Duplicate Write-Warning Output in PowerShell

  • Write-Warning was being emitted twice: once live via the host UI's WriteWarningLine (formatted as WARNING:) and again after pipeline completion via ps.Streams.Warning aggregation (formatted as [WARNING])
  • Removed WarningLines from InvokeResult and stopped consuming ps.Streams.Warning; the host UI's live emission is now the single source of truth, matching how Write-Verbose and Write-Debug already worked
  • Regression tests added asserting Write-Warning, Write-Error, Write-Verbose, and Write-Debug each produce exactly one output

Fixed: Host Protocol Output Captured by Kernel Console.SetOut

  • Kernels that call Console.SetOut to capture per-evaluation stdout could cause host protocol notifications to be re-emitted as cell output
  • Protocol writer now binds to Console.OpenStandardOutput() (UTF-8 without BOM) instead of Console.Out; SendLine accepts a TextWriter and uses WriteLine/Flush
  • All call sites including the HostReady notification updated to use the new writer so captured stdout cannot leak into cell output