Metadata-Version: 2.4
Name: hdsp-jupyter-extension
Version: 2.0.34
Summary: HDSP Agent JupyterLab Extension - Thin client for Agent Server
Project-URL: Homepage, https://github.com/yourusername/hdsp-agent
Project-URL: Bug Tracker, https://github.com/yourusername/hdsp-agent/issues
Project-URL: Repository, https://github.com/yourusername/hdsp-agent.git
Author-email: Your Name <your.email@example.com>
License-File: LICENSE
Classifier: Framework :: Jupyter
Classifier: Framework :: Jupyter :: JupyterLab
Classifier: Framework :: Jupyter :: JupyterLab :: 4
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: aiohttp>=3.11.0
Requires-Dist: certifi>=2024.0.0
Requires-Dist: deepagents>=0.1.0
Requires-Dist: httpx>=0.28.0
Requires-Dist: json-repair==0.44.1
Requires-Dist: jupyter-server<3,>=2.0.1
Requires-Dist: langchain-core>=1.0.0
Requires-Dist: langchain-openai>=0.3.0
Requires-Dist: langchain>=1.0.0
Requires-Dist: langgraph>=1.0.0
Requires-Dist: psutil>=5.9.8
Requires-Dist: pydantic>=2.10.0
Requires-Dist: tabulate>=0.9.0
Requires-Dist: uvicorn>=0.32.0
Provides-Extra: embedded
Requires-Dist: qdrant-client>=1.12.0; extra == 'embedded'
Requires-Dist: rank-bm25>=0.2.2; extra == 'embedded'
Requires-Dist: watchdog>=6.0.0; extra == 'embedded'
Provides-Extra: test
Requires-Dist: coverage; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-asyncio; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-jupyter[server]>=0.6.0; extra == 'test'
Description-Content-Type: text/markdown

# HDSP Jupyter Extension

JupyterLab extension that connects to the HDSP Agent Server for AI-powered code assistance.

## Architecture

This extension is a thin client that:
- Proxies all AI requests to the HDSP Agent Server (FastAPI)
- Provides the JupyterLab frontend UI
- Handles Jupyter-specific integration (kernel communication, notebook manipulation)

```
[JupyterLab Frontend] → [Jupyter Extension (Proxy)] → [Agent Server :8000]
```

## Prerequisites

- **Agent Server**: Must be running on `http://localhost:8000` (or configured via `AGENT_SERVER_URL`)
- **JupyterLab**: Version 4.0 or higher

## Installation

### Development Installation

```bash
# Install dependencies
yarn install

# Build extension
yarn build

# Install in JupyterLab (development mode)
pip install -e .
jupyter labextension develop . --overwrite
```

### Starting the Development Environment

```bash
# Terminal 1: Start Agent Server
cd ../../agent-server
poetry install
poetry run uvicorn agent_server.main:app --reload --port 8000

# Terminal 2: Start Jupyter with extension
cd extensions/jupyter
jupyter lab
```

## Configuration

Set the Agent Server URL via environment variable:

```bash
export AGENT_SERVER_URL=http://localhost:8000
jupyter lab
```

Or in `~/.jupyter/hdsp_agent_config.json`:

```json
{
  "agent_server_url": "http://localhost:8000",
  "provider": "gemini"
}
```

## Development

### Watch Mode

```bash
# Terminal 1: Watch TypeScript
yarn watch:src

# Terminal 2: Watch labextension
yarn watch:labextension
```

### Testing

```bash
# Run UI tests (requires Agent Server)
yarn test:ui

# Run UI tests with browser visible
yarn test:ui:headed
```

## API Endpoints (Proxied to Agent Server)

| Jupyter Endpoint | Agent Server Endpoint |
|------------------|----------------------|
| `/hdsp-agent/config` | `/config` |
| `/hdsp-agent/auto-agent/plan` | `/agent/plan` |
| `/hdsp-agent/auto-agent/refine` | `/agent/refine` |
| `/hdsp-agent/auto-agent/replan` | `/agent/replan` |
| `/hdsp-agent/chat/message` | `/chat/message` |
| `/hdsp-agent/chat/stream` | `/chat/stream` |

## License

MIT
