Commit Graph

2163 Commits

Author SHA1 Message Date
Raza Rauf
5773691dbe docs: add pre-commit hooks documentation to CONTRIBUTING.md 2026-01-19 23:09:40 +05:00
Raza Rauf
dd04429482 Add pre-commit hooks with husky and lint staged 2026-01-19 22:58:29 +05:00
Raza Rauf
2702a7c63a Merge branch 'main' into code-refactor 2026-01-19 16:08:48 +05:00
Pedram Amini
a0ebf02e4a ## CHANGES
- Added per-agent per-day stats breakdown powering richer provider charts 📊
- Upgraded AgentUsageChart to multi-provider lines with query/time toggle 📈
- Normalized cumulative usage events into per-turn deltas for Claude/Codex 🧮
- Fixed context token display to use agent-specific calculation pipeline 🧠
- Reworked session aggregation: distinct session counts plus closed-session averages 🗃️
- Hardened tool execution rendering to ignore non-string inputs safely 🛡️
- Added comprehensive tests preventing React error #31 from tool metadata 🧪
- Refreshed summary cards into cleaner 2×3 grid layout across breakpoints 🧩
- Improved metric card readability by wrapping long agent names instead 📝
- Updated types and IPC contracts to include new `byAgentByDay` payload 🔌
2026-01-18 15:58:49 -06:00
Pedram Amini
ead7b7d538 ## CHANGES
- Split Git status into file, branch, and detail hooks for cleaner UI wiring 🧩
- Supercharged panel resizing by updating state only on mouseup 
- Added explicit tests ensuring resize drags avoid excessive rerenders 🧪
- Refreshed dashboard wording: “Agent Comparison” is now “Provider Comparison” 🔁
- Renamed “Source Distribution” chart to clearer “Session Type” labeling 🏷️
- Updated chart accessibility labels and headings to match new terminology 
- Improved mobile timestamps: time-only for today, date+time for older 🕰️
- Added robust MessageHistory tests covering today vs older date formatting 📅
2026-01-18 14:06:55 -06:00
Pedram Amini
fe77591d42 ## CHANGES
- Eliminated mobile session ref initialization race with immediate saved defaults 🚀
- Made active tab ref mirror URL/saved tab instantly for reliable callbacks 🧭
- Simplified hook test by removing unnecessary async waiting on refs 🧪
2026-01-18 13:14:42 -06:00
Pedram Amini
bcc15a486e MAESTRO: Phase 03 - Integrate props hooks into App.tsx
- Import useMainPanelProps, useSessionListProps, useRightPanelProps hooks
- Create memoized wizard handlers (handleWizardComplete, handleWizardLetsGo, handleToggleWizardShowThinking)
- Integrate all three props hooks with comprehensive dependency objects
- Update MainPanel, SessionList, and RightPanel JSX to use spread props pattern
- Fix type mismatches:
  - BatchRunState null vs undefined
  - AITab type for activeTab
  - DocumentGenerationCallbacks function signature
  - mergeSourceName/mergeTargetName string | undefined
  - lastGraphFocusFilePath string | undefined

This optimization prevents React from re-evaluating 50-100+ props on every state change in MaestroConsoleInner by memoizing props objects that only change when their dependencies change.
2026-01-18 13:05:30 -06:00
Pedram Amini
51aa4b9ff0 ## CHANGES
- Removed OpenSpec prompt injection quick actions and related modal wiring 🧹
- QuickActionsModal no longer fetches or exposes OpenSpec command helpers 🔌
- Added brand-new Agent Usage Over Time dual-axis chart (sessions + time) 📈
- Integrated Agent Usage section into Agents dashboard with keyboard navigation 🧭
- Renamed “Agent Comparison” UI to “Provider Comparison” for clarity 🏷️
- Updated “Session Statistics” panels to “Agent Statistics” across dashboard 📊
- Rebranded “Source Distribution” chart to “Session Type” for better meaning 🗂️
- Improved accessibility labels to match new provider/session terminology 
- Fixed batch processor ref syncing to prevent “0 of N completed” regressions 🛠️
2026-01-18 12:44:17 -06:00
Pedram Amini
3b9abec5a5 MAESTRO: Phase 04 - Tab memoization & split GitStatusContext
Tab memoization:
- Add tabId prop to Tab component to avoid inline closures
- Create stable callback wrappers in TabBarInner
- Convert all Tab event handlers to use useCallback with tabId dependency
- Eliminates ~16k unnecessary re-renders per commit

