Commit Graph

2212 Commits

Author SHA1 Message Date
chr1syy
aafe0d6a48 fix(windows): stabilize local and SSH execution for wizard and sessions
- Use full agent path (claude.exe) on Windows to avoid shell:true
  which breaks stdin piping for stream-json input mode
- Fix SSH condition to check enabled flag, not just config existence
- Pass sessionSshRemoteConfig through inline wizard to enable remote execution
- Add synopsis SSH inheritance from parent session as backend workaround

Fixes local wizard crashing with exit code 1 and SSH sessions
incorrectly using local paths when SSH was disabled.
2026-01-26 13:01:44 +00:00
chr1syy
98b5a05f56 fix(build): ensure Windows build stability by adding Python with distutils and resolving TypeScript errors
- Added Python 3.11 to Windows CI to restore distutils support required by node-gyp
- Ensured native module rebuilds (better-sqlite3, node-pty) succeed on Windows runners
- Fixed TypeScript build errors to restore clean compilation across all platforms
2026-01-26 12:51:32 +00:00
Pedram Amini
dca51447fd fix(ssh): stabilize SSH remote execution across wizard, file browser, and process manager
- Added extensive DEBUG-level logging for SSH command execution, spawn details, exit codes, and configuration flow
- Improved Wizard SSH remote support:
  - Debounced remote directory validation to reduce excessive SSH calls
  - Fixed git.isRepo() to correctly pass remoteCwd for remote checks
  - Persisted SSH config in SerializableWizardState and validated directories over SSH
  - Ensured ConversationScreen and ConversationSession consistently pass SSH config for remote agent execution
  - Fixed "agent not available" errors by forwarding stdin via exec and enabling stream-json mode for large prompts
- Enhanced remote agent execution logic in ProcessManager with stdin streaming, exec-based forwarding, and useStdin flag
- Improved SSH file browser behavior:
  - Added resolveSshPath() to locate SSH binaries on Windows (Electron spawn PATH issue)
  - Corrected getSshContext() handling of enabled/remoteId states
  - Ensured synopsis background tasks run via SSH instead of local paths
