Commit Graph

59 Commits

Author SHA1 Message Date
Henry Li
c66995bcc0 Merge pull request #16 from amszuidas/experimental
fix: refactor env var resolution to support complex structures and fix in-place mutation bug
2026-01-24 10:14:20 +08:00
Henry Li
9498e783f1 Merge pull request #17 from amszuidas/fix/tavily-api-key-config
fix: support loading tavily ak from config.yaml
2026-01-24 10:14:04 +08:00
amszuidas
c1c8942491 fix: support loading tavily ak from config.yaml 2026-01-23 23:50:40 +08:00
amszuidas
761cb6a7f5 fix: use return value of resolve_env_variables in config loading 2026-01-23 21:51:48 +08:00
hetao
1fe37fdb6c feat: implement file upload feature 2026-01-23 18:47:39 +08:00
amszuidas
2ef320f107 fix: correct spelling 2026-01-23 18:29:20 +08:00
amszuidas
303e0252ce fix: robust environment variable resolution in config 2026-01-23 17:01:38 +08:00
hetao
2fac72601e feat: add unified development environment with nginx proxy
Add a root-level Makefile to manage frontend, backend, and nginx services:
- `make check` validates required dependencies (Node.js 22+, pnpm, uv, nginx)
- `make install` installs all project dependencies
- `make dev` starts all services with unified port 2026
- `make stop` and `make clean` for cleanup

