Commit Graph

14 Commits

  • feat(chat): write API keys to OpenClaw and embed Control UI for chat
    Part 1: API Key Integration
    - Create electron/utils/openclaw-auth.ts to write keys to
      ~/.openclaw/agents/main/agent/auth-profiles.json
    - Update provider:save and provider:setApiKey IPC handlers to
      persist keys to OpenClaw auth-profiles alongside ClawX storage
    - Save API key to OpenClaw on successful validation in Setup wizard
    - Pass provider API keys as environment variables when starting
      the Gateway process (ANTHROPIC_API_KEY, OPENROUTER_API_KEY, etc.)
    
    Part 2: Embed OpenClaw Control UI for Chat
    - Replace custom Chat UI with <webview> embedding the Gateway's
      built-in Control UI at http://127.0.0.1:{port}/?token={token}
    - Add gateway:getControlUiUrl IPC handler to provide tokenized URL
    - Enable webviewTag in Electron BrowserWindow preferences
    - Override X-Frame-Options/CSP headers to allow webview embedding
    - Suppress noisy control-ui token_mismatch stderr messages
    - Add loading/error states for the embedded webview
    
    This fixes the "No API key found for provider" error and replaces
    the buggy custom chat implementation with OpenClaw's battle-tested
    Control UI.
  • refactor(setup): replace skills selection with auto-install progress UI
    - Replace manual skill bundle selection with automatic installation step
    - Add InstallingContent component with real-time progress feedback
    - Auto-install essential components: OpenCode, Python, Code Assist, File Tools, Terminal
    - Show animated progress bar and per-skill installation status
    - Auto-proceed to completion after installation finishes
    - Update CompleteContent to display installed components
    - Update architecture docs and build process documentation
  • refactor(setup): remove channel step from setup wizard
    - Remove channel connection step from onboarding flow (6 steps -> 5 steps)
    - Users can now start using ClawX immediately
    - Channel configuration moved to Settings > Channels (future)
    - Update architecture doc to reflect simplified setup flow
    - Reduces onboarding friction for new users
  • feat(providers): implement real API key validation with OpenRouter support
    - Replace mock API key validation with actual API calls to verify keys
    - Add validateApiKeyWithProvider() with provider-specific implementations
    - Support Anthropic, OpenAI, Google, and OpenRouter validation
    - Add OpenRouter as a new provider option in setup wizard and settings
    - Fix setup page to call real validation instead of mock length check
    - Allow validation during setup before provider is saved
    - Return user-friendly error messages instead of raw API errors
  • feat(gateway): integrate OpenClaw as git submodule
    - Add OpenClaw as git submodule at ./openclaw/
    - Update GatewayManager to start gateway from submodule path
    - Support both production (dist) and development (pnpm dev) modes
    - Add IPC handler for OpenClaw status check
    - Update Setup wizard to check real OpenClaw submodule status
    - Configure electron-builder to include submodule in packaged app
    - Add npm scripts for submodule management:
      - postinstall: auto-init submodule
      - openclaw:init: initialize and install dependencies
      - openclaw:install: install dependencies only
      - openclaw:build: build OpenClaw
      - openclaw:update: update to latest version
  • feat(setup): implement functional setup wizard with multi-step flow
    Add complete setup wizard implementation with the following features:
    
    - Welcome step with feature highlights
    - Environment check step with Node.js, OpenClaw, and Gateway verification
    - AI Provider selection with API key input and validation UI
    - Channel connection step with QR code placeholder
    - Skill bundle selection with recommended bundles pre-selected
    - Completion summary showing all configured options
    
    Additional changes:
    - Add setupComplete state and markSetupComplete action to settings store
    - Auto-redirect to setup wizard on first launch
    - Track setup completion in persisted settings
  • feat(core): initialize project skeleton with Electron + React + TypeScript
    Set up the complete project foundation for ClawX, a graphical AI assistant:
    
    - Electron main process with IPC handlers, menu, tray, and gateway management
    - React renderer with routing, layout components, and page scaffolding
    - Zustand state management for gateway, settings, channels, skills, chat, and cron
    - shadcn/ui components with Tailwind CSS and CSS variable theming
    - Build tooling with Vite, electron-builder, and TypeScript configuration
    - Testing setup with Vitest and Playwright
    - Development configurations (ESLint, Prettier, gitignore, env example)