Commit Graph

6 Commits

  • fix(stores): align RPC methods with OpenClaw protocol and fix chat flow
    - Fix channels store: use channels.status instead of channels.list
    - Fix skills store: use skills.status instead of skills.list
    - Fix chat store: correct chat.history response parsing (messages in payload)
    - Fix chat store: handle chat.send async flow (ack + event streaming)
    - Add chat event handling for streaming AI responses (delta/final/error)
    - Wire gateway:chat-message IPC events to chat store
    - Fix health check: use WebSocket status instead of nonexistent /health endpoint
    - Fix waitForReady: probe via WebSocket instead of HTTP
    - Gracefully degrade when methods are unsupported (no white screen)
  • fix(gateway): implement proper OpenClaw WebSocket handshake protocol
    - Send JSON-RPC connect request after WebSocket opens (required by OpenClaw Gateway)
    - Use OpenClaw protocol format: { type: "req" } instead of { jsonrpc: "2.0" }
    - Include proper ConnectParams: client info, auth token, protocol version
    - Handle OpenClaw response format: { type: "res", ok: true/false }
    - Handle OpenClaw event format: { type: "event", event: "..." }
    - Wait for handshake completion before marking connection as running
    - Improve error handling for connection failures
    
    The Gateway was rejecting connections because:
    1. ClawX wasn't sending the required "connect" handshake message
    2. The protocol format was incorrect (standard JSON-RPC vs OpenClaw format)
  • fix(gateway): use GitHub URL for OpenClaw submodule and add token auth
    - Change submodule URL from local path to https://github.com/openclaw/openclaw.git
    - Checkout stable version v2026.2.3
    - Add auto-generated gateway token (clawx-xxx) stored in electron-store
    - Pass token via --token argument and OPENCLAW_GATEWAY_TOKEN env var
    - Include token in WebSocket URL for authentication
    - Add --dev and --allow-unconfigured flags for first-time setup
  • 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(gateway): enhance gateway process management with auto-reconnection
    Improve Gateway lifecycle management with the following features:
    
    - Add exponential backoff reconnection (1s-30s delay, max 10 attempts)
    - Add health check monitoring every 30 seconds
    - Add proper restart method with graceful shutdown
    - Handle server-initiated notifications (channel status, chat messages)
    - Add 'reconnecting' state for better UI feedback
    - Enhance IPC handlers with isConnected and health check endpoints
    - Update preload script with new event channels
    - Improve type safety and error handling throughout
    
    Also fixes several TypeScript errors and unused variable warnings.
  • 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)