feat: scaffold JigAi v0.1.0 - #1
Merged
Merged
Conversation
- Python 3.10+ support - Full dependency list: typer, fastapi, uvicorn, websockets, zeroconf, pyyaml, rich, pydantic - Dev extras: pytest, ruff, mypy - Trusted publishing setup for PyPI - GitHub URLs pointing to nafistiham/jigai
- Session tracks tool name, command, PID, status, working dir - IdleEvent carries detection method, tool name, last output, session context - SessionStatus enum: active / idle / stopped - Pydantic v2 models with serialization support
- JigAiConfig with nested models: server, notifications, detection, sessions - NotificationConfig includes sound, redact_patterns, only_when_away flag - Auto-creates ~/.jigai/ directory on first use - Safe YAML loading with fallback to defaults - save_default_config() helper for jigai config init
…emini CLI, Aider, OpenCode - Built-in patterns for all major AI coding tools - PatternRegistry with match_any() and tool name lookup - User-overridable via ~/.jigai/patterns.yaml - detect_tool_from_command() auto-identifies tool from argv - Invalid regex patterns are skipped gracefully - 30s timeout fallback, 5s cooldown between notifications
- Forks child process inside a proper pseudo-terminal - All I/O proxied unchanged — child behaves identically to direct launch - Handles terminal resize (SIGWINCH) and passes through raw keystrokes - on_output callback receives every byte of child stdout for detection - Clean teardown on child exit or KeyboardInterrupt
…meout - Strips ANSI escape codes before matching (handles rich TUI output) - Layered detection: tool-hinted match first, then all-tool scan, then timeout - Cooldown prevents notification floods on repeated idle patterns - Output buffer (last 50 lines) for notification context - Sensitive data redaction via configurable regex patterns
…ctor - Watcher ties PTY proxy, idle detector, notifier, and server client together - Accumulates partial lines (prompts without newline) for pattern matching - _last_meaningful_line() strips box-drawing chars and finds real output text - Background thread runs timeout checks every second - Skips notification if terminal is focused (only_when_away config)
- Uses terminal-notifier when installed (banner popups) - Falls back to osascript when terminal-notifier is not available - is_terminal_focused() checks frontmost app via System Events - only_when_away config skips notification if user is at a terminal - Input sanitized to prevent osascript injection via quote/backslash escaping
- REST endpoints: /api/sessions, /api/events (register, unregister, push) - WebSocket endpoint /ws broadcasts idle events to all connected clients - ConnectionManager handles connect/disconnect and broadcast - mDNS service registration so mobile clients auto-discover server on LAN - get_local_ip() resolves machine's LAN IP for display at startup
- ServerClient wraps all REST calls to the local JigAi server - is_server_running() used at startup to detect running server - push_event() sends IdleEvent JSON to /api/events - register_session() and unregister_session() for session lifecycle - Silently ignores connection errors (server is optional)
…s commands - jigai watch: wraps any command, connects to server if running - jigai server start/status: manage LAN notification server - jigai config init/show/test: config management and pattern testing - jigai patterns: display all loaded patterns in a Rich table - jigai sessions: list active sessions via server REST API - Startup banner shown once before wrapped tool launches, then silent
- 46 tests covering core detection logic, pattern loading, config defaults - TestStripAnsi verifies ANSI codes are stripped before matching - TestDetector covers pattern detection, tool hints, cooldown, buffer, redaction - TestTimeoutDetection covers idle trigger, re-trigger prevention, reset - TestLoadPatterns verifies built-in patterns load and compile correctly - All tests run on macOS CI via pytest-asyncio
- ci.yml: runs ruff lint + pytest on Python 3.10, 3.11, 3.12 on macos-latest - publish.yml: builds and publishes to PyPI on GitHub Release via Trusted Publishing - No API tokens stored — uses OIDC id-token for PyPI authentication - Runs on push/PR to main and develop branches
- Installation steps for pip and terminal-notifier - Notification setup walkthrough (terminal-notifier macOS config) - Known caveats: Focus mode, Sequoia compatibility, display mirroring - only_when_away config for suppressing notifications at terminal - Full command reference, architecture diagram, project structure - PyPI Trusted Publishing guide for maintainers - Roadmap through v0.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Commits
14 atomic commits — one logical unit each. No squash requested.
Test plan
pip install -e ".[dev]" && pytest— all 46 tests passjigai --versionreturnsv0.1.0jigai watch claudewraps Claude Code transparently with no UI disruptionjigai server startstarts FastAPI server on port 9384jigai config test "> "correctly matches claude_code pattern