Skip to content

feat(runtimed-wasm): expose typed metadata and runtime detection on WASM handle#568

Merged
rgbkrk merged 1 commit intomainfrom
540/wasm-metadata-phase0
Mar 6, 2026
Merged

feat(runtimed-wasm): expose typed metadata and runtime detection on WASM handle#568
rgbkrk merged 1 commit intomainfrom
540/wasm-metadata-phase0

Conversation

@rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Mar 6, 2026

Phase 0 of the WASM metadata migration plan. Exposes typed metadata reads on the WASM NotebookHandle so the frontend can read from its local Automerge doc instead of going through Tauri IPC.

WASM API additions

// Get the full metadata as a typed JSON string
handle.get_metadata_snapshot_json()  // → string | undefined

// Detect runtime from kernelspec/language_info
handle.detect_runtime()              // → "python" | "deno" | undefined

These call through to the already-existing NotebookDoc methods from the notebook-doc shared crate (#562, #566).

Dead code removal

  • get_deno_permissions — zero frontend callers
  • set_deno_permissions — zero frontend callers

QA

  • Existing notebook operations work unchanged (this PR adds API surface, doesn't change any callers yet)
  • WASM artifacts build cleanly

WASM binary size: 1104KB → 1194KB (+90KB from pulling in serde_json serialization for the metadata snapshot and the metadata module's types). The notebook-doc crate now includes the metadata types that were previously only in runtimed.

Next: Phase 2 will migrate the read-only Tauri commands (get_notebook_runtime, get_notebook_dependencies, etc.) to use these WASM methods instead of invoke().

…ASM handle

Phase 0 of the WASM metadata migration plan.

WASM additions:
- get_metadata_snapshot_json() — returns NotebookMetadataSnapshot as JSON
- detect_runtime() — returns 'python', 'deno', or undefined

These call through to the existing notebook-doc methods, making typed
metadata reads available to the frontend without Tauri IPC.

Also removes dead Tauri commands: get_deno_permissions, set_deno_permissions
(zero frontend callers).

WASM artifacts rebuilt with wasm-pack.
@rgbkrk rgbkrk enabled auto-merge (squash) March 6, 2026 17:51
@rgbkrk rgbkrk merged commit 31fa0cd into main Mar 6, 2026
10 checks passed
@rgbkrk rgbkrk deleted the 540/wasm-metadata-phase0 branch March 6, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant