Skip to content

Worth-Doing/brain-os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Worth Doing Icon

Worth Doing

AI-Powered Desktop Agent for macOS
Describe a task in natural language. The agent plans it, you approve it, it executes it.

Download DMG

macOS 14+ Swift 5.9+ SwiftUI SPM Notarized MIT

Files Lines of Code Modules Zero Dependencies No Xcode


What is Worth Doing?

Worth Doing is a native macOS application that turns natural language instructions into real desktop automation. It uses OpenRouter LLMs for reasoning and planning, then executes actions through shell commands and AppleScript — step by step, with full visibility and safety controls.

How it works

You type: "Create a project folder on my Desktop with subfolders for docs, images, and exports"

The agent:
  1. Interprets your request
  2. Builds a structured execution plan (shell commands, AppleScript, file ops)
  3. Shows you the plan for review
  4. You approve → it executes each step sequentially
  5. You see live output, errors, retries, and final result

Key Features

Agent Execution Engine

  • Sequential step-by-step execution
  • 10 step types: shell, AppleScript, file I/O, LLM reasoning, verification, and more
  • Automatic error recovery via LLM step repair
  • Pause / Resume / Cancel mid-execution
  • Live execution timeline with output inspection

Safety & Transparency

  • Risk classification engine (low / medium / high)
  • Safe Mode: medium + high risk actions require approval
  • Command-level pattern analysis (detects rm -rf, sudo, etc.)
  • Full visibility into every command before and after execution
  • macOS permission status panel

LLM Planning

  • OpenRouter integration (any model)
  • Structured JSON plan generation
  • Task interpretation → assumptions → risk assessment → steps
  • Step repair on failure (asks LLM to fix broken commands)
  • Model picker with context length and pricing info

Workflows & History

  • Save successful executions as reusable workflows
  • Favorite workflows for quick access
  • Full task history with search and filtering
  • Session logging with step-by-step results
  • Re-run workflows with one click

Architecture

Core Agent Executors AIService UI

Sources/
├── BrainOS/           App entry point, state, navigation
├── Core/              Models, persistence (JSON), safety engine
├── DesignSystem/      Theme, glass cards, visual effects, badges
├── SecureStorage/     Keychain wrapper (API key storage)
├── AIService/         OpenRouter client (models, completions)
├── Agent/             Coordinator, PlanBuilder, StepRunner, UI
├── Executors/         ShellExecutor, AppleScriptExecutor
├── Dashboard/         Main view, task composer
├── Settings/          API key, model picker, permissions, safety
├── History/           Task history with search/filter
├── Workflows/         Saved workflow library
└── Onboarding/        First-launch setup flow

Agent State Machine

idle → planning → awaitingApproval → executingStep → completed
                        ↓                  ↓
                   (user rejects)     verifyingStep
                    → cancelled       recoveringStep
                                         paused
                                        → failed

Tech Stack

Component Technology
Language Swift 5.9+
UI Framework SwiftUI (macOS 14+)
Build System Swift Package Manager
LLM Backend OpenRouter API
Shell Execution Process (stdin/stdout/stderr pipes)
AppleScript NSAppleScript
Secrets macOS Keychain (Security framework)
Persistence JSON files (~/Library/Application Support/BrainOS/)
Signing Developer ID + Apple Notarization
Dependencies Zero external dependencies

Metrics

33 files 6027 LOC 11 modules 10 step types 11 states

35+ risk patterns 15+ components 0 deps 3s build 2.8MB


Install

Download (Recommended)

  1. Download the latest WorthDoing.dmg from Releases
  2. Open the DMG and drag Worth Doing to Applications
  3. Launch — the app is signed and notarized by Apple, no Gatekeeper warning

Build from Source

git clone https://github.com/Worth-Doing/brain-os.git
cd worth-doing
swift build -c release
swift run BrainOS

Requires macOS 14+ and Swift 5.9+ (Xcode Command Line Tools). No Xcode project needed.

Create .app Bundle

swift build -c release
bash Scripts/bundle-app.sh
open ".build/release/Worth Doing.app"

Setup

  1. Get an OpenRouter API key at openrouter.ai
  2. Launch the app — the onboarding will guide you through:
    • Entering your API key (stored in macOS Keychain)
    • Selecting a default model
  3. Start describing tasks on the Dashboard

Example Tasks

Task What the agent does
"Create a folder on Desktop called Research with subfolders PDFs, Notes, Exports" mkdir -p commands, verifies structure
"List all PNG files in Downloads and rename them receipt-001, receipt-002..." find + sequential mv commands with preview
"Open Safari" AppleScript tell application "Safari" to activate
"Find files larger than 100MB in my home directory" find ~ -size +100M with formatted output
"Create a markdown report of my system info" Runs sw_vers, sysctl, df and writes .md file

Safety Model

Risk Level Examples Behavior
Low Read files, list dirs, open apps Executes automatically
Medium Move/rename files, write files, app automation Requires approval in Safe Mode
High Delete files, sudo, rm -rf, bulk operations Always requires approval

The RiskEngine scans every command against 35+ known dangerous patterns before execution.


License

MIT License. See LICENSE for details.


Built with Swift + SwiftUI. No Xcode. No Electron. No web wrappers. Just native macOS.

About

AI-Powered Desktop Agent for macOS — Natural language task execution via Shell & AppleScript with OpenRouter LLMs

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors