agent-ecosystem/src/renderer/App.tsx
iliya 3e605622f7 feat: implement tool approval protocol for team management
- Added support for tool approval requests and responses in the team provisioning service.
- Introduced IPC channels for handling tool approval events between main and renderer processes.
- Enhanced the UI to display tool approval requests and allow user responses through new components.
- Updated team launch and creation dialogs to include an option for skipping permissions, integrating with the new tool approval logic.
- Implemented state management for pending approvals in the store, ensuring a seamless user experience during tool interactions.
2026-03-06 21:12:59 +02:00

48 lines
1.5 KiB
TypeScript

import React, { useEffect } from 'react';
import { TooltipProvider } from '@renderer/components/ui/tooltip';
import { ConfirmDialog } from './components/common/ConfirmDialog';
import { ContextSwitchOverlay } from './components/common/ContextSwitchOverlay';
import { ErrorBoundary } from './components/common/ErrorBoundary';
import { TabbedLayout } from './components/layout/TabbedLayout';
import { ToolApprovalSheet } from './components/team/ToolApprovalSheet';
import { useTheme } from './hooks/useTheme';
import { api } from './api';
import { useStore } from './store';
export const App = (): React.JSX.Element => {
// Initialize theme on app load
useTheme();
// Dismiss splash screen once React is ready
useEffect(() => {
const splash = document.getElementById('splash');
if (splash) {
splash.style.opacity = '0';
setTimeout(() => splash.remove(), 300);
}
}, []);
// Initialize context system lazily when SSH connection state changes.
// Local-only users never pay the cost of IndexedDB init + context IPC calls.
useEffect(() => {
if (!api.ssh?.onStatus) return;
const cleanup = api.ssh.onStatus(() => {
void useStore.getState().initializeContextSystem();
void useStore.getState().fetchAvailableContexts();
});
return cleanup;
}, []);
return (
<ErrorBoundary>
<TooltipProvider delayDuration={300}>
<ContextSwitchOverlay />
<TabbedLayout />
<ConfirmDialog />
<ToolApprovalSheet />
</TooltipProvider>
</ErrorBoundary>
);
};