@foxden-app/foxclaw 0.2.4 → 0.2.5

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.
Files changed (2) hide show
  1. package/README.md +84 -82
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,36 +2,36 @@
2
2
 
3
3
  # FoxClaw
4
4
 
5
- FoxClaw 是 Foxden agents 的本地执行爪。
5
+ FoxClaw 是 Foxden agents 的本地执行爪——跑在你自己电脑上,让你通过 Telegram 或微信远程操控本机的 Codex。
6
6
 
7
- 它运行在你自己的电脑上,让受信任的 Telegram 或微信聊天可以控制本机 Codex 环境。你不需要公网服务器:FoxClaw 通过本地 `codex app-server` 与 Codex 通信,把审批留在你的电脑上,并把工作会话发送回手机。
7
+ 不需要公网服务器。FoxClaw 在本地和 `codex app-server` 通信,审批在你电脑上完成,结果推送回手机。
8
8
 
9
9
  ## 从这里开始
10
10
 
11
- - 已经有 Codex、OpenClaw、QwenPaw、Hermes、OpenCodeKimi CLI 这类能操作 shell 的 agent?优先使用 [Agent 辅助安装](./docs/agent-assisted-install.md),这是推荐路径。
12
- - 不熟悉 Node、Telegram 机器人或 Codex CLI?使用 [新手安装指南](./docs/install-for-beginners.md)。
13
- - 已经熟悉 Git、Node 和 `.env` 文件?可以直接使用下面的快速设置。
14
- - 遇到问题?查看 [故障排查](./docs/troubleshooting.md)。
11
+ - 手头有 Codex、OpenClaw、QwenPaw、Hermes、OpenCodeKimi CLI 之类能跑 shell 的 agent?推荐走 [Agent 辅助安装](./docs/agent-assisted-install.md)
12
+ - Node、Telegram 机器人、Codex CLI 不太熟?看 [新手安装指南](./docs/install-for-beginners.md)。
13
+ - Git、Node、`.env` 都玩得转?直接往下看快速设置。
14
+ - 卡住了?看 [故障排查](./docs/troubleshooting.md)。
15
15
 
16
- 如果你希望做到这些,FoxClaw 会很适合:
16
+ FoxClaw 适合这些场景:
17
17
 
18
- - 在手机上使用 Codex,同时不把自己的电脑暴露到公网
19
- - 将代码、shell 访问、认证、审批和运行数据都保留在自己的机器上
20
- - 让一个受信任的 Telegram 用户作为远程操作者
18
+ - 在手机上用 Codex,但不想把电脑暴露到公网
19
+ - 代码、shell、认证、审批、运行数据全部留在本机
20
+ - 只允许一个受信任的 Telegram 用户远程操作
21
21
 
22
- 最小安装只需要一个 Telegram bot token、你的 Telegram 数字用户 ID、Node.js 24,以及一份已经登录的 `codex` CLI。首次安装通常需要 10-20 分钟。
22
+ 最低要求:一个 Telegram bot token、你的 Telegram 数字用户 ID、Node.js 24、一份已登录的 `codex` CLI。首次安装大约 1020 分钟。
23
23
 
24
- 30 秒产品示例:FoxClaw 运行后,向你的 Telegram 机器人发送 `List files in DEFAULT_CWD`。FoxClaw 会让本地 Codex 检查你电脑上的那个目录,并把答案发回 Telegram。
24
+ **30 秒体验**:启动 FoxClaw 后,给你的 Telegram 机器人发一句 `List files in DEFAULT_CWD`。Codex 会在本地检查那个目录,然后把结果发回 Telegram。
25
25
 
26
26
  ## 环境要求
27
27
 
28
- - macOS 或 Linux,并且有可用的 `codex` CLI
29
- - 主机上的 Codex 已完成认证
28
+ - macOS 或 Linux,`codex` CLI 可用
29
+ - Codex 已完成登录认证
30
30
  - Node.js 24+
31
- - 来自 `@BotFather` Telegram bot token
31
+ - 一个 `@BotFather` 创建的 Telegram bot token
32
32
  - 你的 Telegram 数字用户 ID
33
33
 
34
- ## npm 快速设置
34
+ ## 快速设置
35
35
 
36
36
  ```bash
37
37
  npm install -g @foxden-app/foxclaw
@@ -41,7 +41,7 @@ foxclaw doctor
41
41
  foxclaw start
42
42
  ```
