farming-code 2.2.7 → 2.2.11
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 +110 -199
- package/README.zh_cn.md +106 -237
- package/THIRD_PARTY_NOTICES.md +11 -2
- package/backend/acp-checkpoint-store.js +198 -0
- package/backend/acp-runtime.js +306 -83
- package/backend/acp-session-state.js +202 -6
- package/backend/acp-transcript.js +112 -0
- package/backend/agent-activity.js +6 -157
- package/backend/agent-manager.js +1496 -737
- package/backend/agent-provider-session.js +17 -242
- package/backend/agent-runtime-binding.js +219 -0
- package/backend/agent-session-history.js +66 -1
- package/backend/auth.js +79 -6
- package/backend/codex-models.js +81 -84
- package/backend/codex-session-archive.js +45 -0
- package/backend/codex-terminal-profile.js +500 -0
- package/backend/codex-transcript-sanitizer.js +12 -0
- package/backend/codex-transcript.js +230 -8
- package/backend/config-manager.js +30 -0
- package/backend/control-api.js +192 -17
- package/backend/farming-net-pass.js +285 -0
- package/backend/farming-net-registry.js +112 -0
- package/backend/farming-net-server.js +298 -0
- package/backend/farming-session-store.js +5 -13
- package/backend/git-worktree-info.js +181 -0
- package/backend/local-session-engine.js +411 -186
- package/backend/main-page-session.js +5 -2
- package/backend/native-pty-controller-generation.js +106 -0
- package/backend/native-pty-host-client.js +275 -7
- package/backend/native-pty-host-identity.js +86 -0
- package/backend/native-pty-host.js +813 -114
- package/backend/native-session-engine.js +100 -28
- package/backend/packaged-node-pty.js +22 -2
- package/backend/provider-adapters.js +253 -0
- package/backend/provider-session-service.js +241 -0
- package/backend/runtime-observation.js +81 -0
- package/backend/server.js +294 -86
- package/backend/session-engine-bridge.js +21 -2
- package/backend/session-engine-router.js +1 -1
- package/backend/session-engine.js +1 -1
- package/backend/session-stream-protocol.js +185 -0
- package/backend/storage-layout.js +55 -0
- package/backend/terminal-attach-checkpoint.js +74 -0
- package/backend/terminal-exit-quiescence.js +39 -0
- package/backend/terminal-reducer-flow-control.js +97 -0
- package/backend/terminal-screen-state.js +11 -2
- package/backend/terminal-screen-worker-pool.js +59 -6
- package/backend/terminal-screen-worker-thread.js +97 -57
- package/backend/terminal-screen-worker.js +133 -51
- package/backend/terminal-state-serialization.js +127 -0
- package/backend/terminal-status.js +23 -4
- package/backend/usage-monitor.js +81 -4
- package/backend/workspace-directory.js +152 -0
- package/backend/workspace-file-router.js +182 -76
- package/backend/workspace-file-service.js +319 -4
- package/backend/workspace-root-registry.js +164 -0
- package/dist/assets/App-CHYpgECZ.js +208 -0
- package/dist/assets/{FileEditorMarkdownPreview-elKWc8Im.js → FileEditorMarkdownPreview--Cri80nQ.js} +92 -92
- package/dist/assets/FileEditorPane-DGJlEKdf.js +2 -0
- package/dist/assets/IconGlyphs-Cc14sepw.js +1 -0
- package/dist/assets/ProjectFilesSection-Cz1wG4NT.js +12 -0
- package/dist/assets/{ReviewPage-BaXu1ZdX.js → ReviewPage-LonRc6Fz.js} +1 -1
- package/dist/assets/code-dark-B1pAtO_P.css +1 -0
- package/dist/assets/file-icons-Bw2qd5iT.js +1 -0
- package/dist/assets/{index-B8SHldPE.js → index-miO2r9IZ.js} +3 -3
- package/dist/assets/main-DNe0jPw-.css +1 -0
- package/dist/assets/workspace-editor-model-BQol4qbA.js +1 -0
- package/dist/assets/workspace-editor-monaco-5gFbeDPF.js +1 -0
- package/dist/assets/workspace-editor-monaco-xPv8JzHH.js +4 -0
- package/dist/assets/workspace-view-state-DvYG_9PH.js +7 -0
- package/dist/assets/workspace-working-copy-D8-s_Sgh.js +1 -0
- package/dist/index.html +1 -1
- package/frontend/farming-net/app.css +625 -0
- package/frontend/farming-net/app.js +268 -0
- package/frontend/farming-net/index.html +86 -0
- package/frontend/reading-anchor.js +198 -0
- package/frontend/session-bridge.js +12 -3
- package/frontend/session-modal-bridge.js +5 -12
- package/frontend/skins/crt/app.js +1976 -793
- package/frontend/skins/crt/index.html +313 -23
- package/frontend/skins/crt/styles/billing.css +294 -223
- package/frontend/skins/crt/styles/monochrome-green.css +7 -2
- package/frontend/terminal-replay.js +372 -0
- package/package.json +10 -3
- package/shared/browser-protocol.d.ts +5 -0
- package/shared/browser-protocol.js +130 -0
- package/dist/assets/App-iA2BU9P6.js +0 -124
- package/dist/assets/FileEditorPane-RWiFD2cq.js +0 -5
- package/dist/assets/IconGlyphs-DfL0EBnj.js +0 -1
- package/dist/assets/ProjectFilesSection-Q4PDsWmM.js +0 -12
- package/dist/assets/code-dark-CDkOQAtK.css +0 -1
- package/dist/assets/file-icons-EFUGSSwf.js +0 -1
- package/dist/assets/main-DpYuBonn.css +0 -1
- package/dist/assets/qoder-C9LmmOSf.svg +0 -1
- package/dist/assets/qoder-Cf9gl0Y5.svg +0 -1
- package/dist/assets/qoder-gHCinseV.svg +0 -1
- package/dist/assets/workspace-view-state-CTyDzk2D.js +0 -1
- package/dist/assets/zsh-CLpveKlF.svg +0 -1
- package/dist/assets/zsh-FxSpMPbz.svg +0 -1
- /package/dist/assets/{api-D1lyBYIQ.js → api-D8nyOEbz.js} +0 -0
- /package/dist/assets/{core-ZlAPicox.js → core-D0LFJkDt.js} +0 -0
- /package/dist/assets/{useWorkspaceMenuKeyboard-CneKAZUJ.js → useWorkspaceMenuKeyboard-Brws6Ar9.js} +0 -0
package/README.md
CHANGED
|
@@ -9,279 +9,190 @@
|
|
|
9
9
|

