Commit Graph

1896 Commits

Author SHA1 Message Date
Pedram Amini
079fd72e88 MAESTRO: Refactor agent-output-parser.ts for improved type safety
- Add isValidToolType() type guard to replace unsafe `as ToolType` casts
- Make `raw` field optional in ParsedEvent interface since never read
- Fix MockParser in tests to implement missing error detection methods
- Add @internal JSDoc to test-only exports (hasOutputParser, getAllOutputParsers, clearParserRegistry)
- Update AGENT_SUPPORT.md to reference canonical ParsedEvent source instead of duplicating type definition
- Add tests for new isValidToolType function
2025-12-30 11:13:46 -06:00
Pedram Amini
5a6d94d282 MAESTRO: Consolidate GlobalAgentStats type to shared types
- Add GlobalAgentStats and ProviderStats interfaces to src/shared/types.ts
- Update agentSessions.ts to import and re-export from shared types
- Update AboutModal.tsx to import GlobalAgentStats from shared types
- Update test file to use shared GlobalAgentStats type instead of duplicate

Eliminates 3 duplicate definitions of GlobalAgentStats across the codebase.
All 47 AboutModal tests pass. TypeScript type checking passes.
2025-12-30 10:28:33 -06:00
Pedram Amini
2af14c765a MAESTRO: Extract pricing utility to eliminate 24 duplications of cost calculation
- Created src/main/utils/pricing.ts with calculateCost() and calculateClaudeCost()
- Added TOKENS_PER_MILLION constant to constants.ts
- Removed dead code: STATS_BATCH_SIZE, ClaudeSessionParseLimits, ClaudePricing type exports
- Updated agentSessions.ts, claude.ts, claude-session-storage.ts to use new utility
- Added 8 unit tests for pricing module

Eliminates ~60 lines of duplicated cost calculation code across 3 files.
2025-12-30 10:22:28 -06:00
Pedram Amini
d3acf31e0f ## CHANGES
- Added per-session SSH remote config, overriding agent defaults cleanly 🚀
- Wizard now saves SSH settings per session, not per agent 🧭
- Agent spawning pipeline passes session SSH config end-to-end seamlessly 🔗
- Session storage now skips stale/missing session files to avoid errors 🛡️
- Release workflow now checks out `main` explicitly for reliable automation ⚙️
- Docs updated with v0.13–0.14 highlights: graphs, dashboards, exchange 📚
2025-12-30 07:17:36 -06:00
Pedram Amini
318dafe26c ## CHANGES
- Added per-session SSH remote binding, overriding agent-level SSH settings 🎯
- New instance creation now passes SSH remote config per session 🧩
- Process handler resolves SSH config by session > agent > global defaults 🧭
- SSH now forces no-TTY mode to avoid sourcing shell rc files 🧯
- Remote commands now run via `$SHELL -lc` for full user PATH 🛤️
- Introduced safe double-quote shell escaping for layered SSH execution 🧷
- Added detailed SSH command build logging for easier remote debugging 🔍
- Settings UI revamped: context warnings toggle separated from threshold sliders 🧰
- Threshold sliders now visually disable/ghost when warnings are off 🫥
- Session and process types updated to include session-level SSH configuration 🧾
2025-12-30 07:01:02 -06:00
Pedram Amini
d3f611e14e ## CHANGES
- Pick an SSH remote when creating a new group chat! 🛰️
- Edit existing group chats with top-level SSH remote execution controls! 🛠️
- Agent edit modal now uses dedicated SSH Remote selector UI! 🎛️
- Wizard agent selection adds compact SSH Remote selector in config view! 🧙
- SSH Remote selector UX revamped: “local vs selected remote” clarity! 🔍
- Removed global default SSH remote logic for simpler, explicit choices! 🧹
- Selector styling now matches form fields for cleaner modal layouts! 🎨
- Status indicator now reflects selected remote, not “effective” fallback! 📡
- SSH remotes are loaded automatically in group chat modals on open! 
- SSH remote config resets cleanly when modals reset state! 🔄
2025-12-30 05:14:50 -06:00
Pedram Amini
f3499ab7f0 POST "https://api.openai.com/v1/responses": 400 Bad Request {
"message": "Invalid 'input[0].content': string too long. Expected a string with maximum length 10485760, but got a string with length 11952519 instead.",
    "type": "invalid_request_error",
    "param": "input[0].content",
    "code": "string_above_max_length"
  }
