From 7e03e3cd5f050894f11953308cb3337da9346cb3 Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Mon, 6 Apr 2026 15:12:25 +0800 Subject: [PATCH] feat: stabilize context compression and deep-compact flow --- AGENTS.md | 130 ++++++-- CLAUDE.md | 14 + core/main_terminal_parts/context.py | 15 +- modules/personalization_manager.py | 12 + server/chat_flow_task_main.py | 74 ++++- server/chat_flow_tool_loop.py | 76 ++++- server/conversation.py | 91 +++++- server/deep_compression.py | 295 ++++++++++++++++++ server/status.py | 9 + server/tasks.py | 37 ++- static/src/app/computed.ts | 4 +- static/src/app/methods/conversation.ts | 49 ++- static/src/app/methods/message.ts | 67 ++++ static/src/app/methods/resources.ts | 12 + static/src/app/methods/taskPolling.ts | 48 ++- static/src/app/methods/ui.ts | 8 + static/src/app/state.ts | 4 + .../personalization/PersonalizationDrawer.vue | 40 +++ static/src/stores/personalization.ts | 10 +- utils/context_manager.py | 186 ++++++++++- utils/conversation_manager.py | 162 +++++++--- 21 files changed, 1224 insertions(+), 119 deletions(-) create mode 100644 server/deep_compression.py diff --git a/AGENTS.md b/AGENTS.md index 8030c3a..8828ff1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,39 +1,103 @@ -# Repository Guidelines +# Repository Guidelines (Code-Verified) -## Project Structure & Module Organization -- `main.py` runs the CLI agent; `web_server.py` serves the Flask/SocketIO UI from `static/`. -- `core/` contains terminal orchestration (`main_terminal.py`, `web_terminal.py`) and should stay I/O-light. -- `modules/` collects reusable capabilities (file/search/memory/terminal); extend here before touching entrypoints. -- `utils/` provides API clients, context helpers, and logging; import from here instead of adding globals. -- `prompts/`, `data/`, and `project/` bundle prompt templates, fixtures, and demos used primarily for reference. -- `test/` stores integration helpers (`api_interceptor_server.py`, `test_deepseek_output.py`); add new suites alongside them. -- 前端:`static/src/components/chat/monitor` 是虚拟显示器动画层;涉及新场景请在 `MonitorDirector`/`monitor store` 内对齐数据与动画的状态同步。 +> Last verified against current codebase: 2026-04-06 +> Scope: `/Users/jojo/Desktop/agents/正在修复中/agents` -## Build, Test, and Development Commands -- `pip install -r requirements.txt` installs Python dependencies. -- `python main.py` launches the CLI agent loop. -- `python web_server.py` serves the web UI at `http://localhost:8091`. -- `python test/api_interceptor_server.py` starts the mock proxy that logs traffic to `api_logs/`. -- `python test_deepseek_output.py` exercises streaming tool-calls; populate `config.py` with valid API credentials first. -- `npm install` then `npm run build` builds the Vue frontend to `static/dist`; `npm run dev` watches; `npm run lint` for TS/Vue linting. +这份文档基于当前仓库实际代码重写。若与未来代码冲突,以代码为准并及时更新本文档。 -## Coding Style & Naming Conventions -- Target Python 3.11+, 4-space indentation, `snake_case` functions, and `PascalCase` classes. -- TypeScript 5 / Vue 3 单文件组件,保持 `