Commit graph

841 commits

Author SHA1 Message Date
Jiayuan Zhang
7ac90a2ce7 feat(tools): add image resize wrapper for read tool
Wraps the read tool from pi-coding-agent to automatically downscale
oversized images (>1MB or >2000px) before they enter the session.
Uses macOS sips for resize with no extra dependencies, following the
same pattern as OpenClaw. Falls back gracefully on non-macOS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:12:37 +08:00
Jiayuan Zhang
278334474f feat(session): externalize base64 images from session JSONL
Session JSONL files were bloated because base64 image data was stored
inline (a real session had 6.7MB of images in a 9.8MB file). Images
are now extracted to per-session media/ directories as binary files,
with compact $ref references stored in the JSONL. Images are restored
transparently on read. Old sessions with inline base64 remain
backward compatible and auto-migrate on next compaction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:12:30 +08:00
Bohan Jiang
7acf4cc4a5
Merge pull request #155 from multica-ai/fix/codex-oauth-expiry
fix(oauth): don't expire credentials with refresh_token
2026-02-13 11:56:49 +08:00
Jiang Bohan
a490c737cc feat(providers): add gpt-5.3-codex and update OpenAI model lists
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:55:16 +08:00
Jiang Bohan
16c325c808 fix(oauth): don't expire OAuth credentials that have refresh_token
Codex and Claude Code OAuth tokens with refresh_token can auto-renew,
so they should not be considered expired based on last_refresh time or
file mtime. Previously, credentials were hardcoded to expire after 1
hour, causing valid Codex sessions to show as unconfigured.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:42:24 +08:00
Bohan Jiang
065b686960
Merge pull request #154 from multica-ai/fix/desktop-ci-publish
fix(desktop): prevent electron-builder auto-publish in CI
2026-02-13 11:31:05 +08:00
Jiang Bohan
d641c1a30c fix(desktop): prevent electron-builder auto-publish in CI
electron-builder detects CI and implicitly triggers publishing to GitHub
Releases, which fails without GH_TOKEN. Adding --publish never to the
build script so CI only builds without attempting to publish.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:30:26 +08:00
Naiyuan Qing
0ae17d6082
Merge pull request #153 from multica-ai/docs/monorepo-dev-workflow
docs: add monorepo development workflow
2026-02-13 09:29:51 +08:00
Naiyuan Qing
e87e39f13b docs: add monorepo development workflow documentation
- Update root dev script to build packages before watching
- Add --no-dts flag to package dev scripts to avoid DTS race conditions
- Document monorepo development workflow in README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 09:21:47 +08:00
Naiyuan Qing
c728a80a9b
Merge pull request #152 from multica-ai/fix/markdown-strikethrough-parsing
fix(ui): remove math plugins and disable single-tilde strikethrough
2026-02-13 08:51:37 +08:00
Naiyuan Qing
374ce68b84 fix(ui): remove math plugins and disable single-tilde strikethrough
- Remove remarkMath and rehypeKatex plugins that caused text wrapping
  issues by interpreting $ signs as LaTeX delimiters
- Configure remarkGfm with singleTilde: false to prevent single ~ from
  being parsed as strikethrough (e.g., ~1000 should not become <del>)
