From 08b74feec2894874a7e74963871a0e6531a46f19 Mon Sep 17 00:00:00 2001 From: deepagent-ai Date: Mon, 13 Jul 2026 00:06:06 +0800 Subject: [PATCH 1/5] Link DeepAgent Code Enterprise --- README.md | 186 +----------------------------------------------------- 1 file changed, 1 insertion(+), 185 deletions(-) diff --git a/README.md b/README.md index 98d360e1..ed101cc6 100644 --- a/README.md +++ b/README.md @@ -1,186 +1,2 @@ -

- - - - DeepAgent Code logo - -

- -

AI coding agent with persistent memory and control plane

- -

- English | - 简体中文 -

- -

Desktop v1.3

- ---- - -DeepAgent Code is an AI coding agent built on persistent document memory. It keeps [opencode](https://github.com/sst/opencode)'s runtime foundations and adds a control plane so the agent behaves less like a one-shot chat and more like a teammate that remembers your project, sharpens vague asks, and goes deep on hard problems. - -The features below start from a real need — something a plain coding agent, opencode included, leaves on the table — and work down to the architecture we built to serve it. - -## What You Can Do - -### Bring your history over — switch tools without starting from zero - -**The need:** You've built up months of context in another agent — Codex or Claude Code — and switching tools normally means abandoning all of it: the conversations, the accumulated memory, the skills you tuned. That cost alone keeps people on tools they've outgrown. - -**What DeepAgent does:** One-click import of your existing history. Point it at a Codex or Claude Code installation and it hot-imports your chat sessions, memory, and skills straight into DeepAgent — reading each tool's on-disk format, normalizing it, and replaying it into the document graph so imported conversations behave like native ones. Secrets are redacted on the way in, imported projects stay isolated so nothing collides with your active work, and re-running an import converges instead of duplicating. Available from the Settings "Import history" panel, a History view in the sidebar, or the `import-history` CLI command. Migration is a few minutes, not a fresh start. - -### Keep one conversation going indefinitely - -**The need:** Long tasks overflow the context window. Most agents respond by truncating history or summarizing everything at a threshold — so mid-task the agent forgets a decision you made an hour ago, or the window fills with stale tool output and quality falls off a cliff. - -**What DeepAgent does:** Your conversation is treated as a continuously maintained work state, not a growing chat log. Before every turn, the agent rebuilds a working set — the task anchor, the most recent exchanges verbatim, active file references, and only the older facts that are relevant right now — while the full history is archived durably and stays queryable. The working set is held to a hard fraction of the model window, so there's always room for the model to actually think and respond. You just keep talking; the agent keeps focus. - -### Switch windows, fork freely, never lose memory - -**The need:** You want to try two approaches, or hand the work to a fresh conversation, without starting from amnesia and without polluting the original thread. - -**What DeepAgent does:** Fork any conversation from a chosen message. The fork opens carrying the parent's memory up to that point, shows a full-width "derived from" marker at the top of its transcript, and nests folder-style under its origin in the session tree (subagents and forks alike, up to three levels deep). Knowledge flows up a scope hierarchy — what one session learns can be promoted to the whole project, and cross-project preferences live at the user-global layer — so switching windows is a clean handoff, not a reset. - -### Ask roughly, and let the agent sharpen it - -**The need:** A half-formed prompt gets a half-useful answer, and you don't always know how to phrase what you want. - -**What DeepAgent does:** Two scenario modes on the composer. **Direct** sends your prompt as-is — you own the wording. **Intelligence** refines a rough ask into a sharper prompt, surfaces a draft plan and decision suggestions, and waits for your confirmation before it automates anything. You decide how much the agent shapes the request. - -### Choose how much the agent drives — and who writes the plan - -**The need:** Sometimes you want the agent to just take a request and run; sometimes you want to steer it with a plan you control; sometimes you've already written the plan and just want it executed faithfully. - -**What DeepAgent does:** Three collaboration modes on the composer, picked from a single selector. **Auto** — the agent sets the objective, designs and plans as needed, and executes to completion. **Loop** — you describe the goal, the agent writes a `goal+plan.md` you can edit, then a supervised loop drives it to completion (plan → execute → verify per tick, with hard budget/step ceilings and objective completion checks). **Design** — you author `goal+plan.md` yourself and the agent executes your plan faithfully without redefining the goal. Orthogonal to mode, a permission control offers three presets — **Read-only**, **Request approval** (default), **Full access** — so autonomy and approval are separate, explicit choices. - -### Get a second opinion before high-risk decisions - -**The need:** Some decisions — a breaking migration, a security-sensitive change, an architecture call — deserve more than one confident pass agreeing with itself. - -**What DeepAgent does:** Convene an **Expert Panel** from the composer. Differentiated expert lenses (correctness, security, performance, architecture, repro) review the same frozen question independently, debate anonymously, and a deterministic (non-LLM) arbiter aggregates a verdict — with minority opinions preserved and a fail-closed bias toward escalating to you when the panel can't safely agree. - -### Read and govern what the agent knows - -**The need:** Persistent memory is only trustworthy if you can see it and correct it. - -**What DeepAgent does:** A **Repo & Wiki** view projects the four graphs into human-readable pages — browse and full-text-search the agent's knowledge, follow docs↔code cross-links, and edit governable Knowledge/Memory pages through the same evidence-gate the agent uses (Documents and Code stay read-only). A separate governance view lists learned facts grouped by project and global scope, so you approve what becomes durable. - -### Go deep on genuinely hard problems - -**The need:** Complex work — an architecture decision, a tricky migration, a subtle bug — needs more than a single confident pass. It needs research, a second opinion, and someone actively trying to poke holes. - -**What DeepAgent does:** At higher work strengths the primary agent decomposes the task, fans it out to focused subagents that research modules in parallel, synthesizes their findings, and then runs independent reviewers whose job is to *break* the plan rather than agree with it. Fan-out is bounded by a configurable concurrency ceiling, and live subagents surface in a session side panel and inline in the transcript so you can watch and jump into any of them. - -### Chat with your team and your agents in one place - -**The need:** Coordinating with teammates and driving agents usually happens in two different tools. - -**What DeepAgent does:** A per-project group chat lives in the session side panel. @mention an agent as a chat member and it runs the full agent loop — query code, generate, fix — pulling project knowledge and recent messages for context, then replies inline with live progress streaming. - -## How It Works - -Each capability above is served by a control-plane primitive underneath. These are the parts a plain runtime doesn't have. - -**Four-graph unification** — Code, knowledge, project memory, and the document graph are unified into one typed, bidirectionally-linked store. When the agent pulls context, a change to a symbol surfaces the design decisions, past diagnoses, and knowledge actually linked to it — connected context, not four disconnected keyword searches. - -**Domain packs** — 140+ composable knowledge packages spanning languages, frameworks, platforms (cloud, Kubernetes, CI), hardware, and business/risk domains (security, privacy, compliance). Each pack bundles typed documents (strategies, methodologies, knowledge, skills, failure dossiers) with detectors that auto-activate the right packs for your task; conflicts resolve stricter-policy-wins, and the active set is version-locked so a run is reproducible. Core stays domain-neutral — expertise is data on disk, not hardcoded. - -**Tiered knowledge invocation** — A monotonic strength ladder (`general → high → xhigh → max → ultra`) gates how much control-plane machinery engages. `general` stays close to the plain runtime — fast and cheap. Higher rungs progressively unlock durable knowledge, project handoff summaries, heavier strategy/methodology tiers, and multi-agent orchestration. You pay for depth only when you dial it up. - -**Self-learning** — After work lands, the agent proposes candidate knowledge, facts, and methodologies. Promotion is evidence-gated (a test passed, a diagnostic cleared, a validation confirmed) and user-controllable — durable knowledge is carried over deliberately, not silently guessed. Session-stable conclusions consolidate into project memory over time, so the next session starts smarter about *your* codebase. - -## Installation - -```bash -npm install -g deepagent-code -``` - -Then run: - -```bash -deepagent-code -# or use the alias: -deepagent -``` - -## Quick Example - -Start the agent and give it a task: - -```bash -deepagent-code "add rate limiting to /api/users endpoint" -``` - -The agent will: - -1. Use LSP to find the endpoint definition and understand its structure -2. Check project memory for existing middleware patterns -3. Activate the relevant domain packs (backend API, the project's language) -4. Implement rate limiting following project conventions -5. Run tests, capture diagnostics, and propose a candidate memory: "This project uses express-rate-limit middleware" - -On your next session, when you ask to add rate limiting elsewhere, the agent already knows the pattern. - -## Core Concepts - -**Document graph** — All persistent state lives in typed documents: `knowledge`, `strategy`, `methodology`, `skill`, `memory`, `design`, `worklog`, `diagnosis`, `eval`. Documents link to each other (supports/blocks/conflicts/validates), forming a graph you can traverse. - -**Scope layers** — `session-private` (current conversation), `project-shared` (all sessions in this project), `user-global` (cross-project preferences), `public-system` (built-in skills), `sealed` (audit-only, never enters context). - -**Context admission** — Retrieval hits pass through admission gates. Full tool output (raw LSP dumps, diagnostics, capability indexes) is written to evidence artifacts, ref-linked and tool-only; only summaries and `file:line` snippets enter the model context. Sensitive values (SSH hosts, tokens, internal paths) are suggested, never auto-expanded. - -**AI IDE microservice** — Query code by symbol name and intent (e.g. `code_intel({ symbol: "AgentGateway.open", intent: "overview" })`), not file:line coordinates. Get definitions, references, call chains, type hierarchies, and diagnostics in one call. Built on LSP with 38 language servers; degrades gracefully to grep/read when no server is configured. - -**Preset MCP catalog** — Curated MCP servers for Git platforms, file search, read-only databases, and browser automation. Risk tiers are derived at load time from the catalog template (not user config, so they can't be injected), and servers default to not-connected with write and external-fetch operations behind approval gates. - -## Architecture - -``` -┌─────────────────────────────────────────────────────────────┐ -│ Control Plane (DeepAgent additions) │ -│ • Four-graph unified store (code + knowledge + memory + doc)│ -│ • Continuously maintained working state (memory + compaction)│ -│ • Domain pack system (composable, auto-activating knowledge)│ -│ • Context assembly & admission gates │ -│ • Multi-agent orchestration & adversarial review │ -│ • Evidence-gated learning & work-strength ladder │ -└─────────────────────────────────────────────────────────────┘ - │ -┌─────────────────────────────────────────────────────────────┐ -│ Runtime Foundations (from opencode) │ -│ • Agent loop & tool execution │ -│ • Session, fork & provider management │ -│ • MCP client runtime │ -│ • Permission system │ -└─────────────────────────────────────────────────────────────┘ - │ -┌─────────────────────────────────────────────────────────────┐ -│ Intelligence Layers │ -│ • LSP microservice (38 language servers) │ -│ • Preset MCP servers (git/files/db/browser) │ -│ • Domain adapters (validation & diagnostics) │ -│ • Diagnostic & validation loops │ -└─────────────────────────────────────────────────────────────┘ -``` - -DeepAgent's control plane operates at provider-turn boundaries: it selects context before each model call and writes evidence back into the document graph afterward. It does not replace opencode's runtime — it layers on top. - -## Documentation - -- [Architecture & Design](design/README.md) — Control plane, code intelligence, MCP security model -- [Security Policy](SECURITY.md) — Vulnerability reporting, known limitations -- [Privacy Policy](PRIVACY.md) — Data handling and storage -- [Contributing](CONTRIBUTING.md) — Development setup and guidelines -- [Changelog](CHANGELOG.md) — Release history - -## License & Attribution - -DeepAgent Code is licensed under **AGPL-3.0-or-later**. If you modify and run it as a network service, you must make your source code available to users. - -This project is derived from [opencode](https://github.com/sst/opencode) (MIT License). See [NOTICE](NOTICE) for the upstream license and attribution. No endorsement by opencode or its contributors is implied. - ---- - -

- Built by DeepAgent +lt by DeepAgent

From a2c5fb717ffcf3a6d2ee355fb8eae54ff7517c03 Mon Sep 17 00:00:00 2001 From: deepagent-ai Date: Mon, 13 Jul 2026 00:06:32 +0800 Subject: [PATCH 2/5] Link DeepAgent Code Enterprise --- README.zh.md | 171 +-------------------------------------------------- 1 file changed, 1 insertion(+), 170 deletions(-) diff --git a/README.zh.md b/README.zh.md index 0a17532a..57f8634d 100644 --- a/README.zh.md +++ b/README.zh.md @@ -1,173 +1,4 @@ -

- - - - DeepAgent Code logo - -

- -

具备持久记忆与控制平面的 AI 编程智能体

- -

- English | - 简体中文 -

- -

桌面版 v1.3

- ---- - -DeepAgent Code 是一个构建在持久文档记忆之上的 AI 编程智能体。它保留了 [opencode](https://github.com/sst/opencode) 的运行时基座,并在其上叠加了一层控制平面——让智能体不再像一次性的对话工具,而更像一位记得住你项目、会替你打磨模糊需求、能对硬骨头深挖到底的队友。 - -下面的每一项特性,都从一个真实的需求出发——一个普通编程智能体(包括 opencode)尚未满足的需求——再向下讲到我们为满足它而构建的底层架构。 - -## 你可以做什么 - -### 把历史一起带过来——换工具不必从零开始 - -**需求:** 你已经在另一个智能体里——Codex 或 Claude Code——积累了几个月的上下文,而换工具通常意味着把这一切统统丢下:那些对话、沉淀下来的记忆、你调好的技能。单是这份代价,就足以把人留在早该告别的工具上。 - -**DeepAgent 的做法:** 一键导入你已有的历史。把它指向一个 Codex 或 Claude Code 的安装目录,它就会把你的会话、记忆和技能热导入 DeepAgent——读取各工具的本地格式,归一化后重放进文档图,让导入的对话表现得和原生对话一样。导入过程中会对密钥做脱敏,导入的项目彼此隔离、不会和你正在进行的工作冲突,重复导入会收敛而不是产生重复。入口有三处:设置里的"导入历史"面板、侧栏的历史视图,以及 `import-history` 命令行。迁移只需几分钟,而不是推倒重来。 - -### 一直对话下去,不必换新 - -**需求:** 长任务会撑爆上下文窗口。多数智能体的应对方式是截断历史,或在阈值处一刀切地整体摘要——于是任务进行到一半,智能体忘了你一小时前拍的板,或者窗口被陈旧的工具输出塞满,质量断崖式下跌。 - -**DeepAgent 的做法:** 你的对话被当作一份持续维护的工作状态,而不是不断变长的聊天记录。每一轮开始前,智能体都会重建一份工作面——任务锚点、最近若干轮的原文、活跃的文件引用,以及此刻真正相关的旧事实——同时完整历史被持久归档、随时可查。工作面被严格控制在模型窗口的一个固定比例以内,永远给模型留足思考和作答的余地。你只管一直说,智能体替你保持专注。 - -### 随手分叉、切换窗口,记忆不丢 - -**需求:** 你想同时试两条思路,或把工作交给一个全新的对话,却不想从头失忆重来,也不想把原来的线程搅乱。 - -**DeepAgent 的做法:** 从任意一条消息分叉当前对话。分叉出的新对话会继承父对话到该点为止的记忆,在时间线顶部显示一条贯穿窗口的"从对话派生"分割线,并像文件夹一样嵌套挂在来源对话之下(子 agent 与分叉同理,最多三层深)。知识沿作用域层级向上流动——单个会话学到的东西可提升到整个项目,跨项目的偏好则沉淀在用户全局层——所以换窗口是一次干净的交接,而非一次清零重来。 - -### 想到哪问到哪,让智能体替你打磨 - -**需求:** 半成品的提问只能换来半有用的回答,而你未必总知道该怎么把想要的东西说清楚。 - -**DeepAgent 的做法:** 输入框上有两种情景模式。**直接**模式原样发送你的提示——措辞由你做主。**智能**模式会把粗糙的想法打磨成更精准的提示,给出草拟的方案和决策建议,并在自动执行任何操作前等你确认。智能体替你塑形到什么程度,由你决定。 - -### 选择智能体驱动的方式——以及由谁来写计划 - -**需求:** 有时你希望智能体拿到需求就自己跑;有时你想用一份由自己掌控的计划来引导它;有时你已经把计划写好了,只需要它忠实执行。 - -**DeepAgent 的做法:** 输入框上的协作模式选择器提供三档。**自动** ——智能体自行定目标、做计划、执行到完成。**目标** ——你说明需求,智能体生成一份你可以编辑的 `goal+plan.md`,再由监督循环驱动执行(计划→执行→验证逐步推进,有硬性预算/步数上限和客观完成判据)。**设计** ——你自己写好 `goal+plan.md`,智能体读取并忠实执行你的方案,不会重新定义目标。与协作模式正交,权限控制提供三个预设——**只读**、**请求批准**(默认)、**完全访问**——自主程度与审批方式是两个独立的、明确的选项。 - -### 在高风险决策前听一次会诊 - -**需求:** 有些决策——一次破坏性迁移、一个安全敏感的改动、一个架构抉择——值得不止一次自信的作答自我认同。 - -**DeepAgent 的做法:** 在输入框旁召集**专家团**。差异化的专家视角(正确性、安全、性能、架构、可复现)对同一个冻结问题各自独立审阅,匿名辩论,再由一个确定性(非 LLM)的仲裁者聚合裁定——保留少数派意见,并在专家团无法安全达成一致时偏向将决策权升级给你。 - -### 读懂并治理智能体所知道的 - -**需求:** 持久记忆只有在你能看见、能纠错的情况下才值得信任。 - -**DeepAgent 的做法:** **仓库与百科**视图把四张图投影成人类可读的页面——浏览并全文检索智能体的知识,跟随文档↔代码的交叉链接,并通过与智能体相同的证据门编辑可治理的知识/记忆页面(文档与代码页面只读)。单独的知识治理视图按项目和全局分组列出已学事实,由你审批哪些成为永久知识。 - -### 对真正的难题深挖到底 - -**需求:** 复杂的工作——一个架构决策、一次棘手的迁移、一个隐蔽的 bug——需要的不止一次自信的单程作答。它需要调研、需要第二意见、需要有人主动来挑刺。 - -**DeepAgent 的做法:** 在更高的工作强度下,主智能体会拆解任务,扇出给专注的子 agent 并行调研各个模块,综合它们的发现,再运行独立的审阅者——审阅者的职责是"击破"方案,而不是附和。扇出受可配置的并发上限约束;运行中的子 agent 会出现在会话侧栏面板和时间线内联卡片里,你可以旁观并随时跳进任意一个。 - -### 团队与智能体,在同一处协作 - -**需求:** 和队友协调、驱动智能体,通常发生在两个不同的工具里。 - -**DeepAgent 的做法:** 每个项目的群聊就在会话侧栏里。把某个智能体 @ 进来当作聊天成员,它便会跑完整的智能体回路——查代码、生成、修复——拉取项目知识与最近消息作为上下文,然后带着实时进度在群里内联回复。 - -## 它是怎么做到的 - -上面每一项能力,底层都由一个控制平面原语来支撑。这些正是普通运行时所没有的部分。 - -**四图合一** — 代码图、知识图、项目记忆、文档图被统一进同一个带类型、双向链接的存储。当智能体拉取上下文时,对某个符号的改动会连带浮现出与它真正相连的设计决策、过往诊断和知识——是连通的上下文,而不是四次互不相干的关键词检索。 - -**领域包** — 140+ 个可组合的知识包,覆盖编程语言、框架、平台(云、Kubernetes、CI)、硬件,以及业务/风险领域(安全、隐私、合规)。每个包捆绑了带类型的文档(策略、方法论、知识、技能、故障档案)与探测器,能为你的任务自动激活相应的包;冲突按"更严策略优先"消解,激活的集合会被版本锁定,从而让一次运行可复现。内核保持领域中立——专业能力是磁盘上的数据,而非写死的代码。 - -**知识分级调用** — 一条单调递增的强度阶梯(`general → high → xhigh → max → ultra`)决定控制平面机器启动到什么程度。`general` 贴近原生运行时——又快又省。越往上,逐级解锁持久知识、项目交接摘要、更重的策略/方法论层,以及多智能体编排。只有当你上调档位时,才为深度付费。 - -**自学习** — 工作落地后,智能体会提出候选的知识、事实与方法论。晋升是证据门控的(一项测试通过、一条诊断清零、一次校验确认)且由用户掌控——持久知识是被有意结转的,而非后台悄悄猜出来的。会话中稳定的结论会随时间巩固进项目记忆,于是下一次会话对*你的*代码库上手更聪明。 - -## 安装 - -```bash -npm install -g deepagent-code -``` - -然后运行: - -```bash -deepagent-code -# 或使用别名: -deepagent -``` - -## 快速示例 - -启动智能体并交给它一个任务: - -```bash -deepagent-code "为 /api/users 端点添加限流" -``` - -智能体将会: - -1. 用 LSP 找到端点定义并理解其结构 -2. 检查项目记忆中已有的中间件模式 -3. 激活相关领域包(后端 API、项目所用语言) -4. 遵循项目约定实现限流 -5. 运行测试、捕获诊断,并提出一条候选记忆:"本项目使用 express-rate-limit 中间件" - -下一次会话,当你要在别处添加限流时,智能体已经知道这套模式。 - -## 核心概念 - -**文档图** — 所有持久状态都存放在带类型的文档里:`knowledge`、`strategy`、`methodology`、`skill`、`memory`、`design`、`worklog`、`diagnosis`、`eval`。文档之间相互链接(支持/阻断/冲突/校验),构成一张可遍历的图。 - -**作用域分层** — `session-private`(当前对话)、`project-shared`(本项目所有会话)、`user-global`(跨项目偏好)、`public-system`(内置技能)、`sealed`(仅供审计,永不进入上下文)。 - -**上下文准入** — 检索命中要经过准入门。完整的工具输出(原始 LSP 转储、诊断、能力索引)被写入证据工件,带引用链接、仅工具可见;只有摘要与 `file:line` 片段进入模型上下文。敏感值(SSH 主机、令牌、内部路径)只被建议、绝不自动展开。 - -**AI IDE 微服务** — 按符号名与意图查询代码(例如 `code_intel({ symbol: "AgentGateway.open", intent: "overview" })`),而非按 file:line 坐标。一次调用即可拿到定义、引用、调用链、类型层级与诊断。基于 LSP、支持 38 种语言服务器;当某文件类型未配置服务器时,优雅降级到 grep/read。 - -**预置 MCP 目录** — 面向 Git 平台、文件搜索、只读数据库与浏览器自动化的精选 MCP 服务器。风险等级在加载时由目录模板推导(不来自用户配置,因而无法被注入),服务器默认不连接,写操作与外部请求置于审批门之后。 - -## 架构 - -``` -┌─────────────────────────────────────────────────────────────┐ -│ 控制平面(DeepAgent 新增) │ -│ • 四图合一存储(代码 + 知识 + 记忆 + 文档) │ -│ • 持续维护的工作状态(记忆 + 压缩) │ -│ • 领域包系统(可组合、自动激活的知识) │ -│ • 上下文装配与准入门 │ -│ • 多智能体编排与对抗式审阅 │ -│ • 证据门控的学习 + 工作强度阶梯 │ -└─────────────────────────────────────────────────────────────┘ - │ -┌─────────────────────────────────────────────────────────────┐ -│ 运行时基座(来自 opencode) │ -│ • 智能体回路与工具执行 │ -│ • 会话、分叉与供应商管理 │ -│ • MCP 客户端运行时 │ -│ • 权限系统 │ -└─────────────────────────────────────────────────────────────┘ - │ -┌─────────────────────────────────────────────────────────────┐ -│ 智能层 │ -│ • LSP 微服务(38 种语言服务器) │ -│ • 预置 MCP 服务器(git/文件/数据库/浏览器) │ -│ • 领域适配器(校验与诊断) │ -│ • 诊断与校验回路 │ -└─────────────────────────────────────────────────────────────┘ -``` - -DeepAgent 的控制平面在供应商轮次的边界上运作:在每次模型调用前挑选上下文,调用后把证据写回文档图。它不替换 opencode 的运行时——只是叠加在其之上。 - -## 文档 - -- [架构与设计](design/README.md) — 控制平面、代码智能、MCP 安全模型 +、代码智能、MCP 安全模型 - [安全策略](SECURITY.md) — 漏洞上报、已知限制 - [隐私政策](PRIVACY.md) — 数据处理与存储 - [贡献指南](CONTRIBUTING.md) — 开发环境与规范 From 1450aa9d39c6780b74c85c956d165e007f236594 Mon Sep 17 00:00:00 2001 From: deepagent-ai Date: Mon, 13 Jul 2026 00:09:03 +0800 Subject: [PATCH 3/5] Restore README and link Enterprise edition --- README.md | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 186 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ed101cc6..3b175f72 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,187 @@ -lt by DeepAgent +

+ + + + DeepAgent Code logo + +

+ +

AI coding agent with persistent memory and control plane

+ +

+ English | + 简体中文 | + Enterprise +

+ +

Desktop v1.3

+ +--- + +DeepAgent Code is an AI coding agent built on persistent document memory. It keeps [opencode](https://github.com/sst/opencode)'s runtime foundations and adds a control plane so the agent behaves less like a one-shot chat and more like a teammate that remembers your project, sharpens vague asks, and goes deep on hard problems. + +The features below start from a real need — something a plain coding agent, opencode included, leaves on the table — and work down to the architecture we built to serve it. + +## What You Can Do + +### Bring your history over — switch tools without starting from zero + +**The need:** You've built up months of context in another agent — Codex or Claude Code — and switching tools normally means abandoning all of it: the conversations, the accumulated memory, the skills you tuned. That cost alone keeps people on tools they've outgrown. + +**What DeepAgent does:** One-click import of your existing history. Point it at a Codex or Claude Code installation and it hot-imports your chat sessions, memory, and skills straight into DeepAgent — reading each tool's on-disk format, normalizing it, and replaying it into the document graph so imported conversations behave like native ones. Secrets are redacted on the way in, imported projects stay isolated so nothing collides with your active work, and re-running an import converges instead of duplicating. Available from the Settings "Import history" panel, a History view in the sidebar, or the `import-history` CLI command. Migration is a few minutes, not a fresh start. + +### Keep one conversation going indefinitely + +**The need:** Long tasks overflow the context window. Most agents respond by truncating history or summarizing everything at a threshold — so mid-task the agent forgets a decision you made an hour ago, or the window fills with stale tool output and quality falls off a cliff. + +**What DeepAgent does:** Your conversation is treated as a continuously maintained work state, not a growing chat log. Before every turn, the agent rebuilds a working set — the task anchor, the most recent exchanges verbatim, active file references, and only the older facts that are relevant right now — while the full history is archived durably and stays queryable. The working set is held to a hard fraction of the model window, so there's always room for the model to actually think and respond. You just keep talking; the agent keeps focus. + +### Switch windows, fork freely, never lose memory + +**The need:** You want to try two approaches, or hand the work to a fresh conversation, without starting from amnesia and without polluting the original thread. + +**What DeepAgent does:** Fork any conversation from a chosen message. The fork opens carrying the parent's memory up to that point, shows a full-width "derived from" marker at the top of its transcript, and nests folder-style under its origin in the session tree (subagents and forks alike, up to three levels deep). Knowledge flows up a scope hierarchy — what one session learns can be promoted to the whole project, and cross-project preferences live at the user-global layer — so switching windows is a clean handoff, not a reset. + +### Ask roughly, and let the agent sharpen it + +**The need:** A half-formed prompt gets a half-useful answer, and you don't always know how to phrase what you want. + +**What DeepAgent does:** Two scenario modes on the composer. **Direct** sends your prompt as-is — you own the wording. **Intelligence** refines a rough ask into a sharper prompt, surfaces a draft plan and decision suggestions, and waits for your confirmation before it automates anything. You decide how much the agent shapes the request. + +### Choose how much the agent drives — and who writes the plan + +**The need:** Sometimes you want the agent to just take a request and run; sometimes you want to steer it with a plan you control; sometimes you've already written the plan and just want it executed faithfully. + +**What DeepAgent does:** Three collaboration modes on the composer, picked from a single selector. **Auto** — the agent sets the objective, designs and plans as needed, and executes to completion. **Loop** — you describe the goal, the agent writes a `goal+plan.md` you can edit, then a supervised loop drives it to completion (plan → execute → verify per tick, with hard budget/step ceilings and objective completion checks). **Design** — you author `goal+plan.md` yourself and the agent executes your plan faithfully without redefining the goal. Orthogonal to mode, a permission control offers three presets — **Read-only**, **Request approval** (default), **Full access** — so autonomy and approval are separate, explicit choices. + +### Get a second opinion before high-risk decisions + +**The need:** Some decisions — a breaking migration, a security-sensitive change, an architecture call — deserve more than one confident pass agreeing with itself. + +**What DeepAgent does:** Convene an **Expert Panel** from the composer. Differentiated expert lenses (correctness, security, performance, architecture, repro) review the same frozen question independently, debate anonymously, and a deterministic (non-LLM) arbiter aggregates a verdict — with minority opinions preserved and a fail-closed bias toward escalating to you when the panel can't safely agree. + +### Read and govern what the agent knows + +**The need:** Persistent memory is only trustworthy if you can see it and correct it. + +**What DeepAgent does:** A **Repo & Wiki** view projects the four graphs into human-readable pages — browse and full-text-search the agent's knowledge, follow docs↔code cross-links, and edit governable Knowledge/Memory pages through the same evidence-gate the agent uses (Documents and Code stay read-only). A separate governance view lists learned facts grouped by project and global scope, so you approve what becomes durable. + +### Go deep on genuinely hard problems + +**The need:** Complex work — an architecture decision, a tricky migration, a subtle bug — needs more than a single confident pass. It needs research, a second opinion, and someone actively trying to poke holes. + +**What DeepAgent does:** At higher work strengths the primary agent decomposes the task, fans it out to focused subagents that research modules in parallel, synthesizes their findings, and then runs independent reviewers whose job is to *break* the plan rather than agree with it. Fan-out is bounded by a configurable concurrency ceiling, and live subagents surface in a session side panel and inline in the transcript so you can watch and jump into any of them. + +### Chat with your team and your agents in one place + +**The need:** Coordinating with teammates and driving agents usually happens in two different tools. + +**What DeepAgent does:** A per-project group chat lives in the session side panel. @mention an agent as a chat member and it runs the full agent loop — query code, generate, fix — pulling project knowledge and recent messages for context, then replies inline with live progress streaming. + +## How It Works + +Each capability above is served by a control-plane primitive underneath. These are the parts a plain runtime doesn't have. + +**Four-graph unification** — Code, knowledge, project memory, and the document graph are unified into one typed, bidirectionally-linked store. When the agent pulls context, a change to a symbol surfaces the design decisions, past diagnoses, and knowledge actually linked to it — connected context, not four disconnected keyword searches. + +**Domain packs** — 140+ composable knowledge packages spanning languages, frameworks, platforms (cloud, Kubernetes, CI), hardware, and business/risk domains (security, privacy, compliance). Each pack bundles typed documents (strategies, methodologies, knowledge, skills, failure dossiers) with detectors that auto-activate the right packs for your task; conflicts resolve stricter-policy-wins, and the active set is version-locked so a run is reproducible. Core stays domain-neutral — expertise is data on disk, not hardcoded. + +**Tiered knowledge invocation** — A monotonic strength ladder (`general → high → xhigh → max → ultra`) gates how much control-plane machinery engages. `general` stays close to the plain runtime — fast and cheap. Higher rungs progressively unlock durable knowledge, project handoff summaries, heavier strategy/methodology tiers, and multi-agent orchestration. You pay for depth only when you dial it up. + +**Self-learning** — After work lands, the agent proposes candidate knowledge, facts, and methodologies. Promotion is evidence-gated (a test passed, a diagnostic cleared, a validation confirmed) and user-controllable — durable knowledge is carried over deliberately, not silently guessed. Session-stable conclusions consolidate into project memory over time, so the next session starts smarter about *your* codebase. + +## Installation + +```bash +npm install -g deepagent-code +``` + +Then run: + +```bash +deepagent-code +# or use the alias: +deepagent +``` + +## Quick Example + +Start the agent and give it a task: + +```bash +deepagent-code "add rate limiting to /api/users endpoint" +``` + +The agent will: + +1. Use LSP to find the endpoint definition and understand its structure +2. Check project memory for existing middleware patterns +3. Activate the relevant domain packs (backend API, the project's language) +4. Implement rate limiting following project conventions +5. Run tests, capture diagnostics, and propose a candidate memory: "This project uses express-rate-limit middleware" + +On your next session, when you ask to add rate limiting elsewhere, the agent already knows the pattern. + +## Core Concepts + +**Document graph** — All persistent state lives in typed documents: `knowledge`, `strategy`, `methodology`, `skill`, `memory`, `design`, `worklog`, `diagnosis`, `eval`. Documents link to each other (supports/blocks/conflicts/validates), forming a graph you can traverse. + +**Scope layers** — `session-private` (current conversation), `project-shared` (all sessions in this project), `user-global` (cross-project preferences), `public-system` (built-in skills), `sealed` (audit-only, never enters context). + +**Context admission** — Retrieval hits pass through admission gates. Full tool output (raw LSP dumps, diagnostics, capability indexes) is written to evidence artifacts, ref-linked and tool-only; only summaries and `file:line` snippets enter the model context. Sensitive values (SSH hosts, tokens, internal paths) are suggested, never auto-expanded. + +**AI IDE microservice** — Query code by symbol name and intent (e.g. `code_intel({ symbol: "AgentGateway.open", intent: "overview" })`), not file:line coordinates. Get definitions, references, call chains, type hierarchies, and diagnostics in one call. Built on LSP with 38 language servers; degrades gracefully to grep/read when no server is configured. + +**Preset MCP catalog** — Curated MCP servers for Git platforms, file search, read-only databases, and browser automation. Risk tiers are derived at load time from the catalog template (not user config, so they can't be injected), and servers default to not-connected with write and external-fetch operations behind approval gates. + +## Architecture + +``` +┌─────────────────────────────────────────────────────────────┐ +│ Control Plane (DeepAgent additions) │ +│ • Four-graph unified store (code + knowledge + memory + doc)│ +│ • Continuously maintained working state (memory + compaction)│ +│ • Domain pack system (composable, auto-activating knowledge)│ +│ • Context assembly & admission gates │ +│ • Multi-agent orchestration & adversarial review │ +│ • Evidence-gated learning & work-strength ladder │ +└─────────────────────────────────────────────────────────────┘ + │ +┌─────────────────────────────────────────────────────────────┐ +│ Runtime Foundations (from opencode) │ +│ • Agent loop & tool execution │ +│ • Session, fork & provider management │ +│ • MCP client runtime │ +│ • Permission system │ +└─────────────────────────────────────────────────────────────┘ + │ +┌─────────────────────────────────────────────────────────────┐ +│ Intelligence Layers │ +│ • LSP microservice (38 language servers) │ +│ • Preset MCP servers (git/files/db/browser) │ +│ • Domain adapters (validation & diagnostics) │ +│ • Diagnostic & validation loops │ +└─────────────────────────────────────────────────────────────┘ +``` + +DeepAgent's control plane operates at provider-turn boundaries: it selects context before each model call and writes evidence back into the document graph afterward. It does not replace opencode's runtime — it layers on top. + +## Documentation + +- [Architecture & Design](design/README.md) — Control plane, code intelligence, MCP security model +- [Security Policy](SECURITY.md) — Vulnerability reporting, known limitations +- [Privacy Policy](PRIVACY.md) — Data handling and storage +- [Contributing](CONTRIBUTING.md) — Development setup and guidelines +- [Changelog](CHANGELOG.md) — Release history + +## License & Attribution + +DeepAgent Code is licensed under **AGPL-3.0-or-later**. If you modify and run it as a network service, you must make your source code available to users. + +This project is derived from [opencode](https://github.com/sst/opencode) (MIT License). See [NOTICE](NOTICE) for the upstream license and attribution. No endorsement by opencode or its contributors is implied. + +--- + +

+ Built by DeepAgent

From 295bf84af39aa2ed4ff149f81085e354b4805304 Mon Sep 17 00:00:00 2001 From: deepagent-ai Date: Mon, 13 Jul 2026 00:09:15 +0800 Subject: [PATCH 4/5] Restore Chinese README and link Enterprise edition --- README.zh.md | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 171 insertions(+), 1 deletion(-) diff --git a/README.zh.md b/README.zh.md index 57f8634d..91cd323c 100644 --- a/README.zh.md +++ b/README.zh.md @@ -1,4 +1,174 @@ -、代码智能、MCP 安全模型 +

+ + + + DeepAgent Code logo + +

+ +

具备持久记忆与控制平面的 AI 编程智能体

+ +

+ English | + 简体中文 | + Enterprise 版本 +

+ +

桌面版 v1.3

+ +--- + +DeepAgent Code 是一个构建在持久文档记忆之上的 AI 编程智能体。它保留了 [opencode](https://github.com/sst/opencode) 的运行时基座,并在其上叠加了一层控制平面——让智能体不再像一次性的对话工具,而更像一位记得住你项目、会替你打磨模糊需求、能对硬骨头深挖到底的队友。 + +下面的每一项特性,都从一个真实的需求出发——一个普通编程智能体(包括 opencode)尚未满足的需求——再向下讲到我们为满足它而构建的底层架构。 + +## 你可以做什么 + +### 把历史一起带过来——换工具不必从零开始 + +**需求:** 你已经在另一个智能体里——Codex 或 Claude Code——积累了几个月的上下文,而换工具通常意味着把这一切统统丢下:那些对话、沉淀下来的记忆、你调好的技能。单是这份代价,就足以把人留在早该告别的工具上。 + +**DeepAgent 的做法:** 一键导入你已有的历史。把它指向一个 Codex 或 Claude Code 的安装目录,它就会把你的会话、记忆和技能热导入 DeepAgent——读取各工具的本地格式,归一化后重放进文档图,让导入的对话表现得和原生对话一样。导入过程中会对密钥做脱敏,导入的项目彼此隔离、不会和你正在进行的工作冲突,重复导入会收敛而不是产生重复。入口有三处:设置里的"导入历史"面板、侧栏的历史视图,以及 `import-history` 命令行。迁移只需几分钟,而不是推倒重来。 + +### 一直对话下去,不必换新 + +**需求:** 长任务会撑爆上下文窗口。多数智能体的应对方式是截断历史,或在阈值处一刀切地整体摘要——于是任务进行到一半,智能体忘了你一小时前拍的板,或者窗口被陈旧的工具输出塞满,质量断崖式下跌。 + +**DeepAgent 的做法:** 你的对话被当作一份持续维护的工作状态,而不是不断变长的聊天记录。每一轮开始前,智能体都会重建一份工作面——任务锚点、最近若干轮的原文、活跃的文件引用,以及此刻真正相关的旧事实——同时完整历史被持久归档、随时可查。工作面被严格控制在模型窗口的一个固定比例以内,永远给模型留足思考和作答的余地。你只管一直说,智能体替你保持专注。 + +### 随手分叉、切换窗口,记忆不丢 + +**需求:** 你想同时试两条思路,或把工作交给一个全新的对话,却不想从头失忆重来,也不想把原来的线程搅乱。 + +**DeepAgent 的做法:** 从任意一条消息分叉当前对话。分叉出的新对话会继承父对话到该点为止的记忆,在时间线顶部显示一条贯穿窗口的"从对话派生"分割线,并像文件夹一样嵌套挂在来源对话之下(子 agent 与分叉同理,最多三层深)。知识沿作用域层级向上流动——单个会话学到的东西可提升到整个项目,跨项目的偏好则沉淀在用户全局层——所以换窗口是一次干净的交接,而非一次清零重来。 + +### 想到哪问到哪,让智能体替你打磨 + +**需求:** 半成品的提问只能换来半有用的回答,而你未必总知道该怎么把想要的东西说清楚。 + +**DeepAgent 的做法:** 输入框上有两种情景模式。**直接**模式原样发送你的提示——措辞由你做主。**智能**模式会把粗糙的想法打磨成更精准的提示,给出草拟的方案和决策建议,并在自动执行任何操作前等你确认。智能体替你塑形到什么程度,由你决定。 + +### 选择智能体驱动的方式——以及由谁来写计划 + +**需求:** 有时你希望智能体拿到需求就自己跑;有时你想用一份由自己掌控的计划来引导它;有时你已经把计划写好了,只需要它忠实执行。 + +**DeepAgent 的做法:** 输入框上的协作模式选择器提供三档。**自动** ——智能体自行定目标、做计划、执行到完成。**目标** ——你说明需求,智能体生成一份你可以编辑的 `goal+plan.md`,再由监督循环驱动执行(计划→执行→验证逐步推进,有硬性预算/步数上限和客观完成判据)。**设计** ——你自己写好 `goal+plan.md`,智能体读取并忠实执行你的方案,不会重新定义目标。与协作模式正交,权限控制提供三个预设——**只读**、**请求批准**(默认)、**完全访问**——自主程度与审批方式是两个独立的、明确的选项。 + +### 在高风险决策前听一次会诊 + +**需求:** 有些决策——一次破坏性迁移、一个安全敏感的改动、一个架构抉择——值得不止一次自信的作答自我认同。 + +**DeepAgent 的做法:** 在输入框旁召集**专家团**。差异化的专家视角(正确性、安全、性能、架构、可复现)对同一个冻结问题各自独立审阅,匿名辩论,再由一个确定性(非 LLM)的仲裁者聚合裁定——保留少数派意见,并在专家团无法安全达成一致时偏向将决策权升级给你。 + +### 读懂并治理智能体所知道的 + +**需求:** 持久记忆只有在你能看见、能纠错的情况下才值得信任。 + +**DeepAgent 的做法:** **仓库与百科**视图把四张图投影成人类可读的页面——浏览并全文检索智能体的知识,跟随文档↔代码的交叉链接,并通过与智能体相同的证据门编辑可治理的知识/记忆页面(文档与代码页面只读)。单独的知识治理视图按项目和全局分组列出已学事实,由你审批哪些成为永久知识。 + +### 对真正的难题深挖到底 + +**需求:** 复杂的工作——一个架构决策、一次棘手的迁移、一个隐蔽的 bug——需要的不止一次自信的单程作答。它需要调研、需要第二意见、需要有人主动来挑刺。 + +**DeepAgent 的做法:** 在更高的工作强度下,主智能体会拆解任务,扇出给专注的子 agent 并行调研各个模块,综合它们的发现,再运行独立的审阅者——审阅者的职责是"击破"方案,而不是附和。扇出受可配置的并发上限约束;运行中的子 agent 会出现在会话侧栏面板和时间线内联卡片里,你可以旁观并随时跳进任意一个。 + +### 团队与智能体,在同一处协作 + +**需求:** 和队友协调、驱动智能体,通常发生在两个不同的工具里。 + +**DeepAgent 的做法:** 每个项目的群聊就在会话侧栏里。把某个智能体 @ 进来当作聊天成员,它便会跑完整的智能体回路——查代码、生成、修复——拉取项目知识与最近消息作为上下文,然后带着实时进度在群里内联回复。 + +## 它是怎么做到的 + +上面每一项能力,底层都由一个控制平面原语来支撑。这些正是普通运行时所没有的部分。 + +**四图合一** — 代码图、知识图、项目记忆、文档图被统一进同一个带类型、双向链接的存储。当智能体拉取上下文时,对某个符号的改动会连带浮现出与它真正相连的设计决策、过往诊断和知识——是连通的上下文,而不是四次互不相干的关键词检索。 + +**领域包** — 140+ 个可组合的知识包,覆盖编程语言、框架、平台(云、Kubernetes、CI)、硬件,以及业务/风险领域(安全、隐私、合规)。每个包捆绑了带类型的文档(策略、方法论、知识、技能、故障档案)与探测器,能为你的任务自动激活相应的包;冲突按"更严策略优先"消解,激活的集合会被版本锁定,从而让一次运行可复现。内核保持领域中立——专业能力是磁盘上的数据,而非写死的代码。 + +**知识分级调用** — 一条单调递增的强度阶梯(`general → high → xhigh → max → ultra`)决定控制平面机器启动到什么程度。`general` 贴近原生运行时——又快又省。越往上,逐级解锁持久知识、项目交接摘要、更重的策略/方法论层,以及多智能体编排。只有当你上调档位时,才为深度付费。 + +**自学习** — 工作落地后,智能体会提出候选的知识、事实与方法论。晋升是证据门控的(一项测试通过、一条诊断清零、一次校验确认)且由用户掌控——持久知识是被有意结转的,而非后台悄悄猜出来的。会话中稳定的结论会随时间巩固进项目记忆,于是下一次会话对*你的*代码库上手更聪明。 + +## 安装 + +```bash +npm install -g deepagent-code +``` + +然后运行: + +```bash +deepagent-code +# 或使用别名: +deepagent +``` + +## 快速示例 + +启动智能体并交给它一个任务: + +```bash +deepagent-code "为 /api/users 端点添加限流" +``` + +智能体将会: + +1. 用 LSP 找到端点定义并理解其结构 +2. 检查项目记忆中已有的中间件模式 +3. 激活相关领域包(后端 API、项目所用语言) +4. 遵循项目约定实现限流 +5. 运行测试、捕获诊断,并提出一条候选记忆:"本项目使用 express-rate-limit 中间件" + +下一次会话,当你要在别处添加限流时,智能体已经知道这套模式。 + +## 核心概念 + +**文档图** — 所有持久状态都存放在带类型的文档里:`knowledge`、`strategy`、`methodology`、`skill`、`memory`、`design`、`worklog`、`diagnosis`、`eval`。文档之间相互链接(支持/阻断/冲突/校验),构成一张可遍历的图。 + +**作用域分层** — `session-private`(当前对话)、`project-shared`(本项目所有会话)、`user-global`(跨项目偏好)、`public-system`(内置技能)、`sealed`(仅供审计,永不进入上下文)。 + +**上下文准入** — 检索命中要经过准入门。完整的工具输出(原始 LSP 转储、诊断、能力索引)被写入证据工件,带引用链接、仅工具可见;只有摘要与 `file:line` 片段进入模型上下文。敏感值(SSH 主机、令牌、内部路径)只被建议、绝不自动展开。 + +**AI IDE 微服务** — 按符号名与意图查询代码(例如 `code_intel({ symbol: "AgentGateway.open", intent: "overview" })`),而非按 file:line 坐标。一次调用即可拿到定义、引用、调用链、类型层级与诊断。基于 LSP、支持 38 种语言服务器;当某文件类型未配置服务器时,优雅降级到 grep/read。 + +**预置 MCP 目录** — 面向 Git 平台、文件搜索、只读数据库与浏览器自动化的精选 MCP 服务器。风险等级在加载时由目录模板推导(不来自用户配置,因而无法被注入),服务器默认不连接,写操作与外部请求置于审批门之后。 + +## 架构 + +``` +┌─────────────────────────────────────────────────────────────┐ +│ 控制平面(DeepAgent 新增) │ +│ • 四图合一存储(代码 + 知识 + 记忆 + 文档) │ +│ • 持续维护的工作状态(记忆 + 压缩) │ +│ • 领域包系统(可组合、自动激活的知识) │ +│ • 上下文装配与准入门 │ +│ • 多智能体编排与对抗式审阅 │ +│ • 证据门控的学习 + 工作强度阶梯 │ +└─────────────────────────────────────────────────────────────┘ + │ +┌─────────────────────────────────────────────────────────────┐ +│ 运行时基座(来自 opencode) │ +│ • 智能体回路与工具执行 │ +│ • 会话、分叉与供应商管理 │ +│ • MCP 客户端运行时 │ +│ • 权限系统 │ +└─────────────────────────────────────────────────────────────┘ + │ +┌─────────────────────────────────────────────────────────────┐ +│ 智能层 │ +│ • LSP 微服务(38 种语言服务器) │ +│ • 预置 MCP 服务器(git/文件/数据库/浏览器) │ +│ • 领域适配器(校验与诊断) │ +│ • 诊断与校验回路 │ +└─────────────────────────────────────────────────────────────┘ +``` + +DeepAgent 的控制平面在供应商轮次的边界上运作:在每次模型调用前挑选上下文,调用后把证据写回文档图。它不替换 opencode 的运行时——只是叠加在其之上。 + +## 文档 + +- [架构与设计](design/README.md) — 控制平面、代码智能、MCP 安全模型 - [安全策略](SECURITY.md) — 漏洞上报、已知限制 - [隐私政策](PRIVACY.md) — 数据处理与存储 - [贡献指南](CONTRIBUTING.md) — 开发环境与规范 From 861f86c4f253df1d9992a309e6ed464e1f7c32b0 Mon Sep 17 00:00:00 2001 From: deepagent-ai Date: Wed, 15 Jul 2026 08:56:55 +0800 Subject: [PATCH 5/5] Core v4.0 beta (#64) ### Issue for this PR Closes # ### Type of change - [ ] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [ ] Documentation ### What does this PR do? Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR. **If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!** ### How did you verify your code works? ### Screenshots / recordings _If this is a UI change, please include a screenshot or recording._ ### Checklist - [ ] I have tested my changes locally - [ ] I have not included unrelated changes in this PR _If you do not follow this template your PR will be automatically rejected._ --------- Co-authored-by: Claude Opus 4.8 (1M context) --- README.md | 23 +- README.zh.md | 23 +- bun.lock | 4 +- packages/app/package.json | 2 +- .../deepagent/goal-plan-edit-dialog.tsx | 164 ++++ .../deepagent/goal-start-button.tsx | 2 +- .../components/deepagent/goal-status-bar.tsx | 30 +- .../deepagent/oversight-contract.test.ts | 79 ++ .../deepagent/oversight-dashboard.tsx | 493 ++++++++++ .../src/components/deepagent/oversight.api.ts | 208 ++++ .../src/components/deepagent/panel-button.tsx | 146 +-- .../deepagent/panel-goal-contract.test.ts | 61 +- .../components/deepagent/panel-goal.api.ts | 76 +- .../app/src/components/im/capabilities.ts | 52 + .../src/components/im/group-chat-panel.tsx | 58 +- .../src/components/im/message-composer.tsx | 43 +- .../app/src/components/im/message-item.tsx | 12 + .../app/src/components/im/message-list.tsx | 3 + .../app/src/components/im/message-search.tsx | 98 ++ .../app/src/components/im/thread-view.tsx | 113 +++ packages/app/src/components/im/types.ts | 16 + .../app/src/components/mcp-management.tsx | 116 +++ .../prompt-input/scenario-toggle.tsx | 2 +- .../src/components/session/session-header.tsx | 6 +- .../src/components/status-popover-body.tsx | 119 +-- .../app/src/components/status-popover.tsx | 76 +- packages/app/src/components/wiki/wiki.api.ts | 30 + packages/app/src/context/layout.tsx | 41 +- packages/app/src/i18n/en.ts | 92 +- packages/app/src/i18n/zh.ts | 92 +- packages/app/src/i18n/zht.ts | 88 +- packages/app/src/pages/error.tsx | 27 +- .../app/src/pages/layout/sidebar-shell.tsx | 12 +- packages/app/src/pages/session.tsx | 14 +- .../composer/session-composer-region.tsx | 14 + .../pages/session/im-panel-helpers.test.ts | 4 +- .../app/src/pages/session/im-panel-helpers.ts | 29 +- .../src/pages/session/session-side-panel.tsx | 559 ++++++----- .../app/src/pages/session/side-panel-im.tsx | 112 ++- .../app/src/pages/session/side-panel-mcp.tsx | 29 + .../pages/session/side-panel-oversight.tsx | 29 + .../src/pages/session/side-panel-plugins.tsx | 6 +- .../src/pages/session/side-panel-profile.tsx | 2 +- .../pages/session/use-session-commands.tsx | 3 +- packages/app/src/utils/im-client.ts | 76 +- packages/core/src/agent-gateway.ts | 8 +- packages/core/src/database/migration.gen.ts | 16 + .../20260711000000_deepagent_event_bus.ts | 87 ++ .../20260711010000_deepagent_scheduler.ts | 47 + .../20260711020000_im_agent_push_logs.ts | 50 + ...20260711030000_deepagent_approval_queue.ts | 44 + .../20260711040000_im_messages_v4_columns.ts | 42 + ...260711050000_deepagent_workspace_config.ts | 27 + .../20260711060000_im_messages_fts.ts | 85 ++ .../20260711080000_im_attachments.ts | 49 + ...0711090000_im_agent_push_digest_flushed.ts | 34 + ...1100000_deepagent_event_publish_latency.ts | 26 + .../20260712000000_deepagent_schedule_key.ts | 30 + .../20260712010000_deepagent_event_drop.ts | 36 + ...20260712020000_deepagent_human_takeover.ts | 39 + .../20260712030000_deepagent_rollback.ts | 41 + ...712040000_deepagent_event_drop_distinct.ts | 43 + .../20260712050000_session_steer_queue.ts | 30 + .../core/src/deepagent/agent-push-policy.ts | 111 +++ .../core/src/deepagent/approval-queue-sql.ts | 36 + packages/core/src/deepagent/approval-queue.ts | 214 +++++ .../core/src/deepagent/autonomy-policy.ts | 106 ++ .../core/src/deepagent/background-learning.ts | 16 +- packages/core/src/deepagent/code-indexer.ts | 50 + packages/core/src/deepagent/command-intent.ts | 15 +- .../core/src/deepagent/conflict-arbiter.ts | 102 ++ packages/core/src/deepagent/content-safety.ts | 163 ++++ .../core/src/deepagent/context-admission.ts | 5 +- packages/core/src/deepagent/context/config.ts | 8 - .../core/src/deepagent/context/curator.ts | 122 --- packages/core/src/deepagent/context/index.ts | 12 +- packages/core/src/deepagent/context/ingest.ts | 249 ----- .../core/src/deepagent/context/token-meter.ts | 67 -- .../core/src/deepagent/context/working-set.ts | 139 --- .../core/src/deepagent/deepagent-event-bus.ts | 778 +++++++++++++++ .../core/src/deepagent/deepagent-event-sql.ts | 100 ++ .../core/src/deepagent/deepagent-event.ts | 86 ++ packages/core/src/deepagent/document-store.ts | 34 +- packages/core/src/deepagent/event-router.ts | 172 ++++ packages/core/src/deepagent/goal-loop.ts | 196 +++- packages/core/src/deepagent/graph-query.ts | 6 + .../core/src/deepagent/human-takeover-sql.ts | 31 + packages/core/src/deepagent/human-takeover.ts | 126 +++ .../core/src/deepagent/knowledge-source.ts | 11 + packages/core/src/deepagent/lmn-events.ts | 106 ++ packages/core/src/deepagent/observability.ts | 463 +++++++++ .../src/deepagent/panel-convene-policy.ts | 80 ++ packages/core/src/deepagent/path-acl.ts | 45 + packages/core/src/deepagent/prompt-policy.ts | 30 +- packages/core/src/deepagent/quiet-hours.ts | 75 ++ packages/core/src/deepagent/rate-limiter.ts | 81 ++ .../core/src/deepagent/retention-sweeper.ts | 156 +++ .../core/src/deepagent/rollback-audit-sql.ts | 33 + packages/core/src/deepagent/rollback-audit.ts | 129 +++ packages/core/src/deepagent/scheduler-sql.ts | 56 ++ packages/core/src/deepagent/scheduler.ts | 382 ++++++++ packages/core/src/deepagent/security-gate.ts | 88 ++ .../core/src/deepagent/security-resolvers.ts | 168 ++++ packages/core/src/deepagent/session-state.ts | 27 + .../core/src/deepagent/task-partitioner.ts | 194 ++++ .../src/deepagent/workspace-concurrency.ts | 86 ++ .../src/deepagent/workspace-config-sql.ts | 21 + .../core/src/deepagent/workspace-config.ts | 172 ++++ packages/core/src/im/agent-executor.ts | 4 + packages/core/src/im/agent-list-provider.ts | 10 +- packages/core/src/im/agent-orchestrator.ts | 27 +- packages/core/src/im/attachment-storage.ts | 114 +++ packages/core/src/im/builtin-agents.ts | 125 +++ packages/core/src/im/id.ts | 10 + packages/core/src/im/mention-parser.ts | 12 + packages/core/src/im/push-log-sql.ts | 55 ++ packages/core/src/im/repository.ts | 533 +++++++++- packages/core/src/im/sql.ts | 50 +- packages/core/src/im/websocket.ts | 4 +- packages/core/src/public/deepagent-code.ts | 130 --- packages/core/src/public/index.ts | 1 - packages/core/src/session/event.ts | 8 +- packages/core/src/session/input.ts | 7 +- packages/core/src/session/runner/llm.ts | 7 + packages/core/src/session/sql.ts | 30 + packages/core/src/util/identifier.ts | 33 +- packages/core/test/agent-push-policy.test.ts | 99 ++ packages/core/test/agent.test.ts | 2 +- packages/core/test/approval-queue.test.ts | 194 ++++ packages/core/test/autonomy-policy.test.ts | 89 ++ packages/core/test/conflict-arbiter.test.ts | 94 ++ packages/core/test/content-safety.test.ts | 166 ++++ packages/core/test/database-migration.test.ts | 90 ++ .../core/test/deepagent-event-bus.test.ts | 522 ++++++++++ .../deepagent/background-learning.test.ts | 47 + .../core/test/deepagent/code-indexer.test.ts | 42 +- .../test/deepagent/command-intent.test.ts | 34 + packages/core/test/deepagent/context.test.ts | 278 +----- .../test/deepagent/document-store.test.ts | 42 +- .../deepagent/domain-pack-registry.test.ts | 15 + .../core/test/deepagent/goal-loop.test.ts | 341 ++++++- .../core/test/deepagent/graph-query.test.ts | 25 + .../core/test/deepagent/prompt-policy.test.ts | 61 ++ .../session-state-panel-goal.test.ts | 28 + packages/core/test/event-router.test.ts | 201 ++++ packages/core/test/human-takeover.test.ts | 69 ++ .../core/test/im-agent-reply-sink.test.ts | 2 +- .../core/test/im-attachment-storage.test.ts | 126 +++ packages/core/test/im-b3.test.ts | 385 ++++++++ packages/core/test/im-builtin-agents.test.ts | 125 +++ packages/core/test/im-e2e.test.ts | 19 +- packages/core/test/im-integration.test.ts | 2 + packages/core/test/im-orchestrator.test.ts | 158 ++- .../test/im-unified-context-graph.test.ts | 6 +- packages/core/test/lmn-events.test.ts | 54 ++ packages/core/test/observability.test.ts | 425 ++++++++ .../core/test/panel-convene-policy.test.ts | 113 +++ packages/core/test/path-acl.test.ts | 56 ++ .../core/test/public-deepagent-code.test.ts | 177 ---- packages/core/test/quiet-hours.test.ts | 63 ++ packages/core/test/rate-limiter.test.ts | 57 ++ packages/core/test/retention-sweeper.test.ts | 304 ++++++ packages/core/test/rollback-audit.test.ts | 81 ++ packages/core/test/scheduler.test.ts | 249 +++++ packages/core/test/security-gate.test.ts | 75 ++ packages/core/test/security-resolvers.test.ts | 216 +++++ .../core/test/session-runner-recorded.test.ts | 8 +- packages/core/test/session-runner.test.ts | 14 +- packages/core/test/task-partitioner.test.ts | 117 +++ packages/core/test/util/identifier.test.ts | 61 ++ .../core/test/v4-migration-integrity.test.ts | 108 +++ .../core/test/workspace-concurrency.test.ts | 76 ++ packages/core/test/workspace-config.test.ts | 140 +++ packages/deepagent-code/specs/v2/api.ts | 67 -- .../src/effect/runtime-flags.ts | 55 ++ .../src/im/agent-executor-server.ts | 93 +- .../src/im/agent-reply-sink-server.ts | 13 +- .../src/panel/panel-convene-consumer.ts | 286 ++++++ .../src/server/routes/instance/httpapi/api.ts | 4 + .../instance/httpapi/groups/deepagent.ts | 91 +- .../routes/instance/httpapi/groups/global.ts | 9 + .../routes/instance/httpapi/groups/im.ts | 185 +++- .../instance/httpapi/groups/oversight.ts | 212 ++++ .../routes/instance/httpapi/groups/webhook.ts | 178 ++++ .../instance/httpapi/handlers/deepagent.ts | 82 +- .../instance/httpapi/handlers/global.ts | 8 + .../routes/instance/httpapi/handlers/im.ts | 406 +++++++- .../instance/httpapi/handlers/oversight.ts | 159 +++ .../instance/httpapi/handlers/session.ts | 16 +- .../instance/httpapi/handlers/webhook.ts | 234 +++++ .../server/routes/instance/httpapi/server.ts | 61 ++ .../deepagent-code/src/session/agent-push.ts | 389 ++++++++ .../src/session/agent-worktree.ts | 163 ++++ .../src/session/code-index-trigger.ts | 47 +- .../src/session/digest-builder.ts | Bin 0 -> 9341 bytes .../src/session/event-dispatcher.ts | 529 ++++++++++ .../deepagent-code/src/session/goal-driver.ts | 190 +++- .../src/session/goal-governance-audit.ts | 45 + .../src/session/goal-loop-wiring.ts | 119 ++- .../src/session/goal-manager.ts | 325 ++++++- .../src/session/multi-agent-runtime.ts | 536 +++++++++++ packages/deepagent-code/src/session/prompt.ts | 268 +++++- .../deepagent-code/src/session/run-state.ts | 12 +- .../session/session-completed-publisher.ts | 282 ++++++ packages/deepagent-code/src/session/steer.ts | 208 ++++ .../src/session/supervisor-notifier.ts | 293 ++++++ packages/deepagent-code/src/session/tools.ts | 149 +-- .../src/session/v4-event-runtime.ts | 723 ++++++++++++++ .../src/wiki/event-driven-archiver.ts | 152 +++ .../src/wiki/execution-archiver.ts | 160 --- .../test/cli/cmd/tui/attention.test.ts | 6 +- .../deepagent-code/test/cli/error.test.ts | 2 +- .../test/cli/github-remote.test.ts | 21 +- .../__snapshots__/help-snapshots.test.ts.snap | 2 + .../test/deepagent/plan-status-cache.test.ts | 73 ++ .../test/effect/runtime-flags.test.ts | 53 + .../test/im/agent-executor-server.test.ts | 5 + .../im/agent-list-provider-server.test.ts | 221 ++++- .../test/im/agent-reply-sink-steered.test.ts | 80 ++ .../deepagent-code/test/lib/seed-ripgrep.ts | 4 + .../test/panel/panel-convene-consumer.test.ts | 269 ++++++ .../test/server/httpapi-im-agent.test.ts | 8 +- .../test/server/httpapi-im-b3.test.ts | 269 ++++++ .../test/server/httpapi-instance.test.ts | 114 +++ .../test/server/httpapi-listen.test.ts | 7 +- .../test/server/httpapi-ui.test.ts | 18 +- .../test/server/httpapi-webhook.test.ts | 299 ++++++ .../test/server/session-actions.test.ts | 9 +- .../test/session/agent-push.test.ts | 444 +++++++++ .../test/session/agent-worktree.test.ts | 89 ++ .../test/session/code-index-trigger.test.ts | 26 +- .../test/session/digest-builder.test.ts | 190 ++++ .../test/session/event-dispatcher.test.ts | 569 +++++++++++ .../test/session/flag-independence.test.ts | 2 +- .../test/session/goal-driver.test.ts | 89 +- .../session/goal-loop-bcd-integration.test.ts | 24 +- .../test/session/goal-loop-wiring.test.ts | 15 +- .../test/session/goal-steer.test.ts | 315 ++++++ .../test/session/llm-native-recorded.test.ts | 18 + .../deepagent-code/test/session/llm.test.ts | 644 +++++++------ .../test/session/multi-agent-runtime.test.ts | 907 ++++++++++++++++++ .../test/session/processor-effect.test.ts | 4 +- .../test/session/prompt.test.ts | 7 +- .../session-completed-publisher.test.ts | 235 +++++ .../test/session/snapshot-tool-race.test.ts | 2 + .../deepagent-code/test/session/steer.test.ts | 879 +++++++++++++++++ .../test/session/supervisor-notifier.test.ts | 225 +++++ .../test/session/v4-event-runtime.test.ts | 848 ++++++++++++++++ .../test/session/v4-integration.test.ts | 347 +++++++ .../test/wiki/event-driven-archiver.test.ts | 184 ++++ .../test/wiki/execution-archiver.test.ts | 145 --- packages/desktop/package.json | 2 +- packages/ui/src/components/icon.tsx | 22 +- packages/ui/src/v2/components/icon.tsx | 66 +- 254 files changed, 27900 insertions(+), 2788 deletions(-) create mode 100644 packages/app/src/components/deepagent/goal-plan-edit-dialog.tsx create mode 100644 packages/app/src/components/deepagent/oversight-contract.test.ts create mode 100644 packages/app/src/components/deepagent/oversight-dashboard.tsx create mode 100644 packages/app/src/components/deepagent/oversight.api.ts create mode 100644 packages/app/src/components/im/capabilities.ts create mode 100644 packages/app/src/components/im/message-search.tsx create mode 100644 packages/app/src/components/im/thread-view.tsx create mode 100644 packages/app/src/components/mcp-management.tsx create mode 100644 packages/app/src/pages/session/side-panel-mcp.tsx create mode 100644 packages/app/src/pages/session/side-panel-oversight.tsx create mode 100644 packages/core/src/database/migration/20260711000000_deepagent_event_bus.ts create mode 100644 packages/core/src/database/migration/20260711010000_deepagent_scheduler.ts create mode 100644 packages/core/src/database/migration/20260711020000_im_agent_push_logs.ts create mode 100644 packages/core/src/database/migration/20260711030000_deepagent_approval_queue.ts create mode 100644 packages/core/src/database/migration/20260711040000_im_messages_v4_columns.ts create mode 100644 packages/core/src/database/migration/20260711050000_deepagent_workspace_config.ts create mode 100644 packages/core/src/database/migration/20260711060000_im_messages_fts.ts create mode 100644 packages/core/src/database/migration/20260711080000_im_attachments.ts create mode 100644 packages/core/src/database/migration/20260711090000_im_agent_push_digest_flushed.ts create mode 100644 packages/core/src/database/migration/20260711100000_deepagent_event_publish_latency.ts create mode 100644 packages/core/src/database/migration/20260712000000_deepagent_schedule_key.ts create mode 100644 packages/core/src/database/migration/20260712010000_deepagent_event_drop.ts create mode 100644 packages/core/src/database/migration/20260712020000_deepagent_human_takeover.ts create mode 100644 packages/core/src/database/migration/20260712030000_deepagent_rollback.ts create mode 100644 packages/core/src/database/migration/20260712040000_deepagent_event_drop_distinct.ts create mode 100644 packages/core/src/database/migration/20260712050000_session_steer_queue.ts create mode 100644 packages/core/src/deepagent/agent-push-policy.ts create mode 100644 packages/core/src/deepagent/approval-queue-sql.ts create mode 100644 packages/core/src/deepagent/approval-queue.ts create mode 100644 packages/core/src/deepagent/autonomy-policy.ts create mode 100644 packages/core/src/deepagent/conflict-arbiter.ts create mode 100644 packages/core/src/deepagent/content-safety.ts delete mode 100644 packages/core/src/deepagent/context/curator.ts delete mode 100644 packages/core/src/deepagent/context/ingest.ts delete mode 100644 packages/core/src/deepagent/context/token-meter.ts delete mode 100644 packages/core/src/deepagent/context/working-set.ts create mode 100644 packages/core/src/deepagent/deepagent-event-bus.ts create mode 100644 packages/core/src/deepagent/deepagent-event-sql.ts create mode 100644 packages/core/src/deepagent/deepagent-event.ts create mode 100644 packages/core/src/deepagent/event-router.ts create mode 100644 packages/core/src/deepagent/human-takeover-sql.ts create mode 100644 packages/core/src/deepagent/human-takeover.ts create mode 100644 packages/core/src/deepagent/lmn-events.ts create mode 100644 packages/core/src/deepagent/observability.ts create mode 100644 packages/core/src/deepagent/panel-convene-policy.ts create mode 100644 packages/core/src/deepagent/path-acl.ts create mode 100644 packages/core/src/deepagent/quiet-hours.ts create mode 100644 packages/core/src/deepagent/rate-limiter.ts create mode 100644 packages/core/src/deepagent/retention-sweeper.ts create mode 100644 packages/core/src/deepagent/rollback-audit-sql.ts create mode 100644 packages/core/src/deepagent/rollback-audit.ts create mode 100644 packages/core/src/deepagent/scheduler-sql.ts create mode 100644 packages/core/src/deepagent/scheduler.ts create mode 100644 packages/core/src/deepagent/security-gate.ts create mode 100644 packages/core/src/deepagent/security-resolvers.ts create mode 100644 packages/core/src/deepagent/task-partitioner.ts create mode 100644 packages/core/src/deepagent/workspace-concurrency.ts create mode 100644 packages/core/src/deepagent/workspace-config-sql.ts create mode 100644 packages/core/src/deepagent/workspace-config.ts create mode 100644 packages/core/src/im/attachment-storage.ts create mode 100644 packages/core/src/im/builtin-agents.ts create mode 100644 packages/core/src/im/push-log-sql.ts delete mode 100644 packages/core/src/public/deepagent-code.ts create mode 100644 packages/core/test/agent-push-policy.test.ts create mode 100644 packages/core/test/approval-queue.test.ts create mode 100644 packages/core/test/autonomy-policy.test.ts create mode 100644 packages/core/test/conflict-arbiter.test.ts create mode 100644 packages/core/test/content-safety.test.ts create mode 100644 packages/core/test/deepagent-event-bus.test.ts create mode 100644 packages/core/test/event-router.test.ts create mode 100644 packages/core/test/human-takeover.test.ts create mode 100644 packages/core/test/im-attachment-storage.test.ts create mode 100644 packages/core/test/im-b3.test.ts create mode 100644 packages/core/test/im-builtin-agents.test.ts create mode 100644 packages/core/test/lmn-events.test.ts create mode 100644 packages/core/test/observability.test.ts create mode 100644 packages/core/test/panel-convene-policy.test.ts create mode 100644 packages/core/test/path-acl.test.ts delete mode 100644 packages/core/test/public-deepagent-code.test.ts create mode 100644 packages/core/test/quiet-hours.test.ts create mode 100644 packages/core/test/rate-limiter.test.ts create mode 100644 packages/core/test/retention-sweeper.test.ts create mode 100644 packages/core/test/rollback-audit.test.ts create mode 100644 packages/core/test/scheduler.test.ts create mode 100644 packages/core/test/security-gate.test.ts create mode 100644 packages/core/test/security-resolvers.test.ts create mode 100644 packages/core/test/task-partitioner.test.ts create mode 100644 packages/core/test/util/identifier.test.ts create mode 100644 packages/core/test/v4-migration-integrity.test.ts create mode 100644 packages/core/test/workspace-concurrency.test.ts create mode 100644 packages/core/test/workspace-config.test.ts delete mode 100644 packages/deepagent-code/specs/v2/api.ts create mode 100644 packages/deepagent-code/src/panel/panel-convene-consumer.ts create mode 100644 packages/deepagent-code/src/server/routes/instance/httpapi/groups/oversight.ts create mode 100644 packages/deepagent-code/src/server/routes/instance/httpapi/groups/webhook.ts create mode 100644 packages/deepagent-code/src/server/routes/instance/httpapi/handlers/oversight.ts create mode 100644 packages/deepagent-code/src/server/routes/instance/httpapi/handlers/webhook.ts create mode 100644 packages/deepagent-code/src/session/agent-push.ts create mode 100644 packages/deepagent-code/src/session/agent-worktree.ts create mode 100644 packages/deepagent-code/src/session/digest-builder.ts create mode 100644 packages/deepagent-code/src/session/event-dispatcher.ts create mode 100644 packages/deepagent-code/src/session/goal-governance-audit.ts create mode 100644 packages/deepagent-code/src/session/multi-agent-runtime.ts create mode 100644 packages/deepagent-code/src/session/session-completed-publisher.ts create mode 100644 packages/deepagent-code/src/session/steer.ts create mode 100644 packages/deepagent-code/src/session/supervisor-notifier.ts create mode 100644 packages/deepagent-code/src/session/v4-event-runtime.ts create mode 100644 packages/deepagent-code/src/wiki/event-driven-archiver.ts delete mode 100644 packages/deepagent-code/src/wiki/execution-archiver.ts create mode 100644 packages/deepagent-code/test/im/agent-reply-sink-steered.test.ts create mode 100644 packages/deepagent-code/test/panel/panel-convene-consumer.test.ts create mode 100644 packages/deepagent-code/test/server/httpapi-im-b3.test.ts create mode 100644 packages/deepagent-code/test/server/httpapi-webhook.test.ts create mode 100644 packages/deepagent-code/test/session/agent-push.test.ts create mode 100644 packages/deepagent-code/test/session/agent-worktree.test.ts create mode 100644 packages/deepagent-code/test/session/digest-builder.test.ts create mode 100644 packages/deepagent-code/test/session/event-dispatcher.test.ts create mode 100644 packages/deepagent-code/test/session/goal-steer.test.ts create mode 100644 packages/deepagent-code/test/session/multi-agent-runtime.test.ts create mode 100644 packages/deepagent-code/test/session/session-completed-publisher.test.ts create mode 100644 packages/deepagent-code/test/session/steer.test.ts create mode 100644 packages/deepagent-code/test/session/supervisor-notifier.test.ts create mode 100644 packages/deepagent-code/test/session/v4-event-runtime.test.ts create mode 100644 packages/deepagent-code/test/session/v4-integration.test.ts create mode 100644 packages/deepagent-code/test/wiki/event-driven-archiver.test.ts delete mode 100644 packages/deepagent-code/test/wiki/execution-archiver.test.ts diff --git a/README.md b/README.md index 3b175f72..616ccd9c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

-

AI coding agent with persistent memory and control plane

+

AI coding agent with persistent memory, autonomous goals, and a control plane

English | @@ -42,11 +42,11 @@ The features below start from a real need — something a plain coding agent, op **What DeepAgent does:** Fork any conversation from a chosen message. The fork opens carrying the parent's memory up to that point, shows a full-width "derived from" marker at the top of its transcript, and nests folder-style under its origin in the session tree (subagents and forks alike, up to three levels deep). Knowledge flows up a scope hierarchy — what one session learns can be promoted to the whole project, and cross-project preferences live at the user-global layer — so switching windows is a clean handoff, not a reset. -### Ask roughly, and let the agent sharpen it +### Pick how much autonomy you want, per task -**The need:** A half-formed prompt gets a half-useful answer, and you don't always know how to phrase what you want. +**The need:** Some asks want a fast answer in your exact words; others want the agent to plan first, or to run on its own until the job is done. One fixed behavior can't serve all three. -**What DeepAgent does:** Two scenario modes on the composer. **Direct** sends your prompt as-is — you own the wording. **Intelligence** refines a rough ask into a sharper prompt, surfaces a draft plan and decision suggestions, and waits for your confirmation before it automates anything. You decide how much the agent shapes the request. +**What DeepAgent does:** Three modes on the composer. **Auto** decides how to plan and act on your request. **Design** explores the problem and proposes a design before building anything. **Loop** turns a request into a supervised goal the agent works toward autonomously — iterating plan → execute → verify until the criteria are met — while you stay in control. You choose the autonomy level per task, not once for the whole tool. ### Choose how much the agent drives — and who writes the plan @@ -72,6 +72,18 @@ The features below start from a real need — something a plain coding agent, op **What DeepAgent does:** At higher work strengths the primary agent decomposes the task, fans it out to focused subagents that research modules in parallel, synthesizes their findings, and then runs independent reviewers whose job is to *break* the plan rather than agree with it. Fan-out is bounded by a configurable concurrency ceiling, and live subagents surface in a session side panel and inline in the transcript so you can watch and jump into any of them. +### Set a goal and let it run — supervised, not unsupervised + +**The need:** Some work is a long haul — a migration, a green-the-suite push, a multi-step feature. You want to hand it off and walk away, but "walk away" can't mean "lose control." + +**What DeepAgent does:** Loop mode drives an autonomous goal loop against an objectively decidable finish line (tests pass, no diagnostics, reviewer clean, plan complete). It runs plan → execute → verify → iterate in the background, with hard ceilings on ticks, tokens, wall-clock, and cost so it can never run away. A status bar shows live progress; you can hot-edit the plan mid-run, pause and resume from exactly where it stopped, or take over — a takeover pauses autonomy escalation and hands control back to you. A goal with steps that need a human never reports "done"; it routes to you. Autonomy is a dial you hold, not a switch you flip and hope. + +### Get a second opinion that actually argues + +**The need:** For a high-stakes decision, one confident answer isn't enough — you want independent experts who see the same evidence, disagree, and defend their positions. + +**What DeepAgent does:** Convene an Expert Panel on the current conversation from the composer. Pick single-round for a quick multi-lens review, or multi-round for a real debate: panelists (correctness, security, design, …) each render a verdict, then see each other's *anonymized* opinions and revise across up to three rounds — identity stripped so nobody anchors on "the security expert said." An arbiter synthesizes the surviving verdict. Fan-out and rounds are bounded, and every opinion (including the losers') is archived. The panel convenes on demand, or a running goal loop can convene it at high-risk decision points. + ### Chat with your team and your agents in one place **The need:** Coordinating with teammates and driving agents usually happens in two different tools. @@ -90,6 +102,8 @@ Each capability above is served by a control-plane primitive underneath. These a **Self-learning** — After work lands, the agent proposes candidate knowledge, facts, and methodologies. Promotion is evidence-gated (a test passed, a diagnostic cleared, a validation confirmed) and user-controllable — durable knowledge is carried over deliberately, not silently guessed. Session-stable conclusions consolidate into project memory over time, so the next session starts smarter about *your* codebase. +**Supervised autonomy** — The goal loop, expert panel, and multi-agent fan-out run on an event-driven substrate with the guardrails autonomy needs: hard budget ceilings (ticks/tokens/wall-clock/cost), a stall detector that stops rather than spins, layered permission and safety gates that fail closed, human takeover that pauses escalation, and a full audit trail written back to the document graph. An Agent Dashboard surfaces task success rate, conflicts, and dead-letter events. Autonomy is bounded and observable by construction — never a black box you can't stop. + ## Installation ```bash @@ -144,6 +158,7 @@ On your next session, when you ask to add rate limiting elsewhere, the agent alr │ • Domain pack system (composable, auto-activating knowledge)│ │ • Context assembly & admission gates │ │ • Multi-agent orchestration & adversarial review │ +│ • Supervised goal loop & expert panel (event-driven) │ │ • Evidence-gated learning & work-strength ladder │ └─────────────────────────────────────────────────────────────┘ │ diff --git a/README.zh.md b/README.zh.md index 91cd323c..e59e34c5 100644 --- a/README.zh.md +++ b/README.zh.md @@ -6,7 +6,7 @@

-

具备持久记忆与控制平面的 AI 编程智能体

+

具备持久记忆、自主目标与控制平面的 AI 编程智能体

English | @@ -42,11 +42,11 @@ DeepAgent Code 是一个构建在持久文档记忆之上的 AI 编程智能体 **DeepAgent 的做法:** 从任意一条消息分叉当前对话。分叉出的新对话会继承父对话到该点为止的记忆,在时间线顶部显示一条贯穿窗口的"从对话派生"分割线,并像文件夹一样嵌套挂在来源对话之下(子 agent 与分叉同理,最多三层深)。知识沿作用域层级向上流动——单个会话学到的东西可提升到整个项目,跨项目的偏好则沉淀在用户全局层——所以换窗口是一次干净的交接,而非一次清零重来。 -### 想到哪问到哪,让智能体替你打磨 +### 自主程度,按任务自己挑 -**需求:** 半成品的提问只能换来半有用的回答,而你未必总知道该怎么把想要的东西说清楚。 +**需求:** 有些提问想要一个快速、原话作答;有些希望智能体先规划;还有些希望它自己跑到把活干完为止。一种固定行为伺候不了这三种。 -**DeepAgent 的做法:** 输入框上有两种情景模式。**直接**模式原样发送你的提示——措辞由你做主。**智能**模式会把粗糙的想法打磨成更精准的提示,给出草拟的方案和决策建议,并在自动执行任何操作前等你确认。智能体替你塑形到什么程度,由你决定。 +**DeepAgent 的做法:** 输入框上有三种模式。**自动(Auto)** 由智能体决定如何规划并执行你的请求。**设计(Design)** 先探索问题、给出设计方案,再动手构建。**循环(Loop)** 把请求变成一个受监督的目标,智能体朝它自主推进——不断地"规划 → 执行 → 校验"直到满足完成判据——而掌控权始终在你手里。自主程度按任务来选,而不是为整个工具一次性定死。 ### 选择智能体驱动的方式——以及由谁来写计划 @@ -72,6 +72,18 @@ DeepAgent Code 是一个构建在持久文档记忆之上的 AI 编程智能体 **DeepAgent 的做法:** 在更高的工作强度下,主智能体会拆解任务,扇出给专注的子 agent 并行调研各个模块,综合它们的发现,再运行独立的审阅者——审阅者的职责是"击破"方案,而不是附和。扇出受可配置的并发上限约束;运行中的子 agent 会出现在会话侧栏面板和时间线内联卡片里,你可以旁观并随时跳进任意一个。 +### 定个目标让它自己跑——是受监督,而非放养 + +**需求:** 有些工作是场持久战——一次迁移、一轮把测试全刷绿、一个多步骤的特性。你想把它交出去然后走开,但"走开"不能等于"失控"。 + +**DeepAgent 的做法:** 循环模式驱动一个自主目标回路,朝着一条可客观判定的终点线推进(测试通过、无诊断、审阅无异议、计划完成)。它在后台跑"规划 → 执行 → 校验 → 迭代",并对轮次、令牌、墙钟时间和成本设有硬上限,绝不会失控狂奔。状态条实时显示进度;你可以在运行中热编辑计划、暂停后从中断处精确恢复,或直接接管——接管会暂停自主升级、把控制权交还给你。一个包含需要人工处理步骤的目标绝不会谎报"完成",而是转交给你。自主是你握在手里的旋钮,不是拨一下就听天由命的开关。 + +### 要一个真会争论的第二意见 + +**需求:** 面对高风险决策,一个自信的答案不够——你想要一批独立专家,看着同样的证据,各持己见、各自辩护。 + +**DeepAgent 的做法:** 从输入框就当前对话召集专家团。选单轮做一次快速的多视角评审,或选多轮进行真正的辩论:各位专家(正确性、安全、设计……)先各自给出裁定,然后看到彼此**匿名化**的意见并在最多三轮里修正——身份被抹去,谁都无法因"是安全专家说的"而锚定。一位仲裁者综合出最终存活的裁定。扇出与轮数都有界,每一条意见(包括落败的)都会被归档。专家团可按需召集,运行中的目标回路也能在高风险决策点上召集它。 + ### 团队与智能体,在同一处协作 **需求:** 和队友协调、驱动智能体,通常发生在两个不同的工具里。 @@ -90,6 +102,8 @@ DeepAgent Code 是一个构建在持久文档记忆之上的 AI 编程智能体 **自学习** — 工作落地后,智能体会提出候选的知识、事实与方法论。晋升是证据门控的(一项测试通过、一条诊断清零、一次校验确认)且由用户掌控——持久知识是被有意结转的,而非后台悄悄猜出来的。会话中稳定的结论会随时间巩固进项目记忆,于是下一次会话对*你的*代码库上手更聪明。 +**受监督的自主** — 目标回路、专家团与多智能体扇出都跑在一套事件驱动的底座上,并带着自主所必需的护栏:硬性预算上限(轮次/令牌/墙钟/成本)、宁停不空转的停滞检测、层层失败即关闭的权限与安全门、暂停升级的人工接管,以及写回文档图的完整审计轨迹。一个 Agent 面板会呈现任务成功率、冲突与死信事件。自主在构造上就是有界且可观测的——绝不是一个你停不下来的黑盒。 + ## 安装 ```bash @@ -144,6 +158,7 @@ deepagent-code "为 /api/users 端点添加限流" │ • 领域包系统(可组合、自动激活的知识) │ │ • 上下文装配与准入门 │ │ • 多智能体编排与对抗式审阅 │ +│ • 受监督的目标回路与专家团(事件驱动) │ │ • 证据门控的学习 + 工作强度阶梯 │ └─────────────────────────────────────────────────────────────┘ │ diff --git a/bun.lock b/bun.lock index 63a61400..82ed0bd7 100644 --- a/bun.lock +++ b/bun.lock @@ -29,7 +29,7 @@ }, "packages/app": { "name": "@deepagent-code/app", - "version": "1.0.0-beta", + "version": "1.4.0", "dependencies": { "@codemirror/autocomplete": "6", "@codemirror/commands": "6", @@ -344,7 +344,7 @@ }, "packages/desktop": { "name": "@deepagent-code/desktop", - "version": "1.2.0", + "version": "1.4.0", "dependencies": { "@zip.js/zip.js": "2.7.62", "effect": "catalog:", diff --git a/packages/app/package.json b/packages/app/package.json index 888f9b32..9435d21f 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@deepagent-code/app", - "version": "1.0.0-beta", + "version": "1.4.0", "description": "", "type": "module", "exports": { diff --git a/packages/app/src/components/deepagent/goal-plan-edit-dialog.tsx b/packages/app/src/components/deepagent/goal-plan-edit-dialog.tsx new file mode 100644 index 00000000..a7d3a00d --- /dev/null +++ b/packages/app/src/components/deepagent/goal-plan-edit-dialog.tsx @@ -0,0 +1,164 @@ +import { For, Index, Show, createSignal } from "solid-js" +import { Dialog, DialogFooter } from "@deepagent-code/ui/v2/dialog-v2" +import { Button } from "@deepagent-code/ui/button" +import { Icon } from "@deepagent-code/ui/icon" +import { useLanguage } from "@/context/language" +import { showToast } from "@/utils/toast" +import { editPlanGoal, type GoalPlanInput, type PanelGoalClient } from "./panel-goal.api" +import type { SessionPlan } from "@/context/global-sync/types" + +/** + * V4.1 §S2 — the goal plan HOT-EDIT dialog. Opened from the goal status bar for a running/paused goal. + * Pre-fills from the live session_plan (the same plan the status bar reads), lets the user revise the + * goal text + step titles/statuses (add/remove steps), and POSTs the revision via editPlanGoal. The + * backend applies it between ticks (durable-doc upsert + stall re-baseline) — see goal-loop.applyPlanEdit. + * + * step_id is preserved for existing steps (so the backend reconciles ids + runtime evidence via + * buildPlanFromInput); a NEW step is sent without an id and the backend assigns one. Evidence is + * runtime-owned and never sent from the client. + */ + +// The status values a user can pick — mirrors PlanStepStatus. `active` is included so a user can point +// the goal at a specific step; the backend re-derives active_step_id from the first active step. +const STATUS_OPTIONS = ["pending", "active", "done", "blocked", "cancelled"] as const +type StatusOption = (typeof STATUS_OPTIONS)[number] + +const STATUS_LABEL_KEY: Record = { + pending: "composer.goal.editPlan.status.pending", + active: "composer.goal.editPlan.status.active", + done: "composer.goal.editPlan.status.done", + blocked: "composer.goal.editPlan.status.blocked", + cancelled: "composer.goal.editPlan.status.cancelled", +} + +// A local editable step row. `step_id` is undefined for a freshly-added step (the backend assigns one). +type EditStep = { + step_id?: string + title: string + status: StatusOption +} + +const normStatus = (s: string): StatusOption => + (STATUS_OPTIONS as readonly string[]).includes(s) ? (s as StatusOption) : "pending" + +export function GoalPlanEditDialog(props: { + sessionID: string + plan: SessionPlan | undefined + client: PanelGoalClient + onClose: () => void +}) { + const language = useLanguage() + const [goal, setGoal] = createSignal(props.plan?.goal ?? "") + const [steps, setSteps] = createSignal( + (props.plan?.steps ?? []).map((s) => ({ step_id: s.step_id, title: s.title, status: normStatus(s.status) })), + ) + const [busy, setBusy] = createSignal(false) + + const setStep = (i: number, patch: Partial) => + setSteps((prev) => prev.map((s, idx) => (idx === i ? { ...s, ...patch } : s))) + const addStep = () => setSteps((prev) => [...prev, { title: "", status: "pending" }]) + const removeStep = (i: number) => setSteps((prev) => prev.filter((_, idx) => idx !== i)) + + // Valid to submit: a non-empty goal and at least one step whose title is non-empty. Empty-title steps + // are dropped on submit (a user adding a row then leaving it blank shouldn't create a titleless step). + const canSave = () => goal().trim().length > 0 && steps().some((s) => s.title.trim().length > 0) + + const onSave = async () => { + if (busy() || !canSave()) return + setBusy(true) + try { + const plan: GoalPlanInput = { + goal: goal().trim(), + steps: steps() + .filter((s) => s.title.trim().length > 0) + .map((s) => ({ + ...(s.step_id ? { step_id: s.step_id } : {}), + title: s.title.trim(), + status: s.status, + })), + } + const ok = await editPlanGoal(props.client, props.sessionID, plan) + if (ok) { + showToast({ title: language.t("composer.goal.editPlan.saved"), variant: "success" }) + props.onClose() + } else { + showToast({ title: language.t("composer.goal.editPlan.failed") }) + } + } catch { + showToast({ title: language.t("composer.goal.editPlan.failed") }) + } finally { + setBusy(false) + } + } + + return ( +

+
+