@keyou007/agent-bot 0.1.13-alpha.0 → 0.1.13-alpha.2

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 (97) hide show
  1. package/.env.example +2 -2
  2. package/CHANGELOG.md +15 -0
  3. package/README.md +107 -98
  4. package/README.zh.md +81 -72
  5. package/dist/acp/AcpProcessManager.js +8 -3
  6. package/dist/acp/AcpProcessManager.js.map +1 -1
  7. package/dist/acp/AcpSessionManager.js +15 -0
  8. package/dist/acp/AcpSessionManager.js.map +1 -1
  9. package/dist/cli/ServerStarter.js +17 -2
  10. package/dist/cli/ServerStarter.js.map +1 -1
  11. package/dist/cli/controlProtocol.js.map +1 -1
  12. package/dist/cli/help.js +16 -4
  13. package/dist/cli/help.js.map +1 -1
  14. package/dist/cli/serverStatus.js +27 -0
  15. package/dist/cli/serverStatus.js.map +1 -1
  16. package/dist/cli/taskListOutput.js +72 -0
  17. package/dist/cli/taskListOutput.js.map +1 -0
  18. package/dist/cli.js +88 -54
  19. package/dist/cli.js.map +1 -1
  20. package/dist/codex/CodexProcessManager.js +34 -4
  21. package/dist/codex/CodexProcessManager.js.map +1 -1
  22. package/dist/codex/CodexRuntime.js +3 -0
  23. package/dist/codex/CodexRuntime.js.map +1 -1
  24. package/dist/commands/CommandRouter.js +5 -0
  25. package/dist/commands/CommandRouter.js.map +1 -1
  26. package/dist/config/FeishuUserOpenIdStore.js +76 -0
  27. package/dist/config/FeishuUserOpenIdStore.js.map +1 -0
  28. package/dist/config/loadConfig.js +3 -0
  29. package/dist/config/loadConfig.js.map +1 -1
  30. package/dist/feishu/CardRenderer.js +123 -22
  31. package/dist/feishu/CardRenderer.js.map +1 -1
  32. package/dist/feishu/FeishuConnector.js +16 -5
  33. package/dist/feishu/FeishuConnector.js.map +1 -1
  34. package/dist/index.js +125 -26
  35. package/dist/index.js.map +1 -1
  36. package/dist/presentation/turnGraph.js +36 -0
  37. package/dist/presentation/turnGraph.js.map +1 -0
  38. package/dist/proxy/ProxySessionController.js +425 -104
  39. package/dist/proxy/ProxySessionController.js.map +1 -1
  40. package/dist/runtime/AcpRuntimeAdapter.js +3 -0
  41. package/dist/runtime/AcpRuntimeAdapter.js.map +1 -1
  42. package/dist/runtime/agentEnvironment.js +24 -4
  43. package/dist/runtime/agentEnvironment.js.map +1 -1
  44. package/dist/runtime/createAgentRuntimeRegistry.js +7 -3
  45. package/dist/runtime/createAgentRuntimeRegistry.js.map +1 -1
  46. package/dist/startup/StartupNotifier.js +16 -7
  47. package/dist/startup/StartupNotifier.js.map +1 -1
  48. package/dist/startup/startFeishu.js +2 -2
  49. package/dist/startup/startFeishu.js.map +1 -1
  50. package/dist/state/StateStore.js +172 -0
  51. package/dist/state/StateStore.js.map +1 -1
  52. package/dist/state/migrations.js +21 -0
  53. package/dist/state/migrations.js.map +1 -1
  54. package/dist/supervision/SafeRestartNotifier.js +46 -3
  55. package/dist/supervision/SafeRestartNotifier.js.map +1 -1
  56. package/dist/supervision/SafeRestartScheduler.js +65 -6
  57. package/dist/supervision/SafeRestartScheduler.js.map +1 -1
  58. package/dist/supervision/replacementSupervisor.js +27 -2
  59. package/dist/supervision/replacementSupervisor.js.map +1 -1
  60. package/dist/supervisor.js +27 -2
  61. package/dist/supervisor.js.map +1 -1
  62. package/docs/technical-reference.md +20 -7
  63. package/docs/technical-reference.zh.md +20 -7
  64. package/npm-shrinkwrap.json +2 -2
  65. package/package.json +1 -1
  66. package/skills/agent-bot/SKILL.md +63 -26
  67. package/src/acp/AcpProcessManager.ts +16 -3
  68. package/src/acp/AcpSessionManager.ts +14 -0
  69. package/src/cli/ServerStarter.ts +25 -2
  70. package/src/cli/controlProtocol.ts +6 -1
  71. package/src/cli/help.ts +16 -4
  72. package/src/cli/serverStatus.ts +28 -0
  73. package/src/cli/taskListOutput.ts +91 -0
  74. package/src/cli.ts +123 -51
  75. package/src/codex/CodexProcessManager.ts +38 -3
  76. package/src/codex/CodexRuntime.ts +6 -0
  77. package/src/commands/CommandRouter.ts +4 -0
  78. package/src/commands/commandTypes.ts +1 -0
  79. package/src/config/FeishuUserOpenIdStore.ts +81 -0
  80. package/src/config/loadConfig.ts +3 -0
  81. package/src/feishu/CardRenderer.ts +169 -22
  82. package/src/feishu/FeishuConnector.ts +13 -4
  83. package/src/index.ts +195 -23
  84. package/src/presentation/turnGraph.ts +48 -0
  85. package/src/proxy/ProxySessionController.ts +507 -112
  86. package/src/runtime/AcpRuntimeAdapter.ts +5 -0
  87. package/src/runtime/agentEnvironment.ts +41 -3
  88. package/src/runtime/createAgentRuntimeRegistry.ts +18 -3
  89. package/src/runtime/types.ts +5 -0
  90. package/src/startup/StartupNotifier.ts +23 -7
  91. package/src/startup/startFeishu.ts +3 -2
  92. package/src/state/StateStore.ts +224 -0
  93. package/src/state/migrations.ts +21 -0
  94. package/src/supervision/SafeRestartNotifier.ts +53 -4
  95. package/src/supervision/SafeRestartScheduler.ts +78 -7
  96. package/src/supervision/replacementSupervisor.ts +27 -1
  97. package/src/supervisor.ts +33 -2
