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 UUIDv7 session ID examples and continuation workflow
- Add new Sessions section documenting storage format
- Add --thinking CLI option example
- Document process tool output buffering and auto-cleanup
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Document agent profile system and profile CLI commands
- Document exec and process tools with usage examples
- Update project structure to reflect new directories
Co-Authored-By: Claude Opus 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>
- Add pnpm workspace and Turborepo configuration
- Extract Gateway SDK to packages/sdk as independent package
- Add Next.js + shadcn Web client in apps/web
- Update root package.json with turbo scripts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement Hub that auto-connects to Gateway, manages agents via REST API,
and routes WebSocket messages to agents by payload.agentId with echo responses
sent back to the original sender.
- Add Hub with GatewayClient auto-connect, agent CRUD, and message routing
- Add Console (NestJS) with REST API and static pages (management + demo client)
- Switch Gateway registration from explicit event to query-based on connect
- Remove deprecated types (RegisterPayload, metadata, SendMessagePayload)
- Add @nestjs/serve-static for serving console UI
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Dockerfile and build script for Gateway containerization
- Add USAGE.md documenting SDK usage for Client/Agent implementations
- Move socket.io-client to production dependencies (required by SDK)
- Remove redundant timestamp field from RoutedMessage (UUID v7 contains timestamp)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>