@best-agent/cli-linux-x64-gnu 0.0.2-beta.9 → 0.0.17-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,61 +1,124 @@
1
1
  # @best-agent/cli
2
2
 
3
- v3 的本地 Application composition 与终端入口。
3
+ Best-Agent v3 的本地 CLI、TUI 与 Application composition 入口。产品合同见:
4
+
5
+ - [Composition](../../docs/product-v3/composition.md)
6
+ - [Task and Session](../../docs/product-v3/task-session.md)
7
+ - [Orchestration](../../docs/product-v3/orchestration.md)
8
+ - [Context](../../docs/product-v3/context.md)
9
+ - [Presentation](../../docs/product-v3/presentation.md)
10
+ - [External Services](../../docs/product-v3/external-services.md)
11
+
12
+ ## 当前命令
13
+
14
+ ```bash
15
+ best-agent run [options] <prompt>
16
+ best-agent chat [options]
17
+ best-agent subagent [options] <task>
18
+ best-agent workflow --workflow <steps.json> [options] <prompt>
19
+ best-agent server --stdio [options]
20
+ best-agent serve [options]
21
+ best-agent daemon [options]
22
+ best-agent acp [options]
23
+ best-agent --version | -version | -v | version
24
+ ```
25
+
26
+ 运行 `best-agent --help` 查看当前 composition 与 transport 参数。
27
+
28
+ `best-agent --version`(等价 `-version`、`-v`、`version`)是只读查询:不进入任何 composition,只在 stdout 打印一行 CLI 版本后退出
29
+ (安装态 npm 包读自身 package manifest,SEA 单文件读构建时注入的版本;无法解析时打印 `dev`),便于在外部脚本或终端里确认当前安装的版本。
30
+
31
+ `b8` 是同一入口的短别名(`b` + 省略的 8 个字母):安装该包后 `b8 <subcommand>` 与
32
+ `best-agent <subcommand>` 等价,帮助文本中的命令名仍为 `best-agent`。
33
+
34
+ ## TUI shell mode(`!` / `!!`)
35
+
36
+ Home 或 chat 的空输入框中,用前缀明确选择是否把结果交给模型:
37
+
38
+ | 输入 | 行为 | 模型上下文 |
39
+ | --- | --- | --- |
40
+ | `!git status` | 直接执行一次 | 完成后,命令、工作目录、输出尾和退出事实随该聊天的下一条消息发送;不自动触发回复 |
41
+ | `!!git status` | 直接执行一次 | 命令和输出都不发送给模型 |
42
+
43
+ 输入框和输出区会显示模式说明。第二个 `!` 会切换为本地模式,粘贴 `!!命令` 也会完整识别前缀;前缀不会传给 shell。命令接受后回到普通消息输入,拒绝则保留草稿。使用 `↑` 回忆 shell 命令时,也会恢复它原来的上下文选择。
44
+
45
+ `!` 在首页会先建立一个空聊天固定结果归属,不调用模型;`!!` 无需创建聊天。切换聊天不会改变已经执行的命令的归属。输出区显示“结果已随消息提交”表示消息入口已接受,排队中的消息仍需等待派发。未提交的结果仅保留在当前 CLI 进程中;删除聊天或关闭进程会清理。输出超出保留窗口时会明确显示省略信息;结果过多时会提示先发一条消息。
46
+
47
+ 执行中按 `Esc` 停止命令;结果显示时空输入框上的 `Esc` 收起输出区。`Backspace` / `Ctrl+U` 在空 shell 输入框上退出模式。既有优先层序保持:in-flight fork → 对话框 / inspect → shell stop/exit → Run interrupt / exit-confirm。`/theme` 等在 shell 输入框中是命令文本。
48
+
49
+ - 环境:命令由你的 shell 以**交互式登录**方式执行(POSIX 为 `$SHELL -ilc <命令>`,`SHELL` 为空时用 `/bin/sh`;Windows 为
50
+ `cmd.exe /d /s /c <命令>`)。子进程继承启动这次 TUI 的终端的全部环境变量,shell 再读你的登录文件与 **rc 文件**——因此
51
+ `.zshrc` / `.bashrc` 里定义的 **alias 与函数(例如 `gp`、`gpl`)和只在那里赋值的变量都可用**,与你在新开终端里执行一致。
52
+ - 代价(已声明):每条命令都会执行一次 rc 文件,所以 rc 自己写到 stderr 的输出(例如 npm 的 warning)会如实出现在 block 里,
53
+ 且重 rc(oh-my-zsh 之类)会让每条命令多花约 1 秒启动时间;这些都不做静默过滤,因为 block 是读取端的忠实副本。
54
+ - 仍不支持:需要 **TTY** 的交互式程序——`vim`、`top`、需要密码的 `sudo` / `ssh`、以及靠方向键选择的交互式命令(例如
55
+ `fzf`、某些 `pnpm run` 选择器、你自己的 `prun`)。子进程的 stdin/stdout 是管道而不是终端(`[ -t 1 ]` 为假、没有 raw mode、
56
+ 没有光标寻址),所以这类程序要么直接报 "not a tty",要么只输出纯文本帧;把终端真正交给子进程(PTY 归属与交接)是独立切片。
57
+ - 边界:`!!` 与 recall 历史不进入模型上下文;`!` 只有在下一条消息被接受后才进入既有消息历史,后续持久化与 compact 沿用消息本身的规则。
58
+ - 运行中的命令在你离开 chat 页面后继续运行,回到 chat 时以运行态恢复显示;离开期间结算的命令以结算态显示,不自动重放。
4
59
 
