Commit graph

361 commits

Author SHA1 Message Date
Jiang Bohan
bdc2006e0e feat(desktop): add agent settings dialog
Add UI for editing agent name and user preferences:
- AgentSettingsDialog component with name input and user.md textarea
- Agent Settings section on Home page with Edit button
- Auto-reload agent info when settings are saved

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:26:40 +08:00
Jiang Bohan
a157c6546d feat(desktop): add profile IPC handlers
Add IPC handlers for profile management:
- profile:get - Get profile name and user content
- profile:updateName - Update agent display name
- profile:updateUser - Update user.md content

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:26:40 +08:00
Jiang Bohan
a80c858ce5 feat(agent): add profile name and user content management
Add methods to ProfileManager, Agent, and AsyncAgent for:
- Getting/setting agent display name (stored in config.json)
- Getting/setting user.md content

This enables the desktop app to manage agent settings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:26:40 +08:00
Naiyuan Qing
e9ed53b615
Merge pull request #77 from multica-ai/feat/clean-web-store
refactor(store+ui): consolidate stores, add skeleton loading, fetch history on reconnect
2026-02-04 10:32:53 +08:00
Naiyuan Qing
24b75d3398 chore: update lockfile after removing sonner from store
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:21:38 +08:00
Naiyuan Qing
986b08be48 chore(web): replace old icons with company logo
- Add logo.svg as the new brand logo
- Generate logo-192x192.png and logo-512x512.png from SVG for PWA
- Update app-header, manifest, and layout to reference new logo files
- Remove old icon.png, icon-192x192.png, icon-512x512.png

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:20:02 +08:00
Naiyuan Qing
972c887b43 refactor(apps): simplify layout components to pure navigation shells
- desktop layout.tsx: remove connection logic, keep header + tabs + outlet
- web app-header.tsx: remove connection logic, keep logo + theme toggle

Connection lifecycle is now owned by the shared Chat component.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:12:57 +08:00
Naiyuan Qing
62267aaf19 refactor(ui): split Chat into focused components with skeleton loading
- Extract ConnectPrompt: self-contained connection code input
- Extract MessageList: pure display of messages with streaming support
- Add ChatSkeleton: skeleton placeholder shown during reconnection
- Chat component: three-state rendering (skeleton → connect → messages),
  keeps <main ref> always mounted so useScrollFade works correctly
