Commit graph

269 commits

Author SHA1 Message Date
Jiang Bohan
9b8aebdf76 chore(skills): remove redundant provider skill
The /provider command is now a built-in CLI command in chat.ts,
which directly calls oauth/providers.ts for accurate status.
The skill was redundant and could produce inconsistent results
since it relied on LLM reading files instead of using the API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:54:42 +08:00
Jiang Bohan
da11e65d35 refactor(oauth): rename credentials/ to oauth/ for clarity
Separate OAuth credential reading (external CLI tools) from the main
CredentialManager (API Key configuration in credentials.json5).

- credentials.ts: API Key configuration management
- oauth/: External OAuth credential reading (Claude Code, Codex)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:52:04 +08:00
Jiang Bohan
307b381e6c feat(skills): add provider skill for LLM provider management
Provides instructions for viewing and switching LLM providers,
including OAuth (Claude Code, Codex) and API Key based providers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:43:10 +08:00
Jiang Bohan
9504eeab62 feat(cli): add /provider command to show and switch providers
The /provider command shows:
- Current provider and model
- List of available providers (OAuth and API Key)
- Status of each provider (configured/not configured)
- Instructions for switching providers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:43:05 +08:00
Jiang Bohan
b9ce4da28f feat(runner): support OAuth providers (claude-code, openai-codex)
- Add provider alias mapping (claude-code -> anthropic)
- Resolve API key from OAuth credentials for claude-code and codex
- Add default models for each provider

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:43:00 +08:00
Jiang Bohan
05138029de feat(credentials): add CLI credentials reader for OAuth providers
Add support for reading OAuth credentials from external CLI tools:
- Claude Code: ~/.claude/.credentials.json or macOS Keychain
- Codex: ~/.codex/auth.json or macOS Keychain

Includes provider management with status checking and login instructions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:42:55 +08:00
Naiyuan Qing
ebcab2477a
Merge pull request #57 from multica-ai/feature/ws-migration
feat: migrate frontend to pure WebSocket RPC
2026-02-02 16:35:19 +08:00
Naiyuan Qing
a62ac2e075 chore: remove @multica/fetch package
No consumers remain after migrating to pure WebSocket RPC.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:29:27 +08:00
Naiyuan Qing
e491949749 refactor(store): remove @multica/fetch dependency
- Move gatewayUrl into gateway store state with setGatewayUrl action
- layout.tsx uses useGatewayStore.getState().setGatewayUrl() directly
- Remove @multica/fetch from store and web package.json dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:23:06 +08:00
Naiyuan Qing
a1c28b3d04 feat(ui): add auto-scroll to bottom for chat messages
- Add useAutoScroll hook using ResizeObserver + MutationObserver
- Observes content children for size changes (streaming, images)
- Watches for new DOM nodes (new messages, history load)
- Respects user scroll position: no force-scroll when reading above
- Integrate in Chat component alongside existing useScrollFade

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:14:18 +08:00
Naiyuan Qing
4d6d57187c feat(store): load agent message history via RPC
- Add typed AgentMessageItem to SDK with proper content block types
- Add fetchAgentMessages action to hub store using getAgentMessages RPC
- Extract text from complex content blocks (user string, assistant array)
- Auto-load history when selecting an agent with no local messages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:13:59 +08:00
Naiyuan Qing
3622f82a7b feat(gateway): add auto-connect, hub discovery via list-devices
- Add LIST_DEVICES event and "hub" device type to SDK
- Add listDevices() method to GatewayClient
- Add handleListDevices handler in Gateway
- Change Hub deviceType from "client" to "hub"
- Refactor gateway store: auto-connect WS, separate hubId selection
- Hub-init: auto-connect on mount, discover hubs on registered
- Hub-sidebar: show discovered hubs list with connect/disconnect UI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:13:40 +08:00
Bohan Jiang
10f9aa342c
Merge pull request #56 from multica-ai/feature/skills-progressive-loading
feat(skills): implement progressive loading for reduced token usage (MUL-123)
2026-02-02 16:05:15 +08:00
Jiang Bohan
6f0be4a1cb feat(skills): implement progressive loading for reduced token usage
Changed buildModelSkillsPrompt() to only output skill metadata (name + description)
instead of full instructions. Full instructions are now loaded on-demand when a
skill is triggered via the new buildSkillPromptForInjection() method.