2025-12-30 04:41:36 -06:00
Pedram Amini
4d67cce6e1 ## CHANGES
- Enforced strict Node versioning with `.npmrc` engine-strict enabled ⚙️
- Declared Node.js >=20 requirement via `package.json` engines field 🚀
- Added early WSL2 environment checks during app startup 🕵️
- Introduced WSL detector utility to identify WSL and cache results 🧠
- Detects `/mnt/<drive>` Windows-mount paths to prevent common breakages 🧭
- Emits clear warnings for WSL mount risks: sockets, Electron, npm, git 🔥
- Added user-friendly WSL warning message with fix steps and docs link 📣
- Expanded installation docs with WSL2 best-practice cloning guidance 📘
- Added troubleshooting playbook for WSL2 errors and proven remedies 🛠️
- Polished File Explorer status bar styling with rounded bordered container 🎨
2025-12-30 04:14:24 -06:00
Pedram Amini
630075b414 Merge pull request #121 from pedramamini/1-ssh-tunnel-agents
ssh tunneling enhancements
2025-12-30 04:00:19 -06:00
Pedram Amini
15f1026847 Merge pull request #120 from t1mmen/fix/detect-node-version-manager-paths-dry
refactor: consolidate tilde expansion and version utilities
2025-12-30 03:58:23 -06:00
Timm Stokke
1350bf7c74 refactor: consolidate tilde expansion into shared expandTilde
Removes 4 duplicate implementations of tilde expansion (~/) and
consolidates them into a single shared function in pathUtils.ts.

Changes:
- Add optional homeDir param to expandTilde for dependency injection
- Refactor agent-detector.ts to use shared expandTilde
- Refactor ssh-command-builder.ts to use shared expandTilde
- Refactor ssh-config-parser.ts to use shared expandTilde
- Refactor ssh-remote-manager.ts to use shared expandTilde
- Update ssh-command-builder tests to mock os.homedir()

Net reduction: 38 lines of code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 03:57:44 -06:00
Timm Stokke
a9c1f5b34e refactor: use shared compareVersions utility
Replace duplicated version comparison logic with shared utility:
- process-manager.ts: use compareVersions for Node version sorting
- update-checker.ts: remove local parseVersion/compareVersions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-30 03:57:44 -06:00
Timm Stokke
9eca0dc054 refactor: add shared path and version utilities
Extract common utilities to src/shared/pathUtils.ts:
- expandTilde: tilde expansion for paths
- parseVersion: parse semver strings to arrays
- compareVersions: compare version strings (1/-1/0)

These consolidate duplicated logic found across multiple files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-30 03:56:01 -06:00
Pedram Amini
11c12e5b02 refactor: extract version sorting helper and add tests for Node version manager detection
- Extract duplicated sortNodeVersionsDescending() helper function
- Add comprehensive unit tests for version sorting logic
- Reduces code duplication from 4 inline sorts to 1 reusable function
2025-12-30 03:45:45 -06:00
Pedram Amini
6433d654fc MAESTRO: Add SSH remote support to basic git IPC handlers
Wire up SSH context to git:status, git:diff, git:isRepo, git:numstat,
git:branch, git:branches, git:tags, git:remote, and git:info handlers.
These operations now support executing on remote hosts via SSH when
an sshRemoteId parameter is provided.

