diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f5f6ee0..2f486496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +> **Current product:** Team Engineering (department tree, Discuss/Assign, conversation map) is the only delegation path. Older entries below that describe SubAgent DAG orchestration, `nori_swarm_launch`, or SubAgent+Team coexistence are historical. See the root [README](README.md) for an honest comparison and gap list. + ## v2.0.0-pre.0 (2026-08-24) The major bump is one change: delegation. The temporary SubAgent is gone, and Team Engineering — a durable department tree whose members talk to each other — is now the only way Nori hands work to another agent. diff --git a/README.md b/README.md index 8cbd4052..829d2edf 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Nori Code / Nori Work -> **Multi-agent coding workspace — decompose, distribute, verify, remember.** +> **Early project.** What ships today is **Team Engineering**: a durable department tree, Discuss before Assign, and a conversation map linked by `parent_session_id`. The deleted SubAgent DAG is **not** the product. -Nori orchestrates multiple AI agents to plan, implement, review, and persist knowledge across sessions. Not another chat-over-code tool — a **multi-agent engineering workspace**. +Nori is a coding-agent workspace forked from [Kimi Code CLI](https://github.com/MoonshotAI/kimi-code) (MIT). Nori Code is the terminal CLI/TUI; Nori Work is the Electron desktop. Like Codex and Claude Code, it can read and edit files, run a shell, and connect MCP. Unlike them, handing work to another agent means hiring a **standing department**, not spawning a disposable fan-out. [中文说明](README.zh-CN.md) @@ -11,101 +11,118 @@ Nori orchestrates multiple AI agents to plan, implement, review, and persist kno ![Nori Work browser workspace](docs/images/nori-work-browser.png) > [!NOTE] -> **v2.0** adds **team engineering**: a department tree of durable partner sessions, Discuss/Assign before Code, and a **conversation map** (`/map` in the TUI, **Map** in Nori Work) linked by `parent_session_id`. Identity is injected via `` and mount-change notices — not transcript copying. +> Current delegation is documented in [CHANGELOG.md](CHANGELOG.md) under `v2.0.0-pre.0`. Older entries that describe SubAgent, DAG orchestration, or `nori_swarm_launch` are historical. -> [!NOTE] -> **v1.0.0** was the first stable Nori Code and Nori Work release. Existing Nori Work installations are fully replaced during upgrade while user data is preserved. +--- -### What's included in v1.0.0 +## 1. What Nori is now -- Browser page actions no longer wait for the 90-second bridge timeout when no page is open; the Agent immediately receives an instruction to navigate first. -- Browser tools remain registered while the desktop bridge reconnects, and independent heartbeats prevent long-running actions from making the bridge appear offline. -- Local `.html` and `.htm` files open in the embedded browser without granting arbitrary `file://` access. -- Desktop packaging rejects stale Web/SEA artifacts, and startup recovers from stale or incompatible local-server locks instead of silently connecting to an old backend. -- Regular Agent and SubAgent work is visible by project and session with nested ownership, output, correct completion counts, and completed/failed states. -- Opening **Chat** reliably returns to the conversation view and session list. -- The vault no longer creates empty legacy plural folders; Related links use Obsidian-compatible paths and include both outgoing links and backlinks. -- Built-in LSP discovery covers common language servers instead of reporting "No language server is configured" when a supported server is available. +**Team Engineering** is the **only** way Nori hands work to another agent. The temporary `SubAgent` tool, the `'sub'` node kind, and the TUI subagent chrome are gone. Changelog rationale: two spawn paths meant two answers to “who is working right now”; more importantly, throwaway children that report only at `done` are fan-out, not a team. The failure mode this exists to prevent is silent parallel work. ---- +### A department tree, not a task pool -## Products +- Any agent may hire members with `TeamCreate` and chair its own department, bounded by `team.maxDepth` (default `2`, maximum `5`). +- A Discuss round is one department: a parent plus its direct members. A node never chairs and participates at the same time. +- Hiring uses the same path as the conversation map: create a **real child session**, mount it with `parent_session_id`, and show it as a session card. The runtime also **dual-writes** a team agent so Discuss/Assign still address this department by agent id. That dual-write is an implementation seam, not a finished unified identity (see [Honest gaps](#3-honest-gaps)). +- `TeamDismiss` removes a member and **deletes** that child session. Unmount on the map is a user action: detach without deleting. A session has one parent; part-time / second-parent hire is not supported. -| | Nori Code | Nori Work | -|---|---|---| -| **What** | Terminal CLI/TUI for focused coding sessions | Electron desktop workbench | -| **Who for** | Terminal-first power users | Full workspace with browser, terminal, Git, filesystem | -| **Interface** | Ink-based TUI with split panes | Multi-panel Electron desktop | -| **Start** | `nori` | Standalone installer (see releases) | +### Discuss, then Code ---- +Typical flow: + +1. **`TeamCreate`** — hire only who the work needs (`name` / `role` / `mandate`). +2. **`TeamDecide action=start`** — the chair states the goal, constraints, and open questions. No fixed plan yet. +3. **`TeamSpeak`** — members speak in turn. Each speaker is handed every statement already published this round; bare agreement is not a contribution. One short, decidable point per turn. +4. **`TeamAssign`** — every member exactly once (`task=null` leaves one idle). Success leaves Discuss and enters Code. +5. When the plan changes, two members are about to touch the same ground, or progress stalls, **`TeamDecide action=continue`** reopens the meeting instead of waiting for everyone to report `done`. + +While a round is open, `Write`, `Edit`, `Bash`, `TaskStop`, `CronCreate`, and `CronDelete` are denied to everyone including the chair. The denial names the way out: read with `Read`, `Grep`, and `Glob`, then `TeamAssign`. -## Why Nori +The main Agent stays a **read-only coordinator** by default (`/setting readonly on`): it does not write files; members execute after Assign. Use `/setting readonly off` only when you want the lead to edit directly. -Most AI coding tools are **single-agent chat shells**: one model, one context, one turn at a time. Nori is built differently: +### Members reach each other, not only upward -- **Parallel, not serial.** Complex tasks decompose into DAG-shaped agent workflows — plan → implement → verify → review — running in parallel with dependency scheduling. -- **Memory, not amnesia.** Architecture decisions, code reviews, and patterns persist in a bidirectional-link vault. What you learned last month is available next session. -- **Policy, not guesswork.** `nori.yaml` enforces deterministic rules: search memory before coding, run tests before exit, review before merge. AI flexibility backed by project discipline. -- **Desktop, not a web tab.** Nori Work is an Electron native workspace — a proper local workbench. +- **`TeamChat`**: peers hired by the same parent share a group channel. The parent does not read it. +- **`TeamDM`**: three named relations by agent id — parent, sibling, member. Task reports (`completed` / `blocked` / `needs_decision`) go to the parent. +- **`TeamStatus`**: `members` plus `colleagues` (peer role, idle/running, assigned task, whether they have reported). A `running` peer is to be left to finish. +- Identity is not transcript copying. Each session’s system prompt gets **``** (id, title, depth, parent, role, mandate, tags, direct members). Mount or identity changes inject **``** / **``** on the next turn. + +### Conversation map + +Sessions form a forest via **`parent_session_id`**. In the TUI, `/map` browses, opens, mounts, and unmounts. In Nori Work / the web UI, **Map** is a pan/zoom canvas for the same tree. `/team` is department membership (open a partner, read reports and this-round Discuss). `/map` is mount topology. They are not the same surface. --- -## Key Features +## 2. Compared with Codex, Claude Code, and Cursor -### 🧠 Multi-Agent DAG Orchestration -SubAgent splits a task into parallel sub-agents with explicit dependency chaining. A multi-file refactor dispatches `{ plan, implement-1, implement-2, verify, review }` concurrently — no manual turn-by-turn handholding. +This table is what those products publicly ship, not a wishlist. Codex, Claude Code, and Cursor are more mature **single-agent coding loops**. Nori is earlier; its bet is a standing department that talks before it codes. -### 👥 Team engineering (2.0) -`TeamCreate` hires durable partners as **mounted child sessions** on the conversation map. Discuss (`TeamDecide` / `TeamSpeak`) gathers statements before `TeamAssign` enters Code; the main Agent stays read-only while members execute. `/team` opens partner sessions; `/map` manages mounts. `TeamDismiss` removes partners and deletes their sessions. Web **Map** mirrors the same forest with pan/zoom and local annotations. +| | **Nori (now)** | **OpenAI Codex CLI / agent** | **Anthropic Claude Code** | **Cursor Agent** (brief) | +|---|---|---|---|---| +| **Shape** | Terminal TUI + local web + Electron desktop | Terminal CLI, also wired into ChatGPT / IDE / cloud | Terminal CLI, also IDE / desktop / browser | VS Code–based AI IDE (the editor is the product) | +| **Main loop** | Read/edit files, `Bash`, search; lead is read-only by default | Single-agent coding loop: files, shell, sandbox + approvals | Same, with a denser tool surface | Same, plus Tab, visual diffs, and editor LSP | +| **Delegation** | **Team Engineering only.** Durable child sessions; Discuss then Assign | **Subagents**: spawn specialists in parallel, collect results on the main thread; custom TOML agents; `/agent` switches threads | **Subagents**: isolated context, configurable tools/models/MCP; `.claude/agents/` | Built-in Explore / Bash / Browser subagents; git worktrees for parallelism | +| **Collaboration model** | Standing department tree + sequentially visible meetings. Designed against **silent parallel work** | Parent orchestrates; children return summaries. Fan-out | Lead coordinates; subagents work and merge. Still closer to fan-out | Agent threads in the editor; isolation is often a worktree | +| **Session topology** | **First-class**: mount forest, `/map`, web Map | Subagent threads you can inspect, not a cross-session department graph | Subagent / background-agent panels | Agents window + worktrees; not Nori’s session tree | +| **Git** | Rough: porcelain badges + REST status/diff/commit/push; the agent mostly uses `Bash` | Git-aware inside the sandbox; app/ChatGPT surfaces are more productized | **Product-grade**: stage, commit, branch, PRs, `--worktree` | Visual diffs, worktrees, cloud agents on isolated checkouts | +| **LSP** | Rough: server discovery, REST, inspector panel; **not** in the agent tool loop | Native LSP still evolving (diagnostics/definition tools are being designed and shipped) | **First-class tool**: definitions, references, post-edit diagnostics | Native — Cursor *is* the editor | +| **Permissions / sandbox** | Tool approvals + Discuss write-block; **filesystem sandbox still planned** | Local sandbox + approval modes; subagents inherit | Fine-grained allow/deny/ask and several permission modes | Editor permissions + cloud isolation | +| **MCP / Skills** | Present (stdio / HTTP / SSE; Skills, Hooks, Plugins) — inherited from upstream, usable | MCP, Skills, Plugins, `AGENTS.md` | MCP, Skills, Hooks, `CLAUDE.md` | MCP, Rules, Skills; marketplace and team config are further along | +| **Memory** | Obsidian-compatible vault (`nori_memory_search` / `nori_memory_write`) | Memories + `AGENTS.md` | `CLAUDE.md` / auto-memory | Rules + Memories | +| **Models** | Any OpenAI-compatible provider (local or cloud) | Primarily OpenAI / ChatGPT plans | Primarily Claude | Multi-model | -### 📚 Persistent Project Memory -Every decision, review, and pattern lands in an Obsidian-compatible vault with `[[wiki-links]]`. The planner searches it automatically before each implementation phase. Cross-session knowledge means Nori gets smarter about *your project* over time. +### Where Nori is strong -### ⚙️ Policy-as-Code (`nori.yaml`) -Codify project rules that the agent loop enforces automatically: -```yaml -rules: - - name: search_before_code - condition: { on_phase: implement, stage: enter } - prompt: "Search vault for prior decisions and patterns." - enforced: true -``` -Orchestrator, coder, and reviewer can each use a different model/provider. +- **Durable partners, not disposable workers.** A `TeamCreate` hire is a real session on the map: it can meet, remount, and be dismissed. Codex and Claude Code subagents are strong at “spawn, finish, summarize back.” +- **The meeting exists to catch mismatch early.** Later speakers must read earlier statements; Code can reopen Discuss mid-flight. That is the opposite of “everyone reports done, then reconcile.” +- **The session tree is UI, not just runtime.** `/team`, `/map`, the web Map, and the Discuss/Chat inspector are faces of the same mount forest. +- **Peer channels.** Siblings use `TeamChat` / `TeamDM` to hand off file boundaries without routing every detail through the chair. -### 🔌 Provider Flexibility -Bring any OpenAI-compatible provider — local (Ollama, LM Studio) or cloud. Each agent role (orchestrator / coder / reviewer) can run its own model. +Those strengths sit on a young runtime. They are not yet the polished daily coding loop Codex and Claude Code already sell. -### 🖥️ Nori Work Engineering Workspace -Nori Work keeps the conversation, project files, live code changes, Git operations, LSP results, a persistent PTY terminal, and a multi-tab embedded browser in one resizable desktop layout. Inspector tools can be reordered or opened in standalone windows. Custom Agent roles define their own instructions and explicit read, write, terminal, web, and delegation permissions. +### What they have that we do not (on purpose, or not yet) -Agent and SubAgent work always runs in the background. The main model can inspect, pause, guide, resume, or stop a SubAgent while the collaboration view shows its project/session tree, status, output, and token usage. +Codex and Claude Code still ship a **polished throwaway-subagent fan-out** (parallel explore/review, summaries back to the parent). Nori removed that path in v2 because two delegation systems and silent parallel work were the failure mode. If you want “one lead plus a pile of workers that disappear when the task ends,” they are the better fit today. Nori’s bet is that a hard change is worth a meeting first. -### 🌐 Agent-Controlled Browser -The embedded browser is available to the main Agent through a structured Browser tool: navigate, snapshot stable element references, click, type, upload files, capture screenshots, inspect console/network activity, and work with page annotations. It supports web URLs and local `.html`/`.htm` files while blocking privileged URLs and arbitrary local files. User takeover can pause automation at any time, and actions fail immediately with actionable feedback when no page is open. +--- + +## 3. Honest gaps + +The project owner described LSP and Git as a rough shell (「毛坯房」). After checking the code and `CHANGELOG.md`, at least the following is also true. + +### LSP and Git (rough) + +- **LSP:** `LspService` can start language servers. REST exposes `status` / `request` (diagnostics, hover, definition, references, symbols, rename, format). Nori Work has an inspector panel that loads diagnostics and document symbols for the selected file. The agent has **no** Claude Code–style `LSP` tool, and the edit loop does not consume diagnostics automatically. Discovery covers common servers; “fix the type error the language server just published” is not a product loop. +- **Git:** The file tree can show porcelain status. The server implements `git status` / `diff` / `commit` / `push`. The web client binds those APIs; **commit and push are not a complete UI**. There is no Claude Code flow of stage → message → PR → worktree. Today the agent changes a repo mostly by running git through `Bash`. + +### Other gaps verified in this repo -### 🔗 Obsidian-Compatible Knowledge -Memory notes use vault-relative `[[folder/note|Title]]` links. Nori Work renders outgoing links, backlinks, and the movable knowledge graph while retaining compatibility with legacy vault layouts and Obsidian. +- **TUI test debt** (from the changelog): about 66 failing tests across 25 files in `apps/nori-code`. They still assert the pre-rename `kimi-code` home directory, user-agent, and command names, or slash commands the registry has not exposed for a long time. The count moved from 68 to 66 only because SubAgent’s own tests were deleted with the feature. +- **Dual-write hire:** The product path is “empty child session + mount + a team agent on the parent.” Discuss/Assign speak agent ids; the map speaks session ids. After a crash, an idempotent sync has to reattach both sides. Known seam, not a unified identity model. +- **Kimi naming leftovers:** The TUI coordinator is still `KimiTUI`; build macros are `__KIMI_CODE_*`; native cache paths can still land under `kimi-code`; the docs theme and many VitePress pages still carry upstream branding and SubAgent copy. `pnpm check:brand` catches public brand drift; it does not mean every internal identifier is gone. +- **Map peer/service edges live in localStorage:** Parent edges are server `parent_session_id`. Peer edges, service edges, annotations, and pinned positions live in `nori-session-map-doc`. Clearing site data drops them. Server-side graph storage has not landed (see `docs/adr/pre.1-session-node-graph.md`). +- **`nori.yaml` is not a DAG scheduler:** The file still contains `phases:`, step lists, and leftover SubAgent rules. What the runtime actually uses is rule-prompt injection plus review / memory / bug-hunt **gates** (score activity, inject instructions). There is no `depends_on` node runner. Older README text that sold this YAML as policy-as-code DAG orchestration overclaimed. +- **Filesystem sandbox:** Still planned. The default system prompt says the environment is **not** sandboxed and actions hit the user’s machine immediately. +- **Docs lag:** VitePress still has pages that present SubAgent and Team as coexisting, or DAG orchestration as the product. This README is the source of truth; the worst landing-page contradictions are fixed or bannered toward here. The whole site is not rewritten in this change. --- -## Roadmap +## Products + +| | Nori Code | Nori Work | +|---|---|---| +| **What** | Terminal CLI/TUI | Electron desktop workbench | +| **Who** | Terminal-first | Conversation, files, browser, and terminal in one window | +| **UI** | Split-pane TUI | Multi-panel desktop | +| **Start** | `nori` | Standalone installer ([Releases](https://github.com/wangyuahn/nori-code/releases)) | + +The same sessions can also open with `nori web`. Do not edit the **same session** in the TUI and Nori Work at once (mount metadata and transcripts can race). -| Priority | Feature | Status | -|----------|---------|--------| -| P0 | **Built-in LSP** — diagnostics, hover, definitions, references, symbols, rename, and formatting | ✅ Implemented | -| P0 | **Custom Agent Profiles** — user-defined roles, prompts, base profiles, and tool permissions | ✅ Implemented | -| P0 | **Nori Work — Embedded Terminal** (persistent node-pty sessions) | ✅ Implemented | -| P0 | **Nori Work — Embedded Browser** (isolated WebContentsView tabs for research and preview) | ✅ Implemented | -| P0 | **Nori Work — Filesystem Sandbox** (whitelist + blocklist) | 📝 Planned | -| P0 | **Nori Work — System Tray / Notifications** | ✅ Implemented | -| P0 | **Nori Work — Secure Preload Bridge** | ✅ Implemented | -| P1 | **Agent Browser Tool** — navigation, snapshots, interaction, uploads, diagnostics, and annotations | ✅ Implemented | -| P0 | **Team engineering** — department tree, Discuss/Assign, conversation map, `/team` / `/map` | ✅ Implemented | +Also present, inherited from upstream, and **not** claimed as freshly polished: MCP, Agent Skills, Hooks, Plugins, the Obsidian-style vault, the embedded browser tool, provider config, Cron, and tool-approval permissions. --- -## Quick Start +## Quick start ```sh npm install -g nori-code @@ -116,11 +133,13 @@ nori # One-shot prompt nori -p "your task" -# Start the local web workspace +# Local web workspace nori web ``` -Nori Work is available as a **standalone desktop installer**. Download the stable [v1.0.0 release](https://github.com/wangyuahn/nori-code/releases/tag/v1.0.0), or browse all builds on [Releases](https://github.com/wangyuahn/nori-code/releases). +Requires Node.js `>=24.15.0` (root `engines`; `.npmrc` sets `engine-strict`). After entering a project, `/login` or `/provider`. Team workflow: [Team engineering](docs/en/guides/team-engineering.md). + +Nori Work ships as a **standalone installer**: [Releases](https://github.com/wangyuahn/nori-code/releases). Desktop package tags may still say 1.x; **delegation follows the v2 changelog and this README**. ### From source @@ -142,10 +161,10 @@ pnpm dev:desktop # Desktop workbench | Package | Role | |---------|------| | `apps/nori-code` | CLI/TUI entry point | -| `apps/nori-web` | Web UI (loaded by desktop) | +| `apps/nori-web` | Web UI (also loaded by desktop) | | `apps/nori-desktop` | Electron desktop workbench | -| `packages/agent-core` | Agent, session, Team/SubAgent, tool, workflow engine | -| `packages/server` | REST/WebSocket server | +| `packages/agent-core` | Agent, session, Team, tools, memory, workflow gates | +| `packages/server` | REST/WebSocket (`/api/v1`) | | `packages/kosong` | Model/provider abstraction | | `packages/kaos` | File, process, environment abstractions | | `packages/node-sdk` | Public TypeScript SDK | @@ -160,13 +179,13 @@ pnpm typecheck pnpm lint pnpm test pnpm build -pnpm check:brand # Verify no stray Kimi branding +pnpm check:brand # Public copy should not still say Kimi ``` -Run focused checks per affected package first; expand to root-level checks before commit. +Run focused checks on the packages you touched. Root `pnpm test` is not a green bar today — see TUI test debt above. --- ## License -MIT. Based on [Kimi Code CLI](https://github.com/MoonshotAI/kimi-code) (MIT), from which Nori forked and grew its own architecture: multi-agent DAG orchestration, persistent memory, desktop environment, policy engine, and independent branding. Required upstream compatibility is maintained where shared protocol surfaces apply. +MIT. Forked from [Kimi Code CLI](https://github.com/MoonshotAI/kimi-code) (MIT). Required upstream compatibility is kept where shared protocol surfaces apply. The product direction is Team Engineering, not upstream temporary-SubAgent orchestration. diff --git a/README.zh-CN.md b/README.zh-CN.md index 05233d12..6af34cc6 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,8 +1,8 @@ # Nori Code / Nori Work -> **多智能体编程工作区 —— 分解、分发、验证、记忆。** +> **早期项目。** 当前产品是 **团队工程**:持久的部门树、先 Discuss 再 Assign、用 `parent_session_id` 连起来的会话地图。已删除的 SubAgent DAG **不是** 产品路径。 -Nori 编排多个 AI Agent 协同完成代码的规划、实现、审查和跨会话知识持久化。不是一个聊天的代码工具,而是一个**多 Agent 工程工作台**。 +Nori 是一个从 [Kimi Code CLI](https://github.com/MoonshotAI/kimi-code)(MIT)fork 出来的编程 Agent 工作区。终端里是 Nori Code;桌面端是 Nori Work。和 Codex / Claude Code 一样,它能读改代码、跑命令、接 MCP;和它们不一样的地方,是它把「把活交给另一个 Agent」做成了**长期部门**,而不是一次性 fan-out。 [English](README.md) @@ -11,97 +11,114 @@ Nori 编排多个 AI Agent 协同完成代码的规划、实现、审查和跨 ![Nori Work 浏览器工作区](docs/images/nori-work-browser.png) > [!NOTE] -> **v2.0** 新增**团队工程**:持久伙伴会话组成的部门树、进入 Code 前的 Discuss/Assign,以及由 `parent_session_id` 连接的**会话地图**(TUI `/map`、Nori Work **Map**)。身份通过 `` 与挂载变更通知注入,而非复制 transcript。 +> 最新发布说明见 [CHANGELOG.md](CHANGELOG.md) 的 `v2.0.0-pre.0`。那一节才是当前委派模型的源。更早条目里的 SubAgent、DAG、`nori_swarm_launch` 描述的是已经拿掉的路径。 -> [!NOTE] -> **v1.0.0** 是 Nori Code 与 Nori Work 的首个正式稳定版本。升级时会完整覆盖旧版 Nori Work 程序文件,同时保留用户数据。 +--- -### v1.0.0 包含的内容 +## 1. 现在的 Nori 是什么 -- 没有打开页面时,Browser 的页面操作不再等待 90 秒桥接超时;Agent 会立即收到“先导航”的可执行提示。 -- 桌面桥接重连期间 Browser 工具仍保持注册;独立心跳避免长时间操作被误判为离线。 -- 内嵌浏览器可直接打开本地 `.html` 与 `.htm`,但不会放开任意 `file://` 文件访问。 -- 桌面打包会拒绝陈旧的 Web/SEA 产物;启动时会恢复陈旧或不兼容的本地服务锁,不再静默连接旧后端。 -- 普通 Agent 与 SubAgent 按项目和会话展示调用归属、嵌套关系、输出、正确完成数量及完成/失败状态。 -- 点击“对话”会可靠返回聊天主区域与会话列表。 -- Vault 不再创建空的旧版复数目录;Related 使用 Obsidian 兼容路径,并同时显示出链与反向链接。 -- 内置 LSP 可发现主流语言服务器,不再在已有可用服务器时统一提示“未配置语言服务器”。 +**团队工程(Team Engineering)** 是现在把工作交给另一个 Agent 的**唯一**方式。临时 `SubAgent` 工具、`'sub'` 节点、TUI 的 subagent 进度条都已删除。原因写在 changelog 里:两个 spawn 路径会变成两套「现在谁在干活」的状态源;更重要的是,一次性子 Agent 各自闷头做完再汇报,错位假设要到 `done` 才露面——那是 fan-out,不是团队。 ---- +### 部门树,不是任务池 -## 产品形态 +- 每个 Agent 可以用 `TeamCreate` 雇佣自己的成员,并主持自己的部门。深度受 `team.maxDepth` 约束(默认 `2`,上限 `5`)。 +- 一次 Discuss 的范围是**一个部门**:父节点 + 它的直接成员。节点不会同时当主席又当发言人。 +- 雇佣走的是和会话地图同一条路径:创建一个**真实子会话**,用 `parent_session_id` 挂到你下面,地图上就是一张会话卡片。同时会 **dual-write** 一个团队 Agent,好让 Discuss / Assign 仍按本部门的 agent id 寻址。这是实现上的双写,不是已经磨平的统一身份(见 [缺口](#3-诚实的缺口))。 +- `TeamDismiss` 移除成员并**删除**对应子会话。地图上的 Unmount 是用户操作:只拆挂载,不删会话。一个会话目前只能有一个父节点。 -| | Nori Code | Nori Work | -|---|---|---| -| **定位** | 终端 CLI/TUI | Electron 桌面工作台 | -| **适合谁** | 终端重度用户 | 桌面 IDE 偏好者 | -| **界面** | Ink 分屏 TUI | 多面板 Electron 桌面 | -| **启动** | `nori` | 独立安装包(见 releases) | +### 先 Discuss,再 Code ---- +典型流程: + +1. **`TeamCreate`** — 只雇当前工作真正需要的人(`name` / `role` / `mandate`)。 +2. **`TeamDecide action=start`** — 主席抛出目标、约束和未决问题,**还没有**固定方案。 +3. **`TeamSpeak`** — 成员轮流发言。后发言的人会读到本轮已发表的全部内容;光附和不算贡献。一轮只推进一步。 +4. **`TeamAssign`** — 给每个成员恰好一份任务(`task=null` 表示闲置)。成功则离开 Discuss,进入 Code。 +5. 计划变了、两人要碰到同一块地、或进展卡住时,用 **`TeamDecide action=continue`** 再开会,而不是等所有人报 `done` 再对账。 + +Discuss 开着时,包括主席在内,`Write`、`Edit`、`Bash`、`TaskStop`、`CronCreate`、`CronDelete` 都会被拒绝。出路写在拒绝信息里:用 `Read` / `Grep` / `Glob` 弄清事实,然后 `TeamAssign`。 -## 为什么是 Nori +主 Agent 默认是**只读协调者**(`/setting readonly on`):自己不写文件,成员在 Assign 之后执行。需要负责人直接改代码时再用 `/setting readonly off`。 -大多数 AI 编程工具是**单 Agent 聊天壳** —— 一个模型、一个上下文、一问一答。Nori 不一样: +### 成员之间能直接说话 -- **并行而非串行。** 复杂任务拆解为 DAG 结构的 Agent 工作流 —— 规划 → 实现 → 验证 → 审查 —— 带依赖调度的并行执行。 -- **记忆而非失忆。** 架构决策、代码审查、设计模式持久化到双向链接记忆库。上个月学到的东西,下个会话还能用。 -- **策略而非猜测。** `nori.yaml` 强制执行确定性规则:编码前搜索记忆、退出前跑测试、合并前审查。AI 的灵活性加上项目级的纪律约束。 -- **桌面而非浏览器标签。** Nori Work 是基于 Electron 的原生桌面工作台。 +- **`TeamChat`**:同一父节点雇来的同事共享群聊;父节点不读这条通道。 +- **`TeamDM`**:按 agent id 找到三种关系——上级、同级、自己雇的成员。任务汇报(`completed` / `blocked` / `needs_decision`)走给上级的 DM。 +- **`TeamStatus`**:除了自己的 `members`,还报告 `colleagues`(同事的角色、idle/running、任务、是否已向上级汇报)。`running` 的同事不该被抢活。 +- 身份不靠复制 transcript。每个会话的 system prompt 注入 **``**(id、标题、深度、父节点、角色、职责、标签、直接成员);挂载或身份变更时下一回合注入 **``** / **``**。 + +### 会话地图 + +会话靠 **`parent_session_id`** 连成森林。TUI 用 `/map` 浏览、打开、挂载、卸载;Nori Work / Web 侧栏有 **Map** 画布(平移、缩放、建子会话、改挂)。`/team` 管部门成员(打开伙伴会话、看汇报和本轮 Discuss);`/map` 管挂载拓扑。二者不是同一件事。 --- -## 核心能力 +## 2. 和其他工具比 -### 🧠 多 Agent DAG 编排 -SubAgent 将任务拆解为带显式依赖链的并行子 Agent。多文件重构自动派发 `{ 规划, 实现-1, 实现-2, 验证, 审查 }` 并行工作,无需手动一问一答。 +下面按**现在公开能核对的能力**写,不按愿景写。Codex、Claude Code、Cursor 都是更成熟的单 Agent 编程循环;Nori 还早,赌注放在「长期部门 + 会前对齐」。 -### 👥 团队工程(2.0) -`TeamCreate` 将会话地图上的**挂载子会话**雇佣为持久伙伴。Discuss(`TeamDecide` / `TeamSpeak`)在 `TeamAssign` 进入 Code 前收集团队发言;主 Agent 保持只读,成员执行分配任务。`/team` 打开伙伴会话;`/map` 管理挂载。`TeamDismiss` 移除伙伴并删除对应会话。Web **Map** 提供同一挂载森林的平移/缩放与本地标注。 +| | **Nori(现在)** | **OpenAI Codex CLI / Agent** | **Anthropic Claude Code** | **Cursor Agent**(简写) | +|---|---|---|---|---| +| **形态** | 终端 TUI + 本地 Web + Electron 桌面 | 终端 CLI,并接到 ChatGPT / IDE / 云端 Agent | 终端 CLI,并接到 IDE / 桌面 / 浏览器 | VS Code 系 AI IDE(编辑器才是主场) | +| **主循环** | 读/改文件、`Bash`、搜索;主 Agent 默认可读不可写 | 单 Agent 编码循环:文件、Shell、沙箱与审批 | 同左,工具面更完整 | 同左,再加 Tab 补全、可视化 diff、编辑器 LSP | +| **把活分出去** | **唯一路径:团队工程。** 雇持久子会话,先 Discuss 再 Assign | **Subagents**:按需拉起专职 Agent 并行干活,结果收回主线程;可用 TOML 自定义;CLI 用 `/agent` 切线程 | **Subagents**:独立上下文,可配工具 / 模型 / MCP;`.claude/agents/` | 内置 Explore / Bash / Browser 子 Agent;可用 worktree 并行 | +| **协作模型** | 站着的部门树 + 轮流可见的会。要防的是**沉默并行** | 主线程编排、子 Agent 做完交摘要。偏 fan-out | 主 Agent 协调、子 Agent 做事再合并。仍更接近 fan-out | 编辑器里的 Agent 线程;隔离多用 git worktree | +| **会话拓扑** | **一等公民**:挂载森林、`/map`、Web Map | 子 Agent 线程可打开检查,不是跨会话部门图 | 子 Agent / 后台 Agent 面板 | Agent 窗口 + worktree;不是 Nori 这种会话树 | +| **Git** | 毛坯:状态徽标 + REST 的 status/diff/commit/push;Agent 主要靠 `Bash` | 沙箱内 git-aware;产品级提交/PR 体验随 Codex App / ChatGPT 走 | **产品级**:stage、commit、branch、PR、`--worktree` | 可视化 diff、worktree、云端 Agent 走独立 checkout | +| **LSP** | 毛坯:有语言服务器发现、REST、检查器面板;**没有**进 Agent 工具循环 | 原生 LSP 仍在演进(诊断/定义等工具有公开设计与实现讨论) | **一等工具**:定义、引用、诊断,改码后可吃 LSP 反馈 | 编辑器自带 LSP,这是它的主场 | +| **权限 / 沙箱** | 工具审批 + Discuss 只读闸门;**文件系统沙箱仍是规划** | 本地沙箱 + 审批模式,子 Agent 继承 | 细粒度 allow/deny/ask;多种 permission mode | 编辑器权限 + 云端隔离 | +| **MCP / Skills** | 有(stdio / HTTP / SSE;Skills、Hooks、Plugins)——从上游继承,能用 | MCP、Skills、Plugins、`AGENTS.md` | MCP、Skills、Hooks、`CLAUDE.md` | MCP、Rules、Skills;市场与团队配置更完整 | +| **记忆** | Obsidian 兼容 vault(`nori_memory_search` / `nori_memory_write`) | Memories + `AGENTS.md` | `CLAUDE.md` / auto-memory | Rules + Memories | +| **模型** | 任意 OpenAI 兼容 Provider(本地或云) | 以 OpenAI / ChatGPT 计划为主 | 以 Claude 为主 | 多模型 | -### 📚 持久项目记忆 -每个决策、审查和模式都写入 Obsidian 兼容的 `[[双向链接]]` 记忆库。规划阶段自动检索历史上下文。Nori 会随着时间推移越来越了解**你的项目**。 +### Nori 相对强在哪 -### ⚙️ 策略即代码 (`nori.yaml`) -将项目规则编码为 Agent 循环自动执行: -```yaml -rules: - - name: search_before_code - condition: { on_phase: implement, stage: enter } - prompt: "搜索记忆库,查找已有决策和模式。" - enforced: true -``` -编排器、编码器和审查器可各自使用不同的模型/Provider。 +- **长期伙伴,不是一次性工人。** `TeamCreate` 雇出来的是地图上的真实会话,能开会、能改挂、能解雇。Codex / Claude Code 的 subagent 很强,但默认是「拉起来、干完、把摘要交回主线程」。 +- **会是为了对齐,不是为了收工。** Discuss 里后发言的人必须读到前面的话;Code 中途还能 `continue`。这是刻意和「各做各的,最后对账」对着干。 +- **会话树是 UI,不只是内部实现。** `/team`、`/map`、Web Map、部门 Chat / Discuss 检查器是同一套挂载森林的不同面。 +- **同事通道。** 同级用 `TeamChat` / `TeamDM` 交接文件边界,不必每件事都经过主席。 -### 🔌 Provider 灵活接入 -接入任何兼容 OpenAI 接口的 Provider —— 本地(Ollama、LM Studio)或云端。每个 Agent 角色(编排器/编码器/审查器)可使用不同模型。 +这些强项建立在一个仍很新的运行时上。它们还不是 Codex / Claude Code 那种打磨过的日常编码体验。 -### 🖥️ Nori Work 工程工作台 -Nori Work 将对话、项目文件、实时代码更改、Git 操作、LSP 结果、持久 PTY 终端和多标签内嵌浏览器放在同一个可调整大小的桌面布局中。右侧检查器工具可以调整顺序,也可以单独打开为独立窗口。用户可创建自定义 Agent 角色,并分别配置角色说明以及读取、写入、终端、联网和委派权限。 +### 对方有、我们刻意不做或还没做的 -SubAgent 始终可以一次启动多个子会话。主模型可以查询、暂停、插入指令、恢复或终止这些子会话;团队树按项目和会话展示调用树、状态、输出与 token 用量。 +Codex 和 Claude Code 仍然提供**打磨过的一次性 subagent fan-out**(并行探索、审查、收摘要)。Nori 在 v2 删掉了这条路径,因为两套委派和沉默并行是当时要关掉的失败模式。如果你要的是「主 Agent + 一堆用完即走的工人」,他们现在更合适。Nori 赌的是:复杂改动值得先开会。 -### 🌐 Agent 可控浏览器 -主 Agent 可通过结构化 Browser 工具操作内嵌浏览器:导航、获取带稳定元素引用的页面快照、点击、输入、上传文件、截图、检查控制台与网络活动,以及处理网页标注。浏览器支持网页 URL 和本地 `.html`/`.htm` 文件,同时拦截特权 URL 与任意本地文件。用户可以随时接管并暂停自动化;没有打开页面时,操作会立即返回可执行的错误提示,而不是等待超时。 +--- + +## 3. 诚实的缺口 + +用户原话:LSP 和 Git 基本是「毛坯房」。对照代码和 `CHANGELOG.md` 之后,至少还有这些。 + +### LSP 和 Git(毛坯房) + +- **LSP**:`LspService` 能拉起语言服务器,REST 上有 `status` / `request`(diagnostics、hover、definition、references、symbols、rename、format)。Nori Work 检查器里有一个按当前文件拉诊断和符号的面板。Agent **没有** Claude Code 那种 `LSP` 工具,改码循环也不会自动吃诊断。发现逻辑能找到常见语言服务器,但离「改完就能用类型信息纠错」还早。 +- **Git**:文件树可以打 porcelain 状态;服务端有 `git status` / `diff` / `commit` / `push`。Web 客户端绑了这些 API,**提交和推送没有做成完整 UI**。没有 Claude Code 那种 stage → 写 message → 开 PR → worktree 的产品流。Agent 改仓库,今天主要还是 `Bash` 跑 git。 + +### 代码里核对过的其它缺口 -### 🔗 Obsidian 兼容知识库 -记忆笔记使用 Vault 相对路径格式 `[[folder/note|Title]]`。Nori Work 可展示出链、反向链接和可移动的知识图谱,同时兼容旧 Vault 布局与 Obsidian。 +- **TUI 测试债**(changelog 原文):`apps/nori-code` 里约 66 个测试、25 个文件失败。一部分还在断言改名之前的 `kimi-code` 家目录、UA、命令名;一部分在断言注册表很久没再暴露的斜杠命令。数量从 68 降到 66,只是因为 SubAgent 自己的测试随功能一起删了。 +- **雇佣 dual-write**:产品路径是「空子会话 + 挂载 + 父会话里再挂一个 team agent」。Discuss / Assign 仍按 agent id 说话;地图按 session id 说话。crash 之后要靠幂等 sync 把两边对齐。这是已知接缝,不是已经统一的身份模型。 +- **Kimi 命名残留**:TUI 协调器仍叫 `KimiTUI`;构建宏是 `__KIMI_CODE_*`;原生缓存目录仍能落到 `kimi-code`;文档站组件和不少 VitePress 页面还带着上游品牌与 SubAgent 说法。`pnpm check:brand` 管的是对外品牌漂移,不是一次清完所有内部标识。 +- **Map 的 peer / service 边只在 localStorage**:父边以服务端 `parent_session_id` 为准。对等边、服务边、标注、钉住的位置写在 `nori-session-map-doc` 里,换浏览器或清站点数据就会丢。服务端图存储还没落地(见 `docs/adr/pre.1-session-node-graph.md`)。 +- **`nori.yaml` 不是 DAG 调度器**:文件里有 `phases:`、步骤、甚至旧的 SubAgent 规则,但运行时真正读的是规则 prompt 注入,以及 review / memory / bug-hunt **闸门**(复杂度打分后往上下文里塞指令)。没有一个按 `depends_on` 跑节点的编排引擎。旧 README 把这份 YAML 写成「策略即代码的 DAG」,那是超售。 +- **文件系统沙箱**:仍是规划。默认 system prompt 写明环境**不在沙箱里**,动作会立刻作用在用户机器上。 +- **文档滞后**:VitePress 里仍有页面把 SubAgent 和 Team 写成并存,或把 DAG 当产品。根 README 以本节为准;站点最刺眼的几处会改掉或挂上指向这里的提示,整站不会在这次重写。 --- -## 开发路线 +## 产品形态 + +| | Nori Code | Nori Work | +|---|---|---| +| **是什么** | 终端 CLI / TUI | Electron 桌面工作台 | +| **适合谁** | 终端优先 | 想把对话、文件、浏览器、终端放在一起 | +| **界面** | 分屏 TUI | 多面板桌面 | +| **启动** | `nori` | 独立安装包(见 [Releases](https://github.com/wangyuahn/nori-code/releases)) | + +同一套会话也可以 `nori web` 开本地 Web。TUI 和 Nori Work 不要同时改**同一个会话**(挂载元数据和 transcript 会竞态)。 -| 优先级 | 功能 | 状态 | -|--------|------|------| -| P0 | **内置 LSP** — 诊断、悬浮信息、定义、引用、符号、重命名和格式化 | ✅ 已实现 | -| P0 | **自定义 Agent 配置** — 自定义角色、Prompt、基础 Profile 与工具权限 | ✅ 已实现 | -| P0 | **Nori Work — 内嵌终端**(持久 node-pty 会话) | ✅ 已实现 | -| P0 | **Nori Work — 内嵌浏览器**(用于研究与预览的隔离 WebContentsView 标签页) | ✅ 已实现 | -| P0 | **Nori Work — 文件系统沙箱**(白名单 + 黑名单) | 📝 规划中 | -| P0 | **Nori Work — 系统托盘 / 通知** | ✅ 已实现 | -| P0 | **Nori Work — 安全 Preload 桥接** | ✅ 已实现 | -| P1 | **Agent 内置浏览器** — 导航、快照、交互、上传、诊断与网页标注 | ✅ 已实现 | -| P0 | **团队工程** — 部门树、Discuss/Assign、会话地图、`/team` / `/map` | ✅ 已实现 | +其它从上游带过来、现在仍能用的能力(不假装已经打磨完):MCP、Agent Skills、Hooks、Plugins、Obsidian 风格记忆库、内嵌浏览器工具、Provider 配置、Cron、权限审批。 --- @@ -113,14 +130,16 @@ npm install -g nori-code # 交互式 TUI nori -# 单次任务 +# 一次性 prompt nori -p "你的任务" -# 启动本地 Web 工作台 +# 本地 Web 工作台 nori web ``` -Nori Work 桌面版提供**独立安装包**。可直接下载正式稳定的 [v1.0.0](https://github.com/wangyuahn/nori-code/releases/tag/v1.0.0),或在 [Releases](https://github.com/wangyuahn/nori-code/releases) 查看全部构建。 +需要 Node.js `>=24.15.0`(仓库 `engines`;`.npmrc` 开了 `engine-strict`)。首次进入项目目录后 `/login` 或 `/provider`。团队工作流见文档站 [团队工程](docs/zh/guides/team-engineering.md)。 + +Nori Work 提供**独立安装包**:[Releases](https://github.com/wangyuahn/nori-code/releases)。当前桌面包版本号可能仍停在 1.x 标签;**委派模型以 v2 changelog 和这份 README 为准**。 ### 从源码运行 @@ -141,32 +160,32 @@ pnpm dev:desktop # 桌面工作台 | 包 | 职责 | |----|------| -| `apps/nori-code` | CLI/TUI 入口 | -| `apps/nori-web` | Web UI(桌面端加载) | +| `apps/nori-code` | CLI / TUI 入口 | +| `apps/nori-web` | Web UI(桌面端也会加载) | | `apps/nori-desktop` | Electron 桌面工作台 | -| `packages/agent-core` | Agent、Session、Team/SubAgent、Tool、Workflow 引擎 | -| `packages/server` | REST/WebSocket 服务 | -| `packages/kosong` | 模型/Provider 抽象层 | +| `packages/agent-core` | Agent、Session、Team、工具、记忆与工作流闸门 | +| `packages/server` | REST / WebSocket(`/api/v1`) | +| `packages/kosong` | 模型 / Provider 抽象 | | `packages/kaos` | 文件、进程、环境抽象 | | `packages/node-sdk` | 公开 TypeScript SDK | | `packages/oauth` | 认证与 Provider 注册 | --- -## 开发与验证 +## 开发 ```sh pnpm typecheck pnpm lint pnpm test pnpm build -pnpm check:brand # 检查是否残留 Kimi 品牌标识 +pnpm check:brand # 检查对外文案是否残留 Kimi 品牌 ``` -开发时先跑定点检查,提交前扩大到全量验证。 +开发时先跑定点检查。根目录 `pnpm test` 目前不能当作绿灯:TUI 测试债见上面。 --- ## 协议 -MIT。本项目基于 [Kimi Code CLI](https://github.com/MoonshotAI/kimi-code)(MIT 协议)fork 并发展出自己的架构:多 Agent DAG 编排、持久记忆、桌面环境、策略引擎和独立品牌。在共享协议层面保持必要的上游兼容性。 +MIT。基于 [Kimi Code CLI](https://github.com/MoonshotAI/kimi-code)(MIT)fork。共享协议面保持必要的上游兼容;产品方向已经走到团队工程,而不是上游的临时 SubAgent 编排。 diff --git a/apps/nori-code/README.md b/apps/nori-code/README.md index 2d2841f7..e9c321b5 100644 --- a/apps/nori-code/README.md +++ b/apps/nori-code/README.md @@ -1,6 +1,6 @@ # Nori Code -> Loop-core multi-agent coding CLI. +> Terminal CLI/TUI for Nori. Early project — **Team Engineering** is the product, not the deleted SubAgent DAG. ## Install @@ -15,6 +15,8 @@ Verify: nori --version ``` +Requires Node.js `>=24.15.0`. + ## Quick Start ```sh @@ -28,18 +30,19 @@ On first launch, configure a provider with `/provider` and select a model with ` Take a look at this project and explain the main directories. ``` -## Key Features +## What this CLI does now -- **Tree-structured team.** `TeamCreate` hires durable partners as mounted child sessions. `TeamDecide` / `TeamSpeak` run Discuss; `TeamAssign` enters Code; `TeamDismiss` removes partners and deletes their sessions. +- **Department tree.** `TeamCreate` hires durable partners as mounted child sessions. `TeamDecide` / `TeamSpeak` run Discuss; `TeamAssign` enters Code; `TeamDismiss` removes partners and deletes their sessions. - **Conversation map.** Sessions link via `parent_session_id`. `/map` in the TUI and the Web **Map** view browse, open, mount, unmount, and remount nodes. - **Main read-only by default.** The lead coordinates; members execute assigned tracks. Toggle with `/setting readonly off` when needed. - **Persistent memory.** Architecture decisions and patterns persist in a bidirectional-link vault via `nori_memory_search` / `nori_memory_write`. -- **Policy-as-Code.** `nori.yaml` enforces deterministic rules: search vault before coding, run tests before exit, require review before merge. -- **Desktop workbench.** Nori Work pairs with the CLI for browser, terminal, Git, and the session map on a large screen. +- **Inherited harness.** MCP, Skills, Hooks, and tool approvals come from the Kimi Code fork. They work; they are not the differentiator. + +`nori.yaml` is **not** a DAG scheduler. The runtime injects rule prompts and review/memory gates; it does not execute `phases:` as an orchestrator. LSP and Git in Nori Work are a rough shell. Full comparison and gap list: the project [README](../../README.md). ## Documentation -User docs live under [`docs/`](../docs/) (VitePress, English and Chinese). Start with [Team engineering](../docs/en/guides/team-engineering.md) for 2.0 department workflows, or the project root [README](../README.md) for product overview. +User docs live under [`docs/`](../../docs/) (VitePress, English and Chinese). Start with [Team engineering](../../docs/en/guides/team-engineering.md). ## Repository @@ -47,4 +50,4 @@ User docs live under [`docs/`](../docs/) (VitePress, English and Chinese). Start ## License -MIT. Based on [Kimi Code CLI](https://github.com/MoonshotAI/kimi-code) (MIT) — see the project root [README](../README.md) for the full attribution and history. +MIT. Based on [Kimi Code CLI](https://github.com/MoonshotAI/kimi-code) (MIT) — see the project root [README](../../README.md). diff --git a/docs/.vitepress/theme/components/HomeFeatures.vue b/docs/.vitepress/theme/components/HomeFeatures.vue index 7c16669e..15a9ec2a 100644 --- a/docs/.vitepress/theme/components/HomeFeatures.vue +++ b/docs/.vitepress/theme/components/HomeFeatures.vue @@ -33,7 +33,7 @@ const highlights = computed(() => isZh.value { icon: '🧭', title: '只读协调者', - desc: '主 Agent 默认只读协调;用 /team 打开伙伴会话,SubAgent 仍负责有界临时委派。', + desc: '主 Agent 默认只读协调;用 /team 打开伙伴会话。临时 SubAgent 已删除,委派只走团队工程。', }, ] : [ @@ -50,7 +50,7 @@ const highlights = computed(() => isZh.value { icon: '🧭', title: 'Read-only lead', - desc: 'The main Agent coordinates by default. Open partners with /team; SubAgent still handles bounded temporary work.', + desc: 'The main Agent coordinates by default. Open partners with /team. Temporary SubAgent is gone — Team Engineering is the only delegation path.', }, ]) @@ -70,9 +70,9 @@ const features = computed(() => isZh.value }, { icon: '🤖', - title: 'Agent 与 SubAgent', - desc: '持久团队伙伴与有界临时 SubAgent 并存;主对话保持清爽。', - href: '/zh/customization/agents', + title: '团队伙伴', + desc: '持久部门树是委派的唯一路径;对照 Codex / Claude Code 的说明见 GitHub README。', + href: '/zh/guides/team-engineering', }, { icon: '🔌', @@ -96,9 +96,9 @@ const features = computed(() => isZh.value }, { icon: '🤖', - title: 'Agents and SubAgents', - desc: 'Durable team partners plus bounded temporary SubAgents — main thread stays clean.', - href: '/en/customization/agents', + title: 'Team partners', + desc: 'The department tree is the only delegation path. Comparison with Codex / Claude Code lives in the GitHub README.', + href: '/en/guides/team-engineering', }, { icon: '🔌', @@ -108,10 +108,10 @@ const features = computed(() => isZh.value } ]) -const highlightsTitle = computed(() => isZh.value ? '2.0 开箱即得' : 'Ready in 2.0') +const highlightsTitle = computed(() => isZh.value ? '2.0 的主线' : 'The 2.0 path') const highlightsLede = computed(() => isZh.value - ? '团队工程与会话地图默认就绪。' - : 'Team engineering and the conversation map ship ready to use.') + ? '团队工程与会话地图是当前产品;LSP、Git 等仍是毛坯,见 GitHub README。' + : 'Team engineering and the conversation map are the product. LSP, Git, and other gaps are listed in the GitHub README.') const featuresTitle = computed(() => isZh.value ? '按需深入' : 'Go deeper') const featuresLede = computed(() => isZh.value diff --git a/docs/en/configuration/data-locations.md b/docs/en/configuration/data-locations.md index bf5fd7b0..c04d1ad1 100644 --- a/docs/en/configuration/data-locations.md +++ b/docs/en/configuration/data-locations.md @@ -77,7 +77,7 @@ Inside each session directory: - **`state.json`**: session metadata including title, `lastPrompt`, creation/update timestamps, `forkedFrom`, and mount fields such as `parent_session_id`, `mount_role`, and `mount_mandate` when the session sits on the conversation map. - **`upcoming-goals.json`**: the TUI-only queue created by `/goal next `. It is not part of the agent conversation until a queued goal is promoted after the current goal completes. - **`agents/main/wire.jsonl`**: the main Agent's complete communication record, used for session resumption and replay. -- **`agents/agent-0/` etc.**: main, team, and SubAgent transcript directories, each containing its own `wire.jsonl`. Completed temporary SubAgents remain reopenable in the session archive rather than being deleted. +- **`agents/agent-0/` etc.**: main and team transcript directories, each containing its own `wire.jsonl`. Temporary SubAgent archives from before v2.0 may still exist on disk; new work uses Team child sessions. - **`logs/nori-code.log`**: diagnostic log for this session; only present when a diagnostic event occurs. - **`tasks/`**: background task persistence — `tasks/.json` stores status/pid/exit code; `tasks//output.log` stores output. - **`cron/`**: scheduled task persistence; reloaded into the scheduler when `nori resume` runs. See [Scheduled tasks](../reference/tools.md#scheduled-tasks). diff --git a/docs/en/customization/agents.md b/docs/en/customization/agents.md index c1b488c2..97c88b60 100644 --- a/docs/en/customization/agents.md +++ b/docs/en/customization/agents.md @@ -1,10 +1,12 @@ # Agents and Sub-Agents -Every session in Nori Code CLI is driven by a **main Agent**. The main Agent understands the user's intent, plans steps, calls tools, and when needed dispatches **sub-agents** to handle more focused sub-tasks — for example, exploring an unfamiliar codebase, reviewing multiple implementations in parallel, or planning a large refactor without touching the main context. +Every session in Nori Code CLI is driven by a **main Agent**. In 2.0 the main Agent leads a **department tree** of durable **team partners** (`TeamCreate`). Partners are real child sessions on the conversation map; they Discuss, receive assignments, and execute while the lead stays read-only by default. See [Team engineering](../guides/team-engineering.md). -In Nori Code CLI 2.0, the main Agent also leads a **department tree** of durable **team partners** (`TeamCreate`). Partners are real child sessions on the conversation map, with a dual-write team agent so Discuss still addresses this department; they Discuss, receive assignments, and execute work while the lead stays read-only by default. Temporary **SubAgents** remain the tool for bounded delegation inside a single session archive. See [Team engineering](../guides/team-engineering.md) for the full workflow. +::: warning Note +The temporary `SubAgent` tool and its DAG fan-out were **removed** in v2.0. Team Engineering is the only delegation path. This page still contains leftover SubAgent copy from the Kimi Code fork and should not be read as current product. For what Nori is now versus Codex / Claude Code, see the GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.md). +::: -A sub-agent receives a task description from the main Agent, works in its own isolated context, and then returns its conclusions. It does not communicate with the user directly, and its intermediate reasoning and tool call records do not mix into the main Agent's history. +The sections below are **stale** (built-in sub-agent types, `SubAgent.tasks`, nesting depth). Until this page is rewritten, use Team tools (`TeamCreate`, `TeamDecide`, `TeamSpeak`, `TeamAssign`) instead of anything named SubAgent. ## Main Agent and read-only mode diff --git a/docs/en/guides/getting-started.md b/docs/en/guides/getting-started.md index 6e5f68a3..f016b163 100644 --- a/docs/en/guides/getting-started.md +++ b/docs/en/guides/getting-started.md @@ -15,7 +15,7 @@ The CLI is written in TypeScript, distributed via npm as `nori-code`, and runs o ## Installation -Install the published package globally with npm or pnpm. Requires Node.js 22.19.0 or later (the monorepo development engines may be stricter). +Install the published package globally with npm or pnpm. Requires Node.js 24.15.0 or later (see the repository `engines` field). ```sh node --version @@ -105,7 +105,7 @@ You can also describe a more concrete task directly: Add a function in src/utils that converts any string to kebab-case, and add a unit test for it. ``` -Nori Code CLI plans the steps, delegates implementation through `SubAgent` or hired team partners when the task needs code changes, runs the relevant checks, and tells you what it did at each step. Use `/setting readonly off` if you want the main Agent to edit files directly after approval. +Nori Code CLI plans the steps, hires team partners with `TeamCreate` when the task needs parallel work, runs Discuss before `TeamAssign`, and tells you what it did at each step. Temporary `SubAgent` orchestration was removed in v2.0. Use `/setting readonly off` if you want the main Agent to edit files directly after approval. ::: tip Not sure what to do? Type `/help` Type `/help` at any time to open the built-in command and keyboard shortcut panel. Use `↑`/`↓` to browse and `Esc` to close. To exit, type `/exit`, press `Ctrl-C` twice, or press `Ctrl-D` with the input box empty. diff --git a/docs/en/guides/team-engineering.md b/docs/en/guides/team-engineering.md index 4354f9b4..b1347d6e 100644 --- a/docs/en/guides/team-engineering.md +++ b/docs/en/guides/team-engineering.md @@ -2,19 +2,24 @@ Nori Code CLI 2.0 treats a project as a **department tree**, not a single chat transcript with side notes. `TeamCreate` hires by creating a **mounted child session** (the same class of node the conversation map already shows) plus a dual-write team agent so Discuss still addresses this department. Discuss rounds gather statements before execution. This page explains how those pieces fit together in the terminal and in Nori Work. -## Department tree vs SubAgent +::: warning Note +Temporary `SubAgent` DAG orchestration was **removed** in v2.0. Team Engineering is the only way Nori hands work to another agent. Comparison with Codex / Claude Code, and an honest gap list (LSP and Git are still a rough shell), live in the GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.md). +::: -Two collaboration models coexist: +## Department tree and the conversation map + +There is one collaboration model, shown in two places: - **Team partners** (`TeamCreate`) are **real child sessions** mounted under you. They appear as session cards on the conversation map, keep Discuss/Assign until `TeamDismiss` removes them, and dual-write a team agent so Discuss still addresses this department by agent id. - **Map nodes** are the same class: **real child sessions** linked by `parent_session_id`. Creating or wiring a child on the Web Map canvas uses the same create-child + mount path as `TeamCreate`. A session can have only one parent (part-time / second-parent hire is not supported). -- **SubAgents** (`SubAgent`) are **temporary delegates** archived inside the parent's session directory. They finish a bounded task and return a result; they are not map nodes and are not meant as long-lived departments. + +The dual-write (child session + in-parent team agent) is how Discuss still speaks agent ids while the map speaks session ids. It is a seam, not a finished unified identity. The main Agent stays a **read-only coordinator** by default: direct `Write` / `Edit` are blocked (`/setting readonly on`), while hired members execute assigned tracks after `TeamAssign` leaves Discuss. Use `/setting readonly off` only when you want the lead to edit files directly. ## Discuss and Code -**Discuss** is a read-only team meeting. While it is active, `Write`, `Edit`, `Bash`, `SubAgent`, and several scheduling tools stay blocked until the team enters **Code**. +**Discuss** is a read-only team meeting. While it is active, `Write`, `Edit`, `Bash`, `TaskStop`, `CronCreate`, and `CronDelete` stay blocked until the team enters **Code**. Typical flow: @@ -100,5 +105,5 @@ When Nori server or Nori Work already holds the home-directory lock, the TUI may - [Slash commands](../reference/slash-commands.md) — `/team`, `/map`, `/discuss`, `/web` - [Built-in tools](../reference/tools.md#collaboration-tools) — `TeamCreate`, `TeamAssign`, `TeamDismiss`, and related tools -- [Agents and sub-agents](../customization/agents.md) — read-only main Agent and SubAgent delegation - [Sessions and context](./sessions.md) — storage layout and session metadata +- GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.md) — what Nori is now vs Codex / Claude Code, including gaps diff --git a/docs/en/guides/use-cases.md b/docs/en/guides/use-cases.md index 322286c8..2f700a77 100644 --- a/docs/en/guides/use-cases.md +++ b/docs/en/guides/use-cases.md @@ -24,7 +24,7 @@ How does the event loop in src/runtime work? Where do events originate, and what How is "permission approval" implemented in this project? Which files are involved, and what are the key types? ``` -For large-scale investigations, you can have the main agent dispatch **sub-agents** to handle sub-tasks in parallel. See [Agents and sub-agents](../customization/agents.md). +For large-scale investigations, hire team partners with `TeamCreate` and use Discuss before assigning tracks. See [Team engineering](./team-engineering.md). The GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.md) compares this model with Codex / Claude Code subagents. ## Implementing a new feature diff --git a/docs/en/index.md b/docs/en/index.md index faa77a58..03f0e6d5 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -19,8 +19,8 @@ features: details: Hire durable partners with TeamCreate. Discuss before Code, then TeamAssign — each partner is a real child session on the conversation map. - title: Conversation map details: Sessions link via parent_session_id. Browse and remount with /map in the TUI or the Map view in Nori Work. - - title: SubAgent DAG - details: Bounded temporary delegates still run plan → implement → verify → review in parallel inside a session archive. + - title: Honest about gaps + details: LSP and Git are a rough shell. Throwaway SubAgent DAG orchestration was removed — Team Engineering is the only delegation path. See the GitHub README. - title: Nori Work - details: Electron workbench with chat, browser, terminal, Git, and the same conversation map on a large screen. + details: Electron workbench with chat, browser, terminal, and the same conversation map. Early project — several inspector surfaces are still unfinished. --- diff --git a/docs/en/reference/slash-commands.md b/docs/en/reference/slash-commands.md index 7fff1f11..67d22efb 100644 --- a/docs/en/reference/slash-commands.md +++ b/docs/en/reference/slash-commands.md @@ -4,6 +4,10 @@ Slash commands are built-in control commands provided by Nori Code CLI in the in After typing the full command name, press `Enter` to execute. If the `/`-prefixed input does not match any built-in or Skill command, it is sent to the Agent as a regular message. +::: warning Note +`/subagent` is leftover copy. Temporary SubAgent mode was removed in v2.0; use `/team` and Team tools. See the GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.md). +::: + ::: tip Some commands are only available in the idle state. Executing these commands while a session is streaming output or compacting context will be blocked — press `Esc` or `Ctrl-C` to interrupt first. The "Always available" column in the tables below indicates commands that are also available during streaming. ::: @@ -54,8 +58,8 @@ Some commands are only available in the idle state. Executing these commands whi | `/team [settings]` | `/agents` | Open a hired partner's session, or browse reports and this-round Discuss speech. Enter opens the selected member (Main returns to the lead session). Tab shows details. A discussion row opens the Discuss pane. `/team settings` sets max department depth | Yes | | `/map` | — | Browse the conversation map (session mount forest) for the current working directory. Enter opens a session; M mount (child then parent); U unmount. See [Team engineering](../guides/team-engineering.md) | Yes | | `/plan clear` | — | Clear legacy plan state | No | -| `/subagent on\|off` | — | Turn SubAgent mode on or off without sending a prompt. | No | -| `/subagent ` | — | Turn SubAgent mode on, then send `` as a normal prompt. If the turn completes normally, SubAgent mode turns off automatically. In `manual` permission mode, Nori Code asks whether to switch to `auto` or `yolo` before starting. | No | +| `/subagent on\|off` | — | **Removed in v2.0.** Temporary SubAgent mode is gone; use `/team`. | No | +| `/subagent ` | — | **Removed in v2.0.** Hire partners with Team Engineering instead. | No | | `/goal [...]` | — | Start or manage an autonomous goal | See below | ::: warning diff --git a/docs/en/reference/tools.md b/docs/en/reference/tools.md index db313bcf..8b156ac1 100644 --- a/docs/en/reference/tools.md +++ b/docs/en/reference/tools.md @@ -4,6 +4,10 @@ Built-in tools are the tool set provided by Nori Code CLI alongside its core eng Compared to MCP tools, built-in tools are managed directly by the runtime, their lifecycle is bound to the session, and no external process is required. Both follow the same unified approval mechanism: **read-only tools** (such as `Read`, `Grep`, `Glob`) are automatically allowed by default, while **write and execution tools** (such as `Write`, `Edit`, `Bash`) require user approval by default. Nori's session-level read-only setting blocks direct `Write` and `Edit` calls, but it does not remove file-reading tools or block `Bash`; `Bash` still follows the current permission mode and rules. In YOLO mode, approval for regular tool calls is skipped; Discuss exit approval is not affected. +::: warning Note +`SubAgent` (including `depends_on` DAG tasks) was **removed** in v2.0. Delegation is Team Engineering only. Current product vs Codex / Claude Code: GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.md). +::: + ## File Tools File tools handle reading, writing, and searching the local filesystem — the foundation for code analysis and modification tasks. @@ -65,7 +69,7 @@ In the default Nori read-only posture, the main Agent can still use `Bash` for b | --- | --- | --- | | `TeamDecide` | Main agent | Enter Discuss with `action=start`; continue with `action=continue` | -Discuss is a read-only team meeting. New sessions start here unless the user turned that default off. While Discuss is active, `Write`, `Edit`, `Bash`, `SubAgent`, `TaskStop`, `CronCreate`, and `CronDelete` are blocked. There is no session-file workflow and no `ExitDiscussMode` model exit. +Discuss is a read-only team meeting. New sessions start here unless the user turned that default off. While Discuss is active, `Write`, `Edit`, `Bash`, `TaskStop`, `CronCreate`, and `CronDelete` are blocked. There is no session-file workflow and no `ExitDiscussMode` model exit. **`TeamDecide`** uses `action=start` with a topic and opening statement to enter Discuss, then `action=continue` with a new statement for later rounds. Each `TeamSpeak` is one short point in a multi-round Discuss, not a complete plan. Use `TeamAssign` to enter Code. The UI Discuss/Code toggle can also leave or re-enter this stage. @@ -83,7 +87,6 @@ Collaboration tools handle inter-Agent coordination, user interaction, and Skill | Tool | Default Approval | Description | | --- | --- | --- | -| `SubAgent` | Auto-allow in SubAgent mode; otherwise requires approval | Launch one or many temporary SubAgents | | `TeamCreate` | Auto-allow | Hire durable team partners as child sessions | | `TeamDecide` | Auto-allow | Start/continue discussion, or vote after execution | | `TeamSpeak` | Auto-allow | Publish one short discussion point; not calling it records the turn as skipped (abstention) | @@ -93,8 +96,6 @@ Collaboration tools handle inter-Agent coordination, user interaction, and Skill | `AskUserQuestion` | Auto-allow | Ask the user a question to gather structured input | | `Skill` | Auto-allow | Invoke a registered inline Skill | -**`SubAgent`** is the unified temporary-delegation tool. Launch one or many full child transcripts with `prompt_template` + `items`, `tasks` (including `depends_on` DAGs), or `resume_agent_ids`. Completed SubAgents are archived in the parent session. If a model response calls `SubAgent`, that call must be the only tool call in the response. Do not use SubAgent during Discuss; call TeamAssign first. - **`TeamCreate`** requires a unique `name`, `role`, and `mandate` for every member. Each hire creates a real mounted child session (a session card on the conversation map) and a dual-write team agent so Discuss/Assign still address this department. **`TeamDismiss`** removes members from the department and deletes that child session; provide `reason`, and use `confirm_active=true` only after accepting interruption of active work. Unmount on the map is a separate user action that detaches without deleting. **`TeamUpdate`** changes name, role, mandate, or tags; related sessions receive a reminder and do not start a turn. **`TeamDecide`** `action=start` requires `topic` and the lead `statement`. Members publish only with `TeamSpeak`. After execution, `action=vote` does not require Discuss; every team member votes (`discuss_again` / `proceed` / `abstain`), including members left idle with `task=null`. Session mount changes refresh **``** in each affected session's system prompt and may inject **``** on the next turn. This is identity and topology only — not transcript sharing. See [Team engineering](../guides/team-engineering.md#identity-session_self-and-mount-changes). @@ -105,7 +106,7 @@ Session mount changes refresh **``** in each affected session's sy ## Nori Tools -Nori-specific tools extend the built-in tool set with shared memory, documentation writes, and configured DAG templates. They appear only when the matching provider or runtime feature is available. +Nori-specific tools extend the built-in tool set with shared memory and documentation writes. They appear only when the matching provider or runtime feature is available. | Tool | Default Approval | Description | | --- | --- | --- | @@ -114,12 +115,12 @@ Nori-specific tools extend the built-in tool set with shared memory, documentati **`nori_memory_search`** accepts concrete `keywords`, optional `note_types`, `top_k`, `include_linked`, `link_depth`, `chain_depth`, and `follow_up_keywords`. Use chained retrieval (`chain_depth: 1` or `2`) when the first results reveal better terms or linked notes. -**`nori_memory_write`** records structured notes in the shared vault. Use it for durable task progress, architecture analysis, review findings, and decisions that future turns or subagents should retrieve. +**`nori_memory_write`** records structured notes in the shared vault. Use it for durable task progress, architecture analysis, review findings, and decisions that future turns or team members should retrieve. ## Background Tasks -Background task tools manage tasks started via `Bash`, `SubAgent`, or `AskUserQuestion`. When a task reaches a terminal state, its status and saved output path are automatically delivered back to the Agent; use `TaskOutput` to check progress early. +Background task tools manage tasks started via `Bash` or `AskUserQuestion`. When a task reaches a terminal state, its status and saved output path are automatically delivered back to the Agent; use `TaskOutput` to check progress early. | Tool | Default Approval | Description | | --- | --- | --- | @@ -153,6 +154,6 @@ To prevent all users from firing at the same time on the hour, the scheduler app ## Next steps -- [Agent & Sub-Agents](../customization/agents.md) — Scheduling mechanics and context isolation for the `Agent` tool -- [Hooks](../customization/hooks.md) — Trigger local scripts before and after tool calls +- [Team engineering](../guides/team-engineering.md) — Department tree, Discuss/Assign, conversation map +- [Hooks](../customization/hooks.md) — Trigger local script notifications or interceptions at key points such as tool completion - [Slash Commands](./slash-commands.md) — Quick reference for TUI built-in control commands diff --git a/docs/en/release-notes/changelog.md b/docs/en/release-notes/changelog.md index ba440936..27f22d8c 100644 --- a/docs/en/release-notes/changelog.md +++ b/docs/en/release-notes/changelog.md @@ -6,6 +6,10 @@ outline: 2 This page documents the changes in each Kimi Code CLI release. +::: warning Note +This VitePress changelog is still the **upstream Kimi Code CLI** history. Nori's own releases live in the repository [CHANGELOG.md](https://github.com/wangyuahn/nori-code/blob/master/CHANGELOG.md). Current product is Team Engineering; SubAgent DAG orchestration was removed. See the GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.md). +::: + ## 0.22.0 (2026-07-02) ### Features diff --git a/docs/zh/configuration/data-locations.md b/docs/zh/configuration/data-locations.md index 9ea41ed3..8b20e525 100644 --- a/docs/zh/configuration/data-locations.md +++ b/docs/zh/configuration/data-locations.md @@ -77,7 +77,7 @@ $NORI_CODE_HOME (默认 ~/.nori-code) - **`state.json`**:会话标题、`lastPrompt`、创建/更新时间、`forkedFrom` 等元数据;若会话位于会话地图上,还会包含 `parent_session_id`、`mount_role`、`mount_mandate` 等挂载字段。 - **`upcoming-goals.json`**:由 `/goal next ` 创建的 TUI 专属队列。它不属于 Agent 对话;只有当前目标完成并提升后续目标后,才会进入 Agent 对话。 - **`agents/main/wire.jsonl`**:主 Agent 的完整通信记录,用于会话恢复和回放。 -- **`agents/agent-0/` 等**:主 Agent、团队伙伴和 SubAgent 的会话记录目录,各自含 `wire.jsonl`。已完成的临时 SubAgent 会保留在会话归档中并可重新打开,不会被删除。 +- **`agents/agent-0/` 等**:主 Agent 与团队伙伴的会话记录目录,各自含 `wire.jsonl`。v2.0 之前的临时 SubAgent 归档可能仍留在磁盘上;新工作使用团队子会话。 - **`logs/nori-code.log`**:该会话的诊断日志,只有发生诊断事件时才存在。 - **`tasks/`**:后台任务持久化——`tasks/.json` 保存状态/pid/退出码,`tasks//output.log` 保存输出。 - **`cron/`**:定时任务持久化,`nori resume` 时重新加载到调度器。详见[定时任务](../reference/tools.md#定时任务)。 diff --git a/docs/zh/customization/agents.md b/docs/zh/customization/agents.md index 7d7162d8..1f6cbdbf 100644 --- a/docs/zh/customization/agents.md +++ b/docs/zh/customization/agents.md @@ -1,10 +1,12 @@ # Agent 与子 Agent -Nori Code CLI 中的每次会话都由一个**主 Agent** 驱动。主 Agent 理解用户意图、规划步骤、调用工具,并在需要时向外派发**子 Agent** 处理更聚焦的子任务——例如探索一个陌生代码库、并行审阅多处实现、或在不触碰主上下文的情况下规划一次大型重构。 +Nori Code CLI 中的每次会话都由一个**主 Agent** 驱动。2.0 里,主 Agent 领导一棵由 **`TeamCreate`** 雇佣的持久**团队伙伴**组成的**部门树**。伙伴是会话地图上的真实子会话;它们参与 Discuss、接收任务并执行,负责人默认只读。完整流程见[团队工程](../guides/team-engineering.md)。 -Nori Code CLI 2.0 中,主 Agent 还领导一棵由 **`TeamCreate`** 雇佣的持久**团队伙伴**组成的**部门树**。伙伴是会话地图上的真实子会话,并双写团队 Agent 以便 Discuss 仍按本部门寻址;它们参与 Discuss、接收任务并执行,而负责人默认保持只读。有界委派仍使用临时 **SubAgent**,归档在父会话目录内。完整流程见[团队工程](../guides/team-engineering.md)。 +::: warning 注意 +临时 `SubAgent` 工具及其 DAG fan-out 已在 v2.0 **删除**。委派只走团队工程。本页仍残留 Kimi Code fork 的 SubAgent 说明,**不能**当作当前产品。现在的 Nori 相对 Codex / Claude Code 见 GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.zh-CN.md)。 +::: -子 Agent 接受主 Agent 给出的任务描述,在自己的独立上下文里工作,最后把结论返回。它不会与用户直接对话,中间的思考和工具调用记录也不会混入主 Agent 的历史。 +以下各节(内置子 Agent 类型、`SubAgent.tasks`、嵌套深度)均为**过时内容**。在本页重写之前,请使用团队工具(`TeamCreate`、`TeamDecide`、`TeamSpeak`、`TeamAssign`),不要调用任何名为 SubAgent 的入口。 ## 主 Agent 与只读模式 diff --git a/docs/zh/guides/getting-started.md b/docs/zh/guides/getting-started.md index 5cb4ee43..4e99c50e 100644 --- a/docs/zh/guides/getting-started.md +++ b/docs/zh/guides/getting-started.md @@ -15,7 +15,7 @@ Nori Code CLI 是一个运行在终端中的 AI 编程 Agent,帮助你完成 ## 安装 -用 npm 或 pnpm 全局安装已发布的包。需要 Node.js 22.19.0 或更高版本(仓库本地开发的 engines 可能更严格)。 +用 npm 或 pnpm 全局安装已发布的包。需要 Node.js 24.15.0 或更高版本(见仓库 `engines` 字段)。 ```sh node --version @@ -105,7 +105,7 @@ Nori Code CLI 会自动调用文件读取、搜索等工具浏览相关内容后 在 src/utils 里新增一个函数,用来把任意字符串转成 kebab-case,并补一个单元测试 ``` -Nori Code CLI 会规划步骤,在需要代码改动时通过 `SubAgent` 或雇佣的团队伙伴委派实现,运行相关检查,并在每一步告诉你它做了什么。如果希望主 Agent 在审批后直接编辑文件,可使用 `/setting readonly off`。 +Nori Code CLI 会规划步骤,在需要并行推进时用 `TeamCreate` 雇佣团队伙伴,先 Discuss 再 `TeamAssign`,并在每一步告诉你它做了什么。临时 `SubAgent` 编排已在 v2.0 删除。如果希望主 Agent 在审批后直接编辑文件,可使用 `/setting readonly off`。 ::: tip 不知道能做什么?输入 `/help` 随时在输入框输入 `/help`,可以打开内置的命令和快捷键面板,按 `↑`/`↓` 翻看,`Esc` 关闭。退出时输入 `/exit`,或按 `Ctrl-C` 两次,或在输入框为空时按 `Ctrl-D`。 diff --git a/docs/zh/guides/team-engineering.md b/docs/zh/guides/team-engineering.md index 1fefdd0e..baec3dea 100644 --- a/docs/zh/guides/team-engineering.md +++ b/docs/zh/guides/team-engineering.md @@ -2,19 +2,24 @@ Nori Code CLI 2.0 把项目当作一棵**部门树**,而不是单条聊天记录加旁注。`TeamCreate` 通过创建**挂载子会话**雇佣伙伴(与会话地图上已有的节点是同一类),并双写一个团队 Agent,以便 Discuss 仍按本部门寻址。Discuss 轮次在动手前收集团队发言。本页说明终端与 Nori Work 中这些能力如何配合。 -## 部门树与 SubAgent +::: warning 注意 +临时 `SubAgent` DAG 编排已在 v2.0 **删除**。把工作交给另一个 Agent 的唯一方式是团队工程。与 Codex / Claude Code 的对照,以及 LSP、Git 仍是毛坯等缺口,见 GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.zh-CN.md)。 +::: -两种协作模型并存: +## 部门树与会话地图 + +协作模型只有一套,出现在两个面上: - **团队伙伴**(`TeamCreate`)是挂在你下面的**真实子会话**。它们出现在会话地图上的会话卡片中,参与 Discuss/Assign,直到 `TeamDismiss` 移除;同时双写一个团队 Agent,以便 Discuss 仍按 agent id 寻址本部门。 - **会话地图节点**与雇佣是同一类:**真实子会话**,通过 `parent_session_id` 链接。在 Web Map 画布上拉线或「新建会话」走的是与 `TeamCreate` 相同的「空子会话 + 挂载」路径。一个会话只能有一个父节点(暂不支持兼职)。 -- **SubAgent**(`SubAgent`)是归档在父会话目录内的**临时代理**,完成有界任务后返回结果;不是地图节点,也不适合作为长期部门。 + +双写(子会话 + 父会话里的 team agent)是为了让 Discuss 仍按 agent id 说话、地图按 session id 说话。这是接缝,不是已经磨平的统一身份。 主 Agent 默认是**只读协调者**:直接 `Write` / `Edit` 会被拦截(`/setting readonly on`),雇佣成员在 `TeamAssign` 离开 Discuss 后执行分配任务。只有在你希望负责人直接改文件时才使用 `/setting readonly off`。 ## Discuss 与 Code -**Discuss** 是只读团队会议。开启期间,`Write`、`Edit`、`Bash`、`SubAgent` 及部分调度工具会被拦截,直到团队进入 **Code**。 +**Discuss** 是只读团队会议。开启期间,`Write`、`Edit`、`Bash`、`TaskStop`、`CronCreate`、`CronDelete` 会被拦截,直到团队进入 **Code**。 典型流程: @@ -100,5 +105,5 @@ Discuss 是**多轮**的会。每条 `TeamSpeak` 只推进一步(一个可裁 - [斜杠命令](../reference/slash-commands.md) — `/team`、`/map`、`/discuss`、`/web` - [内置工具](../reference/tools.md#协作工具) — `TeamCreate`、`TeamAssign`、`TeamDismiss` 等 -- [Agent 与子 Agent](../customization/agents.md) — 只读主 Agent 与 SubAgent 委派 - [会话与上下文](./sessions.md) — 存储布局与会话元数据 +- GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.zh-CN.md) — 现在的 Nori 相对 Codex / Claude Code,以及缺口清单 diff --git a/docs/zh/guides/use-cases.md b/docs/zh/guides/use-cases.md index 8ccc7b38..dac5d132 100644 --- a/docs/zh/guides/use-cases.md +++ b/docs/zh/guides/use-cases.md @@ -24,7 +24,7 @@ src/runtime 下的 event loop 是怎么工作的?事件从哪里产生、又 这个项目里「权限审批」是怎么实现的?涉及哪些文件,关键类型是什么? ``` -大型调研可以让主 Agent 派发**子 Agent** 并行处理子任务,详见 [Agent 与子 Agent](../customization/agents.md)。 +大型调研用 `TeamCreate` 雇佣团队伙伴,先 Discuss 再分配轨道,详见[团队工程](./team-engineering.md)。与 Codex / Claude Code 子 Agent 的对照见 GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.zh-CN.md)。 ## 实现新功能 diff --git a/docs/zh/index.md b/docs/zh/index.md index 1d19fd25..dd10cf2a 100644 --- a/docs/zh/index.md +++ b/docs/zh/index.md @@ -19,8 +19,8 @@ features: details: 用 TeamCreate 雇佣持久伙伴。先 Discuss 再 Code,随后 TeamAssign —— 每位伙伴都是会话地图上的真实子会话。 - title: 会话地图 details: 会话通过 parent_session_id 连接。在 TUI 用 /map,或在 Nori Work 打开 Map 视图浏览与调整挂载。 - - title: SubAgent DAG - details: 有界临时委派仍可在会话归档内并行跑规划 → 实现 → 验证 → 审查。 + - title: 缺口说清楚 + details: LSP 和 Git 仍是毛坯。已删除的 SubAgent DAG 不是产品路径;委派只走团队工程。详见 GitHub README。 - title: Nori Work - details: Electron 工作台,集成对话、浏览器、终端、Git,以及同一张会话地图。 + details: Electron 工作台,集成对话、浏览器、终端和同一张会话地图。早期项目,部分检查器仍未打磨。 --- diff --git a/docs/zh/reference/slash-commands.md b/docs/zh/reference/slash-commands.md index 6397f78b..93921233 100644 --- a/docs/zh/reference/slash-commands.md +++ b/docs/zh/reference/slash-commands.md @@ -4,6 +4,10 @@ 输入完整命令名后按 `Enter` 执行。如果输入的 `/` 开头内容不匹配任何内置或 Skill 命令,则按普通消息发送给 Agent。 +::: warning 注意 +`/subagent` 是残留文案。临时 SubAgent 模式已在 v2.0 删除;请用 `/team` 和团队工具。见 GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.zh-CN.md)。 +::: + ::: tip 提示 部分命令仅在空闲(idle)状态下可用。会话正在流式输出或压缩上下文时执行这些命令会被拦截,需先按 `Esc` 或 `Ctrl-C` 中断。下表「随时可用」列标注了流式输出期间也可用的命令。 ::: @@ -52,8 +56,8 @@ | `/team [settings]` | `/agents` | 打开已雇佣成员的会话,或浏览汇报与本回合 Discuss 发言。Enter 打开选中成员(Main 回到主会话)。Tab 查看详情。讨论节点打开 Discuss 栏。`/team settings` 设置最大部门深度 | 是 | | `/map` | — | 浏览当前工作目录的会话地图(挂载森林)。Enter 打开会话;M 挂载(先子后父);U 卸载。详见[团队工程](../guides/team-engineering.md) | 是 | | `/plan clear` | — | 清除旧计划状态 | 否 | -| `/subagent on\|off` | — | 开启或关闭 SubAgent 模式,但不发送提示词。 | 否 | -| `/subagent ` | — | 先开启 SubAgent 模式,再把 `` 作为普通提示词发送。如果该轮次正常完成,SubAgent 模式会自动关闭。若当前是 `manual` 权限模式,启动前会提示是否切换到 `auto` 或 `yolo`。 | 否 | +| `/subagent on\|off` | — | **v2.0 已删除。** 临时 SubAgent 模式已去掉;请用 `/team`。 | 否 | +| `/subagent ` | — | **v2.0 已删除。** 请用团队工程雇佣伙伴。 | 否 | | `/goal [...]` | — | 开始或管理目标模式 | 见下文 | ::: warning 注意 diff --git a/docs/zh/reference/tools.md b/docs/zh/reference/tools.md index 10063ffc..bed39af6 100644 --- a/docs/zh/reference/tools.md +++ b/docs/zh/reference/tools.md @@ -4,6 +4,10 @@ 与 MCP 工具相比,内置工具由运行时直接管理,生命周期与会话绑定,无需外部进程。两者都遵循统一的审批机制:**只读类工具**(如 `Read`、`Grep`、`Glob`)默认自动放行,**写入与执行类工具**(如 `Write`、`Edit`、`Bash`)默认需要用户审批。Nori 的会话级只读设置会拦截直接 `Write` 和 `Edit`,但不会移除文件读取工具,也不会拦截 `Bash`;`Bash` 仍按当前权限模式和规则处理。YOLO 模式下普通工具调用的审批会被跳过。Discuss 通过 TeamAssign 或 UI 切换进入 Code,不再走计划文件审批。 +::: warning 注意 +`SubAgent`(含 `depends_on` DAG 任务)已在 v2.0 **删除**。委派只走团队工程。当前产品相对 Codex / Claude Code 见 GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.zh-CN.md)。 +::: + ## 文件类 文件类工具负责读取、写入、搜索本地文件系统,是代码分析和修改任务的基础工具。 @@ -65,7 +69,7 @@ | --- | --- | --- | | `TeamDecide` | 主代理 | 使用 `action=start` 进入 Discuss,使用 `action=continue` 继续讨论 | -Discuss 是只读团队开会。新会话默认进入该状态(用户可关闭)。期间 `Write`、`Edit`、`Bash`、`SubAgent`、`TaskStop`、`CronCreate`、`CronDelete` 被拦截。没有 session 文件工作流,也没有 `ExitDiscussMode` 模型出口。 +Discuss 是只读团队开会。新会话默认进入该状态(用户可关闭)。期间 `Write`、`Edit`、`Bash`、`TaskStop`、`CronCreate`、`CronDelete` 被拦截。没有 session 文件工作流,也没有 `ExitDiscussMode` 模型出口。 **`TeamDecide`** 使用 `action=start` 加主题和开场陈述进入 Discuss;后续使用 `action=continue` 加新陈述继续讨论。每条 `TeamSpeak` 只是多轮讨论里的一个短观点,不是完整方案,再用 `TeamAssign` 进入 Code。UI 的 Discuss/Code 切换也可离开或再进入。 @@ -83,7 +87,6 @@ Discuss 是只读团队开会。新会话默认进入该状态(用户可关闭 | 工具 | 默认审批 | 说明 | | --- | --- | --- | -| `SubAgent` | SubAgent 模式中自动放行,否则需审批 | 启动一个或多个临时 SubAgent | | `TeamCreate` | 自动放行 | 雇佣持久团队伙伴为子会话 | | `TeamDecide` | 自动放行 | 开会或在执行后投票 | | `TeamSpeak` | 自动放行 | 发布一条短讨论发言;不调用会将本轮记录为 skipped(弃权) | @@ -93,8 +96,6 @@ Discuss 是只读团队开会。新会话默认进入该状态(用户可关闭 | `AskUserQuestion` | 自动放行 | 向用户提问以获取结构化输入 | | `Skill` | 自动放行 | 调用已注册的 inline Skill | -**`SubAgent`** 是统一的临时代理入口。可用 `prompt_template` + `items`、`tasks`(含 `depends_on` DAG)或 `resume_agent_ids` 一次启动一个或多个完整子会话。完成后归档到父会话,可再打开。一次模型响应若调用 `SubAgent`,该调用必须是该响应中的唯一工具调用。Discuss 期间不要用 SubAgent,先 TeamAssign。 - **`TeamCreate`** 每个成员必须有唯一的 `name`、`role`、`mandate`;每次雇佣会创建真实挂载子会话(地图上的会话卡片),并双写一个团队 Agent,以便 Discuss/Assign 仍按本部门寻址。**`TeamDismiss`** 从部门移除成员并删除该子会话;需提供 `reason`,仅在确认中断进行中的任务后用 `confirm_active=true` 重试。地图上的拆挂是用户操作,只断开挂载、不删除会话。**`TeamUpdate`** 可改名称、角色、职责或标签;相关会话会收到提醒,但不会被唤醒。**`TeamDecide`** `action=start` 必须有 `topic` 和主持 `statement`。成员只用 `TeamSpeak` 发言。执行后 `action=vote` 不要求 Discuss;全队投票(`discuss_again` / `proceed` / `abstain`),含 `task=null` 的成员。 挂载变更会刷新各会话 system prompt 中的 **``**,并可能在下一回合注入 **``**。这只是身份与拓扑,**不是** transcript 共享。详见[团队工程](../guides/team-engineering.md#身份模型session_self-与挂载变更)。 @@ -105,7 +106,7 @@ Discuss 是只读团队开会。新会话默认进入该状态(用户可关闭 ## Nori 工具 -Nori 专用工具在内置工具集上增加共享记忆、文档写入和已配置的 graph/DAG 检查模板能力。只有对应供应商或运行时能力可用时,这些工具才会出现在工具列表中。 +Nori 专用工具在内置工具集上增加共享记忆和文档写入。只有对应供应商或运行时能力可用时,这些工具才会出现在工具列表中。 | 工具 | 默认审批 | 说明 | | --- | --- | --- | @@ -114,12 +115,12 @@ Nori 专用工具在内置工具集上增加共享记忆、文档写入和已配 **`nori_memory_search`** 接受具体的 `keywords`,以及可选的 `note_types`、`top_k`、`include_linked`、`link_depth`、`chain_depth` 和 `follow_up_keywords`。当第一轮结果暴露出更好的关键词或链接笔记时,使用链式检索(`chain_depth: 1` 或 `2`)。 -**`nori_memory_write`** 把结构化笔记写入共享记忆库。适合记录任务进度、架构分析、审阅发现,以及未来轮次或子 Agent 需要检索的决策。 +**`nori_memory_write`** 把结构化笔记写入共享记忆库。适合记录任务进度、架构分析、审阅发现,以及未来轮次或团队成员需要检索的决策。 ## 后台任务 -后台任务工具用于管理通过 `Bash`、`SubAgent` 或 `AskUserQuestion` 启动的后台任务。任务进入终止状态时会自动把状态和已保存的输出路径送回 Agent;如需提前检查进度,使用 `TaskOutput`。 +后台任务工具用于管理通过 `Bash` 或 `AskUserQuestion` 启动的后台任务。任务进入终止状态时会自动把状态和已保存的输出路径送回 Agent;如需提前检查进度,使用 `TaskOutput`。 | 工具 | 默认审批 | 说明 | | --- | --- | --- | @@ -153,6 +154,6 @@ Nori 专用工具在内置工具集上增加共享记忆、文档写入和已配 ## 下一步 -- [Agent 与子 Agent](../customization/agents.md) — `Agent` 工具的调度机制与上下文隔离 +- [团队工程](../guides/team-engineering.md) — 部门树、Discuss/Assign、会话地图 - [Hooks](../customization/hooks.md) — 在工具调用前后触发本地脚本 - [斜杠命令](./slash-commands.md) — TUI 内置控制命令速查 diff --git a/docs/zh/release-notes/changelog.md b/docs/zh/release-notes/changelog.md index 317b219e..73539ebb 100644 --- a/docs/zh/release-notes/changelog.md +++ b/docs/zh/release-notes/changelog.md @@ -6,6 +6,10 @@ outline: 2 本页记录 Kimi Code CLI 每个版本的变更内容。 +::: warning 注意 +本页仍是**上游 Kimi Code CLI** 的变更记录。Nori 自己的版本说明在仓库 [CHANGELOG.md](https://github.com/wangyuahn/nori-code/blob/master/CHANGELOG.md)。当前产品是团队工程;SubAgent DAG 已删除。见 GitHub [README](https://github.com/wangyuahn/nori-code/blob/master/README.zh-CN.md)。 +::: + ## 0.22.0(2026-07-02) ### 新功能