Commit graph

1581 commits

Author SHA1 Message Date
Jiayuan
e2e8cc15d6
docs: add CLAUDE.md with atomic commits instructions (#16) 2026-01-30 04:05:05 +08:00
Jiayuan
3a435aac8a
docs: translate comments from Chinese to English (#15)
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>
2026-01-30 04:01:14 +08:00
Jiayuan
67cd46a072
feat(agent): add context window management with token-aware compaction (#14)
* 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>
2026-01-30 03:46:11 +08:00
Jiayuan
3024e89071
Merge pull request #13 from multica-ai/forrestchang/interactive-cli
feat(agent): add interactive CLI for agent interaction
2026-01-30 03:31:09 +08:00
Jiayuan
14d22640e3 feat(agent): add interactive CLI for agent interaction
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>
2026-01-30 03:29:45 +08:00
Jiayuan
dc1fba6a9b
Merge pull request #12 from multica-ai/forrestchang/agent-arch-review
feat(agent): implement agent profile system
2026-01-30 03:15:57 +08:00
Jiayuan
c8cb7c1a5a docs: enhance README with session management details
- 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>
2026-01-30 03:12:57 +08:00
Jiayuan
6e8307e09b docs: update README with profile system and tools documentation
- 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>
2026-01-30 03:11:29 +08:00
Jiayuan
99473af854 fix(agent): prevent memory leak and buffer overflow in process tool
- 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>
2026-01-30 03:08:24 +08:00
Jiayuan
200b2cefda feat(agent): add profile system and improve tools
- 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>
2026-01-30 02:47:30 +08:00
Jiayuan
46a6cb3061
Merge pull request #10 from multica-ai/feat/exec-process-tools
feat(agent): add exec/process tools
2026-01-30 01:54:00 +08:00
Jiayuan
1097ef5144 feat(agent): add exec/process tools 2026-01-30 01:52:10 +08:00
Jiayuan
3e7fa97296 chore(agent): drop bash tool alias 2026-01-30 01:51:29 +08:00
Jiayuan
307e7fa8ee
Merge pull request #9 from multica-ai/refactor/agent-structure
Refactor/agent structure
2026-01-30 01:40:01 +08:00
Jiayuan
c189eb7188
Merge pull request #7 from multica-ai/feat/session-persistence
feat(agent): session persistence
2026-01-30 01:34:46 +08:00
Jiayuan
674a88c61e docs: add agent CLI usage 2026-01-30 01:33:08 +08:00
Jiayuan
49122e252b feat(agent): add session persistence and compaction 2026-01-30 01:29:21 +08:00
Jiayuan
dd0fd2fd3b
Merge pull request #6 from multica-ai/refactor/agent-structure
refactor(agent): split runner/tools/output
2026-01-30 01:15:31 +08:00
Jiayuan
5fdae53687 refactor(agent): split runner, tools, output, types 2026-01-30 01:12:48 +08:00
Jiayuan
c0e3dabf25
Merge pull request #5 from multica-ai/feat/agent-cli
feat(agent): integrate pi-agent core and add test CLI
2026-01-30 01:06:39 +08:00
Jiayuan
8c2b6563d2 feat(agent): add pi-agent core integration and test CLI 2026-01-30 01:04:39 +08:00
Naiyuan Qing
f7d03aa427
Merge pull request #4 from multica-ai/naiyuan/monorepo-setup
Add monorepo setup with Turborepo and Web client
2026-01-29 17:34:39 +08:00
Naiyuan Qing
84fe9d99f5 Add monorepo setup with Turborepo and Web client
- 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>
2026-01-29 16:33:35 +08:00
LinYushen
4a7d0faa31
Merge pull request #3 from multica-ai/ldnvnbl/hub-agent-mgmt
Add Hub Console with agent management and message routing
2026-01-29 16:15:05 +08:00
yushen
dcca9333ab Add Hub Console with agent management and message routing
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>
2026-01-29 16:14:29 +08:00
LinYushen
4b3592b5e4
Merge pull request #2 from multica-ai/ldnvnbl/gateway-docker
Add Docker support for Gateway
2026-01-28 17:57:09 +08:00
yushen
2ea7938444 Add Docker support for Gateway and SDK documentation
- 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>
2026-01-28 17:56:22 +08:00
LinYushen
279d94b69d
Merge pull request #1 from multica-ai/ldnvnbl/ts-gateway-research
Implement WebSocket Gateway with NestJS and client SDK
2026-01-28 16:47:53 +08:00
yushen
7d94b40a11 Implement WebSocket Gateway with NestJS and client SDK
- Add NestJS WebSocket Gateway with Socket.IO for real-time communication
- Create client SDK (GatewayClient) supporting both browser and Node.js
- Implement device registration and point-to-point message routing
- Add action types: request/response (RPC), stream (for chat messages)
- Integrate Pino logger for structured logging
- Configure heartbeat detection (pingInterval/pingTimeout)
- Use UUID v7 for time-ordered message IDs

Gateway features:
- Device registration with deviceId and deviceType (client/agent)
- Message routing between devices via Gateway
- HTTP API endpoints (/ping, /broadcast)
- Auto-reconnect support in client SDK

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:46:51 +08:00
yushen
b36769f913 Add README with project overview
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:09:37 +08:00
yushen
6b34ddc3dc Initial project setup with multi-component architecture
- Initialize TypeScript project with pnpm
- Create agent, gateway, client, and shared modules
- Configure ESM with strict TypeScript settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:08:34 +08:00