Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5b6bbea
fix(轮次1): 修复 datetime.utcnow deprecation 警告 + pytest 收集警告
afine907 May 29, 2026
bda7520
test(轮次3): 补充安全模块测试 + 修复 denial.py 缩进 bug
afine907 May 29, 2026
c3ae747
test(轮次5): 补充 MCP 客户端完整测试
afine907 May 29, 2026
963ee1b
test(轮次4-5): 补充内存系统完整测试 + 修复 long_term.py Path bug
afine907 May 29, 2026
c1ab8e6
test(轮次6): 补充内置插件完整测试
afine907 May 29, 2026
66a134d
feat(轮次7): 动态 system prompt - 从工具注册表自动生成
afine907 May 29, 2026
2abccfe
feat(轮次8): 工具调用重试机制 - 指数退避
afine907 May 29, 2026
926038c
feat(轮次9-10): 工具结果大小限制 + 迭代次数可配置
afine907 May 29, 2026
4e5f827
feat(轮次11): grep_search 支持上下文行显示
afine907 May 29, 2026
7445aee
feat(轮次12): read_file 支持行范围读取
afine907 May 29, 2026
82cc14d
feat(轮次13): 增强 health check 端点
afine907 May 29, 2026
2de9fff
feat(轮次14): CLI 添加 --version 参数
afine907 May 29, 2026
6c74ba8
feat(轮次15): thinking_node 添加 LLM 调用错误处理
afine907 May 29, 2026
9854b6f
docs(轮次16): 新增 CHANGELOG.md
afine907 May 29, 2026
e0b38ac
test(轮次17): 补充核心模块测试 + 修复 MockDatabaseBackend
afine907 May 29, 2026
00d4e67
test+fix(轮次18-19): 补充监控和 webhook 测试 + 修复多个 bug
afine907 May 29, 2026
4e8641d
release(轮次20): 版本升级至 0.2.0
afine907 May 29, 2026
a43a205
docs(轮次22): 新增 CONTRIBUTING.md 贡献指南
afine907 May 29, 2026
afa87c3
docs(轮次23): 新增 GitHub Issue 模板
afine907 May 29, 2026
2fd97fe
docs(轮次24): 新增 PR 模板
afine907 May 29, 2026
f75d66b
docs(轮次26): 新增 examples/README.md
afine907 May 29, 2026
c3edc6d
docs(轮次27): 更新 CHANGELOG.md
afine907 May 29, 2026
d13c210
test(轮次29): 新增 context 模块测试目录
afine907 May 29, 2026
3e71ebb
test(轮次30): 补充 CLI 和 context 模块测试
afine907 May 29, 2026
58a3d83
fix(轮次31): 修复所有 ruff lint 错误
afine907 May 29, 2026
3b306a6
test(轮次35-40): 补充 ops 模块测试 + 修复测试目录冲突
afine907 May 29, 2026
d2e8a0f
test(轮次45-50): 补充 skills、task、session、models 测试
afine907 May 29, 2026
547c42f
test(轮次52-55): 补充 MCP、plugin 模块测试
afine907 May 29, 2026
057fd67
test(轮次57-60): 补充 plugin 模块测试
afine907 May 29, 2026
3f084f6
test+fix(轮次62-70): 补充核心模块测试 + 修复多个 bug
afine907 May 29, 2026
d26a21b
test(轮次73-80): 补充安全模块测试
afine907 May 29, 2026
e297f23
test+fix(轮次81-90): 补充 ops 模块测试 + 修复多个 bug
afine907 May 29, 2026
7763a15
test(轮次93-100): 补充 models 和 session 模块测试
afine907 May 29, 2026
20a6a1c
fix(轮次100): 修复最终 lint 错误
afine907 May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 118 additions & 10 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,23 +1,131 @@
# LLM 配置(三选一)
# =============================================================================
# LLM Provider Configuration (choose one)
# =============================================================================

# 方式 1: OpenAI 兼容 API(如 LongCatDeepSeek 等)
# Option 1: OpenAI-Compatible API (LongCat, DeepSeek, etc.)
OPENAI_API_KEY=your-api-key
OPENAI_BASE_URL=https://api.longcat.chat/openai/v1
MODEL=LongCat-Flash-Chat

# 方式 2: Anthropic Claude
# Option 2: Anthropic Claude
# OPENAI_API_KEY=
# ANTHROPIC_API_KEY=your-anthropic-api-key
# MODEL=claude-sonnet-4-20250514

