farming-code 2.2.13 → 2.2.14

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 CHANGED
@@ -1,168 +1,138 @@
1
- # Farming
1
+ <p align="center">
2
+ <img src="./public/farming-2/app-icon-v2-512.png" alt="Farming" width="112">
3
+ </p>
2
4
 
3
- > Chinese version: [README.zh_cn.md](./README.zh_cn.md)
5
+ <h1 align="center">Farming</h1>
4
6
 
5
- [![CI](https://github.com/zhuwenzhuang/farming/actions/workflows/ci.yml/badge.svg)](https://github.com/zhuwenzhuang/farming/actions/workflows/ci.yml)
6
- [![Release](https://img.shields.io/github/v/release/zhuwenzhuang/farming?label=release)](https://github.com/zhuwenzhuang/farming/releases)
7
- [![npm](https://img.shields.io/npm/v/farming-code?label=npm)](https://www.npmjs.com/package/farming-code)
8
- [![License](https://img.shields.io/github/license/zhuwenzhuang/farming)](./LICENSE)
9
- ![Node](https://img.shields.io/badge/node-%3E%3D22-339933?logo=nodedotjs&logoColor=white)
10
- ![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux-555)
7
+ <p align="center">
8
+ Farming is an open-source remote web workbench for running and supervising AI coding agents on a development machine.
9
+ </p>
11
10
 
12
- Farming is an open-source, customizable browser workspace for supervising AI coding agents on a development machine. It keeps several live agents, structured conversations, real terminals, project files, review, history, and runtime controls in one place—without moving the repository or agent processes into the browser.
11
+ <p align="center"><a href="./README.zh_cn.md">简体中文</a></p>
13
12
 
14
- Run Farming on the development machine where your coding CLIs already work, then return to the same tasks from a desktop or phone. Closing the browser does not stop the agents; the native PTY host can also preserve live terminal sessions while the Farming server restarts.
13
+ <p align="center">
14
+ <a href="https://github.com/zhuwenzhuang/farming/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/zhuwenzhuang/farming/actions/workflows/ci.yml/badge.svg"></a>
15
+ <a href="https://github.com/zhuwenzhuang/farming/releases"><img alt="Release" src="https://img.shields.io/github/v/release/zhuwenzhuang/farming?label=release"></a>
16
+ <a href="https://www.npmjs.com/package/farming-code"><img alt="npm" src="https://img.shields.io/npm/v/farming-code?label=npm"></a>
17
+ <a href="./LICENSE"><img alt="License" src="https://img.shields.io/github/license/zhuwenzhuang/farming"></a>
18
+ <img alt="Node.js 22+" src="https://img.shields.io/badge/node-%3E%3D22-339933?logo=nodedotjs&amp;logoColor=white">
19
+ <img alt="macOS and Linux" src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-555">
20
+ </p>
21
+
22
+ ![Farming Code workbench](./docs/products/code/assets/01-code-workspace.png)
23
+
24
+ Farming runs on the same development machine as your repositories and coding CLIs. Agent processes, terminals, and project files stay on that machine; a desktop or phone browser connects to those real sessions.
15
25
 
16
26
  ## Quick Start
17
27
 
18
- With Node.js 22 or newer and at least one supported coding CLI installed and signed in, install and start Farming in one command:
28
+ With Node.js 22 or newer and at least one supported coding CLI installed and signed in:
19
29
 
20
30
  ```bash
21
31
  npm install --global farming-code@latest && farming daemon
22
32
  ```
23
33
 
24
- Open the authenticated URL printed by the command, choose **New Agent**, select an Agent and workspace, and start in Chat or Terminal.
25
-
26
- ![Farming CRT billing control room](./docs/products/crt/assets/crt-billing-control-room.png)
27
-
28
- ## Two Interfaces, One Runtime
29
-
30
- Farming 2 provides two complete browser interfaces over the same agents and sessions.
31
-
32
- ### Farming Code
33
-
34
- The default workbench for reading conversations, intervening in tasks, editing files, and reviewing workspace changes.
35
-
36
- ![Farming Code structured Chat](./docs/products/code/assets/11-code-agent-process.png)
37
-
38
- ### Farming CRT
39
-
40
- A keyboard-first control room for watching many agents, opening structured Chat or raw Terminal, searching history, and reading live usage telemetry.
41
-
42
- ![Farming CRT dashboard](./docs/products/crt/assets/01-crt-dashboard.png)
34
+ Open one of the authenticated URLs printed by the command, choose **New Agent**, then select a CLI, workspace, and Chat or Terminal. Closing the browser does not stop the Agent. In the same browser, revisit that address; on the development machine, this command prints the local address again:
43
35
 
44
- | | Farming Code | Farming CRT |
45
- | --- | --- | --- |
46
- | Best for | Long follow-ups, files, editing, diffs, review | At-a-glance monitoring, keyboard control, terminal work, telemetry |
47
- | Live session | Structured Chat and real PTY Terminal | Phosphor Chat and real xterm Terminal |
48
- | Navigation | Project sidebar, Search, History, Files | Stable Agent bays and keyboard-driven consoles |
49
- | Appearance | Light and dark | CRT effects, terminal font size, optional Dynamic Heat |
50
- | Entry | `/farming/code/` or `/farming/` | `/farming/crt/` |
36
+ ```bash
37
+ farming url
38
+ ```
51
39
 
52
- Switching interfaces does not restart or duplicate an Agent. If Farming Code cannot start or render, its bounded diagnostic view leaves the live CRT surface available rather than hiding the running sessions.
40
+ For a new remote browser, use the authenticated **Network** URL printed when `farming daemon` starts. A VPN, SSH tunnel, or HTTPS reverse proxy can provide a stable reachable address, but the first visit still needs the Farming startup token.
53
41
 
54
- To switch without editing the URL:
42
+ ![Start an Agent](./docs/products/code/assets/02-start-agent-picker.png)
55
43
 
56
- - **Farming Code → CRT:** click the gear at the bottom-left, open **Interface**, then choose **Farming CRT**.
57
- - **Farming CRT → Code:** press `S` (or choose **[S] SETTINGS**), then choose **Farming Code** under **UI Theme**.
44
+ ## Farming Code
58
45
 
59
- Farming carries the focused Agent into the other interface when possible. Both views keep using the same live Agent and provider session; this is an interface switch, not a restart.
46
+ Farming Code is the default desktop and mobile interface. It groups work by project and keeps live Agents, resumable history, files, and review in the same browser workspace.
60
47
 
61
- The complete current capability map and screenshot tour are in the [Farming 2 product overview](./docs/products/README.md). See the focused [Farming Code guide](./docs/products/code/README.md) and [Farming CRT guide](./docs/products/crt/README.md) for the full workflows.
48
+ ### Agents, Chat, and Terminal
62
49
 
63
- ## Farming Net: One Portal For Deployments
50
+ Start or resume Codex, Claude Code, OpenCode, Qoder, and other detected coding CLIs. Supported Agents offer structured Chat for reading results and inspecting tool activity, plus a real Terminal for working directly with the CLI. Search and History cover both current work and resumable sessions.
64
51
 
65
- Farming Net is a separate, token-protected directory for the Farming instances you already run. Its cards can point to a Farming on the current device, a remote development host, an intranet address, or a tunnel. Enrolled targets accept short-lived signed passes, so users keep one portal login instead of a list of deployment URLs and target tokens.
52
+ ![Farming Code structured Agent process](./docs/products/code/assets/11-code-agent-process.png)
66
53
 
67
- ```bash
68
- FARMING_NET_PORT=6693 FARMING_NET_BASE_PATH=/farming-net npm run start:net
69
- ```
54
+ ### Files and Review
70
55
 
71
- The portal keeps its token, signing identity, and private `instances.json` registry under `~/.farming-net/`. It does not proxy target traffic or store target tokens; each destination remains an independent Farming service and explicitly chooses whether to trust the portal. See the [Farming Net guide](./docs/products/net/README.md) for enrollment and the security boundary.
72
-
73
- ## What You Can Do
74
-
75
- - Group live agents by project, pin or rename important work, track unread activity, search live and historical sessions, and archive or resume tasks.
76
- - Use structured ACP Chat for Codex, Claude Code, OpenCode, and Qoder. Plans, reasoning, tools, permission requests, embedded terminals, child sessions, attachments, queued follow-ups, and exact change summaries remain available without overwhelming the final answer.
77
- - Switch the same provider session between structured Chat and a real PTY Terminal. Supported Codex model, reasoning, Fast, Ultra, and permission changes reach the live workflow; a compatible Terminal applies model changes immediately and confirms the CLI state before accepting the next Composer message.
78
- - Browse, search, and lightly edit Project Files; inspect a VS Code-derived Git history graph, changed files, Git changes, Diff, and Blame; then open commits or working-copy changes in Review with captured revisions, inline comments, and Reviewed state.
79
- - Observe CPU/MEM, token-rate, context, quota, provider usage, and CRT daily/live token telemetry when the provider exposes the required data.
80
- - Continue the same Farming Code task from desktop or phone without moving the Agent process away from the development host.
56
+ Browse, search, and lightly edit Project Files without leaving the current task. Inspect Git Changes, History, Diff, and Blame, then open a commit or working-copy change in Review.
81
57
 
82
58
  ![Farming Code project files and blame](./docs/products/code/assets/04-files-editor-blame.png)
83
59
 
84
- ## Supported Agent Paths
60
+ ## Supported Agents
85
61
 
86
- Farming discovers installed CLIs on the host. The richer structured runtime currently applies to providers with ACP support; other detected coding agents remain first-class terminal sessions.
62
+ Farming discovers installed CLIs on the host. Codex, Claude Code, OpenCode, and Qoder support both structured Chat and a native Terminal; other detected coding agents use the Terminal path.
87
63
 
88
- | Agent | Structured Chat | Native Terminal | History / resume |
64
+ | Agent | Structured Chat | Terminal | History / resume |
89
65
  | --- | --- | --- | --- |
90
- | Codex | ACP | Yes | Yes |
91
- | Claude Code | ACP | Yes | Yes |
92
- | OpenCode | ACP | Yes | Yes |
93
- | Qoder | ACP | Yes | Yes |
66
+ | Codex | Yes | Yes | Yes |
67
+ | Claude Code | Yes | Yes | Yes |
68
+ | OpenCode | Yes | Yes | Yes |
69
+ | Qoder | Yes | Yes | Yes |
94
70
  | Qwen Code | — | Yes | CLI-dependent |
95
71
  | Aider | — | Yes | CLI-dependent |
96
72
  | GitHub Copilot CLI | — | Yes | CLI-dependent |
97
73
  | Amazon Q | — | Yes | CLI-dependent |
98
- | bash / zsh | — | Yes | No provider-session resume |
74
+ | bash / zsh | — | Yes | No |
99
75
 
100
76
  Farming hosts CLIs that already work on the same machine. It does not replace provider installation, login, or account configuration.
101
77
 
102
- ## Runtime Defaults And Daemon Commands
78
+ ## Remote Use
103
79
 
104
- Farming defaults to port `6694`, base path `/farming`, config directory `~/.farming`, and token authentication. The startup log prints a URL similar to:
80
+ Run Farming on the development machine and open its authenticated URL from any desktop or phone that can reach that machine:
105
81
 
106
82
  ```text
107
- http://development-host:6694/farming?token=<startup-token>
83
+ Desktop or phone browser
84
+ │ HTTP / WebSocket
85
+
86
+ Development machine
87
+ Farming server
88
+ ├── coding Agent processes
89
+ ├── real terminals
90
+ └── repositories and project files
108
91
  ```
109
92
 
110
- Useful daemon commands are:
111
-
112
- ```bash
113
- farming status
114
- farming url
115
- farming logs
116
- farming stop
117
- ```
93
+ The browser can disconnect and reconnect without stopping an Agent. A normal Farming server restart can also reconnect supported live terminal sessions. The desktop layout keeps projects, conversations, files, and review together; the mobile layout focuses one conversation, terminal, or file at a time.
118
94
 
119
- The first authenticated start stores a readable random token in `~/.farming/.session-token`; restarts and upgrades reuse it unless `FARMING_TOKEN` overrides it. Token language defaults to the host time zone: Chinese, Japanese, or English.
95
+ <p align="center">
96
+ <img src="./docs/products/code/assets/05-mobile-agent-chat.png" alt="Farming Code reconnecting to a running Agent from a phone" width="390">
97
+ </p>
120
98
 
121
- ![Start an Agent](./docs/products/code/assets/02-start-agent-picker.png)
99
+ ## Farming CRT
122
100
 
123
- ## Desktop And Mobile
101
+ Farming CRT is an optional keyboard-first, retro control-room interface for scanning many Agents, opening their Chat or Terminal sessions, searching history, and viewing usage telemetry.
124
102
 
125
- Desktop keeps the project, conversation, files, and review close together. Mobile focuses one conversation, terminal, or file at a time and moves navigation into a drawer, making it useful for checking progress and sending a short intervention.
103
+ ![Farming CRT multi-Agent control room](./docs/products/crt/assets/01-crt-dashboard.png)
126
104
 
127
- Farming CRT is currently a desktop interface. Use Farming Code from a phone; CRT mobile concepts are not part of the supported product yet.
105
+ Code and CRT use the same backend Agents and sessions. Switching interfaces does not create a second Agent. Farming Code remains the default interface and the supported phone interface. See the [Farming CRT guide](./docs/products/crt/README.md) for controls and workflows.
128
106
 
129
- ## Installation And Updates
107
+ ## Farming Net
130
108
 
131
- The npm package is the default distribution. **Settings Updates** can upgrade npm installations in place: Farming installs the new package while the current server stays alive, restarts only after installation succeeds, and attempts rollback when the new server cannot start.
109
+ Farming Net is a separate, token-protected directory for Farming deployments. It provides one portal for opening registered instances without storing their target tokens or proxying their traffic. See the [Farming Net guide](./docs/products/net/README.md) for enrollment and security boundaries.
132
110
 
133
- GitHub Releases also provide standalone CLI and directory bundles. Legacy Linux x64 hosts can use the `linux-x64-legacy-glibc228` first-install bootstrap; subsequent application updates use the same private npm prefix. A separately built glibc 2.17 ABI bundle remains available for controlled environments. See [GitHub Releases](https://github.com/zhuwenzhuang/farming/releases) for current assets and release notes.
111
+ ## Installation And Updates
134
112
 
135
- Source development:
113
+ The installed `farming` CLI defaults to port `6694`, base path `/farming`, config directory `~/.farming`, and token authentication. Useful daemon commands are:
136
114
 
137
115
  ```bash
138
- npm install
139
- npm start
116
+ farming status
117
+ farming url
118
+ farming logs
119
+ farming stop
140
120
  ```
141
121
 
142
- For trusted local development only, `npm run start:no-auth` disables token authentication.
122
+ The startup token is stored in `~/.farming/.session-token` and reused across restarts and upgrades. **Settings → Updates** can upgrade npm installations in place. GitHub Releases also provide standalone CLI and directory bundles; see [GitHub Releases](https://github.com/zhuwenzhuang/farming/releases) for current artifacts.
143
123
 
144
- ## How It Works
124
+ To run from source with the same port and base path:
145
125
 
146
- ```text
147
- Farming Code / Farming CRT
148
- React, Monaco, xterm.js, CRT browser skin
149
- │ HTTP + WebSocket
150
-
151
- Farming core
152
- auth, Agent manager, ACP, history, files, review, usage
153
- │ native PTY host + session providers
154
-
155
- Development host
156
- repositories, shells, Codex, Claude Code, OpenCode, Qoder, ...
126
+ ```bash
127
+ npm install
128
+ PORT=6694 FARMING_BASE_PATH=/farming npm start
157
129
  ```
158
130
 
159
- The backend owns lifecycle, authentication, session routing, workspace boundaries, history, and configuration. Interactive terminal sessions use a separate native PTY host by default, allowing browser and server reconnection without replacing the live process. The browser terminal renderer defaults to xterm.js WebGL as its single supported product path; the Ghostty web adapter remains an explicit debug path, not a runtime fallback.
160
-
161
- Runtime settings live in `~/.farming/settings.json`. Farming session metadata, the project membership index, archived runs, theme settings, update state, logs, and the startup token use separate files under `~/.farming/`. External provider histories remain read-only integrations except for explicit Codex archive and unarchive lifecycle actions.
131
+ For trusted local development only, `npm run start:no-auth` disables token authentication.
162
132
 
163
133
  ## Security
164
134
 
165
- Farming controls real terminals and files on the target machine. Run it on a trusted development host and trusted network. Do not expose it directly to the public internet without a VPN, SSH tunnel, HTTPS reverse proxy, or equivalent access control.
135
+ Farming controls real terminals and files on the development machine. Run it on a trusted host and network. Do not expose it directly to the public internet without a VPN, SSH tunnel, HTTPS reverse proxy, or equivalent access control.
166
136
 
167
137
  Token authentication protects HTTP and WebSocket traffic. `FARMING_DISABLE_AUTH=1` is only for trusted local development. Workspace file APIs validate paths against the selected project root. See [SECURITY.md](./SECURITY.md) for reporting and deployment guidance.
168
138
 
@@ -194,6 +164,12 @@ Product screenshots are generated from an anonymous demo workspace with real bro
194
164
  npm run docs:product:screenshots
195
165
  ```
196
166
 
167
+ To refresh only selected files, pass a comma-separated list:
168
+
169
+ ```bash
170
+ FARMING_SCREENSHOT_FILES=01-code-workspace.png npm run docs:product:screenshots
171
+ ```
172
+
197
173
  ## License
198
174
 
199
175
  Farming is released under the [MIT License](./LICENSE). Third-party notices are listed in [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md).
package/README.zh_cn.md CHANGED
@@ -1,170 +1,140 @@
1
- # Farming
1
+ <p align="center">
2
+ <img src="./public/farming-2/app-icon-v2-512.png" alt="Farming" width="112">
3
+ </p>
2
4
 
3
- > English version: [README.md](./README.md)
5
+ <h1 align="center">Farming</h1>
4
6
 
5
- [![CI](https://github.com/zhuwenzhuang/farming/actions/workflows/ci.yml/badge.svg)](https://github.com/zhuwenzhuang/farming/actions/workflows/ci.yml)
6
- [![Release](https://img.shields.io/github/v/release/zhuwenzhuang/farming?label=release)](https://github.com/zhuwenzhuang/farming/releases)
7
- [![npm](https://img.shields.io/npm/v/farming-code?label=npm)](https://www.npmjs.com/package/farming-code)
8
- [![License](https://img.shields.io/github/license/zhuwenzhuang/farming)](./LICENSE)
9
- ![Node](https://img.shields.io/badge/node-%3E%3D22-339933?logo=nodedotjs&logoColor=white)
10
- ![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux-555)
7
+ <p align="center">
8
+ Farming 是一个开源的远程 Web 工作台,用于在开发机上启动和管理 AI Coding Agent。
9
+ </p>
11
10
 
12
- Farming 是一个开源、可自定义、运行在开发机上的浏览器 AI Coding Agent 工作台。它把多个实时 Agent、结构化对话、真实终端、项目文件、Review、历史记录和运行时控制放在一起,同时代码仓库和 Agent 进程仍然留在开发机上。
11
+ <p align="center"><a href="./README.md">English</a></p>
13
12
 
14
- Coding CLI 已经能正常工作的开发机上运行 Farming,就可以从电脑或手机回到同一批任务。关闭浏览器不会停止 Agent;Farming Server 重启时,独立的原生 PTY Host 也可以保留正在运行的终端会话。
13
+ <p align="center">
14
+ <a href="https://github.com/zhuwenzhuang/farming/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/zhuwenzhuang/farming/actions/workflows/ci.yml/badge.svg"></a>
15
+ <a href="https://github.com/zhuwenzhuang/farming/releases"><img alt="Release" src="https://img.shields.io/github/v/release/zhuwenzhuang/farming?label=release"></a>
16
+ <a href="https://www.npmjs.com/package/farming-code"><img alt="npm" src="https://img.shields.io/npm/v/farming-code?label=npm"></a>
17
+ <a href="./LICENSE"><img alt="License" src="https://img.shields.io/github/license/zhuwenzhuang/farming"></a>
18
+ <img alt="Node.js 22+" src="https://img.shields.io/badge/node-%3E%3D22-339933?logo=nodedotjs&amp;logoColor=white">
19
+ <img alt="macOS and Linux" src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-555">
20
+ </p>
21
+
22
+ ![Farming Code 工作台](./docs/products/code/assets/01-code-workspace.png)
23
+
24
+ Farming 与代码仓库和 Coding CLI 运行在同一台开发机上。Agent 进程、终端和项目文件都留在这台机器上;电脑或手机浏览器连接并操作这些真实 Session。
15
25
 
16
26
  ## 快速开始
17
27
 
18
- 准备好 Node.js 22 或更新版本,以及至少一个已安装、已登录的受支持 Coding CLI,然后用一行命令安装并启动 Farming
28
+ 准备好 Node.js 22 或更新版本,以及至少一个已安装、已登录的受支持 Coding CLI:
19
29
 
20
30
  ```bash
21
31
  npm install --global farming-code@latest && farming daemon
22
32
  ```
23
33
 
24
- 打开命令输出的带鉴权 URL,选择 **New Agent**、Agent 类型和 Workspace,然后从 Chat 或 Terminal 开始工作。
25
-
26
- ![Farming CRT 用量控制室](./docs/products/crt/assets/crt-billing-control-room.png)
27
-
28
- ## 两套界面,同一套运行时
29
-
30
- Farming 2 在同一批 Agent 和 Session 上提供两套完整的浏览器界面。
31
-
32
- ### Farming Code
33
-
34
- 默认工作台,适合阅读对话、介入任务、编辑文件和检查工作区修改。
35
-
36
- ![Farming Code 结构化 Chat](./docs/products/code/assets/11-code-agent-process.png)
37
-
38
- ### Farming CRT
39
-
40
- 键盘优先的控制室,适合同时观察多个 Agent、打开结构化 Chat 或原生 Terminal、搜索历史和查看实时用量遥测。
41
-
42
- ![Farming CRT 控制台](./docs/products/crt/assets/01-crt-dashboard.png)
34
+ 打开命令输出的任意一个带鉴权 URL,选择 **New Agent**,再选择 CLI、Workspace Chat 或 Terminal。关闭浏览器不会停止 Agent;同一个浏览器可以再次打开该地址。在开发机上,下面的命令会重新输出本机地址:
43
35
 
44
- | | Farming Code | Farming CRT |
45
- | --- | --- | --- |
46
- | 更适合 | 长对话、文件、编辑、Diff、Review | 总览监控、键盘控制、终端操作、遥测 |
47
- | 实时 Session | 结构化 Chat 与真实 PTY Terminal | 磷光风格 Chat 与真实 xterm Terminal |
48
- | 导航方式 | 项目侧栏、Search、History、Files | 稳定 Agent 机位和键盘控制台 |
49
- | 外观 | 浅色与深色 | CRT 效果、终端字号、可选 Dynamic Heat |
50
- | 入口 | `/farming/code/` 或 `/farming/` | `/farming/crt/` |
36
+ ```bash
37
+ farming url
38
+ ```
51
39
 
52
- 切换界面不会重启或复制 Agent。如果 Farming Code 启动或渲染失败,有限范围的诊断层仍会保留后面的实时 CRT 界面,而不是把正在运行的 Session 一起遮掉。
40
+ 新的远程浏览器应使用 `farming daemon` 启动时输出的带鉴权 **Network** URL。VPN、SSH Tunnel HTTPS Reverse Proxy 可以提供稳定且可达的地址,但第一次访问仍需要 Farming 启动 Token。
53
41
 
54
- 不修改地址也可以直接切换:
42
+ ![启动 Agent](./docs/products/code/assets/02-start-agent-picker.png)
55
43
 
56
- - **Farming Code → CRT:**点击左下角齿轮,打开**界面**,再选择 **Farming CRT**。
57
- - **Farming CRT → Code:**按 `S`(或点击 **[S] SETTINGS**),在 **UI Theme** 中选择 **Farming Code**。
44
+ ## Farming Code
58
45
 
59
- 条件允许时,Farming 会把当前聚焦的 Agent 一起带到另一套界面。两边继续使用同一个实时 Agent Provider Session;这里只切换界面,不会重启会话。
46
+ Farming Code 是默认的桌面与手机界面。它按项目组织工作,把实时 Agent、可恢复的 History、文件和 Review 放在同一个浏览器工作区里。
60
47
 
61
- 完整能力矩阵和截图导览见 [Farming 2 产品总览](./docs/products/README.zh_cn.md)。两套界面的完整流程分别见 [Farming Code 指南](./docs/products/code/README.zh_cn.md) 和 [Farming CRT 指南](./docs/products/crt/README.zh_cn.md)。
48
+ ### Agent、Chat Terminal
62
49
 
63
- ## Farming Net:部署门户
50
+ 启动或恢复 Codex、Claude Code、OpenCode、Qoder 以及其他检测到的 Coding CLI。受支持的 Agent 提供结构化 Chat,用来阅读结果和检查工具活动;也可以打开真实 Terminal,直接操作 CLI。Search 和 History 同时覆盖当前工作与可恢复 Session。
64
51
 
65
- Farming Net 是一套独立、带 Token 鉴权的 Farming 环境目录。卡片可以指向当前设备、远程开发机、内网地址或隧道中的 Farming;已登记的目标接受短时签名通行证,让用户只保留一个门户登录,不再分别记录每个部署地址和目标 Token。
52
+ ![Farming Code 结构化 Agent 过程](./docs/products/code/assets/11-code-agent-process.png)
66
53
 
67
- ```bash
68
- FARMING_NET_PORT=6693 FARMING_NET_BASE_PATH=/farming-net npm run start:net
69
- ```
54
+ ### Files 与 Review
70
55
 
71
- 门户自己的 Token、签名身份和私有 `instances.json` 注册表放在 `~/.farming-net/`。它不代理目标流量,也不保存目标 Token;每个目标仍是独立 Farming 服务,并且主动决定是否信任门户。登记方式和安全边界见 [Farming Net 指南](./docs/products/net/README.zh_cn.md)
72
-
73
- ## 现在可以做什么
74
-
75
- - 按项目组织实时 Agent,置顶或重命名重点工作、查看未读状态、搜索实时与历史 Session,并归档或恢复任务。
76
- - Codex、Claude Code、OpenCode 和 Qoder 使用结构化 ACP Chat。计划、推理、工具调用、权限请求、内嵌终端、子 Session、附件、排队追问和精确修改摘要都可以保留,但不会淹没最终答案。
77
- - 在结构化 Chat 与真实 PTY Terminal 之间切换同一个 Provider Session。支持的 Codex 模型、思考强度、Fast、Ultra 和权限修改会作用到实时工作流;兼容 Terminal 会立即应用模型修改,并在接受下一条 Composer 消息前确认 CLI 的真实状态。
78
- - 浏览、搜索并轻量编辑 Project Files,通过复用 VS Code 图算法的 Git History 查看提交树与变更文件,检查 Git Changes、Diff 和 Blame,再把 Commit 或 Working Copy 修改送入带 Revision、行内评论和 Reviewed 状态的 Review。
79
- - 在 Provider 提供所需数据时查看 CPU/MEM、Token Rate、Context、Quota、Provider 用量,以及 CRT 的按日/实时 Token 遥测。
80
- - 从电脑或手机继续同一个 Farming Code 任务,Agent 进程始终留在开发机上。
56
+ 浏览、搜索并轻量编辑 Project Files,不需要离开当前任务。检查 Git Changes、History、Diff Blame,再把 Commit Working Copy 修改打开到 Review
81
57
 
82
58
  ![Farming Code 项目文件与 Blame](./docs/products/code/assets/04-files-editor-blame.png)
83
59
 
84
- ## 支持的 Agent 路径
60
+ ## 支持的 Agent
85
61
 
86
- Farming 会发现开发机上已经安装的 CLI。有 ACP 支持的 Provider 使用更完整的结构化运行时,其他检测到的 Coding Agent 仍然可以作为一等 Terminal Session 使用。
62
+ Farming 会发现开发机上已经安装的 CLI。Codex、Claude Code、OpenCode Qoder 同时支持结构化 Chat 与原生 Terminal;其他检测到的 Coding Agent 使用 Terminal 路径。
87
63
 
88
- | Agent | 结构化 Chat | 原生 Terminal | History / Resume |
64
+ | Agent | 结构化 Chat | Terminal | History / Resume |
89
65
  | --- | --- | --- | --- |
90
- | Codex | ACP | 是 | 是 |
91
- | Claude Code | ACP | 是 | 是 |
92
- | OpenCode | ACP | 是 | 是 |
93
- | Qoder | ACP | 是 | 是 |
66
+ | Codex | | 是 | 是 |
67
+ | Claude Code | | 是 | 是 |
68
+ | OpenCode | | 是 | 是 |
69
+ | Qoder | | 是 | 是 |
94
70
  | Qwen Code | — | 是 | 取决于 CLI |
95
71
  | Aider | — | 是 | 取决于 CLI |
96
72
  | GitHub Copilot CLI | — | 是 | 取决于 CLI |
97
73
  | Amazon Q | — | 是 | 取决于 CLI |
98
- | bash / zsh | — | 是 | 没有 Provider Session Resume |
74
+ | bash / zsh | — | 是 | |
99
75
 
100
76
  Farming 承载的是已经能在同一台机器正常工作的 CLI,不替代 Provider 的安装、登录和账户配置。
101
77
 
102
- ## 运行默认值与 Daemon 命令
78
+ ## 远程使用
103
79
 
104
- 默认端口是 `6694`,Base Path 是 `/farming`,配置目录是 `~/.farming`,Token 鉴权默认开启。启动日志会打印类似下面的 URL:
80
+ 在开发机上运行 Farming,再从能够访问这台机器的电脑或手机打开带鉴权 URL:
105
81
 
106
82
  ```text
107
- http://development-host:6694/farming?token=<startup-token>
83
+ 电脑或手机浏览器
84
+ │ HTTP / WebSocket
85
+
86
+ 开发机
87
+ Farming Server
88
+ ├── Coding Agent 进程
89
+ ├── 真实 Terminal
90
+ └── 代码仓库与项目文件
108
91
  ```
109
92
 
110
- 常用守护进程命令:
111
-
112
- ```bash
113
- farming status
114
- farming url
115
- farming logs
116
- farming stop
117
- ```
93
+ 浏览器断开或重新连接不会停止 Agent。Farming Server 正常重启后也可以重新连接受支持的实时 Terminal Session。桌面布局把项目、对话、文件和 Review 放在一起;手机布局一次聚焦一段对话、一个 Terminal 或一个文件。
118
94
 
119
- 第一次带鉴权启动会把随机、可读的 Token 写入 `~/.farming/.session-token`;后续重启和升级都会复用,除非显式设置 `FARMING_TOKEN`。Token 默认根据时区使用中文、日文或英文。
95
+ <p align="center">
96
+ <img src="./docs/products/code/assets/05-mobile-agent-chat.png" alt="使用手机重新连接仍在运行的 Farming Code Agent" width="390">
97
+ </p>
120
98
 
121
- ![启动 Agent](./docs/products/code/assets/02-start-agent-picker.png)
99
+ ## Farming CRT
122
100
 
123
- ## 桌面与手机
101
+ Farming CRT 是可选的键盘优先复古控制室,用来扫视多个 Agent、打开它们的 Chat 或 Terminal、搜索 History,以及查看用量遥测。
124
102
 
125
- 桌面端把项目、对话、文件和 Review 放在彼此靠近的位置。移动端一次聚焦一段对话、一个终端或一个文件,并把导航移入抽屉,更适合查看进度和发送短介入。
103
+ ![Farming CRT 多 Agent 控制室](./docs/products/crt/assets/01-crt-dashboard.png)
126
104
 
127
- Farming CRT 当前只作为桌面界面使用。手机请使用 Farming CodeCRT 手机方案目前仍是概念设计,不属于已支持的产品能力。
105
+ Code CRT 使用相同的后端 Agent 和 Session,切换界面不会创建第二个 Agent。Farming Code 仍是默认界面,也是受支持的手机界面。控制方式和完整流程见 [Farming CRT 指南](./docs/products/crt/README.zh_cn.md)。
128
106
 
129
- ## 安装与更新
107
+ ## Farming Net
130
108
 
131
- npm 包是默认分发方式。**Settings Updates** 可以原地升级 npm 安装:Farming 会在当前 Server 仍运行时安装新包,只在安装成功后重启;新 Server 无法启动时会尝试回退。
109
+ Farming Net 是独立、带 Token 鉴权的 Farming 部署目录。它提供一个入口打开已登记实例,但不保存目标 Token,也不代理目标流量。登记方式和安全边界见 [Farming Net 指南](./docs/products/net/README.zh_cn.md)。
132
110
 
133
- GitHub Releases 也提供独立 CLI 和目录 Bundle。旧版 Linux x64 可以用 `linux-x64-legacy-glibc228` 完成第一次安装,后续应用更新继续使用同一个私有 npm Prefix。受控环境还可以单独构建 glibc 2.17 ABI Bundle。当前产物和版本说明见 [GitHub Releases](https://github.com/zhuwenzhuang/farming/releases)。
111
+ ## 安装与更新
134
112
 
135
- 从源码开发:
113
+ 安装后的 `farming` CLI 默认端口是 `6694`,Base Path 是 `/farming`,配置目录是 `~/.farming`,Token 鉴权默认开启。常用 Daemon 命令:
136
114
 
137
115
  ```bash
138
- npm install
139
- npm start
116
+ farming status
117
+ farming url
118
+ farming logs
119
+ farming stop
140
120
  ```
141
121
 
142
- 只有在可信本地开发环境中,才可以用 `npm run start:no-auth` 关闭 Token 鉴权。
122
+ 启动 Token 存放在 `~/.farming/.session-token`,重启和升级会继续复用。**Settings Updates** 可以原地升级 npm 安装。GitHub Releases 也提供独立 CLI 和目录 Bundle;当前产物见 [GitHub Releases](https://github.com/zhuwenzhuang/farming/releases)。
143
123
 
144
- ## 工作原理
124
+ 从源码运行,并使用相同的端口与 Base Path:
145
125
 
146
- ```text
147
- Farming Code / Farming CRT
148
- React, Monaco, xterm.js, CRT browser skin
149
- │ HTTP + WebSocket
150
-
151
- Farming core
152
- auth, Agent manager, ACP, history, files, review, usage
153
- │ native PTY host + session providers
154
-
155
- Development host
156
- repositories, shells, Codex, Claude Code, OpenCode, Qoder, ...
126
+ ```bash
127
+ npm install
128
+ PORT=6694 FARMING_BASE_PATH=/farming npm start
157
129
  ```
158
130
 
159
- 后端负责生命周期、鉴权、Session 路由、Workspace 边界、History 和配置。交互式 Terminal 默认由独立的原生 PTY Host 持有,因此浏览器和 Server 可以重新连接,而不需要替换实际进程。xterm.js WebGL 是唯一受支持的产品 Terminal Renderer;Ghostty Web Adapter 只保留为显式调试路径,不作为运行时 Fallback。
160
-
161
- 运行时设置存放在 `~/.farming/settings.json`。Farming Session 元数据、项目成员索引、归档运行、主题设置、更新状态、日志和启动 Token 使用 `~/.farming/` 下彼此独立的文件。外部 Provider History 保持只读,但明确的 Codex archive / unarchive 生命周期操作除外。
131
+ 只有在可信本地开发环境中,才可以用 `npm run start:no-auth` 关闭 Token 鉴权。
162
132
 
163
133
  ## 安全
164
134
 
165
- Farming 会控制目标机器上的真实终端和文件。请只运行在可信开发机和可信网络中,不要在没有 VPN、SSH Tunnel、HTTPS Reverse Proxy 或等价访问控制时直接暴露到公网。
135
+ Farming 会控制开发机上的真实终端和文件。请只运行在可信主机和可信网络中,不要在没有 VPN、SSH Tunnel、HTTPS Reverse Proxy 或等价访问控制时直接暴露到公网。
166
136
 
167
- Token 鉴权同时保护 HTTP 和 WebSocket。`FARMING_DISABLE_AUTH=1` 只适合可信本地开发;Workspace 文件 API 会校验所有路径都位于所选项目根目录内。报告和部署说明见 [SECURITY.md](./SECURITY.md)。
137
+ Token 鉴权同时保护 HTTP 和 WebSocket。`FARMING_DISABLE_AUTH=1` 只适合可信本地开发;Workspace 文件 API 会校验所有路径都位于所选项目根目录内。报告和部署说明见 [SECURITY.zh_cn.md](./SECURITY.zh_cn.md)。
168
138
 
169
139
  ## 文档
170
140
 
@@ -194,6 +164,12 @@ npm run test:e2e:playwright
194
164
  npm run docs:product:screenshots
195
165
  ```
196
166
 
167
+ 只更新指定截图时,可以传入逗号分隔的文件名:
168
+
169
+ ```bash
170
+ FARMING_SCREENSHOT_FILES=01-code-workspace.png npm run docs:product:screenshots
171
+ ```
172
+
197
173
  ## License
198
174
 
199
175
  Farming 使用 [MIT License](./LICENSE)。第三方组件声明见 [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md)。