Update nginx configuration:
- Change port from 8000 to 2026
- Add frontend upstream and routing (port 3000)
- Add /api/langgraph/* routing with path rewriting to LangGraph server
- Keep other /api/* routes to Gateway API
- Route non-API requests to frontend

Update frontend configuration:
- Use relative URLs through nginx proxy by default
- Support environment variables for direct backend access
- Construct full URL for LangGraph SDK compatibility

Clean up backend Makefile by removing nginx and serve targets.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-22 12:00:46 +08:00
hetao
50c25f5c4d fix: fix nginx conf 2026-01-22 12:00:46 +08:00
hetao
87752cafac feat: add SSE and HTTP transport support for MCP servers
- Add type, url, and headers fields to MCP server config
- Update MCP client to handle stdio, sse, and http transports
- Add todos field to ThreadState
- Add Deerflow branding requirement to frontend-design skill
- Update extensions_config.example.json with SSE/HTTP examples

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 16:14:00 +08:00
hetaoBackend
7ead7c93f8 feat: integrate todo middleware 2026-01-20 22:38:04 +08:00
hetaoBackend
c5a2771636 fix: fix sandbox cp issue 2026-01-20 22:08:36 +08:00
hetaoBackend
e58e5f1904 fix: fix skill md path 2026-01-20 21:10:05 +08:00
hetaoBackend
2d931105d5 feat: enable public skills by default 2026-01-20 20:37:51 +08:00
hetaoBackend
66df9b5927 feat: add skills api 2026-01-20 13:57:36 +08:00
hetaoBackend
411d9d57c3 feat: add MCP API endpoint and enhance API documentation
Add new MCP configuration management endpoint and enhance API documentation
with detailed descriptions, examples, and OpenAPI support for better
developer experience.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-20 13:20:50 +08:00
hetaoBackend
5c1bb675ba fix: fix backend 2026-01-20 09:58:27 +08:00
DanielWalnut
7978e05dc1 feat: add nginx reversed proxy (#15)
* docs: add nginx reverse proxy documentation

Add comprehensive nginx configuration documentation to README including:
- Production deployment instructions with step-by-step setup
- Architecture diagram showing traffic routing between services
- Nginx features: unified entry point, CORS handling, SSE support
- Updated project structure with nginx.conf and service ports

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: implement nginx

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-19 23:23:38 +08:00
hetaoBackend
a6fcdbf50a fix: fix proxy 2026-01-19 21:36:35 +08:00
hetaoBackend
74d4a16492 feat: add MCP (Model Context Protocol) support
Add comprehensive MCP integration using langchain-mcp-adapters to enable
pluggable external tools from MCP servers.

Features:
- MCP server configuration via mcp_config.json
- Automatic lazy initialization for seamless use in both FastAPI and LangGraph Studio
- Support for multiple MCP servers (filesystem, postgres, github, brave-search, etc.)
- Environment variable resolution in configuration
- Tool caching mechanism for optimal performance
- Complete documentation and setup guide

Implementation:
- Add src/mcp module with client, tools, and cache components
- Integrate MCP config loading in AppConfig
- Update tool system to include MCP tools automatically
- Add eager initialization in FastAPI lifespan handler
- Add lazy initialization fallback for LangGraph Studio

Dependencies:
- Add langchain-mcp-adapters>=0.1.0

Documentation:
- Add MCP_SETUP.md with comprehensive setup guide
- Update CLAUDE.md with MCP system architecture
- Update config.example.yaml with MCP configuration notes
- Update README.md with MCP setup instructions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-19 18:58:13 +08:00
hetaoBackend
ffb9ed3198 fix: use shared httpx client to prevent premature closure in SSE streaming
The proxy was creating a temporary httpx.AsyncClient within an async context manager.
When returning StreamingResponse for SSE endpoints, the client was being closed before
the streaming generator could use it, causing "client has been closed" errors.

This change introduces a shared httpx.AsyncClient that persists for the application
lifecycle, properly cleaned up during shutdown. This also improves performance by
reusing TCP connections across requests.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-19 16:52:30 +08:00
hetaoBackend
3a4149c437 fix: stop tracking .claude/settings.local.json
Remove .claude/settings.local.json from git tracking and add it to .gitignore to prevent future accidental commits of local settings.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-19 16:28:03 +08:00
DanielWalnut
f0a2381bd5 feat: implement summarization (#14) 2026-01-19 16:17:31 +08:00
DanielWalnut
e1a8d544b6 feat: add clarification feature (#13) 2026-01-18 19:55:36 +08:00
DanielWalnut
6f97dde5d1 fix: Long thinking but with empty content (#12) 2026-01-18 14:21:40 +08:00
DanielWalnut
5f4c58aa82 feat: implement lazy sandbox and thread data initialization (#11)
Defer sandbox acquisition and thread directory creation until first use to improve performance and reduce resource usage.

Changes:
- Add lazy_init parameter to SandboxMiddleware (default: true)
- Add ensure_sandbox_initialized() helper for lazy sandbox acquisition
- Update all sandbox tools to use lazy initialization
- Add lazy_init parameter to ThreadDataMiddleware (default: true)
- Create thread directories on-demand in AioSandboxProvider
- LocalSandbox already creates directories on write (no changes needed)

Benefits:
- Saves 1-2s Docker container startup for conversations without tools
- Reduces unnecessary directory creation and file system operations
- Backward compatible with lazy_init=false option

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 13:38:34 +08:00
DanielWalnut
5a0912d0fd fix: fix backend python execution (#10) 2026-01-18 12:41:48 +08:00
DanielWalnut
3261273ee3 feat: fix todos (#9) 2026-01-17 23:23:12 +08:00
Henry Li
d603771291 chore: add TODO for checking duplicate files in state.artifacts 2026-01-17 16:25:51 +08:00
Henry Li
1d3b3e8eb8 dos: update backend TODOs 2026-01-17 16:17:59 +08:00
Henry Li
0c6f8353bf feat: support artifact preview 2026-01-17 15:09:44 +08:00
DanielWalnut
d5b3052cda feat: add artifacts logic (#8) 2026-01-16 23:04:38 +08:00
DanielWalnut
50a1e407cf feat: add thread-safety and graceful shutdown to AioSandboxProvider (#7)
Add thread-safe port allocation and proper cleanup on process exit to
prevent port conflicts in concurrent environments and ensure containers
are stopped when the application terminates.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 22:28:19 +08:00
Henry Li
d2845f658f docs: rewording 2026-01-16 22:10:08 +08:00
Henry Li
56b26c060e feat: add present_file tool 2026-01-16 21:48:00 +08:00
DanielWalnut
cfa97f7a96 feat: add skills system for specialized agent workflows (#6)
Implement a skills framework that enables specialized workflows for
specific tasks (e.g., PDF processing, web page generation). Skills are
discovered from the skills/ directory and automatically mounted in
sandboxes with path mapping support.

- Add SkillsConfig for configuring skills path and container mount point
- Implement dynamic skill loading from SKILL.md files with YAML frontmatter
- Add path mapping in LocalSandbox to translate container paths to local paths
- Mount skills directory in AIO Docker sandbox containers
- Update lead agent prompt to dynamically inject available skills
- Add setup documentation and expand config.example.yaml

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:44:51 +08:00
DanielWalnut
fb92a472e2 feat: add gateway module with FastAPI server (#5)
* chore: add .claude/ to .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add gateway module with FastAPI server

- Add new gateway module with FastAPI app for API routing
- Add gateway and serve commands to Makefile
- Add fastapi, httpx, uvicorn, sse-starlette dependencies
- Fix model config retrieval in lead_agent (support both model_name and model)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 13:22:26 +08:00
DanielWalnut
c7d68c6d3f feat: support function factory (#4) 2026-01-15 22:05:54 +08:00
DanielWalnut
3b879e277e fix: fix local path for local sandbox (#3) 2026-01-15 14:37:00 +08:00
DanielWalnut
41442ccc2f feat: add thread data middleware (#2) 2026-01-15 13:22:30 +08:00
DanielWalnut
b2abfecf67 feat: add AIO sandbox provider and auto title generation (#1)
- Add AioSandboxProvider for Docker-based sandbox execution with
  configurable container lifecycle, volume mounts, and port management
- Add TitleMiddleware to auto-generate thread titles after first
  user-assistant exchange using LLM
- Add Claude Code documentation (CLAUDE.md, AGENTS.md)
- Extend SandboxConfig with Docker-specific options (image, port, mounts)
- Fix hardcoded mount path to use expanduser
- Add agent-sandbox and dotenv dependencies

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 23:29:18 +08:00
Henry Li
de2d18561a feat: integrated with sandbox 2026-01-14 12:32:34 +08:00
Henry Li
c1e9340062 chore: use .env 2026-01-14 12:32:15 +08:00
Henry Li
ce0b6f7754 chore: specify project title 2026-01-14 09:57:52 +08:00
Henry Li
5d6a7442d6 chore: remove tests 2026-01-14 09:52:34 +08:00
Henry Li
2aeaf7c965 style: format 2026-01-14 09:21:19 +08:00
Henry Li
421488a991 chore: add lint and format 2026-01-14 09:20:05 +08:00
Henry Li
e5c69cb7ee docs: update tool docs 2026-01-14 09:12:03 +08:00
Henry Li
cb611f9270 chore: use ruff to lint and auto-format 2026-01-14 09:08:20 +08:00
Henry Li
7dc063ba25 feat: add agents 2026-01-14 07:20:00 +08:00