Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
04745f3
• Fixed race condition in session state updates for tab creation 🐛
pedramamini Dec 3, 2025
a5535cd
feat: Enhance Prompt Composer with send functionality and token count
pedramamini Dec 3, 2025
2b7f0af
refactor: UI polish and improved navigation behavior
pedramamini Dec 3, 2025
e183b65
terminal auto scrolls
pedramamini Dec 3, 2025
3c18557
fix: Tab input persistence and named session resume
pedramamini Dec 3, 2025
234a717
fix: Simplify tab centering logic for reliable scroll behavior
pedramamini Dec 3, 2025
83ebe66
# CHANGES
pedramamini Dec 3, 2025
0d05334
MAESTRO: Rename Scratchpad component to AutoRun
pedramamini Dec 3, 2025
8a18fef
MAESTRO: Update RightPanelTab type from 'scratchpad' to 'autorun'
pedramamini Dec 3, 2025
584388d
MAESTRO: Remove deprecated scratchpad fields from Session interface
pedramamini Dec 3, 2025
e6fcc53
MAESTRO: Add Auto Run state fields to Session interface
pedramamini Dec 3, 2025
c7bd987
MAESTRO: Add autorun:listDocs IPC handler for Auto Run feature
pedramamini Dec 3, 2025
452a68a
MAESTRO: Add autorun:readDoc IPC handler for Auto Run feature
pedramamini Dec 3, 2025
16c8d40
MAESTRO: Add autorun:writeDoc IPC handler for Auto Run feature
pedramamini Dec 3, 2025
3c1618d
MAESTRO: Add remaining Auto Run image IPC handlers and complete prelo…
pedramamini Dec 3, 2025
74ccf5c
MAESTRO: Add AutoRunSetupModal component for Auto Run folder configur…
pedramamini Dec 3, 2025
5327043
MAESTRO: Integrate AutoRunSetupModal into App.tsx for first-time Auto…
pedramamini Dec 3, 2025
a5607bc
MAESTRO: Add AutoRunDocumentSelector component and document switching…
pedramamini Dec 3, 2025
478d8b3
MAESTRO: Implement 5-second debounce auto-save for Auto Run documents
pedramamini Dec 3, 2025
23ebe06
MAESTRO: Implement per-document undo/redo system for Auto Run
pedramamini Dec 3, 2025
1d781e5
MAESTRO: Update Auto Run image handling to use file-system storage
pedramamini Dec 3, 2025
c528273
MAESTRO: Add multi-document and loop mode fields to BatchRunState type
pedramamini Dec 3, 2025
18cf40e
MAESTRO: Add multi-document support to BatchRunnerModal with document…
pedramamini Dec 3, 2025
0c5f2bc
MAESTRO: Add loop mode toggle to BatchRunnerModal with visual indicator
pedramamini Dec 3, 2025
989883b
MAESTRO: Add reset-on-completion toggle and document duplication to B…
pedramamini Dec 3, 2025
09fe525
MAESTRO: Update RightPanel batch progress display for multi-document …
pedramamini Dec 3, 2025
dddf3be
MAESTRO: Implement multi-document batch processor with loop and reset…
pedramamini Dec 3, 2025
c2b9ac6
MAESTRO: Add Playbook and PlaybookDocumentEntry types for batch run c…
pedramamini Dec 3, 2025
236fa07
MAESTRO: Implement Playbook IPC handlers and API for batch run config…
pedramamini Dec 3, 2025
c362cf8
MAESTRO: Add playbook state management to BatchRunnerModal
pedramamini Dec 3, 2025
35cf66d
MAESTRO: Add Load Playbook dropdown button to BatchRunnerModal
pedramamini Dec 3, 2025
16c4804
MAESTRO: Add Save as Playbook button to BatchRunnerModal
pedramamini Dec 3, 2025
b3b4e65
MAESTRO: Add Save Update and Discard buttons to BatchRunnerModal play…
pedramamini Dec 3, 2025
6bc5cc5
MAESTRO: Add PlaybookDeleteConfirmModal for dedicated playbook deleti…
pedramamini Dec 3, 2025
dcf3d91
MAESTRO: Add PlaybookNameModal for dedicated playbook name input
pedramamini Dec 3, 2025
7a93cc1
MAESTRO: Add Git worktree types for Auto Run parallelization support
pedramamini Dec 3, 2025
18e37d4
MAESTRO: Add Git worktree IPC handlers for Auto Run parallelization
pedramamini Dec 3, 2025
bec635b
MAESTRO: Add git repo detection to BatchRunnerModal for worktree support
pedramamini Dec 3, 2025
7730f5d
MAESTRO: Add Git Worktree UI section to BatchRunnerModal
pedramamini Dec 3, 2025
32d0a37
MAESTRO: Add debounced worktree validation with path and branch checks
pedramamini Dec 3, 2025
a702766
MAESTRO: Implement Git worktree support in batch processor for Auto R…
pedramamini Dec 3, 2025
a388a84
MAESTRO: Implement write queue integration for Auto Run (Phase 4.8.7)
pedramamini Dec 3, 2025
f472e87
MAESTRO: Implement playbook worktree settings storage (Phase 4.8.8)
pedramamini Dec 3, 2025
ba3512f
MAESTRO: Update Auto Run keyboard shortcut to Meta+Shift+1 (Phase 5)
pedramamini Dec 3, 2025
aea5564
MAESTRO: Update CLAUDE.md Right Bar description from Scratchpad to Au…
pedramamini Dec 3, 2025
56dca02
MAESTRO: Add keyboard shortcuts section to CLAUDE.md
pedramamini Dec 3, 2025
26c98b1
MAESTRO: Add Auto Run System section to ARCHITECTURE.md
pedramamini Dec 3, 2025
4a57d55
MAESTRO: Update README.md with Auto Run feature descriptions
pedramamini Dec 3, 2025
8fd94b4
MAESTRO: Rewrite AutoRunnerHelpModal with comprehensive Auto Run docu…
pedramamini Dec 3, 2025
48c7b55
MAESTRO: Fix Cmd+Shift+1 shortcut for Auto Run tab
pedramamini Dec 3, 2025
8e4b885
MAESTRO: Add neutral info display for existing worktree current branch
pedramamini Dec 3, 2025
abca52f
MAESTRO: Add toast notifications for PR creation results
pedramamini Dec 3, 2025
e2f6e2d
MAESTRO: Fix playbook worktree settings not being saved
pedramamini Dec 3, 2025
a5d4311
MAESTRO: Add empty folder state message to Auto Run panel
pedramamini Dec 3, 2025
e3bcd1f
MAESTRO: Implement graceful handling for playbooks with missing docum…
pedramamini Dec 3, 2025
d49c333
achievements tweaks
pedramamini Dec 3, 2025
a6663ad
MAESTRO: Tab switcher improvements and slash command UX refinements
pedramamini Dec 3, 2025
ad9591f
Fix cloudflared detection in packaged app + minor UX improvements
pedramamini Dec 3, 2025
0908178
MAESTRO: UX improvements for confirmations, process monitor, and quic…
pedramamini Dec 4, 2025
d5b9968
use template vars to set context in default autorun prompt
pedramamini Dec 4, 2025
e778703
Auto Run: subfolder tree support, loop controls, and info panel impro…
pedramamini Dec 4, 2025
41ca365
Fix slash commands appearing twice when session is idle
pedramamini Dec 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Auto Assign