|
|
10
10
|

|
|
11
11
|
|
|
12
|
-
Farming is
|
|
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.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Farming is designed around remote hosting. Agents, shells, project files, and git state keep running on the remote machine. A desktop browser is good for editing, reviewing, searching, and long follow-up sessions; a mobile browser is good for checking progress, switching sessions, and sending a short intervention while away from the desk.
|
|
17
|
-
|
|
18
|
-
The browser exposes two live interfaces over the same backend: Farming Code at `/farming/code/` and the original CRT interface at `/farming/crt/`. `/farming/` continues to open Farming Code. If Code cannot start or render, the failure view keeps the live CRT interface visible behind the bounded error details, without restarting running agents.
|
|
19
|
-
|
|
20
|
-
For a product-oriented introduction, screenshots, and the architecture diagram, see the [Farming 2 Wiki](https://github.com/zhuwenzhuang/farming/wiki/English).
|
|
21
|
-
|
|
22
|
-

|
|
23
|
-
|
|
24
|
-
> If you are an AI agent contributing to this repository, read [AGENTS.md](./AGENTS.md) first.
|
|
25
|
-
|
|
26
|
-
## Why Farming Exists
|
|
27
|
-
|
|
28
|
-
Current AI-agent interfaces are often chat-session lists. They are not great at showing which long-running task matters now, which agent is waiting, which one is stale, and where a human should intervene.
|
|
29
|
-
|
|
30
|
-
Farming first solves the practical workbench problem: put the tools needed to supervise coding agents into one remote UI. Longer term, it explores attention management through a Main Agent that can observe, coordinate, and summarize multiple child agents.
|
|
31
|
-
|
|
32
|
-
## Farming 2
|
|
33
|
-
|
|
34
|
-
Farming 2 turns the project into a remote coding workbench:
|
|
35
|
-
|
|
36
|
-
- start and manage Codex, Claude, OpenCode, Qoder, bash, and zsh sessions in the browser;
|
|
37
|
-
- discover and resume local Codex, Claude, OpenCode, and Qoder session history, then reconnect it to live Farming terminals;
|
|
38
|
-
- group agents by project;
|
|
39
|
-
- open Project Files with Open Editors, file tree, search, Monaco editing, Markdown/image preview, git changes, diff, and blame;
|
|
40
|
-
- click terminal `path:line` references and HTTP URLs;
|
|
41
|
-
- set Codex / Claude launch profiles for permissions, model, and speed where the underlying runtime supports them; App Server Codex updates permissions on its current thread, while terminal-owned sessions restart and resume when they already have a provider session id, or start fresh when no resumable id exists yet;
|
|
42
|
-
- attach text and images to composer messages;
|
|
43
|
-
- view lightweight usage, context, token-rate, quota, and CPU/MEM signals where available;
|
|
44
|
-
- access the same remote service from desktop and mobile browsers.
|
|
45
|
-
|
|
46
|
-
Screenshots, install details, and product notes are in [Farming 2 product guide](./docs/products/code/README.md).
|
|
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.
|
|
47
15
|
|
|
48
16
|
## Quick Start
|
|
49
17
|
|
|
50
|
-
|
|
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:
|
|
51
19
|
|
|
52
20
|
```bash
|
|
53
|
-
npm install --global farming-code
|
|
54
|
-
farming daemon
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Farming defaults to port `6694`, base path `/farming`, config directory `~/.farming`, and token auth. The first authenticated start generates a random readable token and stores it in `~/.farming/.session-token`; later restarts and upgrades reuse that token unless `FARMING_TOKEN` is explicitly set. In Chinese time zones this is a Chinese haiku-style passphrase by default; Japanese time zones use Japanese haiku-style passphrases, and other time zones use English passphrases. The startup log prints a URL like:
|
|
58
|
-
|
|
59
|
-
```text
|
|
60
|
-
http://linux-host:6694/farming?token=<startup-token>
|
|
21
|
+
npm install --global farming-code@latest && farming daemon
|
|
61
22
|
```
|
|
62
23
|
|
|
63
|
-
Open
|
|
24
|
+
Open the authenticated URL printed by the command, choose **New Agent**, select an Agent and workspace, and start in Chat or Terminal.
|
|
64
25
|
|
|
65
|
-
|
|
26
|
+

|
|
66
27
|
|
|
67
|
-
|
|
28
|
+
## Two Interfaces, One Runtime
|
|
68
29
|
|
|
69
|
-
Farming
|
|
30
|
+
Farming 2 provides two complete browser interfaces over the same agents and sessions.
|
|
70
31
|
|
|
71
|
-
|
|
72
|
-
| --- | --- | --- |
|
|
73
|
-
| macOS and Linux | `npm install --global farming-code` | Default path. Requires Node.js 22 or newer and a system runtime that can load `node-pty`. |
|
|
74
|
-
| Standalone use | platform CLI from GitHub Releases | Manual installation for environments that do not want npm; upgrades remain manual. |
|
|
75
|
-
| Directory deployment | `farming-<version>-<platform>-<arch>.tar.gz` | App bundle with production dependencies and launcher scripts; it uses the target system runtime. |
|
|
76
|
-
| Legacy Linux x64 (glibc < 2.28) | `farming-<version>-linux-x64-legacy-glibc228.tar.gz` | First-install bootstrap with a pinned glibc 2.28 runtime. It installs Farming under `~/.farming/npm`; later one-click updates use npm like the default installation. A Node.js 22 executable and npm are still required. |
|
|
77
|
-
| Custom older Linux build | `farming-<version>-linux-x64-glibc217.tar.gz` | Separately built bundle that rebuilds `node-pty` against a glibc 2.17 baseline; it still needs a usable target Node.js runtime. |
|
|
32
|
+
### Farming Code
|
|
78
33
|
|
|
79
|
-
|
|
34
|
+
The default workbench for reading conversations, intervening in tasks, editing files, and reviewing workspace changes.
|
|
80
35
|
|
|
81
|
-
|
|
36
|
+

|
|
82
37
|
|
|
83
|
-
|
|
84
|
-
Browser skins
|
|
85
|
-
React + Vite + Monaco + terminal renderer
|
|
86
|
-
|
|
|
87
|
-
| HTTP / WebSocket
|
|
88
|
-
v
|
|
89
|
-
Farming core
|
|
90
|
-
Express server + token auth + agent manager + session providers
|
|
91
|
-
|
|
|
92
|
-
| native pty host + session engine
|
|
93
|
-
v
|
|
94
|
-
Execution environment
|
|
95
|
-
bash / zsh / Codex / Claude Code
|
|
96
|
-
```
|
|
38
|
+
### Farming CRT
|
|
97
39
|
|
|
98
|
-
|
|
40
|
+
A keyboard-first control room for watching many agents, opening structured Chat or raw Terminal, searching history, and reading live usage telemetry.
|
|
99
41
|
|
|
100
|
-
|
|
42
|
+

|
|
101
43
|
|
|
102
|
-
|
|
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/` |
|
|
103
51
|
|
|
104
|
-
|
|
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.
|
|
105
53
|
|
|
106
|
-
|
|
107
|
-
npm install --global farming-code
|
|
108
|
-
farming daemon
|
|
109
|
-
```
|
|
54
|
+
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.
|
|
110
55
|
|
|
111
|
-
|
|
56
|
+
## Farming Net: One Portal For Deployments
|
|
112
57
|
|
|
113
|
-
|
|
58
|
+
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.
|
|
114
59
|
|
|
115
60
|
```bash
|
|
116
|
-
npm
|
|
117
|
-
npm run release:cli
|
|
61
|
+
FARMING_NET_PORT=6693 FARMING_NET_BASE_PATH=/farming-net npm run start:net
|
|
118
62
|
```
|
|
119
63
|
|
|
120
|
-
|
|
64
|
+
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.
|
|
121
65
|
|
|
122
|
-
|
|
123
|
-
npm install
|
|
124
|
-
npm run release:app
|
|
125
|
-
```
|
|
66
|
+
## What You Can Do
|
|
126
67
|
|
|
127
|
-
|
|
68
|
+
- Group live agents by project, pin or rename important work, track unread activity, search live and historical sessions, and archive or resume tasks.
|
|
69
|
+
- 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.
|
|
70
|
+
- 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.
|
|
71
|
+
- 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.
|
|
72
|
+
- Observe CPU/MEM, token-rate, context, quota, provider usage, and CRT daily/live token telemetry when the provider exposes the required data.
|
|
73
|
+
- Continue the same Farming Code task from desktop or phone without moving the Agent process away from the development host.
|
|
128
74
|
|
|
129
|
-
|
|
75
|
+

|
|
130
76
|
|
|
131
|
-
|
|
132
|
-
npm run release:app:legacy-linux
|
|
133
|
-
```
|
|
77
|
+

|
|
134
78
|
|
|
135
|
-
|
|
79
|
+
## Supported Agent Paths
|
|
136
80
|
|
|
137
|
-
|
|
81
|
+
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.
|
|
138
82
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
83
|
+
| Agent | Structured Chat | Native Terminal | History / resume |
|
|
84
|
+
| --- | --- | --- | --- |
|
|
85
|
+
| Codex | ACP | Yes | Yes |
|
|
86
|
+
| Claude Code | ACP | Yes | Yes |
|
|
87
|
+
| OpenCode | ACP | Yes | Yes |
|
|
88
|
+
| Qoder | ACP | Yes | Yes |
|
|
89
|
+
| Qwen Code | — | Yes | CLI-dependent |
|
|
90
|
+
| Aider | — | Yes | CLI-dependent |
|
|
91
|
+
| GitHub Copilot CLI | — | Yes | CLI-dependent |
|
|
92
|
+
| Amazon Q | — | Yes | CLI-dependent |
|
|
93
|
+
| bash / zsh | — | Yes | No provider-session resume |
|
|
142
94
|
|
|
143
|
-
|
|
95
|
+
Farming hosts CLIs that already work on the same machine. It does not replace provider installation, login, or account configuration.
|
|
144
96
|
|
|
145
|
-
|
|
97
|
+
## Runtime Defaults And Daemon Commands
|
|
146
98
|
|
|
147
|
-
|
|
99
|
+
Farming defaults to port `6694`, base path `/farming`, config directory `~/.farming`, and token authentication. The startup log prints a URL similar to:
|
|
148
100
|
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
./farming daemon
|
|
101
|
+
```text
|
|
102
|
+
http://development-host:6694/farming?token=<startup-token>
|
|
152
103
|
```
|
|
153
104
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
Useful commands:
|
|
105
|
+
Useful daemon commands are:
|
|
157
106
|
|
|
158
107
|
```bash
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
108
|
+
farming status
|
|
109
|
+
farming url
|
|
110
|
+
farming logs
|
|
111
|
+
farming stop
|
|
163
112
|
```
|
|
164
113
|
|
|
165
|
-
|
|
114
|
+
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.
|
|
166
115
|
|
|
167
|
-
|
|
168
|
-
tar -xzf farming-<version>-linux-x64.tar.gz
|
|
169
|
-
cd farming-<version>-linux-x64
|
|
170
|
-
./farming
|
|
171
|
-
```
|
|
116
|
+

|
|
172
117
|
|
|
173
|
-
|
|
118
|
+
## Desktop And Mobile
|
|
174
119
|
|
|
175
|
-
|
|
120
|
+
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.
|
|
176
121
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
```
|
|
122
|
+
<p align="center">
|
|
123
|
+
<img src="./docs/products/code/assets/05-mobile-agent-chat.jpg" alt="Farming Code on mobile" width="320">
|
|
124
|
+
</p>
|
|
181
125
|
|
|
182
|
-
|
|
126
|
+
Farming CRT is currently a desktop interface. Use Farming Code from a phone; CRT mobile concepts are not part of the supported product yet.
|
|
183
127
|
|
|
184
|
-
|
|
185
|
-
npm run start:no-auth
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
## Configuration
|
|
128
|
+
## Installation And Updates
|
|
189
129
|
|
|
190
|
-
|
|
191
|
-
Agent session metadata is stored separately in `~/.farming/sessions/`. Farming
|
|
192
|
-
uses stable `fsess_*` files for its own Agent records; live `agent-...` ids and
|
|
193
|
-
Codex / Claude provider session ids are stored as metadata on those records.
|
|
194
|
-
The main Projects page membership lives in `sessions/index.json` and is exposed
|
|
195
|
-
as `mainPageSessionKeys` only for API compatibility.
|
|
196
|
-
Archived run history is stored in `~/.farming/history/runs.json`, not in
|
|
197
|
-
`settings.json`.
|
|
198
|
-
Theme overrides, the startup token, server pid/state/log files, and native pty
|
|
199
|
-
host logs live under the same config directory.
|
|
130
|
+
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.
|
|
200
131
|
|
|
201
|
-
|
|
132
|
+
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.
|
|
202
133
|
|
|
203
|
-
|
|
204
|
-
- `agentLaunchProfiles.codex`
|
|
205
|
-
- `agentLaunchProfiles.claude`
|
|
206
|
-
- `agentHomes` (home metadata for Codex, Claude, OpenCode, and Qoder; each provider keeps a non-removable `default` home)
|
|
207
|
-
- `workspaceHistory`
|
|
208
|
-
- `dangerouslySkipAgentPermissionsByDefault` (launch supported coding agents such as Codex, Claude, OpenCode, Qoder, Qwen, Aider, GitHub Copilot CLI, and Amazon Q with their provider-specific dangerous permission-skip flags by default)
|
|
134
|
+
Source development:
|
|
209
135
|
|
|
210
|
-
|
|
136
|
+
```bash
|
|
137
|
+
npm install
|
|
138
|
+
npm start
|
|
139
|
+
```
|
|
211
140
|
|
|
212
|
-
|
|
141
|
+
For trusted local development only, `npm run start:no-auth` disables token authentication.
|
|
213
142
|
|
|
214
|
-
|
|
143
|
+
## How It Works
|
|
215
144
|
|
|
216
|
-
|
|
145
|
+
```text
|
|
146
|
+
Farming Code / Farming CRT
|
|
147
|
+
React, Monaco, xterm.js, CRT browser skin
|
|
148
|
+
│ HTTP + WebSocket
|
|
149
|
+
▼
|
|
150
|
+
Farming core
|
|
151
|
+
auth, Agent manager, ACP, history, files, review, usage
|
|
152
|
+
│ native PTY host + session providers
|
|
153
|
+
▼
|
|
154
|
+
Development host
|
|
155
|
+
repositories, shells, Codex, Claude Code, OpenCode, Qoder, ...
|
|
156
|
+
```
|
|
217
157
|
|
|
218
|
-
|
|
219
|
-
- `config/farming.install.env.example`
|
|
158
|
+
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.
|
|
220
159
|
|
|
221
|
-
|
|
160
|
+
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.
|
|
222
161
|
|
|
223
162
|
## Security
|
|
224
163
|
|
|
225
|
-
Farming controls real terminals and
|
|
226
|
-
|
|
227
|
-
The startup token protects both HTTP and WebSocket traffic. It is generated on first authenticated startup, persisted in `~/.farming/.session-token`, and reused across restarts and upgrades. The generated token is designed to be easier to copy than a long hexadecimal secret: Chinese time zones get a Chinese haiku-style passphrase by default, Japanese time zones get a Japanese haiku-style passphrase, and other time zones get an English passphrase. `FARMING_TOKEN_LOCALE=zh|ja|en|auto` can override generation behavior for a new token.
|
|
228
|
-
|
|
229
|
-
`FARMING_DISABLE_AUTH=1` is only for trusted local development. Terminal-owned Codex / Claude sessions apply a permission change by restarting with the selected CLI flags, resuming when a provider session id is available and starting fresh otherwise. App Server Codex applies the new approval and sandbox policy to its existing thread without a CLI restart.
|
|
230
|
-
|
|
231
|
-
See [SECURITY.md](./SECURITY.md) for the reporting policy and deployment notes.
|
|
232
|
-
|
|
233
|
-
## Troubleshooting
|
|
234
|
-
|
|
235
|
-
- **No `codex` or `claude` option works**: verify the CLI is installed, logged in, and runnable from a normal shell on the same host.
|
|
236
|
-
- **Native PTY cannot start**: verify the target system's Node.js and packaged `node-pty` runtime are compatible. On Linux x64 with glibc older than 2.28, use the `-legacy-glibc228` app bundle.
|
|
237
|
-
- **Port already in use**: pass `--port <port>` or let the default daemon mode choose the next available port when no explicit port is provided.
|
|
238
|
-
- **Phone cannot connect**: use the network URL printed by the server and make sure the phone can reach the target machine.
|
|
239
|
-
- **Lost the token URL**: run `./farming url`, or check `./farming logs`.
|
|
240
|
-
|
|
241
|
-
## Repository Layout
|
|
242
|
-
|
|
243
|
-
```text
|
|
244
|
-
farming/
|
|
245
|
-
├── .gitattributes # Source archive export rules
|
|
246
|
-
├── backend/ # Node.js server, session engines, and backend APIs
|
|
247
|
-
├── src/ # React + Vite frontend; Farming Code helpers live under src/components/code/
|
|
248
|
-
├── frontend/skins/crt/ # Independent live CRT entry, app, and visual effects
|
|
249
|
-
├── frontend/*.js # Shared terminal/session browser bridges
|
|
250
|
-
├── docs/products/code/ # Farming Code product docs and screenshots
|
|
251
|
-
├── docs/products/crt/ # CRT skin layout docs
|
|
252
|
-
├── config/ # deployment / install templates
|
|
253
|
-
├── scripts/ # release, deployment, screenshots, tests
|
|
254
|
-
├── tests/e2e/ # Playwright browser flows
|
|
255
|
-
├── pkg.config.cjs
|
|
256
|
-
└── bin/farming
|
|
257
|
-
```
|
|
164
|
+
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.
|
|
258
165
|
|
|
259
|
-
`
|
|
166
|
+
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.
|
|
260
167
|
|
|
261
|
-
##
|
|
168
|
+
## Documentation
|
|
262
169
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
170
|
+
- [Farming 2 product overview and capability map](./docs/products/README.md)
|
|
171
|
+
- [Farming Code guide](./docs/products/code/README.md)
|
|
172
|
+
- [Farming CRT guide](./docs/products/crt/README.md)
|
|
173
|
+
- [Farming Net deployment portal](./docs/products/net/README.md)
|
|
174
|
+
- [Mobile guide](./docs/products/code/mobile-guide.md)
|
|
175
|
+
- [ACP runtime](./docs/products/code/acp-runtime.md)
|
|
176
|
+
- [Review foundation](./docs/products/code/review-foundation.md)
|
|
177
|
+
- [Release history](https://github.com/zhuwenzhuang/farming/releases)
|
|
178
|
+
- [Contributor instructions](./AGENTS.md)
|
|
266
179
|
|
|
267
|
-
|
|
180
|
+
## Development Checks
|
|
268
181
|
|
|
269
182
|
```bash
|
|
270
183
|
npm test
|
|
271
184
|
npm run typecheck
|
|
272
185
|
npm run lint
|
|
186
|
+
FARMING_BASE_PATH=/farming npm run build
|
|
273
187
|
npm run test:e2e:playwright
|
|
274
188
|
```
|
|
275
189
|
|
|
276
|
-
|
|
190
|
+
Product screenshots are generated from an anonymous demo workspace with real browser flows:
|
|
277
191
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
## Contributing
|
|
282
|
-
|
|
283
|
-
Issues and pull requests are welcome. Start with [CONTRIBUTING.md](./CONTRIBUTING.md), and keep user-facing docs updated when behavior or packaging changes.
|
|
192
|
+
```bash
|
|
193
|
+
npm run docs:product:screenshots
|
|
194
|
+
```
|
|
284
195
|
|
|
285
196
|
## License
|
|
286
197
|
|
|
287
|
-
Farming is released under the MIT License.
|
|
198
|
+
Farming is released under the [MIT License](./LICENSE). Third-party notices are listed in [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md).
|