diff --git a/.protocolbox/SKILL.md b/.protocolbox/SKILL.md index 595573a..f62cfb0 100644 --- a/.protocolbox/SKILL.md +++ b/.protocolbox/SKILL.md @@ -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 @@ -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. diff --git a/CHANGELOG.md b/CHANGELOG.md index 30b4a28..02fb6eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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. @@ -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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b09052a..2a6421f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/README.md b/README.md index 036a83c..ab35957 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # ProtocolBox 📦 -[](LICENSE) -[](https://python.org) -[](https://docs.astral.sh/ruff/) -[](https://modelcontextprotocol.io/) +[](LICENSE) +[](https://github.com/ianuragbhatt/protocolbox/actions) +[](https://github.com/astral-sh/ruff) +[](https://modelcontextprotocol.io/) +[](https://protocolbox.in) > **The Standard Library for the Agentic Web.** > https://protocolbox.in @@ -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 @@ -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 ``` diff --git a/ROADMAP.md b/ROADMAP.md new file mode 100644 index 0000000..d7e5802 --- /dev/null +++ b/ROADMAP.md @@ -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! diff --git a/docs/index.html b/docs/index.html index 8338b3b..eed6020 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,292 +4,917 @@
+