Split GitStatusContext into focused sub-contexts:
- GitBranchContext: branch, remote, ahead/behind (rarely changes)
- GitFileStatusContext: getFileCount, hasChanges (changes on file ops)
- GitDetailContext: getFileDetails, refreshGitStatus (active session only)

Update consumers to use only needed context:
- SessionList: useGitFileStatus (file counts only)
- MainPanel: useGitBranch + useGitFileStatus + useGitDetail
- GitStatusWidget: useGitFileStatus + useGitDetail

Preserve legacy useGitStatus for backwards compatibility.
2026-01-18 12:09:37 -06:00
Pedram Amini
2e1dd4c74f MAESTRO: Phase 03 - Props hooks for major components
Create memoized props hooks for MainPanel, SessionList, and RightPanel to
prevent React from re-evaluating 50-100 props on every state change in
MaestroConsoleInner.

Key changes:
- Add useMainPanelProps hook (~100 props memoized)
- Add useSessionListProps hook (~80 props memoized)
- Add useRightPanelProps hook (~60 props memoized)
- Create props module with index.ts exports
- Update hooks index to re-export props module

Optimization: Uses primitive values in dependency arrays (e.g., activeSession?.id
instead of activeSession) to minimize re-renders.
2026-01-18 11:51:16 -06:00
Pedram Amini
576d71c9c0 MAESTRO: Phase 02 - useDeferredValue for input responsiveness
Add React's useDeferredValue to prioritize input field responsiveness
while allowing expensive components to defer their updates. InputArea
uses the immediate inputValue for responsive typing, while the prompt
composer uses deferredInputValue to avoid blocking keystrokes.
2026-01-18 11:41:53 -06:00
Pedram Amini
9aa466cc60 MAESTRO: Phase 01 performance fixes - panel resize & callback memoization
- RightPanel/SessionList resize: Use direct DOM style updates during drag,
  React state updated only on mouseup (eliminates ~60 re-renders/sec)
- Extract 4 inline callbacks from MainPanel props to useCallback hooks:
  handleExportHtml, handlePublishTabGist, handleClearAgentErrorForMainPanel,
  handleShowAgentErrorModal
