$ show ygwyg/system
SYSTEM is an AI-powered macOS automation assistant enabling natural language control of Mac functions through a distributed architecture. It consists of a Tauri-based desktop app for local management, a CLI for setup/diagnostics, a local bridge server executing commands on the Mac, and a Cloudflare Worker serving as the AI agent using Anthropic's Claude. The system emphasizes privacy by keeping processing on user infrastructure, with secure Bearer token authentication between components. The architecture features a modular tool system where each capability (music, reminders, calendar, etc.) follows a consistent interface for easy extension. Communication occurs via HTTP/WebSocket: the UI sends requests to the Cloudflare Agent, which processes natural language with Claude and commands the local bridge. The bridge validates inputs, executes tools (using AppleScript/shell commands), and returns results. Real-time updates use WebSockets for scheduled tasks and notifications. Security is prioritized through command allowlisting, dangerous pattern blocking, and explicit macOS permission requirements. Key reusable components include secure command execution utilities and input validation patterns. The bridge server's validation and command modules isolate security concerns, while the tool interface pattern enables extensibility. The system is actively maintained with a pre-commit hook and low issue count, though distributed components risk drift. Dependencies show no known vulnerabilities (Dependabot Alerts: 0), but reliance on external services (Anthropic, Cloudflare) requires monitoring for API changes.
The LLM identified 2 files worth highlighting for reuse:
Provides reusable shell command validation against configurable allowlists, blocking dangerous patterns (e.g., 'rm -rf', 'sudo'). Isolates security concerns for command execution, demonstrating non-obvious skill in balancing flexibility with prevention of injection attacks. Easily extractable for any CLI tool processing user input.
Encapsulates safe spawning of child processes and AppleScript execution on macOS, handling output streaming, errors, and timeouts. Abstracts low-level process management into a simple interface, showcasing craftsmanship in robust, reusable cross-platform command execution with macOS-specific automation integration.