Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

add sandboxed NotebookEdit tool for Jupyter notebook editing #64

Description

@yai-dev

Summary

Add a sandboxed NotebookEdit tool for cell-level editing of Jupyter notebooks.

Background

Editing .ipynb files through generic text replacement is brittle because notebook content is JSON-encoded, cell indices matter, and code-cell outputs typically need cleanup after edits.

Proposed API

This should target the current sandbox/capability layout rather than a non-existent standalone sandbox package.

Suggested landing area:

  • packages/capabilities/src/sandbox/tools/sandboxed-notebook-edit.ts

Suggested factory shape:

export function createSandboxedNotebookEdit(...): RuntimeTool

Operations

  • insert
  • replace
  • delete

Semantics to Pin Down

  • preserve existing notebook/cell metadata unless explicitly overwritten
  • clear outputs and reset execution state on code-cell replace
  • keep notebook JSON round-trippable without lossy rewrites

Acceptance Criteria

  • Sandboxed notebook edit tool is exported through the current capability package
  • Insert / replace / delete operations are supported
  • Replacing a code cell clears outputs safely
  • Notebook JSON round-trips without data loss
  • Unit tests cover all operations and metadata preservation

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsandboxRelated to @agentrail/sandbox package

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions