Compare commits

...

60 Commits

Author SHA1 Message Date
Web Dev Cody
02a1af3314 Merge pull request #37 from AutoMaker-Org/refactor/monorepo-restructure
Refactor/monorepo restructure
2025-12-11 23:11:37 -05:00
Cody Seibert
2c4a977b4a chore: update package.json to enhance build configuration
- Added `artifactName` template for output files.
- Set `executableName` for the application to improve clarity in the build process.
2025-12-11 22:59:29 -05:00
Cody Seibert
28cc1400e9 refactor: simplify font imports in layout.tsx
- Removed unnecessary variable assignments for GeistSans and GeistMono.
- Updated imports to directly use the Geist font components.
2025-12-11 22:52:35 -05:00
Web Dev Cody
193627e166 Merge pull request #39 from AutoMaker-Org/copilot/fix-build-issues
Fix build issues by switching from Google Fonts to local fonts
2025-12-11 22:46:55 -05:00
Cody Seibert
72560cbd36 chore: update package-lock.json to remove unnecessary dependencies and add optional flags
- Removed `@tailwindcss/oxide-linux-x64-gnu` and `lightningcss-linux-x64-gnu` dependencies.
- Added `dev` and `optional` flags for Linux x64 binaries to enhance compatibility.
2025-12-11 22:44:11 -05:00
Cody Seibert
8b62bf9817 trying stuff 2025-12-11 22:43:57 -05:00
GTheMachine
95913714cc Update apps/app/src/app/layout.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-11 19:19:08 -08:00
copilot-swe-agent[bot]
9f0c648391 Fix build issues by switching from Google Fonts to local fonts
- Added `geist` npm package for local font files
- Updated layout.tsx to import fonts from the geist package
- Build now succeeds without network access to Google Fonts

Co-authored-by: GTheMachine <156854865+GTheMachine@users.noreply.github.com>
2025-12-12 03:06:02 +00:00
copilot-swe-agent[bot]
0b3ffb642a Initial plan 2025-12-12 02:58:08 +00:00
SuperComboGamer
7282113a0f fix: add missing native binaries for WSL development
The monorepo restructure caused npm to skip installing platform-specific
optional dependencies for tailwindcss and lightningcss. This adds explicit
dependencies for the Linux x64 binaries and removes the duplicate lockfile.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:47:45 -05:00
Cody Seibert
ada2703d3e feat: add debug option for Electron development
- Introduced a new command `dev:electron:debug` in both package.json files to launch Electron with DevTools open.
- Updated main.js to conditionally open DevTools based on the `OPEN_DEVTOOLS` environment variable.
- Refactored some IPC handler code for better readability and consistency.
2025-12-11 21:21:59 -05:00
Cody Seibert
2cc9e47747 chore: update GitHub workflows for consistency and clarity
- Standardized quotes in YAML files for better readability.
- Adjusted cache-dependency-path to point to the correct location.
- Removed unnecessary working-directory specifications to simplify the workflow.
2025-12-11 21:14:17 -05:00
Cody Seibert
e6857c6feb feat: disable automated testing by default and rename checkbox
- Change default skipTests value from false to true (tests disabled by default)
- Rename checkbox label from 'Skip automated testing' to 'Enable automated testing'
- Invert checkbox logic so checked means tests enabled
- Update help text to clarify the new behavior

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:13:45 -05:00
Cody Seibert
b5d31db57c chore: remove email-course-reminder.mjml 2025-12-11 20:43:27 -05:00
Cody Seibert
1bb20e5070 refactor: restructure project to monorepo with apps directory 2025-12-11 20:34:49 -05:00
Web Dev Cody
7cb5a6a4df Merge pull request #35 from AutoMaker-Org/refactor/remove-duplicated-kanban-display-view
refactor(settings): remove kanban display section from settings view
2025-12-11 20:08:28 -05:00
Web Dev Cody
e1e84226c9 Merge pull request #31 from AutoMaker-Org/feat/enchance-welcome-page-setup
feat: enchance welcome page setup
2025-12-11 20:06:29 -05:00
Web Dev Cody
7ff97a42cb Merge pull request #26 from AutoMaker-Org/bugfix/appspec-complete-overhaul
Complete overhaul for app spec system. Created logic to auto generate…
2025-12-11 17:28:16 -05:00
Kacper
502ac9e100 refactor(settings): remove kanban display section from settings view
Moved kanban display configuration from settings to board view to improve UX.
Removed KanbanDisplaySection component, related imports, and navigation items.
2025-12-11 23:21:38 +01:00
Shirone
e6e2fa70e2 Merge pull request #34 from AutoMaker-Org/style/enchance-sidebar-style
style: enhance sidebar layout for better responsiveness
2025-12-11 22:43:59 +01:00
Kacper
067f051ff7 style: enhance sidebar layout for better responsiveness
- Adjusted padding and flex properties in the sidebar component to improve layout when the sidebar is open or closed.
- Ensured consistent alignment and spacing for a more user-friendly interface.
2025-12-11 22:05:36 +01:00
Kacper
13de3131b7 fix: infinite loop when checking cli status 2025-12-11 21:20:34 +01:00
Kacper
c8a9ae64b6 fix: address Gemini code review suggestions
Fixed two critical code quality issues identified in code review:

1. Auth Method Selector - Tailwind CSS Dynamic Classes:
   - Replaced dynamic class name concatenation with static class mapping
   - Tailwind JIT compiler requires complete class names at build time
   - Added getBadgeClasses() helper function with predefined color mappings
   - Prevents broken styling from unparseable dynamic classes

2. Claude CLI Detector - Async Terminal Detection:
   - Moved execSync loop to async/await pattern to prevent UI blocking
   - Refactored Linux terminal detection to run before Promise constructor
   - Prevents main process freezing during terminal emulator detection
   - Improves responsiveness on Linux systems

Both fixes improve code reliability and user experience.
2025-12-11 21:07:15 +01:00
Shirone
7383babd68 chore: update app/README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-11 20:59:39 +01:00
Kacper
9dc5d64a26 refactor: modularize setup view into reusable components and hooks
Refactored setup-view.tsx (1,740 → 148 lines, -91.5%) by extracting:
- 8 reusable UI components (status badges, terminal output, etc.)
- 4 custom hooks (CLI status, installation, OAuth, token save)
- 4 step components (welcome, complete, Claude setup, Codex setup)
- 1 dialog component (OAuth token modal)

All business logic separated from UI, zero code duplication, fully type-safe.
2025-12-11 20:41:44 +01:00
Kacper
b39a88ba15 feat: enhance Claude CLI detector for macOS support
- Updated ClaudeCliDetector to include support for macOS (darwin) in the preference for using pty, improving compatibility across platforms.
2025-12-11 19:16:22 +01:00
Kacper
0510ab31e3 feat: implement OAuth token setup for Claude CLI
- Added a new SetupTokenModal component for handling OAuth token authentication.
- Integrated in-app terminal support using node-pty for seamless user experience.
- Updated ClaudeCliDetector to extract tokens from command output and handle authentication flow.
- Enhanced README with Windows-specific notes and authentication instructions.
- Updated package.json and package-lock.json to include necessary dependencies for the new functionality.
2025-12-11 19:08:08 +01:00
GTheMachine
e6a6b4cd78 Merge pull request #27 from AutoMaker-Org/copilot/sub-pr-26
Fix TypeScript build errors in SpecRegenerationAPI interface
2025-12-11 12:19:34 -05:00
copilot-swe-agent[bot]
1e6412e90e Fix TypeScript build errors in SpecRegenerationAPI interface
Co-authored-by: GTheMachine <156854865+GTheMachine@users.noreply.github.com>
2025-12-11 17:16:30 +00:00
copilot-swe-agent[bot]
7419288189 Initial plan 2025-12-11 17:08:45 +00:00
trueheads
f757270198 including type error commit fixes 2025-12-11 10:20:58 -06:00
trueheads
ca57b9e3ca ok one final pr to remove gemini-found race condition 2025-12-11 10:15:39 -06:00
trueheads
6352a1df19 final code review 2025-12-11 09:59:48 -06:00
Ben
f460e689f1 Update app/electron/services/feature-loader.js
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-12-11 09:54:22 -06:00
trueheads
74efaadb59 further gemini reviews and fixes 2025-12-11 09:36:38 -06:00
trueheads
a602b1b519 adjustments based on gemini review 2025-12-11 09:14:41 -06:00
Ben
4b1f4576ae Update app/src/components/views/spec-view.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-11 08:51:06 -06:00
Ben
60065806f4 Update app/electron/services/spec-regeneration-service.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-11 08:50:30 -06:00
Ben
9381162a8e Update app/electron/services/mcp-server-factory.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-11 08:50:13 -06:00
trueheads
626219fa62 Scans the project once again before generating features that may already be implemented. Soft tested, worked the 1 time I tried, created half as many items for an existing project. 2025-12-11 04:01:29 -06:00
trueheads
8d6f825c5c Overhaul updates for appspec & feature generation. Added detail back to kanban feature creation 2025-12-11 03:40:16 -06:00
trueheads
c198c10244 Complete overhaul for app spec system. Created logic to auto generate kanban stories after the fact as well as added logging logic and visual aids to tell what stage of the process the app spec creation is in. May need refinement for state-based updates as the menu doesnt update as dynamicly as id like 2025-12-11 03:01:45 -06:00
Web Dev Cody
acae5526b7 Merge pull request #25 from AutoMaker-Org/fix-build
feat: add repository information to package.json
2025-12-11 00:12:59 -05:00
Cody Seibert
d6ce71702e feat: add repository information to package.json
- Included repository details in package.json to enhance project metadata and facilitate easier access to the source code.
2025-12-11 00:08:55 -05:00
Web Dev Cody
a2d2f52cf8 Merge pull request #24 from AutoMaker-Org/fix-build
feat: add PR build check workflow and enhance feature management
2025-12-10 23:47:44 -05:00
Cody Seibert
7c7a044417 feat: update application icons and add marketing assets
- Replaced the application icon in package.json with a larger version for better visibility.
- Added a new logo image file `logo_larger.png` to the public directory.
- Introduced a Dockerfile for the marketing section to serve static files using Nginx.
- Created a new `index.html` file for the marketing site, featuring a responsive layout and sections for features and technology stack.
2025-12-10 23:43:23 -05:00
Cody Seibert
58a59aa391 Merge branch 'main' into fix-build 2025-12-10 23:37:14 -05:00
Web Dev Cody
9c6ff4c2e3 Merge pull request #21 from AutoMaker-Org/fix/auth-status-display-and-console-cleanup
fix: improve auth status display and remove verbose console logging
2025-12-10 23:32:46 -05:00
Cody Seibert
f2a443afad feat: move "Report Bug / Feature Request" button to header
- Relocated the "Report Bug / Feature Request" button from the bottom of the sidebar to the header, next to the AutoMaker logo for improved accessibility.
- Updated the button to be a compact icon-only version with a tooltip on hover.
- Adjusted the header layout to accommodate the new button placement.
- Removed the old button from the sidebar to streamline the interface.
2025-12-10 23:28:29 -05:00
Cody Seibert
9dc3124738 feat: update package.json with project metadata
- Added project description, homepage, author details, and maintainer information to package.json for better project documentation and visibility.
2025-12-10 23:17:47 -05:00
SuperComboGamer
e553b39454 fix 2025-12-10 23:14:23 -05:00
SuperComboGamer
0fca89e0b5 Merge pull request #23 from AutoMaker-Org/wsl
wsl
2025-12-10 23:13:28 -05:00
Cody Seibert
67a448ce91 feat: add PR build check workflow and enhance feature management
- Introduced a new GitHub Actions workflow for PR build checks to ensure code quality and consistency.
- Updated `analysis-view.tsx`, `interview-view.tsx`, and `setup-view.tsx` to incorporate a new `Feature` type for better feature management.
- Refactored various components to improve code readability and maintainability.
- Adjusted type imports in `delete-project-dialog.tsx` and `settings-navigation.tsx` for consistency.
- Enhanced project initialization logic in `project-init.ts` to ensure proper type handling.
- Updated Electron API types in `electron.d.ts` for better clarity and functionality.
2025-12-10 23:10:04 -05:00
SuperComboGamer
081fc09e4f wsl 2025-12-10 23:09:15 -05:00
SuperComboGamer
f96fa6561e Update README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-10 20:08:13 -08:00
SuperComboGamer
c667c1c682 Update app/electron/services/claude-cli-detector.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-10 20:07:54 -08:00
SuperComboGamer
d474208e8b fix: improve auth status display and remove verbose console logging
- Fix authentication status display in settings showing "Method: Unknown"
  - Add support for CLAUDE_CODE_OAUTH_TOKEN environment variable
  - Update ClaudeAuthStatus type to include all auth methods
  - Fix method mapping in use-cli-status hook
  - Display correct auth method labels in UI

- Remove verbose console logging from:
  - claude-cli-detector.js
  - codex-cli-detector.js
  - agent-service.js
  - main.js (IPC, Security logs)

- Fix TypeScript errors:
  - Add proper type exports for AutoModeEvent
  - Fix Project import paths
  - Add null checks for api.features
  - Add openExternalLink to ElectronAPI type
  - Add type annotation for REQUIRED_STRUCTURE

- Update README with clearer getting started guide

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 22:28:27 -05:00
Web Dev Cody
41f14167a6 Merge pull request #20 from AutoMaker-Org/running-agents-list
feat: implement running agents view and enhance auto mode functionality
2025-12-10 22:04:48 -05:00
Cody Seibert
f17abc93c2 Merge branch 'main' into running-agents-list 2025-12-10 21:53:41 -05:00
Cody Seibert
d08f922631 feat: implement running agents view and enhance auto mode functionality
- Added a new `RunningAgentsView` component to display currently active agents working on features.
- Implemented auto-refresh functionality for the running agents list every 2 seconds.
- Enhanced the auto mode service to support project-specific operations, including starting and stopping auto mode for individual projects.
- Updated IPC handlers to manage auto mode status and running agents more effectively.
- Introduced audio settings to mute notifications when agents complete tasks.
- Refactored existing components to accommodate new features and improve overall user experience.
2025-12-10 21:51:00 -05:00
180 changed files with 21404 additions and 17828 deletions

View File

@@ -1,14 +0,0 @@
{
"category": "Core",
"description": "do nothing, code nothing, print yolo",
"steps": [],
"status": "waiting_approval",
"images": [],
"imagePaths": [],
"skipTests": true,
"model": "opus",
"thinkingLevel": "none",
"id": "feature-1765414180387-4zcc7wpdv",
"startedAt": "2025-12-11T00:49:41.713Z",
"summary": "No code changes required. Feature requested 'do nothing, code nothing, print yolo' - completed as specified. YOLO!"
}

View File

@@ -0,0 +1,53 @@
📋 Planning implementation for: move the report bug request button to top in header next to the automaker logo
⚡ Executing implementation for: move the report bug request button to top in header next to the automaker logo
Starting code implementation...
🔧 Tool: TodoWrite
Let me start by exploring the header component and understanding the current structure.
🔧 Tool: Glob
🔧 Tool: Grep
🔧 Tool: Read
🔧 Tool: Glob
🔧 Tool: TodoWrite
I found the sidebar component. The "Report Bug / Feature Request" button is currently in the bottom section of the sidebar (lines 1150-1180). The feature request is to move this button to the top header, next to the Automaker logo.
Looking at the current structure:
1. The logo section is at lines 742-770
2. The bug report button is in the bottom section at lines 1150-1180
I'll move the bug report button to be next to the logo in the header area. Let me make this change:
🔧 Tool: Edit
Now I need to remove the old bug report button from the bottom section:
🔧 Tool: Edit
The change is complete. Let me verify the build compiles correctly:
🔧 Tool: Bash
🔧 Tool: Bash
🔧 Tool: Bash
🔧 Tool: Bash
The TypeScript check passed with no errors. Let me mark the task as completed and update the feature status:
🔧 Tool: TodoWrite
🔧 Tool: mcp__automaker-tools__UpdateFeatureStatus
🔧 Tool: TodoWrite
I've completed the feature implementation. Here's a summary of what was done:
**Changes Made:**
1. **Modified `app/src/components/layout/sidebar.tsx`:**
- Moved the "Report Bug / Feature Request" button from the bottom sidebar section (between Running Agents and Settings) to the header area, next to the AutoMaker logo
- Changed the header container from `justify-center` to `justify-between` to accommodate the new button placement
- The button is now a compact icon-only button with a tooltip on hover
- Kept the same test ID (`bug-report-link`) for consistency
- Removed the old button from the bottom section
The bug report button now appears as a small bug icon in the header, right next to the AutoMaker logo, making it more accessible and visible to users.✅ Verifying implementation for: move the report bug request button to top in header next to the automaker logo
Verifying implementation and checking test results...
✓ Verification successful: All tests passed

View File

@@ -0,0 +1,14 @@
{
"category": "Uncategorized",
"description": "move the report bug request button to top in header next to the automaker logo",
"steps": [],
"status": "waiting_approval",
"images": [],
"imagePaths": [],
"skipTests": true,
"model": "opus",
"thinkingLevel": "none",
"id": "feature-1765426941179-om12nlapa",
"startedAt": "2025-12-11T04:22:21.750Z",
"summary": "Moved the Report Bug / Feature Request button from the bottom sidebar section to the header, next to the AutoMaker logo. Modified: app/src/components/layout/sidebar.tsx. The button now appears as a compact icon button in the header area."
}

View File