Changes:
- Add sshRemoteId parameter to git handlers in git.ts
- Import execGitRemote from remote-git.ts for SSH execution
- Update preload.ts with new function signatures
- Update global.d.ts with TypeScript types
- Update gitService in renderer with SSH support
- Wire SSH context to useGitStatusPolling hook
- Wire SSH context to useWorktreeValidation hook
- Update tests to expect new parameter signatures
2025-12-30 03:43:19 -06:00
Pedram Amini
1629b327ff Merge pull request #119 from t1mmen/fix/detect-node-version-manager-paths
fix: detect Node version manager paths in process spawning
2025-12-30 03:43:08 -06:00
Pedram Amini
c8d0388d15 MAESTRO: Update tests to expect sshRemoteId parameter in assertions
Test fixes for SSH context propagation:
- AutoRun.test.tsx: Add undefined sshRemoteId to writeDoc assertions
- AutoRunBlurSaveTiming.test.tsx: Add undefined sshRemoteId to writeDoc assertions
- AutoRunContentSync.test.tsx: Add undefined sshRemoteId to writeDoc assertions
- AutoRunSessionIsolation.test.tsx: Add undefined sshRemoteId to writeDoc assertions
- useBatchProcessor.test.ts: Add undefined sshRemoteId to worktreeSetup/worktreeCheckout assertions

All tests now correctly expect the optional sshRemoteId parameter that was added
for SSH remote session support. For local sessions, this parameter is undefined.
2025-12-30 03:40:35 -06:00
Pedram Amini
1f44d61dcf MAESTRO: Wire up SSH context to worktree batch processing hooks
- Added sshRemoteId parameter to useWorktreeValidation deps interface
- Updated worktreeInfo() and getRepoRoot() calls to pass SSH context
- Added sshRemoteId to WorktreeConfig interface in useWorktreeManager
- Updated worktreeSetup() and worktreeCheckout() to use sshRemoteId
- Modified useBatchProcessor to inject session.sshRemoteId into worktree config

This ensures batch processing worktree operations work correctly on
remote SSH sessions, completing the SSH remote support implementation.

All 12 existing worktree validation tests pass.
2025-12-30 03:40:35 -06:00
Pedram Amini
c0b38a7ea9 MAESTRO: Disable Document Graph for SSH remote sessions
Document Graph requires local filesystem access to scan markdown files
and cannot work with remote hosts via SSH. Added remote session detection
to show a styled unavailable message when sshRemoteId is present.

- Added sshRemoteId prop to DocumentGraphViewProps interface
- Added remote session unavailable UI with themed styling
- Pass sshRemoteId from activeSession to DocumentGraphView in App.tsx
2025-12-30 03:40:35 -06:00
Pedram Amini
c11259b1bc MAESTRO: Wire up SSH context to Auto Run component IPC calls
Updates the AutoRun component to pass SSH context for remote session support:

- Add sshRemoteId prop to AutoRunProps interface
- Update AttachmentImage component to use SSH context for loading remote images
- Pass sshRemoteId to all window.maestro.fs.readFile() calls (3 locations)
- Pass sshRemoteId to window.maestro.autorun.writeDoc() in handleSave and handleResetTasks
- Update both baseMarkdownComponents and searchHighlightedComponents useMemo hooks
- Update RightPanel.tsx to pass session.sshRemoteId through autoRunSharedProps
- Update AutoRunExpandedModal.tsx interface for TypeScript correctness

This completes Task 5.2 of SSH Remote Full Support - Auto Run can now read/write
documents and load images on remote sessions via SSH.
2025-12-30 03:39:25 -06:00
Pedram Amini
0c0f810a10 MAESTRO: Add SSH remote support to Auto Run IPC handlers
Add SSH support to core Auto Run document operations for remote file
access when sessions are running on SSH remote hosts.

Changes:
- autorun.ts: Added imports for Store, SshRemoteConfig, remote-fs utils
- autorun.ts: Added AutorunHandlerDependencies interface with settingsStore
- autorun.ts: Created getSshRemoteById helper and scanDirectoryRemote function
- autorun.ts: Updated listDocs handler to scan remote directories via SSH
- autorun.ts: Updated readDoc handler to read files via readFileRemote()
- autorun.ts: Updated writeDoc handler to write files via writeFileRemote()
- autorun.ts: Updated watchFolder to return isRemote: true for remote sessions
  (chokidar cannot watch remote directories, UI should poll instead)