package/.env.example CHANGED
@@ -1,6 +1,6 @@
1
1
  # agentbot init fills these through Feishu one-click registration.
2
- # Leave them blank for console-only mode. When binding an existing app manually,
3
- # FEISHU_USER_OPEN_ID is the private-chat fallback for startup notifications.
2
+ # Leave them blank for console-only mode. For an existing app, the first direct
3
+ # message fills FEISHU_USER_OPEN_ID for startup notifications and CLI group invites.
4
4
  FEISHU_APP_ID=
5
5
  FEISHU_APP_SECRET=
6
6
  FEISHU_USER_OPEN_ID=
package/CHANGELOG.md CHANGED
@@ -6,6 +6,21 @@ The project follows [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.13-alpha.2] - 2026-08-04
10
+
11
+ - Show every configured Agent process's PID and initialized version in `agentbot server status` and its JSON output.
12
+ - 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.
13
+ - Repair missing turn-parent links after a Worker crash so `/turns` keeps the correct conversation graph across restart recovery.
14
+
15
+ ## [0.1.13-alpha.1] - 2026-08-03
16
+
17
+ - 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.
18
+ - Send every startup card to all known private chats, non-topic groups active during the previous minute, and every group enrolled for the current safe restart; fold topic routes into their parent group instead of sending startup cards into topics.
19
+ - Replace the expanding `More` action in `/sessions` with in-place five-task pagination using `Previous` and `Next`, preserving search terms, task actions, and global numbering across pages.
20
+ - Add `Reset` actions to successfully completed progress cards and a paginated `/turns` history card with 10 completed turns per page. Persist each new turn's parent, backfill existing tasks from Reset audits, and render true branch lanes and merges across page boundaries instead of connecting turns merely because their completion times are adjacent. The card marks the current conversation point and moves that marker after a successful Reset while preserving the Agent Bot task and leaving local files unchanged. Completed turns after the selected Reset point remain visible because history snapshots are retained, and the success notice identifies the selected Prompt, completion time, and Turn ID.
21
+ - Recover a missing `FEISHU_USER_OPEN_ID` from the first valid private-chat message, persist it atomically without allowing group or later messages to replace it, and reload it correctly after Worker restarts.
22
+ - Schedule a safe restart after `agentbot init` when the selected Profile server is already running, ensuring upgraded code and refreshed configuration take effect without interrupting active work.
23
+
9
24
  ## [0.1.13-alpha.0] - 2026-08-03
10
25
 
11
26
  - Upgrade existing Profiles during `agentbot init` by filling missing `config.yaml` and `.env` settings, detecting Codex and TraeX versions, offering explicit install or upgrade actions, and requiring an interactive default-Agent selection.
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,10 +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
- - 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
18
19
  - Queue follow-up Prompts or add instructions while a task is running
19
- - Resume work after Agent Bot restarts
20
- - Use a local Console UI without Feishu
20
+ - Continue existing work after Agent Bot restarts
21
+ - Run through the local Console UI without Feishu
21
22
 
