Commit graph

861 commits

Author SHA1 Message Date
Jiang Bohan
13fbeaf4d2 fix(providers): use dedicated openai-codex provider instead of aliasing to openai
Codex OAuth tokens use the ChatGPT backend API (chatgpt.com), not the
standard OpenAI API (api.openai.com). pi-ai already has a dedicated
openai-codex provider with the correct API format (openai-codex-responses)
and base URL. Remove the alias that was incorrectly mapping openai-codex
to openai, which caused 401 errors due to missing scopes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:01:57 +08:00
Naiyuan Qing
7578946990
Merge pull request #159 from multica-ai/refactor/login-ui-consistency
refactor(ui): unify login page styling across web and desktop
2026-02-13 14:57:16 +08:00
Naiyuan Qing
a2cabb550f refactor(ui): unify login page styling across web and desktop
- Use bordered icon with consistent size on both platforms
- Adjust font size to match icon proportions
- Simplify desktop tagline for cleaner presentation
- Streamline web login header to [icon] Sign In format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:56:16 +08:00
Naiyuan Qing
736df03a4f
Merge pull request #156 from multica-ai/feat/desktop-auth
feat: add desktop authentication with Web login
2026-02-13 14:49:38 +08:00
Naiyuan Qing
09562776d4 fix(web): avoid setState in useEffect in AuthGuard 2026-02-13 14:43:52 +08:00
Naiyuan Qing
e0f80b0054 merge: resolve conflict with main (keep both auth and subagents handlers) 2026-02-13 14:41:15 +08:00
Naiyuan Qing
450257035f fix: add missing comma in package.json 2026-02-13 14:39:38 +08:00
Bohan Jiang
b2e4f08424
Merge pull request #158 from multica-ai/feat/subagent-dashboard
feat(desktop): subagent dashboard
2026-02-13 14:37:55 +08:00
Naiyuan Qing
7faf421996 merge: resolve conflict with main branch (build scripts) 2026-02-13 14:36:42 +08:00
Naiyuan Qing
e3c24fc10b chore(desktop): add deep link protocol and build scripts
- Add multica:// protocol for macOS and Windows (production login)
- Add build:staging and build:production scripts
- Update env vars: remove MULTICA_URL, add WEB_URL
- Update README with environment configuration docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:33:48 +08:00
Naiyuan Qing
ae86bba599 feat(web): add client-side auth with session storage and route protection
- Add lib/auth.ts for cookie-based session storage
- Add AuthGuard component for route protection
- Update request.ts to include sid in Authorization header
- Update login-form.tsx to save session and redirect if authenticated
- Wrap ChatPage with AuthGuard

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:31:02 +08:00
Naiyuan Qing
683182e3ac fix(web): fix login page prerender error
Split login page into Server Component + Client Form to properly
handle useSearchParams with force-dynamic rendering.

Reference: CAP project pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:25:38 +08:00
Naiyuan Qing
2a6e10496a feat(desktop): improve login page and add auth toasts
- Add tagline and animation to login page
- Add toast notification on login success
- Add toast notification on logout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:19:53 +08:00
Jiang Bohan
499c573544 feat(desktop): add subagent dashboard with real-time status tracking
Adds a status bar and slide-out dashboard panel to the chat view that
shows subagent progress in real-time. Polls at 2s when active, 10s when
idle. Completed runs auto-hide after 5 minutes. Includes dismiss button
and 30s auto-dismiss for the status bar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:46:58 +08:00
Naiyuan Qing
31c8b1babc refactor(web): replace devd proxy with Next.js rewrites
- Add rewrites in next.config.ts to proxy /api/* to api-dev.copilothub.ai
- Update docs to reflect new local dev workflow (no devd needed)
- Fix web port number in CLAUDE.md (3001 → 3000)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 13:25:08 +08:00
Naiyuan Qing
6e3ba38df6 docs(auth): clarify storage location for SID and user data
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 12:39:16 +08:00
Naiyuan Qing
2eb7ff6847 chore: update pnpm-lock.yaml
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 12:25:12 +08:00
Naiyuan Qing
bef3a5b3cb docs: add desktop auth integration guide
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 12:25:08 +08:00
Naiyuan Qing
108cf7ffb0 feat(web): add login page for desktop auth callback
- Add email/code login with verification
- Add Google OAuth login
- Add desktop callback API route
- Add request service with device ID handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 12:25:03 +08:00
Naiyuan Qing
2577475ba6 feat(desktop): add authentication flow with Web login
- Add auth IPC handlers (main process)
- Add auth store with Zustand (renderer)
- Add login page with branded UI
- Add AuthGuard for protected routes
- Add user dropdown menu in sidebar footer
- Support deep link (multica://) for production
- Support local HTTP callback for development

Reference: https://github.com/CapSoftware/Cap

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 12:24:57 +08:00
Naiyuan Qing
ca1c260735 feat(ui): add size prop to MulticaIcon bordered variant
Supports sm, md, lg sizes for flexible usage in different contexts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 12:24:48 +08:00
Naiyuan Qing
35ab158775 feat(types): add AuthUser type for auth integration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 12:24:43 +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