- index.ts: Pass settingsStore to registerAutorunHandlers()
- preload.ts: Added sshRemoteId parameter to listDocs, readDoc, writeDoc, watchFolder
- global.d.ts: Updated type signatures with sshRemoteId parameter

This enables Phase 5 tasks 5.1 and 5.3 of SSH remote support. Task 5.2
(updating AutoRun.tsx component) remains to wire up the SSH context.
2025-12-30 03:39:25 -06:00
Pedram Amini
8b0fd296ac MAESTRO: Add SSH support to git worktree IPC handlers
Phase 4 implementation for SSH remote sessions:

- Create remote-git.ts module with SSH-enabled git operations:
  - worktreeInfoRemote(), worktreeSetupRemote(), worktreeCheckoutRemote()
  - listWorktreesRemote(), getRepoRootRemote()
  - Uses shell escaping and executes git commands via SSH

- Update git IPC handlers to accept optional sshRemoteId:
  - git:worktreeInfo, git:worktreeSetup, git:worktreeCheckout
  - git:listWorktrees, git:getRepoRoot
  - Dispatches to remote or local execution based on presence of sshRemoteId

- Handle remote file watching gracefully:
  - git:watchWorktreeDirectory returns isRemote: true for SSH sessions
  - UI can detect this and fall back to polling via listWorktrees

- Add GitHandlerDependencies interface for settingsStore access
- Update preload.ts and global.d.ts with new method signatures
2025-12-30 03:39:25 -06:00
Pedram Amini
edb845c0eb MAESTRO: Wire up SSH context to File Explorer fs operations
Pass sshRemoteId to fs.readDir and fs.directorySize calls in:
- loadFileTree() for remote directory listing
- useFileTreeManagement hook for all file tree operations

This completes Phase 3 of SSH remote support, enabling the
File Explorer to work with remote sessions over SSH.

Added unit tests for SSH context propagation.
2025-12-30 03:36:37 -06:00
Pedram Amini
f6e40a282a MAESTRO: Add SSH remote support to FS IPC handlers
Update fs:readDir, fs:readFile, fs:stat, and fs:directorySize IPC handlers
to accept optional sshRemoteId parameter. When provided, operations dispatch
to remote-fs utilities that execute commands via SSH on the remote host.

This completes Task 2.2 of the SSH Remote Full Support feature:
- Created getSshRemoteById helper to look up SSH config by ID
- fs:readDir dispatches to readDirRemote when sshRemoteId provided
- fs:readFile dispatches to readFileRemote with image handling
- fs:stat dispatches to statRemote with mtime fallback for createdAt
- fs:directorySize dispatches to directorySizeRemote (size only)
- Updated preload.ts and global.d.ts type signatures
2025-12-30 03:36:37 -06:00
Pedram Amini
6a498ffcda MAESTRO: Add remote-fs module for SSH file system operations
Creates src/main/utils/remote-fs.ts with SSH wrappers for:
- readDirRemote: ls -1AF command parsing
- readFileRemote: cat command for file contents
- statRemote: stat command with GNU/BSD format support
- directorySizeRemote: du command for directory sizes
- writeFileRemote: base64-encoded file writing
- existsRemote: test -e path existence check
- mkdirRemote: directory creation

All functions use shell escaping for security and return
RemoteFsResult<T> with success/failure status and error messages.

Includes 43 unit tests covering output parsing, error handling,
and SSH context integration.
2025-12-30 03:36:37 -06:00
Pedram Amini
bc7e9d12ad MAESTRO: Pass SSH context through component tree for file operations
Phase 1, Task 1.3: Updated hooks and components to access session.sshRemoteId
and session.remoteCwd for future remote file operations support.

Changes:
- Added SshContext interface to fileExplorer.ts
- Updated loadFileTree() to accept optional SSH context parameter
- Added getSshContext() helper in useFileTreeManagement hook
- Updated refreshFileTree, refreshGitFileState, and initial load effect
  to pass SSH context when session has sshRemoteId
- Added test for SSH context propagation

