feat: Add integrated release workflow with AI version suggestion

Adds a streamlined release workflow that uses AI (Claude Haiku) to analyze git commits and suggest semantic version bumps (major/minor/patch). Automatically updates package.json, commits, and pushes using a safe git workflow that preserves user's current work.

New features:

- RELEASE_SUGGEST_VERSION IPC for AI-powered version suggestions

- bumpVersion() with safe git workflow (stash/checkout/commit/restore)

- VersionSuggestion type with bumpType and reasoning

- Updated ReleaseProgress to include bumping_version stage

Also replaces VERSION file detection with requirements.txt across the codebase.
This commit is contained in:
AndyMik90
2025-12-18 10:32:55 +01:00
parent 0ef0e1588b
commit 7f3cd5969d
14 changed files with 415 additions and 49 deletions
@@ -6,7 +6,8 @@ import type {
GitHubImportResult,
GitHubInvestigationStatus,
GitHubInvestigationResult,
IPCResult
IPCResult,
VersionSuggestion
} from '../../../shared/types';
import { createIpcListener, invokeIpc, sendIpc, IpcListenerCleanup } from './ipc-utils';
@@ -28,6 +29,9 @@ export interface GitHubAPI {
options?: { draft?: boolean; prerelease?: boolean }
) => Promise<IPCResult<{ url: string }>>;
/** AI-powered version suggestion based on commits since last release */
suggestReleaseVersion: (projectId: string) => Promise<IPCResult<VersionSuggestion>>;
// OAuth operations (gh CLI)
checkGitHubCli: () => Promise<IPCResult<{ installed: boolean; version?: string }>>;
checkGitHubAuth: () => Promise<IPCResult<{ authenticated: boolean; username?: string }>>;
@@ -79,6 +83,9 @@ export const createGitHubAPI = (): GitHubAPI => ({
): Promise<IPCResult<{ url: string }>> =>
invokeIpc(IPC_CHANNELS.GITHUB_CREATE_RELEASE, projectId, version, releaseNotes, options),
suggestReleaseVersion: (projectId: string): Promise<IPCResult<VersionSuggestion>> =>
invokeIpc(IPC_CHANNELS.RELEASE_SUGGEST_VERSION, projectId),
// OAuth operations (gh CLI)
checkGitHubCli: (): Promise<IPCResult<{ installed: boolean; version?: string }>> =>
invokeIpc(IPC_CHANNELS.GITHUB_CHECK_CLI),