Commit Graph

53 Commits

Author SHA1 Message Date
Haze
93caeedd12 Fix/add x86 macos (#11) 2026-02-09 15:38:29 +08:00
Felix
ca71ef9b9b feat: add Gateway button to dashboard header (#10)
lgtm
2026-02-09 15:37:39 +08:00
Haze
de445ae3d5 Chore/build npm (#9)
Co-authored-by: DigHuang <114602213+DigHuang@users.noreply.github.com>
Co-authored-by: Felix <24791380+vcfgv@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 15:10:08 +08:00
arianachennn-design
0b7f1c700e Update README.md (#5)
Co-authored-by: Felix <24791380+vcfgv@users.noreply.github.com>
2026-02-07 16:09:35 +08:00
Haze
4cd720ac43 Create SECURITY.md for security policy
Added a security policy document outlining supported versions and vulnerability reporting.
2026-02-07 01:45:52 +08:00
Haze
e6317cafd6 chore(frontend): fix corn task (#3) 2026-02-07 01:28:38 +08:00
Felix
fa6c23b82a feature: channels and skills (#2)
Co-authored-by: paisley <8197966+su8su@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 18:26:06 +08:00
Haze
f9845023c3 Merge pull request #1 from intellispectrum/0.1.0-dev
dev-0.1.0
2026-02-06 05:57:43 +08:00
Haze
aa032385da chore(dependencies): add @testing-library/jest-dom to package.json and pnpm-lock.yaml
- Included @testing-library/jest-dom version 6.9.1 to enhance testing capabilities.
- Updated pnpm-lock.yaml to reflect the new dependency and its resolution details.
- Removed unused version click handling from Sidebar component to streamline code.
2026-02-06 05:55:14 +08:00
Haze
9fe27e3510 chore(lint): remove ESLint configuration file and update lint scripts
- Deleted the .eslintrc.cjs file to simplify configuration management.
- Updated lint scripts in package.json to remove unnecessary extensions for linting.
- Added new devDependencies for ESLint and globals to enhance linting capabilities.
2026-02-06 05:50:20 +08:00
Haze
4e1f79922b chore(workspace): add root package to pnpm workspace configuration
- Included the root directory as a package in the pnpm workspace to facilitate dependency management and streamline project structure.
2026-02-06 05:38:21 +08:00
Haze
b576cd2e1b chore(ci, release): update pnpm action to v4 and version to 9 in CI and release workflows
- Upgraded pnpm/action-setup from v2 to v4 in both CI and release workflows.
- Updated pnpm version from 8 to 9 to ensure compatibility with the latest features and improvements.
2026-02-06 05:33:40 +08:00
Haze
fc511826a1 refactor(sidebar): remove version button from Sidebar component
- Eliminated the version display button from the Sidebar to streamline the UI.
- Adjusted layout to maintain consistency with the overall design.
2026-02-06 05:20:55 +08:00
Haze
e9ad15bf6f fix(ui): move chat controls to header, add new session, fix settings layout
Chat page:
- Move session selector, refresh, thinking toggle to the Header bar
  (same level as "Chat" title) instead of inside the chat content area
- Add "New Session" button (+ icon) to create fresh chat sessions
- Remove duplicate toolbar from chat body

Settings page:
- Remove max-w-2xl constraint so cards fill available width
- Redesign provider cards: compact layout with key + actions in one row
- Shorten API key display (sk-...df67 format instead of full masked key)
- Move edit/delete/star buttons inside the key row background area
- Remove duplicate "AI Providers" heading (already in card header)
2026-02-06 05:11:39 +08:00
Haze
ecb36f0ed8 fix(build): update OpenClaw submodule URL and enhance gateway token management
- Changed the OpenClaw submodule URL to the official GitHub repository for proper integration.
- Implemented automatic gateway token generation on first launch, ensuring seamless authentication for users.
- Updated the gateway manager to utilize the generated token for WebSocket connections.
2026-02-06 05:03:53 +08:00
Haze
7fded9bf8d refactor(chat): remove instruction text from ChatInput component
- Removed the instruction text for sending messages (Enter to send, Shift+Enter for new line) from the ChatInput component to streamline the UI.
2026-02-06 04:59:40 +08:00
Haze
94a6cecf2f fix(chat): move toolbar to Header and add New Session button
- Move ChatToolbar (session selector, refresh, thinking toggle) from
  the Chat page body into the Header component, so controls appear
  at the same level as the "Chat" title
- Add New Session button (+) to create a fresh conversation
- Add newSession action to chat store
- Header conditionally renders ChatToolbar only on /chat route
- Chat page fills full content area without duplicate toolbar
2026-02-06 04:57:25 +08:00
Haze
3468d1bdf4 feat(chat): native React chat page with session selector and streaming
Replace the iframe-based Control UI embed with a native React
implementation that communicates directly with the Gateway via
gateway:rpc IPC calls and chat event streaming.

New components:
- ChatToolbar: session selector dropdown, refresh button, thinking toggle
- ChatMessage: message bubbles with markdown (react-markdown + GFM),
  collapsible thinking blocks, tool use cards, image attachments
- ChatInput: textarea with Enter to send, Shift+Enter for new line
- message-utils: extractText/extractThinking/extractImages/extractToolUse
  ported from OpenClaw's message-extract.ts

Rewritten chat store with:
- Session management (sessions.list, switchSession)
- Proper chat.history loading with raw message preservation
- chat.send with idempotencyKey and run tracking
- Streaming via handleChatEvent (delta/final/error/aborted)
- Thinking toggle (show/hide reasoning blocks)
2026-02-06 04:49:01 +08:00
Haze
bdb734120f refactor(ui): remove search, theme toggle, and notifications from header 2026-02-06 04:18:42 +08:00
Haze
191948ce51 fix(docs): update repository links in README and menu to reflect new GitHub organization 2026-02-06 04:18:16 +08:00
Haze
20af6c7ba3 fix(auth): add required models:[] array to provider config 2026-02-06 04:03:46 +08:00
Haze
ed060c142f fix(auth): register models.providers for OpenRouter and other providers
OpenClaw's model resolution checks cfg.models.providers[provider] for
baseUrl and API type. Without this config entry, any model for that
provider returns "Unknown model" even if the API key is correct.

- Reverted model names back to user-specified versions
- Added PROVIDER_CONFIGS with baseUrl, api type, and env var name
- setOpenClawDefaultModel() now writes models.providers.openrouter
  (and other providers) to openclaw.json so model resolution works
- Config format: { models: { providers: { openrouter: {
    baseUrl: "https://openrouter.ai/api/v1",
    api: "openai-completions",
    apiKey: "OPENROUTER_API_KEY" } } } }
2026-02-06 04:02:07 +08:00
Haze
07320042a7 fix(auth): use OpenClaw-recognized model names (openrouter/auto, etc.) 2026-02-06 03:53:26 +08:00
Haze
a36c3c5399 fix(stores): channels.status and skills.status return complex objects, not arrays
The Dashboard crashed with 'channels.slice is not a function' because
channels.status returns a deeply nested object per channel ID, not a
Channel[] array. Same issue with skills.status.

For now, use empty arrays since channel/skill management is deferred
to their dedicated pages. Will properly parse the complex response
format when those pages are implemented.
2026-02-06 03:50:23 +08:00
Haze
7089c7a891 fix(app): add ErrorBoundary to show actual crash errors instead of white screen 2026-02-06 03:48:29 +08:00
Haze
7818798bff fix(app): remove provider:list check that caused white screen on startup 2026-02-06 03:45:50 +08:00
Haze
f67370ce03 fix(app): scope header overrides to gateway URLs only
- The session.webRequest.onHeadersReceived was stripping X-Frame-Options
  and modifying CSP for ALL responses including the Vite dev server,
  which could break the main app rendering. Now only applies to
  gateway URLs (127.0.0.1:18789 / localhost:18789).
- Dashboard: only fetch channels/skills when gateway is running
- Dashboard: guard against non-array channels/skills data
- Gateway store: use dynamic import() instead of require() for chat
  store to avoid ESM/CJS issues in Vite
2026-02-06 03:40:47 +08:00
Haze
71409042cb fix(auth): update default models to latest versions 2026-02-06 03:37:27 +08:00
Haze
a92ced3c4a fix(auth): use correct model config format (object, not string)
OpenClaw expects agents.defaults.model as { primary: "provider/model" }
not a plain string. The previous code wrote a string which caused:
"agents.defaults.model: Invalid input: expected object, received string"
2026-02-06 03:31:24 +08:00
Haze
4b9ab69b9b fix(setup): auto-redirect to setup when no API keys are configured
If setup was previously completed but no provider API keys were saved
(due to the legacy bug where validation didn't persist keys), the app
now detects this on startup and redirects to the setup wizard so the
user can re-enter their key with the fixed save flow.
2026-02-06 03:27:32 +08:00
Haze
00475ce2b5 fix(auth): configure OpenClaw default model when saving provider
- Add setOpenClawDefaultModel() to write the correct model to
  ~/.openclaw/openclaw.json based on the selected provider
- Maps: openrouter -> openrouter/anthropic/claude-sonnet-4,
  anthropic -> anthropic/claude-sonnet-4, etc.
- Call setOpenClawDefaultModel on provider:save IPC handler
- Fixes "No API key found for provider anthropic" when user
  configured OpenRouter (wrong default model was being used)
2026-02-06 03:26:39 +08:00
Haze
542178c1e7 fix(chat): switch from webview to iframe for Control UI embedding
The <webview> tag had issues with event listener attachment and React
ref handling, causing the loading overlay to stay forever (white screen).
Switched to a standard <iframe> which is simpler and works reliably:
- Uses iframe onLoad/onError instead of webview dom-ready events
- Added 5s fallback timeout to dismiss loading overlay
- The X-Frame-Options/CSP header overrides from session.webRequest
  allow the iframe to load the Control UI
2026-02-06 03:21:43 +08:00
Haze
1e6cc8e329 docs: update build process for commits 16-17 2026-02-06 03:12:40 +08:00
Haze
284861a0f5 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.
2026-02-06 03:12:17 +08:00
Haze
b01952fba7 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)
2026-02-06 02:38:18 +08:00
Haze
0f8e6f3f9e 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)
2026-02-06 02:18:23 +08:00
Haze
931fea3735 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
2026-02-06 02:07:02 +08:00
Haze
3fd62e112f 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
2026-02-06 01:48:34 +08:00
Haze
4431d2ba1d 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
2026-02-06 01:25:33 +08:00
Haze
af76b28286 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
2026-02-06 00:50:19 +08:00
Haze
29ee21754a 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
2026-02-06 00:24:36 +08:00
Haze
a04aaf54e3 feat(cron): Enhance scheduled tasks with create/edit dialog and presets
- Add TaskDialog component for creating/editing cron jobs
- Implement schedule presets (every minute, hourly, daily, weekly, monthly)
- Add human-readable cron schedule parsing
- Enhance CronJobCard with run now, edit, delete actions
- Add failed tasks counter to statistics
- Show last run success/failure with timestamps
- Integrate channel selection for task targets
- Add gateway connection status awareness
- Update process.md to reflect project completion
2026-02-05 23:48:48 +08:00
Haze
6239b156cb feat(skills): enhance skills browser with bundles and categories
- Add skill bundles with batch enable/disable functionality
- Create SkillDetailDialog for viewing skill metadata
- Add Tabs component for All Skills / Bundles navigation
- Implement category filtering with skill counts
- Add search functionality for skills
- Show Gateway connection status awareness
- Add configuration and dependency badges
- Include recommended bundle highlighting
2026-02-05 23:45:46 +08:00
Haze
727869f2b8 feat(chat): enhance chat interface with markdown support
- Add markdown rendering with react-markdown and remark-gfm
- Create ChatMessage component with code copy functionality
- Add typing indicator animation during AI response
- Create welcome screen for new users
- Add Textarea component for multi-line input
- Improve message styling with avatars and hover actions
- Add Gateway connection status awareness
- Add prose styling for markdown content
2026-02-05 23:43:02 +08:00
Haze
bad94e7e76 build(packaging): set up multi-platform packaging and CI/CD
- Add GitHub Actions workflows for CI and releases
- Create icon generation script and SVG source
- Configure electron-builder for macOS, Windows, Linux
- Add macOS entitlements for code signing
- Add Linux post-install/remove scripts
- Enhance package.json with publishing scripts
- Add artifact naming convention
2026-02-05 23:39:55 +08:00
Haze
e02cf05baf feat(update): implement auto-update functionality with electron-updater
- Add AppUpdater module with update lifecycle management
- Create UpdateSettings UI component with progress display
- Add Progress UI component based on Radix UI
- Create update Zustand store for state management
- Register update IPC handlers in main process
- Auto-check for updates on production startup
- Add commit documentation for commits 2-6
2026-02-05 23:36:12 +08:00
Haze
98a2d9bc83 feat(channels): implement channel connection flows with multi-platform support
- Add comprehensive Channels page with connection statistics and status display
- Implement AddChannelDialog with type-specific connection flows:
  - QR code-based connection for WhatsApp/WeChat
  - Token-based connection for Telegram/Discord/Slack
- Enhance channels store with addChannel, deleteChannel, and requestQrCode actions
- Update electron-store usage to dynamic imports for ESM compatibility
- Add channel connection instructions and documentation links
2026-02-05 23:29:18 +08:00
Haze
ebb6f515a7 feat(providers): implement secure API key storage and provider management
Add complete provider configuration system with the following features:

- Secure API key storage using Electron's safeStorage encryption
- Provider CRUD operations with IPC handlers
- Lazy-loaded electron-store for ESM compatibility
- Provider settings UI component with add/edit/delete functionality
- API key masking for display (shows first/last 4 chars)
- Basic API key format validation per provider type
- Default provider selection
- Provider enable/disable toggle

New files:
- electron/utils/secure-storage.ts: Encrypted key storage and provider config
- src/stores/providers.ts: Zustand store for provider state
- src/components/settings/ProvidersSettings.tsx: Provider management UI
2026-02-05 23:24:31 +08:00
Haze
18dc3bf53f 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
2026-02-05 23:18:43 +08:00
Haze
1646536e40 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.
2026-02-05 23:15:07 +08:00