This prepares the codebase for Phase 2 (Remote File System Utilities)
where actual SSH-aware file operations will be implemented.
2025-12-30 03:36:37 -06:00
Pedram Amini
4c1abe02a8 MAESTRO: Populate sshRemoteId and remoteCwd on session at spawn
- Extended SSH remote event payload to include remoteWorkingDir field
- Updated onSshRemote handler in App.tsx to populate session-wide SSH context
- sshRemoteId and remoteCwd are now set when a process spawns on an SSH remote
- These fields enable future features: remote file explorer, git, auto run
2025-12-30 03:36:37 -06:00
Pedram Amini
42770326c6 MAESTRO: Add sshRemoteId and remoteCwd fields to Session interface
Phase 1, Task 1.1 of SSH Remote Full Support:
- Added sshRemoteId?: string for flat access to SSH remote config ID
- Added remoteCwd?: string for remote working directory tracking
- These complement existing sshRemote object for easier component tree access
2025-12-30 03:36:37 -06:00
Pedram Amini
3af8bcc815 ## CHANGES
- Added cloud sync IPC to restore leaderboard stats on new installs 🚀
- Exposed `maestro.leaderboard.sync` in preload with typed results for safety 🧩
- Leaderboard modal now supports “Sync from Cloud” to pull down stats ☁️
- Auto-run stats can be updated from synced server values, including badges 🏅
- Added clear sync status messaging plus robust token/email error handling 🛡️
- Document graph double-click now focuses nodes and expands neighbor ego-network 🕸️
- ForceGraph gained real double-click detection instead of ignoring the handler 🖱️
- Reworked graph link rendering for sharper widths/colors and null-safe endpoints 🎨
- Usage dashboard added Cmd+Shift+[ / ] shortcuts to cycle tabs quickly ⌨️
- Usage dashboard UI refined: cleaner dropdown styling and removed refresh button 🧼
2025-12-30 03:33:11 -06:00
Pedram Amini
62c2f8f4ee ## CHANGES
- Settings checkboxes upgraded into sleek right-aligned toggle switches 🎛️
- Full-row setting cards now toggle on click for faster changes 🖱️
- Keyboard accessibility added: Enter/Space toggles settings cleanly ⌨️
- Toggle buttons now prevent event bubbling for reliable interactions 🛑
- Context Window Warnings setting redesigned with the new toggle UI ⚠️
- Toggle styling now reflects theme colors for clearer on/off states 🎨
- Batch progress totals now track net task changes, not just additions 📈
- Document processor computes `totalTasksChange` for accurate task accounting 🧮
- Overall batch state updates now correctly handle added and completed tasks 🔄
2025-12-30 02:28:19 -06:00
Pedram Amini
4015ce8b02 ## CHANGES
- Polished Gist publish modal buttons with consistent small-text styling 🧩
- Prevented button label wrapping for cleaner, stable modal layouts 📐
2025-12-30 01:58:04 -06:00
Pedram Amini
396e74aa54 ## CHANGES
- Run git commands remotely via SSH with optional `sshRemoteId` support 🚀
- New `execGit` dispatcher seamlessly chooses local vs remote execution 🧭
- Git IPC handlers now accept remote working directory overrides for flexibility 🛰️
- Git handler registration injects settings store for SSH remote lookups 🧩
- SSH execution hardened: disable forwarding and TTY to avoid flaky runs 🛡️
- Document Graph fully rewritten to `react-force-graph-2d` for smoother visuals 🎛️
- Added focus mode with neighbor-depth slider for ego-network exploration 🔍
- Node size now reflects connection counts for instant relationship insight 📈
- Graph data builder decoupled from React Flow; positions handled by D3 physics 🧠
- Persistence now avoids saving empty sessions before initial load completes 🔒
2025-12-30 01:39:34 -06:00
Pedram Amini
621f60c6cd OAuth enabled but no valid token found. Starting authentication...
Found expired OAuth token, attempting refresh...
Token refresh successful
## CHANGES

