Skip to content

verso-v1.0.18

Choose a tag to compare

@github-actions github-actions released this 02 May 12:49
· 131 commits to main since this release

Release introducing an interactive verso repl command, supervised kernel restart in the VS Code extension, expanded Polyglot Notebook compatibility on Jupyter import, third-party extension loading from a configured directory, a structured VS Code logging channel, and quality-of-life fixes around variable substitution and NuGet reference tracking.

New: verso repl Command

image
  • New repl subcommand launches an interactive REPL session backed by the same kernel infrastructure used by notebooks
  • Two prompt drivers: PrettyPromptDriver for capable terminals (history, multi-line editing, syntax highlighting, completion via Roslyn callbacks) and PlainPromptDriver as a fallback for restricted terminals
  • MinimalHighlighter provides offline syntax highlighting for C#/F#/PowerShell tokens; KernelPromptCallbacks bridges Roslyn completions and signature help into the prompt
  • MimeDispatcher and renderer set (PlainTextRenderer, MarkdownRenderer, JsonRenderer, CsvTableRenderer, HtmlStripRenderer, ImagePlaceholderRenderer) translate kernel outputs to terminal-friendly forms with TruncationPolicy
  • Meta-command set (prefixed with .): .clear, .convert, .exit, .export, .help, .history, .kernel, .layout, .list, .load, .md, .recall, .rerun, .reset, .save, .set, .theme, .vars, .view
  • ReplSession, ReplLoop, and ReplOptions orchestrate the session; ReplSettings and ReplSettingsLoader resolve user preferences from a settings file
  • SignalHandler traps Ctrl+C to interrupt running cells without exiting the session; HistoryStore persists prompt history across sessions
  • TerminalCapabilities probes for color/Unicode support so the REPL degrades gracefully on minimal terminals
  • New ToolbarActionResolver factored out of ExportCommand resolves ExportMenu toolbar actions and themes by DisplayName (case-insensitive) with ActionId/ThemeId fallback, shared by both verso export and the REPL .export meta-command
  • Spectre.Console and PrettyPrompt added to THIRD-PARTY-NOTICES.md

