Commit Graph

269 Commits

Author SHA1 Message Date
Pedram Amini
98aebe06f3 MAESTRO: Extract theme types to shared location for web interface
- Create src/shared/theme-types.ts with Theme, ThemeId, ThemeMode, ThemeColors types
- Add isValidThemeId type guard utility function
- Update renderer types to re-export from shared location
- Update main process themes.ts to use shared types
- Update web-server.ts to import Theme from shared instead of defining WebTheme
- This enables the web interface build to access theme types without duplicating code
2025-11-27 03:08:15 -06:00
Pedram Amini
72b847840a MAESTRO: Implement /api/theme GET endpoint for current theme configuration
Added a new REST API endpoint at /api/theme that returns the currently
configured theme. The endpoint:
- Is protected by token-based authentication (if enabled)
- Is rate limited using GET rate limit config
- Returns the theme object with all color values
- Returns 503 if theme service not configured
- Returns 404 if no theme is currently set
2025-11-27 03:05:38 -06:00
Pedram Amini
b3f1ba660c MAESTRO: Implement /api/session/:id/interrupt POST endpoint for session interruption
Add REST API endpoint to send SIGINT/Ctrl+C signal to sessions via the web interface.
This allows mobile and desktop web clients to gracefully interrupt running AI agents
or terminal processes.

- Add InterruptSessionCallback type for session interrupt operations
- Add setInterruptSessionCallback method to WebServer class
- Create /api/session/:id/interrupt POST endpoint with authentication and rate limiting
- Wire up callback in main process to use ProcessManager.interrupt()
2025-11-27 03:04:10 -06:00
Pedram Amini
90cc71ee49 MAESTRO: Implement /api/session/:id/send POST endpoint for sending commands
Add POST endpoint to send commands to active sessions via the web API:
- Add WriteToSessionCallback type for session input
- Implement /api/session/:id/send endpoint with rate limiting (POST limits)
- Validate command presence and type before processing
- Check session exists before attempting to write
- Wire up callback in index.ts using processManager.write()
2025-11-27 03:01:57 -06:00
Pedram Amini
65ca472230 MAESTRO: Implement /api/session/:id endpoint for detailed session data
- Add SessionDetail interface with extended session fields (aiLogs, shellLogs, usageStats, claudeSessionId, isGitRepo)
- Add GetSessionDetailCallback type and setGetSessionDetailCallback method
- Implement /api/session/:id endpoint with authentication and rate limiting
- Returns 404 for non-existent sessions, 503 if callback not configured
- Wire up callback in index.ts to fetch session data from sessions store
- Update header comments to reflect current implementation status
2025-11-27 02:59:49 -06:00
Pedram Amini
e7e037fe64 MAESTRO: Implement /api/sessions endpoint to return actual session data
Updated the /api/sessions endpoint to use the getSessionsCallback
to return real session data instead of an empty array placeholder.
Added authentication and rate limiting to the endpoint.
2025-11-27 02:57:24 -06:00
Pedram Amini
138ba5aeb4 MAESTRO: Add rate limiting for web interface endpoints
- Install @fastify/rate-limit package
- Configure rate limiting with sensible defaults:
  - 100 requests/minute for GET endpoints
  - 30 requests/minute for POST endpoints (more restrictive)
