Commit graph

762 commits

Author SHA1 Message Date
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
b718b95da7 fix(ui): improve chat input scroll behavior
- Scroll cursor into view on content changes (e.g., Shift+Enter)
- Add scroll threshold and margin for better edge handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 09:39:16 +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
d1d3cd0a9f feat(ui): add collapsible component
Add Radix-based collapsible component for accordion-style UI sections.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 09:38:56 +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
Jiayuan Zhang
14e9913290
Merge pull request #131 from multica-ai/forrestchang/latex-render
feat(ui): add LaTeX math rendering support
2026-02-11 21:46:06 +08:00
Jiayuan Zhang
953041efa0 feat(ui): add LaTeX math rendering support to chat markdown
Add remark-math + rehype-katex plugins to render inline ($...$) and
display ($$...$$) math expressions. Includes dark mode CSS overrides,
streaming block splitting for math fences, and math range exclusion
in link preprocessing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:57:52 +08:00
Jiayuan Zhang
b5f63f7f7c
Merge pull request #130 from multica-ai/forrestchang/finance-pr
feat(finance): add internal evidence decision engine
2026-02-11 20:39:29 +08:00
Jiayuan Zhang
24435cdba4 refactor(agent): remove hasWebTools conditional in data section
Web tools are always available, so the conditional branching was
unnecessary. Data section now always includes the dynamic evidence
decision guidance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:31:40 +08:00
Jiayuan Zhang
0330b8b7ca refactor(agent): remove keyword-based finance decisioner
The finance-decisioner used hardcoded keyword matching and arbitrary
scoring weights to decide evidence plans — the LLM reading the
improved SKILL.md already makes this decision more intelligently.

Removes: finance-decisioner.ts, its tests, runner.ts integration
(applyFinanceResearchGuidance, saveFinanceDecisionMeta,
rebuildSystemPromptWithExtra shim), and researchDecision from
session meta.

Keeps: SKILL.md improvements, sections.ts dynamic data/web guidance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:29:14 +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
Bohan Jiang
cd078969fe
Merge pull request #125 from multica-ai/Bohan-J/desktop-auto-update
feat(desktop): add auto-update functionality
2026-02-11 20:09:36 +08:00
Jiayuan Zhang
4c4f8989ca feat(agent): add internal finance evidence decisioner 2026-02-11 20:02:30 +08:00
Bohan Jiang
b22ad5a559
Merge pull request #129 from multica-ai/fix/desktop-heartbeat-ack-filter
fix: hide heartbeat messages from desktop chat UI
2026-02-11 19:53:27 +08:00
Jiang Bohan
c49ab1fee4 fix(heartbeat): use internal run to hide heartbeat from chat history
The heartbeat runner used agent.write() (normal write), which persisted
both the heartbeat prompt and HEARTBEAT_OK response as regular messages
visible in the UI chat history.

Switch to runInternalForResult() — a new AsyncAgent method that runs
via runInternal() (messages marked internal: true, rolled back from
in-memory state). This hides both the heartbeat prompt and response
from the UI entirely, while still persisting to JSONL for diagnostics.

The previous commit's event-stream heartbeat ACK filter remains as a
defense-in-depth layer for edge cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 19:41:57 +08:00
Jiang Bohan
8d6a803739 fix(agent): filter heartbeat ACK messages from desktop event stream
The heartbeat runner uses agent.write() (normal write), so heartbeat
ACK responses like "HEARTBEAT_OK" were not suppressed by the internal
run filter and leaked into the desktop UI chat. The Gateway path was
already fixed (Hub has delayed-start + isHeartbeatAckEvent filtering),
but the local Desktop path through AsyncAgent had no such filtering.

Add createFilteredHandler() to AsyncAgent that buffers message_start
for assistant messages and checks subsequent events with
isHeartbeatAckEvent(). Pure heartbeat ACKs are suppressed end-to-end;
all other messages are forwarded normally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 19:34:23 +08:00
Jiang Bohan
e9efb66fb2 Merge remote-tracking branch 'origin/main' into Bohan-J/desktop-auto-update 2026-02-11 19:06:15 +08:00
Bohan Jiang
16cd5d0aaf
Merge pull request #126 from multica-ai/feat/subagent-announce-delivery
feat(subagent): two-tier announce delivery, provider inheritance, error propagation
2026-02-11 19:04:39 +08:00
Jiang Bohan
af3a42a00e fix(subagent): forward announcement summary to UI stream
Changed forwardAssistant from false to true in sendAnnounceDirect() so
the assistant's summary response is streamed to the desktop UI in
real-time. The announcement prompt stays internal (hidden from UI), but
the user now sees the completion notification.

