English | 中文
macOS-native AI workspace for visualizing and interacting with AI agents. SwiftWork provides real-time observability into agent execution — see what the agent is doing, why it's doing it, and the results of each step.
Built with Open Agent SDK (Swift).
- Create, rename, and delete chat sessions
- Chronological session list in sidebar
- Last active session is preserved across restarts
- Message input with Enter to send, Shift+Enter for newline
- Real-time streaming of agent responses
- Task interruption support
- Real-time rendering of 18+ SDK event types
- Streaming text with partial message updates
- Thinking state animation
- Visual differentiation between user, tool, and system events
- Structured tool call cards showing name, parameters, and execution status
- Real-time progress indicators with expand/collapse for detailed results
- Extensible
ToolRenderableprotocol for adding new tool types
- Inline approval cards in the timeline — approve, allow for session, or deny tool calls in context
- Template-driven rule creation with inline editing in Settings
- Auto-approve mode with visual warning indicator
- Permission rule management — view, edit, delete rules
- Slash command autocomplete in input bar — type
/to discover available skills - Skill timeline cards — dedicated rendering for skill execution events
- Skill management panel in Settings — browse skills grouped by source (Built-in / Project / User)
- Three-panel layout (Sidebar + Workspace + Inspector)
- Detailed event inspection panel
- Panel state persistence across sessions
- First-launch setup wizard
- API key management via app sandbox storage
- Model selection interface
| Component | Technology |
|---|---|
| Language | Swift 6.1+ with strict concurrency |
| Platform | macOS 14+ (Sonoma), Apple Silicon native |
| UI Framework | SwiftUI with @Observable |
| Persistence | SwiftData |
| Agent SDK | Open Agent SDK (Swift) |
| Markdown | swift-markdown (Apple) |
| Syntax Highlighting | Splash |
| Auto-Update | Sparkle 2.x |
SwiftWork/
├── App/
│ ├── SwiftWorkApp.swift # App entry point
│ └── ContentView.swift # Root view with NavigationSplitView
├── Models/
│ ├── UI/ # UI-facing models (AgentEvent, ToolContent)
│ └── SwiftData/ # Persistent models (Session, Event)
├── ViewModels/
│ ├── SessionViewModel.swift # Session management
│ └── SettingsViewModel.swift # Settings management
├── Views/
│ ├── Sidebar/ # Session list
│ ├── Workspace/
│ │ ├── Timeline/EventViews/ # Per-event-type views
│ │ │ └── ToolRenderers/ # Skill, Bash, etc. tool cards
│ │ ├── Inspector/ # Event detail panel
│ │ └── InputBar/ # Message input + skill autocomplete
│ ├── Permission/ # Inline approval cards
│ └── Settings/ # Settings + skill management
├── SDKIntegration/
│ ├── AgentBridge.swift # SDK ↔ ViewModel bridge + skill pipeline
│ ├── EventMapper.swift # SDKMessage → AgentEvent
│ ├── PermissionHandler.swift # Tool call approval logic
│ ├── ToolRenderable.swift # Tool rendering protocol
│ └── ToolRendererRegistry.swift # Extensible tool registry
├── Services/
│ └── KeychainManager.swift # Secure credential storage
└── Utils/
└── Extensions/ # Color, Date formatting helpers
SwiftWork follows an event-driven architecture:
AsyncStream<SDKMessage> → AgentBridge → EventMapper → ViewModel → SwiftUI
Key principles:
- Strict concurrency — all UI code is
@MainActorisolated - Separation of concerns — views consume UI models, never raw SDK types
- Extensibility — new tool types are registered via
ToolRendererRegistrywithout modifying the timeline
- macOS 14.0+ (Sonoma)
- Xcode 16.0+
- Swift 6.1+
git clone https://github.com/terryso/SwiftWork.git
cd SwiftWork
open Package.swift
# Press Cmd+R in Xcode to build and runOr via command line:
swift build
swift run SwiftWorkDownload the latest SwiftWork-*.dmg from Releases, then:
- Open the DMG and drag SwiftWork.app to Applications
- Run the following command to remove macOS quarantine:
xattr -cr /Applications/SwiftWork.app- Launch SwiftWork from Applications or Spotlight
| Epic | Description | Status |
|---|---|---|
| Epic 1 | First launch & basic interaction (SDK→UI loop) | Done |
| Epic 2 | Agent execution visualization (Tool Cards) | Done |
| Epic 3 | Permission control & session management | Done |
| Epic 4 | Debug panel & app shell | Done |
| Epic 5 | Skill system (slash commands, cards, management) | Done |
Epic 1 (done): Project init, onboarding, session management, message input, event timeline, state restore.
Epic 2 (done): Tool visualization architecture, tool card experience, event visual system, markdown/code highlighting, timeline performance.
Epic 3 (done): Inline permission approval cards, permission rules CRUD, auto-approve mode, session management, inspector panel, execution plan visualization.
Epic 4 (done): Debug panel, multi-tab settings, macOS menu bar, dock badge.
Epic 5 (done): SDK skill pipeline, slash command autocomplete, skill timeline card rendering, skill management panel.
- Doom loop detection — identify and warn when agent is stuck in repetitive cycles
- Multi-agent support — switch between different agent configurations
- Plugin system — third-party tool renderers and skill extensions
- Export sessions — save conversation transcripts as Markdown or JSON
