Add invocation capabilities to SkillManager:
- getSkillCommands: get user-invocable skill command specs
- resolveCommand: match user input to skill invocation
- getCompletions: get tab completions for command prefix
- buildModelSkillsPrompt: build prompt excluding user-only skills
Export invoke module functions for external use.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement skill command invocation system:
- resolveInvocationPolicy: get skill's invocation settings
- isUserInvocable/isModelInvocable: check invocation eligibility
- sanitizeCommandName: normalize skill names for commands
- buildSkillCommands: generate command specs from skills
- findSkillCommand: match command by name or skill ID
- resolveSkillInvocation: parse user input to skill invocation
- getCommandCompletions: tab completion for skill commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add managed skills directory (~/.super-multica/skills/) to loader
- Change discoverSkillDirs to recursively scan up to 3 levels deep
- Skip hidden directories during scan
- Fixes skills installed via `skills add` not being discovered
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
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>
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>
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>
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>
- 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>
- 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>
- 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>
Add tests for createPinnedLookup, resolvePinnedHostname,
createPinnedDispatcher, and closeDispatcher functions.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
Add tests for resolveContextWindowInfo, evaluateContextWindowGuard,
and checkContextWindow functions with various threshold scenarios.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
Add documentation for web_fetch and web_search tools to the default
agent profile templates. Also adds additional options info for glob
and usage guidelines for the web tools.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* chore(deps): add yaml package for skill parsing
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(agent): add skills system
Implement a skills system inspired by moltbot's approach:
- Skills are markdown files (SKILL.md) with YAML frontmatter
- Multi-source loading with precedence: bundled < user < workspace
- Eligibility filtering based on platform, binaries, and env vars
- Skills are automatically included in agent system prompt
- New AgentOptions: enableSkills, skillsBaseDir, extraSkillDirs
Includes two bundled skills:
- commit: Git commit helper with conventional commit guidelines
- code-review: Code review checklist and best practices
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(skills): use profile-based skills instead of workspace
Change skill loading from workspace-based (.skills/) to profile-based:
- Skills now load from ~/.super-multica/agent-profiles/<profileId>/skills/
- Remove workspace and user skill sources
- Simplify to only bundled and profile sources
- Profile skills have higher precedence than bundled
This is more appropriate for non-coding agents where skills are
associated with agent identity rather than working directory.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* chore(deps): add web tools dependencies
Add undici, @mozilla/readability, linkedom, and turndown for
web fetching and HTML content extraction capabilities.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(agent): add web_fetch and web_search tools
Port network tools from moltbot with the following features:
web_fetch:
- Fetch and extract readable content from URLs
- Dual extraction mode: readability (smart) or turndown (full page)
- SSRF protection (blocks private IPs, localhost)
- Response caching with TTL
- Redirect handling
web_search:
- Brave Search API for traditional results
- Perplexity API for AI-synthesized answers
- Region/language settings
- Freshness filtering (Brave only)
- Auto-detects provider from available API keys
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(agent): register web_fetch and web_search tools
Add web tools to the agent's tool registry.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add documentation for glob tool, exec auto-backgrounding, and process
actions. Reorganize into File Operations and Command Execution sections
with usage guidelines.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add a glob tool that allows agents to find files matching glob patterns.
Features:
- Supports standard glob patterns (e.g., **/*.ts, src/**/*.{js,jsx})
- Results sorted by modification time (most recent first)
- Configurable result limit and ignore patterns
- Default ignores for node_modules, .git, dist, etc.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat(agent): add auto-backgrounding to exec tool
- Add yieldMs parameter to exec tool (default 5s) - commands that don't
complete within this time automatically run in background
- Create shared process-registry.ts for unified process management
- Refactor process.ts to use shared registry
- Add --debug CLI flag for session message logging
- Signal isolation: backgrounded processes ignore abort signals
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(session): preserve tool_use/tool_result pairs during compaction
Previously, session compaction simply kept the last N messages, which
could break tool_use/tool_result pairs if the cut point fell between
them. This caused "tool_call_id is not found" errors from the API.
Now compaction finds a safe cut point that starts from either:
- A user message without tool_result
- An assistant message whose tool_use is needed by the next tool_result
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(session): use Kimi as default model for summary compaction
- Auto-detect MOONSHOT_API_KEY from environment
- Use moonshot-v1-128k (cheaper than k2-thinking)
- Fall back to tokens mode if API key not available
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add rule to never use git commit --amend
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: clarify git amend rule for immediate fixes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Translate all comments, JSDoc strings, and documentation text from Chinese to English across 19 files for improved accessibility and consistency with the broader developer community.
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
* feat(agent): add context window guard to prevent token overflow
Implement token-aware context management that validates context window
size on agent initialization and provides intelligent message compaction
based on actual token usage rather than simple message count.
Key changes:
- Add context-window module with guard, token estimation, and types
- Support both "count" (legacy) and "tokens" (new default) compaction modes
- Warn when context window < 32K tokens, block when < 16K tokens
- Trigger compaction at 80% utilization, target 50% after compaction
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(agent): add summary-based compaction using LLM
Implement intelligent compaction that uses LLM to generate summaries
of older messages instead of simply truncating them. This preserves
important context like key decisions, TODOs, and technical details.
Key changes:
- Add summarization.ts with compactMessagesWithSummary functions
- Support chunked summarization for very large histories
- Add "summary" compaction mode alongside "count" and "tokens"
- Auto-resolve API key from environment based on provider
- Graceful fallback to "tokens" mode if model/apiKey unavailable
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Introduce a new interactive CLI that provides a REPL interface for continuous conversation with the agent. Features include multi-line input mode, session management, built-in commands, and streaming output integration with existing agent infrastructure.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add TTL-based auto-cleanup for terminated processes (1 hour)
- Add 'cleanup' action for manual removal of terminated processes
- Fix buffer overflow when single chunk exceeds MAX_OUTPUT_BUFFER
- Track terminatedAt timestamp for cleanup eligibility
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Agent Profile module for managing agent identity, soul, tools,
memory, and bootstrap configuration
- Add profile CLI (pnpm agent:profile) for creating/listing/showing profiles
- Default sessionId to UUIDv7 instead of "default"
- Expose Agent.sessionId as public readonly property
- Improve exec/process tools error handling (no more crashes on spawn errors)
- Add 'output' action to process tool for reading stdout/stderr
- Better tool descriptions to guide agent in choosing exec vs process
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>