21 Commits
Author SHA1 Message Date
zeekay 369b525882 fix(tools): a screenshot arrives downscaled, with the full capture on disk 2026-08-27 08:45:44 -07:00
zeekay 2f8a7e176a feat(computer): ydotool/uinput backend (Linux) — avoid xdotool/XTEST crashing Tauri/WebKitGTK 2026-06-17 22:06:55 +00:00
zeekay 1a7ec1bad0 fix: Windows + WSL compatibility across python-sdk
Make uvloop fully opt-in (performance extra only, not a hard dep).
Add Windows native support: shell resolution (pwsh/cmd), signal
handling (SIGKILL guard), platform-appropriate paths, chmod guards.

Changes:
- hanzo-mcp: move uvloop from hard dep to [performance] extra
- hanzo-tools-shell: resolve pwsh/powershell/cmd on Windows,
  use correct invocation flags (cmd /c, pwsh -Command)
- hanzo-tools-shell: guard signal.SIGKILL (doesn't exist on Windows)
- hanzo-tools-computer: replace HOME=/tmp fallback with Path.home()
- hanzo-mcp cli: platform-appropriate socket path default
- hanzoai auth: skip os.chmod on Windows
- hanzo install: skip os.chmod on Windows
- Add .github/workflows/test-windows.yml (native + WSL2 matrix)

Versions bumped: hanzo-mcp 0.12.7, hanzo-async 0.1.2,
hanzo-tools-shell 0.6.2, hanzo-tools-computer 0.5.4
2026-03-09 20:50:55 -07:00
zeekay 259d437061 fix: ruff lint errors across hanzo-tools-* packages (I001, F401, F541)
Fix 21 auto-fixable errors: import sorting (I001), unused import (F401),
and empty f-strings (F541) in 13 files across tool packages.
2026-03-06 23:44:10 -08:00
zeekay 30fb202cf0 fix(screen): write captures to file instead of returning inline base64
Screenshots and session frames are now saved to ~/.hanzo/screen/ and
the tool returns the file path. Prevents blowing up context with ~52K
chars of base64 per capture.
2026-03-06 04:18:32 -08:00
zeekay 4ebf26df3e feat(mcp): unify tool surfaces, rename iching→zen, fix test infrastructure
- Consolidate memory tools into single unified surface
- Rename IChingTool → ZenTool across agent tools
- Rename tool files: proc_tool→exec_tool, net_tool→fetch_tool,
  vcs_tool→git_tool, todo_tool→tasks_tool
- Add hanzo_tool.py for unified Hanzo API surface
- Add workspace_tool.py for config management
- Add hanzo-tools-ui package with GitHub API integration
- Add unified.py core tool dispatcher
- Update IAM client to RFC-compliant OAuth endpoints
- Fix pytest-asyncio plugin conflict: pin <1.0.0, fix addopts
  double-registration, and align test APIs to current signatures
- Fix integration tests: PermissionManager API, ReviewProtocol
  focus values, AgentTool parameter names, mock llm module for CI
2026-03-06 03:13:54 -08:00
zooqueenandHanzo Dev b144973bfc fix(lint): resolve all ruff + black errors across all packages
Fix 35 ruff errors (E722, F841, B904, B905, B007, E741, S202, S310,
S306, S110, TID251, UP042, F401) and run black on 526 files.

Co-authored-by: Hanzo Dev <[email protected]>
2026-02-21 23:32:32 -08:00
zooqueenandHanzo Dev 920f767417 style: auto-fix ruff lint and format for Python 3.12
Run ruff check --fix and ruff format across the repo to fix ~495
auto-fixable lint errors (mostly I001 import sorting) and reformat
225 files to match the py312 target.

Co-authored-by: Hanzo Dev <[email protected]>
2026-02-20 21:29:31 -08:00
zeekay 86c2cdcc0d feat: add new tool packages and install command
- Add hanzo-tools-code: code analysis and transformation tools
- Add hanzo-tools-net: network and HTTP tools
- Add hanzo-tools-plan: planning and task management tools
- Add hanzo-tools-test: testing tools
- Add hanzo-tools-vcs: version control tools
- Add install command for dependency management
- Improve CDP bridge server with better error handling
- Add ui_tool for computer tools
- Add unified tool loading and id_tool
- Add HIP documentation (HIP-0300, HIP-0301)
2026-01-24 13:21:16 -08:00
zeekay 36b3ca8455 Add file saving option to screenshot action
When name parameter is provided, screenshot saves to file and returns path
instead of base64 data. This prevents huge MCP responses.

Usage: computer(action='screenshot', name='screen.png')
Returns: {path: '/tmp/screen.png', size: ...}
2026-01-12 18:45:53 -08:00
zeekay e5e9b53175 Fix computer tool list_windows and focus_window bugs
- list_windows: Use unit separator (ASCII 31) instead of "|" as delimiter
  to avoid parsing errors when window titles contain "|" characters
  (e.g., "DNS | Records | hanzo.ai | Cloudflare")
- list_windows: Add try/except around int() parsing to skip malformed entries
- focus_window: Increase timeout from 5s to 10s
- focus_window: Add fallback to partial app name matching via System Events
  when direct app activation fails (handles "Firefox" matching "Firefox Developer Edition")
2026-01-12 18:43:23 -08:00
zeekay 6eac006595 fix(computer): correct docstring to show 2000px Claude limit
The docstring incorrectly showed 1568px as max dimension when
the actual code uses 2000px (Claude's API limit).
2026-01-11 20:44:38 -08:00
zeekay 55703b869c fix(computer): use Claude's actual 2000px limit for multi-image 2026-01-11 20:13:05 -08:00
zeekay 9144211873 feat(computer): add ScreenTool for unified screen recording and Claude interpretation
New 'screen' tool provides one-shot recording → analysis → compression:

screen(action="session", duration=30)  # Record 30s, return compressed frames

ACTIONS:
- session: ONE-SHOT record → analyze → compress → return for Claude
- capture: Single screenshot (optimized)
- record: Start background recording
- stop: Stop and process recording
- analyze: Process existing video file

HARD LIMITS (Claude API constraints):
- Max 1568px per dimension (Claude 2000px limit for multi-image)
- Max 100 images per request
- Max 32MB payload

DEFAULT SETTINGS:
- 768px max dimension (good quality, safe margin)
- 60% JPEG quality (aggressive compression)
- 30 target frames per session
- Activity detection @ 0.02 threshold

USAGE:
  screen(action="session")  # 30s → ~30 frames → ~500KB
  screen(action="capture")  # Single screenshot
  screen(action="analyze", path="recording.mp4")  # Process existing

ENV VARS:
  HANZO_SCREEN_DURATION=30
  HANZO_SCREEN_TARGET_FRAMES=30
  HANZO_SCREEN_MAX_SIZE=768
  HANZO_SCREEN_QUALITY=60

Bump hanzo-tools-computer to v0.5.0
2026-01-11 20:07:08 -08:00
zeekay dbd18eca93 feat(computer): add intelligent video slicing with activity detection
MediaTool v0.4.0 - Smart video compression for Claude interpretation:

NEW ACTIONS:
- analyze: Detect activity segments (movement, scene changes)
- slice: Extract frames ONLY at activity points
- compress_session: Full pipeline for computer use sessions

ACTIVITY DETECTION:
- Frame differencing (PIL + numpy) for movement detection
- FFmpeg scene change detection for major transitions
- Activity clustering into segments with scores
- Configurable sensitivity thresholds

COMPRESSION:
- 512px max dimension for session frames (vs 768px default)
- 60% JPEG quality for aggressive compression
- Target 30 frames per 60-second session
- ~15KB per frame, ~450KB total for typical session

NEW ENV VARS:
  HANZO_MEDIA_ACTIVITY_THRESHOLD=0.02
  HANZO_MEDIA_SCENE_THRESHOLD=0.3
  HANZO_MEDIA_SESSION_MAX_DURATION=60
  HANZO_MEDIA_SESSION_TARGET_FRAMES=30
  HANZO_MEDIA_SESSION_QUALITY=60

Usage:
  media(action="compress_session", path="recording.mp4")
  # Returns compressed keyframes + activity analysis
  # Perfect for Claude to interpret computer use sessions

Added numpy>=1.26.0 dependency for frame differencing.
2026-01-11 19:52:05 -08:00
zeekay e940ca5f1a feat(computer): add MediaTool with configurable limits (100 images, 32MB)
- Add MediaTool for native image/video support with configurable limits
- MediaLimits dataclass configurable via HANZO_MEDIA_* env vars
- Actions: load, load_batch, optimize, resize, extract_frames, info, limits, status
- Hard caps enforced: 100 images, 32MB payload, 4096px max resolution
- Default optimal targets: 768px, 85% JPEG quality
- Fixed requires-python to >=3.12 (was >=3.11)
- Bump hanzo-tools-computer to v0.3.0

Environment variables:
  HANZO_MEDIA_MAX_IMAGES=100       # Max images per batch
  HANZO_MEDIA_MAX_PAYLOAD_MB=32    # Max total payload in MB
  HANZO_MEDIA_MAX_RESOLUTION=1568  # Max image dimension
  HANZO_MEDIA_OPTIMAL_SIZE=768     # Target size for optimization
  HANZO_MEDIA_JPEG_QUALITY=85      # JPEG quality (1-100)
2026-01-11 19:30:45 -08:00
zeekay 8d30e5a9e3 feat(shell): remove cmd, add ksh/tcsh/csh support, shell-first exposure
- Remove 'cmd' from default TOOLS list - only detected shell exposed
- Add KshTool, TcshTool, CshTool for enterprise Unix shells
- Fallback to ShellTool (smart auto-detect) if shell detection fails
- Support ksh93, pdksh, mksh as aliases for ksh
- Bump hanzo-tools-shell to 0.6.1, hanzo-mcp to 0.10.37
2026-01-11 19:22:32 -08:00
zeekay 303a05a616 feat(agent): agentic proxy with agent integration
Enhanced agent tool architecture:
- 8 CLI agents: claude, codex, gemini, grok, qwen, vibe, code, dev
- Auto-detects agent environment for seamless auth
- Shares hanzo-mcp config with spawned agents
- Lightweight - no heavy litellm dependency

Essential tools reorganization:
- Added agent, think, critic to essential tools
- Removed llm/consensus from essential (heavy deps, opt-in)
- HEAVY_TOOLS constant for tracking opt-in tools

Config sharing:
- HANZO_AGENT_PARENT=true passed to child agents
- MCP config env vars propagated
- API keys shared when appropriate
2025-12-26 12:25:16 -08:00
zeekay 2cb7eb03fc feat(hanzo-mcp): unified tool command and essential tools system
Major improvements to mode and tool management:

1. Essential System Tools - Critical tools (llm, consensus, config, mode,
   tool, version, stats) are now ALWAYS enabled regardless of active mode.
   Previously, mode system disabled all tools then only enabled mode-specific
   ones, causing critical tools to be unavailable.

2. Unified 'tool' Command - Consolidates tool_install, tool_enable,
   tool_disable, tool_list into single 'tool' command with actions:
   - list: List all tools by category
   - enable/disable: Toggle tool state
   - install/uninstall: Package management
   - upgrade/reload: Update tools
   - self_update: Update hanzo-mcp

3. Fixed Permission Manager - Made permission_manager optional in:
   - FileSystemTool base class
   - ComputerTool
   - ConfigTool
   - ReadTool, WriteTool, EditTool
   Now creates default PermissionManager if not provided.

4. Fixed Mode System - Builtin modes (hanzo, minimal, fullstack, devops,
   security) are now always registered alongside hanzo-persona profiles.
   Previously they were skipped when hanzo-persona was available.

5. Updated ESSENTIAL_TOOLS constant with modern tool names and added
   llm, consensus, config, mode to ensure they're in all default modes.

Version bump: 0.10.19 -> 0.10.20
2025-12-26 11:09:45 -08:00
zeekay 44e505abf2 feat(hanzo-tools-computer): v0.2.0 - comprehensive Mac automation
- Add window management: get_active_window, list_windows, focus_window
- Add screen management: get_screens, screen_size, current_screen
- Add region abstractions: define_region, region_screenshot, region_locate
- Add image utilities: locate_all, wait_for_image, wait_while_image
- Add pixel operations: pixel, pixel_matches with tolerance
- Add timing controls: set_pause, set_failsafe, countdown
- Add input helpers: write (with clear), key_down/key_up, move_relative
- Add batch operations: run multiple actions in one call
- Performance: thread pool executor, cached screen info, faster polling
- All operations non-blocking with async-first design
2025-12-26 06:45:07 -08:00
zeekay 7ff34ba5bf feat(hanzo-tools): v0.10.17 - modular tool packages + computer control
- Add hanzo-tools-computer package for pyautogui Mac automation
- Fix hanzo-tools-agent imports to use new package structure
- Add get_read_only_*_tools() helpers to filesystem/jupyter
- Remove BatchTool (replaced by dag - one tool per capability)
- Remove hanzo-persona dependency (not published yet)
- Simplify pyproject.toml for local development

Packages ready for PyPI:
- hanzo-tools-core
- hanzo-tools-filesystem
- hanzo-tools-shell
- hanzo-tools-browser
- hanzo-tools-memory
- hanzo-tools-todo
- hanzo-tools-reasoning
- hanzo-tools-lsp
- hanzo-tools-refactor
- hanzo-tools-database
- hanzo-tools-agent
- hanzo-tools-jupyter
- hanzo-tools-editor
- hanzo-tools-computer (NEW)
2025-12-26 06:37:28 -08:00