- Only double tilde ~~text~~ now renders as strikethrough

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 08:33:56 +08:00
Jiayuan Zhang
ad26eec7d2
Merge pull request #151 from multica-ai/forrestchang/telegram-file-send
feat(gateway): handle send_file action in Telegram service
2026-02-13 04:28:56 +08:00
Jiayuan Zhang
0c6cdb0d3a fix(hub): initialize channelManager before restoreAgents
Move channel plugin initialization (initChannels + ChannelManager
constructor) before restoreAgents() to prevent TypeError when
createAgent() calls channelManager.listChannelInfos() during restore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:40:16 +08:00
Jiayuan Zhang
f5ac4b85e8 feat(gateway): handle send_file action in Telegram service
Add sendFileToTelegram method that decodes base64 file data and sends
it via grammy's InputFile API. Handle send_file RoutedMessage action
in the virtual device sendCallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:37:41 +08:00
Jiayuan Zhang
c64616512a feat(hub): wire send_file callback with dual-path routing
Create onChannelSendFile callback in Hub.createAgent() that tries the
channel plugin path first (local file), then falls back to the gateway
path (base64 over RoutedMessage). Also pass channel info to agent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:37:35 +08:00
Jiayuan Zhang
0ebd9d6b22 feat(agent): add connected channels section to system prompt
Add ChannelInfo type and buildChannelsSection() that informs the LLM
about connected messaging channels and their capabilities (e.g. send
files). Wire through SystemPromptOptions and runner.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:37:29 +08:00
Jiayuan Zhang
01b89ed488 feat(channels): add message source prefix, sendFile, and channel info
Prepend [ChannelName · private/group] prefix to debounced messages so
the LLM knows the message source. Add sendFile() for outbound media
routing and listChannelInfos() for system prompt channel awareness.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:37:22 +08:00
Jiayuan Zhang
a29366d7cf feat(agent): add send_file tool for channel file sending
New send_file tool with TypeBox schema, auto-detect media type from
file extension, and file validation. Wired through AgentOptions and
resolveTools with conditional registration when callback is provided.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:37:15 +08:00
Jiayuan Zhang
6e96fd1306 feat(channels): add outbound media types and sendMedia to channel adapter
Add OutboundMedia interface and OutboundMediaType to the channel type
system. Implement sendMedia in the Telegram plugin using grammy's
InputFile API with HTML caption formatting and plain-text fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:37:08 +08:00
Jiayuan Zhang
ade7f2b056
feat(agent): add search-then-fetch guidance to web tools system prompt (#150)
Guide the LLM to evaluate snippet quality after web_search and
follow up with web_fetch on the most relevant URLs when deeper
content is needed for accurate answers.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 23:50:13 +08:00
Bohan Jiang
a986456e72
Merge pull request #148 from multica-ai/refactor/workspace-documents
refactor(agent): move workspace to ~/Documents/Multica
2026-02-12 23:08:57 +08:00
Bohan Jiang
d385915f95
Merge pull request #149 from multica-ai/feat/default-agent-name-multica
feat(profile): default new agent name to "Multica"
2026-02-12 23:08:33 +08:00
Jiang Bohan
02b480dc47 feat(profile): default new agent name to "Multica" instead of "Assistant"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 19:48:40 +08:00
Naiyuan Qing
9a22ed1171
Merge pull request #147 from multica-ai/docs/desktop-env-example
docs(desktop): improve .env.example with accurate configuration guide
2026-02-12 19:06:15 +08:00
Naiyuan Qing
ad06679e69 fix: simplify - just say pnpm dev works directly
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 19:04:44 +08:00
Jiang Bohan
cb2dfd246f refactor(agent): move workspace to ~/Documents/Multica
Hidden directory ~/.super-multica is not user-friendly for a working
directory. Move default workspace base to ~/Documents/Multica so
users can easily find agent-created files in Finder.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 19:04:20 +08:00
Naiyuan Qing
8704e37faa fix: clarify dev gateway is hardcoded in root package.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 19:03:26 +08:00
Naiyuan Qing
c0b248e8f9 fix: remove hardcoded URLs, reference config files instead
URLs may change - point to package.json and .env.production as sources of truth.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 19:02:13 +08:00
Naiyuan Qing
816c883f30 docs(desktop): improve .env.example with accurate configuration guide
- Clarify that local dev needs no .env (GATEWAY_URL set in package.json)
- Document GATEWAY_URL override for local gateway testing
- Add detailed explanation of both URLs (Gateway vs API Server)
- List dev/prod values for each environment variable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 19:00:04 +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
e901bec227
Merge pull request #145 from multica-ai/NevilleQingNY/fix-core-dist-missing
feat(desktop): default dev gateway URL with GATEWAY_URL override
2026-02-12 18:44:48 +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
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
Naiyuan Qing
fd098c04eb Merge remote-tracking branch 'origin/main' into feat/dashboard 2026-02-12 17:38:49 +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