- Bumped app version to 0.14.0 with fresh dependency refresh 🚀
- Added <a href="https://www.npmjs.com/package/react-force-graph-2d">react-force-graph-2d</a> for richer graph visualization options 🧠
- DocumentGraph layouts now use two-phase positioning for cleaner clusters 🧭
- External link nodes now sit on periphery/runs below hierarchy, reducing chaos 🪐
- Force layout spacing tuned for better readability and fewer overlaps 📐
- Added fallback grid layout when only external nodes exist 🧩
- SSH remote configs now persist `useSshConfig` and `sshConfigHost` metadata 🔐
- SSH Config host picker now supports filtering + keyboard navigation ⌨️
- SSH remote validation relaxed: username/key optional, leverage ssh-agent defaults 🗝️
- File explorer shows RTL-ellipsized cwd and double-click copies path 🎯
2025-12-30 00:32:06 -06:00
Timm Stokke
d4e4cf96db refactor: consolidate tilde expansion into shared expandTilde
Removes 4 duplicate implementations of tilde expansion (~/) and
consolidates them into a single shared function in pathUtils.ts.

Changes:
- Add optional homeDir param to expandTilde for dependency injection
- Refactor agent-detector.ts to use shared expandTilde
- Refactor ssh-command-builder.ts to use shared expandTilde
- Refactor ssh-config-parser.ts to use shared expandTilde
- Refactor ssh-remote-manager.ts to use shared expandTilde
- Update ssh-command-builder tests to mock os.homedir()

Net reduction: 38 lines of code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 21:34:11 -08:00
Timm Stokke
e744ba41cb refactor: use shared compareVersions utility
Replace duplicated version comparison logic with shared utility:
- process-manager.ts: use compareVersions for Node version sorting
- update-checker.ts: remove local parseVersion/compareVersions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-29 21:11:31 -08:00
Timm Stokke
ede75f2ded refactor: add shared path and version utilities
Extract common utilities to src/shared/pathUtils.ts:
- expandTilde: tilde expansion for paths
- parseVersion: parse semver strings to arrays
- compareVersions: compare version strings (1/-1/0)

These consolidate duplicated logic found across multiple files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-29 21:11:14 -08:00
Timm Stokke
5bac9c51fb fix: detect Node version manager paths in process spawning
GUI applications (like Electron) don't inherit shell PATH configuration,
causing 'env: node: No such file or directory' errors for users who install
Node via version managers (nvm, fnm, volta, mise, asdf, n).

This adds automatic detection of common Node version manager installations
and includes their bin paths when spawning AI agent and terminal processes.

Supported version managers:
- nvm (reads default version from ~/.nvm)
- fnm (Fast Node Manager)
- volta
- mise (formerly rtx)
- asdf
- n

The detection runs at process spawn time and only adds paths that exist
on the system. This ensures node/npm are available without requiring
users to set up wrapper scripts or launchctl environment variables.