22
23
  ## Quick Start
23
24
 
@@ -25,151 +26,163 @@ Agent Bot runs on your computer and connects a Feishu bot to your local coding a
25
26
 
26
27
  - Node.js 22 or later
27
28
  - At least one supported App Server Agent: Codex or TraeX
28
- - A completed local login for the Agent you intend to use
29
+ - A completed local login for the Agent you plan to use
29
30
 
30
- Check the installed Agents and login state:
31
+ Check the installed Agents and their login status:
31
32
 
32
- ```powershell
33
+ ```bash
33
34
  codex --version
34
35
  codex login status
35
36
  traex --version
36
37
  traex login status
37
38
  ```
38
39
 
39
- 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.
40
41
 
41
42
  ### Install
42
43
 
43
- ```powershell
44
+ ```bash
45
+ # Install the stable version
44
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
45
49
  agentbot --version
46
50
  agentbot --help
47
51
  ```
48
52
 
49
- To try the current Alpha channel without replacing npm's stable `latest` tag:
50
-
51
- ```powershell
52
- npm install --global @keyou007/agent-bot@alpha
53
- ```
54
-
55
- 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.
56
54
 
57
55
  ### Initialize
58
56
 
59
- ```powershell
57
+ ```bash
60
58
  agentbot init
61
59
  ```
62
60
 
63
- 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`.
64
62
 
65
- 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.
66
64
 
67
- 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:
68
68
 
69
- 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.
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. |
70
73
 
71
- 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.
74
+ After these steps, the `~/.agent-bot` directory is initialized. Agent Bot starts automatically and sends you a welcome message through the Feishu bot, so you can begin using it in Feishu.
72
75
 
73
- | Option | Purpose |
74
- | ---------------------- | ----------------------------------- |
75
- | `--reset` | Back up and fully reset an explicitly selected Profile |
76
- | `--skip-feishu` | Initialize for Console only; do not start the server |
77
- | `--reconfigure-feishu` | Replace existing Feishu credentials |
78
- | `--json` | Print a machine-readable result |
79
- | `--profile <directory>`| Use an isolated profile directory |
80
- | `--config <path>` | Use a specific configuration file |
76
+ Agent Bot includes a keepalive mechanism that automatically reconnects after Agent Bot, Codex, or TraeX crashes.
81
77
 
82
- 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 leaves it running. In a non-interactive terminal, `init` cannot ask for a selection and keeps the already configured default Agent.
78
+ ### Start And Stop
83
79
 
84
- To fully reconfigure a Profile, stop its server and select the Profile explicitly:
80
+ Start the service:
85
81
 
86
- ```powershell
87
- 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
88
85
  ```
89
86
 
90
- 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:
91
88
 
92
- ### Start And Stop
93
-
94
- ```powershell
89
+ ```bash
95
90
  agentbot server status
96
91
  ```
97
92
 
98
- `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.
99
-
100
- The `Agent Bot 已启动` startup card shows the version of Agent Bot currently running.
93
+ Stop the service:
101
94
 
102
- 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
+ ```
103
98
 
104
- Stop the service with:
99
+ Safely restart the service:
105
100
 
106
- ```powershell
107
- agentbot server stop
101
+ ```bash
102
+ agentbot server restart
108
103
  ```
109
104
 
105
+ It waits for currently running Agent tasks to finish before restarting, allowing every task to complete normally.
106
+
110
107
  ### Update Or Uninstall
111
108
 
112
109
  Stop the running service before replacing or removing the global package:
113
110
 
114
- ```powershell
111
+ ```bash
115
112
  agentbot server stop
116
113
  npm install --global @keyou007/agent-bot@latest
117
- agentbot server start
114
+ agentbot init # Update the Profile and start the Server
118
115
  ```
119
116
 
120
117
  To uninstall:
121
118
 
122
- ```powershell
119
+ ```bash
123
120
  agentbot server stop
124
121
  npm uninstall --global @keyou007/agent-bot
125
122
  ```
126
123
 
127
- 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`.
128
125
 
129
- ## Daily Commands
126
+ ### Multiple Profiles
130
127
 
131
- ### Service
128
+ Multiple Profiles let you run several independent Agent Bot instances on the same device without interfering with one another.
132
129
 
133
- ```powershell
134
- agentbot server status
135
- agentbot server start
136
- agentbot server stop
137
- 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
138
137
  ```
139
138
 
140
- `server restart` waits for current work to finish by default. Its status card includes a `Cancel` button while the restart is still waiting. Use `--immediate` only when interruption is acceptable.
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.
141
142
 
142
- 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.
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
150
+ ```
143
151
 