on:
issues:
types: [opened]
pull_request:
types: [opened]

jobs:
assign:
runs-on: ubuntu-latest
steps:
- name: Assign to pedramamini
uses: actions/github-script@v7
with:
script: |
const issueNumber = context.issue?.number || context.payload.pull_request?.number;
if (issueNumber) {
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
assignees: ['pedramamini']
});
}
184 changes: 183 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Deep technical documentation for Maestro's architecture and design patterns. For
- [Theme System](#theme-system)
- [Settings Persistence](#settings-persistence)
- [Claude Sessions API](#claude-sessions-api)
- [Auto Run System](#auto-run-system)
- [Error Handling Patterns](#error-handling-patterns)

---
Expand Down Expand Up @@ -92,7 +93,7 @@ React frontend with no direct Node.js access:
| Directory | Purpose |
|-----------|---------|
| `components/` | React UI components |
| `hooks/` | Custom React hooks (useSettings, useSessionManager, useFileExplorer) |
| `hooks/` | Custom React hooks (useSettings, useSessionManager, useFileExplorer, useBatchProcessor) |
| `services/` | IPC wrappers (git.ts, process.ts) |
| `contexts/` | React contexts (LayerStackContext) |
| `constants/` | Themes, shortcuts, modal priorities |
Expand Down Expand Up @@ -594,6 +595,187 @@ const unsubscribe = window.maestro.claude.onGlobalStatsUpdate((stats) => {

---

## Auto Run System

File-based document runner for automating multi-step tasks. Users configure a folder of markdown documents containing checkbox tasks that are processed sequentially by AI agents.

### Component Architecture

| Component | Purpose |
|-----------|---------|
| `AutoRun.tsx` | Main panel showing current document with edit/preview modes |
| `AutoRunSetupModal.tsx` | First-time setup for selecting the Runner Docs folder |
| `AutoRunDocumentSelector.tsx` | Dropdown for switching between markdown documents |
| `BatchRunnerModal.tsx` | Configuration modal for multi-document batch execution |
| `PlaybookNameModal.tsx` | Modal for naming saved playbook configurations |
| `PlaybookDeleteConfirmModal.tsx` | Confirmation modal for playbook deletion |
| `useBatchProcessor.ts` | Hook managing batch execution logic |

### Data Types

```typescript
// Document entry in the batch run queue (supports duplicates)
interface BatchDocumentEntry {
id: string; // Unique ID for drag-drop and duplicates
filename: string; // Document filename (without .md)
resetOnCompletion: boolean; // Uncheck all boxes when done
isDuplicate: boolean; // True if this is a duplicate entry
}

// Git worktree configuration for parallel work
interface WorktreeConfig {
enabled: boolean; // Whether to use a worktree
path: string; // Absolute path for the worktree
branchName: string; // Branch name to use/create
createPROnCompletion: boolean; // Create PR when Auto Run finishes
}

// Configuration for starting a batch run
interface BatchRunConfig {
documents: BatchDocumentEntry[]; // Ordered list of docs to run
prompt: string; // Agent prompt template
loopEnabled: boolean; // Loop back to first doc when done
worktree?: WorktreeConfig; // Optional worktree configuration
}

// Runtime batch processing state
interface BatchRunState {
isRunning: boolean;
isStopping: boolean;
documents: string[]; // Document filenames in order
currentDocumentIndex: number; // Which document we're on (0-based)
currentDocTasksTotal: number;
currentDocTasksCompleted: number;
totalTasksAcrossAllDocs: number;
completedTasksAcrossAllDocs: number;
loopEnabled: boolean;
loopIteration: number; // How many times we've looped
folderPath: string;
worktreeActive: boolean;
worktreePath?: string;
worktreeBranch?: string;
}

// Saved playbook configuration
interface Playbook {
id: string;
name: string;
createdAt: number;
updatedAt: number;
documents: PlaybookDocumentEntry[];
loopEnabled: boolean;
prompt: string;
worktreeSettings?: {
branchNameTemplate: string;
createPROnCompletion: boolean;
};
}
```

### Session Fields

Auto Run state is stored per-session:

```typescript
// In Session interface
autoRunFolderPath?: string; // Persisted folder path for Runner Docs
autoRunSelectedFile?: string; // Currently selected markdown filename
autoRunMode?: 'edit' | 'preview'; // Current editing mode
autoRunEditScrollPos?: number; // Scroll position in edit mode
autoRunPreviewScrollPos?: number; // Scroll position in preview mode
autoRunCursorPosition?: number; // Cursor position in edit mode
batchRunnerPrompt?: string; // Custom batch runner prompt
batchRunnerPromptModifiedAt?: number;
```

### IPC Handlers

```typescript
// List markdown files in a directory
'autorun:listDocs': (folderPath: string) => Promise<{ success, files, error? }>

// Read a markdown document
'autorun:readDoc': (folderPath: string, filename: string) => Promise<{ success, content, error? }>

// Write a markdown document
'autorun:writeDoc': (folderPath: string, filename: string, content: string) => Promise<{ success, error? }>

// Save image to folder
'autorun:saveImage': (folderPath: string, docName: string, base64Data: string, extension: string) =>
Promise<{ success, relativePath, error? }>

// Delete image
'autorun:deleteImage': (folderPath: string, relativePath: string) => Promise<{ success, error? }>

// List images for a document
'autorun:listImages': (folderPath: string, docName: string) => Promise<{ success, images, error? }>

// Playbook CRUD operations
'playbooks:list': (sessionId: string) => Promise<{ success, playbooks, error? }>
'playbooks:create': (sessionId: string, playbook) => Promise<{ success, playbook, error? }>
'playbooks:update': (sessionId: string, playbookId: string, updates) => Promise<{ success, playbook, error? }>
'playbooks:delete': (sessionId: string, playbookId: string) => Promise<{ success, error? }>
```

### Git Worktree Integration

When worktree is enabled, Auto Run operates in an isolated directory:

```typescript
// Check if worktree exists and get branch info
'git:worktreeInfo': (worktreePath: string) => Promise<{
success: boolean;
exists: boolean;
isWorktree: boolean;
currentBranch?: string;
repoRoot?: string;
}>

// Create or reuse a worktree
'git:worktreeSetup': (mainRepoCwd: string, worktreePath: string, branchName: string) => Promise<{
success: boolean;
created: boolean;
currentBranch: string;
branchMismatch: boolean;
}>

// Checkout a branch in a worktree
'git:worktreeCheckout': (worktreePath: string, branchName: string, createIfMissing: boolean) => Promise<{
success: boolean;
hasUncommittedChanges: boolean;
}>

// Create PR from worktree branch
'git:createPR': (worktreePath: string, baseBranch: string, title: string, body: string) => Promise<{
success: boolean;
prUrl?: string;
}>
```

### Execution Flow

1. **Setup**: User selects Runner Docs folder via `AutoRunSetupModal`
2. **Document Selection**: Documents appear in `AutoRunDocumentSelector` dropdown
3. **Editing**: `AutoRun` component provides edit/preview modes with auto-save (5s debounce)
4. **Batch Configuration**: `BatchRunnerModal` allows ordering documents, enabling loop/reset, configuring worktree
5. **Playbooks**: Save/load configurations for repeated batch runs
6. **Execution**: `useBatchProcessor` hook processes documents sequentially
7. **Progress**: RightPanel shows document and task-level progress

### Write Queue Integration

Without worktree mode, Auto Run tasks queue through the existing execution queue:
- Auto Run tasks are marked as write operations (`readOnlyMode: false`)
- Manual write messages queue behind Auto Run (sequential)
- Read-only operations from other tabs can run in parallel

With worktree mode:
- Auto Run operates in a separate directory
- No queue conflicts with main workspace
- True parallelization enabled

---

## Error Handling Patterns

### IPC Handlers (Main Process)
Expand Down
61 changes: 59 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Use these terms consistently in code, comments, and documentation:

### UI Components
- **Left Bar** - Left sidebar with session list and groups (`SessionList.tsx`)
- **Right Bar** - Right sidebar with Files, History, Scratchpad tabs (`RightPanel.tsx`)
- **Right Bar** - Right sidebar with Files, History, Auto Run tabs (`RightPanel.tsx`)
- **Main Window** - Center workspace (`MainPanel.tsx`)
- **AI Terminal** - Main window in AI mode (interacting with AI agents)
- **Command Terminal** - Main window in terminal/shell mode
Expand Down Expand Up @@ -172,7 +172,8 @@ interface Session {
toolType: ToolType; // 'claude-code' | 'aider' | 'terminal' | etc.
state: SessionState; // 'idle' | 'busy' | 'error' | 'connecting'
inputMode: 'ai' | 'terminal'; // Which process receives input
cwd: string; // Working directory
cwd: string; // Current working directory (can change via cd)
projectRoot: string; // Initial working directory (never changes, used for Claude session storage)
aiPid: number; // AI process ID
terminalPid: number; // Terminal process ID
aiLogs: LogEntry[]; // AI output history
Expand Down Expand Up @@ -223,3 +224,59 @@ The `window.maestro` API exposes:
### Modal Escape Not Working
1. Register with layer stack (don't handle Escape locally)
2. Check priority is set correctly

## Keyboard Shortcuts

Key shortcuts for navigation and common actions. Full list available via `⌘+/` (Help).

### Panel Navigation
| Shortcut | Action |
|----------|--------|
| `⌥⌘←` | Toggle Left Panel |
| `⌥⌘→` | Toggle Right Panel |
| `⌘⇧F` | Go to Files Tab |
| `⌘⇧H` | Go to History Tab |
| `⌘⇧1` | Go to Auto Run Tab |

### Session Management
| Shortcut | Action |
|----------|--------|
| `⌘N` | New Agent |
| `⌘[` / `⌘]` | Previous/Next Agent |
| `⌥⌘1-0` | Jump to Session 1-10 |
| `⌘⇧⌫` | Remove Agent |
| `⌘⇧M` | Move Session to Group |

### Tab Management (AI Mode)
| Shortcut | Action |
|----------|--------|
| `⌘T` | New Tab |
| `⌘W` | Close Tab |
| `⌘⇧T` | Reopen Closed Tab |
| `⌘1-9` | Go to Tab 1-9 |
| `⌘0` | Go to Last Tab |
| `⌥⌘T` | Tab Switcher |

### Mode & Focus
| Shortcut | Action |
|----------|--------|
| `⌘J` | Switch AI/Shell Mode |
| `⌘.` | Focus Input Field |
| `⌘⇧A` | Focus Left Panel |
| `⌘R` | Toggle Read-Only Mode |
| `⌘E` | Toggle Markdown Raw/Preview |

### Git & System
| Shortcut | Action |
|----------|--------|
| `⌘⇧D` | View Git Diff |
| `⌘⇧G` | View Git Log |
| `⌥⌘L` | System Log Viewer |
| `⌥⌘P` | System Process Monitor |

### Quick Access
| Shortcut | Action |
|----------|--------|
| `⌘K` | Quick Actions |
| `⌘,` | Open Settings |
| `⌘/` | Show All Shortcuts |
Loading