This reduces initial system prompt size significantly for projects with many skills.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-02 16:00:38 +08:00
Naiyuan Qing
150c87a496 refactor(frontend): replace HTTP API with pure WebSocket RPC
- gateway store: add hubId state and request() RPC method
- hub store: replace consoleApi calls with gateway.request() RPC
- hub-init: simplify to react on gwState === "registered"
- hub-sidebar: add hub-id input + connect/disconnect flow
- chat: use gateway hubId for message routing
- layout: remove consoleUrl config (no longer needed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 15:27:07 +08:00
Naiyuan Qing
1f22c3e578 feat(hub): register RPC handlers for hub, agent, and gateway operations
Add 5 new RPC methods (getHubInfo, listAgents, createAgent, deleteAgent,
updateGateway) mirroring the existing Console HTTP API, enabling pure
WebSocket communication from the frontend.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 15:27:07 +08:00
Bohan Jiang
64878d9fe1
Merge pull request #55 from multica-ai/feature/skills-profile-and-autocomplete-fix
feat(skills): add --profile option and fix autocomplete terminal issues
2026-02-02 14:13:06 +08:00
Jiang Bohan
452ba8b5bb fix(autocomplete): improve terminal compatibility and CJK support
- Add terminal support detection to gracefully fallback to simple readline
- Add getStringWidth() for proper CJK character width calculation
- Remove unreliable SAVE_CURSOR/RESTORE_CURSOR ANSI sequences
- Use relative cursor movement for better compatibility
- Handle edge case when cursor is at line boundary

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:11:36 +08:00
Jiang Bohan
58eb249e11 docs(skills): add profile-specific installation documentation
Update both English and Chinese README files with:
- CLI examples for --profile option
- Reorganized manual creation as alternative method

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:11:36 +08:00
Jiang Bohan
351afb13a7 feat(skills): add --profile option for installing to specific profile
- Add profileId parameter to SkillAddRequest interface
- Add getSkillsDir() helper to determine target directory
- Update CLI to parse --profile/-p option
- Update help text and error messages with new option

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:11:36 +08:00
Jiang Bohan
991937897d docs(skills): update CLI commands and add profile skills documentation
- Update skills/README.zh-CN.md: pnpm skills:cli → multica skills
- Add "Adding Profile-Specific Skills" section to both READMEs
- Document manual creation of profile-specific skills

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:11:36 +08:00
Jiang Bohan
3797e9e58b docs: update CLI commands to use unified multica format
- Update skills/README.md: pnpm skills:cli → multica skills
- Update tools/README.md: pnpm agent:cli, pnpm tools:cli → multica run, multica tools
- Update tools/README.zh-CN.md: same changes for Chinese docs
- Update test commands: npx tsx → pnpm test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:11:36 +08:00
LinYushen
4d4da4ed43
Merge pull request #54 from multica-ai/fetch-agent-history
feat(hub): add RPC protocol for fetching agent history
2026-02-02 14:10:52 +08:00
yushen
812710c06a docs(hub): add RPC protocol documentation
Document the full RPC flow, message format, error codes, SDK usage,
available methods (getAgentMessages), and guide for adding new methods.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:10:17 +08:00
yushen
1e7d5f66ec feat(hub): add RPC dispatcher with structured error handling
Add RpcDispatcher and RpcError for method dispatch with typed error
codes (METHOD_NOT_FOUND, INVALID_PARAMS, AGENT_NOT_FOUND). Implement
getAgentMessages handler that checks session files on disk, supporting
both active and closed agents. Wire up RPC request/response flow in Hub.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:10:09 +08:00
yushen
2541745152 feat(sdk): add RPC request method and types to GatewayClient
Add request<T>() method that handles full request/response lifecycle
with auto-generated requestId, timeout handling, and pending request
cleanup on disconnect. Also add GetAgentMessagesParams and
GetAgentMessagesResult type definitions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:10:00 +08:00
Naiyuan Qing
d5c4295eb2
Merge pull request #53 from multica-ai/naiyuan/unify-gateway-sdk
refactor(sdk): unify gateway-sdk into @multica/sdk package
2026-02-02 13:45:53 +08:00
Naiyuan Qing
3d7b13555f refactor(sdk): unify gateway-sdk into @multica/sdk package
Sync latest code from src/shared/gateway-sdk/ into packages/sdk/,
update all backend imports to use @multica/sdk, and remove the
duplicate src/shared/gateway-sdk/ directory.

- Translate Chinese comments to English in SDK source
- Fix package.json exports with default condition
- Add @multica/sdk as workspace dependency for backend
- Update imports in gateway, test-client, and hub

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 13:43:52 +08:00
Naiyuan Qing
f4500ad148
Merge pull request #52 from multica-ai/naiyuan/refactor-frontend-logic
refactor(frontend): extract shared logic into packages
2026-02-02 12:03:18 +08:00
Naiyuan Qing
3548c91488 docs(web): add development guidelines README
Document thin-shell architecture, package responsibilities, Zustand
best practices, import conventions, and new feature checklist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 11:52:47 +08:00
Naiyuan Qing
4a7a9800f2 fix(frontend): apply code review fixes across store and UI
- Move setConfig() after imports in layout.tsx
- Add gateway disconnect cleanup in hub-init useEffect
- Replace silent catches with toast error notifications in hub store
- Optimize chat selectors with useMemo and useCallback/getState()
- Remove unused getMessagesByAgent from messages store
- Add clipboard try/catch with error toast
- Add skeleton loading states for hub sidebar and chat header

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 11:52:42 +08:00
Naiyuan Qing
eef26d8675 refactor(frontend): complete migration of all hooks and components to packages
- Create gateway store in @multica/store (WS connection independent of components)
- Gateway auto-connects when hub is ready, messages handled internally
- Move scroll-fade hook to @multica/ui/hooks
- Move Chat component to @multica/ui/components
- Add setConfig() call in web layout for URL injection
- Delete all web-local hooks, components, and lib/config
- Web app is now a pure shell: layout.tsx + page.tsx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 11:07:57 +08:00
Naiyuan Qing
97fce5b113 refactor(store): migrate messages hook to Zustand store
- Move useMessages from apps/web to packages/store/src/messages.ts
- Convert useState to Zustand store for global message persistence
- Add reserved interfaces: updateMessage, loadMessages, getMessagesByAgent
- Update chat.tsx imports to use @multica/store

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 10:49:52 +08:00
Naiyuan Qing
5275bc55fc refactor(store): migrate device-id hook to @multica/store
- Move useDeviceId from apps/web to packages/store/src/device-id.ts
- Update imports in chat.tsx and use-gateway.ts to use @multica/store
- Add uuid dependency to @multica/store

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 10:45:20 +08:00
Naiyuan Qing
63861d03c6 refactor(frontend): extract shared stores and components into packages
- Create @multica/fetch package for HTTP client and URL config
- Migrate hub store and hub-init hook to @multica/store
- Move HubSidebar component to @multica/ui for web/desktop reuse
- Update web app imports to use shared packages
- Remove counter store example and its component-example usage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 10:37:17 +08:00
Jiayuan Zhang
46b7906272
Merge pull request #51 from multica-ai/jiayuan/fix-web-search
fix(web-search): use correct model name based on Perplexity API key type
2026-02-02 00:55:31 +08:00
Jiayuan
52a8b5a612 fix(web-search): use correct model name based on Perplexity API key type
- Direct Perplexity API (pplx-*) uses "sonar-pro" model name
- OpenRouter (sk-or-*) uses "perplexity/sonar-pro" model name
- Refactor inferPerplexityBaseUrl to inferPerplexityConfig returning both baseUrl and model
- Export internal functions for potential reuse

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 00:49:41 +08:00
Jiayuan Zhang
806279a72c
Merge pull request #50 from multica-ai/jiayuan/agent-setup
feat(profile): add interactive setup wizard and simplify profile structure
2026-02-02 00:18:48 +08:00
Jiayuan
8228643924 feat(skills): auto-sync bundled skills based on version comparison
When loading skills, automatically check if bundled skills have a higher
version than managed skills. If so, update the managed skill to the
newer bundled version.

This ensures users get skill updates when upgrading multica, without
needing manual intervention.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 00:15:40 +08:00
Jiayuan
34bfc81ce7 refactor(profile-setup): simplify setup to focus on agent identity and user info
Remove work context and workflow preferences collection since this is a
general-purpose agent not tied to specific work types.

Setup now only collects:
- Agent identity (name, style) -> soul.md
- User info (name, timezone, preferences) -> user.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 23:59:59 +08:00
Jiayuan
eeabe0d55c fix(profile-setup): add agent identity questions to setup wizard
- Add soul.md to the list of configurable files
- Include agent identity questions (name, role, style)
- Update file examples to show soul.md updates
- Start conversation by asking about agent's name first

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 23:55:40 +08:00
Jiayuan
a990a1c3ca feat(profile): add interactive setup command for agent profiles
- Add `multica profile setup <id>` command for interactive profile setup
- Create profile-setup skill with conversational setup wizard
- Agent collects user info through natural dialogue and updates profile files
- Supports updating user.md, workspace.md, and config.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 23:49:48 +08:00
Jiayuan
e7f84755b3 refactor(profile): simplify profile structure by removing identity and bootstrap
- Remove identity.md and bootstrap.md from profile files
- Merge identity content into soul.md (now contains identity, personality, and behavior)
- Update templates, storage, and types to reflect new structure
- Update tests to match new profile structure

Profile now has 4 files: soul.md, user.md, workspace.md, memory.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 23:49:37 +08:00
Jiayuan Zhang
9f48dca6af
Merge pull request #49 from multica-ai/jiayuan/better-cli-commands
refactor(cli): unify CLI with multica command and subcommands
2026-02-01 23:17:43 +08:00
Jiayuan
bbc488beda docs: update documentation for new CLI structure
- Update README.md with new multica command examples
- Update CLAUDE.md common commands section
- Document all subcommands and their usage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 23:10:02 +08:00
Jiayuan
c35ffb1f80 chore(cli): update package.json and build script for unified CLI
- Simplify bin entries to multica and mu
- Update npm scripts to use new CLI entry point
- Modify build-cli.js to build single multica.mjs binary

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 23:09:54 +08:00
Jiayuan
52850920ac refactor(cli): unify CLI with multica command and subcommands
- Create unified entry point at src/agent/cli/index.ts
- Add subcommand modules: run, chat, session, profile, skills, tools, credentials, dev
- Support both 'multica' and 'mu' aliases
- Add session management commands (list, show, delete)
- Integrate dev server commands into CLI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 23:09:44 +08:00
Jiayuan Zhang
144dc94f09
Merge pull request #48 from multica-ai/chore/update-pnpm-version
chore: update pnpm version to 10.28.2
2026-02-01 22:40:53 +08:00
Jiayuan
99b461fc1c chore: update pnpm version to 10.28.2
Co-Authored-By: Warp <agent@warp.dev>
2026-02-01 22:40:08 +08:00
Jiayuan Zhang
2d86d8ac7e
Merge pull request #47 from multica-ai/forrestchang/optimize-agent-templates
refactor(profile): optimize agent templates
2026-02-01 22:17:36 +08:00