43
43
 
44
- pnpm 用户可以使用:
44
+ pnpm 用户:
45
45
 
46
46
  ```bash
47
47
  pnpm add -g @foxden-app/foxclaw
@@ -51,7 +51,7 @@ foxclaw doctor
51
51
  foxclaw start
52
52
  ```
53
53
 
54
- 运行 `doctor` 或 `start` 前先编辑 `.env`。私聊模式的最小配置:
54
+ `doctor` 或 `start` 之前先把 `.env` 填好。私聊模式最小配置:
55
55
 
56
56
  ```dotenv
57
57
  TG_BOT_TOKEN=123456:telegram-token
@@ -61,66 +61,68 @@ DEFAULT_APPROVAL_POLICY=on-request
61
61
  DEFAULT_SANDBOX_MODE=workspace-write
62
62
  ```
63
63
 
64
- 默认配置文件是 `~/.foxclaw/.env`。如果你想把配置放在别处,可以设置 `FOXCLAW_ENV=/path/to/.env`。
64
+ 配置文件默认在 `~/.foxclaw/.env`。想放别处的话设 `FOXCLAW_ENV=/path/to/.env`。
65
65
 
66
- `foxclaw start` 会运行检查并安装或重启后台服务;这个命令是幂等的,升级后可以再执行一次。
66
+ `foxclaw start` 会自动检查环境并安装/重启后台服务,幂等操作,升级后再跑一次就行。
67
67
 
68
- FoxClaw 只接受来自 `TG_ALLOWED_USER_ID` 的消息。把机器人放进群组并不会让每个群成员都能使用它。
68
+ FoxClaw 只响应 `TG_ALLOWED_USER_ID` 的消息——把机器人拉进群不代表群里所有人都能用。
69
69
 
70
70
  <details>
71
- <summary>FoxClaw 运行后可以做什么</summary>
72
-
73
- - 允许一个 Telegram 用户通过私聊、群组和话题控制
74
- - 可选的微信/iLink 通道,复用同一套桥接核心
75
- - 使用 `/threads`、`/open`、`/new`、`/where` 和 `/interrupt` 进行稳定的聊天到线程绑定
76
- - 从手机控制线程生命周期:重命名、归档、取消归档、fork、回滚、compact、reviewdiff
77
- - 面向单个聊天的设置面板:模型、reasoning effort、Fast service tier、access preset、Agent/Plan 模式和 active-turn 行为
78
- - Codex 账户控制:`/account`、`/quota`、`/login_device`、`/login_cancel`、`/auth add <name>`,以及带保护的 `/logout confirm`
79
- - 当某个认证触发用量限制时,在本地 `auth.json_*` 候选之间自动切换 Codex 认证
80
- - 针对命令、文件变更和细粒度权限审批的内联按钮
81
- - 针对工具在 turn 中提出的结构化问题显示 MCP elicitation 卡片
82
- - Skills、MCP、hooks、plugins、apps、feature flags、config、requirementsprovider diagnostics
83
- - 使用 SQLite 持久化绑定、offset、审批、待处理输入提示和审计日志
84
- - 单实例进程锁,避免同一个 bot token 上出现重复 Telegram polling
71
+ <summary>FoxClaw 能做什么</summary>
72
+
73
+ - 单个 Telegram 用户通过私聊、群组、话题控制
74
+ - 可选微信/iLink 通道,复用同一套桥接核心
75
+ - `/threads`、`/open`、`/new`、`/where`、`/interrupt`——稳定的聊天-线程绑定
76
+ - 手机上管理线程生命周期:重命名、归档、取消归档、fork、回滚、compact、reviewdiff
77
+ - 每个聊天独立的设置面板:模型、reasoning effort、Fast tier、access preset、Agent/Plan 模式、active-turn 行为
78
+ - Codex 账户管理:`/account`、`/quota`、`/login_device`、`/login_cancel`、`/auth add <name>`、`/logout confirm`
79
+ - 触发用量限制时自动在本地 `auth.json_*` 之间切换认证
80
+ - 命令、文件变更、细粒度权限审批的内联按钮
81
+ - MCP elicitation 卡片——工具在 turn 中提出结构化问题时展示
82
+ - Skills、MCP、hooks、plugins、apps、feature flags、config、requirementsprovider diagnostics
83
+ - SQLite 持久化:绑定、offset、审批、待处理提示、审计日志
84
+ - 单实例进程锁,防止同一 bot token 重复 polling
85
85
 
