@keyou007/agent-bot 0.1.13-alpha.1 → 0.1.13-alpha.3

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 (63) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +106 -103
  3. package/README.zh.md +76 -73
  4. package/dist/acp/AcpProcessManager.js +8 -3
  5. package/dist/acp/AcpProcessManager.js.map +1 -1
  6. package/dist/acp/AcpSessionManager.js +15 -0
  7. package/dist/acp/AcpSessionManager.js.map +1 -1
  8. package/dist/cli/InitializationWelcome.js +116 -0
  9. package/dist/cli/InitializationWelcome.js.map +1 -0
  10. package/dist/cli/help.js +4 -2
  11. package/dist/cli/help.js.map +1 -1
  12. package/dist/cli/serverStatus.js +27 -0
  13. package/dist/cli/serverStatus.js.map +1 -1
  14. package/dist/cli/taskListOutput.js +72 -0
  15. package/dist/cli/taskListOutput.js.map +1 -0
  16. package/dist/cli.js +103 -56
  17. package/dist/cli.js.map +1 -1
  18. package/dist/codex/CodexProcessManager.js +34 -4
  19. package/dist/codex/CodexProcessManager.js.map +1 -1
  20. package/dist/codex/CodexRuntime.js +3 -0
  21. package/dist/codex/CodexRuntime.js.map +1 -1
  22. package/dist/feishu/CardRenderer.js +164 -2
  23. package/dist/feishu/CardRenderer.js.map +1 -1
  24. package/dist/feishu/FeishuConnector.js +16 -5
  25. package/dist/feishu/FeishuConnector.js.map +1 -1
  26. package/dist/index.js +23 -4
  27. package/dist/index.js.map +1 -1
  28. package/dist/proxy/ProxySessionController.js +157 -59
  29. package/dist/proxy/ProxySessionController.js.map +1 -1
  30. package/dist/runtime/AcpRuntimeAdapter.js +3 -0
  31. package/dist/runtime/AcpRuntimeAdapter.js.map +1 -1
  32. package/dist/runtime/agentEnvironment.js +24 -4
  33. package/dist/runtime/agentEnvironment.js.map +1 -1
  34. package/dist/runtime/createAgentRuntimeRegistry.js +7 -3
  35. package/dist/runtime/createAgentRuntimeRegistry.js.map +1 -1
  36. package/dist/state/StateStore.js +12 -9
  37. package/dist/state/StateStore.js.map +1 -1
  38. package/dist/supervision/SafeRestartNotifier.js +1 -9
  39. package/dist/supervision/SafeRestartNotifier.js.map +1 -1
  40. package/docs/technical-reference.md +12 -4
  41. package/docs/technical-reference.zh.md +12 -4
  42. package/npm-shrinkwrap.json +2 -2
  43. package/package.json +1 -1
  44. package/skills/agent-bot/SKILL.md +53 -22
  45. package/src/acp/AcpProcessManager.ts +16 -3
  46. package/src/acp/AcpSessionManager.ts +14 -0
  47. package/src/cli/InitializationWelcome.ts +160 -0
  48. package/src/cli/help.ts +4 -2
  49. package/src/cli/serverStatus.ts +28 -0
  50. package/src/cli/taskListOutput.ts +91 -0
  51. package/src/cli.ts +140 -55
  52. package/src/codex/CodexProcessManager.ts +38 -3
  53. package/src/codex/CodexRuntime.ts +6 -0
  54. package/src/feishu/CardRenderer.ts +204 -1
  55. package/src/feishu/FeishuConnector.ts +13 -4
  56. package/src/index.ts +35 -3
  57. package/src/proxy/ProxySessionController.ts +186 -59
  58. package/src/runtime/AcpRuntimeAdapter.ts +5 -0
  59. package/src/runtime/agentEnvironment.ts +41 -3
  60. package/src/runtime/createAgentRuntimeRegistry.ts +18 -3
  61. package/src/runtime/types.ts +5 -0
  62. package/src/state/StateStore.ts +12 -9
  63. package/src/supervision/SafeRestartNotifier.ts +1 -11
