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

@@ -5,7 +5,7 @@ import type { CliStatus, ClaudeAuthStatus, CodexAuthStatus } from '@/store/setup
interface CliStatusApiResponse {
success: boolean;
status?: 'installed' | 'not_installed';
status?: string;
installed?: boolean;
method?: string;
version?: string;
@@ -14,12 +14,16 @@ interface CliStatusApiResponse {
authenticated: boolean;
method: string;
hasCredentialsFile?: boolean;
hasToken?: boolean;
hasStoredOAuthToken?: boolean;
hasStoredApiKey?: boolean;
hasEnvApiKey?: boolean;
hasEnvOAuthToken?: boolean;
hasCliAuth?: boolean;
hasRecentActivity?: boolean;
hasAuthFile?: boolean;
hasApiKey?: boolean;
hasOAuthToken?: boolean;
};
error?: string;
}

View File

@@ -55,13 +55,18 @@ export function OpencodeSetupStep({ onNext, onBack, onSkip }: OpencodeSetupStepP
}
const result = await api.setup.getOpencodeStatus();
if (result.success) {
// Derive install command from platform-specific options or use npm fallback
const installCommand =
result.installCommands?.npm ||
result.installCommands?.macos ||
result.installCommands?.linux;
const status: OpencodeCliStatus = {
installed: result.installed ?? false,
version: result.version,
path: result.path,
version: result.version ?? null,
path: result.path ?? null,
auth: result.auth,
installCommand: result.installCommand,
loginCommand: result.loginCommand,
installCommand,
loginCommand: 'opencode auth login',
};
setOpencodeCliStatus(status);

View File

@@ -133,8 +133,8 @@ function ClaudeContent() {
if (result.success) {
setClaudeCliStatus({
installed: result.installed ?? false,
version: result.version,
path: result.path,
version: result.version ?? null,
path: result.path ?? null,
method: 'none',
});
@@ -707,14 +707,21 @@ function CodexContent() {
if (result.success) {
setCodexCliStatus({
installed: result.installed ?? false,
version: result.version,
path: result.path,
version: result.version ?? null,
path: result.path ?? null,
method: 'none',
});
if (result.auth?.authenticated) {
const validMethods = ['api_key_env', 'api_key', 'cli_authenticated', 'none'] as const;
type CodexAuthMethod = (typeof validMethods)[number];
const method: CodexAuthMethod = validMethods.includes(
result.auth.method as CodexAuthMethod
)
? (result.auth.method as CodexAuthMethod)
: 'cli_authenticated';
setCodexAuthStatus({
authenticated: true,
method: result.auth.method || 'cli_authenticated',
method,
});
toast.success('Codex CLI is ready!');
}
@@ -997,13 +1004,18 @@ function OpencodeContent() {
if (!api.setup?.getOpencodeStatus) return;
const result = await api.setup.getOpencodeStatus();
if (result.success) {
// Derive install command from platform-specific options or use npm fallback
const installCommand =
result.installCommands?.npm ||
result.installCommands?.macos ||
result.installCommands?.linux;
setOpencodeCliStatus({
installed: result.installed ?? false,
version: result.version,
path: result.path,
version: result.version ?? null,
path: result.path ?? null,
auth: result.auth,
installCommand: result.installCommand,
loginCommand: result.loginCommand,
installCommand,
loginCommand: 'opencode auth login',
});
if (result.auth?.authenticated) {
toast.success('OpenCode CLI is ready!');
@@ -1807,8 +1819,8 @@ export function ProvidersSetupStep({ onNext, onBack }: ProvidersSetupStepProps)
if (result.success) {
setClaudeCliStatus({
installed: result.installed ?? false,
version: result.version,
path: result.path,
version: result.version ?? null,
path: result.path ?? null,
method: 'none',
});
// Note: Auth verification is handled by ClaudeContent component to avoid duplicate calls
@@ -1846,14 +1858,21 @@ export function ProvidersSetupStep({ onNext, onBack }: ProvidersSetupStepProps)
if (result.success) {
setCodexCliStatus({
installed: result.installed ?? false,
version: result.version,
path: result.path,
version: result.version ?? null,
path: result.path ?? null,
method: 'none',
});
if (result.auth?.authenticated) {
const validMethods = ['api_key_env', 'api_key', 'cli_authenticated', 'none'] as const;
type CodexAuthMethodType = (typeof validMethods)[number];
const method: CodexAuthMethodType = validMethods.includes(
result.auth.method as CodexAuthMethodType
)
? (result.auth.method as CodexAuthMethodType)
: 'cli_authenticated';
setCodexAuthStatus({
authenticated: true,
method: result.auth.method || 'cli_authenticated',
method,
});
}
}
@@ -1868,13 +1887,18 @@ export function ProvidersSetupStep({ onNext, onBack }: ProvidersSetupStepProps)
if (!api.setup?.getOpencodeStatus) return;
const result = await api.setup.getOpencodeStatus();
if (result.success) {
// Derive install command from platform-specific options or use npm fallback
const installCommand =
result.installCommands?.npm ||
result.installCommands?.macos ||
result.installCommands?.linux;
setOpencodeCliStatus({
installed: result.installed ?? false,
version: result.version,
path: result.path,
version: result.version ?? null,
path: result.path ?? null,
auth: result.auth,
installCommand: result.installCommand,
loginCommand: result.loginCommand,
installCommand,
loginCommand: 'opencode auth login',
});
}
} catch {