neko-harness 0.4.9 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -25
- package/dist/client/assets/{index-LHUxaMG9.js → index-BTQSuCzi.js} +62 -62
- package/dist/client/assets/index-DCZeTvcw.css +2 -0
- package/dist/client/index.html +2 -2
- package/dist/gateway.js +78 -13
- package/dist/neko.js +75 -14
- package/package.json +6 -5
- package/dist/client/assets/index-CP-ffuep.css +0 -2
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ A local AI coding assistant for the terminal, the browser and your phone: it rea
|
|
|
22
22
|
|
|
23
23
|
## Requirements
|
|
24
24
|
|
|
25
|
-
- **Bun 1.4.
|
|
25
|
+
- **Bun 1.4.x** (1.4.4 recommended) — see the [Bun installation guide](https://bun.sh/docs/installation). If `neko` is not found afterwards, add Bun's bin directory to `PATH` (`~/.bun/bin`, on Windows `%USERPROFILE%\.bun\bin`).
|
|
26
26
|
- macOS, Linux or Windows. **Windows also needs [Git for Windows](https://git-scm.com/download/win)**: the bash tool, background jobs and subagents run through Git Bash, which neko finds automatically (`shell.path` overrides the lookup).
|
|
27
27
|
- A model API key. DeepSeek works out of the box; 31 other API-key providers can be enabled.
|
|
28
28
|
|
|
@@ -48,47 +48,50 @@ Both UIs can run at the same time and share one gateway. The process that starte
|
|
|
48
48
|
|
|
49
49
|
## First run
|
|
50
50
|
|
|
51
|
-
In the TUI run `/login`; in the web UI open
|
|
51
|
+
In the TUI run `/login`; in the web UI open **Settings → Model services**. Paste a [DeepSeek API key](https://platform.deepseek.com/api_keys) and save it. The default model is `deepseek/deepseek-flash` (DeepSeek V4.1 Flash); pick another from the model picker, and change the thinking level with `/think` in the TUI.
|
|
52
52
|
|
|
53
53
|
Keys can come from environment variables instead (`DEEPSEEK_API_KEY`, `OPENROUTER_API_KEY`, `OPENCODE_API_KEY`, `TAVILY_API_KEY`, …). A key saved in the UI wins over the environment, and keys stay on this machine.
|
|
54
54
|
|
|
55
|
-
**Other providers.** Besides DeepSeek there are 31 API-key providers (OpenRouter, OpenCode Go / Zen, OpenAI, Google, Groq, Mistral, xAI, Together, …). Enable one in `/login` (space toggles it) or in
|
|
55
|
+
**Other providers.** Besides DeepSeek there are 31 API-key providers (OpenRouter, OpenCode Go / Zen, OpenAI, Google, Groq, Mistral, xAI, Together, …). Enable one in `/login` (space toggles it) or in **Settings → Model services**, then save its key or export its environment variable — the provider card in the web settings shows the exact name. Enabled providers appear in `/model` and in the composer's model picker. Disabling a provider keeps its saved key but blocks sending in sessions that use it, until you re-enable the provider or switch those sessions to another model. `--model` takes `provider/modelId`, for example `openrouter/anthropic/claude-haiku-4.5`.
|
|
56
56
|
|
|
57
|
-
**Default model.** Choose a model and set it as the default for new sessions: the ☆ action in the web picker
|
|
57
|
+
**Default model.** Choose a model and set it as the default for new sessions: the ☆ action (**Set as default**) in the web picker or `d` in the TUI `/model` list, pressing `d` again to clear it. Precedence: `--model` > saved default > `defaultModel` in the config file > built-in DeepSeek Flash. Only sessions created afterwards are affected.
|
|
58
58
|
|
|
59
59
|
## Features
|
|
60
60
|
|
|
61
61
|
### Workspace and files
|
|
62
62
|
|
|
63
63
|
- The workspace is the directory neko was started in (`--cwd` overrides it). The assistant is not sandboxed to it.
|
|
64
|
-
- Web sidebar: add and
|
|
64
|
+
- Web sidebar: add, switch and remove projects, browse the file tree, list the changes this session produced (with diffs), and open the folder in VS Code or the file manager — opening it works only from the machine running the web server.
|
|
65
|
+
- Removing a project only hides it and its sessions from the list: no files are deleted, and adding the same directory again brings them back. The directory the web server started in, the last remaining project and any project with a running session (or one waiting for an answer or plan decision) cannot be removed.
|
|
65
66
|
- Type `@` to reference a file or directory. Images: `Ctrl+V` in the TUI (`Alt+V` on Windows and WSL, where the terminal handles paste itself); paste, drop or pick files in the web UI. Whether a model accepts images depends on the model.
|
|
66
67
|
- Sessions: `/new` and `/sessions` in the TUI, the sidebar in the web UI; `/fork` and `/archive` in the TUI, archive from the web sidebar.
|
|
67
68
|
|
|
68
69
|
### Conversation and queue
|
|
69
70
|
|
|
70
|
-
- Sending while a run is busy queues the message instead of interrupting it. The queue bar (above the composer in the web UI, `Alt+↑` in the TUI) lists what is waiting, and every entry can be **steered**
|
|
71
|
+
- Sending while a run is busy queues the message instead of interrupting it. The queue bar (above the composer in the web UI, `Alt+↑` in the TUI) lists what is waiting, and every entry can be **steered** into the running work after the current tool round or **withdrawn** back into the editor.
|
|
71
72
|
- TUI queue keys: `Alt+↑` selects, `↑`/`↓` moves, `Enter` steers the selected message, `Esc` withdraws it without stopping the run.
|
|
72
73
|
- `Esc` on the running session stops the current run.
|
|
73
74
|
|
|
74
75
|
### Context and export
|
|
75
76
|
|
|
76
|
-
- `/compact` compacts the conversation and accepts optional instructions. Automatic compaction follows pi-durable's native policy — it triggers close to the model window; tune the trigger percentage, the keep-recent budget and on/off in TUI `/context`, in web
|
|
77
|
+
- `/compact` compacts the conversation and accepts optional instructions. Automatic compaction follows pi-durable's native policy — it triggers close to the model window; tune the trigger percentage, the keep-recent budget and on/off in TUI `/context`, in web **Settings → Context**, or in the config file (`context.compaction`). A value saved in the UI wins over the config file.
|
|
77
78
|
- Tool result pruning is off by default. With `context.pruning` enabled, old tool results become placeholders in the model context once usage crosses a threshold; the transcript, projections and exports keep the originals, and the model re-runs a tool when it needs the data again. `/context` and the settings page expose the knobs.
|
|
78
79
|
- Copy and export: the web UI copies an answer without its reasoning and exports Markdown, HTML or JSON from the top bar (thinking included on request). TUI: `/copy` and `/export [path] [--thinking]`; without a path the file goes into the workspace, and an existing file is never overwritten.
|
|
79
80
|
|
|
80
81
|
### Agent capabilities
|
|
81
82
|
|
|
82
|
-
- **Skills.** `/skill:` completes installed skills; browse and install them from the market in the web sidebar (
|
|
83
|
+
- **Skills.** `/skill:` completes installed skills; browse and install them from the market in the web sidebar (**Skill market**) or with TUI `/skills`. The prompt carries only the skill list — a body is read when the skill is invoked.
|
|
83
84
|
- **Subagents.** The assistant delegates exploration, planning or coding work, waits for the result and integrates it. Delegation cards and the sidebar in the web UI, `/agents` in the TUI; stop the current round without losing the agent's context. Bash commands from an explore subagent need one approval each.
|
|
84
|
-
- **Background jobs.** The `job` tool moves long commands (`npm run dev`, `uv run …`) to the background, up to 4 at a time. When one finishes the assistant is told and keeps going; live output and manual stops live in the web top bar
|
|
85
|
-
- **Todos.** For multi-step work the assistant keeps an ordered, read-only todo list. Web top bar
|
|
85
|
+
- **Background jobs.** The `job` tool moves long commands (`npm run dev`, `uv run …`) to the background, up to 4 at a time. When one finishes the assistant is told and keeps going; live output and manual stops live in the web top bar **Jobs** and TUI `/jobs`. Jobs still running when the gateway restarts are marked lost and never re-run.
|
|
86
|
+
- **Todos.** For multi-step work the assistant keeps an ordered, read-only todo list. Web top bar **Todo n/m**, TUI `/todos`, progress entry on the mobile chat page. It is saved with the session and survives restarts and compaction; subagents cannot use it.
|
|
86
87
|
- **Questions.** When a decision is missing, the assistant asks with `ask_user`: single or multiple choice — a recommended option is marked but never preselected — with optional text, or skip. Answer above the composer in the web UI, with `Ctrl+O` or `/question` in the TUI, or on the mobile chat page. The answer counts only once submitted (`Enter` in the TUI); the assistant stays paused meanwhile and messages you send queue behind the answer. Questions and options are plain text.
|
|
87
|
-
- **Web search.** Tavily by default — keyless mode is rate-limited until you add a key — or DeepSeek search and fetch, reusing your DeepSeek key. Pick the provider in web
|
|
88
|
+
- **Web search.** Tavily by default — keyless mode is rate-limited until you add a key — or DeepSeek search and fetch, reusing your DeepSeek key. Pick the provider in web **Settings → Web search**, TUI `/search`, or `webSearch.provider` in the config file. DeepSeek search bills per successful request (CNY 5 per 1000).
|
|
88
89
|
|
|
89
90
|
### Clients
|
|
90
91
|
|
|
91
|
-
**Web** — chat, workspace sidebar (files, changes, open in editor), skill market
|
|
92
|
+
**Web** — chat, workspace sidebar (files, changes, open in editor), skill market, and settings: `/settings` Model services, `/settings/search` Web search, `/settings/context` Context, `/settings/appearance` Appearance, `/settings/language` Language, `/settings/mobile` Mobile pairing, `/about` About and updates. The workspace, job and subagent panels share one width: drag its edge (or use ←/→ and Home/End, double-click to reset); it is remembered in the browser.
|
|
93
|
+
|
|
94
|
+
The web UI is available in Chinese (default) and English: switch it in **Settings → Language**. **Settings → Appearance** sets the theme (Sakura, Paper or Ink) and the chat typography (font, size, weight, line height). Both are stored in the browser only, apply to that browser alone, and do not affect the TUI or the mobile app.
|
|
92
95
|
|
|
93
96
|
**TUI** — `/` completes commands, `@` files and `/skill:` skills; `/help` lists every shortcut and command.
|
|
94
97
|
|
|
@@ -103,18 +106,18 @@ Keys can come from environment variables instead (`DEEPSEEK_API_KEY`, `OPENROUTE
|
|
|
103
106
|
|
|
104
107
|
The terminal theme comes from `--theme light|dark|auto` (default `auto`), the `NEKO_THEME` environment variable, or `/theme`.
|
|
105
108
|
|
|
106
|
-
The interface language (`zh` by default, or `en`) comes from `--lang zh|en`, the `NEKO_LANG` environment variable, or `/language`; the choice is saved. The
|
|
109
|
+
The interface language (`zh` by default, or `en`) comes from `--lang zh|en`, the `NEKO_LANG` environment variable, or `/language`; the choice is saved. The web UI and the mobile app keep their own language setting.
|
|
107
110
|
|
|
108
|
-
**Mobile (beta)** — an Android app ([Flutter](apps/mobile/README.md)) that drives the agent over your LAN. In web
|
|
111
|
+
**Mobile (beta)** — an Android app ([Flutter](apps/mobile/README.md)) that drives the agent over your LAN. In web **Settings → Mobile pairing**, show the QR code and scan it with the app. The phone must be on the same network and the firewall must allow the port; under WSL's default NAT the port is forwarded through `powershell.exe` automatically. The app trusts only the certificate fingerprint it received while pairing, so revoke a device or regenerate the certificate on the same page when needed. APKs are attached to [GitHub Releases](https://github.com/kirineko/neko-harness/releases) as `NekoAI-v<version>-<abi>.apk` (arm64-v8a, armeabi-v7a, x86_64). This is a beta: builds use a debug signature, so upgrading means uninstalling, reinstalling and pairing again, and there is no in-app update.
|
|
109
112
|
|
|
110
113
|
## Plan mode
|
|
111
114
|
|
|
112
115
|
Read-only planning with an explicit approval step.
|
|
113
116
|
|
|
114
|
-
- **Enter and leave.** TUI: `/plan` or `Shift+Tab` — idle sessions only. Web: `/plan` in the composer. While the mode is on, the composer shows a
|
|
117
|
+
- **Enter and leave.** TUI: `/plan` or `Shift+Tab` — idle sessions only. Web: `/plan` in the composer. While the mode is on, the composer shows a **Plan mode (read-only)** badge.
|
|
115
118
|
- **What the assistant may do.** Read files, search the code base, use the web, keep todos, ask questions and run read-only bash (listing, searching, `git log`/`diff`/`status`, version checks). `edit`, `write`, `job` and any command that changes files, installs packages or starts processes are rejected — the tools are removed from the agent, a `beforeTool` guard checks the rest, and bash is checked again when it executes (a guard rail, not a sandbox). Explore and plan subagents are allowed; the coder subagent is not.
|
|
116
119
|
- **Submitting.** Once it understands the task the assistant calls `submit_plan` once, alone in its turn, with a short title, ordered steps and an optional note (risks, assumptions, verification). The round ends and the session goes idle, waiting for your decision.
|
|
117
|
-
- **Deciding.** The plan card sits above the composer in the web UI; in the TUI a panel opens by itself.
|
|
120
|
+
- **Deciding.** The plan card sits above the composer in the web UI; in the TUI a panel opens by itself. **Approve and run** leaves plan mode and submits the plan as the next input, so execution starts immediately. **Request changes** takes a note, keeps plan mode, and the assistant revises and submits again. **Cancel and leave plan mode** cancels the waiting plan (web button, TUI `X`). TUI keys: `↑`/`↓` choose, `A` approves, `R` writes changes, `X` cancels and exits, `Esc` closes the panel without deciding.
|
|
118
121
|
- **Edge cases.** Sending a normal message while a plan waits replaces that plan. Stopping the session or leaving plan mode cancels it; a restart keeps it. The mode and the last 5 plans are saved with the session, and a forked session inherits them.
|
|
119
122
|
- **Mobile.** A paired phone can read a plan and approve, request changes, or cancel and exit; it cannot enter plan mode. Mode changes and decisions are accepted only while the session is idle.
|
|
120
123
|
|
|
@@ -183,11 +186,13 @@ The assistant runs commands and edits files: use it in projects you trust, and r
|
|
|
183
186
|
|
|
184
187
|
Finish your work, quit every neko UI and service, run `neko update`, then start again. On Windows, `neko update` prints the manual steps: quit neko and run `bun add --global neko-harness@latest`.
|
|
185
188
|
|
|
186
|
-
|
|
189
|
+
Version 0.5.0 raises the application protocol to 9 (project removal). A UI or gateway from an older release is refused with a protocol message, so restart every neko process after updating.
|
|
190
|
+
|
|
191
|
+
`/version` in the TUI and web **About and updates** show the running version, check for updates and explain how to restart or reload. If the running version has no `neko update` command, reinstall with `bun add --global neko-harness`.
|
|
187
192
|
|
|
188
193
|
## Development
|
|
189
194
|
|
|
190
|
-
Source development
|
|
195
|
+
Source development uses Bun 1.4.4 (see `.bun-version`; any 1.4.x works) and, on Windows, Git for Windows.
|
|
191
196
|
|
|
192
197
|
```bash
|
|
193
198
|
bun install --frozen-lockfile
|
|
@@ -199,7 +204,8 @@ bun run neko serve # gateway only
|
|
|
199
204
|
| Command | What it does |
|
|
200
205
|
| --- | --- |
|
|
201
206
|
| `bun run build` | tsc build of every workspace package (the web package also runs vite) |
|
|
202
|
-
| `bun run test` | Bun test (`--conditions=neko-source --
|
|
207
|
+
| `bun run test` | Bun test (`--conditions=neko-source --parallel`): the full suite takes about 12 s on a laptop |
|
|
208
|
+
| `bun run test:serial` | the same tests one after another (`--isolate`); use it to tell a real failure from a timing problem |
|
|
203
209
|
| `bun run check` | biome check plus type checks for the root and the web client |
|
|
204
210
|
| `bun run check:write` | biome fixes plus the same type checks |
|
|
205
211
|
| `bun run build:release` | build the `dist/` release bundle |
|
|
@@ -211,17 +217,18 @@ Layout:
|
|
|
211
217
|
- `packages/gateway` — Chord / WebSocket gateway and the mobile API
|
|
212
218
|
- `packages/tui`, `packages/web`, `packages/cli` — the two frontends and the `neko` command
|
|
213
219
|
- `apps/mobile` — Flutter app (beta)
|
|
214
|
-
- `openspec/` changes and specs, `docs/`
|
|
220
|
+
- `openspec/` changes and specs, `docs/` documentation, `scripts/` build and release scripts
|
|
215
221
|
|
|
216
|
-
Conventions: Biome (tabs, double quotes, 120 columns); relative imports carry the `.ts` extension; TypeScript strict with `noUncheckedIndexedAccess`, `erasableSyntaxOnly` and `verbatimModuleSyntax`. `reference/` is read-only, `dist/` and `artifacts/` are not committed, and behaviour changes go through an `openspec/` change. Run `bun run check` and `bun run test` before handing work over.
|
|
222
|
+
Conventions: Biome (tabs, double quotes, 120 columns); relative imports carry the `.ts` extension; TypeScript strict with `noUncheckedIndexedAccess`, `erasableSyntaxOnly` and `verbatimModuleSyntax`. `reference/` is read-only, `dist/` and `artifacts/` are not committed, and behaviour changes go through an `openspec/` change. Run `bun run check` and `bun run test` before handing work over. Releases are published by pushing a `vX.Y.Z` tag (see [docs/dev/releasing.md](docs/dev/releasing.md)); there is no CI on ordinary pushes.
|
|
217
223
|
|
|
218
224
|
## Documentation
|
|
219
225
|
|
|
220
|
-
- [AGENTS.md](AGENTS.md) — architecture, modules and development conventions
|
|
226
|
+
- [AGENTS.md](AGENTS.md) — architecture, modules and development conventions (Chinese only)
|
|
227
|
+
- [docs/README.md](docs/README.md) — documentation index
|
|
221
228
|
- [docs/README.zh-CN.md](docs/README.zh-CN.md) — this documentation in Chinese
|
|
222
|
-
- [docs/mobile
|
|
223
|
-
- [apps/mobile/README.md](apps/mobile/README.md) — building and releasing the Flutter app
|
|
224
|
-
- [
|
|
229
|
+
- [docs/mobile/api-v1.md](docs/mobile/api-v1.md) — mobile JSON-RPC protocol (Chinese only)
|
|
230
|
+
- [apps/mobile/README.md](apps/mobile/README.md) — building and releasing the Flutter app (Chinese only)
|
|
231
|
+
- [docs/dev/releasing.md](docs/dev/releasing.md) — release process (Chinese only)
|
|
225
232
|
- [openspec/](openspec/) — change proposals and specs
|
|
226
233
|
|
|
227
234
|
## License
|