@keyou007/agent-bot 0.1.10 → 0.1.12
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 +1 -1
- package/CHANGELOG.md +25 -0
- package/README.md +55 -43
- package/README.zh.md +55 -43
- package/assets/agent-bot-logo.png +0 -0
- package/config.example.yaml +11 -1
- package/dist/acp/AcpSessionManager.js +78 -46
- package/dist/acp/AcpSessionManager.js.map +1 -1
- package/dist/cli/FeishuAppConfiguration.js +1 -1
- package/dist/cli/FeishuAppConfiguration.js.map +1 -1
- package/dist/cli/FeishuAppRegistration.js +2 -2
- package/dist/cli/FeishuAppRegistration.js.map +1 -1
- package/dist/cli/Initializer.js +1 -1
- package/dist/cli/Initializer.js.map +1 -1
- package/dist/cli/ServerStarter.js +7 -2
- package/dist/cli/ServerStarter.js.map +1 -1
- package/dist/cli/controlProtocol.js.map +1 -1
- package/dist/cli/help.js +20 -16
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/taskGroupOptions.js +95 -0
- package/dist/cli/taskGroupOptions.js.map +1 -0
- package/dist/cli.js +74 -2
- package/dist/cli.js.map +1 -1
- package/dist/codex/AppServerConnection.js +15 -1
- package/dist/codex/AppServerConnection.js.map +1 -1
- package/dist/codex/CodexLocalActivityDetector.js +4 -1
- package/dist/codex/CodexLocalActivityDetector.js.map +1 -1
- package/dist/codex/CodexProcessManager.js +1 -0
- package/dist/codex/CodexProcessManager.js.map +1 -1
- package/dist/codex/CodexRuntime.js +112 -11
- package/dist/codex/CodexRuntime.js.map +1 -1
- package/dist/commands/CommandRouter.js +64 -49
- package/dist/commands/CommandRouter.js.map +1 -1
- package/dist/config/loadConfig.js +11 -1
- package/dist/config/loadConfig.js.map +1 -1
- package/dist/config/schema.js +6 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/console/ConsoleConnector.js +1 -1
- package/dist/console/ConsoleConnector.js.map +1 -1
- package/dist/console/ConsoleTurnPresenter.js +15 -8
- package/dist/console/ConsoleTurnPresenter.js.map +1 -1
- package/dist/deprecated-cli.js +5 -0
- package/dist/deprecated-cli.js.map +1 -0
- package/dist/feishu/CardRenderer.js +350 -15
- package/dist/feishu/CardRenderer.js.map +1 -1
- package/dist/feishu/FeishuMessageClient.js +51 -5
- package/dist/feishu/FeishuMessageClient.js.map +1 -1
- package/dist/feishu/FeishuTurnPresenter.js +17 -8
- package/dist/feishu/FeishuTurnPresenter.js.map +1 -1
- package/dist/feishu/transport.js +1 -1
- package/dist/feishu/transport.js.map +1 -1
- package/dist/index.js +38 -19
- package/dist/index.js.map +1 -1
- package/dist/presentation/OutboundRouter.js +2 -2
- package/dist/presentation/OutboundRouter.js.map +1 -1
- package/dist/presentation/TurnStateReducer.js +2 -1
- package/dist/presentation/TurnStateReducer.js.map +1 -1
- package/dist/proxy/ProxySessionController.js +665 -225
- package/dist/proxy/ProxySessionController.js.map +1 -1
- package/dist/runtime/AcpRuntimeAdapter.js +1 -0
- package/dist/runtime/AcpRuntimeAdapter.js.map +1 -1
- package/dist/runtime/AgentRuntimeRegistry.js +7 -4
- package/dist/runtime/AgentRuntimeRegistry.js.map +1 -1
- package/dist/runtime/createAgentRuntimeRegistry.js +22 -0
- package/dist/runtime/createAgentRuntimeRegistry.js.map +1 -0
- package/dist/startup/SessionMetadataHydrator.js +2 -2
- package/dist/startup/SessionMetadataHydrator.js.map +1 -1
- package/dist/startup/StartupNotifier.js +1 -0
- package/dist/startup/StartupNotifier.js.map +1 -1
- package/dist/state/StateStore.js +21 -15
- package/dist/state/StateStore.js.map +1 -1
- package/dist/supervision/SafeRestartScheduler.js +5 -0
- package/dist/supervision/SafeRestartScheduler.js.map +1 -1
- package/dist/supervision/systemEnvironment.js +129 -0
- package/dist/supervision/systemEnvironment.js.map +1 -0
- package/dist/supervisor.js +13 -1
- package/dist/supervisor.js.map +1 -1
- package/docs/technical-reference.md +35 -21
- package/docs/technical-reference.zh.md +35 -21
- package/npm-shrinkwrap.json +4 -3
- package/package.json +4 -2
- package/skills/agent-bot/SKILL.md +73 -30
- package/src/acp/AcpSessionManager.ts +73 -54
- package/src/cli/FeishuAppConfiguration.ts +2 -2
- package/src/cli/FeishuAppRegistration.ts +4 -4
- package/src/cli/Initializer.ts +2 -2
- package/src/cli/ServerStarter.ts +8 -3
- package/src/cli/controlProtocol.ts +21 -1
- package/src/cli/help.ts +20 -16
- package/src/cli/taskGroupOptions.ts +149 -0
- package/src/cli.ts +98 -4
- package/src/codex/AppServerConnection.ts +21 -1
- package/src/codex/CodexLocalActivityDetector.ts +8 -1
- package/src/codex/CodexProcessManager.ts +1 -0
- package/src/codex/CodexRuntime.ts +137 -15
- package/src/commands/CommandRouter.ts +71 -49
- package/src/commands/commandTypes.ts +6 -11
- package/src/config/loadConfig.ts +11 -1
- package/src/config/schema.ts +7 -1
- package/src/console/ConsoleConnector.ts +1 -1
- package/src/console/ConsoleTurnPresenter.ts +21 -8
- package/src/deprecated-cli.ts +9 -0
- package/src/feishu/CardRenderer.ts +423 -15
- package/src/feishu/FeishuMessageClient.ts +66 -3
- package/src/feishu/FeishuTurnPresenter.ts +22 -3
- package/src/feishu/transport.ts +1 -1
- package/src/index.ts +54 -24
- package/src/presentation/OutboundRouter.ts +15 -3
- package/src/presentation/TurnStateReducer.ts +2 -0
- package/src/presentation/turnViewTypes.ts +1 -0
- package/src/proxy/ProxySessionController.ts +870 -228
- package/src/runtime/AcpRuntimeAdapter.ts +1 -0
- package/src/runtime/AgentRuntimeRegistry.ts +7 -6
- package/src/runtime/createAgentRuntimeRegistry.ts +25 -0
- package/src/runtime/types.ts +18 -0
- package/src/startup/SessionMetadataHydrator.ts +2 -2
- package/src/startup/StartupNotifier.ts +1 -0
- package/src/state/StateStore.ts +29 -15
- package/src/supervision/SafeRestartScheduler.ts +5 -0
- package/src/supervision/systemEnvironment.ts +174 -0
- package/src/supervisor.ts +12 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-bot
|
|
3
|
-
description: Initialize Agent Bot, detect and work safely inside its runtime, and manage the local service and its Codex or ACP sessions through the
|
|
3
|
+
description: Initialize Agent Bot, detect and work safely inside its runtime, and manage the local service and its Codex or ACP sessions through the agentbot CLI. Use when an agent needs to adapt its behavior while running under Agent Bot, or when a user asks to initialize, inspect, start, safely restart, immediately restart, or stop Agent Bot; open its console UI; list, inspect, stop, rename, or send a prompt to tasks; create or fork Lark groups from tasks; check a scheduled restart; or troubleshoot the bot without manually killing worker processes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Agent Bot
|
|
7
7
|
|
|
8
|
-
Use the `
|
|
8
|
+
Use the `agentbot` command as the supported control surface for Agent Bot. The legacy `agent-bot` command is deprecated and should not be used in new instructions or automation. Prefer structured status and control operations over direct process manipulation or database edits.
|
|
9
9
|
|
|
10
10
|
## Detect the Agent Bot runtime
|
|
11
11
|
|
|
@@ -43,7 +43,7 @@ When `AGENT_BOT=1`:
|
|
|
43
43
|
Run initialization once after installing or linking the CLI:
|
|
44
44
|
|
|
45
45
|
```powershell
|
|
46
|
-
|
|
46
|
+
agentbot init
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
Initialization creates the Agent Bot home, `config.yaml`, `.env`, `data/`, and `logs/` from the bundled examples. If Feishu credentials are absent, it starts Feishu one-click app registration, prints a QR code followed by its authorization URL, waits for the user to approve the request, and stores the returned app ID and secret in `.env`. It then audits the app's currently published tenant permissions, event subscriptions, and callbacks. Core and optional missing items produce separate configuration challenges. Core configuration is polled until ready, except that the manually configured all-group-message permission may be explicitly skipped with `Y`. For optional configuration, the CLI prints the QR code followed by the authorization URL and immediately waits up to five minutes for activation. The only terminal choice is also `Y`, which skips optional authorization and continues initialization.
|
|
@@ -56,15 +56,15 @@ After Feishu initialization succeeds, `init` releases its initialization lock an
|
|
|
56
56
|
|
|
57
57
|
When running `init` on the user's behalf, relay every exact authorization, incremental-configuration, and manual permission-page URL and let the user complete it in their own browser. For `im:message.group_msg`, explicitly tell the user to add the filtered permission and publish the app version, or offer to enter `Y` when they intentionally accept mention-only group behavior. Optional polling starts automatically after the link is shown. Do not enter `Y` for either prompt unless the user explicitly asks to skip; there is no separate accept action. Optional capabilities such as group creation, group-title synchronization, reactions, images, and card actions never block initialization when skipped, timed out, or still unavailable; relay the final affected-feature warnings. In a non-interactive terminal, skip input is unavailable. None of the URLs contains the app secret, and the secret itself is never printed.
|
|
58
58
|
|
|
59
|
-
Existing complete Feishu credentials are preserved but still audited and repaired when needed. Missing or incomplete credentials mean app creation did not complete, so a later `init` starts a new registration instead of resuming the previous device code. Once both credentials are durably saved, an interrupted permission audit resumes against the same remote app. `init` also holds a local lock to prevent concurrent registrations. Use `
|
|
59
|
+
Existing complete Feishu credentials are preserved but still audited and repaired when needed. Missing or incomplete credentials mean app creation did not complete, so a later `init` starts a new registration instead of resuming the previous device code. Once both credentials are durably saved, an interrupted permission audit resumes against the same remote app. `init` also holds a local lock to prevent concurrent registrations. Use `agentbot init --skip-feishu` only for console-only initialization because it skips both registration and configuration auditing. Use `agentbot init --reconfigure-feishu` only when the user explicitly wants to replace existing complete credentials. The command respects `AGENT_BOT_HOME`, `AGENT_BOT_CONFIG`, and `--config <path>`. Use `agentbot init --json` when structured final output helps.
|
|
60
60
|
|
|
61
|
-
Use `
|
|
61
|
+
Use `agentbot --profile <directory> init --reset` only when the user explicitly requests a full Profile reset. `--profile` is mandatory even for the primary Profile, and its server must be stopped first. The command moves the active `config.yaml`, `.env`, `data/`, and `logs/` into a new timestamped `.reset-backups` directory, retains all older backups and unrelated files, then initializes a clean Profile. Relay the reported backup path. Do not delete `.reset-backups`; it may contain old credentials and task data. `--reset --skip-feishu` is valid for a clean Console-only Profile, but `--reset` cannot be combined with `--reconfigure-feishu`.
|
|
62
62
|
|
|
63
63
|
For an isolated secondary bot, pass its profile directory explicitly on every command:
|
|
64
64
|
|
|
65
65
|
```powershell
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
agentbot --profile ~/.agent-bot-rescue init
|
|
67
|
+
agentbot --profile ~/.agent-bot-rescue server status
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
No `--profile` selects the main profile at `~/.agent-bot` by default. `--profile <directory>` selects that directory's `config.yaml`, `.env`, data, logs, and local control endpoint and propagates the selection to the supervisor and worker. Alternative profiles are not registered by name. Do not combine `--profile` with `--config`.
|
|
@@ -74,15 +74,15 @@ No `--profile` selects the main profile at `~/.agent-bot` by default. `--profile
|
|
|
74
74
|
Verify the CLI and current service state before changing anything:
|
|
75
75
|
|
|
76
76
|
```powershell
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
agentbot --version
|
|
78
|
+
agentbot --help
|
|
79
|
+
agentbot server status
|
|
80
|
+
agentbot task list
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
Agent Bot CLI interface text follows the system locale: locales beginning with `zh` use Chinese, while English and unsupported locales use English. JSON output is not localized. `
|
|
83
|
+
Agent Bot CLI interface text follows the system locale: locales beginning with `zh` use Chinese, while English and unsupported locales use English. JSON output is not localized. `agentbot server status` also reports the running profile's Lark App ID; with `--json`, read it from `feishuAppId`.
|
|
84
84
|
|
|
85
|
-
Add `--json` to status and list commands when machine-readable output helps. If `
|
|
85
|
+
Add `--json` to status and list commands when machine-readable output helps. If `agentbot` is unavailable, report that the CLI is not installed or linked instead of guessing process state.
|
|
86
86
|
|
|
87
87
|
By default Agent Bot stores user-owned configuration and runtime state in `~/.agent-bot`: config at `~/.agent-bot/config.yaml`, environment variables at `~/.agent-bot/.env`, SQLite state at `~/.agent-bot/data/agent-bot.sqlite`, logs at `~/.agent-bot/logs/agent-bot.log`, and inbound image cache next to the SQLite database. `AGENT_BOT_HOME` changes this root. Prefer `--profile <directory>` when controlling a complete isolated instance; use `--config <path>` only when selecting a non-default configuration without changing the whole profile.
|
|
88
88
|
|
|
@@ -91,17 +91,21 @@ By default Agent Bot stores user-owned configuration and runtime state in `~/.ag
|
|
|
91
91
|
Use these commands:
|
|
92
92
|
|
|
93
93
|
```powershell
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
agentbot server start
|
|
95
|
+
agentbot server status
|
|
96
|
+
agentbot server restart --reason "reason for restart"
|
|
97
|
+
agentbot server stop
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
Treat `server restart` as the normal restart path. It schedules a safe restart and waits for active tasks, pending final-message delivery, and a quiet inbound-message window. The first safe-restart status card is delayed by three seconds so the active task's final response can usually be delivered first; this presentation delay does not postpone scheduler polling. While the restart is pending, its status card has a bottom `Cancel` button that conditionally cancels that exact schedule and updates the card in place.
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
On Windows, initial start, safe or immediate replacement, and every crash-driven Worker launch reload the latest Machine and User environment variables. After changing `PATH` or installing a CLI shim, finish the current work and use the normal restart path. Agent Bot keeps `AGENT_BOT_*` and `FEISHU_*` process-local so Profile selection and bot credentials do not leak between isolated instances.
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
In Feishu, `/restart` schedules the same safe restart. Use `/restart --force` only when the user explicitly accepts interruption; the command accepts no other arguments.
|
|
105
|
+
|
|
106
|
+
Use `agentbot server restart --immediate` only when the user explicitly requests an immediate restart or accepts interruption. Never use `taskkill`, `Stop-Process`, or equivalent commands for routine Agent Bot restart management.
|
|
107
|
+
|
|
108
|
+
`agentbot console` opens the console UI only when the service is stopped. Do not use `--force` while the service is live unless the user explicitly accepts concurrent state access.
|
|
105
109
|
|
|
106
110
|
When a startup card says the Worker exited and the supervisor restarted it, inspect the selected profile's persisted crash evidence before guessing at a cause:
|
|
107
111
|
|
|
@@ -117,12 +121,14 @@ Normal safe restarts and explicit stops do not overwrite the latest crash record
|
|
|
117
121
|
List tasks before resolving a numeric reference because task numbers follow the current list order:
|
|
118
122
|
|
|
119
123
|
```powershell
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
agentbot task list
|
|
125
|
+
agentbot task chat <number-or-task-id> [--json]
|
|
126
|
+
agentbot task status <number-or-task-id>
|
|
127
|
+
agentbot task stop <number-or-task-id>
|
|
128
|
+
agentbot task title <number-or-task-id> <new-title>
|
|
129
|
+
agentbot task prompt <number-or-task-id> <prompt>
|
|
130
|
+
agentbot task newgroup <number-or-task-id> [title] [--agent <standard-name>] [--dir <cwd> | --nodir] [--json]
|
|
131
|
+
agentbot task forkgroup <number-or-task-id> [title] [--json]
|
|
126
132
|
```
|
|
127
133
|
|
|
128
134
|
Task IDs may be supplied in full or as an unambiguous prefix. Use `task stop` to ask the running worker to send the Codex Interrupt signal; leave child-process lifecycle management to Codex.
|
|
@@ -131,25 +137,62 @@ Use `task chat <number-or-task-id>` to read the Feishu chat ID associated with a
|
|
|
131
137
|
|
|
132
138
|
Use `task prompt` to send input to a specific task without changing any chat's current task. The bot first posts the Prompt text to the task's existing Feishu chat, thread, or private-chat route, then submits it to the task. If posting fails, the task is not started or steered. The thinking card and final response continue to the same route; the command line only reports whether the Prompt was accepted.
|
|
133
139
|
|
|
140
|
+
### Create a task group from the CLI
|
|
141
|
+
|
|
142
|
+
Use `task newgroup` to create a Lark group and bind a new task from outside Feishu. List tasks first and pass the intended source task explicitly; `<number-or-task-id>` defines the source context, so never substitute the shell's current working directory for the task's project directory.
|
|
143
|
+
|
|
144
|
+
```powershell
|
|
145
|
+
# Inherit the source task's Agent, project, and execution settings.
|
|
146
|
+
agentbot task newgroup <number-or-task-id> "Review"
|
|
147
|
+
|
|
148
|
+
# Override the project directory. Prefer an absolute path or a ~-based path.
|
|
149
|
+
agentbot task newgroup <number-or-task-id> "Review" --dir ~/dev/project
|
|
150
|
+
|
|
151
|
+
# Create a fresh Projectless App Server task instead of inheriting a project.
|
|
152
|
+
agentbot task newgroup <number-or-task-id> "Question" --nodir
|
|
153
|
+
|
|
154
|
+
# Use another configured Agent with the inherited project shape.
|
|
155
|
+
agentbot task newgroup <number-or-task-id> "Review" --agent traex
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Apply these rules:
|
|
159
|
+
|
|
160
|
+
- With neither `--dir` nor `--nodir`, inherit the source task's project directory. If the source is Projectless, create a fresh Projectless workspace rather than reusing its generated directory.
|
|
161
|
+
- `--dir <cwd>` overrides the inherited project and resolves `~`, `~/...`, and `~\...` from the user's home directory.
|
|
162
|
+
- `--nodir` forces a Projectless task and is valid only for an App Server Agent. Reject combining it with `--dir`.
|
|
163
|
+
- With no `--agent`, inherit the source task's Agent, Provider, model, reasoning effort, and permission mode. When `--agent <standard-name>` selects a different Agent, retain the chosen or inherited project shape but use that Agent runtime's own execution defaults.
|
|
164
|
+
- The Server must be running. The Profile must contain `FEISHU_USER_OPEN_ID`; the Server invites that saved authorizing user because the CLI has no Lark operator identity.
|
|
165
|
+
- Creating the group must not interrupt the source task or switch the source chat's current task. Add `--json` when the caller needs `group.chatId`, `group.contextKey`, or the created task IDs.
|
|
166
|
+
|
|
167
|
+
Use `task forkgroup` to Fork the selected task's latest available completed turn into a new group. It does not interrupt a newer active source turn and does not switch the source chat. Both group commands accept an optional title and `--json`; use the structured result to read the new `group.chatId`, `group.contextKey`, and task IDs.
|
|
168
|
+
|
|
134
169
|
Use `/queue <prompt>` in Feishu to persist a separate follow-up Prompt instead of steering the active turn. Queued Prompts run in FIFO order after the current turn completes and survive Agent Bot restarts. `/nosteer <prompt>` is an equivalent compatibility spelling.
|
|
135
170
|
|
|
136
171
|
For a long-running objective in the active Feishu task, use `/goal <objective>`. Use `/goal` to inspect it, `/goal pause` or `/goal resume` to control automatic continuation, `/goal edit <objective>` to revise it, and `/goal clear` to remove it. Stopping a Goal turn through Agent Bot also pauses the Goal before sending Interrupt so it does not immediately continue.
|
|
137
172
|
|
|
138
|
-
Use `/
|
|
173
|
+
Use `/agent` in Feishu to open the unified execution-settings card on its Agent tab and `/agent <name>` to directly select the default agent. The Agent tab is present only when multiple agents are configured and remains usable before the chat has a current task. When only one Agent is configured, `/agent` reports that current Agent directly instead of sending a card. Agent selection affects future tasks and does not replace the Agent of an existing task; use `/new` after selecting when a new task is needed.
|
|
174
|
+
|
|
175
|
+
Use `/newgroup [title] [--dir <cwd> | --nodir]` in Feishu to create a private group named `[agent] [project directory] <title>`, invite the command sender, and immediately create and bind a new task in that group. `/new` and `/newgroup` share the same project options: an explicit `--dir` overrides the inherited project directory, while `--nodir` forces a Projectless App Server task; reject using both together. Resolve `~`, `~/...`, and `~\...` from the current user's home directory for both commands. Projectless groups omit the project segment and use `[agent] <title>`. The new task inherits the source chat's current task project directory when neither option is present, plus its model, reasoning effort, and permission mode without interrupting or switching the source task. When the source chat has no current task, use the selected agent and its runtime defaults. An explicit title becomes both the group suffix and the task title. When the title is omitted, use task title `新任务` and group name `[agent] [project directory] 新任务 (mm-dd)`, or `[agent] 新任务 (mm-dd)` for Projectless; an explicit title never gets a date suffix. Every new group gets a deterministic scheme-C Identicon avatar: Latin project names display their first word, Chinese names display up to their first four characters, and the normalized full project path hashes into the palette and symmetric node pattern. Projectless groups use the title as the stable seed. Replace the user's home-directory prefix with `~`. The bracketed project-directory value is limited to 15 characters. Longer paths keep the final two directories when they fit, otherwise keep the final directory, truncating the tail only when the final directory itself is overlong. Use `\` on Windows and `/` on macOS/Linux. Do not automatically send a Sessions or Status card to the new group. A later `/new --dir <cwd>` or `/new --nodir` in the group may explicitly replace the inherited project shape.
|
|
176
|
+
|
|
177
|
+
Provider is part of the same inherited execution-settings group as model, reasoning effort, and permission mode. Preserve all four across `/new`, `/newgroup`, `/fork`, `/forkgroup`, and the matching `/sessions` actions. New tasks with no inherited Provider must leave it unset so Codex App Server uses the default from Codex configuration. New-group welcome messages report all four settings.
|
|
139
178
|
|
|
140
179
|
Group names created by `/newgroup` and `/forkgroup` are capped at 60 displayed characters. When the generated name would exceed that limit, truncate only the title portion in the Feishu group name; preserve the underlying Agent Bot task title.
|
|
141
180
|
|
|
142
181
|
Use `/forkgroup [title]` in Feishu to fork the current position into a newly created private group. In a Feishu thread, use the thread's original anchor turn when the thread has no bound task or its bound task has not completed a turn of its own. Once the bound thread task has completed a turn, use its latest locally persisted completed turn; exclude any newer active turn without interrupting it. Resolve this source before generic thread initialization so an unbound thread does not create an intermediate task. Outside a thread, fork the current Codex task's latest available completed turn. Agent Bot invites the command sender and binds the fork as the new group's current task, but does not automatically send a Sessions or Status card there. The new-group welcome message reports the forked task's model, reasoning effort, and permission type. An explicit title is used directly. Without an explicit title, both the forked task and group name use the same persistent `source title(分支 N)` sequence as `/fork`. `/forkgroup` does not add a date suffix.
|
|
143
182
|
|
|
144
|
-
Use `/new [title] --nodir` to force a new
|
|
183
|
+
Use `/new [title] --nodir` to force a new App Server Projectless task even when the current task belongs to a project. `--nodir` and `--dir <cwd>` are mutually exclusive; omitting both preserves the normal project-shape inheritance behavior.
|
|
145
184
|
|
|
146
185
|
Every task in the Feishu `/sessions` card has `New`, `NewGroup`, `Fork`, and `ForkGroup` actions. `New` inherits the source task's project directory, model, reasoning effort, and permission mode, creates a new task, and switches the current chat to it without stopping or forking the source task. `NewGroup` applies the same inheritance in a newly created private group. `Fork` switches the current chat to a branch, while `ForkGroup` binds the branch to a newly created private group; both fork actions use the selected task's latest available completed turn without interrupting an active turn.
|
|
147
186
|
|
|
148
|
-
Use `/fork [number-or-task-id]` in Feishu to branch from the current or specified Codex task and switch to the new branch. If the source task is running, Agent Bot forks from its latest completed turn and leaves the active turn running; it rejects only when the task has no completed turn yet.
|
|
187
|
+
Use `/fork [number-or-task-id]` in Feishu to branch from the current or specified Codex task and switch to the new branch. If the source task is running, Agent Bot forks from its latest completed turn and leaves the active turn running; it rejects only when the task has no completed turn yet. Every fork request sends `excludeTurns: true` to Codex App Server so the response omits populated turns without removing turns from the forked history. Older App Servers that explicitly reject this experimental field are retried once without it; ambiguous failures such as timeouts or disconnects are not retried.
|
|
149
188
|
|
|
150
189
|
Status cards include a `Refresh` action that reads the latest task state and updates the same card in place without switching tasks or sending another card.
|
|
151
190
|
|
|
152
|
-
Use `/model` in Feishu to
|
|
191
|
+
Use `/agent`, `/provider`, `/model`, `/thinking`, or `/permissions` in Feishu to open the same interactive Card 2.0 execution-settings card with the corresponding tab active. The card exposes Provider, Model, Thinking, and Permission tabs whenever a current task exists, plus an Agent tab when multiple agents are configured. Each non-current option has an English `Switch` action. Selecting an option refreshes the same card in place. Agent changes affect future tasks; the other settings apply from the next request. Model changes automatically choose a compatible reasoning effort when necessary.
|
|
192
|
+
|
|
193
|
+
If the current runtime has no alternative Provider, `/provider` reports the current Provider directly instead of opening the settings card. Apply the same rule to `/agent` when only one Agent is configured.
|
|
194
|
+
|
|
195
|
+
These four settings commands do not accept arguments. Never instruct a user to send a Provider, model, reasoning effort, or permission value after the command; direct them to the card callbacks instead.
|
|
153
196
|
|
|
154
197
|
Keep action labels placed to the right of card content or at the bottom of a card in English. Buttons above the main card content, such as activity-history navigation, may remain in Chinese.
|
|
155
198
|
|
|
@@ -164,7 +207,7 @@ Use `--context <key>` or `--status <status>` to narrow `task list`. Use `--profi
|
|
|
164
207
|
After changing Agent Bot code, run the relevant tests, typecheck, and build. If a running service must pick up the result, schedule:
|
|
165
208
|
|
|
166
209
|
```powershell
|
|
167
|
-
|
|
210
|
+
agentbot server restart --reason "brief description of the completed change"
|
|
168
211
|
```
|
|
169
212
|
|
|
170
213
|
Do not replace the worker immediately while a task is active. A later incoming task must not cancel the pending safe restart; allow the scheduler to wait until the service becomes safely idle again.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import type { Logger } from "pino";
|
|
3
|
-
import type {
|
|
3
|
+
import type { AgentConfig } from "../config/schema.js";
|
|
4
4
|
import type {
|
|
5
5
|
AcpInitializeResult,
|
|
6
6
|
AcpPermissionRequestParams,
|
|
@@ -13,7 +13,6 @@ import { AcpProcessManager, type ManagedAcpProcess } from "./AcpProcessManager.j
|
|
|
13
13
|
|
|
14
14
|
export interface RuntimeSession {
|
|
15
15
|
localSessionId: string;
|
|
16
|
-
processKey: string;
|
|
17
16
|
agentName: string;
|
|
18
17
|
cwd: string;
|
|
19
18
|
acpSessionId: string;
|
|
@@ -22,6 +21,8 @@ export interface RuntimeSession {
|
|
|
22
21
|
modes?: JsonValue;
|
|
23
22
|
configOptions?: JsonValue;
|
|
24
23
|
availableCommands?: JsonValue;
|
|
24
|
+
onUpdate: (session: RuntimeSession, update: Record<string, JsonValue>) => void;
|
|
25
|
+
onPermissionRequest: (session: RuntimeSession, params: AcpPermissionRequestParams) => Promise<JsonValue>;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export interface CreateRuntimeSessionInput {
|
|
@@ -38,9 +39,11 @@ export interface CreateRuntimeSessionInput {
|
|
|
38
39
|
export class AcpSessionManager {
|
|
39
40
|
private readonly sessions = new Map<string, RuntimeSession>();
|
|
40
41
|
private readonly sessionsByAcpId = new Map<string, RuntimeSession>();
|
|
42
|
+
private processStart?: Promise<ManagedAcpProcess>;
|
|
41
43
|
|
|
42
44
|
constructor(
|
|
43
|
-
private readonly
|
|
45
|
+
private readonly agentName: string,
|
|
46
|
+
private readonly agent: AgentConfig,
|
|
44
47
|
private readonly processManager: AcpProcessManager,
|
|
45
48
|
private readonly logger: Logger,
|
|
46
49
|
) {}
|
|
@@ -50,66 +53,19 @@ export class AcpSessionManager {
|
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
async create(input: CreateRuntimeSessionInput): Promise<RuntimeSession> {
|
|
53
|
-
|
|
54
|
-
if (!agent) {
|
|
55
|
-
throw new Error(`Unknown agent: ${input.agentName}`);
|
|
56
|
-
}
|
|
56
|
+
if (input.agentName !== this.agentName) throw new Error(`Unexpected agent: ${input.agentName}`);
|
|
57
57
|
|
|
58
58
|
const cwd = path.resolve(input.cwd);
|
|
59
|
-
const
|
|
60
|
-
const managed = this.processManager.start(processKey, input.agentName, agent);
|
|
59
|
+
const managed = await this.process();
|
|
61
60
|
const connection = managed.connection;
|
|
62
61
|
|
|
63
|
-
let runtime: RuntimeSession | undefined;
|
|
64
|
-
|
|
65
|
-
connection.registerHandler("session/request_permission", async (params) => {
|
|
66
|
-
if (!runtime) {
|
|
67
|
-
throw new Error("Received permission request before session was ready.");
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return input.onPermissionRequest(runtime, params as unknown as AcpPermissionRequestParams);
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
connection.on("notification", (_method, params) => {
|
|
74
|
-
if (_method !== "session/update") {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const updateParams = params as unknown as AcpSessionUpdateParams;
|
|
79
|
-
const target = this.sessionsByAcpId.get(updateParams.sessionId);
|
|
80
|
-
if (!target) {
|
|
81
|
-
this.logger.debug({ updateParams }, "Ignoring update for unknown ACP session.");
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
this.applySessionUpdate(target, updateParams.update);
|
|
86
|
-
input.onUpdate(target, updateParams.update);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
const initializeResult = await connection.request<AcpInitializeResult>("initialize", {
|
|
90
|
-
protocolVersion: 1,
|
|
91
|
-
clientCapabilities: {},
|
|
92
|
-
clientInfo: {
|
|
93
|
-
name: "agent-bot",
|
|
94
|
-
title: "Agent Bot",
|
|
95
|
-
version: "0.1.0",
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
if (initializeResult.authMethods?.length) {
|
|
100
|
-
const method = initializeResult.authMethods[0];
|
|
101
|
-
this.logger.info({ methodId: method.id }, "Authenticating ACP agent with first advertised method.");
|
|
102
|
-
await connection.request("authenticate", { methodId: method.id });
|
|
103
|
-
}
|
|
104
|
-
|
|
105
62
|
const newSessionResult = await connection.request<AcpSessionNewResult>("session/new", {
|
|
106
63
|
cwd,
|
|
107
64
|
mcpServers: [],
|
|
108
65
|
});
|
|
109
66
|
|
|
110
|
-
runtime = {
|
|
67
|
+
const runtime: RuntimeSession = {
|
|
111
68
|
localSessionId: input.localSessionId,
|
|
112
|
-
processKey,
|
|
113
69
|
agentName: input.agentName,
|
|
114
70
|
cwd,
|
|
115
71
|
acpSessionId: newSessionResult.sessionId,
|
|
@@ -117,6 +73,8 @@ export class AcpSessionManager {
|
|
|
117
73
|
running: false,
|
|
118
74
|
modes: newSessionResult.modes,
|
|
119
75
|
configOptions: newSessionResult.configOptions,
|
|
76
|
+
onUpdate: input.onUpdate,
|
|
77
|
+
onPermissionRequest: input.onPermissionRequest,
|
|
120
78
|
};
|
|
121
79
|
|
|
122
80
|
this.sessions.set(input.localSessionId, runtime);
|
|
@@ -169,7 +127,13 @@ export class AcpSessionManager {
|
|
|
169
127
|
|
|
170
128
|
this.sessions.delete(localSessionId);
|
|
171
129
|
this.sessionsByAcpId.delete(session.acpSessionId);
|
|
172
|
-
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
shutdown(): void {
|
|
133
|
+
this.sessions.clear();
|
|
134
|
+
this.sessionsByAcpId.clear();
|
|
135
|
+
this.processStart = undefined;
|
|
136
|
+
this.processManager.stopAll();
|
|
173
137
|
}
|
|
174
138
|
|
|
175
139
|
async setMode(localSessionId: string, modeId: string): Promise<void> {
|
|
@@ -203,6 +167,61 @@ export class AcpSessionManager {
|
|
|
203
167
|
return session;
|
|
204
168
|
}
|
|
205
169
|
|
|
170
|
+
private async process(): Promise<ManagedAcpProcess> {
|
|
171
|
+
const existing = this.processManager.get(this.agentName);
|
|
172
|
+
if (existing) return existing;
|
|
173
|
+
if (this.processStart) return this.processStart;
|
|
174
|
+
const start = this.startProcess();
|
|
175
|
+
this.processStart = start;
|
|
176
|
+
try {
|
|
177
|
+
return await start;
|
|
178
|
+
} finally {
|
|
179
|
+
if (this.processStart === start) this.processStart = undefined;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
private async startProcess(): Promise<ManagedAcpProcess> {
|
|
184
|
+
const managed = this.processManager.start(this.agentName, this.agentName, this.agent);
|
|
185
|
+
try {
|
|
186
|
+
const connection = managed.connection;
|
|
187
|
+
connection.registerHandler("session/request_permission", async (params) => {
|
|
188
|
+
const permission = params as unknown as AcpPermissionRequestParams;
|
|
189
|
+
const target = this.sessionsByAcpId.get(permission.sessionId);
|
|
190
|
+
if (!target) throw new Error(`Unknown ACP session requesting permission: ${permission.sessionId}`);
|
|
191
|
+
return target.onPermissionRequest(target, permission);
|
|
192
|
+
});
|
|
193
|
+
connection.on("notification", (method, params) => {
|
|
194
|
+
if (method !== "session/update") return;
|
|
195
|
+
const updateParams = params as unknown as AcpSessionUpdateParams;
|
|
196
|
+
const target = this.sessionsByAcpId.get(updateParams.sessionId);
|
|
197
|
+
if (!target) {
|
|
198
|
+
this.logger.debug({ updateParams }, "Ignoring update for unknown ACP session.");
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
this.applySessionUpdate(target, updateParams.update);
|
|
202
|
+
target.onUpdate(target, updateParams.update);
|
|
203
|
+
});
|
|
204
|
+
const initializeResult = await connection.request<AcpInitializeResult>("initialize", {
|
|
205
|
+
protocolVersion: 1,
|
|
206
|
+
clientCapabilities: {},
|
|
207
|
+
clientInfo: {
|
|
208
|
+
name: "agent-bot",
|
|
209
|
+
title: "Agent Bot",
|
|
210
|
+
version: "0.1.0",
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
if (initializeResult.authMethods?.length) {
|
|
214
|
+
const method = initializeResult.authMethods[0];
|
|
215
|
+
this.logger.info({ methodId: method.id }, "Authenticating ACP agent with first advertised method.");
|
|
216
|
+
await connection.request("authenticate", { methodId: method.id });
|
|
217
|
+
}
|
|
218
|
+
return managed;
|
|
219
|
+
} catch (error) {
|
|
220
|
+
this.processManager.stop(this.agentName);
|
|
221
|
+
throw error;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
206
225
|
private applySessionUpdate(session: RuntimeSession, update: Record<string, JsonValue>): void {
|
|
207
226
|
const updateType = update.sessionUpdate;
|
|
208
227
|
if (updateType === "config_option_update" && "configOptions" in update) {
|
|
@@ -222,8 +222,8 @@ export async function ensureFeishuAppConfiguration(
|
|
|
222
222
|
? cliText(` Last check failed: ${lastError.message}`, ` 上次检查失败:${lastError.message}`)
|
|
223
223
|
: "";
|
|
224
224
|
throw new Error(cliText(
|
|
225
|
-
`Timed out waiting for the core Lark scopes and message event. Run
|
|
226
|
-
`等待飞书核心权限和消息事件超时。请重新运行
|
|
225
|
+
`Timed out waiting for the core Lark scopes and message event. Run agentbot init again.${detail}`,
|
|
226
|
+
`等待飞书核心权限和消息事件超时。请重新运行 agentbot init。${detail}`,
|
|
227
227
|
));
|
|
228
228
|
}
|
|
229
229
|
|
|
@@ -120,8 +120,8 @@ export async function registerFeishuApp(options: FeishuAppRegistrationOptions =
|
|
|
120
120
|
case "expired_token":
|
|
121
121
|
case "invalid_grant":
|
|
122
122
|
throw new Error(cliText(
|
|
123
|
-
"The Lark app creation link expired. Run
|
|
124
|
-
"飞书应用创建链接已过期,请重新运行
|
|
123
|
+
"The Lark app creation link expired. Run agentbot init again.",
|
|
124
|
+
"飞书应用创建链接已过期,请重新运行 agentbot init。",
|
|
125
125
|
));
|
|
126
126
|
default:
|
|
127
127
|
throwRegistrationError(payload, cliText("Lark app creation failed", "飞书应用创建失败"));
|
|
@@ -129,8 +129,8 @@ export async function registerFeishuApp(options: FeishuAppRegistrationOptions =
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
throw new Error(cliText(
|
|
132
|
-
"Timed out waiting for Lark app creation. Run
|
|
133
|
-
"等待飞书应用创建超时,请重新运行
|
|
132
|
+
"Timed out waiting for Lark app creation. Run agentbot init again.",
|
|
133
|
+
"等待飞书应用创建超时,请重新运行 agentbot init。",
|
|
134
134
|
));
|
|
135
135
|
}
|
|
136
136
|
|
package/src/cli/Initializer.ts
CHANGED
|
@@ -188,8 +188,8 @@ export function acquireInitializationLock(lockDirectory: string): Initialization
|
|
|
188
188
|
if (!isFileExistsError(error)) throw error;
|
|
189
189
|
if (!isStaleInitializationLock(lockPath)) {
|
|
190
190
|
throw new Error(cliText(
|
|
191
|
-
`Another
|
|
192
|
-
`另一个
|
|
191
|
+
`Another agentbot init process is running (lock file: ${lockPath}).`,
|
|
192
|
+
`另一个 agentbot init 进程正在运行(锁文件:${lockPath})。`,
|
|
193
193
|
));
|
|
194
194
|
}
|
|
195
195
|
fs.rmSync(lockPath, { force: true });
|
package/src/cli/ServerStarter.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
prepareCrashReportDirectory,
|
|
9
9
|
resolveSupervisorDiagnosticsPaths,
|
|
10
10
|
} from "../supervision/SupervisorDiagnostics.js";
|
|
11
|
+
import { refreshedSystemEnvironment } from "../supervision/systemEnvironment.js";
|
|
11
12
|
import { controlEndpoint } from "./controlProtocol.js";
|
|
12
13
|
import { cliText } from "./i18n.js";
|
|
13
14
|
import { isServerReachable, isServerRunning } from "./LocalControlClient.js";
|
|
@@ -53,8 +54,8 @@ export async function startServer(
|
|
|
53
54
|
} catch (error) {
|
|
54
55
|
if (error instanceof Error && /Lark bot is not configured/.test(error.message)) {
|
|
55
56
|
throw new Error(cliText(
|
|
56
|
-
"The Lark bot is not configured. Run
|
|
57
|
-
"尚未配置飞书机器人。请先运行
|
|
57
|
+
"The Lark bot is not configured. Run agentbot init first, or use agentbot console for local-only testing.",
|
|
58
|
+
"尚未配置飞书机器人。请先运行 agentbot init,或使用 agentbot console 进行纯本地测试。",
|
|
58
59
|
));
|
|
59
60
|
}
|
|
60
61
|
throw error;
|
|
@@ -94,6 +95,7 @@ const defaultDependencies: ServerStarterDependencies = {
|
|
|
94
95
|
const entry = fileURLToPath(new URL("../supervisor.js", import.meta.url));
|
|
95
96
|
const reportDirectory = resolveSupervisorDiagnosticsPaths(config).crashReportDirectory;
|
|
96
97
|
prepareCrashReportDirectory(reportDirectory);
|
|
98
|
+
const environmentRefresh = refreshedSystemEnvironment();
|
|
97
99
|
const child = spawn(process.execPath, [
|
|
98
100
|
...nodeDiagnosticReportArguments(reportDirectory),
|
|
99
101
|
entry,
|
|
@@ -102,7 +104,10 @@ const defaultDependencies: ServerStarterDependencies = {
|
|
|
102
104
|
detached: true,
|
|
103
105
|
windowsHide: true,
|
|
104
106
|
stdio: "ignore",
|
|
105
|
-
env: {
|
|
107
|
+
env: {
|
|
108
|
+
...environmentRefresh.environment,
|
|
109
|
+
AGENT_BOT_RESTART_REASON: "通过 Agent Bot CLI 启动",
|
|
110
|
+
},
|
|
106
111
|
});
|
|
107
112
|
child.unref();
|
|
108
113
|
},
|
|
@@ -11,7 +11,16 @@ export type ControlRequest =
|
|
|
11
11
|
| { action: "task_status"; localSessionId: string }
|
|
12
12
|
| { action: "task_stop"; localSessionId: string }
|
|
13
13
|
| { action: "task_title"; localSessionId: string; title: string }
|
|
14
|
-
| { action: "task_prompt"; localSessionId: string; text: string }
|
|
14
|
+
| { action: "task_prompt"; localSessionId: string; text: string }
|
|
15
|
+
| {
|
|
16
|
+
action: "task_new_group";
|
|
17
|
+
localSessionId: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
cwd?: string;
|
|
20
|
+
agentName?: string;
|
|
21
|
+
projectless?: boolean;
|
|
22
|
+
}
|
|
23
|
+
| { action: "task_fork_group"; localSessionId: string; title?: string };
|
|
15
24
|
|
|
16
25
|
export interface ControlResponse {
|
|
17
26
|
ok: boolean;
|
|
@@ -25,6 +34,17 @@ export interface TaskStatusControlData {
|
|
|
25
34
|
remote?: RemoteSessionSummary;
|
|
26
35
|
}
|
|
27
36
|
|
|
37
|
+
export interface TaskGroupControlData {
|
|
38
|
+
sourceLocalSessionId: string;
|
|
39
|
+
sourceTurnId?: string;
|
|
40
|
+
group: {
|
|
41
|
+
chatId: string;
|
|
42
|
+
contextKey: string;
|
|
43
|
+
name: string;
|
|
44
|
+
};
|
|
45
|
+
task: SessionRecord;
|
|
46
|
+
}
|
|
47
|
+
|
|
28
48
|
export function controlEndpoint(sqlitePath: string): string {
|
|
29
49
|
const resolvedPath = path.resolve(sqlitePath);
|
|
30
50
|
const key = createHash("sha256").update(resolvedPath.toLowerCase()).digest("hex").slice(0, 16);
|
package/src/cli/help.ts
CHANGED
|
@@ -6,7 +6,7 @@ export function renderCliHelp(version: string, language: CliLanguage = cliLangua
|
|
|
6
6
|
通过飞书使用本地 Codex 和 ACP Agent。
|
|
7
7
|
|
|
8
8
|
用法:
|
|
9
|
-
|
|
9
|
+
agentbot [选项] <命令>
|
|
10
10
|
|
|
11
11
|
常用命令:
|
|
12
12
|
init 初始化飞书应用并启动服务
|
|
@@ -20,6 +20,8 @@ export function renderCliHelp(version: string, language: CliLanguage = cliLangua
|
|
|
20
20
|
task status <任务> 显示任务状态
|
|
21
21
|
task chat <任务> 显示任务绑定的飞书会话
|
|
22
22
|
task prompt <任务> <提示词> 向任务发送提示词
|
|
23
|
+
task newgroup <任务> [标题] 创建新群;支持 --agent、--dir、--nodir
|
|
24
|
+
task forkgroup <任务> [标题] 从任务 Fork 新群
|
|
23
25
|
task stop <任务> 停止任务
|
|
24
26
|
task title <任务> <标题> 重命名任务
|
|
25
27
|
skills status 显示内置 Skill 状态
|
|
@@ -38,13 +40,13 @@ export function renderCliHelp(version: string, language: CliLanguage = cliLangua
|
|
|
38
40
|
--reconfigure-feishu 仅替换现有飞书凭据
|
|
39
41
|
|
|
40
42
|
示例:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
agentbot init
|
|
44
|
+
agentbot --profile ~/.agent-bot init --reset
|
|
45
|
+
agentbot --profile ~/.agent-bot-rescue init
|
|
46
|
+
agentbot server start
|
|
47
|
+
agentbot server status
|
|
48
|
+
agentbot task list
|
|
49
|
+
agentbot server restart --reason "更新 Agent Bot"
|
|
48
50
|
`;
|
|
49
51
|
}
|
|
50
52
|
|
|
@@ -52,7 +54,7 @@ export function renderCliHelp(version: string, language: CliLanguage = cliLangua
|
|
|
52
54
|
Use local Codex and ACP agents from Lark/Feishu.
|
|
53
55
|
|
|
54
56
|
Usage:
|
|
55
|
-
|
|
57
|
+
agentbot [options] <command>
|
|
56
58
|
|
|
57
59
|
Common commands:
|
|
58
60
|
init Initialize the Lark app and start the service
|
|
@@ -66,6 +68,8 @@ Common commands:
|
|
|
66
68
|
task status <task> Show task status
|
|
67
69
|
task chat <task> Show the task's Lark chat binding
|
|
68
70
|
task prompt <task> <prompt> Send a Prompt to a task
|
|
71
|
+
task newgroup <task> [title] Create a group; supports --agent, --dir, --nodir
|
|
72
|
+
task forkgroup <task> [title] Fork a task into a new group
|
|
69
73
|
task stop <task> Stop a task
|
|
70
74
|
task title <task> <title> Rename a task
|
|
71
75
|
skills status Show the built-in Skill status
|
|
@@ -84,12 +88,12 @@ Init options:
|
|
|
84
88
|
--reconfigure-feishu Replace only the existing Lark credentials
|
|
85
89
|
|
|
86
90
|
Examples:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
agentbot init
|
|
92
|
+
agentbot --profile ~/.agent-bot init --reset
|
|
93
|
+
agentbot --profile ~/.agent-bot-rescue init
|
|
94
|
+
agentbot server start
|
|
95
|
+
agentbot server status
|
|
96
|
+
agentbot task list
|
|
97
|
+
agentbot server restart --reason "Update Agent Bot"
|
|
94
98
|
`;
|
|
95
99
|
}
|