Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
171 changes: 95 additions & 76 deletions README.md

Large diffs are not rendered by default.

177 changes: 98 additions & 79 deletions README.zh-CN.md

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions apps/nori-code/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -15,6 +15,8 @@ Verify:
nori --version
```

Requires Node.js `>=24.15.0`.

## Quick Start

```sh
Expand All @@ -28,23 +30,24 @@ 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

<https://github.com/wangyuahn/nori-code>

## 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).
22 changes: 11 additions & 11 deletions docs/.vitepress/theme/components/HomeFeatures.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const highlights = computed<Highlight[]>(() => isZh.value
{
icon: '🧭',
title: '只读协调者',
desc: '主 Agent 默认只读协调;用 /team 打开伙伴会话,SubAgent 仍负责有界临时委派。',
desc: '主 Agent 默认只读协调;用 /team 打开伙伴会话。临时 SubAgent 已删除,委派只走团队工程。',
},
]
: [
Expand All @@ -50,7 +50,7 @@ const highlights = computed<Highlight[]>(() => 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.',
},
])

Expand All @@ -70,9 +70,9 @@ const features = computed<Feature[]>(() => 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: '🔌',
Expand All @@ -96,9 +96,9 @@ const features = computed<Feature[]>(() => 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: '🔌',
Expand All @@ -108,10 +108,10 @@ const features = computed<Feature[]>(() => 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
Expand Down
2 changes: 1 addition & 1 deletion docs/en/configuration/data-locations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <objective>`. 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/<task_id>.json` stores status/pid/exit code; `tasks/<task_id>/output.log` stores output.
- **`cron/`**: scheduled task persistence; reloaded into the scheduler when `nori resume` runs. See [Scheduled tasks](../reference/tools.md#scheduled-tasks).
Expand Down
8 changes: 5 additions & 3 deletions docs/en/customization/agents.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/en/guides/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
15 changes: 10 additions & 5 deletions docs/en/guides/team-engineering.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/en/guides/use-cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
---
8 changes: 6 additions & 2 deletions docs/en/reference/slash-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
:::
Expand Down Expand Up @@ -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 <task>` | — | Turn SubAgent mode on, then send `<task>` 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 <task>` | — | **Removed in v2.0.** Hire partners with Team Engineering instead. | No |
| `/goal [...]` | — | Start or manage an autonomous goal | See below |

::: warning
Expand Down
Loading
Loading