Repository navigation
verso-v1.0.4
·
282 commits
to main
since this release
Feature release adding the #!extension magic command for dynamic extension loading, a user-consent flow for remote extension packages, support for multiple magic commands per cell, and several VS Code stability fixes.
#!extension Magic Command
- New
#!extensionmagic command for loading Verso extensions at runtime - NuGet packages:
#!extension PackageId [Version]resolves the package, prompts for user consent, loads all[VersoExtension]types, and stores assembly paths for kernel references - Local DLLs:
#!extension ./path/to/MyExtension.dllloads extensions directly from a local assembly file without a consent dialog, with paths resolved relative to the notebook directory - Cross-platform path normalization: backslash paths authored on Windows resolve correctly on macOS/Linux
- Idempotent: re-running a cell that already loaded an extension skips with a message instead of failing
- Developer-friendly error messages for file not found, invalid assemblies, and zero-extension DLLs
Extension Consent Flow
- User-consent dialog shown before loading remote NuGet extension packages
ExtensionConsentDialogBlazor component with styled modal (shared across Server and WASM)- Pre-scan on notebook open:
#!extensiondirectives are detected and consent is requested proactively so packages are pre-approved before cell execution - Pre-scan on Jupyter import: imported notebooks containing
#!extensiondirectives trigger consent during the import flow - Approved packages are tracked per session so subsequent cells referencing the same package skip the consent prompt
ExtensionHost.ConsentHandlerdelegate enables host-agnostic consent routing (Blazor Server shows inline, VS Code WASM routes through JSON-RPC)
Multiple Magic Commands per Cell
- Cells can now contain multiple consecutive magic commands (e.g. two
#!extensionlines, or#!nugetfollowed by#!time) - Execution pipeline loops through magic commands until the first non-magic line, then hands remaining code to the kernel
- Each command executes in order with its own context;
SuppressExecutionfrom any command stops the cell immediately
Dynamic Extension Registration
- Subsystems (
LayoutManager,ThemeEngine,SettingsManager) now refresh when extensions are loaded at runtime viaExtensionHost.OnExtensionLoaded - Dynamically loaded layouts, themes, and settings appear in the UI immediately without a restart or reload
Scaffold.RefreshSubsystems()preserves the active layout and theme selection during refresh
VS Code Extension Fixes
- Deadlock fix: Concurrent stdin reading via
Channel<T>prevents the host process from locking up when extension consent requests block the main loop - Extension change notifications: Host sends
extension/changednotification to the webview when extensions load dynamically; WASM client refreshes cached extension, layout, and theme lists - Modal styling: Extension consent dialog CSS included in the shared Blazor project so it renders correctly in both Server and WASM
- Content Security Policy: Relaxed CSP to allow
https:sources in script, style, font, image, and connect directives, enabling HTML cells to load external libraries (e.g. charting, visualization) - UTF-8 console encoding: Force
Console.InputEncodingandConsole.OutputEncodingto UTF-8 to prevent corruption of non-ASCII JSON-RPC messages on Windows