@keyou007/agent-bot 0.1.24-alpha.4 → 0.1.24-alpha.6
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/CHANGELOG.md +59 -0
- package/README.md +42 -6
- package/README.zh.md +42 -6
- package/SECURITY.md +12 -0
- package/config.example.yaml +5 -0
- package/dist/cli/controlProtocol.js.map +1 -1
- package/dist/cli/serverStatus.js +1 -0
- package/dist/cli/serverStatus.js.map +1 -1
- package/dist/cli.js +6 -1
- package/dist/cli.js.map +1 -1
- package/dist/codex/AppServerPermissions.js +34 -0
- package/dist/codex/AppServerPermissions.js.map +1 -0
- package/dist/codex/CodexLocalActivityDetector.js +37 -5
- package/dist/codex/CodexLocalActivityDetector.js.map +1 -1
- package/dist/codex/CodexRuntime.js +238 -127
- package/dist/codex/CodexRuntime.js.map +1 -1
- package/dist/codex/ProviderSwitch.js +12 -13
- package/dist/codex/ProviderSwitch.js.map +1 -1
- package/dist/codex/ThreadWriterProcess.js +19 -5
- package/dist/codex/ThreadWriterProcess.js.map +1 -1
- package/dist/config/AgentExecutionDefaultsStore.js +4 -0
- package/dist/config/AgentExecutionDefaultsStore.js.map +1 -1
- package/dist/config/loadConfig.js +4 -0
- package/dist/config/loadConfig.js.map +1 -1
- package/dist/config/schema.js +3 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/feishu/CardRenderer.js +146 -72
- package/dist/feishu/CardRenderer.js.map +1 -1
- package/dist/feishu/FeishuConnector.js +1 -0
- package/dist/feishu/FeishuConnector.js.map +1 -1
- package/dist/feishu/FeishuTurnPresenter.js +121 -17
- package/dist/feishu/FeishuTurnPresenter.js.map +1 -1
- package/dist/index.js +43 -6
- package/dist/index.js.map +1 -1
- package/dist/local-files/CsvPreview.js +148 -0
- package/dist/local-files/CsvPreview.js.map +1 -0
- package/dist/local-files/LocalFileViewerServer.js +104 -14
- package/dist/local-files/LocalFileViewerServer.js.map +1 -1
- package/dist/local-files/TurnPreviewPage.js +128 -12
- package/dist/local-files/TurnPreviewPage.js.map +1 -1
- package/dist/presentation/TurnStateReducer.js +80 -6
- package/dist/presentation/TurnStateReducer.js.map +1 -1
- package/dist/proxy/ProxySessionController.js +767 -260
- package/dist/proxy/ProxySessionController.js.map +1 -1
- package/dist/proxy/SessionOperationQueue.js +14 -0
- package/dist/proxy/SessionOperationQueue.js.map +1 -0
- package/dist/runtime/AcpRuntimeAdapter.js +4 -2
- package/dist/runtime/AcpRuntimeAdapter.js.map +1 -1
- package/dist/state/StateStore.js +22 -0
- package/dist/state/StateStore.js.map +1 -1
- package/dist/state/TurnPreviewJournal.js +19 -7
- package/dist/state/TurnPreviewJournal.js.map +1 -1
- package/dist/state/migrations.js +6 -0
- package/dist/state/migrations.js.map +1 -1
- package/dist/supervision/SafeRestartNotifier.js +1 -0
- package/dist/supervision/SafeRestartNotifier.js.map +1 -1
- package/dist/supervision/SafeRestartScheduler.js +19 -6
- package/dist/supervision/SafeRestartScheduler.js.map +1 -1
- package/dist/terminal/TerminalCards.js +13 -0
- package/dist/terminal/TerminalCards.js.map +1 -0
- package/dist/terminal/TerminalLinks.js +76 -0
- package/dist/terminal/TerminalLinks.js.map +1 -0
- package/dist/terminal/TerminalPage.js +212 -0
- package/dist/terminal/TerminalPage.js.map +1 -0
- package/dist/terminal/TerminalProcess.js +71 -0
- package/dist/terminal/TerminalProcess.js.map +1 -0
- package/dist/terminal/TerminalServer.js +639 -0
- package/dist/terminal/TerminalServer.js.map +1 -0
- package/docs/technical-reference.md +53 -3
- package/docs/technical-reference.zh.md +52 -2
- package/npm-shrinkwrap.json +55 -5
- package/package.json +11 -4
- package/skills/agent-bot/SKILL.md +15 -2
- package/src/cli/controlProtocol.ts +2 -1
- package/src/cli/serverStatus.ts +1 -0
- package/src/cli.ts +6 -1
- package/src/codex/AppServerPermissions.ts +39 -0
- package/src/codex/CodexLocalActivityDetector.ts +34 -4
- package/src/codex/CodexRuntime.ts +243 -139
- package/src/codex/ProviderSwitch.ts +11 -12
- package/src/codex/ThreadWriterProcess.ts +17 -9
- package/src/config/AgentExecutionDefaultsStore.ts +2 -0
- package/src/config/loadConfig.ts +4 -0
- package/src/config/schema.ts +5 -1
- package/src/feishu/CardRenderer.ts +159 -72
- package/src/feishu/FeishuConnector.ts +1 -0
- package/src/feishu/FeishuTurnPresenter.ts +108 -16
- package/src/feishu/types.ts +1 -0
- package/src/index.ts +44 -7
- package/src/local-files/CsvPreview.ts +132 -0
- package/src/local-files/LocalFileViewerServer.ts +102 -15
- package/src/local-files/TurnPreviewPage.ts +131 -13
- package/src/presentation/TurnStateReducer.ts +87 -7
- package/src/presentation/turnViewTypes.ts +9 -0
- package/src/proxy/ProxySessionController.ts +762 -259
- package/src/proxy/SessionOperationQueue.ts +13 -0
- package/src/runtime/AcpRuntimeAdapter.ts +5 -3
- package/src/runtime/types.ts +10 -3
- package/src/state/StateStore.ts +38 -1
- package/src/state/TurnPreviewJournal.ts +19 -7
- package/src/state/migrations.ts +6 -0
- package/src/supervision/SafeRestartNotifier.ts +1 -0
- package/src/supervision/SafeRestartScheduler.ts +18 -6
- package/src/terminal/TerminalCards.ts +18 -0
- package/src/terminal/TerminalLinks.ts +61 -0
- package/src/terminal/TerminalPage.ts +213 -0
- package/src/terminal/TerminalProcess.ts +71 -0
- package/src/terminal/TerminalServer.ts +513 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,65 @@ The project follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.24-alpha.6] - 2026-10-12
|
|
10
|
+
|
|
11
|
+
### 中文
|
|
12
|
+
|
|
13
|
+
- 修复 node-pty 预编译包缺少执行权限导致的 macOS 终端启动失败;限制 Windows CI 测试并发,避免磁盘争用引起的超时。
|
|
14
|
+
- 命令卡片新增独立网页终端,支持连续输入、ANSI 颜色、调整尺寸、复制粘贴与断线重连。终端与 Preview 共用地址,在原会话/话题核对验证码并由所有者授权,以主机用户权限运行,不重放原命令;原始 HTML/SVG/XML 保持沙箱隔离。
|
|
15
|
+
- 终端管理卡支持打开、恢复、关闭和刷新;使用稳定的 8 位链接标识,丢失页面后可重新授权恢复原 Shell。支持手机授权后自动恢复连接,避免历史回放产生多余输入。断开三分钟、后台无输入输出三十分钟或总时长八小时后回收;安全重启等待活动终端关闭。
|
|
16
|
+
- 支持运行中预选 Provider 和模型,本轮结束后应用最后选择,待生效设置跨重启保留。切换始终保留任务 ID 和完整历史,不隐式 Fork 或替换空任务;切换失败验证回退,无法确认恢复时暂停后续消息并明确提示。设置入口不再被故障的旧 Provider 阻塞,修复默认配置并发保存、恢复/重连校验及认证失败误重试。
|
|
17
|
+
- 模型卡片每页最多显示 20 个模型,支持原卡片翻页,默认定位当前模型;翻页不改变任务设置,并校验 Provider 是否已切换。
|
|
18
|
+
- 修复转发消息附言被拆成追加消息、主 Prompt 错用转发内容的问题;附言作为主 Prompt,转发内容和附件保留为参考,避免慢 Reaction 拆散已关联消息。
|
|
19
|
+
- 修复新建空任务无法归档或解散群的问题:仅对确认未生成历史的任务安全释放,不读取完整历史或发送虚构消息,保留活动任务和历史保护。
|
|
20
|
+
- 修复 TraeX 批准方案后未继续执行的问题:在原任务、话题和思考卡片中衔接执行,保留审批记录、Reaction 与消息队列;Preview 使用同一追加日志和 SSE 连续更新,处理通知乱序、重复、取消及启动失败。
|
|
21
|
+
- TraeX 规划确认遵循任务权限:auto 自动同意,confirm 保留手动按钮。思考卡片和 Preview 保留自动审批记录;自动回复失败时提示并恢复手动确认,仍遵守用户仅讨论或禁止实施的明确要求。
|
|
22
|
+
|
|
23
|
+
### English
|
|
24
|
+
|
|
25
|
+
- Restore missing executable permissions on node-pty's macOS helper before opening a terminal; limit Windows CI test concurrency to avoid disk-contention timeouts.
|
|
26
|
+
- Add independent browser terminals to command cards, with continuous input, ANSI colors, resizing, clipboard support and reconnects. Share Preview addressing, require owner approval of a matching code in the original conversation/topic, and run as the host user without replaying the original command. Keep raw HTML/SVG/XML documents sandboxed.
|
|
27
|
+
- Add terminal management cards for opening, recovering, closing and refreshing the same Shell through stable eight-character links and fresh recovery approval. Recover after mobile authorization and network interruptions without replay-generated input. Reclaim terminals after three disconnected minutes, thirty minutes of background I/O inactivity, or eight hours total; safe restart waits for active terminals.
|
|
28
|
+
- Stage Provider/model choices during active turns and apply the latest selection afterward, preserving pending settings across restarts. Keep task IDs and complete history without implicit forks or empty-thread replacement. Verify rollback on failure and pause further messages if recovery cannot be confirmed. Keep settings accessible with a broken old Provider; fix concurrent defaults persistence, resume/reconnect verification and retries of permanent authentication failures.
|
|
29
|
+
- Paginate model cards at twenty models per page, opening on the current model. Update the existing card without changing task settings and guard against Provider changes while paging.
|
|
30
|
+
- Use the user's attached forwarding instruction as the main Prompt, retaining forwarded text and attachments as reference material. Prevent slow Reactions from splitting already-associated messages.
|
|
31
|
+
- Fix archive/Dismiss for new empty tasks by safely releasing only confirmed unmaterialized tasks, without full-history reads or synthetic messages, while retaining activity and history safeguards.
|
|
32
|
+
- Continue TraeX execution after plan approval in the original task, topic and progress card. Preserve approval history, reactions and queues; keep Preview live through one append-only journal and SSE, handling out-of-order notifications, duplicates, cancellation and startup failures.
|
|
33
|
+
- Honor task permissions for TraeX plan confirmations: auto accepts automatically and confirm retains manual controls. Record automatic decisions in the card and Preview, fall back to manual confirmation if the response fails, and continue respecting explicit discussion-only or no-implementation instructions.
|
|
34
|
+
|
|
35
|
+
## [0.1.24-alpha.5] - 2026-09-24
|
|
36
|
+
|
|
37
|
+
### 中文
|
|
38
|
+
|
|
39
|
+
- 修复权限切换未同步沙箱策略的问题:下一轮同时应用审批与沙箱设置,无需重启 Agent、Fork 或新建任务,并保留工作区沙箱配置。
|
|
40
|
+
- 修复崩溃后任务持续显示运行中的问题:核实存活写入进程,限制未确认恢复的重试时间,提示写锁冲突,不中断其他客户端任务。
|
|
41
|
+
- Session 列表为运行中任务提供独立 Stop 按钮,发送正常停止信号,保留任务绑定、搜索条件和分页。
|
|
42
|
+
- 支持 CSV 只读表格预览,支持引号内逗号与换行、空单元格,并对超大文件和格式错误给出提示。
|
|
43
|
+
- Markdown 文件预览支持 Mermaid/流程图,提供预览、源码及原大、适应切换,实时更新保留图表状态。
|
|
44
|
+
- Turn Preview 最终回答旁新增下载和复制图标,以原始 Markdown 格式导出,支持局域网 HTTP 页面的复制回退。
|
|
45
|
+
- 简化命令授权卡片:先显示原因,命令默认折叠,过长内容可在 Preview 查看完整原文;授权操作保持不变。
|
|
46
|
+
- Turn Preview 顶部显示上下文大小及按有效 Token 用量更新次数统计的模型调用次数,上下文位于模型调用前面,不再显示压缩统计;支持局部实时更新,不额外读取历史。
|
|
47
|
+
|
|
48
|
+
### English
|
|
49
|
+
|
|
50
|
+
- Apply both approval and sandbox policies on every App Server Turn start so permission switches take effect on the next Turn without an Agent restart or task replacement. Preserve workspace sandbox options and fail closed when configuration or policy validation fails.
|
|
51
|
+
|
|
52
|
+
- Show per-turn model call counts in Turn Preview headers using effective token-usage updates, with duplicate/regression filtering, cached-usage support, persisted baselines, and live metadata-only updates. Keep Feishu cards unchanged and avoid additional Agent history reads.
|
|
53
|
+
|
|
54
|
+
- Make command approval cards compact: show a short heading and the reason before a collapsed command, avoid repeated command titles, and provide the full original command in read-only Turn Preview. Keep all approval decisions and callbacks unchanged.
|
|
55
|
+
|
|
56
|
+
- Support Mermaid/flowchart diagrams in Markdown file previews using Turn Preview's local renderer, Preview/Source and Actual size/Fit controls, safe source fallback, and preserved diagram state across live file updates.
|
|
57
|
+
|
|
58
|
+
- Add download/copy icon buttons beside Turn Preview's final answer to export original UTF-8 Markdown, with clipboard fallback for HTTP/LAN pages, accessible feedback, and support for live-arriving and historical answers.
|
|
59
|
+
|
|
60
|
+
- Add a direct Stop button to running task details in `/sessions`, including the current task, other Agent Bot tasks, and external tasks. Send the normal interrupt without changing task bindings, preserve search/pagination, and keep running status until the Agent reports completion. Hide unavailable Archive actions while running to keep ten-task cards within Feishu limits.
|
|
61
|
+
|
|
62
|
+
- Preview CSV files as read-only, scrollable tables with row/column labels, safe quoted-field parsing, existing text-encoding support, bounded rendering, code/raw/download access, and preserved scroll positions on live updates.
|
|
63
|
+
|
|
64
|
+
- Fix crash recovery leaving stale tasks running: verify live Codex writers, confirm resume before replacing progress cards, report writer conflicts, and bound unconfirmed recovery retries without interrupting external or already-confirmed live work.
|
|
65
|
+
|
|
66
|
+
- Show the latest reported context token count immediately before model calls in Turn Preview headers, with live incremental updates and exact counts on hover; hide compaction statistics and leave missing context values hidden.
|
|
67
|
+
|
|
9
68
|
## [0.1.24-alpha.4] - 2026-09-23
|
|
10
69
|
|
|
11
70
|
### 中文
|
package/README.md
CHANGED
|
@@ -292,7 +292,7 @@ Only groups explicitly enabled with `/mute` or `/mute on` supplement ordinary @-
|
|
|
292
292
|
|
|
293
293
|
`/file` accepts relative paths, absolute paths, and paths beginning with `~`; relative paths resolve from the current task directory.
|
|
294
294
|
|
|
295
|
-
`/fork` and `/forkgroup` branch from completed work without interrupting a running turn. `/sessions` manages tasks across projects and Providers in pages of up to 10 tasks; switching Provider does not hide a task from the list or search. Use each project menu for `New` and `NewGroup`. Each task’s `SwitchGroup` action creates a new group bound to that same task, preserving its history, title, and execution settings without creating or forking an Agent task. The original conversation stays unchanged. An Agent Bot Turn already in progress keeps replying to its original conversation; new messages from the new group queue until it finishes. Tasks running in an external client cannot be switched until they finish. Expanding a task directly shows the first 50 characters of its latest user Prompt, its update time, and task-specific actions. Use `Turns` to view that task’s history without switching tasks, including tasks not yet bound to Agent Bot; non-current tasks are read-only until you switch to them. `/turns` restores conversation context without reverting local files.
|
|
295
|
+
`/fork` and `/forkgroup` branch from completed work without interrupting a running turn. `/sessions` manages tasks across projects and Providers in pages of up to 10 tasks; switching Provider does not hide a task from the list or search. Use each project menu for `New` and `NewGroup`. Each task’s `SwitchGroup` action creates a new group bound to that same task, preserving its history, title, and execution settings without creating or forking an Agent task. The original conversation stays unchanged. An Agent Bot Turn already in progress keeps replying to its original conversation; new messages from the new group queue until it finishes. Tasks running in an external client cannot be switched until they finish. Expanding a task directly shows the first 50 characters of its latest user Prompt, its update time, and task-specific actions. Running tasks also show a direct `Stop` button, including the current task and tasks running in other conversations or external clients. It sends the normal Agent interrupt without switching tasks or killing processes. The list refresh preserves search and pagination and keeps Stop available until the Agent reports the task idle; Archive is available only when idle. Use `Turns` to view that task’s history without switching tasks, including tasks not yet bound to Agent Bot; non-current tasks are read-only until you switch to them. `/turns` restores conversation context without reverting local files.
|
|
296
296
|
|
|
297
297
|
`/turn` and `/turns` are equivalent. Without an argument they open the history card; `/turn 3` uses its one-based, newest-first index (including a running Turn at the top), and `/turn <Turn ID>` selects a Turn in the current task's history. Viewing details does not Reset, resume, stop, or switch tasks. Saved IDs are read directly; missing history is located through summary pages, stopping at the requested index or the page containing the ID. Fork lookups stay within inherited history. Details show the saved Prompt, status, timing, activities, and results, with Preview when configured; summary-only external Turns cannot show tool activity that Agent Bot never recorded.
|
|
298
298
|
|
|
@@ -302,6 +302,8 @@ Ordinary tasks also load history as summary pages on demand. Task lists read onl
|
|
|
302
302
|
|
|
303
303
|
Turn history uses fixed-width graph lanes with separate sequence numbers, keeping nodes and branch connectors aligned without adding blank continuation rows.
|
|
304
304
|
|
|
305
|
+
Model cards show at most 20 models per page. Larger lists have Previous/Next controls that update the same card without changing task settings. Opening the Model tab starts on the current model's page; Provider configuration model lists use the same pagination.
|
|
306
|
+
|
|
305
307
|
## Local Commands
|
|
306
308
|
|
|
307
309
|
Enter a message beginning with `!` directly in the Feishu chat box to run a local command in the current task directory.
|
|
@@ -309,6 +311,24 @@ Enter a message beginning with `!` directly in the Feishu chat box to run a loca
|
|
|
309
311
|
For example, `! ls` lists files in the current directory, and `! git status` shows the state of the current Git repository.
|
|
310
312
|
Local commands run in independent background processes without a time limit, so they do not block other messages or commands in the current conversation. The same output card refreshes while a command runs, preserves the observed order of normal and diagnostic output, and includes a `Cancel` action. Agent Bot resumes monitoring commands that are still running after a Worker restart. Long output keeps its beginning and end while the middle is truncated.
|
|
311
313
|
|
|
314
|
+
### Interactive browser terminal
|
|
315
|
+
|
|
316
|
+
With terminal text selected, **Ctrl+C** copies without interrupting the command; without a selection it still interrupts. **Ctrl+V** pastes through the browser's native clipboard events, including on HTTP deployments, and preserves xterm's newline and bracketed-paste handling. **Cmd+C / Cmd+V** remain available on macOS. The toolbar's **Ctrl+C** button always interrupts.
|
|
317
|
+
|
|
318
|
+
The **Terminal** field on authorization and management cards shows the 8-character token from that terminal's recovery URL (`/terminal/<token>`), preserving case. It stays the same across reconnects and fresh approvals; terminals created from the same command have different tokens. Internal IDs and authorization credentials remain separate.
|
|
319
|
+
|
|
320
|
+
Terminal authorization and recovery cards are sent to the original command conversation, staying inside the original topic when applicable, never redirected to the owner’s private chat. Only the configured owner may approve or manage them. After approval, the card becomes a **terminal management card**: before the first connection it offers **Open Terminal**; after the Shell starts it offers **Reopen Terminal**. Both identify the same terminal. A new tab requires fresh verification-code approval before the previous tab loses access; opening a lost, not-yet-connected terminal starts its Shell only after WebSocket authentication, while a running terminal reuses the same Shell. Close Terminal and Refresh remain available without the webpage. Running Shells can be recovered or closed while safe restart is pending; starting a not-yet-connected Shell is blocked. Ended terminals and terminals from before service restart cannot be recovered. Open Terminal on the original command card still creates a new terminal.
|
|
321
|
+
|
|
322
|
+
Refresh/reconnect restores terminal output without sending historical device-query responses back to the Shell, preventing stray input such as `?1;2c`. Initial startup and live queries still receive normal responses.
|
|
323
|
+
|
|
324
|
+
Returning from Feishu authorization or restoring network connectivity automatically resumes the existing session. Transient failures retry without revoking approval; Reconnect reuses the session instead of closing its Shell or sending another approval card. Explicit rejection/expiry stops recovery. Errors distinguish authorization polling, WebSocket connection and Shell startup.
|
|
325
|
+
|
|
326
|
+
Feishu `!` command cards offer **Open Terminal**. Use **Request Connection** in the welcome section or the top-right toolbar, then have the owner approve the matching six-digit code in the original command conversation/topic. This starts a **separate Shell in the card's working directory**: it never replays, attaches to, or stops the original command. Commands run as the Agent Bot host's OS user, not in the Agent sandbox.
|
|
327
|
+
|
|
328
|
+
xterm.js supports continuous input, ANSI colors, Ctrl+C, resize, and refresh/reconnect in the same browser tab. Windows uses ConPTY/PowerShell (preferring `pwsh`); macOS/Linux use a Unix PTY with the user's Shell. Input highlighting depends on the Shell and plugins such as PSReadLine. Up to three sessions may be open. Close Terminal ends the Shell immediately. Closing a tab starts a three-minute disconnect timeout; successfully reconnecting in time cancels it and restarts the thirty-minute idle timeout, but background output does not extend the disconnect deadline. A connected foreground page prevents idle closure. Hiding it starts the thirty-minute input/output idle timeout; input/output resets that timeout. Background idle and disconnect timeouts are independent: either can close the Shell. Sessions expire after eight hours total and do not survive Agent Bot restart. Detached background processes may outlive the Shell.
|
|
329
|
+
|
|
330
|
+
Terminal links share **the exact Preview protocol, host, port and base path**. Command and management-card links both use `/terminal/<8-character-token>`; the server selects new-shell or recovery behavior from the token. Tokens are URL-safe and case-sensitive references, not execution credentials. Command links remain valid after restart, while recovery links expire with their Shell. Only this terminal link format is supported. They reuse `fileViewer` network selection and `publicBaseUrl`; no separate terminal address or port is needed. HTTP Preview deployments also support terminals: use only trusted networks and configure HTTPS for untrusted/Internet access. Owner approval remains mandatory and Preview remains read-only. See [terminal configuration](docs/technical-reference.md#interactive-browser-terminal). Set `terminal.enabled: false` to disable; disabling Preview also disables terminals. Safe restart waits for active terminals and temporarily blocks new ones.
|
|
331
|
+
|
|
312
332
|
## Configuration And Data
|
|
313
333
|
|
|
314
334
|
Agent Bot keeps user-owned files outside the repository:
|
|
@@ -328,7 +348,7 @@ Relative file links in Feishu answers and thinking cards, such as `outputs/repor
|
|
|
328
348
|
|
|
329
349
|
`/status` cards also include **Preview** beside Refresh and Stop/Switch. It opens the active Turn, or the latest Turn when idle, and updates its target when you refresh the card. For external tasks not yet recorded by Agent Bot, opening Preview loads the selected Turn from the Agent and caches its full execution details. Read failures can be retried by refreshing the page. The button is hidden if there is no Turn, no supported history reader, or the file viewer is unavailable. Viewing another task’s status does not switch or take over that task.
|
|
330
350
|
|
|
331
|
-
Progress cards include a `Preview` button that opens the saved Turn timeline in a compact, mobile-friendly browser view. Reasoning panels use the content title as their collapsed header and show the text directly on expansion. Tool blocks have a single collapse level and start collapsed with a meaningful one-line command summary, a compact duration (`58s` or `2:32`), and completion status. Expanding a block shows the full command prefixed by `$`, followed directly by its results, images, and changed files. Identical output/error logs appear once. Running Turns update live by patching changed sections in place, preserving expanded or collapsed steps, scroll positions, and unchanged image elements instead of reloading them. Token and other metadata updates do not replace the timeline. Collapsed tool steps and the file-change summary initially contain only their headers; commands, logs, images, and file lists are fetched on expansion. Reopening reuses loaded content, and live updates refresh only expanded details whose content changed. Failed loads offer Retry. Finished Turns do not open a live SSE connection. The waiting-for-progress placeholder is hidden once a response or other visible progress is available, and is never shown for finished Turns. Click a file in the file changes or tool file list to preview its current contents in a new tab; deleted or unavailable files remain plain text. Turn previews use the same signed viewer address and access rules as local file links.
|
|
351
|
+
Progress cards include a `Preview` button that opens the saved Turn timeline in a compact, mobile-friendly browser view. Reasoning panels use the content title as their collapsed header and show the text directly on expansion. Tool blocks have a single collapse level and start collapsed with a meaningful one-line command summary, a compact duration (`58s` or `2:32`), and completion status. Expanding a block shows the full command prefixed by `$`, followed directly by its results, images, and changed files. Identical output/error logs appear once. Running Turns update live by patching changed sections in place, preserving expanded or collapsed steps, scroll positions, and unchanged image elements instead of reloading them. Token and other metadata updates do not replace the timeline. Collapsed tool steps and the file-change summary initially contain only their headers; commands, logs, images, and file lists are fetched on expansion. Reopening reuses loaded content, and live updates refresh only expanded details whose content changed. Failed loads offer Retry. Finished Turns do not open a live SSE connection. The waiting-for-progress placeholder is hidden once a response or other visible progress is available, and is never shown for finished Turns. Click a file in the file changes or tool file list to preview its current contents in a new tab; deleted or unavailable files remain plain text. Turn previews use the same signed viewer address and access rules as local file links. Beside Final answer, download and copy icons export the original Markdown (including formatting, code blocks, and unchanged link targets), not the rendered HTML. Download saves a UTF-8 `.md` file; Copy uses the clipboard with a fallback for HTTP/LAN previews and shows success or failure feedback. Both work on completed pages and when the final answer arrives live.
|
|
332
352
|
|
|
333
353
|
Opening `/turn <ID or index>` or Preview for an imported summary loads that Turn's execution details from its original Agent session and caches the result. Only summary pages and the selected Turn's full record are requested, never the entire full history; source tasks are not resumed or interrupted. Read failures show their reason separately from the Turn's execution status; reopen the details or refresh Preview to retry. Existing detailed snapshots remain unchanged, and unavailable historical timing or token data is not estimated.
|
|
334
354
|
|
|
@@ -336,7 +356,7 @@ Turn Preview highlights fenced code blocks in common languages such as JavaScrip
|
|
|
336
356
|
|
|
337
357
|
Turn Preview retains complete recorded execution content without repeatedly saving the whole Turn to the database. Live previews update incrementally; collapsed tools load their full details when opened. Back up the entire Profile data directory to keep execution records as well as task metadata. Existing saved history remains readable.
|
|
338
358
|
|
|
339
|
-
Mermaid diagrams in Turn Preview have **Preview / Source** controls and default to Preview. Use a `mermaid` fenced code block with `flowchart` or `graph` syntax (`flowchart` fences are also accepted). Your mode selection survives live updates; invalid or incomplete diagrams fall back to source. Rendering runs locally in your browser, without sending diagram content to an external service. Diagrams scale down to the available width by default without enlarging small diagrams. On phones, the preview is capped at roughly half the screen height; scroll vertically for long flows. Use **Actual size / Fit** to inspect details or return to the fitted view. Live updates preserve this choice.
|
|
359
|
+
Mermaid diagrams in Turn Preview and Markdown file previews have **Preview / Source** controls and default to Preview. Use a `mermaid` fenced code block with `flowchart` or `graph` syntax (`flowchart` fences are also accepted). Your mode selection survives live updates; invalid or incomplete diagrams fall back to source. Rendering runs locally in your browser, without sending diagram content to an external service. Diagrams scale down to the available width by default without enlarging small diagrams. On phones, the preview is capped at roughly half the screen height; scroll vertically for long flows. Use **Actual size / Fit** to inspect details or return to the fitted view. Live updates preserve this choice.
|
|
340
360
|
|
|
341
361
|
The compact Turn Preview header uses dot-separated values, keeps the duration label, and abbreviates token counts with K, M, and B units. It wraps to fit narrow screens. Prompt, Commentary, and result text use a regular weight and a slightly larger font than tool calls. Tool commands and outputs preserve line breaks and indentation; long lines scroll horizontally within the tool block without wrapping. Commands and results share one scroll area capped at 30 lines in height. The page reserves space for classic vertical scrollbars so expanding or collapsing tools does not shift the header or timeline horizontally. Thin, subtle scrollbars have no arrow buttons. On desktop they appear on hover or keyboard focus; on touch devices they are hidden while gesture scrolling remains available.
|
|
342
362
|
|
|
@@ -346,7 +366,9 @@ When an App Server reports only `Read` or `Grep` as the command, available actio
|
|
|
346
366
|
|
|
347
367
|
Tool titles start with the same status icons as the thinking card: an hourglass while running, a check mark on success, or a cross on failure. Running blocks have an accent border. Header summaries omit shell line-continuation markers while preserving file paths and the full expanded command. Durations remain hidden at zero seconds. The expanded footer shows the execution status, start time, duration, and result character count outside the scroll area; running durations update live in both the header and footer.
|
|
348
368
|
|
|
349
|
-
|
|
369
|
+
Command approval cards use a short heading and show the reason first, with the command in a collapsed panel instead of repeating it as a long bold title. The summary omits recognized shell wrappers, but the expanded command retains them. Oversized commands and reasons show an explicit truncation notice; check the complete original command in Turn Preview before authorizing. The four approval actions and their permission scope are unchanged. Preview remains read-only and preserves command expansion and scroll position during live updates.
|
|
370
|
+
|
|
371
|
+
TraeX plan-mode confirmations follow the task permission setting: **auto** automatically approves entering Plan mode and approving the plan, while **confirm** shows the plan with `Approve Plan` (or `Enter Plan Mode`), `Reject`, and `Cancel Request` actions. Requests and decisions remain in the card history and live Preview; automatic decisions are labeled as automatic, not as a user click. Approval continues implementation in the same task and on the same progress card when TraeX ends its planning turn. Explicit user instructions to discuss or plan only still apply. If automatic confirmation fails, the card reports it and offers manual confirmation. Preview remains read-only. Cancelling a confirmation is not the same as stopping the task, and waiting turns still block safe restart. Notifications missed by an older running version are not automatically replayed.
|
|
350
372
|
|
|
351
373
|
Local images in Turn Preview Prompts, Commentary, and results load through signed file URLs, including live updates. Relative image paths resolve from the task's project directory.
|
|
352
374
|
|
|
@@ -354,8 +376,12 @@ Attached images from initial and appended user messages are saved with the Turn
|
|
|
354
376
|
|
|
355
377
|
The Turn Preview header shows **Processing** during both normal processing and tool execution; tool details and other status labels are unchanged.
|
|
356
378
|
|
|
379
|
+
The header hides compaction statistics and shows **Context** in tokens immediately before **Model calls** (before the tool count when model calls are unavailable) using the Agent's latest reported context size for that Turn, not cumulative token consumption or the model's capacity. It updates in place, including decreases after compaction when reported; hover for the exact count. Historical Turns show their saved value. Missing or invalid values stay hidden, without estimating from other token counts or fetching history.
|
|
380
|
+
|
|
357
381
|
Turn Preview shows the Provider before the model recorded for each Turn, without a visible Provider prefix. Changing settings affects subsequent Turns, not the running Turn or earlier Turns. Older snapshots without a recorded Provider leave it hidden rather than using the task's current settings.
|
|
358
382
|
|
|
383
|
+
The header also shows **Model calls** for the Turn, counting effective token-usage updates: the first positive usage report counts once, and subsequent cumulative increases count once each. Total tokens including cache take precedence, with non-cached usage as a fallback. Duplicate, regressing, invalid, and context-only updates do not add calls. Counts update in place and persist across restarts; Feishu thinking cards are unchanged. Saved Preview events can reconstruct the count during normal replay, but incomplete old snapshots or Agents without usage reports leave it hidden; no additional Agent history or rollout scan is performed.
|
|
384
|
+
|
|
359
385
|
When reported by the Agent, Turn Preview shows this Turn's total tokens (input plus output, including cached input) alongside the existing non-cached count. The separate cache-hit token count is hidden; underlying token accounting is unchanged. Values update live, use compact units, and show exact counts on hover. Duplicate usage notifications are not counted twice. Missing breakdowns and older snapshots are not estimated or backfilled from task history; Feishu card token counts keep their existing calculation.
|
|
360
386
|
|
|
361
387
|
Markdown previews keep table cells at their content width. Wide tables scroll horizontally within the preview instead of squeezing columns on narrow screens, and live updates preserve each table's horizontal scroll position.
|
|
@@ -364,11 +390,15 @@ Local links in rendered Markdown open signed viewer pages for the referenced fil
|
|
|
364
390
|
|
|
365
391
|
HTML files (`.html` and `.htm`) open in preview mode with a code toggle, line anchors, and live updates. Self-contained HTML can use inline styles, inline scripts, and embedded media inside an isolated frame. External resources, relative local assets, network requests, forms, and access to the outer viewer are not enabled. The rendered document is complete; only the code view is limited to the first 2 MiB.
|
|
366
392
|
|
|
393
|
+
CSV files (`.csv`, case-insensitive) open as read-only tables with row numbers, column letters, sticky labels, and horizontal/vertical scrolling. The first row remains data, not an inferred header. Standard comma-separated fields support quoted commas, escaped quotes, embedded newlines, empty cells, and UTF-8/UTF-16 BOM or GB18030 text decoding; numeric strings and formulas remain plain text. Preview reads at most the first 2 MiB and displays up to 500 records, 50 columns, and 4,000 characters per cell, with explicit truncation or malformed-quote notices. Incomplete records at the byte boundary are omitted. The code view displays up to 2,000 physical lines; raw/download links preserve the entire original file. Live updates retain the selected view and table scroll position.
|
|
394
|
+
|
|
367
395
|
Provider, model, reasoning effort, and permission choices apply to the current task and are also saved under that Agent's `defaults`. If an older configuration has no `defaults` section for that Agent, it is created automatically on the first change. Future tasks that have no same-Agent settings to inherit start with those saved defaults; each configured Agent keeps its own values.
|
|
368
396
|
|
|
397
|
+
For App Server tasks, permission changes apply both approval and sandbox policies on the next Turn: `auto` uses no sandbox and no approval prompts; `confirm` uses the workspace-write sandbox and on-request approval. Choose the mode in `/permissions`, or use `agentbot task permissions auto|confirm`. Switching requires no Agent restart, fork, or new task and does not change already-running tool processes or steering requests. Workspace writable roots, network access, and temporary-directory exclusions retain the Agent's configured values.
|
|
398
|
+
|
|
369
399
|
The execution settings card ends with a one-sentence Markdown blockquote for the selected tab's scope and timing. Agent selection changes only the default for new tasks in that conversation, without migrating the current task. Model, reasoning, and permission changes apply from the next turn. Agent and Provider options show their identifiers without duplicate display names, while retaining current/default indicators. `/provider` opens this card even when only one Provider is available, keeping the Model, Thinking, and Permission tabs accessible.
|
|
370
400
|
|
|
371
|
-
Provider changes
|
|
401
|
+
Provider changes requested during an Agent Bot turn are saved as pending without interrupting it. The settings card immediately shows the target Provider and the model that will be used; the Model tab lists that Provider’s models, and later selections replace the pending choice. Thinking and permission changes made while a Provider switch is pending are staged with it. The switch is applied after the current turn ends, before a queued, retried, or new turn starts; idle tasks switch immediately. Pending settings survive restarts and do not overwrite active settings or Agent defaults until applied. If a deferred switch fails, Agent Bot restores the previous Provider and model. After verified rollback, the card returns to the original settings with an error notice, clears the pending choice, and queued/new turns continue using the original settings. Only failed or unverified rollback pauses further turns and keeps queued prompts for manual recovery. For a custom Provider, Agent Bot uses its OpenAI-compatible `/models` endpoint when available and shows only that Provider's models. A switch keeps the previous model when the target supports it, otherwise selects the target's default model or its first returned model. Providers without a model-list endpoint remain usable: Agent Bot keeps the current or configured model as the single fallback candidate and lets Codex apply it. Agent Bot releases its subscription only to the selected idle thread, resumes that same thread with the resolved Provider and model, and verifies the ID and both settings before saving or reporting success. Unsubscribing does not itself prove that App Server unloaded the thread. Settings changes always preserve the remote thread ID and all history, including failed and interrupted Turns. They never start, fork, truncate, or replace a thread. A pristine thread without a saved rollout is refused before detaching rather than silently replaced. If a switch fails, the previous settings are retained and remote recovery is attempted. If recovery also fails, further turns are blocked until a Provider switch succeeds.
|
|
372
402
|
|
|
373
403
|
For TraeX's built-in `trae` Provider, Agent Bot uses the complete native `model/list` catalog, including model names and reasoning options, without requiring a custom Provider `base_url`. Other custom Providers keep their own model discovery and fallback behavior.
|
|
374
404
|
|
|
@@ -378,7 +408,7 @@ Some Responses-compatible Providers omit assistant message phases. Their text st
|
|
|
378
408
|
|
|
379
409
|
`feishu.groupNameFormat` defines separate name templates for new Project and Projectless groups, with variables for the operating system, Agent, project, task name, and date. See the [technical reference](docs/technical-reference.md#configuration-model) for the complete format.
|
|
380
410
|
|
|
381
|
-
If
|
|
411
|
+
If App Server ignores the requested Provider/model, Agent Bot reports the requested and actual settings and verifies restoration on the same thread. It never forks to bypass an upstream limitation. Codex 0.153.4 can retain the old Provider after a failed model request even after unsubscribe; an explicit safe restart followed by retry can clear this in-memory state without changing history. Agent Bot does not restart a shared App Server as a side effect of switching settings. Settings pages can load saved task metadata without first resuming a broken old Provider; ordinary resume/reconnect verifies thread identity and known Provider before allowing a new Turn. Permanent authentication failures are not automatically retried by Agent Bot.
|
|
382
412
|
|
|
383
413
|
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.
|
|
384
414
|
|
|
@@ -396,10 +426,16 @@ Turn Preview shows each saved reasoning item in a collapsed panel. A leading Mar
|
|
|
396
426
|
|
|
397
427
|
Quoted cards and cards inside merged forwards include their available original text and images in the Agent's context.
|
|
398
428
|
|
|
429
|
+
When forwarding rich text, images, files, or chat records with an attached message, Agent Bot combines the associated messages into one request: your attached text is the main Prompt, and the forwarded content remains reference material.
|
|
430
|
+
|
|
399
431
|
File-change summaries display paths as plain text, preserving Windows separators and literal underscores (including `\__init__.py`) instead of interpreting them as Markdown formatting.
|
|
400
432
|
|
|
433
|
+
`/archive` and `/dismiss` also work for a newly created task before its first conversation. Empty tasks are released without generating a dummy message; tasks with history keep the normal archive path. Group dismissal still requires confirmation.
|
|
434
|
+
|
|
401
435
|
## Troubleshooting
|
|
402
436
|
|
|
437
|
+
After a crash, an unfinished Codex rollout alone no longer means the task is running: unloaded threads also require a live writer process. Agent Bot confirms session resume before creating a new running card. Writer conflicts stop automatic recovery with an occupancy card; other unconfirmed recovery failures are retried every five seconds for a one-minute window, then marked interrupted with a notification. No external process is closed automatically. Already-confirmed live turns remain monitored, including during temporary connection outages, and are not subject to this recovery timeout.
|
|
438
|
+
|
|
403
439
|
- **The bot does not respond:** run `agentbot server status` and check today's `~/.agent-bot/logs/agent-bot.YYYY-MM-DD.log`
|
|
404
440
|
- **The Worker restarted after a Node crash:** check `~/.agent-bot/data/last-crash.json`, that day's `~/.agent-bot/logs/worker.stderr.YYYY-MM-DD.log`, and `~/.agent-bot/data/crash-reports/`
|
|
405
441
|
- **Feishu permissions are incomplete:** rerun `agentbot init` and follow the displayed authorization steps
|
package/README.zh.md
CHANGED
|
@@ -293,10 +293,12 @@ Fork 只记录来源任务和分支轮次,不同步完整历史。普通任务
|
|
|
293
293
|
|
|
294
294
|
`/file` 支持相对路径、绝对路径和以 `~` 开头的用户目录路径;相对路径以当前任务目录为基准。
|
|
295
295
|
|
|
296
|
-
`/fork` 和 `/forkgroup` 会从已完成的工作创建分支,不会中断正在执行的轮次。`/sessions` 用于跨项目、跨 Provider 管理任务,每页最多显示 10 个任务;切换 Provider 不会让任务从列表或搜索结果中消失。项目菜单提供 `New` 和 `NewGroup`。每个任务的 `SwitchGroup` 会创建新群并绑定同一个任务,保留历史、标题和运行设置,不创建新 Agent 任务,也不 fork,原会话绑定不变。若任务正在 Agent Bot 中执行,本轮回复仍留在原会话,新群发来的消息先排队;正在外部客户端执行的任务需要等待完成后再切换。展开任务后会直接显示最后一个用户 Prompt 的前 50
|
|
296
|
+
`/fork` 和 `/forkgroup` 会从已完成的工作创建分支,不会中断正在执行的轮次。`/sessions` 用于跨项目、跨 Provider 管理任务,每页最多显示 10 个任务;切换 Provider 不会让任务从列表或搜索结果中消失。项目菜单提供 `New` 和 `NewGroup`。每个任务的 `SwitchGroup` 会创建新群并绑定同一个任务,保留历史、标题和运行设置,不创建新 Agent 任务,也不 fork,原会话绑定不变。若任务正在 Agent Bot 中执行,本轮回复仍留在原会话,新群发来的消息先排队;正在外部客户端执行的任务需要等待完成后再切换。展开任务后会直接显示最后一个用户 Prompt 的前 50 个字符、更新时间以及任务级操作。运行中任务还会显示独立的 `Stop` 按钮,包括当前任务、其他会话和外部客户端中的任务;点击发送正常的 Agent 中断信号,不切换任务、不结束进程。列表刷新保留搜索条件和页码,并根据 Agent 的实际状态保留或移除 Stop;空闲后才提供 Archive。点击 `Turns` 可查看对应任务的轮次,包括尚未绑定到 Agent Bot 的任务,不会切换当前任务;非当前任务仅供查看,需要先切换任务才能 Reset。`/turns` 用于恢复对话上下文,不会回退本地文件。
|
|
297
297
|
|
|
298
298
|
发送 `/update` 可同时检查最新正式版和 Alpha 版,查看更新简介后,点击 **Update <版本号>** 选择更新。更新简介优先显示对应版本的中文内容(包括随包提供的已发布版本译文),没有中文时回退原文。只有配置的机器人所有者可以执行安装;仅检查不会安装。已安装或低于当前版本的版本不提供更新按钮。下载校验在后台进行,随后等待任务和最终回复完成,再安全重启;失败时沿用现有回滚保护。关闭自动检查后仍可使用此命令;源码或 `npm link` 安装只能查看版本,不能原地更新。选择过期或下载失败后,请重新发送 `/update`。
|
|
299
299
|
|
|
300
|
+
模型卡片每页最多显示 20 个模型,超过时提供上一页、下一页,在原卡片内更新,翻页不会改变任务设置。打开 Model tab 时默认显示当前模型所在页;Provider 配置中的模型列表也采用相同分页。
|
|
301
|
+
|
|
300
302
|
## 本地命令
|
|
301
303
|
|
|
302
304
|
在飞书聊天框直接输入 `!` 开头的消息会作为本地命令处理,命令会在当前任务目录执行。
|
|
@@ -304,6 +306,24 @@ Fork 只记录来源任务和分支轮次,不同步完整历史。普通任务
|
|
|
304
306
|
比如 `! ls` 会列出当前目录下的文件,`! git status` 会显示当前 Git 仓库的状态。
|
|
305
307
|
本地命令由独立后台进程执行,不设运行超时,也不会阻塞当前会话中的其他消息或命令。运行期间会动态刷新同一张输出卡片,并按观察到的先后顺序显示正常输出和诊断输出;可通过卡片中的 `Cancel` 停止命令。Agent Bot Worker 重启后会自动恢复监控仍在运行的命令。内容过长时会保留开头和结尾,并截断中间部分。
|
|
306
308
|
|
|
309
|
+
### 交互式网页终端
|
|
310
|
+
|
|
311
|
+
选中终端文字时,**Ctrl+C** 复制,不中断命令;没有选中文字时仍用于中断。**Ctrl+V** 通过浏览器原生剪贴板事件粘贴,HTTP 页面同样支持,并保留 xterm 的换行和括号粘贴处理。macOS 同时支持 **Cmd+C / Cmd+V**。顶部 **Ctrl+C** 按钮始终用于中断。
|
|
312
|
+
|
|
313
|
+
授权卡和管理卡中的“终端”显示该终端恢复链接 `/terminal/<token>` 中的 8 位 token,保留大小写。重连和重新授权后不变;同一命令创建的不同终端使用不同 token。内部 ID 和授权凭证仍独立保留。
|
|
314
|
+
|
|
315
|
+
终端授权卡和重新授权卡发送到**原命令所在会话**;命令在话题内时仍留在原话题,不再转发到所有者私聊。仅配置的所有者可授权或管理。授权后卡片变为**终端管理卡**:首次连接前提供“打开终端”,Shell 启动后提供“重新打开终端”,两者都指向同一个终端。原网页丢失时,新网页核对验证码并重新授权后,才撤销旧网页访问;尚未连接的终端在 WebSocket 鉴权后启动 Shell,已运行的终端复用原 Shell。无需找回网页,也可点击“关闭终端”或“刷新”。安全重启等待期间允许恢复或关闭已运行的 Shell,但不允许启动尚未连接的 Shell。已结束或服务重启前的终端不能恢复。原命令卡片的 Open Terminal 仍用于创建新终端。
|
|
316
|
+
|
|
317
|
+
刷新/重连仅回放终端画面,不会将历史中的设备查询响应再次送入 Shell,避免命令行出现 `?1;2c` 等多余字符;首次启动和实时查询仍正常响应。
|
|
318
|
+
|
|
319
|
+
手机切到飞书授权再返回网页时会自动恢复查询/连接。短暂断网会保留已有授权并自动重试;“重新连接”复用当前会话,不会关闭 Shell 或重复发送授权卡。明确拒绝/过期时才停止恢复;页面区分授权查询、WebSocket 连接和 Shell 启动错误。
|
|
320
|
+
|
|
321
|
+
飞书 `!` 命令卡片新增 **Open Terminal**。点击网页说明区或右上角的“请求连接”,由所有者到原命令所在会话/话题核对六位验证码并授权,即可在卡片目录启动**独立 Shell**;不会重复执行、接管或停止原命令。命令以 Agent Bot 主机的系统用户权限运行,不受 Agent 沙箱限制。
|
|
322
|
+
|
|
323
|
+
xterm.js 支持连续输入、ANSI 颜色、Ctrl+C、尺寸调整和同一浏览器标签页刷新重连。Windows 使用 ConPTY/PowerShell(优先 `pwsh`),macOS/Linux 使用 Unix PTY/用户 Shell。输入语法高亮由 Shell 和 PSReadLine 等插件提供。最多三个会话;“关闭终端”立即停止 Shell;关闭标签页后开始三分钟断开计时,期间成功重连会取消断开计时并重置 30 分钟空闲计时,后台输出不会延长断开时限。页面连接正常且处于前台时不因空闲关闭;切到后台后开始 30 分钟无输入/输出计时,输入/输出会刷新计时。后台空闲与断开超时是“或”的关系,先到者生效;累计八小时后仍会自动关闭;会话不跨 Agent Bot 重启保留。脱离终端的后台进程可能继续运行。
|
|
324
|
+
|
|
325
|
+
终端链接与 Preview **共用协议、主机、端口及路径前缀**,新建和管理卡恢复入口统一为 `/terminal/<8位token>`,由服务端根据 token 判断新建或恢复。token 使用区分大小写的 URL 安全字符,仅用于定位,不是执行凭证。新建链接重启后仍有效,恢复链接随 Shell 结束失效。终端仅支持这一链接格式,复用 `fileViewer` 的网卡选择和 `publicBaseUrl`,无需独立地址或端口。Preview 使用 HTTP 时终端同样可用,仅用于可信网络,不可信网络/互联网访问请配置 HTTPS。仍需所有者授权,Preview 保持只读。详见[网页终端配置](docs/technical-reference.zh.md#交互式网页终端)。`terminal.enabled: false` 可禁用,关闭 Preview 也会关闭终端。安全重启等待活动终端关闭,等待期间禁止创建新终端。
|
|
326
|
+
|
|
307
327
|
## 配置与数据
|
|
308
328
|
|
|
309
329
|
Agent Bot 将用户相关文件保存在仓库之外:
|
|
@@ -323,7 +343,7 @@ Agent Bot 将用户相关文件保存在仓库之外:
|
|
|
323
343
|
|
|
324
344
|
`/status` 状态卡片底部也提供 **Preview**,与 Refresh、Stop/Switch 放在同一行。点击可查看正在执行的轮次,空闲时则查看最近一轮;刷新卡片后会更新目标。对于尚未被 Agent Bot 记录的外部任务,打开 Preview 时会从 Agent 按需读取所选轮次并缓存完整执行详情;读取失败可刷新页面重试。没有轮次、无法读取历史且无本地记录,或文件预览服务不可用时不显示按钮。查看其他任务的状态不会切换或接管任务。
|
|
325
345
|
|
|
326
|
-
思考卡片底部操作区提供 `Preview` 按钮,可在浏览器中查看本轮已保存的执行时间线,采用紧凑布局并适配手机,思考块直接以内容标题作为折叠标题,展开后显示内容。工具块只有一级折叠,默认只显示有意义的单行命令摘要、简短耗时(如 `58s` 或 `2:32`)和完成状态。展开后先显示以 `$` 开头的完整命令,随后直接显示结果、图片和修改文件。相同的输出和错误日志只显示一次。执行中的 Turn 会通过局部更新实时显示变化,保留手动展开状态、滚动位置和未变化的图片节点,避免图片反复加载;Token 等元数据更新不会替换时间线。折叠工具块和文件变更汇总首屏只加载摘要,展开时才请求命令、日志、图片和文件列表;再次展开复用已加载内容,运行中只刷新已展开且内容变化的详情,加载失败可点击重试。已结束的 Turn 不再建立 SSE 实时连接。“正在等待 Agent 返回进度”只在尚无可显示进度时出现,已有回答、其他可见进展或 Turn 已结束时不再显示。点击文件变更列表或工具文件列表中的文件,可在新标签页预览其当前内容;已删除或不可用的文件保留为路径文字。Turn Preview
|
|
346
|
+
思考卡片底部操作区提供 `Preview` 按钮,可在浏览器中查看本轮已保存的执行时间线,采用紧凑布局并适配手机,思考块直接以内容标题作为折叠标题,展开后显示内容。工具块只有一级折叠,默认只显示有意义的单行命令摘要、简短耗时(如 `58s` 或 `2:32`)和完成状态。展开后先显示以 `$` 开头的完整命令,随后直接显示结果、图片和修改文件。相同的输出和错误日志只显示一次。执行中的 Turn 会通过局部更新实时显示变化,保留手动展开状态、滚动位置和未变化的图片节点,避免图片反复加载;Token 等元数据更新不会替换时间线。折叠工具块和文件变更汇总首屏只加载摘要,展开时才请求命令、日志、图片和文件列表;再次展开复用已加载内容,运行中只刷新已展开且内容变化的详情,加载失败可点击重试。已结束的 Turn 不再建立 SSE 实时连接。“正在等待 Agent 返回进度”只在尚无可显示进度时出现,已有回答、其他可见进展或 Turn 已结束时不再显示。点击文件变更列表或工具文件列表中的文件,可在新标签页预览其当前内容;已删除或不可用的文件保留为路径文字。Turn Preview 与本地文件链接共用相同的签名、访问地址和网络范围。“最终回答”旁提供下载、复制两个图标,导出原始 Markdown(保留格式、代码块和原始链接),而非渲染后的网页内容。下载为 UTF-8 `.md` 文件;复制支持 HTTP/局域网页面的回退方式,并显示成功或失败提示。已结束页面及实时到达的最终回答均可使用。
|
|
327
347
|
|
|
328
348
|
Turn Preview 完整保留已记录的执行内容,不再反复把整轮内容写入数据库。页面按增量实时更新,折叠工具展开时加载完整详情。备份时请保留整个 Profile 数据目录,以同时保存执行记录和任务信息;已有历史仍可查看。
|
|
329
349
|
|
|
@@ -331,7 +351,7 @@ Turn Preview 完整保留已记录的执行内容,不再反复把整轮内容
|
|
|
331
351
|
|
|
332
352
|
Turn Preview 支持 JavaScript/TypeScript、Python、Shell/PowerShell、JSON/YAML、SQL、HTML/CSS、Go、Rust、Java、C/C++ 等常见语言的代码块高亮,配色跟随系统浅色/深色主题。在代码块开头指定语言即可;未指定、未知语言或超大代码块仍完整显示为纯文本。行内代码和工具日志保持原样。
|
|
333
353
|
|
|
334
|
-
Turn Preview
|
|
354
|
+
Turn Preview 和 Markdown 文件预览中的 Mermaid 图表支持「预览 / 源码」切换,默认显示预览。使用 `mermaid` 代码块和 `flowchart` 或 `graph` 语法即可,也支持 `flowchart` 代码块。实时更新会保留手动选择的模式;语法错误或尚未完整的图表会回退到源码。图表在本地浏览器中渲染,不上传外部服务;图表默认按可用宽度等比缩小,不会放大小图。手机端预览高度最多约半屏,长图可纵向滑动;点击「原大 / 适应」可查看细节或恢复适配,实时更新会保留该选择。
|
|
335
355
|
|
|
336
356
|
Turn Preview 顶部用点分隔各项信息,保留“耗时”标签,Token 数量使用 K、M、B 单位简写,窄屏下自动换行。Prompt、Commentary 和结果正文使用普通字重,字号比工具调用大一号。展开后的工具命令和输出保留换行与缩进,长行在工具块内横向滚动,不自动折行。命令和结果共用一个最多 30 行高的滚动区域。页面为占宽度的竖向滚动条预留空间,展开或收起工具时,顶部和正文不再左右跳动。滚动条采用无箭头的浅色细条,鼠标设备上悬停或键盘聚焦时显示,触屏设备隐藏滚动条,仍可用手势滚动。
|
|
337
357
|
|
|
@@ -341,7 +361,9 @@ Turn Preview 顶部用点分隔各项信息,保留“耗时”标签,Token
|
|
|
341
361
|
|
|
342
362
|
工具标题开头使用与思考卡片相同的状态图标:执行中为沙漏,成功为对号,失败为叉号;执行中的工具边框突出显示。标题摘要省略命令续行符,保留文件路径和展开后的完整命令。时长为 0 秒时隐藏。展开后的底部显示执行状态、开始时间、耗时和结果字符数,不随内容滚动;执行中标题和底部的耗时都会实时更新。
|
|
343
363
|
|
|
344
|
-
|
|
364
|
+
命令授权卡片使用简短的“命令执行确认”标题,优先显示申请原因,命令放入默认折叠的区域,不再把整条命令重复显示为加粗标题。摘要省略可识别的 Shell 包装,展开后仍保留原始包装。命令或说明超长时明确提示截断,请在 Turn Preview 查看完整原始命令后再授权。四个授权操作及其权限范围不变;Preview 保持只读,实时更新保留命令展开状态和滚动位置。
|
|
365
|
+
|
|
366
|
+
TraeX 的规划模式确认遵循任务权限设置:**auto** 自动同意进入规划模式及批准方案;**confirm** 显示方案和 `Approve Plan`(或 `Enter Plan Mode`)、`Reject`、`Cancel Request` 按钮,等待用户选择。请求和结果保留在思考卡片及实时 Preview 中,自动处理明确标记为“自动同意”,不记为用户点击。方案获批后,TraeX 结束规划轮次时,Agent Bot 在同一任务、同一张思考卡片中继续执行。用户明确要求“仅讨论”“先不要实现”时仍须遵守。自动确认失败会显示提示并恢复手动确认按钮。Preview 保持只读。取消确认不等同于停止任务,等待确认的轮次仍阻止安全重启。旧版本已丢失的确认通知不会自动补回。
|
|
345
367
|
|
|
346
368
|
Turn Preview 的 Prompt、Commentary 和结果中的本地图片通过签名文件链接加载,实时更新时同样生效。相对图片路径按任务的项目目录解析。
|
|
347
369
|
|
|
@@ -349,17 +371,25 @@ Turn Preview 的 Prompt、Commentary 和结果中的本地图片通过签名文
|
|
|
349
371
|
|
|
350
372
|
Turn Preview 顶部在处理和工具执行期间统一显示“正在处理”;工具详情和其他状态提示保持不变。
|
|
351
373
|
|
|
374
|
+
Header 不再显示上下文压缩统计,“上下文”Token 数放在“模型调用”前面(没有模型调用次数时,放在工具数量前面),使用 Agent 在本轮最近一次上报的上下文大小,不是累计消耗或模型容量。数值局部实时更新,压缩后收到较小值时同步下降;悬停可查看精确值。历史轮次显示当时保存的值,未上报或数值无效时隐藏,不从其他 Token 数推算,也不额外读取历史。
|
|
375
|
+
|
|
352
376
|
Turn Preview 先显示每轮保存的 Provider,再显示模型,不添加可见的 Provider 前缀。切换设置只影响后续轮次,不改变当前轮次或历史轮次的标记;旧快照未记录 Provider 时不显示,也不会用任务当前设置补填。
|
|
353
377
|
|
|
378
|
+
Header 还显示本轮“模型调用 N 次”,按有效 Token 用量更新次数统计:首次正用量计一次,之后累计用量每次增长计一次,优先采用含缓存的总用量,缺失时采用非缓存用量。重复、回退、无效及仅上下文变化的通知不增加次数。数值局部实时更新,重启后保留;不修改飞书思考卡片。已有 Preview 事件在正常回放时可还原次数,缺少完整记录的旧快照或未上报用量的 Agent 则不显示;不额外读取 Agent 历史或扫描 rollout。
|
|
379
|
+
|
|
354
380
|
Agent 提供数据时,Turn Preview 在原有非缓存 Token 数量旁显示本轮总计(输入加输出,包含缓存命中),不再单独显示缓存命中 Token 数;底层统计保持不变。数值实时更新,使用简写单位,悬停可查看精确值;重复用量通知不会重复累计。缺失的明细和旧快照不作推算,也不会读取任务历史补填;飞书卡片的 Token 统计口径保持不变。
|
|
355
381
|
|
|
356
382
|
HTML 文件(`.html`、`.htm`)默认以预览模式打开,并支持切换代码、行号定位和实时更新。自包含 HTML 的内联样式、内联脚本和嵌入媒体可在隔离框架内运行;不开放外部资源、相对路径本地资源、网络请求、表单提交及对外层查看页的访问。预览会渲染完整文档,仅代码视图限制为开头 2 MiB。
|
|
357
383
|
|
|
384
|
+
CSV 文件(`.csv`,不区分大小写)默认显示只读表格,带行号、列字母和固定标签,可横向及纵向滚动;首行保留为数据,不自动当作表头。支持标准逗号分隔、引号内逗号和换行、双引号转义、空单元格,以及现有 UTF-8、带 BOM 的 UTF-16、GB18030 编码识别;数字字符串和公式均按普通文本显示。预览最多读取开头 2 MiB,表格最多显示 500 条记录、50 列、每格 4000 个字符,超限或引号格式错误时明确提示,字节边界处不完整的记录不展示。代码视图最多显示 2000 个物理行,原始文件和下载保持完整内容;实时更新保留所选模式和表格滚动位置。
|
|
385
|
+
|
|
358
386
|
Provider、模型、思考强度和权限设置会作用于当前任务,同时保存到对应 Agent 的 `defaults` 中。以后创建没有同 Agent 设置可继承的新任务时,会使用这些默认值;每个已配置 Agent 分别保存自己的设置。
|
|
359
387
|
|
|
388
|
+
App Server 任务切换权限时,下一轮会同时应用审批与沙箱策略:`auto` 为关闭沙箱且不弹审批,`confirm` 为工作区可写沙箱并按需审批。可在 `/permissions` 卡片中选择,或使用 `agentbot task permissions auto|confirm`。切换无需重启 Agent、Fork 或新建任务,不改变已在执行的工具进程,也不会通过追加消息(steer)修改当前轮次沙箱。工作区额外可写目录、网络访问及临时目录排除项保留 Agent 的配置。
|
|
389
|
+
|
|
360
390
|
运行设置卡片末尾以 Markdown 引用块显示当前选项页的一句重点提示,标明作用范围和生效时机。Agent 只改变本聊天或话题中新任务的默认 Agent,不迁移当前任务;模型、思考强度和权限从下一轮生效。Agent 和 Provider 选项只显示标识,去掉重复的展示名称,保留当前与默认状态标记。只有一个 Provider 时,`/provider` 仍会打开运行设置卡片,可以继续切换到 Model、Thinking 和 Permission 页。
|
|
361
391
|
|
|
362
|
-
|
|
392
|
+
任务正在 Agent Bot 中执行时,切换 Provider 会保存为待生效设置,不中断本轮。运行设置卡片立即显示目标 Provider 和将使用的模型,Model 页切换为该 Provider 的模型列表,可继续选择,以最后选择为准;此时修改思考强度和权限也一起暂存。本轮结束后、排队消息、重试或新轮次开始前实际应用,空闲任务则立即切换。待生效设置重启后保留,应用前不改动实际运行设置或 Agent 默认值。如果延迟切换失败,自动回退之前的 Provider 和模型;确认回退成功后,卡片恢复显示原设置并提示失败原因,清除待生效选择,排队消息和后续轮次继续使用原设置。只有回退也失败或无法确认时才暂停后续轮次、保留排队消息,等待重新选择恢复。对于自定义 Provider,Agent Bot 会在接口可用时读取其 OpenAI 兼容 `/models` 接口,并只展示该 Provider 返回的模型。切换时优先保留目标 Provider 也支持的原模型;否则选择目标 Provider 的默认模型,没有默认模型时选择返回列表中的第一个模型。未提供模型列表接口的 Provider 仍可使用:Agent Bot 会把当前或已配置模型作为唯一候选交给 Codex 应用。Agent Bot 只取消选中空闲任务的订阅,再使用解析出的 Provider 和模型恢复同一线程,校验 ID 和两项设置后才保存并提示成功;取消订阅本身不代表 App Server 已卸载线程。设置切换始终保留远端线程 ID 和全部历史,包括失败、中断的轮次;绝不新建、Fork、截断或替换线程。尚未保存 rollout 的全新空会话会在取消订阅前明确拒绝切换,不会偷偷替换。切换失败时保留原设置并尝试恢复远端;如果恢复也失败,将阻止后续执行,直到重新切换 Provider 成功。
|
|
363
393
|
|
|
364
394
|
`feishu.groupNameFormat` 可分别设置 Project 与 Projectless 新群的名称模板,支持系统、Agent、项目、任务名和日期变量。完整格式说明见[技术参考](docs/technical-reference.zh.md#配置模型)。
|
|
365
395
|
|
|
@@ -369,7 +399,7 @@ Provider 模型列表读取失败时,设置卡片保留降级候选模型,
|
|
|
369
399
|
|
|
370
400
|
部分 Responses 兼容 Provider 不返回助手消息阶段。这类文本先按顺序显示在进度时间线,不再提前拼接成最终回答;轮次成功结束时,只有最后一条且之后未开始工具调用的未标记消息会成为最终回答。明确的 `commentary` 和 `final_answer` 标记优先。思考卡片和 Preview 使用同一分类结果,不自动改写此前保存的快照。
|
|
371
401
|
|
|
372
|
-
如果
|
|
402
|
+
如果 App Server 忽略指定的 Provider 或模型,Agent Bot 会报告请求值和实际值,并在同一线程上验证恢复原设置,绝不通过 Fork 绕过上游限制。实测 Codex 0.153.4 在模型请求失败后,取消订阅再恢复仍可能保留旧 Provider;显式安全重启后重试可以清除此内存状态,不需要改变历史。切换设置不会自动重启共享 App Server。设置入口可直接加载保存的任务元数据,无需先用故障的旧 Provider 恢复任务;普通恢复和断线重连会验证线程 ID 与已知 Provider,再允许发起新轮次。明确的认证失败不再触发 Agent Bot 自动重试。
|
|
373
403
|
|
|
374
404
|
Agent 进程会继承普通父进程变量及其显式配置的 `agents.<name>.env`。启动 Agent 前,Agent Bot 会移除继承的 `FEISHU_*` 凭据和内部 `AGENT_BOT_*` 状态,再仅提供带命名空间的非敏感 Profile 与 Lark 身份上下文;`FEISHU_APP_SECRET` 永远不会传入 Agent 进程。
|
|
375
405
|
|
|
@@ -387,10 +417,16 @@ Turn Preview 中每个已保存的思考项默认折叠,开头的 Markdown 标
|
|
|
387
417
|
|
|
388
418
|
引用卡片或合并转发中的卡片时,Agent 会收到可读取的原始文字和图片。
|
|
389
419
|
|
|
420
|
+
转发富文本、图片、文件或聊天记录并附言时,Agent Bot 会将关联消息合并为一次请求:你的附言作为主 Prompt,转发内容保留为参考材料。
|
|
421
|
+
|
|
390
422
|
文件变更摘要中的路径保持普通文本样式,完整保留 Windows 路径分隔符和下划线(包括 `\__init__.py`),不会将其解析为 Markdown 格式。
|
|
391
423
|
|
|
424
|
+
新建任务尚未开始对话时,也可以使用 `/archive` 或 `/dismiss`。空任务会直接释放,不会为了归档而发送虚构消息;已有历史的任务仍按正常流程归档。解散群聊仍需确认。
|
|
425
|
+
|
|
392
426
|
## 常见问题
|
|
393
427
|
|
|
428
|
+
异常崩溃后,不再仅凭 Codex 日志缺少结束事件就把任务判为运行中:未加载的任务还需要确认有存活的写入进程。Agent Bot 确认会话恢复成功后才创建新的运行卡片;写锁冲突会停止自动恢复并显示占用卡片,其他尚未确认恢复成功的故障每 5 秒重试,在 1 分钟重试窗口耗尽后标记中断并通知用户,不会自动关闭外部进程。已经确认仍在执行的轮次继续监控,临时断连也不会被该恢复超时误判为空闲。
|
|
429
|
+
|
|
394
430
|
- **机器人没有响应:** 运行 `agentbot server status`,并查看当天的 `~/.agent-bot/logs/agent-bot.YYYY-MM-DD.log`
|
|
395
431
|
- **Node 崩溃后 Worker 被自动重启:** 查看 `~/.agent-bot/data/last-crash.json`、崩溃当天的 `~/.agent-bot/logs/worker.stderr.YYYY-MM-DD.log` 和 `~/.agent-bot/data/crash-reports/`
|
|
396
432
|
- **飞书权限不完整:** 重新运行 `agentbot init`,完成显示的授权步骤
|
package/SECURITY.md
CHANGED
|
@@ -4,6 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
Security fixes are released for the latest published version of Agent Bot.
|
|
6
6
|
|
|
7
|
+
## Interactive Terminal Trust Boundary
|
|
8
|
+
|
|
9
|
+
Terminal management cards in the original command conversation/topic can close their associated Shell without browser credentials. They validate the current owner, exact card and action token. Eight-character URL tokens share `/terminal/<token>` and identify a stored command or terminal but grant no execution access; the server selects behavior, and retired recovery tokens stay reserved so they never become new-shell links; do not shorten the independent browser keys or approval tokens. Reopen links identify a terminal but grant no access: recovery requires fresh code approval, rotates browser authorization and revokes old access. Denying a recovery request leaves the original terminal unaffected; ended terminals cannot be recovered. Never approve recovery on the owner's behalf.
|
|
10
|
+
|
|
11
|
+
The browser terminal executes arbitrary commands as the Agent Bot OS user, outside Agent sandbox settings. Disable it with `terminal.enabled: false` or disable `fileViewer`. Terminal and Preview share `fileViewer` networking and the same origin, but not authorization. Raw files have a no-script response sandbox; rendered HTML has an opaque-origin sandbox without same-origin privilege or network requests. Do not remove those boundaries or serve other arbitrary scripts in this origin. Protect profile files/signing secrets with local user access controls.
|
|
12
|
+
|
|
13
|
+
HTTP terminals are supported for trusted LAN use; traffic is unencrypted. Network interception/tampering can compromise terminal traffic and credentials; owner approval is not transport encryption. Use HTTPS on untrusted networks or the Internet, preserve Host/Origin and proxy WebSocket upgrades. Never log terminal credentials or traffic.
|
|
14
|
+
|
|
15
|
+
Every browser session needs matching-code owner approval in the original Feishu command conversation/topic. Group members may see the card and verification code but cannot authorize: current owner, exact card ID and action token are checked independently of the delivery destination. A launch link or Preview token alone cannot execute commands. Never approve unsolicited requests or log/share browser credentials. Keys live in sessionStorage, not URLs; access to that browser tab or OS account is inside the trust boundary. Shells can read host files and other environment credentials even though internal Feishu/Agent Bot variables are filtered. Shell profiles also execute as that user.
|
|
16
|
+
|
|
17
|
+
Disconnecting retains the Shell for three minutes; a successful authenticated reconnection cancels this deadline and restarts thirty idle minutes, but command output does not extend the disconnect deadline. A connected foreground page with fresh visibility heartbeats prevents idle closure; hiding it starts thirty minutes of input/output inactivity. Either timeout closes it. Explicit close, the eight-hour absolute limit and service shutdown still end it. Detached processes may survive. Safe restart waits for active terminals; forced restart interrupts them.
|
|
18
|
+
|
|
7
19
|
## Reporting A Vulnerability
|
|
8
20
|
|
|
9
21
|
Do not open a public issue for a suspected vulnerability.
|
package/config.example.yaml
CHANGED
|
@@ -23,6 +23,11 @@ console:
|
|
|
23
23
|
updates:
|
|
24
24
|
enabled: true
|
|
25
25
|
|
|
26
|
+
# Interactive terminal: independent authorization, not a read-only Preview.
|
|
27
|
+
terminal:
|
|
28
|
+
enabled: true
|
|
29
|
+
# Shares fileViewer host, port and publicBaseUrl; keeps independent owner authorization.
|
|
30
|
+
|
|
26
31
|
# Signed, read-only pages for local files referenced in Agent replies.
|
|
27
32
|
fileViewer:
|
|
28
33
|
enabled: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controlProtocol.js","sourceRoot":"","sources":["../../src/cli/controlProtocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"controlProtocol.js","sourceRoot":"","sources":["../../src/cli/controlProtocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AA0L7B,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC/F,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO;QACjC,CAAC,CAAC,0BAA0B,GAAG,EAAE;QACjC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/cli/serverStatus.js
CHANGED
|
@@ -31,6 +31,7 @@ export function formatServerStatus(data, language = cliLanguage) {
|
|
|
31
31
|
`${cliText("Supervisor: ", "Supervisor:", language)}${value.supervised ? cliText("enabled", "已启用", language) : cliText("disabled", "未启用", language)}`,
|
|
32
32
|
...agents,
|
|
33
33
|
`${cliText("Running tasks: ", "运行中任务:", language)}${activity.runningSessions ?? 0}`,
|
|
34
|
+
...(activity.activeTerminals ? [`${cliText("Active terminals: ", "活动终端:", language)}${activity.activeTerminals}`] : []),
|
|
34
35
|
`${cliText("Pending final deliveries: ", "待发送最终结果:", language)}${activity.pendingFinalDeliveries ?? 0}`,
|
|
35
36
|
`${cliText("Safe restart: ", "安全重启:", language)}${safeRestart}`,
|
|
36
37
|
"",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverStatus.js","sourceRoot":"","sources":["../../src/cli/serverStatus.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,yBAAyB,CACvC,IAAa,EACb,qBAA8B;IAE9B,MAAM,KAAK,GAAG,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAC5C,CAAC,CAAC,IAA+B;QACjC,CAAC,CAAC,EAAE,CAAC;IACP,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC;QAAE,OAAO,KAAK,CAAC;IACtD,OAAO;QACL,GAAG,KAAK;QACR,WAAW,EAAE,qBAAqB,IAAI,IAAI;KAC3C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAa,EAAE,QAAQ,GAAgB,WAAW;IACnF,MAAM,KAAK,GAAG,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAA+B,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;QACnE,CAAC,CAAC,KAAK,CAAC,QAAmC;QAC3C,CAA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CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC;gBACvF,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;gBACnB,CAAC,CAAC,GAAG,CAAC;YACR,MAAM,OAAO,GAAG,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE;gBACvE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE;gBACtB,CAAC,CAAC,GAAG,CAAC;YACR,OAAO,QAAQ,KAAK,IAAI;gBACtB,CAAC,CAAC,KAAK,KAAK,QAAQ,GAAG,OAAO,OAAO,EAAE;gBACvC,CAAC,CAAC,KAAK,KAAK,SAAS,GAAG,aAAa,OAAO,EAAE,CAAC;QACnD,CAAC,CAAC;KACH,CAAC;AACJ,CAAC;AACD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAoB,MAAM,WAAW,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -1391,7 +1391,12 @@ function printTaskAgentSettings(result) {
|
|
|
1391
1391
|
process.stdout.write(`${cliText("Available Agents: ", "可用 Agent:")}${result.agents.map((agent) => `${agent.name} (${agent.title})`).join(", ")}\n`);
|
|
1392
1392
|
}
|
|
1393
1393
|
function printTaskSettings(result, setting) {
|
|
1394
|
-
const session = result.session;
|
|
1394
|
+
const session = result.pendingProvider?.settings ?? result.session;
|
|
1395
|
+
if (result.pendingProvider) {
|
|
1396
|
+
const status = cliText("Pending Provider switch (after current turn)", "Provider 待切换(本轮结束后生效)");
|
|
1397
|
+
const error = result.pendingProvider.error ? `: ${result.pendingProvider.error}` : "";
|
|
1398
|
+
process.stdout.write(`${status}${error}\n`);
|
|
1399
|
+
}
|
|
1395
1400
|
process.stdout.write(`${cliText("Provider: ", "Provider:")}${session.modelProvider ?? cliText("Agent default", "Agent 默认")}\n`);
|
|
1396
1401
|
process.stdout.write(`${cliText("Model: ", "模型:")}${session.model ?? cliText("default", "默认")}\n`);
|
|
1397
1402
|
process.stdout.write(`${cliText("Thinking: ", "思考强度:")}${session.reasoningEffort ?? cliText("automatic", "自动")}\n`);
|