Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bb5c744613 | |||
| 03e6e84333 | |||
| 146e32a1e4 | |||
| e8b53d5a93 | |||
| c7d571fc4a | |||
| 2f9aa64b55 | |||
| 982c5e6063 | |||
| cfeb15726e | |||
| 92998dedd6 |
Binary file not shown.
|
After Width: | Height: | Size: 3.0 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 834 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.7 MiB |
@@ -0,0 +1,23 @@
|
||||
name: Discord Release Notification
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
discord-notification:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Send to Discord
|
||||
uses: SethCohen/github-releases-to-discord@v1
|
||||
with:
|
||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||
color: "5865F2"
|
||||
username: "Auto Claude Releases"
|
||||
avatar_url: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
|
||||
footer_title: "Auto Claude Changelog"
|
||||
footer_timestamp: true
|
||||
reduce_headings: true
|
||||
+3
-1
@@ -74,4 +74,6 @@ dmypy.json
|
||||
# Development of Auto Build with Auto Build
|
||||
dev/
|
||||
|
||||
.auto-claude/
|
||||
.auto-claude/
|
||||
|
||||
/docs
|
||||
@@ -1,3 +1,35 @@
|
||||
## What's New in v2.0.0
|
||||
|
||||
### New Features
|
||||
- **Task Integration**: Connected ideas to tasks with "Go to Task" functionality across the UI
|
||||
- **File Explorer Panel**: Implemented file explorer panel with directory listing capabilities
|
||||
- **Terminal Task Selection**: Added task selection dropdown in terminal with auto-context loading
|
||||
- **Task Archiving**: Introduced task archiving functionality
|
||||
- **Graphiti MCP Server Integration**: Added support for Graphiti memory integration
|
||||
- **Roadmap Functionality**: New roadmap visualization and management features
|
||||
|
||||
### Improvements
|
||||
- **File Tree Virtualization**: Refactored FileTree component to use efficient virtualization for improved performance with large file structures
|
||||
- **Agent Parallelization**: Improved Claude Code agent decision-making for parallel task execution
|
||||
- **Terminal Experience**: Enhanced terminal with task features and visual feedback for better user experience
|
||||
- **Python Environment Detection**: Auto-detect Python environment readiness before task execution
|
||||
- **Version System**: Cleaner version management system
|
||||
- **Project Initialization**: Simpler project initialization process
|
||||
|
||||
### Bug Fixes
|
||||
- Fixed project settings bug
|
||||
- Fixed insight UI sidebar
|
||||
- Resolved Kanban and terminal integration issues
|
||||
|
||||
### Changed
|
||||
- Updated project-store.ts to use proper Dirent type for specDirs variable
|
||||
- Refactored codebase for better code quality
|
||||
- Removed worktree-worker logic in favor of Claude Code's internal agent system
|
||||
- Removed obsolete security configuration file (.auto-claude-security.json)
|
||||
|
||||
### Documentation
|
||||
- Added CONTRIBUTING.md with development guidelines
|
||||
|
||||
## What's New in v1.1.0
|
||||
|
||||
### New Features
|
||||
|
||||
@@ -1,49 +1,72 @@
|
||||
# Auto Claude
|
||||
# Auto Claude 🤖
|
||||
|
||||
A production-ready framework for autonomous multi-session AI coding. Build complete applications or add features to existing projects through coordinated AI agent sessions.
|
||||
|
||||
## What It Does
|
||||