Fixes the "Agent exited with code 127" error for nvm users.
2025-12-29 20:06:02 -08:00
Pedram Amini
bc0db13cd7 ## CHANGES
- Added Escape-triggered “Close Document Graph?” confirmation modal for safety 🛡️
- Improved graph data loading: cache preserved unless settings or rootPath change 
- Resized Document Graph modal to a cleaner, consistent 90vw/90vh view 🖥️
- Repositioned legend to bottom-center for better visibility and balance 🧭
- Increased default node/rank spacing to reduce clutter and overlaps 📐
- Tuned force layout: stronger repulsion, collision, and longer link distances 🧲
- Extended force simulation iterations for more stable, converged layouts ⏱️
- Upgraded hierarchical layout: larger margins, better ranker, roomier nodes 🏗️
- Adjusted external link sizing/padding and edge min-length to avoid clustering 🔗
2025-12-29 19:13:04 -06:00
Pedram Amini
e025fba795 Merge pull request #118 from pedramamini/1-ssh-tunnel-agents
## CHANGES - Import SSH remotes straight from `~/.ssh/config` via new dropdown picker 🚀 - Run remotes using SSH Host patterns, not raw IPs anymore 🧭 - Username and private key become optional when SSH config is enabled 🔑 - SSH commands now omit `-i` unless you explicitly override keys 🎛️ - Default port 22 no longer forced; only send `-p` when overriding 🔌 - New SSH config parser supports HostName, User, Port, IdentityFile, ProxyJump 🧩 - Wildcard-only hosts (`Host *`, `dev-*`) are ignored for cleaner imports 🧹 - UI shows “Using SSH Config” indicator with one-click clear toggle 🏷️ - Added IPC + preload API to fetch SSH config hosts safely 🛡️ - Expanded test coverage for SSH-config mode command-building and parsing 
2025-12-29 19:11:28 -06:00
Pedram Amini
d5284434b8 ## CHANGES
- Import SSH remotes straight from `~/.ssh/config` via new dropdown picker 🚀
- Run remotes using SSH Host patterns, not raw IPs anymore 🧭
- Username and private key become optional when SSH config is enabled 🔑
- SSH commands now omit `-i` unless you explicitly override keys 🎛️
- Default port 22 no longer forced; only send `-p` when overriding 🔌
- New SSH config parser supports HostName, User, Port, IdentityFile, ProxyJump 🧩
- Wildcard-only hosts (`Host *`, `dev-*`) are ignored for cleaner imports 🧹
- UI shows “Using SSH Config” indicator with one-click clear toggle 🏷️
- Added IPC + preload API to fetch SSH config hosts safely 🛡️
- Expanded test coverage for SSH-config mode command-building and parsing 
2025-12-29 19:10:55 -06:00
Pedram Amini
43ec590475 ## CHANGES
- Bumped Maestro to v0.14.0 with a fresh release cutover 🚀
- Added self-serve “Resend Confirmation” for leaderboard token recovery 📧
- Wired new `leaderboard:resendConfirmation` IPC handler end-to-end 🧩
- Upgraded registration modal with resend-first flow, manual token fallback 🛟
- Added Quick Actions entry to open the Document Graph instantly 
- Document Graph now persists external-links toggle back into settings 💾
- Document Graph modal now preserves state across closes for continuity 🔒
- React Flow controls are fully theme-styled with dynamic injected CSS 🎨
- Improved graph layouts to reduce external-node overlap in both modes 🧭
- Wizard now detects provider errors and shows recovery hints + “Go Back” 🧠
2025-12-29 18:06:31 -06:00
Pedram Amini
6939fa2565 Merge pull request #111 from pedramamini/1-ssh-tunnel-agents
feat: SSH Remote Execution for AI Agents
2025-12-29 18:05:42 -06:00
Pedram Amini
558419a755 ## CHANGES
- Bumped Maestro version to 0.13.1 for the latest improvements 🚀
- Added Document Graph IPC handlers to enable live file watching 📈
- Introduced SSH Remote IPC handlers for managing saved SSH configurations 🛰️
- Added a dedicated SSH tab in Settings for cleaner navigation 🗂️
- Updated Settings keyboard tab-cycling to include the new SSH section ⌨️
- Refined Settings UI with a new Server icon for SSH tab branding 🖥️
- Moved SSH Remote hosts configuration into its own SSH Settings panel 🔐
2025-12-29 17:22:06 -06:00
Pedram Amini
43df1a42a6 docs: Add SSH Remote Execution documentation
Add comprehensive documentation for the SSH remote execution feature:
- New ssh-remote-execution.md with full guide
- Update configuration.md with SSH Remotes section reference
- Update features.md with feature highlight
- Add to docs.json navigation
2025-12-29 17:22:06 -06:00
Pedram Amini
431d3a04f1 dropped spec file 2025-12-29 17:22:06 -06:00
Pedram Amini
b3a490e0fa MAESTRO: Add SSH-specific error pattern detection (Phase 8 Tasks T042-T046)
Implements SSH-specific error handling in the process manager output parsing:

