Commit graph

128 commits

Author SHA1 Message Date
yushen
5ee08e9368 Merge remote-tracking branch 'origin/main' into feat/desktop-api-client 2026-02-13 17:57:19 +08:00
Naiyuan Qing
9877a4f97e
Merge pull request #167 from multica-ai/feat/desktop-device-id
feat: unify encrypted Device ID across all platforms
2026-02-13 17:47:54 +08:00
Naiyuan Qing
0c748f563f
Merge pull request #166 from multica-ai/NevilleQingNY/login-drag-region
fix(desktop): enable window dragging on login page
2026-02-13 17:34:23 +08:00
Naiyuan Qing
242be23876 feat(utils): unify encrypted Device ID across all platforms
- Add common generateEncryptedId() utility in @multica/utils
- All Device IDs now use same encryption algorithm (40 hex chars)
- Web: store encrypted format directly in localStorage
- Desktop: use shared utility, accept encrypted ID from Web
- Hub: use shared utility for hub-id generation
- Telegram: use shared utility for device ID generation
- Gateway hook: use encrypted format for client connections

Algorithm: sha256(sha256(uuid).slice(0,32)).slice(0,8) + sha256(uuid).slice(0,32)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 17:34:23 +08:00
Naiyuan Qing
8dfd4bc388 fix(desktop): enable window dragging on login page
Add WebkitAppRegion drag to login page background areas so the window
can be dragged on macOS. Mark the sign-in button as no-drag to keep it
clickable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:28:38 +08:00
Naiyuan Qing
911ed5ae36
Merge pull request #164 from multica-ai/NevilleQingNY/persist-chat-tabs
fix(desktop): persist chat state across tab navigation
2026-02-13 17:10:54 +08:00
Naiyuan Qing
298299d88e fix(desktop): persist chat state across tab navigation
Keep LocalChat mounted at the Layout level with CSS visibility toggle
instead of unmounting on route change, preserving messages, streaming
state, and IPC subscriptions when switching sidebar tabs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:04:15 +08:00
yushen
9026c27f21 Merge remote-tracking branch 'origin/main' into feat/desktop-api-client 2026-02-13 16:57:42 +08:00
Naiyuan Qing
0d11318618 fix(desktop): prevent duplicate welcome toast on login
- Move auth callback listener setup before async operations
- Add unique ID to welcome toast to prevent duplicates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 16:53:17 +08:00
Naiyuan Qing
f13509e12a feat(auth): pass encrypted Device ID from Web to Desktop
- Web stores raw UUID, encrypts when transmitting (consistent with copilot-search)
- Desktop receives encrypted Device ID from Web login callback
- Desktop stores encrypted 40-char format in auth.json
- Update IPC types to include deviceId in auth callback

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 16:53:13 +08:00
yushen
309c27b4dd feat(desktop): add API client with auth headers
Add fetch wrapper for desktop renderer to call Multica backend REST API.
Attaches sid, device-id, and os-type headers automatically using
useAuthStore and electronAPI.auth.getDeviceIdHeader().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 16:31:43 +08:00
Naiyuan Qing
68e262810c fix(desktop): store encrypted Device ID directly (40 hex chars)
- Change from storing raw UUID to storing encrypted format
- Consistent with devv-sdk and Web implementation
- Auto-migrate old UUID format to new encrypted format
- Validate device ID format (40 hex characters)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 16:00:16 +08:00
Naiyuan Qing
57cb99dbba feat(desktop): add persistent Device ID with encryption
- Generate UUID-based Device ID on first launch
- Store deviceId in auth.json (persists across logins/logouts)
- Add double SHA-256 encryption (consistent with Web)
- Expose getDeviceId and getDeviceIdHeader IPC methods
- Fix callback path to only accept /callback (prevent duplicate toasts)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 15:35:59 +08:00
Naiyuan Qing
a2cabb550f refactor(ui): unify login page styling across web and desktop
- Use bordered icon with consistent size on both platforms
- Adjust font size to match icon proportions
- Simplify desktop tagline for cleaner presentation
- Streamline web login header to [icon] Sign In format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:56:16 +08:00
Naiyuan Qing
e0f80b0054 merge: resolve conflict with main (keep both auth and subagents handlers) 2026-02-13 14:41:15 +08:00
Naiyuan Qing
e3c24fc10b chore(desktop): add deep link protocol and build scripts
- Add multica:// protocol for macOS and Windows (production login)
- Add build:staging and build:production scripts
- Update env vars: remove MULTICA_URL, add WEB_URL
- Update README with environment configuration docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:33:48 +08:00
Naiyuan Qing
2a6e10496a feat(desktop): improve login page and add auth toasts
- Add tagline and animation to login page
- Add toast notification on login success
- Add toast notification on logout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:19:53 +08:00
Jiang Bohan
499c573544 feat(desktop): add subagent dashboard with real-time status tracking
Adds a status bar and slide-out dashboard panel to the chat view that
shows subagent progress in real-time. Polls at 2s when active, 10s when
idle. Completed runs auto-hide after 5 minutes. Includes dismiss button
and 30s auto-dismiss for the status bar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:46:58 +08:00
Naiyuan Qing
2577475ba6 feat(desktop): add authentication flow with Web login
- Add auth IPC handlers (main process)
- Add auth store with Zustand (renderer)
- Add login page with branded UI
- Add AuthGuard for protected routes
- Add user dropdown menu in sidebar footer
- Support deep link (multica://) for production
- Support local HTTP callback for development

Reference: https://github.com/CapSoftware/Cap

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 12:24:57 +08:00
Naiyuan Qing
71433fc4ed
Merge pull request #146 from multica-ai/feat/message-source-tracking
feat(core): add message source tracking and persistence
2026-02-12 18:51:23 +08:00
Naiyuan Qing
8199dde1b6 feat(core): add message source tracking and persistence
- Add MessageSource type to track where user messages originate (local, gateway, channel)
- Broadcast inbound messages from all channels to local Desktop UI via Hub.onInboundMessage()
- Persist source field in JSONL session storage so it survives page refresh
- Display source icon (Monitor/Smartphone/Send) with tooltip for non-local user messages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 18:45:15 +08:00
Naiyuan Qing
c95b74ffc9 feat(desktop): default dev gateway URL and support GATEWAY_URL env override
`pnpm dev` now connects to dev gateway by default. Support runtime
GATEWAY_URL env var to override, so no per-worktree .env setup needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 18:39:46 +08:00
Naiyuan Qing
bad4d05c15
Merge pull request #138 from multica-ai/refactor/desktop-page-restructure
refactor(desktop): restructure pages and add dev reset scripts
2026-02-12 16:45:07 +08:00
Naiyuan Qing
274651754c fix(desktop): remove unused saving state in profile page
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 16:29:26 +08:00
Naiyuan Qing
8efc4ae5aa refactor(desktop): improve clients page and QR code component architecture
- Refactor QR code component with extracted hooks (useQRToken, useCountdown, useCopyToClipboard)
- Extract reusable sub-components (QRCodeFrame, ExpiryTimer, CopyLinkButton)
- Extract QRCodeCard and DevicesCard components in clients page
- Add GatewayStatus indicator for connection state
- Minor styling fix for empty device list state

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 16:27:15 +08:00
Naiyuan Qing
304c6a9bc6 fix(desktop): wait for channel status to settle before returning
The listStates IPC handler now waits for any "starting" status to
settle (max 3.5s) before returning, ensuring the UI always gets the
final status (running/error) instead of the transient "starting" state.

Also fixes unused variable lint warning in profile page.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 16:25:48 +08:00
Naiyuan Qing
bc9b7d6fc5 refactor(desktop): restructure pages and consolidate UI components
- Rename channels.tsx to clients.tsx
- Remove standalone skills.tsx and tools.tsx pages
- Add agent/ directory for agent-related pages
- Update layout and navigation structure
- Add tabs component to ui package
- Update fonts and global styles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 15:49:52 +08:00
Jiang Bohan
ece00cac2b merge: resolve conflict with main (lucide-react migration)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 14:47:00 +08:00
Jiang Bohan
a33df19bef feat(desktop): add chat abort support with partial content preservation
Add stop button to interrupt agent generation mid-stream. The send button
toggles to a stop icon during loading. Abort propagates from UI through
IPC to the Agent layer (PiAgentCore.abort()), preserving all partial
content in the agent's context so users can follow up immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 14:33:06 +08:00
Naiyuan Qing
b5313b643f refactor(desktop): add container wrapper to page layouts
- Wrap page content with container class for consistent max-width
- Move overflow-auto to outer div so scrollbar stays at viewport edge
- Add self-stretch to vertical divider in home page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 12:03:41 +08:00
Naiyuan Qing
e93e0952bd fix(desktop): suppress react-refresh lint warning for useTheme hook
Standard pattern for context providers exporting both Provider and hook.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 11:28:10 +08:00
Naiyuan Qing
7e2f55bfe9 feat(desktop): integrate UpdateNotification into new sidebar layout
- Convert update-notification component from Hugeicons to Lucide icons
- Add UpdateNotification to layout.tsx for auto-update functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 11:19:17 +08:00
Naiyuan Qing
b310b57ce9 merge: integrate origin/main into feat/onboarding-check
Resolved conflicts:
- Keep Lucide icons (replaced Hugeicons) in desktop and ui
- Keep new Sidebar layout design
- Merge new dependencies (electron-updater, lucide-react, katex)
- Add new 'data' tool with Lucide BarChart3 icon
- Keep UpdateNotification component (not integrated into UI yet)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 11:16:49 +08:00
Naiyuan Qing
3fd6e10c86 refactor(desktop): add silent option to provider store and improve devices
- Add silent option to setProvider to suppress toast notifications
- Improve device list with better state handling
- Update onboarding setup step with silent provider switch
- Minor UI tweaks in layout and App components

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 11:10:08 +08:00
Naiyuan Qing
eb4e1f57b1 feat(desktop): persist onboarding state to file system
- Add AppState module in core for managing app state persistence
- Add app-state IPC handlers for reading/writing onboarding state
- Hydrate onboarding state from file system on app startup
- Prevent flash by showing blank screen during hydration
- Update onboarding store to sync with file system
- Improve MulticaIcon with enhanced animation states
- Minor UI fixes in chat and device list components

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 10:53:04 +08:00
Naiyuan Qing
cf3ad1db91 style(desktop): update capabilities summary wording
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 10:13:11 +08:00
Naiyuan Qing
6037be2efa refactor: migrate from Hugeicons to Lucide icons
- Replace @hugeicons/react with lucide-react across all packages
- Update all components to use Lucide icon components
- Add silent option to store refresh methods to control toast display
- Simplify icon usage with direct component imports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 10:12:56 +08:00
Naiyuan Qing
272cabf3fa feat(desktop): redesign home page with capabilities dashboard
- Add collapsible capabilities section showing skills, tools,
  channels, and scheduled tasks counts
- Add AI brain icon to represent agent capabilities
- Add refresh button with tooltip to refresh all capabilities
- Add desktop-specific Toaster component (uses local ThemeProvider)
- Show all capability counts even when zero
- Change "View all" buttons to outline style for better distinction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 09:39:03 +08:00
Naiyuan Qing
6ea6c9fff5 refactor(desktop): migrate to zustand stores and remove hook layer
- Add new stores: skills, tools, cron-jobs, hub
- Remove wrapper hooks: use-channels, use-cron-jobs, use-hub,
  use-provider, use-skills, use-tools, use-heartbeat
- Update all components and pages to use stores directly
- Add 800ms minimum loading time for refresh operations
- Add toast notifications for store actions (success/error feedback)
- Remove unused chat-mode store and remote-chat component

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 09:38:51 +08:00
Jiang Bohan
f9b193d467 fix(desktop): use default import for electron-updater CJS module
electron-updater is a CommonJS module — ESM named imports fail at
runtime. Switch to default import with destructuring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:20:47 +08:00
Naiyuan Qing
3d25aa96f4 feat(desktop): add minimum window size constraints
Set minWidth: 500 and minHeight: 520 to prevent UI breakage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 18:51:18 +08:00
Naiyuan Qing
bbf91a98ca refactor(desktop): redesign layout with sidebar navigation
- Replace tab navigation with collapsible sidebar
- Fix header scroll issue with proper flex container structure
- Add TooltipProvider at app root
- Simplify onboarding store by removing forceOnboarding flag

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 18:51:14 +08:00
Naiyuan Qing
fedb8fb668 fix(desktop): align onboarding step labels with content
- Header: "Connect" → "Channels", "Try it" → "Start"
- Step 3: "Your agent, everywhere" → "Connect a channel"
- Step 4: "You're all set 🎉" → "Ready to go" (remove emoji)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:57:51 +08:00
Naiyuan Qing
d189b14a15 feat(desktop): add StepDots component and minor onboarding tweaks
- Add StepDots progress indicator to all steps
- Update animations for consistency
- Minor copy and layout adjustments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:46:56 +08:00
Naiyuan Qing
437dc05db0 feat(desktop): improve setup step with radio indicators
- Add radio button style indicators for provider selection
- Add HoverCard component for provider setup help
- Add Link component for external URLs
- Add Popover component (dependency for HoverCard)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:46:17 +08:00
Naiyuan Qing
eb807787d3 feat(desktop): redesign connect step with single column layout
- Single column centered layout matching other steps
- Improved copy: "Your agent, everywhere"
- Info box explaining direct connection to local agent
- Coming soon hint for Discord, Slack, Mobile app
- Simplified button logic: Skip (outline) + Continue

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:46:00 +08:00
Naiyuan Qing
fc77cb89d3 refactor(desktop): migrate provider state to zustand store
- Create ProviderStore for global provider state management
- Refactor useProvider hook to use the store
- Data fetched once at startup, shared across components

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:45:19 +08:00
Naiyuan Qing
5ae86feb2b feat(desktop): add global channels store with zustand
- Create ChannelsStore for global channel state management
- Refactor useChannels hook to use the store
- Initialize channels store at app startup
- Share state between onboarding and channels page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:43:23 +08:00
Naiyuan Qing
07b8a014aa feat(desktop): add resolvedTheme to theme provider
- Add resolvedTheme state to expose actual applied theme
- Listen for system theme changes when in "system" mode
- Fix mode toggle to show correct icon based on selected theme

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:43:18 +08:00
Naiyuan Qing
54bc00ce3f feat(desktop): redesign privacy step with single column layout
- Simplify permissions step to single centered column
- Replace per-item switches with single "I understand" checkbox
- Add capabilities info card with clean dividers
- Add trust note section for privacy messaging
- Rename step from "Permissions" to "Privacy" for clarity
- Add fade-in animation for step transitions
- Add shadcn checkbox component

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 16:09:42 +08:00