86
86
  </details>
87
87
 
88
88
  ## 服务与调试
89
89
 
90
- 推荐使用:
90
+ 推荐方式:
91
91
 
92
92
  ```bash
93
93
  foxclaw start
94
94
  ```
95
95
 
96
- 它会在 Linux 上安装或重启用户级 systemd 服务,在 macOS 上安装或重载 launchd。需要查看服务状态时:
96
+ Linux 上会安装/重启用户级 systemd 服务,macOS 上安装/重载 launchd。查看状态:
97
97
 
98
98
  ```bash
99
99
  systemctl --user status foxclaw.service
100
100
  journalctl --user -u foxclaw.service -f
101
101
  ```
102
102
 
103
- 前台调试时可以直接运行:
103
+ 需要前台调试时:
104
104
 
105
105
  ```bash
106
106
  foxclaw serve
107
107
  ```
108
108
 
109
- 默认运行时文件存储在 `~/.foxclaw`:
109
+ 运行时文件默认在 `~/.foxclaw`:
110
110
 
111
- - store:`~/.foxclaw/data/bridge.sqlite`
112
- - bridge log:`~/.foxclaw/logs/service.log`
113
- - status:`~/.foxclaw/runtime/status.json`
114
- - app-server state:`~/.foxclaw/runtime/codex-app-server.json`
115
- - app-server log:`~/.foxclaw/logs/codex-app-server.log`
111
+ | 用途 | 路径 |
112
+ |------|------|
113
+ | 数据库 | `~/.foxclaw/data/bridge.sqlite` |
114
+ | Bridge 日志 | `~/.foxclaw/logs/service.log` |
115
+ | 状态 | `~/.foxclaw/runtime/status.json` |
116
+ | App-server 状态 | `~/.foxclaw/runtime/codex-app-server.json` |
117
+ | App-server 日志 | `~/.foxclaw/logs/codex-app-server.log` |
116
118
 
117
- 可以用 `STORE_PATH`、`LOCK_PATH`、`CODEX_APP_SERVER_STATE_PATH` 和 `CODEX_APP_SERVER_LOG_PATH` 覆盖 store、lock 和 app-server 路径。
119
+ 可通过 `STORE_PATH`、`LOCK_PATH`、`CODEX_APP_SERVER_STATE_PATH`、`CODEX_APP_SERVER_LOG_PATH` 覆盖。
118
120
 
119
121
  ## 从 telegram-codex-app-bridge 迁移
120
122
 
121
- FoxClaw 最初 fork 自 `Gan-Xing/telegram-codex-app-bridge`,并继续以 MIT License 分发。
123
+ FoxClaw 最初 fork 自 `Gan-Xing/telegram-codex-app-bridge`,继续以 MIT License 分发。
122
124
 
123
- 升级已有本地安装时:
125
+ 升级已有安装:
124
126
 
125
127
  ```bash
126
128
  systemctl --user disable --now telegram-codex-app-bridge.service 2>/dev/null || true
@@ -128,54 +130,54 @@ test -e ~/.foxclaw || cp -a ~/.telegram-codex-app-bridge ~/.foxclaw
128
130
  foxclaw start
129
131
  ```
130
132
 
131
- 如果使用 launchd 安装,先卸载旧 plist(如存在):
133
+ macOS launchd 用户先卸载旧 plist
132
134
 
133
135
  ```bash
134
136
  launchctl unload ~/Library/LaunchAgents/com.ganxing.telegram-codex-app-bridge.plist 2>/dev/null || true
135
137
  foxclaw start
136
138
  ```
137
139
 
138
- 旧运行时目录不会被自动读取。如果你想保留现有绑定、缓存线程列表、审批和状态数据,请手动复制一次。
140
+ 旧目录不会被自动读取。如果要保留已有的绑定、线程缓存、审批和状态数据,手动复制一次即可。
139
141
 
140
142
  ## Telegram 设置
141
143
 
