mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-30 23:14:37 +00:00
* feat: add .mcp.json for MCP server configuration - Introduced `.mcp.json` with server details for managing MCP integrations - Defines `readme` server with HTTP type and URL endpoint configuration * fix: Update skills submodule with Telegram error handling improvements - Fixed setup flow showing false success when TDLib errors occurred - Improved async error handling in setup steps - Added client reset mechanisms for error recovery - Enhanced error messaging for better user experience - Cleaned up excessive debug logging while maintaining error logs Resolves issue where Telegram setup showed success modal despite underlying TDLib errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Add daemon lifecycle management system to frontend UI This implementation integrates the Rust daemon's health monitoring and lifecycle management into the React frontend. Key features include real-time health indicators, automatic start/error recovery, and detailed control panels, enhancing both user experience and operational reliability. * Enhance daemon health monitoring with detailed logging, event tracking, and state management improvements. * Add extensive logging for Tauri socket lifecycle and event listeners This update improves troubleshooting and debugging by adding detailed logs throughout Tauri socket initialization, event listener setup, and error handling processes. * Define global Tauri interface types in TypeScript * Fix daemon service management and health communication issues This comprehensive fix resolves two critical daemon-related issues: 1. **Launchctl "Input/output error" fix**: - Add intelligent state checking before service operations - Only load LaunchAgent if not already loaded - Treat "already running" as success, not failure - Add helper functions for cross-platform service state detection - Implement idempotent service start operations 2. **Daemon health communication fix**: - Add ALPHAHUMAN_DAEMON_INTERNAL environment variable to external service plist - Force external daemon to use file-based communication (daemon_state.json) - Implement file watching bridge in main app to emit Tauri events - Ensure frontend receives proper health updates from external daemon **Key Changes**: - Enhanced `start()` function with state checking across all platforms - Added `is_service_loaded_macos()`, `is_service_enabled_linux()`, `is_task_exists_windows()` - Modified macOS plist to include `ALPHAHUMAN_DAEMON_INTERNAL=false` - Added `watch_daemon_health_file()` function for external daemon communication - Updated daemon mode detection logic for cross-platform consistency - Added comprehensive logging for service management operations **Expected Results**: - No more "Input/output error" when clicking daemon start button - External daemon status shows "connected" instead of "disconnected" - Idempotent service operations (safe to run multiple times) - Single daemon process prevents resource conflicts - Cross-platform daemon service reliability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Add `ALPHAHUMAN_DAEMON_INTERNAL` env variable to configuration documentation * Optimize imports in `TauriCommandsPanel.tsx` by removing unused variables and adding necessary hooks. * Add OAuth login support with configurable provider types and UI components This update introduces OAuth login functionality, including support for multiple providers (Google, GitHub, Twitter, Discord). Added reusable components for provider buttons and a login section, along with styled configurations and type definitions. Includes enhancements for token handling and updated login flows. * Add OAuth debug mode support for development environments Introduce `IS_DEV` checks to enable OAuth debug mode, allowing detailed logging and adjustable OAuth URLs with debug parameters during development. --------- Co-authored-by: Claude <noreply@anthropic.com>
68 lines
2.3 KiB
TypeScript
68 lines
2.3 KiB
TypeScript
import { useState } from 'react';
|
|
import type { OAuthProviderConfig } from '../../types/oauth';
|
|
import { openUrl } from '../../utils/openUrl';
|
|
import { isTauri } from '../../utils/tauriCommands';
|
|
import { IS_DEV } from '../../utils/config';
|
|
|
|
interface OAuthProviderButtonProps {
|
|
provider: OAuthProviderConfig;
|
|
className?: string;
|
|
disabled?: boolean;
|
|
}
|
|
|
|
const OAuthProviderButton = ({
|
|
provider,
|
|
className = '',
|
|
disabled: externalDisabled = false,
|
|
}: OAuthProviderButtonProps) => {
|
|
const [isLoading, setIsLoading] = useState(false);
|
|
|
|
const handleOAuthLogin = async () => {
|
|
if (externalDisabled || isLoading) return;
|
|
|
|
console.log(`Starting ${provider.name} OAuth login`, isTauri());
|
|
|
|
if (IS_DEV) {
|
|
console.log(`[dev] OAuth debug mode enabled. OAuth URL: ${provider.loginUrl}`);
|
|
console.log('[dev] In debug mode, OAuth will return JSON response instead of redirect.');
|
|
console.log('[dev] After OAuth completion, copy the loginToken and use: window.__simulateDeepLink("alphahuman://auth?token=YOUR_TOKEN")');
|
|
}
|
|
|
|
setIsLoading(true);
|
|
|
|
try {
|
|
// Desktop (Tauri): use system browser → backend OAuth → deep link back to app
|
|
if (isTauri()) {
|
|
await openUrl(provider.loginUrl);
|
|
} else {
|
|
// Web fallback: direct OAuth flow in current window
|
|
window.location.href = provider.loginUrl;
|
|
}
|
|
} catch (error) {
|
|
console.error(`Failed to initiate ${provider.name} OAuth login:`, error);
|
|
setIsLoading(false);
|
|
}
|
|
};
|
|
|
|
const isDisabled = externalDisabled || isLoading;
|
|
const IconComponent = provider.icon;
|
|
|
|
return (
|
|
<button
|
|
onClick={handleOAuthLogin}
|
|
disabled={isDisabled}
|
|
className={`w-full flex items-center justify-center space-x-3 ${provider.color} ${provider.hoverColor} ${provider.textColor} font-semibold py-4 rounded-xl transition-all duration-300 hover:shadow-medium hover:scale-[1.02] active:scale-[0.98] disabled:hover:scale-100 disabled:opacity-50 disabled:cursor-not-allowed ${className}`}
|
|
>
|
|
{isLoading ? (
|
|
<div className="animate-spin rounded-full h-5 w-5 border-b-2 border-current"></div>
|
|
) : (
|
|
<IconComponent className="w-5 h-5" />
|
|
)}
|
|
<span>
|
|
{isLoading ? 'Connecting...' : `Continue with ${provider.name}`}
|
|
</span>
|
|
</button>
|
|
);
|
|
};
|
|
|
|
export default OAuthProviderButton; |