or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-5/

Kernel-Linked Text Runner

Create a lightweight runner that binds plain-text/code files to a live kernel session so engineers can execute snippets without converting files into notebooks.

Capabilities

Run selected text via kernel

  • Running the command with a selection executes exactly that text on the active kernel for the document and appends the result to the document's output history. @test
  • When no text is selected, the command executes the line at the cursor and records the result in the same history. @test

Persist output per document

  • Each document keeps its own ordered output history that survives multiple runs until the document is closed; switching documents never mixes histories. @test

Manage kernel-backed sessions

  • Opening a supported text file creates or reuses a kernel session for that file; closing the file cleanly shuts down its session. @test

Toggle preview rendering

  • A command toggles a live preview panel for the active document; when enabled, it updates to reflect the latest content plus any captured run results in fenced code blocks. @test

Implementation

@generates

API

export interface RunResult {
  executionCount: number;
  stdout: string;
  stderr: string;
}

export interface KernelTextRunnerOptions {
  openSession(path: string): Promise<unknown>;
  closeSession(path: string): Promise<void>;
  sendToKernel(session: unknown, code: string): Promise<RunResult>;
  updatePreview(path: string, content: string, history: RunResult[]): void;
  appendOutput(path: string, result: RunResult): void;
}

export class KernelTextRunner {
  constructor(options: KernelTextRunnerOptions);
  attachDocument(path: string, content: string): Promise<void>;
  detachDocument(path: string): Promise<void>;
  executeSelection(params: { path: string; content: string; selection?: { start: number; end: number }; cursorLine: number }): Promise<RunResult>;
  togglePreview(path: string, content: string): void;
  getHistory(path: string): RunResult[];
}

Dependencies { .dependencies }

jupyterlab { .dependency }

Provides kernel-backed text editing, session management, and preview surfaces for documents. @satisfied-by