chore: Fix all 246 TypeScript errors in UI

- Extended SetupAPI interface with 20+ missing methods for Cursor, Codex,
  OpenCode, Gemini, and Copilot CLI integrations
- Fixed WorktreeInfo type to include isCurrent and hasWorktree fields
- Added null checks for optional API properties across all hooks
- Fixed Feature type conflicts between @automaker/types and local definitions
- Added missing CLI status hooks for all providers
- Fixed type mismatches in mutation callbacks and event handlers
- Removed dead code referencing non-existent GlobalSettings properties
- Updated mock implementations in electron.ts for all new API methods

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Shirone
2026-01-25 18:36:47 +01:00
parent 0fb471ca15
commit 5c335641fa
48 changed files with 1071 additions and 336 deletions

View File

@@ -9,7 +9,7 @@ import { useEffect, useRef } from 'react';
import { useQueryClient, QueryClient } from '@tanstack/react-query';
import { getElectronAPI } from '@/lib/electron';
import { queryKeys } from '@/lib/query-keys';
import type { AutoModeEvent, SpecRegenerationEvent } from '@/types/electron';
import type { AutoModeEvent, SpecRegenerationEvent, StreamEvent } from '@/types/electron';
import type { IssueValidationEvent } from '@automaker/types';
import { debounce, type DebouncedFunction } from '@automaker/utils/debounce';
import { useEventRecencyStore } from './use-event-recency';
@@ -165,6 +165,7 @@ export function useAutoModeQueryInvalidation(projectPath: string | undefined) {
}
const api = getElectronAPI();
if (!api.autoMode) return;
const unsubscribe = api.autoMode.onEvent((event: AutoModeEvent) => {
// Record that we received a WebSocket event (for event recency tracking)
// This allows polling to be disabled when WebSocket events are flowing
@@ -241,6 +242,7 @@ export function useSpecRegenerationQueryInvalidation(projectPath: string | undef
if (!projectPath) return;
const api = getElectronAPI();
if (!api.specRegeneration) return;
const unsubscribe = api.specRegeneration.onEvent((event: SpecRegenerationEvent) => {
// Only handle events for the current project
if (event.projectPath !== projectPath) return;
@@ -288,14 +290,14 @@ export function useGitHubValidationQueryInvalidation(projectPath: string | undef
// Record that we received a WebSocket event
recordGlobalEvent();
if (event.type === 'validation_complete' || event.type === 'validation_error') {
if (event.type === 'issue_validation_complete' || event.type === 'issue_validation_error') {
// Invalidate all validations for this project
queryClient.invalidateQueries({
queryKey: queryKeys.github.validations(projectPath),
});
// Also invalidate specific issue validation if we have the issue number
if ('issueNumber' in event && event.issueNumber) {
if (event.issueNumber) {
queryClient.invalidateQueries({
queryKey: queryKeys.github.validation(projectPath, event.issueNumber),
});
@@ -320,7 +322,9 @@ export function useSessionQueryInvalidation(sessionId: string | undefined) {
if (!sessionId) return;
const api = getElectronAPI();
const unsubscribe = api.agent.onStream((event) => {
if (!api.agent) return;
const unsubscribe = api.agent.onStream((data: unknown) => {
const event = data as StreamEvent;
// Only handle events for the current session
if ('sessionId' in event && event.sessionId !== sessionId) return;