- Add RateLimitConfig interface for configuration
- Apply rate limiting to all /web/* routes
- Add /web/api/rate-limit endpoint to check current limits
- Skip rate limiting for /health endpoint
- Custom error response with retry-after information
- Support for X-Forwarded-For header for proxied requests
2025-11-27 02:55:51 -06:00
Pedram Amini
55761ee5db MAESTRO: Broadcast theme changes to connected web clients
Added broadcastThemeChange method to WebServer class and integrated
it with the settings:set IPC handler to automatically notify all
connected web clients when the user switches themes in the desktop app.
2025-11-27 02:52:22 -06:00
Pedram Amini
14ff05d36f MAESTRO: Send current theme on initial WebSocket connection
- Add WebTheme type and GetThemeCallback to web-server.ts
- Add setGetThemeCallback method to WebServer class
- Send theme after sessions list on initial connection
- Send theme after auth success for authenticated clients
- Create src/main/themes.ts with all theme definitions for main process
- Wire up theme callback in index.ts using getThemeById helper
2025-11-27 02:50:29 -06:00
Pedram Amini
d40d36a43b MAESTRO: Broadcast session state changes to connected web clients
Added real-time session state broadcasting to the web interface:

- Added broadcastSessionStateChange() method to broadcast when session state,
  name, or input mode changes
- Added broadcastSessionAdded() and broadcastSessionRemoved() methods for
  tracking session lifecycle
- Added broadcastSessionsList() method for bulk session sync
- Modified sessions:setAll IPC handler to detect session changes and broadcast
  them to all authenticated web clients
- Added setGetSessionsCallback() to allow web server to fetch current sessions
- Send initial sessions_list to newly connected/authenticated web clients
- Only broadcast to authenticated clients for security

WebSocket message types added:
- session_state_change: { type, sessionId, state, name?, toolType?, inputMode?, cwd?, timestamp }
- session_added: { type, session, timestamp }
- session_removed: { type, sessionId, timestamp }
- sessions_list: { type, sessions, timestamp }
2025-11-27 02:46:14 -06:00
Pedram Amini
f541b3f198 MAESTRO: Add optional PIN/token authentication for web interface
- Add WebAuthConfig type and auth state management in WebServer
- Generate 6-character alphanumeric PINs (excludes confusing chars)
- Support authentication via:
  - WebSocket query string (?token=XXX)
  - WebSocket auth message { type: 'auth', token: '<token>' }
  - REST API headers (Authorization: Bearer or X-Auth-Token)
- Add IPC handlers for auth management:
  - webserver:getAuthConfig
  - webserver:setAuthEnabled (auto-generates token if needed)
  - webserver:generateNewToken
  - webserver:setAuthToken
  - webserver:getConnectedClients
- Persist auth settings in electron-store
- Add /web/api/auth/status and /web/api/auth/verify endpoints
2025-11-27 02:41:29 -06:00
Pedram Amini
c95380f8cb MAESTRO: Add WebSocket upgrade handler for web clients at /ws/web
- Added new WebSocket endpoint at /ws/web for web interface clients
- Implemented client connection tracking with unique client IDs
- Added connection/disconnection event handling with logging
- Added message handling for ping/pong, subscribe, and echo
- Added broadcastToWebClients() method for real-time updates
- Added getWebClientCount() method for monitoring connected clients
- Imported WebSocket from 'ws' for readyState checks
- Added WebClient and WebClientMessage type definitions
2025-11-27 02:37:53 -06:00
Pedram Amini
06318eef4f MAESTRO: Add /web/* route namespace for web interface
Created dedicated web interface route namespace in WebServer class:
- /web - Root endpoint returning available interfaces info
- /web/desktop - Desktop web interface entry point (placeholder)
- /web/desktop/* - Wildcard for client-side routing
- /web/mobile - Mobile web interface entry point (placeholder)
- /web/mobile/* - Wildcard for client-side routing
- /web/api - Web API namespace root with endpoint discovery

This establishes the foundation for the new web interface that will
provide both desktop (collaborative) and mobile (remote control)
access to Maestro sessions.
2025-11-27 02:33:44 -06:00
Pedram Amini
7488dc25b2 feat: Improve AI command display and add message delivery tracking
- Add delivery checkmark for user messages when AI responds
- Display AI commands with styled header showing command name and description
- Show full interpolated prompt below the command header
- Fix template variable substitution to happen before prompt display
- Improve hover states for copy/speak buttons

Claude ID: 24a6cdd6-27a7-41e0-af30-679cc2ffe66b
Maestro ID: 5a166b38-b7e9-47f0-a8ff-0113c65f2682
2025-11-27 02:19:55 -06:00
Pedram Amini
da21f4a1f8 feat: Improve History panel graph and session pill UX
- History activity graph now uses sliding time window that adjusts as
  you scroll, showing activity relative to the visible entries rather
  than always anchored to "now"
- Session ID pill now opens on hover instead of click for faster access
- Added hover timeout and invisible bridge for smooth tooltip behavior

Claude ID: 24a6cdd6-27a7-41e0-af30-679cc2ffe66b
Maestro ID: 5a166b38-b7e9-47f0-a8ff-0113c65f2682
2025-11-27 02:08:02 -06:00
Pedram Amini
0835672ce0 feat: Add session naming with search and improve macOS code signing
- Add user-defined session names stored with Claude session origins
- Display session names in AgentSessionsBrowser with tag icon
- Add "Named only" filter to quickly find named sessions
- Include session names in search across title and content modes
- Sync session names when renaming sessions in the sidebar
- Fix macOS code signing with ad-hoc signatures in release workflow
- Fix electron-builder CLI syntax (--config.extraMetadata)
- Improve lightbox navigation with context-aware image arrays
- Fix GitLogViewer search input focus handling
- Improve AI command prompt display with multi-line clamp

Claude ID: 24a6cdd6-27a7-41e0-af30-679cc2ffe66b
Maestro ID: 5a166b38-b7e9-47f0-a8ff-0113c65f2682
2025-11-27 01:59:49 -06:00
Pedram Amini
17b929d430 feat: Add template variables for custom AI commands
- Add template variable system with substitution for session, project,
  date/time, and git context (e.g., {{SESSION_NAME}}, {{GIT_BRANCH}})
- Display collapsible template variables documentation in AI Commands panel
- Update default /commit command to include {{CLAUDE_SESSION_ID}} for traceability
- Add tag icon indicator for sessions with custom (user-defined) names
- Improve Git Log Viewer date formatting (time for today, full date for older)
- Improve Git Log search UX with better focus handling
- Change Agent Sessions Browser default search mode to 'all'
- Update README with custom AI commands documentation
- Add template variable file reference to CLAUDE.md

Session: 35b88ae2-fc1a-44de-a1a1-4b0f0f5a14f9
2025-11-27 01:30:31 -06:00
Pedram Amini
d2ab6db88c feat: Add session bookmarks and improve release workflow
- Add bookmark feature to sessions (star icon on hover, dedicated
  Bookmarks section at top of Left Bar when bookmarks exist)
- Improve GitHub release workflow to handle partial build failures
  gracefully (continue-on-error for each platform)
- Fix input placeholder spacing ("Ask Claude about" instead of
  "askClaudeAbout")
- Update README to document bookmark functionality
2025-11-27 01:18:43 -06:00
Pedram Amini
9aa9982feb build fix 2025-11-27 00:57:26 -06:00
Pedram Amini
b8a32e2de3 MAESTRO: Fix history entry deletion bug - missing unique ID
The addHistoryEntry helper function was not generating a unique ID for
history entries. This caused all USER-type entries to have undefined IDs,
which meant when the delete handler filtered by entry.id !== entryId, all
entries with undefined IDs would match and be deleted together.

Added generateId() call to ensure each history entry has a unique ID.
2025-11-27 00:56:21 -06:00
Pedram Amini
b65355181f MAESTRO: Display Auto Mode Running indicator across all right sidebar tabs
Moved the batch run progress indicator from Scratchpad to RightPanel,
so it now persists at the bottom of all three tabs (Files, History,
Scratchpad) when auto mode is active.
2025-11-27 00:50:12 -06:00
Pedram Amini
109f32dbd8 MAESTRO: Add token/context tracking to auto-run task history details
- Add elapsedTimeMs field to HistoryEntry interface to track task duration
- Update useBatchProcessor to capture and pass usage stats (tokens, context,
  cost) and elapsed time when adding history entries for auto-run tasks
- Enhance HistoryDetailModal with a comprehensive stats panel that shows:
  - Context window progress bar with percentage
  - Token breakdown (input/output/cache tokens)
  - Elapsed time in human-readable format
  - Cost per task
- Update main process HistoryEntry interface to match renderer types

This enables users to track resource usage for each auto-run task iteration
in the history details view.
2025-11-27 00:47:46 -06:00
Pedram Amini
641cb81f83 MAESTRO: Move parallel batch processing doc to tmp/ 2025-11-27 00:41:33 -06:00
Pedram Amini
db5737c46b MAESTRO: Add design doc for parallel batch processing with git worktrees
Documents the implementation plan for adding parallel task execution
to the Auto Runner feature. Key concepts:

- Git worktrees for isolated working directories per task
- Configurable concurrency (default: 3 workers)
- UI toggle for serial vs parallel mode
- Merge strategies and conflict handling
- Resource considerations and cleanup

This enables significant speedup when batch tasks are independent,
reducing total execution time from N*T to approximately T (where N
is task count and T is average task duration).
2025-11-27 00:38:12 -06:00
Pedram Amini
8288ab73db MAESTRO: Fix batch task session ID overwriting interactive session
The batch processor was incorrectly overwriting the main session's
claudeSessionId when batch tasks completed. This caused the main panel
to display the batch task's session ID instead of the interactive
session's ID.

Fix: Remove claudeSessionId from the setSessions update when batch tasks
exit. The batch task's claudeSessionId is still returned via the Promise
resolve for tracking/history purposes, but it no longer contaminates
the interactive session state.
2025-11-27 00:36:38 -06:00
Pedram Amini
0b47daa47e MAESTRO: Add session origin tracking to distinguish Maestro vs CLI sessions
- Added new store (maestro-claude-session-origins) to track which Claude
  sessions were created via Maestro and whether they were user-initiated
  or auto-batch sessions
- Added IPC handlers for registering and retrieving session origins
- Updated App.tsx to register user-initiated sessions when receiving
  Claude session IDs (non-batch sessions)
- Updated useBatchProcessor.ts to register auto/batch sessions
- Updated claude:listSessions to include origin type in returned data
- Updated AgentSessionsBrowser.tsx to display colored origin pills:
  - MAESTRO (accent color): user-initiated through Maestro
  - AUTO (warning color): batch/auto sessions through Maestro
  - CLI (dim): sessions created via Claude Code command line
2025-11-27 00:33:47 -06:00
Pedram Amini
7cd4a11bd4 MAESTRO: Add session stats panel to Claude session details view
When viewing a Claude session's details, users now see a comprehensive
stats panel showing:
- Cost (with 4 decimal precision)
- Duration (calculated from first to last message timestamps)
- Total tokens with context window percentage (based on 200k)
- Message count
- Token breakdown: input, output, cache read, cache write
- File size and session start time

Extended ClaudeSession interface with token details (inputTokens,
outputTokens, cacheReadTokens, cacheCreationTokens) and durationSeconds.
Backend now calculates duration by parsing first and last timestamps
from the session file.
2025-11-27 00:28:57 -06:00
Pedram Amini
e0d3b6eb7f MAESTRO: Add star/bookmark functionality to Claude Sessions Browser
- Added Star icon import and starredSessions state
- Load starred sessions from settings on component mount
- Added toggleStar function to toggle and persist star status
- Modified filteredSessions to sort starred sessions to the top
- Added star button UI to each session in the list
- Starred sessions are persisted per-project in settings

This matches the functionality already in AgentSessionsModal.tsx
2025-11-27 00:26:14 -06:00
Pedram Amini
3e1e2484a6 added session management from main panel 2025-11-26 23:55:41 -06:00
Pedram Amini
0a09e19b0c sync version number to tag/release 2025-11-26 23:31:07 -06:00
Pedram Amini
091996e181 fix: Handle carriage returns in terminal output and add stream-json usage stats
- Add processCarriageReturns() to handle terminal line overwrites (fixes
  Claude Code status line "In: X  Out: Y" not updating in real-time)
- Apply carriage return processing to both AI and terminal mode output
- Add usage stats extraction for stream-json mode (when images are used)
- The carriage return fix ensures status lines that use \r for in-place
  updates display only the final state, not all intermediate updates
2025-11-26 23:06:14 -06:00
Pedram Amini
ed443a2a37 feat: Add session favorites, recent sessions quick access, and window state persistence
- Add starred/favorite sessions in Agent Sessions modal (persisted per-project)
- Add recent Claude sessions hover tooltip on Agent Sessions button for quick access
- Remember window size, position, and maximized/fullscreen state across restarts
- Fix light theme text colors for user message bubbles in chat views
- Fix auto-scroll to pause when user has expanded log entries
- Move history graph tooltip below the graph to avoid overlap
- Adjust warning colors in vibe mode themes for better contrast
2025-11-26 23:00:43 -06:00
Pedram Amini
94c9bc90a4 fix: Resolve macOS and Linux build failures in release workflow
- Use Python 3.11 for macOS builds (Python 3.12+ removed distutils module needed by node-gyp)
- Add author email to package.json (required for Linux .deb package maintainer field)
2025-11-26 22:38:52 -06:00
Pedram Amini
826c364557 feat: Replace globe tooltip with live agents table
- Shows all agents with active tunnels in a scrollable list
- Each entry displays agent name and group name
- Click agent name to jump to that session
- Click localhost link to open local server
- Click ngrok link (if available) to open public tunnel URL
2025-11-26 22:32:04 -06:00
Pedram Amini
840b8a03f0 feat: Add Vibe Mode themes section with new color schemes
- Move Pedurple and Maestro's Choice to new Vibe Mode section
- Change Pedurple's third color from orange to pinkish violet (#da70d6)
- Redesign Maestro's Choice: elegant dark theme with gold accents
- Add Dre Synth: 80s synthwave with hot pink, cyan, and deep purple
- Add InQuest: stark black/red/white security aesthetic
- Themes panel now shows Dark Mode, Light Mode, and Vibe Mode sections
2025-11-26 22:30:37 -06:00
Pedram Amini
6addd11ce6 feat: Improve history graph tooltip with time range and counts
- Show actual time range (e.g., '2PM - 3PM') instead of 'X hours ago'
- Display Auto and User counts on separate lines for clarity
- Better visual formatting with labels and values aligned
2025-11-26 22:27:35 -06:00
Pedram Amini
21babd5b20 fix: Align activity graph with filter buttons in History panel
- Change container to items-start for top alignment
- Add small top margin to graph to align bordered box with button text
2025-11-26 22:26:49 -06:00
Pedram Amini
80ea42a1b7 fix: Show cost and time widgets by default in header
- Initialize panelWidth to Infinity so widgets show before ResizeObserver fires
- Get initial width immediately on mount
- Widgets were hidden because initial state was 0, failing the > 500/600 checks
2025-11-26 22:25:44 -06:00
Pedram Amini
4a7e03d1f9 feat: Add 'Made in Austin, TX' to About modal 2025-11-26 22:24:58 -06:00
Pedram Amini
70af470983 fix: Fix blinking buttons and scroll jumping in terminal output
- Optimize atBottomStateChange to only update state when value changes
- Disable auto-scroll when user has expanded log entries
- Memoize toggleExpanded, toggleLocalFilter, and setLocalFilterQuery callbacks
- Reduces unnecessary re-renders that caused button blinking
2025-11-26 22:24:14 -06:00
Pedram Amini
630e1911ec fix: Remove ^C log entry when interrupting Claude 2025-11-26 22:22:20 -06:00
Pedram Amini
6dfedbb739 feat: Add speech button to AI responses for text-to-speech
- Adds Volume2 icon button next to copy button on non-user messages
- Only shows when audioFeedbackCommand is configured in settings
- Clicking speaks the message content using the configured TTS command
2025-11-26 22:21:49 -06:00
Pedram Amini
aa32adae3d fix: Move shortcuts count from tab header to filter row pill
- Removes count pill from Shortcuts tab to keep all tabs single-line
- Adds count pill before the filter input that shows total or filtered/total
2025-11-26 22:17:29 -06:00
Pedram Amini
360269e0ff fix: Custom AI commands now send prompt content, left-align Add Command button
- Custom AI commands now display and send the actual prompt text instead of
  showing "command: description" in the chat
- Left-align the Add Command button in settings
2025-11-26 22:13:30 -06:00
Pedram Amini
2621b83c17 fix: UI polish including copy content button, search context, and tooltip fixes
- Add copy content/image to clipboard button in FilePreview
- Increase search preview context from 30 to 60 characters
- Fix j/k navigation keys conflicting with search input in GitLogViewer
- Fix git tooltip click propagation and pointer events in MainPanel
- Convert globe tooltip to state-based with proper theme colors
- Add icons to settings modal tab buttons
- Reset AgentSessionsBrowser to list view on mount
2025-11-26 22:12:22 -06:00
Pedram Amini
fee2337e91 feat: Fix custom AI commands, responsive header, and UI polish
- Fix custom AI commands (/commit) execution from autocomplete dropdown
- Add responsive header that hides time/cost widgets when panel is narrow
- Add copy-to-clipboard button for terminal mode messages
- Hide token stats from terminal busy indicator (AI-only)
- Improve Add Command button layout in settings
2025-11-26 21:53:15 -06:00
Pedram Amini
f2597657c0 feat: Add per-session web server, history deletion, and UI improvements
- Add local web server per session with UUID authentication for browser access
- Add history entry deletion with confirmation modal
- Show git branch name in header pill, click to open git log
- Fix hover tooltips (Git, Tunnel, Context) to stay open when moving to content
- Widen settings modal to 800x600 for better AI Commands visibility
- Fix notification "never" dismissal by removing hardcoded durations
- Cycle all sessions with Cmd-Shift-[] when sidebar collapsed
- Update test audio text to Maestro introduction
2025-11-26 21:43:48 -06:00
Pedram Amini
4994fd4c74 bugfix in mac app builder 2025-11-26 21:00:12 -06:00
Pedram Amini
1d73ec8e2f Update README with application description and image 2025-11-26 20:59:28 -06:00
Pedram Amini
76a68e2274 MAESTRO: Add manual refresh button to file explorer
- Added RefreshCw icon button next to expand/collapse buttons
- Created refreshFileTree function to reload file tree on demand
- Button positioned to the left of expand/collapse controls
2025-11-26 20:54:34 -06:00