package/CHANGELOG.md CHANGED
@@ -6,6 +6,17 @@ The project follows [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.13-alpha.3] - 2026-08-05
10
+
11
+ - Send a polished, logo-branded private welcome card after every successful `agentbot init`, with first-use capabilities, upgrade highlights, same-version refresh confirmation based on Profile initialization history, and a link to the project Changelog.
12
+ - Limit safe-restart progress cards to the conversations that explicitly requested the restart instead of enrolling recently active chats.
13
+
14
+ ## [0.1.13-alpha.2] - 2026-08-04
15
+
16
+ - Show every configured Agent process's PID and initialized version in `agentbot server status` and its JSON output.
17
+ - Stop forwarding Lark credentials and internal restart state to Agent processes; preserve ordinary parent variables while exposing only namespaced, non-secret Agent Bot Profile and Lark identity context.
18
+ - Repair missing turn-parent links after a Worker crash so `/turns` keeps the correct conversation graph across restart recovery.
19
+
9
20
  ## [0.1.13-alpha.1] - 2026-08-03
10
21
 
11
22
  - Route safe-restart status cards and restarting acknowledgements to every conversation that triggers the pending restart plus every conversation active during the previous minute, retaining each enrolled route until the restart completes while preserving Feishu topic replies; add `agentbot server restart --task <task>` and reject ambiguous CLI routing when multiple conversations are active.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <p align="center">
2
- <img src="assets/agent-bot-logo.png" alt="Agent Bot logo" width="180">
2
+ <img src="assets/agent-bot-logo.png" alt="Agent Bot Logo" width="180">
3
3
  </p>
4
4
 
5
5
  # Agent Bot
6
6
 
7
- Use Codex, TraeX, and compatible ACP agents directly from Feishu.
7
+ Use local Codex, TraeX, and compatible ACP agents through Feishu.
8
8
 
9
9
  English | [简体中文](README.zh.md)
10
10
 
@@ -14,11 +14,11 @@ Agent Bot runs on your computer and connects a Feishu bot to your local coding a
14
14
 
15
15
  - Use your existing local Codex or TraeX login from Feishu
16
16
  - Create, continue, switch, fork, and stop tasks
17
- - Reset the current conversation to any successfully completed progress card
18
- - Work with text, images, groups, and threads
17
+ - Reset the current conversation from any successfully completed progress card
18
+ - Collaborate with text, images, group chats, and topics
19
19
  - Queue follow-up Prompts or add instructions while a task is running
20
- - Resume work after Agent Bot restarts
21
- - Use a local Console UI without Feishu
20
+ - Continue existing work after Agent Bot restarts
21
+ - Run through the local Console UI without Feishu
22
22
 
23
23
  ## Quick Start
24
24
 
@@ -26,153 +26,163 @@ Agent Bot runs on your computer and connects a Feishu bot to your local coding a
26
26
 
27
27
  - Node.js 22 or later
28
28
  - At least one supported App Server Agent: Codex or TraeX
29
- - A completed local login for the Agent you intend to use
29
+ - A completed local login for the Agent you plan to use
30
30
 
31
- Check the installed Agents and login state:
31
+ Check the installed Agents and their login status:
32
32
 
33
- ```powershell
33
+ ```bash
34
34
  codex --version
35
35
  codex login status
36
36
  traex --version
37
37
  traex login status
38
38
  ```
39
39
 
40
- You can continue to initialization when either Codex or TraeX is ready. `agentbot init` checks both Agents and can help install or upgrade either one.
40
+ You can continue once either Codex or TraeX is ready. `agentbot init` checks both and can help install or upgrade them.
41
41
 
42
42
  ### Install
43
43
 
44
- ```powershell
44
+ ```bash
45
+ # Install the stable version
45
46
  npm install --global @keyou007/agent-bot
47
+ # Install the Alpha version to try the latest features
48
+ # npm install --global @keyou007/agent-bot@alpha
46
49
  agentbot --version
47
50
  agentbot --help
48
51
  ```
49
52
 
