Handle undefined values correctly in optional object properties
for TypeScript strict mode compatibility.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add --tools-profile, --tools-allow, and --tools-deny CLI options
to configure tool policy from command line.
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>
* 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>
- 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>