- Added Windows development improvements: dev:win script and PowerShell launcher for separate renderer/main terminals
- Added additional SSH directory debugging logs for remote-fs and wizard flows

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:48:41 +00:00
chr1syy
ab7bf27d03 fix(ssh): stabilize and complete SSH remote execution support across wizard, IPC, and agent detection
- Added full SSH remote support to the wizard, including propagation of SSH config through all phases
- Ensured SSH config flows correctly through IPC bridge (renderer → preload → main)
- Improved agent detection with optional sshRemoteId and remote `which` resolution
- Fixed SSH config transfer during manual agent creation and auto-selection flows
- Added extensive debugging and structured logging for SSH execution, agent availability, and wizard message flow
- Improved stdin/JSON streaming for large prompts and remote execution
- Added input/output JSON stream handling and enhanced logging for SSH transport
- Added sourcing of bash profiles to correctly resolve claude-code binary paths on remote hosts
2026-01-26 12:38:50 +00:00
github-actions[bot]
1f938021fb docs: sync release notes for v0.14.5 2026-01-24 11:15:48 +00:00
Kayvan Sylvan
965a049400 fix: make dev server port configurable via VITE_PORT environment variable (#234)
## CHANGES

- Extract dev server port and URL into separate variables
- Add radix parameter to `parseInt` for proper number parsing
- Sync port configuration between Vite config and main process
- Use consistent port parsing with explicit base 10 radix
2026-01-24 05:03:09 -06:00
Raza Mair
93cf4c71ff Merge pull request #230 from pedramamini/code-refactor
refactor: extract app lifecycle modules from main/index.ts
2026-01-23 16:01:18 -06:00
Raza Rauf
64d990ca3f fix: address code review feedback for Phase 4 refactor
- Use module-level flag instead of try-catch for IPC handler registration
- Improve error logging to capture full context with stack traces
- Add race condition protection for quit confirmation flow
2026-01-24 01:46:32 +05:00
Raza Rauf
434ee29bfb Merge branch 'main' into code-refactor 2026-01-24 00:02:13 +05:00
Pedram Amini
8be8a8eb6a fix: add Python 3.11 setup for Windows build (distutils removed in 3.12+) 2026-01-23 12:36:59 -06:00
github-actions[bot]
f87971f680 docs: sync release notes for v0.14.5 2026-01-23 13:41:20 +00:00
Pedram Amini
90fd6c3179 sentry.io sourced bug fixes 2026-01-22 16:37:53 -06:00
Raza Rauf
69ef490897 refactor: extract app lifecycle modules from main/index.ts
Extract app lifecycle functionality into dedicated modules with dependency
injection pattern for improved testability and maintainability:

- error-handlers.ts: Global uncaught exception and unhandled rejection handlers
- cli-watcher.ts: CLI activity file watcher with start/stop lifecycle
- window-manager.ts: Window creation with state persistence and auto-updater
- quit-handler.ts: Quit confirmation flow and cleanup orchestration

This reduces main/index.ts by ~200 lines and adds 48 new tests covering
all extracted functionality.
2026-01-23 03:08:46 +05:00
Raza Rauf
7878d29663 Merge pull request #226 from pedramamini/code-refactor
refactor: extract modules from main/index.ts
2026-01-22 15:31:32 -06:00
Raza Rauf
0916960f25 fix: address code review feedback for Phase 1 & 2 refactor
- Add MAX_GROUP_CHAT_BUFFER_SIZE (10MB) to prevent memory exhaustion
- Add buffer truncation with marker when exceeding limit
- Add isGroupChatBufferTruncated() to check truncation status
- Add debugLogLazy() for lazy evaluation of expensive string operations
- Use proper TypeScript types (StoredSession, Group) in web-server-factory
- Add 15 new tests for buffer limits and lazy logging
2026-01-23 02:26:53 +05:00
Raza Rauf
37356c6822 refactor: extract modules from main/index.ts
1 - Pure function extractions:
- constants.ts: Add regex patterns and debugLog for group chat
- group-chat/session-parser.ts: parseParticipantSessionId
- group-chat/output-parser.ts: Text extraction from agent JSONL output
- group-chat/output-buffer.ts: Streaming output buffer management

2 - Dependency injection factories:
- utils/safe-send.ts: createSafeSend for safe IPC messaging
- web-server/web-server-factory.ts: createWebServerFactory for web server

Added 133 new unit tests across 6 test files for full coverage of
extracted modules.
2026-01-23 01:52:54 +05:00
Pedram Amini
8f77c84617 ## CHANGES
- Fixed context token math by excluding cumulative cacheReadInputTokens entirely 🧠
- Updated Claude context rules: count input plus cache-creation only 📏
- Updated Codex context rules: combine input with output, skip cache-read 🔀
- Prevented impossible context utilization percentages exceeding 100% 🚫
- Added high-cache-read regression test to guard against session-total spikes 🧪
- Expanded tests to validate agent-specific context semantics clearly 🧩
- Improved inline docs explaining Claude’s cumulative token reporting nuance 📚
2026-01-22 13:42:00 -06:00
Pedram Amini
a4213b8f66 ## CHANGES
- Synopsis parsing now strips conversational filler to surface real summaries 🔍
- Added robust filler phrase detection across many variants and punctuation 🧹
- Synopsis fallback now skips filler-only outputs, returning “Task completed” 🛟
- Renderer short-summary generator ignores filler sentences before summarizing 🧠
- Autorun synopsis prompt updated to enforce scientific, verb-first logging 📓
- Expanded test suite to verify filler filtering and fallback behavior 🧪
2026-01-22 13:25:49 -06:00
Kayvan Sylvan
2667cbdd77 Developer Experience Improvements (multi-worktree simultaneous development) (#209)
* docs: add git hash display and configurable dev server port

## CHANGES

- Add `VITE_PORT` env variable to configure dev server port
- Display git commit hash in About modal next to version
- Add `__GIT_HASH__` build-time constant to both Vite configs
- Document running multiple Maestro instances with git worktrees
- Update CONTRIBUTING.md with parallel development instructions

* feat: add configurable ports for dev servers

- Allow VITE_PORT to configure main dev server port
- Update main window to load from configurable port
- Enable VITE_WEB_PORT for web interface dev server
- Add note in CONTRIBUTING.md about port configuration
- Log port usage in development mode

* docs: update CONTRIBUTING.md section and fix React DevTools script initialization

## CHANGES

- Rename "Linting" section to "Linting & Pre-commit Hooks" in table of contents
- Move script variable declaration outside conditional block
- Fix React DevTools script initialization order in index.html

* chore: update `.vscode/settings.json` with new markdownlint config

* fix: disable biome linting. Project uses ESLint

* chore: Update baseline-browser-mapping (>2 months old, warning message on "npm run build:web")

* chore: add .vscode/ to gitignore

* chore: fix gitignore to ignore .cscode/* files properly

* fix

* chore: stop tracking .vscode/ files, respect gitignore

Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
2026-01-22 12:14:48 -06:00
Kayvan Sylvan
5778a5b34b feat: add local playbook support for marketplace import and display (#216)
- Add merged manifest lookup for local playbook imports
- Read local manifest and merge with official during import
- Display "Local" badge for custom playbooks in marketplace UI
- Add source badge in playbook detail view sidebar
- Support filesystem paths (absolute and tilde) for local playbooks
- Add comprehensive tests for local playbook import scenarios
- Add tests for merged manifest lookup and source tagging
- Fix mock file reads to handle local manifest ENOENT cases
2026-01-22 10:32:03 -06:00
Pedram Amini
30868daa0d - Added per-session daily stats aggregation for richer usage analytics 📊
- Agent Usage chart now tracks Maestro sessions, not providers 🎯
- Map session IDs to friendly names in charts and legends 🏷️
- Limit Agent Usage chart to top 10 sessions by queries 🔟
- Toggle Agent Usage chart between query counts and time metrics ⏱️
- Auto Run queries now record stats with accurate `source: auto` 🤖
- Interactive queries detect Auto Run state to tag stats correctly 🧠
- Smarter cumulative token normalization avoids inflated first-event context % 🛡️
- About modal shows dev commit hash alongside app version 🔍
- Group chat history summaries now strip markdown for cleaner reading 🧹
2026-01-22 10:24:25 -06:00
Raza Rauf
8a6faf7836 Merge pull request #224 from pedramamini/code-refactor
refactor: modularize preload.ts into domain-specific modules with tests
2026-01-22 10:02:09 -06:00
Raza Rauf
57940c28f2 fix: address PR review feedback for preload refactoring
- Replace any[] with proper types in settings.ts (StoredSession, Group).
- Replace console.log with logger service in process.ts.
- Add consistent debug logging across remote IPC handlers.
2026-01-22 20:57:21 +05:00
Raza Rauf
1c2a8101ee refactor: modularize preload.ts into domain-specific modules with tests 2026-01-22 20:33:55 +05:00
Raza Rauf
7749fa5251 Merge pull request #222 from pedramamini/code-refactor
refactor: extract leaderboard and notification handlers from main/index.ts
2026-01-21 12:48:39 -06:00
Raza Rauf
888b53c718 fix: harden TTS and leaderboard handlers against security vulnerabilities
Security fixes:
- Add TTS command whitelist validation to prevent command injection
- Change spawn() to use shell: false for TTS execution
- Add 30-second fetch timeout to all leaderboard API calls
- Add TTS queue size limit (max 10) to prevent memory exhaustion

Test coverage:
- 25+ security tests for TTS command validation
- Timeout tests for all 6 leaderboard handlers
- Queue size limit tests
2026-01-21 23:37:16 +05:00
Raza Rauf
26a2af2182 fix: address PR review feedback for notification handlers
- Remove all console.log/console.error statements in favor of logger
- Fix potential race condition in TTS queue by setting isTtsProcessing
  flag before checking queue length
- Add comprehensive JSDoc comment explaining TTS_MIN_DELAY_MS (15s) rationale
- Fix type guard for stdin error handling with proper type checks
2026-01-21 23:15:25 +05:00
Raza Rauf
8ef8bba615 refactor: extract leaderboard and notification handlers from main/index.ts 2026-01-21 23:04:30 +05:00
Raza Rauf
a7b0f9af20 Merge pull request #220 from pedramamini/code-refactor
refactor: extract filesystem, attachments, and web handlers from main/index.ts
2026-01-21 20:05:35 +05:00
Raza Rauf
233863aa7f docs: document why registerWebHandlers is called separately
Add JSDoc comment explaining that web handlers require access to
module-level webServer state with getter/setter functions for proper
lifecycle management, which is why they are registered separately
in main/index.ts rather than through registerAllHandlers().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 04:33:13 +05:00
Raza Rauf
ec5726aab5 fix: address PR review feedback
- Add path traversal protection in attachments handlers using path.basename()
- Extract IMAGE_EXTENSIONS constant in filesystem.ts to avoid duplication
- Extract SERVER_STARTUP_TIMEOUT_MS and SERVER_STARTUP_POLL_INTERVAL_MS constants in web.ts
- Add proper AITabData type for aiTabs parameter in web:broadcastTabsChange handler
2026-01-21 04:12:44 +05:00
Raza Rauf
3a8155368a chore: add debug logging to web:broadcastUserInput handler
Add debug logging to help diagnose web broadcast issues. Logs webServer
existence and client count when broadcastUserInput is called.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 03:36:18 +05:00
Raza Rauf
b1b8736e04 refactor: extract filesystem, attachments, and web handlers from main/index.ts
Phase 2 of main process refactoring - extract IPC handlers to dedicated modules.

Extracted handlers:
- handlers/filesystem.ts: 10 handlers (fs:homeDir, fs:readDir, fs:readFile,
  fs:stat, fs:directorySize, fs:writeFile, fs:rename, fs:delete, fs:countItems,
  fs:fetchImageAsBase64)
- handlers/attachments.ts: 5 handlers (attachments:save, attachments:load,
  attachments:delete, attachments:list, attachments:getPath)
- handlers/web.ts: 14 handlers (web:broadcastUserInput, web:broadcastAutoRunState,
  web:broadcastTabsChange, web:broadcastSessionState, live:toggle, live:getStatus,
  live:getDashboardUrl, live:getLiveSessions, live:broadcastActiveSession,
  live:startServer, live:stopServer, live:disableAll, webserver:getUrl,
  webserver:getConnectedClients)

Changes:
- All handler logic preserved exactly as-is (no functional changes)
- All IPC channel names and signatures unchanged
- Dependency injection used for web handlers (getWebServer, setWebServer, createWebServer)
- Filesystem handlers use stores directly (no dependencies needed)
- Attachments handlers receive app dependency for userData path

Tests added:
- 23 tests for filesystem handlers
- 13 tests for attachments handlers
- 25 tests for web handlers (including edge cases for server startup timeout)

Removed ~677 lines from main/index.ts, added ~805 lines across new modules.
2026-01-21 01:23:58 +05:00
Raza Rauf
bc5f03364b Merge pull request #219 from pedramamini/code-refactor
fix: address PR feedback for stores module
2026-01-21 00:26:45 +05:00
Raza Rauf
58f170df6d fix: improve path validation security in getCustomSyncPath
Addresses PR review feedback on path traversal detection:

1. Fixed false positive issue - now checks for literal ".." path segments BEFORE normalization, allowing valid paths like "/Users/test/my..project" while still blocking traversal attacks like "/Users/../../../etc"

2. Added null byte check - prevents Unix security vulnerability

3. Added Windows reserved names check (CON, PRN, AUX, NUL, COM1-9, LPT1-9)

4. Improved Windows sensitive path detection - now checks across all drive letters (not just C:) and added more system directories

5. Added tests for:
   - Valid paths with ".." in directory names
   - Null byte rejection
   - More specific traversal error assertion

All 102 stores module tests pass. Lint passes.
2026-01-21 00:17:40 +05:00
Raza Rauf
efac035718 fix: address PR feedback for stores module
1. Type Safety: Added StoredSession interface with required fields (id, name, toolType, cwd, projectRoot) and index signature. Changed SessionsData.sessions from any[] to StoredSession[]. Changed GroupsData.groups from any[] to Group[].

2. Test Mock Cleanup: Refactored instances.test.ts to use vi.hoisted() for proper mock scoping, avoiding potential test interference.

3. Path Validation Security: Added isValidSyncPath() to getCustomSyncPath() that rejects relative paths, traversal sequences, paths that are too short, and paths in sensitive system directories.

Added 7 new path validation tests. All 15,311 tests pass.
2026-01-21 00:05:44 +05:00
Raza Rauf
681aa637e0 Merge pull request #218 from pedramamini/code-refactor
refactor: extract stores module from main/index.ts with comprehensive…
2026-01-20 23:53:10 +05:00
Raza Rauf
edde5d7a8f refactor: extract stores module from main/index.ts with comprehensive tests
Split monolithic store code from index.ts into dedicated src/main/stores/ module
following single responsibility principle:

- types.ts (112 lines) - Centralized type definitions
- defaults.ts (86 lines) - Default values and getDefaultShell()
- instances.ts (175 lines) - Store instance lifecycle management
- getters.ts (118 lines) - Public store accessor functions
- utils.ts (94 lines) - Utility functions (getCustomSyncPath, getEarlySettings)
- index.ts (72 lines) - Public API re-exports
2026-01-20 23:47:34 +05:00
Raza Rauf
ff176e4dcb Merge pull request #215 from pedramamini/format-codebase
chore: format entire codebase with prettier
2026-01-19 15:44:51 -06:00
Raza Rauf
231fe2fd88 chore: format entire codebase with prettier
Run `npm run format` across all TypeScript/TSX files
for consistent code formatting throughout the project.
2026-01-20 02:21:36 +05:00
Raza Rauf
6041b62b0b Merge pull request #214 from pedramamini/code-refactor
perf: optimize hot path performance in main process
2026-01-19 15:16:02 -06:00
Raza Rauf
d1056664ff fix: moved beforeEach import to top 2026-01-20 02:12:06 +05:00
Raza Rauf
c7a3b4a0df fix + test: address PR recommendations + add comprehensive tests for performance optimizations 2026-01-20 02:01:53 +05:00
Raza Rauf
557066babb perf: optimize hot path performance in main process
- Pre-compile regex patterns at module level to avoid repeated compilation in data handlers that fire hundreds of times per second
- Add conditional debugLog() function to skip logging overhead in production (can be enabled via DEBUG_GROUP_CHAT=1 env var)
- Optimize group chat buffer from O(n²) string concatenation to O(n) array-based buffering with single join on read
- Consolidate MaestroSettings interface to single source of truth in persistence.ts to fix type incompatibility errors
2026-01-20 01:38:47 +05:00
Raza Rauf
83cc8da4eb Merge pull request #213 from pedramamini/code-refactor
Added pre-commit husky hooks that to enforce project standards
2026-01-19 13:15:15 -06:00
Raza Rauf
491cef67fa chore: address PR review feedback
- Add troubleshooting section for pre-commit hooks in CONTRIBUTING.md
- Make prepare script resilient for CI/Docker: husky || true
- Update .prettierignore to exclude coverage/ and *.min.js
2026-01-20 00:11:22 +05:00
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
cea3818e42 Merge pull request #212 from pedramamini/code-refactor
eslint-config-prettier added along with necessary editor config files for standardized formatting
2026-01-19 11:23:57 -06:00
Raza Rauf
f90892115e added eslint-config-prettier along with necessary config files for streamlined formatting 2026-01-19 22:15:39 +05:00