Commit graph

88 commits

Author SHA1 Message Date
Jiang Bohan
ecaada1df0 feat(skills): add CLI commands for add/remove skills
Add new CLI commands:
- add <source>: Add skill from GitHub (owner/repo format)
- remove <name>: Remove installed skill
- Support for --force flag to overwrite existing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:30:00 +08:00
Jiang Bohan
aee807e95a feat(skills): add module for GitHub skill installation
Implement skill download from GitHub repositories:
- parseSource() to handle owner/repo, owner/repo/skill, and full URLs
- addSkill() with shallow clone and sparse checkout support
- removeSkill() to uninstall skills
- listInstalledSkills() for listing managed skills
- Automatic .git cleanup after clone

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:29:55 +08:00
Jiang Bohan
1105a7ac1f feat(skills): add CLI for skills management
Add skills-cli.ts with commands:
- list: Show all skills with eligibility status
- status [id]: Show detailed skill info or summary
- install <id>: Install skill dependencies

Add skills:cli script to package.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:15:56 +08:00
Jiang Bohan
91709ddd84 feat(skills): integrate watcher into SkillManager
Add hot reload support to SkillManager:
- startWatching/stopWatching methods
- Version-based automatic cache invalidation
- Export install and watcher functions
- listAllSkillsWithStatus and checkSkillEligibility helpers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:15:51 +08:00
Jiang Bohan
8eba6c0f4a feat(skills): add file watcher for hot reload
Implement chokidar-based file watching for skill hot reload:
- Version-based cache invalidation
- Debounced change detection
- Change listener registration with onSkillsChange
- Dynamic chokidar import (optional dependency)
- Watch skill directories with configurable paths

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:15:46 +08:00
Jiang Bohan
5853c9146a feat(skills): add install mechanism for skill dependencies
Implement install support for brew/npm/uv/go/download methods:
- buildInstallCommand for each installer type
- selectPreferredInstallSpec with configurable priority
- installSkill main function with timeout support
- Download support with archive extraction (tar.gz, zip)
- getInstallOptions for UI listing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:15:41 +08:00
Jiang Bohan
6d0ee87fdf test(skills): update eligibility tests for new context-based API
- Update checkEligibility calls to use EligibilityContext object
- Add tests for new features: anyBins, always flag, config disabled
- Add tests for bundled allowlist filtering
- Add tests for env var injection via config
- Add tests for apiKey + primaryEnv combination
- Add tests for new requires.bins/env format alongside legacy format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:01:50 +08:00
Jiang Bohan
3d2e539127 feat(agent): integrate skills config into AgentOptions
- Add skills?: SkillsConfig to AgentOptions
- Update runner.ts to pass skills config to SkillManager
- Merge extraSkillDirs from options with config.load.extraDirs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:01:44 +08:00
Jiang Bohan
00915d7fb9 feat(skills): enhance metadata and config system for OpenClaw compatibility
- Add SkillInstallSpec type for future install mechanism support
- Add SkillRequirements type with bins, anyBins, env, config checks
- Add SkillConfig, SkillsConfig types for per-skill and global config
- Add utility functions: getSkillKey, getSkillConfig, normalizeRequirements
- Support both new (requires.bins, os) and legacy (requiresBinaries, platforms) fields
- Implement 'always' flag to skip eligibility checks
- Implement bundled skills allowlist filtering
- Implement config-based skill enable/disable
- Implement env var injection via config (apiKey + primaryEnv)
- Add listAllSkillsWithStatus() method to SkillManager
- Export new types and utility functions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:01:35 +08:00
Jiayuan
75fba044bd
Merge pull request #30 from multica-ai/forrestchang/add-unit-tests
test: add comprehensive unit tests across the codebase
2026-01-30 14:13:10 +08:00
LinYushen
0bc5380765
Merge pull request #29 from multica-ai/agent-api-key-baseurl
feat(agent): add LLM provider config and Hub agent persistence
2026-01-30 14:08:26 +08:00
yushen
e5feb96b0b Merge remote-tracking branch 'origin/main' into agent-api-key-baseurl
# Conflicts:
#	src/shared/index.ts
2026-01-30 14:06:36 +08:00
Jiayuan
f6360c32d9 test(ssrf): expand SSRF test coverage
Add tests for createPinnedLookup, resolvePinnedHostname,
createPinnedDispatcher, and closeDispatcher functions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:01:00 +08:00
Jiayuan
44d0cef838 test(tools): add unit tests for glob and param-helpers
Add tests for:
- Glob tool pattern matching, limits, and ignore patterns
- Parameter helpers for string/number parsing and JSON results

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:00:53 +08:00
Jiayuan
5353161b1d test(skills): add unit tests for skills loader
Add tests for getProfileSkillsDir, getBundledSkillsDir, and loadAllSkills
with skill precedence, invalid files, and directory discovery.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:00:47 +08:00
Jiayuan
0f8d032b68 test(context): add unit tests for context window guard
Add tests for resolveContextWindowInfo, evaluateContextWindowGuard,
and checkContextWindow functions with various threshold scenarios.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:00:38 +08:00
yushen
c6d0476679 feat(hub): persist agent list to disk for restart recovery
Store agent records in ~/.super-multica/agents/agents.json.
Hub restores agents on startup and updates the file on create/delete.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:56:19 +08:00
Jiayuan
4201095519 test(profile): add unit tests for profile storage
Add tests for profile file storage operations including read,
write, load, and save functionality with temp directory isolation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:55:03 +08:00
Jiayuan
9345128367 test(context): add unit tests for token estimation and compaction
Add tests for:
- Token estimation and usage calculation
- Token-aware message compaction
- Count and token-based compaction strategies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:54:57 +08:00
Jiayuan
de8ff730fb test(skills): add unit tests for parser and eligibility checker
Add tests for:
- YAML frontmatter parsing from SKILL.md files
- Skill eligibility checking (platform, binary, env requirements)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:54:50 +08:00
Jiayuan
9f5424eb5c test(web): add unit tests for SSRF, cache, and HTML utilities
Add comprehensive tests for:
- SSRF protection (isPrivateIpAddress, isBlockedHostname)
- Cache utilities (readCache, writeCache, TTL handling)
- HTML utilities (htmlToMarkdownSimple, markdownToText, truncateText)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:54:44 +08:00
Jiayuan
7215a15e37 chore: set up Vitest testing framework
Add Vitest and @vitest/coverage-v8 for unit testing. Configure
test scripts and add coverage directory to gitignore.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:54:34 +08:00
Jiayuan
a86774e7b5
chore(ci): add GitHub Actions workflow (#28) 2026-01-30 13:51:05 +08:00
Jiayuan
f74ac430a9
feat(shared): add error handling infrastructure (#27)
- Add JakartaError base class with error codes and retry semantics
- Add typed error classes for network, session, compaction, process, channel, and gateway errors
- Add withRetry utility with exponential backoff, jitter, and abort support
- Add CancellationToken with hierarchical parent-child cancellation support

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:50:49 +08:00
yushen
36e9acb35f refactor(shared): extract DATA_DIR constant to shared/paths.ts
Replace hardcoded ~/.super-multica paths across agent and hub modules
with a single DATA_DIR constant exported from shared.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:49:35 +08:00
yushen
98f3f7ed50 chore(agent): remove --env-file from agent:cli script
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:49:28 +08:00
yushen
a9dcde124b docs: add .env.example and environment configuration guide
- Add .env.example with all supported provider env vars
  (OpenAI, Anthropic, DeepSeek, Kimi, Groq, Mistral, Together, Google)
- Update README with environment setup instructions
- Document configuration priority and startup commands
- Whitelist .env.example in .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:32:01 +08:00
yushen
0d1f48cf53 refactor(agent): rename env vars to LLM_PROVIDER and provider-specific MODEL
- AGENT_PROVIDER → LLM_PROVIDER
- AGENT_MODEL → provider-specific env vars (e.g., OPENAI_MODEL, DEEPSEEK_MODEL)
- Add resolveModelId function matching resolveApiKey/resolveBaseUrl pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:20:20 +08:00
yushen
236863acd4 feat(agent): support AGENT_PROVIDER and AGENT_MODEL env vars
Add environment variable support for provider/model defaults:
- AGENT_PROVIDER: default LLM provider (fallback: kimi-coding)
- AGENT_MODEL: default model name
- Auto-load .env via tsx --env-file in agent:cli script

Priority: CLI args > env vars > session meta > defaults.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:15:11 +08:00
yushen
9858576abe feat(agent): support custom API key and base URL configuration
Add apiKey and baseUrl options to AgentOptions, with support for:
- Explicit values via CLI args (--api-key, --base-url)
- Provider-specific environment variables (e.g., OPENAI_BASE_URL)
- Generic fallback format (PROVIDER_BASE_URL)

Priority: CLI args > env vars > library defaults.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:12:24 +08:00
LinYushen
6f8c9ef383
Merge pull request #26 from multica-ai/view-recent-commits
feat(agent): add SyncAgent/AsyncAgent wrappers and integrate with Hub
2026-01-30 12:51:08 +08:00
yushen
0212b02f4e Merge remote-tracking branch 'origin/main' into view-recent-commits
# Conflicts:
#	.gitignore
2026-01-30 12:50:20 +08:00
yushen
e0615dbe69 chore: add .env to gitignore
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 12:48:22 +08:00
yushen
49540e63e7 refactor(hub): replace mock Agent with AsyncAgent
Hub now uses AsyncAgent from src/agent/ instead of its own Agent
implementation. Deleted hub/agent.ts and hub/channel.ts as they
are no longer needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:58:21 +08:00
yushen
da80ba1cb0 refactor(agent): simplify AsyncAgent to use result.text instead of stream interception
Replace stdout/stderr stream interception with direct result.text push
to Channel. Also fix queued tasks still executing after close().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:52:01 +08:00
yushen
6e82219630 feat(agent): add SyncAgent and AsyncAgent wrapper classes
Introduce two wrapper classes around the core Agent:
- SyncAgent: exposes run() for synchronous request-response usage
- AsyncAgent: exposes write()/read()/close() for non-blocking streaming via Channel

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:37:09 +08:00
Naiyuan Qing
438b1bd8d1
Merge pull request #25 from multica-ai/feat/extract-packages-ui
feat: extract shared packages (ui, store) and scaffold desktop app
2026-01-30 11:35:20 +08:00
Naiyuan Qing
6cc3a375e7 chore(desktop): clean up build artifacts and unused code
- Add dist-electron and release to .gitignore
- Remove tracked dist-electron build outputs from git
- Remove unused createRequire import in electron/main.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:09 +08:00
Naiyuan Qing
d7d2861a79 feat(store): add shared Zustand store package with counter example
- Create packages/store with @multica/store package
- Add zustand to pnpm catalog for version consistency
- Add counter store as cross-platform state example
- Integrate counter into ComponentExample for verification
- Add tsconfig path mappings for web and desktop
- Add @multica/store to Next.js transpilePackages
- Add @multica/store dependency to packages/ui

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:09 +08:00
Naiyuan Qing
eb5c388a80 refactor(ui): reorganize components into ui/ subdirectory and share layout
- Move shadcn components from src/components/ to src/components/ui/
- Move component-example and example from apps/web to packages/ui
- Update package.json exports with separate components/* and components/ui/* paths
- Update components.json ui alias in both packages/ui and apps/web
- Add missing @import "shadcn/tailwind.css" to globals.css
- Add new UI components: sheet, sidebar, skeleton, switch
- Update apps/web and apps/desktop to use shared ComponentExample

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:09 +08:00
Naiyuan Qing
141af9e9f1 feat(desktop): integrate @multica/ui shared components
Add @multica/ui workspace dependency with @tailwindcss/vite plugin
for CSS processing. Import globals.css for theme and replace template
UI with shared Button component. Remove unused template CSS files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:09 +08:00
Naiyuan Qing
6431829b0c chore: unify shared deps with pnpm catalogs
Add catalog section to pnpm-workspace.yaml for react, react-dom,
@types/react, @types/react-dom, @types/node, and typescript.
Update all package.json files to use catalog: protocol.
Upgrade desktop from React 18 to 19. Rename to @multica/desktop.
Add dev:desktop script to root.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:09 +08:00
Naiyuan Qing
ff026b122d feat(desktop): scaffold Electron app with Vite
Add initial Electron desktop app using vite-plugin-electron template
with React and TypeScript.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:09 +08:00
Naiyuan Qing
663a9ec2a7 chore: update lockfile for packages/ui dependencies
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:05 +08:00
Naiyuan Qing
ae2a28037b chore: update .gitignore for monorepo build outputs
Add rules for .next, .turbo, build, tsbuildinfo, env files, and
platform-specific binaries (dmg, app, apk, ipa).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:05 +08:00
Naiyuan Qing
5c240ab363 refactor(web): update imports to use @multica/ui package
Replace local UI component and utility imports with @multica/ui
subpath imports. Remove old components/ui/ directory, lib/utils.ts,
and globals.css. Configure postcss, next.config, and tsconfig for
monorepo UI package consumption.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:05 +08:00
Naiyuan Qing
c1129ff37d feat(ui): extract components, utils, and styles from apps/web
Move 13 shadcn UI components, cn() utility, and theme CSS variables
to packages/ui for cross-platform reuse. Add @source directives for
Tailwind v4 content scanning.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:05 +08:00
Naiyuan Qing
e1443720eb feat(ui): create @multica/ui package skeleton
Shared UI package for web, electron, and mobile. Uses subpath exports
following the official shadcn monorepo template pattern.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:34:05 +08:00
LinYushen
1bf2b47fca
Merge pull request #24 from multica-ai/ldnvnbl/hub-gateway-config
Add gateway URL configuration to Hub Console
2026-01-30 11:01:39 +08:00
yushen
6deac2f76a Add gateway URL configuration to Hub Console
Allow changing the gateway connection URL at runtime via a new
PUT /hub/gateway endpoint and a corresponding input form in the
console UI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:01:06 +08:00