142
- 1. 使用 `@BotFather` 创建机器人,并把 token 填入 `TG_BOT_TOKEN`。
143
- 2. 获取你的 Telegram 数字用户 ID,并填入 `TG_ALLOWED_USER_ID`。
144
- 3. 使用 `foxclaw start` 启动 FoxClaw。
145
- 4. 打开与机器人的私聊并发送 `/help`。
144
+ 1. `@BotFather` 创建机器人,token 填入 `TG_BOT_TOKEN`。
145
+ 2. 拿到你的 Telegram 数字用户 ID,填入 `TG_ALLOWED_USER_ID`。
146
+ 3. `foxclaw start` 启动。
147
+ 4. 打开和机器人的私聊,发 `/help`。
146
148
 
147
- 可选的群组/话题配置:
149
+ 可选——群组/话题配置:
148
150
 
149
151
  ```dotenv
150
152
  TG_ALLOWED_CHAT_ID=-1001234567890
151
153
  TG_ALLOWED_TOPIC_ID=42
152
154
  ```
153
155
 
154
- - 留空 `TG_ALLOWED_CHAT_ID` 表示使用私聊模式。
155
- - 只设置 `TG_ALLOWED_CHAT_ID` 时,允许一个群组作为默认会话范围。
156
- - 同时设置 `TG_ALLOWED_CHAT_ID` 和 `TG_ALLOWED_TOPIC_ID` 时,绑定一个话题作为默认范围。
157
- - 即使配置了群组,`TG_ALLOWED_USER_ID` 仍然可以继续使用私聊。
156
+ - `TG_ALLOWED_CHAT_ID` 留空 → 纯私聊模式。
157
+ - 只填 `TG_ALLOWED_CHAT_ID` → 允许一个群组作为默认会话范围。
158
+ - 两个都填 绑定到某个话题。
159
+ - 配了群组后,`TG_ALLOWED_USER_ID` 的私聊依然可用。
158
160
 
159
- 查找群组和话题 ID
161
+ **怎么找群组和话题 ID:**
160
162
 
161
- 1. 停止 FoxClaw。
162
- 2. 在目标群组或话题中发送一条消息。
163
- 3. 打开 `https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates`。
164
- 4. 读取 `message.chat.id` 作为 `TG_ALLOWED_CHAT_ID`。
165
- 5. 读取 `message.message_thread_id` 作为 `TG_ALLOWED_TOPIC_ID`。
163
+ 1. 先停掉 FoxClaw。
164
+ 2. 在目标群组/话题里发一条消息。
165
+ 3. 浏览器打开 `https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates`。
166
+ 4. `message.chat.id` `TG_ALLOWED_CHAT_ID`。
167
+ 5. `message.message_thread_id` `TG_ALLOWED_TOPIC_ID`。
166
168
 
167
- 如果 FoxClaw 还在运行,它可能会在你检查前消费掉该 update
169
+ > 如果 FoxClaw 还在跑,它可能会先把这条 update 消费掉,所以要先停。
168
170
 
169
171
  ## Telegram 群组检查清单
170
172
 
171
- 对于群组或超级群里的自然语言消息:
173
+ 要让机器人在群组/超级群里收到普通消息:
172
174
 
173
- 1. 将机器人加入目标群组。
174
- 2. 在 `@BotFather` 中禁用机器人的 `privacy mode`。
175
- 3. 将机器人提升为该群管理员。
176
- 4. 如果是在加入群组后才修改隐私模式,请移除并重新加入机器人。
175
+ 1. 把机器人加进目标群组。
176
+ 2. 在 `@BotFather` 里关掉 `privacy mode`。
177
+ 3. 把机器人设为群管理员。
178
+ 4. 如果是加群之后才改的隐私模式,把机器人踢出去再重新加。
177
179
 
178
- 即使 privacy mode 阻止普通消息,`/status@botname` 这样的显式命令也可能正常工作,所以请用一条普通消息验证群组设置。
180
+ > 注意:即使 privacy mode 挡住了普通消息,`/status@botname` 这种显式命令可能还是能用的。所以验证群组设置时,请用一条普通文本消息测试。
179
181
 
180
182
  ## Codex App-Server 生命周期
181
183
 
@@ -190,14 +192,14 @@ CODEX_APP_SYNC_ON_OPEN=true
190
192
  CODEX_APP_SYNC_ON_TURN_COMPLETE=false
