feat(worktree): add AI commit message generation feature

- Implemented a new endpoint to generate commit messages based on git diffs.
- Updated worktree routes to include the AI commit message generation functionality.
- Enhanced the UI to support automatic generation of commit messages when the commit dialog opens, based on user settings.
- Added settings for enabling/disabling AI-generated commit messages and configuring the model used for generation.
This commit is contained in:
Shirone
2026-01-12 20:38:00 +01:00
parent 8b19266c9a
commit 5e4f5f86cd
10 changed files with 162 additions and 42 deletions

View File

@@ -40,8 +40,12 @@ import {
createDeleteInitScriptHandler,
createRunInitScriptHandler,
} from './routes/init-script.js';
import type { SettingsService } from '../../services/settings-service.js';
export function createWorktreeRoutes(events: EventEmitter): Router {
export function createWorktreeRoutes(
events: EventEmitter,
settingsService?: SettingsService
): Router {
const router = Router();
router.post('/info', validatePathParams('projectPath'), createInfoHandler());
@@ -69,7 +73,7 @@ export function createWorktreeRoutes(events: EventEmitter): Router {
'/generate-commit-message',
validatePathParams('worktreePath'),
requireGitRepoOnly,
createGenerateCommitMessageHandler()
createGenerateCommitMessageHandler(settingsService)
);
router.post(
'/push',