@@ -0,0 +1,11 @@
{
"timestamp": "2025-12-11T04:22:21.809Z",
"modifiedFiles": [
"app/src/components/views/analysis-view.tsx",
"app/src/components/views/interview-view.tsx"
],
"untrackedFiles": [
".automaker/features/feature-1765426941179-om12nlapa/feature.json",
"marketing/index.html"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

33
.github/workflows/pr-check.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: PR Build Check
on:
pull_request:
branches:
- "*"
push:
branches:
- main
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
# Use npm install instead of npm ci to correctly resolve platform-specific
# optional dependencies (e.g., @tailwindcss/oxide, lightningcss binaries)
run: npm install
- name: Run build:electron
run: npm run build:electron

View File

@@ -3,13 +3,13 @@ name: Build and Release Electron App
on:
push:
tags:
- 'v*.*.*' # Triggers on version tags like v1.0.0
workflow_dispatch: # Allows manual triggering
- "v*.*.*" # Triggers on version tags like v1.0.0
workflow_dispatch: # Allows manual triggering
inputs:
version:
description: 'Version to release (e.g., v1.0.0)'
description: "Version to release (e.g., v1.0.0)"
required: true
default: 'v0.1.0'
default: "v0.1.0"
jobs:
build-and-release:
@@ -36,31 +36,29 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: app/package-lock.json
node-version: "20"
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
working-directory: ./app
run: npm ci
# Use npm install instead of npm ci to correctly resolve platform-specific
# optional dependencies (e.g., @tailwindcss/oxide, lightningcss binaries)
run: npm install
- name: Build Electron App (macOS)
if: matrix.os == 'macos-latest'
working-directory: ./app
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run build:electron -- --mac --x64 --arm64
- name: Build Electron App (Windows)
if: matrix.os == 'windows-latest'
working-directory: ./app
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run build:electron -- --win --x64
- name: Build Electron App (Linux)
if: matrix.os == 'ubuntu-latest'
working-directory: ./app
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run build:electron -- --linux --x64
@@ -70,12 +68,12 @@ jobs:
with:
tag_name: ${{ github.event.inputs.version || github.ref_name }}
files: |
app/dist/*.exe
app/dist/*.dmg
app/dist/*.AppImage
app/dist/*.zip
app/dist/*.deb
app/dist/*.rpm
apps/app/dist/*.exe
apps/app/dist/*.dmg
apps/app/dist/*.AppImage
apps/app/dist/*.zip
apps/app/dist/*.deb
apps/app/dist/*.rpm
draft: false
prerelease: false
env:

9
.gitignore vendored
View File

@@ -1,2 +1,9 @@
#added by trueheads > will remove once supercombo adds multi-os support
#added by trueheads > will remove once supercombo adds multi-os support
launch.sh
# Dependencies
node_modules/
# Build outputs
dist/
.next/

10
.npmrc Normal file
View File

@@ -0,0 +1,10 @@
# Cross-platform compatibility for Tailwind CSS v4 and lightningcss
# These packages use platform-specific optional dependencies that npm
# automatically resolves based on your OS (macOS, Linux, Windows, WSL)
#
# IMPORTANT: When switching platforms or getting platform mismatch errors:
# 1. Delete node_modules: rm -rf node_modules apps/*/node_modules
# 2. Run: npm install
#
# In CI/CD: Use "npm install" instead of "npm ci" to allow npm to resolve
# the correct platform-specific binaries at install time.

221
LICENSE
View File

@@ -1,21 +1,208 @@
MIT License
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (c) 2025 Cody Seibert
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Preamble
The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS 0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based on the Program.
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <https://www.gnu.org/licenses/>.

View File

@@ -20,54 +20,54 @@ Automaker is an autonomous AI development studio that helps you build software f
## Getting Started
**Step 1:** Clone this repository:
### Prerequisites
- Node.js 18+
- npm
- [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated
### Quick Start
```bash
# 1. Clone the repo
git clone git@github.com:AutoMaker-Org/automaker.git
cd automaker
```
**Step 2:** Install dependencies:
```bash
# 2. Install dependencies
npm install
```
**Step 3:** Run the Claude Code setup token command:
```bash
# 3. Get your Claude Code OAuth token
claude setup-token
```
# ⚠️ This prints your token - don't share your screen!
> **⚠️ Warning:** This command will print your token to your terminal. Be careful if you're streaming or sharing your screen, as the token will be visible to anyone watching.
**Step 4:** Export the Claude Code OAuth token in your shell:
```bash
export CLAUDE_CODE_OAUTH_TOKEN="your-token-here"
```
**Step 5:** Start the development server:
```bash
# 4. Set the token and run
export CLAUDE_CODE_OAUTH_TOKEN="sk-ant-oat01-..."
npm run dev:electron
```
This will start both the Next.js development server and the Electron application.
### Authentication Options
**Step 6:** MOST IMPORANT: Run the Following after all is setup
Automaker supports multiple authentication methods (in order of priority):
| Method | Environment Variable | Description |
|--------|---------------------|-------------|
| OAuth Token (env) | `CLAUDE_CODE_OAUTH_TOKEN` | From `claude setup-token` - uses your Claude subscription |
| OAuth Token (stored) | — | Stored in app credentials file |
| API Key (stored) | — | Anthropic API key stored in app |
| API Key (env) | `ANTHROPIC_API_KEY` | Pay-per-use API key |
**Recommended:** Use `CLAUDE_CODE_OAUTH_TOKEN` if you have a Claude subscription.
### Persistent Setup (Optional)
Add to your `~/.bashrc` or `~/.zshrc`:
```bash
echo "W"
echo "W"
echo "W"
echo "W"
echo "W"
echo "W"
echo "W"
echo "W"
export CLAUDE_CODE_OAUTH_TOKEN="YOUR_TOKEN_HERE"
```
Then restart your terminal or run `source ~/.bashrc`.
## Features
- 📋 **Kanban Board** - Visual drag-and-drop board to manage features through backlog, in progress, waiting approval, and verified stages

View File

@@ -1,269 +0,0 @@
const { query, AbortError } = require("@anthropic-ai/claude-agent-sdk");
const promptBuilder = require("./prompt-builder");
/**
* Feature Suggestions Service - Analyzes project and generates feature suggestions
*/
class FeatureSuggestionsService {
constructor() {
this.runningAnalysis = null;
}
/**
* Generate feature suggestions by analyzing the project
*/
async generateSuggestions(projectPath, sendToRenderer, execution) {
console.log(
`[FeatureSuggestions] Generating suggestions for: ${projectPath}`
);
try {
const abortController = new AbortController();
execution.abortController = abortController;
const options = {
model: "claude-sonnet-4-20250514",
systemPrompt: this.getSystemPrompt(),
maxTurns: 50,
cwd: projectPath,
allowedTools: ["Read", "Glob", "Grep", "Bash"],
permissionMode: "acceptEdits",
sandbox: {
enabled: true,
autoAllowBashIfSandboxed: true,
},
abortController: abortController,
};
const prompt = this.buildAnalysisPrompt();
sendToRenderer({
type: "suggestions_progress",
content: "Starting project analysis...\n",
});
const currentQuery = query({ prompt, options });
execution.query = currentQuery;
let fullResponse = "";
for await (const msg of currentQuery) {
if (!execution.isActive()) break;
if (msg.type === "assistant" && msg.message?.content) {
for (const block of msg.message.content) {
if (block.type === "text") {
fullResponse += block.text;
sendToRenderer({
type: "suggestions_progress",
content: block.text,
});
} else if (block.type === "tool_use") {
sendToRenderer({
type: "suggestions_tool",
tool: block.name,
input: block.input,
});
}
}
}
}
execution.query = null;
execution.abortController = null;
// Parse the suggestions from the response
const suggestions = this.parseSuggestions(fullResponse);
sendToRenderer({
type: "suggestions_complete",
suggestions: suggestions,
});
return {
success: true,
suggestions: suggestions,
};
} catch (error) {
if (error instanceof AbortError || error?.name === "AbortError") {
console.log("[FeatureSuggestions] Analysis aborted");
if (execution) {
execution.abortController = null;
execution.query = null;
}
return {
success: false,
message: "Analysis aborted",
suggestions: [],
};
}
console.error(
"[FeatureSuggestions] Error generating suggestions:",
error
);
if (execution) {
execution.abortController = null;
execution.query = null;
}
throw error;
}
}
/**
* Parse suggestions from the LLM response
* Looks for JSON array in the response
*/
parseSuggestions(response) {
try {
// Try to find JSON array in the response
// Look for ```json ... ``` blocks first
const jsonBlockMatch = response.match(/```json\s*([\s\S]*?)```/);
if (jsonBlockMatch) {
const parsed = JSON.parse(jsonBlockMatch[1].trim());
if (Array.isArray(parsed)) {
return this.validateSuggestions(parsed);
}
}
// Try to find a raw JSON array
const jsonArrayMatch = response.match(/\[\s*\{[\s\S]*\}\s*\]/);
if (jsonArrayMatch) {
const parsed = JSON.parse(jsonArrayMatch[0]);
if (Array.isArray(parsed)) {
return this.validateSuggestions(parsed);
}
}
console.warn(
"[FeatureSuggestions] Could not parse suggestions from response"
);
return [];
} catch (error) {
console.error("[FeatureSuggestions] Error parsing suggestions:", error);
return [];
}
}
/**
* Validate and normalize suggestions
*/
validateSuggestions(suggestions) {
return suggestions
.filter((s) => s && typeof s === "object")
.map((s, index) => ({
id: `suggestion-${Date.now()}-${index}`,
category: s.category || "Uncategorized",
description: s.description || s.title || "No description",
steps: Array.isArray(s.steps) ? s.steps : [],
priority: typeof s.priority === "number" ? s.priority : index + 1,
reasoning: s.reasoning || "",
}))
.sort((a, b) => a.priority - b.priority);
}
/**
* Get the system prompt for feature suggestion analysis
*/
getSystemPrompt() {
return `You are an expert software architect and product manager. Your job is to analyze a codebase and suggest missing features that would improve the application.
You should:
1. Thoroughly analyze the project structure, code, and any existing documentation
2. Identify what the application does and what features it currently has (look at the .automaker/app_spec.txt file as well if it exists)
3. Generate a comprehensive list of missing features that would be valuable to users
4. Prioritize features by impact and complexity
5. Provide clear, actionable descriptions and implementation steps
When analyzing, look at:
- README files and documentation
- Package.json, cargo.toml, or similar config files for tech stack
- Source code structure and organization
- Existing features and their implementation patterns
- Common patterns in similar applications
- User experience improvements
- Developer experience improvements
- Performance optimizations
- Security enhancements
You have access to file reading and search tools. Use them to understand the codebase.`;
}
/**
* Build the prompt for analyzing the project
*/
buildAnalysisPrompt() {
return `Analyze this project and generate a list of suggested features that are missing or would improve the application.
**Your Task:**
1. First, explore the project structure:
- Read README.md, package.json, or similar config files
- Scan the source code directory structure
- Identify the tech stack and frameworks used
- Look at existing features and how they're implemented
2. Identify what the application does:
- What is the main purpose?
- What features are already implemented?
- What patterns and conventions are used?
3. Generate feature suggestions:
- Think about what's missing compared to similar applications
- Consider user experience improvements
- Consider developer experience improvements
- Think about performance, security, and reliability
- Consider testing and documentation improvements
4. **CRITICAL: Output your suggestions as a JSON array** at the end of your response, formatted like this:
\`\`\`json
[
{
"category": "User Experience",
"description": "Add dark mode support with system preference detection",
"steps": [
"Create a ThemeProvider context to manage theme state",
"Add a toggle component in the settings or header",
"Implement CSS variables for theme colors",
"Add localStorage persistence for user preference"
],
"priority": 1,
"reasoning": "Dark mode is a standard feature that improves accessibility and user comfort"
},
{
"category": "Performance",
"description": "Implement lazy loading for heavy components",
"steps": [
"Identify components that are heavy or rarely used",
"Use React.lazy() and Suspense for code splitting",
"Add loading states for lazy-loaded components"
],
"priority": 2,
"reasoning": "Improves initial load time and reduces bundle size"
}
]
\`\`\`
**Important Guidelines:**
- Generate at least 10-20 feature suggestions
- Order them by priority (1 = highest priority)
- Each feature should have clear, actionable steps
- Categories should be meaningful (e.g., "User Experience", "Performance", "Security", "Testing", "Documentation", "Developer Experience", "Accessibility", etc.)
- Be specific about what files might need to be created or modified
- Consider the existing tech stack and patterns when suggesting implementation steps
Begin by exploring the project structure.`;
}
/**
* Stop the current analysis
*/
stop() {
if (this.runningAnalysis && this.runningAnalysis.abortController) {
this.runningAnalysis.abortController.abort();
}
this.runningAnalysis = null;
}
}
module.exports = new FeatureSuggestionsService();

View File

@@ -1,76 +0,0 @@
const { createSdkMcpServer, tool } = require("@anthropic-ai/claude-agent-sdk");
const { z } = require("zod");
const featureLoader = require("./feature-loader");
/**
* MCP Server Factory - Creates custom MCP servers with tools
*/
class McpServerFactory {
/**
* Create a custom MCP server with the UpdateFeatureStatus tool
* This tool allows Claude Code to safely update feature status without
* directly modifying feature files, preventing race conditions
* and accidental state corruption.
*/
createFeatureToolsServer(updateFeatureStatusCallback, projectPath) {
return createSdkMcpServer({
name: "automaker-tools",
version: "1.0.0",
tools: [
tool(
"UpdateFeatureStatus",
"Update the status of a feature. Use this tool instead of directly modifying feature files to safely update feature status. IMPORTANT: If the feature has skipTests=true, you should NOT mark it as verified - instead it will automatically go to waiting_approval status for manual review. Always include a summary of what was done.",
{
featureId: z.string().describe("The ID of the feature to update"),
status: z.enum(["backlog", "in_progress", "verified"]).describe("The new status for the feature. Note: If skipTests=true, verified will be converted to waiting_approval automatically."),
summary: z.string().optional().describe("A brief summary of what was implemented/changed. This will be displayed on the Kanban card. Example: 'Added dark mode toggle. Modified: settings.tsx, theme-provider.tsx'")
},
async (args) => {
try {
console.log(`[McpServerFactory] UpdateFeatureStatus tool called: featureId=${args.featureId}, status=${args.status}, summary=${args.summary || "(none)"}`);
// Load the feature to check skipTests flag
const features = await featureLoader.loadFeatures(projectPath);
const feature = features.find((f) => f.id === args.featureId);
if (!feature) {
throw new Error(`Feature ${args.featureId} not found`);
}
// If agent tries to mark as verified but feature has skipTests=true, convert to waiting_approval
let finalStatus = args.status;
if (args.status === "verified" && feature.skipTests === true) {
console.log(`[McpServerFactory] Feature ${args.featureId} has skipTests=true, converting verified -> waiting_approval`);
finalStatus = "waiting_approval";
}
// Call the provided callback to update feature status with summary
await updateFeatureStatusCallback(args.featureId, finalStatus, projectPath, args.summary);
const statusMessage = finalStatus !== args.status
? `Successfully updated feature ${args.featureId} to status "${finalStatus}" (converted from "${args.status}" because skipTests=true)${args.summary ? ` with summary: "${args.summary}"` : ""}`
: `Successfully updated feature ${args.featureId} to status "${finalStatus}"${args.summary ? ` with summary: "${args.summary}"` : ""}`;
return {
content: [{
type: "text",
text: statusMessage
}]
};
} catch (error) {
console.error("[McpServerFactory] UpdateFeatureStatus tool error:", error);
return {
content: [{
type: "text",
text: `Failed to update feature status: ${error.message}`
}]
};
}
}
)
]
});
}
}
module.exports = new McpServerFactory();

View File

@@ -1,467 +0,0 @@
const { query, AbortError } = require("@anthropic-ai/claude-agent-sdk");
const fs = require("fs/promises");
const path = require("path");
/**
* XML template for app_spec.txt
*/
const APP_SPEC_XML_TEMPLATE = `<project_specification>
<project_name></project_name>
<overview>
</overview>
<technology_stack>
<frontend>
<framework></framework>
<ui_library></ui_library>
<styling></styling>
<state_management></state_management>
<drag_drop></drag_drop>
<icons></icons>
</frontend>
<desktop_shell>
<framework></framework>
<language></language>
<inter_process_communication></inter_process_communication>
<file_system></file_system>
</desktop_shell>
<ai_engine>
<logic_model></logic_model>
<design_model></design_model>
<orchestration></orchestration>
</ai_engine>
<testing>
<framework></framework>
<unit></unit>
</testing>
</technology_stack>
<core_capabilities>
<project_management>
</project_management>
<intelligent_analysis>
</intelligent_analysis>
<kanban_workflow>
</kanban_workflow>
<autonomous_agent_engine>
</autonomous_agent_engine>
<extensibility>
</extensibility>
</core_capabilities>
<ui_layout>
<window_structure>
</window_structure>
<theme>
</theme>
</ui_layout>
<development_workflow>
<local_testing>
</local_testing>
</development_workflow>
<implementation_roadmap>
<phase_1_foundation>
</phase_1_foundation>
<phase_2_core_logic>
</phase_2_core_logic>
<phase_3_kanban_and_interaction>
</phase_3_kanban_and_interaction>
<phase_4_polish>
</phase_4_polish>
</implementation_roadmap>
</project_specification>`;
/**
* Spec Regeneration Service - Regenerates app spec based on project description and tech stack
*/
class SpecRegenerationService {
constructor() {
this.runningRegeneration = null;
}
/**
* Create initial app spec for a new project
* @param {string} projectPath - Path to the project
* @param {string} projectOverview - User's project description
* @param {Function} sendToRenderer - Function to send events to renderer
* @param {Object} execution - Execution context with abort controller
* @param {boolean} generateFeatures - Whether to generate feature entries in features folder
*/
async createInitialSpec(projectPath, projectOverview, sendToRenderer, execution, generateFeatures = true) {
console.log(`[SpecRegeneration] Creating initial spec for: ${projectPath}, generateFeatures: ${generateFeatures}`);
try {
const abortController = new AbortController();
execution.abortController = abortController;
const options = {
model: "claude-sonnet-4-20250514",
systemPrompt: this.getInitialCreationSystemPrompt(generateFeatures),
maxTurns: 50,
cwd: projectPath,
allowedTools: ["Read", "Write", "Edit", "Glob", "Grep", "Bash"],
permissionMode: "acceptEdits",
sandbox: {
enabled: true,
autoAllowBashIfSandboxed: true,
},
abortController: abortController,
};
const prompt = this.buildInitialCreationPrompt(projectOverview, generateFeatures);
sendToRenderer({
type: "spec_regeneration_progress",
content: "Starting project analysis and spec creation...\n",
});
const currentQuery = query({ prompt, options });
execution.query = currentQuery;
let fullResponse = "";
for await (const msg of currentQuery) {
if (!execution.isActive()) break;
if (msg.type === "assistant" && msg.message?.content) {
for (const block of msg.message.content) {
if (block.type === "text") {
fullResponse += block.text;
sendToRenderer({
type: "spec_regeneration_progress",
content: block.text,
});
} else if (block.type === "tool_use") {
sendToRenderer({
type: "spec_regeneration_tool",
tool: block.name,
input: block.input,
});
}
}
}
}
execution.query = null;
execution.abortController = null;
sendToRenderer({
type: "spec_regeneration_complete",
message: "Initial spec creation complete!",
});
return {
success: true,
message: "Initial spec creation complete",
};
} catch (error) {
if (error instanceof AbortError || error?.name === "AbortError") {
console.log("[SpecRegeneration] Creation aborted");
if (execution) {
execution.abortController = null;
execution.query = null;
}
return {
success: false,
message: "Creation aborted",
};
}
console.error("[SpecRegeneration] Error creating initial spec:", error);
if (execution) {
execution.abortController = null;
execution.query = null;
}
throw error;
}
}
/**
* Get the system prompt for initial spec creation
* @param {boolean} generateFeatures - Whether features should be generated
*/
getInitialCreationSystemPrompt(generateFeatures = true) {
return `You are an expert software architect and product manager. Your job is to analyze an existing codebase and generate a comprehensive application specification based on a user's project overview.
You should:
1. First, thoroughly analyze the project structure to understand the existing tech stack
2. Read key configuration files (package.json, tsconfig.json, Cargo.toml, requirements.txt, etc.) to understand dependencies and frameworks
3. Understand the current architecture and patterns used
4. Based on the user's project overview, create a comprehensive app specification
5. Be liberal and comprehensive when defining features - include everything needed for a complete, polished application
6. Use the XML template format provided
7. Write the specification to .automaker/app_spec.txt
When analyzing, look at:
- package.json, cargo.toml, requirements.txt or similar config files for tech stack
- Source code structure and organization
- Framework-specific patterns (Next.js, React, Django, etc.)
- Database configurations and schemas
- API structures and patterns
**Feature Storage:**
Features are stored in .automaker/features/{id}/feature.json - each feature has its own folder.
Do NOT manually create feature files. Use the UpdateFeatureStatus tool to manage features.
You CAN and SHOULD modify:
- .automaker/app_spec.txt (this is your primary target)
You have access to file reading, writing, and search tools. Use them to understand the codebase and write the new spec.`;
}
/**
* Build the prompt for initial spec creation
* @param {string} projectOverview - User's project description
* @param {boolean} generateFeatures - Whether to generate feature entries in features folder
*/
buildInitialCreationPrompt(projectOverview, generateFeatures = true) {
return `I need you to create an initial application specification for my project. I haven't set up an app_spec.txt yet, so this will be the first one.
**My Project Overview:**
${projectOverview}
**Your Task:**
1. First, explore the project to understand the existing tech stack:
- Read package.json, Cargo.toml, requirements.txt, or similar config files
- Identify all frameworks and libraries being used
- Understand the current project structure and architecture
- Note any database, authentication, or other infrastructure in use
2. Based on my project overview and the existing tech stack, create a comprehensive app specification using this XML template:
\`\`\`xml
${APP_SPEC_XML_TEMPLATE}
\`\`\`
3. Fill out the template with:
- **project_name**: Extract from the project or derive from overview
- **overview**: A clear description based on my project overview
- **technology_stack**: All technologies you discover in the project (fill out the relevant sections, remove irrelevant ones)
- **core_capabilities**: List all the major capabilities the app should have based on my overview
- **ui_layout**: Describe the UI structure if relevant
- **development_workflow**: Note any testing or development patterns
- **implementation_roadmap**: Break down the features into phases - be VERY detailed here, listing every feature that needs to be built
4. **IMPORTANT**: Write the complete specification to the file \`.automaker/app_spec.txt\`
**Guidelines:**
- Be comprehensive! Include ALL features needed for a complete application
- Only include technology_stack sections that are relevant (e.g., skip desktop_shell if it's a web-only app)
- Add new sections to core_capabilities as needed for the specific project
- The implementation_roadmap should reflect logical phases for building out the app - list EVERY feature individually
- Consider user flows, error states, and edge cases when defining features
- Each phase should have multiple specific, actionable features
Begin by exploring the project structure.`;
}
/**
* Regenerate the app spec based on user's project definition
*/
async regenerateSpec(projectPath, projectDefinition, sendToRenderer, execution) {
console.log(`[SpecRegeneration] Regenerating spec for: ${projectPath}`);
try {
const abortController = new AbortController();
execution.abortController = abortController;
const options = {
model: "claude-sonnet-4-20250514",
systemPrompt: this.getSystemPrompt(),
maxTurns: 50,
cwd: projectPath,
allowedTools: ["Read", "Write", "Edit", "Glob", "Grep", "Bash"],
permissionMode: "acceptEdits",
sandbox: {
enabled: true,
autoAllowBashIfSandboxed: true,
},
abortController: abortController,
};
const prompt = this.buildRegenerationPrompt(projectDefinition);
sendToRenderer({
type: "spec_regeneration_progress",
content: "Starting spec regeneration...\n",
});
const currentQuery = query({ prompt, options });
execution.query = currentQuery;
let fullResponse = "";
for await (const msg of currentQuery) {
if (!execution.isActive()) break;
if (msg.type === "assistant" && msg.message?.content) {
for (const block of msg.message.content) {
if (block.type === "text") {
fullResponse += block.text;
sendToRenderer({
type: "spec_regeneration_progress",
content: block.text,
});
} else if (block.type === "tool_use") {
sendToRenderer({
type: "spec_regeneration_tool",
tool: block.name,
input: block.input,
});
}
}
}
}
execution.query = null;
execution.abortController = null;
sendToRenderer({
type: "spec_regeneration_complete",
message: "Spec regeneration complete!",
});
return {
success: true,
message: "Spec regeneration complete",
};
} catch (error) {
if (error instanceof AbortError || error?.name === "AbortError") {
console.log("[SpecRegeneration] Regeneration aborted");
if (execution) {
execution.abortController = null;
execution.query = null;
}
return {
success: false,
message: "Regeneration aborted",
};
}
console.error("[SpecRegeneration] Error regenerating spec:", error);
if (execution) {
execution.abortController = null;
execution.query = null;
}
throw error;
}
}
/**
* Get the system prompt for spec regeneration
*/
getSystemPrompt() {
return `You are an expert software architect and product manager. Your job is to analyze an existing codebase and generate a comprehensive application specification based on a user's project definition.
You should:
1. First, thoroughly analyze the project structure to understand the existing tech stack
2. Read key configuration files (package.json, tsconfig.json, etc.) to understand dependencies and frameworks
3. Understand the current architecture and patterns used
4. Based on the user's project definition, create a comprehensive app specification that includes ALL features needed to realize their vision
5. Be liberal and comprehensive when defining features - include everything needed for a complete, polished application
6. Write the specification to .automaker/app_spec.txt
When analyzing, look at:
- package.json, cargo.toml, or similar config files for tech stack
- Source code structure and organization
- Framework-specific patterns (Next.js, React, etc.)
- Database configurations and schemas
- API structures and patterns
**Feature Storage:**
Features are stored in .automaker/features/{id}/feature.json - each feature has its own folder.
Do NOT manually create feature files. Use the UpdateFeatureStatus tool to manage features.
You CAN and SHOULD modify:
- .automaker/app_spec.txt (this is your primary target)
You have access to file reading, writing, and search tools. Use them to understand the codebase and write the new spec.`;
}
/**
* Build the prompt for regenerating the spec
*/
buildRegenerationPrompt(projectDefinition) {
return `I need you to regenerate my application specification based on the following project definition. Be very comprehensive and liberal when defining features - I want a complete, polished application.
**My Project Definition:**
${projectDefinition}
**Your Task:**
1. First, explore the project to understand the existing tech stack:
- Read package.json or similar config files
- Identify all frameworks and libraries being used
- Understand the current project structure and architecture
- Note any database, authentication, or other infrastructure in use
2. Based on my project definition and the existing tech stack, create a comprehensive app specification that includes:
- Product Overview: A clear description of what the app does
- Tech Stack: All technologies currently in use
- Features: A COMPREHENSIVE list of all features needed to realize my vision
- Be liberal! Include all features that would make this a complete, production-ready application
- Include core features, supporting features, and nice-to-have features
- Think about user experience, error handling, edge cases, etc.
- Architecture Notes: Any important architectural decisions or patterns
3. **IMPORTANT**: Write the complete specification to the file \`.automaker/app_spec.txt\`
**Format Guidelines for the Spec:**
Use this general structure:
\`\`\`
# [App Name] - Application Specification
## Product Overview
[Description of what the app does and its purpose]
## Tech Stack
- Frontend: [frameworks, libraries]
- Backend: [frameworks, APIs]
- Database: [if applicable]
- Other: [other relevant tech]
## Features
### [Category 1]
- **[Feature Name]**: [Detailed description of the feature]
- **[Feature Name]**: [Detailed description]
...
### [Category 2]
- **[Feature Name]**: [Detailed description]
...
## Architecture Notes
[Any important architectural notes, patterns, or conventions]
\`\`\`
**Remember:**
- Be comprehensive! Include ALL features needed for a complete application
- Consider user flows, error states, loading states, etc.
- Include authentication, authorization if relevant
- Think about what would make this a polished, production-ready app
- The more detailed and complete the spec, the better
Begin by exploring the project structure.`;
}
/**
* Stop the current regeneration
*/
stop() {
if (this.runningRegeneration && this.runningRegeneration.abortController) {
this.runningRegeneration.abortController.abort();
}
this.runningRegeneration = null;
}
}
module.exports = new SpecRegenerationService();

13896
app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,212 +0,0 @@
import { Label } from "@/components/ui/label";
import {
CheckCircle2,
AlertCircle,
Info,
Terminal,
Atom,
Sparkles,
} from "lucide-react";
import type { ClaudeAuthStatus, CodexAuthStatus } from "@/store/setup-store";
interface AuthenticationStatusDisplayProps {
claudeAuthStatus: ClaudeAuthStatus | null;
codexAuthStatus: CodexAuthStatus | null;
apiKeyStatus: {
hasAnthropicKey: boolean;
hasOpenAIKey: boolean;
hasGoogleKey: boolean;
} | null;
apiKeys: {
anthropic: string;
google: string;
openai: string;
};
}
export function AuthenticationStatusDisplay({
claudeAuthStatus,
codexAuthStatus,
apiKeyStatus,
apiKeys,
}: AuthenticationStatusDisplayProps) {
return (
<div className="space-y-4 pt-4 border-t border-border">
<div className="flex items-center gap-2 mb-3">
<Info className="w-4 h-4 text-brand-500" />
<Label className="text-foreground font-semibold">
Current Authentication Configuration
</Label>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
{/* Claude Authentication Status */}
<div className="p-3 rounded-lg bg-card border border-border">
<div className="flex items-center gap-2 mb-1.5">
<Terminal className="w-4 h-4 text-brand-500" />
<span className="text-sm font-medium text-foreground">
Claude (Anthropic)
</span>
</div>
<div className="space-y-1.5 text-xs min-h-12">
{claudeAuthStatus?.authenticated ? (
<>
<div className="flex items-center gap-2">
<CheckCircle2 className="w-3 h-3 text-green-500 shrink-0" />
<span className="text-muted-foreground">
Method:{" "}
<span className="font-mono text-foreground">
{claudeAuthStatus.method === "oauth"
? "OAuth Token"
: claudeAuthStatus.method === "api_key"
? "API Key"
: "Unknown"}
</span>
</span>
</div>
{claudeAuthStatus.oauthTokenValid && (
<div className="flex items-center gap-2 text-green-400">
<CheckCircle2 className="w-3 h-3 shrink-0" />
<span>OAuth token configured</span>
</div>
)}
{claudeAuthStatus.apiKeyValid && (
<div className="flex items-center gap-2 text-green-400">
<CheckCircle2 className="w-3 h-3 shrink-0" />
<span>API key configured</span>
</div>
)}
{apiKeyStatus?.hasAnthropicKey && (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Environment variable detected</span>
</div>
)}
{apiKeys.anthropic && (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Manual API key in settings</span>
</div>
)}
</>
) : apiKeyStatus?.hasAnthropicKey ? (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Using environment variable (ANTHROPIC_API_KEY)</span>
</div>
) : apiKeys.anthropic ? (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Using manual API key from settings</span>
</div>
) : (
<div className="flex items-center gap-1.5 text-muted-foreground py-0.5">
<AlertCircle className="w-2.5 h-2.5 shrink-0" />
<span className="text-xs">Not Setup</span>
</div>
)}
</div>
</div>
{/* Codex/OpenAI Authentication Status */}
<div className="p-3 rounded-lg bg-card border border-border">
<div className="flex items-center gap-2 mb-1.5">
<Atom className="w-4 h-4 text-green-500" />
<span className="text-sm font-medium text-foreground">
Codex (OpenAI)
</span>
</div>
<div className="space-y-1.5 text-xs min-h-12">
{codexAuthStatus?.authenticated ? (
<>
<div className="flex items-center gap-2">
<CheckCircle2 className="w-3 h-3 text-green-500 shrink-0" />
<span className="text-muted-foreground">
Method:{" "}
<span className="font-mono text-foreground">
{codexAuthStatus.method === "cli_verified" ||
codexAuthStatus.method === "cli_tokens"
? "CLI Login (OpenAI Account)"
: codexAuthStatus.method === "api_key"
? "API Key (Auth File)"
: codexAuthStatus.method === "env"
? "API Key (Environment)"
: "Unknown"}
</span>
</span>
</div>
{codexAuthStatus.method === "cli_verified" ||
codexAuthStatus.method === "cli_tokens" ? (
<div className="flex items-center gap-2 text-green-400">
<CheckCircle2 className="w-3 h-3 shrink-0" />
<span>Account authenticated</span>
</div>
) : codexAuthStatus.apiKeyValid ? (
<div className="flex items-center gap-2 text-green-400">
<CheckCircle2 className="w-3 h-3 shrink-0" />
<span>API key configured</span>
</div>
) : null}
{apiKeyStatus?.hasOpenAIKey && (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Environment variable detected</span>
</div>
)}
{apiKeys.openai && (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Manual API key in settings</span>
</div>
)}
</>
) : apiKeyStatus?.hasOpenAIKey ? (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Using environment variable (OPENAI_API_KEY)</span>
</div>
) : apiKeys.openai ? (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Using manual API key from settings</span>
</div>
) : (
<div className="flex items-center gap-1.5 text-muted-foreground py-0.5">
<AlertCircle className="w-2.5 h-2.5 shrink-0" />
<span className="text-xs">Not Setup</span>
</div>
)}
</div>
</div>
{/* Google/Gemini Authentication Status */}
<div className="p-3 rounded-lg bg-card border border-border">
<div className="flex items-center gap-2 mb-1.5">
<Sparkles className="w-4 h-4 text-purple-500" />
<span className="text-sm font-medium text-foreground">
Gemini (Google)
</span>
</div>
<div className="space-y-1.5 text-xs min-h-12">
{apiKeyStatus?.hasGoogleKey ? (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Using environment variable (GOOGLE_API_KEY)</span>
</div>
) : apiKeys.google ? (
<div className="flex items-center gap-2 text-blue-400">
<Info className="w-3 h-3 shrink-0" />
<span>Using manual API key from settings</span>
</div>
) : (
<div className="flex items-center gap-1.5 text-muted-foreground py-0.5">
<AlertCircle className="w-2.5 h-2.5 shrink-0" />
<span className="text-xs">Not Setup</span>
</div>
)}
</div>
</div>
</div>
</div>
);
}

View File

@@ -1,96 +0,0 @@
import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label";
import { LayoutGrid, Minimize2, Square, Maximize2 } from "lucide-react";
import type { KanbanDetailLevel } from "../shared/types";
interface KanbanDisplaySectionProps {
detailLevel: KanbanDetailLevel;
onChange: (level: KanbanDetailLevel) => void;
}
export function KanbanDisplaySection({
detailLevel,
onChange,
}: KanbanDisplaySectionProps) {
return (
<div
id="kanban"
className="rounded-xl border border-border bg-card backdrop-blur-md overflow-hidden scroll-mt-6"
>
<div className="p-6 border-b border-border">
<div className="flex items-center gap-2 mb-2">
<LayoutGrid className="w-5 h-5 text-brand-500" />
<h2 className="text-lg font-semibold text-foreground">
Kanban Card Display
</h2>
</div>
<p className="text-sm text-muted-foreground">
Control how much information is displayed on Kanban cards.
</p>
</div>
<div className="p-6 space-y-4">
<div className="space-y-3">
<Label className="text-foreground">Detail Level</Label>
<div className="grid grid-cols-3 gap-3">
<Button
variant={detailLevel === "minimal" ? "secondary" : "outline"}
onClick={() => onChange("minimal")}
className={`flex flex-col items-center justify-center gap-2 px-4 py-4 h-auto ${
detailLevel === "minimal"
? "border-brand-500 ring-1 ring-brand-500/50"
: ""
}`}
data-testid="kanban-detail-minimal"
>
<Minimize2 className="w-5 h-5" />
<span className="font-medium text-sm">Minimal</span>
<span className="text-xs text-muted-foreground text-center">
Title & category only
</span>
</Button>
<Button
variant={detailLevel === "standard" ? "secondary" : "outline"}
onClick={() => onChange("standard")}
className={`flex flex-col items-center justify-center gap-2 px-4 py-4 h-auto ${
detailLevel === "standard"
? "border-brand-500 ring-1 ring-brand-500/50"
: ""
}`}
data-testid="kanban-detail-standard"
>
<Square className="w-5 h-5" />
<span className="font-medium text-sm">Standard</span>
<span className="text-xs text-muted-foreground text-center">
Steps & progress
</span>
</Button>
<Button
variant={detailLevel === "detailed" ? "secondary" : "outline"}
onClick={() => onChange("detailed")}
className={`flex flex-col items-center justify-center gap-2 px-4 py-4 h-auto ${
detailLevel === "detailed"
? "border-brand-500 ring-1 ring-brand-500/50"
: ""
}`}
data-testid="kanban-detail-detailed"
>
<Maximize2 className="w-5 h-5" />
<span className="font-medium text-sm">Detailed</span>
<span className="text-xs text-muted-foreground text-center">
Model, tools & tasks
</span>
</Button>
</div>
<p className="text-xs text-muted-foreground">
<strong>Minimal:</strong> Shows only title and category
<br />
<strong>Standard:</strong> Adds steps preview and progress bar
<br />
<strong>Detailed:</strong> Shows all info including model, tool
calls, task list, and summaries
</p>
</div>
</div>
</div>
);
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,437 +0,0 @@
"use client";
import { useEffect, useState, useCallback } from "react";
import { useAppStore } from "@/store/app-store";
import { getElectronAPI } from "@/lib/electron";
import { Button } from "@/components/ui/button";
import { HotkeyButton } from "@/components/ui/hotkey-button";
import { Card } from "@/components/ui/card";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import { Save, RefreshCw, FileText, Sparkles, Loader2, FilePlus2 } from "lucide-react";
import { Checkbox } from "@/components/ui/checkbox";
import { XmlSyntaxEditor } from "@/components/ui/xml-syntax-editor";
import type { SpecRegenerationEvent } from "@/types/electron";
export function SpecView() {
const { currentProject, appSpec, setAppSpec } = useAppStore();
const [isLoading, setIsLoading] = useState(true);
const [isSaving, setIsSaving] = useState(false);
const [hasChanges, setHasChanges] = useState(false);
const [specExists, setSpecExists] = useState(true);
// Regeneration state
const [showRegenerateDialog, setShowRegenerateDialog] = useState(false);
const [projectDefinition, setProjectDefinition] = useState("");
const [isRegenerating, setIsRegenerating] = useState(false);
// Create spec state
const [showCreateDialog, setShowCreateDialog] = useState(false);
const [projectOverview, setProjectOverview] = useState("");
const [isCreating, setIsCreating] = useState(false);
const [generateFeatures, setGenerateFeatures] = useState(true);
// Load spec from file
const loadSpec = useCallback(async () => {
if (!currentProject) return;
setIsLoading(true);
try {
const api = getElectronAPI();
const result = await api.readFile(
`${currentProject.path}/.automaker/app_spec.txt`
);
if (result.success && result.content) {
setAppSpec(result.content);
setSpecExists(true);
setHasChanges(false);
} else {
// File doesn't exist
setAppSpec("");
setSpecExists(false);
}
} catch (error) {
console.error("Failed to load spec:", error);
setSpecExists(false);
} finally {
setIsLoading(false);
}
}, [currentProject, setAppSpec]);
useEffect(() => {
loadSpec();
}, [loadSpec]);
// Subscribe to spec regeneration events
useEffect(() => {
const api = getElectronAPI();
if (!api.specRegeneration) return;
const unsubscribe = api.specRegeneration.onEvent((event: SpecRegenerationEvent) => {
console.log("[SpecView] Regeneration event:", event.type);
if (event.type === "spec_regeneration_complete") {
setIsRegenerating(false);
setIsCreating(false);
setShowRegenerateDialog(false);
setShowCreateDialog(false);
setProjectDefinition("");
setProjectOverview("");
// Reload the spec to show the new content
loadSpec();
} else if (event.type === "spec_regeneration_error") {
setIsRegenerating(false);
setIsCreating(false);
console.error("[SpecView] Regeneration error:", event.error);
}
});
return () => {
unsubscribe();
};
}, [loadSpec]);
// Save spec to file
const saveSpec = async () => {
if (!currentProject) return;
setIsSaving(true);
try {
const api = getElectronAPI();
await api.writeFile(
`${currentProject.path}/.automaker/app_spec.txt`,
appSpec
);
setHasChanges(false);
} catch (error) {
console.error("Failed to save spec:", error);
} finally {
setIsSaving(false);
}
};
const handleChange = (value: string) => {
setAppSpec(value);
setHasChanges(true);
};
const handleRegenerate = async () => {
if (!currentProject || !projectDefinition.trim()) return;
setIsRegenerating(true);
try {
const api = getElectronAPI();
if (!api.specRegeneration) {
console.error("[SpecView] Spec regeneration not available");
setIsRegenerating(false);
return;
}
const result = await api.specRegeneration.generate(
currentProject.path,
projectDefinition.trim()
);
if (!result.success) {
console.error("[SpecView] Failed to start regeneration:", result.error);
setIsRegenerating(false);
}
// If successful, we'll wait for the events to update the state
} catch (error) {
console.error("[SpecView] Failed to regenerate spec:", error);
setIsRegenerating(false);
}
};
const handleCreateSpec = async () => {
if (!currentProject || !projectOverview.trim()) return;
setIsCreating(true);
setShowCreateDialog(false);
try {
const api = getElectronAPI();
if (!api.specRegeneration) {
console.error("[SpecView] Spec regeneration not available");
setIsCreating(false);
return;
}
const result = await api.specRegeneration.create(
currentProject.path,
projectOverview.trim(),
generateFeatures
);
if (!result.success) {
console.error("[SpecView] Failed to start spec creation:", result.error);
setIsCreating(false);
}
// If successful, we'll wait for the events to update the state
} catch (error) {
console.error("[SpecView] Failed to create spec:", error);
setIsCreating(false);
}
};
if (!currentProject) {
return (
<div
className="flex-1 flex items-center justify-center"
data-testid="spec-view-no-project"
>
<p className="text-muted-foreground">No project selected</p>
</div>
);
}
if (isLoading) {
return (
<div
className="flex-1 flex items-center justify-center"
data-testid="spec-view-loading"
>
<RefreshCw className="w-6 h-6 animate-spin text-muted-foreground" />
</div>
);
}
// Show empty state when no spec exists (isCreating is handled by bottom-right indicator in sidebar)
if (!specExists) {
return (
<div
className="flex-1 flex flex-col overflow-hidden content-bg"
data-testid="spec-view-empty"
>
{/* Header */}
<div className="flex items-center justify-between p-4 border-b border-border bg-glass backdrop-blur-md">
<div className="flex items-center gap-3">
<FileText className="w-5 h-5 text-muted-foreground" />
<div>
<h1 className="text-xl font-bold">App Specification</h1>
<p className="text-sm text-muted-foreground">
{currentProject.path}/.automaker/app_spec.txt
</p>
</div>
</div>
</div>
{/* Empty State */}
<div className="flex-1 flex items-center justify-center p-8">
<div className="text-center max-w-md">
<div className="mb-6 flex justify-center">
<div className="p-4 rounded-full bg-primary/10">
<FilePlus2 className="w-12 h-12 text-primary" />
</div>
</div>
<h2 className="text-2xl font-semibold mb-3">No App Specification Found</h2>
<p className="text-muted-foreground mb-6">
Create an app specification to help our system understand your project.
We&apos;ll analyze your codebase and generate a comprehensive spec based on your description.
</p>
<Button
size="lg"
onClick={() => setShowCreateDialog(true)}
>
<FilePlus2 className="w-5 h-5 mr-2" />
Create app_spec
</Button>
</div>
</div>
{/* Create Dialog */}
<Dialog open={showCreateDialog} onOpenChange={setShowCreateDialog}>
<DialogContent className="max-w-2xl">
<DialogHeader>
<DialogTitle>Create App Specification</DialogTitle>
<DialogDescription className="text-muted-foreground">
We didn&apos;t find an app_spec.txt file. Let us help you generate your app_spec.txt
to help describe your project for our system. We&apos;ll analyze your project&apos;s
tech stack and create a comprehensive specification.
</DialogDescription>
</DialogHeader>
<div className="space-y-4 py-4">
<div className="space-y-2">
<label className="text-sm font-medium">
Project Overview
</label>
<p className="text-xs text-muted-foreground">
Describe what your project does and what features you want to build.
Be as detailed as you want - this will help us create a better specification.
</p>
<textarea
className="w-full h-48 p-3 rounded-md border border-border bg-background font-mono text-sm resize-none focus:outline-none focus:ring-2 focus:ring-ring"
value={projectOverview}
onChange={(e) => setProjectOverview(e.target.value)}
placeholder="e.g., A project management tool that allows teams to track tasks, manage sprints, and visualize progress through kanban boards. It should support user authentication, real-time updates, and file attachments..."
autoFocus
/>
</div>
<div className="flex items-start space-x-3 pt-2">
<Checkbox
id="generate-features"
checked={generateFeatures}
onCheckedChange={(checked) => setGenerateFeatures(checked === true)}
/>
<div className="space-y-1">
<label
htmlFor="generate-features"
className="text-sm font-medium cursor-pointer"
>
Generate feature list
</label>
<p className="text-xs text-muted-foreground">
Automatically create features in the features folder from the
implementation roadmap after the spec is generated.
</p>
</div>
</div>
</div>
<DialogFooter>
<Button
variant="ghost"
onClick={() => setShowCreateDialog(false)}
>
Cancel
</Button>
<HotkeyButton
onClick={handleCreateSpec}
disabled={!projectOverview.trim()}
hotkey={{ key: "Enter", cmdCtrl: true }}
hotkeyActive={showCreateDialog}
>
<Sparkles className="w-4 h-4 mr-2" />
Generate Spec
</HotkeyButton>
</DialogFooter>
</DialogContent>
</Dialog>
</div>
);
}
return (
<div
className="flex-1 flex flex-col overflow-hidden content-bg"
data-testid="spec-view"
>
{/* Header */}
<div className="flex items-center justify-between p-4 border-b border-border bg-glass backdrop-blur-md">
<div className="flex items-center gap-3">
<FileText className="w-5 h-5 text-muted-foreground" />
<div>
<h1 className="text-xl font-bold">App Specification</h1>
<p className="text-sm text-muted-foreground">
{currentProject.path}/.automaker/app_spec.txt
</p>
</div>
</div>
<div className="flex gap-2">
<Button
size="sm"
variant="outline"
onClick={() => setShowRegenerateDialog(true)}
disabled={isRegenerating}
data-testid="regenerate-spec"
>
{isRegenerating ? (
<Loader2 className="w-4 h-4 mr-2 animate-spin" />
) : (
<Sparkles className="w-4 h-4 mr-2" />
)}
{isRegenerating ? "Regenerating..." : "Regenerate"}
</Button>
<Button
size="sm"
onClick={saveSpec}
disabled={!hasChanges || isSaving}
data-testid="save-spec"
>
<Save className="w-4 h-4 mr-2" />
{isSaving ? "Saving..." : hasChanges ? "Save Changes" : "Saved"}
</Button>
</div>
</div>
{/* Editor */}
<div className="flex-1 p-4 overflow-hidden">
<Card className="h-full overflow-hidden">
<XmlSyntaxEditor
value={appSpec}
onChange={handleChange}
placeholder="Write your app specification here..."
data-testid="spec-editor"
/>
</Card>
</div>
{/* Regenerate Dialog */}
<Dialog open={showRegenerateDialog} onOpenChange={setShowRegenerateDialog}>
<DialogContent className="max-w-2xl">
<DialogHeader>
<DialogTitle>Regenerate App Specification</DialogTitle>
<DialogDescription className="text-muted-foreground">
We will regenerate your app spec based on a short project definition and the
current tech stack found in your project. The agent will analyze your codebase
to understand your existing technologies and create a comprehensive specification.
</DialogDescription>
</DialogHeader>
<div className="space-y-4 py-4">
<div className="space-y-2">
<label className="text-sm font-medium">
Describe your project
</label>
<p className="text-xs text-muted-foreground">
Provide a clear description of what your app should do. Be as detailed as you
want - the more context you provide, the more comprehensive the spec will be.
</p>
<textarea
className="w-full h-40 p-3 rounded-md border border-border bg-background font-mono text-sm resize-none focus:outline-none focus:ring-2 focus:ring-ring"
value={projectDefinition}
onChange={(e) => setProjectDefinition(e.target.value)}
placeholder="e.g., A task management app where users can create projects, add tasks with due dates, assign tasks to team members, track progress with a kanban board, and receive notifications for upcoming deadlines..."
disabled={isRegenerating}
/>
</div>
</div>
<DialogFooter>
<Button
variant="ghost"
onClick={() => setShowRegenerateDialog(false)}
disabled={isRegenerating}
>
Cancel
</Button>
<HotkeyButton
onClick={handleRegenerate}
disabled={!projectDefinition.trim() || isRegenerating}
hotkey={{ key: "Enter", cmdCtrl: true }}
hotkeyActive={showRegenerateDialog}
>
{isRegenerating ? (
<>
<Loader2 className="w-4 h-4 mr-2 animate-spin" />
Regenerating...
</>
) : (
<>
<Sparkles className="w-4 h-4 mr-2" />
Regenerate Spec
</>
)}
</HotkeyButton>
</DialogFooter>
</DialogContent>
</Dialog>
</div>
);
}

View File

@@ -33,6 +33,13 @@ cd automaker
npm install
```
### Windows notes (in-app Claude auth)
- Node.js 22.x
- Prebuilt PTY is bundled; Visual Studio build tools are not required for Claude auth.
- If you prefer the external terminal flow, set `CLAUDE_AUTH_DISABLE_PTY=1`.
- If you later add native modules beyond the prebuilt PTY, you may still need VS Build Tools + Python to rebuild those.
**Step 3:** Run the Claude Code setup token command:
```bash
@@ -55,7 +62,15 @@ npm run dev:electron
This will start both the Next.js development server and the Electron application.
**Step 6:** MOST IMPORANT: Run the Following after all is setup
### Auth smoke test (Windows)
1. Ensure dependencies are installed (prebuilt pty is included).
2. Run `npm run dev:electron` and open the Setup modal.
3. Click Start on Claude auth; watch the embedded terminal stream logs.
4. Successful runs show “Token captured automatically.”; otherwise copy/paste the token from the log.
5. Optional: `node --test tests/claude-cli-detector.test.js` to verify token parsing.
**Step 6:** MOST IMPORTANT: Run the Following after all is setup
```bash
echo "W"

View File

@@ -19,14 +19,12 @@ class AgentService {
this.stateDir = path.join(appDataPath, "agent-sessions");
this.metadataFile = path.join(appDataPath, "sessions-metadata.json");
await fs.mkdir(this.stateDir, { recursive: true });
console.log("[AgentService] Initialized with state dir:", this.stateDir);
}
/**
* Start or resume a conversation
*/
async startConversation({ sessionId, workingDirectory }) {
console.log("[AgentService] Starting conversation:", sessionId);
// Initialize session if it doesn't exist
if (!this.sessions.has(sessionId)) {
@@ -307,7 +305,7 @@ class AgentService {
};
} catch (error) {
if (error instanceof AbortError || error?.name === "AbortError") {
console.log("[AgentService] Query aborted");
// Query aborted
session.isRunning = false;
session.abortController = null;
return { success: false, aborted: true };

View File

@@ -20,11 +20,64 @@ class AutoModeService {
constructor() {
// Track multiple concurrent feature executions
this.runningFeatures = new Map(); // featureId -> { abortController, query, projectPath, sendToRenderer }
this.autoLoopRunning = false; // Separate flag for the auto loop
this.autoLoopAbortController = null;
this.autoLoopInterval = null; // Timer for periodic checking
// Per-project auto loop state (keyed by projectPath)
this.projectLoops = new Map(); // projectPath -> { isRunning, interval, abortController, sendToRenderer, maxConcurrency }
this.checkIntervalMs = 5000; // Check every 5 seconds
this.maxConcurrency = 3; // Default max concurrency
this.maxConcurrency = 3; // Default max concurrency (global default)
}
/**
* Get or create project loop state
*/
getProjectLoopState(projectPath) {
if (!this.projectLoops.has(projectPath)) {
this.projectLoops.set(projectPath, {
isRunning: false,
interval: null,
abortController: null,
sendToRenderer: null,
maxConcurrency: this.maxConcurrency,
});
}
return this.projectLoops.get(projectPath);
}
/**
* Check if any project has auto mode running
*/
hasAnyAutoLoopRunning() {
for (const [, state] of this.projectLoops) {
if (state.isRunning) return true;
}
return false;
}
/**
* Get running features for a specific project
*/
getRunningFeaturesForProject(projectPath) {
const features = [];
for (const [featureId, execution] of this.runningFeatures) {
if (execution.projectPath === projectPath) {
features.push(featureId);
}
}
return features;
}
/**
* Count running features for a specific project
*/
getRunningCountForProject(projectPath) {
let count = 0;
for (const [, execution] of this.runningFeatures) {
if (execution.projectPath === projectPath) {
count++;
}
}
return count;
}
/**
@@ -43,6 +96,18 @@ class AutoModeService {
return context;
}
/**
* Helper to emit event with projectPath included
*/
emitEvent(projectPath, sendToRenderer, event) {
if (sendToRenderer) {
sendToRenderer({
...event,
projectPath,
});
}
}
/**
* Setup worktree for a feature
* Creates an isolated git worktree where the agent can work
@@ -65,7 +130,7 @@ class AutoModeService {
return { useWorktree: false, workPath: projectPath };
}
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_progress",
featureId: feature.id,
content: "Creating isolated worktree for feature...\n",
@@ -75,7 +140,7 @@ class AutoModeService {
if (!result.success) {
console.warn(`[AutoMode] Failed to create worktree: ${result.error}. Falling back to main project.`);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_progress",
featureId: feature.id,
content: `Warning: Could not create worktree (${result.error}). Working directly on main project.\n`,
@@ -84,7 +149,7 @@ class AutoModeService {
}
console.log(`[AutoMode] Created worktree at: ${result.worktreePath}, branch: ${result.branchName}`);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_progress",
featureId: feature.id,
content: `Working in isolated branch: ${result.branchName}\n`,
@@ -107,46 +172,56 @@ class AutoModeService {
}
/**
* Start auto mode - continuously implement features
* Start auto mode for a specific project - continuously implement features
* Each project can have its own independent auto mode loop
*/
async start({ projectPath, sendToRenderer, maxConcurrency }) {
if (this.autoLoopRunning) {
throw new Error("Auto mode loop is already running");
const projectState = this.getProjectLoopState(projectPath);
if (projectState.isRunning) {
throw new Error(`Auto mode loop is already running for project: ${projectPath}`);
}
this.autoLoopRunning = true;
this.maxConcurrency = maxConcurrency || 3;
projectState.isRunning = true;
projectState.maxConcurrency = maxConcurrency || 3;
projectState.sendToRenderer = sendToRenderer;
console.log(
`[AutoMode] Starting auto mode for project: ${projectPath} with max concurrency: ${this.maxConcurrency}`
`[AutoMode] Starting auto mode for project: ${projectPath} with max concurrency: ${projectState.maxConcurrency}`
);
// Start the periodic checking loop
this.runPeriodicLoop(projectPath, sendToRenderer);
// Start the periodic checking loop for this project
this.runPeriodicLoopForProject(projectPath);
return { success: true };
}
/**
* Stop auto mode - stops the auto loop but lets running features complete
* Stop auto mode for a specific project - stops the auto loop but lets running features complete
* This only turns off the auto toggle to prevent picking up new features.
* Running tasks will continue until they complete naturally.
*/
async stop() {
console.log("[AutoMode] Stopping auto mode (letting running features complete)");
async stop({ projectPath }) {
console.log(`[AutoMode] Stopping auto mode for project: ${projectPath} (letting running features complete)`);
this.autoLoopRunning = false;
const projectState = this.projectLoops.get(projectPath);
if (!projectState) {
console.log(`[AutoMode] No auto mode state found for project: ${projectPath}`);
return { success: true, runningFeatures: 0 };
}
// Clear the interval timer
if (this.autoLoopInterval) {
clearInterval(this.autoLoopInterval);
this.autoLoopInterval = null;
projectState.isRunning = false;
// Clear the interval timer for this project
if (projectState.interval) {
clearInterval(projectState.interval);
projectState.interval = null;
}
// Abort auto loop if running
if (this.autoLoopAbortController) {
this.autoLoopAbortController.abort();
this.autoLoopAbortController = null;
if (projectState.abortController) {
projectState.abortController.abort();
projectState.abortController = null;
}
// NOTE: We intentionally do NOT abort running features here.
@@ -154,23 +229,58 @@ class AutoModeService {
// from being picked up. Running features will complete naturally.
// Use stopFeature() to cancel a specific running feature if needed.
const runningCount = this.runningFeatures.size;
console.log(`[AutoMode] Auto loop stopped. ${runningCount} feature(s) still running and will complete.`);
const runningCount = this.getRunningCountForProject(projectPath);
console.log(`[AutoMode] Auto loop stopped for ${projectPath}. ${runningCount} feature(s) still running and will complete.`);
return { success: true, runningFeatures: runningCount };
}
/**
* Get status of auto mode
* Get status of auto mode (global and per-project)
*/
getStatus() {
getStatus({ projectPath } = {}) {
// If projectPath is specified, return status for that project
if (projectPath) {
const projectState = this.projectLoops.get(projectPath);
return {
autoLoopRunning: projectState?.isRunning || false,
runningFeatures: this.getRunningFeaturesForProject(projectPath),
runningCount: this.getRunningCountForProject(projectPath),
};
}
// Otherwise return global status
const allRunningProjects = [];
for (const [path, state] of this.projectLoops) {
if (state.isRunning) {
allRunningProjects.push(path);
}
}
return {
autoLoopRunning: this.autoLoopRunning,
autoLoopRunning: this.hasAnyAutoLoopRunning(),
runningProjects: allRunningProjects,
runningFeatures: Array.from(this.runningFeatures.keys()),
runningCount: this.runningFeatures.size,
};
}
/**
* Get status for all projects with auto mode
*/
getAllProjectStatuses() {
const statuses = {};
for (const [projectPath, state] of this.projectLoops) {
statuses[projectPath] = {
isRunning: state.isRunning,
runningFeatures: this.getRunningFeaturesForProject(projectPath),
runningCount: this.getRunningCountForProject(projectPath),
maxConcurrency: state.maxConcurrency,
};
}
return statuses;
}
/**
* Run a specific feature by ID
* @param {string} projectPath - Path to the project
@@ -218,7 +328,7 @@ class AutoModeService {
projectPath
);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_start",
featureId: feature.id,
feature: { ...feature, worktreePath: worktreeSetup.workPath, branchName: worktreeSetup.branchName },
@@ -253,7 +363,7 @@ class AutoModeService {
// Keep context file for viewing output later (deleted only when card is removed)
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_complete",
featureId: feature.id,
passes: result.passes,
@@ -281,14 +391,13 @@ class AutoModeService {
featureId,
"waiting_approval",
projectPath,
null, // no summary
error.message // pass error message
{ error: error.message }
);
} catch (statusError) {
console.error("[AutoMode] Failed to update feature status after error:", statusError);
}
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_error",
error: error.message,
featureId: featureId,
@@ -333,7 +442,7 @@ class AutoModeService {
console.log(`[AutoMode] Verifying feature: ${feature.description}`);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_start",
featureId: feature.id,
feature: feature,
@@ -357,7 +466,7 @@ class AutoModeService {
// Keep context file for viewing output later (deleted only when card is removed)
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_complete",
featureId: feature.id,
passes: result.passes,
@@ -385,14 +494,13 @@ class AutoModeService {
featureId,
"waiting_approval",
projectPath,
null, // no summary
error.message // pass error message
{ error: error.message }
);
} catch (statusError) {
console.error("[AutoMode] Failed to update feature status after error:", statusError);
}
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_error",
error: error.message,
featureId: featureId,
@@ -437,7 +545,7 @@ class AutoModeService {
console.log(`[AutoMode] Resuming feature: ${feature.description}`);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_start",
featureId: feature.id,
feature: feature,
@@ -481,7 +589,7 @@ class AutoModeService {
`\n\n🔄 Auto-retry #${attempts} - Continuing implementation...\n\n`
);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_progress",
featureId: feature.id,
content: `\n🔄 Auto-retry #${attempts} - Agent ended early, continuing...\n`,
@@ -524,7 +632,7 @@ class AutoModeService {
// Keep context file for viewing output later (deleted only when card is removed)
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_complete",
featureId: feature.id,
passes: finalResult.passes,
@@ -552,14 +660,13 @@ class AutoModeService {
featureId,
"waiting_approval",
projectPath,
null, // no summary
error.message // pass error message
{ error: error.message }
);
} catch (statusError) {
console.error("[AutoMode] Failed to update feature status after error:", statusError);
}
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_error",
error: error.message,
featureId: featureId,
@@ -572,42 +679,52 @@ class AutoModeService {
}
/**
* New periodic loop - checks available slots and starts features up to max concurrency
* New periodic loop for a specific project - checks available slots and starts features up to max concurrency
* This loop continues running even if there are no backlog items
*/
runPeriodicLoop(projectPath, sendToRenderer) {
runPeriodicLoopForProject(projectPath) {
const projectState = this.getProjectLoopState(projectPath);
console.log(
`[AutoMode] Starting periodic loop with interval: ${this.checkIntervalMs}ms`
`[AutoMode] Starting periodic loop for ${projectPath} with interval: ${this.checkIntervalMs}ms`
);
// Initial check immediately
this.checkAndStartFeatures(projectPath, sendToRenderer);
this.checkAndStartFeaturesForProject(projectPath);
// Then check periodically
this.autoLoopInterval = setInterval(() => {
if (this.autoLoopRunning) {
this.checkAndStartFeatures(projectPath, sendToRenderer);
projectState.interval = setInterval(() => {
if (projectState.isRunning) {
this.checkAndStartFeaturesForProject(projectPath);
}
}, this.checkIntervalMs);
}
/**
* Check how many features are running and start new ones if under max concurrency
* Check how many features are running for a specific project and start new ones if under max concurrency
*/
async checkAndStartFeatures(projectPath, sendToRenderer) {
async checkAndStartFeaturesForProject(projectPath) {
const projectState = this.projectLoops.get(projectPath);
if (!projectState || !projectState.isRunning) {
return;
}
const sendToRenderer = projectState.sendToRenderer;
const maxConcurrency = projectState.maxConcurrency;
try {
// Check how many are currently running
const currentRunningCount = this.runningFeatures.size;
// Check how many are currently running FOR THIS PROJECT
const currentRunningCount = this.getRunningCountForProject(projectPath);
console.log(
`[AutoMode] Checking features - Running: ${currentRunningCount}/${this.maxConcurrency}`
`[AutoMode] [${projectPath}] Checking features - Running: ${currentRunningCount}/${maxConcurrency}`
);
// Calculate available slots
const availableSlots = this.maxConcurrency - currentRunningCount;
// Calculate available slots for this project
const availableSlots = maxConcurrency - currentRunningCount;
if (availableSlots <= 0) {
console.log("[AutoMode] At max concurrency, waiting...");
console.log(`[AutoMode] [${projectPath}] At max concurrency, waiting...`);
return;
}
@@ -616,7 +733,7 @@ class AutoModeService {
const backlogFeatures = features.filter((f) => f.status === "backlog");
if (backlogFeatures.length === 0) {
console.log("[AutoMode] No backlog features available, waiting...");
console.log(`[AutoMode] [${projectPath}] No backlog features available, waiting...`);
return;
}
@@ -624,7 +741,7 @@ class AutoModeService {
const featuresToStart = backlogFeatures.slice(0, availableSlots);
console.log(
`[AutoMode] Starting ${featuresToStart.length} feature(s) from backlog`
`[AutoMode] [${projectPath}] Starting ${featuresToStart.length} feature(s) from backlog`
);
// Start each feature (don't await - run in parallel like drag operations)
@@ -632,7 +749,7 @@ class AutoModeService {
this.startFeatureAsync(feature, projectPath, sendToRenderer);
}
} catch (error) {
console.error("[AutoMode] Error checking/starting features:", error);
console.error(`[AutoMode] [${projectPath}] Error checking/starting features:`, error);
}
}
@@ -678,7 +795,7 @@ class AutoModeService {
projectPath
);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_start",
featureId: feature.id,
feature: { ...feature, worktreePath: worktreeSetup.workPath, branchName: worktreeSetup.branchName },
@@ -713,7 +830,7 @@ class AutoModeService {
// Keep context file for viewing output later (deleted only when card is removed)
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_complete",
featureId: feature.id,
passes: result.passes,
@@ -739,14 +856,13 @@ class AutoModeService {
featureId,
"waiting_approval",
projectPath,
null, // no summary
error.message // pass error message
{ error: error.message }
);
} catch (statusError) {
console.error("[AutoMode] Failed to update feature status after error:", statusError);
}
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_error",
error: error.message,
featureId: featureId,
@@ -778,7 +894,7 @@ class AutoModeService {
this.runningFeatures.set(analysisId, execution);
try {
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_start",
featureId: analysisId,
feature: {
@@ -796,7 +912,7 @@ class AutoModeService {
execution
);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_complete",
featureId: analysisId,
passes: result.success,
@@ -806,7 +922,7 @@ class AutoModeService {
return { success: true, message: result.message };
} catch (error) {
console.error("[AutoMode] Error analyzing project:", error);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_error",
error: error.message,
featureId: analysisId,
@@ -911,7 +1027,7 @@ class AutoModeService {
projectPath
);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_start",
featureId: feature.id,
feature: feature,
@@ -956,7 +1072,7 @@ class AutoModeService {
// Keep context file for viewing output later (deleted only when card is removed)
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_complete",
featureId: feature.id,
passes: result.passes,
@@ -982,14 +1098,13 @@ class AutoModeService {
featureId,
"waiting_approval",
projectPath,
null, // no summary
error.message // pass error message
{ error: error.message }
);
} catch (statusError) {
console.error("[AutoMode] Failed to update feature status after error:", statusError);
}
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_error",
error: error.message,
featureId: featureId,
@@ -1021,13 +1136,13 @@ class AutoModeService {
throw new Error(`Feature ${featureId} not found`);
}
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_start",
featureId: feature.id,
feature: { ...feature, description: "Committing changes..." },
});
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_phase",
featureId,
phase: "action",
@@ -1051,7 +1166,7 @@ class AutoModeService {
// Keep context file for viewing output later (deleted only when card is removed)
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_complete",
featureId: feature.id,
passes: true,
@@ -1061,7 +1176,7 @@ class AutoModeService {
return { success: true };
} catch (error) {
console.error("[AutoMode] Error committing feature:", error);
sendToRenderer({
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_error",
error: error.message,
featureId: featureId,
@@ -1108,26 +1223,22 @@ class AutoModeService {
// Delete context file
await contextManager.deleteContextFile(projectPath, featureId);
if (sendToRenderer) {
sendToRenderer({
type: "auto_mode_feature_complete",
featureId: featureId,
passes: false,
message: "Feature reverted - all changes discarded",
});
}
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_complete",
featureId: featureId,
passes: false,
message: "Feature reverted - all changes discarded",
});
console.log(`[AutoMode] Feature ${featureId} reverted successfully`);
return { success: true, removedPath: result.removedPath };
} catch (error) {
console.error("[AutoMode] Error reverting feature:", error);
if (sendToRenderer) {
sendToRenderer({
type: "auto_mode_error",
error: error.message,
featureId: featureId,
});
}
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_error",
error: error.message,
featureId: featureId,
});
return { success: false, error: error.message };
}
}
@@ -1147,13 +1258,11 @@ class AutoModeService {
throw new Error(`Feature ${featureId} not found`);
}
if (sendToRenderer) {
sendToRenderer({
type: "auto_mode_progress",
featureId: featureId,
content: "Merging feature branch into main...\n",
});
}
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_progress",
featureId: featureId,
content: "Merging feature branch into main...\n",
});
// Merge the worktree
const result = await worktreeManager.mergeWorktree(projectPath, featureId, {
@@ -1171,26 +1280,22 @@ class AutoModeService {
// Update feature status to verified
await featureLoader.updateFeatureStatus(featureId, "verified", projectPath);
if (sendToRenderer) {
sendToRenderer({
type: "auto_mode_feature_complete",
featureId: featureId,
passes: true,
message: `Feature merged into ${result.intoBranch}`,
});
}
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_feature_complete",
featureId: featureId,
passes: true,
message: `Feature merged into ${result.intoBranch}`,
});
console.log(`[AutoMode] Feature ${featureId} merged successfully`);
return { success: true, mergedBranch: result.mergedBranch };
} catch (error) {
console.error("[AutoMode] Error merging feature:", error);
if (sendToRenderer) {
sendToRenderer({
type: "auto_mode_error",
error: error.message,
featureId: featureId,
});
}
this.emitEvent(projectPath, sendToRenderer, {
type: "auto_mode_error",
error: error.message,
featureId: featureId,
});
return { success: false, error: error.message };
}
}

View File

@@ -42,7 +42,10 @@ function createWindow() {
const isDev = !app.isPackaged;
if (isDev) {
mainWindow.loadURL("http://localhost:3007");
// mainWindow.webContents.openDevTools();
// Open DevTools if OPEN_DEVTOOLS environment variable is set
if (process.env.OPEN_DEVTOOLS === "true") {
mainWindow.webContents.openDevTools();
}
} else {
mainWindow.loadFile(path.join(__dirname, "../.next/server/app/index.html"));
}
@@ -70,9 +73,6 @@ app.whenReady().then(async () => {
addAllowedPath(session.projectPath);
}
});
console.log(
`[Security] Pre-loaded ${allowedPaths.size} allowed paths from history`
);
} catch (error) {
console.error("Failed to load sessions for security whitelist:", error);
}
@@ -101,7 +101,6 @@ const allowedPaths = new Set();
function addAllowedPath(pathToAdd) {
if (!pathToAdd) return;
allowedPaths.add(path.resolve(pathToAdd));
console.log(`[Security] Added allowed path: ${pathToAdd}`);
}
/**
@@ -341,7 +340,6 @@ ipcMain.handle(
// Write image to file
await fs.writeFile(imageFilePath, base64Data, "base64");
console.log("[IPC] Saved image to .automaker/images:", imageFilePath);
return { success: true, path: imageFilePath };
} catch (error) {
console.error("[IPC] Failed to save image:", error);
@@ -355,6 +353,17 @@ ipcMain.handle("ping", () => {
return "pong";
});
// Open external link in default browser
ipcMain.handle("shell:openExternal", async (_, url) => {
try {
await shell.openExternal(url);
return { success: true };
} catch (error) {
console.error("[IPC] shell:openExternal error:", error);
return { success: false, error: error.message };
}
});
// ============================================================================
// Agent IPC Handlers
// ============================================================================
@@ -574,11 +583,11 @@ ipcMain.handle(
);
/**
* Stop auto mode
* Stop auto mode for a specific project
*/
ipcMain.handle("auto-mode:stop", async () => {
ipcMain.handle("auto-mode:stop", async (_, { projectPath }) => {
try {
return await autoModeService.stop();
return await autoModeService.stop({ projectPath });
} catch (error) {
console.error("[IPC] auto-mode:stop error:", error);
return { success: false, error: error.message };
@@ -586,11 +595,11 @@ ipcMain.handle("auto-mode:stop", async () => {
});
/**
* Get auto mode status
* Get auto mode status (optionally for a specific project)
*/
ipcMain.handle("auto-mode:status", () => {
ipcMain.handle("auto-mode:status", (_, { projectPath } = {}) => {
try {
return { success: true, ...autoModeService.getStatus() };
return { success: true, ...autoModeService.getStatus({ projectPath }) };
} catch (error) {
console.error("[IPC] auto-mode:status error:", error);
return { success: false, error: error.message };
@@ -629,10 +638,6 @@ ipcMain.handle(
ipcMain.handle(
"auto-mode:verify-feature",
async (_, { projectPath, featureId }) => {
console.log("[IPC] auto-mode:verify-feature called with:", {
projectPath,
featureId,
});
try {
const sendToRenderer = (data) => {
if (mainWindow && !mainWindow.isDestroyed()) {
@@ -658,10 +663,6 @@ ipcMain.handle(
ipcMain.handle(
"auto-mode:resume-feature",
async (_, { projectPath, featureId }) => {
console.log("[IPC] auto-mode:resume-feature called with:", {
projectPath,
featureId,
});
try {
const sendToRenderer = (data) => {
if (mainWindow && !mainWindow.isDestroyed()) {
@@ -712,7 +713,6 @@ ipcMain.handle(
* and update the app_spec.txt with tech stack and implemented features
*/
ipcMain.handle("auto-mode:analyze-project", async (_, { projectPath }) => {
console.log("[IPC] auto-mode:analyze-project called with:", { projectPath });
try {
// Add project path to allowed paths
addAllowedPath(projectPath);
@@ -737,7 +737,6 @@ ipcMain.handle("auto-mode:analyze-project", async (_, { projectPath }) => {
* Stop a specific feature
*/
ipcMain.handle("auto-mode:stop-feature", async (_, { featureId }) => {
console.log("[IPC] auto-mode:stop-feature called with:", { featureId });
try {
return await autoModeService.stopFeature({ featureId });
} catch (error) {
@@ -752,12 +751,6 @@ ipcMain.handle("auto-mode:stop-feature", async (_, { featureId }) => {
ipcMain.handle(
"auto-mode:follow-up-feature",
async (_, { projectPath, featureId, prompt, imagePaths }) => {
console.log("[IPC] auto-mode:follow-up-feature called with:", {
projectPath,
featureId,
prompt,
imagePaths,
});
try {
const sendToRenderer = (data) => {
if (mainWindow && !mainWindow.isDestroyed()) {
@@ -785,10 +778,6 @@ ipcMain.handle(
ipcMain.handle(
"auto-mode:commit-feature",
async (_, { projectPath, featureId }) => {
console.log("[IPC] auto-mode:commit-feature called with:", {
projectPath,
featureId,
});
try {
const sendToRenderer = (data) => {
if (mainWindow && !mainWindow.isDestroyed()) {
@@ -908,12 +897,9 @@ ipcMain.handle(
async (_, { featureId, status, projectPath, summary }) => {
try {
const featureLoader = require("./services/feature-loader");
await featureLoader.updateFeatureStatus(
featureId,
status,
projectPath,
summary
);
await featureLoader.updateFeatureStatus(featureId, status, projectPath, {
summary,
});
// Notify renderer if window is available
if (mainWindow && !mainWindow.isDestroyed()) {
@@ -942,60 +928,67 @@ let suggestionsExecution = null;
/**
* Generate feature suggestions by analyzing the project
* @param {string} projectPath - The path to the project
* @param {string} suggestionType - Type of suggestions: "features", "refactoring", "security", "performance"
*/
ipcMain.handle("suggestions:generate", async (_, { projectPath }) => {
console.log("[IPC] suggestions:generate called with:", { projectPath });
try {
// Check if already running
if (suggestionsExecution && suggestionsExecution.isActive()) {
return {
success: false,
error: "Suggestions generation is already running",
};
}
// Create execution context
suggestionsExecution = {
abortController: null,
query: null,
isActive: () => suggestionsExecution !== null,
};
const sendToRenderer = (data) => {
if (mainWindow && !mainWindow.isDestroyed()) {
mainWindow.webContents.send("suggestions:event", data);
ipcMain.handle(
"suggestions:generate",
async (_, { projectPath, suggestionType = "features" }) => {
try {
// Check if already running
if (suggestionsExecution && suggestionsExecution.isActive()) {
return {
success: false,
error: "Suggestions generation is already running",
};
}
};
// Start generating suggestions (runs in background)
featureSuggestionsService
.generateSuggestions(projectPath, sendToRenderer, suggestionsExecution)
.catch((error) => {
console.error("[IPC] suggestions:generate background error:", error);
sendToRenderer({
type: "suggestions_error",
error: error.message,
// Create execution context
suggestionsExecution = {
abortController: null,
query: null,
isActive: () => suggestionsExecution !== null,
};
const sendToRenderer = (data) => {
if (mainWindow && !mainWindow.isDestroyed()) {
mainWindow.webContents.send("suggestions:event", data);
}
};
// Start generating suggestions (runs in background)
featureSuggestionsService
.generateSuggestions(
projectPath,
sendToRenderer,
suggestionsExecution,
suggestionType
)
.catch((error) => {
console.error("[IPC] suggestions:generate background error:", error);
sendToRenderer({
type: "suggestions_error",
error: error.message,
});
})
.finally(() => {
suggestionsExecution = null;
});
})
.finally(() => {
suggestionsExecution = null;
});
// Return immediately
return { success: true };
} catch (error) {
console.error("[IPC] suggestions:generate error:", error);
suggestionsExecution = null;
return { success: false, error: error.message };
// Return immediately
return { success: true };
} catch (error) {
console.error("[IPC] suggestions:generate error:", error);
suggestionsExecution = null;
return { success: false, error: error.message };
}
}
});
);
/**
* Stop the current suggestions generation
*/
ipcMain.handle("suggestions:stop", async () => {
console.log("[IPC] suggestions:stop called");
try {
if (suggestionsExecution && suggestionsExecution.abortController) {
suggestionsExecution.abortController.abort();
@@ -1068,10 +1061,6 @@ ipcMain.handle("openai:test-connection", async (_, { apiKey }) => {
ipcMain.handle(
"worktree:revert-feature",
async (_, { projectPath, featureId }) => {
console.log("[IPC] worktree:revert-feature called with:", {
projectPath,
featureId,
});
try {
const sendToRenderer = (data) => {
if (mainWindow && !mainWindow.isDestroyed()) {
@@ -1104,10 +1093,6 @@ let specRegenerationExecution = null;
ipcMain.handle(
"spec-regeneration:generate",
async (_, { projectPath, projectDefinition }) => {
console.log("[IPC] spec-regeneration:generate called with:", {
projectPath,
});
try {
// Add project path to allowed paths
addAllowedPath(projectPath);
@@ -1169,7 +1154,6 @@ ipcMain.handle(
* Stop the current spec regeneration
*/
ipcMain.handle("spec-regeneration:stop", async () => {
console.log("[IPC] spec-regeneration:stop called");
try {
if (
specRegenerationExecution &&
@@ -1194,6 +1178,7 @@ ipcMain.handle("spec-regeneration:status", () => {
isRunning:
specRegenerationExecution !== null &&
specRegenerationExecution.isActive(),
currentPhase: specRegenerationService.getCurrentPhase(),
};
});
@@ -1203,11 +1188,6 @@ ipcMain.handle("spec-regeneration:status", () => {
ipcMain.handle(
"spec-regeneration:create",
async (_, { projectPath, projectOverview, generateFeatures = true }) => {
console.log("[IPC] spec-regeneration:create called with:", {
projectPath,
generateFeatures,
});
try {
// Add project path to allowed paths
addAllowedPath(projectPath);
@@ -1263,17 +1243,75 @@ ipcMain.handle(
}
);
/**
* Generate features from existing app_spec.txt
* This allows users to generate features retroactively without regenerating the spec
*/
ipcMain.handle(
"spec-regeneration:generate-features",
async (_, { projectPath }) => {
try {
// Add project path to allowed paths
addAllowedPath(projectPath);
// Check if already running
if (specRegenerationExecution && specRegenerationExecution.isActive()) {
return {
success: false,
error: "Spec regeneration is already running",
};
}
// Create execution context
specRegenerationExecution = {
abortController: null,
query: null,
isActive: () => specRegenerationExecution !== null,
};
const sendToRenderer = (data) => {
if (mainWindow && !mainWindow.isDestroyed()) {
mainWindow.webContents.send("spec-regeneration:event", data);
}
};
// Start generating features (runs in background)
specRegenerationService
.generateFeaturesOnly(
projectPath,
sendToRenderer,
specRegenerationExecution
)
.catch((error) => {
console.error(
"[IPC] spec-regeneration:generate-features background error:",
error
);
sendToRenderer({
type: "spec_regeneration_error",
error: error.message,
});
})
.finally(() => {
specRegenerationExecution = null;
});
// Return immediately
return { success: true };
} catch (error) {
console.error("[IPC] spec-regeneration:generate-features error:", error);
specRegenerationExecution = null;
return { success: false, error: error.message };
}
}
);
/**
* Merge feature worktree changes back to main branch
*/
ipcMain.handle(
"worktree:merge-feature",
async (_, { projectPath, featureId, options }) => {
console.log("[IPC] worktree:merge-feature called with:", {
projectPath,
featureId,
options,
});
try {
const sendToRenderer = (data) => {
if (mainWindow && !mainWindow.isDestroyed()) {
@@ -1399,7 +1437,6 @@ ipcMain.handle("setup:claude-status", async () => {
"credentials.json"
);
const result = claudeCliDetector.getFullStatus(credentialsPath);
console.log("[IPC] setup:claude-status result:", result);
return result;
} catch (error) {
console.error("[IPC] setup:claude-status error:", error);
@@ -1524,7 +1561,6 @@ ipcMain.handle("setup:auth-codex", async (event, { apiKey }) => {
*/
ipcMain.handle("setup:store-api-key", async (_, { provider, apiKey }) => {
try {
console.log("[IPC] setup:store-api-key called for provider:", provider);
const configPath = path.join(app.getPath("userData"), "credentials.json");
let credentials = {};
@@ -1546,7 +1582,6 @@ ipcMain.handle("setup:store-api-key", async (_, { provider, apiKey }) => {
"utf-8"
);
console.log("[IPC] setup:store-api-key stored successfully for:", provider);
return { success: true };
} catch (error) {
console.error("[IPC] setup:store-api-key error:", error);
@@ -1768,7 +1803,10 @@ ipcMain.handle(
}
const featureLoader = require("./services/feature-loader");
const content = await featureLoader.getAgentOutput(projectPath, featureId);
const content = await featureLoader.getAgentOutput(
projectPath,
featureId
);
return { success: true, content };
} catch (error) {
console.error("[IPC] features:getAgentOutput error:", error);
@@ -1776,3 +1814,41 @@ ipcMain.handle(
}
}
);
// ============================================================================
// Running Agents IPC Handlers
// ============================================================================
/**
* Get all currently running agents across all projects
*/
ipcMain.handle("running-agents:getAll", () => {
try {
const status = autoModeService.getStatus();
const allStatuses = autoModeService.getAllProjectStatuses();
// Build a list of running agents with their details
const runningAgents = [];
for (const [projectPath, projectStatus] of Object.entries(allStatuses)) {
for (const featureId of projectStatus.runningFeatures) {
runningAgents.push({
featureId,
projectPath,
projectName: projectPath.split(/[/\\]/).pop() || projectPath,
isAutoMode: projectStatus.isRunning,
});
}
}
return {
success: true,
runningAgents,
totalCount: status.runningCount,
autoLoopRunning: status.autoLoopRunning,
};
} catch (error) {
console.error("[IPC] running-agents:getAll error:", error);
return { success: false, error: error.message };
}
});

View File

@@ -6,6 +6,9 @@ contextBridge.exposeInMainWorld("electronAPI", {
// IPC test
ping: () => ipcRenderer.invoke("ping"),
// Shell APIs
openExternalLink: (url) => ipcRenderer.invoke("shell:openExternal", url),
// Dialog APIs
openDirectory: () => ipcRenderer.invoke("dialog:openDirectory"),
openFile: (options) => ipcRenderer.invoke("dialog:openFile", options),
@@ -97,15 +100,15 @@ contextBridge.exposeInMainWorld("electronAPI", {
// Auto Mode API
autoMode: {
// Start auto mode
// Start auto mode for a specific project
start: (projectPath, maxConcurrency) =>
ipcRenderer.invoke("auto-mode:start", { projectPath, maxConcurrency }),
// Stop auto mode
stop: () => ipcRenderer.invoke("auto-mode:stop"),
// Stop auto mode for a specific project
stop: (projectPath) => ipcRenderer.invoke("auto-mode:stop", { projectPath }),
// Get auto mode status
status: () => ipcRenderer.invoke("auto-mode:status"),
// Get auto mode status (optionally for a specific project)
status: (projectPath) => ipcRenderer.invoke("auto-mode:status", { projectPath }),
// Run a specific feature
runFeature: (projectPath, featureId, useWorktrees) =>
@@ -243,8 +246,9 @@ contextBridge.exposeInMainWorld("electronAPI", {
// Feature Suggestions API
suggestions: {
// Generate feature suggestions
generate: (projectPath) =>
ipcRenderer.invoke("suggestions:generate", { projectPath }),
// suggestionType can be: "features", "refactoring", "security", "performance"
generate: (projectPath, suggestionType = "features") =>
ipcRenderer.invoke("suggestions:generate", { projectPath, suggestionType }),
// Stop generating suggestions
stop: () => ipcRenderer.invoke("suggestions:stop"),
@@ -281,6 +285,12 @@ contextBridge.exposeInMainWorld("electronAPI", {
projectDefinition,
}),
// Generate features from existing app_spec.txt
generateFeatures: (projectPath) =>
ipcRenderer.invoke("spec-regeneration:generate-features", {
projectPath,
}),
// Stop regenerating spec
stop: () => ipcRenderer.invoke("spec-regeneration:stop"),
@@ -382,6 +392,12 @@ contextBridge.exposeInMainWorld("electronAPI", {
getAgentOutput: (projectPath, featureId) =>
ipcRenderer.invoke("features:getAgentOutput", { projectPath, featureId }),
},
// Running Agents API
runningAgents: {
// Get all running agents across all projects
getAll: () => ipcRenderer.invoke("running-agents:getAll"),
},
});
// Also expose a flag to detect if we're in Electron

View File

@@ -3,6 +3,22 @@ const fs = require("fs");
const path = require("path");
const os = require("os");
let runPtyCommand = null;
try {
({ runPtyCommand } = require("./pty-runner"));
} catch (error) {
console.warn(
"[ClaudeCliDetector] node-pty unavailable, will fall back to external terminal:",
error?.message || error
);
}
const ANSI_REGEX =
// eslint-disable-next-line no-control-regex
/\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b[@-_]|\u001b\][^\u0007]*\u0007/g;
const stripAnsi = (text = "") => text.replace(ANSI_REGEX, "");
/**
* Claude CLI Detector
*
@@ -24,7 +40,6 @@ class ClaudeCliDetector {
const shell = process.env.SHELL || "/bin/bash";
const shellName = path.basename(shell);
// Common shell config files
const configFiles = [];
if (shellName.includes("zsh")) {
configFiles.push(path.join(homeDir, ".zshrc"));
@@ -36,7 +51,6 @@ class ClaudeCliDetector {
configFiles.push(path.join(homeDir, ".profile"));
}
// Also check common locations
const commonPaths = [
path.join(homeDir, ".local", "bin"),
path.join(homeDir, ".cargo", "bin"),
@@ -45,12 +59,10 @@ class ClaudeCliDetector {
path.join(homeDir, "bin"),
];
// Try to extract PATH additions from config files
for (const configFile of configFiles) {
if (fs.existsSync(configFile)) {
try {
const content = fs.readFileSync(configFile, "utf-8");
// Look for PATH exports that might include claude installation paths
const pathMatches = content.match(
/export\s+PATH=["']?([^"'\n]+)["']?/g
);
@@ -71,14 +83,12 @@ class ClaudeCliDetector {
}
}
return [...new Set(commonPaths)]; // Remove duplicates
return [...new Set(commonPaths)];
}
static detectClaudeInstallation() {
console.log("[ClaudeCliDetector] Detecting Claude installation...");
try {
// Method 1: Check if 'claude' command is in PATH (Unix)
// Check if 'claude' command is in PATH (Unix)
if (process.platform !== "win32") {
try {
const claudePath = execSync("which claude 2>/dev/null", {
@@ -86,12 +96,6 @@ class ClaudeCliDetector {
}).trim();
if (claudePath) {
const version = this.getClaudeVersion(claudePath);
console.log(
"[ClaudeCliDetector] Found claude at:",
claudePath,
"version:",
version
);
return {
installed: true,
path: claudePath,
@@ -100,11 +104,11 @@ class ClaudeCliDetector {
};
}
} catch (error) {
// CLI not in PATH, continue checking other locations
// CLI not in PATH
}
}
// Method 2: Check Windows path
// Check Windows path
if (process.platform === "win32") {
try {
const claudePath = execSync("where claude 2>nul", {
@@ -114,12 +118,6 @@ class ClaudeCliDetector {
.split("\n")[0];
if (claudePath) {
const version = this.getClaudeVersion(claudePath);
console.log(
"[ClaudeCliDetector] Found claude at:",
claudePath,
"version:",
version
);
return {
installed: true,
path: claudePath,
@@ -132,7 +130,7 @@ class ClaudeCliDetector {
}
}
// Method 3: Check for local installation
// Check for local installation
const localClaudePath = path.join(
os.homedir(),
".claude",
@@ -141,12 +139,6 @@ class ClaudeCliDetector {
);
if (fs.existsSync(localClaudePath)) {
const version = this.getClaudeVersion(localClaudePath);
console.log(
"[ClaudeCliDetector] Found local claude at:",
localClaudePath,
"version:",
version
);
return {
installed: true,
path: localClaudePath,
@@ -155,7 +147,7 @@ class ClaudeCliDetector {
};
}
// Method 4: Check common installation locations (including those from shell config)
// Check common installation locations
const commonPaths = this.getUpdatedPathFromShellConfig();
const binaryNames = ["claude", "claude-code"];
@@ -165,12 +157,6 @@ class ClaudeCliDetector {
if (fs.existsSync(claudePath)) {
try {
const version = this.getClaudeVersion(claudePath);
console.log(
"[ClaudeCliDetector] Found claude at:",
claudePath,
"version:",
version
);
return {
installed: true,
path: claudePath,
@@ -178,13 +164,13 @@ class ClaudeCliDetector {
method: "cli",
};
} catch (error) {
// File exists but can't get version, might not be executable
// File exists but can't get version
}
}
}
}
// Method 5: Try to source shell config and check PATH again (for Unix)
// Try to source shell config and check PATH again (Unix)
if (process.platform !== "win32") {
try {
const shell = process.env.SHELL || "/bin/bash";
@@ -205,12 +191,6 @@ class ClaudeCliDetector {
}).trim();
if (claudePath && claudePath.startsWith("/")) {
const version = this.getClaudeVersion(claudePath);
console.log(
"[ClaudeCliDetector] Found claude via shell config at:",
claudePath,
"version:",
version
);
return {
installed: true,
path: claudePath,
@@ -220,11 +200,10 @@ class ClaudeCliDetector {
}
}
} catch (error) {
// Failed to source shell config or find claude
// Failed to source shell config
}
}
console.log("[ClaudeCliDetector] Claude CLI not found");
return {
installed: false,
path: null,
@@ -232,10 +211,6 @@ class ClaudeCliDetector {
method: "none",
};
} catch (error) {
console.error(
"[ClaudeCliDetector] Error detecting Claude installation:",
error
);
return {
installed: false,
path: null,
@@ -274,12 +249,9 @@ class ClaudeCliDetector {
* @returns {Object} Authentication status
*/
static getAuthStatus(appCredentialsPath) {
console.log("[ClaudeCliDetector] Checking auth status...");
const envApiKey = process.env.ANTHROPIC_API_KEY;
console.log("[ClaudeCliDetector] Env ANTHROPIC_API_KEY:", !!envApiKey);
const envOAuthToken = process.env.CLAUDE_CODE_OAUTH_TOKEN;
// Check app's stored credentials
let storedOAuthToken = null;
let storedApiKey = null;
@@ -290,51 +262,41 @@ class ClaudeCliDetector {
storedOAuthToken = credentials.anthropic_oauth_token || null;
storedApiKey =
credentials.anthropic || credentials.anthropic_api_key || null;
console.log("[ClaudeCliDetector] App credentials:", {
hasOAuthToken: !!storedOAuthToken,
hasApiKey: !!storedApiKey,
});
} catch (error) {
console.error(
"[ClaudeCliDetector] Error reading app credentials:",
error
);
// Ignore credential read errors
}
}
// Determine authentication method
// Priority: Stored OAuth Token > Stored API Key > Env API Key
// Authentication priority (highest to lowest):
// 1. Environment OAuth Token (CLAUDE_CODE_OAUTH_TOKEN)
// 2. Stored OAuth Token (from credentials file)
// 3. Stored API Key (from credentials file)
// 4. Environment API Key (ANTHROPIC_API_KEY)
let authenticated = false;
let method = "none";
if (storedOAuthToken) {
if (envOAuthToken) {
authenticated = true;
method = "oauth_token_env";
} else if (storedOAuthToken) {
authenticated = true;
method = "oauth_token";
console.log(
"[ClaudeCliDetector] Using stored OAuth token (subscription)"
);
} else if (storedApiKey) {
authenticated = true;
method = "api_key";
console.log("[ClaudeCliDetector] Using stored API key");
} else if (envApiKey) {
authenticated = true;
method = "api_key_env";
console.log("[ClaudeCliDetector] Using environment API key");
} else {
console.log("[ClaudeCliDetector] No authentication found");
}
const result = {
return {
authenticated,
method,
hasStoredOAuthToken: !!storedOAuthToken,
hasStoredApiKey: !!storedApiKey,
hasEnvApiKey: !!envApiKey,
hasEnvOAuthToken: !!envOAuthToken,
};
console.log("[ClaudeCliDetector] Auth status result:", result);
return result;
}
/**
* Get installation info (installation status only, no auth)
@@ -371,6 +333,30 @@ class ClaudeCliDetector {
};
}
/**
* Get installation info and recommendations
* @returns {Object} Installation status and recommendations
*/
static getInstallationInfo() {
const detection = this.detectClaudeInstallation();
if (detection.installed) {
return {
status: 'installed',
method: detection.method,
version: detection.version,
path: detection.path,
recommendation: 'Claude Code CLI is ready for ultrathink'
};
}
return {
status: 'not_installed',
recommendation: 'Install Claude Code CLI for optimal ultrathink performance',
installCommands: this.getInstallCommands()
};
}
/**
* Get installation commands for different platforms
* @returns {Object} Installation commands
@@ -489,6 +475,247 @@ class ClaudeCliDetector {
note: "This token is from your Claude subscription and allows you to use Claude without API charges.",
};
}
/**
* Extract OAuth token from command output
* Tries multiple patterns to find the token
* @param {string} output The command output
* @returns {string|null} Extracted token or null
*/
static extractTokenFromOutput(output) {
// Pattern 1: CLAUDE_CODE_OAUTH_TOKEN=<token> or CLAUDE_CODE_OAUTH_TOKEN: <token>
const envMatch = output.match(
/CLAUDE_CODE_OAUTH_TOKEN[=:]\s*["']?([a-zA-Z0-9_\-\.]+)["']?/i
);
if (envMatch) return envMatch[1];
// Pattern 2: "Token: <token>" or "token: <token>"
const tokenLabelMatch = output.match(
/\btoken[:\s]+["']?([a-zA-Z0-9_\-\.]{40,})["']?/i
);
if (tokenLabelMatch) return tokenLabelMatch[1];
// Pattern 3: Look for token after success/authenticated message
const successMatch = output.match(
/(?:success|authenticated|generated|token is)[^\n]*\n\s*([a-zA-Z0-9_\-\.]{40,})/i
);
if (successMatch) return successMatch[1];
// Pattern 4: Standalone long alphanumeric string on its own line (last resort)
// This catches tokens that are printed on their own line
const lines = output.split("\n");
for (const line of lines) {
const trimmed = line.trim();
// Token should be 40+ chars, alphanumeric with possible hyphens/underscores/dots
if (/^[a-zA-Z0-9_\-\.]{40,}$/.test(trimmed)) {
return trimmed;
}
}
return null;
}
/**
* Run claude setup-token command to generate OAuth token
* Opens an external terminal window since Claude CLI requires TTY for its Ink-based UI
* @param {Function} onProgress Callback for progress updates
* @returns {Promise<Object>} Result indicating terminal was opened
*/
static async runSetupToken(onProgress) {
const detection = this.detectClaudeInstallation();
if (!detection.installed) {
throw {
success: false,
error: "Claude CLI is not installed. Please install it first.",
requiresManualAuth: false,
};
}
const claudePath = detection.path;
const platform = process.platform;
const preferPty =
(platform === "win32" ||
platform === "darwin" ||
process.env.CLAUDE_AUTH_FORCE_PTY === "1") &&
process.env.CLAUDE_AUTH_DISABLE_PTY !== "1";
const send = (data) => {
if (onProgress && data) {
onProgress({ type: "stdout", data });
}
};
if (preferPty && runPtyCommand) {
try {
send("Starting in-app terminal session for Claude auth...\n");
send("If your browser opens, complete sign-in and return here.\n\n");
const ptyResult = await runPtyCommand(claudePath, ["setup-token"], {
cols: 120,
rows: 30,
onData: (chunk) => send(chunk),
env: {
FORCE_COLOR: "1",
},
});
const cleanedOutput = stripAnsi(ptyResult.output || "");
const token = this.extractTokenFromOutput(cleanedOutput);
if (ptyResult.success && token) {
send("\nCaptured token automatically.\n");
return {
success: true,
token,
requiresManualAuth: false,
terminalOpened: false,
};
}
if (ptyResult.success && !token) {
send(
"\nCLI completed but token was not detected automatically. You can copy it above or retry.\n"
);
return {
success: true,
requiresManualAuth: true,
terminalOpened: false,
error: "Could not capture token automatically",
output: cleanedOutput,
};
}
send(
`\nClaude CLI exited with code ${ptyResult.exitCode}. Falling back to manual copy.\n`
);
return {
success: false,
error: `Claude CLI exited with code ${ptyResult.exitCode}`,
requiresManualAuth: true,
output: cleanedOutput,
};
} catch (error) {
console.error("[ClaudeCliDetector] PTY auth failed, falling back:", error);
send(
`In-app terminal failed (${error?.message || "unknown error"}). Falling back to external terminal...\n`
);
}
}
// Fallback: external terminal window
if (preferPty && !runPtyCommand) {
send("In-app terminal unavailable (node-pty not loaded).");
} else if (!preferPty) {
send("Using system terminal for authentication on this platform.");
}
send("Opening system terminal for authentication...\n");
// Helper function to check if a command exists asynchronously
const commandExists = (cmd) => {
return new Promise((resolve) => {
require("child_process").exec(
`which ${cmd}`,
{ timeout: 1000 },
(error) => {
resolve(!error);
}
);
});
};
// For Linux, find available terminal first (async)
let linuxTerminal = null;
if (platform !== "win32" && platform !== "darwin") {
const terminals = [
["gnome-terminal", ["--", claudePath, "setup-token"]],
["konsole", ["-e", claudePath, "setup-token"]],
["xterm", ["-e", claudePath, "setup-token"]],
["x-terminal-emulator", ["-e", `${claudePath} setup-token`]],
];
for (const [term, termArgs] of terminals) {
const exists = await commandExists(term);
if (exists) {
linuxTerminal = { command: term, args: termArgs };
break;
}
}
}
return new Promise((resolve, reject) => {
// Open command in external terminal since Claude CLI requires TTY
let command, args;
if (platform === "win32") {
// Windows: Open new cmd window that stays open
command = "cmd";
args = ["/c", "start", "cmd", "/k", `"${claudePath}" setup-token`];
} else if (platform === "darwin") {
// macOS: Open Terminal.app
command = "osascript";
args = [
"-e",
`tell application "Terminal" to do script "${claudePath} setup-token"`,
"-e",
'tell application "Terminal" to activate',
];
} else {
// Linux: Use the terminal we found earlier
if (!linuxTerminal) {
reject({
success: false,
error:
"Could not find a terminal emulator. Please run 'claude setup-token' manually in your terminal.",
requiresManualAuth: true,
});
return;
}
command = linuxTerminal.command;
args = linuxTerminal.args;
}
console.log(
"[ClaudeCliDetector] Spawning terminal:",
command,
args.join(" ")
);
const proc = spawn(command, args, {
detached: true,
stdio: "ignore",
shell: platform === "win32",
});
proc.unref();
proc.on("error", (error) => {
console.error("[ClaudeCliDetector] Failed to open terminal:", error);
reject({
success: false,
error: `Failed to open terminal: ${error.message}`,
requiresManualAuth: true,
});
});
// Give the terminal a moment to open
setTimeout(() => {
send("Terminal window opened!\n\n");
send("1. Complete the sign-in in your browser\n");
send("2. Copy the token from the terminal\n");
send("3. Paste it below\n");
// Resolve with manual auth required since we can't capture from external terminal
resolve({
success: true,
requiresManualAuth: true,
terminalOpened: true,
message:
"Terminal opened. Complete authentication and paste the token below.",
});
}, 500);
});
}
}
module.exports = ClaudeCliDetector;

View File

@@ -32,35 +32,28 @@ class CodexCliDetector {
* @returns {Object} Authentication status
*/
static checkAuth() {
console.log('[CodexCliDetector] Checking auth status...');
try {
const authPath = this.getAuthPath();
const envApiKey = process.env.OPENAI_API_KEY;
console.log('[CodexCliDetector] Auth path:', authPath);
console.log('[CodexCliDetector] Has env API key:', !!envApiKey);
// First, try to verify authentication using codex CLI command if available
// Try to verify authentication using codex CLI command if available
try {
const detection = this.detectCodexInstallation();
if (detection.installed) {
try {
// Use 'codex login status' to verify authentication
const statusOutput = execSync(`"${detection.path || 'codex'}" login status 2>/dev/null`, {
const statusOutput = execSync(`"${detection.path || 'codex'}" login status 2>/dev/null`, {
encoding: 'utf-8',
timeout: 5000
timeout: 5000
});
// If command succeeds and shows logged in status
if (statusOutput && (statusOutput.includes('Logged in') || statusOutput.includes('Authenticated'))) {
const result = {
return {
authenticated: true,
method: 'cli_verified',
hasAuthFile: fs.existsSync(authPath),
hasEnvKey: !!envApiKey,
authPath
};
console.log('[CodexCliDetector] Auth result (cli_verified):', result);
return result;
}
} catch (statusError) {
// status command failed, continue with file-based check
@@ -72,63 +65,47 @@ class CodexCliDetector {
// Check if auth file exists
if (fs.existsSync(authPath)) {
console.log('[CodexCliDetector] Auth file exists, reading content...');
let auth = null;
try {
const content = fs.readFileSync(authPath, 'utf-8');
auth = JSON.parse(content);
console.log('[CodexCliDetector] Auth file content keys:', Object.keys(auth));
console.log('[CodexCliDetector] Auth file has token object:', !!auth.token);
if (auth.token) {
console.log('[CodexCliDetector] Token object keys:', Object.keys(auth.token));
}
// Check for token object structure (from codex auth login)
// Structure: { token: { Id_token, access_token, refresh_token }, last_refresh: ... }
// Check for token object structure
if (auth.token && typeof auth.token === 'object') {
const token = auth.token;
if (token.Id_token || token.access_token || token.refresh_token || token.id_token) {
const result = {
return {
authenticated: true,
method: 'cli_tokens', // Distinguish token-based auth from API key auth
method: 'cli_tokens',
hasAuthFile: true,
hasEnvKey: !!envApiKey,
authPath
};
console.log('[CodexCliDetector] Auth result (cli_tokens):', result);
return result;
}
}
// Check for tokens at root level (alternative structure)
// Check for tokens at root level
if (auth.access_token || auth.refresh_token || auth.Id_token || auth.id_token) {
const result = {
return {
authenticated: true,
method: 'cli_tokens', // These are tokens, not API keys
method: 'cli_tokens',
hasAuthFile: true,
hasEnvKey: !!envApiKey,
authPath
};
console.log('[CodexCliDetector] Auth result (cli_tokens - root level):', result);
return result;
}
// Check for various possible API key fields that codex might use
// Note: access_token is NOT an API key, it's a token, so we check for it above
// Check for API key fields
if (auth.api_key || auth.openai_api_key || auth.apiKey) {
const result = {
return {
authenticated: true,
method: 'auth_file',
hasAuthFile: true,
hasEnvKey: !!envApiKey,
authPath
};
console.log('[CodexCliDetector] Auth result (auth_file - API key):', result);
return result;
}
} catch (error) {
console.error('[CodexCliDetector] Error reading/parsing auth file:', error.message);
// If we can't parse the file, we can't determine auth status
return {
authenticated: false,
method: 'none',
@@ -138,10 +115,7 @@ class CodexCliDetector {
};
}
// Also check if the file has any meaningful content (non-empty object)
// This is a fallback - but we should still try to detect if it's tokens
if (!auth) {
// File exists but couldn't be parsed
return {
authenticated: false,
method: 'none',
@@ -150,121 +124,32 @@ class CodexCliDetector {
authPath
};
}
const keys = Object.keys(auth);
console.log('[CodexCliDetector] File has content, keys:', keys);
if (keys.length > 0) {
// Check again for tokens in case we missed them (maybe nested differently)
const hasTokens = keys.some(key =>
key.toLowerCase().includes('token') ||
const hasTokens = keys.some(key =>
key.toLowerCase().includes('token') ||
key.toLowerCase().includes('refresh') ||
(auth[key] && typeof auth[key] === 'object' && (
auth[key].access_token || auth[key].refresh_token || auth[key].Id_token || auth[key].id_token
))
);
if (hasTokens) {
const result = {
return {
authenticated: true,
method: 'cli_tokens',
hasAuthFile: true,
hasEnvKey: !!envApiKey,
authPath
};
console.log('[CodexCliDetector] Auth result (cli_tokens - fallback detection):', result);
return result;
}
// File exists and has content, likely authenticated
// Try to verify by checking if codex command works
try {
const detection = this.detectCodexInstallation();
if (detection.installed) {
// Try to verify auth by running a simple command
try {
execSync(`"${detection.path || 'codex'}" --version 2>/dev/null`, {
encoding: 'utf-8',
timeout: 3000
});
// If command succeeds, assume authenticated
// But check if it's likely tokens vs API key based on file structure
const likelyTokens = keys.some(key => key.toLowerCase().includes('token') || key.toLowerCase().includes('refresh'));
const result = {
authenticated: true,
method: likelyTokens ? 'cli_tokens' : 'auth_file',
hasAuthFile: true,
hasEnvKey: !!envApiKey,
authPath
};
console.log('[CodexCliDetector] Auth result (verified via CLI, method:', result.method, '):', result);
return result;
} catch (cmdError) {
// Command failed, but file exists - might still be authenticated
// Check if it's likely tokens
const likelyTokens = keys.some(key => key.toLowerCase().includes('token') || key.toLowerCase().includes('refresh'));
const result = {
authenticated: true,
method: likelyTokens ? 'cli_tokens' : 'auth_file',
hasAuthFile: true,
hasEnvKey: !!envApiKey,
authPath
};
console.log('[CodexCliDetector] Auth result (file exists, method:', result.method, '):', result);
return result;
}
}
} catch (verifyError) {
// Verification failed, but file exists with content
// Check if it's likely tokens
const likelyTokens = keys.some(key => key.toLowerCase().includes('token') || key.toLowerCase().includes('refresh'));
const result = {
authenticated: true,
method: likelyTokens ? 'cli_tokens' : 'auth_file',
hasAuthFile: true,
hasEnvKey: !!envApiKey,
authPath
};
console.log('[CodexCliDetector] Auth result (fallback, method:', result.method, '):', result);
return result;
}
}
}
// Check environment variable
if (envApiKey) {
const result = {
authenticated: true,
method: 'env_var',
hasAuthFile: false,
hasEnvKey: true,
authPath
};
console.log('[CodexCliDetector] Auth result (env_var):', result);
return result;
}
// If auth file exists but we didn't find standard keys,
// check if codex CLI is installed and try to verify auth
if (fs.existsSync(authPath)) {
try {
const detection = this.detectCodexInstallation();
if (detection.installed) {
// Auth file exists and CLI is installed - likely authenticated
// The file existing is a good indicator that login was successful
return {
authenticated: true,
method: 'auth_file',
hasAuthFile: true,
hasEnvKey: !!envApiKey,
authPath
};
}
} catch (verifyError) {
// Verification attempt failed, but file exists
// Assume authenticated if file exists
// File exists and has content - check if it's tokens or API key
const likelyTokens = keys.some(key => key.toLowerCase().includes('token') || key.toLowerCase().includes('refresh'));
return {
authenticated: true,
method: 'auth_file',
method: likelyTokens ? 'cli_tokens' : 'auth_file',
hasAuthFile: true,
hasEnvKey: !!envApiKey,
authPath
@@ -272,24 +157,30 @@ class CodexCliDetector {
}
}
const result = {
// Check environment variable
if (envApiKey) {
return {
authenticated: true,
method: 'env_var',
hasAuthFile: false,
hasEnvKey: true,
authPath
};
}
return {
authenticated: false,
method: 'none',
hasAuthFile: false,
hasEnvKey: false,
authPath
};
console.log('[CodexCliDetector] Auth result (not authenticated):', result);
return result;
} catch (error) {
console.error('[CodexCliDetector] Error checking auth:', error);
const result = {
return {
authenticated: false,
method: 'none',
error: error.message
};
console.log('[CodexCliDetector] Auth result (error):', result);
return result;
}
}
/**
@@ -409,7 +300,7 @@ class CodexCliDetector {
method: 'none'
};
} catch (error) {
console.error('[CodexCliDetector] Error detecting Codex installation:', error);
// Error detecting Codex installation
return {
installed: false,
path: null,

View File

@@ -170,14 +170,38 @@ class FeatureLoader {
const featureJsonPath = this.getFeatureJsonPath(projectPath, featureId);
try {
// Read feature.json directly - handle ENOENT in catch block
// This avoids TOCTOU race condition from checking with fs.access first
const content = await fs.readFile(featureJsonPath, "utf-8");
const feature = JSON.parse(content);
// Validate that the feature has required fields
if (!feature.id) {
console.warn(
`[FeatureLoader] Feature ${featureId} missing required 'id' field, skipping`
);
continue;
}
features.push(feature);
} catch (error) {
console.error(
`[FeatureLoader] Failed to load feature ${featureId}:`,
error
);
// Handle different error types appropriately
if (error.code === "ENOENT") {
// File doesn't exist - this is expected for incomplete feature directories
// Skip silently (feature.json not yet created or was removed)
continue;
} else if (error instanceof SyntaxError) {
// JSON parse error - log as warning since file exists but is malformed
console.warn(
`[FeatureLoader] Failed to parse feature.json for ${featureId}: ${error.message}`
);
} else {
// Other errors - log as error
console.error(
`[FeatureLoader] Failed to load feature ${featureId}:`,
error.message || error
);
}
// Continue loading other features
}
}
@@ -339,30 +363,93 @@ class FeatureLoader {
/**
* Update feature status (legacy API)
* Features are stored in .automaker/features/{id}/feature.json
* Creates the feature if it doesn't exist.
* @param {string} featureId - The ID of the feature to update
* @param {string} status - The new status
* @param {string} projectPath - Path to the project
* @param {string} [summary] - Optional summary of what was done
* @param {string} [error] - Optional error message if feature errored
* @param {Object} options - Options object for optional parameters
* @param {string} [options.summary] - Optional summary of what was done
* @param {string} [options.error] - Optional error message if feature errored
* @param {string} [options.description] - Optional detailed description
* @param {string} [options.category] - Optional category/phase
* @param {string[]} [options.steps] - Optional array of implementation steps
*/
async updateFeatureStatus(featureId, status, projectPath, summary, error) {
async updateFeatureStatus(featureId, status, projectPath, options = {}) {
const { summary, error, description, category, steps } = options;
// Check if feature exists
const existingFeature = await this.get(projectPath, featureId);
if (!existingFeature) {
// Feature doesn't exist - create it with all required fields
console.log(`[FeatureLoader] Feature ${featureId} not found - creating new feature`);
const newFeature = {
id: featureId,
title: featureId.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' '),
description: description || summary || '', // Use provided description, fall back to summary
category: category || "Uncategorized",
steps: steps || [],
status: status,
images: [],
imagePaths: [],
skipTests: false, // Auto-generated features should run tests by default
model: "sonnet",
thinkingLevel: "none",
summary: summary || description || '',
createdAt: new Date().toISOString(),
};
if (error !== undefined) {
newFeature.error = error;
}
await this.create(projectPath, newFeature);
console.log(
`[FeatureLoader] Created feature ${featureId}: status=${status}, category=${category || "Uncategorized"}, steps=${steps?.length || 0}${
summary ? `, summary="${summary}"` : ""
}`
);
return;
}
// Feature exists - update it
const updates = { status };
if (summary !== undefined) {
updates.summary = summary;
// Also update description if it's empty or not set
if (!existingFeature.description) {
updates.description = summary;
}
}
if (description !== undefined) {
updates.description = description;
}
if (category !== undefined) {
updates.category = category;
}
if (steps !== undefined && Array.isArray(steps)) {
updates.steps = steps;
}
if (error !== undefined) {
updates.error = error;
} else {
// Clear error if not provided
const feature = await this.get(projectPath, featureId);
if (feature && feature.error) {
if (existingFeature.error) {
updates.error = undefined;
}
}
// Ensure required fields exist (for features created before this fix)
if (!existingFeature.category && !updates.category) updates.category = "Uncategorized";
if (!existingFeature.steps && !updates.steps) updates.steps = [];
if (!existingFeature.images) updates.images = [];
if (!existingFeature.imagePaths) updates.imagePaths = [];
if (existingFeature.skipTests === undefined) updates.skipTests = false;
if (!existingFeature.model) updates.model = "sonnet";
if (!existingFeature.thinkingLevel) updates.thinkingLevel = "none";
await this.update(projectPath, featureId, updates);
console.log(
`[FeatureLoader] Updated feature ${featureId}: status=${status}${
category ? `, category="${category}"` : ""
}${steps ? `, steps=${steps.length}` : ""}${
summary ? `, summary="${summary}"` : ""
}`
);

View File

@@ -0,0 +1,379 @@
const { query, AbortError } = require("@anthropic-ai/claude-agent-sdk");
const promptBuilder = require("./prompt-builder");
/**
* Feature Suggestions Service - Analyzes project and generates feature suggestions
*/
class FeatureSuggestionsService {
constructor() {
this.runningAnalysis = null;
}
/**
* Generate feature suggestions by analyzing the project
* @param {string} projectPath - Path to the project
* @param {Function} sendToRenderer - Function to send events to renderer
* @param {Object} execution - Execution context with abort controller
* @param {string} suggestionType - Type of suggestions: "features", "refactoring", "security", "performance"
*/
async generateSuggestions(projectPath, sendToRenderer, execution, suggestionType = "features") {
console.log(
`[FeatureSuggestions] Generating ${suggestionType} suggestions for: ${projectPath}`
);
try {
const abortController = new AbortController();
execution.abortController = abortController;
const options = {
model: "claude-sonnet-4-20250514",
systemPrompt: this.getSystemPrompt(suggestionType),
maxTurns: 50,
cwd: projectPath,
allowedTools: ["Read", "Glob", "Grep", "Bash"],
permissionMode: "acceptEdits",
sandbox: {
enabled: true,
autoAllowBashIfSandboxed: true,
},
abortController: abortController,
};
const prompt = this.buildAnalysisPrompt(suggestionType);
sendToRenderer({
type: "suggestions_progress",
content: "Starting project analysis...\n",
});
const currentQuery = query({ prompt, options });
execution.query = currentQuery;
let fullResponse = "";
for await (const msg of currentQuery) {
if (!execution.isActive()) break;
if (msg.type === "assistant" && msg.message?.content) {
for (const block of msg.message.content) {
if (block.type === "text") {
fullResponse += block.text;
sendToRenderer({
type: "suggestions_progress",
content: block.text,
});
} else if (block.type === "tool_use") {
sendToRenderer({
type: "suggestions_tool",
tool: block.name,
input: block.input,
});
}
}
}
}
execution.query = null;
execution.abortController = null;
// Parse the suggestions from the response
const suggestions = this.parseSuggestions(fullResponse);
sendToRenderer({
type: "suggestions_complete",
suggestions: suggestions,
});
return {
success: true,
suggestions: suggestions,
};
} catch (error) {
if (error instanceof AbortError || error?.name === "AbortError") {
console.log("[FeatureSuggestions] Analysis aborted");
if (execution) {
execution.abortController = null;
execution.query = null;
}
return {
success: false,
message: "Analysis aborted",
suggestions: [],
};
}
console.error(
"[FeatureSuggestions] Error generating suggestions:",
error
);
if (execution) {
execution.abortController = null;
execution.query = null;
}
throw error;
}
}
/**
* Parse suggestions from the LLM response
* Looks for JSON array in the response
*/
parseSuggestions(response) {
try {
// Try to find JSON array in the response
// Look for ```json ... ``` blocks first
const jsonBlockMatch = response.match(/```json\s*([\s\S]*?)```/);
if (jsonBlockMatch) {
const parsed = JSON.parse(jsonBlockMatch[1].trim());
if (Array.isArray(parsed)) {
return this.validateSuggestions(parsed);
}
}
// Try to find a raw JSON array
const jsonArrayMatch = response.match(/\[\s*\{[\s\S]*\}\s*\]/);
if (jsonArrayMatch) {
const parsed = JSON.parse(jsonArrayMatch[0]);
if (Array.isArray(parsed)) {
return this.validateSuggestions(parsed);
}
}
console.warn(
"[FeatureSuggestions] Could not parse suggestions from response"
);
return [];
} catch (error) {
console.error("[FeatureSuggestions] Error parsing suggestions:", error);
return [];
}
}
/**
* Validate and normalize suggestions
*/
validateSuggestions(suggestions) {
return suggestions
.filter((s) => s && typeof s === "object")
.map((s, index) => ({
id: `suggestion-${Date.now()}-${index}`,
category: s.category || "Uncategorized",
description: s.description || s.title || "No description",
steps: Array.isArray(s.steps) ? s.steps : [],
priority: typeof s.priority === "number" ? s.priority : index + 1,
reasoning: s.reasoning || "",
}))
.sort((a, b) => a.priority - b.priority);
}
/**
* Get the system prompt for feature suggestion analysis
* @param {string} suggestionType - Type of suggestions: "features", "refactoring", "security", "performance"
*/
getSystemPrompt(suggestionType = "features") {
const basePrompt = `You are an expert software architect. Your job is to analyze a codebase and provide actionable suggestions.
You have access to file reading and search tools. Use them to understand the codebase.
When analyzing, look at:
- README files and documentation
- Package.json, cargo.toml, or similar config files for tech stack
- Source code structure and organization
- Existing code patterns and implementation styles`;
switch (suggestionType) {
case "refactoring":
return `${basePrompt}
Your specific focus is on **refactoring suggestions**. You should:
1. Identify code smells and areas that need cleanup
2. Find duplicated code that could be consolidated
3. Spot overly complex functions or classes that should be broken down
4. Look for inconsistent naming conventions or coding patterns
5. Find opportunities to improve code organization and modularity
6. Identify violations of SOLID principles or common design patterns
7. Look for dead code or unused dependencies
Prioritize suggestions by:
- Impact on maintainability
- Risk level (lower risk refactorings first)
- Complexity of the refactoring`;
case "security":
return `${basePrompt}
Your specific focus is on **security vulnerabilities and improvements**. You should:
1. Identify potential security vulnerabilities (OWASP Top 10)
2. Look for hardcoded secrets, API keys, or credentials
3. Check for proper input validation and sanitization
4. Identify SQL injection, XSS, or command injection risks
5. Review authentication and authorization patterns
6. Check for secure communication (HTTPS, encryption)
7. Look for insecure dependencies or outdated packages
8. Review error handling that might leak sensitive information
9. Check for proper session management
10. Identify insecure file handling or path traversal risks
Prioritize by severity:
- Critical: Exploitable vulnerabilities with high impact
- High: Security issues that could lead to data exposure
- Medium: Best practice violations that weaken security
- Low: Minor improvements to security posture`;
case "performance":
return `${basePrompt}
Your specific focus is on **performance issues and optimizations**. You should:
1. Identify N+1 query problems or inefficient database access
2. Look for unnecessary re-renders in React/frontend code
3. Find opportunities for caching or memoization
4. Identify large bundle sizes or unoptimized imports
5. Look for blocking operations that could be async
6. Find memory leaks or inefficient memory usage
7. Identify slow algorithms or data structure choices
8. Look for missing indexes in database schemas
9. Find opportunities for lazy loading or code splitting
10. Identify unnecessary network requests or API calls
Prioritize by:
- Impact on user experience
- Frequency of the slow path
- Ease of implementation`;
default: // "features"
return `${basePrompt}
Your specific focus is on **missing features and improvements**. You should:
1. Identify what the application does and what features it currently has
2. Look at the .automaker/app_spec.txt file if it exists
3. Generate a comprehensive list of missing features that would be valuable to users
4. Consider user experience improvements
5. Consider developer experience improvements
6. Look at common patterns in similar applications
Prioritize features by:
- Impact on users
- Alignment with project goals
- Complexity of implementation`;
}
}
/**
* Build the prompt for analyzing the project
* @param {string} suggestionType - Type of suggestions: "features", "refactoring", "security", "performance"
*/
buildAnalysisPrompt(suggestionType = "features") {
const commonIntro = `Analyze this project and generate a list of actionable suggestions.
**Your Task:**
1. First, explore the project structure:
- Read README.md, package.json, or similar config files
- Scan the source code directory structure
- Identify the tech stack and frameworks used
- Look at existing code and how it's implemented
2. Identify what the application does:
- What is the main purpose?
- What patterns and conventions are used?
`;
const commonOutput = `
**CRITICAL: Output your suggestions as a JSON array** at the end of your response, formatted like this:
\`\`\`json
[
{
"category": "Category Name",
"description": "Clear description of the suggestion",
"steps": [
"Step 1 to implement",
"Step 2 to implement",
"Step 3 to implement"
],
"priority": 1,
"reasoning": "Why this is important"
}
]
\`\`\`
**Important Guidelines:**
- Generate at least 10-15 suggestions
- Order them by priority (1 = highest priority)
- Each suggestion should have clear, actionable steps
- Be specific about what files might need to be modified
- Consider the existing tech stack and patterns
Begin by exploring the project structure.`;
switch (suggestionType) {
case "refactoring":
return `${commonIntro}
3. Look for refactoring opportunities:
- Find code duplication across the codebase
- Identify functions or classes that are too long or complex
- Look for inconsistent patterns or naming conventions
- Find tightly coupled code that should be decoupled
- Identify opportunities to extract reusable utilities
- Look for dead code or unused exports
- Check for proper separation of concerns
Categories to use: "Code Smell", "Duplication", "Complexity", "Architecture", "Naming", "Dead Code", "Coupling", "Testing"
${commonOutput}`;
case "security":
return `${commonIntro}
3. Look for security issues:
- Check for hardcoded secrets or API keys
- Look for potential injection vulnerabilities (SQL, XSS, command)
- Review authentication and authorization code
- Check input validation and sanitization
- Look for insecure dependencies
- Review error handling for information leakage
- Check for proper HTTPS/TLS usage
- Look for insecure file operations
Categories to use: "Critical", "High", "Medium", "Low" (based on severity)
${commonOutput}`;
case "performance":
return `${commonIntro}
3. Look for performance issues:
- Find N+1 queries or inefficient database access patterns
- Look for unnecessary re-renders in React components
- Identify missing memoization opportunities
- Check bundle size and import patterns
- Look for synchronous operations that could be async
- Find potential memory leaks
- Identify slow algorithms or data structures
- Look for missing caching opportunities
- Check for unnecessary network requests
Categories to use: "Database", "Rendering", "Memory", "Bundle Size", "Caching", "Algorithm", "Network"
${commonOutput}`;
default: // "features"
return `${commonIntro}
3. Generate feature suggestions:
- Think about what's missing compared to similar applications
- Consider user experience improvements
- Consider developer experience improvements
- Think about performance, security, and reliability
- Consider testing and documentation improvements
Categories to use: "User Experience", "Performance", "Security", "Testing", "Documentation", "Developer Experience", "Accessibility", etc.
${commonOutput}`;
}
}
/**
* Stop the current analysis
*/
stop() {
if (this.runningAnalysis && this.runningAnalysis.abortController) {
this.runningAnalysis.abortController.abort();
}
this.runningAnalysis = null;
}
}
module.exports = new FeatureSuggestionsService();

View File

@@ -0,0 +1,98 @@
const { createSdkMcpServer, tool } = require("@anthropic-ai/claude-agent-sdk");
const { z } = require("zod");
const featureLoader = require("./feature-loader");
/**
* MCP Server Factory - Creates custom MCP servers with tools
*/
class McpServerFactory {
/**
* Create a custom MCP server with the UpdateFeatureStatus tool
* This tool allows Claude Code to safely update feature status without
* directly modifying feature files, preventing race conditions
* and accidental state corruption.
*/
createFeatureToolsServer(updateFeatureStatusCallback, projectPath) {
return createSdkMcpServer({
name: "automaker-tools",
version: "1.0.0",
tools: [
tool(
"UpdateFeatureStatus",
"Create or update a feature. Use this tool to create new features with detailed information or update existing feature status. When creating features, provide comprehensive description, category, and implementation steps.",
{
featureId: z.string().describe("The ID of the feature (lowercase, hyphens for spaces). Example: 'user-authentication', 'budget-tracking'"),
status: z.enum(["backlog", "todo", "in_progress", "verified"]).describe("The status for the feature. Use 'backlog' or 'todo' for new features."),
summary: z.string().optional().describe("A brief summary of what was implemented/changed or what the feature does."),
description: z.string().optional().describe("A detailed description of the feature. Be comprehensive - explain what the feature does, its purpose, and key functionality."),
category: z.string().optional().describe("The category/phase for this feature. Example: 'Phase 1: Foundation', 'Phase 2: Core Logic', 'Phase 3: Polish', 'Authentication', 'UI/UX'"),
steps: z.array(z.string()).optional().describe("Array of implementation steps. Each step should be a clear, actionable task. Example: ['Set up database schema', 'Create API endpoints', 'Build UI components', 'Add validation']")
},
async (args) => {
try {
console.log(`[McpServerFactory] UpdateFeatureStatus tool called: featureId=${args.featureId}, status=${args.status}, summary=${args.summary || "(none)"}, category=${args.category || "(none)"}, steps=${args.steps?.length || 0}`);
console.log(`[Feature Creation] Creating/updating feature "${args.featureId}" with status "${args.status}"`);
// Load the feature to check skipTests flag
const features = await featureLoader.loadFeatures(projectPath);
const feature = features.find((f) => f.id === args.featureId);
if (!feature) {
console.log(`[Feature Creation] Feature ${args.featureId} not found - this might be a new feature being created`);
// This might be a new feature - try to proceed anyway
}
// If agent tries to mark as verified but feature has skipTests=true, convert to waiting_approval
let finalStatus = args.status;
// Convert 'todo' to 'backlog' for consistency, but only for new features
if (!feature && finalStatus === "todo") {
finalStatus = "backlog";
}
if (feature && args.status === "verified" && feature.skipTests === true) {
console.log(`[McpServerFactory] Feature ${args.featureId} has skipTests=true, converting verified -> waiting_approval`);
finalStatus = "waiting_approval";
}
// Call the provided callback to update feature status
await updateFeatureStatusCallback(
args.featureId,
finalStatus,
projectPath,
{
summary: args.summary,
description: args.description,
category: args.category,
steps: args.steps,
}
);
const statusMessage = finalStatus !== args.status
? `Successfully created/updated feature ${args.featureId} to status "${finalStatus}" (converted from "${args.status}")${args.summary ? ` - ${args.summary}` : ""}`
: `Successfully created/updated feature ${args.featureId} to status "${finalStatus}"${args.summary ? ` - ${args.summary}` : ""}`;
console.log(`[Feature Creation] ✓ ${statusMessage}`);
return {
content: [{
type: "text",
text: statusMessage
}]
};
} catch (error) {
console.error("[McpServerFactory] UpdateFeatureStatus tool error:", error);
console.error(`[Feature Creation] ✗ Failed to create/update feature ${args.featureId}: ${error.message}`);
return {
content: [{
type: "text",
text: `Failed to update feature status: ${error.message}`
}]
};
}
}
)
]
});
}
}
module.exports = new McpServerFactory();

View File

@@ -215,7 +215,7 @@ async function handleToolsCall(params, id) {
// Call the update callback via IPC or direct call
// Since we're in a separate process, we need to use IPC to communicate back
// For now, we'll call the feature loader directly since it has the update method
await featureLoader.updateFeatureStatus(featureId, finalStatus, projectPath, summary);
await featureLoader.updateFeatureStatus(featureId, finalStatus, projectPath, { summary });
const statusMessage = finalStatus !== status
? `Successfully updated feature ${featureId} to status "${finalStatus}" (converted from "${status}" because skipTests=true)${summary ? ` with summary: "${summary}"` : ''}`

View File

@@ -251,7 +251,7 @@ class ClaudeProvider extends ModelProvider {
async detectInstallation() {
const claudeCliDetector = require('./claude-cli-detector');
return claudeCliDetector.getInstallationInfo();
return claudeCliDetector.getFullStatus();
}
getAvailableModels() {

View File

@@ -52,11 +52,11 @@ ${memoryContent}
**Current Feature to Implement:**
ID: ${feature.id}
Category: ${feature.category}
Description: ${feature.description}
Category: ${feature.category || "Uncategorized"}
Description: ${feature.description || feature.summary || feature.title || "No description provided"}
${skipTestsNote}${imagesNote}${contextFilesPreview}
**Steps to Complete:**
${feature.steps.map((step, i) => `${i + 1}. ${step}`).join("\n")}
${(feature.steps || []).map((step, i) => `${i + 1}. ${step}`).join("\n") || "No specific steps provided - implement based on description"}
**Your Task:**
@@ -195,12 +195,12 @@ ${memoryContent}
**Feature to Implement/Verify:**
ID: ${feature.id}
Category: ${feature.category}
Description: ${feature.description}
Category: ${feature.category || "Uncategorized"}
Description: ${feature.description || feature.summary || feature.title || "No description provided"}
Current Status: ${feature.status}
${skipTestsNote}${imagesNote}${contextFilesPreview}
**Steps that should be implemented:**
${feature.steps.map((step, i) => `${i + 1}. ${step}`).join("\n")}
${(feature.steps || []).map((step, i) => `${i + 1}. ${step}`).join("\n") || "No specific steps provided - implement based on description"}
**Your Task:**
@@ -335,11 +335,11 @@ ${memoryContent}
**Current Feature:**
ID: ${feature.id}
Category: ${feature.category}
Description: ${feature.description}
Category: ${feature.category || "Uncategorized"}
Description: ${feature.description || feature.summary || feature.title || "No description provided"}
${skipTestsNote}${imagesNote}${contextFilesPreview}
**Steps to Complete:**
${feature.steps.map((step, i) => `${i + 1}. ${step}`).join("\n")}
${(feature.steps || []).map((step, i) => `${i + 1}. ${step}`).join("\n") || "No specific steps provided - implement based on description"}
**Previous Work Context:**

View File

@@ -0,0 +1,84 @@
const os = require("os");
// Prefer prebuilt to avoid native build issues.
const pty = require("@homebridge/node-pty-prebuilt-multiarch");
/**
* Minimal PTY helper to run CLI commands with a pseudo-terminal.
* Useful for CLIs (like Claude) that need raw mode on Windows.
*
* @param {string} command Executable path
* @param {string[]} args Arguments for the executable
* @param {Object} options Additional spawn options
* @param {(chunk: string) => void} [options.onData] Data callback
* @param {string} [options.cwd] Working directory
* @param {Object} [options.env] Extra env vars
* @param {number} [options.cols] Terminal columns
* @param {number} [options.rows] Terminal rows
* @returns {Promise<{ success: boolean, exitCode: number, signal?: number, output: string, errorOutput: string }>}
*/
function runPtyCommand(command, args = [], options = {}) {
const {
onData,
cwd = process.cwd(),
env = {},
cols = 120,
rows = 30,
} = options;
const mergedEnv = {
...process.env,
TERM: process.env.TERM || "xterm-256color",
...env,
};
return new Promise((resolve, reject) => {
let ptyProcess;
try {
ptyProcess = pty.spawn(command, args, {
name: os.platform() === "win32" ? "Windows.Terminal" : "xterm-color",
cols,
rows,
cwd,
env: mergedEnv,
useConpty: true,
});
} catch (error) {
return reject(error);
}
let output = "";
let errorOutput = "";
ptyProcess.onData((data) => {
output += data;
if (typeof onData === "function") {
onData(data);
}
});
// node-pty does not emit 'error' in practice, but guard anyway
if (ptyProcess.on) {
ptyProcess.on("error", (err) => {
errorOutput += err?.message || "";
reject(err);
});
}
ptyProcess.onExit(({ exitCode, signal }) => {
resolve({
success: exitCode === 0,
exitCode,
signal,
output,
errorOutput,
});
});
});
}
module.exports = {
runPtyCommand,
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,16 @@
{
"name": "automaker",
"name": "@automaker/app",
"version": "0.1.0",
"description": "An autonomous AI development studio that helps you build software faster using AI-powered agents",
"homepage": "https://github.com/AutoMaker-Org/automaker",
"repository": {
"type": "git",
"url": "https://github.com/AutoMaker-Org/automaker.git"
},
"author": {
"name": "Cody Seibert",
"email": "webdevcody@gmail.com"
},
"private": true,
"license": "Unlicense",
"main": "electron/main.js",
@@ -8,18 +18,22 @@
"dev": "next dev -p 3007",
"dev:web": "next dev -p 3007",
"dev:electron": "concurrently \"next dev -p 3007\" \"wait-on http://localhost:3007 && electron .\"",
"dev:electron:debug": "concurrently \"next dev -p 3007\" \"wait-on http://localhost:3007 && OPEN_DEVTOOLS=true electron .\"",
"build": "next build",
"build:electron": "next build && electron-builder",
"start": "next start",
"lint": "eslint",
"test": "playwright test",
"test:headed": "playwright test --headed"
"test:headed": "playwright test --headed",
"dev:electron:wsl": "concurrently \"next dev -p 3007\" \"wait-on http://localhost:3007 && electron . --no-sandbox --disable-gpu\"",
"dev:electron:wsl:gpu": "concurrently \"next dev -p 3007\" \"wait-on http://localhost:3007 && MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA electron . --no-sandbox --disable-gpu-sandbox\""
},
"dependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.1.61",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@homebridge/node-pty-prebuilt-multiarch": "^0.13.1",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
@@ -34,6 +48,7 @@
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"dotenv": "^17.2.3",
"geist": "^1.5.1",
"lucide-react": "^0.556.0",
"next": "16.0.7",
"react": "19.2.0",
@@ -44,6 +59,7 @@
"zustand": "^5.0.9"
},
"devDependencies": {
"@electron/rebuild": "^4.0.2",
"@playwright/test": "^1.57.0",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
@@ -62,6 +78,7 @@
"build": {
"appId": "com.automaker.app",
"productName": "Automaker",
"artifactName": "${productName}-${version}-${arch}.${ext}",
"directories": {
"output": "dist"
},
@@ -99,7 +116,7 @@
]
}
],
"icon": "public/logo.png"
"icon": "public/logo_larger.png"
},
"win": {
"target": [
@@ -110,7 +127,7 @@
]
}
],
"icon": "public/logo.png"
"icon": "public/logo_larger.png"
},
"linux": {
"target": [
@@ -128,7 +145,9 @@
}
],
"category": "Development",
"icon": "public/logo.png"
"icon": "public/logo_larger.png",
"maintainer": "webdevcody@gmail.com",
"executableName": "automaker"
},
"nsis": {
"oneClick": false,

View File

Before

Width:  |  Height:  |  Size: 391 B

After

Width:  |  Height:  |  Size: 391 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View File

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 128 B

View File

Before

Width:  |  Height:  |  Size: 385 B

After

Width:  |  Height:  |  Size: 385 B

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -1,18 +1,8 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import { GeistSans } from "geist/font/sans";
import { GeistMono } from "geist/font/mono";
import { Toaster } from "sonner";
import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "Automaker - Autonomous AI Development Studio",
description: "Build software autonomously with intelligent orchestration",
@@ -26,7 +16,7 @@ export default function RootLayout({
return (
<html lang="en" suppressHydrationWarning>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
className={`${GeistSans.variable} ${GeistMono.variable} antialiased`}
>
{children}
<Toaster richColors position="bottom-right" />

View File

@@ -12,6 +12,7 @@ import { InterviewView } from "@/components/views/interview-view";
import { ContextView } from "@/components/views/context-view";
import { ProfilesView } from "@/components/views/profiles-view";
import { SetupView } from "@/components/views/setup-view";
import { RunningAgentsView } from "@/components/views/running-agents-view";
import { useAppStore } from "@/store/app-store";
import { useSetupStore } from "@/store/setup-store";
import { getElectronAPI, isElectron } from "@/lib/electron";
@@ -178,6 +179,8 @@ export default function Home() {
return <ContextView />;
case "profiles":
return <ProfilesView />;
case "running-agents":
return <RunningAgentsView />;
default:
return <WelcomeView />;
}

View File

@@ -40,6 +40,8 @@ import {
Radio,
Monitor,
Search,
Bug,
Activity,
} from "lucide-react";
import {
DropdownMenu,
@@ -394,7 +396,8 @@ export function Sidebar() {
if (!result.canceled && result.filePaths[0]) {
const path = result.filePaths[0];
// Extract folder name from path (works on both Windows and Mac/Linux)
const name = path.split(/[/\\]/).filter(Boolean).pop() || "Untitled Project";
const name =
path.split(/[/\\]/).filter(Boolean).pop() || "Untitled Project";
try {
// Check if this is a brand new project (no .automaker directory)
@@ -572,7 +575,10 @@ export function Sidebar() {
// Handle selecting the currently highlighted project
const selectHighlightedProject = useCallback(() => {
if (filteredProjects.length > 0 && selectedProjectIndex < filteredProjects.length) {
if (
filteredProjects.length > 0 &&
selectedProjectIndex < filteredProjects.length
) {
setCurrentProject(filteredProjects[selectedProjectIndex]);
setIsProjectPickerOpen(false);
}
@@ -596,7 +602,11 @@ export function Sidebar() {
} else if (event.key === "ArrowUp") {
event.preventDefault();
setSelectedProjectIndex((prev) => (prev > 0 ? prev - 1 : prev));
} else if (event.key.toLowerCase() === "p" && !event.metaKey && !event.ctrlKey) {
} else if (
event.key.toLowerCase() === "p" &&
!event.metaKey &&
!event.ctrlKey
) {
// Toggle off when P is pressed (not with modifiers) while dropdown is open
// Only if not typing in the search input
if (document.activeElement !== projectSearchInputRef.current) {
@@ -732,12 +742,15 @@ export function Sidebar() {
{/* Logo */}
<div
className={cn(
"h-20 pt-8 flex items-center justify-center border-b border-sidebar-border shrink-0 titlebar-drag-region",
sidebarOpen ? "px-3 lg:px-6" : "px-3"
"h-20 border-b border-sidebar-border shrink-0 titlebar-drag-region",
sidebarOpen ? "pt-8 px-3 lg:px-6 flex items-center justify-between" : "pt-2 pb-2 px-3 flex flex-col items-center justify-center gap-2"
)}
>
<div
className="flex items-center titlebar-no-drag cursor-pointer"
className={cn(
"flex items-center titlebar-no-drag cursor-pointer",
!sidebarOpen && "flex-col gap-1"
)}
onClick={() => setCurrentView("welcome")}
data-testid="logo-button"
>
@@ -757,6 +770,18 @@ export function Sidebar() {
Auto<span className="text-brand-500">maker</span>
</span>
</div>
{/* Bug Report Button */}
<button
onClick={() => {
const api = getElectronAPI();
api.openExternalLink("https://github.com/AutoMaker-Org/automaker/issues");
}}
className="titlebar-no-drag p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-sidebar-accent/50 transition-all"
title="Report Bug / Feature Request"
data-testid="bug-report-link"
>
<Bug className="w-4 h-4" />
</button>
</div>
{/* Project Actions - Moved above project selector */}
@@ -913,7 +938,10 @@ export function Sidebar() {
</span>
)}
</DropdownMenuSubTrigger>
<DropdownMenuSubContent className="w-48" data-testid="project-theme-menu">
<DropdownMenuSubContent
className="w-48"
data-testid="project-theme-menu"
>
<DropdownMenuLabel className="text-xs text-muted-foreground">
Select theme for this project
</DropdownMenuLabel>
@@ -922,7 +950,10 @@ export function Sidebar() {
value={currentProject.theme || ""}
onValueChange={(value) => {
if (currentProject) {
setProjectTheme(currentProject.id, value === "" ? null : value as any);
setProjectTheme(
currentProject.id,
value === "" ? null : (value as any)
);
}
}}
>
@@ -932,7 +963,9 @@ export function Sidebar() {
<DropdownMenuRadioItem
key={option.value}
value={option.value}
data-testid={`project-theme-${option.value || 'global'}`}
data-testid={`project-theme-${
option.value || "global"
}`}
>
<Icon className="w-4 h-4 mr-2" />
<span>{option.label}</span>
@@ -955,21 +988,30 @@ export function Sidebar() {
<DropdownMenuLabel className="text-xs text-muted-foreground">
Project History
</DropdownMenuLabel>
<DropdownMenuItem onClick={cyclePrevProject} data-testid="cycle-prev-project">
<DropdownMenuItem
onClick={cyclePrevProject}
data-testid="cycle-prev-project"
>
<Undo2 className="w-4 h-4 mr-2" />
<span className="flex-1">Previous</span>
<span className="text-[10px] font-mono text-muted-foreground ml-2">
{formatShortcut(shortcuts.cyclePrevProject, true)}
</span>
</DropdownMenuItem>
<DropdownMenuItem onClick={cycleNextProject} data-testid="cycle-next-project">
<DropdownMenuItem
onClick={cycleNextProject}
data-testid="cycle-next-project"
>
<Redo2 className="w-4 h-4 mr-2" />
<span className="flex-1">Next</span>
<span className="text-[10px] font-mono text-muted-foreground ml-2">
{formatShortcut(shortcuts.cycleNextProject, true)}
</span>
</DropdownMenuItem>
<DropdownMenuItem onClick={clearProjectHistory} data-testid="clear-project-history">
<DropdownMenuItem
onClick={clearProjectHistory}
data-testid="clear-project-history"
>
<RotateCcw className="w-4 h-4 mr-2" />
<span>Clear history</span>
</DropdownMenuItem>
@@ -1078,8 +1120,48 @@ export function Sidebar() {
</nav>
</div>
{/* Bottom Section - User / Settings */}
{/* Bottom Section - Running Agents / Bug Report / Settings */}
<div className="border-t border-sidebar-border bg-sidebar-accent/10 shrink-0">
{/* Running Agents Link */}
<div className="p-2 pb-0">
<button
onClick={() => setCurrentView("running-agents")}
className={cn(
"group flex items-center w-full px-2 lg:px-3 py-2.5 rounded-lg relative overflow-hidden transition-all titlebar-no-drag",
isActiveRoute("running-agents")
? "bg-sidebar-accent/50 text-foreground border border-sidebar-border"
: "text-muted-foreground hover:text-foreground hover:bg-sidebar-accent/50",
sidebarOpen ? "justify-start" : "justify-center"
)}
title={!sidebarOpen ? "Running Agents" : undefined}
data-testid="running-agents-link"
>
{isActiveRoute("running-agents") && (
<div className="absolute inset-y-0 left-0 w-0.5 bg-brand-500 rounded-l-md"></div>
)}
<Activity
className={cn(
"w-4 h-4 shrink-0 transition-colors",
isActiveRoute("running-agents")
? "text-brand-500"
: "group-hover:text-brand-400"
)}
/>
<span
className={cn(
"ml-2.5 font-medium text-sm flex-1 text-left",
sidebarOpen ? "hidden lg:block" : "hidden"
)}
>
Running Agents
</span>
{!sidebarOpen && (
<span className="absolute left-full ml-2 px-2 py-1 bg-popover text-popover-foreground text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap z-50 border border-border">
Running Agents
</span>
)}
</button>
</div>
{/* Settings Link */}
<div className="p-2">
<button
@@ -1272,8 +1354,8 @@ export function Sidebar() {
Generate feature list
</label>
<p className="text-xs text-muted-foreground">
Automatically create features in the features folder
from the implementation roadmap after the spec is generated.
Automatically create features in the features folder from the
implementation roadmap after the spec is generated.
</p>
</div>
</div>

View File

@@ -82,7 +82,7 @@ function DialogContent({
data-slot="dialog-close"
className={cn(
"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute rounded-xs opacity-70 transition-opacity cursor-pointer hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
compact ? "top-2 right-2" : "top-4 right-4"
compact ? "top-2 right-3" : "top-3 right-5"
)}
>
<XIcon />

View File

@@ -56,7 +56,10 @@ function parseHotkeyConfig(hotkey: string | HotkeyConfig): HotkeyConfig {
/**
* Generate the display label for the hotkey
*/
function getHotkeyDisplayLabel(config: HotkeyConfig, isMac: boolean): React.ReactNode {
function getHotkeyDisplayLabel(
config: HotkeyConfig,
isMac: boolean
): React.ReactNode {
if (config.label) {
return config.label;
}
@@ -73,7 +76,10 @@ function getHotkeyDisplayLabel(config: HotkeyConfig, isMac: boolean): React.Reac
if (config.shift) {
parts.push(
<span key="shift" className="leading-none flex items-center justify-center">
<span
key="shift"
className="leading-none flex items-center justify-center"
>
</span>
);
@@ -134,11 +140,7 @@ function getHotkeyDisplayLabel(config: HotkeyConfig, isMac: boolean): React.Reac
</span>
);
return (
<span className="inline-flex items-center gap-1.5">
{parts}
</span>
);
return <span className="inline-flex items-center gap-1.5">{parts}</span>;
}
/**
@@ -205,7 +207,11 @@ export function HotkeyButton({
// Don't trigger when typing in inputs (unless explicitly scoped or using cmdCtrl modifier)
// cmdCtrl shortcuts like Cmd+Enter should work even in inputs as they're intentional submit actions
if (!scopeRef && !config.cmdCtrl && isInputElement(document.activeElement)) {
if (
!scopeRef &&
!config.cmdCtrl &&
isInputElement(document.activeElement)
) {
return;
}
@@ -228,7 +234,8 @@ export function HotkeyButton({
// If scoped, check that the scope element is visible
if (scopeRef && scopeRef.current) {
const scopeEl = scopeRef.current;
const isVisible = scopeEl.offsetParent !== null ||
const isVisible =
scopeEl.offsetParent !== null ||
getComputedStyle(scopeEl).display !== "none";
if (!isVisible) return;
}
@@ -259,14 +266,15 @@ export function HotkeyButton({
}, [config, hotkeyActive, handleKeyDown]);
// Render the hotkey indicator
const hotkeyIndicator = config && showHotkeyIndicator ? (
<span
className="ml-3 px-2 py-0.5 text-[10px] font-mono rounded bg-primary-foreground/10 border border-primary-foreground/20 inline-flex items-center gap-1.5"
data-testid="hotkey-indicator"
>
{getHotkeyDisplayLabel(config, isMac)}
</span>
) : null;
const hotkeyIndicator =
config && showHotkeyIndicator ? (
<span
className="px-2 py-0.5 text-[10px] font-mono rounded bg-primary-foreground/10 border border-primary-foreground/20 inline-flex items-center gap-1.5"
data-testid="hotkey-indicator"
>
{getHotkeyDisplayLabel(config, isMac)}
</span>
) : null;
return (
<Button

View File

@@ -208,7 +208,19 @@ export function LogViewer({ output, className }: LogViewerProps) {
};
if (entries.length === 0) {
return null;
return (
<div className="flex items-center justify-center p-8 text-muted-foreground">
<div className="text-center">
<Info className="w-8 h-8 mx-auto mb-2 opacity-50" />
<p className="text-sm">No log entries yet. Logs will appear here as the process runs.</p>
{output && output.trim() && (
<div className="mt-4 p-3 bg-zinc-900/50 rounded text-xs font-mono text-left max-h-40 overflow-auto">
<pre className="whitespace-pre-wrap">{output}</pre>
</div>
)}
</div>
</div>
);
}
// Count entries by type

Some files were not shown because too many files have changed in this diff Show More