# 方式 3: OpenAI 默认
# Option 3: OpenAI Default
# OPENAI_API_KEY=your-openai-api-key
# OPENAI_BASE_URL=
# MODEL=gpt-4o-mini

# 日志配置
# JOJO_CODE_LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR
# JOJO_CODE_LOG_FILE=server.log # 日志文件路径
# JOJO_CODE_LOG_FORMAT=json # json 或 text
# JOJO_CODE_LOG_MAX_BYTES=10485760 # 单文件最大 10MB
# JOJO_CODE_LOG_BACKUP_COUNT=5 # 保留 5 个备份文件
# =============================================================================
# Server Configuration
# =============================================================================

# Server host and port
JOJO_CODE_HOST=0.0.0.0
JOJO_CODE_PORT=8080

# Enable debug mode (verbose logging, auto-reload)
# JOJO_CODE_DEBUG=false

# CORS allowed origins (comma-separated)
# JOJO_CODE_CORS_ORIGINS=http://localhost:3000,http://localhost:5173

# Rate limiting (requests per minute per IP)
# JOJO_CODE_RATE_LIMIT=60

# Maximum concurrent WebSocket connections
# JOJO_CODE_MAX_CONNECTIONS=100

# =============================================================================
# Logging Configuration
# =============================================================================

# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
# JOJO_CODE_LOG_LEVEL=INFO

# Log file path (empty = stdout only)
# JOJO_CODE_LOG_FILE=server.log

# Log format: json or text
# JOJO_CODE_LOG_FORMAT=json

# Log rotation: max file size in bytes (default 10MB)
# JOJO_CODE_LOG_MAX_BYTES=10485760

# Number of backup log files to keep
# JOJO_CODE_LOG_BACKUP_COUNT=5

# =============================================================================
# Agent Configuration
# =============================================================================

# Maximum iterations per agent session (prevents infinite loops)
# JOJO_CODE_MAX_ITERATIONS=50

# Agent timeout in seconds
# JOJO_CODE_AGENT_TIMEOUT=300

# Enable/disable tool execution (useful for testing)
# JOJO_CODE_ENABLE_TOOLS=true

# Default agent mode: plan or build
# JOJO_CODE_DEFAULT_MODE=build

# =============================================================================
# Security Configuration
# =============================================================================

# Enable audit logging
# JOJO_CODE_AUDIT_ENABLED=true

# Audit log file path
# JOJO_CODE_AUDIT_FILE=audit.log

# Allowed shell commands (comma-separated, empty = all)
# JOJO_CODE_ALLOWED_COMMANDS=git,python,uv

# Blocked shell commands (comma-separated)
# JOJO_CODE_BLOCKED_COMMANDS=rm -rf,sudo

# Enable SSRF protection for web requests
# JOJO_CODE_SSRF_PROTECTION=true

# =============================================================================
# Memory Configuration
# =============================================================================

# Enable conversation memory
# JOJO_CODE_MEMORY_ENABLED=true

# Maximum messages to keep in memory
# JOJO_CODE_MEMORY_MAX_MESSAGES=100

# Token limit for memory compression
# JOJO_CODE_MEMORY_TOKEN_LIMIT=4000

# =============================================================================
# Plugin Configuration
# =============================================================================

# Enable plugin system
# JOJO_CODE_PLUGINS_ENABLED=true

# Plugin directories (comma-separated)
# JOJO_CODE_PLUGIN_DIRS=./plugins,~/.jojo-code/plugins

# Disabled plugins (comma-separated)
# JOJO_CODE_DISABLED_PLUGINS=

# =============================================================================
# Development Configuration
# =============================================================================

# Enable hot reload for development
# JOJO_CODE_HOT_RELOAD=false

# Enable profiling
# JOJO_CODE_PROFILING=false

# Test mode (disables external API calls)
# JOJO_CODE_TEST_MODE=false
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Bug 报告
about: 报告一个 bug 帮助我们改进
title: '[BUG] '
labels: bug
assignees: ''
---

## 描述

简要描述 bug。

## 复现步骤

1. 执行 '...'
2. 输入 '...'
3. 看到 '...'

## 期望行为

描述你期望的正确行为。

## 实际行为

描述实际发生的情况。

## 环境信息

