neko-harness 0.4.7 → 0.4.8
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 +192 -47
- package/dist/client/assets/{index-DYhp2f2g.js → index-vrkP1dHF.js} +57 -57
- package/dist/client/assets/index-wmHY1s4T.css +2 -0
- package/dist/client/index.html +2 -2
- package/dist/gateway.js +1880 -1192
- package/dist/neko.js +2558 -1137
- package/package.json +1 -1
- package/dist/client/assets/index-Cdi87SA6.css +0 -2
package/README.md
CHANGED
|
@@ -1,81 +1,226 @@
|
|
|
1
1
|
# neko-harness
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**English** | [简体中文](docs/README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A local AI coding assistant for the terminal, the browser and your phone: it reads and edits files in your project, runs commands, accepts images, searches the web, calls skills and delegates to subagents. Sessions are saved automatically.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
> The Chinese version is the master copy. If this page and [`docs/README.zh-CN.md`](docs/README.zh-CN.md) disagree, the Chinese page is correct.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
bun add --global neko-harness
|
|
11
|
-
```
|
|
9
|
+
## Contents
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
- [Requirements](#requirements)
|
|
12
|
+
- [Quick start](#quick-start)
|
|
13
|
+
- [First run](#first-run)
|
|
14
|
+
- [Features](#features)
|
|
15
|
+
- [Plan mode](#plan-mode)
|
|
16
|
+
- [Configuration](#configuration)
|
|
17
|
+
- [Security](#security)
|
|
18
|
+
- [Upgrade](#upgrade)
|
|
19
|
+
- [Development](#development)
|
|
20
|
+
- [Documentation](#documentation)
|
|
21
|
+
- [License](#license)
|
|
14
22
|
|
|
15
|
-
|
|
23
|
+
## Requirements
|
|
16
24
|
|
|
17
|
-
|
|
25
|
+
- **Bun 1.4.2** (any 1.4.x release) — 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
|
+
- 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
|
+
- A model API key. DeepSeek works out of the box; 31 other API-key providers can be enabled.
|
|
18
28
|
|
|
19
|
-
|
|
29
|
+
## Quick start
|
|
20
30
|
|
|
21
31
|
```bash
|
|
32
|
+
bun add --global neko-harness
|
|
33
|
+
|
|
22
34
|
cd /path/to/your/project
|
|
23
|
-
neko tui #
|
|
24
|
-
neko web #
|
|
35
|
+
neko tui # terminal UI
|
|
36
|
+
neko web # browser UI
|
|
25
37
|
```
|
|
26
38
|
|
|
27
|
-
|
|
39
|
+
`neko` starts the interface you asked for and, when no gateway is running yet, a gateway — the process that owns sessions, tools and the mobile endpoint.
|
|
28
40
|
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
| Command | What it starts |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `neko tui` | Terminal UI; starts a gateway on demand. The TUI talks to it over a Unix socket on POSIX and over a local WebSocket on Windows. |
|
|
44
|
+
| `neko web` | Web UI on `http://127.0.0.1:8322` with a gateway WebSocket on `127.0.0.1:8321`; reuses a gateway another UI already started, and opens the browser unless `--no-open` is given. |
|
|
45
|
+
| `neko serve` | Gateway only: WebSocket on `127.0.0.1:8321` plus a Unix socket on POSIX. Keeps sessions, background jobs and the phone endpoint available without any UI. |
|
|
46
|
+
|
|
47
|
+
Both UIs can run at the same time and share one gateway. The process that started the gateway stops it when it exits, so use `neko serve` when the gateway should outlive the UI — for example to keep a paired phone connected after closing the browser page.
|
|
48
|
+
|
|
49
|
+
## First run
|
|
50
|
+
|
|
51
|
+
In the TUI run `/login`; in the web UI open **设置 → 模型服务** (settings → model providers). 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
|
+
|
|
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
|
+
|
|
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 **设置 → 模型服务**, 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
|
+
|
|
57
|
+
**Default model.** Choose a model and set it as the default for new sessions: the ☆ action 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
|
+
|
|
59
|
+
## Features
|
|
60
|
+
|
|
61
|
+
### Workspace and files
|
|
62
|
+
|
|
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 switch 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
|
+
- 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
|
+
- 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
|
+
### Conversation and queue
|
|
69
|
+
|
|
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** (引导) into the running work after the current tool round or **withdrawn** (撤回) back into the editor.
|
|
71
|
+
- TUI queue keys: `Alt+↑` selects, `↑`/`↓` moves, `Enter` steers the selected message, `Esc` withdraws it without stopping the run.
|
|
72
|
+
- `Esc` on the running session stops the current run.
|
|
73
|
+
|
|
74
|
+
### Context and export
|
|
75
|
+
|
|
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 **设置 → 上下文**, or in the config file (`context.compaction`). A value saved in the UI wins over the config file.
|
|
77
|
+
- 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
|
+
- 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
|
+
### Agent capabilities
|
|
81
|
+
|
|
82
|
+
- **Skills.** `/skill:` completes installed skills; browse and install them from the market in the web sidebar (**技能市场**) or with TUI `/skills`. The prompt carries only the skill list — a body is read when the skill is invoked.
|
|
83
|
+
- **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 **任务** and TUI `/jobs`. Jobs still running when the gateway restarts are marked lost and never re-run.
|
|
85
|
+
- **Todos.** For multi-step work the assistant keeps an ordered, read-only todo list. Web top bar **待办 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
|
+
- **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 **设置 → 联网搜索**, TUI `/search`, or `webSearch.provider` in the config file. DeepSeek search bills per successful request (CNY 5 per 1000).
|
|
88
|
+
|
|
89
|
+
### Clients
|
|
90
|
+
|
|
91
|
+
**Web** — chat, workspace sidebar (files, changes, open in editor), skill market (技能市场), and settings (设置): `/settings` 模型服务, `/settings/search` 联网搜索, `/settings/context` 上下文, `/settings/mobile` 手机配对, `/about` 版本与更新. The web UI ships Chinese labels; they are quoted as shown, with a short gloss where it helps.
|
|
92
|
+
|
|
93
|
+
**TUI** — `/` completes commands, `@` files and `/skill:` skills; `/help` lists every shortcut and command.
|
|
94
|
+
|
|
95
|
+
| Commands | What they do |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| `/login`, `/model`, `/think` | providers and keys, model, thinking level |
|
|
98
|
+
| `/new`, `/sessions`, `/fork`, `/archive` | sessions |
|
|
99
|
+
| `/compact`, `/context` | compaction, pruning and their settings |
|
|
100
|
+
| `/copy`, `/export` | copy the last answer, export the session |
|
|
101
|
+
| `/agents`, `/jobs`, `/todos`, `/question`, `/plan` | delegated work, background jobs, todos, questions, plan mode |
|
|
102
|
+
| `/search`, `/skills`, `/theme`, `/version`, `/help` | search provider, skill market, theme, version and updates, shortcuts |
|
|
103
|
+
|
|
104
|
+
The terminal theme comes from `--theme light|dark|auto` (default `auto`), the `NEKO_THEME` environment variable, or `/theme`.
|
|
105
|
+
|
|
106
|
+
**Mobile (beta)** — an Android app ([Flutter](apps/mobile/README.md)) that drives the agent over your LAN. In web **设置 → 手机配对**, 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.
|
|
107
|
+
|
|
108
|
+
## Plan mode
|
|
109
|
+
|
|
110
|
+
Read-only planning with an explicit approval step.
|
|
111
|
+
|
|
112
|
+
- **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 **规划模式(只读)** badge.
|
|
113
|
+
- **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.
|
|
114
|
+
- **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.
|
|
115
|
+
- **Deciding.** The plan card sits above the composer in the web UI; in the TUI a panel opens by itself. **批准并执行** (approve and execute) 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.
|
|
116
|
+
- **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.
|
|
117
|
+
- **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.
|
|
118
|
+
|
|
119
|
+
## Configuration
|
|
120
|
+
|
|
121
|
+
### Command line
|
|
122
|
+
|
|
123
|
+
CLI flags > config file > built-in defaults. `neko tui --help`, `neko web --help` and `neko serve --help` list every option.
|
|
124
|
+
|
|
125
|
+
| Flag | Applies to | Meaning |
|
|
126
|
+
| --- | --- | --- |
|
|
127
|
+
| `--cwd <dir>` | tui, web, serve | Workspace for the session's tools (default: the current directory). Not a sandbox. |
|
|
128
|
+
| `--model <ref>` | tui, web, serve | Model as `provider/modelId`; overrides the saved default for this launch |
|
|
129
|
+
| `--storage <path>` | tui, web, serve | SQLite file (default `~/.neko/neko.sqlite`) |
|
|
130
|
+
| `--port <n>` | web, serve | Web UI port (default 8322) or gateway WebSocket port (default 8321; Windows picks a random port) |
|
|
131
|
+
| `--gateway-port <n>` | web | Gateway WebSocket port when the web UI starts the gateway |
|
|
132
|
+
| `--host <ip>` | web, serve | Web server address, or gateway WebSocket address (default `127.0.0.1`) |
|
|
133
|
+
| `--no-open` | web | Do not open the browser |
|
|
134
|
+
| `--socket-path <path>` | tui, web, serve | Unix socket path (POSIX only) |
|
|
135
|
+
| `--no-socket` | serve | Disable the Unix transport |
|
|
136
|
+
| `--theme <mode>` | tui | `light`, `dark` or `auto` (default) |
|
|
137
|
+
| `--credentials <path>` | serve | Credentials file (default `~/.neko/credentials.json`) |
|
|
138
|
+
| `--config <dir>` | serve | Where the config file lookup starts |
|
|
139
|
+
|
|
140
|
+
### Config file
|
|
141
|
+
|
|
142
|
+
`neko.config.json` is looked up from the working directory upward to the filesystem root; if nothing is found, `~/.neko/neko.config.json` is used. It holds one JSON object; `$NAME` and `${NAME}` in string values are replaced from the environment, and a reference to an unset variable is an error.
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"defaultModel": { "provider": "deepseek", "modelId": "deepseek-flash" },
|
|
147
|
+
"thinkingLevel": "high",
|
|
148
|
+
"webSearch": { "provider": "tavily" },
|
|
149
|
+
"context": {
|
|
150
|
+
"compaction": { "enabled": true, "triggerPercent": 80, "keepRecentTokens": 20000 },
|
|
151
|
+
"pruning": { "enabled": false, "triggerPercent": 35, "keepRecent": 10 }
|
|
152
|
+
}
|
|
153
|
+
}
|
|
31
154
|
```
|
|
32
155
|
|
|
33
|
-
|
|
156
|
+
| Key | Meaning |
|
|
157
|
+
| --- | --- |
|
|
158
|
+
| `defaultModel` | `{ provider, modelId }` for new sessions, below `--model` and the default saved in the UI |
|
|
159
|
+
| `thinkingLevel` | Thinking level for new sessions (default `high`, adjusted to what the model supports) |
|
|
160
|
+
| `storagePath` | SQLite file, same as `--storage` |
|
|
161
|
+
| `gateway.host`, `gateway.port`, `gateway.socketPath` | Gateway listen address, WebSocket port and Unix socket path (`socketPath: null` disables the Unix transport) |
|
|
162
|
+
| `skills.marketUrl` | Skill market base URL (default `https://skill.kirineko.tech`) |
|
|
163
|
+
| `webSearch.provider` | Initial search provider, `tavily` or `deepseek`; a choice saved in the UI wins |
|
|
164
|
+
| `context.compaction` | `enabled`, `triggerPercent` (1–99), `keepRecentTokens`; unset fields keep the native policy |
|
|
165
|
+
| `context.pruning` | `enabled`, `triggerPercent` (1–99), `keepRecent`, `minChars`, `minSavePercent`; off by default |
|
|
166
|
+
| `shell.path` | Git Bash `bash.exe` on Windows (a WSL `bash.exe` is rejected) |
|
|
167
|
+
|
|
168
|
+
### Data and environment
|
|
169
|
+
|
|
170
|
+
- `~/.neko/neko.sqlite` — sessions, messages, documents and settings, including the values saved from the UIs (default model, enabled providers, context settings, search provider).
|
|
171
|
+
- `~/.neko/credentials.json` — keys saved in the UI, in plain text for your user. Resetting a provider's key means removing it from the UI or this file.
|
|
172
|
+
- `~/.neko/gateway-server-id`, socket and port files — gateway discovery used by the UIs; replaced automatically. `~/.neko/update-check.json` caches the last update check.
|
|
173
|
+
- Environment variables: one per provider (`DEEPSEEK_API_KEY`, `OPENROUTER_API_KEY`, `OPENCODE_API_KEY`, …), `TAVILY_API_KEY` for web search, `NEKO_THEME` for the TUI theme.
|
|
174
|
+
|
|
175
|
+
## Security
|
|
34
176
|
|
|
35
|
-
|
|
177
|
+
The assistant runs commands and edits files: use it in projects you trust, and remember the workspace is not a sandbox for its file access. The web UI and the gateway listen on loopback by default; phone pairing, opening a workspace in an editor and the mobile API are only available from the machine itself, and remote access is refused. Keys never leave the machine except to the provider they belong to. Exports and backups can contain code, prompts and keys — quit every neko process before copying `~/.neko/`, and treat the copy as sensitive.
|
|
36
178
|
|
|
37
|
-
|
|
179
|
+
## Upgrade
|
|
38
180
|
|
|
39
|
-
|
|
181
|
+
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`.
|
|
40
182
|
|
|
41
|
-
|
|
42
|
-
- **会话**:TUI 用 `/new` 新建、`/sessions` 切换;Web 使用侧栏。
|
|
43
|
-
- **模型与思考强度**:TUI 用 `/model`(按服务分组、可输入过滤)和 `/think`;Web 点击输入框中的模型入口(按服务分组、可搜索)。
|
|
44
|
-
- **文件与图片**:输入 `@` 引用文件或目录;TUI 用 `Ctrl+V` 粘贴图片(Windows 与 WSL 为 `Alt+V`,避免与终端自带粘贴冲突);Web 支持粘贴、拖放和选择。识图能力取决于所选模型。
|
|
45
|
-
- **上下文**:`/compact` 整理较长对话。默认沿用 pi-durable 的自动压缩策略(接近模型窗口上限才触发),可在 TUI `/context`、Web 设置页「上下文」或配置文件 `context.compaction` 调整触发百分比、保留量与开关,保存值优先。
|
|
46
|
-
- **工具结果裁剪**(默认关闭):配置 `context.pruning`,上下文占用过高时把较旧的工具结果在模型上下文中替换为占位,界面与导出仍显示原始结果,模型需要时会重新执行工具。阈值与保留量可在 `/context` 与设置页修改。
|
|
47
|
-
- **复制与导出**:Web 在消息下方复制回答(不含思考过程),顶栏「导出」可选 Markdown、HTML、JSON 及是否包含思考过程;TUI 用 `/copy` 与 `/export [path] [--thinking]`,省略路径时写入工作区目录,不覆盖已有文件。
|
|
48
|
-
- **技能**:输入 `/skill:` 选择;Web 可从侧栏进入技能市场,浏览和安装技能。
|
|
49
|
-
- **子 agent**:助手会按任务需要委派探索、规划或编码工作,并等待结果后整合。Web 点委派卡片或侧栏、TUI 用 `/agents` 查看过程;可单独停止当前任务,保留后续接续能力。探索子 agent 的 Bash 命令需逐次批准。
|
|
50
|
-
- **后台任务**:`npm run dev`、`uv run` 等长命令可由 `job` 工具转入后台(同时最多 4 个),结束时助手会收到回报并继续处理。Web 顶栏「任务」、TUI `/jobs` 查看实时输出或手动停止。重启后运行中的任务标记为已丢失,不会自动重跑。
|
|
51
|
-
- **待办列表**:多步骤任务中,助手用 `todo` 工具维护一份有序待办,用户只读。Web 顶栏「待办 n/m」、TUI `/todos`、手机聊天页进度入口查看。列表随会话保存,重启与压缩后仍在,子 agent 不能使用。
|
|
52
|
-
- **向你提问**:缺少必要决策时,助手用 `ask_user` 提问:可单选或多选(带「推荐」提示但不预选),可附加文字,也可只回文字或跳过。Web 在输入区上方、TUI 按 `Ctrl+O` 或 `/question`、手机在聊天页回答;选择需点「提交回答」(TUI 按 Enter)才生效。等待期间助手暂停,期间发送的消息仍排队到回答之后;问题与选项按纯文本显示。
|
|
53
|
-
- **网页搜索**:默认使用 Tavily(无 Key 时为有限流的 keyless 模式,可在 Web「设置 → 联网搜索」或 TUI `/login` 中配置自己的 Key),也可改用 DeepSeek 搜索与抓取,复用你的 DeepSeek Key:TUI 用 `/search`、Web 在设置页「联网搜索」选择,或用配置 `webSearch.provider` 设置初始值。DeepSeek 搜索按成功请求计费(5 元 / 千次)。
|
|
54
|
-
- **手机配对**:Web 设置页「手机配对」开启后用 App 扫码连接。手机需与电脑同一网络,系统防火墙放行所选端口;撤销设备、重新生成证书也在设置页完成。gateway 由 `neko web` 启动时,退出页面会同时停止手机入口,需要长期连接请改用 `neko serve` 或保持 TUI 运行。WSL 默认 NAT 网络下会自动经 `powershell.exe` 转发,无需 portproxy。
|
|
183
|
+
`/version` in the TUI and web **关于与更新** 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`.
|
|
55
184
|
|
|
56
|
-
|
|
185
|
+
## Development
|
|
57
186
|
|
|
58
|
-
|
|
187
|
+
Source development needs Bun 1.4.2 (see `.bun-version`) and, on Windows, Git for Windows.
|
|
59
188
|
|
|
60
189
|
```bash
|
|
61
|
-
|
|
62
|
-
neko tui
|
|
63
|
-
neko web
|
|
64
|
-
neko
|
|
190
|
+
bun install --frozen-lockfile
|
|
191
|
+
bun run neko tui # TUI from source (starts a gateway)
|
|
192
|
+
bun run neko web # Web UI from source
|
|
193
|
+
bun run neko serve # gateway only
|
|
65
194
|
```
|
|
66
195
|
|
|
67
|
-
|
|
196
|
+
| Command | What it does |
|
|
197
|
+
| --- | --- |
|
|
198
|
+
| `bun run build` | tsc build of every workspace package (the web package also runs vite) |
|
|
199
|
+
| `bun run test` | Bun test (`--conditions=neko-source --isolate`) |
|
|
200
|
+
| `bun run check` | biome check plus type checks for the root and the web client |
|
|
201
|
+
| `bun run check:write` | biome fixes plus the same type checks |
|
|
202
|
+
| `bun run build:release` | build the `dist/` release bundle |
|
|
203
|
+
| `bun run test:package` | pack into `artifacts/`, install in a temp directory and smoke test |
|
|
68
204
|
|
|
69
|
-
|
|
205
|
+
Layout:
|
|
70
206
|
|
|
71
|
-
|
|
207
|
+
- `packages/core` — session runtime, system prompt, tools and the provider catalog
|
|
208
|
+
- `packages/gateway` — Chord / WebSocket gateway and the mobile API
|
|
209
|
+
- `packages/tui`, `packages/web`, `packages/cli` — the two frontends and the `neko` command
|
|
210
|
+
- `apps/mobile` — Flutter app (beta)
|
|
211
|
+
- `openspec/` changes and specs, `docs/` protocol docs, `scripts/` build and release scripts
|
|
72
212
|
|
|
73
|
-
|
|
213
|
+
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.
|
|
74
214
|
|
|
75
|
-
|
|
215
|
+
## Documentation
|
|
76
216
|
|
|
77
|
-
|
|
217
|
+
- [AGENTS.md](AGENTS.md) — architecture, modules and development conventions
|
|
218
|
+
- [docs/README.zh-CN.md](docs/README.zh-CN.md) — this documentation in Chinese
|
|
219
|
+
- [docs/mobile-api-v1.md](docs/mobile-api-v1.md) — mobile JSON-RPC protocol
|
|
220
|
+
- [apps/mobile/README.md](apps/mobile/README.md) — building and releasing the Flutter app
|
|
221
|
+
- [.github/RELEASING.md](.github/RELEASING.md) — release process
|
|
222
|
+
- [openspec/](openspec/) — change proposals and specs
|
|
78
223
|
|
|
79
|
-
##
|
|
224
|
+
## License
|
|
80
225
|
|
|
81
|
-
[MIT](LICENSE)
|
|
226
|
+
[MIT](LICENSE). Built on the [Pi](https://github.com/earendil-works/pi) ecosystem.
|