- Add themeRef to App.tsx for callback stability
- Verified derived arrays already properly memoized
2026-01-18 11:37:45 -06:00
Pedram Amini
53833be428 prompt clarifications 2026-01-18 11:31:11 -06:00
Pedram Amini
0bd8a4ffc7 ## CHANGES
- Playbook Exchange now highlights local playbooks with blue “Local” badge 🟦
- Added new screenshot documenting the Local badge UI state 🖼️
- Marketplace manifest results now include per-playbook `source` metadata 🧾
- Manifest handling now merges official and local sources consistently 🔀
- Network failures now return empty merged manifest instead of error 📡
- HTTP fetch failures now degrade gracefully to empty manifest result 🧯
- Marketplace tests updated for dual-read cache + local manifest flow 🧪
- InputArea now expects pre-filtered `thinkingSessions` for better performance 
- ThinkingStatusPill mock now matches real conditional rendering behavior 🎭
- Added `onManifestChanged` stub to Maestro test setup for new hook 🪝
2026-01-18 10:52:56 -06:00
Pedram Amini
a699332797 ## CHANGES
- Dramatically reduced re-renders by memoizing tons of UI callbacks 🚀
- Input blur now syncs session text via refs, not dependencies 🧠
- File preview history navigation now uses stable, memoized back/forward arrays 🧭
- Thinking status now receives pre-filtered “busy AI” sessions only 🔥
- MainPanel no longer rerenders on keystrokes from inline prop functions 
- New log deletion handler cleanly removes user blocks and updates histories 🗑️
- AI log deletion also prunes persisted Claude JSONL context asynchronously 📜
- Tab actions (rename, reorder, star, unread) now run through memoized handlers 🧩
- “Last Document Graph” opens reliably using ref-backed remembered file path 🕸️
- Replay message now stages images then triggers input processing via ref 🎬
2026-01-18 10:13:03 -06:00
Kayvan Sylvan
302cd59c5d feat: add local manifest feature for custom playbooks (#204)
- Add comprehensive documentation for local manifest feature
- Create example local-manifest.json with custom playbook structure
- Implement local manifest reading and merging with official manifests
- Add file watcher for hot reload on local manifest changes
- Support local filesystem paths (absolute and tilde-prefixed)
- Add "Local" badge to distinguish custom playbooks in UI
- Expose manifest change event through preload API
- Add source field to playbook type for origin tracking
2026-01-18 10:10:51 -06:00
Raza Rauf
f0cbf2475c refactored main/process-manager.ts into manageable / scalable modules 2026-01-17 03:35:48 +05:00
Raza Rauf
b87e21fe3f Merge pull request #198 from pedramamini/code-refactor
added .prettierrc config to ensure consistent formatting
2026-01-16 15:18:05 -06:00
Raza Rauf
8e51017e50 Merge pull request #196 from pedramamini/code-refactor
perf: Buffered process data events to reduce IPC frequency
2026-01-16 13:56:02 -06:00
Raza Rauf
9ecf57bf25 added .prettierrc config to ensure consistent formatting 2026-01-16 23:54:27 +05:00
Raza Rauf
b206c849b1 Merge branch 'code-refactor' of https://github.com/pedramamini/Maestro into code-refactor 2026-01-16 18:22:57 +05:00
Raza Rauf
640aa0a8ff Address PR feedback: add flush before kill, try-catch in flushDataBuffer and its test coverage 2026-01-16 18:16:36 +05:00
Raza Rauf
f21cd0b442 Address PR feedback: add flush before kill, try-catch in flushDataBuffer and its test coverage 2026-01-16 18:10:15 +05:00
Pedram Amini
a95ee31316 ## CHANGES
- Search result scrolling now centers correctly within scrollable preview container 🎯
- Search scrolling clamps to non-negative positions for safer navigation 🛡️
- Edit-mode search no longer steals focus while you type—huge UX win ✍️
- Edit-mode search now resets match counts cleanly when query clears 🧹
- Match selection triggers only during navigation (Enter/Shift+Enter) ⌨️
- Added tracking refs to detect match navigation versus query edits 🧠
- Git status widget is now memoized to avoid needless re-renders 🚀
- Session hover tooltip content is memoized for smoother session lists 🧊
2026-01-16 00:43:09 -06:00
Pedram Amini
181a7f436b ## CHANGES
- Installed React DevTools automatically for Electron development debugging bliss 🧩
- Fixed token aggregation: MAX across models to stop double-counting 🎯
- Corrected Claude context math by excluding cumulative cache-read tokens 📉
- Context usage now reflects latest value, not high-water mark history 🧠
- Preserved lifetime stats by archiving deleted sessions instead of purging 🗄️
- Filtered SSH shell-integration junk from stdout for cleaner logs 🧼
- Hardened terminal/ANSI stripping for iTerm2, VSCode, and OSC sequences 🧹
- Prevented UI freezes: truncate huge syntax-highlight previews and warn users ⚠️
- Skipped expensive token counting for >1MB files to keep previews snappy 🚀
- Mobile web now renders AI responses as rich Markdown with copyable code blocks 📱
2026-01-15 23:32:09 -06:00
Raza Rauf
f8c5fc2832 Buffered process data events to reduce IPC frequency 2026-01-16 02:35:50 +05:00
Raza Rauf
eed244b500 Merge branch 'code-refactor' 2026-01-15 06:29:30 +05:00
Pedram Amini
0cee135132 ## CHANGES
- Persist Claude session context-usage percentage, surviving resumes and restarts 🧠
- New IPC/API: `claude:updateSessionContextUsage` to store live context stats 🔌
- Fix resumed sessions falsely showing 100% context from lifetime tokens 🧯
- Usage stats now preserve cost only; tokens intentionally zeroed 📉
- Resume now always fetches session origins to restore context usage 🧭
- Reconstruct context percent on resume by synthesizing equivalent input tokens 🧮
- Add `{{AGENT_HISTORY_PATH}}` template variable for prompts and commands 🧾
- System prompt gains Task Recall guidance using the history JSON file 🗂️
- Input processing now resolves history file path during prompt substitution 🧬
- Add Electron DevTools trace-export workarounds in performance docs 🛠️
2026-01-14 17:07:45 -06:00
Raza Rauf
aba774d9ac Fixed StateAction types in UILayoutContext.ts + used state from UILayoutProvider instead of redundant local useState duplications in App.tsx 2026-01-15 02:37:26 +05:00
Raza Rauf
c27ec9ceff Initialized Refactoring Branch 2026-01-14 23:44:33 +05:00
Pedram Amini
753d5db906 ## CHANGES
- Right-click now selects the clicked file before opening menu 🖱️
- LogViewer shows agent name pill for toast project entries ✏️
- Autorun logs get an agent/session pill pulled from context 🏷️
- Context badges no longer show for toast and autorun logs 🚫
- Added `NOTHING_TO_REPORT` sentinel for “no meaningful work” responses 🧩
- Synopsis parsing now flags `nothingToReport` and skips history creation ⏭️
- New helper `isNothingToReport()` handles ANSI/box-drawing-wrapped tokens 🧼
- Autorun synopsis prompt now requires strict `NOTHING_TO_REPORT` output 📜
- File tree loading avoids redundant reloads after an empty initial load 🌲
- Delete confirmation button uses softer semi-transparent error styling 🎨
2026-01-14 12:28:21 -06:00
Pedram Amini
f87d072f96 ## CHANGES
- Split monolithic CLAUDE.md into focused, indexed sub-docs for faster onboarding 📚
- Added deep Agent support guide: capabilities, flags, parsers, storage, and adding agents 🤖
- Documented full `window.maestro` IPC surface with clearer namespaces and History API 📡
- Captured core implementation patterns: processes, security, settings, modals, SSH, Auto Run 🧭
- Published performance playbook for React, IPC batching, caching, and debouncing 🚀
- Formalized Session interface docs, including multi-tab, queues, stats, and error fields 🧩
- Session-level custom agent path now overrides detected binary during spawn 🛠️
- New rendering settings: disable GPU acceleration (early startup) and disable confetti 🖥️
- Confetti effects now respect user preference across celebration overlays and wizard completion 🎊
- File explorer now distinguishes “loading” vs “no files found” empty states 🗂️
2026-01-13 11:14:59 -06:00
Pedram Amini
34db91b8e4 test: check OpenSpec metadata structure instead of specific version 2026-01-12 16:20:00 -06:00
julien Lengrand-Lambert
d7ddbab52c Adding Bluesky to the list of social networks on the client side (#186)
* MAESTRO: Add Bluesky social network support to leaderboard registration

- Add blueskyHandle field to LeaderboardRegistration interface
- Create BlueskySkyIcon component with official butterfly logo
- Add Bluesky input field to registration modal
- Update IPC handlers to accept and transmit blueskyHandle
- Support both username.bsky.social and custom domain formats
- Strip @ prefix from handles for consistency with other social fields
- Update main process to include blueskyHandle in API submission

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* MAESTRO: Add comprehensive test suite for Bluesky leaderboard integration

- Created LeaderboardRegistrationModal.test.tsx with 20 tests
- Tests cover Bluesky field rendering, @ prefix stripping, state persistence, and theme styling
- 16/20 tests passing (4 form submission tests have timing issues in test environment)
- Updated test setup to include leaderboard API mock
- All existing tests remain passing (9,893/9,898 pass)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: add blueskyHandle to MaestroAPI type and fix test setup

- Added blueskyHandle to global.d.ts MaestroAPI interface (was missing)
- Added missing leaderboard mock methods to test setup
- Fixed form submission tests to use existing registration

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Pedram Amini <pedram.amini@gmail.com>
2026-01-12 16:14:12 -06:00
Pedram Amini
9572042da6 test: update OpenSpec default version expectation to 0.19.0 2026-01-12 16:13:49 -06:00
Pedram Amini
9572aba751 ## CHANGES
- Added `calculateContextTokens` to unify agent-specific context token semantics 🧮
- Codex context usage now counts output tokens for accurate combined-window math 🎯
- Claude context usage keeps excluding output tokens, matching real limits 🧠
- Refactored context percentage calculations across main process listeners 🔧
- Updated desktop UI panels to use shared context-token calculator 📊
- Tab switcher now computes context usage using each tab’s agent type 🗂️
- Context extraction/token estimation now respects agent-specific counting logic 🔍
- Mobile header and status banner now handle Codex combined context windows 📱
- Expanded test coverage for new token calculator, edge cases included 
- Adjusted Codex default-window tests to reflect new output-inclusive usage 🧪
2026-01-12 16:11:21 -06:00
Pedram Amini
950962873e Merge pull request #182 from ronaldeddings/feat/context-calculation-claude-code
Feat/context calculation claude code
2026-01-12 15:56:14 -06:00
Pedram Amini
09472d84f7 fix: OpenSpec version now fetches actual release tag instead of hardcoded 0.1.0
Fixes #178 - OpenSpec "Check for Updates" was always showing version 0.1.0
regardless of the actual latest release (currently v0.19.0).

Root cause: sourceVersion was hardcoded in refreshOpenSpecPrompts().

Changes:
- Fetch latest release from GitHub API to get actual version tag
- Download AGENTS.md from release tag instead of main branch
- Use fetched version for both commitSha and sourceVersion metadata
- Update bundled metadata to v0.19.0
2026-01-12 12:00:24 -06:00
Pedram Amini
882470786f ## CHANGES
- Removed `remoteWorkingDir` SSH setting—remote sessions now start in `~` by default 🏠
- Simplified SSH command building: only `cwd` triggers remote `cd` injection 🧭
- Dropped remote-CWD integration assertions to reduce flaky SSH test failures 🧪
- Added `stripAnsi` utility to clean ANSI/OSC noise from SSH outputs 🧼
- Hardened remote agent detection against iTerm2 shell-integration escape sequences 🛰️
- Updated remote git execution to require explicit `remoteCwd` for correctness 🔧
- Streamlined SSH remote IPC payloads—no more working-directory field transmitted 📡
- Cleaned up SSH remote settings UI by removing the Remote Working Directory input 🧰
- Refined remote `cd` handling: `~` and bare `cd` map to session base dir 📁
- Tightened shared types and tests to match the new SSH remote config shape 🧩
2026-01-11 17:05:44 -06:00
Pedram Amini
c1a0e5d513 ## CHANGES
- Run remote commands via `$SHELL -ilc` to load full environment reliably 🚀
- Ensure `.bashrc` actually executes by forcing interactive shell mode 🧩
- Fix missing PATH additions like `~/.local/bin` on Ubuntu hosts 🐧
- Improve cross-shell consistency across bash, zsh, and configured `$SHELL` 🧠
- Update SSH command wrapping expectations and comments for new behavior 📝
- Document why non-interactive shells silently skip critical startup logic 🔍
- Keep TTY allocation guidance intact to prevent SSH-agent command hangs 🛡️
2026-01-11 16:15:02 -06:00
Pedram Amini
f05a3f2570 - Added rich Symphony History view with totals header and per-card metrics 🧾
- Launched Symphony Stats dashboard with summary cards and achievement milestones 🏆
- Embedded new Symphony screenshots to showcase History and Stats tabs 🖼️
- Added “Available Issues” card linking Maestro-ready GitHub issue list 🔗
- Introduced “Confirm and Erase” agent deletion flow that trashes working directory 🗑️
- Added new Delete Agent confirmation modal with strong accessibility and focus behavior 
- Implemented secure `shell:trashItem` IPC handler with validation and existence checks 🛡️
- Exposed `maestro.shell.trashItem()` in preload and renderer typings for use 🧩
- Wizard document prompts now respect configurable Auto Run folder paths 📁
- Prompt templates now forbid extra summary/recap files—only Phase docs allowed 🚫
2026-01-11 15:14:21 -06:00
Pedram Amini
8de3dfc43a Merge pull request #180 from pedramamini/symphony/issue-179-mk9muakc
[WIP] Symphony: Documentation Accuracy Check (#179)
2026-01-11 14:06:22 -06:00
Pedram Amini
1054b83d34 Merge branch 'main' into symphony/issue-179-mk9muakc 2026-01-11 14:02:50 -06:00
Pedram Amini
372dac4e5d ## CHANGES
- Added a live “Detecting agent on remote host” banner during SSH scans 🚧
- Introduced a themed, animated spinner to visualize ongoing detection work 🌀
- Conditioned the banner to hide once a real agent configuration is detected 🎯
2026-01-11 13:05:42 -06:00
Pedram Amini
975f23e4b3 ## CHANGES
- Smoothed tab switching by resizing textarea only when active tab changes 🚀
- Reduced costly layout reflows by dropping per-keystroke resize dependencies 
- Prevented agent-config undefined states during slow SSH detection with fallbacks 🛡️
- Added placeholder agent configs from tiles to handle detection race conditions 🧩
2026-01-11 13:05:32 -06:00
Pedram Amini
1d34eb6f2b ## CHANGES
- Added multi-document Auto Run progress fields across IPC and WebSocket state 📚
- Web clients now receive aggregated task totals and completions across documents 📈
- Active tab UI docs expanded with screenshot and richer contribution details 🖼️
- Canonical `activeTab` lookup is now memoized to kill repeated O(n) finds 
- Staged images, logs, and prompt tab toggles now reuse memoized `activeTab` 🧠
- Tab-completion suggestions now debounce input only while menu is open ⌨️
- @mention suggestions now debounce filter only while menu is open 🔎
- Disabling worktrees now removes all sub-agents and reports counts 🧹
- Added performance guidance: debounce, throttle, batching, virtualization, parallel IPC 🚀
- Bumped version to 0.14.5 for this release tag 🏷️
2026-01-11 12:20:36 -06:00
Ronald Eddings
c93ed9292d fix: align context usage with claude code 2026-01-11 06:55:17 -06:00
Ronald Eddings
e0390b270d fix: align context usage with claude code 2026-01-11 06:38:06 -06:00
Pedram Amini
c42bf3224b MAESTRO: Fix usage-dashboard.md documentation inaccuracies
- Add missing "Sessions" summary card (6 cards total, not 5)
- Document Location Distribution chart (local vs SSH queries)
- Document Peak Hours chart (24-hour activity breakdown)
- Document Duration Trends chart in Overview tab
- Expand Agents tab with Session Statistics details
- Expand Auto Run tab with all 6 metric cards and mini chart
- Add Keyboard Navigation section (tab navigation, section nav)
- Fix Accessibility section (colorblind mode not in Settings UI)
- Fix Enabling/Disabling Collection path (General tab → Usage Dashboard)
- Add real-time updates and database size footer documentation
2026-01-11 06:27:22 -06:00
Pedram Amini
d10ffc29b6 MAESTRO: Fix troubleshooting.md documentation inaccuracies
- Fix log level description (was backwards - higher levels show FEWER logs)
- Update severity levels list (was 3, now correctly shows all 6: debug, info, warn, error, toast, autorun)
- Add search shortcut (Cmd+F) and detail view feature for System Log Viewer
- Expand Process Monitor docs with hierarchical tree structure, all 8 process types, keyboard shortcuts, and features
- Add new Agent Errors section documenting all 6 error types handled by AgentErrorModal
- Fix Debug Package contents table - split into "Always included" (9 files) and "Optional" (5 files) sections
- Add 5 missing files: windows-diagnostics.json, groups.json, web-server.json, group-chats.json, batch-state.json
2026-01-11 06:23:41 -06:00