144
- `server status` shows the Lark App ID used by the running server. Add `--json` to read it from `feishuAppId`.
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.
145
153
 
146
- ### Console
154
+ Reset does not remove Codex or TraeX chat sessions. It only recreates the Feishu bot and clears Agent Bot's local data.
147
155
 
148
- ```powershell
156
+ ## Daily Commands
157
+
158
+ ### Console UI/TUI
159
+
160
+ ```bash
149
161
  agentbot console
150
162
  ```
151
163
 
152
- 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.
153
165
 
154
- ### Tasks
166
+ ### Task Management
155
167
 
156
- ```powershell
168
+ ```bash
157
169
  agentbot task list
170
+ agentbot task current [--json]
158
171
  agentbot task status <task>
159
172
  agentbot task prompt <task> "<prompt>"
160
- agentbot task newgroup <task> [title] [--agent <name>] [--dir <path> | --nodir]
173
+ agentbot task newgroup <task> [title] [--agent <standard-name>] [--dir <path> | --nodir]
161
174
  agentbot task forkgroup <task> [title]
162
175
  agentbot task title <task> "<title>"
163
176
  agentbot task stop <task>
164
177
  ```
165
178
 
166
- `<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.
167
180
 
168
- `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`.
169
182
 
170
183
  ## Feishu Commands
171
184
 
172
- 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.
173
186
 
174
187
  | Command | Purpose |
175
188
  | ---------------------------------------- | ------------------------------------------- |
@@ -177,6 +190,7 @@ Plain text continues the current task. Messages beginning with `/` are commands.
177
190
  | `/sessions [keyword]` | Browse available App Server tasks |
178
191
  | `/switch [task]` | Switch tasks or return to the previous task |
179
192
  | `/fork [task]` | Create and open a task branch |
193
+ | `/turns` | Browse historical turns and reset the conversation |
180
194
  | `/status [task]` | View task progress and results |
181
195
  | `/title <title>` | Rename the current task |
182
196
  | `/stop` | Stop the current execution |
@@ -190,28 +204,33 @@ Plain text continues the current task. Messages beginning with `/` are commands.
190
204
  | `/newgroup [title] [--dir <cwd> \| --nodir]` | Create a private group for a new task |
191
205
  | `/forkgroup [title]` | Fork the current position into a private group |
192
206
  | `/agent [name]` | Open Agent settings or select the default Agent |
193
- | `! <command>` | Run a local command in the task directory |
194
- | `/restart [--force]` | Restart safely, or immediately with `--force` |
195
- | `/help` | Show in-chat help |
207
+ | `/restart [--force]` | Restart safely, or immediately with `--force` |
208
+ | `/help` | Show in-chat help |
196
209
 
197
- 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.
198
211
 
199
- `/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.
200
213
 
201
- 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.
202
215
 
203
- The `/sessions` card 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.
204
217
 
205
- 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.
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.
206
219
 
207
- After `/forkgroup` creates the new group, its welcome message shows the forked task's current Provider, model, reasoning effort, and permission type.
220
+ After `/forkgroup` creates a new group, its welcome message shows the forked task's current Provider, model, reasoning effort, and permission type.
208
221
 
209
- `/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.
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.
210
223
 
211
- 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.
212
225
 
213
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.
214
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
+
215
234
  ## Configuration And Data
216
235
 
217
236
  Agent Bot keeps user-owned files outside the repository:
@@ -225,28 +244,18 @@ Agent Bot keeps user-owned files outside the repository:
225
244
 
226
245
  Set `AGENT_BOT_HOME` to use another user-data directory. See [config.example.yaml](config.example.yaml) for configuration examples.
227
246
 
228
- 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.
229
-
230
- ### Multiple Profiles
231
-
232
- 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.
233
248
 
234
- ```powershell
235
- agentbot --profile ~/.agent-bot-rescue init
236
- agentbot --profile ~/.agent-bot-rescue server start
237
- agentbot --profile ~/.agent-bot-rescue server status
238
- ```
239
-
240
- 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.
241
250
 
242
251
  ## Troubleshooting
243
252
 
244
- - **The bot does not respond:** run `agentbot server status` and check `~/.agent-bot/logs/agent-bot.log`.
245
- - **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/`.
246
- - **Feishu permissions are incomplete:** rerun `agentbot init` and follow the displayed authorization steps.
247
- - **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.
248
- - **You only need local testing:** run `agentbot init --skip-feishu`, then `agentbot console`.
249
- - **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`
250
259
 
251
260
  ## More Documentation
252
261