Skip to content

Commit a744a4b

Browse files
committed
feat: multi-chat sessions, file attachments, and critical bug fixes
Frontend: - Add multi-chat sessions with Hive persistence - Implement chat sidebar with hover effects and transparent UI - Add usage tracking per chat (tokens/cost) - Add file attachment support with lightbox viewer - Fix memory leaks (StreamControllers disposal) - Fix stop button - now correctly cancels running jobs - Update branding to "OS AI" Backend: - Fix race condition in JobManager with threading.Lock - Fix double job removal bug - Improve WebSocket exception handling - Add proper logging for error cases Docs & Config: - Add Development Mode section to README - Fix Makefile dev-install paths - Add macOS file access entitlements 🤖 Generated with Claude Code
1 parent c7ef239 commit a744a4b

File tree

69 files changed

+2617
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2617
-300
lines changed

.DS_Store

2 KB
Binary file not shown.

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ install:
1111

1212
dev-install:
1313
# Install local packages in editable mode for mono-repo dev
14-
$(PY) -m pip install -e packages/os/src
15-
$(PY) -m pip install -e packages/os-macos/src
16-
$(PY) -m pip install -e packages/os-windows/src
17-
$(PY) -m pip install -e packages/core/src
14+
$(PY) -m pip install -e packages/os
15+
$(PY) -m pip install -e packages/os-macos
16+
$(PY) -m pip install -e packages/os-windows
17+
$(PY) -m pip install -e packages/core
18+
$(PY) -m pip install -e packages/backend
1819

1920
lint:
2021
pytest -q -k "not integration_os"

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ https://github.com/user-attachments/assets/5b8e5ff1-5cbd-4515-b593-cd7de0b222cd
1717
- [Installation \& Setup](#installation--setup)
1818
- [Quick start](#quick-start)
1919
- [CLI Examples](#cli-examples)
20+
- [Development Mode](#development-mode)
21+
- [1. Install dependencies](#1-install-dependencies)
22+
- [2. Start the backend](#2-start-the-backend)
23+
- [3. Start the frontend (in a new terminal)](#3-start-the-frontend-in-a-new-terminal)
2024
- [Features](#features)
2125
- [Supported Platforms](#supported-platforms)
2226
- [Configuration (config/settings.py)](#configuration-configsettingspy)
@@ -44,6 +48,10 @@ Highlights:
4448
- Reliable keyboard input (robust Enter on macOS), hotkeys and hold sequences
4549
- Screenshots (Quartz on macOS or PyAutoGUI fallback), on‑disk saving and base64 tool_result
4650
- Detailed logs and running cost estimation per iteration and total
51+
- Multiple chats
52+
- Images upload
53+
- Voice input
54+
- AI API Agnostic
4755

4856
See provider architecture in `docs/architecture-universal-llm.md`, OS ports/drivers in `docs/os-architecture.md`, and packaging notes in `docs/ci-packaging.md`.
4957

@@ -130,6 +138,77 @@ make itest-local-click # run click/drag harness
130138

131139
---
132140

141+
## Development Mode
142+
143+
For development with backend + frontend (Flutter UI):
144+
145+
### 1. Install dependencies
146+
147+
```bash
148+
# (optional) create and activate venv
149+
python -m venv .venv && source .venv/bin/activate
150+
151+
# install Python dependencies
152+
make install
153+
154+
# install local packages in editable mode for mono-repo dev
155+
make dev-install
156+
```
157+
158+
### 2. Start the backend
159+
160+
```bash
161+
# Set your API key
162+
export ANTHROPIC_API_KEY=sk-ant-...
163+
164+
# (optional) enable debug mode
165+
export OS_AI_BACKEND_DEBUG=1
166+
167+
# Start backend on 127.0.0.1:8765
168+
os-ai-backend
169+
170+
# Or run directly via Python module
171+
# python -m os_ai_backend.app
172+
```
173+
174+
Backend environment variables (optional):
175+
- `OS_AI_BACKEND_HOST` - host address (default: `127.0.0.1`)
176+
- `OS_AI_BACKEND_PORT` - port number (default: `8765`)
177+
- `OS_AI_BACKEND_DEBUG` - enable debug logging (default: `0`)
178+
- `OS_AI_BACKEND_TOKEN` - authentication token (optional)
179+
- `OS_AI_BACKEND_CORS_ORIGINS` - allowed CORS origins (default: `http://localhost,http://127.0.0.1`)
180+
181+
Backend endpoints:
182+
- `GET /healthz` - health check
183+
- `WS /ws` - WebSocket for JSON-RPC commands
184+
- `POST /v1/files` - file upload
185+
- `GET /v1/files/{file_id}` - file download
186+
- `GET /metrics` - metrics snapshot
187+
188+
### 3. Start the frontend (in a new terminal)
189+
190+
```bash
191+
cd frontend_flutter
192+
193+
# Install Flutter dependencies
194+
flutter pub get
195+
196+
# Run on macOS
197+
flutter run -d macos
198+
199+
# Or run on other platforms
200+
# flutter run -d chrome # web
201+
# flutter run -d windows # Windows
202+
```
203+
204+
Frontend config (in code):
205+
- Default backend WebSocket: `ws://127.0.0.1:8765/ws`
206+
- Default REST base: `http://127.0.0.1:8765`
207+
208+
See `frontend_flutter/README.md` for more details on the Flutter app architecture and features.
209+
210+
---
211+
133212
## Features
134213

135214
- Smooth mouse motion: easing, distance‑based durations
@@ -245,6 +324,8 @@ Recommended setup: Flutter as pure UI, local Python service:
245324
- Streams: screenshots (JPEG/PNG), logs, events
246325
- Example notes: `docs/flutter.md`
247326

327+
**To run backend + frontend in development mode, see the [Development Mode](#development-mode) section above.**
328+
248329
Note: project code and docs use English.
249330

250331
---
1.37 MB
Loading

frontend_flutter/lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import 'package:frontend_flutter/src/presentation/stores/theme_store.dart';
77
import 'package:window_manager/window_manager.dart';
88
import 'package:hotkey_manager/hotkey_manager.dart';
99
import 'package:flutter_acrylic/flutter_acrylic.dart' as acrylic;
10+
import 'package:hive_flutter/hive_flutter.dart';
1011

1112
void main() async {
1213
WidgetsFlutterBinding.ensureInitialized();
1314
await configureDependencies();
15+
await Hive.initFlutter();
1416

1517
// Initialize window manager for macOS transparency and control
1618
await windowManager.ensureInitialized();

0 commit comments

Comments
 (0)