Commit graph

806 commits

Author SHA1 Message Date
Bohan Jiang
0f4d579cb7
Merge pull request #144 from multica-ai/feat/agent-workspace
feat(agent): add default workspace directory per profile
2026-02-12 18:39:02 +08:00
Jiang Bohan
18ab2da8c4 test(agent): add workspace resolution and initialization tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 18:08:04 +08:00
Jiang Bohan
ca0b4624fd feat(agent): add default workspace directory per profile
Each agent profile now gets a dedicated workspace directory
(~/.super-multica/workspace/{profileId}) used as the default CWD
for tool operations. Supports override via MULTICA_WORKSPACE_DIR
env var or config.json workspaceDir field. The workspace path is
injected into system prompt and runtime info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 18:07:59 +08:00
Bohan Jiang
ade5e5a17c
Merge pull request #143 from multica-ai/Bohan-J/subagent-timeout
feat(subagent): increase default timeout to 30 min
2026-02-12 18:02:29 +08:00
Jiayuan Zhang
7bb0438270
Merge pull request #142 from multica-ai/forrestchang/office-skills
feat(skills): add office suite skills (docx, pdf, pptx, xlsx)
2026-02-12 17:59:28 +08:00
Jiang Bohan
5b0cbd4d7d feat(subagent): increase default timeout from 10 min to 30 min
A subagent that times out loses all its work, so a generous default
reduces wasted compute. Update the constant, tool description, system
prompt guidelines, and documentation to reflect the new 1800s default.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:54:53 +08:00
Jiayuan Zhang
28957ba835 feat(skills): add Excel spreadsheet (xlsx) skill
Add xlsx skill with openpyxl/pandas workflows, formula-first approach, LibreOffice recalculation, financial model color coding standards, and formula verification checklist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:54:17 +08:00
Jiayuan Zhang
1c51932119 feat(skills): add PowerPoint presentation (pptx) skill
Add pptx skill with template-based editing workflow, PptxGenJS creation from scratch, slide thumbnails, design guidelines, and visual QA process.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:54:16 +08:00
Jiayuan Zhang
7999d8fc99 feat(skills): add PDF processing skill
Add pdf skill with text/table extraction, merge/split, form filling (fillable and non-fillable), PDF creation with reportlab, and command-line tools integration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:54:16 +08:00
Jiayuan Zhang
2774c0f61f feat(skills): add Word document (docx) skill
Add docx skill with document creation via docx-js, XML editing workflow (unpack/edit/pack), tracked changes, comments, and LibreOffice integration for PDF conversion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:54:16 +08:00
Jiayuan Zhang
143d779376
Merge pull request #140 from multica-ai/forrestchang/earnings-analysis-skill
feat(skills): earnings analysis for financial statement assessment
2026-02-12 17:34:16 +08:00
Bohan Jiang
28c83af0d3
Merge pull request #141 from multica-ai/fix/writeinternal-retry
fix(agent): retry writeInternal once on transient LLM errors
2026-02-12 17:31:03 +08:00
LinYushen
8bc36a9cc9
Merge pull request #136 from multica-ai/fix/agent-compaction
fix(agent): prevent context window overflow with 3-layer compaction defense
2026-02-12 17:23:12 +08:00
Jiayuan Zhang
845bcea77d fix(skills): enforce mandatory web search in earnings analysis
Agent was skipping all web searches because instructions used optional
language ("if...", "after reviewing..."). Changed key searches from
conditional to mandatory (MUST/REQUIRED), added a checkpoint after
Step 1b, and rewrote Web Search Guidelines as "Requirements" with a
minimum of 3 mandatory searches per analysis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:21:51 +08:00
Jiang Bohan
d627fb4ff4 fix(agent): retry writeInternal once on transient LLM errors
When writeInternal fails with a transient error (e.g. undici
"terminated", connection reset, 502/503), wait 5 seconds and retry
once. This prevents continuation tasks from silently failing when
the LLM streaming connection is interrupted mid-generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:19:52 +08:00
Bohan Jiang
b0f3e1e38a
Merge pull request #139 from multica-ai/feat/subagent-group-next
feat(subagent): add group/next continuation for multi-agent workflows
2026-02-12 17:17:46 +08:00
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
f021063a3e feat(skills): add web search integration to earnings analysis
Add targeted web search guidance at key analysis steps: earnings call
highlights, industry context, anomaly explanation (margin shifts, debt
changes, CapEx spikes), quality-of-earnings validation, and earnings
call transcript supplementation. Includes guardrails to keep searches
targeted (3-6 total) and source-quality hierarchy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:05:30 +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
Jiayuan Zhang
bef8692e75 feat(skills): add earnings analysis skill for financial statement assessment
Adds a new bundled skill for analyzing company financial statements with
a structured 9-step framework including Buffett competitive advantage
scoring, quality of earnings assessment, and SEC filing qualitative
analysis. Includes reference files for sector benchmarks and scoring
criteria.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 16:53:21 +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
yushen
8f4e894370 feat(ui): show in-chat system message when context compaction occurs
Add CompactionItem component that renders a subtle inline notification
in the chat stream when the agent compacts its context window. Extends
Message type with "system" role and handles compaction_end events in
useChat's handleStream.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 16:10:19 +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
yushen
9c52dc0124 fix(agent): 3-layer defense against context window overflow
Root cause: compaction only ran after successful assistant response,
never before calling the LLM API. Internal runs skipped it entirely,
and the fire-and-forget void swallowed errors with race conditions.

Layer 1 - Pre-flight compaction in transformContext:
  Runs before EVERY LLM call (including internal runs). Prunes tool
  results and drops oldest messages when utilization exceeds 80%.
  Pure in-memory, no disk writes.

Layer 2 - Fix post-hoc compaction:
  Store compaction promise instead of voiding it, await at _run() start
  to prevent race conditions. Emit compaction_start before the actual
  compaction. Remove useless catch-rethrow block.

Layer 3 - Context overflow recovery:
  Catch context overflow 400 errors → auto-compact → retry (up to 2
  attempts). Runs before classifyError/auth rotation so overflow errors
  are handled by compaction, not profile switching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 14:52:19 +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
yushen
b13d40c6da fix(agent): increase token estimation safety margins
- ESTIMATION_SAFETY_MARGIN: 1.2 → 1.5 (50% buffer covers CJK text)
- estimateSystemPromptTokens: /3 → /2 (conservative for mixed content)

This makes the 80% compaction trigger fire earlier, reducing the gap
between estimated and actual token counts that caused overflow errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 14:43:43 +08:00
yushen
f8ca4ca95e feat(agent): add isContextOverflowError utility
Detects context overflow 400 errors from various LLM providers
(prompt too long, context length exceeded, request too large, etc.)
for use in auto-compaction recovery.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 14:43:33 +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