Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ and this project aims to adhere to [Semantic Versioning](https://semver.org/spec

_(Future changes will go here)_

## [0.7.10] - 2025-07-03

### Changed

- **Migrated to External LLM Module**: Replaced integrated LLM implementation (`electron/modules/llm/`) with external `genai-lite` package (^0.1.0) for better maintainability and separation of concerns. This significant refactoring maintains full backward compatibility while simplifying the codebase.
- **Improved API Key Handling**: Enhanced the ApiKeyProvider to support both secure storage and environment variable fallbacks seamlessly.
- **Centralized IPC Constants**: Moved LLM IPC channel constants to `common/types/llm.ts` for better code organization and reusability.
- **Updated Build Configuration**: Modified webpack configurations to include the new `common/` directory for TypeScript compilation.

### Fixed

- **Environment Variable Support**: Restored environment variable fallback functionality that was temporarily lost during the initial genai-lite migration.
- **Documentation Error**: Corrected environment variable name from `ATHANOR_GOOGLE_API_KEY` to `ATHANOR_GEMINI_API_KEY` to match the actual provider ID.

### Documentation

- Updated `CLAUDE.md` and `PROJECT.md` to reflect the new architecture using `genai-lite`.
- Added documentation for the `common/types/` directory pattern for shared types.
- Added Mistral to the list of supported environment variables in troubleshooting guide.

## [0.7.9] - 2025-07-03

### Added
Expand Down
18 changes: 11 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ Athanor is an Electron desktop application for AI-assisted development workflows
- Optional direct API integration via secure storage (`electron/modules/secure-api-storage/`)
- Primary workflow: copy prompts to external AI, paste responses back
- XML command parsing for applying AI-generated changes
- Modular LLM provider system (`electron/modules/llm/`) supporting:
- LLM functionality provided by external `genai-lite` package supporting:
- Anthropic Claude API
- OpenAI GPT models
- Google Gemini models
- Mistral models (API key storage only)
- Type-safe IPC channels for LLM operations
- Extensive model configuration and client adapters
- Mistral models
- Type-safe IPC channels for LLM operations via `common/types/llm.ts`
- Custom ApiKeyProvider supporting both secure storage and environment variables
- Environment variable fallback: `ATHANOR_<PROVIDER>_API_KEY`

**File Management:**

Expand Down Expand Up @@ -153,6 +154,11 @@ Athanor is an Electron desktop application for AI-assisted development workflows
3. Add corresponding methods to `preload.ts`
4. Update type definitions in `src/types/global.d.ts`

**When working with shared types:**

- Use `common/types/` for types shared between main and renderer processes
- Update webpack configs to include new directories when needed

**Important UI Patterns:**

- **Left Panel**: File explorer with context menus and ignore functionality
Expand Down Expand Up @@ -186,8 +192,6 @@ Athanor is an Electron desktop application for AI-assisted development workflows
- **ignore** - .gitignore/.athignore parsing
- **js-tiktoken** - Token counting for prompts
- **Jest + ts-jest** - Testing framework
- **@anthropic-ai/sdk** - Anthropic Claude API integration
- **openai** - OpenAI API integration
- **@google/genai** - Google Gemini API integration
- **genai-lite** - Unified LLM integration supporting Claude, GPT, Gemini, and Mistral
- **node-pty** - Terminal emulation support
- **xterm & xterm-addon-fit** - Terminal rendering in UI
10 changes: 6 additions & 4 deletions PROJECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Athanor is an **Electron-based desktop application** that integrates AI coding a
3. **Direct LLM API Integration (Optional)**
- While the core workflow is API-key-free, Athanor includes an optional feature for direct communication with LLM providers (OpenAI, Anthropic, Gemini, Mistral).
- API keys are stored securely using Electron's `safeStorage` via the `ApiKeyServiceMain`.
- The `LLMServiceMain`, client adapters, and extensive model configuration (`electron/modules/llm/main/config.ts`) manage these interactions.
- The `LLMService` from the external `genai-lite` package manages these interactions with a custom ApiKeyProvider that supports both secure storage and environment variable fallbacks.

4. **Git Integration**
- Athanor deeply integrates with Git repositories via `GitService.ts`.
Expand Down Expand Up @@ -116,8 +116,10 @@ Athanor follows Electron's recommended **“secure by default”** pattern, sepa
- A lightweight service that listens for file changes from `FileService` to identify which files are being actively edited, providing a real-time relevance signal.
- **Dependency Resolver/Scanner (`DependencyResolver.ts`, `DependencyScanner.ts`)**:
- Utilities used by the Project Graph Service to perform language-aware dependency analysis for JavaScript/TypeScript and Python.
- **LLM & API Key Services (`electron/modules/`)**:
- A dedicated module for handling optional, direct LLM API calls (`LLMServiceMain`) and secure storage of API keys (`ApiKeyServiceMain`).
- **LLM & API Key Services**:
- LLM functionality provided by external `genai-lite` package with custom ApiKeyProvider
- Secure API key storage via `genai-key-storage-lite` package (`ApiKeyServiceMain`)
- Shared IPC channel types in `common/types/llm.ts`

2. **Renderer Process (React)**
- **`src/services/fileSystemService.ts`**:
Expand Down Expand Up @@ -154,7 +156,7 @@ Athanor follows Electron's recommended **“secure by default”** pattern, sepa
- **Chokidar**: Watches the local file system for changes in the open folder.
- **ignore**: Reads `.athignore` and `.gitignore` to filter out hidden or excluded files in the Explorer.
- **js-tiktoken**: Used for accurate token counting in prompts.
- **LLM SDKs**: Optional integration with `@anthropic-ai/sdk`, `@google/genai`, `openai`.
- **genai-lite**: Unified LLM integration supporting Claude, GPT, Gemini, and Mistral models.
- **Webpack & electron-forge**: Build, package, and run the Electron application.
- **TailwindCSS 3 + Lucide Icons**: Provides a flexible styling system and icon library for a clean UI.
- **Material-UI (MUI) 5**: Partially integrated for certain UI elements (used in some components).
Expand Down
16 changes: 16 additions & 0 deletions common/types/llm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// common/types/llm.ts
/**
* IPC channel names for LLM operations
*/
export const LLM_IPC_CHANNELS = {
GET_PROVIDERS: 'llm:get-providers',
GET_MODELS: 'llm:get-models',
SEND_MESSAGE: 'llm:send-message',
IS_KEY_AVAILABLE: 'llm:is-key-available',
} as const;

/**
* Type for LLM IPC channel names
*/
export type LLMIPCChannelName =
(typeof LLM_IPC_CHANNELS)[keyof typeof LLM_IPC_CHANNELS];
5 changes: 4 additions & 1 deletion docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ export ATHANOR_OPENAI_API_KEY="sk-..."
export ATHANOR_ANTHROPIC_API_KEY="sk-ant-..."

# For Gemini
export ATHANOR_GOOGLE_API_KEY="..."
export ATHANOR_GEMINI_API_KEY="..."

# For Mistral
export ATHANOR_MISTRAL_API_KEY="..."
```

When Athanor starts, it will detect these environment variables and enable the "Send via API" functionality for the corresponding providers, even if the OS keyring service is not available.
Expand Down
Loading