Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .protocolbox/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: protocolbox
description: >
Standard Library of verified tools for AI Agents.
Tools: scrape(url), heal_json(str), generate_invoice(dict).
Tools: scrape(url), heal_json(str).
---

# ProtocolBox
Expand Down Expand Up @@ -31,5 +31,3 @@ uv run protocolbox start

- **scrape(url: str) -> str** — Fetch a web page and return clean Markdown.
- **heal_json(broken_json: str) -> dict** — Fix malformed JSON from LLM output.
- **generate_invoice(data: dict) -> str** — Generate a PDF invoice.
Requires `client_name` and `total` in data.
26 changes: 22 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.4] - 2026-02-15

### Added
- **Web Search** (`web_search`): Privacy-focused web search using DuckDuckGo with Markdown-formatted results.
- **Safe Math** (`safe_math`): Secure mathematical expression evaluator using `ast.parse` (no `eval()`). Supports arithmetic and `math` functions.
- **Get Time** (`get_time`): Real-world time retrieval for any timezone using `pytz`, returns ISO 8601 format.
- **Get Transcript** (`get_transcript`): YouTube video transcript fetcher via `youtube-transcript-api`.
- **Memory** (`remember` / `recall`): Persistent local key-value store using `~/.protocolbox/memory.json`.
- **Tests**: 184 new edge-case tests (283 total) covering all new tools — security, error handling, unicode, and boundary conditions.

### Fixed
- **YouTube Tool**: Migrated to `youtube-transcript-api` v1.x instance-based API (`api.fetch()` instead of removed `get_transcript()` class method).

### Dependencies
- Added `duckduckgo-search`, `youtube-transcript-api`, and `pytz`.

## [0.1.3] - 2026-02-15

### Removed
- **Invoice Tool**: Removed `generate_invoice()` tool and all related code, tests, and documentation.
- **Dependency**: Removed `reportlab` from project dependencies (was only used by the invoice tool).

## [0.1.2] - 2026-02-14

### Fixed
Expand Down Expand Up @@ -34,9 +56,6 @@ ProtocolBox v0.1.0 establishes the "Standard Library for the Agentic Web," provi
- `heal_json(broken_json)`:
- deterministic recovery of malformed JSON from LLM outputs.
- Fixes trailing commas, missing quotes, unclosed brackets, and truncated strings.
- `generate_invoice(data)`:
- Generates professional PDF invoices from structured Python dictionaries.
- Supports line items, tax calculations, and custom notes.

- **Developer Experience**
- **CLI**: `protocolbox init` for environment setup and `protocolbox start` for running the server.
Expand All @@ -61,4 +80,3 @@ ProtocolBox v0.1.0 establishes the "Standard Library for the Agentic Web," provi

- All dependencies pinned via `uv.lock`.
- No external API key requirements for core tools.
- Sandboxed PDF generation.
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ protocolbox/
│ ├── utils.py # Shared utilities (HTTP client)
│ ├── scraper.py # scrape() tool
│ ├── json_healer.py # heal_json() tool
│ └── invoice.py # generate_invoice() tool
│ ├── search.py # web_search() tool
│ ├── math_utils.py # safe_math() tool
│ ├── time_utils.py # get_time() tool
│ ├── youtube.py # get_transcript() tool
│ └── memory.py # remember() + recall() tools
├── tests/ # Test suite (mirrors tool structure)
├── docs/ # Documentation & landing page
├── pyproject.toml # Project config
Expand Down
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# ProtocolBox 📦