- Added SSH_ERROR_PATTERNS to error-patterns.ts covering:
  - permission_denied: SSH authentication failures, host key verification, passphrase prompts
  - network_error: Connection refused, timeouts, hostname resolution, network unreachable
  - agent_crashed: Command not found, agent binary missing, broken pipe, connection drops

- Integrated SSH error detection in process-manager.ts:
  - Checks stdout lines for SSH errors after agent-specific error detection
  - Checks stderr data for SSH errors (SSH errors typically appear on stderr)
  - Checks at process exit for any SSH errors that may have been missed

- Added helper functions:
  - matchSshErrorPattern(): Match a line against SSH-specific patterns
  - getSshErrorPatterns(): Get the SSH error patterns object

- Added 36 new tests for SSH error pattern detection covering all error categories

All 12,265 tests pass.
2025-12-29 17:22:06 -06:00
Pedram Amini
ea6fa534a4 MAESTRO: Implement SSH remote connection status visibility (Phase 7 Tasks T038-T041)
Added visual indicator in session header showing when an agent is running on a
remote SSH host. Implementation includes:

- Session type: Added sshRemote field to track active SSH remote (id, name, host)
- IPC event: Added process:ssh-remote event emitted after process spawn
- Event handler: Added onSshRemote listener in App.tsx to update session state
- UI indicator: Added purple-themed pill badge in MainPanel header with Server
  icon, remote name (truncated to 100px), and tooltip showing full details
- Test fixes: Added getMainWindow mock to process handler tests

The indicator only appears when a session is actively using SSH remote execution,
providing clear visibility into where agent commands are being run.
2025-12-29 17:22:06 -06:00
Pedram Amini
4dfc52ea96 MAESTRO: Mark Phase 6 tasks T033-T037 as completed (connection test functionality)
All Phase 6 tasks were already implemented as part of Phase 3 work:
- T033: ssh-remote:test handler in src/main/ipc/handlers/ssh-remote.ts
- T034: test IPC exposed in src/main/preload.ts
- T035: testConnection function in useSshRemotes hook
- T036: Test Connection button and result display in SshRemoteModal
- T037: Test button per remote in SshRemotesSection list

75 SSH-related tests pass confirming complete functionality.
2025-12-29 17:22:05 -06:00
Pedram Amini
4b90a5e0dc MAESTRO: Add SSH remote dropdown to per-agent configuration (Phase 5 Tasks T030-T032)
- Add SSH remote selection UI to AgentConfigPanel.tsx with dropdown options:
  - "Use Global Default" (follows global SSH remote setting)
  - "Force Local Execution" (override to run locally even if global default is set)
  - Individual SSH remotes by name
- Add status indicator showing effective remote (local vs. SSH with remote name)
- Update NewInstanceModal.tsx to:
  - Load SSH remote configurations when modal opens
  - Pass SSH remote props to AgentConfigPanel
  - Save SSH remote config to agent config store on create
- Update EditAgentModal to:
  - Load and display current SSH remote config
  - Save SSH remote config changes on save
- Add sshRemote mock to test setup for window.maestro API
- T032 was already implemented in Phase 4 (getSshRemoteConfig already checks agent override first)
2025-12-29 17:22:05 -06:00
Pedram Amini
3b74191af7 MAESTRO: Integrate SSH remote execution in process spawn (Phase 4 Tasks T027-T029)
Add SSH remote detection and command wrapping to the process:spawn IPC handler.
When an SSH remote is configured (global default or agent-specific override),
agent commands are wrapped with SSH for remote execution.

Changes:
- Import SSH utilities (getSshRemoteConfig, createSshRemoteStoreAdapter, buildSshCommand)
- Update MaestroSettings interface with sshRemotes and defaultSshRemoteId fields
- Add SSH remote resolution after agent args are built
- Wrap command with buildSshCommand when SSH remote is configured
- Disable PTY when using SSH (SSH handles terminal emulation)
- Pass custom env vars via remote command string, not locally
- Terminal sessions always run locally (need PTY for shell interaction)

Tests:
- 8 new unit tests for SSH remote execution scenarios
- All existing tests pass (12,232 tests)
2025-12-29 17:22:05 -06:00