|
||||
|
||||
Auto Claude uses a **multi-agent pattern** to build software autonomously:
|
||||
## What It Does ✨
|
||||
|
||||
### Spec Creation Pipeline (8 phases)
|
||||
1. **Discovery** - Analyzes project structure
|
||||
2. **Requirements Gatherer** - Collects user requirements interactively
|
||||
3. **Research Agent** - Validates external integrations against documentation
|
||||
4. **Context Discovery** - Finds relevant files in codebase
|
||||
5. **Spec Writer** - Creates comprehensive spec.md
|
||||
6. **Spec Critic** - Uses ultrathink to find and fix issues before implementation
|
||||
7. **Planner** - Creates chunk-based implementation plan
|
||||
8. **Validation** - Ensures all outputs are valid
|
||||
**Auto Claude runs AI coding agents in parallel while you work on other things.** Whether you're a vibe coder just getting started or an experienced developer, Auto Claude meets you where you are. Describe what you want to build, and Auto Claude handles the rest — from understanding your codebase, to writing the code, to validating it actually works.
|
||||
|
||||
### Implementation Pipeline
|
||||
1. **Planner Agent** (Session 1) - Analyzes spec, creates chunk-based implementation plan
|
||||
2. **Coder Agent** (Sessions 2+) - Implements chunks one-by-one with verification
|
||||
3. **QA Reviewer Agent** - Validates all acceptance criteria before sign-off
|
||||
4. **QA Fixer Agent** - Fixes issues found by QA in a self-validating loop
|
||||
Think of it as having a team of AI developers that:
|
||||
- **Work autonomously** — no babysitting required
|
||||
- **Run in parallel** — multiple features built simultaneously
|
||||
- **Self-validate** — QA agents check their own work before you see it
|
||||
- **Stay safe** — isolated workspaces mean your code is never touched until you approve
|
||||
|
||||
Each session runs with a fresh context window. Progress is tracked via `implementation_plan.json` and Git commits.
|
||||
**The result?** 10x your output while maintaining code quality.
|
||||
|
||||
## Quick Start
|
||||
## Key Features
|
||||
|
||||
- **Parallel Agents**: Run multiple builds simultaneously while you focus on other work
|
||||
- **Context Engineering**: Agents understand your codebase structure before writing code
|
||||
- **Self-Validating**: Built-in QA loop catches issues before you review
|
||||
- **Isolated Workspaces**: All work happens in git worktrees — your code stays safe
|
||||
- **Memory Layer**: Agents remember insights across sessions for smarter decisions
|
||||
- **Cross-Platform**: Desktop app runs on Mac, Windows, and Linux
|
||||
- **Any Project Type**: Build web apps, APIs, CLIs — works with any software project
|
||||
- **Human Control**: Pause, guide, or stop agents at any time
|
||||
|
||||
## 🚀 Quick Start (Desktop UI)
|
||||
|
||||
The Desktop UI is the recommended way to use Auto Claude. It provides visual task management, real-time progress tracking, and a Kanban board interface.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Python 3.8+
|
||||
- Claude Code CLI (`npm install -g @anthropic-ai/claude-code`)
|
||||
1. **Node.js 18+** - [Download Node.js](https://nodejs.org/)
|
||||
2. **Python 3.9+** - [Download Python](https://www.python.org/downloads/)
|
||||
3. **Docker Desktop** - Required for the Memory Layer
|
||||
4. **Claude Code CLI** - `npm install -g @anthropic-ai/claude-code`
|
||||
5. **Claude Subscription** - Requires [Claude Pro or Max](https://claude.ai/upgrade) for Claude Code access
|
||||
|
||||
### Setup
|
||||
---
|
||||
|
||||
**Step 1:** Copy the `auto-claude` folder into your project
|
||||
### Installing Docker Desktop
|
||||
|
||||
Docker runs the FalkorDB database that powers Auto Claude's cross-session memory.
|
||||
|
||||
| Operating System | Download Link |
|
||||
|------------------|---------------|
|
||||
| **Mac (Apple Silicon M1/M2/M3/M4)** | [Download for Apple Chip](https://desktop.docker.com/mac/main/arm64/Docker.dmg) |
|
||||
| **Mac (Intel)** | [Download for Intel Chip](https://desktop.docker.com/mac/main/amd64/Docker.dmg) |
|
||||
| **Windows** | [Download for Windows](https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe) |
|
||||
| **Linux** | [Installation Guide](https://docs.docker.com/desktop/install/linux-install/) |
|
||||
|
||||
> **Not sure which Mac?** Click the Apple menu (🍎) → "About This Mac". Look for "Chip" - M1/M2/M3/M4 = Apple Silicon, otherwise Intel.
|
||||
|
||||
**After installing:** Open Docker Desktop and wait for the whale icon (🐳) to appear in your menu bar/system tray.
|
||||
|
||||
> **Using the Desktop UI?** It automatically detects Docker status and offers one-click FalkorDB setup. No terminal commands needed!
|
||||
|
||||
📚 **For detailed installation steps, troubleshooting, and advanced configuration, see [guides/DOCKER-SETUP.md](guides/DOCKER-SETUP.md)**
|
||||
|
||||
---
|
||||
|
||||
### Step 1: Set Up the Python Backend
|
||||
|
||||
The Desktop UI runs Python scripts behind the scenes. Set up the Python environment:
|
||||
|
||||
```bash
|
||||
# Copy the auto-claude folder to your project root
|
||||
cp -r auto-claude /path/to/your/project/
|
||||
```
|
||||
|
||||
**Step 2:** Set up Python environment
|
||||
|
||||
```bash
|
||||
cd your-project
|
||||
cd auto-claude
|
||||
|
||||
# Using uv (recommended)
|
||||
@@ -53,373 +76,187 @@ uv venv && uv pip install -r requirements.txt
|
||||
python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt
|
||||
```
|
||||
|
||||
**Step 3:** Configure environment
|
||||
### Step 2: Start the Memory Layer
|
||||
|
||||
The Auto Claude Memory Layer provides cross-session context retention using a graph database:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
|
||||
# Get your OAuth token
|
||||
claude setup-token
|
||||
|
||||
# Add the token to .env
|
||||
# CLAUDE_CODE_OAUTH_TOKEN=your-token-here
|
||||
# Make sure Docker Desktop is running, then:
|
||||
docker-compose up -d falkordb
|
||||
```
|
||||
|
||||
**Step 4:** Create a spec using the orchestrator
|
||||
### Step 3: Install and Launch the Desktop UI
|
||||
|
||||
```bash
|
||||
# Activate the virtual environment
|
||||
source auto-claude/.venv/bin/activate
|
||||
cd auto-claude-ui
|
||||
|
||||
# Create a spec interactively
|
||||
python auto-claude/spec_runner.py --interactive
|
||||
# Install dependencies (pnpm recommended, npm works too)
|
||||
pnpm install
|
||||
# or: npm install
|
||||
|
||||
# Or with a task description
|
||||
python auto-claude/spec_runner.py --task "Add user authentication with OAuth"
|
||||
# Build and start the application
|
||||
pnpm run build && pnpm run start
|
||||
# or: npm run build && npm run start
|
||||
```
|
||||
|
||||
The spec orchestrator will:
|
||||
1. Analyze your project structure
|
||||
2. Gather requirements interactively
|
||||
3. **Research external integrations** against documentation
|
||||
4. Discover relevant codebase context
|
||||
5. Write the specification
|
||||
6. **Self-critique using ultrathink** to find and fix issues
|
||||
7. Generate an implementation plan
|
||||
8. Validate all outputs
|
||||
### Step 4: Start Building
|
||||
|
||||
**Step 5:** Run the autonomous build
|
||||
1. Add your project in the UI
|
||||
2. Create a new task describing what you want to build
|
||||
3. Watch as Auto Claude creates a spec, plans, and implements your feature
|
||||
4. Review changes and merge when satisfied
|
||||
|
||||
```bash
|
||||
python auto-claude/run.py --spec 001
|
||||
```
|
||||
---
|
||||
|
||||
### Managing Specs
|
||||
## 🎯 Features
|
||||
|
||||
```bash
|
||||
# List all specs and their status
|
||||
python auto-claude/run.py --list
|
||||
### Kanban Board
|
||||
|
||||
# Run a specific spec
|
||||
python auto-claude/run.py --spec 001
|
||||
python auto-claude/run.py --spec 001-feature-name
|
||||
Plan tasks and let AI handle the planning, coding, and validation — all in a visual interface. Track progress from "Planning" to "Done" while agents work autonomously.
|
||||
|
||||
# Run with parallel workers (2-3x speedup for independent phases)
|
||||
python auto-claude/run.py --spec 001 --parallel 2
|
||||
python auto-claude/run.py --spec 001 --parallel 3
|
||||
### Agent Terminals
|
||||
|
||||
# Limit iterations for testing
|
||||
python auto-claude/run.py --spec 001 --max-iterations 5
|
||||
```
|
||||
Spawn up to 12 AI-powered terminals for hands-on coding. Inject task context with a click, reference files from your project, and work rapidly across multiple sessions.
|
||||
|
||||
### QA Validation
|
||||
**Power users:** Connect multiple Claude Code subscriptions to run even more agents in parallel — perfect for teams or heavy workloads.
|
||||
|
||||
After all chunks are complete, QA validation runs automatically:
|
||||

|
||||
|
||||
```bash
|
||||
# QA runs automatically after build completes
|
||||
# To skip automatic QA:
|
||||
python auto-claude/run.py --spec 001 --skip-qa
|
||||
### Insights
|
||||
|
||||
# Run QA validation manually on a completed build
|
||||
python auto-claude/run.py --spec 001 --qa
|
||||
Have a conversation about your project in a ChatGPT-style interface. Ask questions, get explanations, and explore your codebase through natural dialogue.
|
||||
|
||||
# Check QA status
|
||||
python auto-claude/run.py --spec 001 --qa-status
|
||||
```
|
||||
### Roadmap
|
||||
|
||||
The QA validation loop:
|
||||
1. **QA Reviewer** checks all acceptance criteria (unit tests, integration tests, E2E, browser verification, database migrations)
|
||||
2. If issues found → creates `QA_FIX_REQUEST.md`
|
||||
3. **QA Fixer** applies fixes
|
||||
4. Loop repeats until approved (up to 50 iterations)
|
||||
5. Final sign-off recorded in `implementation_plan.json`
|
||||
Based on your target audience, AI anticipates and plans the most impactful features you should focus on. Prioritize what matters most to your users.
|
||||
|
||||
### Spec Creation Pipeline (Dynamic Complexity)
|
||||

|
||||
|
||||
The `spec_runner.py` orchestrator **automatically assesses task complexity** and adapts the number of phases accordingly:
|
||||
### Ideation
|
||||
|
||||
```bash
|
||||
# Simple task (auto-detected) - runs 3 phases
|
||||
python auto-claude/spec_runner.py --task "Fix button color in Header"
|
||||
Let AI help you create a project that shines. Rapidly understand your codebase and discover:
|
||||
- Code improvements and refactoring opportunities
|
||||
- Performance bottlenecks
|
||||
- Security vulnerabilities
|
||||
- Documentation gaps
|
||||
- UI/UX enhancements
|
||||
- Overall code quality issues
|
||||
|
||||
# Complex task (auto-detected) - runs 8 phases
|
||||
python auto-claude/spec_runner.py --task "Add Graphiti memory integration with FalkorDB"
|
||||
### Changelog
|
||||
|
||||
# Force a specific complexity level
|
||||
python auto-claude/spec_runner.py --task "Update text" --complexity simple
|
||||
Write professional changelogs effortlessly. Generate release notes from completed Auto Claude tasks or integrate with GitHub to create masterclass changelogs automatically.
|
||||
|
||||
# Interactive mode
|
||||
python auto-claude/spec_runner.py --interactive
|
||||
### Context
|
||||
|
||||
# Continue an interrupted spec
|
||||
python auto-claude/spec_runner.py --continue 001-feature
|
||||
```
|
||||
See exactly what Auto Claude understands about your project — the tech stack, file structure, patterns, and insights it uses to write better code.
|
||||
|
||||
**Complexity Tiers:**
|
||||
---
|
||||
|
||||
| Tier | Phases | When Used |
|
||||
|------|--------|-----------|
|
||||
| **SIMPLE** | 3 | 1-2 files, single service, no integrations (UI fixes, text changes) |
|
||||
| **STANDARD** | 6 | 3-10 files, 1-2 services, minimal integrations (features, bug fixes) |
|
||||
| **COMPLEX** | 8 | 10+ files, multiple services, external integrations (integrations, migrations) |
|
||||
## CLI Usage (Terminal-Only)
|
||||
|
||||
**Phase Matrix:**
|
||||
For terminal-based workflows, headless servers, or CI/CD integration, see **[guides/CLI-USAGE.md](guides/CLI-USAGE.md)**.
|
||||
|
||||
| Phase | Simple | Standard | Complex |
|
||||
|-------|--------|----------|---------|
|
||||
| Discovery | ✓ | ✓ | ✓ |
|
||||
| Requirements | - | ✓ | ✓ |
|
||||
| **Research** | - | - | ✓ |
|
||||
| Context | - | ✓ | ✓ |
|
||||
| Spec Writing | Quick | Full | Full |
|
||||
| **Self-Critique** | - | - | ✓ |
|
||||
| Planning | Auto | ✓ | ✓ |
|
||||
| Validation | ✓ | ✓ | ✓ |
|
||||
## ⚙️ How It Works
|
||||
|
||||
**Complexity Detection Signals:**
|
||||
- Keywords: "fix", "typo", "color" → Simple | "integrate", "migrate", "oauth" → Complex
|
||||
- External integrations detected (redis, postgres, graphiti, etc.)
|
||||
- Number of files/services mentioned
|
||||
- Infrastructure changes (docker, deploy, schema)
|
||||
Auto Claude focuses on three core principles: **context engineering** (understanding your codebase before writing code), **good coding standards** (following best practices and patterns), and **validation logic** (ensuring code works before you see it).
|
||||
|
||||
**Manual validation:**
|
||||
```bash
|
||||
python auto-claude/validate_spec.py --spec-dir auto-claude/specs/001-feature --checkpoint all
|
||||
```
|
||||
### The Agent Pipeline
|
||||
|
||||
### Isolated Worktrees (Safe by Default)
|
||||
**Phase 1: Spec Creation** (3-8 phases based on complexity)
|
||||
|
||||
Auto Claude uses Git worktrees to keep your work completely safe. All AI-generated code is built in a separate workspace (`.worktrees/auto-claude/`) - your current files are never touched until you explicitly merge.
|
||||
Before any code is written, agents gather context and create a detailed specification:
|
||||
|
||||
**How it works:**
|
||||
1. **Discovery** — Analyzes your project structure and tech stack
|
||||
2. **Requirements** — Gathers what you want to build through interactive conversation
|
||||
3. **Research** — Validates external integrations against real documentation
|
||||
4. **Context Discovery** — Finds relevant files in your codebase
|
||||
5. **Spec Writer** — Creates a comprehensive specification document
|
||||
6. **Spec Critic** — Self-critiques using extended thinking to find issues early
|
||||
7. **Planner** — Breaks work into subtasks with dependencies
|
||||
8. **Validation** — Ensures all outputs are valid before proceeding
|
||||
|
||||
1. When you run auto-claude, it creates an isolated workspace
|
||||
2. All coding happens in `.worktrees/auto-claude/` on its own branch
|
||||
3. You can `cd` into the worktree to test the feature before accepting
|
||||
4. Only when you're satisfied, merge the changes into your project
|
||||
**Phase 2: Implementation**
|
||||
|
||||
**After a build completes, you can:**
|
||||
With a validated spec, coding agents execute the plan:
|
||||
|
||||
```bash
|
||||
# Test the feature in the isolated workspace
|
||||
cd .worktrees/auto-claude/
|
||||
npm run dev # or your project's run command
|
||||
1. **Planner Agent** — Creates subtask-based implementation plan
|
||||
2. **Coder Agent** — Implements subtasks one-by-one with verification
|
||||
3. **QA Reviewer** — Validates all acceptance criteria
|
||||
4. **QA Fixer** — Fixes issues in a self-healing loop (up to 50 iterations)
|
||||
|
||||
# See what was changed
|
||||
python auto-claude/run.py --spec 001 --review
|
||||
Each session runs with a fresh context window. Progress is tracked via `implementation_plan.json` and Git commits.
|
||||
|
||||
# Add changes to your project
|
||||
python auto-claude/run.py --spec 001 --merge
|
||||
### 🔒 Security Model
|
||||
|
||||
# Discard if you don't like it (requires confirmation)
|
||||
python auto-claude/run.py --spec 001 --discard
|
||||
```
|
||||
Three-layer defense keeps your code safe:
|
||||
- **OS Sandbox** — Bash commands run in isolation
|
||||
- **Filesystem Restrictions** — Operations limited to project directory
|
||||
- **Command Allowlist** — Only approved commands based on your project's stack
|
||||
|
||||
**Key benefits:**
|
||||
### 🧠 Memory Layer
|
||||
|
||||
- **Safety**: Your uncommitted work is protected - auto-claude won't touch it
|
||||
- **Testability**: Run and test the feature before committing to it
|
||||
- **Easy rollback**: Don't like it? Just discard the worktree
|
||||
- **Parallel-safe**: Multiple workers can build without conflicts
|
||||
The Memory Layer is a **hybrid RAG system** combining graph nodes with semantic search to deliver the best possible context during AI coding. Agents remember insights from previous sessions, discovered codebase patterns persist and are reusable, and historical context helps agents make smarter decisions.
|
||||
|
||||
If you have uncommitted changes, auto-claude automatically uses isolated mode. With a clean working directory, you can choose between isolated (recommended) or direct mode.
|
||||
**Architecture:**
|
||||
- **Backend**: FalkorDB (graph database) via Docker
|
||||
- **Library**: Graphiti for knowledge graph operations
|
||||
- **Providers**: OpenAI, Anthropic, Azure OpenAI, or Ollama (local/offline)
|
||||
|
||||
### Interactive Controls
|
||||
|
||||
While the agent is running, you can:
|
||||
|
||||
```bash
|
||||
# Pause and optionally add instructions
|
||||
Ctrl+C (once)
|
||||
# You'll be prompted to add instructions for the agent
|
||||
# The agent will read these instructions when you resume
|
||||
|
||||
# Exit immediately without prompting
|
||||
Ctrl+C (twice)
|
||||
# Press Ctrl+C again during the prompt to exit
|
||||
```
|
||||
|
||||
**Alternative (file-based):**
|
||||
```bash
|
||||
# Create PAUSE file to pause after current session
|
||||
touch auto-claude/specs/001-name/PAUSE
|
||||
|
||||
# Manually edit instructions file
|
||||
echo "Focus on fixing the login bug first" > auto-claude/specs/001-name/HUMAN_INPUT.md
|
||||
```
|
||||
| Setup | LLM | Embeddings | Notes |
|
||||
|-------|-----|------------|-------|
|
||||
| **OpenAI** | OpenAI | OpenAI | Simplest - single API key |
|
||||
| **Anthropic + Voyage** | Anthropic | Voyage AI | High quality |
|
||||
| **Ollama** | Ollama | Ollama | Fully offline |
|
||||
| **Azure** | Azure OpenAI | Azure OpenAI | Enterprise |
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
your-project/
|
||||
├── .worktrees/ # Created during build (git-ignored)
|
||||
├── .worktrees/ # Created during build (git-ignored)
|
||||
│ └── auto-claude/ # Isolated workspace for AI coding
|
||||
├── auto-claude/
|
||||
│ ├── run.py # Build entry point
|
||||
│ ├── spec_runner.py # Spec creation orchestrator (8-phase pipeline)
|
||||
│ ├── validate_spec.py # Spec validation with JSON schemas
|
||||
│ ├── agent.py # Session orchestration
|
||||
│ ├── planner.py # Deterministic implementation planner
|
||||
│ ├── worktree.py # Git worktree management
|
||||
│ ├── workspace.py # Workspace selection UI
|
||||
│ ├── coordinator.py # Parallel execution coordinator
|
||||
│ ├── qa_loop.py # QA validation loop
|
||||
│ ├── client.py # Claude SDK configuration
|
||||
│ ├── memory.py # File-based session memory (primary storage)
|
||||
│ ├── graphiti_memory.py # Graphiti knowledge graph integration (optional)
|
||||
│ ├── spec_contract.json # Spec creation contract (required outputs)
|
||||
│ ├── prompts/
|
||||
│ │ ├── planner.md # Session 1 - creates implementation plan
|
||||
│ │ ├── coder.md # Sessions 2+ - implements chunks
|
||||
│ │ ├── spec_gatherer.md # Requirements gathering agent
|
||||
│ │ ├── spec_researcher.md # External integration research agent
|
||||
│ │ ├── spec_writer.md # Spec document creation agent
|
||||
│ │ ├── spec_critic.md # Self-critique agent (ultrathink)
|
||||
│ │ ├── qa_reviewer.md # QA validation agent
|
||||
│ │ └── qa_fixer.md # QA fix agent
|
||||
│ └── specs/
|
||||
│ └── 001-feature/ # Each spec in its own folder
|
||||
│ ├── spec.md
|
||||
│ ├── requirements.json # User requirements (structured)
|
||||
│ ├── research.json # External integration research
|
||||
│ ├── context.json # Codebase context
|
||||
│ ├── critique_report.json # Self-critique findings
|
||||
│ ├── implementation_plan.json
|
||||
│ ├── qa_report.md # QA validation report
|
||||
│ └── QA_FIX_REQUEST.md # Issues to fix (if rejected)
|
||||
└── [your project files]
|
||||
├── .auto-claude/ # Per-project data (specs, plans, QA reports)
|
||||
│ ├── specs/ # Task specifications
|
||||
│ ├── roadmap/ # Project roadmap
|
||||
│ └── ideation/ # Ideas and planning
|
||||
├── auto-claude/ # Python backend (framework code)
|
||||
│ ├── run.py # Build entry point
|
||||
│ ├── spec_runner.py # Spec creation orchestrator
|
||||
│ ├── prompts/ # Agent prompt templates
|
||||
│ └── ...
|
||||
├── auto-claude-ui/ # Electron desktop application
|
||||
│ └── ...
|
||||
└── docker-compose.yml # FalkorDB for Memory Layer
|
||||
```
|
||||
|
||||
## Key Features
|
||||
## Environment Variables (CLI Only)
|
||||
|
||||
- **Domain Agnostic**: Works for any software project (web apps, APIs, CLIs, etc.)
|
||||
- **Multi-Session**: Unlimited sessions, each with fresh context
|
||||
- **Research-First Specs**: External integrations validated against documentation before implementation
|
||||
- **Self-Critique**: Specs are critiqued using ultrathink to find issues before coding begins
|
||||
- **Parallel Execution**: 2-3x speedup with multiple workers on independent phases
|
||||
- **Isolated Worktrees**: Build in a separate workspace - your current work is never touched
|
||||
- **Self-Verifying**: Agents test their work with browser automation before marking complete
|
||||
- **QA Validation Loop**: Automated QA agent validates all acceptance criteria before sign-off
|
||||
- **Self-Healing**: QA finds issues → Fixer agent resolves → QA re-validates (up to 50 iterations)
|
||||
- **8-Phase Spec Pipeline**: Discovery → Requirements → Research → Context → Spec → Critique → Plan → Validate
|
||||
- **Fix Bugs Immediately**: Agents fix discovered bugs in the same session, not later
|
||||
- **Defense-in-Depth Security**: OS sandbox, filesystem restrictions, command allowlist
|
||||
- **Secret Scanning**: Automatic pre-commit scanning blocks secrets with actionable fix instructions
|
||||
- **Human Intervention**: Pause, add instructions, or stop at any time
|
||||
- **Multiple Specs**: Track and run multiple specifications independently
|
||||
- **Graphiti Memory** (Optional): Persistent knowledge graph for cross-session context retention
|
||||
|
||||
## Graphiti Memory Integration V2 (Optional)
|
||||
|
||||
Auto Claude includes an optional **Graphiti-based persistent memory layer** that enables context retention across coding sessions. This uses FalkorDB as a graph database to store codebase patterns, session insights, and cross-session learnings.
|
||||
|
||||
### Why Use Graphiti Memory?
|
||||
|
||||
- **Cross-session context**: Agents remember insights from previous sessions
|
||||
- **Pattern recognition**: Discovered codebase patterns persist and are reusable
|
||||
- **Smarter agents**: Context retrieval helps agents make better decisions
|
||||
- **Historical hints**: Spec creation, ideation, and roadmap phases receive relevant historical insights
|
||||
|
||||
### Multi-Provider Support (V2)
|
||||
|
||||
Graphiti Memory V2 supports multiple LLM and embedding providers:
|
||||
|
||||
| LLM Providers | Embedding Providers |
|
||||
|---------------|---------------------|
|
||||
| OpenAI (default) | OpenAI (default) |
|
||||
| Anthropic | Voyage AI |
|
||||
| Azure OpenAI | Azure OpenAI |
|
||||
| Ollama (local) | Ollama (local) |
|
||||
|
||||
**Provider Combinations:**
|
||||
- **OpenAI + OpenAI**: Simplest setup, single API key
|
||||
- **Anthropic + Voyage**: High-quality LLM with specialized embeddings
|
||||
- **Ollama + Ollama**: Fully offline, no API keys needed
|
||||
- **Azure OpenAI + Azure OpenAI**: Enterprise deployments
|
||||
|
||||
### Setup
|
||||
|
||||
**Step 1:** Install the Graphiti dependency
|
||||
|
||||
```bash
|
||||
# Uncomment the graphiti line in requirements.txt, or install directly:
|
||||
pip install graphiti-core[falkordb]
|
||||
```
|
||||
|
||||
**Step 2:** Start FalkorDB via Docker
|
||||
|
||||
```bash
|
||||
docker-compose up -d falkordb
|
||||
```
|
||||
|
||||
**Step 3:** Configure environment variables
|
||||
|
||||
Add to your `.env` file (see `.env.example` for full documentation):
|
||||
|
||||
```bash
|
||||
# Enable Graphiti integration
|
||||
GRAPHITI_ENABLED=true
|
||||
|
||||
# Provider selection (defaults to openai)
|
||||
GRAPHITI_LLM_PROVIDER=openai
|
||||
GRAPHITI_EMBEDDER_PROVIDER=openai
|
||||
|
||||
# Example 1: OpenAI (simplest)
|
||||
OPENAI_API_KEY=sk-your-openai-key-here
|
||||
|
||||
# Example 2: Anthropic + Voyage (high quality)
|
||||
# GRAPHITI_LLM_PROVIDER=anthropic
|
||||
# GRAPHITI_EMBEDDER_PROVIDER=voyage
|
||||
# ANTHROPIC_API_KEY=sk-ant-xxx
|
||||
# VOYAGE_API_KEY=pa-xxx
|
||||
|
||||
# Example 3: Ollama (fully offline)
|
||||
# GRAPHITI_LLM_PROVIDER=ollama
|
||||
# GRAPHITI_EMBEDDER_PROVIDER=ollama
|
||||
# OLLAMA_LLM_MODEL=deepseek-r1:7b
|
||||
# OLLAMA_EMBEDDING_MODEL=nomic-embed-text
|
||||
# OLLAMA_EMBEDDING_DIM=768
|
||||
```
|
||||
|
||||
**Step 4:** Verify it's working
|
||||
|
||||
```bash
|
||||
python auto-claude/run.py --list
|
||||
# Should show: "Graphiti memory: ENABLED"
|
||||
|
||||
# Test the full integration
|
||||
python auto-claude/test_graphiti_memory.py
|
||||
```
|
||||
|
||||
### When Disabled
|
||||
|
||||
When `GRAPHITI_ENABLED` is not set (default), Auto Claude uses file-based memory only. This is the zero-dependency default that works out of the box.
|
||||
|
||||
## Environment Variables
|
||||
> **Desktop UI users:** These are configured through the app settings — no manual setup needed.
|
||||
|
||||
| Variable | Required | Description |
|
||||
|----------|----------|-------------|
|
||||
| `CLAUDE_CODE_OAUTH_TOKEN` | Yes | OAuth token from `claude setup-token` |
|
||||
| `AUTO_BUILD_MODEL` | No | Model override (default: claude-opus-4-5-20251101) |
|
||||
| `GRAPHITI_ENABLED` | No | Set to `true` to enable Graphiti memory |
|
||||
| `GRAPHITI_LLM_PROVIDER` | No | LLM provider: openai, anthropic, azure_openai, ollama |
|
||||
| `GRAPHITI_EMBEDDER_PROVIDER` | No | Embedder: openai, voyage, azure_openai, ollama |
|
||||
| `GRAPHITI_ENABLED` | Recommended | Set to `true` to enable Memory Layer |
|
||||
| `GRAPHITI_LLM_PROVIDER` | For Memory | LLM provider: openai, anthropic, azure_openai, ollama |
|
||||
| `GRAPHITI_EMBEDDER_PROVIDER` | For Memory | Embedder: openai, voyage, azure_openai, ollama |
|
||||
| `OPENAI_API_KEY` | For OpenAI | Required for OpenAI provider |
|
||||
| `ANTHROPIC_API_KEY` | For Anthropic | Required for Anthropic LLM |
|
||||
| `VOYAGE_API_KEY` | For Voyage | Required for Voyage embeddings |
|
||||
|
||||
See `auto-claude/.env.example` for complete provider configuration options.
|
||||
See `auto-claude/.env.example` for complete configuration options.
|
||||
|
||||
## Documentation
|
||||
## 💬 Community
|
||||
|
||||
For parallel execution details:
|
||||
- How parallelism works
|
||||
- Performance analysis
|
||||
- Best practices
|
||||
- Troubleshooting
|
||||
Join our Discord to get help, share what you're building, and connect with other Auto Claude users:
|
||||
|
||||
See [auto-claude/PARALLEL_EXECUTION.md](auto-claude/PARALLEL_EXECUTION.md)
|
||||
[](https://discord.gg/maj9EWmY)
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
We welcome contributions! Whether it's bug fixes, new features, or documentation improvements.
|
||||
|
||||
See **[CONTRIBUTING.md](CONTRIBUTING.md)** for guidelines on how to get started.
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
@@ -427,4 +264,15 @@ This framework was inspired by Anthropic's [Autonomous Coding Agent](https://git
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
**AGPL-3.0** - GNU Affero General Public License v3.0
|
||||
|
||||
This software is licensed under AGPL-3.0, which means:
|
||||
|
||||
- **Attribution Required**: You must give appropriate credit, provide a link to the license, and indicate if changes were made. When using Auto Claude, please credit the project.
|
||||
- **Open Source Required**: If you modify this software and distribute it or run it as a service, you must release your source code under AGPL-3.0.
|
||||
- **Network Use (Copyleft)**: If you run this software as a network service (e.g., SaaS), users interacting with it over a network must be able to receive the source code.
|
||||
- **No Closed-Source Usage**: You cannot use this software in proprietary/closed-source projects without open-sourcing your entire project under AGPL-3.0.
|
||||
|
||||
**In simple terms**: You can use Auto Claude freely, but if you build on it, your code must also be open source under AGPL-3.0 and attribute this project. Closed-source commercial use requires a separate license.
|
||||
|
||||
For commercial licensing inquiries (closed-source usage), please contact the maintainers.
|
||||
|
||||
+661
@@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 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.
|
||||
|
||||
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 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.
|
||||
|
||||
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/>.
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "auto-claude-ui",
|
||||
"version": "1.1.0",
|
||||
"version": "2.0.1",
|
||||
"description": "Desktop UI for Auto Claude autonomous coding framework",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "Auto Claude Team",
|
||||
"license": "MIT",
|
||||
"license": "AGPL-3.0",
|
||||
"scripts": {
|
||||
"postinstall": "electron-rebuild",
|
||||
"dev": "electron-vite dev",
|
||||
|
||||
@@ -85,12 +85,12 @@ describe('IPC Bridge Integration', () => {
|
||||
id: string,
|
||||
settings: object
|
||||
) => Promise<unknown>;
|
||||
await updateProjectSettings('project-id', { parallelEnabled: true });
|
||||
await updateProjectSettings('project-id', { model: 'sonnet' });
|
||||
|
||||
expect(mockIpcRenderer.invoke).toHaveBeenCalledWith(
|
||||
'project:updateSettings',
|
||||
'project-id',
|
||||
{ parallelEnabled: true }
|
||||
{ model: 'sonnet' }
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -252,7 +252,7 @@ describe('IPC Handlers', () => {
|
||||
'project:updateSettings',
|
||||
{},
|
||||
'nonexistent-id',
|
||||
{ parallelEnabled: true }
|
||||
{ model: 'sonnet' }
|
||||
);
|
||||
|
||||
expect(result).toEqual({
|
||||
@@ -274,7 +274,7 @@ describe('IPC Handlers', () => {
|
||||
'project:updateSettings',
|
||||
{},
|
||||
projectId,
|
||||
{ parallelEnabled: true, maxWorkers: 4 }
|
||||
{ model: 'sonnet', linearSync: true }
|
||||
);
|
||||
|
||||
expect(result).toEqual({ success: true });
|
||||
|
||||
@@ -208,7 +208,7 @@ describe('ProjectStore', () => {
|
||||
const { ProjectStore } = await import('../project-store');
|
||||
const store = new ProjectStore();
|
||||
|
||||
const result = store.updateProjectSettings('nonexistent-id', { parallelEnabled: true });
|
||||
const result = store.updateProjectSettings('nonexistent-id', { model: 'sonnet' });
|
||||
|
||||
expect(result).toBeUndefined();
|
||||
});
|
||||
@@ -219,13 +219,13 @@ describe('ProjectStore', () => {
|
||||
|
||||
const project = store.addProject(TEST_PROJECT_PATH);
|
||||
const updated = store.updateProjectSettings(project.id, {
|
||||
parallelEnabled: true,
|
||||
maxWorkers: 4
|
||||
model: 'sonnet',
|
||||
linearSync: true
|
||||
});
|
||||
|
||||
expect(updated).toBeDefined();
|
||||
expect(updated?.settings.parallelEnabled).toBe(true);
|
||||
expect(updated?.settings.maxWorkers).toBe(4);
|
||||
expect(updated?.settings.model).toBe('sonnet');
|
||||
expect(updated?.settings.linearSync).toBe(true);
|
||||
});
|
||||
|
||||
it('should update updatedAt timestamp', async () => {
|
||||
@@ -238,7 +238,7 @@ describe('ProjectStore', () => {
|
||||
// Small delay to ensure timestamp difference
|
||||
await new Promise((resolve) => setTimeout(resolve, 10));
|
||||
|
||||
const updated = store.updateProjectSettings(project.id, { parallelEnabled: true });
|
||||
const updated = store.updateProjectSettings(project.id, { model: 'haiku' });
|
||||
|
||||
expect(updated?.updatedAt.getTime()).toBeGreaterThan(originalUpdatedAt.getTime());
|
||||
});
|
||||
@@ -248,12 +248,12 @@ describe('ProjectStore', () => {
|
||||
const store = new ProjectStore();
|
||||
|
||||
const project = store.addProject(TEST_PROJECT_PATH);
|
||||
store.updateProjectSettings(project.id, { maxWorkers: 8 });
|
||||
store.updateProjectSettings(project.id, { model: 'sonnet' });
|
||||
|
||||
// Read directly from file
|
||||
const storePath = path.join(USER_DATA_PATH, 'store', 'projects.json');
|
||||
const content = JSON.parse(readFileSync(storePath, 'utf-8'));
|
||||
expect(content.projects[0].settings.maxWorkers).toBe(8);
|
||||
expect(content.projects[0].settings.model).toBe('sonnet');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -501,8 +501,6 @@ describe('ProjectStore', () => {
|
||||
path: '/test/path',
|
||||
autoBuildPath: '',
|
||||
settings: {
|
||||
parallelEnabled: false,
|
||||
maxWorkers: 2,
|
||||
model: 'sonnet',
|
||||
memoryBackend: 'file',
|
||||
linearSync: false,
|
||||
@@ -511,7 +509,9 @@ describe('ProjectStore', () => {
|
||||
onTaskFailed: true,
|
||||
onReviewNeeded: true,
|
||||
sound: false
|
||||
}
|
||||
},
|
||||
graphitiMcpEnabled: true,
|
||||
graphitiMcpUrl: 'http://localhost:8000/mcp/'
|
||||
},
|
||||
createdAt: '2024-01-01T00:00:00Z',
|
||||
updatedAt: '2024-01-01T00:00:00Z'
|
||||
|
||||
@@ -43,6 +43,7 @@ interface GitHubRelease {
|
||||
tag_name: string;
|
||||
name: string;
|
||||
body: string;
|
||||
html_url: string;
|
||||
tarball_url: string;
|
||||
published_at: string;
|
||||
prerelease: boolean;
|
||||
@@ -60,6 +61,7 @@ export interface AutoBuildUpdateCheck {
|
||||
currentVersion: string;
|
||||
latestVersion?: string;
|
||||
releaseNotes?: string;
|
||||
releaseUrl?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
@@ -204,7 +206,8 @@ export async function checkForUpdates(): Promise<AutoBuildUpdateCheck> {
|
||||
updateAvailable,
|
||||
currentVersion,
|
||||
latestVersion,
|
||||
releaseNotes: release.body || undefined
|
||||
releaseNotes: release.body || undefined,
|
||||
releaseUrl: release.html_url || undefined
|
||||
};
|
||||
} catch (error) {
|
||||
// Clear cache on error
|
||||
|
||||
@@ -0,0 +1,301 @@
|
||||
/**
|
||||
* Docker & FalkorDB Service
|
||||
*
|
||||
* Provides automatic detection and management of Docker and FalkorDB
|
||||
* for non-technical users. This eliminates the need for manual
|
||||
* "docker --version" verification steps.
|
||||
*/
|
||||
|
||||
import { exec, spawn } from 'child_process';
|
||||
import { promisify } from 'util';
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
|
||||
// FalkorDB container configuration
|
||||
const FALKORDB_CONTAINER_NAME = 'auto-claude-falkordb';
|
||||
const FALKORDB_IMAGE = 'falkordb/falkordb:latest';
|
||||
const FALKORDB_DEFAULT_PORT = 6380;
|
||||
|
||||
export interface DockerStatus {
|
||||
installed: boolean;
|
||||
running: boolean;
|
||||
version?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface FalkorDBStatus {
|
||||
containerExists: boolean;
|
||||
containerRunning: boolean;
|
||||
containerName: string;
|
||||
port: number;
|
||||
healthy: boolean;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface InfrastructureStatus {
|
||||
docker: DockerStatus;
|
||||
falkordb: FalkorDBStatus;
|
||||
ready: boolean; // True if both Docker is running and FalkorDB is healthy
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Docker is installed and running
|
||||
*/
|
||||
export async function checkDockerStatus(): Promise<DockerStatus> {
|
||||
try {
|
||||
// Check if Docker CLI is available
|
||||
const { stdout: versionOutput } = await execAsync('docker --version', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
const version = versionOutput.trim();
|
||||
|
||||
// Check if Docker daemon is running by trying to ping it
|
||||
try {
|
||||
await execAsync('docker info', { timeout: 10000 });
|
||||
return {
|
||||
installed: true,
|
||||
running: true,
|
||||
version,
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
installed: true,
|
||||
running: false,
|
||||
version,
|
||||
error: 'Docker is installed but not running. Please start Docker Desktop.',
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
const errorMsg = error instanceof Error ? error.message : String(error);
|
||||
|
||||
// Check if it's a "command not found" type error
|
||||
if (
|
||||
errorMsg.includes('not found') ||
|
||||
errorMsg.includes('ENOENT') ||
|
||||
errorMsg.includes('not recognized')
|
||||
) {
|
||||
return {
|
||||
installed: false,
|
||||
running: false,
|
||||
error: 'Docker is not installed. Please install Docker Desktop.',
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
installed: false,
|
||||
running: false,
|
||||
error: `Docker check failed: ${errorMsg}`,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check FalkorDB container status
|
||||
*/
|
||||
export async function checkFalkorDBStatus(port: number = FALKORDB_DEFAULT_PORT): Promise<FalkorDBStatus> {
|
||||
const status: FalkorDBStatus = {
|
||||
containerExists: false,
|
||||
containerRunning: false,
|
||||
containerName: FALKORDB_CONTAINER_NAME,
|
||||
port,
|
||||
healthy: false,
|
||||
};
|
||||
|
||||
try {
|
||||
// Check if container exists and get its status
|
||||
const { stdout } = await execAsync(
|
||||
`docker ps -a --filter "name=${FALKORDB_CONTAINER_NAME}" --format "{{.Status}}"`,
|
||||
{ timeout: 5000 }
|
||||
);
|
||||
|
||||
const containerStatus = stdout.trim();
|
||||
|
||||
if (containerStatus) {
|
||||
status.containerExists = true;
|
||||
status.containerRunning = containerStatus.toLowerCase().startsWith('up');
|
||||
|
||||
if (status.containerRunning) {
|
||||
// Check if FalkorDB is responding
|
||||
status.healthy = await checkFalkorDBHealth(port);
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
} catch (error) {
|
||||
status.error = error instanceof Error ? error.message : String(error);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if FalkorDB is responding to connections
|
||||
*/
|
||||
async function checkFalkorDBHealth(port: number): Promise<boolean> {
|
||||
try {
|
||||
// Try to ping FalkorDB using redis-cli (FalkorDB uses Redis protocol)
|
||||
// Since we may not have redis-cli, we'll check if the port is listening
|
||||
await execAsync(`docker exec ${FALKORDB_CONTAINER_NAME} redis-cli PING`, {
|
||||
timeout: 5000,
|
||||
});
|
||||
return true;
|
||||
} catch {
|
||||
// Fallback: just check if container is running (less accurate)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get combined infrastructure status
|
||||
*/
|
||||
export async function getInfrastructureStatus(
|
||||
falkordbPort: number = FALKORDB_DEFAULT_PORT
|
||||
): Promise<InfrastructureStatus> {
|
||||
const [docker, falkordb] = await Promise.all([
|
||||
checkDockerStatus(),
|
||||
checkFalkorDBStatus(falkordbPort),
|
||||
]);
|
||||
|
||||
return {
|
||||
docker,
|
||||
falkordb,
|
||||
ready: docker.running && falkordb.containerRunning && falkordb.healthy,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Start FalkorDB container
|
||||
* Creates a new container if it doesn't exist, or starts the existing one
|
||||
*/
|
||||
export async function startFalkorDB(
|
||||
port: number = FALKORDB_DEFAULT_PORT
|
||||
): Promise<{ success: boolean; error?: string }> {
|
||||
try {
|
||||
// First, check Docker status
|
||||
const dockerStatus = await checkDockerStatus();
|
||||
if (!dockerStatus.running) {
|
||||
return {
|
||||
success: false,
|
||||
error: dockerStatus.error || 'Docker is not running',
|
||||
};
|
||||
}
|
||||
|
||||
// Check if container already exists
|
||||
const falkordbStatus = await checkFalkorDBStatus(port);
|
||||
|
||||
if (falkordbStatus.containerExists) {
|
||||
if (falkordbStatus.containerRunning) {
|
||||
// Already running
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
// Start existing container
|
||||
await execAsync(`docker start ${FALKORDB_CONTAINER_NAME}`, { timeout: 30000 });
|
||||
} else {
|
||||
// Create and start new container
|
||||
await execAsync(
|
||||
`docker run -d --name ${FALKORDB_CONTAINER_NAME} -p ${port}:6379 ${FALKORDB_IMAGE}`,
|
||||
{ timeout: 60000 }
|
||||
);
|
||||
}
|
||||
|
||||
// Wait for FalkorDB to be ready (up to 30 seconds)
|
||||
const ready = await waitForFalkorDB(port, 30000);
|
||||
|
||||
if (!ready) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'FalkorDB container started but is not responding. Please check Docker logs.',
|
||||
};
|
||||
}
|
||||
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop FalkorDB container
|
||||
*/
|
||||
export async function stopFalkorDB(): Promise<{ success: boolean; error?: string }> {
|
||||
try {
|
||||
await execAsync(`docker stop ${FALKORDB_CONTAINER_NAME}`, { timeout: 30000 });
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for FalkorDB to be ready
|
||||
*/
|
||||
async function waitForFalkorDB(port: number, timeoutMs: number): Promise<boolean> {
|
||||
const startTime = Date.now();
|
||||
const checkInterval = 1000; // Check every second
|
||||
|
||||
while (Date.now() - startTime < timeoutMs) {
|
||||
const status = await checkFalkorDBStatus(port);
|
||||
if (status.containerRunning && status.healthy) {
|
||||
return true;
|
||||
}
|
||||
// If container is running but not healthy yet, wait
|
||||
if (status.containerRunning) {
|
||||
await new Promise((resolve) => setTimeout(resolve, checkInterval));
|
||||
} else {
|
||||
// Container stopped unexpectedly
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open Docker Desktop application (macOS/Windows)
|
||||
*/
|
||||
export async function openDockerDesktop(): Promise<{ success: boolean; error?: string }> {
|
||||
try {
|
||||
if (process.platform === 'darwin') {
|
||||
// macOS
|
||||
await execAsync('open -a Docker', { timeout: 5000 });
|
||||
} else if (process.platform === 'win32') {
|
||||
// Windows
|
||||
spawn('cmd', ['/c', 'start', '', 'Docker Desktop'], {
|
||||
detached: true,
|
||||
stdio: 'ignore',
|
||||
});
|
||||
} else {
|
||||
// Linux - Docker doesn't have a GUI, suggest starting daemon
|
||||
return {
|
||||
success: false,
|
||||
error: 'On Linux, start Docker with: sudo systemctl start docker',
|
||||
};
|
||||
}
|
||||
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get download URL for Docker Desktop
|
||||
*/
|
||||
export function getDockerDownloadUrl(): string {
|
||||
if (process.platform === 'darwin') {
|
||||
return 'https://www.docker.com/products/docker-desktop/';
|
||||
} else if (process.platform === 'win32') {
|
||||
return 'https://www.docker.com/products/docker-desktop/';
|
||||
}
|
||||
return 'https://docs.docker.com/engine/install/';
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import type { ProcessType, ExecutionProgressData } from '../agent';
|
||||
import { titleGenerator } from '../title-generator';
|
||||
import { fileWatcher } from '../file-watcher';
|
||||
import { projectStore } from '../project-store';
|
||||
import { notificationService } from '../notification-service';
|
||||
|
||||
|
||||
/**
|
||||
@@ -88,12 +89,12 @@ export function registerAgenteventsHandlers(
|
||||
newStatus = 'human_review';
|
||||
}
|
||||
|
||||
// Persist status to disk so it survives hot reload
|
||||
// This is a backup in case the Python backend didn't sync properly
|
||||
// Find task and project for status persistence and notifications
|
||||
let task: Task | undefined;
|
||||
let project: Project | undefined;
|
||||
|
||||
try {
|
||||
const projects = projectStore.getProjects();
|
||||
let task: Task | undefined;
|
||||
let project: Project | undefined;
|
||||
|
||||
for (const p of projects) {
|
||||
const tasks = projectStore.getTasks(p.id);
|
||||
@@ -104,6 +105,8 @@ export function registerAgenteventsHandlers(
|
||||
}
|
||||
}
|
||||
|
||||
// Persist status to disk so it survives hot reload
|
||||
// This is a backup in case the Python backend didn't sync properly
|
||||
if (task && project) {
|
||||
const specsBaseDir = getSpecsDir(project.autoBuildPath);
|
||||
const specDir = path.join(project.path, specsBaseDir, task.specId);
|
||||
@@ -135,6 +138,19 @@ export function registerAgenteventsHandlers(
|
||||
console.error(`[Task ${taskId}] Failed to persist status:`, persistError);
|
||||
}
|
||||
|
||||
// Send notifications based on task completion status
|
||||
if (task && project) {
|
||||
const taskTitle = task.title || task.specId;
|
||||
|
||||
if (code === 0) {
|
||||
// Task completed successfully - ready for review
|
||||
notificationService.notifyReviewNeeded(taskTitle, project.id, taskId);
|
||||
} else {
|
||||
// Task failed
|
||||
notificationService.notifyTaskFailed(taskTitle, project.id, taskId);
|
||||
}
|
||||
}
|
||||
|
||||
mainWindow.webContents.send(
|
||||
IPC_CHANNELS.TASK_STATUS_CHANGE,
|
||||
taskId,
|
||||
|
||||
@@ -20,7 +20,7 @@ export function registerAutobuildSourceHandlers(
|
||||
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.AUTOBUILD_SOURCE_CHECK,
|
||||
async (): Promise<IPCResult<{ updateAvailable: boolean; currentVersion: string; latestVersion?: string; releaseNotes?: string; error?: string }>> => {
|
||||
async (): Promise<IPCResult<{ updateAvailable: boolean; currentVersion: string; latestVersion?: string; releaseNotes?: string; releaseUrl?: string; error?: string }>> => {
|
||||
try {
|
||||
const result = await checkSourceUpdates();
|
||||
return { success: true, data: result };
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* Docker & FalkorDB IPC Handlers
|
||||
*
|
||||
* Provides automatic infrastructure detection for non-technical users.
|
||||
* When Graphiti is enabled, the UI can check Docker/FalkorDB status
|
||||
* and offer one-click solutions instead of manual terminal commands.
|
||||
*/
|
||||
|
||||
import { ipcMain } from 'electron';
|
||||
import { IPC_CHANNELS } from '../../shared/constants';
|
||||
import type { IPCResult, InfrastructureStatus } from '../../shared/types';
|
||||
import {
|
||||
getInfrastructureStatus,
|
||||
startFalkorDB,
|
||||
stopFalkorDB,
|
||||
openDockerDesktop,
|
||||
getDockerDownloadUrl,
|
||||
} from '../docker-service';
|
||||
|
||||
/**
|
||||
* Register all Docker-related IPC handlers
|
||||
*/
|
||||
export function registerDockerHandlers(): void {
|
||||
// Get infrastructure status (Docker + FalkorDB)
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.DOCKER_STATUS,
|
||||
async (_, port?: number): Promise<IPCResult<InfrastructureStatus>> => {
|
||||
try {
|
||||
const status = await getInfrastructureStatus(port);
|
||||
return { success: true, data: status };
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : 'Failed to check Docker status',
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Start FalkorDB container
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.DOCKER_START_FALKORDB,
|
||||
async (_, port?: number): Promise<IPCResult<{ success: boolean; error?: string }>> => {
|
||||
try {
|
||||
const result = await startFalkorDB(port);
|
||||
return { success: true, data: result };
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : 'Failed to start FalkorDB',
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Stop FalkorDB container
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.DOCKER_STOP_FALKORDB,
|
||||
async (): Promise<IPCResult<{ success: boolean; error?: string }>> => {
|
||||
try {
|
||||
const result = await stopFalkorDB();
|
||||
return { success: true, data: result };
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : 'Failed to stop FalkorDB',
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Open Docker Desktop application
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.DOCKER_OPEN_DESKTOP,
|
||||
async (): Promise<IPCResult<{ success: boolean; error?: string }>> => {
|
||||
try {
|
||||
const result = await openDockerDesktop();
|
||||
return { success: true, data: result };
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : 'Failed to open Docker Desktop',
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Get Docker download URL
|
||||
ipcMain.handle(IPC_CHANNELS.DOCKER_GET_DOWNLOAD_URL, async (): Promise<string> => {
|
||||
return getDockerDownloadUrl();
|
||||
});
|
||||
}
|
||||
@@ -26,6 +26,8 @@ import { registerAutobuildSourceHandlers } from './autobuild-source-handlers';
|
||||
import { registerIdeationHandlers } from './ideation-handlers';
|
||||
import { registerChangelogHandlers } from './changelog-handlers';
|
||||
import { registerInsightsHandlers } from './insights-handlers';
|
||||
import { registerDockerHandlers } from './docker-handlers';
|
||||
import { notificationService } from '../notification-service';
|
||||
|
||||
/**
|
||||
* Setup all IPC handlers across all domains
|
||||
@@ -41,6 +43,9 @@ export function setupIpcHandlers(
|
||||
getMainWindow: () => BrowserWindow | null,
|
||||
pythonEnvManager: PythonEnvManager
|
||||
): void {
|
||||
// Initialize notification service
|
||||
notificationService.initialize(getMainWindow);
|
||||
|
||||
// Project handlers (including Python environment setup)
|
||||
registerProjectHandlers(pythonEnvManager, agentManager, getMainWindow);
|
||||
|
||||
@@ -86,6 +91,9 @@ export function setupIpcHandlers(
|
||||
// Insights handlers
|
||||
registerInsightsHandlers(getMainWindow);
|
||||
|
||||
// Docker & infrastructure handlers (for Graphiti/FalkorDB)
|
||||
registerDockerHandlers();
|
||||
|
||||
console.log('[IPC] All handler modules registered successfully');
|
||||
}
|
||||
|
||||
@@ -105,5 +113,6 @@ export {
|
||||
registerAutobuildSourceHandlers,
|
||||
registerIdeationHandlers,
|
||||
registerChangelogHandlers,
|
||||
registerInsightsHandlers
|
||||
registerInsightsHandlers,
|
||||
registerDockerHandlers
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ipcMain, dialog, app } from 'electron';
|
||||
import { ipcMain, dialog, app, shell } from 'electron';
|
||||
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
||||
import { execSync } from 'child_process';
|
||||
import path from 'path';
|
||||
@@ -218,4 +218,15 @@ export function registerSettingsHandlers(
|
||||
ipcMain.handle(IPC_CHANNELS.APP_VERSION, async (): Promise<string> => {
|
||||
return app.getVersion();
|
||||
});
|
||||
|
||||
// ============================================
|
||||
// Shell Operations
|
||||
// ============================================
|
||||
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.SHELL_OPEN_EXTERNAL,
|
||||
async (_, url: string): Promise<void> => {
|
||||
await shell.openExternal(url);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ export function registerTaskHandlers(
|
||||
async (
|
||||
_,
|
||||
taskId: string,
|
||||
updates: { title?: string; description?: string }
|
||||
updates: { title?: string; description?: string; metadata?: Partial<TaskMetadata> }
|
||||
): Promise<IPCResult<Task>> => {
|
||||
try {
|
||||
// Find task and project
|
||||
@@ -363,11 +363,80 @@ export function registerTaskHandlers(
|
||||
}
|
||||
}
|
||||
|
||||
// Update metadata if provided
|
||||
let updatedMetadata = task.metadata;
|
||||
if (updates.metadata) {
|
||||
updatedMetadata = { ...task.metadata, ...updates.metadata };
|
||||
|
||||
// Process and save attached images if provided
|
||||
if (updates.metadata.attachedImages && updates.metadata.attachedImages.length > 0) {
|
||||
const attachmentsDir = path.join(specDir, 'attachments');
|
||||
mkdirSync(attachmentsDir, { recursive: true });
|
||||
|
||||
const savedImages: typeof updates.metadata.attachedImages = [];
|
||||
|
||||
for (const image of updates.metadata.attachedImages) {
|
||||
// If image has data (new image), save it
|
||||
if (image.data) {
|
||||
try {
|
||||
const buffer = Buffer.from(image.data, 'base64');
|
||||
const imagePath = path.join(attachmentsDir, image.filename);
|
||||
writeFileSync(imagePath, buffer);
|
||||
|
||||
savedImages.push({
|
||||
id: image.id,
|
||||
filename: image.filename,
|
||||
mimeType: image.mimeType,
|
||||
size: image.size,
|
||||
path: `attachments/${image.filename}`
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(`Failed to save image ${image.filename}:`, err);
|
||||
}
|
||||
} else if (image.path) {
|
||||
// Existing image, keep it
|
||||
savedImages.push(image);
|
||||
}
|
||||
}
|
||||
|
||||
updatedMetadata.attachedImages = savedImages;
|
||||
}
|
||||
|
||||
// Update task_metadata.json
|
||||
const metadataPath = path.join(specDir, 'task_metadata.json');
|
||||
try {
|
||||
writeFileSync(metadataPath, JSON.stringify(updatedMetadata, null, 2));
|
||||
} catch (err) {
|
||||
console.error('Failed to update task_metadata.json:', err);
|
||||
}
|
||||
|
||||
// Update requirements.json if it exists
|
||||
const requirementsPath = path.join(specDir, 'requirements.json');
|
||||
if (existsSync(requirementsPath)) {
|
||||
try {
|
||||
const requirementsContent = readFileSync(requirementsPath, 'utf-8');
|
||||
const requirements = JSON.parse(requirementsContent);
|
||||
|
||||
if (updates.description !== undefined) {
|
||||
requirements.task_description = updates.description;
|
||||
}
|
||||
if (updates.metadata.category) {
|
||||
requirements.workflow_type = updates.metadata.category;
|
||||
}
|
||||
|
||||
writeFileSync(requirementsPath, JSON.stringify(requirements, null, 2));
|
||||
} catch (err) {
|
||||
console.error('Failed to update requirements.json:', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Build the updated task object
|
||||
const updatedTask: Task = {
|
||||
...task,
|
||||
title: finalTitle ?? task.title,
|
||||
description: updates.description ?? task.description,
|
||||
metadata: updatedMetadata,
|
||||
updatedAt: new Date()
|
||||
};
|
||||
|
||||
@@ -469,29 +538,16 @@ export function registerTaskHandlers(
|
||||
);
|
||||
} else {
|
||||
// Task has subtasks, start normal execution
|
||||
// Only enable parallel if there are multiple subtasks AND user has parallel enabled
|
||||
const hasMultipleSubtasks = task.subtasks.length > 1;
|
||||
const pendingSubtasks = task.subtasks.filter(s => s.status === 'pending' || s.status === 'in_progress').length;
|
||||
const parallelEnabled = options?.parallel ?? project.settings.parallelEnabled;
|
||||
const useParallel = parallelEnabled && hasMultipleSubtasks && pendingSubtasks > 1;
|
||||
const workers = useParallel ? (options?.workers ?? project.settings.maxWorkers) : 1;
|
||||
|
||||
// Note: Parallel execution is handled internally by the agent, not via CLI flags
|
||||
console.log('[TASK_START] Starting task execution (has subtasks) for:', task.specId);
|
||||
console.log('[TASK_START] Parallel decision:', {
|
||||
hasMultipleSubtasks,
|
||||
pendingSubtasks,
|
||||
parallelEnabled,
|
||||
useParallel,
|
||||
workers
|
||||
});
|
||||
|
||||
agentManager.startTaskExecution(
|
||||
taskId,
|
||||
project.path,
|
||||
task.specId,
|
||||
{
|
||||
parallel: useParallel,
|
||||
workers
|
||||
parallel: false,
|
||||
workers: 1
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -705,20 +761,15 @@ export function registerTaskHandlers(
|
||||
);
|
||||
} else {
|
||||
// Task has subtasks, start normal execution
|
||||
const hasMultipleSubtasks = task.subtasks.length > 1;
|
||||
const pendingSubtasks = task.subtasks.filter(s => s.status === 'pending' || s.status === 'in_progress').length;
|
||||
const parallelEnabled = project.settings.parallelEnabled;
|
||||
const useParallel = parallelEnabled && hasMultipleSubtasks && pendingSubtasks > 1;
|
||||
const workers = useParallel ? project.settings.maxWorkers : 1;
|
||||
|
||||
// Note: Parallel execution is handled internally by the agent
|
||||
console.log('[TASK_UPDATE_STATUS] Starting task execution (has subtasks) for:', task.specId);
|
||||
agentManager.startTaskExecution(
|
||||
taskId,
|
||||
project.path,
|
||||
task.specId,
|
||||
{
|
||||
parallel: useParallel,
|
||||
workers
|
||||
parallel: false,
|
||||
workers: 1
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -908,26 +959,19 @@ export function registerTaskHandlers(
|
||||
}
|
||||
|
||||
// Start the task execution
|
||||
|
||||
// Check if we should use parallel mode
|
||||
const hasMultipleSubtasks = task.subtasks.length > 1;
|
||||
const pendingSubtasks = task.subtasks.filter(s => s.status === 'pending').length;
|
||||
const parallelEnabled = project.settings.parallelEnabled;
|
||||
const useParallel = parallelEnabled && hasMultipleSubtasks && pendingSubtasks > 1;
|
||||
const workers = useParallel ? project.settings.maxWorkers : 1;
|
||||
|
||||
// Start file watcher for this task
|
||||
const specsBaseDir = getSpecsDir(project.autoBuildPath);
|
||||
const specDirForWatcher = path.join(project.path, specsBaseDir, task.specId);
|
||||
fileWatcher.watch(taskId, specDirForWatcher);
|
||||
|
||||
// Note: Parallel execution is handled internally by the agent
|
||||
agentManager.startTaskExecution(
|
||||
taskId,
|
||||
project.path,
|
||||
task.specId,
|
||||
{
|
||||
parallel: useParallel,
|
||||
workers
|
||||
parallel: false,
|
||||
workers: 1
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { IPCResult, TerminalCreateOptions, ClaudeProfile, ClaudeProfileSett
|
||||
import { getClaudeProfileManager } from '../claude-profile-manager';
|
||||
import { TerminalManager } from '../terminal-manager';
|
||||
import { projectStore } from '../project-store';
|
||||
import { terminalNameGenerator } from '../terminal-name-generator';
|
||||
|
||||
|
||||
/**
|
||||
@@ -53,6 +54,25 @@ export function registerTerminalHandlers(
|
||||
}
|
||||
);
|
||||
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.TERMINAL_GENERATE_NAME,
|
||||
async (_, command: string, cwd?: string): Promise<IPCResult<string>> => {
|
||||
try {
|
||||
const name = await terminalNameGenerator.generateName(command, cwd);
|
||||
if (name) {
|
||||
return { success: true, data: name };
|
||||
} else {
|
||||
return { success: false, error: 'Failed to generate terminal name' };
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : 'Failed to generate terminal name'
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Claude profile management (multi-account support)
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.CLAUDE_PROFILES_GET,
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
import { Notification, shell } from 'electron';
|
||||
import type { BrowserWindow } from 'electron';
|
||||
import { projectStore } from './project-store';
|
||||
|
||||
export type NotificationType = 'task-complete' | 'task-failed' | 'review-needed';
|
||||
|
||||
interface NotificationOptions {
|
||||
title: string;
|
||||
body: string;
|
||||
projectId?: string;
|
||||
taskId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Service for sending system notifications with optional sound
|
||||
*/
|
||||
class NotificationService {
|
||||
private mainWindow: (() => BrowserWindow | null) | null = null;
|
||||
|
||||
/**
|
||||
* Initialize the notification service with the main window getter
|
||||
*/
|
||||
initialize(getMainWindow: () => BrowserWindow | null): void {
|
||||
this.mainWindow = getMainWindow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a notification for task completion
|
||||
*/
|
||||
notifyTaskComplete(taskTitle: string, projectId: string, taskId: string): void {
|
||||
this.sendNotification('task-complete', {
|
||||
title: 'Task Complete',
|
||||
body: `"${taskTitle}" has completed and is ready for review`,
|
||||
projectId,
|
||||
taskId
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a notification for task failure
|
||||
*/
|
||||
notifyTaskFailed(taskTitle: string, projectId: string, taskId: string): void {
|
||||
this.sendNotification('task-failed', {
|
||||
title: 'Task Failed',
|
||||
body: `"${taskTitle}" encountered an error`,
|
||||
projectId,
|
||||
taskId
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a notification for review needed
|
||||
*/
|
||||
notifyReviewNeeded(taskTitle: string, projectId: string, taskId: string): void {
|
||||
this.sendNotification('review-needed', {
|
||||
title: 'Review Needed',
|
||||
body: `"${taskTitle}" is ready for your review`,
|
||||
projectId,
|
||||
taskId
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a system notification with optional sound
|
||||
*/
|
||||
private sendNotification(type: NotificationType, options: NotificationOptions): void {
|
||||
// Get notification settings
|
||||
const settings = this.getNotificationSettings(options.projectId);
|
||||
|
||||
// Check if this notification type is enabled
|
||||
if (!this.isNotificationEnabled(type, settings)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Create and show the notification
|
||||
if (Notification.isSupported()) {
|
||||
const notification = new Notification({
|
||||
title: options.title,
|
||||
body: options.body,
|
||||
silent: !settings.sound // Let the OS handle sound if enabled
|
||||
});
|
||||
|
||||
// Focus window when notification is clicked
|
||||
notification.on('click', () => {
|
||||
const window = this.mainWindow?.();
|
||||
if (window) {
|
||||
if (window.isMinimized()) {
|
||||
window.restore();
|
||||
}
|
||||
window.focus();
|
||||
}
|
||||
});
|
||||
|
||||
notification.show();
|
||||
}
|
||||
|
||||
// Play sound if enabled (system beep)
|
||||
if (settings.sound) {
|
||||
this.playNotificationSound();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Play a notification sound
|
||||
*/
|
||||
private playNotificationSound(): void {
|
||||
// Use system beep - works across all platforms
|
||||
shell.beep();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notification settings for a project or fall back to defaults
|
||||
*/
|
||||
private getNotificationSettings(projectId?: string): {
|
||||
onTaskComplete: boolean;
|
||||
onTaskFailed: boolean;
|
||||
onReviewNeeded: boolean;
|
||||
sound: boolean;
|
||||
} {
|
||||
// Try to get project-specific settings
|
||||
if (projectId) {
|
||||
const projects = projectStore.getProjects();
|
||||
const project = projects.find(p => p.id === projectId);
|
||||
if (project?.settings?.notifications) {
|
||||
return project.settings.notifications;
|
||||
}
|
||||
}
|
||||
|
||||
// Fall back to defaults
|
||||
return {
|
||||
onTaskComplete: true,
|
||||
onTaskFailed: true,
|
||||
onReviewNeeded: true,
|
||||
sound: false
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a notification type is enabled in settings
|
||||
*/
|
||||
private isNotificationEnabled(
|
||||
type: NotificationType,
|
||||
settings: {
|
||||
onTaskComplete: boolean;
|
||||
onTaskFailed: boolean;
|
||||
onReviewNeeded: boolean;
|
||||
sound: boolean;
|
||||
}
|
||||
): boolean {
|
||||
switch (type) {
|
||||
case 'task-complete':
|
||||
return settings.onTaskComplete;
|
||||
case 'task-failed':
|
||||
return settings.onTaskFailed;
|
||||
case 'review-needed':
|
||||
return settings.onReviewNeeded;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Export singleton instance
|
||||
export const notificationService = new NotificationService();
|
||||
@@ -0,0 +1,306 @@
|
||||
import path from 'path';
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import { spawn } from 'child_process';
|
||||
import { app } from 'electron';
|
||||
import { EventEmitter } from 'events';
|
||||
import { detectRateLimit, createSDKRateLimitInfo, getProfileEnv } from './rate-limit-detector';
|
||||
|
||||
/**
|
||||
* Debug logging - only logs when AUTO_CLAUDE_DEBUG env var is set
|
||||
*/
|
||||
const DEBUG = process.env.AUTO_CLAUDE_DEBUG === 'true' || process.env.AUTO_CLAUDE_DEBUG === '1';
|
||||
|
||||
function debug(...args: unknown[]): void {
|
||||
if (DEBUG) {
|
||||
console.log('[TerminalNameGenerator]', ...args);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Service for generating terminal names from commands using Claude AI
|
||||
*/
|
||||
export class TerminalNameGenerator extends EventEmitter {
|
||||
private pythonPath: string = 'python3';
|
||||
private autoBuildSourcePath: string = '';
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
debug('TerminalNameGenerator initialized');
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure paths for Python and auto-claude source
|
||||
*/
|
||||
configure(pythonPath?: string, autoBuildSourcePath?: string): void {
|
||||
if (pythonPath) {
|
||||
this.pythonPath = pythonPath;
|
||||
}
|
||||
if (autoBuildSourcePath) {
|
||||
this.autoBuildSourcePath = autoBuildSourcePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the auto-claude source path (detects automatically if not configured)
|
||||
*/
|
||||
private getAutoBuildSourcePath(): string | null {
|
||||
if (this.autoBuildSourcePath && existsSync(this.autoBuildSourcePath)) {
|
||||
return this.autoBuildSourcePath;
|
||||
}
|
||||
|
||||
const possiblePaths = [
|
||||
path.resolve(__dirname, '..', '..', '..', 'auto-claude'),
|
||||
path.resolve(app.getAppPath(), '..', 'auto-claude'),
|
||||
path.resolve(process.cwd(), 'auto-claude')
|
||||
];
|
||||
|
||||
for (const p of possiblePaths) {
|
||||
if (existsSync(p) && existsSync(path.join(p, 'VERSION'))) {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load environment variables from auto-claude .env file
|
||||
*/
|
||||
private loadAutoBuildEnv(): Record<string, string> {
|
||||
const autoBuildSource = this.getAutoBuildSourcePath();
|
||||
if (!autoBuildSource) return {};
|
||||
|
||||
const envPath = path.join(autoBuildSource, '.env');
|
||||
if (!existsSync(envPath)) return {};
|
||||
|
||||
try {
|
||||
const envContent = readFileSync(envPath, 'utf-8');
|
||||
const envVars: Record<string, string> = {};
|
||||
|
||||
// Handle both Unix (\n) and Windows (\r\n) line endings
|
||||
for (const line of envContent.split(/\r?\n/)) {
|
||||
const trimmed = line.trim();
|
||||
if (!trimmed || trimmed.startsWith('#')) continue;
|
||||
|
||||
const eqIndex = trimmed.indexOf('=');
|
||||
if (eqIndex > 0) {
|
||||
const key = trimmed.substring(0, eqIndex).trim();
|
||||
let value = trimmed.substring(eqIndex + 1).trim();
|
||||
|
||||
if ((value.startsWith('"') && value.endsWith('"')) ||
|
||||
(value.startsWith("'") && value.endsWith("'"))) {
|
||||
value = value.slice(1, -1);
|
||||
}
|
||||
|
||||
envVars[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return envVars;
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a terminal name from a command using Claude AI
|
||||
* @param command - The command or recent output to generate a name from
|
||||
* @param cwd - Current working directory for context
|
||||
* @returns Promise resolving to the generated name (2-3 words) or null on failure
|
||||
*/
|
||||
async generateName(command: string, cwd?: string): Promise<string | null> {
|
||||
const autoBuildSource = this.getAutoBuildSourcePath();
|
||||
|
||||
if (!autoBuildSource) {
|
||||
debug('Auto-claude source path not found');
|
||||
return null;
|
||||
}
|
||||
|
||||
const prompt = this.createNamePrompt(command, cwd);
|
||||
const script = this.createGenerationScript(prompt);
|
||||
|
||||
debug('Generating terminal name for command:', command.substring(0, 100) + '...');
|
||||
|
||||
const autoBuildEnv = this.loadAutoBuildEnv();
|
||||
debug('Environment loaded', {
|
||||
hasOAuthToken: !!autoBuildEnv.CLAUDE_CODE_OAUTH_TOKEN
|
||||
});
|
||||
|
||||
// Get active Claude profile environment (CLAUDE_CONFIG_DIR if not default)
|
||||
const profileEnv = getProfileEnv();
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const childProcess = spawn(this.pythonPath, ['-c', script], {
|
||||
cwd: autoBuildSource,
|
||||
env: {
|
||||
...process.env,
|
||||
...autoBuildEnv,
|
||||
...profileEnv, // Include active Claude profile config
|
||||
PYTHONUNBUFFERED: '1'
|
||||
}
|
||||
});
|
||||
|
||||
let output = '';
|
||||
let errorOutput = '';
|
||||
const timeout = setTimeout(() => {
|
||||
debug('Terminal name generation timed out after 30s');
|
||||
childProcess.kill();
|
||||
resolve(null);
|
||||
}, 30000); // 30 second timeout
|
||||
|
||||
childProcess.stdout?.on('data', (data: Buffer) => {
|
||||
output += data.toString();
|
||||
});
|
||||
|
||||
childProcess.stderr?.on('data', (data: Buffer) => {
|
||||
errorOutput += data.toString();
|
||||
});
|
||||
|
||||
childProcess.on('exit', (code: number | null) => {
|
||||
clearTimeout(timeout);
|
||||
|
||||
if (code === 0 && output.trim()) {
|
||||
const name = this.cleanName(output.trim());
|
||||
debug('Generated terminal name:', name);
|
||||
resolve(name);
|
||||
} else {
|
||||
// Check for rate limit
|
||||
const combinedOutput = `${output}\n${errorOutput}`;
|
||||
const rateLimitDetection = detectRateLimit(combinedOutput);
|
||||
if (rateLimitDetection.isRateLimited) {
|
||||
debug('Rate limit detected:', {
|
||||
resetTime: rateLimitDetection.resetTime,
|
||||
limitType: rateLimitDetection.limitType,
|
||||
suggestedProfile: rateLimitDetection.suggestedProfile?.name
|
||||
});
|
||||
|
||||
const rateLimitInfo = createSDKRateLimitInfo('terminal-name-generator', rateLimitDetection);
|
||||
this.emit('sdk-rate-limit', rateLimitInfo);
|
||||
}
|
||||
|
||||
if (!rateLimitDetection.isRateLimited) {
|
||||
debug('Terminal name generation failed', {
|
||||
code,
|
||||
errorOutput: errorOutput.substring(0, 500)
|
||||
});
|
||||
}
|
||||
resolve(null);
|
||||
}
|
||||
});
|
||||
|
||||
childProcess.on('error', (err) => {
|
||||
clearTimeout(timeout);
|
||||
debug('Process error:', err.message);
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the prompt for terminal name generation
|
||||
*/
|
||||
private createNamePrompt(command: string, cwd?: string): string {
|
||||
let prompt = `Generate a very short, descriptive name (2-3 words MAX) for a terminal window based on what it's doing. The name should be concise and help identify the terminal at a glance.
|
||||
|
||||
Command or activity:
|
||||
${command}`;
|
||||
|
||||
if (cwd) {
|
||||
prompt += `
|
||||
|
||||
Working directory:
|
||||
${cwd}`;
|
||||
}
|
||||
|
||||
prompt += `
|
||||
|
||||
Output ONLY the name (2-3 words), nothing else. Examples: "npm build", "git logs", "python tests", "claude dev"`;
|
||||
|
||||
return prompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the Python script to generate terminal name using Claude Agent SDK
|
||||
*/
|
||||
private createGenerationScript(prompt: string): string {
|
||||
// Escape the prompt for Python string - use JSON.stringify for safe escaping
|
||||
const escapedPrompt = JSON.stringify(prompt);
|
||||
|
||||
return `
|
||||
import asyncio
|
||||
import sys
|
||||
|
||||
async def generate_name():
|
||||
try:
|
||||
from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient
|
||||
|
||||
prompt = ${escapedPrompt}
|
||||
|
||||
# Create a minimal client for simple text generation (no tools needed)
|
||||
client = ClaudeSDKClient(
|
||||
options=ClaudeAgentOptions(
|
||||
model="claude-haiku-4-5",
|
||||
system_prompt="You generate very short, concise terminal names (2-3 words MAX). Output ONLY the name, nothing else. No quotes, no explanation, no preamble. Keep it as short as possible while being descriptive.",
|
||||
max_turns=1,
|
||||
)
|
||||
)
|
||||
|
||||
async with client:
|
||||
# Send the query
|
||||
await client.query(prompt)
|
||||
|
||||
# Collect response text from AssistantMessage
|
||||
response_text = ""
|
||||
async for msg in client.receive_response():
|
||||
msg_type = type(msg).__name__
|
||||
if msg_type == "AssistantMessage" and hasattr(msg, "content"):
|
||||
for block in msg.content:
|
||||
block_type = type(block).__name__
|
||||
if block_type == "TextBlock" and hasattr(block, "text"):
|
||||
response_text += block.text
|
||||
|
||||
if response_text:
|
||||
# Clean up the result
|
||||
name = response_text.strip()
|
||||
# Remove any quotes
|
||||
name = name.strip('"').strip("'")
|
||||
# Take first line only
|
||||
name = name.split('\\n')[0].strip()
|
||||
if name:
|
||||
print(name)
|
||||
sys.exit(0)
|
||||
|
||||
# If we get here, no valid response
|
||||
sys.exit(1)
|
||||
|
||||
except ImportError as e:
|
||||
print(f"Import error: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
except Exception as e:
|
||||
print(f"Error: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
asyncio.run(generate_name())
|
||||
`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up the generated name
|
||||
*/
|
||||
private cleanName(name: string): string {
|
||||
// Remove quotes if present
|
||||
let cleaned = name.replace(/^["']|["']$/g, '');
|
||||
|
||||
// Remove any "Terminal:" or similar prefixes
|
||||
cleaned = cleaned.replace(/^(terminal|name)[:\s]*/i, '');
|
||||
|
||||
// Truncate if too long (max 30 chars for terminal names)
|
||||
if (cleaned.length > 30) {
|
||||
cleaned = cleaned.substring(0, 27) + '...';
|
||||
}
|
||||
|
||||
return cleaned.trim();
|
||||
}
|
||||
}
|
||||
|
||||
// Export singleton instance
|
||||
export const terminalNameGenerator = new TerminalNameGenerator();
|
||||
@@ -158,6 +158,9 @@ export interface AgentAPI {
|
||||
downloadAutoBuildSourceUpdate: () => void;
|
||||
getAutoBuildSourceVersion: () => Promise<IPCResult<string>>;
|
||||
onAutoBuildSourceUpdateProgress: (callback: (progress: AutoBuildSourceUpdateProgress) => void) => () => void;
|
||||
|
||||
// Shell Operations
|
||||
openExternal: (url: string) => Promise<void>;
|
||||
}
|
||||
|
||||
export const createAgentAPI = (): AgentAPI => ({
|
||||
@@ -652,5 +655,9 @@ export const createAgentAPI = (): AgentAPI => ({
|
||||
return () => {
|
||||
ipcRenderer.removeListener(IPC_CHANNELS.AUTOBUILD_SOURCE_PROGRESS, handler);
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
// Shell Operations
|
||||
openExternal: (url: string): Promise<void> =>
|
||||
ipcRenderer.invoke(IPC_CHANNELS.SHELL_OPEN_EXTERNAL, url)
|
||||
});
|
||||
|
||||
@@ -12,7 +12,8 @@ import type {
|
||||
ContextSearchResult,
|
||||
MemoryEpisode,
|
||||
ProjectEnvConfig,
|
||||
ClaudeAuthResult
|
||||
ClaudeAuthResult,
|
||||
InfrastructureStatus
|
||||
} from '../../shared/types';
|
||||
|
||||
export interface ProjectAPI {
|
||||
@@ -49,6 +50,13 @@ export interface ProjectAPI {
|
||||
initGit: boolean
|
||||
) => Promise<IPCResult<import('../../shared/types').CreateProjectFolderResult>>;
|
||||
getDefaultProjectLocation: () => Promise<string | null>;
|
||||
|
||||
// Docker & Infrastructure Operations (for Graphiti/FalkorDB)
|
||||
getInfrastructureStatus: (port?: number) => Promise<IPCResult<InfrastructureStatus>>;
|
||||
startFalkorDB: (port?: number) => Promise<IPCResult<{ success: boolean; error?: string }>>;
|
||||
stopFalkorDB: () => Promise<IPCResult<{ success: boolean; error?: string }>>;
|
||||
openDockerDesktop: () => Promise<IPCResult<{ success: boolean; error?: string }>>;
|
||||
getDockerDownloadUrl: () => Promise<string>;
|
||||
}
|
||||
|
||||
export const createProjectAPI = (): ProjectAPI => ({
|
||||
@@ -118,5 +126,21 @@ export const createProjectAPI = (): ProjectAPI => ({
|
||||
ipcRenderer.invoke(IPC_CHANNELS.DIALOG_CREATE_PROJECT_FOLDER, location, name, initGit),
|
||||
|
||||
getDefaultProjectLocation: (): Promise<string | null> =>
|
||||
ipcRenderer.invoke(IPC_CHANNELS.DIALOG_GET_DEFAULT_PROJECT_LOCATION)
|
||||
ipcRenderer.invoke(IPC_CHANNELS.DIALOG_GET_DEFAULT_PROJECT_LOCATION),
|
||||
|
||||
// Docker & Infrastructure Operations
|
||||
getInfrastructureStatus: (port?: number): Promise<IPCResult<InfrastructureStatus>> =>
|
||||
ipcRenderer.invoke(IPC_CHANNELS.DOCKER_STATUS, port),
|
||||
|
||||
startFalkorDB: (port?: number): Promise<IPCResult<{ success: boolean; error?: string }>> =>
|
||||
ipcRenderer.invoke(IPC_CHANNELS.DOCKER_START_FALKORDB, port),
|
||||
|
||||
stopFalkorDB: (): Promise<IPCResult<{ success: boolean; error?: string }>> =>
|
||||
ipcRenderer.invoke(IPC_CHANNELS.DOCKER_STOP_FALKORDB),
|
||||
|
||||
openDockerDesktop: (): Promise<IPCResult<{ success: boolean; error?: string }>> =>
|
||||
ipcRenderer.invoke(IPC_CHANNELS.DOCKER_OPEN_DESKTOP),
|
||||
|
||||
getDockerDownloadUrl: (): Promise<string> =>
|
||||
ipcRenderer.invoke(IPC_CHANNELS.DOCKER_GET_DOWNLOAD_URL)
|
||||
});
|
||||
|
||||
@@ -15,6 +15,7 @@ export interface TerminalAPI {
|
||||
sendTerminalInput: (id: string, data: string) => void;
|
||||
resizeTerminal: (id: string, cols: number, rows: number) => void;
|
||||
invokeClaudeInTerminal: (id: string, cwd?: string) => void;
|
||||
generateTerminalName: (command: string, cwd?: string) => Promise<IPCResult<string>>;
|
||||
|
||||
// Terminal Session Management
|
||||
getTerminalSessions: (projectPath: string) => Promise<IPCResult<import('../../shared/types').TerminalSession[]>>;
|
||||
@@ -81,6 +82,9 @@ export const createTerminalAPI = (): TerminalAPI => ({
|
||||
invokeClaudeInTerminal: (id: string, cwd?: string): void =>
|
||||
ipcRenderer.send(IPC_CHANNELS.TERMINAL_INVOKE_CLAUDE, id, cwd),
|
||||
|
||||
generateTerminalName: (command: string, cwd?: string): Promise<IPCResult<string>> =>
|
||||
ipcRenderer.invoke(IPC_CHANNELS.TERMINAL_GENERATE_NAME, command, cwd),
|
||||
|
||||
// Terminal Session Management
|
||||
getTerminalSessions: (projectPath: string): Promise<IPCResult<import('../../shared/types').TerminalSession[]>> =>
|
||||
ipcRenderer.invoke(IPC_CHANNELS.TERMINAL_GET_SESSIONS, projectPath),
|
||||
|
||||
@@ -19,7 +19,7 @@ import { Sidebar, type SidebarView } from './components/Sidebar';
|
||||
import { KanbanBoard } from './components/KanbanBoard';
|
||||
import { TaskDetailPanel } from './components/TaskDetailPanel';
|
||||
import { TaskCreationWizard } from './components/TaskCreationWizard';
|
||||
import { AppSettingsDialog } from './components/AppSettings';
|
||||
import { AppSettingsDialog, type AppSection } from './components/settings/AppSettings';
|
||||
import { TerminalGrid } from './components/TerminalGrid';
|
||||
import { Roadmap } from './components/Roadmap';
|
||||
import { Context } from './components/Context';
|
||||
@@ -52,12 +52,14 @@ export function App() {
|
||||
const [selectedTask, setSelectedTask] = useState<Task | null>(null);
|
||||
const [isNewTaskDialogOpen, setIsNewTaskDialogOpen] = useState(false);
|
||||
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = useState(false);
|
||||
const [settingsInitialSection, setSettingsInitialSection] = useState<AppSection | undefined>(undefined);
|
||||
const [activeView, setActiveView] = useState<SidebarView>('kanban');
|
||||
|
||||
// Initialize dialog state
|
||||
const [showInitDialog, setShowInitDialog] = useState(false);
|
||||
const [pendingProject, setPendingProject] = useState<Project | null>(null);
|
||||
const [isInitializing, setIsInitializing] = useState(false);
|
||||
const [skippedInitProjectId, setSkippedInitProjectId] = useState<string | null>(null);
|
||||
|
||||
// Get selected project
|
||||
const selectedProject = projects.find((p) => p.id === selectedProjectId);
|
||||
@@ -68,14 +70,31 @@ export function App() {
|
||||
loadSettings();
|
||||
}, []);
|
||||
|
||||
// Listen for open-app-settings events (e.g., from project settings)
|
||||
useEffect(() => {
|
||||
const handleOpenAppSettings = (event: Event) => {
|
||||
const customEvent = event as CustomEvent<AppSection>;
|
||||
const section = customEvent.detail;
|
||||
if (section) {
|
||||
setSettingsInitialSection(section);
|
||||
}
|
||||
setIsSettingsDialogOpen(true);
|
||||
};
|
||||
|
||||
window.addEventListener('open-app-settings', handleOpenAppSettings);
|
||||
return () => {
|
||||
window.removeEventListener('open-app-settings', handleOpenAppSettings);
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Check if selected project needs initialization (e.g., .auto-claude folder was deleted)
|
||||
useEffect(() => {
|
||||
if (selectedProject && !selectedProject.autoBuildPath && !showInitDialog) {
|
||||
if (selectedProject && !selectedProject.autoBuildPath && !showInitDialog && skippedInitProjectId !== selectedProject.id) {
|
||||
// Project exists but isn't initialized - show init dialog
|
||||
setPendingProject(selectedProject);
|
||||
setShowInitDialog(true);
|
||||
}
|
||||
}, [selectedProject, showInitDialog]);
|
||||
}, [selectedProject, showInitDialog, skippedInitProjectId]);
|
||||
|
||||
// Load tasks when project changes
|
||||
useEffect(() => {
|
||||
@@ -188,6 +207,9 @@ export function App() {
|
||||
};
|
||||
|
||||
const handleSkipInit = () => {
|
||||
if (pendingProject) {
|
||||
setSkippedInitProjectId(pendingProject.id);
|
||||
}
|
||||
setShowInitDialog(false);
|
||||
setPendingProject(null);
|
||||
};
|
||||
@@ -219,12 +241,7 @@ export function App() {
|
||||
<header className="electron-drag flex h-14 items-center justify-between border-b border-border bg-card/50 backdrop-blur-sm px-6">
|
||||
<div className="electron-no-drag">
|
||||
{selectedProject ? (
|
||||
<div>
|
||||
<h1 className="font-semibold text-foreground">{selectedProject.name}</h1>
|
||||
<p className="text-xs text-muted-foreground truncate max-w-md">
|
||||
{selectedProject.path}
|
||||
</p>
|
||||
</div>
|
||||
<h1 className="font-semibold text-foreground">{selectedProject.name}</h1>
|
||||
) : (
|
||||
<div className="text-muted-foreground">
|
||||
Select a project to get started
|
||||
@@ -326,11 +343,24 @@ export function App() {
|
||||
|
||||
<AppSettingsDialog
|
||||
open={isSettingsDialogOpen}
|
||||
onOpenChange={setIsSettingsDialogOpen}
|
||||
onOpenChange={(open) => {
|
||||
setIsSettingsDialogOpen(open);
|
||||
if (!open) {
|
||||
// Reset initial section when dialog closes
|
||||
setSettingsInitialSection(undefined);
|
||||
}
|
||||
}}
|
||||
initialSection={settingsInitialSection}
|
||||
/>
|
||||
|
||||
{/* Initialize Auto Claude Dialog */}
|
||||
<Dialog open={showInitDialog} onOpenChange={setShowInitDialog}>
|
||||
<Dialog open={showInitDialog} onOpenChange={(open) => {
|
||||
if (!open) {
|
||||
handleSkipInit();
|
||||
} else {
|
||||
setShowInitDialog(true);
|
||||
}
|
||||
}}>
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
* New code should import from './settings' instead.
|
||||
*/
|
||||
|
||||
export { AppSettingsDialog } from './settings';
|
||||
export { AppSettingsDialog, type AppSection } from './settings';
|
||||
|
||||
@@ -54,7 +54,8 @@ import type {
|
||||
AutoBuildVersionInfo,
|
||||
ProjectEnvConfig,
|
||||
LinearSyncStatus,
|
||||
GitHubSyncStatus
|
||||
GitHubSyncStatus,
|
||||
InfrastructureStatus
|
||||
} from '../../shared/types';
|
||||
|
||||
interface ProjectSettingsProps {
|
||||
@@ -100,6 +101,12 @@ export function ProjectSettings({ project, open, onOpenChange }: ProjectSettings
|
||||
const [isCheckingClaudeAuth, setIsCheckingClaudeAuth] = useState(false);
|
||||
const [claudeAuthStatus, setClaudeAuthStatus] = useState<'checking' | 'authenticated' | 'not_authenticated' | 'error'>('checking');
|
||||
|
||||
// Docker/FalkorDB infrastructure status
|
||||
const [infrastructureStatus, setInfrastructureStatus] = useState<InfrastructureStatus | null>(null);
|
||||
const [isCheckingInfrastructure, setIsCheckingInfrastructure] = useState(false);
|
||||
const [isStartingFalkorDB, setIsStartingFalkorDB] = useState(false);
|
||||
const [isOpeningDocker, setIsOpeningDocker] = useState(false);
|
||||
|
||||
// Linear import state
|
||||
const [showLinearImportModal, setShowLinearImportModal] = useState(false);
|
||||
const [linearConnectionStatus, setLinearConnectionStatus] = useState<LinearSyncStatus | null>(null);
|
||||
@@ -221,6 +228,84 @@ export function ProjectSettings({ project, open, onOpenChange }: ProjectSettings
|
||||
}
|
||||
}, [envConfig?.githubEnabled, envConfig?.githubToken, envConfig?.githubRepo, project.id]);
|
||||
|
||||
// Check Docker/FalkorDB infrastructure status when Graphiti is enabled
|
||||
useEffect(() => {
|
||||
const checkInfrastructure = async () => {
|
||||
if (!envConfig?.graphitiEnabled) {
|
||||
setInfrastructureStatus(null);
|
||||
return;
|
||||
}
|
||||
|
||||
setIsCheckingInfrastructure(true);
|
||||
try {
|
||||
const port = envConfig.graphitiFalkorDbPort || 6380;
|
||||
const result = await window.electronAPI.getInfrastructureStatus(port);
|
||||
if (result.success && result.data) {
|
||||
setInfrastructureStatus(result.data);
|
||||
}
|
||||
} catch {
|
||||
// Silently fail - infrastructure check is optional
|
||||
} finally {
|
||||
setIsCheckingInfrastructure(false);
|
||||
}
|
||||
};
|
||||
|
||||
checkInfrastructure();
|
||||
// Refresh every 10 seconds while Graphiti is enabled
|
||||
let interval: NodeJS.Timeout | undefined;
|
||||
if (envConfig?.graphitiEnabled && open) {
|
||||
interval = setInterval(checkInfrastructure, 10000);
|
||||
}
|
||||
return () => {
|
||||
if (interval) clearInterval(interval);
|
||||
};
|
||||
}, [envConfig?.graphitiEnabled, envConfig?.graphitiFalkorDbPort, open]);
|
||||
|
||||
// Handler to start FalkorDB
|
||||
const handleStartFalkorDB = async () => {
|
||||
setIsStartingFalkorDB(true);
|
||||
try {
|
||||
const port = envConfig?.graphitiFalkorDbPort || 6380;
|
||||
const result = await window.electronAPI.startFalkorDB(port);
|
||||
if (result.success && result.data?.success) {
|
||||
// Refresh status after starting
|
||||
const statusResult = await window.electronAPI.getInfrastructureStatus(port);
|
||||
if (statusResult.success && statusResult.data) {
|
||||
setInfrastructureStatus(statusResult.data);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Error handling is implicit in the status check
|
||||
} finally {
|
||||
setIsStartingFalkorDB(false);
|
||||
}
|
||||
};
|
||||
|
||||
// Handler to open Docker Desktop
|
||||
const handleOpenDockerDesktop = async () => {
|
||||
setIsOpeningDocker(true);
|
||||
try {
|
||||
await window.electronAPI.openDockerDesktop();
|
||||
// Wait a bit then refresh status
|
||||
setTimeout(async () => {
|
||||
const port = envConfig?.graphitiFalkorDbPort || 6380;
|
||||
const result = await window.electronAPI.getInfrastructureStatus(port);
|
||||
if (result.success && result.data) {
|
||||
setInfrastructureStatus(result.data);
|
||||
}
|
||||
setIsOpeningDocker(false);
|
||||
}, 3000);
|
||||
} catch {
|
||||
setIsOpeningDocker(false);
|
||||
}
|
||||
};
|
||||
|
||||
// Handler to open Docker download page
|
||||
const handleDownloadDocker = async () => {
|
||||
const url = await window.electronAPI.getDockerDownloadUrl();
|
||||
window.electronAPI.openExternal(url);
|
||||
};
|
||||
|
||||
const toggleSection = (section: string) => {
|
||||
setExpandedSections(prev => ({ ...prev, [section]: !prev[section] }));
|
||||
};
|
||||
@@ -920,11 +1005,115 @@ export function ProjectSettings({ project, open, onOpenChange }: ProjectSettings
|
||||
|
||||
{envConfig.graphitiEnabled && (
|
||||
<>
|
||||
<div className="rounded-lg border border-warning/30 bg-warning/5 p-3">
|
||||
<p className="text-xs text-warning">
|
||||
Requires FalkorDB running. Start with:{' '}
|
||||
<code className="px-1 bg-warning/10 rounded">docker-compose up -d falkordb</code>
|
||||
</p>
|
||||
{/* Infrastructure Status - Dynamic Docker/FalkorDB check */}
|
||||
<div className="rounded-lg border border-border bg-muted/30 p-3 space-y-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-sm font-medium text-foreground">Infrastructure Status</span>
|
||||
{isCheckingInfrastructure && (
|
||||
<Loader2 className="h-4 w-4 animate-spin text-muted-foreground" />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Docker Status */}
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
{infrastructureStatus?.docker.running ? (
|
||||
<CheckCircle2 className="h-4 w-4 text-success" />
|
||||
) : infrastructureStatus?.docker.installed ? (
|
||||
<AlertCircle className="h-4 w-4 text-warning" />
|
||||
) : (
|
||||
<AlertCircle className="h-4 w-4 text-destructive" />
|
||||
)}
|
||||
<span className="text-xs text-foreground">Docker</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
{infrastructureStatus?.docker.running ? (
|
||||
<span className="text-xs text-success">Running</span>
|
||||
) : infrastructureStatus?.docker.installed ? (
|
||||
<>
|
||||
<span className="text-xs text-warning">Not Running</span>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onClick={handleOpenDockerDesktop}
|
||||
disabled={isOpeningDocker}
|
||||
className="h-6 text-xs"
|
||||
>
|
||||
{isOpeningDocker ? (
|
||||
<Loader2 className="h-3 w-3 animate-spin mr-1" />
|
||||
) : null}
|
||||
Start Docker
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<span className="text-xs text-destructive">Not Installed</span>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onClick={handleDownloadDocker}
|
||||
className="h-6 text-xs"
|
||||
>
|
||||
<Download className="h-3 w-3 mr-1" />
|
||||
Install
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* FalkorDB Status */}
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
{infrastructureStatus?.falkordb.healthy ? (
|
||||
<CheckCircle2 className="h-4 w-4 text-success" />
|
||||
) : infrastructureStatus?.falkordb.containerRunning ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin text-warning" />
|
||||
) : (
|
||||
<AlertCircle className="h-4 w-4 text-muted-foreground" />
|
||||
)}
|
||||
<span className="text-xs text-foreground">FalkorDB</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
{infrastructureStatus?.falkordb.healthy ? (
|
||||
<span className="text-xs text-success">Ready</span>
|
||||
) : infrastructureStatus?.falkordb.containerRunning ? (
|
||||
<span className="text-xs text-warning">Starting...</span>
|
||||
) : infrastructureStatus?.docker.running ? (
|
||||
<>
|
||||
<span className="text-xs text-muted-foreground">Not Running</span>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onClick={handleStartFalkorDB}
|
||||
disabled={isStartingFalkorDB}
|
||||
className="h-6 text-xs"
|
||||
>
|
||||
{isStartingFalkorDB ? (
|
||||
<Loader2 className="h-3 w-3 animate-spin mr-1" />
|
||||
) : (
|
||||
<Zap className="h-3 w-3 mr-1" />
|
||||
)}
|
||||
Start
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<span className="text-xs text-muted-foreground">Requires Docker</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Overall Status Message */}
|
||||
{infrastructureStatus?.ready ? (
|
||||
<div className="text-xs text-success flex items-center gap-1">
|
||||
<CheckCircle2 className="h-3 w-3" />
|
||||
Graph memory is ready to use
|
||||
</div>
|
||||
) : infrastructureStatus && !infrastructureStatus.docker.installed && (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Docker Desktop is required for graph-based memory.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Graphiti MCP Server Toggle */}
|
||||
@@ -985,7 +1174,7 @@ export function ProjectSettings({ project, open, onOpenChange }: ProjectSettings
|
||||
<SelectValue placeholder="Select LLM provider" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="openai">OpenAI (GPT-4o)</SelectItem>
|
||||
<SelectItem value="openai">OpenAI (GPT-5-mini)</SelectItem>
|
||||
<SelectItem value="anthropic">Anthropic (Claude)</SelectItem>
|
||||
<SelectItem value="google">Google (Gemini)</SelectItem>
|
||||
<SelectItem value="groq">Groq (Llama)</SelectItem>
|
||||
@@ -1141,39 +1330,6 @@ export function ProjectSettings({ project, open, onOpenChange }: ProjectSettings
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="space-y-0.5">
|
||||
<Label className="font-normal text-foreground">Parallel Execution</Label>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Run multiple subtasks simultaneously
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings.parallelEnabled}
|
||||
onCheckedChange={(checked) =>
|
||||
setSettings({ ...settings, parallelEnabled: checked })
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{settings.parallelEnabled && (
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="workers" className="text-sm font-medium text-foreground">Max Workers</Label>
|
||||
<Input
|
||||
id="workers"
|
||||
type="number"
|
||||
min={1}
|
||||
max={8}
|
||||
value={settings.maxWorkers}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
...settings,
|
||||
maxWorkers: parseInt(e.target.value) || 1
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
</section>
|
||||
|
||||
<Separator />
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
/**
|
||||
* TaskEditDialog - Dialog for editing task title and description
|
||||
* TaskEditDialog - Dialog for editing task details
|
||||
*
|
||||
* Allows users to modify the title and description of an existing task.
|
||||
* Allows users to modify all task properties including title, description,
|
||||
* classification fields, images, and review settings.
|
||||
* Follows the same dialog pattern as TaskCreationWizard for consistency.
|
||||
*
|
||||
* Features:
|
||||
* - Pre-populates form with current task values
|
||||
* - Form validation (title and description required)
|
||||
* - Shows attached images in read-only mode (if task has images)
|
||||
* - Form validation (description required)
|
||||
* - Editable classification fields (category, priority, complexity, impact)
|
||||
* - Editable image attachments (add/remove images)
|
||||
* - Editable review settings (requireReviewBeforeCoding)
|
||||
* - Saves changes via persistUpdateTask (updates store + spec files)
|
||||
* - Prevents save when no changes have been made
|
||||
*
|
||||
@@ -21,8 +24,8 @@
|
||||
* />
|
||||
* ```
|
||||
*/
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Loader2, Image as ImageIcon, ChevronDown, ChevronUp } from 'lucide-react';
|
||||
import { useState, useEffect, useCallback, useRef, type ClipboardEvent } from 'react';
|
||||
import { Loader2, Image as ImageIcon, ChevronDown, ChevronUp, X } from 'lucide-react';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -35,9 +38,33 @@ import { Button } from './ui/button';
|
||||
import { Input } from './ui/input';
|
||||
import { Textarea } from './ui/textarea';
|
||||
import { Label } from './ui/label';
|
||||
import { Checkbox } from './ui/checkbox';
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue
|
||||
} from './ui/select';
|
||||
import {
|
||||
ImageUpload,
|
||||
generateImageId,
|
||||
blobToBase64,
|
||||
createThumbnail,
|
||||
isValidImageMimeType,
|
||||
resolveFilename
|
||||
} from './ImageUpload';
|
||||
import { persistUpdateTask } from '../stores/task-store';
|
||||
import { cn } from '../lib/utils';
|
||||
import type { Task, ImageAttachment } from '../../shared/types';
|
||||
import type { Task, ImageAttachment, TaskCategory, TaskPriority, TaskComplexity, TaskImpact } from '../../shared/types';
|
||||
import {
|
||||
TASK_CATEGORY_LABELS,
|
||||
TASK_PRIORITY_LABELS,
|
||||
TASK_COMPLEXITY_LABELS,
|
||||
TASK_IMPACT_LABELS,
|
||||
MAX_IMAGES_PER_TASK,
|
||||
ALLOWED_IMAGE_TYPES_DISPLAY
|
||||
} from '../../shared/constants';
|
||||
|
||||
/**
|
||||
* Props for the TaskEditDialog component
|
||||
@@ -58,21 +85,129 @@ export function TaskEditDialog({ task, open, onOpenChange, onSaved }: TaskEditDi
|
||||
const [description, setDescription] = useState(task.description);
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [showAdvanced, setShowAdvanced] = useState(false);
|
||||
const [showImages, setShowImages] = useState(false);
|
||||
const [pasteSuccess, setPasteSuccess] = useState(false);
|
||||
|
||||
// Get attached images from task metadata
|
||||
const attachedImages: ImageAttachment[] = task.metadata?.attachedImages || [];
|
||||
// Classification fields
|
||||
const [category, setCategory] = useState<TaskCategory | ''>(task.metadata?.category || '');
|
||||
const [priority, setPriority] = useState<TaskPriority | ''>(task.metadata?.priority || '');
|
||||
const [complexity, setComplexity] = useState<TaskComplexity | ''>(task.metadata?.complexity || '');
|
||||
const [impact, setImpact] = useState<TaskImpact | ''>(task.metadata?.impact || '');
|
||||
|
||||
// Image attachments
|
||||
const [images, setImages] = useState<ImageAttachment[]>(task.metadata?.attachedImages || []);
|
||||
|
||||
// Review setting
|
||||
const [requireReviewBeforeCoding, setRequireReviewBeforeCoding] = useState(
|
||||
task.metadata?.requireReviewBeforeCoding ?? false
|
||||
);
|
||||
|
||||
// Ref for the textarea to handle paste events
|
||||
const descriptionRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
||||
// Reset form when task changes or dialog opens
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
setTitle(task.title);
|
||||
setDescription(task.description);
|
||||
setCategory(task.metadata?.category || '');
|
||||
setPriority(task.metadata?.priority || '');
|
||||
setComplexity(task.metadata?.complexity || '');
|
||||
setImpact(task.metadata?.impact || '');
|
||||
setImages(task.metadata?.attachedImages || []);
|
||||
setRequireReviewBeforeCoding(task.metadata?.requireReviewBeforeCoding ?? false);
|
||||
setError(null);
|
||||
|
||||
// Auto-expand sections if they have content
|
||||
if (task.metadata?.category || task.metadata?.priority || task.metadata?.complexity || task.metadata?.impact) {
|
||||
setShowAdvanced(true);
|
||||
}
|
||||
// Auto-expand images section if task has images
|
||||
setShowImages(attachedImages.length > 0);
|
||||
setShowImages((task.metadata?.attachedImages || []).length > 0);
|
||||
setPasteSuccess(false);
|
||||
}
|
||||
}, [open, task.title, task.description, attachedImages.length]);
|
||||
}, [open, task]);
|
||||
|
||||
/**
|
||||
* Handle paste event for screenshot support
|
||||
*/
|
||||
const handlePaste = useCallback(async (e: ClipboardEvent<HTMLTextAreaElement>) => {
|
||||
const clipboardItems = e.clipboardData?.items;
|
||||
if (!clipboardItems) return;
|
||||
|
||||
// Find image items in clipboard
|
||||
const imageItems: DataTransferItem[] = [];
|
||||
for (let i = 0; i < clipboardItems.length; i++) {
|
||||
const item = clipboardItems[i];
|
||||
if (item.type.startsWith('image/')) {
|
||||
imageItems.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
// If no images, allow normal paste behavior
|
||||
if (imageItems.length === 0) return;
|
||||
|
||||
// Prevent default paste when we have images
|
||||
e.preventDefault();
|
||||
|
||||
// Check if we can add more images
|
||||
const remainingSlots = MAX_IMAGES_PER_TASK - images.length;
|
||||
if (remainingSlots <= 0) {
|
||||
setError(`Maximum of ${MAX_IMAGES_PER_TASK} images allowed`);
|
||||
return;
|
||||
}
|
||||
|
||||
setError(null);
|
||||
|
||||
// Process image items
|
||||
const newImages: ImageAttachment[] = [];
|
||||
const existingFilenames = images.map(img => img.filename);
|
||||
|
||||
for (const item of imageItems.slice(0, remainingSlots)) {
|
||||
const file = item.getAsFile();
|
||||
if (!file) continue;
|
||||
|
||||
// Validate image type
|
||||
if (!isValidImageMimeType(file.type)) {
|
||||
setError(`Invalid image type. Allowed: ${ALLOWED_IMAGE_TYPES_DISPLAY}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
const dataUrl = await blobToBase64(file);
|
||||
const thumbnail = await createThumbnail(dataUrl);
|
||||
|
||||
// Generate filename for pasted images (screenshot-timestamp.ext)
|
||||
const extension = file.type.split('/')[1] || 'png';
|
||||
const baseFilename = `screenshot-${Date.now()}.${extension}`;
|
||||
const resolvedFilename = resolveFilename(baseFilename, [
|
||||
...existingFilenames,
|
||||
...newImages.map(img => img.filename)
|
||||
]);
|
||||
|
||||
newImages.push({
|
||||
id: generateImageId(),
|
||||
filename: resolvedFilename,
|
||||
mimeType: file.type,
|
||||
size: file.size,
|
||||
data: dataUrl.split(',')[1], // Store base64 without data URL prefix
|
||||
thumbnail
|
||||
});
|
||||
} catch {
|
||||
setError('Failed to process pasted image');
|
||||
}
|
||||
}
|
||||
|
||||
if (newImages.length > 0) {
|
||||
setImages(prev => [...prev, ...newImages]);
|
||||
// Auto-expand images section
|
||||
setShowImages(true);
|
||||
// Show success feedback
|
||||
setPasteSuccess(true);
|
||||
setTimeout(() => setPasteSuccess(false), 2000);
|
||||
}
|
||||
}, [images]);
|
||||
|
||||
const handleSave = async () => {
|
||||
// Validate input - only description is required
|
||||
@@ -84,7 +219,17 @@ export function TaskEditDialog({ task, open, onOpenChange, onSaved }: TaskEditDi
|
||||
// Check if anything changed
|
||||
const trimmedTitle = title.trim();
|
||||
const trimmedDescription = description.trim();
|
||||
if (trimmedTitle === task.title && trimmedDescription === task.description) {
|
||||
const hasChanges =
|
||||
trimmedTitle !== task.title ||
|
||||
trimmedDescription !== task.description ||
|
||||
category !== (task.metadata?.category || '') ||
|
||||
priority !== (task.metadata?.priority || '') ||
|
||||
complexity !== (task.metadata?.complexity || '') ||
|
||||
impact !== (task.metadata?.impact || '') ||
|
||||
requireReviewBeforeCoding !== (task.metadata?.requireReviewBeforeCoding ?? false) ||
|
||||
JSON.stringify(images) !== JSON.stringify(task.metadata?.attachedImages || []);
|
||||
|
||||
if (!hasChanges) {
|
||||
// No changes, just close
|
||||
onOpenChange(false);
|
||||
return;
|
||||
@@ -93,10 +238,20 @@ export function TaskEditDialog({ task, open, onOpenChange, onSaved }: TaskEditDi
|
||||
setIsSaving(true);
|
||||
setError(null);
|
||||
|
||||
// Build metadata updates
|
||||
const metadataUpdates: Partial<typeof task.metadata> = {};
|
||||
if (category) metadataUpdates.category = category;
|
||||
if (priority) metadataUpdates.priority = priority;
|
||||
if (complexity) metadataUpdates.complexity = complexity;
|
||||
if (impact) metadataUpdates.impact = impact;
|
||||
if (images.length > 0) metadataUpdates.attachedImages = images;
|
||||
metadataUpdates.requireReviewBeforeCoding = requireReviewBeforeCoding;
|
||||
|
||||
// Title is optional - if empty, it will be auto-generated by the backend
|
||||
const success = await persistUpdateTask(task.id, {
|
||||
title: trimmedTitle,
|
||||
description: trimmedDescription
|
||||
description: trimmedDescription,
|
||||
metadata: metadataUpdates
|
||||
});
|
||||
|
||||
if (success) {
|
||||
@@ -124,7 +279,7 @@ export function TaskEditDialog({ task, open, onOpenChange, onSaved }: TaskEditDi
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-foreground">Edit Task</DialogTitle>
|
||||
<DialogDescription>
|
||||
Update the task title and description. Changes will be saved to the spec files.
|
||||
Update task details including title, description, classification, images, and settings. Changes will be saved to the spec files.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -135,13 +290,18 @@ export function TaskEditDialog({ task, open, onOpenChange, onSaved }: TaskEditDi
|
||||
Description <span className="text-destructive">*</span>
|
||||
</Label>
|
||||
<Textarea
|
||||
ref={descriptionRef}
|
||||
id="edit-description"
|
||||
placeholder="Describe the feature, bug fix, or improvement..."
|
||||
placeholder="Describe the feature, bug fix, or improvement. Be as specific as possible about requirements, constraints, and expected behavior."
|
||||
value={description}
|
||||
onChange={(e) => setDescription(e.target.value)}
|
||||
onPaste={handlePaste}
|
||||
rows={5}
|
||||
disabled={isSaving}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Tip: Paste screenshots directly with {navigator.platform.includes('Mac') ? '⌘V' : 'Ctrl+V'} to add reference images.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Title (Optional - Auto-generated if empty) */}
|
||||
@@ -161,71 +321,202 @@ export function TaskEditDialog({ task, open, onOpenChange, onSaved }: TaskEditDi
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Read-only Images Section (only shown if task has images) */}
|
||||
{attachedImages.length > 0 && (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowImages(!showImages)}
|
||||
className={cn(
|
||||
'flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors',
|
||||
'w-full justify-between py-2 px-3 rounded-md hover:bg-muted/50'
|
||||
)}
|
||||
disabled={isSaving}
|
||||
>
|
||||
<span className="flex items-center gap-2">
|
||||
<ImageIcon className="h-4 w-4" />
|
||||
Attached Images
|
||||
<span className="text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded">
|
||||
{attachedImages.length}
|
||||
</span>
|
||||
</span>
|
||||
{showImages ? (
|
||||
<ChevronUp className="h-4 w-4" />
|
||||
) : (
|
||||
<ChevronDown className="h-4 w-4" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
{showImages && (
|
||||
<div className="space-y-3 p-4 rounded-lg border border-border bg-muted/30">
|
||||
<p className="text-xs text-muted-foreground">
|
||||
These images were attached when the task was created. They cannot be modified.
|
||||
</p>
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
{attachedImages.map((image) => (
|
||||
<div
|
||||
key={image.id}
|
||||
className="relative group rounded-lg overflow-hidden border border-border bg-background"
|
||||
>
|
||||
{image.thumbnail ? (
|
||||
<img
|
||||
src={`data:${image.mimeType};base64,${image.thumbnail}`}
|
||||
alt={image.filename}
|
||||
className="w-full h-24 object-cover"
|
||||
/>
|
||||
) : (
|
||||
<div className="w-full h-24 flex items-center justify-center bg-muted">
|
||||
<ImageIcon className="h-8 w-8 text-muted-foreground" />
|
||||
</div>
|
||||
)}
|
||||
<div className="absolute bottom-0 left-0 right-0 bg-black/60 px-2 py-1">
|
||||
<p className="text-xs text-white truncate" title={image.filename}>
|
||||
{image.filename}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
{/* Paste Success Indicator */}
|
||||
{pasteSuccess && (
|
||||
<div className="flex items-center gap-2 text-sm text-success animate-in fade-in slide-in-from-top-1 duration-200">
|
||||
<ImageIcon className="h-4 w-4" />
|
||||
Image added successfully!
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Advanced Options Toggle */}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowAdvanced(!showAdvanced)}
|
||||
className={cn(
|
||||
'flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors',
|
||||
'w-full justify-between py-2 px-3 rounded-md hover:bg-muted/50'
|
||||
)}
|
||||
disabled={isSaving}
|
||||
>
|
||||
<span>Classification (optional)</span>
|
||||
{showAdvanced ? (
|
||||
<ChevronUp className="h-4 w-4" />
|
||||
) : (
|
||||
<ChevronDown className="h-4 w-4" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
{/* Advanced Options */}
|
||||
{showAdvanced && (
|
||||
<div className="space-y-4 p-4 rounded-lg border border-border bg-muted/30">
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
{/* Category */}
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="edit-category" className="text-xs font-medium text-muted-foreground">
|
||||
Category
|
||||
</Label>
|
||||
<Select
|
||||
value={category}
|
||||
onValueChange={(value) => setCategory(value as TaskCategory)}
|
||||
disabled={isSaving}
|
||||
>
|
||||
<SelectTrigger id="edit-category" className="h-9">
|
||||
<SelectValue placeholder="Select category" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{Object.entries(TASK_CATEGORY_LABELS).map(([value, label]) => (
|
||||
<SelectItem key={value} value={value}>
|
||||
{label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
{/* Priority */}
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="edit-priority" className="text-xs font-medium text-muted-foreground">
|
||||
Priority
|
||||
</Label>
|
||||
<Select
|
||||
value={priority}
|
||||
onValueChange={(value) => setPriority(value as TaskPriority)}
|
||||
disabled={isSaving}
|
||||
>
|
||||
<SelectTrigger id="edit-priority" className="h-9">
|
||||
<SelectValue placeholder="Select priority" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{Object.entries(TASK_PRIORITY_LABELS).map(([value, label]) => (
|
||||
<SelectItem key={value} value={value}>
|
||||
{label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
{/* Complexity */}
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="edit-complexity" className="text-xs font-medium text-muted-foreground">
|
||||
Complexity
|
||||
</Label>
|
||||
<Select
|
||||
value={complexity}
|
||||
onValueChange={(value) => setComplexity(value as TaskComplexity)}
|
||||
disabled={isSaving}
|
||||
>
|
||||
<SelectTrigger id="edit-complexity" className="h-9">
|
||||
<SelectValue placeholder="Select complexity" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{Object.entries(TASK_COMPLEXITY_LABELS).map(([value, label]) => (
|
||||
<SelectItem key={value} value={value}>
|
||||
{label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
{/* Impact */}
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="edit-impact" className="text-xs font-medium text-muted-foreground">
|
||||
Impact
|
||||
</Label>
|
||||
<Select
|
||||
value={impact}
|
||||
onValueChange={(value) => setImpact(value as TaskImpact)}
|
||||
disabled={isSaving}
|
||||
>
|
||||
<SelectTrigger id="edit-impact" className="h-9">
|
||||
<SelectValue placeholder="Select impact" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{Object.entries(TASK_IMPACT_LABELS).map(([value, label]) => (
|
||||
<SelectItem key={value} value={value}>
|
||||
{label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-muted-foreground">
|
||||
These labels help organize and prioritize tasks. They're optional but useful for filtering.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Images Toggle */}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowImages(!showImages)}
|
||||
className={cn(
|
||||
'flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors',
|
||||
'w-full justify-between py-2 px-3 rounded-md hover:bg-muted/50'
|
||||
)}
|
||||
disabled={isSaving}
|
||||
>
|
||||
<span className="flex items-center gap-2">
|
||||
<ImageIcon className="h-4 w-4" />
|
||||
Reference Images (optional)
|
||||
{images.length > 0 && (
|
||||
<span className="text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded">
|
||||
{images.length}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
{showImages ? (
|
||||
<ChevronUp className="h-4 w-4" />
|
||||
) : (
|
||||
<ChevronDown className="h-4 w-4" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
{/* Image Upload Section */}
|
||||
{showImages && (
|
||||
<div className="space-y-3 p-4 rounded-lg border border-border bg-muted/30">
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Attach screenshots, mockups, or diagrams to provide visual context for the AI.
|
||||
</p>
|
||||
<ImageUpload
|
||||
images={images}
|
||||
onImagesChange={setImages}
|
||||
disabled={isSaving}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Review Requirement Toggle */}
|
||||
<div className="flex items-start gap-3 p-4 rounded-lg border border-border bg-muted/30">
|
||||
<Checkbox
|
||||
id="edit-require-review"
|
||||
checked={requireReviewBeforeCoding}
|
||||
onCheckedChange={(checked) => setRequireReviewBeforeCoding(checked === true)}
|
||||
disabled={isSaving}
|
||||
className="mt-0.5"
|
||||
/>
|
||||
<div className="flex-1 space-y-1">
|
||||
<Label
|
||||
htmlFor="edit-require-review"
|
||||
className="text-sm font-medium text-foreground cursor-pointer"
|
||||
>
|
||||
Require human review before coding
|
||||
</Label>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
When enabled, you'll be prompted to review the spec and implementation plan before the coding phase begins. This allows you to approve, request changes, or provide feedback.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Error */}
|
||||
{error && (
|
||||
<div className="rounded-lg bg-[var(--error-light)] border border-[var(--error)]/30 p-3 text-sm text-[var(--error)]">
|
||||
{error}
|
||||
<div className="flex items-start gap-2 rounded-lg bg-destructive/10 border border-destructive/30 p-3 text-sm text-destructive">
|
||||
<X className="h-4 w-4 mt-0.5 flex-shrink-0" />
|
||||
<span>{error}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { X, Sparkles, TerminalSquare, ListTodo, FileDown, ChevronDown, Circle, L
|
||||
import { Button } from './ui/button';
|
||||
import { cn } from '../lib/utils';
|
||||
import { useTerminalStore, type TerminalStatus } from '../stores/terminal-store';
|
||||
import { useSettingsStore } from '../stores/settings-store';
|
||||
import type { Task, ExecutionPhase } from '../../shared/types';
|
||||
import {
|
||||
Select,
|
||||
@@ -67,6 +68,9 @@ export function Terminal({ id, cwd, projectPath, isActive, onClose, onActivate,
|
||||
const isCreatedRef = useRef(false);
|
||||
const isMountedRef = useRef(true);
|
||||
const titleInputRef = useRef<HTMLInputElement>(null);
|
||||
const commandBufferRef = useRef<string>('');
|
||||
const lastCommandRef = useRef<string>('');
|
||||
const autoNameTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
||||
|
||||
// Title editing state
|
||||
const [isEditingTitle, setIsEditingTitle] = useState(false);
|
||||
@@ -77,6 +81,7 @@ export function Terminal({ id, cwd, projectPath, isActive, onClose, onActivate,
|
||||
const setClaudeMode = useTerminalStore((state) => state.setClaudeMode);
|
||||
const updateTerminal = useTerminalStore((state) => state.updateTerminal);
|
||||
const setAssociatedTask = useTerminalStore((state) => state.setAssociatedTask);
|
||||
const autoNameTerminals = useSettingsStore((state) => state.settings.autoNameTerminals);
|
||||
|
||||
// Filter tasks to only show backlog (Planning) status tasks for dropdown
|
||||
const backlogTasks = tasks.filter((t) => t.status === 'backlog');
|
||||
@@ -92,6 +97,30 @@ export function Terminal({ id, cwd, projectPath, isActive, onClose, onActivate,
|
||||
data: { type: 'terminal', terminalId: id }
|
||||
});
|
||||
|
||||
// Auto-naming function - generates terminal name based on commands
|
||||
const triggerAutoNaming = useCallback(async () => {
|
||||
// Only auto-name if setting is enabled, not in Claude mode, and we have a command
|
||||
if (!autoNameTerminals || terminal?.isClaudeMode || !lastCommandRef.current.trim()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const command = lastCommandRef.current.trim();
|
||||
// Skip very short or common commands
|
||||
if (command.length < 2 || ['ls', 'cd', 'll', 'pwd', 'exit', 'clear'].includes(command)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await window.electronAPI.generateTerminalName(command, terminal?.cwd || cwd);
|
||||
if (result.success && result.data) {
|
||||
updateTerminal(id, { title: result.data });
|
||||
}
|
||||
} catch (error) {
|
||||
// Silently fail - auto-naming is not critical
|
||||
console.debug('[Terminal] Auto-naming failed:', error);
|
||||
}
|
||||
}, [autoNameTerminals, terminal?.isClaudeMode, terminal?.cwd, cwd, id, updateTerminal]);
|
||||
|
||||
// Initialize xterm.js UI (separate from PTY creation)
|
||||
useEffect(() => {
|
||||
if (!terminalRef.current || xtermRef.current) return;
|
||||
@@ -167,6 +196,32 @@ export function Terminal({ id, cwd, projectPath, isActive, onClose, onActivate,
|
||||
// Handle terminal input - send to main process
|
||||
xterm.onData((data) => {
|
||||
window.electronAPI.sendTerminalInput(id, data);
|
||||
|
||||
// Track commands for auto-naming
|
||||
if (data === '\r' || data === '\n') {
|
||||
// Enter pressed - save the command and schedule auto-naming
|
||||
lastCommandRef.current = commandBufferRef.current;
|
||||
commandBufferRef.current = '';
|
||||
|
||||
// Clear any pending auto-naming
|
||||
if (autoNameTimeoutRef.current) {
|
||||
clearTimeout(autoNameTimeoutRef.current);
|
||||
}
|
||||
|
||||
// Trigger auto-naming after a delay (wait for command to execute and produce output)
|
||||
autoNameTimeoutRef.current = setTimeout(() => {
|
||||
triggerAutoNaming();
|
||||
}, 1500); // 1.5 second delay
|
||||
} else if (data === '\x7f' || data === '\b') {
|
||||
// Backspace - remove last char from buffer
|
||||
commandBufferRef.current = commandBufferRef.current.slice(0, -1);
|
||||
} else if (data === '\x03') {
|
||||
// Ctrl+C - clear buffer
|
||||
commandBufferRef.current = '';
|
||||
} else if (data.charCodeAt(0) >= 32 && data.charCodeAt(0) < 127) {
|
||||
// Printable character - add to buffer
|
||||
commandBufferRef.current += data;
|
||||
}
|
||||
});
|
||||
|
||||
// Handle resize
|
||||
@@ -346,6 +401,12 @@ export function Terminal({ id, cwd, projectPath, isActive, onClose, onActivate,
|
||||
return () => {
|
||||
isMountedRef.current = false;
|
||||
|
||||
// Clear auto-naming timeout
|
||||
if (autoNameTimeoutRef.current) {
|
||||
clearTimeout(autoNameTimeoutRef.current);
|
||||
autoNameTimeoutRef.current = null;
|
||||
}
|
||||
|
||||
// Delay cleanup to skip StrictMode's immediate remount
|
||||
setTimeout(() => {
|
||||
if (!isMountedRef.current) {
|
||||
|
||||
@@ -80,13 +80,28 @@ export function TerminalGrid({ projectPath, onNewTaskClick }: TerminalGridProps)
|
||||
fetchSessionDates();
|
||||
}, [projectPath]);
|
||||
|
||||
// Get addRestoredTerminal from store
|
||||
const addRestoredTerminal = useTerminalStore((state) => state.addRestoredTerminal);
|
||||
|
||||
// Handle restoring sessions from a specific date
|
||||
const handleRestoreFromDate = useCallback(async (date: string) => {
|
||||
if (!projectPath || isRestoring) return;
|
||||
|
||||
setIsRestoring(true);
|
||||
try {
|
||||
// First close all existing terminals
|
||||
// First get the session data for this date (we need it after restore)
|
||||
const sessionsResult = await window.electronAPI.getTerminalSessionsForDate(date, projectPath);
|
||||
const sessionsToRestore = sessionsResult.success ? sessionsResult.data || [] : [];
|
||||
|
||||
console.log(`[TerminalGrid] Found ${sessionsToRestore.length} sessions to restore from ${date}`);
|
||||
|
||||
if (sessionsToRestore.length === 0) {
|
||||
console.log('[TerminalGrid] No sessions found for this date');
|
||||
setIsRestoring(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Close all existing terminals
|
||||
for (const terminal of terminals) {
|
||||
await window.electronAPI.destroyTerminal(terminal.id);
|
||||
removeTerminal(terminal.id);
|
||||
@@ -95,7 +110,7 @@ export function TerminalGrid({ projectPath, onNewTaskClick }: TerminalGridProps)
|
||||
// Small delay to ensure cleanup
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
|
||||
// Restore sessions from the selected date
|
||||
// Restore sessions from the selected date (creates PTYs in main process)
|
||||
const result = await window.electronAPI.restoreTerminalSessionsFromDate(
|
||||
date,
|
||||
projectPath,
|
||||
@@ -104,9 +119,20 @@ export function TerminalGrid({ projectPath, onNewTaskClick }: TerminalGridProps)
|
||||
);
|
||||
|
||||
if (result.success && result.data) {
|
||||
console.log(`Restored ${result.data.restored} sessions from ${date}`);
|
||||
// The terminal-store's restoreTerminalSessions will be called by App.tsx
|
||||
// Or we can manually add the restored terminals
|
||||
console.log(`[TerminalGrid] Main process restored ${result.data.restored} sessions from ${date}`);
|
||||
|
||||
// Add each successfully restored session to the renderer's terminal store
|
||||
for (const sessionResult of result.data.sessions) {
|
||||
if (sessionResult.success) {
|
||||
// Find the full session data
|
||||
const fullSession = sessionsToRestore.find(s => s.id === sessionResult.id);
|
||||
if (fullSession) {
|
||||
console.log(`[TerminalGrid] Adding restored terminal to store: ${fullSession.id}`);
|
||||
addRestoredTerminal(fullSession);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Refresh session dates to update counts
|
||||
const datesResult = await window.electronAPI.getTerminalSessionDates(projectPath);
|
||||
if (datesResult.success && datesResult.data) {
|
||||
@@ -118,7 +144,7 @@ export function TerminalGrid({ projectPath, onNewTaskClick }: TerminalGridProps)
|
||||
} finally {
|
||||
setIsRestoring(false);
|
||||
}
|
||||
}, [projectPath, terminals, removeTerminal, isRestoring]);
|
||||
}, [projectPath, terminals, removeTerminal, addRestoredTerminal, isRestoring]);
|
||||
|
||||
// Setup drag sensors
|
||||
const sensors = useSensors(
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import {
|
||||
Key,
|
||||
ExternalLink,
|
||||
Eye,
|
||||
EyeOff,
|
||||
ChevronDown,
|
||||
ChevronUp,
|
||||
Loader2,
|
||||
Globe
|
||||
Globe,
|
||||
Check,
|
||||
Star,
|
||||
Settings,
|
||||
Users
|
||||
} from 'lucide-react';
|
||||
import { Button } from '../ui/button';
|
||||
import { Input } from '../ui/input';
|
||||
import { Label } from '../ui/label';
|
||||
import type { ProjectEnvConfig } from '../../../shared/types';
|
||||
import { cn } from '../../lib/utils';
|
||||
import type { ProjectEnvConfig, ClaudeProfile } from '../../../shared/types';
|
||||
|
||||
interface EnvironmentSettingsProps {
|
||||
envConfig: ProjectEnvConfig | null;
|
||||
@@ -24,7 +27,7 @@ interface EnvironmentSettingsProps {
|
||||
claudeAuthStatus: 'checking' | 'authenticated' | 'not_authenticated' | 'error';
|
||||
handleClaudeSetup: () => Promise<void>;
|
||||
|
||||
// Password visibility
|
||||
// Password visibility (kept for interface compatibility but not used)
|
||||
showClaudeToken: boolean;
|
||||
setShowClaudeToken: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
|
||||
@@ -37,15 +40,38 @@ export function EnvironmentSettings({
|
||||
envConfig,
|
||||
isLoadingEnv,
|
||||
envError,
|
||||
updateEnvConfig,
|
||||
isCheckingClaudeAuth,
|
||||
claudeAuthStatus,
|
||||
handleClaudeSetup,
|
||||
showClaudeToken,
|
||||
setShowClaudeToken,
|
||||
expanded,
|
||||
onToggle
|
||||
}: EnvironmentSettingsProps) {
|
||||
// Load global Claude profiles to show active account
|
||||
const [claudeProfiles, setClaudeProfiles] = useState<ClaudeProfile[]>([]);
|
||||
const [activeProfileId, setActiveProfileId] = useState<string | null>(null);
|
||||
const [isLoadingProfiles, setIsLoadingProfiles] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const loadProfiles = async () => {
|
||||
setIsLoadingProfiles(true);
|
||||
try {
|
||||
const result = await window.electronAPI.getClaudeProfiles();
|
||||
if (result.success && result.data) {
|
||||
setClaudeProfiles(result.data.profiles);
|
||||
setActiveProfileId(result.data.activeProfileId);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to load Claude profiles:', err);
|
||||
} finally {
|
||||
setIsLoadingProfiles(false);
|
||||
}
|
||||
};
|
||||
loadProfiles();
|
||||
}, []);
|
||||
|
||||
const activeProfile = claudeProfiles.find(p => p.id === activeProfileId);
|
||||
const hasAuthenticatedProfiles = claudeProfiles.some(p => p.oauthToken);
|
||||
|
||||
return (
|
||||
<section className="space-y-3">
|
||||
<button
|
||||
@@ -75,84 +101,142 @@ export function EnvironmentSettings({
|
||||
|
||||
{expanded && (
|
||||
<div className="space-y-4 pl-6 pt-2">
|
||||
{isLoadingEnv ? (
|
||||
{isLoadingEnv || isLoadingProfiles ? (
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
Loading configuration...
|
||||
</div>
|
||||
) : envConfig ? (
|
||||
<>
|
||||
{/* Claude CLI Status */}
|
||||
<div className="rounded-lg border border-border bg-muted/30 p-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-foreground">Claude CLI</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{isCheckingClaudeAuth ? 'Checking...' :
|
||||
claudeAuthStatus === 'authenticated' ? 'Authenticated via OAuth' :
|
||||
claudeAuthStatus === 'not_authenticated' ? 'Not authenticated' :
|
||||
'Status unknown'}
|
||||
{/* Inheritance Info */}
|
||||
<div className="rounded-lg border border-info/30 bg-info/5 p-3">
|
||||
<div className="flex items-start gap-3">
|
||||
<Globe className="h-5 w-5 text-info mt-0.5 shrink-0" />
|
||||
<div className="flex-1">
|
||||
<p className="text-sm font-medium text-foreground">
|
||||
Using Global Authentication
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground mt-1">
|
||||
Claude authentication is managed in{' '}
|
||||
<span className="font-medium text-info">Settings → Integrations</span>.
|
||||
All projects share the same Claude accounts.
|
||||
</p>
|
||||
</div>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onClick={handleClaudeSetup}
|
||||
disabled={isCheckingClaudeAuth}
|
||||
>
|
||||
{isCheckingClaudeAuth ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
) : (
|
||||
<>
|
||||
<ExternalLink className="h-4 w-4 mr-2" />
|
||||
{claudeAuthStatus === 'authenticated' ? 'Re-authenticate' : 'Setup OAuth'}
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Manual OAuth Token */}
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<Label className="text-sm font-medium text-foreground">
|
||||
OAuth Token {envConfig.claudeTokenIsGlobal ? '(Override)' : ''}
|
||||
</Label>
|
||||
{envConfig.claudeTokenIsGlobal && (
|
||||
<span className="flex items-center gap-1 text-xs text-info">
|
||||
<Globe className="h-3 w-3" />
|
||||
Using global token
|
||||
</span>
|
||||
{/* Active Account Display */}
|
||||
{hasAuthenticatedProfiles ? (
|
||||
<div className="rounded-lg border border-border bg-muted/30 p-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<Users className="h-4 w-4 text-muted-foreground" />
|
||||
<Label className="text-sm font-medium text-foreground">Active Account</Label>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onClick={handleClaudeSetup}
|
||||
disabled={isCheckingClaudeAuth}
|
||||
>
|
||||
{isCheckingClaudeAuth ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
) : (
|
||||
<>
|
||||
<ExternalLink className="h-4 w-4 mr-2" />
|
||||
Re-authenticate
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{activeProfile ? (
|
||||
<div className="mt-3 flex items-center gap-3">
|
||||
<div className={cn(
|
||||
"h-8 w-8 rounded-full flex items-center justify-center text-sm font-medium shrink-0",
|
||||
"bg-primary text-primary-foreground"
|
||||
)}>
|
||||
{activeProfile.name.charAt(0).toUpperCase()}
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
<span className="text-sm font-medium text-foreground">{activeProfile.name}</span>
|
||||
<span className="text-xs bg-primary/20 text-primary px-1.5 py-0.5 rounded flex items-center gap-1">
|
||||
<Star className="h-3 w-3" />
|
||||
Active
|
||||
</span>
|
||||
{activeProfile.oauthToken ? (
|
||||
<span className="text-xs bg-success/20 text-success px-1.5 py-0.5 rounded flex items-center gap-1">
|
||||
<Check className="h-3 w-3" />
|
||||
Authenticated
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-xs bg-warning/20 text-warning px-1.5 py-0.5 rounded">
|
||||
Needs Auth
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{activeProfile.email && (
|
||||
<span className="text-xs text-muted-foreground">{activeProfile.email}</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : claudeProfiles.length > 0 ? (
|
||||
<p className="text-xs text-warning mt-2">
|
||||
No active account selected. Go to Settings → Integrations to select an account.
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
{/* Show other authenticated accounts */}
|
||||
{claudeProfiles.filter(p => p.id !== activeProfileId && p.oauthToken).length > 0 && (
|
||||
<div className="mt-3 pt-3 border-t border-border/50">
|
||||
<p className="text-xs text-muted-foreground mb-2">
|
||||
Other authenticated accounts (used for rate limit fallback):
|
||||
</p>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{claudeProfiles
|
||||
.filter(p => p.id !== activeProfileId && p.oauthToken)
|
||||
.map(profile => (
|
||||
<div
|
||||
key={profile.id}
|
||||
className="flex items-center gap-1.5 text-xs bg-muted px-2 py-1 rounded"
|
||||
>
|
||||
<div className="h-4 w-4 rounded-full bg-muted-foreground/30 flex items-center justify-center text-[10px]">
|
||||
{profile.name.charAt(0).toUpperCase()}
|
||||
</div>
|
||||
<span className="text-muted-foreground">{profile.name}</span>
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{envConfig.claudeTokenIsGlobal ? (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Using token from App Settings. Enter a project-specific token below to override.
|
||||
</p>
|
||||
) : (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Paste a token from <code className="px-1 bg-muted rounded">claude setup-token</code>
|
||||
</p>
|
||||
)}
|
||||
<div className="relative">
|
||||
<Input
|
||||
type={showClaudeToken ? 'text' : 'password'}
|
||||
placeholder={envConfig.claudeTokenIsGlobal ? 'Enter to override global token...' : 'your-oauth-token-here'}
|
||||
value={envConfig.claudeTokenIsGlobal ? '' : (envConfig.claudeOAuthToken || '')}
|
||||
onChange={(e) => updateEnvConfig({
|
||||
claudeOAuthToken: e.target.value || undefined,
|
||||
})}
|
||||
className="pr-10"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowClaudeToken(!showClaudeToken)}
|
||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
{showClaudeToken ? <EyeOff className="h-4 w-4" /> : <Eye className="h-4 w-4" />}
|
||||
</button>
|
||||
) : (
|
||||
/* No accounts configured */
|
||||
<div className="rounded-lg border border-warning/30 bg-warning/5 p-4">
|
||||
<div className="flex flex-col items-center text-center">
|
||||
<Users className="h-8 w-8 text-warning mb-2" />
|
||||
<p className="text-sm font-medium text-foreground">No Claude Accounts Configured</p>
|
||||
<p className="text-xs text-muted-foreground mt-1 mb-3">
|
||||
Add a Claude account in the global settings to use Auto-Build.
|
||||
</p>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onClick={() => {
|
||||
// Emit event to open app settings at Integrations
|
||||
window.dispatchEvent(new CustomEvent('open-app-settings', { detail: 'integrations' }));
|
||||
}}
|
||||
>
|
||||
<Settings className="h-4 w-4 mr-2" />
|
||||
Open Integrations Settings
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
) : envError ? (
|
||||
<p className="text-sm text-destructive">{envError}</p>
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
Loader2
|
||||
} from 'lucide-react';
|
||||
import { Button } from '../ui/button';
|
||||
import { Input } from '../ui/input';
|
||||
import { Label } from '../ui/label';
|
||||
import { Switch } from '../ui/switch';
|
||||
import {
|
||||
@@ -130,38 +129,6 @@ export function GeneralSettings({
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="space-y-0.5">
|
||||
<Label className="font-normal text-foreground">Parallel Execution</Label>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Run multiple subtasks simultaneously
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings.parallelEnabled}
|
||||
onCheckedChange={(checked) =>
|
||||
setSettings({ ...settings, parallelEnabled: checked })
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{settings.parallelEnabled && (
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="workers" className="text-sm font-medium text-foreground">Max Workers</Label>
|
||||
<Input
|
||||
id="workers"
|
||||
type="number"
|
||||
min={1}
|
||||
max={8}
|
||||
value={settings.maxWorkers}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
...settings,
|
||||
maxWorkers: parseInt(e.target.value) || 1
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
|
||||
<Separator />
|
||||
|
||||
@@ -173,7 +173,7 @@ export function SecuritySettings({
|
||||
<SelectValue placeholder="Select LLM provider" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="openai">OpenAI (GPT-4o)</SelectItem>
|
||||
<SelectItem value="openai">OpenAI (GPT-5-mini)</SelectItem>
|
||||
<SelectItem value="anthropic">Anthropic (Claude)</SelectItem>
|
||||
<SelectItem value="google">Google (Gemini)</SelectItem>
|
||||
<SelectItem value="groq">Groq (Llama)</SelectItem>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useState, useEffect, useMemo } from 'react';
|
||||
import {
|
||||
RefreshCw,
|
||||
CheckCircle2,
|
||||
AlertCircle,
|
||||
CloudDownload,
|
||||
Loader2
|
||||
Loader2,
|
||||
ExternalLink
|
||||
} from 'lucide-react';
|
||||
import { Button } from '../ui/button';
|
||||
import { Label } from '../ui/label';
|
||||
@@ -14,6 +15,43 @@ import { cn } from '../../lib/utils';
|
||||
import { SettingsSection } from './SettingsSection';
|
||||
import type { AppSettings, AutoBuildSourceUpdateCheck, AutoBuildSourceUpdateProgress } from '../../../shared/types';
|
||||
|
||||
/**
|
||||
* Simple markdown renderer for release notes
|
||||
* Handles: headers, bold, lists, line breaks
|
||||
*/
|
||||
function ReleaseNotesRenderer({ markdown }: { markdown: string }) {
|
||||
const html = useMemo(() => {
|
||||
let result = markdown
|
||||
// Escape HTML
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
// Headers (### Header -> <h3>)
|
||||
.replace(/^### (.+)$/gm, '<h4 class="text-sm font-semibold text-foreground mt-3 mb-1.5 first:mt-0">$1</h4>')
|
||||
.replace(/^## (.+)$/gm, '<h3 class="text-sm font-semibold text-foreground mt-3 mb-1.5 first:mt-0">$1</h3>')
|
||||
// Bold (**text** -> <strong>)
|
||||
.replace(/\*\*([^*]+)\*\*/g, '<strong class="text-foreground font-medium">$1</strong>')
|
||||
// Inline code (`code` -> <code>)
|
||||
.replace(/`([^`]+)`/g, '<code class="px-1 py-0.5 bg-muted rounded text-xs">$1</code>')
|
||||
// List items (- item -> <li>)
|
||||
.replace(/^- (.+)$/gm, '<li class="ml-4 text-muted-foreground before:content-[\'•\'] before:mr-2 before:text-muted-foreground/60">$1</li>')
|
||||
// Wrap consecutive list items
|
||||
.replace(/(<li[^>]*>.*?<\/li>\n?)+/g, '<ul class="space-y-1 my-2">$&</ul>')
|
||||
// Line breaks for remaining lines
|
||||
.replace(/\n\n/g, '<div class="h-2"></div>')
|
||||
.replace(/\n/g, '<br/>');
|
||||
|
||||
return result;
|
||||
}, [markdown]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className="text-sm text-muted-foreground leading-relaxed"
|
||||
dangerouslySetInnerHTML={{ __html: html }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
interface AdvancedSettingsProps {
|
||||
settings: AppSettings;
|
||||
onSettingsChange: (settings: AppSettings) => void;
|
||||
@@ -124,12 +162,20 @@ export function AdvancedSettings({ settings, onSettingsChange, section, version
|
||||
{sourceUpdateCheck.updateAvailable && (
|
||||
<div className="space-y-4 pt-2">
|
||||
{sourceUpdateCheck.releaseNotes && (
|
||||
<div className="text-sm text-muted-foreground bg-background rounded-lg p-3 max-h-32 overflow-y-auto">
|
||||
<pre className="whitespace-pre-wrap font-sans">
|
||||
{sourceUpdateCheck.releaseNotes}
|
||||
</pre>
|
||||
<div className="bg-background rounded-lg p-4 max-h-48 overflow-y-auto border border-border/50">
|
||||
<ReleaseNotesRenderer markdown={sourceUpdateCheck.releaseNotes} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{sourceUpdateCheck.releaseUrl && (
|
||||
<button
|
||||
onClick={() => window.electronAPI.openExternal(sourceUpdateCheck.releaseUrl!)}
|
||||
className="inline-flex items-center gap-1.5 text-sm text-info hover:text-info/80 hover:underline transition-colors"
|
||||
>
|
||||
<ExternalLink className="h-3.5 w-3.5" />
|
||||
View full release on GitHub
|
||||
</button>
|
||||
)}
|
||||
|
||||
{isDownloadingUpdate ? (
|
||||
<div className="space-y-3">
|
||||
|
||||
@@ -39,10 +39,11 @@ import type { UseProjectSettingsReturn } from '../project-settings/hooks/useProj
|
||||
interface AppSettingsDialogProps {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
initialSection?: AppSection;
|
||||
}
|
||||
|
||||
// App-level settings sections
|
||||
type AppSection = 'appearance' | 'agent' | 'paths' | 'integrations' | 'updates' | 'notifications';
|
||||
export type AppSection = 'appearance' | 'agent' | 'paths' | 'integrations' | 'updates' | 'notifications';
|
||||
|
||||
interface NavItem<T extends string> {
|
||||
id: T;
|
||||
@@ -72,15 +73,23 @@ const projectNavItems: NavItem<ProjectSettingsSection>[] = [
|
||||
* Main application settings dialog container
|
||||
* Coordinates app and project settings sections
|
||||
*/
|
||||
export function AppSettingsDialog({ open, onOpenChange }: AppSettingsDialogProps) {
|
||||
export function AppSettingsDialog({ open, onOpenChange, initialSection }: AppSettingsDialogProps) {
|
||||
const { settings, setSettings, isSaving, error, saveSettings } = useSettings();
|
||||
const [version, setVersion] = useState<string>('');
|
||||
|
||||
// Track which top-level section is active
|
||||
const [activeTopLevel, setActiveTopLevel] = useState<'app' | 'project'>('app');
|
||||
const [appSection, setAppSection] = useState<AppSection>('appearance');
|
||||
const [appSection, setAppSection] = useState<AppSection>(initialSection || 'appearance');
|
||||
const [projectSection, setProjectSection] = useState<ProjectSettingsSection>('general');
|
||||
|
||||
// Navigate to initial section when dialog opens with a specific section
|
||||
useEffect(() => {
|
||||
if (open && initialSection) {
|
||||
setActiveTopLevel('app');
|
||||
setAppSection(initialSection);
|
||||
}
|
||||
}, [open, initialSection]);
|
||||
|
||||
// Project state
|
||||
const projects = useProjectStore((state) => state.projects);
|
||||
const selectedProjectId = useProjectStore((state) => state.selectedProjectId);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Label } from '../ui/label';
|
||||
import { Input } from '../ui/input';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select';
|
||||
import { Switch } from '../ui/switch';
|
||||
import { SettingsSection } from './SettingsSection';
|
||||
import { AVAILABLE_MODELS } from '../../../shared/constants';
|
||||
import type { AppSettings } from '../../../shared/types';
|
||||
@@ -56,6 +57,23 @@ export function GeneralSettings({ settings, onSettingsChange, section }: General
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<div className="flex items-center justify-between max-w-md">
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="autoNameTerminals" className="text-sm font-medium text-foreground">
|
||||
AI Terminal Naming
|
||||
</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Automatically name terminals based on commands (uses Haiku)
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
id="autoNameTerminals"
|
||||
checked={settings.autoNameTerminals}
|
||||
onCheckedChange={(checked) => onSettingsChange({ ...settings, autoNameTerminals: checked })}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SettingsSection>
|
||||
);
|
||||
|
||||
@@ -41,7 +41,6 @@ export function ProjectSelector({
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
await removeProject(projectId);
|
||||
// Close dropdown after removal
|
||||
setOpen(false);
|
||||
}, []);
|
||||
|
||||
@@ -49,76 +48,65 @@ export function ProjectSelector({
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="space-y-2">
|
||||
<Select
|
||||
value={selectedProjectId || ''}
|
||||
onValueChange={handleValueChange}
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
>
|
||||
<SelectTrigger className="w-full [&_span]:truncate">
|
||||
<div className="flex items-center gap-2 min-w-0 flex-1 overflow-hidden">
|
||||
<FolderOpen className="h-4 w-4 shrink-0 text-muted-foreground" />
|
||||
<SelectValue placeholder="Select a project..." className="truncate min-w-0 flex-1" />
|
||||
<Select
|
||||
value={selectedProjectId || ''}
|
||||
onValueChange={handleValueChange}
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
>
|
||||
<SelectTrigger className="w-full [&_span]:truncate">
|
||||
<div className="flex items-center gap-2 min-w-0 flex-1 overflow-hidden">
|
||||
<FolderOpen className="h-4 w-4 shrink-0 text-muted-foreground" />
|
||||
<SelectValue placeholder="Select a project..." className="truncate min-w-0 flex-1" />
|
||||
</div>
|
||||
</SelectTrigger>
|
||||
<SelectContent className="min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-trigger-width)]">
|
||||
{projects.length === 0 ? (
|
||||
<div className="px-2 py-4 text-center text-sm text-muted-foreground">
|
||||
<p>No projects yet</p>
|
||||
</div>
|
||||
</SelectTrigger>
|
||||
<SelectContent
|
||||
className="min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-trigger-width)]"
|
||||
position="popper"
|
||||
sideOffset={4}
|
||||
>
|
||||
{projects.length === 0 ? (
|
||||
<div className="px-2 py-4 text-center text-sm text-muted-foreground">
|
||||
<p>No projects yet</p>
|
||||
</div>
|
||||
) : (
|
||||
projects.map((project) => (
|
||||
<SelectItem
|
||||
key={project.id}
|
||||
value={project.id}
|
||||
className="pr-8"
|
||||
>
|
||||
<div className="flex items-center justify-between w-full min-w-0">
|
||||
<span className="truncate flex-1" title={`${project.name} - ${project.path}`}>
|
||||
{project.name}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
className="ml-2 flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-destructive/10 transition-colors"
|
||||
onPointerDown={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
onMouseDown={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
onClick={(e) => handleRemoveProject(project.id, e)}
|
||||
>
|
||||
<Trash2 className="h-3.5 w-3.5 text-destructive" />
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
projects.map((project) => (
|
||||
<div key={project.id} className="relative flex items-center">
|
||||
<SelectItem value={project.id} className="flex-1 pr-10">
|
||||
<span className="truncate" title={`${project.name} - ${project.path}`}>
|
||||
{project.name}
|
||||
</span>
|
||||
</SelectItem>
|
||||
))
|
||||
)}
|
||||
<Separator className="my-1" />
|
||||
<SelectItem value="__add_new__">
|
||||
<div className="flex items-center gap-2">
|
||||
<Plus className="h-4 w-4 shrink-0" />
|
||||
<span>Add Project...</span>
|
||||
<button
|
||||
type="button"
|
||||
className="absolute right-2 flex h-6 w-6 items-center justify-center rounded-md hover:bg-destructive/10 transition-colors"
|
||||
onPointerDown={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
onClick={(e) => handleRemoveProject(project.id, e)}
|
||||
>
|
||||
<Trash2 className="h-3.5 w-3.5 text-destructive" />
|
||||
</button>
|
||||
</div>
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
))
|
||||
)}
|
||||
<Separator className="my-1" />
|
||||
<SelectItem value="__add_new__">
|
||||
<div className="flex items-center gap-2">
|
||||
<Plus className="h-4 w-4 shrink-0" />
|
||||
<span>Add Project...</span>
|
||||
</div>
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
{/* Project path - shown when project is selected */}
|
||||
{selectedProject && (
|
||||
<p
|
||||
className="text-xs text-muted-foreground px-1 break-words leading-relaxed"
|
||||
{/* Project path - shown when project is selected */}
|
||||
{selectedProject && (
|
||||
<div className="mt-2">
|
||||
<span
|
||||
className="truncate block text-xs text-muted-foreground"
|
||||
title={selectedProject.path}
|
||||
>
|
||||
{selectedProject.path}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<AddProjectModal
|
||||
open={showAddModal}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Provides clean import paths for settings components
|
||||
*/
|
||||
|
||||
export { AppSettingsDialog } from './AppSettings';
|
||||
export { AppSettingsDialog, type AppSection } from './AppSettings';
|
||||
export { ThemeSettings } from './ThemeSettings';
|
||||
export { GeneralSettings } from './GeneralSettings';
|
||||
export { IntegrationSettings } from './IntegrationSettings';
|
||||
|
||||
@@ -652,6 +652,12 @@ const browserMockAPI: ElectronAPI = {
|
||||
}),
|
||||
|
||||
onAutoBuildSourceUpdateProgress: () => () => {},
|
||||
|
||||
// Shell Operations (browser mock)
|
||||
openExternal: async (url: string) => {
|
||||
console.log('[Browser Mock] openExternal:', url);
|
||||
window.open(url, '_blank');
|
||||
},
|
||||
|
||||
// Auto-Build Source Environment Operations (browser mock)
|
||||
getSourceEnv: async () => ({
|
||||
|
||||
@@ -272,11 +272,11 @@ export async function persistTaskStatus(
|
||||
}
|
||||
|
||||
/**
|
||||
* Update task title/description and persist to file
|
||||
* Update task title/description/metadata and persist to file
|
||||
*/
|
||||
export async function persistUpdateTask(
|
||||
taskId: string,
|
||||
updates: { title?: string; description?: string }
|
||||
updates: { title?: string; description?: string; metadata?: Partial<TaskMetadata> }
|
||||
): Promise<boolean> {
|
||||
const store = useTaskStore.getState();
|
||||
|
||||
@@ -289,6 +289,7 @@ export async function persistUpdateTask(
|
||||
store.updateTask(taskId, {
|
||||
title: result.data.title,
|
||||
description: result.data.description,
|
||||
metadata: result.data.metadata,
|
||||
updatedAt: new Date()
|
||||
});
|
||||
return true;
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
|
||||
--color-popover: var(--popover);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
|
||||
/* Semantic colors */
|
||||
--color-success: var(--success);
|
||||
--color-success-foreground: var(--success-foreground);
|
||||
@@ -115,6 +118,9 @@
|
||||
--sidebar: #FFFFFF;
|
||||
--sidebar-foreground: #0B0B0F;
|
||||
|
||||
--popover: #FFFFFF;
|
||||
--popover-foreground: #0B0B0F;
|
||||
|
||||
/* Semantic colors */
|
||||
--success: #4EBE96;
|
||||
--success-foreground: #FFFFFF;
|
||||
@@ -173,6 +179,9 @@
|
||||
--sidebar: #0E0E12;
|
||||
--sidebar-foreground: #E6E6E6;
|
||||
|
||||
--popover: #1A1A1F;
|
||||
--popover-foreground: #E6E6E6;
|
||||
|
||||
/* Semantic colors - muted for dark mode */
|
||||
--success: #4EBE96;
|
||||
--success-foreground: #0B0B0F;
|
||||
|
||||
@@ -89,6 +89,7 @@ export const DEFAULT_APP_SETTINGS = {
|
||||
pythonPath: undefined as string | undefined,
|
||||
autoBuildPath: undefined as string | undefined,
|
||||
autoUpdateAutoBuild: true,
|
||||
autoNameTerminals: true,
|
||||
notifications: {
|
||||
onTaskComplete: true,
|
||||
onTaskFailed: true,
|
||||
@@ -102,8 +103,6 @@ export const DEFAULT_APP_SETTINGS = {
|
||||
|
||||
// Default project settings
|
||||
export const DEFAULT_PROJECT_SETTINGS = {
|
||||
parallelEnabled: false,
|
||||
maxWorkers: 2,
|
||||
model: 'opus',
|
||||
memoryBackend: 'file' as const,
|
||||
linearSync: false,
|
||||
@@ -171,6 +170,7 @@ export const IPC_CHANNELS = {
|
||||
TERMINAL_INPUT: 'terminal:input',
|
||||
TERMINAL_RESIZE: 'terminal:resize',
|
||||
TERMINAL_INVOKE_CLAUDE: 'terminal:invokeClaude',
|
||||
TERMINAL_GENERATE_NAME: 'terminal:generateName',
|
||||
|
||||
// Terminal session management
|
||||
TERMINAL_GET_SESSIONS: 'terminal:getSessions',
|
||||
@@ -219,6 +219,9 @@ export const IPC_CHANNELS = {
|
||||
|
||||
// App info
|
||||
APP_VERSION: 'app:version',
|
||||
|
||||
// Shell operations
|
||||
SHELL_OPEN_EXTERNAL: 'shell:openExternal',
|
||||
|
||||
// Roadmap operations
|
||||
ROADMAP_GET: 'roadmap:get',
|
||||
@@ -285,6 +288,13 @@ export const IPC_CHANNELS = {
|
||||
GITHUB_INVESTIGATION_COMPLETE: 'github:investigationComplete',
|
||||
GITHUB_INVESTIGATION_ERROR: 'github:investigationError',
|
||||
|
||||
// Docker & Infrastructure status
|
||||
DOCKER_STATUS: 'docker:status',
|
||||
DOCKER_START_FALKORDB: 'docker:startFalkordb',
|
||||
DOCKER_STOP_FALKORDB: 'docker:stopFalkordb',
|
||||
DOCKER_OPEN_DESKTOP: 'docker:openDesktop',
|
||||
DOCKER_GET_DOWNLOAD_URL: 'docker:getDownloadUrl',
|
||||
|
||||
// Auto Claude source updates
|
||||
AUTOBUILD_SOURCE_CHECK: 'autobuild:source:check',
|
||||
AUTOBUILD_SOURCE_DOWNLOAD: 'autobuild:source:download',
|
||||
|
||||
@@ -15,7 +15,8 @@ import type {
|
||||
GraphitiMemoryStatus,
|
||||
ContextSearchResult,
|
||||
MemoryEpisode,
|
||||
ProjectEnvConfig
|
||||
ProjectEnvConfig,
|
||||
InfrastructureStatus
|
||||
} from './project';
|
||||
import type {
|
||||
Task,
|
||||
@@ -251,6 +252,13 @@ export interface ElectronAPI {
|
||||
checkClaudeAuth: (projectId: string) => Promise<IPCResult<ClaudeAuthResult>>;
|
||||
invokeClaudeSetup: (projectId: string) => Promise<IPCResult<ClaudeAuthResult>>;
|
||||
|
||||
// Docker & Infrastructure operations (for Graphiti/FalkorDB)
|
||||
getInfrastructureStatus: (port?: number) => Promise<IPCResult<InfrastructureStatus>>;
|
||||
startFalkorDB: (port?: number) => Promise<IPCResult<{ success: boolean; error?: string }>>;
|
||||
stopFalkorDB: () => Promise<IPCResult<{ success: boolean; error?: string }>>;
|
||||
openDockerDesktop: () => Promise<IPCResult<{ success: boolean; error?: string }>>;
|
||||
getDockerDownloadUrl: () => Promise<string>;
|
||||
|
||||
// Linear integration operations
|
||||
getLinearTeams: (projectId: string) => Promise<IPCResult<LinearTeam[]>>;
|
||||
getLinearProjects: (projectId: string, teamId: string) => Promise<IPCResult<LinearProject[]>>;
|
||||
@@ -342,6 +350,9 @@ export interface ElectronAPI {
|
||||
callback: (progress: AutoBuildSourceUpdateProgress) => void
|
||||
) => () => void;
|
||||
|
||||
// Shell operations
|
||||
openExternal: (url: string) => Promise<void>;
|
||||
|
||||
// Auto Claude source environment operations
|
||||
getSourceEnv: () => Promise<IPCResult<SourceEnvConfig>>;
|
||||
updateSourceEnv: (config: { claudeOAuthToken?: string }) => Promise<IPCResult>;
|
||||
|
||||
@@ -13,8 +13,6 @@ export interface Project {
|
||||
}
|
||||
|
||||
export interface ProjectSettings {
|
||||
parallelEnabled: boolean;
|
||||
maxWorkers: number;
|
||||
model: string;
|
||||
memoryBackend: 'graphiti' | 'file';
|
||||
linearSync: boolean;
|
||||
@@ -145,6 +143,29 @@ export interface GraphitiMemoryStatus {
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
// Docker & Infrastructure Types
|
||||
export interface DockerStatus {
|
||||
installed: boolean;
|
||||
running: boolean;
|
||||
version?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface FalkorDBStatus {
|
||||
containerExists: boolean;
|
||||
containerRunning: boolean;
|
||||
containerName: string;
|
||||
port: number;
|
||||
healthy: boolean;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface InfrastructureStatus {
|
||||
docker: DockerStatus;
|
||||
falkordb: FalkorDBStatus;
|
||||
ready: boolean; // True if both Docker is running and FalkorDB is healthy
|
||||
}
|
||||
|
||||
// Graphiti Provider Types (Memory System V2)
|
||||
export type GraphitiProviderType = 'openai' | 'anthropic' | 'google' | 'groq';
|
||||
export type GraphitiEmbeddingProvider = 'openai' | 'voyage' | 'google' | 'huggingface';
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface AppSettings {
|
||||
pythonPath?: string;
|
||||
autoBuildPath?: string;
|
||||
autoUpdateAutoBuild: boolean;
|
||||
autoNameTerminals: boolean;
|
||||
notifications: NotificationSettings;
|
||||
// Global API keys (used as defaults for all projects)
|
||||
globalClaudeOAuthToken?: string;
|
||||
@@ -40,6 +41,7 @@ export interface AutoBuildSourceUpdateCheck {
|
||||
currentVersion: string;
|
||||
latestVersion?: string;
|
||||
releaseNotes?: string;
|
||||
releaseUrl?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"sourceHash": "901d7898b1e236b8",
|
||||
"sourcePath": "/Users/andremikalsen/Documents/Coding/autonomous-coding/auto-claude",
|
||||
"initializedAt": "2025-12-12T09:20:22.555Z",
|
||||
"updatedAt": "2025-12-12T09:20:22.555Z"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"error": "Claude SDK not installed"
|
||||
}
|
||||
@@ -1,165 +0,0 @@
|
||||
{
|
||||
"project_root": "/Users/andremikalsen/Documents/Coding/autonomous-coding/auto-claude",
|
||||
"project_type": "single",
|
||||
"services": {
|
||||
"main": {
|
||||
"name": "main",
|
||||
"path": "/Users/andremikalsen/Documents/Coding/autonomous-coding/auto-claude",
|
||||
"language": "Python",
|
||||
"framework": null,
|
||||
"type": "unknown",
|
||||
"package_manager": "pip",
|
||||
"dependencies": [
|
||||
"claude-agent-sdk",
|
||||
"python-dotenv",
|
||||
"graphiti-core"
|
||||
],
|
||||
"environment": {
|
||||
"variables": {
|
||||
"CLAUDE_CODE_OAUTH_TOKEN": {
|
||||
"value": "<REDACTED>",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": true,
|
||||
"required": true
|
||||
},
|
||||
"CLAUDE_CODE_OAUTH_TOKEN_2": {
|
||||
"value": "<REDACTED>",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": true,
|
||||
"required": false
|
||||
},
|
||||
"ENABLE_FANCY_UI": {
|
||||
"value": "true",
|
||||
"source": ".env",
|
||||
"type": "boolean",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"GRAPHITI_ENABLED": {
|
||||
"value": "true",
|
||||
"source": ".env",
|
||||
"type": "boolean",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"OPENAI_API_KEY": {
|
||||
"value": "<REDACTED>",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": true,
|
||||
"required": false
|
||||
},
|
||||
"OPENAI_MODEL": {
|
||||
"value": "gpt-5-mini",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"GRAPHITI_FALKORDB_HOST": {
|
||||
"value": "localhost",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"GRAPHITI_FALKORDB_PORT": {
|
||||
"value": "6380",
|
||||
"source": ".env",
|
||||
"type": "number",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"GRAPHITI_DATABASE": {
|
||||
"value": "auto_build_memory",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"DEBUG": {
|
||||
"value": "true",
|
||||
"source": ".env",
|
||||
"type": "boolean",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"DEBUG_LEVEL": {
|
||||
"value": "3",
|
||||
"source": ".env",
|
||||
"type": "number",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"FALKORDB_ARGS": {
|
||||
"value": null,
|
||||
"source": "../docker-compose.yml",
|
||||
"type": "string",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"required_count": 1,
|
||||
"optional_count": 0,
|
||||
"detected_count": 12
|
||||
},
|
||||
"api": {
|
||||
"routes": [
|
||||
{
|
||||
"path": "/path",
|
||||
"methods": [
|
||||
"GET"
|
||||
],
|
||||
"file": "analyzer.py",
|
||||
"framework": "FastAPI",
|
||||
"requires_auth": false
|
||||
},
|
||||
{
|
||||
"path": "/path",
|
||||
"methods": [
|
||||
"POST"
|
||||
],
|
||||
"file": "analyzer.py",
|
||||
"framework": "FastAPI",
|
||||
"requires_auth": false
|
||||
},
|
||||
{
|
||||
"path": "/add_episode",
|
||||
"methods": [
|
||||
"POST"
|
||||
],
|
||||
"file": ".venv/lib/python3.14/site-packages/graphiti_core/graphiti.py",
|
||||
"framework": "FastAPI",
|
||||
"requires_auth": false
|
||||
},
|
||||
{
|
||||
"path": "/path",
|
||||
"methods": [
|
||||
"GET",
|
||||
"POST"
|
||||
],
|
||||
"file": "analyzer.py",
|
||||
"framework": "Flask",
|
||||
"requires_auth": true
|
||||
}
|
||||
],
|
||||
"total_routes": 4,
|
||||
"methods": [
|
||||
"GET",
|
||||
"POST"
|
||||
],
|
||||
"protected_routes": [
|
||||
"/path"
|
||||
]
|
||||
},
|
||||
"monitoring": {
|
||||
"metrics_endpoint": "/metrics",
|
||||
"metrics_type": "prometheus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"infrastructure": {},
|
||||
"conventions": {}
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
{
|
||||
"project_root": "/Users/andremikalsen/Documents/Coding/autonomous-coding/auto-claude",
|
||||
"project_type": "single",
|
||||
"services": {
|
||||
"main": {
|
||||
"name": "main",
|
||||
"path": "/Users/andremikalsen/Documents/Coding/autonomous-coding/auto-claude",
|
||||
"language": "Python",
|
||||
"framework": null,
|
||||
"type": "unknown",
|
||||
"package_manager": "pip",
|
||||
"dependencies": [
|
||||
"claude-agent-sdk",
|
||||
"python-dotenv",
|
||||
"graphiti-core"
|
||||
],
|
||||
"test_directory": "spec",
|
||||
"environment": {
|
||||
"variables": {
|
||||
"CLAUDE_CODE_OAUTH_TOKEN": {
|
||||
"value": "<REDACTED>",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": true,
|
||||
"required": true
|
||||
},
|
||||
"CLAUDE_CODE_OAUTH_TOKEN_2": {
|
||||
"value": "<REDACTED>",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": true,
|
||||
"required": false
|
||||
},
|
||||
"ENABLE_FANCY_UI": {
|
||||
"value": "true",
|
||||
"source": ".env",
|
||||
"type": "boolean",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"GRAPHITI_ENABLED": {
|
||||
"value": "true",
|
||||
"source": ".env",
|
||||
"type": "boolean",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"OPENAI_API_KEY": {
|
||||
"value": "<REDACTED>",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": true,
|
||||
"required": false
|
||||
},
|
||||
"OPENAI_MODEL": {
|
||||
"value": "gpt-5-mini",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"GRAPHITI_FALKORDB_HOST": {
|
||||
"value": "localhost",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"GRAPHITI_FALKORDB_PORT": {
|
||||
"value": "6380",
|
||||
"source": ".env",
|
||||
"type": "number",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"GRAPHITI_DATABASE": {
|
||||
"value": "auto_build_memory",
|
||||
"source": ".env",
|
||||
"type": "string",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"DEBUG": {
|
||||
"value": "true",
|
||||
"source": ".env",
|
||||
"type": "boolean",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"DEBUG_LEVEL": {
|
||||
"value": "3",
|
||||
"source": ".env",
|
||||
"type": "number",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
},
|
||||
"FALKORDB_ARGS": {
|
||||
"value": null,
|
||||
"source": "../docker-compose.yml",
|
||||
"type": "string",
|
||||
"sensitive": false,
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"required_count": 1,
|
||||
"optional_count": 0,
|
||||
"detected_count": 12
|
||||
},
|
||||
"api": {
|
||||
"routes": [
|
||||
{
|
||||
"path": "/path",
|
||||
"methods": [
|
||||
"GET"
|
||||
],
|
||||
"file": "analyzers/route_detector.py",
|
||||
"framework": "FastAPI",
|
||||
"requires_auth": false
|
||||
},
|
||||
{
|
||||
"path": "/path",
|
||||
"methods": [
|
||||
"POST"
|
||||
],
|
||||
"file": "analyzers/route_detector.py",
|
||||
"framework": "FastAPI",
|
||||
"requires_auth": false
|
||||
},
|
||||
{
|
||||
"path": "/add_episode",
|
||||
"methods": [
|
||||
"POST"
|
||||
],
|
||||
"file": ".venv/lib/python3.14/site-packages/graphiti_core/graphiti.py",
|
||||
"framework": "FastAPI",
|
||||
"requires_auth": false
|
||||
},
|
||||
{
|
||||
"path": "/metrics",
|
||||
"methods": [
|
||||
"GET"
|
||||
],
|
||||
"file": "analyzers/context_analyzer.py",
|
||||
"framework": "Flask",
|
||||
"requires_auth": false
|
||||
},
|
||||
{
|
||||
"path": "/path",
|
||||
"methods": [
|
||||
"GET",
|
||||
"POST"
|
||||
],
|
||||
"file": "analyzers/route_detector.py",
|
||||
"framework": "Flask",
|
||||
"requires_auth": true
|
||||
}
|
||||
],
|
||||
"total_routes": 5,
|
||||
"methods": [
|
||||
"GET",
|
||||
"POST"
|
||||
],
|
||||
"protected_routes": [
|
||||
"/path"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"infrastructure": {},
|
||||
"conventions": {}
|
||||
}
|
||||
@@ -1,187 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Build ALL handler modules
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
OUTPUT_DIR = Path("auto-claude-ui/src/main/ipc-handlers")
|
||||
original = Path("auto-claude-ui/src/main/ipc-handlers.ts").read_text()
|
||||
lines = original.split('\n')
|
||||
|
||||
COMMON_IMPORTS = """import { ipcMain } from 'electron';
|
||||
import type { BrowserWindow } from 'electron';
|
||||
import { IPC_CHANNELS } from '../../shared/constants';
|
||||
import type { IPCResult } from '../../shared/types';
|
||||
"""
|
||||
|
||||
def extract(start, end, extra_imports, services, name):
|
||||
handler_code = '\n'.join(lines[start-1:end])
|
||||
|
||||
# Build service parameters
|
||||
service_params_list = [f"{s['name']}: {s['type']}" for s in services]
|
||||
service_params_list.append("getMainWindow: () => BrowserWindow | null")
|
||||
params = ',\n '.join(service_params_list)
|
||||
|
||||
# Build imports
|
||||
imports = COMMON_IMPORTS + extra_imports
|
||||
for s in services:
|
||||
if s.get('import'):
|
||||
imports += s['import'] + '\n'
|
||||
|
||||
return f"""{imports}
|
||||
|
||||
/**
|
||||
* Register all {name}-related IPC handlers
|
||||
*/
|
||||
export function register{name.replace('-', '').capitalize()}Handlers(
|
||||
{params}
|
||||
): void {{
|
||||
{handler_code}
|
||||
}}
|
||||
"""
|
||||
|
||||
# Module configurations
|
||||
modules = {
|
||||
'terminal': {
|
||||
'start': 2201,
|
||||
'end': 2687,
|
||||
'imports': """import type { TerminalCreateOptions, ClaudeProfile, ClaudeProfileSettings } from '../../shared/types';
|
||||
import { getClaudeProfileManager } from '../claude-profile-manager';
|
||||
""",
|
||||
'services': [
|
||||
{'name': 'terminalManager', 'type': 'TerminalManager', 'import': "import { TerminalManager } from '../terminal-manager';"}
|
||||
]
|
||||
},
|
||||
'agent-events': {
|
||||
'start': 2689,
|
||||
'end': 2838,
|
||||
'imports': """import type { RateLimitInfo, ExecutionProgress } from '../../shared/types';
|
||||
""",
|
||||
'services': [
|
||||
{'name': 'agentManager', 'type': 'AgentManager', 'import': "import { AgentManager } from '../agent-manager';"},
|
||||
{'name': 'titleGenerator', 'type': 'any', 'import': "import { titleGenerator } from '../title-generator';"},
|
||||
{'name': 'fileWatcher', 'type': 'any', 'import': "import { fileWatcher } from '../file-watcher';"}
|
||||
]
|
||||
},
|
||||
'roadmap': {
|
||||
'start': 2840,
|
||||
'end': 3207,
|
||||
'imports': """import path from 'path';
|
||||
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
||||
import type { Roadmap, RoadmapFeature, RoadmapFeatureStatus } from '../../shared/types';
|
||||
import { projectStore } from '../project-store';
|
||||
import { fileWatcher } from '../file-watcher';
|
||||
""",
|
||||
'services': [
|
||||
{'name': 'agentManager', 'type': 'AgentManager', 'import': "import { AgentManager } from '../agent-manager';"}
|
||||
]
|
||||
},
|
||||
'context': {
|
||||
'start': 3208,
|
||||
'end': 3716,
|
||||
'imports': """import path from 'path';
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import type { ProjectContextData, GraphitiMemoryStatus, MemoryEpisode, ContextSearchResult } from '../../shared/types';
|
||||
import { projectStore } from '../project-store';
|
||||
""",
|
||||
'services': []
|
||||
},
|
||||
'env': {
|
||||
'start': 3717,
|
||||
'end': 4143,
|
||||
'imports': """import path from 'path';
|
||||
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
||||
import { execSync, spawn } from 'child_process';
|
||||
import type { ProjectEnvConfig, ClaudeAuthResult } from '../../shared/types';
|
||||
import { projectStore } from '../project-store';
|
||||
""",
|
||||
'services': []
|
||||
},
|
||||
'linear': {
|
||||
'start': 4144,
|
||||
'end': 4647,
|
||||
'imports': """import path from 'path';
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import { spawn } from 'child_process';
|
||||
import type { LinearIssue, LinearTeam, LinearProject, LinearImportResult, LinearSyncStatus } from '../../shared/types';
|
||||
import { projectStore } from '../project-store';
|
||||
""",
|
||||
'services': []
|
||||
},
|
||||
'github': {
|
||||
'start': 4648,
|
||||
'end': 5369,
|
||||
'imports': """import path from 'path';
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import { spawn } from 'child_process';
|
||||
import type { GitHubRepository, GitHubIssue, GitHubSyncStatus, GitHubImportResult, GitHubInvestigationResult } from '../../shared/types';
|
||||
import { projectStore } from '../project-store';
|
||||
""",
|
||||
'services': [
|
||||
{'name': 'agentManager', 'type': 'AgentManager', 'import': "import { AgentManager } from '../agent-manager';"}
|
||||
]
|
||||
},
|
||||
'autobuild-source': {
|
||||
'start': 5370,
|
||||
'end': 5655,
|
||||
'imports': """import path from 'path';
|
||||
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
||||
import type { AutoBuildSourceUpdateProgress, SourceEnvConfig, SourceEnvCheckResult } from '../../shared/types';
|
||||
import { checkForUpdates as checkSourceUpdates, downloadAndApplyUpdate, getBundledVersion, getEffectiveSourcePath } from '../auto-claude-updater';
|
||||
""",
|
||||
'services': []
|
||||
},
|
||||
'ideation': {
|
||||
'start': 5656,
|
||||
'end': 6241,
|
||||
'imports': """import path from 'path';
|
||||
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
||||
import type { IdeationSession, IdeationConfig, IdeationGenerationStatus } from '../../shared/types';
|
||||
import { projectStore } from '../project-store';
|
||||
import { fileWatcher } from '../file-watcher';
|
||||
""",
|
||||
'services': [
|
||||
{'name': 'agentManager', 'type': 'AgentManager', 'import': "import { AgentManager } from '../agent-manager';"}
|
||||
]
|
||||
},
|
||||
'changelog': {
|
||||
'start': 6243,
|
||||
'end': 6553,
|
||||
'imports': """import path from 'path';
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import { execSync } from 'child_process';
|
||||
import { getSpecsDir } from '../../shared/constants';
|
||||
import type { Task } from '../../shared/types';
|
||||
import { projectStore } from '../project-store';
|
||||
import { changelogService } from '../changelog-service';
|
||||
""",
|
||||
'services': []
|
||||
},
|
||||
'insights': {
|
||||
'start': 6554,
|
||||
'end': 6830,
|
||||
'imports': """import path from 'path';
|
||||
import type { InsightsSession, InsightsSessionSummary, InsightsChatStatus, InsightsStreamChunk } from '../../shared/types';
|
||||
import { projectStore } from '../project-store';
|
||||
import { insightsService } from '../insights-service';
|
||||
""",
|
||||
'services': []
|
||||
}
|
||||
}
|
||||
|
||||
# Generate all modules
|
||||
for name, config in modules.items():
|
||||
content = extract(
|
||||
config['start'],
|
||||
config['end'],
|
||||
config['imports'],
|
||||
config['services'],
|
||||
name
|
||||
)
|
||||
|
||||
output_file = OUTPUT_DIR / f"{name}-handlers.ts"
|
||||
output_file.write_text(content)
|
||||
lines_count = config['end'] - config['start'] + 1
|
||||
print(f"✓ {name}-handlers.ts ({lines_count} lines)")
|
||||
|
||||
print(f"\n✅ Generated {len(modules)} handler modules!")
|
||||
@@ -1,96 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Build complete handler modules with proper imports and structure
|
||||
"""
|
||||
from pathlib import Path
|
||||
import re
|
||||
|
||||
# Base output directory
|
||||
OUTPUT_DIR = Path("auto-claude-ui/src/main/ipc-handlers")
|
||||
|
||||
# Read original file
|
||||
original = Path("auto-claude-ui/src/main/ipc-handlers.ts").read_text()
|
||||
lines = original.split('\n')
|
||||
|
||||
# Common imports for all modules
|
||||
COMMON_IMPORTS = """import { ipcMain } from 'electron';
|
||||
import { IPC_CHANNELS } from '../../shared/constants';
|
||||
import type { IPCResult, BrowserWindow } from '../../shared/types';
|
||||
"""
|
||||
|
||||
# Helper to create module template
|
||||
def create_module(name: str, start_line: int, end_line: int, extra_imports: str = "", services: list = []):
|
||||
# Extract handler code
|
||||
handler_code = '\n'.join(lines[start_line-1:end_line])
|
||||
|
||||
# Build service parameters
|
||||
service_params = []
|
||||
service_imports = []
|
||||
|
||||
for service in services:
|
||||
service_params.append(f" {service['name']}: {service['type']}")
|
||||
if service.get('import'):
|
||||
service_imports.append(service['import'])
|
||||
|
||||
params_str = ',\n'.join(service_params) if service_params else ''
|
||||
if params_str:
|
||||
params_str = f"\n{params_str},\n getMainWindow: () => BrowserWindow | null\n"
|
||||
else:
|
||||
params_str = "getMainWindow: () => BrowserWindow | null"
|
||||
|
||||
imports_block = COMMON_IMPORTS
|
||||
if extra_imports:
|
||||
imports_block += extra_imports
|
||||
for imp in service_imports:
|
||||
imports_block += imp + '\n'
|
||||
|
||||
module_content = f"""{imports_block}
|
||||
|
||||
/**
|
||||
* Register all {name}-related IPC handlers
|
||||
*/
|
||||
export function register{name.capitalize()}Handlers({params_str}): void {{
|
||||
{handler_code}
|
||||
}}
|
||||
"""
|
||||
return module_content
|
||||
|
||||
print("Building handler modules...")
|
||||
|
||||
# Build each module
|
||||
modules_config = [
|
||||
{
|
||||
'name': 'task',
|
||||
'start': 381,
|
||||
'end': 1877,
|
||||
'extra_imports': """import path from 'path';
|
||||
import { existsSync, readFileSync, writeFileSync, readdirSync, mkdirSync } from 'fs';
|
||||
import { execSync } from 'child_process';
|
||||
import { getSpecsDir } from '../../shared/constants';
|
||||
import type { Task, TaskMetadata, TaskStartOptions, ImplementationPlan } from '../../shared/types';
|
||||
import { projectStore } from '../project-store';
|
||||
import { fileWatcher } from '../file-watcher';
|
||||
import { taskLogService } from '../task-log-service';
|
||||
import { titleGenerator } from '../title-generator';
|
||||
""",
|
||||
'services': [
|
||||
{'name': 'agentManager', 'type': 'AgentManager', 'import': "import { AgentManager } from '../agent-manager';"},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
# Generate task handlers as proof of concept
|
||||
config = modules_config[0]
|
||||
module_code = create_module(
|
||||
config['name'],
|
||||
config['start'],
|
||||
config['end'],
|
||||
config['extra_imports'],
|
||||
config['services']
|
||||
)
|
||||
|
||||
output_file = OUTPUT_DIR / f"{config['name']}-handlers.ts"
|
||||
output_file.write_text(module_code)
|
||||
print(f"✓ Created {output_file} ({len(module_code)} chars)")
|
||||
|
||||
print("\nModule generation complete!")
|
||||
@@ -1,61 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Smart extraction of IPC handlers into separate modules
|
||||
"""
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typing import List, Tuple
|
||||
|
||||
# Read the original file
|
||||
original_file = Path("auto-claude-ui/src/main/ipc-handlers.ts")
|
||||
content = original_file.read_text()
|
||||
|
||||
# Read imports section (first 100 lines)
|
||||
imports_section = '\n'.join(content.split('\n')[:76])
|
||||
|
||||
# Module definitions with their channel patterns and line ranges
|
||||
MODULES = {
|
||||
'task': {
|
||||
'channels': ['TASK_', 'CHANGELOG_LOAD_TASK'],
|
||||
'start_line': 381,
|
||||
'end_line': 1877,
|
||||
'imports': ['Task', 'TaskMetadata', 'TaskStatus', 'TaskStartOptions', 'ImplementationPlan'],
|
||||
},
|
||||
'terminal': {
|
||||
'channels': ['TERMINAL_', 'CLAUDE_PROFILE_', 'CLAUDE_RETRY'],
|
||||
'start_line': 2201,
|
||||
'end_line': 2687,
|
||||
'imports': ['TerminalCreateOptions', 'ClaudeProfile', 'ClaudeProfileSettings'],
|
||||
},
|
||||
'changelog': {
|
||||
'channels': ['CHANGELOG_'],
|
||||
'extra_content': True, # Has event handlers
|
||||
},
|
||||
'roadmap': {
|
||||
'channels': ['ROADMAP_'],
|
||||
'start_line': 2840,
|
||||
'end_line': 3207,
|
||||
},
|
||||
'context': {
|
||||
'channels': ['CONTEXT_'],
|
||||
'start_line': 3208,
|
||||
'end_line': 3716,
|
||||
},
|
||||
}
|
||||
|
||||
# Extract content by line numbers
|
||||
lines = content.split('\n')
|
||||
|
||||
for module_name, config in MODULES.items():
|
||||
if 'start_line' in config and 'end_line' in config:
|
||||
# Extract the handler section
|
||||
start = config['start_line'] - 1 # Convert to 0-indexed
|
||||
end = config['end_line']
|
||||
module_content = '\n'.join(lines[start:end])
|
||||
|
||||
# Save to section file
|
||||
section_file = Path(f"auto-claude-ui/src/main/ipc-handlers/sections/{module_name}_extracted.txt")
|
||||
section_file.write_text(module_content)
|
||||
print(f"Extracted {module_name}: lines {config['start_line']}-{config['end_line']} ({end-start} lines)")
|
||||
|
||||
print("\nExtraction complete!")
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
services:
|
||||
falkordb:
|
||||
image: falkordb/falkordb:latest
|
||||
container_name: auto-build-falkordb
|
||||
container_name: auto-claude-falkordb
|
||||
ports:
|
||||
- "${GRAPHITI_FALKORDB_PORT:-6380}:6379"
|
||||
volumes:
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Script to extract IPC handlers from the monolithic ipc-handlers.ts file
|
||||
and organize them into domain-specific modules.
|
||||
"""
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
# Read the original file
|
||||
ipc_handlers_path = Path("auto-claude-ui/src/main/ipc-handlers.ts")
|
||||
content = ipc_handlers_path.read_text()
|
||||
|
||||
# Define handler domains based on IPC channel prefixes
|
||||
DOMAINS = {
|
||||
'task': ['TASK_'],
|
||||
'terminal': ['TERMINAL_', 'CLAUDE_PROFILE_', 'CLAUDE_RETRY'],
|
||||
'file': ['FILE_EXPLORER_'],
|
||||
'settings': ['SETTINGS_', 'DIALOG_', 'APP_VERSION', 'python-env:'],
|
||||
'changelog': ['CHANGELOG_'],
|
||||
'roadmap': ['ROADMAP_'],
|
||||
'context': ['CONTEXT_'],
|
||||
'insights': ['INSIGHTS_'],
|
||||
'ideation': ['IDEATION_'],
|
||||
'integration': ['LINEAR_', 'GITHUB_', 'ENV_', 'AUTOBUILD_SOURCE_ENV'],
|
||||
'autobuild': ['AUTOBUILD_SOURCE_CHECK', 'AUTOBUILD_SOURCE_DOWNLOAD', 'AUTOBUILD_SOURCE_VERSION', 'AUTOBUILD_SOURCE_PROGRESS']
|
||||
}
|
||||
|
||||
# Find all handler registrations
|
||||
handler_pattern = r'ipcMain\.(handle|on)\s*\(\s*(?:IPC_CHANNELS\.|[\'"])([\w:]+)'
|
||||
handlers = list(re.finditer(handler_pattern, content))
|
||||
|
||||
print(f"Found {len(handlers)} handlers")
|
||||
|
||||
# Group handlers by domain
|
||||
domain_handlers: Dict[str, List[Tuple[str, int]]] = {domain: [] for domain in DOMAINS.keys()}
|
||||
domain_handlers['project'] = [] # Special case for project handlers
|
||||
|
||||
for match in handlers:
|
||||
channel = match.group(2)
|
||||
start_pos = match.start()
|
||||
|
||||
# Determine domain
|
||||
domain = None
|
||||
if channel.startswith('PROJECT'):
|
||||
domain = 'project'
|
||||
else:
|
||||
for dom, prefixes in DOMAINS.items():
|
||||
if any(channel.startswith(prefix) or channel.find(prefix) != -1 for prefix in prefixes):
|
||||
domain = dom
|
||||
break
|
||||
|
||||
if domain:
|
||||
domain_handlers[domain].append((channel, start_pos))
|
||||
else:
|
||||
print(f"Unknown domain for channel: {channel}")
|
||||
|
||||
# Print summary
|
||||
for domain, handlers_list in domain_handlers.items():
|
||||
if handlers_list:
|
||||
print(f"{domain}: {len(handlers_list)} handlers")
|
||||
for channel, _ in sorted(handlers_list)[:5]:
|
||||
print(f" - {channel}")
|
||||
if len(handlers_list) > 5:
|
||||
print(f" ... and {len(handlers_list) - 5} more")
|
||||
@@ -0,0 +1,173 @@
|
||||
# Auto Claude CLI Usage
|
||||
|
||||
This document covers terminal-only usage of Auto Claude. **For most users, we recommend using the [Desktop UI](#) instead** - it provides a better experience with visual task management, progress tracking, and automatic Python environment setup.
|
||||
|
||||
## When to Use CLI
|
||||
|
||||
- You prefer terminal workflows
|
||||
- You're running on a headless server
|
||||
- You're integrating Auto Claude into scripts or CI/CD
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Python 3.9+
|
||||
- Claude Code CLI (`npm install -g @anthropic-ai/claude-code`)
|
||||
|
||||
## Setup
|
||||
|
||||
**Step 1:** Navigate to the auto-claude directory
|
||||
|
||||
```bash
|
||||
cd auto-claude
|
||||
```
|
||||
|
||||
**Step 2:** Set up Python environment
|
||||
|
||||
```bash
|
||||
# Using uv (recommended)
|
||||
uv venv && uv pip install -r requirements.txt
|
||||
|
||||
# Or using standard Python
|
||||
python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt
|
||||
```
|
||||
|
||||
**Step 3:** Configure environment
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
|
||||
# Get your OAuth token
|
||||
claude setup-token
|
||||
|
||||
# Add the token to .env
|
||||
# CLAUDE_CODE_OAUTH_TOKEN=your-token-here
|
||||
```
|
||||
|
||||
## Creating Specs
|
||||
|
||||
```bash
|
||||
# Activate the virtual environment
|
||||
source .venv/bin/activate
|
||||
|
||||
# Create a spec interactively
|
||||
python spec_runner.py --interactive
|
||||
|
||||
# Or with a task description
|
||||
python spec_runner.py --task "Add user authentication with OAuth"
|
||||
|
||||
# Force a specific complexity level
|
||||
python spec_runner.py --task "Fix button color" --complexity simple
|
||||
|
||||
# Continue an interrupted spec
|
||||
python spec_runner.py --continue 001-feature
|
||||
```
|
||||
|
||||
### Complexity Tiers
|
||||
|
||||
The spec runner automatically assesses task complexity:
|
||||
|
||||
| Tier | Phases | When Used |
|
||||
|------|--------|-----------|
|
||||
| **SIMPLE** | 3 | 1-2 files, single service, no integrations (UI fixes, text changes) |
|
||||
| **STANDARD** | 6 | 3-10 files, 1-2 services, minimal integrations (features, bug fixes) |
|
||||
| **COMPLEX** | 8 | 10+ files, multiple services, external integrations |
|
||||
|
||||
## Running Builds
|
||||
|
||||
```bash
|
||||
# List all specs and their status
|
||||
python run.py --list
|
||||
|
||||
# Run a specific spec
|
||||
python run.py --spec 001
|
||||
python run.py --spec 001-feature-name
|
||||
|
||||
# Limit iterations for testing
|
||||
python run.py --spec 001 --max-iterations 5
|
||||
```
|
||||
|
||||
## QA Validation
|
||||
|
||||
After all chunks are complete, QA validation runs automatically:
|
||||
|
||||
```bash
|
||||
# Skip automatic QA
|
||||
python run.py --spec 001 --skip-qa
|
||||
|
||||
# Run QA validation manually
|
||||
python run.py --spec 001 --qa
|
||||
|
||||
# Check QA status
|
||||
python run.py --spec 001 --qa-status
|
||||
```
|
||||
|
||||
The QA validation loop:
|
||||
1. **QA Reviewer** checks all acceptance criteria
|
||||
2. If issues found → creates `QA_FIX_REQUEST.md`
|
||||
3. **QA Fixer** applies fixes
|
||||
4. Loop repeats until approved (up to 50 iterations)
|
||||
|
||||
## Workspace Management
|
||||
|
||||
Auto Claude uses Git worktrees for isolated builds:
|
||||
|
||||
```bash
|
||||
# Test the feature in the isolated workspace
|
||||
cd .worktrees/auto-claude/
|
||||
npm run dev # or your project's run command
|
||||
|
||||
# See what was changed
|
||||
python run.py --spec 001 --review
|
||||
|
||||
# Merge changes into your project
|
||||
python run.py --spec 001 --merge
|
||||
|
||||
# Discard if you don't like it
|
||||
python run.py --spec 001 --discard
|
||||
```
|
||||
|
||||
## Interactive Controls
|
||||
|
||||
While the agent is running:
|
||||
|
||||
```bash
|
||||
# Pause and add instructions
|
||||
Ctrl+C (once)
|
||||
|
||||
# Exit immediately
|
||||
Ctrl+C (twice)
|
||||
```
|
||||
|
||||
**File-based alternative:**
|
||||
```bash
|
||||
# Create PAUSE file to pause after current session
|
||||
touch specs/001-name/PAUSE
|
||||
|
||||
# Add instructions
|
||||
echo "Focus on fixing the login bug first" > specs/001-name/HUMAN_INPUT.md
|
||||
```
|
||||
|
||||
## Spec Validation
|
||||
|
||||
```bash
|
||||
python validate_spec.py --spec-dir specs/001-feature --checkpoint all
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Required | Description |
|
||||
|----------|----------|-------------|
|
||||
| `CLAUDE_CODE_OAUTH_TOKEN` | Yes | OAuth token from `claude setup-token` |
|
||||
| `AUTO_BUILD_MODEL` | No | Model override (default: claude-opus-4-5-20251101) |
|
||||
|
||||
## Auto Claude Memory Layer (Optional)
|
||||
|
||||
For cross-session context retention, see the main README for Memory Layer setup instructions.
|
||||
|
||||
### Verifying Memory Layer
|
||||
|
||||
```bash
|
||||
cd auto-claude
|
||||
source .venv/bin/activate
|
||||
python test_graphiti_memory.py
|
||||
```
|
||||
@@ -0,0 +1,370 @@
|
||||
# Docker & FalkorDB Setup Guide
|
||||
|
||||
This guide covers installing and troubleshooting Docker for Auto Claude's Memory Layer. The Memory Layer uses FalkorDB (a graph database) to provide persistent cross-session memory for AI agents.
|
||||
|
||||
> **Good news!** If you're using the Desktop UI, it automatically detects Docker and FalkorDB status and offers one-click setup. This guide is for manual setup or troubleshooting.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Quick Start](#quick-start)
|
||||
- [What is Docker?](#what-is-docker)
|
||||
- [Installing Docker Desktop](#installing-docker-desktop)
|
||||
- [macOS](#macos)
|
||||
- [Windows](#windows)
|
||||
- [Linux](#linux)
|
||||
- [Starting FalkorDB](#starting-falkordb)
|
||||
- [Verifying Your Setup](#verifying-your-setup)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Advanced Configuration](#advanced-configuration)
|
||||
- [Uninstalling](#uninstalling)
|
||||
|
||||
---
|
||||
|
||||
## Quick Start
|
||||
|
||||
If Docker Desktop is already installed and running:
|
||||
|
||||
```bash
|
||||
# Start FalkorDB
|
||||
docker run -d --name auto-claude-falkordb -p 6380:6379 falkordb/falkordb:latest
|
||||
|
||||
# Verify it's running
|
||||
docker ps | grep falkordb
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## What is Docker?
|
||||
|
||||
Docker is a tool that runs applications in isolated "containers". Think of it as a lightweight virtual machine that:
|
||||
|
||||
- **Keeps things contained** - FalkorDB runs inside Docker without affecting your system
|
||||
- **Makes setup easy** - One command to start, no complex installation
|
||||
- **Works everywhere** - Same setup on Mac, Windows, and Linux
|
||||
|
||||
**You don't need to understand Docker** - just install Docker Desktop and Auto Claude handles the rest.
|
||||
|
||||
---
|
||||
|
||||
## Installing Docker Desktop
|
||||
|
||||
### macOS
|
||||
|
||||
#### Step 1: Download
|
||||
|
||||
| Mac Type | Download Link |
|
||||
|----------|---------------|
|
||||
| **Apple Silicon (M1/M2/M3/M4)** | [Download for Apple Chip](https://desktop.docker.com/mac/main/arm64/Docker.dmg) |
|
||||
| **Intel** | [Download for Intel Chip](https://desktop.docker.com/mac/main/amd64/Docker.dmg) |
|
||||
|
||||
> **Which do I have?** Click the Apple logo () → "About This Mac". Look for "Chip" - if it says Apple M1/M2/M3/M4, use Apple Silicon. If it says Intel, use Intel.
|
||||
|
||||
#### Step 2: Install
|
||||
|
||||
1. Open the downloaded `.dmg` file
|
||||
2. Drag the Docker icon to your Applications folder
|
||||
3. Open Docker from Applications (or Spotlight: ⌘+Space, type "Docker")
|
||||
4. Click "Open" if you see a security warning
|
||||
5. **Wait** - Docker takes 1-2 minutes to start the first time
|
||||
|
||||
#### Step 3: Verify
|
||||
|
||||
Look for the whale icon (🐳) in your menu bar. When it stops animating, Docker is ready.
|
||||
|
||||
Open Terminal and run:
|
||||
|
||||
```bash
|
||||
docker --version
|
||||
# Expected: Docker version 24.x.x or higher
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
- Windows 10 (version 2004 or higher) or Windows 11
|
||||
- WSL 2 enabled (Docker will prompt you to install it)
|
||||
|
||||
#### Step 1: Download
|
||||
|
||||
[Download Docker Desktop for Windows](https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe)
|
||||
|
||||
#### Step 2: Install
|
||||
|
||||
1. Run the downloaded installer
|
||||
2. **Keep "Use WSL 2" checked** (recommended)
|
||||
3. Follow the installation wizard with default settings
|
||||
4. **Restart your computer** when prompted
|
||||
5. After restart, Docker Desktop will start automatically
|
||||
|
||||
#### Step 3: WSL 2 Setup (if prompted)
|
||||
|
||||
If Docker shows a WSL 2 warning:
|
||||
|
||||
1. Open PowerShell as Administrator
|
||||
2. Run:
|
||||
```powershell
|
||||
wsl --install
|
||||
```
|
||||
3. Restart your computer
|
||||
4. Open Docker Desktop again
|
||||
|
||||
#### Step 4: Verify
|
||||
|
||||
Look for the whale icon (🐳) in your system tray. When it stops animating, Docker is ready.
|
||||
|
||||
Open PowerShell or Command Prompt and run:
|
||||
|
||||
```bash
|
||||
docker --version
|
||||
# Expected: Docker version 24.x.x or higher
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
#### Ubuntu/Debian
|
||||
|
||||
```bash
|
||||
# Update package index
|
||||
sudo apt-get update
|
||||
|
||||
# Install prerequisites
|
||||
sudo apt-get install ca-certificates curl gnupg
|
||||
|
||||
# Add Docker's official GPG key
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.gpg
|
||||
|
||||
# Add the repository
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
# Install Docker
|
||||
sudo apt-get update
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
||||
|
||||
# Add your user to the docker group (to run without sudo)
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
# Log out and back in, then verify
|
||||
docker --version
|
||||
```
|
||||
|
||||
#### Fedora
|
||||
|
||||
```bash
|
||||
# Install Docker
|
||||
sudo dnf -y install dnf-plugins-core
|
||||
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
|
||||
sudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
||||
|
||||
# Start Docker
|
||||
sudo systemctl start docker
|
||||
sudo systemctl enable docker
|
||||
|
||||
# Add your user to the docker group
|
||||
sudo usermod -aG docker $USER
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Starting FalkorDB
|
||||
|
||||
### Option 1: Using Docker Compose (Recommended)
|
||||
|
||||
From the Auto Claude root directory:
|
||||
|
||||
```bash
|
||||
docker-compose up -d falkordb
|
||||
```
|
||||
|
||||
This uses the project's `docker-compose.yml` which is pre-configured.
|
||||
|
||||
### Option 2: Using Docker Run
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name auto-claude-falkordb \
|
||||
-p 6380:6379 \
|
||||
--restart unless-stopped \
|
||||
falkordb/falkordb:latest
|
||||
```
|
||||
|
||||
### Option 3: Let the Desktop UI Handle It
|
||||
|
||||
If you're using the Auto Claude Desktop UI:
|
||||
|
||||
1. Go to Project Settings → Memory Backend
|
||||
2. Enable "Use Graphiti"
|
||||
3. The UI will show Docker/FalkorDB status
|
||||
4. Click "Start" to launch FalkorDB automatically
|
||||
|
||||
---
|
||||
|
||||
## Verifying Your Setup
|
||||
|
||||
### Check Docker is Running
|
||||
|
||||
```bash
|
||||
docker info
|
||||
# Should show Docker system information without errors
|
||||
```
|
||||
|
||||
### Check FalkorDB is Running
|
||||
|
||||
```bash
|
||||
docker ps | grep falkordb
|
||||
# Should show the running container
|
||||
```
|
||||
|
||||
### Test FalkorDB Connection
|
||||
|
||||
```bash
|
||||
docker exec auto-claude-falkordb redis-cli PING
|
||||
# Expected response: PONG
|
||||
```
|
||||
|
||||
### Check Logs (if something seems wrong)
|
||||
|
||||
```bash
|
||||
docker logs auto-claude-falkordb
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Docker Issues
|
||||
|
||||
| Problem | Solution |
|
||||
|---------|----------|
|
||||
| **"docker: command not found"** | Docker Desktop isn't installed or isn't in PATH. Reinstall Docker Desktop. |
|
||||
| **"Cannot connect to Docker daemon"** | Docker Desktop isn't running. Open Docker Desktop and wait for it to start. |
|
||||
| **"permission denied"** | On Linux, add your user to the docker group: `sudo usermod -aG docker $USER` then log out and back in. |
|
||||
| **Docker Desktop won't start** | Try restarting your computer. On Mac, check System Preferences → Security for blocked apps. |
|
||||
| **"Docker Desktop requires macOS 12"** | Update macOS in System Preferences → Software Update. |
|
||||
| **"WSL 2 installation incomplete"** | Run `wsl --install` in PowerShell (as Admin) and restart. |
|
||||
|
||||
### FalkorDB Issues
|
||||
|
||||
| Problem | Solution |
|
||||
|---------|----------|
|
||||
| **Container won't start** | Check if port 6380 is in use: `lsof -i :6380` (Mac/Linux) or `netstat -ano | findstr 6380` (Windows) |
|
||||
| **"port is already allocated"** | Stop conflicting container: `docker stop auto-claude-falkordb && docker rm auto-claude-falkordb` |
|
||||
| **Connection refused** | Verify container is running: `docker ps`. If not listed, start it again. |
|
||||
| **Container crashes immediately** | Check logs: `docker logs auto-claude-falkordb`. May need more memory. |
|
||||
|
||||
### Memory/Performance Issues
|
||||
|
||||
| Problem | Solution |
|
||||
|---------|----------|
|
||||
| **Docker using too much memory** | Open Docker Desktop → Settings → Resources → Memory. Reduce to 2-4GB. |
|
||||
| **Docker using too much disk** | Run `docker system prune -a` to clean unused images and containers. |
|
||||
| **Computer running slow** | Quit Docker Desktop when not using Auto Claude. FalkorDB only needs to run during active sessions. |
|
||||
|
||||
### Network Issues
|
||||
|
||||
| Problem | Solution |
|
||||
|---------|----------|
|
||||
| **"network not found"** | Run `docker network create auto-claude-network` or use `docker-compose up` |
|
||||
| **Can't connect from app** | Ensure port 6380 is exposed. Check firewall isn't blocking localhost connections. |
|
||||
|
||||
---
|
||||
|
||||
## Advanced Configuration
|
||||
|
||||
### Custom Port
|
||||
|
||||
If port 6380 is in use, change it:
|
||||
|
||||
```bash
|
||||
# Using docker run
|
||||
docker run -d --name auto-claude-falkordb -p 6381:6379 falkordb/falkordb:latest
|
||||
```
|
||||
|
||||
Then update Auto Claude settings to use port 6381.
|
||||
|
||||
### Persistent Data
|
||||
|
||||
To persist FalkorDB data between container restarts:
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name auto-claude-falkordb \
|
||||
-p 6380:6379 \
|
||||
-v auto-claude-falkordb-data:/data \
|
||||
--restart unless-stopped \
|
||||
falkordb/falkordb:latest
|
||||
```
|
||||
|
||||
### Memory Limits
|
||||
|
||||
To limit FalkorDB memory usage:
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name auto-claude-falkordb \
|
||||
-p 6380:6379 \
|
||||
--memory=2g \
|
||||
--restart unless-stopped \
|
||||
falkordb/falkordb:latest
|
||||
```
|
||||
|
||||
### Running on a Remote Server
|
||||
|
||||
If running Docker on a different machine:
|
||||
|
||||
1. Expose the port on the server:
|
||||
```bash
|
||||
docker run -d -p 0.0.0.0:6380:6379 falkordb/falkordb:latest
|
||||
```
|
||||
|
||||
2. Update Auto Claude settings:
|
||||
- Set `GRAPHITI_FALKORDB_HOST=your-server-ip`
|
||||
- Set `GRAPHITI_FALKORDB_PORT=6380`
|
||||
|
||||
---
|
||||
|
||||
## Uninstalling
|
||||
|
||||
### Stop and Remove FalkorDB
|
||||
|
||||
```bash
|
||||
docker stop auto-claude-falkordb
|
||||
docker rm auto-claude-falkordb
|
||||
```
|
||||
|
||||
### Remove FalkorDB Image
|
||||
|
||||
```bash
|
||||
docker rmi falkordb/falkordb:latest
|
||||
```
|
||||
|
||||
### Remove All Docker Data
|
||||
|
||||
```bash
|
||||
docker system prune -a --volumes
|
||||
```
|
||||
|
||||
### Uninstall Docker Desktop
|
||||
|
||||
- **Mac**: Drag Docker from Applications to Trash, then empty Trash
|
||||
- **Windows**: Control Panel → Programs → Uninstall Docker Desktop
|
||||
- **Linux**: `sudo apt-get remove docker-ce docker-ce-cli containerd.io`
|
||||
|
||||
---
|
||||
|
||||
## Getting Help
|
||||
|
||||
If you're still having issues:
|
||||
|
||||
1. Check the [Auto Claude GitHub Issues](https://github.com/auto-claude/auto-claude/issues)
|
||||
2. Search for your error message
|
||||
3. Create a new issue with:
|
||||
- Your operating system and version
|
||||
- Docker version (`docker --version`)
|
||||
- Error message or logs
|
||||
- Steps you've already tried
|
||||
@@ -0,0 +1,16 @@
|
||||
# Auto Claude Guides
|
||||
|
||||
Detailed documentation for Auto Claude setup and usage.
|
||||
|
||||
## Available Guides
|
||||
|
||||
| Guide | Description |
|
||||
|-------|-------------|
|
||||
| **[CLI-USAGE.md](CLI-USAGE.md)** | Terminal-only usage for power users, headless servers, and CI/CD |
|
||||
| **[DOCKER-SETUP.md](DOCKER-SETUP.md)** | Docker Desktop installation, FalkorDB setup, and troubleshooting |
|
||||
|
||||
## Quick Links
|
||||
|
||||
- [Main README](../README.md) - Getting started with the Desktop UI
|
||||
- [Contributing](../CONTRIBUTING.md) - How to contribute to Auto Claude
|
||||
- [Changelog](../CHANGELOG.md) - Release history
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Extract sections from ipc-handlers.ts based on line ranges
|
||||
|
||||
FILE="auto-claude-ui/src/main/ipc-handlers.ts"
|
||||
OUT_DIR="auto-claude-ui/src/main/ipc-handlers/sections"
|
||||
|
||||
mkdir -p "$OUT_DIR"
|
||||
|
||||
# Extract task handlers (lines 381-1877)
|
||||
sed -n '381,1877p' "$FILE" > "$OUT_DIR/task-section.txt"
|
||||
|
||||
# Extract terminal handlers (lines 2201-2687)
|
||||
sed -n '2201,2687p' "$FILE" > "$OUT_DIR/terminal-section.txt"
|
||||
|
||||
# Extract roadmap/context handlers (lines 2840-3716)
|
||||
sed -n '2840,3716p' "$FILE" > "$OUT_DIR/context-roadmap-section.txt"
|
||||
|
||||
# Extract integration handlers (lines 3717-5369)
|
||||
sed -n '3717,5369p' "$FILE" > "$OUT_DIR/integration-section.txt"
|
||||
|
||||
# Extract ideation handlers (lines 5656-6830)
|
||||
sed -n '5656,6830p' "$FILE" > "$OUT_DIR/ideation-insights-section.txt"
|
||||
|
||||
echo "Sections extracted to $OUT_DIR"
|
||||
ls -lh "$OUT_DIR"
|
||||
Reference in New Issue
Block a user