Commit Graph

1332 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
d6e19e8e71 feat: improve GitHub CLI detection with platform-aware auto-detection
- Add platform-specific command detection (where/which)
- Use expanded environment for PATH resolution
- Handle Windows multi-path output by taking first match
- Export getExpandedEnv() from cliDetection.ts for reuse
- Add proper fallback when detection fails

Addresses review comments from PR #59

Co-authored-by: oliveiraantoniocc <411161+oliveiraantoniocc@users.noreply.github.com>
2025-12-21 23:50:38 +00:00
copilot-swe-agent[bot]
5a506a6d67 Initial plan 2025-12-21 23:46:57 +00:00
Pedram Amini
fe09d53572 ## CHANGES
- Session previews now prefer first assistant reply over user prompt! 🚀
- Fallback to first user message when assistant response missing. 🛟
- Claude session parser stops scanning once assistant preview found. 
- Codex parser captures assistant previews across message and payload formats. 🔎
- Agent message completions now populate assistant-first preview correctly. 🤖
- First-message preview now uses unified `previewMessage` selection logic. 🧠
- Timestamp handling stays accurate while improving preview meaningfulness. ⏱️
- Message counting remains intact while preview extraction gets smarter. 📊
- Preview slicing now consistently applies to assistant-first chosen text. ✂️
- Session list previews become more informative, reducing system-context noise. 🎯
2025-12-21 16:29:08 -06:00
Pedram Amini
39825d8d25 ## CHANGES
- Share release-to-release project evolution once you provide repository data. 🚀
2025-12-21 16:22:20 -06:00
Pedram Amini
a20e7b6200 MAESTRO: handle inline code block parsing 2025-12-21 16:13:09 -06:00
Pedram Amini
5df0edbc8a ## CHANGES
- Added Windows-path truncation coverage so session lists display correctly everywhere 🪟
- Improved code-fence language parsing to support C++ mapping to cpp 🧠
- Refined About modal stats copy with clearer “Hands-on Time” labeling ⏱️
- Simplified mobile connection timeout typing for safer browser compatibility 🔧
- Centralized haptic triggering into shared constants for cleaner reuse 📦
- Upgraded haptics detection to verify vibrate is an actual function 📳
- Tuned input-mode toggle haptics to a crisp light vibration duration 🎚️
- Strengthened interrupt button feedback with consistent strong haptic pulses 🛑
- Removed redundant default export bundle from CommandInputButtons module 🧹
- Expanded test suite to catch edge cases across platforms and languages 
2025-12-21 16:09:13 -06:00
Pedram Amini
c7c1c8f4d6 ## CHANGES
- Crash reporting now runs only in production, keeping development logs spotless. 🚀
- Renderer Sentry initialization skips local dev servers, eliminating hot-reload noise. 🔇
- TTS stdin now catches EPIPE errors, preventing unexpected crashes during playback. 🛡️
- ProcessManager stdin error handling added, logging EPIPE without taking down sessions. 🧰
- Closing tabs now respects “unread-only” filtering, choosing the next unread tab. 
- Keyboard shortcut tab-closing now passes unread-only state for consistent navigation. ⌨️
- MainPanel Git log opening is now optional-safe, avoiding undefined callback crashes. 🔒
- Mobile session path truncation now supports Windows separators for cleaner display. 🪟
- Mobile haptics centralized via shared triggerHaptic helper, simplifying feedback logic. 📳
- Code block parsing now supports richer language tags, trimmed for accurate highlighting. 📝
2025-12-21 16:06:49 -06:00
Pedram Amini
6752439611 MAESTRO: harden mobile connect retry cleanup 2025-12-21 15:59:57 -06:00
Pedram Amini
60cfea1106 MAESTRO: add web hook tests and cleanup 2025-12-21 15:53:49 -06:00
Pedram Amini
1d42e40932 MAESTRO: refine mobile web hooks 2025-12-21 15:47:56 -06:00
Pedram Amini
28b198bd9f ## CHANGES
- Sessions hook now notifies consumers immediately when sessions update 🎉
- Added test ensuring `onSessionsChange` receives updated session payloads 
- `useSessions` preserves client-side flags while still broadcasting updates 🚀
- Codex sessions directory logic clarified via dedicated platform-aware helper 🗂️
- OpenCode storage path now correctly supports Windows `%APPDATA%` locations 🪟
- Auto Runner reset now restores original documents using automatic backups 🔄
- Interrupted Auto Run restores reset-document backups before proceeding safely 🛡️
- Execution Queue footer now highlights drag-and-drop reordering capability 🧩
- Wizard tour copy updated to reference Settings → General location 🧭
- Storage directory comments upgraded with clear per-platform path documentation 📚
2025-12-21 15:40:40 -06:00
Pedram Amini
981c36d5f4 MAESTRO: Harden pull-to-refresh color parsing 2025-12-21 15:36:58 -06:00
Pedram Amini
9a02f6c181 MAESTRO: refactor web app entrypoint 2025-12-21 15:32:23 -06:00
Pedram Amini
b2a4d27fbe ## CHANGES
- Added Auto Run document backups for reliable reset-on-completion workflows. 🔄
- Restored reset documents from backups, then deleted backup automatically. ♻️
- Added recursive cleanup to delete all `.backup.md` files quickly. 🧹
- Hardened backup IPC with traversal blocking and folder path validation. 🛡️
- Exposed new backup APIs in preload and Maestro typings. 🔌
- Batch processor now creates backups before processing reset-enabled documents. 🚀
- Interruptions now restore in-progress reset docs, then clean remaining backups. 🧯
- Group chat export now renders using the user’s current theme colors. 🎨
- Removed embedded JSON from chat exports, focusing on polished HTML. 
- Exported chats now support richer markdown, links, and embedded images. 📝
2025-12-21 15:25:26 -06:00
Pedram Amini
b4265499da ## CHANGES
- Terminal agent now defaults to PowerShell on Windows, bash elsewhere! 🚀
- PATH expansion is now platform-aware, including rich Windows install locations! 🎯
- PATH parsing now uses `path.delimiter`, fixing Windows semicolon separation! 🛠️
- Terminal PTY sessions set Windows-friendly HOME, USER, and SHELL values! 
- Base terminal PATH now includes Windows System32 and Git commands reliably! 🧩
- Command runner defaults to platform-appropriate shell, boosting cross-platform usability! 🌍
- `runCommand` adds Windows-specific environment variables for better subprocess behavior! 🔧
- Shell detection now lists Windows shells: PowerShell, pwsh, cmd, WSL! 🔎
- Windows shell detection maps IDs to `.exe` binaries before `where` lookup! 🧠
- Cloudflared CLI detection now searches Windows paths like Scoop/Chocolatey/npm! 🛰️
2025-12-21 15:09:12 -06:00
Pedram Amini
09b7a613b3 fix: ARM64 Linux build crashes (#54)
- Add asarUnpack for node-pty so native module is extracted outside ASAR
- Add missing system dependencies (libdrm2, libgbm1, libasound2) to deb
- Add missing dependencies (libdrm, mesa-libgbm, alsa-lib) to rpm
2025-12-21 12:25:31 -06:00
Pedram Amini
3b5257d9ac perf: Auto Run performance quick wins 3 & 4
- Quick Win 3: Reduce elapsed time timer from 1s to 3s in RightPanel
  - Reduces timer callbacks by 66% during Auto Run

- Quick Win 4: Memoize batch state selectors in App.tsx
  - currentSessionBatchState and activeBatchRunState wrapped in useMemo
  - Prevents unnecessary re-calculation on unrelated re-renders

- Update RightPanel test to expect 3s intervals

- Document npm run lint command in CLAUDE.md and CONTRIBUTING.md

Claude ID: 9ba72f64-27a0-4682-a8f2-93febcf94609
Maestro ID: b9bc0d08-5be2-4fdf-93cd-5618a8d53b35
2025-12-21 11:52:49 -06:00
Pedram Amini
40b279ec5a Merge pull request #51 from pedramamini/lint-cleanups
Proper Linting
2025-12-21 11:45:52 -06:00
Pedram Amini
6e21a6327f MAESTRO: prevent debounced updates after unmount 2025-12-21 11:44:41 -06:00
Pedram Amini
1b9549b48e MAESTRO: fix lint errors and git diff tests 2025-12-21 11:41:42 -06:00
Pedram Amini
1aca1e446a MAESTRO: fix test expectations after rebase 2025-12-21 11:36:14 -06:00
Pedram Amini
77d9724806 revert: undo risky behavioral changes from lint cleanup
Reverted changes that could introduce regressions:
- git.ts: restore passing files array to diff API (vs iterating)
- FilePreview.tsx: restore inline prop detection for code blocks
- FilePreview.tsx: remove unnecessary visit() function cast

These changes modified behavior beyond type fixes and could cause issues.
2025-12-21 11:26:50 -06:00
Pedram Amini
8843690530 MAESTRO: fix lint types after rebase 2025-12-21 11:16:46 -06:00
Pedram Amini
3d362cf0f5 MAESTRO: fix lint types after rebase 2025-12-21 11:14:26 -06:00
Pedram Amini
7497644d7b MAESTRO: fix 6 TypeScript errors in web/mobile layer
- Card.tsx: Use Omit<HTMLAttributes, 'title'> to avoid title type conflict
- useWebSocket.ts: Add 'user_input' to ServerMessageType union
- App.tsx: Remove non-standard renotify property from NotificationOptions
- useMobileKeyboardHandler.ts: Use type alias for MobileKeyboardSession
- CommandInputBar.tsx: Use proper double-cast for ref typing
- serviceWorker.ts: Extract registration.active to guarded local variable
2025-12-21 11:14:25 -06:00
Pedram Amini
ec2ed7dcd0 MAESTRO: fix 18 remaining renderer type errors
- GitLogViewer.tsx: nullish coalescing for optional additions/deletions
- InputArea.tsx: explicit string[] types for command history arrays
- LogViewer.tsx: boolean coercion for log.data check
- MainPanel.tsx: optional chaining for usageStats, fixed setStagedImages, handleDrop, onDeleteLog types
- TerminalOutput.tsx: imported FocusArea type and updated activeFocus/setActiveFocus
- ProcessMonitor.tsx: made startTime optional in ActiveProcess
- FileExplorerPanel.tsx: FocusArea import and prop types
- SettingsModal.tsx: type assertion for customFonts setting
- TabSwitcherModal.tsx: getUuidPill accepts null

Lint result: 6 remaining errors (all in web/mobile layer)
2025-12-21 11:14:25 -06:00
Pedram Amini
6cf666dcc3 MAESTRO: fix type errors in QueuedItemsList, TerminalOutput, and HistoryPanel
- QueuedItemsList: add null coalescing for optional command/text properties
- TerminalOutput: add boolean coercion for unknown parsedJson type
- HistoryPanel: remove non-existent 'prompt' property from search filter
2025-12-21 11:13:00 -06:00
Pedram Amini
263eebf09c MAESTRO: fix 73+ type errors in renderer hooks and components
Major type fixes:
- useSettings.ts: Add type assertions for settings.get() return values
- global.d.ts: Fix playbooks API types (maxLoops, branchNameTemplate, etc.)
- global.d.ts: Fix logger API to use proper log level union type
- useAgentExecution.ts: Simplify ref type definitions
- useExpandedSet.ts: Fix Set iteration type issues
- useTemplateAutocomplete.ts: Cast refs array properly

Component fixes:
- Fix ringColor CSS property -> use --tw-ring-color CSS variable (11 files)
- Fix Lucide icon title prop -> wrap icons in span with title
- Fix confetti shapes type in FirstRunCelebration and StandingOvation
- Fix nullable costUsd checks in AgentSessionsBrowser, SessionListItem
- Fix isDuplicate boolean coercion in AutoRunDocumentSelector
- Add lastAcknowledgedBadgeLevel to PlaygroundPanel mock stats
- Make GitLogEntry additions/deletions optional to match IPC
- Fix listDocuments -> listDocs API call in DirectorySelectionScreen

Reduces lint errors from 102 to 29.
2025-12-21 11:13:00 -06:00
Pedram Amini
e2347a52d1 MAESTRO: fix hooks and utility type errors in renderer
- useSessionNavigation: fixed TypeScript narrowing for entry.tabId
- useSessionPagination: made costUsd optional in AgentSession interface
- useAgentCapabilities: merge API result with defaults for optional fields
- useSessionManager: added missing imports (generateId, ToolType) and required fields
- useInputProcessing: added worktreeActive to BatchState, fixed shellCwd fallback
- useBatchProcessor: imported gitService, fixed badge function return type
- useAgentSessionManagement: null to undefined conversion for sessionName
- gitDiffParser: updated imports to FileData, HunkData, ChangeData
- FilePreview: fixed visit function typing and code inline detection
- git service: added branch to default value, fixed getDiff for file arrays
- process service: updated return types to Promise<boolean> to match IPC

Reduced lint errors from ~160 to 102. Remaining issues are primarily:
- useSettings.ts: settings.get() return type ({} | null)
- usePlaybookManagement.ts: maxLoops/branchNameTemplate not in type
- Component prop types: ringColor, LucideProps mismatches
2025-12-21 11:13:00 -06:00
Pedram Amini
d9693b848c MAESTRO: fix App.tsx type errors and component prop type mismatches
- Fixed totalCacheCreationInputTokens → totalCacheCreationTokens in GlobalStats
- Fixed HistoryEntryInput.command → added type: 'AUTO' for proper typing
- Fixed showToast → replaced with addToast({ type, title, message }) pattern
- Added FileNode import from useFileExplorer
- Added command: string and args?: string[] to AgentConfig interface
- Updated commandToUse to use nullish coalescing for proper typing
- Fixed error typing with unknown and proper error message extraction
- Added setGitLogOpen prop to MainPanel
- Added SettingsTab type and updated component interfaces
- Updated setActiveFocus, setActiveRightTab, setSettingsTab props to use proper types
- Fixed ThemeMode usage in PlaygroundPanel
- Fixed ThemeId and LLMProvider types in SettingsModal
- Added onToggleRemoteControl prop to QuickActionsModal

App.tsx is now type-clean. All 10,966 tests pass.
2025-12-21 11:12:09 -06:00
Pedram Amini
df472e36d5 MAESTRO: fix theme and layer type consistency
- Add accentForeground to web ThemeProvider defaults and CSS custom properties
- Fix invalid theme property references (yellow→warning, bgHover→accentDim, info→accentText)
- Convert ringColor to --tw-ring-color CSS custom property across components
- Add LayerInput type for proper discriminated union support
- Fix all modal registerLayer calls to include required blocksLowerLayers, capturesFocus, focusTrap
- Update tests to expect 14 CSS properties (added accentForeground)

Files changed:
- 14 component files with Layer type fixes
- 4 files with ringColor conversion
- 2 web files with accentForeground
- 1 type file with LayerInput type
- 1 hook file with proper typing
- 5 test files updated
2025-12-21 11:11:19 -06:00
Pedram Amini
aa0158b88a MAESTRO: align MaestroAPI types with runtime preload APIs
Added missing namespaces to global.d.ts:
- agentError, updates, debug, sync, cli, groupChat, leaderboard

Added missing methods to existing namespaces:
- process.onAgentError for agent error event handling
- agents: getCapabilities, custom path/args/envVars methods
- agents.refresh now returns { agents, debugInfo } structure
- git: branches, tags, commitCount, checkGhCli methods
- fs: homeDir, stat methods
- logger: autorun, onNewLog methods
- claude: getProjectStats, onProjectStatsUpdate methods
- history: getAllPaginated, updateSessionName, getFilePath, etc.
- playbooks: added worktreeSettings

Type improvements:
- AgentCapabilities interface with all capability flags
- AgentConfig.capabilities in both global.d.ts and types/index.ts
- DirectoryEntry.isFile property
- Proper leaderboard.submit ranking structure
- Agent error parsedJson property
2025-12-21 11:11:19 -06:00
Pedram Amini
19eb288a39 MAESTRO: audit CLI services - fix duplicated UUID and formatElapsedTime utilities
- Created src/shared/uuid.ts with generateUUID function (RFC 4122 v4 compliant)
- Removed duplicate generateUUID from agent-spawner.ts and batch-processor.ts
- Removed duplicate formatLoopDuration from batch-processor.ts and useBatchProcessor.ts
  (now uses formatElapsedTime from shared/formatters.ts which was identical)
- Added 6 tests for new uuid utility
- All 219 CLI service tests passing
2025-12-21 10:37:17 -06:00
Pedram Amini
f237c681a9 MAESTRO: audit CLI commands - add JSDoc documentation, fix unused parameter
- Add JSDoc to run-playbook.ts internal helpers (isSessionBusyInDesktop,
  formatWaitDuration, sleep, checkAgentBusy)
- Document intentional config directory case difference (maestro vs Maestro)
- Fix unused agentName parameter in checkAgentBusy
- All 145 CLI command tests passing
2025-12-21 10:31:59 -06:00
Pedram Amini
d9f098a2f5 MAESTRO: audit shared utilities - fix ANSI code duplication, document getConfigDir inconsistencies
Consolidates duplicated ANSI code stripping across codebase:
- HistoryDetailModal.tsx: now imports stripAnsiCodes from shared/stringUtils
- MobileHistoryPanel.tsx: now imports stripAnsiCodes from shared/stringUtils
- synopsis.ts: now imports stripAnsiCodes from shared/stringUtils

Documents intentional differences:
- terminalFilter.ts:stripAllAnsiCodes - more comprehensive, handles OSC/BEL/control chars
- shared/stringUtils:stripAnsiCodes - simpler, for UI display cleanup

Documents getConfigDir duplication (not fixed - backward compatibility):
- cli/services/storage.ts uses "Maestro" (capitalized)
- shared/cli-activity.ts uses "maestro" (lowercase) - matches electron-store
- Added JSDoc explaining this inconsistency

All 199 affected tests passing.
2025-12-21 10:25:12 -06:00
Pedram Amini
69e692ba44 MAESTRO: audit shared treeUtils.ts - document intentional duplication
- Added JSDoc note to getAllFilePaths explaining it's a convenience wrapper
  kept for API symmetry with getAllFolderPaths (used in tests only)
- Documented intentional difference between shared/treeUtils.ts TreeNode
  and autorun.ts TreeNode in both files:
  - shared TreeNode constructs paths from `name` during traversal
  - autorun TreeNode has pre-computed `path` from scanDirectory
- Added @internal markers to autorun-specific TreeNode and flattenTree

Task 152 audit: no dead code, no deprecated patterns, well-typed with
generics, 33 existing tests pass.
2025-12-21 10:19:36 -06:00
Pedram Amini
c80769268e MAESTRO: audit shared synopsis.ts - add comprehensive test coverage
- Created src/__tests__/shared/synopsis.test.ts with 25 unit tests
- Tests cover format parsing, ANSI cleaning, box char cleaning, fallbacks
- No dead code or duplication found - module is well-structured
2025-12-21 10:16:04 -06:00
Pedram Amini
0f38bfade5 MAESTRO: audit shared group-chat-types.ts - fix missing re-exports, add tests
- Fixed TypeScript errors: GroupChatHistoryEntry and GroupChatHistoryEntryType
  were missing from renderer/types/index.ts re-exports, causing compile errors
  in GroupChatInfoOverlay.tsx and groupChatExport.ts
- Added comprehensive test coverage with 27 tests for utility functions
  (normalizeMentionName, mentionMatches) and type validation
2025-12-21 10:13:09 -06:00
Pedram Amini
431e2cd33c MAESTRO: audit shared history.ts - add JSDoc, test coverage 2025-12-21 10:08:31 -06:00
Pedram Amini
8aede101b4 MAESTRO: audit shared gitUtils.ts - fix duplication, mark internal helpers
- Remove duplicate isImageFile from FilePreview.tsx, import from shared
- Refactor useWorktreeValidation.ts to use shared hasUncommittedChanges
- Mark cleanBranchName and cleanGitPath as @internal (test-only usage)
2025-12-21 10:03:30 -06:00
Pedram Amini
3d5829725c MAESTRO: audit shared formatters.ts - add JSDoc, test coverage
- Added JSDoc comments to CLI formatter's local formatTokens and
  formatDuration functions explaining intentional difference from
  shared formatters (decimal format vs combined units format)
- Created comprehensive test file for shared/formatters.ts with 39
  tests covering all 9 formatter functions
- All formatters verified in active use across renderer and web
2025-12-21 09:59:28 -06:00
Pedram Amini
2dfa5915bc MAESTRO: audit shared themes.ts - add theme count sync test
Added explicit theme count test (17 themes) to catch sync issues between
ThemeId type, THEMES object, and isValidThemeId array. This ensures all
three locations stay in sync when themes are added or removed.
2025-12-21 09:52:37 -06:00
Pedram Amini
2a203b36a9 MAESTRO: audit shared templateVariables - fix cross-platform path handling
- Fix PROJECT_NAME to handle both Unix and Windows paths using split(/[/\\]/)
- Fix trailing slash handling with .filter(Boolean)
- Update misleading "deprecated" comment to "aliases" since PROJECT_NAME is actively used in wizard prompts
- Update tests to verify the improved behavior
2025-12-21 09:48:41 -06:00
Pedram Amini
c9b6d53c29 MAESTRO: audit shared types - consolidate duplicated type definitions
Reduced type duplication between src/shared/types.ts and src/renderer/types/index.ts
by re-exporting types from shared rather than duplicating them:

- ToolType, Group, UsageStats, BatchDocumentEntry, PlaybookDocumentEntry, Playbook
  are now re-exported from shared
- WorktreeConfig in renderer now properly extends base with UI-specific ghPath field
- Kept intentional differences: AgentConfig (UI-specific fields), HistoryEntry
  (extends base with achievementAction)
2025-12-21 09:45:08 -06:00
Pedram Amini
1ad3cee4de MAESTRO: audit shared AgentConfigPanel - improve type safety 2025-12-21 09:38:39 -06:00
Pedram Amini
e2275f0b61 MAESTRO: audit Wizard tour system - remove dead code
- Remove unused containerRef in TourOverlay.tsx (created but never accessed)
- Remove 3 unused helper functions from tourSteps.ts (getTourStepById,
  getTourStepIndex, getTotalTourSteps) - exported but never imported
- Update index.ts exports to match
- Fix WizardThemeStyles.test.tsx missing required TourStep props
  (onGoToStep, isPositionReady)

All 269 Wizard tests pass.
2025-12-21 09:32:29 -06:00
Pedram Amini
387411ae7b MAESTRO: audit Wizard services - extract shared shuffle utility
Extract duplicated Fisher-Yates shuffle function from fillerPhrases.ts
and austinFacts.ts into shared shuffle.ts utility file (~4 net lines saved).
All 379 Wizard tests pass.
2025-12-21 09:26:48 -06:00
Pedram Amini
568fe42088 MAESTRO: audit Wizard screens - remove duplicate formatters
Replace local formatFileSize and formatElapsedTime functions with
shared formatters from src/shared/formatters.ts. This reduces code
duplication and improves consistency across the codebase.

The shared formatSize function is also more robust, handling GB and
TB sizes that the local version did not support.
2025-12-21 09:22:56 -06:00
Pedram Amini
77bce8ffab MAESTRO: audit Wizard core components - fix dead code and unused parameter
- WizardResumeModal: Remove dead `id: ''` property from registerLayer() call (id is auto-generated)
- ScreenReaderAnnouncement: Fix useAnnouncement hook to properly use the politeness parameter that was previously accepted but ignored
2025-12-21 09:19:29 -06:00
Pedram Amini
938809b575 MAESTRO: audit miscellaneous components - remove dead code
Remove unused `purpleAccent` variable from AchievementCard.tsx that was
declared but never used.

Audited 11 components (AICommandsPanel, NotificationsPanel, DocumentsPanel,
PlaygroundPanel, ProcessMonitor, ThemePicker, FontConfigurationPanel,
ToggleButtonGroup, LogFilterControls, AchievementCard, SettingCheckbox).
All components use modern React patterns and have proper TypeScript types.
2025-12-21 04:37:34 -06:00