50
- To try the current Alpha channel without replacing npm's stable `latest` tag:
51
-
52
- ```powershell
53
- npm install --global @keyou007/agent-bot@alpha
54
- ```
55
-
56
- This installs `agentbot` as the primary command. The legacy `agent-bot` command remains available temporarily, prints a deprecation warning, and will be removed in a future release. Command-line help, status, progress, prompts, and errors follow the system language for Chinese and English locales; all other locales fall back to English. JSON output remains language-neutral and stable. See the [technical reference](docs/technical-reference.md#development-and-source-installation) to install from source.
53
+ See the [technical reference](docs/technical-reference.md#development-and-source-installation) to install from source.
57
54
 
58
55
  ### Initialize
59
56
 
60
- ```powershell
57
+ ```bash
61
58
  agentbot init
62
59
  ```
63
60
 
64
- Initialization detects Codex and TraeX and reports their installed versions. Missing or outdated Agents are summarized once with their exact install or upgrade commands. Enter one or more action numbers separated by commas, enter `all`, or press Enter to skip maintenance. A failed command does not block the remaining initialization steps. After these checks, select the default Agent by number or standard name; when the current default is still available, press Enter to confirm it. Agent Bot saves the selection to `defaults.agent` in `config.yaml` for future tasks.
61
+ Initialization detects Codex and TraeX and reports their installed versions. Missing or outdated Agents are listed with the appropriate install or upgrade commands. Agent Bot saves its configuration to `~/.agent-bot/config.yaml`.
65
62
 
66
- Then follow the displayed link or scan the QR code to create and authorize the Feishu bot. Initialization prepares `~/.agent-bot`, saves the bot credentials and the authorizing user, checks the required permissions, and starts Agent Bot automatically.
63
+ A fresh initialization normally presents three QR-code or link steps in the terminal.
67
64
 
68
- Only a complete app ID and secret saved locally count as a successful bot creation. If initialization is interrupted before both credentials are saved, rerunning `agentbot init` creates a new bot. If credentials were saved, initialization resumes by auditing that bot's remote permissions and subscriptions.
65
+ 1. **Create the bot.** This creates a Feishu app with the standard basic messaging configuration and saves its App ID, App Secret, and authorizing user. This step cannot be skipped because Agent Bot cannot connect to Feishu without it. Permissions already provided during creation are not repeated below.
66
+ 2. **Add the all-group-message permission.** The only additional core permission needed after bot creation is `im:message.group_msg`. It lets Agent Bot receive ordinary group messages that do not @ the bot. Feishu requires this permission to be added manually in the Developer Console. Enter `Y` to skip waiting; private chats still work without it, but group users must @ the bot.
67
+ 3. **Add the remaining event and callback.** The bot-creation template already provides the other permissions Agent Bot needs. The third step adds only:
69
68
 
70
- If an existing bot has an App ID and secret but no `FEISHU_USER_OPEN_ID`, Agent Bot fills it automatically from the first direct message sent to the bot. The value is stored in the Profile's `.env` and is never replaced by later messages. Group messages cannot claim this default user.
69
+ | Type | Event or callback | Purpose |
70
+ | ---- | ----------------- | ------- |
71
+ | Event | `im.chat.updated_v1` | Detect group renames and synchronize them to Agent task titles. |
72
+ | Callback | `card.action.trigger` | Enable card button interactions. |
71
73
 
72
- The `im:message.group_msg` permission cannot be added through Feishu's one-click configuration. When it is missing, Agent Bot prints a QR code and a direct Developer Console link already filtered to that permission. Add it manually, publish the app version, and complete tenant approval if required. While Agent Bot waits for it to become active, enter `Y` to skip this permission and continue initialization; the final result warns that ordinary group messages which do not mention the bot will be unavailable.
74
+ After these steps, the `~/.agent-bot` directory is initialized and Agent Bot starts automatically. Every successful `agentbot init` sends a private welcome card containing the Agent Bot logo. The first card introduces the main capabilities; after an upgrade it highlights the new version, while a same-version rerun confirms that the Profile was refreshed.
73
75
 
74
- When optional permissions or subscriptions are missing, Agent Bot first shows their QR code and authorization link, then immediately waits up to five minutes for them to become active. The terminal offers only one choice: enter `Y` to skip optional authorization and continue. Otherwise, complete authorization in the browser while Agent Bot waits. Optional authorization failures or timeouts do not block startup, and Agent Bot reports which features may be unavailable.
76
+ Agent Bot includes a keepalive mechanism that automatically reconnects after Agent Bot, Codex, or TraeX crashes.
75
77
 
76
- | Option | Purpose |
77
- | ---------------------- | ----------------------------------- |
78
- | `--reset` | Back up and fully reset an explicitly selected Profile |
79
- | `--skip-feishu` | Initialize for Console only; do not start the server |
80
- | `--reconfigure-feishu` | Replace existing Feishu credentials |
81
- | `--json` | Print a machine-readable result |
82
- | `--profile <directory>`| Use an isolated profile directory |
83
- | `--config <path>` | Use a specific configuration file |
84
-
85
- After upgrading Agent Bot, rerun `agentbot init` to refresh the Profile. It preserves existing values in `config.yaml` and `.env`, fills settings and environment variables added by the current version, lets you confirm or change the default Agent, and rechecks the Agents and bot configuration. If the server is already running, initialization schedules a safe restart so the current Agent Bot version and refreshed configuration take effect after active work finishes. In a non-interactive terminal, `init` cannot ask for a selection and keeps the already configured default Agent.
78
+ ### Start And Stop
86
79
 
87
- To fully reconfigure a Profile, stop its server and select the Profile explicitly:
80
+ Start the service:
88
81
 
89
- ```powershell
90
- agentbot --profile ~/.agent-bot init --reset
82
+ ```bash
83
+ # agentbot init starts the Server automatically, so manual startup is usually unnecessary.
84
+ agentbot server start
91
85
  ```
92
86
 
93
- Reset moves the active `config.yaml`, `.env`, `data/`, and `logs/` into a new timestamped directory under `.reset-backups`, then initializes clean replacements. Existing backup directories are retained. The old remote Feishu app is not deleted.
87
+ Check the service status:
94
88
 
95
- ### Start And Stop
96
-
97
- ```powershell
89
+ ```bash
98
90
  agentbot server status
99
91
  ```
100
92
 
101
- `agentbot init` starts the server automatically. If you stop it later, run `agentbot server start` to start it again. For local-only use, initialize with `--skip-feishu` and run `agentbot console` instead.
102
-
103
- The `Agent Bot 已启动` startup card shows the version currently running. It is sent to every known private chat, groups active in the previous minute, and every group enrolled for the current safe restart; topic routes receive it in their parent group.
93
+ Stop the service:
104
94
 
105
- Open Feishu, find the bot, and send a message. Agent Bot automatically creates a task for a chat that does not have one yet.
95
+ ```bash
96
+ agentbot server stop
97
+ ```
106
98
 
107
- Stop the service with:
99
+ Safely restart the service:
108
100
 
109
- ```powershell
110
- agentbot server stop
101
+ ```bash
102
+ agentbot server restart
111
103
  ```
112
104
 
105
+ It waits for currently running Agent tasks to finish before restarting, allowing every task to complete normally.
106
+
113
107
  ### Update Or Uninstall
114
108
 
115
109
  Stop the running service before replacing or removing the global package:
116
110
 
117
- ```powershell
111
+ ```bash
118
112
  agentbot server stop
119
113
  npm install --global @keyou007/agent-bot@latest
120
- agentbot server start
114
+ agentbot init # Update the Profile and start the Server
121
115
  ```
122
116
 
123
117
  To uninstall:
124
118
 
125
- ```powershell
119
+ ```bash
126
120
  agentbot server stop
127
121
  npm uninstall --global @keyou007/agent-bot
128
122
  ```
129
123
 
130
- Uninstalling the npm package does not delete your data under `~/.agent-bot`.
124
+ Uninstalling the npm package does not delete user data under `~/.agent-bot`.
131
125
 
132
- ## Daily Commands
126
+ ### Multiple Profiles
133
127
 
134
- ### Service
128
+ Multiple Profiles let you run several independent Agent Bot instances on the same device without interfering with one another.
135
129
 
136
- ```powershell
137
- agentbot server status
138
- agentbot server start
139
- agentbot server stop
140
- agentbot server restart
130
+ Create a new Profile with:
131
+
132
+ ```bash
133
+ # Select a new Profile directory and initialize a new bot
134
+ agentbot --profile ~/.agent-bot-rescue init
135
+ agentbot --profile ~/.agent-bot-rescue server start
136
+ agentbot --profile ~/.agent-bot-rescue server status
137
+ ```
138
+
139
+ Commands without `--profile` use the main Profile at `~/.agent-bot`.
140
+
141
+ Each Profile stores its own `config.yaml`, `.env`, `data/`, and `logs/` in the selected directory. Feishu credentials and local control endpoints are isolated as well.
142
+
143
+ ### Reset A Profile
144
+
145
+ To completely reconfigure an existing Profile, stop its Server and select the Profile explicitly:
146
+
147
+ ```bash
148
+ agentbot --profile ~/.agent-bot server stop # Stop the main Profile Server
149
+ agentbot --profile ~/.agent-bot init --reset # Reset the main Profile
141
150
  ```
142
151
 
143
- `server restart` waits for current work to finish by default. Its status card includes a `Cancel` button while the restart is still waiting. Every conversation that triggers the pending restart and every conversation active during the previous minute receives the waiting status and restarting notice. Once included, a conversation stays in the notification set until that restart finishes. When restarting for a specific task, use `--task <task>` to add that task's Lark conversation. Use `--immediate` only when interruption is acceptable.
152
+ Reset moves the current `config.yaml`, `.env`, `data/`, and `logs/` into `.reset-backups`, then creates clean files and directories. Existing backups are retained permanently and are not overwritten or cleaned by later resets. The old remote Feishu app is not deleted.
144
153
 
145
- On Windows, every Supervisor and Worker launch reloads the latest Machine and User environment variables. Restart the service after changing `PATH` or another system environment variable; the active Profile selection remains isolated.
154
+ Reset does not remove Codex or TraeX chat sessions. It only recreates the Feishu bot and clears Agent Bot's local data.
146
155
 
147
- `server status` shows the Lark App ID used by the running server. Add `--json` to read it from `feishuAppId`.
156
+ ## Daily Commands
148
157
 
149
- ### Console
158
+ ### Console UI/TUI
150
159
 
151
- ```powershell
160
+ ```bash
152
161
  agentbot console
153
162
  ```
154
163
 
155
- The Console UI works without Feishu credentials. It will not share task state with a running server unless `--force` is supplied.
164
+ The Console UI does not require Feishu credentials. It does not share task state with a running Server unless `--force` is supplied.
156
165
 
157
- ### Tasks
166
+ ### Task Management
158
167
 
159
- ```powershell
168
+ ```bash
160
169
  agentbot task list
170
+ agentbot task current [--json]
161
171
  agentbot task status <task>
162
172
  agentbot task prompt <task> "<prompt>"
163
- agentbot task newgroup <task> [title] [--agent <name>] [--dir <path> | --nodir]
173
+ agentbot task newgroup <task> [title] [--agent <standard-name>] [--dir <path> | --nodir]
164
174
  agentbot task forkgroup <task> [title]
165
175
  agentbot task title <task> "<title>"
166
176
  agentbot task stop <task>
167
177
  ```
168
178
 
169
- `<task>` can be a number from `task list`, a task ID, or an unambiguous task-ID prefix. Run `agentbot --help` for all CLI options.
179
+ `task current` shows details for the Codex or TraeX task currently invoking the CLI. Its JSON output includes Agent Bot's `localSessionId` and the native `remoteSessionId`. `<task>` can be a number from `task list`, a task ID, or an unambiguous task-ID prefix. Run `agentbot --help` for all CLI options.
170
180
 
171
- `task newgroup` creates a Feishu group and a new task. By default it inherits the source task's Agent and execution settings. `--agent <standard-name>` selects another configured Agent; the source project shape is still inherited, while the selected Agent uses its own runtime defaults for Provider, model, reasoning effort, and permission mode. `--dir` overrides the project directory and supports `~`; `--nodir` forces a Projectless App Server task. `task forkgroup` forks the source task's latest available completed turn without interrupting an active turn. Both commands require the Server to be running, invite the Profile's saved authorizing user, leave the source chat on its current task, and support `--json`.
181
+ `task newgroup` creates a Feishu group and a new task. By default, it inherits the source task's Agent and execution settings. `--agent <standard-name>` selects another configured Agent; the source project shape is still inherited, while Provider, model, reasoning effort, and permission mode use the target Agent's own Runtime defaults. `--dir` overrides the project directory and supports `~`; `--nodir` forces a Projectless App Server task. `task forkgroup` forks from the source task's latest available completed turn without interrupting an active turn. Both commands require the Server to be running, invite the authorizing user saved in the Profile, leave the source conversation on its current task, and support `--json`.
172
182
 
173
183
  ## Feishu Commands
174
184
 
175
- Plain text continues the current task. Messages beginning with `/` are commands.
185
+ Enter a message beginning with `/` directly in the Feishu chat box to run a command.
176
186
 
177
187
  | Command | Purpose |
178
188
  | ---------------------------------------- | ------------------------------------------- |
@@ -194,30 +204,33 @@ Plain text continues the current task. Messages beginning with `/` are commands.
194
204
  | `/newgroup [title] [--dir <cwd> \| --nodir]` | Create a private group for a new task |
195
205
  | `/forkgroup [title]` | Fork the current position into a private group |
196
206
  | `/agent [name]` | Open Agent settings or select the default Agent |
197
- | `! <command>` | Run a local command in the task directory |
198
- | `/restart [--force]` | Restart safely, or immediately with `--force` |
199
- | `/help` | Show in-chat help |
207
+ | `/restart [--force]` | Restart safely, or immediately with `--force` |
208
+ | `/help` | Show in-chat help |
200
209
 
201
- Slash commands accept any unique prefix, and compound commands accept registered initialisms: `/sess` runs `/sessions`, `/fg` runs `/forkgroup`, `/ng` runs `/newgroup`, and `/ns` runs `/nosteer`. Exact command names take priority. An ambiguous prefix such as `/s` or `/f` is rejected and reports every matching command.
210
+ Slash commands accept any unique prefix, and compound commands accept registered initialisms: `/sess` runs `/sessions`, `/fg` runs `/forkgroup`, `/ng` runs `/newgroup`, and `/ns` runs `/nosteer`. Exact command names take priority. An ambiguous prefix such as `/s` or `/f` is rejected and lists every matching command.
202
211
 
203
- `/agent`, `/provider`, `/model`, `/thinking`, and `/permissions` use the same execution-settings card when there is something to select. When more than one Agent is configured, the card adds an Agent tab for selecting the default Agent used by future tasks; `/agent` opens that tab, including when the chat has no current task. With only one configured Agent, `/agent` reports the current Agent directly instead. Existing tasks keep their original Agent, and tasks using different Agents run independently. `/agent <name>` remains available for direct selection. `/provider` likewise reports the current Provider directly when no alternative Provider is configured. The other four commands activate their matching tabs and do not accept arguments. A task created without inherited settings uses the selected Agent's default Provider.
212
+ Private chats, group timelines, and topics maintain separate current tasks. You can send an image by itself or together with text. While a task is running, plain text adds instructions; use `/queue` (or `/nosteer`) when you need to guarantee a later turn.
204
213
 
205
- Private chats, group timelines, and threads keep separate current tasks. You can send an image by itself or together with text. While a task is running, plain text adds instructions to the current work; use `/queue` (or `/nosteer`) to always create a later turn.
214
+ The `/sessions` card shows five tasks per page and uses `Previous` and `Next` to update the card in place. Each task provides `NewGroup` and `ForkGroup` actions, so you can create a same-project group or fork the selected task directly into a new group.
206
215
 
207
- The `/sessions` card shows five tasks per page and uses `Previous` and `Next` to update the card in place. It provides `NewGroup` and `ForkGroup` actions for each task, so you can create a project-matched group or fork a selected task directly into a new group.
216
+ `/turns` opens the current task's completed-turn history, with 10 turns per page. Each turn has its own numbered node and indented content. Graph lanes follow the actual parent turns, preserve Reset branches and merges across pages, and do not connect turns merely because their completion times are adjacent. The active conversation point is marked `Current`; every other entry has a `Reset` button that restores the conversation context to that completed turn and moves the marker there without reverting local files. The success notice shows the selected Prompt summary, completion time, and Turn ID. Turns completed after the selected point remain in history, and turns created on the new branch after Reset are shown as well. Reset is unavailable while the task is running.
208
217
 
209
- `/turns` opens the current task's completed-turn history, 10 turns per page. Each turn is an indented numbered node in a compact commit graph whose lanes follow the actual parent turns, including branches and merges created by Reset. The active conversation point is marked as `Current`; every other entry has a `Reset` action that restores the conversation context to that completed turn and moves the marker there without reverting local file changes. The success notice identifies the selected Prompt, completion time, and Turn ID. Turns completed after the selected point remain in the history, alongside turns later completed on the new branch. Reset is unavailable while the task is running.
218
+ Inside a topic, `/forkgroup` forks from the topic's original turn until the topic task has completed a turn of its own. After that, it forks from the topic task's latest completed turn. A running turn is never used as a fork point.
210
219
 
211
- Inside a thread, `/forkgroup` forks from the thread's original turn until the thread task completes its own turn. After that, it forks from the thread task's latest completed turn. A currently running turn is never used as a fork point.
220
+ After `/forkgroup` creates a new group, its welcome message shows the forked task's current Provider, model, reasoning effort, and permission type.
212
221
 
213
- After `/forkgroup` creates the new group, its welcome message shows the forked task's current Provider, model, reasoning effort, and permission type.
222
+ `/new` and `/newgroup` support the same project options. Use `--dir <cwd>` to override the inherited project directory, or `--nodir` to force a Projectless App Server task; the two options cannot be combined. In both commands, `~`, `~/...`, and `~\...` represent the current user's home directory. `/newgroup` immediately creates and binds the task in the new group while continuing to inherit the current task's Provider, model, reasoning effort, and permission mode without affecting the source task. If the source chat has no current task, Agent Bot uses the selected Agent and its Runtime defaults. An explicit title becomes both the group-name suffix and the task title.
214
223
 
215
- `/new` and `/newgroup` accept the same project options. Pass `--dir <cwd>` to override the inherited project directory, or `--nodir` to force a Projectless App Server task; the two options are mutually exclusive. `~`, `~/...`, and `~\...` resolve from the current user's home directory for both commands. `/newgroup` immediately creates and binds the task in the new group while continuing to inherit the current task's Provider, model, reasoning effort, and permission mode without affecting the source task. If there is no current task, Agent Bot uses the selected agent and its runtime defaults. An explicit title becomes both the group suffix and the task title.
216
-
217
- When `/newgroup` omits the title, both the task title and the group-title portion use `新任务 (mm-dd)`, producing the default group name `[agent] [project dir] 新任务 (mm-dd)`. Projectless groups omit the project segment entirely, using `[agent] title`. When `/forkgroup` omits the title, its task and group name use the same persistent `source title(分支 N)` sequence as `/fork`, without a date suffix. Feishu group names created by `/newgroup` and `/forkgroup` are capped at 60 displayed characters. When a generated name is too long, Agent Bot truncates only the title portion in the group name; the task title itself stays unchanged.
224
+ When `/newgroup` omits the title, the task title and the title portion of the group name both use `新任务 (mm-dd)`, producing `[agent] [project dir] 新任务 (mm-dd)`. Projectless groups omit the project segment entirely and use `[agent] title`. When `/forkgroup` omits the title, its task and group name use the same persistent `source title(分支 N)` sequence as `/fork`, without a date suffix. Feishu group names created by `/newgroup` and `/forkgroup` display at most 60 characters. If the generated name is too long, Agent Bot truncates only the title portion of the group name; the task title itself remains unchanged.
218
225
 
219
226
  Renaming a bound group to `[agent] [project dir] title` synchronizes only `title` to the current task. The Agent and project-directory prefixes remain group metadata and are never included in the task title. The older `[agent] title` format remains supported.
220
227
 
228
+ ## Local Commands
229
+
230
+ Enter a message beginning with `!` directly in the Feishu chat box to run a local command in the current task directory.
231
+
232
+ For example, `! ls` lists files in the current directory, and `! git status` shows the state of the current Git repository.
233
+
221
234
  ## Configuration And Data
222
235
 
223
236
  Agent Bot keeps user-owned files outside the repository:
@@ -231,28 +244,18 @@ Agent Bot keeps user-owned files outside the repository:
231
244
 
232
245
  Set `AGENT_BOT_HOME` to use another user-data directory. See [config.example.yaml](config.example.yaml) for configuration examples.
233
246
 
234
- By default, Agent Bot responds to ordinary messages in groups containing the bot. Set `feishu.respondToAllGroupMessages` to `false` to require users to @ the bot in groups; private chats are unchanged. Initialization still requests the complete group-message permission set so changing this option later does not require another authorization.
235
-
236
- ### Multiple Profiles
237
-
238
- Commands without `--profile` use the main profile at `~/.agent-bot`. To run another bot with isolated credentials, configuration, data, logs, and local control endpoint, pass its directory explicitly on every command:
247
+ Agent processes inherit ordinary parent-process variables and their explicit `agents.<name>.env` settings. Before starting an Agent, Agent Bot removes inherited `FEISHU_*` credentials and internal `AGENT_BOT_*` state, then provides only namespaced, non-secret Profile and Lark identity context. `FEISHU_APP_SECRET` is never forwarded to an Agent process.
239
248
 
240
- ```powershell
241
- agentbot --profile ~/.agent-bot-rescue init
242
- agentbot --profile ~/.agent-bot-rescue server start
243
- agentbot --profile ~/.agent-bot-rescue server status
244
- ```
245
-
246
- Alternative profiles are directory-based and are not registered by name. Each one uses `config.yaml`, `.env`, `data/`, and `logs/` inside the selected directory. `--profile` cannot be combined with `--config`.
249
+ By default, Agent Bot responds to ordinary messages in groups containing the bot. Set `feishu.respondToAllGroupMessages` to `false` to require users to @ the bot in groups; private chats are unchanged. Initialization still requests the complete group-message permission set so changing this option later does not require another authorization.
247
250
 
248
251
  ## Troubleshooting
249
252
 
250
- - **The bot does not respond:** run `agentbot server status` and check `~/.agent-bot/logs/agent-bot.log`.
251
- - **The Worker restarted after a Node crash:** check `~/.agent-bot/data/last-crash.json`, `~/.agent-bot/logs/worker.stderr.log`, and `~/.agent-bot/data/crash-reports/`.
252
- - **Feishu permissions are incomplete:** rerun `agentbot init` and follow the displayed authorization steps.
253
- - **An Agent cannot start:** run `codex login status` or `traex login status` as the same operating-system user that runs Agent Bot, then rerun `agentbot init` to check its version.
254
- - **You only need local testing:** run `agentbot init --skip-feishu`, then `agentbot console`.
255
- - **A safe restart keeps waiting:** inspect active tasks with `agentbot task list --status running`.
253
+ - **The bot does not respond:** run `agentbot server status` and check `~/.agent-bot/logs/agent-bot.log`
254
+ - **The Worker restarted after a Node crash:** check `~/.agent-bot/data/last-crash.json`, `~/.agent-bot/logs/worker.stderr.log`, and `~/.agent-bot/data/crash-reports/`
255
+ - **Feishu permissions are incomplete:** rerun `agentbot init` and follow the displayed authorization steps
256
+ - **An Agent cannot start:** run `codex login status` or `traex login status` as the same operating-system user that runs Agent Bot, then rerun `agentbot init` to check its version
257
+ - **You only need local testing:** run `agentbot init --skip-feishu`, then run `agentbot console`
258
+ - **A safe restart keeps waiting:** inspect active tasks with `agentbot task list --status running`
256
259
 
257
260
  ## More Documentation
258
261