mirror of
https://github.com/hanzoai/extension.git
synced 2026-11-02 23:32:11 +00:00
@hanzo/jupyter: a JupyterLab 4 labextension. A side-panel assistant (model picker + prompt + streaming over @hanzo/ai) that reads active-cell / selection / whole-notebook context, plus cell actions (explain, fix from traceback, document, optimize, generate-a-cell). Model calls route through api.hanzo.ai /v1 via the published @hanzo/ai createAiClient; the hk- key lives in the JupyterLab settings registry (schema/plugin.json). Pure core (notebook.ts context/traceback/truncation, hanzo.ts action catalog + request shaping) is unit-tested with vitest (58 tests); the widget layer (index.ts plugin, panel.tsx) is the thin imperative shell. tsc --noEmit clean. Ships a hatch-jupyter-builder pyproject for pip install / PyPI.
23 lines
776 B
Python
23 lines
776 B
Python
"""Hanzo AI for JupyterLab — a prebuilt (federated) JupyterLab 4 extension.
|
|
|
|
The actual extension is JavaScript, shipped under ``hanzo_jupyter/labextension``
|
|
and discovered by JupyterLab at import time. This module only advertises where
|
|
that federated bundle lives so ``jupyter labextension list`` finds it.
|
|
"""
|
|
|
|
import json
|
|
from pathlib import Path
|
|
|
|
_HERE = Path(__file__).parent.resolve()
|
|
|
|
try:
|
|
with (_HERE / "labextension" / "package.json").open() as f:
|
|
__version__ = json.load(f)["version"]
|
|
except FileNotFoundError: # not yet built (e.g. running from source)
|
|
__version__ = "0.1.0"
|
|
|
|
|
|
def _jupyter_labextension_paths():
|
|
"""Tell JupyterLab where this prebuilt extension's assets live."""
|
|
return [{"src": "labextension", "dest": "@hanzo/jupyter"}]
|