- Remove hub-sidebar.tsx (dead code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:12:51 +08:00
Naiyuan Qing
162a86dff4 refactor(store): consolidate 3 stores into ConnectionStore + MessagesStore
Replace useGatewayStore, useHubStore, useDeviceId, and useHubInit with:
- ConnectionStore: WebSocket lifecycle, deviceId persistence via Zustand persist,
  fetch message history on registration via getAgentMessages RPC
- MessagesStore: simplified to current-agent-only, sendMessage accepts SendContext
  to break circular import with ConnectionStore
- useAutoConnect: returns { loading } for skeleton UI, skips connect if already
  connected (fixes Electron tab-switch reconnect), no cleanup disconnect

Removes: gateway.ts, hub.ts, hub-init.ts, device-id.ts, sonner dep from store

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:12:45 +08:00
Jiayuan Zhang
32c406a2a4
Merge pull request #76 from multica-ai/forrestchang/desktop-qr-refresh
Shorten desktop QR code expiry
2026-02-03 21:24:47 +08:00
Jiayuan Zhang
eee6cf1341 fix(desktop): refresh qr every 30s 2026-02-03 21:21:54 +08:00
Jiayuan Zhang
f3261d312d
Merge pull request #75 from multica-ai/chore/pnpm-allow-build-scripts
chore(pnpm): allow electron and esbuild build scripts
2026-02-03 20:52:15 +08:00
Jiayuan Zhang
995be9d53b chore(pnpm): allow electron and esbuild build scripts
pnpm 10 blocks post-install scripts by default for security.
Added onlyBuiltDependencies to allow electron and esbuild to run
their required install scripts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:51:17 +08:00
Naiyuan Qing
91044dea0f
Merge pull request #74 from multica-ai/feat/connection-code
feat: connection code flow with cross-platform Chat
2026-02-03 20:35:13 +08:00
Naiyuan Qing
dacbfa9e3d refactor(ui): purify Chat component and move header to app layouts
- Remove all props from Chat (showHeader, headerActions) making it a
  zero-config pure chat component with only connection input, messages,
  and send functionality
- Create AppHeader client component for web app with brand, theme
  toggle, disconnect button, and useHubInit
- Add disconnect button to desktop layout header
- Add reset() action to hub store to eliminate duplicated state reset
- Remove unused token field from gateway store
- Remove dead code: connection-bar.tsx
- Guard handleConnect against empty deviceId race condition

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:31:24 +08:00
Naiyuan Qing
b6d7626239 fix(store): use string prefix + URLSearchParams for connection URL parsing
The URL constructor parses non-standard protocols (multica://)
differently across engines — Chromium may return empty hostname
while Node.js returns "connect". Replace new URL() with simple
startsWith check and URLSearchParams to ensure consistent behavior
in both web and Electron environments.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:13:51 +08:00
Naiyuan Qing
ff80cf0732 feat(desktop): integrate Chat component into desktop app
Add @multica/store and zustand to desktop dependencies. Replace
placeholder chat page with the shared Chat component. Add Toaster
for toast notifications and remove padding on the chat route.
Change Chat root from h-dvh to h-full for container adaptability.
Add showHeader prop to Chat; desktop passes showHeader={false}
since it has its own layout header.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:08:30 +08:00
Naiyuan Qing
a088875118 refactor(ui): move theme toggle from Chat to web app layout
Chat component no longer depends on next-themes, making it safe to use
in the desktop app. Theme toggle is now a fixed button in the web layout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:02:48 +08:00
Naiyuan Qing
bb223d8a8c Merge branch 'main' into feat/connection-code 2026-02-03 19:42:41 +08:00
Naiyuan Qing
2bd87ccf5c theme buttom 2026-02-03 19:42:14 +08:00
Bohan Jiang
a995169278
Merge pull request #73 from multica-ai/feat/admin-app
feat(desktop): implement Admin App with Tools and Skills management
2026-02-03 19:29:19 +08:00
Jiang Bohan
f5a0d986a2 fix(desktop): resolve TypeScript build errors
- Disable noUnusedLocals/noUnusedParameters in desktop tsconfig
  (external src/ files have unused imports that fail strict checking)
- Add TSchema constraint to wrapTool generic to satisfy AgentTool type

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:26:25 +08:00
Jiang Bohan
0b83a7c416 fix(desktop): add 'registered' to ConnectionState type
Fix TypeScript error TS2367 by adding 'registered' state to match
SDK's ConnectionState type definition.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:20:45 +08:00
Jiang Bohan
2b3baa27a8 fix(desktop): add missing handleRefresh dependency to useEffect
Fix ESLint warning for react-hooks/exhaustive-deps by moving
handleRefresh definition before the useEffect that uses it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:16:19 +08:00
Naiyuan Qing
6add5fc9c3 refactor(ui): remove sidebar, integrate connection flow into Chat
- Remove ConnectionBar sidebar from layout
- Chat component now handles connection code input inline (centered)
- Header: Multica branding left, Disconnect button right (when connected)
- Chat input disabled until connected

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:01:48 +08:00
Jiang Bohan
4112d4511e fix(agent): resolve TypeScript errors with exactOptionalPropertyTypes
- Fix originalToolsConfig assignment to handle undefined properly
- Fix devNull type cast for WritableStream compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:58:45 +08:00
Jiang Bohan
dafbf856ac merge: resolve conflicts with main branch
- Merge auth-profiles feature from main into runner.ts
- Merge closeCallbacks feature from main into async-agent.ts
- Regenerate pnpm-lock.yaml with new dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:57:05 +08:00
Naiyuan Qing
e7521b4cb0 feat(web): replace sidebar with connection code flow
- Add connection code parsing (JSON + base64) with localStorage persistence
- Add connectWithCode() to gateway store for code-driven connections
- Replace Sidebar with simple ConnectionBar (paste code / status / disconnect)
- Simplify Chat component by removing header clutter
- Auto-restore connection on page refresh from saved code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:53:49 +08:00
LinYushen
dbe57f093b
Merge pull request #72 from multica-ai/auth-profile-rotation
feat(agent): auth profile rotation and cooldown
2026-02-03 18:32:36 +08:00
yushen
a065d5f64c fix(auth-profiles): add jittered cooldowns 2026-02-03 18:27:21 +08:00
Jiang Bohan
82ab988eb4 docs(desktop): add comprehensive design document and TODO list
- Document Host/Client mode architecture
- Detail IPC communication patterns
- Add implementation phases with progress tracking
- Include TODO list for remaining optimizations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:25:56 +08:00
Jiang Bohan
70cee08317 chore(desktop): add dependencies for routing and QR code
- Add react-router-dom for client-side routing
- Add qrcode.react for QR code generation
- Update vite.config.ts with path aliases

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:25:52 +08:00
Jiang Bohan
864d9166fc feat(hub): support profileId in createAgent
- Add profileId option to createAgent() method
- Default to "default" profile for all agents
- Ensures every agent has an associated profile for memory and config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:25:48 +08:00
Jiang Bohan
6f6a4f82e4 feat(agent): add tools and skills management methods
- Add setToolStatus() to persist tool enable/disable to profile config
- Add getActiveTools() and reloadTools() methods
- Add getSkillsWithStatus(), getEligibleSkills(), reloadSkills() methods
- Add updateToolsConfig() and setToolEnabled() to ProfileManager
- Ensure profile directory is created on Agent initialization
- Fix reloadTools() to re-read profile config for latest changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:25:43 +08:00
Jiang Bohan
391bf32625 feat(desktop): add pages for Home, Tools, and Skills with routing
- Update App.tsx with react-router-dom routing setup
- Create layout.tsx with navigation tabs
- Update home.tsx with Hub status and QR code display
- Create tools.tsx page with tool management UI
- Create skills.tsx page with skill management UI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:25:36 +08:00
Jiang Bohan
03bcd853d3 feat(desktop): add UI components for Tools and Skills management
- Create tool-list.tsx with collapsible groups and toggle switches
- Create skill-list.tsx with status badges and action dialogs
- Create qr-code.tsx for connection QR code display
- Add dialog.tsx component to @multica/ui

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:25:30 +08:00
Jiang Bohan
150fde80a9 feat(desktop): add React hooks for Hub, Tools, and Skills state
- Create use-hub.ts for Hub connection state and agent info
- Create use-tools.ts for tools list and toggle functionality
- Create use-skills.ts for skills list and management

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:25:24 +08:00
Jiang Bohan
2a4fcded03 feat(desktop): add IPC handlers for Hub, Tools, and Skills management
- Create hub.ts IPC handlers for Hub initialization and agent management
- Create agent.ts IPC handlers for tools list, toggle, setStatus, reload
- Create skills.ts IPC handlers for skills list, get, toggle, add, remove
- Expose typed electronAPI via preload.ts with contextBridge
- Add TypeScript definitions in electron-env.d.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:25:20 +08:00
yushen
9ed4cdf2b0 fix(agent): handle auth profile failures and provider mismatch 2026-02-03 18:23:18 +08:00
LinYushen
ba555badd6
Merge pull request #71 from multica-ai/subagent-orchestration
feat(agent): add subagent orchestration system
2026-02-03 18:20:46 +08:00
yushen
617ddfbfea refactor(auth-profiles): replace proper-lockfile with custom file lock
Unify locking strategy across the project by using a custom synchronous
file lock (exclusive-create based, with PID stale detection) instead of
the proper-lockfile dependency, matching the pattern in session-write-lock.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:05:00 +08:00
yushen
c67d677f50 docs: align subagent call order 2026-02-03 18:04:40 +08:00
Naiyuan Qing
0595d3a0d3
Merge pull request #69 from multica-ai/fix/streaming-protocol-sync
fix: align streaming protocol and add generation indicator
2026-02-03 17:58:52 +08:00
yushen
4b10420324 Merge remote-tracking branch 'origin/main' into auth-profile-rotation
# Conflicts:
#	pnpm-lock.yaml
#	src/agent/runner.ts
2026-02-03 17:58:50 +08:00
LinYushen
de686022c3
Merge pull request #68 from multica-ai/session-writelock-repair
feat(session): add write lock and auto-repair
2026-02-03 17:56:48 +08:00
Naiyuan Qing
54ee2f3b00 feat(ui): add streaming indicator to StreamingMarkdown
Show a spinner with "Generating..." label while assistant messages are
being streamed. The indicator appears immediately when content is empty
and persists below the content until streaming completes.

Also fix duplicate React key warning by including block index in the key
to handle blocks with identical content.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:56:22 +08:00
yushen
ef77c13fc8 docs: refine subagent diagram 2026-02-03 17:55:50 +08:00
yushen
0fee16f735 test(session): reset lock mock 2026-02-03 17:49:26 +08:00
yushen
f2ca86aa1f fix(session): harden write lock and repair 2026-02-03 17:47:41 +08:00
yushen
f1334349ca Merge remote-tracking branch 'origin/main' into session-writelock-repair 2026-02-03 17:45:56 +08:00