Files
hanzo-dev 0a61b93bcc feat: hanzo-dev Python TUI + LSP + hooks + sandbox + vim + git + multi-auth + full parity
Rename hanzo-repl → hanzo-dev to match @hanzo/dev (Rust/TS).

New packages:
- hanzo-lsp: async LSP client (diagnostics, go-to-def, references, context enrichment)
- hanzo-hooks: pre/post tool use hooks (shell scripts, exit-code deny)
- hanzo-sandbox: container detection, filesystem isolation, Linux unshare

hanzo-dev TUI:
- Vim keybindings (Normal/Insert/Visual/Command modes, 37 tests)
- Git slash commands (/branch /commit /worktree /diff /stash, 13 tests)
- All slash commands at parity: /model /permissions /clear /resume /memory
  /init /export /session /plan /solve /code /auto /fast /remote-control
- Multi-provider auth: Anthropic OAuth, OpenAI device code, Hanzo PKCE, auto-detect

Auth:
- login_with_anthropic() — PKCE via console.hanzo.ai
- login_with_openai() — device code flow via auth.openai.com
- login_auto() — env var detection + saved credential fallback
- OAuthCredentialStore supports provider keys (hanzo/anthropic/openai)

Parity test suite (38 tests): SSE, MCP normalization, permissions, compaction,
token usage, PKCE RFC vector, config, backoff, session roundtrip, hooks.

348 tests total, 0 failures across Python + Rust + Universe E2E.
2026-04-01 10:41:46 -07:00

83 lines
2.3 KiB
Bash
Executable File

#!/bin/bash
# Hanzo AI SDK - Single Package Publishing Script
# Usage: ./scripts/publish-single.sh package-name
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
if [ $# -eq 0 ]; then
echo -e "${RED}Usage: $0 <package-name>${NC}"
echo "Available packages:"
echo " • hanzoai (main AI client)"
echo " • hanzo (CLI and network)"
echo " • hanzo-mcp (MCP tools)"
echo " • hanzo-memory (memory systems)"
echo " • hanzo-network (distributed compute)"
echo " • hanzo-agents (multi-agent workflows)"
echo " • hanzo-dev (interactive dev environment)"
exit 1
fi
PKG_NAME=$1
echo -e "${BLUE}====================================${NC}"
echo -e "${BLUE}Publishing $PKG_NAME${NC}"
echo -e "${BLUE}====================================${NC}"
echo
# Check for PYPI_TOKEN
if [ -z "$PYPI_TOKEN" ]; then
echo -e "${RED}Error: PYPI_TOKEN environment variable not set${NC}"
echo "Set it with: export PYPI_TOKEN='your-token'"
exit 1
fi
# Find package directory
PKG_DIR=""
if [ -f "pyproject.toml" ] && grep -q "name = \"$PKG_NAME\"" pyproject.toml; then
PKG_DIR="."
elif [ -d "pkg/$PKG_NAME" ] && [ -f "pkg/$PKG_NAME/pyproject.toml" ]; then
PKG_DIR="pkg/$PKG_NAME"
else
echo -e "${RED}Error: Package $PKG_NAME not found${NC}"
exit 1
fi
echo -e "${YELLOW}Package directory: $PKG_DIR${NC}"
# Get current version
VERSION=$(cd "$PKG_DIR" && python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo -e "${YELLOW}Current version: $VERSION${NC}"
echo
# Clean previous builds
echo "Cleaning previous builds..."
rm -rf "$PKG_DIR/dist/" "$PKG_DIR/build/" "$PKG_DIR"/*.egg-info 2>/dev/null || true
# Build package
echo "Building package..."
(cd "$PKG_DIR" && python -m build)
# Show built files
echo "Built files:"
ls -la "$PKG_DIR/dist/"
echo
# Upload to PyPI
echo "Uploading to PyPI..."
(cd "$PKG_DIR" && python -m twine upload --username __token__ --password "$PYPI_TOKEN" dist/*)
echo
echo -e "${GREEN}====================================${NC}"
echo -e "${GREEN}$PKG_NAME $VERSION published successfully!${NC}"
echo -e "${GREEN}====================================${NC}"
echo
echo -e "${YELLOW}Install with: pip install $PKG_NAME${NC}"
echo