/** * AdvancedSection - Advanced settings including config management and about info. */ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { api, isElectronMode } from '@renderer/api'; import appIcon from '@renderer/favicon.png'; import { useStore } from '@renderer/store'; import { CheckCircle, Code2, Download, FileEdit, Loader2, RefreshCw, Upload } from 'lucide-react'; import { useShallow } from 'zustand/react/shallow'; import { SettingsSectionHeader } from '../components'; import { CliStatusSection } from './CliStatusSection'; import { ConfigEditorDialog } from './ConfigEditorDialog'; interface AdvancedSectionProps { readonly saving: boolean; readonly onResetToDefaults: () => void; readonly onExportConfig: () => void; readonly onImportConfig: () => void; readonly onOpenInEditor: () => void; } export const AdvancedSection = ({ saving, onResetToDefaults, onExportConfig, onImportConfig, onOpenInEditor, }: AdvancedSectionProps): React.JSX.Element => { const isElectron = useMemo(() => isElectronMode(), []); const [version, setVersion] = useState(''); const [configEditorOpen, setConfigEditorOpen] = useState(false); const { updateStatus, availableVersion, checkForUpdates } = useStore( useShallow((s) => ({ updateStatus: s.updateStatus, availableVersion: s.availableVersion, checkForUpdates: s.checkForUpdates, })) ); // Auto-revert "not-available" / "error" status back to idle after a brief display const revertTimerRef = useRef>(undefined); useEffect(() => { if (updateStatus === 'not-available' || updateStatus === 'error') { revertTimerRef.current = setTimeout(() => { useStore.setState({ updateStatus: 'idle' }); }, 3000); } return () => { if (revertTimerRef.current) clearTimeout(revertTimerRef.current); }; }, [updateStatus]); useEffect(() => { api.getAppVersion().then(setVersion).catch(console.error); }, []); const handleCheckForUpdates = useCallback(() => { checkForUpdates(); }, [checkForUpdates]); const getUpdateButtonContent = (): React.JSX.Element => { switch (updateStatus) { case 'checking': return ( <> Checking... ); case 'not-available': return ( <> Up to date ); case 'available': case 'downloaded': return ( <> {updateStatus === 'downloaded' ? 'Update ready' : `v${availableVersion ?? 'unknown'} available`} ); default: return ( <> Check for Updates ); } }; return (
{isElectron && ( )}
App Icon

Agent Teams AI

{isElectron && ( )} {!isElectron && ( Standalone )}

Version {version || '...'}

Assemble AI agent teams that work autonomously in parallel, communicate across teams, and manage tasks on a kanban board — with built-in code review, live process monitoring, and full tool visibility.

setConfigEditorOpen(false)} onConfigSaved={() => { // Config saved via editor — settings page will pick up changes on next render }} />
); };