5
60
  ## 安装与发布
6
61
 
7
- - `npm install -g @best-agent/cli@beta`:根包按 `os`/`cpu`/`libc` 安装一个 SEA 平台包;
8
- - `pnpm pack:tui`:构建、打包并安装 smoke-test 当前平台的根包和平台包;
9
- - `pnpm release:cli --artifact-root .tmp/sea --tag beta --dry-run`:验证六个平台产物;去掉 `--dry-run` 后依次发布六个平台包和根包。
62
+ 无需安装 Node 或 npm:在 [GitHub Releases](https://github.com/Simon-He95/best-agent/releases) 下载当前系统与 CPU 对应的 `best-agent-<version>-<target>.tar.gz`(Windows 为 `.zip`),以及同名 `.sha256`。Linux 当前支持 glibc,不支持 Alpine/musl。
10
63
 
11
- 发布包不含普通 CLI JavaScript、声明文件或 source map。根包只含平台选择 launcher;Harness、CLI 和 TUI 位于 minified/mangled Node SEA code cache 中。
64
+ macOS / Linux:先在下载目录校验 `shasum -a 256 -c <archive>.sha256`(Linux 也可用 `sha256sum -c`),然后:
12
65
 
13
- ## 当前命令
66
+ ```sh
67
+ tar -xzf best-agent-<version>-<target>.tar.gz
68
+ cd best-agent-<version>-<target>
69
+ sh install.sh
70
+ "$HOME/.local/bin/best-agent" chat
71
+ ```
72
+
73
+ 默认安装到 `$HOME/.local/lib/best-agent`,命令位于 `$HOME/.local/bin`;把该 bin 目录加入 PATH 后可直接使用 `best-agent` 或 `b8`。自定义位置使用 `sh install.sh "/absolute/install prefix"`。安装脚本不修改 shell 配置;更新时安装新归档即可,用户配置与聊天记录保留。
74
+
75
+ Windows:用 `Get-FileHash <archive>.zip -Algorithm SHA256` 与同名 `.sha256` 中的值比对,解压后在 PowerShell 中执行:
76
+
77
+ ```powershell
78
+ powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1
79
+ & "$env:LOCALAPPDATA\Programs\best-agent\bin\best-agent.exe" chat
80
+ ```
14
81
 
15
- - `best-agent run ... <prompt>`:创建一个 frozen Plan、一个 Session 和一个 Run;
16
- - `best-agent chat ...`:创建一个 frozen Plan 和一个 Session,普通输入开始新 Run,`/stop` 请求停止当前
17
- Run,`/quit` 关闭本地 Application 资源;terminal assistant text 中的 `[[approval:<prompt>]]` 仅创建
18
- Application 等待态,`/approve yes|no` 会提交同 Session 的**新 Run**。
19
- - `best-agent subagent ... <task>`:使用 Application-owned coordinator 启动独立 child Agent/Session/Run;`--json` 输出 terminal snapshot 摘要。
20
- - `best-agent workflow --workflow <steps.json> ...`:按 `{"steps":[{"prompt":"... {{previous}}"}]}` 顺序运行,每步均是前一步 terminal 后的新 Run。
82
+ 可用 `-Prefix "C:\absolute\install prefix"` 自定义目录;把安装目录的 `bin` 加入 PATH 后可使用 `best-agent` 和 `b8`。
83
+ 归档已包含运行时、CPU supervisor 与所需依赖,解压目录可以在安装后删除。由用户配置启动的外部工具(例如依赖 `npx` 的 MCP server)仍需各自的运行环境。
21
84
 
22
- `server`、`daemon`、`serve`、`acp` 尚未完成 v3 product composition,会明确失败;CLI 不调用旧
23
- Server、SDK、Engine 或 native bridge。
85
+ - `npm install -g @best-agent/cli@beta`:安装当前平台的 CLI 包;
86
+ - `pnpm pack:tui`:构建当前平台 npm 包和独立归档,执行安装与启动验收;
87
+ - `pnpm distribute:cli`:从干净的源码 commit 推送六平台 CI 请求,全部验收通过后分发 GitHub Release,不发布 npm;
88
+ - `pnpm release:cli --artifact-root .tmp/sea --tag beta --dry-run`:验证发布产物。
24
89
 
25
- ## Composition 输入
90
+ 只打包当前机器的平台,不发布:
91
+
92
+ ```sh
93
+ pnpm install --frozen-lockfile
94
+ pnpm pack:tui
95
+ ```
96
+
97
+ 六平台公开分发使用 [best-agent-releases](https://github.com/Simon-He95/best-agent-releases)。先提交源码改动,再运行 `pnpm distribute:cli`:命令会推送当前私有源码 commit,仅将公开构建模板和 commit/version 请求同步到分发仓库并触发 CI。CI 使用源码仓库的只读 deploy key;源码仓库保持 private。
98
+
99
+ 全部六平台的免 Node/不可用旧 Node 安装和真实 PTY/ConPTY 交互、原生依赖及 CPU supervisor 检查通过后,Release 提供六份独立归档、六份平台 npm tarball 和一份完整入口 npm tarball,以及校验值和验收摘要。失败时保留未发布草稿,原始诊断及内部构建报告只以加密形式传输;最终 Release 不携带它们。该命令不发布 npm registry。公开分发的 SEA 仍包含可被分析的程序代码,不提供不可逆向的保证。
100
+
101
+ 在 Apple Silicon Mac 上,产物为:
26
102
 
27
103
  ```text
28
- --provider <openai|anthropic|google>
29
- --model <id>
30
- --base-url <http(s)-url>
31
- --compatibility <native|compatible>
32
- --system-prompt <text>
33
- --instruction-file <absolute-path> # 可重复,顺序显式
34
- --skill coding
35
- --workspace <absolute-path>
36
- --memory-dir <absolute-path> # Application-owned bounded JSON memory store
37
- --compact-dir <absolute-path> # Rolling compact 与两槽 Session epoch artifact
38
- --compact-debug-dir <absolute-path> # Metadata-only compact rotation evidence (no raw transcript)
39
- --workspace-grant <read|write|exec> # 可重复
40
- --exec-alias <alias>=<absolute-executable> # 可重复
104
+ .tmp/npm/best-agent-cli-<version>.tgz
105
+ .tmp/npm/best-agent-cli-darwin-arm64-<version>.tgz
106
+ .tmp/sea/darwin-arm64/best-agent-<version>-darwin-arm64.tar.gz
107
+ .tmp/sea/darwin-arm64/best-agent-<version>-darwin-arm64.tar.gz.sha256
41
108
  ```
42
109
 
43
- 开启 `--compact-debug-dir` 后,每次 manual/预算触发的 Session rotation 会写一个不含原文的 bounded JSON 记录,包含 source/epoch ref、SHA-256、
44
- 字节数、group 选择/省略 ordinal、budget 与 cache usage。按记录中的 ref 可在 `<compact-dir>/compact/`(未指定时为 storage root 下的
45
- `compact/compact/`)检查 rolling source 与 frozen epoch artifact;该模式不会额外复制原始 terminal Transcript。
110
+ npm 分发需要入口包和匹配的平台包两者;可将两个 `.tgz` 一并交给对方,通过 `npm install -g <platform.tgz> <cli.tgz>` 安装,运行依赖仍由 npm 获取。免 Node 的独立分发使用 `.tar.gz`/`.zip`。Intel Mac 在 x64 Mac/runner 上运行同一命令,产物 target 为 `darwin-x64`;不能把 arm64 包重命名为 x64 包。
111
+
112
+ 已有单平台产物时,只做发布预检(不发布):
46
113
 
47
- argv、environment、文件和 backend 配置在 C0 只是 candidate;CLI 在 C1 验证并构造 private
48
- provider/sandbox,在 C2 显式选择 contributions 与 policy,Composer 在 C3 freeze Plan,CLI 在 C4
49
- 创建 immutable Session admission。运行后只有 AgentKernel 可以写 Harness-local facts。
114
+ ```sh
115
+ pnpm release:cli --artifact-root .tmp/sea --targets darwin-arm64 --allow-partial --tag beta --dry-run
116
+ ```
50
117
 
51
- Workspace grant 只能来自显式 CLI composition。Skill、prompt、Tool input、model output 和 sandbox 都不能
52
- 增加 grant;sandbox 只可进一步收窄 Kernel 已授权的 exact Tool call。
118
+ 其余平台在对应 OS/CPU 环境运行同一条 `pnpm pack:tui`,再收集 `.tmp/sea/<target>/`。构建机需要 `.nvmrc` 中的 Node、pnpm、原生 C 编译器(macOS/Linux 的 clang,Windows 中目标架构与 Node 一致的 Developer PowerShell / MSVC `cl`);POSIX 验收还需要 Python 3 和 pip。Linux 验收环境使用 Ubuntu 24.04;按需安装的 OCR 原生库要求 glibc ≥2.38,不能把 Debian 12 上的 OCR 失败当成 Node 启动失败。
53
119
 
54
- ## 不拥有
120
+ Linux 构建还需要 binutils 的 `strip`:仅在注入 SEA 前去除 SDK 原生调试信息,保留函数符号;不要对已注入的产物再次执行 strip。
55
121
 
56
- - Kernel transition、Runtime facts 或 current-Run next-action authority;
57
- - Provider、Tool 或 sandbox 返回值的外部事实;
58
- - retry、resume、suspended Run、recovery 或 compact lifecycle;
59
- - Server、SDK、Channel 或外部资源恢复。
122
+ Windows 打包验收会在 `.tmp/standalone-pty-runner` 安装固定版本的 ConPTY 驱动及终端屏幕解析器,POSIX 屏幕解析器放在 `.tmp/standalone-python`;它们都不进入 npm 包或独立归档。最终独立归档的安装和启动不要求用户安装 Node、Python 或编译器。
60
123
 
61
- 最终状态只来自 direct `ApplicationHost.snapshot`;event 仅用于 bounded preview/early read。
124
+ 本地开发使用仓库根目录的 `pnpm build`、`pnpm test:cli` 与相关 capability 测试。
package/bin/best-agent CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bin/best-agent
3
- size: 142609600 bytes
4
- sha256: 0d7b330c116ce72197b8155ab560edd285c3d2ef38ec39ca534bf60135344444
3
+ size: 135727872 bytes
4
+ sha256: 442c61824b1c034153b79af74f573004e6fadbcb253ce6a44e59921bdc6dcc66
Binary file
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "@best-agent/cli-linux-x64-gnu",
3
- "version": "0.0.2-beta.9",
3
+ "version": "0.0.17-beta.2",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/Simon-He95/best-agent-releases.git"
7
+ },
4
8
  "description": "best-agent CLI native executable for linux-x64-gnu",
5
9
  "os": [
6
10
  "linux"
@@ -12,15 +16,19 @@
12
16
  "glibc"
13
17
  ],
14
18
  "bin": {
15
- "best-agent-linux-x64-gnu": "./bin/best-agent"
19
+ "best-agent-linux-x64-gnu": "./bin/best-agent",
20
+ "best-agent-cpu-supervisor-linux-x64-gnu": "./bin/cpu-supervisor"
16
21
  },
17
22
  "files": [
18
23
  "bin/best-agent",
24
+ "bin/cpu-supervisor",
19
25
  "README.md",
20
26
  "LICENSE"
21
27
  ],
22
28
  "dependencies": {
23
- "@arcships/light-ocr": "0.5.7",
24
- "node-notifier": "10.0.1"
29
+ "@modelcontextprotocol/sdk": "1.28.0",
30
+ "@resvg/resvg-js": "2.6.2",
31
+ "katex": "0.16.47",
32
+ "mathjax-full": "3.2.2"
25
33
  }
26
34
  }