or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-10/

Workspace Snapshot Toolkit

A utility for capturing, storing, and sharing JupyterLab workspace layouts.

Capabilities

Snapshot active layout

  • Captures the layout for a given workspace id from a running server and writes a JSON snapshot to disk that preserves the returned id and layout data blocks. @test

Restore or clone layout

  • Loads a saved snapshot and applies it to the server under a target workspace id (defaulting to the snapshot's id) so reopening the workspace reflects the same panel arrangement, replacing the id in the payload when cloning. @test

Shareable workspace link

  • Returns a shareable URL for a workspace id using the server base URL in the /lab/workspaces/<id> format so another user can open the saved layout directly. @test

Implementation

@generates

API

export interface WorkspaceSnapshot {
  id: string;
  data: unknown;
  path: string;
}

/**
 * Fetch the current layout for the given workspace id and write it to a JSON file.
 * Returns the snapshot metadata including the saved path.
 */
export function saveWorkspaceSnapshot(options: {
  baseUrl: string;
  token?: string;
  workspaceId: string;
  outputPath: string;
}): Promise<WorkspaceSnapshot>;

/**
 * Read a previously saved snapshot file and apply it to the server under targetWorkspaceId (or the snapshot's id when omitted).
 */
export function restoreWorkspaceSnapshot(options: {
  baseUrl: string;
  token?: string;
  snapshotPath: string;
  targetWorkspaceId?: string;
}): Promise<void>;

/**
 * Build a shareable URL that opens the workspace by id using the server base URL.
 */
export function buildWorkspaceUrl(baseUrl: string, workspaceId: string): string;

Dependencies { .dependencies }

jupyterlab { .dependency }

Provides workspace REST endpoints and base URL/token helpers needed to retrieve and apply layouts.

@satisfied-by