@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.
- package/.env.example +2 -2
- package/CHANGELOG.md +15 -0
- package/README.md +107 -98
- package/README.zh.md +81 -72
- package/dist/acp/AcpProcessManager.js +8 -3
- package/dist/acp/AcpProcessManager.js.map +1 -1
- package/dist/acp/AcpSessionManager.js +15 -0
- package/dist/acp/AcpSessionManager.js.map +1 -1
- package/dist/cli/ServerStarter.js +17 -2
- package/dist/cli/ServerStarter.js.map +1 -1
- package/dist/cli/controlProtocol.js.map +1 -1
- package/dist/cli/help.js +16 -4
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/serverStatus.js +27 -0
- package/dist/cli/serverStatus.js.map +1 -1
- package/dist/cli/taskListOutput.js +72 -0
- package/dist/cli/taskListOutput.js.map +1 -0
- package/dist/cli.js +88 -54
- package/dist/cli.js.map +1 -1
- package/dist/codex/CodexProcessManager.js +34 -4
- package/dist/codex/CodexProcessManager.js.map +1 -1
- package/dist/codex/CodexRuntime.js +3 -0
- package/dist/codex/CodexRuntime.js.map +1 -1
- package/dist/commands/CommandRouter.js +5 -0
- package/dist/commands/CommandRouter.js.map +1 -1
- package/dist/config/FeishuUserOpenIdStore.js +76 -0
- package/dist/config/FeishuUserOpenIdStore.js.map +1 -0
- package/dist/config/loadConfig.js +3 -0
- package/dist/config/loadConfig.js.map +1 -1
- package/dist/feishu/CardRenderer.js +123 -22
- package/dist/feishu/CardRenderer.js.map +1 -1
- package/dist/feishu/FeishuConnector.js +16 -5
- package/dist/feishu/FeishuConnector.js.map +1 -1
- package/dist/index.js +125 -26
- package/dist/index.js.map +1 -1
- package/dist/presentation/turnGraph.js +36 -0
- package/dist/presentation/turnGraph.js.map +1 -0
- package/dist/proxy/ProxySessionController.js +425 -104
- package/dist/proxy/ProxySessionController.js.map +1 -1
- package/dist/runtime/AcpRuntimeAdapter.js +3 -0
- package/dist/runtime/AcpRuntimeAdapter.js.map +1 -1
- package/dist/runtime/agentEnvironment.js +24 -4
- package/dist/runtime/agentEnvironment.js.map +1 -1
- package/dist/runtime/createAgentRuntimeRegistry.js +7 -3
- package/dist/runtime/createAgentRuntimeRegistry.js.map +1 -1
- package/dist/startup/StartupNotifier.js +16 -7
- package/dist/startup/StartupNotifier.js.map +1 -1
- package/dist/startup/startFeishu.js +2 -2
- package/dist/startup/startFeishu.js.map +1 -1
- package/dist/state/StateStore.js +172 -0
- package/dist/state/StateStore.js.map +1 -1
- package/dist/state/migrations.js +21 -0
- package/dist/state/migrations.js.map +1 -1
- package/dist/supervision/SafeRestartNotifier.js +46 -3
- package/dist/supervision/SafeRestartNotifier.js.map +1 -1
- package/dist/supervision/SafeRestartScheduler.js +65 -6
- package/dist/supervision/SafeRestartScheduler.js.map +1 -1
- package/dist/supervision/replacementSupervisor.js +27 -2
- package/dist/supervision/replacementSupervisor.js.map +1 -1
- package/dist/supervisor.js +27 -2
- package/dist/supervisor.js.map +1 -1
- package/docs/technical-reference.md +20 -7
- package/docs/technical-reference.zh.md +20 -7
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/skills/agent-bot/SKILL.md +63 -26
- package/src/acp/AcpProcessManager.ts +16 -3
- package/src/acp/AcpSessionManager.ts +14 -0
- package/src/cli/ServerStarter.ts +25 -2
- package/src/cli/controlProtocol.ts +6 -1
- package/src/cli/help.ts +16 -4
- package/src/cli/serverStatus.ts +28 -0
- package/src/cli/taskListOutput.ts +91 -0
- package/src/cli.ts +123 -51
- package/src/codex/CodexProcessManager.ts +38 -3
- package/src/codex/CodexRuntime.ts +6 -0
- package/src/commands/CommandRouter.ts +4 -0
- package/src/commands/commandTypes.ts +1 -0
- package/src/config/FeishuUserOpenIdStore.ts +81 -0
- package/src/config/loadConfig.ts +3 -0
- package/src/feishu/CardRenderer.ts +169 -22
- package/src/feishu/FeishuConnector.ts +13 -4
- package/src/index.ts +195 -23
- package/src/presentation/turnGraph.ts +48 -0
- package/src/proxy/ProxySessionController.ts +507 -112
- package/src/runtime/AcpRuntimeAdapter.ts +5 -0
- package/src/runtime/agentEnvironment.ts +41 -3
- package/src/runtime/createAgentRuntimeRegistry.ts +18 -3
- package/src/runtime/types.ts +5 -0
- package/src/startup/StartupNotifier.ts +23 -7
- package/src/startup/startFeishu.ts +3 -2
- package/src/state/StateStore.ts +224 -0
- package/src/state/migrations.ts +21 -0
- package/src/supervision/SafeRestartNotifier.ts +53 -4
- package/src/supervision/SafeRestartScheduler.ts +78 -7
- package/src/supervision/replacementSupervisor.ts +27 -1
- 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.
|
|
3
|
-
# FEISHU_USER_OPEN_ID
|
|
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
|
|
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
|
|
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
|
-
-
|
|
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
|
-
-
|
|
20
|
-
-
|
|
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
|
|
29
|
+
- A completed local login for the Agent you plan to use
|
|
29
30
|
|
|
30
|
-
Check the installed Agents and login
|
|
31
|
+
Check the installed Agents and their login status:
|
|
31
32
|
|
|
32
|
-
```
|
|
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
|
|
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
|
-
```
|
|
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
|
-
|
|
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
|
-
```
|
|
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
|
|
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
|
-
|
|
63
|
+
A fresh initialization normally presents three QR-code or link steps in the terminal.
|
|
66
64
|
|
|
67
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
78
|
+
### Start And Stop
|
|
83
79
|
|
|
84
|
-
|
|
80
|
+
Start the service:
|
|
85
81
|
|
|
86
|
-
```
|
|
87
|
-
agentbot
|
|
82
|
+
```bash
|
|
83
|
+
# agentbot init starts the Server automatically, so manual startup is usually unnecessary.
|
|
84
|
+
agentbot server start
|
|
88
85
|
```
|
|
89
86
|
|
|
90
|
-
|
|
87
|
+
Check the service status:
|
|
91
88
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
```powershell
|
|
89
|
+
```bash
|
|
95
90
|
agentbot server status
|
|
96
91
|
```
|
|
97
92
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
The `Agent Bot 已启动` startup card shows the version of Agent Bot currently running.
|
|
93
|
+
Stop the service:
|
|
101
94
|
|
|
102
|
-
|
|
95
|
+
```bash
|
|
96
|
+
agentbot server stop
|
|
97
|
+
```
|
|
103
98
|
|
|
104
|
-
|
|
99
|
+
Safely restart the service:
|
|
105
100
|
|
|
106
|
-
```
|
|
107
|
-
agentbot server
|
|
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
|
-
```
|
|
111
|
+
```bash
|
|
115
112
|
agentbot server stop
|
|
116
113
|
npm install --global @keyou007/agent-bot@latest
|
|
117
|
-
agentbot
|
|
114
|
+
agentbot init # Update the Profile and start the Server
|
|
118
115
|
```
|
|
119
116
|
|
|
120
117
|
To uninstall:
|
|
121
118
|
|
|
122
|
-
```
|
|
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
|
|
124
|
+
Uninstalling the npm package does not delete user data under `~/.agent-bot`.
|
|
128
125
|
|
|
129
|
-
|
|
126
|
+
### Multiple Profiles
|
|
130
127
|
|
|
131
|
-
|
|
128
|
+
Multiple Profiles let you run several independent Agent Bot instances on the same device without interfering with one another.
|
|
132
129
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
agentbot
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
`
|
|
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
|
-
|
|
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
|
-
|
|
156
|
+
## Daily Commands
|
|
157
|
+
|
|
158
|
+
### Console UI/TUI
|
|
159
|
+
|
|
160
|
+
```bash
|
|
149
161
|
agentbot console
|
|
150
162
|
```
|
|
151
163
|
|
|
152
|
-
The Console UI
|
|
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
|
-
###
|
|
166
|
+
### Task Management
|
|
155
167
|
|
|
156
|
-
```
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
|
194
|
-
| `/
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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`
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|