- OS: [e.g., Windows 11, macOS 14, Ubuntu 22.04]
- Python 版本: [e.g., 3.12.0]
- jojo-code 版本: [e.g., 0.2.0]
- 安装方式: [e.g., pip, uv, source]

## 错误日志

```
粘贴相关的错误日志
```

## 补充信息

其他可能有用的信息(截图、配置文件等)。
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: 功能请求
about: 建议一个新功能
title: '[FEATURE] '
labels: enhancement
assignees: ''
---

## 描述

简要描述你想要的功能。

## 使用场景

解释为什么需要这个功能,以及你会如何使用它。

## 建议实现

如果你有想法,描述可能的实现方式。

## 替代方案

描述你目前使用的替代方案(如果有)。

## 补充信息

其他上下文信息。
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 问题咨询
about: 使用中遇到的问题
title: '[QUESTION] '
labels: question
assignees: ''
---

## 问题描述

描述你的问题。

## 已尝试的解决方案

描述你已经尝试过的方法。

## 相关文档

如果有相关的文档或链接,请提供。
33 changes: 33 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## 描述

简要描述此 PR 的变更内容。

## 变更类型

- [ ] Bug 修复
- [ ] 新功能
- [ ] 重构
- [ ] 文档更新
- [ ] 测试
- [ ] 其他

## 相关 Issue

Closes #(issue 编号)

## 测试

- [ ] 已运行 `uv run ruff check src/ tests/`
- [ ] 已运行 `uv run ruff format src/ tests/`
- [ ] 已运行 `uv run pytest tests/ -v`
- [ ] 已添加新功能的测试

## 截图(如适用)

## 检查清单

- [ ] 代码遵循项目风格指南
- [ ] 已添加必要的文档
- [ ] 已添加必要的测试
- [ ] 所有测试通过
- [ ] 已更新 CHANGELOG.md(如适用)
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Dynamic system prompt generation from ToolRegistry
- Tool call retry mechanism with exponential backoff
- Tool result size limiting (50KB max) to prevent context overflow
- Configurable max_iterations in AgentState
- grep_search context_lines parameter for showing surrounding lines
- read_file start_line/end_line parameters for line range reading
- Enhanced health check endpoint with CPU, memory, uptime info
- CLI --version flag
- LLM call error handling in thinking_node
- CONTRIBUTING.md contribution guide
- GitHub Issue templates (bug report, feature request, question)
- PR template
- CHANGELOG.md
- examples/README.md
- Comprehensive test coverage for security modules (ssrf, rule, denial)
- Comprehensive test coverage for memory modules (short_term, long_term, retriever, types)
- Comprehensive test coverage for MCP client
- Comprehensive test coverage for built-in plugins (code_review, test_generator, git)
- Comprehensive test coverage for core modules (database, monitoring, webhook)

### Fixed
- datetime.utcnow() deprecation warning in audit.py
- PytestCollectionWarning for TestCaseEvaluator in evaluator.py
- Indentation bug in denial.py AdaptivePermissionMixin.check_with_denial_tracking
- UnboundLocalError in long_term.py (redundant local Path import)
- MockDatabaseBackend.fetch_one id filtering logic
- AlertManager.check using rule.condition instead of non-existent rule.evaluate
- Webhook.trigger returning results for successful local handlers

### Changed
- System prompt is now dynamically generated from available tools
- Tool execution now supports automatic retry on transient failures

## [0.1.0] - 2026-05-29

### Added
- Initial release
- LangGraph-based agent loop with thinking/execute nodes
- 40+ built-in tools (file, shell, git, search, web, HTTP, code analysis, performance, data, docs, system)
- Textual TUI with chat, header, footer, input area, status bar widgets
- WebSocket (JSON-RPC 2.0) + SSE streaming server
- REST API endpoints for agents, conversations, metrics
- Plugin system with 3 built-in plugins (code_review, git, test_generator)
- Security: permission management, audit logging, SSRF protection, command/path guards
- Memory: conversation memory with token counting and compression
- Short-term and long-term memory with retrieval
- AgentOps: metrics collection, evaluation, dashboard, reporting
- Model abstraction: OpenAI, Anthropic Claude, OpenAI-compatible APIs
- MCP client support
- Skills system
- Task execution framework
- Session persistence
- Docker support (experimental)
- CLI commands: TUI, server management, config, plugin management, setup wizard
Loading
Loading