New: Supervised Kernel Restart

  • Scaffold exposes a HostRestartHandler so an external supervisor (e.g. the VS Code extension) can fully tear down and respawn the host process when the user clicks Restart Kernel — addresses the Windows DLL-locking issue where in-process disposal could not release pinned assembly handles
  • New kernel/restartRequested, kernel/restarting, and kernel/restarted JSON-RPC notifications coordinate the restart lifecycle between host, bridge, and webview
  • VS Code BlazorEditorProvider implements the full sequence: capture an in-memory notebook snapshot via notebook/save, gate webview requests, dispose the host, spawn a new one, reopen the notebook, and drain queued requests against the new host
  • BlazorBridge queues incoming jsonrpc-request messages while a restart is in flight and routes kernel/restartRequested notifications (including those raised by #!restart cells) through the same provider sequence
  • RemoteNotebookService handles kernel/restarting, kernel/restarted, and layout/missing notifications and exposes OnKernelRestarting, OnKernelRestarted, and OnLayoutMissing events
  • NotebookPage shows a persistent status banner during the restart, clears execution badges and the variable inspector when the new kernel is ready, and keeps cell sources and outputs visible throughout

New: Missing-Layout Banner

  • LayoutManager records MissingLayoutId and exposes a TryActivate method instead of throwing when a notebook references an unregistered layout — common when the layout ships in an extension that has not yet loaded
  • NotebookHandler emits a layout/missing notification with the unresolved id; the WASM NotebookPage surfaces it as a non-fatal banner directing the user to run the #!extension or #!nuget cell that registers the layout
  • Default layout activates so the notebook stays interactive while the user resolves the missing extension

New: Polyglot Notebook Language Switching on Jupyter Import

  • New JupyterPolyglotPostProcessor translates Polyglot language-switching directives in imported .ipynb files into the right cell types, so notebooks authored in Polyglot Notebooks open without "Unknown magic command" failures at run time
  • Recognized switchers: #!csharp/#!cs/#!c#, #!fsharp/#!fs/#!f#, #!pwsh/#!powershell, #!python/#!py, #!javascript/#!js, #!typescript/#!ts, #!sql, #!html, #!markdown, #!mermaid, #!value
  • A directive appearing mid-cell splits into a new cell of that type below; the original cell keeps its outputs and Id, split-off cells start with empty outputs
  • Multiple consecutive directives produce multiple cells in source order; back-to-back directives without a body collapse to the last one
  • Unknown bare directives (e.g. #!ruby, #!kql) soft-degrade to a code cell with the raw token as its language so kernel resolution surfaces a clearer "no kernel" error
  • Operation directives (#!set, #!share, #!connect, #!time, #!who, #!whos, #!about, #!lsmagic, #!extension, #!import, #!nuget, #!restart, #!meta, #!r, #!i) and any directive with arguments are left in source for the runtime magic dispatcher
  • DibSerializer.DirectiveMap gains the same cs/fs/python/py/typescript/ts aliases for symmetry between .dib and .ipynb imports
  • Built-in extension count bumped from 37 to 38 to account for the new post-processor

New: Third-Party Extension Directory

  • notebook/open accepts an ExtensionsDirectory parameter; when present, the host loads extension assemblies from that directory after built-in discovery
  • VS Code adds a verso.extensionsPath configuration setting and forwards it to the host when opening a notebook; changes apply on the next open or kernel restart
  • A missing or empty directory is logged to the Verso output channel but is non-fatal

Improved: Markdown Variable Substitution

  • MarkdownRenderer now runs VariableSubstitution.Apply(...) on cell source before invoking Markdig, so markdown can include @variable tokens that resolve to current variable values
  • Substitution runs before Markdown parsing so substituted values are rendered as markdown rather than as escaped text
  • Unresolved tokens are preserved verbatim; @@ is an escape sequence that produces a literal @
  • New MarkdownRendererTests cover substitution, ordering relative to parsing, unresolved-token preservation, and the @@ escape

Improved: VS Code Logging

  • New vscode/src/log.ts wraps a LogOutputChannel and exposes trace/debug/info/warn/error/appendLine helpers
  • Activation logs the extension version and the resolved Verso.Host.dll path
  • BlazorBridge and HostProcess route host spawn, spawn errors, exit warnings, stderr output, and JSON parse failures through the structured logger so all diagnostics land in one "Verso" output channel
  • Stderr is split into individual lines before logging so each entry is independently filterable; minor trim() calls switched to trimEnd() to preserve leading whitespace in formatted output

Fixed: Duplicate Assembly References in C# Kernel

  • CSharpKernel tracks added assembly paths in a new _addedAssemblyPaths set so a path arriving twice (e.g. once from a #!nuget magic command and again from a later #r "nuget:" directive in the same cell) is added to the Roslyn references at most once
  • Magic-command assembly paths are consumed from the variable store on the same execution that processes them, so a subsequent cell does not re-process the same paths and misattribute "Installed Packages" feedback to the wrong cell
  • The dedup set is cleared on kernel initialization so a restart starts from a clean slate
  • Re-publishes the full set of added paths to NuGetMagicCommand.AssemblyStoreKey so downstream consumers (e.g. #!sql-connect provider discovery) can still load them

Removed: ResolvedPackagesStoreKey

  • Removed the ResolvedPackagesStoreKey constant (and its duplicate in NuGetReferenceProcessor) along with the code that stored or read List<NuGetResolveResult> from the variable store
  • Was previously used to render an "Installed Packages" summary but produced misattribution across cells; the new dedup path in CSharpKernel covers the underlying need without persisting result objects
  • Assembly references and extension loading behavior are unchanged