Previously, persistAssistantSummary saved the response to JSONL but
never emitted events to the UI subscriber, leaving users with no
visible feedback after subagent tasks completed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 18:58:32 +08:00
Jiang Bohan
47cbf60687 fix(agent): reload tools after setProvider to fix stale closure
setProvider() updated toolsOptions.provider but didn't reload tool
instances. The sessions_spawn tool captured the old provider in its
closure at creation time, causing subagents to inherit a stale provider.

Now calls resolveTools() + setTools() after updating toolsOptions so
sessions_spawn gets a fresh closure with the correct provider.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 18:58:24 +08:00
Jiayuan Zhang
695d001f9f refactor(skills): hide technical finance decision block 2026-02-11 18:56:35 +08:00
Jiayuan Zhang
5cccb066f1 refactor(agent): keep finance tool decisions internal 2026-02-11 18:56:31 +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
bbf2a16f39 style(ui): soften dark mode background color
Increase lightness from 0.141 to 0.155 for a less harsh dark theme.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 18:51:10 +08:00
Naiyuan Qing
573d803d71 fix(ui): update component styles for Tailwind v4 compatibility
- Replace ring-[3px] with ring-3 in button and input
- Use data-horizontal/data-vertical in separator
- Fix sidebar data attributes and RTL support
- Simplify tooltip provider nesting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 18:51:05 +08:00
Jiayuan Zhang
bbda13d005 feat(skills): add finance evidence sufficiency gate 2026-02-11 18:48:44 +08:00
Jiayuan Zhang
c5db9bf232 refactor(agent): make finance web usage dynamic 2026-02-11 18:48:31 +08:00
Jiayuan Zhang
f2adddcde7 feat(skills): upgrade finance analysis workflows 2026-02-11 18:30:42 +08:00
Jiayuan Zhang
64d8427ca7 fix(agent): enforce data-web evidence fusion 2026-02-11 18:30:20 +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
b825c6b3d8 feat(ui): improve MulticaIcon animation behavior
- Separate entrance animation from hover animation
- Use state to track entrance completion
- Hover spin only activates after entrance is done
- Shorten entrance animation to 0.6s

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:47:35 +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
Jiang Bohan
d7a02182ab feat(subagent): add announce:"silent" mode for deferred coalesced announcements
Add an `announce` parameter to sessions_spawn that controls when findings
are delivered to the parent agent:

- "immediate" (default): announce per-completion (existing behavior)
- "silent": defer until ALL silent runs from the same requester complete,
  then deliver ONE coalesced announcement with all findings

This enables workflows like "spawn 10 parallel subagents to collect data,
then summarize everything at once" without intermediate results.

Changes:
- types.ts: add `announce` field to SubagentRunRecord & RegisterSubagentRunParams
- sessions-spawn.ts: add `announce` parameter to tool schema
- registry.ts: split checkAndAnnounce into immediate/silent groups,
  extract announceGroup helper, use count-match guard for silent readiness
- sections.ts: add announce mode guidance to system prompt
- registry.test.ts: add silent mode tests (field storage, group isolation)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 17:40:00 +08:00
Jiayuan Zhang
a7c194c823
Merge pull request #127 from multica-ai/forrestchang/finance-domain
feat: add finance data domain with DCF valuation and research skills
2026-02-11 17:27:01 +08:00
Jiang Bohan
de928cfe2b fix(agent): add NO_REPLY detection utility for filtering silent replies
Extract SILENT_REPLY_TOKEN and isSilentReplyText() into a shared
module. Detects NO_REPLY at the start or end of text (with optional
whitespace/punctuation) to filter out silent announcement responses
that should not be forwarded to the user.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 17:16:22 +08:00
Jiang Bohan
d01fcffe32 docs(subagent): add architecture flowchart and README
Document the full subagent lifecycle: spawn, concurrency queue,
execution, completion handling, two-tier announcement delivery,
and record archival. Include provider inheritance chain and
error propagation diagrams.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 17:10:12 +08:00
Jiang Bohan
58ec56234c feat(subagent): improve system prompts for error reporting and timeout
Add error reporting rule to subagent system prompt: subagents must
explicitly report tool failures and missing credentials in their
final message. Add timeout guidelines to parent system prompt with
recommended values by task complexity (10-30 min).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 17:10:05 +08:00
Jiang Bohan
716e69ac39 feat(subagent): add anti-polling guards to sessions_list
When subagents are still running, sessions_list now returns an
explicit instruction telling the LLM not to poll again and wait
for automatic result delivery. Normalizes status display to
uppercase ([RUNNING], [OK], [ERROR]).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 17:09:56 +08:00