New version v2.3.6

This commit is contained in:
2026-03-04 10:19:16 +01:00
parent 65a35cd508
commit 49f842f119
52 changed files with 14034 additions and 358 deletions

153
README.md
View File

@@ -16,7 +16,8 @@ A powerful native macOS AI chat application with support for multiple providers,
- **Streaming Responses** - Real-time token streaming for faster interactions
- **Conversation Management** - Save, load, export, and search conversations
- **File Attachments** - Support for text files, images, and PDFs
- **Image Generation** - Create images with supported models (DALL-E, Flux, etc.)
- **Image Generation** - Create images with supported models (DALL-E, Flux, etc.) — renders inline in chat
- **Reasoning / Thinking Tokens** - Stream live reasoning from thinking-capable models (DeepSeek R1, Claude 3.7+, o1/o3, Qwen); configurable effort level (High/Medium/Low/Minimal); collapsible block auto-expands while thinking and collapses when the answer arrives
- **Online Mode** - DuckDuckGo and Google web search integration
- **Session Statistics** - Track token usage, costs, and response times
- **Command History** - Navigate previous commands with searchable modal (⌘H)
@@ -48,6 +49,16 @@ Seamless conversation backup and sync across devices:
![Model Selector](Screenshots/3.png)
### ⚡ Shortcuts & Agent Skills
- **Shortcuts** - Personal slash commands that expand to prompt templates; optional `{{input}}` placeholder for inline input
- **Agent Skills (SKILL.md)** - Markdown instruction files injected into the system prompt; compatible with skill0.io, skillsmp.com, and other SKILL.md marketplaces; import as `.md` or `.zip` bundle with attached data files
### 🖥️ Power-User Features
- **Bash Execution** - AI can run shell commands via `/bin/zsh` (opt-in, with per-command approval prompt)
- **iCloud Backup** - One-click settings backup to iCloud Drive; restore on any Mac; API keys excluded for security
- **Paperless-NGX Integration** *(Beta)* - Search, read, and interact with documents in a self-hosted Paperless instance
- **Tool Call Inspection** - Click any 🔧 tool message to expand input/output JSON for all tool calls
### 📧 Email Handler (AI Email Assistant)
Automated email responses powered by AI:
- **IMAP Polling** - Monitor inbox for emails with specific subject identifiers
@@ -65,6 +76,8 @@ Automated email responses powered by AI:
- Footer stats display (messages, tokens, cost, sync status)
- Header status indicators (MCP, Online mode, Git sync)
- Responsive message layout with copy buttons
- **Model Selector (⌘M)** - Filter by capability (Vision / Tools / Online / Image Gen / Thinking 🧠), sort by price or context window, search by name or description, per-row ⓘ info button
- **Localization** - UI fully translated into Norwegian Bokmål, Swedish, Danish, and German; follows macOS language preference automatically
![Advanced Features](Screenshots/4.png)
@@ -127,6 +140,7 @@ Add your API keys in Settings (⌘,) → General tab:
- **Online Mode** - Enable web search integration
- **Max Tokens** - Set maximum response length
- **Temperature** - Control response randomness (0.0 - 2.0)
- **Reasoning** - Enable thinking tokens for supported models; set effort level (High/Medium/Low/Minimal); optionally hide reasoning content from chat
#### Advanced Tab
- **Smart Context Selection** - Reduce token usage automatically
@@ -254,99 +268,6 @@ AI-powered email auto-responder:
- **Tracking**: Email log with success/error status
- **Security**: AES-256-GCM encrypted credentials
## Development
### Project Structure
```
oAI/
├── Models/ # Data models
│ ├── Message.swift # Chat message model
│ ├── Conversation.swift # Saved conversation model
│ ├── ModelInfo.swift # AI model metadata
│ └── Settings.swift # App settings enums
├── Views/ # SwiftUI views
│ ├── Main/ # Primary UI components
│ │ ├── ChatView.swift # Main chat interface
│ │ ├── MessageRow.swift # Individual message display
│ │ ├── InputBar.swift # Message input with commands
│ │ ├── HeaderView.swift # Top bar (provider/model/status)
│ │ └── FooterView.swift # Bottom stats bar
│ │
│ └── Screens/ # Modal/sheet views
│ ├── SettingsView.swift # Settings with tabs
│ ├── ModelSelectorView.swift
│ ├── ConversationListView.swift
│ └── HelpView.swift
├── ViewModels/ # Observable view models
│ └── ChatViewModel.swift # Main chat logic & state
├── Providers/ # AI provider implementations
│ ├── Provider.swift # Protocol definition
│ ├── OpenRouterProvider.swift
│ ├── AnthropicProvider.swift
│ ├── OpenAIProvider.swift
│ └── OllamaProvider.swift
├── Services/ # Business logic & data
│ ├── DatabaseService.swift # SQLite operations (GRDB)
│ ├── SettingsService.swift # Settings persistence
│ ├── ProviderRegistry.swift # AI provider management
│ ├── MCPService.swift # File access (MCP)
│ ├── WebSearchService.swift # DuckDuckGo/Google search
│ ├── GitSyncService.swift # Git synchronization
│ ├── ContextSelectionService.swift # Smart context
│ ├── EmbeddingService.swift # Semantic search
│ ├── EmailService.swift # Email monitoring (IMAP)
│ └── EmailHandlerService.swift # Email AI responder
└── Resources/
└── oAI.help/ # macOS Help Book
```
### Key Technologies
- **SwiftUI** - Modern declarative UI framework
- **GRDB** - SQLite database wrapper for persistence
- **MarkdownUI** - Markdown rendering with syntax highlighting
- **os.Logger** - Native logging framework
- **Network Framework** - Pure Swift IMAP/SMTP implementation
- **Security Framework** - Keychain and encryption services
### Database Schema
**Conversations**: id, name, createdAt, updatedAt
**Messages**: id, conversationId, role, content, tokens, cost, timestamp
**Message Metadata**: message_id, importance_score, user_starred, summary
**Message Embeddings**: message_id, embedding (BLOB), model, dimension
**Conversation Summaries**: id, conversationId, startIndex, endIndex, summary
**Email Logs**: id, sender, subject, status, timestamp
### Building & Debugging
**Build Commands:**
```bash
# Clean build
xcodebuild clean -scheme oAI
# Build
xcodebuild -scheme oAI -configuration Debug
# Run tests
xcodebuild test -scheme oAI
```
**Logs Location:**
```
~/Library/Logs/oAI.log
```
**Database Location:**
```
~/Library/Application Support/oAI/oai_conversations.db
```
## Troubleshooting
### Common Issues
@@ -378,21 +299,17 @@ xcodebuild test -scheme oAI
- Check Settings → Advanced → Semantic Search
- Verify embedding provider is selected
## Performance Notes
- **Context Selection**: 50-80% token reduction for long conversations
- **Semantic Search**: ~$0.02-0.15/month for heavy users
- **Conversation Export**: Markdown format for human readability
- **Database**: Indexed queries for fast conversation retrieval
- **Streaming**: Efficient memory usage with AsyncThrowingStream
## Roadmap
- [x] Vector index for faster semantic search (sqlite-vss)
- [x] Reasoning / thinking tokens (streamed live, collapsible)
- [x] Localization (Norwegian Bokmål, Swedish, Danish, German)
- [x] iCloud Backup (settings export/restore)
- [x] Bash execution with per-command approval
- [ ] SOUL.md / USER.md — living identity documents injected into system prompt
- [ ] Parallel research agents (read-only, concurrent)
- [ ] Local embeddings (sentence-transformers, $0 cost)
- [ ] Conversation clustering and recommendations
- [ ] Multi-modal conversation export (PDF, HTML)
- [ ] Plugin system for custom tools
- [ ] iOS companion app with CloudKit sync
## License
@@ -403,34 +320,21 @@ This means you are free to use, study, modify, and distribute oAI, but any modif
See [LICENSE](LICENSE) for the full license text, or visit [gnu.org/licenses/agpl-3.0](https://www.gnu.org/licenses/agpl-3.0.html).
## Development
See [DEVELOPMENT.md](DEVELOPMENT.md) for project structure, build scripts, database schema, and contribution guidelines.
## Author
**Rune Olsen**
- Website: [https://blog.rune.pm](https://blog.rune.pm)
- Website: https://mac.oai.pm
- Blog: [https://blog.rune.pm](https://blog.rune.pm)
- Gitlab.pm: [@rune](https://gitlab.pm/rune)
## Contributing
Contributions are welcome! By submitting a pull request you agree that your contribution will be licensed under the AGPL-3.0.
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
Please ensure:
- Code follows Swift style guidelines
- All tests pass
- Documentation is updated
- Commit messages are descriptive
## Acknowledgments
- **MarkdownUI** - Excellent markdown rendering library
- **GRDB** - Robust SQLite wrapper for Swift
- **Anthropic, OpenAI, OpenRouter** - AI API providers
Contributions are welcome! See [DEVELOPMENT.md](DEVELOPMENT.md) for build instructions and project structure.
---
@@ -438,4 +342,3 @@ Please ensure:
**🐛 Found a bug?** [Open an issue](https://gitlab.pm/rune/oai-swift/issues/new)