191
193
  ```
192
194
 
193
- FoxClaw 会把 `codex app-server` 启动为一个由 bridge 管理的 detached 进程,并记录它的 pid 和端口。重启时,如果记录的 app-server 进程仍然存活,FoxClaw 会重新连接;否则会启动一个新进程。`/auth_reload` 和认证切换会重启托管的 app-server,从而重新加载当前 `auth.json`。
195
+ FoxClaw 会把 `codex app-server` 作为 detached 子进程启动,记录其 pid 和端口。重启时如果进程还活着就直接重连,否则拉起新进程。`/auth_reload` 和认证切换会重启 app-server 以重新加载 `auth.json`。
194
196
 
195
- 正常安装不需要固定的 Codex app-server 端口。
197
+ 一般不需要手动固定 app-server 端口。
196
198
 
197
199
  ## 命令
198
200
 
199
201
  - `/help`
200
- - `/setup` 打开统一偏好设置面板
202
+ - `/setup` — 统一设置面板
201
203
  - `/fast <on|off|toggle>`
202
204
  - `/active <steer|queue>`
203
205
  - `/status`、`/account`、`/quota`
@@ -215,35 +217,35 @@ FoxClaw 会把 `codex app-server` 启动为一个由 bridge 管理的 detached
215
217
  - `/skills [query]`、`/skill <name>`、`/skill_enable <name>`、`/skill_disable <name>`
216
218
  - `/loaded`、`/hooks`、`/plugins [query]`、`/apps [reload]`、`/features`、`/config`、`/requirements`、`/provider`
217
219
  - `/mcp`、`/mcp_reload`、`/mcp_login <server>`、`/mcp_resource <server> <uri>`
218
- - `/models`、`/model`、`/effort`、`/permissions`、`/access`、`/mode`、`/plan` 和 `/agent`
220
+ - `/models`、`/model`、`/effort`、`/permissions`、`/access`、`/mode`、`/plan`、`/agent`
219
221
  - `/reveal`、`/where`、`/interrupt`
220
222
 
221
- 普通文本会发送到当前线程;如果当前没有绑定线程,则创建一个新线程。
223
+ 直接发文本会送到当前线程;没有绑定线程时自动创建新线程。
222
224
 
223
225
  ## 微信/iLink
224
226
 
225
- 微信支持是可选的,默认关闭:
227
+ 微信支持默认关闭,需要手动开启:
226
228
 
227
229
  ```dotenv
228
230
  WX_ENABLED=true
229
231
  WX_ALLOWED_ILINK_USER_IDS=
230
232
  ```
231
233
 
232
- 构建后运行一次二维码登录助手:
234
+ 构建完成后跑一次二维码登录:
233
235
 
234
236
  ```bash
235
237
  foxclaw weixin-login
236
238
  ```
237
239
 
238
- 微信运行时文件默认存储在 `~/.foxclaw/weixin`。
240
+ 微信运行时文件在 `~/.foxclaw/weixin`。
239
241
 
240
242
  ## Codex Skill
241
243
 
242
- 本仓库内置一个 Codex skill:[`skills/foxclaw`](./skills/foxclaw)。当你想让 Codex 在本机或另一台 Mac 上通过 SSH bootstrap FoxClaw、写入 `.env`、构建、运行 doctor、安装 launchd,并指导首次消息验证时,可以使用它。
244
+ 仓库自带一个 Codex skill:[`skills/foxclaw`](./skills/foxclaw)。用它可以让 Codex 通过 SSH 在本机或远程 Mac bootstrap FoxClaw——写 `.env`、构建、跑 doctor、装 launchd、引导首次消息验证,一条龙。
243
245
 
244
246
  ## 故障排查
245
247
 
246
- `doctor` 失败、Telegram 没有回复、服务日志、重启行为和迁移问题,请查看 [故障排查](./docs/troubleshooting.md)。
248
+ `doctor` 报错、Telegram 没回复、服务日志看不懂、重启行为异常、迁移出问题——都看 [故障排查](./docs/troubleshooting.md)。
247
249
 
248
250
  ## 运维命令
249
251
 
@@ -256,4 +258,4 @@ foxclaw uninstall-systemd
256
258
 
257
259
  ## 贡献
258
260
 
259
- 欢迎在 `https://github.com/foxden-app/foxclaw` 提交 issue 和 PR。
261
+ 欢迎到 [GitHub](https://github.com/foxden-app/foxclaw) issue 和 PR。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foxden-app/foxclaw",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Foxden local execution claw for controlling Codex from trusted chat interfaces.",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",