Commit graph

784 commits

Author SHA1 Message Date
Jiang Bohan
6b9e5d5f40 refactor(subagent): improve system prompt with anti-hallucination and group guidance
Rewrite Sub-Agents section: add explicit anti-hallucination rules (never
fabricate completion status), make group/next the recommended pattern for
multi-agent tasks, remove sessions_list polling restrictions, add usage
examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:11:38 +08:00
Jiang Bohan
48185c3e77 feat(subagent): add groupId/next params to spawn and group display to list
sessions_spawn now accepts groupId and next parameters. First spawn with
next auto-creates a group; subsequent spawns join via groupId. sessions_list
groups runs by groupId with completion progress display.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:11:31 +08:00
Jiang Bohan
f46c00e902 feat(subagent): update announce flow for group continuation
When all runs in a group complete, deliver combined findings plus the
`next` continuation prompt to the parent agent via writeInternal. The
parent can then act on the collected data (summarize, write files, etc).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:11:25 +08:00
Jiang Bohan
12fb12b895 feat(subagent): add SubagentGroup type and registry support
Add SubagentGroup for "collect all, then act" workflows where multiple
subagents complete before a continuation task runs. Groups are persisted
alongside run records and support a `next` continuation prompt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:11:20 +08:00
Jiayuan Zhang
c251d94c8a
Merge pull request #137 from multica-ai/codex/remove-finance-api-key-requirement
chore(skills): remove finance API key requirement
2026-02-12 16:55:59 +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
07c05b145c feat(desktop): add dev reset scripts for fresh install testing
- Add `dev:desktop:reset` to delete ~/.super-multica directory
- Add `dev:desktop:fresh` to reset and start app in one command

Enables testing the complete onboarding flow as a new user.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 15:56:50 +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
Jiayuan Zhang
b280d6fa52 chore(skills): bump finance skill versions to 1.1.1 2026-02-12 15:15:53 +08:00
Jiayuan Zhang
4b7567fe34 chore(skills): remove finance API key requirement 2026-02-12 15:13:13 +08:00
Bohan Jiang
7b91c15bc5
Merge pull request #134 from multica-ai/feat/chat-abort-support
feat(desktop): add chat abort support
2026-02-12 14:54:56 +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
LinYushen
5c3fd3ea06
Merge pull request #133 from multica-ai/fix/gateway-dockerfile
fix(gateway): rewrite Dockerfile and add Telegram typing indicator
2026-02-12 13:34:30 +08:00
yushen
f20143743b feat(gateway): add typing indicator for Telegram bot responses
Send "typing" chat action while LLM generates a response, with 5s
interval refresh and 60s safety timeout. Stop on message_end,
agent_error, or generic error events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:27:41 +08:00
yushen
899a3d193c fix(gateway): rewrite Dockerfile to match current source layout
Gateway source moved out of src/ subdirectory but Dockerfile still
referenced old paths, breaking docker build. Rewrite to use tsx runtime
(no tsc/esbuild compile step), copy all workspace package.json for
lockfile compatibility, and filter install to gateway deps only (616 vs
1911 packages). Also update build-and-push script to tag latest.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:27:41 +08:00
Naiyuan Qing
ee8e0a67c9
Merge pull request #132 from multica-ai/refactor/desktop-page-container
refactor(desktop): add container wrapper to page layouts
2026-02-12 12:04:25 +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
b5ce4969f9
Merge pull request #128 from multica-ai/feat/onboarding-check
feat(desktop): redesign onboarding flow with improved UX
2026-02-12 11:35:03 +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
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