or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-8/

Kernel-Linked Console Helper

A helper that opens a scratch code console tied to an existing notebook kernel, routes code into it in order, and keeps a simple execution log.

Capabilities

Link console to notebook kernel

  • When given a notebook identifier and optional starter code, opens a kernel-backed console sharing that notebook's kernel, runs the starter code, and returns the first prompt number and outputs @test

Execute code with ordered prompts

  • Each call to run code in the linked console executes in sequence, increments the prompt number, returns text outputs in order, and records the prompt log retrievable in chronological order @test

Share kernel state with the notebook

  • Values defined through console execution are visible when later echoing them through the notebook kernel, proving the console uses the same session @test

Dispose console cleanly

  • Disposing the linked console closes the scratch console UI, releases the kernel link, and rejects further run requests without shutting down the notebook kernel @test

Implementation

@generates

API

export interface LinkRequest {
  notebookId: string;
  initialCode?: string;
}

export interface ConsoleRunResult {
  promptNumber: number;
  outputs: string[];
}

export interface LinkedConsoleController {
  runInConsole(code: string): Promise<ConsoleRunResult>;
  getPromptHistory(count?: number): ConsoleRunResult[];
  dispose(): Promise<void>;
  isDisposed(): boolean;
}

export async function linkNotebookConsole(request: LinkRequest): Promise<LinkedConsoleController>;

Dependencies { .dependencies }

JupyterLab workspace { .dependency }

Requires a package that provides kernel-backed code consoles, notebook session contexts, and workspace layout management. @satisfied-by