[![License: MIT](https://img.shields.io/badge/License-MIT-white.svg)](LICENSE)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-white.svg)](https://python.org)
[![Ruff](https://img.shields.io/badge/linting-ruff-white.svg)](https://docs.astral.sh/ruff/)
[![MCP](https://img.shields.io/badge/protocol-MCP-white.svg)](https://modelcontextprotocol.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](LICENSE)
[![Build Status](https://img.shields.io/github/actions/workflow/status/ianuragbhatt/protocolbox/ci.yml?branch=master&style=for-the-badge)](https://github.com/ianuragbhatt/protocolbox/actions)
[![Code Style: Ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg?style=for-the-badge)](https://github.com/astral-sh/ruff)
[![MCP Compliant](https://img.shields.io/badge/MCP-Compliant-orange?style=for-the-badge)](https://modelcontextprotocol.io/)
[![Built for Antigravity](https://img.shields.io/badge/Built%20for-Antigravity-purple?style=for-the-badge)](https://protocolbox.in)

> **The Standard Library for the Agentic Web.**
> https://protocolbox.in
Expand All @@ -24,13 +25,18 @@ protocolbox init

## 🛠️ Tools

ProtocolBox currently exports 3 core tools optimized for agent workflows:
ProtocolBox currently exports 8 tools optimized for agent workflows:

| Tool | Signature | Description |
| :--- | :--- | :--- |
| **Scrape** | `scrape(url: str) -> str` | Fetches a webpage and converts it to clean, token-saving Markdown. Removes ads, scripts, and clutter automatically. |
| **Heal JSON** | `heal_json(json_str: str) -> dict` | repairs malformed JSON strings often produced by LLMs (trailing commas, missing quotes, etc.) into valid Python dictionaries. |
| **Invoice** | `generate_invoice(data: dict) -> str` | Generates a professional PDF invoice from structured data in milliseconds. |
| **Heal JSON** | `heal_json(json_str: str) -> dict` | Repairs malformed JSON strings often produced by LLMs (trailing commas, missing quotes, etc.) into valid Python dictionaries. |
| **Web Search** | `web_search(query: str, max_results: int) -> str` | Privacy-focused web search using DuckDuckGo. Returns formatted Markdown results. |
| **Safe Math** | `safe_math(expression: str) -> str` | Securely evaluates mathematical expressions without `eval()`. Supports arithmetic and common math functions. |
| **Get Time** | `get_time(timezone: str) -> str` | Returns the current real-world time in any timezone (ISO 8601 format). |
| **Get Transcript** | `get_transcript(video_url: str) -> str` | Fetches the English transcript of a YouTube video as clean text. |
| **Remember** | `remember(key: str, value: str) -> str` | Stores a key-value pair in persistent local memory. |
| **Recall** | `recall(key: str) -> str` | Retrieves a value from persistent local memory by key. |

## ⚡ Usage

Expand All @@ -54,7 +60,14 @@ protocolbox/
│ ├── server.py # FastMCP server
│ ├── cli.py # CLI entry point
│ └── tools/ # Tool implementations
├── tests/ # 115+ edge-case tests
│ ├── scraper.py # scrape()
│ ├── json_healer.py# heal_json()
│ ├── search.py # web_search()
│ ├── math_utils.py # safe_math()
│ ├── time_utils.py # get_time()
│ ├── youtube.py # get_transcript()
│ └── memory.py # remember() + recall()
├── tests/ # 280+ edge-case tests
├── docs/ # Documentation site
└── pyproject.toml # Project config
```
Expand Down
34 changes: 34 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# ProtocolBox Roadmap 🗺️

This document outlines the development trajectory for ProtocolBox. We prioritize tools that provide high-leverage capabilities to AI Agents (scrapers, browsers, sandbox execution).

## ✅ Completed (v0.1.x)

- [x] **Core Tools**: `scrape(url)`, `heal_json(broken_json)` — web scraping and JSON repair.
- [x] **Daily Drivers** (v0.1.4): `web_search`, `safe_math`, `get_time`, `get_transcript`, `remember`, `recall`.
- [x] **CLI**: `protocolbox init` and `protocolbox start` commands.
- [x] **CI/CD**: GitHub Actions, Ruff linting, automated PyPI publishing.
- [x] **Test Suite**: 280+ edge-case tests with 100% pass rate.

## 🚀 Q1 2026 Objectives (v0.2.0)

### New Tools
- [ ] **`browser`**: Headless browser control for interacting with dynamic JS-heavy sites (beyond simple scraping).
- [ ] **`filesystem`**: Safe, sandboxed file I/O permissions for agents to read/write their own workspace.

### Infrastructure
- [ ] **Docker Image**: Official `protocolbox/server` image for easy deployment in containerized agent swarms.
- [ ] **Auth**: Simple Bearer token authentication for the MCP server.

## 🔮 Future Concepts (v0.3.0+)

- **Agent Sandbox**: A secure Python execution environment (REPL) for agents to run generated code safely.
- **Vector Memory**: Built-in simple RAG interface for agents to store/retrieve context across sessions.
- **Multi-Modal**: Tools for resizing/converting images and processing audio.

## 🤝 How to contribute

See a feature here you want?
1. Check [Issues](https://github.com/ianuragbhatt/protocolbox/issues) to see if it's already in progress.
2. Comment on the issue or open a new one expressing interest.
3. Submit a PR!
Loading